|
|
|
|
var SVG=function(){"use strict";const t={},e=[];function n(e,i){if(Array.isArray(e))for(const t of e)n(t,i);else if("object"!=typeof e)r(Object.getOwnPropertyNames(i)),t[e]=Object.assign(t[e]||{},i);else for(const t in e)n(t,e[t])}function i(e){return t[e]||{}}function r(t){e.push(...t)}function s(t,e){let n;const i=t.length,r=[];for(n=0;n<i;n++)r.push(e(t[n]));return r}function o(t,e){let n;const i=t.length,r=[];for(n=0;n<i;n++)e(t[n])&&r.push(t[n]);return r}function h(t){return t%360*Math.PI/180}function u(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function a(t){return t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,n,i){return null!=e&&null!=n||(i=i||t.bbox(),null==e?e=i.width/i.height*n:null==n&&(n=i.height/i.width*e)),{width:e,height:n}}function f(t,e){const n=t.origin;let i=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",r=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([i,r]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof i,o="string"==typeof r;if(s||o){const{height:t,width:n,x:h,y:u}=e.bbox();s&&(i=i.includes("left")?h:i.includes("right")?h+n:h+n/2),o&&(r=r.includes("top")?u:r.includes("bottom")?u+t:u+t/2)}return[i,r]}var d={__proto__:null,map:s,filter:o,radians:h,degrees:function(t){return 180*t/Math.PI%360},camelCase:u,unCamelCase:a,capitalize:l,proportionalSize:c,getOrigin:f};const m="http://www.w3.org/2000/svg",p="http://www.w3.org/1999/xhtml",y="http://www.w3.org/2000/xmlns/",w="http://www.w3.org/1999/xlink",_="http://svgjs.dev/svgjs";var g={__proto__:null,svg:m,html:p,xmlns:y,xlink:w,svgjs:_};const x={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};function b(t=null,e=null){x.window=t,x.document=e}const v={};function M(){v.window=x.window,v.document=x.document}function O(){x.window=v.window,x.document=v.document}class k{}const C={},T="___SYMBOL___ROOT___";function N(t,e=m){return x.document.createElementNS(e,t)}function S(t,e=!1){if(t instanceof k)return t;if("object"==typeof t)return D(t);if(null==t)return new C[T];if("string"==typeof t&&"<"!==t.charAt(0))return D(x.document.querySelector(t));const n=e?x.document.createElement("div"):N("svg");return n.innerHTML=t,t=D(n.firstChild),n.removeChild(n.firstChild),t}function E(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:N(t)}function j(t){if(!t)return null;if(t.instance instanceof k)return t.instance;if("#document-fragment"===t.nodeName)return new C.Fragment(t);let e=l(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":C[e]||(e="Dom"),new C[e](t)}let D=j;function I(t,e=t.name,n=!1){return C[e]=t,n&&(C[T]=t),r(Object.getOwnPropertyNames(t.prototype)),t}function z(t){return C[t]}let R=1e3;function L(t){return"Svgjs"+l(t)+R++}function P(t){for(let e=t.children.length-1;e>=0;e--)P(t.children[e]);return t.id?(t.id=L(t.nodeName),t):t}function F(t,e){let n,i;for(i=(t=Array.isArray(t)?t:[t]).length-1;i>=0;i--)for(n in e)t[i].prototype[n]=e[n]}function q(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}n("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=S(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=S(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=S(t)).befo
|