@camstack/addon-admin-ui 0.1.36 → 0.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-CeLhKMin.js → __mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-Cv6qLu_-.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-DXPQtD9p.js → __mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-CChEG9e0.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-OcRSBqRe.js → __mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-C1BmHlGM.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-GvBGLFI2.js → __mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-Bxv_3KWz.js} +1 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__konva__loadShare__.mjs-g85Oidc0.js +15 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__konva__loadShare__.mjs_commonjs-proxy-Bqeq2Zwj.js +1 -0
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-Dl4u0xYE.js → __mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-DC63qZbr.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-CSyOECfO.js → __mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-D2C49VyZ.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-CzO_Esxm.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-D3WbXy3O.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-xw6c6JeS.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-Csg6EbPB.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-DNpf5SLz.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-CUc0oFNo.js} +2 -2
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-BEKtiDI3.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-vh0hhA5d.js} +1 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs-CpGtTxci.js +35 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs_commonjs-proxy-RUDPE9aM.js +1 -0
- package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-Cjyt3AKP.js +1 -0
- package/dist/assets/{devices-D4k34mru.js → devices-GLp7me2a.js} +1 -1
- package/dist/assets/hostInit-Cx72YpvD.js +1 -0
- package/dist/assets/index-ByRJWRUP.js +1 -0
- package/dist/assets/index-COoei6lw.css +1 -0
- package/dist/assets/index-CtHpLu0L.js +1 -0
- package/dist/assets/{index-D92THlot.js → index-CwF7Dxf8.js} +1 -1
- package/dist/assets/{index-BI3Z7SSi.js → index-D6khiudP.js} +1 -1
- package/dist/assets/index-DNY_otk4.js +151 -0
- package/dist/assets/index-DQFO9ZU6.js +1 -0
- package/dist/assets/index-G9qsQFtk.js +1150 -0
- package/dist/assets/{index-BGZqVJZt.js → index-JJ5NLHxC.js} +1 -1
- package/dist/assets/{index-Bwcmc2hW.js → index-TiJwCuZx.js} +1 -1
- package/dist/assets/index-WrAHDGEr.js +87 -0
- package/dist/assets/index-b0D9qthW.js +1 -0
- package/dist/assets/method-access-map-DLEhlu0x.js +1 -0
- package/dist/assets/{remoteEntry-BRybuw2S.js → remoteEntry-CbhqJYoN.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DUkp33c_.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-I5siGnQL.js} +6 -6
- package/dist/index.html +6 -6
- package/dist/mf-entry-bootstrap-0.js +2 -2
- package/dist/server/addon.js +528 -96
- package/dist/server/addon.js.map +1 -1
- package/dist/sw.js +1 -1
- package/package.json +10 -2
- package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DYU-qDnu.js +0 -1
- package/dist/assets/hostInit-CBKchP1G.js +0 -1
- package/dist/assets/index-BEewR-UX.js +0 -1
- package/dist/assets/index-BRSAFSOw.css +0 -1
- package/dist/assets/index-BqMPfvQx.js +0 -1
- package/dist/assets/index-CP1R6E2R.js +0 -88
- package/dist/assets/index-CwjnPcOV.js +0 -152
- package/dist/assets/index-Dmon2mdO.js +0 -1
- package/dist/assets/index-KlKJOjpC.js +0 -1
- package/dist/assets/index-SyrojlmO.js +0 -1156
- package/dist/assets/method-access-map-BFPyQ2-G.js +0 -1
package/dist/assets/__mfe_internal__admin_ui_host__loadShare__konva__loadShare__.mjs-g85Oidc0.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function zi(r,t){for(var e=0;e<t.length;e++){const i=t[e];if(typeof i!="string"&&!Array.isArray(i)){for(const n in i)if(n!=="default"&&!(n in r)){const s=Object.getOwnPropertyDescriptor(i,n);s&&Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>i[n]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const Yi=Math.PI/180;function Xi(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const St=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},k={_global:St,version:"10.3.0",isBrowser:Xi(),isUnminified:/param/.test(function(r){}.toString()),dblClickWindow:400,getAngle(r){return k.angleDeg?r*Yi:r},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return k.DD.isDragging},isTransforming(){var r,t;return(t=(r=k.Transformer)===null||r===void 0?void 0:r.isTransforming())!==null&&t!==void 0?t:!1},isDragReady(){return!!k.DD.node},releaseCanvasOnDestroy:!0,document:St.document,_injectGlobal(r){typeof St.Konva<"u"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),St.Konva=r}},K=r=>{k[r.prototype.getClassName()]=r};k._injectGlobal(k);const Ui=`Konva.js unsupported environment.
|
|
2
|
+
|
|
3
|
+
Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
|
|
4
|
+
|
|
5
|
+
To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
|
|
6
|
+
|
|
7
|
+
bash: npm install canvas
|
|
8
|
+
js: import "konva/canvas-backend";
|
|
9
|
+
|
|
10
|
+
or
|
|
11
|
+
|
|
12
|
+
bash: npm install skia-canvas
|
|
13
|
+
js: import "konva/skia-backend";
|
|
14
|
+
`,De=()=>{if(typeof document>"u")throw new Error(Ui)};class tt{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new tt(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){const e=this.m;return{x:e[0]*t.x+e[2]*t.y+e[4],y:e[1]*t.x+e[3]*t.y+e[5]}}translate(t,e){return this.m[4]+=this.m[0]*t+this.m[2]*e,this.m[5]+=this.m[1]*t+this.m[3]*e,this}scale(t,e){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=e,this.m[3]*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.m[0]*e+this.m[2]*i,s=this.m[1]*e+this.m[3]*i,a=this.m[0]*-i+this.m[2]*e,o=this.m[1]*-i+this.m[3]*e;return this.m[0]=n,this.m[1]=s,this.m[2]=a,this.m[3]=o,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,e){const i=this.m[0]+this.m[2]*e,n=this.m[1]+this.m[3]*e,s=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=i,this.m[1]=n,this.m[2]=s,this.m[3]=a,this}multiply(t){const e=this.m[0]*t.m[0]+this.m[2]*t.m[1],i=this.m[1]*t.m[0]+this.m[3]*t.m[1],n=this.m[0]*t.m[2]+this.m[2]*t.m[3],s=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],o=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=e,this.m[1]=i,this.m[2]=n,this.m[3]=s,this.m[4]=a,this.m[5]=o,this}invert(){const t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),e=this.m[3]*t,i=-this.m[1]*t,n=-this.m[2]*t,s=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),o=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=e,this.m[1]=i,this.m[2]=n,this.m[3]=s,this.m[4]=a,this.m[5]=o,this}getMatrix(){return this.m}decompose(){const t=this.m[0],e=this.m[1],i=this.m[2],n=this.m[3],s=this.m[4],a=this.m[5],o=t*n-e*i,h={x:s,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||e!=0){const l=Math.sqrt(t*t+e*e);h.rotation=e>0?Math.acos(t/l):-Math.acos(t/l),h.scaleX=l,h.scaleY=o/l,h.skewX=(t*i+e*n)/o,h.skewY=0}else if(i!=0||n!=0){const l=Math.sqrt(i*i+n*n);h.rotation=Math.PI/2-(n>0?Math.acos(-i/l):-Math.acos(i/l)),h.scaleX=o/l,h.scaleY=l,h.skewX=0,h.skewY=(t*i+e*n)/o}return h.rotation=m._getRotation(h.rotation),h}}const Vi="[object Array]",qi="[object Number]",ji="[object String]",Ki="[object Boolean]",$i=Math.PI/180,Qi=180/Math.PI,Rt="#",Ji="",Zi="0",tn="Konva warning: ",Fe="Konva error: ",en="rgb(",de={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},nn=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let jt=[],Mt=null;const sn=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(r){setTimeout(r,16)},m={_isElement(r){return!!(r&&r.nodeType==1)},_isFunction(r){return!!(r&&r.constructor&&r.call&&r.apply)},_isPlainObject(r){return!!r&&r.constructor===Object},_isArray(r){return Object.prototype.toString.call(r)===Vi},_isNumber(r){return Object.prototype.toString.call(r)===qi&&!isNaN(r)&&isFinite(r)},_isString(r){return Object.prototype.toString.call(r)===ji},_isBoolean(r){return Object.prototype.toString.call(r)===Ki},isObject(r){return r instanceof Object},isValidSelector(r){if(typeof r!="string")return!1;const t=r[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(r){return r===0||r>0?1:-1},requestAnimFrame(r){jt.push(r),jt.length===1&&sn(function(){const t=jt;jt=[],t.forEach(function(e){e()})})},createCanvasElement(){De();const r=document.createElement("canvas");try{r.style=r.style||{}}catch{}return r},createImageElement(){return De(),document.createElement("img")},_isInDocument(r){for(;r=r.parentNode;)if(r==document)return!0;return!1},_urlToImage(r,t){const e=m.createImageElement();e.onload=function(){t(e)},e.src=r},_rgbToHex(r,t,e){return((1<<24)+(r<<16)+(t<<8)+e).toString(16).slice(1)},_hexToRgb(r){r=r.replace(Rt,Ji);const t=parseInt(r,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){let r=(Math.random()*16777215<<0).toString(16);for(;r.length<6;)r=Zi+r;return Rt+r},isCanvasFarblingActive(){if(Mt!==null)return Mt;if(typeof document>"u")return Mt=!1,!1;const r=this.createCanvasElement();r.width=10,r.height=10;const t=r.getContext("2d",{willReadFrequently:!0});t.clearRect(0,0,10,10),t.fillStyle="#282828",t.fillRect(0,0,10,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let n=0;n<100;n++)if(e[n*4]!==40||e[n*4+1]!==40||e[n*4+2]!==40||e[n*4+3]!==255){i=!0;break}return Mt=i,this.releaseCanvas(r),Mt},getHitColor(){const r=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(r):r},getHitColorKey(r,t,e){return this.isCanvasFarblingActive()&&(r=Math.round(r/5)*5,t=Math.round(t/5)*5,e=Math.round(e/5)*5),Rt+this._rgbToHex(r,t,e)},getSnappedHexColor(r){const t=this._hexToRgb(r);return Rt+this._rgbToHex(Math.round(t.r/5)*5,Math.round(t.g/5)*5,Math.round(t.b/5)*5)},getRGB(r){let t;return r in de?(t=de[r],{r:t[0],g:t[1],b:t[2]}):r[0]===Rt?this._hexToRgb(r.substring(1)):r.substr(0,4)===en?(t=nn.exec(r.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(r){return r=r||"black",m._namedColorToRBA(r)||m._hex3ColorToRGBA(r)||m._hex4ColorToRGBA(r)||m._hex6ColorToRGBA(r)||m._hex8ColorToRGBA(r)||m._rgbColorToRGBA(r)||m._rgbaColorToRGBA(r)||m._hslColorToRGBA(r)},_namedColorToRBA(r){const t=de[r.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(r){if(r.indexOf("rgb(")===0){r=r.match(/rgb\(([^)]+)\)/)[1];const t=r.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(r){if(r.indexOf("rgba(")===0){r=r.match(/rgba\(([^)]+)\)/)[1];const t=r.split(/ *, */).map((e,i)=>e.slice(-1)==="%"?i===3?parseInt(e)/100:parseInt(e)/100*255:Number(e));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(r){if(r[0]==="#"&&r.length===9)return{r:parseInt(r.slice(1,3),16),g:parseInt(r.slice(3,5),16),b:parseInt(r.slice(5,7),16),a:parseInt(r.slice(7,9),16)/255}},_hex6ColorToRGBA(r){if(r[0]==="#"&&r.length===7)return{r:parseInt(r.slice(1,3),16),g:parseInt(r.slice(3,5),16),b:parseInt(r.slice(5,7),16),a:1}},_hex4ColorToRGBA(r){if(r[0]==="#"&&r.length===5)return{r:parseInt(r[1]+r[1],16),g:parseInt(r[2]+r[2],16),b:parseInt(r[3]+r[3],16),a:parseInt(r[4]+r[4],16)/255}},_hex3ColorToRGBA(r){if(r[0]==="#"&&r.length===4)return{r:parseInt(r[1]+r[1],16),g:parseInt(r[2]+r[2],16),b:parseInt(r[3]+r[3],16),a:1}},_hslColorToRGBA(r){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(r)){const[t,...e]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(r),i=Number(e[0])/360,n=Number(e[1])/100,s=Number(e[2])/100;let a,o,h;if(n===0)return h=s*255,{r:Math.round(h),g:Math.round(h),b:Math.round(h),a:1};s<.5?a=s*(1+n):a=s+n-s*n;const l=2*s-a,c=[0,0,0];for(let f=0;f<3;f++)o=i+1/3*-(f-1),o<0&&o++,o>1&&o--,6*o<1?h=l+(a-l)*6*o:2*o<1?h=a:3*o<2?h=l+(a-l)*(2/3-o)*6:h=l,c[f]=h*255;return{r:Math.round(c[0]),g:Math.round(c[1]),b:Math.round(c[2]),a:1}}},haveIntersection(r,t){return!(t.x>r.x+r.width||t.x+t.width<r.x||t.y>r.y+r.height||t.y+t.height<r.y)},cloneObject(r){const t={};for(const e in r)this._isPlainObject(r[e])?t[e]=this.cloneObject(r[e]):this._isArray(r[e])?t[e]=this.cloneArray(r[e]):t[e]=r[e];return t},cloneArray(r){return r.slice(0)},degToRad(r){return r*$i},radToDeg(r){return r*Qi},_degToRad(r){return m.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),m.degToRad(r)},_radToDeg(r){return m.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),m.radToDeg(r)},_getRotation(r){return k.angleDeg?m.radToDeg(r):r},_capitalize(r){return r.charAt(0).toUpperCase()+r.slice(1)},throw(r){throw new Error(Fe+r)},error(r){console.error(Fe+r)},warn(r){k.showWarnings&&console.warn(tn+r)},each(r,t){for(const e in r)t(e,r[e])},_inRange(r,t,e){return t<=r&&r<e},_getProjectionToSegment(r,t,e,i,n,s){let a,o,h;const l=(r-e)*(r-e)+(t-i)*(t-i);if(l==0)a=r,o=t,h=(n-e)*(n-e)+(s-i)*(s-i);else{const c=((n-r)*(e-r)+(s-t)*(i-t))/l;c<0?(a=r,o=t,h=(r-n)*(r-n)+(t-s)*(t-s)):c>1?(a=e,o=i,h=(e-n)*(e-n)+(i-s)*(i-s)):(a=r+c*(e-r),o=t+c*(i-t),h=(a-n)*(a-n)+(o-s)*(o-s))}return[a,o,h]},_getProjectionToLine(r,t,e){const i=m.cloneObject(r);let n=Number.MAX_VALUE;return t.forEach(function(s,a){if(!e&&a===t.length-1)return;const o=t[(a+1)%t.length],h=m._getProjectionToSegment(s.x,s.y,o.x,o.y,r.x,r.y),l=h[0],c=h[1],f=h[2];f<n&&(i.x=l,i.y=c,n=f)}),i},_prepareArrayForTween(r,t,e){const i=[],n=[];if(r.length>t.length){const a=t;t=r,r=a}for(let a=0;a<r.length;a+=2)i.push({x:r[a],y:r[a+1]});for(let a=0;a<t.length;a+=2)n.push({x:t[a],y:t[a+1]});const s=[];return n.forEach(function(a){const o=m._getProjectionToLine(a,i,e);s.push(o.x),s.push(o.y)}),s},_prepareToStringify(r){let t;r.visitedByCircularReferenceRemoval=!0;for(const e in r)if(r.hasOwnProperty(e)&&r[e]&&typeof r[e]=="object"){if(t=Object.getOwnPropertyDescriptor(r,e),r[e].visitedByCircularReferenceRemoval||m._isElement(r[e]))if(t.configurable)delete r[e];else return null;else if(m._prepareToStringify(r[e])===null)if(t.configurable)delete r[e];else return null}return delete r.visitedByCircularReferenceRemoval,r},_assign(r,t){for(const e in t)r[e]=t[e];return r},_getFirstPointerId(r){return r.touches?r.changedTouches[0].identifier:r.pointerId||999},releaseCanvas(...r){k.releaseCanvasOnDestroy&&r.forEach(t=>{t.width=0,t.height=0})},drawRoundedRectPath(r,t,e,i){let n=t<0?t:0,s=e<0?e:0;t=Math.abs(t),e=Math.abs(e);let a=0,o=0,h=0,l=0;typeof i=="number"?a=o=h=l=Math.min(i,t/2,e/2):(a=Math.min(i[0]||0,t/2,e/2),o=Math.min(i[1]||0,t/2,e/2),l=Math.min(i[2]||0,t/2,e/2),h=Math.min(i[3]||0,t/2,e/2)),r.moveTo(n+a,s),r.lineTo(n+t-o,s),r.arc(n+t-o,s+o,o,Math.PI*3/2,0,!1),r.lineTo(n+t,s+e-l),r.arc(n+t-l,s+e-l,l,0,Math.PI/2,!1),r.lineTo(n+h,s+e),r.arc(n+h,s+e-h,h,Math.PI/2,Math.PI,!1),r.lineTo(n,s+a),r.arc(n+a,s+a,a,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(r,t,e,i,n){i=Math.abs(i);for(let s=0;s<e;s++){const a=t[(s-1+e)%e],o=t[s],h=t[(s+1)%e],l={x:o.x-a.x,y:o.y-a.y},c={x:h.x-o.x,y:h.y-o.y},f=Math.hypot(l.x,l.y),d=Math.hypot(c.x,c.y);let p;typeof n=="number"?p=n:p=s<n.length?n[s]:0,p=i*Math.cos(Math.PI/e)*Math.min(1,p/i*2);const b={x:l.x/f,y:l.y/f},S={x:c.x/d,y:c.y/d},y={x:o.x-b.x*p,y:o.y-b.y*p},_={x:o.x+S.x*p,y:o.y+S.y*p};s===0?r.moveTo(y.x,y.y):r.lineTo(y.x,y.y),r.arcTo(o.x,o.y,_.x,_.y,p)}}};function rn(r){const t=[],e=r.length,i=m;for(let n=0;n<e;n++){let s=r[n];i._isNumber(s)?s=Math.round(s*1e3)/1e3:i._isString(s)||(s=s+""),t.push(s)}return t}const Ne=",",an="(",on=")",hn="([",ln="])",cn=";",dn="()",fn="=",Be=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],un=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],gn=100;let Kt=null;function He(){if(Kt!==null)return Kt;try{const t=m.createCanvasElement().getContext("2d");return t?!!t&&"filter"in t:(Kt=!1,!1)}catch{return Kt=!1,!1}}class oe{constructor(t){this.canvas=t,k.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,e){let i=this.traceArr,n=i.length,s="",a,o,h,l;for(a=0;a<n;a++)o=i[a],h=o.method,h?(l=o.args,s+=h,t?s+=dn:m._isArray(l[0])?s+=hn+l.join(Ne)+ln:(e&&(l=l.map(c=>typeof c=="number"?Math.floor(c):c)),s+=an+l.join(Ne)+on)):(s+=o.property,t||(s+=fn+o.val)),s+=cn;return s}clearTrace(){this.traceArr=[]}_trace(t){let e=this.traceArr,i;e.push(t),i=e.length,i>=gn&&e.shift()}reset(){const t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){const e=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,e.getWidth()/e.pixelRatio,e.getHeight()/e.pixelRatio)}_applyLineCap(t){const e=t.attrs.lineCap;e&&this.setAttr("lineCap",e)}_applyOpacity(t){const e=t.getAbsoluteOpacity();e!==1&&this.setAttr("globalAlpha",e)}_applyLineJoin(t){const e=t.attrs.lineJoin;e&&this.setAttr("lineJoin",e)}_applyMiterLimit(t){const e=t.attrs.miterLimit;e!=null&&this.setAttr("miterLimit",e)}setAttr(t,e){this._context[t]=e}arc(t,e,i,n,s,a){this._context.arc(t,e,i,n,s,a)}arcTo(t,e,i,n,s){this._context.arcTo(t,e,i,n,s)}beginPath(){this._context.beginPath()}bezierCurveTo(t,e,i,n,s,a){this._context.bezierCurveTo(t,e,i,n,s,a)}clearRect(t,e,i,n){this._context.clearRect(t,e,i,n)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,e){const i=arguments;if(i.length===2)return this._context.createImageData(t,e);if(i.length===1)return this._context.createImageData(t)}createLinearGradient(t,e,i,n){return this._context.createLinearGradient(t,e,i,n)}createPattern(t,e){return this._context.createPattern(t,e)}createRadialGradient(t,e,i,n,s,a){return this._context.createRadialGradient(t,e,i,n,s,a)}drawImage(t,e,i,n,s,a,o,h,l){const c=arguments,f=this._context;c.length===3?f.drawImage(t,e,i):c.length===5?f.drawImage(t,e,i,n,s):c.length===9&&f.drawImage(t,e,i,n,s,a,o,h,l)}ellipse(t,e,i,n,s,a,o,h){this._context.ellipse(t,e,i,n,s,a,o,h)}isPointInPath(t,e,i,n){return i?this._context.isPointInPath(i,t,e,n):this._context.isPointInPath(t,e,n)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,e,i,n){this._context.fillRect(t,e,i,n)}strokeRect(t,e,i,n){this._context.strokeRect(t,e,i,n)}fillText(t,e,i,n){n?this._context.fillText(t,e,i,n):this._context.fillText(t,e,i)}measureText(t){return this._context.measureText(t)}getImageData(t,e,i,n){return this._context.getImageData(t,e,i,n)}lineTo(t,e){this._context.lineTo(t,e)}moveTo(t,e){this._context.moveTo(t,e)}rect(t,e,i,n){this._context.rect(t,e,i,n)}roundRect(t,e,i,n,s){this._context.roundRect(t,e,i,n,s)}putImageData(t,e,i){this._context.putImageData(t,e,i)}quadraticCurveTo(t,e,i,n){this._context.quadraticCurveTo(t,e,i,n)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,e){this._context.scale(t,e)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,e,i,n,s,a){this._context.setTransform(t,e,i,n,s,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,e,i,n){this._context.strokeText(t,e,i,n)}transform(t,e,i,n,s,a){this._context.transform(t,e,i,n,s,a)}translate(t,e){this._context.translate(t,e)}_enableTrace(){let t=this,e=Be.length,i=this.setAttr,n,s;const a=function(o){let h=t[o],l;t[o]=function(){return s=rn(Array.prototype.slice.call(arguments,0)),l=h.apply(t,arguments),t._trace({method:o,args:s}),l}};for(n=0;n<e;n++)a(Be[n]);t.setAttr=function(){i.apply(t,arguments);const o=arguments[0];let h=arguments[1];(o==="shadowOffsetX"||o==="shadowOffsetY"||o==="shadowBlur")&&(h=h/this.canvas.getPixelRatio()),t._trace({property:o,val:h})}}_applyGlobalCompositeOperation(t){const e=t.attrs.globalCompositeOperation;!e||e==="source-over"||this.setAttr("globalCompositeOperation",e)}}un.forEach(function(r){Object.defineProperty(oe.prototype,r,{get(){return this._context[r]},set(t){this._context[r]=t}})});class pn extends oe{constructor(t,{willReadFrequently:e=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:e})}_fillColor(t){const e=t.fill();this.setAttr("fillStyle",e),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){const e=t._getLinearGradient();e&&(this.setAttr("fillStyle",e),t._fillFunc(this))}_fillRadialGradient(t){const e=t._getRadialGradient();e&&(this.setAttr("fillStyle",e),t._fillFunc(this))}_fill(t){const e=t.fill(),i=t.getFillPriority();if(e&&i==="color"){this._fillColor(t);return}const n=t.getFillPatternImage();if(n&&i==="pattern"){this._fillPattern(t);return}const s=t.getFillLinearGradientColorStops();if(s&&i==="linear-gradient"){this._fillLinearGradient(t);return}const a=t.getFillRadialGradientColorStops();if(a&&i==="radial-gradient"){this._fillRadialGradient(t);return}e?this._fillColor(t):n?this._fillPattern(t):s?this._fillLinearGradient(t):a&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const e=t.getStrokeLinearGradientStartPoint(),i=t.getStrokeLinearGradientEndPoint(),n=t.getStrokeLinearGradientColorStops(),s=this.createLinearGradient(e.x,e.y,i.x,i.y);if(n){for(let a=0;a<n.length;a+=2)s.addColorStop(n[a],n[a+1]);this.setAttr("strokeStyle",s)}}_stroke(t){const e=t.dash(),i=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!i){this.save();const s=this.getCanvas().getPixelRatio();this.setTransform(s,0,0,s,0,0)}this._applyLineCap(t),e&&t.dashEnabled()&&(this.setLineDash(e),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),t.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),i||this.restore()}}_applyShadow(t){var e,i,n;const s=(e=t.getShadowRGBA())!==null&&e!==void 0?e:"black",a=(i=t.getShadowBlur())!==null&&i!==void 0?i:5,o=(n=t.getShadowOffset())!==null&&n!==void 0?n:{x:0,y:0},h=t.getAbsoluteScale(),l=this.canvas.getPixelRatio(),c=h.x*l,f=h.y*l;this.setAttr("shadowColor",s),this.setAttr("shadowBlur",a*Math.min(Math.abs(c),Math.abs(f))),this.setAttr("shadowOffsetX",o.x*c),this.setAttr("shadowOffsetY",o.y*f)}}class mn extends oe{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const e=t.getStrokeScaleEnabled();if(!e){this.save();const s=this.getCanvas().getPixelRatio();this.setTransform(s,0,0,s,0,0)}this._applyLineCap(t);const i=t.hitStrokeWidth(),n=i==="auto"?t.strokeWidth():i;this.setAttr("lineWidth",n),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),e||this.restore()}}}let $t;function _n(){if($t)return $t;const r=m.createCanvasElement(),t=r.getContext("2d");return $t=(function(){const e=k._global.devicePixelRatio||1,i=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return e/i})(),m.releaseCanvas(r),$t}class Re{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const i=(t||{}).pixelRatio||k.pixelRatio||_n();this.pixelRatio=i,this._canvas=m.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){const e=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/e,this.getHeight()/e)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";const e=this.pixelRatio;this.getContext()._context.scale(e,e)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";const e=this.pixelRatio;this.getContext()._context.scale(e,e)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,e){this.setWidth(t||0),this.setHeight(e||0)}toDataURL(t,e){try{return this._canvas.toDataURL(t,e)}catch{try{return this._canvas.toDataURL()}catch(n){return m.error("Unable to get data URL. "+n.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class ft extends Re{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new pn(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}class Me extends Re{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new mn(this),this.setSize(t.width,t.height)}}const B={get isDragging(){let r=!1;return B._dragElements.forEach(t=>{t.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){let r;return B._dragElements.forEach(t=>{r=t.node}),r},_dragElements:new Map,_drag(r){const t=[];B._dragElements.forEach((e,i)=>{const{node:n}=e,s=n.getStage();s.setPointersPositions(r),e.pointerId===void 0&&(e.pointerId=m._getFirstPointerId(r));const a=s._changedPointerPositions.find(o=>o.id===e.pointerId);if(a){if(e.dragStatus!=="dragging"){const o=n.dragDistance();if(Math.max(Math.abs(a.x-e.startPointerPos.x),Math.abs(a.y-e.startPointerPos.y))<o||(n.startDrag({evt:r}),!n.isDragging()))return}n._setDragPosition(r,e),t.push(n)}}),t.forEach(e=>{e.getStage()&&e.fire("dragmove",{type:"dragmove",target:e,evt:r},!0)})},_endDragBefore(r){const t=[];B._dragElements.forEach(e=>{const{node:i}=e,n=i.getStage();if(r&&n.setPointersPositions(r),!n._changedPointerPositions.find(o=>o.id===e.pointerId))return;(e.dragStatus==="dragging"||e.dragStatus==="stopped")&&(B.justDragged=!0,k._mouseListenClick=!1,k._touchListenClick=!1,k._pointerListenClick=!1,e.dragStatus="stopped");const a=e.node.getLayer()||e.node instanceof k.Stage&&e.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(e=>{e.draw()})},_endDragAfter(r){B._dragElements.forEach((t,e)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:r},!0),t.dragStatus!=="dragging"&&B._dragElements.delete(e)})}};k.isBrowser&&(window.addEventListener("mouseup",B._endDragBefore,!0),window.addEventListener("touchend",B._endDragBefore,!0),window.addEventListener("touchcancel",B._endDragBefore,!0),window.addEventListener("mousemove",B._drag),window.addEventListener("touchmove",B._drag),window.addEventListener("mouseup",B._endDragAfter,!1),window.addEventListener("touchend",B._endDragAfter,!1),window.addEventListener("touchcancel",B._endDragAfter,!1));function gt(r){return m._isString(r)?'"'+r+'"':Object.prototype.toString.call(r)==="[object Number]"||m._isBoolean(r)?r:Object.prototype.toString.call(r)}function li(r){return r>255?255:r<0?0:Math.round(r)}function w(){if(k.isUnminified)return function(r,t){return m._isNumber(r)||m.warn(gt(r)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),r}}function he(r){if(k.isUnminified)return function(t,e){let i=m._isNumber(t),n=m._isArray(t)&&t.length==r;return!i&&!n&&m.warn(gt(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or Array<number>('+r+")"),t}}function Ge(){if(k.isUnminified)return function(r,t){return m._isNumber(r)||r==="auto"||m.warn(gt(r)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),r}}function bt(){if(k.isUnminified)return function(r,t){return m._isString(r)||m.warn(gt(r)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),r}}function ci(){if(k.isUnminified)return function(r,t){const e=m._isString(r),i=Object.prototype.toString.call(r)==="[object CanvasGradient]"||r&&r.addColorStop;return e||i||m.warn(gt(r)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),r}}function yn(){if(k.isUnminified)return function(r,t){const e=Int8Array?Object.getPrototypeOf(Int8Array):null;return e&&r instanceof e||(m._isArray(r)?r.forEach(function(i){m._isNumber(i)||m.warn('"'+t+'" attribute has non numeric element '+i+". Make sure that all elements are numbers.")}):m.warn(gt(r)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),r}}function st(){if(k.isUnminified)return function(r,t){return r===!0||r===!1||m.warn(gt(r)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),r}}function Sn(r){if(k.isUnminified)return function(t,e){return t==null||m.isObject(t)||m.warn(gt(t)+' is a not valid value for "'+e+'" attribute. The value should be an object with properties '+r),t}}const Gt="get",Ot="set",u={addGetterSetter(r,t,e,i,n){u.addGetter(r,t,e),u.addSetter(r,t,i,n),u.addOverloadedGetterSetter(r,t)},addGetter(r,t,e){const i=Gt+m._capitalize(t);r.prototype[i]=r.prototype[i]||function(){const n=this.attrs[t];return n===void 0?e:n}},addSetter(r,t,e,i){const n=Ot+m._capitalize(t);r.prototype[n]||u.overWriteSetter(r,t,e,i)},overWriteSetter(r,t,e,i){const n=Ot+m._capitalize(t);r.prototype[n]=function(s){return e&&s!==void 0&&s!==null&&(s=e.call(this,s,t)),this._setAttr(t,s),i&&i.call(this),this}},addComponentsGetterSetter(r,t,e,i,n){const s=e.length,a=m._capitalize,o=Gt+a(t),h=Ot+a(t);r.prototype[o]=function(){const c={};for(let f=0;f<s;f++){const d=e[f];c[d]=this.getAttr(t+a(d))}return c};const l=Sn(e);r.prototype[h]=function(c){const f=this.attrs[t];i&&(c=i.call(this,c,t)),l&&l.call(this,c,t);for(const d in c)c.hasOwnProperty(d)&&this._setAttr(t+a(d),c[d]);return c||e.forEach(d=>{this._setAttr(t+a(d),void 0)}),this._fireChangeEvent(t,f,c),n&&n.call(this),this},u.addOverloadedGetterSetter(r,t)},addOverloadedGetterSetter(r,t){const e=m._capitalize(t),i=Ot+e,n=Gt+e;r.prototype[t]=function(){return arguments.length?(this[i](arguments[0]),this):this[n]()}},addDeprecatedGetterSetter(r,t,e,i){m.error("Adding deprecated "+t);const n=Gt+m._capitalize(t),s=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";r.prototype[n]=function(){m.error(s);const a=this.attrs[t];return a===void 0?e:a},u.addSetter(r,t,i,function(){m.error(s)}),u.addOverloadedGetterSetter(r,t)},backCompat(r,t){m.each(t,function(e,i){const n=r.prototype[i],s=Gt+m._capitalize(e),a=Ot+m._capitalize(e);function o(){n.apply(this,arguments),m.error('"'+e+'" method is deprecated and will be removed soon. Use ""'+i+'" instead.')}r.prototype[e]=o,r.prototype[s]=o,r.prototype[a]=o})},afterSetFilter(){this._filterUpToDate=!1}};function bn(r){const t=/(\w+)\(([^)]+)\)/g;let e;for(;(e=t.exec(r))!==null;){const[,i,n]=e;switch(i){case"blur":{const s=parseFloat(n.replace("px",""));return function(a){this.blurRadius(s*.5);const o=k.Filters;o&&o.Blur&&o.Blur.call(this,a)}}case"brightness":{const s=n.includes("%")?parseFloat(n)/100:parseFloat(n);return function(a){this.brightness(s);const o=k.Filters;o&&o.Brightness&&o.Brightness.call(this,a)}}case"contrast":{const s=parseFloat(n);return function(a){const o=100*(Math.sqrt(s)-1);this.contrast(o);const h=k.Filters;h&&h.Contrast&&h.Contrast.call(this,a)}}case"grayscale":return function(s){const a=k.Filters;a&&a.Grayscale&&a.Grayscale.call(this,s)};case"sepia":return function(s){const a=k.Filters;a&&a.Sepia&&a.Sepia.call(this,s)};case"invert":return function(s){const a=k.Filters;a&&a.Invert&&a.Invert.call(this,s)};default:m.warn(`CSS filter "${i}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const se="absoluteOpacity",We="allEventListeners",at="absoluteTransform",ze="absoluteScale",yt="canvas",vn="Change",Cn="children",xn="konva",Se="listening",wn="mouseenter",Tn="mouseleave",Pn="pointerenter",kn="pointerleave",An="touchenter",En="touchleave",Ye="set",Xe="Shape",re=" ",Ue="stage",ct="transform",Rn="Stage",be="visible",Mn=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(re);let Gn=1;class T{constructor(t){this._id=Gn++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===ct||t===at)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,e){let i=this._cache.get(t);return(i===void 0||(t===ct||t===at)&&i.dirty===!0)&&(i=e.call(this),this._cache.set(t,i)),i}_calculate(t,e,i){if(!this._attachedDepsListeners.get(t)){const n=e.map(s=>s+"Change.konva").join(re);this.on(n,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,i)}_getCanvasCache(){return this._cache.get(yt)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===at&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(yt)){const{scene:t,filter:e,hit:i}=this._cache.get(yt);m.releaseCanvas(t._canvas,e._canvas,i._canvas),this._cache.delete(yt)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){const e=t||{};let i={};(e.x===void 0||e.y===void 0||e.width===void 0||e.height===void 0)&&(i=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let n=Math.ceil(e.width||i.width),s=Math.ceil(e.height||i.height),a=e.pixelRatio,o=e.x===void 0?Math.floor(i.x):e.x,h=e.y===void 0?Math.floor(i.y):e.y,l=e.offset||0,c=e.drawBorder||!1,f=e.hitCanvasPixelRatio||1;if(!n||!s){m.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const d=Math.abs(Math.round(i.x)-o)>.5?1:0,p=Math.abs(Math.round(i.y)-h)>.5?1:0;n+=l*2+d,s+=l*2+p,o-=l,h-=l;const g=new ft({pixelRatio:a,width:n,height:s}),b=new ft({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),S=new Me({pixelRatio:f,width:n,height:s}),y=g.getContext(),_=S.getContext(),C=new ft({width:g.width/g.pixelRatio+Math.abs(o),height:g.height/g.pixelRatio+Math.abs(h),pixelRatio:g.pixelRatio}),v=C.getContext();return S.isCache=!0,g.isCache=!0,this._cache.delete(yt),this._filterUpToDate=!1,e.imageSmoothingEnabled===!1&&(g.getContext()._context.imageSmoothingEnabled=!1,b.getContext()._context.imageSmoothingEnabled=!1),y.save(),_.save(),v.save(),y.translate(-o,-h),_.translate(-o,-h),v.translate(-o,-h),C.x=o,C.y=h,this._isUnderCache=!0,this._clearSelfAndDescendantCache(se),this._clearSelfAndDescendantCache(ze),this.drawScene(g,this,C),this.drawHit(S,this),this._isUnderCache=!1,y.restore(),_.restore(),c&&(y.save(),y.beginPath(),y.rect(0,0,n,s),y.closePath(),y.setAttr("strokeStyle","red"),y.setAttr("lineWidth",5),y.stroke(),y.restore()),m.releaseCanvas(C._canvas),this._cache.set(yt,{scene:g,filter:b,hit:S,x:o,y:h}),this._requestDraw(),this}isCached(){return this._cache.has(yt)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,e){const i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}];let n=1/0,s=1/0,a=-1/0,o=-1/0;const h=this.getAbsoluteTransform(e);return i.forEach(function(l){const c=h.point(l);n===void 0&&(n=a=c.x,s=o=c.y),n=Math.min(n,c.x),s=Math.min(s,c.y),a=Math.max(a,c.x),o=Math.max(o,c.y)}),{x:n,y:s,width:a-n,height:o-s}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const e=this._getCanvasCache();t.translate(e.x,e.y);const i=this._getCachedSceneCanvas(),n=i.pixelRatio;t.drawImage(i._canvas,0,0,i.width/n,i.height/n),t.restore()}_drawCachedHitCanvas(t){const e=this._getCanvasCache(),i=e.hit;t.save(),t.translate(e.x,e.y),t.drawImage(i._canvas,0,0,i.width/i.pixelRatio,i.height/i.pixelRatio),t.restore()}_getCachedSceneCanvas(){let t=this.filters(),e=this._getCanvasCache(),i=e.scene,n=e.filter,s=n.getContext(),a,o,h,l;if(!t||t.length===0)return i;if(this._filterUpToDate)return n;let c=!0;for(let d=0;d<t.length;d++)if(typeof t[d]=="string"&&He(),typeof t[d]!="string"||!He()){c=!1;break}const f=i.pixelRatio;if(n.setSize(i.width/i.pixelRatio,i.height/i.pixelRatio),c){const d=t.join(" ");return s.save(),s.setAttr("filter",d),s.drawImage(i._canvas,0,0,i.getWidth()/f,i.getHeight()/f),s.restore(),this._filterUpToDate=!0,n}try{for(a=t.length,s.clear(),s.drawImage(i._canvas,0,0,i.getWidth()/f,i.getHeight()/f),o=s.getImageData(0,0,n.getWidth(),n.getHeight()),h=0;h<a;h++)l=t[h],typeof l=="string"&&(l=bn(l)),l.call(this,o),s.putImageData(o,0,0)}catch(d){m.error("Unable to apply filter. "+d.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,n}on(...t){const e=t[0],i=t[1];if(t[2],this._cache&&this._cache.delete(We),t.length===3)return this._delegate.apply(this,t);const n=e.split(re);for(let s=0;s<n.length;s++){const o=n[s].split("."),h=o[0],l=o[1]||"";this.eventListeners[h]||(this.eventListeners[h]=[]),this.eventListeners[h].push({name:l,handler:i})}return this}off(t,e){let i=(t||"").split(re),n=i.length,s,a,o,h,l,c;if(this._cache&&this._cache.delete(We),!t)for(a in this.eventListeners)this._off(a);for(s=0;s<n;s++)if(o=i[s],h=o.split("."),l=h[0],c=h[1],l)this.eventListeners[l]&&this._off(l,c,e);else for(a in this.eventListeners)this._off(a,c,e);return this}dispatchEvent(t){const e={target:this,type:t.type,evt:t};return this.fire(t.type,e),this}addEventListener(t,e){return this.on(t,function(i){e.call(this,i.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,e,i){const n=this;return this.on(t,function(s){const a=s.target.findAncestors(e,!0,n);for(let o=0;o<a.length;o++)s=m.cloneObject(s),s.currentTarget=a[o],i.call(a[o],s)}),this}remove(){return this.isDragging()&&this.stopDrag(),B._dragElements.delete(this._id),B._dragElements.forEach((t,e)=>{this.isAncestorOf(t.node)&&B._dragElements.delete(e)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(at),this._clearSelfAndDescendantCache(se),this._clearSelfAndDescendantCache(ze),this._clearSelfAndDescendantCache(Ue),this._clearSelfAndDescendantCache(be),this._clearSelfAndDescendantCache(Se)}_remove(){this._clearCaches();const t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){const e="get"+m._capitalize(t);return m._isFunction(this[e])?this[e]():this.attrs[t]}getAncestors(){let t=this.getParent(),e=[];for(;t;)e.push(t),t=t.getParent();return e}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{let e,i;if(!t)return this;for(e in t)e!==Cn&&(i=Ye+m._capitalize(e),m._isFunction(this[i])?this[i](t[e]):this._setAttr(e,t[e]))}),this}isListening(){return this._getCache(Se,this._isListening)}_isListening(t){if(!this.listening())return!1;const i=this.getParent();return i&&i!==t&&this!==t?i._isListening(t):!0}isVisible(){return this._getCache(be,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const i=this.getParent();return i&&i!==t&&this!==t?i._isVisible(t):!0}shouldDrawHit(t,e=!1){if(t)return this._isVisible(t)&&this._isListening(t);const i=this.getLayer();let n=!1;B._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===i)&&(n=!0)});const s=!e&&!k.hitOnDragEnabled&&(n||k.isTransforming());return this.isListening()&&this.isVisible()&&!s}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let t=this.getDepth(),e=this,i=0,n,s,a,o;function h(c){for(n=[],s=c.length,a=0;a<s;a++)o=c[a],i++,o.nodeType!==Xe&&(n=n.concat(o.getChildren().slice())),o._id===e._id&&(a=s);n.length>0&&n[0].getDepth()<=t&&h(n)}const l=this.getStage();return e.nodeType!==Rn&&l&&h(l.getChildren()),i}getDepth(){let t=0,e=this.parent;for(;e;)t++,e=e.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(ct),this._clearSelfAndDescendantCache(at)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;const e=t.getPointerPosition();if(!e)return null;const i=this.getAbsoluteTransform().copy();return i.invert(),i.point(e)}getAbsolutePosition(t){let e=!1,i=this.parent;for(;i;){if(i.isCached()){e=!0;break}i=i.parent}e&&!t&&(t=!0);const n=this.getAbsoluteTransform(t).getMatrix(),s=new tt,a=this.offset();return s.m=n.slice(),s.translate(a.x,a.y),s.getTranslation()}setAbsolutePosition(t){const{x:e,y:i,...n}=this._clearTransform();this.attrs.x=e,this.attrs.y=i,this._clearCache(ct);const s=this._getAbsoluteTransform().copy();return s.invert(),s.translate(t.x,t.y),t={x:this.attrs.x+s.getTranslation().x,y:this.attrs.y+s.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(ct),this._clearSelfAndDescendantCache(at),this}_setTransform(t){let e;for(e in t)this.attrs[e]=t[e]}_clearTransform(){const t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){let e=t.x,i=t.y,n=this.x(),s=this.y();return e!==void 0&&(n+=e),i!==void 0&&(s+=i),this.setPosition({x:n,y:s}),this}_eachAncestorReverse(t,e){let i=[],n=this.getParent(),s,a;if(!(e&&e._id===this._id)){for(i.unshift(this);n&&(!e||n._id!==e._id);)i.unshift(n),n=n.parent;for(s=i.length,a=0;a<s;a++)t(i[a])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return m.warn("Node has no parent. moveToTop function is ignored."),!1;const t=this.index,e=this.parent.getChildren().length;return t<e-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return m.warn("Node has no parent. moveUp function is ignored."),!1;const t=this.index,e=this.parent.getChildren().length;return t<e-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return m.warn("Node has no parent. moveDown function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return m.warn("Node has no parent. moveToBottom function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return m.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&m.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const e=this.index;return this.parent.children.splice(e,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(se,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let t=this.opacity();const e=this.getParent();return e&&!e._isUnderCache&&(t*=e.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){let t=this.getAttrs(),e,i,n,s,a;const o={attrs:{},className:this.getClassName()};for(e in t)i=t[e],a=m.isObject(i)&&!m._isPlainObject(i)&&!m._isArray(i),!a&&(n=typeof this[e]=="function"&&this[e],delete t[e],s=n?n.call(this):null,t[e]=i,s!==i&&(o.attrs[e]=i));return m._prepareToStringify(o)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,e,i){const n=[];e&&this._isMatch(t)&&n.push(this);let s=this.parent;for(;s;){if(s===i)return n;s._isMatch(t)&&n.push(s),s=s.parent}return n}isAncestorOf(t){return!1}findAncestor(t,e,i){return this.findAncestors(t,e,i)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);let e=t.replace(/ /g,"").split(","),i=e.length,n,s;for(n=0;n<i;n++)if(s=e[n],m.isValidSelector(s)||(m.warn('Selector "'+s+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),m.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),m.warn("Konva is awesome, right?")),s.charAt(0)==="#"){if(this.id()===s.slice(1))return!0}else if(s.charAt(0)==="."){if(this.hasName(s.slice(1)))return!0}else if(this.className===s||this.nodeType===s)return!0;return!1}getLayer(){const t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(Ue,this._getStage)}_getStage(){const t=this.getParent();return t?t.getStage():null}fire(t,e={},i){return e.target=e.target||this,i?this._fireAndBubble(t,e):this._fire(t,e),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(at,this._getAbsoluteTransform)}_getAbsoluteTransform(t){let e;if(t)return e=new tt,this._eachAncestorReverse(function(i){const n=i.transformsEnabled();n==="all"?e.multiply(i.getTransform()):n==="position"&&e.translate(i.x()-i.offsetX(),i.y()-i.offsetY())},t),e;{e=this._cache.get(at)||new tt,this.parent?this.parent.getAbsoluteTransform().copyInto(e):e.reset();const i=this.transformsEnabled();if(i==="all")e.multiply(this.getTransform());else if(i==="position"){const n=this.attrs.x||0,s=this.attrs.y||0,a=this.attrs.offsetX||0,o=this.attrs.offsetY||0;e.translate(n-a,s-o)}return e.dirty=!1,e}}getAbsoluteScale(t){let e=this;for(;e;)e._isUnderCache&&(t=e),e=e.getParent();const n=this.getAbsoluteTransform(t).decompose();return{x:n.scaleX,y:n.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(ct,this._getTransform)}_getTransform(){var t,e;const i=this._cache.get(ct)||new tt;i.reset();const n=this.x(),s=this.y(),a=k.getAngle(this.rotation()),o=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,h=(e=this.attrs.scaleY)!==null&&e!==void 0?e:1,l=this.attrs.skewX||0,c=this.attrs.skewY||0,f=this.attrs.offsetX||0,d=this.attrs.offsetY||0;return(n!==0||s!==0)&&i.translate(n,s),a!==0&&i.rotate(a),(l!==0||c!==0)&&i.skew(l,c),(o!==1||h!==1)&&i.scale(o,h),(f!==0||d!==0)&&i.translate(-1*f,-1*d),i.dirty=!1,i}clone(t){let e=m.cloneObject(this.attrs),i,n,s,a,o;for(i in t)e[i]=t[i];const h=new this.constructor(e);for(i in this.eventListeners)for(n=this.eventListeners[i],s=n.length,a=0;a<s;a++)o=n[a],o.name.indexOf(xn)<0&&(h.eventListeners[i]||(h.eventListeners[i]=[]),h.eventListeners[i].push(o));return h}_toKonvaCanvas(t){t=t||{};const e=this.getClientRect(),i=this.getStage(),n=t.x!==void 0?t.x:Math.floor(e.x),s=t.y!==void 0?t.y:Math.floor(e.y),a=t.pixelRatio||1,o=new ft({width:t.width||Math.ceil(e.width)||(i?i.width():0),height:t.height||Math.ceil(e.height)||(i?i.height():0),pixelRatio:a}),h=o.getContext(),l=new ft({width:o.width/o.pixelRatio+Math.abs(n),height:o.height/o.pixelRatio+Math.abs(s),pixelRatio:o.pixelRatio});return t.imageSmoothingEnabled===!1&&(h._context.imageSmoothingEnabled=!1),h.save(),(n||s)&&h.translate(-1*n,-1*s),this.drawScene(o,void 0,l),h.restore(),o}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};const e=t.mimeType||null,i=t.quality||null,n=this._toKonvaCanvas(t).toDataURL(e,i);return t.callback&&t.callback(n),n}toImage(t){return new Promise((e,i)=>{try{const n=t?.callback;n&&delete t.callback,m._urlToImage(this.toDataURL(t),function(s){e(s),n?.(s)})}catch(n){i(n)}})}toBlob(t){return new Promise((e,i)=>{try{const n=t?.callback;n&&delete t.callback,this.toCanvas(t).toBlob(s=>{e(s),n?.(s)},t?.mimeType,t?.quality)}catch(n){i(n)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():k.dragDistance}_off(t,e,i){let n=this.eventListeners[t],s,a,o;for(s=0;s<n.length;s++)if(a=n[s].name,o=n[s].handler,(a!=="konva"||e==="konva")&&(!e||a===e)&&(!i||i===o)){if(n.splice(s,1),n.length===0){delete this.eventListeners[t];break}s--}}_fireChangeEvent(t,e,i){this._fire(t+vn,{oldVal:e,newVal:i})}addName(t){if(!this.hasName(t)){const e=this.name(),i=e?e+" "+t:t;this.name(i)}return this}hasName(t){if(!t)return!1;const e=this.name();return e?(e||"").split(/\s/g).indexOf(t)!==-1:!1}removeName(t){const e=(this.name()||"").split(/\s/g),i=e.indexOf(t);return i!==-1&&(e.splice(i,1),this.name(e.join(" "))),this}setAttr(t,e){const i=this[Ye+m._capitalize(t)];return m._isFunction(i)?i.call(this,e):this._setAttr(t,e),this}_requestDraw(){if(k.autoDrawEnabled){const t=this.getLayer()||this.getStage();t?.batchDraw()}}_setAttr(t,e){const i=this.attrs[t];i===e&&!m.isObject(e)||(e==null?delete this.attrs[t]:this.attrs[t]=e,this._shouldFireChangeEvents&&this._fireChangeEvent(t,i,e),this._requestDraw())}_setComponentAttr(t,e,i){let n;i!==void 0&&(n=this.attrs[t],n||(this.attrs[t]=this.getAttr(t)),this.attrs[t][e]=i,this._fireChangeEvent(t,n,i))}_fireAndBubble(t,e,i){e&&this.nodeType===Xe&&(e.target=this);const n=[wn,Tn,Pn,kn,An,En];if(!(n.indexOf(t)!==-1&&(i&&(this===i||this.isAncestorOf&&this.isAncestorOf(i))||this.nodeType==="Stage"&&!i))){this._fire(t,e);const a=n.indexOf(t)!==-1&&i&&i.isAncestorOf&&i.isAncestorOf(this)&&!i.isAncestorOf(this.parent);(e&&!e.cancelBubble||!e)&&this.parent&&this.parent.isListening()&&!a&&(i&&i.parent?this._fireAndBubble.call(this.parent,t,e,i):this._fireAndBubble.call(this.parent,t,e))}}_getProtoListeners(t){var e,i;const{nodeType:n}=this,s=T.protoListenerMap.get(n)||{};let a=s?.[t];if(a===void 0){a=[];let o=Object.getPrototypeOf(this);for(;o;){const h=(i=(e=o.eventListeners)===null||e===void 0?void 0:e[t])!==null&&i!==void 0?i:[];a.push(...h),o=Object.getPrototypeOf(o)}s[t]=a,T.protoListenerMap.set(n,s)}return a}_fire(t,e){e=e||{},e.currentTarget=this,e.type=t;const i=this._getProtoListeners(t);if(i){const s=i.slice();for(let a=0;a<s.length;a++)s[a].handler.call(this,e)}const n=this.eventListeners[t];if(n){const s=n.slice(),a=s.length;for(let h=0;h<s.length;h++)s[h].handler.call(this,e);const o=this.eventListeners[t];if(o)for(let h=a;h<o.length;h++)o[h].handler.call(this,e)}}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){const e=t?t.pointerId:void 0,i=this.getStage(),n=this.getAbsolutePosition();if(!i)return;const s=i._getPointerById(e)||i._changedPointerPositions[0]||n;B._dragElements.set(this._id,{node:this,startPointerPos:s,offset:{x:s.x-n.x,y:s.y-n.y},dragStatus:"ready",pointerId:e,startEvent:t})}startDrag(t,e=!0){B._dragElements.has(this._id)||this._createDragElement(t);const i=B._dragElements.get(this._id);i.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:i.startEvent&&i.startEvent.evt||t&&t.evt},e)}_setDragPosition(t,e){const i=this.getStage()._getPointerById(e.pointerId);if(!i)return;let n={x:i.x-e.offset.x,y:i.y-e.offset.y};const s=this.dragBoundFunc();if(s!==void 0){const a=s.call(this,n,t);a?n=a:m.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==n.x||this._lastPos.y!==n.y)&&(this.setAbsolutePosition(n),this._requestDraw()),this._lastPos=n}stopDrag(t){const e=B._dragElements.get(this._id);e&&(e.dragStatus="stopped"),B._endDragBefore(t),B._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=B._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){if(!(!(t.evt.button!==void 0)||k.dragButtons.indexOf(t.evt.button)>=0)||this.isDragging())return;let n=!1;B._dragElements.forEach(s=>{this.isAncestorOf(s.node)&&(n=!0)}),n||this._createDragElement(t)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const e=B._dragElements.get(this._id),i=e&&e.dragStatus==="dragging",n=e&&e.dragStatus==="ready";i?this.stopDrag():n&&B._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const e=this.getStage();if(!e)return!1;const i={x:-t.x,y:-t.y,width:e.width()+2*t.x,height:e.height()+2*t.y};return m.haveIntersection(i,this.getClientRect())}static create(t,e){return m._isString(t)&&(t=JSON.parse(t)),this._createNode(t,e)}static _createNode(t,e){let i=T.prototype.getClassName.call(t),n=t.children,s,a,o;e&&(t.attrs.container=e),k[i]||(m.warn('Can not find a node with class name "'+i+'". Fallback to "Shape".'),i="Shape");const h=k[i];if(s=new h(t.attrs),n)for(a=n.length,o=0;o<a;o++)s.add(T._createNode(n[o]));return s}}T.protoListenerMap=new Map;T.prototype.nodeType="Node";T.prototype._attrsAffectingSize=[];T.prototype.eventListeners={};T.prototype.on(Mn,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(ct),this._clearSelfAndDescendantCache(at)});T.prototype.on("visibleChange.konva",function(){this._clearSelfAndDescendantCache(be)});T.prototype.on("listeningChange.konva",function(){this._clearSelfAndDescendantCache(Se)});T.prototype.on("opacityChange.konva",function(){this._clearSelfAndDescendantCache(se)});const X=u.addGetterSetter;X(T,"zIndex");X(T,"absolutePosition");X(T,"position");X(T,"x",0,w());X(T,"y",0,w());X(T,"globalCompositeOperation","source-over",bt());X(T,"opacity",1,w());X(T,"name","",bt());X(T,"id","",bt());X(T,"rotation",0,w());u.addComponentsGetterSetter(T,"scale",["x","y"]);X(T,"scaleX",1,w());X(T,"scaleY",1,w());u.addComponentsGetterSetter(T,"skew",["x","y"]);X(T,"skewX",0,w());X(T,"skewY",0,w());u.addComponentsGetterSetter(T,"offset",["x","y"]);X(T,"offsetX",0,w());X(T,"offsetY",0,w());X(T,"dragDistance",void 0,w());X(T,"width",0,w());X(T,"height",0,w());X(T,"listening",!0,st());X(T,"preventDefault",!0,st());X(T,"filters",void 0,function(r){return this._filterUpToDate=!1,r});X(T,"visible",!0,st());X(T,"transformsEnabled","all",bt());X(T,"size");X(T,"dragBoundFunc");X(T,"draggable",!1,st());u.backCompat(T,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class et extends T{constructor(){super(...arguments),this.children=[]}getChildren(t){const e=this.children||[];return t?e.filter(t):e}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(let i=0;i<t.length;i++)this.add(t[i]);return this}const e=t[0];return e.getParent()?(e.moveTo(this),this):(this._validateAdd(e),e.index=this.getChildren().length,e.parent=this,e._clearCaches(),this.getChildren().push(e),this._fire("add",{child:e}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){const e=this._generalFind(t,!0);return e.length>0?e[0]:void 0}_generalFind(t,e){const i=[];return this._descendants(n=>{const s=n._isMatch(t);return s&&i.push(n),!!(s&&e)}),i}_descendants(t){let e=!1;const i=this.getChildren();for(const n of i){if(e=t(n),e)return!0;if(n.hasChildren()&&(e=n._descendants(t),e))return!0}return!1}toObject(){const t=T.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(e=>{t.children.push(e.toObject())}),t}isAncestorOf(t){let e=t.getParent();for(;e;){if(e._id===this._id)return!0;e=e.getParent()}return!1}clone(t){const e=T.prototype.clone.call(this,t);return this.getChildren().forEach(function(i){e.add(i.clone())}),e}getAllIntersections(t){const e=[];return this.find("Shape").forEach(i=>{i.isVisible()&&i.intersects(t)&&e.push(i)}),e}_clearSelfAndDescendantCache(t){var e;super._clearSelfAndDescendantCache(t),!this.isCached()&&((e=this.children)===null||e===void 0||e.forEach(function(i){i._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(e,i){e.index=i}),this._requestDraw()}drawScene(t,e,i){const n=this.getLayer(),s=t||n&&n.getCanvas(),a=s&&s.getContext(),o=this._getCanvasCache(),h=o&&o.scene,l=s&&s.isCache;if(!this.isVisible()&&!l)return this;if(h){a.save();const c=this.getAbsoluteTransform(e).getMatrix();a.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren("drawScene",s,e,i);return this}drawHit(t,e){if(!this.shouldDrawHit(e))return this;const i=this.getLayer(),n=t||i&&i.hitCanvas,s=n&&n.getContext(),a=this._getCanvasCache();if(a&&a.hit){s.save();const h=this.getAbsoluteTransform(e).getMatrix();s.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedHitCanvas(s),s.restore()}else this._drawChildren("drawHit",n,e);return this}_drawChildren(t,e,i,n){var s;const a=e&&e.getContext(),o=this.clipWidth(),h=this.clipHeight(),l=this.clipFunc(),c=typeof o=="number"&&typeof h=="number"||l,f=i===this;if(c){a.save();const p=this.getAbsoluteTransform(i);let g=p.getMatrix();a.transform(g[0],g[1],g[2],g[3],g[4],g[5]),a.beginPath();let b;if(l)b=l.call(this,a,this);else{const S=this.clipX(),y=this.clipY();a.rect(S||0,y||0,o,h)}a.clip.apply(a,b),g=p.copy().invert().getMatrix(),a.transform(g[0],g[1],g[2],g[3],g[4],g[5])}const d=!f&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";d&&(a.save(),a._applyGlobalCompositeOperation(this)),(s=this.children)===null||s===void 0||s.forEach(function(p){p[t](e,i,n)}),d&&a.restore(),c&&a.restore()}getClientRect(t={}){var e;const i=t.skipTransform,n=t.relativeTo;let s,a,o,h,l={x:1/0,y:1/0,width:0,height:0};const c=this;(e=this.children)===null||e===void 0||e.forEach(function(p){if(!p.visible())return;const g=p.getClientRect({relativeTo:c,skipShadow:t.skipShadow,skipStroke:t.skipStroke});g.width===0&&g.height===0||(s===void 0?(s=g.x,a=g.y,o=g.x+g.width,h=g.y+g.height):(s=Math.min(s,g.x),a=Math.min(a,g.y),o=Math.max(o,g.x+g.width),h=Math.max(h,g.y+g.height)))});const f=this.find("Shape");let d=!1;for(let p=0;p<f.length;p++)if(f[p]._isVisible(this)){d=!0;break}return d&&s!==void 0?l={x:s,y:a,width:o-s,height:h-a}:l={x:0,y:0,width:0,height:0},i?l:this._transformedRect(l,n)}}u.addComponentsGetterSetter(et,"clip",["x","y","width","height"]);u.addGetterSetter(et,"clipX",void 0,w());u.addGetterSetter(et,"clipY",void 0,w());u.addGetterSetter(et,"clipWidth",void 0,w());u.addGetterSetter(et,"clipHeight",void 0,w());u.addGetterSetter(et,"clipFunc");const Vt=new Map,di=k._global.PointerEvent!==void 0;function fe(r){return Vt.get(r)}function Oe(r){return{evt:r,pointerId:r.pointerId}}function fi(r,t){return Vt.get(r)===t}function ui(r,t){zt(r),t.getStage()&&(Vt.set(r,t),di&&t._fire("gotpointercapture",Oe(new PointerEvent("gotpointercapture"))))}function zt(r,t){const e=Vt.get(r);if(!e)return;const i=e.getStage();i&&i.content,Vt.delete(r),di&&e._fire("lostpointercapture",Oe(new PointerEvent("lostpointercapture")))}const On="Stage",Ln="string",Ve="px",In="mouseout",gi="mouseleave",pi="mouseover",mi="mouseenter",_i="mousemove",yi="mousedown",Si="mouseup",Ft="pointermove",Nt="pointerdown",kt="pointerup",Bt="pointercancel",Dn="lostpointercapture",Qt="pointerout",Ht="pointerleave",Jt="pointerover",Zt="pointerenter",ve="contextmenu",bi="touchstart",vi="touchend",Ci="touchmove",xi="touchcancel",Ce="wheel",Fn=5,Nn=[[mi,"_pointerenter"],[yi,"_pointerdown"],[_i,"_pointermove"],[Si,"_pointerup"],[gi,"_pointerleave"],[bi,"_pointerdown"],[Ci,"_pointermove"],[vi,"_pointerup"],[xi,"_pointercancel"],[pi,"_pointerover"],[Ce,"_wheel"],[ve,"_contextmenu"],[Nt,"_pointerdown"],[Ft,"_pointermove"],[kt,"_pointerup"],[Bt,"_pointercancel"],[Ht,"_pointerleave"],[Dn,"_lostpointercapture"]],ue={mouse:{[Qt]:In,[Ht]:gi,[Jt]:pi,[Zt]:mi,[Ft]:_i,[Nt]:yi,[kt]:Si,[Bt]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[Qt]:"touchout",[Ht]:"touchleave",[Jt]:"touchover",[Zt]:"touchenter",[Ft]:Ci,[Nt]:bi,[kt]:vi,[Bt]:xi,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[Qt]:Qt,[Ht]:Ht,[Jt]:Jt,[Zt]:Zt,[Ft]:Ft,[Nt]:Nt,[kt]:kt,[Bt]:Bt,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},Wt=r=>r.indexOf("pointer")>=0?"pointer":r.indexOf("touch")>=0?"touch":"mouse",Tt=r=>{const t=Wt(r);if(t==="pointer")return k.pointerEventsEnabled&&ue.pointer;if(t==="touch")return ue.touch;if(t==="mouse")return ue.mouse};function qe(r={}){return(r.clipFunc||r.clipWidth||r.clipHeight)&&m.warn("Stage does not support clipping. Please use clip for Layers or Groups."),r}const Bn="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",Yt=[];class le extends et{constructor(t){super(qe(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Yt.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{qe(this.attrs)}),this._checkVisibility()}_validateAdd(t){const e=t.getType()==="Layer",i=t.getType()==="FastLayer";e||i||m.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===Ln){let e;if(t.charAt(0)==="."){const i=t.slice(1);t=document.getElementsByClassName(i)[0]}else t.charAt(0)!=="#"?e=t:e=t.slice(1),t=document.getElementById(e);if(!t)throw"Can not find container in document with id "+e}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const t=this.children,e=t.length;for(let i=0;i<e;i++)t[i].clear();return this}clone(t){return t||(t={}),t.container=typeof document<"u"&&document.createElement("div"),et.prototype.clone.call(this,t)}destroy(){super.destroy();const t=this.content;t&&m._isInDocument(t)&&this.container().removeChild(t);const e=Yt.indexOf(this);return e>-1&&Yt.splice(e,1),m.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(m.warn(Bn),null)}_getPointerById(t){return this._pointerPositions.find(e=>e.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t={...t},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();const e=new ft({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),i=e.getContext()._context,n=this.children;return(t.x||t.y)&&i.translate(-1*t.x,-1*t.y),n.forEach(function(s){if(!s.isVisible())return;const a=s._toKonvaCanvas(t);i.drawImage(a._canvas,t.x,t.y,a.getWidth()/a.getPixelRatio(),a.getHeight()/a.getPixelRatio())}),e}getIntersection(t){if(!t)return null;const e=this.children,i=e.length,n=i-1;for(let s=n;s>=0;s--){const a=e[s].getIntersection(t);if(a)return a}return null}_resizeDOM(){const t=this.width(),e=this.height();this.content&&(this.content.style.width=t+Ve,this.content.style.height=e+Ve),this.bufferCanvas.setSize(t,e),this.bufferHitCanvas.setSize(t,e),this.children.forEach(i=>{i.setSize({width:t,height:e}),i.draw()})}add(t,...e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}super.add(t);const i=this.children.length;return i>Fn&&m.warn("The stage has "+i+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),k.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return fi(t,this)}setPointerCapture(t){ui(t,this)}releaseCapture(t){zt(t)}getLayers(){return this.children}_bindContentEvents(){k.isBrowser&&Nn.forEach(([t,e])=>{this.content.addEventListener(t,i=>{this[e](i)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const e=Tt(t.type);e&&this._fire(e.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const e=Tt(t.type);e&&this._fire(e.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let e=this[t+"targetShape"];return e&&!e.getStage()&&(e=null),e}_pointerleave(t){const e=Tt(t.type),i=Wt(t.type);if(!e)return;this.setPointersPositions(t);const n=this._getTargetShape(i),s=!(k.isDragging()||k.isTransforming())||k.hitOnDragEnabled;n&&s?(n._fireAndBubble(e.pointerout,{evt:t}),n._fireAndBubble(e.pointerleave,{evt:t}),this._fire(e.pointerleave,{evt:t,target:this,currentTarget:this}),this[i+"targetShape"]=null):s&&(this._fire(e.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(e.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(t){const e=Tt(t.type),i=Wt(t.type);if(!e)return;this.setPointersPositions(t);let n=!1;this._changedPointerPositions.forEach(s=>{const a=this.getIntersection(s);if(B.justDragged=!1,k["_"+i+"ListenClick"]=!0,!a||!a.isListening()){this[i+"ClickStartShape"]=void 0;return}k.capturePointerEventsEnabled&&a.setPointerCapture(s.id),this[i+"ClickStartShape"]=a,a._fireAndBubble(e.pointerdown,{evt:t,pointerId:s.id}),n=!0;const o=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&o&&t.preventDefault()}),n||this._fire(e.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(t){const e=Tt(t.type),i=Wt(t.type);if(!e)return;const n=t.type.indexOf("touch")>=0||t.pointerType==="touch";if(k.isDragging()&&B.node.preventDefault()&&t.cancelable&&n&&t.preventDefault(),this.setPointersPositions(t),!(!(k.isDragging()||k.isTransforming())||k.hitOnDragEnabled))return;const a={};let o=!1;const h=this._getTargetShape(i);this._changedPointerPositions.forEach(l=>{const c=fe(l.id)||this.getIntersection(l),f=l.id,d={evt:t,pointerId:f},p=h!==c;if(p&&h&&(h._fireAndBubble(e.pointerout,{...d},c),h._fireAndBubble(e.pointerleave,{...d},c)),c){if(a[c._id])return;a[c._id]=!0}c&&c.isListening()?(o=!0,p&&(c._fireAndBubble(e.pointerover,{...d},h),c._fireAndBubble(e.pointerenter,{...d},h),this[i+"targetShape"]=c),c._fireAndBubble(e.pointermove,{...d})):h&&(this._fire(e.pointerover,{evt:t,target:this,currentTarget:this,pointerId:f}),this[i+"targetShape"]=null)}),o||this._fire(e.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const e=Tt(t.type),i=Wt(t.type);if(!e)return;this.setPointersPositions(t);const n=this[i+"ClickStartShape"],s=this[i+"ClickEndShape"],a={};let o=!1;this._changedPointerPositions.forEach(h=>{const l=fe(h.id)||this.getIntersection(h);if(l){if(l.releaseCapture(h.id),a[l._id])return;a[l._id]=!0}const c=h.id,f={evt:t,pointerId:c};let d=!1;k["_"+i+"InDblClickWindow"]?(d=!0,clearTimeout(this[i+"DblTimeout"])):B.justDragged||(k["_"+i+"InDblClickWindow"]=!0,clearTimeout(this[i+"DblTimeout"])),this[i+"DblTimeout"]=setTimeout(function(){k["_"+i+"InDblClickWindow"]=!1},k.dblClickWindow),l&&l.isListening()?(o=!0,this[i+"ClickEndShape"]=l,l._fireAndBubble(e.pointerup,{...f}),k["_"+i+"ListenClick"]&&n&&n===l&&(l._fireAndBubble(e.pointerclick,{...f}),d&&s&&s===l&&l._fireAndBubble(e.pointerdblclick,{...f}))):(this[i+"ClickEndShape"]=null,o||(this._fire(e.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),o=!0),k["_"+i+"ListenClick"]&&this._fire(e.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:c}),d&&this._fire(e.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:c}))}),o||this._fire(e.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),k["_"+i+"ListenClick"]=!1,t.cancelable&&i!=="touch"&&i!=="pointer"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);const e=this.getIntersection(this.getPointerPosition());e&&e.isListening()?e._fireAndBubble(ve,{evt:t}):this._fire(ve,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);const e=this.getIntersection(this.getPointerPosition());e&&e.isListening()?e._fireAndBubble(Ce,{evt:t}):this._fire(Ce,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const e=fe(t.pointerId)||this.getIntersection(this.getPointerPosition());e&&e._fireAndBubble(kt,Oe(t)),zt(t.pointerId)}_lostpointercapture(t){zt(t.pointerId)}setPointersPositions(t){const e=this._getContentPosition();let i=null,n=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,s=>{this._pointerPositions.push({id:s.identifier,x:(s.clientX-e.left)/e.scaleX,y:(s.clientY-e.top)/e.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,s=>{this._changedPointerPositions.push({id:s.identifier,x:(s.clientX-e.left)/e.scaleX,y:(s.clientY-e.top)/e.scaleY})})):(i=(t.clientX-e.left)/e.scaleX,n=(t.clientY-e.top)/e.scaleY,this.pointerPos={x:i,y:n},this._pointerPositions=[{x:i,y:n,id:m._getFirstPointerId(t)}],this._changedPointerPositions=[{x:i,y:n,id:m._getFirstPointerId(t)}])}_setPointerPosition(t){m.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new ft({width:this.width(),height:this.height()}),this.bufferHitCanvas=new Me({pixelRatio:1,width:this.width(),height:this.height()}),!k.isBrowser)return;const t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}cache(){return m.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}}le.prototype.nodeType=On;K(le);u.addGetterSetter(le,"container");k.isBrowser&&document.addEventListener("visibilitychange",()=>{Yt.forEach(r=>{r.batchDraw()})});const wi="hasShadow",Ti="shadowRGBA",Pi="patternImage",ki="linearGradient",Ai="radialGradient";let te;function ge(){return te||(te=m.createCanvasElement().getContext("2d"),te)}const Xt={};function Hn(r){const t=this.attrs.fillRule;t?r.fill(t):r.fill()}function Wn(r){r.stroke()}function zn(r){const t=this.attrs.fillRule;t?r.fill(t):r.fill()}function Yn(r){r.stroke()}function Xn(){this._clearCache(wi)}function Un(){this._clearCache(Ti)}function Vn(){this._clearCache(Pi)}function qn(){this._clearCache(ki)}function jn(){this._clearCache(Ai)}class x extends T{constructor(t){super(t);let e,i=0;for(;e=m.getHitColor(),!(e&&!(e in Xt));)if(i++,i>=1e4){m.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),e=m.getRandomColor();break}this.colorKey=e,Xt[e]=this}getContext(){return m.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return m.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(wi,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(Pi,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const e=ge().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(e&&e.setTransform){const i=new tt;i.translate(this.fillPatternX(),this.fillPatternY()),i.rotate(k.getAngle(this.fillPatternRotation())),i.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),i.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const n=i.getMatrix(),s=typeof DOMMatrix>"u"?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(s)}return e}}_getLinearGradient(){return this._getCache(ki,this.__getLinearGradient)}__getLinearGradient(){const t=this.fillLinearGradientColorStops();if(t){const e=ge(),i=this.fillLinearGradientStartPoint(),n=this.fillLinearGradientEndPoint(),s=e.createLinearGradient(i.x,i.y,n.x,n.y);for(let a=0;a<t.length;a+=2)s.addColorStop(t[a],t[a+1]);return s}}_getRadialGradient(){return this._getCache(Ai,this.__getRadialGradient)}__getRadialGradient(){const t=this.fillRadialGradientColorStops();if(t){const e=ge(),i=this.fillRadialGradientStartPoint(),n=this.fillRadialGradientEndPoint(),s=e.createRadialGradient(i.x,i.y,this.fillRadialGradientStartRadius(),n.x,n.y,this.fillRadialGradientEndRadius());for(let a=0;a<t.length;a+=2)s.addColorStop(t[a],t[a+1]);return s}}getShadowRGBA(){return this._getCache(Ti,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const t=m.colorToRGBA(this.shadowColor());if(t)return"rgba("+t.r+","+t.g+","+t.b+","+t.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){const e=this.getStage();if(!e)return!1;const i=e.bufferHitCanvas;return i.getContext().clear(),this.drawHit(i,void 0,!0),i.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data[3]>0}destroy(){return T.prototype.destroy.call(this),delete Xt[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var e;if(!((e=this.attrs.perfectDrawEnabled)!==null&&e!==void 0?e:!0))return!1;const n=t||this.hasFill(),s=this.hasStroke(),a=this.getAbsoluteOpacity()!==1;if(n&&s&&a)return!0;const o=this.hasShadow(),h=this.shadowForStrokeEnabled();return!!(n&&s&&o&&h)}setStrokeHitEnabled(t){m.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){let e=!1,i=this.getParent();for(;i;){if(i.isCached()){e=!0;break}i=i.getParent()}const n=t.skipTransform,s=t.relativeTo||e&&this.getStage()||void 0,a=this.getSelfRect(),h=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,l=a.width+h,c=a.height+h,f=!t.skipShadow&&this.hasShadow(),d=f?this.shadowOffsetX():0,p=f?this.shadowOffsetY():0,g=l+Math.abs(d),b=c+Math.abs(p),S=f&&this.shadowBlur()||0,y=g+S*2,_=b+S*2,C={width:y,height:_,x:-(h/2+S)+Math.min(d,0)+a.x,y:-(h/2+S)+Math.min(p,0)+a.y};return n?C:this._transformedRect(C,s)}drawScene(t,e,i){const n=this.getLayer(),s=t||n.getCanvas(),a=s.getContext(),o=this._getCanvasCache(),h=this.getSceneFunc(),l=this.hasShadow();let c;const f=e===this;if(!this.isVisible()&&!f)return this;if(o){a.save();const d=this.getAbsoluteTransform(e).getMatrix();return a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedSceneCanvas(a),a.restore(),this}if(!h)return this;if(a.save(),this._useBufferCanvas()){c=this.getStage();const d=i||c.bufferCanvas,p=d.getContext();i?(p.save(),p.setTransform(1,0,0,1,0,0),p.clearRect(0,0,d.width,d.height),p.restore()):p.clear(),p.save(),p._applyLineJoin(this),p._applyMiterLimit(this);const g=this.getAbsoluteTransform(e).getMatrix();p.transform(g[0],g[1],g[2],g[3],g[4],g[5]),h.call(this,p,this),p.restore();const b=d.pixelRatio;l&&a._applyShadow(this),f||(a._applyOpacity(this),a._applyGlobalCompositeOperation(this)),a.drawImage(d._canvas,d.x||0,d.y||0,d.width/b,d.height/b)}else{if(a._applyLineJoin(this),a._applyMiterLimit(this),!f){const d=this.getAbsoluteTransform(e).getMatrix();a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),a._applyOpacity(this),a._applyGlobalCompositeOperation(this)}l&&a._applyShadow(this),h.call(this,a,this)}return a.restore(),this}drawHit(t,e,i=!1){if(!this.shouldDrawHit(e,i))return this;const n=this.getLayer(),s=t||n.hitCanvas,a=s&&s.getContext(),o=this.hitFunc()||this.sceneFunc(),h=this._getCanvasCache(),l=h&&h.hit;if(this.colorKey||m.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),l){a.save();const f=this.getAbsoluteTransform(e).getMatrix();return a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!o)return this;if(a.save(),a._applyLineJoin(this),a._applyMiterLimit(this),!(this===e)){const f=this.getAbsoluteTransform(e).getMatrix();a.transform(f[0],f[1],f[2],f[3],f[4],f[5])}return o.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){const e=this._getCanvasCache(),i=this._getCachedSceneCanvas(),n=e.hit,s=n.getContext(),a=n.getWidth(),o=n.getHeight();s.clear(),s.drawImage(i._canvas,0,0,a,o);try{const h=s.getImageData(0,0,a,o),l=h.data,c=l.length,f=m._hexToRgb(this.colorKey);for(let d=0;d<c;d+=4)l[d+3]>t?(l[d]=f.r,l[d+1]=f.g,l[d+2]=f.b,l[d+3]=255):l[d+3]=0;s.putImageData(h,0,0)}catch(h){m.error("Unable to draw hit graph from cached scene canvas. "+h.message)}return this}hasPointerCapture(t){return fi(t,this)}setPointerCapture(t){ui(t,this)}releaseCapture(t){zt(t)}}x.prototype._fillFunc=Hn;x.prototype._strokeFunc=Wn;x.prototype._fillFuncHit=zn;x.prototype._strokeFuncHit=Yn;x.prototype._centroid=!1;x.prototype.nodeType="Shape";K(x);x.prototype.eventListeners={};x.prototype.on("shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",Xn);x.prototype.on("shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",Un);x.prototype.on("fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",Vn);x.prototype.on("fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",qn);x.prototype.on("fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",jn);u.addGetterSetter(x,"stroke",void 0,ci());u.addGetterSetter(x,"strokeWidth",2,w());u.addGetterSetter(x,"fillAfterStrokeEnabled",!1);u.addGetterSetter(x,"hitStrokeWidth","auto",Ge());u.addGetterSetter(x,"strokeHitEnabled",!0,st());u.addGetterSetter(x,"perfectDrawEnabled",!0,st());u.addGetterSetter(x,"shadowForStrokeEnabled",!0,st());u.addGetterSetter(x,"lineJoin");u.addGetterSetter(x,"lineCap");u.addGetterSetter(x,"miterLimit");u.addGetterSetter(x,"sceneFunc");u.addGetterSetter(x,"hitFunc");u.addGetterSetter(x,"dash");u.addGetterSetter(x,"dashOffset",0,w());u.addGetterSetter(x,"shadowColor",void 0,bt());u.addGetterSetter(x,"shadowBlur",0,w());u.addGetterSetter(x,"shadowOpacity",1,w());u.addComponentsGetterSetter(x,"shadowOffset",["x","y"]);u.addGetterSetter(x,"shadowOffsetX",0,w());u.addGetterSetter(x,"shadowOffsetY",0,w());u.addGetterSetter(x,"fillPatternImage");u.addGetterSetter(x,"fill",void 0,ci());u.addGetterSetter(x,"fillPatternX",0,w());u.addGetterSetter(x,"fillPatternY",0,w());u.addGetterSetter(x,"fillLinearGradientColorStops");u.addGetterSetter(x,"strokeLinearGradientColorStops");u.addGetterSetter(x,"fillRadialGradientStartRadius",0);u.addGetterSetter(x,"fillRadialGradientEndRadius",0);u.addGetterSetter(x,"fillRadialGradientColorStops");u.addGetterSetter(x,"fillPatternRepeat","repeat");u.addGetterSetter(x,"fillEnabled",!0);u.addGetterSetter(x,"strokeEnabled",!0);u.addGetterSetter(x,"shadowEnabled",!0);u.addGetterSetter(x,"dashEnabled",!0);u.addGetterSetter(x,"strokeScaleEnabled",!0);u.addGetterSetter(x,"fillPriority","color");u.addComponentsGetterSetter(x,"fillPatternOffset",["x","y"]);u.addGetterSetter(x,"fillPatternOffsetX",0,w());u.addGetterSetter(x,"fillPatternOffsetY",0,w());u.addComponentsGetterSetter(x,"fillPatternScale",["x","y"]);u.addGetterSetter(x,"fillPatternScaleX",1,w());u.addGetterSetter(x,"fillPatternScaleY",1,w());u.addComponentsGetterSetter(x,"fillLinearGradientStartPoint",["x","y"]);u.addComponentsGetterSetter(x,"strokeLinearGradientStartPoint",["x","y"]);u.addGetterSetter(x,"fillLinearGradientStartPointX",0);u.addGetterSetter(x,"strokeLinearGradientStartPointX",0);u.addGetterSetter(x,"fillLinearGradientStartPointY",0);u.addGetterSetter(x,"strokeLinearGradientStartPointY",0);u.addComponentsGetterSetter(x,"fillLinearGradientEndPoint",["x","y"]);u.addComponentsGetterSetter(x,"strokeLinearGradientEndPoint",["x","y"]);u.addGetterSetter(x,"fillLinearGradientEndPointX",0);u.addGetterSetter(x,"strokeLinearGradientEndPointX",0);u.addGetterSetter(x,"fillLinearGradientEndPointY",0);u.addGetterSetter(x,"strokeLinearGradientEndPointY",0);u.addComponentsGetterSetter(x,"fillRadialGradientStartPoint",["x","y"]);u.addGetterSetter(x,"fillRadialGradientStartPointX",0);u.addGetterSetter(x,"fillRadialGradientStartPointY",0);u.addComponentsGetterSetter(x,"fillRadialGradientEndPoint",["x","y"]);u.addGetterSetter(x,"fillRadialGradientEndPointX",0);u.addGetterSetter(x,"fillRadialGradientEndPointY",0);u.addGetterSetter(x,"fillPatternRotation",0);u.addGetterSetter(x,"fillRule",void 0,bt());u.backCompat(x,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const Kn="beforeDraw",$n="draw",Ei=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],Qn=Ei.length;class vt extends et{constructor(t){super(t),this.canvas=new ft,this.hitCanvas=new Me({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),t<e.children.length-1?e.content.insertBefore(this.getNativeCanvasElement(),e.children[t+1].getCanvas()._canvas):e.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){T.prototype.moveToTop.call(this);const t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!T.prototype.moveUp.call(this))return!1;const e=this.getStage();return!e||!e.content?!1:(e.content.removeChild(this.getNativeCanvasElement()),this.index<e.children.length-1?e.content.insertBefore(this.getNativeCanvasElement(),e.children[this.index+1].getCanvas()._canvas):e.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(T.prototype.moveDown.call(this)){const t=this.getStage();if(t){const e=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),e[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(T.prototype.moveToBottom.call(this)){const t=this.getStage();if(t){const e=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),e[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const t=this.getNativeCanvasElement();return T.prototype.remove.call(this),t&&t.parentNode&&m._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:e}){return this.canvas.setSize(t,e),this.hitCanvas.setSize(t,e),this._setSmoothEnabled(),this}_validateAdd(t){const e=t.getType();e!=="Group"&&e!=="Shape"&&m.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t={...t},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),T.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){m.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){m.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,m.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;let e=1,i=!1;for(;;){for(let n=0;n<Qn;n++){const s=Ei[n],a=this._getIntersection({x:t.x+s.x*e,y:t.y+s.y*e}),o=a.shape;if(o)return o;if(i=!!a.antialiased,!a.antialiased)break}if(i)e+=1;else return null}}_getIntersection(t){const e=this.hitCanvas.pixelRatio,i=this.hitCanvas.context.getImageData(Math.round(t.x*e),Math.round(t.y*e),1,1).data,n=i[3];if(n===255){const s=m.getHitColorKey(i[0],i[1],i[2]),a=Xt[s];return a?{shape:a}:{antialiased:!0}}else if(n>0)return{antialiased:!0};return{}}drawScene(t,e,i){const n=this.getLayer(),s=t||n&&n.getCanvas();return this._fire(Kn,{node:this}),this.clearBeforeDraw()&&s.getContext().clear(),et.prototype.drawScene.call(this,s,e,i),this._fire($n,{node:this}),this}drawHit(t,e){const i=this.getLayer(),n=t||i&&i.hitCanvas;return i&&i.clearBeforeDraw()&&i.getHitCanvas().getContext().clear(),et.prototype.drawHit.call(this,n,e),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){m.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return m.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const t=this.parent;!!this.hitCanvas._canvas.parentNode?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}destroy(){return m.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}vt.prototype.nodeType="Layer";K(vt);u.addGetterSetter(vt,"imageSmoothingEnabled",!0);u.addGetterSetter(vt,"clearBeforeDraw",!0);u.addGetterSetter(vt,"hitGraphEnabled",!0,st());class Le extends vt{constructor(t){super(t),this.listening(!1),m.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Le.prototype.nodeType="FastLayer";K(Le);class At extends et{_validateAdd(t){const e=t.getType();e!=="Group"&&e!=="Shape"&&m.throw("You may only add groups and shapes to groups.")}}At.prototype.nodeType="Group";K(At);const pe=(function(){return St.performance&&St.performance.now?function(){return St.performance.now()}:function(){return new Date().getTime()}})();class nt{constructor(t,e){this.id=nt.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:pe(),frameRate:0},this.func=t,this.setLayers(e)}setLayers(t){let e=[];return t&&(e=Array.isArray(t)?t:[t]),this.layers=e,this}getLayers(){return this.layers}addLayer(t){const e=this.layers,i=e.length;for(let n=0;n<i;n++)if(e[n]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const e=nt.animations,i=e.length;for(let n=0;n<i;n++)if(e[n].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=pe(),nt._addAnimation(this),this}stop(){return nt._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const e=t.id,i=this.animations,n=i.length;for(let s=0;s<n;s++)if(i[s].id===e){this.animations.splice(s,1);break}}static _runFrames(){const t={},e=this.animations;for(let i=0;i<e.length;i++){const n=e[i],s=n.layers,a=n.func;n._updateFrameObject(pe());const o=s.length;let h;if(a?h=a.call(n,n.frame)!==!1:h=!0,!!h)for(let l=0;l<o;l++){const c=s[l];c._id!==void 0&&(t[c._id]=c)}}for(const i in t)t.hasOwnProperty(i)&&t[i].batchDraw()}static _animationLoop(){const t=nt;t.animations.length?(t._runFrames(),m.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,m.requestAnimFrame(this._animationLoop))}}nt.animations=[];nt.animIdCounter=0;nt.animRunning=!1;const Jn={node:1,duration:1,easing:1,onFinish:1,yoyo:1},Zn=1,je=2,Ke=3,$e=["fill","stroke","shadowColor"];let ts=0;class es{constructor(t,e,i,n,s,a,o){this.prop=t,this.propFunc=e,this.begin=n,this._pos=n,this.duration=a,this._change=0,this.prevPos=0,this.yoyo=o,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=i,this._change=s-this.begin,this.pause()}fire(t){const e=this[t];e&&e()}setTime(t){t>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=je,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=Ke,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const t=this.getTimer()-this._startTime;this.state===je?this.setTime(t):this.state===Ke&&this.setTime(this.duration-t)}pause(){this.state=Zn,this.fire("onPause")}getTimer(){return new Date().getTime()}}class V{constructor(t){const e=this,i=t.node,n=i._id,s=t.easing||Ut.Linear,a=!!t.yoyo;let o,h;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=i,this._id=ts++;const l=i.getLayer()||(i instanceof k.Stage?i.getLayers():null);l||m.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new nt(function(){e.tween.onEnterFrame()},l),this.tween=new es(h,function(c){e._tweenFunc(c)},s,0,1,o*1e3,a),this._addListeners(),V.attrs[n]||(V.attrs[n]={}),V.attrs[n][this._id]||(V.attrs[n][this._id]={}),V.tweens[n]||(V.tweens[n]={});for(h in t)Jn[h]===void 0&&this._addAttr(h,t[h]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,e){const i=this.node,n=i._id;let s,a,o,h,l;const c=V.tweens[n][t];c&&delete V.attrs[n][c][t];let f=i.getAttr(t);if(m._isArray(e))if(s=[],a=Math.max(e.length,f.length),t==="points"&&e.length!==f.length&&(e.length>f.length?(h=f,f=m._prepareArrayForTween(f,e,i.closed())):(o=e,e=m._prepareArrayForTween(e,f,i.closed()))),t.indexOf("fill")===0)for(let d=0;d<a;d++)if(d%2===0)s.push(e[d]-f[d]);else{const p=m.colorToRGBA(f[d]);l=m.colorToRGBA(e[d]),f[d]=p,s.push({r:l.r-p.r,g:l.g-p.g,b:l.b-p.b,a:l.a-p.a})}else for(let d=0;d<a;d++)s.push(e[d]-f[d]);else $e.indexOf(t)!==-1?(f=m.colorToRGBA(f),l=m.colorToRGBA(e),s={r:l.r-f.r,g:l.g-f.g,b:l.b-f.b,a:l.a-f.a}):s=e-f;V.attrs[n][this._id][t]={start:f,diff:s,end:e,trueEnd:o,trueStart:h},V.tweens[n][t]=this._id}_tweenFunc(t){const e=this.node,i=V.attrs[e._id][this._id];let n,s,a,o,h,l,c,f;for(n in i){if(s=i[n],a=s.start,o=s.diff,f=s.end,m._isArray(a))if(h=[],c=Math.max(a.length,f.length),n.indexOf("fill")===0)for(l=0;l<c;l++)l%2===0?h.push((a[l]||0)+o[l]*t):h.push("rgba("+Math.round(a[l].r+o[l].r*t)+","+Math.round(a[l].g+o[l].g*t)+","+Math.round(a[l].b+o[l].b*t)+","+(a[l].a+o[l].a*t)+")");else for(l=0;l<c;l++)h.push((a[l]||0)+o[l]*t);else $e.indexOf(n)!==-1?h="rgba("+Math.round(a.r+o.r*t)+","+Math.round(a.g+o.g*t)+","+Math.round(a.b+o.b*t)+","+(a.a+o.a*t)+")":h=a+o*t;e.setAttr(n,h)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const t=this.node,e=V.attrs[t._id][this._id];e.points&&e.points.trueEnd&&t.setAttr("points",e.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const t=this.node,e=V.attrs[t._id][this._id];e.points&&e.points.trueStart&&t.points(e.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const t=this.node._id,e=this._id,i=V.tweens[t];this.pause(),this.anim&&this.anim.stop();for(const n in i)delete V.tweens[t][n];delete V.attrs[t][e],V.tweens[t]&&(Object.keys(V.tweens[t]).length===0&&delete V.tweens[t],Object.keys(V.attrs[t]).length===0&&delete V.attrs[t])}}V.attrs={};V.tweens={};T.prototype.to=function(r){const t=r.onFinish;r.node=this,r.onFinish=function(){this.destroy(),t&&t()},new V(r).play()};const Ut={BackEaseIn(r,t,e,i){return e*(r/=i)*r*((1.70158+1)*r-1.70158)+t},BackEaseOut(r,t,e,i){return e*((r=r/i-1)*r*((1.70158+1)*r+1.70158)+1)+t},BackEaseInOut(r,t,e,i){let n=1.70158;return(r/=i/2)<1?e/2*(r*r*(((n*=1.525)+1)*r-n))+t:e/2*((r-=2)*r*(((n*=1.525)+1)*r+n)+2)+t},ElasticEaseIn(r,t,e,i,n,s){let a=0;return r===0?t:(r/=i)===1?t+e:(s||(s=i*.3),!n||n<Math.abs(e)?(n=e,a=s/4):a=s/(2*Math.PI)*Math.asin(e/n),-(n*Math.pow(2,10*(r-=1))*Math.sin((r*i-a)*(2*Math.PI)/s))+t)},ElasticEaseOut(r,t,e,i,n,s){let a=0;return r===0?t:(r/=i)===1?t+e:(s||(s=i*.3),!n||n<Math.abs(e)?(n=e,a=s/4):a=s/(2*Math.PI)*Math.asin(e/n),n*Math.pow(2,-10*r)*Math.sin((r*i-a)*(2*Math.PI)/s)+e+t)},ElasticEaseInOut(r,t,e,i,n,s){let a=0;return r===0?t:(r/=i/2)===2?t+e:(s||(s=i*(.3*1.5)),!n||n<Math.abs(e)?(n=e,a=s/4):a=s/(2*Math.PI)*Math.asin(e/n),r<1?-.5*(n*Math.pow(2,10*(r-=1))*Math.sin((r*i-a)*(2*Math.PI)/s))+t:n*Math.pow(2,-10*(r-=1))*Math.sin((r*i-a)*(2*Math.PI)/s)*.5+e+t)},BounceEaseOut(r,t,e,i){return(r/=i)<1/2.75?e*(7.5625*r*r)+t:r<2/2.75?e*(7.5625*(r-=1.5/2.75)*r+.75)+t:r<2.5/2.75?e*(7.5625*(r-=2.25/2.75)*r+.9375)+t:e*(7.5625*(r-=2.625/2.75)*r+.984375)+t},BounceEaseIn(r,t,e,i){return e-Ut.BounceEaseOut(i-r,0,e,i)+t},BounceEaseInOut(r,t,e,i){return r<i/2?Ut.BounceEaseIn(r*2,0,e,i)*.5+t:Ut.BounceEaseOut(r*2-i,0,e,i)*.5+e*.5+t},EaseIn(r,t,e,i){return e*(r/=i)*r+t},EaseOut(r,t,e,i){return-e*(r/=i)*(r-2)+t},EaseInOut(r,t,e,i){return(r/=i/2)<1?e/2*r*r+t:-e/2*(--r*(r-2)-1)+t},StrongEaseIn(r,t,e,i){return e*(r/=i)*r*r*r*r+t},StrongEaseOut(r,t,e,i){return e*((r=r/i-1)*r*r*r*r+1)+t},StrongEaseInOut(r,t,e,i){return(r/=i/2)<1?e/2*r*r*r*r*r+t:e/2*((r-=2)*r*r*r*r+2)+t},Linear(r,t,e,i){return e*r/i+t}},Qe=m._assign(k,{Util:m,Transform:tt,Node:T,Container:et,Stage:le,stages:Yt,Layer:vt,FastLayer:Le,Group:At,DD:B,Shape:x,shapes:Xt,Animation:nt,Tween:V,Easings:Ut,Context:oe,Canvas:Re});class ot extends x{_sceneFunc(t){const e=k.getAngle(this.angle()),i=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,e,i),t.arc(0,0,this.innerRadius(),e,0,!i),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),e=this.outerRadius(),i=this.clockwise(),n=k.getAngle(i?360-this.angle():this.angle()),s=Math.cos(Math.min(n,Math.PI)),a=1,o=Math.sin(Math.min(Math.max(Math.PI,n),3*Math.PI/2)),h=Math.sin(Math.min(n,Math.PI/2)),l=s*(s>0?t:e),c=a*e,f=o*(o>0?t:e),d=h*(h>0?e:t);return{x:l,y:i?-1*d:f,width:c-l,height:d-f}}}ot.prototype._centroid=!0;ot.prototype.className="Arc";ot.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];K(ot);u.addGetterSetter(ot,"innerRadius",0,w());u.addGetterSetter(ot,"outerRadius",0,w());u.addGetterSetter(ot,"angle",0,w());u.addGetterSetter(ot,"clockwise",!1,st());function xe(r,t,e,i,n,s,a){const o=Math.sqrt(Math.pow(e-r,2)+Math.pow(i-t,2)),h=Math.sqrt(Math.pow(n-e,2)+Math.pow(s-i,2)),l=a*o/(o+h),c=a*h/(o+h),f=e-l*(n-r),d=i-l*(s-t),p=e+c*(n-r),g=i+c*(s-t);return[f,d,p,g]}function Je(r,t){const e=r.length,i=[];for(let n=2;n<e-2;n+=2){const s=xe(r[n-2],r[n-1],r[n],r[n+1],r[n+2],r[n+3],t);isNaN(s[0])||(i.push(s[0]),i.push(s[1]),i.push(r[n]),i.push(r[n+1]),i.push(s[2]),i.push(s[3]))}return i}function is(r){const t=[[r[0],r[2],r[4],r[6]],[r[1],r[3],r[5],r[7]]],e=[];for(const i of t){const n=-3*i[0]+9*i[1]-9*i[2]+3*i[3];if(n!==0){const s=6*i[0]-12*i[1]+6*i[2],a=-3*i[0]+3*i[1],o=s*s-4*n*a;if(o>=0){const h=Math.sqrt(o);e.push((-s+h)/(2*n)),e.push((-s-h)/(2*n))}}}return e.filter(i=>i>0&&i<1).flatMap(i=>t.map(n=>{const s=1-i;return s*s*s*n[0]+3*s*s*i*n[1]+3*s*i*i*n[2]+i*i*i*n[3]}))}class ht extends x{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){const e=this.points(),i=e.length,n=this.tension(),s=this.closed(),a=this.bezier();if(!i)return;let o=0;if(t.beginPath(),t.moveTo(e[0],e[1]),n!==0&&i>4){const h=this.getTensionPoints(),l=h.length;for(o=s?0:4,s||t.quadraticCurveTo(h[0],h[1],h[2],h[3]);o<l-2;)t.bezierCurveTo(h[o++],h[o++],h[o++],h[o++],h[o++],h[o++]);s||t.quadraticCurveTo(h[l-2],h[l-1],e[i-2],e[i-1])}else if(a)for(o=2;o<i;)t.bezierCurveTo(e[o++],e[o++],e[o++],e[o++],e[o++],e[o++]);else for(o=2;o<i;o+=2)t.lineTo(e[o],e[o+1]);s?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():Je(this.points(),this.tension())}_getTensionPointsClosed(){const t=this.points(),e=t.length,i=this.tension(),n=xe(t[e-2],t[e-1],t[0],t[1],t[2],t[3],i),s=xe(t[e-4],t[e-3],t[e-2],t[e-1],t[0],t[1],i),a=Je(t,i);return[n[2],n[3]].concat(a).concat([s[0],s[1],t[e-2],t[e-1],s[2],s[3],n[0],n[1],t[0],t[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:this.bezier()?t=[t[0],t[1],...is(this.points()),t[t.length-2],t[t.length-1]]:t=this.points();let e=t[0],i=t[0],n=t[1],s=t[1],a,o;for(let h=0;h<t.length/2;h++)a=t[h*2],o=t[h*2+1],e=Math.min(e,a),i=Math.max(i,a),n=Math.min(n,o),s=Math.max(s,o);return{x:e,y:n,width:i-e,height:s-n}}}ht.prototype.className="Line";ht.prototype._attrsAffectingSize=["points","bezier","tension"];K(ht);u.addGetterSetter(ht,"closed",!1);u.addGetterSetter(ht,"bezier",!1);u.addGetterSetter(ht,"tension",0,w());u.addGetterSetter(ht,"points",[],yn());const ns=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],ss=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],rs=[[1],[1,1],[1,2,1],[1,3,3,1]],Ze=(r,t,e)=>{let i,n;const a=e/2;i=0;for(let o=0;o<20;o++)n=a*ns[20][o]+a,i+=ss[20][o]*as(r,t,n);return a*i},ti=(r,t,e)=>{e===void 0&&(e=1);const i=r[0]-2*r[1]+r[2],n=t[0]-2*t[1]+t[2],s=2*r[1]-2*r[0],a=2*t[1]-2*t[0],o=4*(i*i+n*n),h=4*(i*s+n*a),l=s*s+a*a;if(o===0)return e*Math.sqrt(Math.pow(r[2]-r[0],2)+Math.pow(t[2]-t[0],2));const c=h/(2*o),f=l/o,d=e+c,p=f-c*c,g=d*d+p>0?Math.sqrt(d*d+p):0,b=c*c+p>0?Math.sqrt(c*c+p):0,S=c+Math.sqrt(c*c+p)!==0?p*Math.log(Math.abs((d+g)/(c+b))):0;return Math.sqrt(o)/2*(d*g-c*b+S)};function as(r,t,e){const i=we(1,e,r),n=we(1,e,t),s=i*i+n*n;return Math.sqrt(s)}const we=(r,t,e)=>{const i=e.length-1;let n,s;if(i===0)return 0;if(r===0){s=0;for(let a=0;a<=i;a++)s+=rs[i][a]*Math.pow(1-t,i-a)*Math.pow(t,a)*e[a];return s}else{n=new Array(i);for(let a=0;a<i;a++)n[a]=i*(e[a+1]-e[a]);return we(r-1,t,n)}},ei=(r,t,e)=>{let i=1,n=r/t,s=(r-e(n))/t,a=0;for(;i>.001;){const o=e(n+s),h=Math.abs(r-o)/t;if(h<i)i=h,n+=s;else{const l=e(n-s),c=Math.abs(r-l)/t;c<i?(i=c,n-=s):s/=2}if(a++,a>500)break}return n};class q extends x{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=q.parsePathData(this.data()),this.pathLength=q.getPathLength(this.dataArray)}_sceneFunc(t){const e=this.dataArray;t.beginPath();let i=!1;for(let n=0;n<e.length;n++){const s=e[n].command,a=e[n].points;switch(s){case"L":t.lineTo(a[0],a[1]);break;case"M":t.moveTo(a[0],a[1]);break;case"C":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"Q":t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case"A":const o=a[0],h=a[1],l=a[2],c=a[3],f=a[4],d=a[5],p=a[6],g=a[7],b=l>c?l:c,S=l>c?1:l/c,y=l>c?c/l:1;t.translate(o,h),t.rotate(p),t.scale(S,y),t.arc(0,0,b,f,f+d,1-g),t.scale(1/S,1/y),t.rotate(-p),t.translate(-o,-h);break;case"z":i=!0,t.closePath();break}}!i&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){let t=[];this.dataArray.forEach(function(h){if(h.command==="A"){const l=h.points[4],c=h.points[5],f=h.points[4]+c;let d=Math.PI/180;if(Math.abs(l-f)<d&&(d=Math.abs(l-f)),c<0)for(let p=l-d;p>f;p-=d){const g=q.getPointOnEllipticalArc(h.points[0],h.points[1],h.points[2],h.points[3],p,0);t.push(g.x,g.y)}else for(let p=l+d;p<f;p+=d){const g=q.getPointOnEllipticalArc(h.points[0],h.points[1],h.points[2],h.points[3],p,0);t.push(g.x,g.y)}}else if(h.command==="C")for(let l=0;l<=1;l+=.01){const c=q.getPointOnCubicBezier(l,h.start.x,h.start.y,h.points[0],h.points[1],h.points[2],h.points[3],h.points[4],h.points[5]);t.push(c.x,c.y)}else t=t.concat(h.points)});let e=t[0],i=t[0],n=t[1],s=t[1],a,o;for(let h=0;h<t.length/2;h++)a=t[h*2],o=t[h*2+1],isNaN(a)||(e=Math.min(e,a),i=Math.max(i,a)),isNaN(o)||(n=Math.min(n,o),s=Math.max(s,o));return{x:e,y:n,width:i-e,height:s-n}}getLength(){return this.pathLength}getPointAtLength(t){return q.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,e,i,n){return Math.sqrt((i-t)*(i-t)+(n-e)*(n-e))}static getPathLength(t){let e=0;for(let i=0;i<t.length;++i)e+=t[i].pathLength;return e}static getPointAtLengthOfDataArray(t,e){let i,n=0,s=e.length;if(!s)return null;for(;n<s&&t>e[n].pathLength;)t-=e[n].pathLength,++n;if(n===s)return i=e[n-1].points.slice(-2),{x:i[0],y:i[1]};if(t<.01)return e[n].command==="M"?(i=e[n].points.slice(0,2),{x:i[0],y:i[1]}):{x:e[n].start.x,y:e[n].start.y};const a=e[n],o=a.points;switch(a.command){case"L":return q.getPointOnLine(t,a.start.x,a.start.y,o[0],o[1]);case"C":return q.getPointOnCubicBezier(ei(t,q.getPathLength(e),b=>Ze([a.start.x,o[0],o[2],o[4]],[a.start.y,o[1],o[3],o[5]],b)),a.start.x,a.start.y,o[0],o[1],o[2],o[3],o[4],o[5]);case"Q":return q.getPointOnQuadraticBezier(ei(t,q.getPathLength(e),b=>ti([a.start.x,o[0],o[2]],[a.start.y,o[1],o[3]],b)),a.start.x,a.start.y,o[0],o[1],o[2],o[3]);case"A":const h=o[0],l=o[1],c=o[2],f=o[3],d=o[5],p=o[6];let g=o[4];return g+=d*t/a.pathLength,q.getPointOnEllipticalArc(h,l,c,f,g,p)}return null}static getPointOnLine(t,e,i,n,s,a,o){a=a??e,o=o??i;const h=this.getLineLength(e,i,n,s);if(h<1e-10)return{x:e,y:i};if(n===e)return{x:a,y:o+(s>i?t:-t)};const l=(s-i)/(n-e),c=Math.sqrt(t*t/(1+l*l))*(n<e?-1:1),f=l*c;if(Math.abs(o-i-l*(a-e))<1e-10)return{x:a+c,y:o+f};const d=((a-e)*(n-e)+(o-i)*(s-i))/(h*h),p=e+d*(n-e),g=i+d*(s-i),b=this.getLineLength(a,o,p,g),S=Math.sqrt(t*t-b*b),y=Math.sqrt(S*S/(1+l*l))*(n<e?-1:1),_=l*y;return{x:p+y,y:g+_}}static getPointOnCubicBezier(t,e,i,n,s,a,o,h,l){function c(S){return S*S*S}function f(S){return 3*S*S*(1-S)}function d(S){return 3*S*(1-S)*(1-S)}function p(S){return(1-S)*(1-S)*(1-S)}const g=h*c(t)+a*f(t)+n*d(t)+e*p(t),b=l*c(t)+o*f(t)+s*d(t)+i*p(t);return{x:g,y:b}}static getPointOnQuadraticBezier(t,e,i,n,s,a,o){function h(p){return p*p}function l(p){return 2*p*(1-p)}function c(p){return(1-p)*(1-p)}const f=a*h(t)+n*l(t)+e*c(t),d=o*h(t)+s*l(t)+i*c(t);return{x:f,y:d}}static getPointOnEllipticalArc(t,e,i,n,s,a){const o=Math.cos(a),h=Math.sin(a),l={x:i*Math.cos(s),y:n*Math.sin(s)};return{x:t+(l.x*o-l.y*h),y:e+(l.x*h+l.y*o)}}static parsePathData(t){if(!t)return[];let e=t;const i=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];e=e.replace(new RegExp(" ","g"),",");for(let f=0;f<i.length;f++)e=e.replace(new RegExp(i[f],"g"),"|"+i[f]);const n=e.split("|"),s=[],a=[];let o=0,h=0;const l=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let c;for(let f=1;f<n.length;f++){let d=n[f],p=d.charAt(0);for(d=d.slice(1),a.length=0;c=l.exec(d);)a.push(c[0]);let g=[],b=p==="A"||p==="a"?0:-1;for(let S=0,y=a.length;S<y;S++){const _=a[S];if(_==="00"){g.push(0,0),b>=0&&(b+=2,b>=7&&(b-=7));continue}if(b>=0){if(b===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(_)){g.push(parseInt(_[0],10)),g.push(parseInt(_[1],10)),g.push(parseFloat(_.slice(2))),b+=3,b>=7&&(b-=7);continue}if(_==="11"||_==="10"||_==="01"){g.push(parseInt(_[0],10)),g.push(parseInt(_[1],10)),b+=2,b>=7&&(b-=7);continue}if(_==="0"||_==="1"){g.push(parseInt(_,10)),b+=1,b>=7&&(b-=7);continue}}else if(b===4){if(/^[01]\d+(?:\.\d+)?$/.test(_)){g.push(parseInt(_[0],10)),g.push(parseFloat(_.slice(1))),b+=2,b>=7&&(b-=7);continue}if(_==="0"||_==="1"){g.push(parseInt(_,10)),b+=1,b>=7&&(b-=7);continue}}const C=parseFloat(_);isNaN(C)?g.push(0):g.push(C),b+=1,b>=7&&(b-=7)}else{const C=parseFloat(_);isNaN(C)?g.push(0):g.push(C)}}for(;g.length>0&&!isNaN(g[0]);){let S="",y=[];const _=o,C=h;let v,A,P,M,E,G,D,H,L,W;switch(p){case"l":o+=g.shift(),h+=g.shift(),S="L",y.push(o,h);break;case"L":o=g.shift(),h=g.shift(),y.push(o,h);break;case"m":const F=g.shift(),I=g.shift();if(o+=F,h+=I,S="M",s.length>2&&s[s.length-1].command==="z"){for(let R=s.length-2;R>=0;R--)if(s[R].command==="M"){o=s[R].points[0]+F,h=s[R].points[1]+I;break}}y.push(o,h),p="l";break;case"M":o=g.shift(),h=g.shift(),S="M",y.push(o,h),p="L";break;case"h":o+=g.shift(),S="L",y.push(o,h);break;case"H":o=g.shift(),S="L",y.push(o,h);break;case"v":h+=g.shift(),S="L",y.push(o,h);break;case"V":h=g.shift(),S="L",y.push(o,h);break;case"C":y.push(g.shift(),g.shift(),g.shift(),g.shift()),o=g.shift(),h=g.shift(),y.push(o,h);break;case"c":y.push(o+g.shift(),h+g.shift(),o+g.shift(),h+g.shift()),o+=g.shift(),h+=g.shift(),S="C",y.push(o,h);break;case"S":A=o,P=h,v=s[s.length-1],v.command==="C"&&(A=o+(o-v.points[2]),P=h+(h-v.points[3])),y.push(A,P,g.shift(),g.shift()),o=g.shift(),h=g.shift(),S="C",y.push(o,h);break;case"s":A=o,P=h,v=s[s.length-1],v.command==="C"&&(A=o+(o-v.points[2]),P=h+(h-v.points[3])),y.push(A,P,o+g.shift(),h+g.shift()),o+=g.shift(),h+=g.shift(),S="C",y.push(o,h);break;case"Q":y.push(g.shift(),g.shift()),o=g.shift(),h=g.shift(),y.push(o,h);break;case"q":y.push(o+g.shift(),h+g.shift()),o+=g.shift(),h+=g.shift(),S="Q",y.push(o,h);break;case"T":A=o,P=h,v=s[s.length-1],v.command==="Q"&&(A=o+(o-v.points[0]),P=h+(h-v.points[1])),o=g.shift(),h=g.shift(),S="Q",y.push(A,P,o,h);break;case"t":A=o,P=h,v=s[s.length-1],v.command==="Q"&&(A=o+(o-v.points[0]),P=h+(h-v.points[1])),o+=g.shift(),h+=g.shift(),S="Q",y.push(A,P,o,h);break;case"A":M=g.shift(),E=g.shift(),G=g.shift(),D=g.shift(),H=g.shift(),L=o,W=h,o=g.shift(),h=g.shift(),S="A",y=this.convertEndpointToCenterParameterization(L,W,o,h,D,H,M,E,G);break;case"a":M=g.shift(),E=g.shift(),G=g.shift(),D=g.shift(),H=g.shift(),L=o,W=h,o+=g.shift(),h+=g.shift(),S="A",y=this.convertEndpointToCenterParameterization(L,W,o,h,D,H,M,E,G);break}s.push({command:S||p,points:y,start:{x:_,y:C},pathLength:this.calcLength(_,C,S||p,y)})}(p==="z"||p==="Z")&&s.push({command:"z",points:[],start:void 0,pathLength:0})}return s}static calcLength(t,e,i,n){let s,a,o,h;const l=q;switch(i){case"L":return l.getLineLength(t,e,n[0],n[1]);case"C":return Ze([t,n[0],n[2],n[4]],[e,n[1],n[3],n[5]],1);case"Q":return ti([t,n[0],n[2]],[e,n[1],n[3]],1);case"A":s=0;const c=n[4],f=n[5],d=n[4]+f;let p=Math.PI/180;if(Math.abs(c-d)<p&&(p=Math.abs(c-d)),a=l.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],c,0),f<0)for(h=c-p;h>d;h-=p)o=l.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],h,0),s+=l.getLineLength(a.x,a.y,o.x,o.y),a=o;else for(h=c+p;h<d;h+=p)o=l.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],h,0),s+=l.getLineLength(a.x,a.y,o.x,o.y),a=o;return o=l.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],d,0),s+=l.getLineLength(a.x,a.y,o.x,o.y),s}return 0}static convertEndpointToCenterParameterization(t,e,i,n,s,a,o,h,l){const c=l*(Math.PI/180),f=Math.cos(c)*(t-i)/2+Math.sin(c)*(e-n)/2,d=-1*Math.sin(c)*(t-i)/2+Math.cos(c)*(e-n)/2,p=f*f/(o*o)+d*d/(h*h);p>1&&(o*=Math.sqrt(p),h*=Math.sqrt(p));let g=Math.sqrt((o*o*(h*h)-o*o*(d*d)-h*h*(f*f))/(o*o*(d*d)+h*h*(f*f)));s===a&&(g*=-1),isNaN(g)&&(g=0);const b=g*o*d/h,S=g*-h*f/o,y=(t+i)/2+Math.cos(c)*b-Math.sin(c)*S,_=(e+n)/2+Math.sin(c)*b+Math.cos(c)*S,C=function(D){return Math.sqrt(D[0]*D[0]+D[1]*D[1])},v=function(D,H){return(D[0]*H[0]+D[1]*H[1])/(C(D)*C(H))},A=function(D,H){return(D[0]*H[1]<D[1]*H[0]?-1:1)*Math.acos(v(D,H))},P=A([1,0],[(f-b)/o,(d-S)/h]),M=[(f-b)/o,(d-S)/h],E=[(-1*f-b)/o,(-1*d-S)/h];let G=A(M,E);return v(M,E)<=-1&&(G=Math.PI),v(M,E)>=1&&(G=0),a===0&&G>0&&(G=G-2*Math.PI),a===1&&G<0&&(G=G+2*Math.PI),[y,_,o,h,P,G,c,a]}}q.prototype.className="Path";q.prototype._attrsAffectingSize=["data"];K(q);u.addGetterSetter(q,"data");class Ct extends ht{_sceneFunc(t){super._sceneFunc(t);const e=Math.PI*2,i=this.points();let n=i;const s=this.tension()!==0&&i.length>4;s&&(n=this.getTensionPoints());const a=this.pointerLength(),o=i.length;let h,l;if(s){const d=[n[n.length-4],n[n.length-3],n[n.length-2],n[n.length-1],i[o-2],i[o-1]],p=q.calcLength(n[n.length-4],n[n.length-3],"C",d),g=q.getPointOnQuadraticBezier(Math.min(1,1-a/p),d[0],d[1],d[2],d[3],d[4],d[5]);h=i[o-2]-g.x,l=i[o-1]-g.y}else h=i[o-2]-i[o-4],l=i[o-1]-i[o-3];const c=(Math.atan2(l,h)+e)%e,f=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(i[o-2],i[o-1]),t.rotate(c),t.moveTo(0,0),t.lineTo(-a,f/2),t.lineTo(-a,-f/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(i[0],i[1]),s?(h=(n[0]+n[2])/2-i[0],l=(n[1]+n[3])/2-i[1]):(h=i[2]-i[0],l=i[3]-i[1]),t.rotate((Math.atan2(-l,-h)+e)%e),t.moveTo(0,0),t.lineTo(-a,f/2),t.lineTo(-a,-f/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){const e=this.dashEnabled();e&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),e&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),e=this.pointerWidth()/2;return{x:t.x,y:t.y-e,width:t.width,height:t.height+e*2}}}Ct.prototype.className="Arrow";K(Ct);u.addGetterSetter(Ct,"pointerLength",10,w());u.addGetterSetter(Ct,"pointerWidth",10,w());u.addGetterSetter(Ct,"pointerAtBeginning",!1);u.addGetterSetter(Ct,"pointerAtEnding",!0);class Et extends x{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}}Et.prototype._centroid=!0;Et.prototype.className="Circle";Et.prototype._attrsAffectingSize=["radius"];K(Et);u.addGetterSetter(Et,"radius",0,w());class pt extends x{_sceneFunc(t){const e=this.radiusX(),i=this.radiusY();t.beginPath(),t.save(),e!==i&&t.scale(1,i/e),t.arc(0,0,e,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}pt.prototype.className="Ellipse";pt.prototype._centroid=!0;pt.prototype._attrsAffectingSize=["radiusX","radiusY"];K(pt);u.addComponentsGetterSetter(pt,"radius",["x","y"]);u.addGetterSetter(pt,"radiusX",0,w());u.addGetterSetter(pt,"radiusY",0,w());class it extends x{constructor(t){super(t),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",e=>{this._removeImageLoad(e.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",this._loadListener)}_removeImageLoad(t){t&&t.removeEventListener&&t.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const t=!!this.cornerRadius(),e=this.hasShadow();return t&&e?!0:super._useBufferCanvas(!0)}_sceneFunc(t){const e=this.getWidth(),i=this.getHeight(),n=this.cornerRadius(),s=this.attrs.image;let a;if(s){const o=this.attrs.cropWidth,h=this.attrs.cropHeight;o&&h?a=[s,this.cropX(),this.cropY(),o,h,0,0,e,i]:a=[s,0,0,e,i]}(this.hasFill()||this.hasStroke()||n)&&(t.beginPath(),n?m.drawRoundedRectPath(t,e,i,n):t.rect(0,0,e,i),t.closePath(),t.fillStrokeShape(this)),s&&(n&&t.clip(),t.drawImage.apply(t,a))}_hitFunc(t){const e=this.width(),i=this.height(),n=this.cornerRadius();t.beginPath(),n?m.drawRoundedRectPath(t,e,i,n):t.rect(0,0,e,i),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,e,i;return(i=(t=this.attrs.width)!==null&&t!==void 0?t:(e=this.image())===null||e===void 0?void 0:e.width)!==null&&i!==void 0?i:0}getHeight(){var t,e,i;return(i=(t=this.attrs.height)!==null&&t!==void 0?t:(e=this.image())===null||e===void 0?void 0:e.height)!==null&&i!==void 0?i:0}static fromURL(t,e,i=null){const n=m.createImageElement();n.onload=function(){const s=new it({image:n});e(s)},n.onerror=i,n.crossOrigin="Anonymous",n.src=t}}it.prototype.className="Image";it.prototype._attrsAffectingSize=["image"];K(it);u.addGetterSetter(it,"cornerRadius",0,he(4));u.addGetterSetter(it,"image");u.addComponentsGetterSetter(it,"crop",["x","y","width","height"]);u.addGetterSetter(it,"cropX",0,w());u.addGetterSetter(it,"cropY",0,w());u.addGetterSetter(it,"cropWidth",0,w());u.addGetterSetter(it,"cropHeight",0,w());const Ri=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],os="Change.konva",hs="none",Te="up",Pe="right",ke="down",Ae="left",ls=Ri.length;class Ie extends At{constructor(t){super(t),this.on("add.konva",function(e){this._addListeners(e.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){let e=this,i;const n=function(){e._sync()};for(i=0;i<ls;i++)t.on(Ri[i]+os,n)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let t=this.getText(),e=this.getTag(),i,n,s,a,o,h,l;if(t&&e){switch(i=t.width(),n=t.height(),s=e.pointerDirection(),a=e.pointerWidth(),l=e.pointerHeight(),o=0,h=0,s){case Te:o=i/2,h=-1*l;break;case Pe:o=i+a,h=n/2;break;case ke:o=i/2,h=n+l;break;case Ae:o=-1*a,h=n/2;break}e.setAttrs({x:-1*o,y:-1*h,width:i,height:n}),t.setAttrs({x:-1*o,y:-1*h})}}}Ie.prototype.className="Label";K(Ie);class xt extends x{_sceneFunc(t){const e=this.width(),i=this.height(),n=this.pointerDirection(),s=this.pointerWidth(),a=this.pointerHeight(),o=this.cornerRadius();let h=0,l=0,c=0,f=0;typeof o=="number"?h=l=c=f=Math.min(o,e/2,i/2):(h=Math.min(o[0]||0,e/2,i/2),l=Math.min(o[1]||0,e/2,i/2),f=Math.min(o[2]||0,e/2,i/2),c=Math.min(o[3]||0,e/2,i/2)),t.beginPath(),t.moveTo(h,0),n===Te&&(t.lineTo((e-s)/2,0),t.lineTo(e/2,-1*a),t.lineTo((e+s)/2,0)),t.lineTo(e-l,0),t.arc(e-l,l,l,Math.PI*3/2,0,!1),n===Pe&&(t.lineTo(e,(i-a)/2),t.lineTo(e+s,i/2),t.lineTo(e,(i+a)/2)),t.lineTo(e,i-f),t.arc(e-f,i-f,f,0,Math.PI/2,!1),n===ke&&(t.lineTo((e+s)/2,i),t.lineTo(e/2,i+a),t.lineTo((e-s)/2,i)),t.lineTo(c,i),t.arc(c,i-c,c,Math.PI/2,Math.PI,!1),n===Ae&&(t.lineTo(0,(i+a)/2),t.lineTo(-1*s,i/2),t.lineTo(0,(i-a)/2)),t.lineTo(0,h),t.arc(h,h,h,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){let t=0,e=0,i=this.pointerWidth(),n=this.pointerHeight(),s=this.pointerDirection(),a=this.width(),o=this.height();return s===Te?(e-=n,o+=n):s===ke?o+=n:s===Ae?(t-=i*1.5,a+=i):s===Pe&&(a+=i*1.5),{x:t,y:e,width:a,height:o}}}xt.prototype.className="Tag";K(xt);u.addGetterSetter(xt,"pointerDirection",hs);u.addGetterSetter(xt,"pointerWidth",0,w());u.addGetterSetter(xt,"pointerHeight",0,w());u.addGetterSetter(xt,"cornerRadius",0,he(4));class qt extends x{_sceneFunc(t){const e=this.cornerRadius(),i=this.width(),n=this.height();t.beginPath(),e?m.drawRoundedRectPath(t,i,n,e):t.rect(0,0,i,n),t.closePath(),t.fillStrokeShape(this)}}qt.prototype.className="Rect";K(qt);u.addGetterSetter(qt,"cornerRadius",0,he(4));class mt extends x{_sceneFunc(t){const e=this._getPoints(),i=this.radius(),n=this.sides(),s=this.cornerRadius();if(t.beginPath(),s)m.drawRoundedPolygonPath(t,e,n,i,s);else{t.moveTo(e[0].x,e[0].y);for(let a=1;a<e.length;a++)t.lineTo(e[a].x,e[a].y)}t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,e=this.attrs.radius||0,i=[];for(let n=0;n<t;n++)i.push({x:e*Math.sin(n*2*Math.PI/t),y:-1*e*Math.cos(n*2*Math.PI/t)});return i}getSelfRect(){const t=this._getPoints();let e=t[0].x,i=t[0].x,n=t[0].y,s=t[0].y;return t.forEach(a=>{e=Math.min(e,a.x),i=Math.max(i,a.x),n=Math.min(n,a.y),s=Math.max(s,a.y)}),{x:e,y:n,width:i-e,height:s-n}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}mt.prototype.className="RegularPolygon";mt.prototype._centroid=!0;mt.prototype._attrsAffectingSize=["radius"];K(mt);u.addGetterSetter(mt,"radius",0,w());u.addGetterSetter(mt,"sides",0,w());u.addGetterSetter(mt,"cornerRadius",0,he(4));const ii=Math.PI*2;class wt extends x{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,ii,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),ii,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}wt.prototype.className="Ring";wt.prototype._centroid=!0;wt.prototype._attrsAffectingSize=["innerRadius","outerRadius"];K(wt);u.addGetterSetter(wt,"innerRadius",0,w());u.addGetterSetter(wt,"outerRadius",0,w());class rt extends x{constructor(t){super(t),this._updated=!0,this.anim=new nt(()=>{const e=this._updated;return this._updated=!1,e}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){const e=this.animation(),i=this.frameIndex(),n=i*4,s=this.animations()[e],a=this.frameOffsets(),o=s[n+0],h=s[n+1],l=s[n+2],c=s[n+3],f=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,l,c),t.closePath(),t.fillStrokeShape(this)),f)if(a){const d=a[e],p=i*2;t.drawImage(f,o,h,l,c,d[p+0],d[p+1],l,c)}else t.drawImage(f,o,h,l,c,0,0,l,c)}_hitFunc(t){const e=this.animation(),i=this.frameIndex(),n=i*4,s=this.animations()[e],a=this.frameOffsets(),o=s[n+2],h=s[n+3];if(t.beginPath(),a){const l=a[e],c=i*2;t.rect(l[c+0],l[c+1],o,h)}else t.rect(0,0,o,h);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const t=this.frameIndex(),e=this.animation(),i=this.animations(),n=i[e],s=n.length/4;t<s-1?this.frameIndex(t+1):this.frameIndex(0)}}rt.prototype.className="Sprite";K(rt);u.addGetterSetter(rt,"animation");u.addGetterSetter(rt,"animations");u.addGetterSetter(rt,"frameOffsets");u.addGetterSetter(rt,"image");u.addGetterSetter(rt,"frameIndex",0,w());u.addGetterSetter(rt,"frameRate",17,w());u.backCompat(rt,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class _t extends x{_sceneFunc(t){const e=this.innerRadius(),i=this.outerRadius(),n=this.numPoints();t.beginPath(),t.moveTo(0,0-i);for(let s=1;s<n*2;s++){const a=s%2===0?i:e,o=a*Math.sin(s*Math.PI/n),h=-1*a*Math.cos(s*Math.PI/n);t.lineTo(o,h)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}_t.prototype.className="Star";_t.prototype._centroid=!0;_t.prototype._attrsAffectingSize=["innerRadius","outerRadius"];K(_t);u.addGetterSetter(_t,"numPoints",5,w());u.addGetterSetter(_t,"innerRadius",0,w());u.addGetterSetter(_t,"outerRadius",0,w());function dt(r){return[...r].reduce((t,e,i,n)=>{if(/\p{Emoji}/u.test(e)){const s=n[i+1];s&&/\p{Emoji_Modifier}|\u200D/u.test(s)?(t.push(e+s),n[i+1]=""):t.push(e)}else/\p{Regional_Indicator}{2}/u.test(e+(n[i+1]||""))?t.push(e+n[i+1]):i>0&&/\p{Mn}|\p{Me}|\p{Mc}/u.test(e)?t[t.length-1]+=e:e&&t.push(e);return t},[])}const Pt="auto",cs="center",Mi="inherit",Lt="justify",ds="Change.konva",Gi="2d",ni="-",Oi="left",fs="text",us="Text",gs="top",ps="bottom",si="middle",Li="normal",ms="px ",ee=" ",_s="right",ri="rtl",ys="word",Ss="char",ai="none",me="…",Ii=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],bs=Ii.length;let It=null;function vs(){if(It!==null)return It;It=!1;try{const r=document.createElement("canvas");r.width=10,r.height=10;const t=r.getContext(Gi);if(t){t.globalAlpha=0,t.shadowColor="black",t.shadowBlur=5,t.shadowOffsetX=5,t.shadowOffsetY=5,t.fillStyle="black",t.font="10px Arial",t.fillText("X",0,10);const e=t.getImageData(0,0,10,10).data;for(let i=3;i<e.length;i+=4)if(e[i]>0){It=!0;break}}}catch{}return It}function Cs(r){return r.split(",").map(t=>{t=t.trim();const e=t.indexOf(" ")>=0,i=t.indexOf('"')>=0||t.indexOf("'")>=0;return e&&!i&&(t=`"${t}"`),t}).join(", ")}let ie;function _e(){return ie||(ie=m.createCanvasElement().getContext(Gi),ie)}function xs(r){r.fillText(this._partialText,this._partialTextX,this._partialTextY)}function ws(r){r.setAttr("miterLimit",2),r.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Ts(r){return r=r||{},!r.fillLinearGradientColorStops&&!r.fillRadialGradientColorStops&&!r.fillPatternImage&&(r.fill=r.fill||"black"),r}class j extends x{constructor(t){super(Ts(t)),this._partialTextX=0,this._partialTextY=0;for(let e=0;e<bs;e++)this.on(Ii[e]+ds,this._setTextData);this._setTextData()}_sceneFunc(t){var e,i;const n=this.textArr,s=n.length;if(!this.text())return;let a=this.padding(),o=this.fontSize(),h=this.lineHeight()*o,l=this.verticalAlign(),c=this.direction(),f=0,d=this.align(),p=this.getWidth(),g=this.letterSpacing(),b=this.charRenderFunc(),S=this.fill(),y=this.textDecoration(),_=this.underlineOffset(),C=y.indexOf("underline")!==-1,v=y.indexOf("line-through")!==-1,A;c=c===Mi?t.direction:c;let P=h/2,M=si;if(!k.legacyTextRendering){const E=this.measureSize("M");M="alphabetic";const G=(e=E.fontBoundingBoxAscent)!==null&&e!==void 0?e:E.actualBoundingBoxAscent,D=(i=E.fontBoundingBoxDescent)!==null&&i!==void 0?i:E.actualBoundingBoxDescent;P=(G-D)/2+h/2}for(c===ri&&t.setAttr("direction",c),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",M),t.setAttr("textAlign",Oi),l===si?f=(this.getHeight()-s*h-a*2)/2:l===ps&&(f=this.getHeight()-s*h-a*2),t.translate(a,f+a),A=0;A<s;A++){let E=0,G=0;const D=n[A],H=D.text,L=D.width,W=D.lastInParagraph;if(t.save(),d===_s?E+=p-L-a*2:d===cs&&(E+=(p-L-a*2)/2),C){t.save(),t.beginPath();const I=_??(k.legacyTextRendering?Math.round(o/2):Math.round(o/4)),R=E,U=P+G+I;t.moveTo(R,U);const O=d===Lt&&!W?p-a*2:L;t.lineTo(R+Math.round(O),U),t.lineWidth=o/15;const Y=this._getLinearGradient();t.strokeStyle=Y||S,t.stroke(),t.restore()}const F=E;if(c!==ri&&(g!==0||d===Lt||b)){const I=H.split(" ").length-1,R=dt(H);for(let U=0;U<R.length;U++){const O=R[U];if(O===" "&&!W&&d===Lt&&(E+=(p-a*2-L)/I),this._partialTextX=E,this._partialTextY=P+G,this._partialText=O,b){t.save();const J=n.slice(0,A).reduce(($,Z)=>$+dt(Z.text).length,0),z=U+J;b({char:O,index:z,x:E,y:P+G,lineIndex:A,column:U,isLastInLine:W,width:this.measureSize(O).width,context:t})}t.fillStrokeShape(this),b&&t.restore(),E+=this.measureSize(O).width+g}}else g!==0&&t.setAttr("letterSpacing",`${g}px`),this._partialTextX=E,this._partialTextY=P+G,this._partialText=H,t.fillStrokeShape(this);if(v){t.save(),t.beginPath();const I=k.legacyTextRendering?0:-Math.round(o/4),R=F;t.moveTo(R,P+G+I);const U=d===Lt&&!W?p-a*2:L;t.lineTo(R+Math.round(U),P+G+I),t.lineWidth=o/15;const O=this._getLinearGradient();t.strokeStyle=O||S,t.stroke(),t.restore()}t.restore(),s>1&&(P+=h)}}_hitFunc(t){const e=this.getWidth(),i=this.getHeight();t.beginPath(),t.rect(0,0,e,i),t.closePath(),t.fillStrokeShape(this)}setText(t){const e=m._isString(t)?t:t==null?"":t+"";return this._setAttr(fs,e),this}getWidth(){return this.attrs.width===Pt||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Pt||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return m.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var e,i,n,s,a,o,h,l,c,f,d;let p=_e(),g=this.fontSize(),b;p.save(),p.font=this._getContextFont(),b=p.measureText(t),p.restore();const S=g/100;return{actualBoundingBoxAscent:(e=b.actualBoundingBoxAscent)!==null&&e!==void 0?e:71.58203125*S,actualBoundingBoxDescent:(i=b.actualBoundingBoxDescent)!==null&&i!==void 0?i:0,actualBoundingBoxLeft:(n=b.actualBoundingBoxLeft)!==null&&n!==void 0?n:-7.421875*S,actualBoundingBoxRight:(s=b.actualBoundingBoxRight)!==null&&s!==void 0?s:75.732421875*S,alphabeticBaseline:(a=b.alphabeticBaseline)!==null&&a!==void 0?a:0,emHeightAscent:(o=b.emHeightAscent)!==null&&o!==void 0?o:100*S,emHeightDescent:(h=b.emHeightDescent)!==null&&h!==void 0?h:-20*S,fontBoundingBoxAscent:(l=b.fontBoundingBoxAscent)!==null&&l!==void 0?l:91*S,fontBoundingBoxDescent:(c=b.fontBoundingBoxDescent)!==null&&c!==void 0?c:21*S,hangingBaseline:(f=b.hangingBaseline)!==null&&f!==void 0?f:72.80000305175781*S,ideographicBaseline:(d=b.ideographicBaseline)!==null&&d!==void 0?d:-21*S,width:b.width,height:g}}_getContextFont(){return this.fontStyle()+ee+this.fontVariant()+ee+(this.fontSize()+ms)+Cs(this.fontFamily())}_addTextLine(t){this.align()===Lt&&(t=t.trim());const i=this._getTextWidth(t);return this.textArr.push({text:t,width:i,lastInParagraph:!1})}_getTextWidth(t){const e=this.letterSpacing(),i=t.length;return _e().measureText(t).width+e*i}_setTextData(){let t=this.text().split(`
|
|
15
|
+
`),e=+this.fontSize(),i=0,n=this.lineHeight()*e,s=this.attrs.width,a=this.attrs.height,o=s!==Pt&&s!==void 0,h=a!==Pt&&a!==void 0,l=this.padding(),c=s-l*2,f=a-l*2,d=0,p=this.wrap(),g=p!==ai,b=p!==Ss&&g,S=this.ellipsis();this.textArr=[],_e().font=this._getContextFont();const y=S?this._getTextWidth(me):0;for(let _=0,C=t.length;_<C;++_){let v=t[_],A=this._getTextWidth(v);if(o&&A>c)for(;v.length>0;){let P=0,M=dt(v).length,E="",G=0;for(;P<M;){const D=P+M>>>1,H=dt(v),L=H.slice(0,D+1).join(""),W=this._getTextWidth(L);(S&&h&&d+n>f?W+y:W)<=c?(P=D+1,E=L,G=W):M=D}if(E){if(b){const L=dt(v),W=dt(E),F=L[W.length],I=F===ee||F===ni;let R;if(I&&G<=c)R=W.length;else{const U=W.lastIndexOf(ee),O=W.lastIndexOf(ni);R=Math.max(U,O)+1}R>0&&(P=R,E=L.slice(0,P).join(""),G=this._getTextWidth(E))}if(E=E.trimRight(),this._addTextLine(E),i=Math.max(i,G),d+=n,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if(v=dt(v).slice(P).join("").trimLeft(),v.length>0&&(A=this._getTextWidth(v),A<=c)){this._addTextLine(v),d+=n,i=Math.max(i,A);break}}else break}else this._addTextLine(v),d+=n,i=Math.max(i,A),this._shouldHandleEllipsis(d)&&_<C-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),h&&d+n>f)break}this.textHeight=e,this.textWidth=i}_shouldHandleEllipsis(t){const e=+this.fontSize(),i=this.lineHeight()*e,n=this.attrs.height,s=n!==Pt&&n!==void 0,a=this.padding(),o=n-a*2;return!(this.wrap()!==ai)||s&&t+i>o}_tryToAddEllipsisToLastLine(){const t=this.attrs.width,e=t!==Pt&&t!==void 0,i=this.padding(),n=t-i*2,s=this.ellipsis(),a=this.textArr[this.textArr.length-1];!a||!s||(e&&(this._getTextWidth(a.text+me)<n||(a.text=a.text.slice(0,a.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(a.text+me))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,e=this.hasShadow();return t&&e||e&&this.getAbsoluteOpacity()!==1&&vs()?!0:super._useBufferCanvas()}}j.prototype._fillFunc=xs;j.prototype._strokeFunc=ws;j.prototype.className=us;j.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];K(j);u.overWriteSetter(j,"width",Ge());u.overWriteSetter(j,"height",Ge());u.addGetterSetter(j,"direction",Mi);u.addGetterSetter(j,"fontFamily","Arial");u.addGetterSetter(j,"fontSize",12,w());u.addGetterSetter(j,"fontStyle",Li);u.addGetterSetter(j,"fontVariant",Li);u.addGetterSetter(j,"padding",0,w());u.addGetterSetter(j,"align",Oi);u.addGetterSetter(j,"verticalAlign",gs);u.addGetterSetter(j,"lineHeight",1,w());u.addGetterSetter(j,"wrap",ys);u.addGetterSetter(j,"ellipsis",!1,st());u.addGetterSetter(j,"letterSpacing",0,w());u.addGetterSetter(j,"text","",bt());u.addGetterSetter(j,"textDecoration","");u.addGetterSetter(j,"underlineOffset",void 0,w());u.addGetterSetter(j,"charRenderFunc",void 0);const Ps="",Di="normal";function Fi(r){r.fillText(this.partialText,0,0)}function Ni(r){r.strokeText(this.partialText,0,0)}class Q extends x{constructor(t){super(t),this.dummyCanvas=m.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva directionChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return q.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const e=this.pathLength;return t>e?null:q.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=q.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();const e=this.textDecoration(),i=this.fill(),n=this.fontSize(),s=this.glyphInfo,a=e.indexOf("underline")!==-1,o=e.indexOf("line-through")!==-1;a&&t.beginPath();for(let h=0;h<s.length;h++){t.save();const l=s[h].p0;t.translate(l.x,l.y),t.rotate(s[h].rotation),this.partialText=s[h].text,t.fillStrokeShape(this),a&&(h===0&&t.moveTo(0,n/2+1),t.lineTo(s[h].width,n/2+1)),t.restore()}if(a&&(t.strokeStyle=i,t.lineWidth=n/20,t.stroke()),o){t.beginPath();for(let h=0;h<s.length;h++){t.save();const l=s[h].p0;t.translate(l.x,l.y),t.rotate(s[h].rotation),h===0&&t.moveTo(0,0),t.lineTo(s[h].width,0),t.restore()}t.strokeStyle=i,t.lineWidth=n/20,t.stroke()}t.restore()}_hitFunc(t){t.beginPath();const e=this.glyphInfo;if(e.length>=1){const i=e[0].p0;t.moveTo(i.x,i.y)}for(let i=0;i<e.length;i++){const n=e[i].p1;t.lineTo(n.x,n.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return m.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return j.prototype.setText.call(this,t)}_getContextFont(){return j.prototype._getContextFont.call(this)}_getTextSize(t){const i=this.dummyCanvas.getContext("2d");i.save(),i.font=this._getContextFont();const n=i.measureText(t);return i.restore(),{width:n.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const t=dt(this.text());this.direction()==="rtl"&&t.reverse();const e=[];let i=0;for(let p=0;p<t.length;p++)e.push({char:t[p],width:this._getTextSize(t[p]).width}),i+=e[p].width;const{width:n,height:s}=this._getTextSize(this.attrs.text);if(this.textWidth=i,this.textHeight=s,this.glyphInfo=[],!this.attrs.data)return null;const a=this.letterSpacing(),o=this.align(),h=this.kerningFunc(),l=Math.max(0,i-n),c=Math.max(this.textWidth+((this.attrs.text||"").length-1)*a,0);let f=0;o==="center"&&(f=Math.max(0,this.pathLength/2-c/2)),o==="right"&&(f=Math.max(0,this.pathLength-c));let d=f;for(let p=0;p<e.length;p++){const g=this._getPointAtLength(d);if(!g)return;const b=e[p].char;let S=e[p].width+a;if(b===" "&&o==="justify"){const M=this.text().split(" ").length-1;S+=(this.pathLength-c)/M}const y=d+S,_=this._getPointAtLength(y>this.pathLength&&y-this.pathLength<=l?this.pathLength:y);if(!_)return;const C=q.getLineLength(g.x,g.y,_.x,_.y);let v=0;if(h)try{v=h(e[p-1].char,b)*this.fontSize()}catch{v=0}g.x+=v,_.x+=v,this.textWidth+=v;const A=q.getPointOnLine(v+C/2,g.x,g.y,_.x,_.y),P=Math.atan2(_.y-g.y,_.x-g.x);this.glyphInfo.push({transposeX:A.x,transposeY:A.y,text:t[p],rotation:P,p0:g,p1:_,width:C}),d+=S}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const t=[];this.glyphInfo.forEach(function(l){t.push(l.p0.x),t.push(l.p0.y),t.push(l.p1.x),t.push(l.p1.y)});let e=t[0]||0,i=t[0]||0,n=t[1]||0,s=t[1]||0,a,o;for(let l=0;l<t.length/2;l++)a=t[l*2],o=t[l*2+1],e=Math.min(e,a),i=Math.max(i,a),n=Math.min(n,o),s=Math.max(s,o);const h=this.fontSize();return{x:e-h/2,y:n-h/2,width:i-e+h,height:s-n+h}}destroy(){return m.releaseCanvas(this.dummyCanvas),super.destroy()}}Q.prototype._fillFunc=Fi;Q.prototype._strokeFunc=Ni;Q.prototype._fillFuncHit=Fi;Q.prototype._strokeFuncHit=Ni;Q.prototype.className="TextPath";Q.prototype._attrsAffectingSize=["text","fontSize","data"];K(Q);u.addGetterSetter(Q,"data");u.addGetterSetter(Q,"fontFamily","Arial");u.addGetterSetter(Q,"fontSize",12,w());u.addGetterSetter(Q,"fontStyle",Di);u.addGetterSetter(Q,"align","left");u.addGetterSetter(Q,"letterSpacing",0,w());u.addGetterSetter(Q,"textBaseline","middle");u.addGetterSetter(Q,"fontVariant",Di);u.addGetterSetter(Q,"text",Ps);u.addGetterSetter(Q,"textDecoration","");u.addGetterSetter(Q,"kerningFunc",void 0);u.addGetterSetter(Q,"direction","inherit");const Bi="tr-konva",ks=["resizeEnabledChange","rotateAnchorOffsetChange","rotateAnchorAngleChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(r=>r+`.${Bi}`).join(" "),oi="nodesRect",As=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],Es={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},Rs="ontouchstart"in k._global;function Ms(r,t,e){if(r==="rotater")return e;t+=m.degToRad(Es[r]||0);const i=(m.radToDeg(t)%360+360)%360;return m._inRange(i,315+22.5,360)||m._inRange(i,0,22.5)?"ns-resize":m._inRange(i,45-22.5,45+22.5)?"nesw-resize":m._inRange(i,90-22.5,90+22.5)?"ew-resize":m._inRange(i,135-22.5,135+22.5)?"nwse-resize":m._inRange(i,180-22.5,180+22.5)?"ns-resize":m._inRange(i,225-22.5,225+22.5)?"nesw-resize":m._inRange(i,270-22.5,270+22.5)?"ew-resize":m._inRange(i,315-22.5,315+22.5)?"nwse-resize":(m.error("Transformer has unknown angle for cursor detection: "+i),"pointer")}const ae=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function Gs(r){return{x:r.x+r.width/2*Math.cos(r.rotation)+r.height/2*Math.sin(-r.rotation),y:r.y+r.height/2*Math.cos(r.rotation)+r.width/2*Math.sin(r.rotation)}}function Hi(r,t,e){const i=e.x+(r.x-e.x)*Math.cos(t)-(r.y-e.y)*Math.sin(t),n=e.y+(r.x-e.x)*Math.sin(t)+(r.y-e.y)*Math.cos(t);return{...r,rotation:r.rotation+t,x:i,y:n}}function Os(r,t){const e=Gs(r);return Hi(r,t,e)}function Ls(r,t,e){let i=t;for(let n=0;n<r.length;n++){const s=k.getAngle(r[n]),a=Math.abs(s-t)%(Math.PI*2);Math.min(a,Math.PI*2-a)<e&&(i=s)}return i}let Ee=0;class N extends At{constructor(t){super(t),this._movingAnchorName=null,this._transforming=!1,this._elementsCreated=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(ks,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return m.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return Bi+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const e=t.filter(n=>n.isAncestorOf(this)?(m.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=t=e,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(n=>{const s=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(n._attrsAffectingSize.length){const a=n._attrsAffectingSize.map(o=>o+"Change."+this._getEventNamespace()).join(" ");n.on(a,s)}n.on(As.map(a=>a+`.${this._getEventNamespace()}`).join(" "),s),n.on(`absoluteTransformChange.${this._getEventNamespace()}`,s),this._proxyDrag(n)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(t){let e;t.on(`dragstart.${this._getEventNamespace()}`,i=>{e=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(i,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,i=>{if(!e)return;const n=t.getAbsolutePosition(),s=n.x-e.x,a=n.y-e.y;this.nodes().forEach(o=>{if(o===t||o.isDragging())return;const h=o.getAbsolutePosition();o.setAbsolutePosition({x:h.x+s,y:h.y+a}),o.startDrag(i)}),e=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(oi),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(oi,this.__getNodeRect)}__getNodeShape(t,e=this.rotation(),i){const n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),s=t.getAbsoluteScale(i),a=t.getAbsolutePosition(i),o=n.x*s.x-t.offsetX()*s.x,h=n.y*s.y-t.offsetY()*s.y,l=(k.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),c={x:a.x+o*Math.cos(l)+h*Math.sin(-l),y:a.y+h*Math.cos(l)+o*Math.sin(l),width:n.width*s.x,height:n.height*s.y,rotation:l};return Hi(c,-k.getAngle(e),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const e=[];this.nodes().map(l=>{const c=l.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),f=[{x:c.x,y:c.y},{x:c.x+c.width,y:c.y},{x:c.x+c.width,y:c.y+c.height},{x:c.x,y:c.y+c.height}],d=l.getAbsoluteTransform();f.forEach(function(p){const g=d.point(p);e.push(g)})});const i=new tt;i.rotate(-k.getAngle(this.rotation()));let n=1/0,s=1/0,a=-1/0,o=-1/0;e.forEach(function(l){const c=i.point(l);n===void 0&&(n=a=c.x,s=o=c.y),n=Math.min(n,c.x),s=Math.min(s,c.y),a=Math.max(a,c.x),o=Math.max(o,c.y)}),i.invert();const h=i.point({x:n,y:s});return{x:h.x,y:h.y,width:a-n,height:o-s,rotation:k.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),ae.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater"),this._elementsCreated=!0}_createAnchor(t){const e=new qt({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Rs?10:"auto"}),i=this;e.on("mousedown touchstart",function(n){i._handleMouseDown(n)}),e.on("dragstart",n=>{e.stopDrag(),n.cancelBubble=!0}),e.on("dragend",n=>{n.cancelBubble=!0}),e.on("mouseenter",()=>{const n=k.getAngle(this.rotation()),s=this.rotateAnchorCursor(),a=Ms(t,n,s);e.getStage().content&&(e.getStage().content.style.cursor=a),this._cursorChange=!0}),e.on("mouseout",()=>{e.getStage().content&&(e.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(e)}_createBack(){const t=new x({name:"back",width:0,height:0,sceneFunc(e,i){const n=i.getParent(),s=n.padding(),a=i.width(),o=i.height();if(e.beginPath(),e.rect(-s,-s,a+s*2,o+s*2),n.rotateEnabled()&&n.rotateLineVisible()){const h=n.rotateAnchorAngle(),l=n.rotateAnchorOffset(),c=m.degToRad(h),f=Math.sin(c),d=-Math.cos(c),p=a/2,g=o/2;let b=1/0;d<0?b=Math.min(b,-g/d):d>0&&(b=Math.min(b,(o-g)/d)),f<0?b=Math.min(b,-p/f):f>0&&(b=Math.min(b,(a-p)/f));const S=p+f*b,y=g+d*b,_=m._sign(o),C=S+f*l*_,v=y+d*l*_;e.moveTo(S,y),e.lineTo(C,v)}e.fillStrokeShape(i)},hitFunc:(e,i)=>{if(!this.shouldOverdrawWholeArea())return;const n=this.padding();e.beginPath(),e.rect(-n,-n,i.width()+n*2,i.height()+n*2),e.fillStrokeShape(i)}});this.add(t),this._proxyDrag(t),t.on("dragstart",e=>{e.cancelBubble=!0}),t.on("dragmove",e=>{e.cancelBubble=!0}),t.on("dragend",e=>{e.cancelBubble=!0}),this.on("dragmove",e=>{this.update()})}_handleMouseDown(t){if(this._transforming)return;this._movingAnchorName=t.target.name().split(" ")[0];const e=this._getNodeRect(),i=e.width,n=e.height,s=Math.sqrt(Math.pow(i,2)+Math.pow(n,2));this.sin=Math.abs(n/s),this.cos=Math.abs(i/s),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const a=t.target.getAbsolutePosition(),o=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:o.x-a.x,y:o.y-a.y},Ee++,this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(h=>{h._fire("transformstart",{evt:t.evt,target:h})})}_handleMouseMove(t){let e,i,n;const s=this.findOne("."+this._movingAnchorName),a=s.getStage();a.setPointersPositions(t);const o=a.getPointerPosition();let h={x:o.x-this._anchorDragOffset.x,y:o.y-this._anchorDragOffset.y};const l=s.getAbsolutePosition();this.anchorDragBoundFunc()&&(h=this.anchorDragBoundFunc()(l,h,t)),s.setAbsolutePosition(h);const c=s.getAbsolutePosition();if(l.x===c.x&&l.y===c.y)return;if(this._movingAnchorName==="rotater"){const _=this._getNodeRect();e=s.x()-_.width/2,i=-s.y()+_.height/2;const C=k.getAngle(this.rotateAnchorAngle());let v=Math.atan2(-i,e)+Math.PI/2-C;_.height<0&&(v-=Math.PI);const P=k.getAngle(this.rotation())+v,M=k.getAngle(this.rotationSnapTolerance()),G=Ls(this.rotationSnaps(),P,M)-_.rotation,D=Os(_,G);this._fitNodesInto(D,t);return}const f=this.shiftBehavior();let d;f==="inverted"?d=this.keepRatio()&&!t.shiftKey:f==="none"?d=this.keepRatio():d=this.keepRatio()||t.shiftKey;let p=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(d){const _=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};n=Math.sqrt(Math.pow(_.x-s.x(),2)+Math.pow(_.y-s.y(),2));const C=this.findOne(".top-left").x()>_.x?-1:1,v=this.findOne(".top-left").y()>_.y?-1:1;e=n*this.cos*C,i=n*this.sin*v,this.findOne(".top-left").x(_.x-e),this.findOne(".top-left").y(_.y-i)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(s.y());else if(this._movingAnchorName==="top-right"){if(d){const _=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};n=Math.sqrt(Math.pow(s.x()-_.x,2)+Math.pow(_.y-s.y(),2));const C=this.findOne(".top-right").x()<_.x?-1:1,v=this.findOne(".top-right").y()>_.y?-1:1;e=n*this.cos*C,i=n*this.sin*v,this.findOne(".top-right").x(_.x+e),this.findOne(".top-right").y(_.y-i)}var g=s.position();this.findOne(".top-left").y(g.y),this.findOne(".bottom-right").x(g.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(s.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(s.x());else if(this._movingAnchorName==="bottom-left"){if(d){const _=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};n=Math.sqrt(Math.pow(_.x-s.x(),2)+Math.pow(s.y()-_.y,2));const C=_.x<s.x()?-1:1,v=s.y()<_.y?-1:1;e=n*this.cos*C,i=n*this.sin*v,s.x(_.x-e),s.y(_.y+i)}g=s.position(),this.findOne(".top-left").x(g.x),this.findOne(".bottom-right").y(g.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(s.y());else if(this._movingAnchorName==="bottom-right"){if(d){const _=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};n=Math.sqrt(Math.pow(s.x()-_.x,2)+Math.pow(s.y()-_.y,2));const C=this.findOne(".bottom-right").x()<_.x?-1:1,v=this.findOne(".bottom-right").y()<_.y?-1:1;e=n*this.cos*C,i=n*this.sin*v,this.findOne(".bottom-right").x(_.x+e),this.findOne(".bottom-right").y(_.y+i)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(p=this.centeredScaling()||t.altKey,p){const _=this.findOne(".top-left"),C=this.findOne(".bottom-right"),v=_.x(),A=_.y(),P=this.getWidth()-C.x(),M=this.getHeight()-C.y();C.move({x:-v,y:-A}),_.move({x:P,y:M})}const b=this.findOne(".top-left").getAbsolutePosition();e=b.x,i=b.y;const S=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),y=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:e,y:i,width:S,height:y,rotation:k.getAngle(this.rotation())},t)}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){var e;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const i=this.getNode();Ee--,this._fire("transformend",{evt:t,target:i}),(e=this.getLayer())===null||e===void 0||e.batchDraw(),i&&this._nodes.forEach(n=>{var s;n._fire("transformend",{evt:t,target:n}),(s=n.getLayer())===null||s===void 0||s.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(t,e){const i=this._getNodeRect(),n=1;if(m._inRange(t.width,-this.padding()*2-n,n)){this.update();return}if(m._inRange(t.height,-this.padding()*2-n,n)){this.update();return}const s=new tt;if(s.rotate(k.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const d=s.point({x:-this.padding()*2,y:0});t.x+=d.x,t.y+=d.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const d=s.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const d=s.point({x:0,y:-this.padding()*2});t.x+=d.x,t.y+=d.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const d=s.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const d=this.boundBoxFunc()(i,t);d?t=d:m.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const a=1e7,o=new tt;o.translate(i.x,i.y),o.rotate(i.rotation),o.scale(i.width/a,i.height/a);const h=new tt,l=t.width/a,c=t.height/a;this.flipEnabled()===!1?(h.translate(t.x,t.y),h.rotate(t.rotation),h.translate(t.width<0?t.width:0,t.height<0?t.height:0),h.scale(Math.abs(l),Math.abs(c))):(h.translate(t.x,t.y),h.rotate(t.rotation),h.scale(l,c));const f=h.multiply(o.invert());this._nodes.forEach(d=>{var p;if(!d.getStage())return;const g=d.getParent().getAbsoluteTransform(),b=d.getTransform().copy();b.translate(d.offsetX(),d.offsetY());const S=new tt;S.multiply(g.copy().invert()).multiply(f).multiply(g).multiply(b);const y=S.decompose();d.setAttrs(y),(p=d.getLayer())===null||p===void 0||p.batchDraw()}),this.rotation(m._getRotation(t.rotation)),this._nodes.forEach(d=>{this._fire("transform",{evt:e,target:d}),d._fire("transform",{evt:e,target:d})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,e){this.findOne(t).setAttrs(e)}update(){var t;const e=this._getNodeRect();this.rotation(m._getRotation(e.rotation));const i=e.width,n=e.height,s=this.enabledAnchors(),a=this.resizeEnabled(),o=this.padding(),h=this.anchorSize(),l=this.find("._anchor");l.forEach(P=>{P.setAttrs({width:h,height:h,offsetX:h/2,offsetY:h/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:h/2+o,offsetY:h/2+o,visible:a&&s.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:i/2,y:0,offsetY:h/2+o,visible:a&&s.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:i,y:0,offsetX:h/2-o,offsetY:h/2+o,visible:a&&s.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:n/2,offsetX:h/2+o,visible:a&&s.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:i,y:n/2,offsetX:h/2-o,visible:a&&s.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:n,offsetX:h/2+o,offsetY:h/2-o,visible:a&&s.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:i/2,y:n,offsetY:h/2-o,visible:a&&s.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:i,y:n,offsetX:h/2-o,offsetY:h/2-o,visible:a&&s.indexOf("bottom-right")>=0});const c=this.rotateAnchorAngle(),f=this.rotateAnchorOffset(),d=m.degToRad(c),p=Math.sin(d),g=-Math.cos(d),b=i/2,S=n/2;let y=1/0;g<0?y=Math.min(y,-S/g):g>0&&(y=Math.min(y,(n-S)/g)),p<0?y=Math.min(y,-b/p):p>0&&(y=Math.min(y,(i-b)/p));const _=b+p*y,C=S+g*y,v=m._sign(n);this._batchChangeChild(".rotater",{x:_+p*f*v,y:C+g*f*v-o*g,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:i,height:n,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(P=>P.draggable()),x:0,y:0});const A=this.anchorStyleFunc();A&&l.forEach(P=>{A(P)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),At.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...t){return this._elementsCreated?(m.error("You cannot add external nodes to the Transformer. Use tr.nodes([node]) instead."),this):super.add(...t)}toObject(){return T.prototype.toObject.call(this)}clone(t){return T.prototype.clone.call(this,t)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}N.isTransforming=()=>Ee>0;function Is(r){return r instanceof Array||m.warn("enabledAnchors value should be an array"),r instanceof Array&&r.forEach(function(t){ae.indexOf(t)===-1&&m.warn("Unknown anchor name: "+t+". Available names are: "+ae.join(", "))}),r||[]}N.prototype.className="Transformer";K(N);u.addGetterSetter(N,"enabledAnchors",ae,Is);u.addGetterSetter(N,"flipEnabled",!0,st());u.addGetterSetter(N,"resizeEnabled",!0);u.addGetterSetter(N,"anchorSize",10,w());u.addGetterSetter(N,"rotateEnabled",!0);u.addGetterSetter(N,"rotateLineVisible",!0);u.addGetterSetter(N,"rotationSnaps",[]);u.addGetterSetter(N,"rotateAnchorOffset",50,w());u.addGetterSetter(N,"rotateAnchorAngle",0,w());u.addGetterSetter(N,"rotateAnchorCursor","crosshair");u.addGetterSetter(N,"rotationSnapTolerance",5,w());u.addGetterSetter(N,"borderEnabled",!0);u.addGetterSetter(N,"anchorStroke","rgb(0, 161, 255)");u.addGetterSetter(N,"anchorStrokeWidth",1,w());u.addGetterSetter(N,"anchorFill","white");u.addGetterSetter(N,"anchorCornerRadius",0,w());u.addGetterSetter(N,"borderStroke","rgb(0, 161, 255)");u.addGetterSetter(N,"borderStrokeWidth",1,w());u.addGetterSetter(N,"borderDash");u.addGetterSetter(N,"keepRatio",!0);u.addGetterSetter(N,"shiftBehavior","default");u.addGetterSetter(N,"centeredScaling",!1);u.addGetterSetter(N,"ignoreStroke",!1);u.addGetterSetter(N,"padding",0,w());u.addGetterSetter(N,"nodes");u.addGetterSetter(N,"node");u.addGetterSetter(N,"boundBoxFunc");u.addGetterSetter(N,"anchorDragBoundFunc");u.addGetterSetter(N,"anchorStyleFunc");u.addGetterSetter(N,"shouldOverdrawWholeArea",!1);u.addGetterSetter(N,"useSingleNodeRotation",!0);u.backCompat(N,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class lt extends x{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,k.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}lt.prototype.className="Wedge";lt.prototype._centroid=!0;lt.prototype._attrsAffectingSize=["radius"];K(lt);u.addGetterSetter(lt,"radius",0,w());u.addGetterSetter(lt,"angle",0,w());u.addGetterSetter(lt,"clockwise",!1);u.backCompat(lt,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function hi(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const Ds=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Fs=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function Ns(r,t){const e=r.data,i=r.width,n=r.height;let s,a,o,h,l,c,f,d,p,g,b,S,y,_,C,v,A,P,M,E;const G=t+t+1,D=i-1,H=n-1,L=t+1,W=L*(L+1)/2,F=new hi,I=Ds[t],R=Fs[t];let U=null,O=F,Y=null,J=null;for(let z=1;z<G;z++)O=O.next=new hi,z===L&&(U=O);O.next=F,o=a=0;for(let z=0;z<n;z++){S=y=_=C=h=l=c=f=0,d=L*(v=e[a]),p=L*(A=e[a+1]),g=L*(P=e[a+2]),b=L*(M=e[a+3]),h+=W*v,l+=W*A,c+=W*P,f+=W*M,O=F;for(let $=0;$<L;$++)O.r=v,O.g=A,O.b=P,O.a=M,O=O.next;for(let $=1;$<L;$++)s=a+((D<$?D:$)<<2),h+=(O.r=v=e[s])*(E=L-$),l+=(O.g=A=e[s+1])*E,c+=(O.b=P=e[s+2])*E,f+=(O.a=M=e[s+3])*E,S+=v,y+=A,_+=P,C+=M,O=O.next;Y=F,J=U;for(let $=0;$<i;$++)e[a+3]=M=f*I>>R,M!==0?(M=255/M,e[a]=(h*I>>R)*M,e[a+1]=(l*I>>R)*M,e[a+2]=(c*I>>R)*M):e[a]=e[a+1]=e[a+2]=0,h-=d,l-=p,c-=g,f-=b,d-=Y.r,p-=Y.g,g-=Y.b,b-=Y.a,s=o+((s=$+t+1)<D?s:D)<<2,S+=Y.r=e[s],y+=Y.g=e[s+1],_+=Y.b=e[s+2],C+=Y.a=e[s+3],h+=S,l+=y,c+=_,f+=C,Y=Y.next,d+=v=J.r,p+=A=J.g,g+=P=J.b,b+=M=J.a,S-=v,y-=A,_-=P,C-=M,J=J.next,a+=4;o+=i}for(let z=0;z<i;z++){y=_=C=S=l=c=f=h=0,a=z<<2,d=L*(v=e[a]),p=L*(A=e[a+1]),g=L*(P=e[a+2]),b=L*(M=e[a+3]),h+=W*v,l+=W*A,c+=W*P,f+=W*M,O=F;for(let Z=0;Z<L;Z++)O.r=v,O.g=A,O.b=P,O.a=M,O=O.next;let $=i;for(let Z=1;Z<=t;Z++)a=$+z<<2,h+=(O.r=v=e[a])*(E=L-Z),l+=(O.g=A=e[a+1])*E,c+=(O.b=P=e[a+2])*E,f+=(O.a=M=e[a+3])*E,S+=v,y+=A,_+=P,C+=M,O=O.next,Z<H&&($+=i);a=z,Y=F,J=U;for(let Z=0;Z<n;Z++)s=a<<2,e[s+3]=M=f*I>>R,M>0?(M=255/M,e[s]=(h*I>>R)*M,e[s+1]=(l*I>>R)*M,e[s+2]=(c*I>>R)*M):e[s]=e[s+1]=e[s+2]=0,h-=d,l-=p,c-=g,f-=b,d-=Y.r,p-=Y.g,g-=Y.b,b-=Y.a,s=z+((s=Z+L)<H?s:H)*i<<2,h+=S+=Y.r=e[s],l+=y+=Y.g=e[s+1],c+=_+=Y.b=e[s+2],f+=C+=Y.a=e[s+3],Y=Y.next,d+=v=J.r,p+=A=J.g,g+=P=J.b,b+=M=J.a,S-=v,y-=A,_-=P,C-=M,J=J.next,a+=i}}const Bs=function(t){const e=Math.round(this.blurRadius());e>0&&Ns(t,e)};u.addGetterSetter(T,"blurRadius",0,w(),u.afterSetFilter);const Hs=function(r){const t=this.brightness()*255,e=r.data,i=e.length;for(let n=0;n<i;n+=4)e[n]+=t,e[n+1]+=t,e[n+2]+=t};u.addGetterSetter(T,"brightness",0,w(),u.afterSetFilter);const Ws=function(r){const t=this.brightness(),e=r.data,i=e.length;for(let n=0;n<i;n+=4)e[n]=Math.min(255,e[n]*t),e[n+1]=Math.min(255,e[n+1]*t),e[n+2]=Math.min(255,e[n+2]*t)},zs=function(r){const t=Math.pow((this.contrast()+100)/100,2),e=r.data,i=e.length;let n=150,s=150,a=150;for(let o=0;o<i;o+=4)n=e[o],s=e[o+1],a=e[o+2],n/=255,n-=.5,n*=t,n+=.5,n*=255,s/=255,s-=.5,s*=t,s+=.5,s*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,n=n<0?0:n>255?255:n,s=s<0?0:s>255?255:s,a=a<0?0:a>255?255:a,e[o]=n,e[o+1]=s,e[o+2]=a};u.addGetterSetter(T,"contrast",0,w(),u.afterSetFilter);const Ys=function(r){var t,e,i,n,s,a,o,h,l;const c=r.data,f=r.width,d=r.height,p=Math.min(1,Math.max(0,(e=(t=this.embossStrength)===null||t===void 0?void 0:t.call(this))!==null&&e!==void 0?e:.5)),g=Math.min(1,Math.max(0,(n=(i=this.embossWhiteLevel)===null||i===void 0?void 0:i.call(this))!==null&&n!==void 0?n:.5)),S=(o={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(a=(s=this.embossDirection)===null||s===void 0?void 0:s.call(this))!==null&&a!==void 0?a:"top-left"])!==null&&o!==void 0?o:315,y=!!((l=(h=this.embossBlend)===null||h===void 0?void 0:h.call(this))!==null&&l!==void 0&&l),_=p*10,C=g*255,v=S*Math.PI/180,A=Math.cos(v),P=Math.sin(v),M=128/1020*_,E=new Uint8ClampedArray(c),G=new Float32Array(f*d);for(let F=0,I=0;I<c.length;I+=4,F++)G[F]=.2126*E[I]+.7152*E[I+1]+.0722*E[I+2];const D=[-1,0,1,-2,0,2,-1,0,1],H=[-1,-2,-1,0,0,0,1,2,1],L=[-f-1,-f,-f+1,-1,0,1,f-1,f,f+1],W=F=>F<0?0:F>255?255:F;for(let F=1;F<d-1;F++)for(let I=1;I<f-1;I++){const R=F*f+I;let U=0,O=0;U+=G[R+L[0]]*D[0],O+=G[R+L[0]]*H[0],U+=G[R+L[1]]*D[1],O+=G[R+L[1]]*H[1],U+=G[R+L[2]]*D[2],O+=G[R+L[2]]*H[2],U+=G[R+L[3]]*D[3],O+=G[R+L[3]]*H[3],U+=G[R+L[5]]*D[5],O+=G[R+L[5]]*H[5],U+=G[R+L[6]]*D[6],O+=G[R+L[6]]*H[6],U+=G[R+L[7]]*D[7],O+=G[R+L[7]]*H[7],U+=G[R+L[8]]*D[8],O+=G[R+L[8]]*H[8];const Y=A*U+P*O,J=W(C+Y*M),z=R*4;if(y){const $=J-C;c[z]=W(E[z]+$),c[z+1]=W(E[z+1]+$),c[z+2]=W(E[z+2]+$),c[z+3]=E[z+3]}else c[z]=c[z+1]=c[z+2]=J,c[z+3]=E[z+3]}for(let F=0;F<f;F++){let I=F*4,R=((d-1)*f+F)*4;c[I]=E[I],c[I+1]=E[I+1],c[I+2]=E[I+2],c[I+3]=E[I+3],c[R]=E[R],c[R+1]=E[R+1],c[R+2]=E[R+2],c[R+3]=E[R+3]}for(let F=1;F<d-1;F++){let I=F*f*4,R=(F*f+(f-1))*4;c[I]=E[I],c[I+1]=E[I+1],c[I+2]=E[I+2],c[I+3]=E[I+3],c[R]=E[R],c[R+1]=E[R+1],c[R+2]=E[R+2],c[R+3]=E[R+3]}return r};u.addGetterSetter(T,"embossStrength",.5,w(),u.afterSetFilter);u.addGetterSetter(T,"embossWhiteLevel",.5,w(),u.afterSetFilter);u.addGetterSetter(T,"embossDirection","top-left",void 0,u.afterSetFilter);u.addGetterSetter(T,"embossBlend",!1,void 0,u.afterSetFilter);function ye(r,t,e,i,n){const s=e-t,a=n-i;if(s===0)return i+a/2;if(a===0)return i;let o=(r-t)/s;return o=a*o+i,o}const Xs=function(r){const t=r.data,e=t.length;let i=t[0],n=i,s,a=t[1],o=a,h,l=t[2],c=l,f;const d=this.enhance();if(d===0)return;for(let C=0;C<e;C+=4)s=t[C+0],s<i?i=s:s>n&&(n=s),h=t[C+1],h<a?a=h:h>o&&(o=h),f=t[C+2],f<l?l=f:f>c&&(c=f);n===i&&(n=255,i=0),o===a&&(o=255,a=0),c===l&&(c=255,l=0);let p,g,b,S,y,_;if(d>0)p=n+d*(255-n),g=i-d*(i-0),b=o+d*(255-o),S=a-d*(a-0),y=c+d*(255-c),_=l-d*(l-0);else{const C=(n+i)*.5;p=n+d*(n-C),g=i+d*(i-C);const v=(o+a)*.5;b=o+d*(o-v),S=a+d*(a-v);const A=(c+l)*.5;y=c+d*(c-A),_=l+d*(l-A)}for(let C=0;C<e;C+=4)t[C+0]=ye(t[C+0],i,n,g,p),t[C+1]=ye(t[C+1],a,o,S,b),t[C+2]=ye(t[C+2],l,c,_,y)};u.addGetterSetter(T,"enhance",0,w(),u.afterSetFilter);const Us=function(r){const t=r.data,e=t.length;for(let i=0;i<e;i+=4){const n=.34*t[i]+.5*t[i+1]+.16*t[i+2];t[i]=n,t[i+1]=n,t[i+2]=n}};u.addGetterSetter(T,"hue",0,w(),u.afterSetFilter);u.addGetterSetter(T,"saturation",0,w(),u.afterSetFilter);u.addGetterSetter(T,"luminance",0,w(),u.afterSetFilter);const Vs=function(r){const t=r.data,e=t.length,i=1,n=Math.pow(2,this.saturation()),s=Math.abs(this.hue()+360)%360,a=this.luminance()*127,o=i*n*Math.cos(s*Math.PI/180),h=i*n*Math.sin(s*Math.PI/180),l=.299*i+.701*o+.167*h,c=.587*i-.587*o+.33*h,f=.114*i-.114*o-.497*h,d=.299*i-.299*o-.328*h,p=.587*i+.413*o+.035*h,g=.114*i-.114*o+.293*h,b=.299*i-.3*o+1.25*h,S=.587*i-.586*o-1.05*h,y=.114*i+.886*o-.2*h;let _,C,v,A;for(let P=0;P<e;P+=4)_=t[P+0],C=t[P+1],v=t[P+2],A=t[P+3],t[P+0]=l*_+c*C+f*v+a,t[P+1]=d*_+p*C+g*v+a,t[P+2]=b*_+S*C+y*v+a,t[P+3]=A},qs=function(r){const t=r.data,e=t.length,i=Math.pow(2,this.value()),n=Math.pow(2,this.saturation()),s=Math.abs(this.hue()+360)%360,a=i*n*Math.cos(s*Math.PI/180),o=i*n*Math.sin(s*Math.PI/180),h=.299*i+.701*a+.167*o,l=.587*i-.587*a+.33*o,c=.114*i-.114*a-.497*o,f=.299*i-.299*a-.328*o,d=.587*i+.413*a+.035*o,p=.114*i-.114*a+.293*o,g=.299*i-.3*a+1.25*o,b=.587*i-.586*a-1.05*o,S=.114*i+.886*a-.2*o;for(let y=0;y<e;y+=4){const _=t[y+0],C=t[y+1],v=t[y+2],A=t[y+3];t[y+0]=h*_+l*C+c*v,t[y+1]=f*_+d*C+p*v,t[y+2]=g*_+b*C+S*v,t[y+3]=A}};u.addGetterSetter(T,"hue",0,w(),u.afterSetFilter);u.addGetterSetter(T,"saturation",0,w(),u.afterSetFilter);u.addGetterSetter(T,"value",0,w(),u.afterSetFilter);const js=function(r){const t=r.data,e=t.length;for(let i=0;i<e;i+=4)t[i]=255-t[i],t[i+1]=255-t[i+1],t[i+2]=255-t[i+2]},Ks=function(r,t,e){const i=r.data,n=t.data,s=r.width,a=r.height,o=e.polarCenterX||s/2,h=e.polarCenterY||a/2;let l=Math.sqrt(o*o+h*h),c=s-o,f=a-h;const d=Math.sqrt(c*c+f*f);l=d>l?d:l;const p=a,g=s,b=360/g*Math.PI/180;for(let S=0;S<g;S+=1){const y=Math.sin(S*b),_=Math.cos(S*b);for(let C=0;C<p;C+=1){c=Math.floor(o+l*C/p*_),f=Math.floor(h+l*C/p*y);let v=(f*s+c)*4;const A=i[v+0],P=i[v+1],M=i[v+2],E=i[v+3];v=(S+C*s)*4,n[v+0]=A,n[v+1]=P,n[v+2]=M,n[v+3]=E}}},$s=function(r,t,e){const i=r.data,n=t.data,s=r.width,a=r.height,o=e.polarCenterX||s/2,h=e.polarCenterY||a/2;let l=Math.sqrt(o*o+h*h),c=s-o,f=a-h;const d=Math.sqrt(c*c+f*f);l=d>l?d:l;const p=a,g=s,b=0;let S,y;for(c=0;c<s;c+=1)for(f=0;f<a;f+=1){const _=c-o,C=f-h,v=Math.sqrt(_*_+C*C)*p/l;let A=(Math.atan2(C,_)*180/Math.PI+360+b)%360;A=A*g/360,S=Math.floor(A),y=Math.floor(v);let P=(y*s+S)*4;const M=i[P+0],E=i[P+1],G=i[P+2],D=i[P+3];P=(f*s+c)*4,n[P+0]=M,n[P+1]=E,n[P+2]=G,n[P+3]=D}},Qs=function(r){const t=r.width,e=r.height;let i,n,s,a,o,h,l,c,f,d,p=Math.round(this.kaleidoscopePower());const g=Math.round(this.kaleidoscopeAngle()),b=Math.floor(t*(g%360)/360);if(p<1)return;const S=m.createCanvasElement();S.width=t,S.height=e;const y=S.getContext("2d").getImageData(0,0,t,e);m.releaseCanvas(S),Ks(r,y,{polarCenterX:t/2,polarCenterY:e/2});let _=t/Math.pow(2,p);for(;_<=8;)_=_*2,p-=1;_=Math.ceil(_);let C=_,v=0,A=C,P=1;for(b+_>t&&(v=C,A=0,P=-1),n=0;n<e;n+=1)for(i=v;i!==A;i+=P)s=Math.round(i+b)%t,f=(t*n+s)*4,o=y.data[f+0],h=y.data[f+1],l=y.data[f+2],c=y.data[f+3],d=(t*n+i)*4,y.data[d+0]=o,y.data[d+1]=h,y.data[d+2]=l,y.data[d+3]=c;for(n=0;n<e;n+=1)for(C=Math.floor(_),a=0;a<p;a+=1){for(i=0;i<C+1;i+=1)f=(t*n+i)*4,o=y.data[f+0],h=y.data[f+1],l=y.data[f+2],c=y.data[f+3],d=(t*n+C*2-i-1)*4,y.data[d+0]=o,y.data[d+1]=h,y.data[d+2]=l,y.data[d+3]=c;C*=2}$s(y,r,{})};u.addGetterSetter(T,"kaleidoscopePower",2,w(),u.afterSetFilter);u.addGetterSetter(T,"kaleidoscopeAngle",0,w(),u.afterSetFilter);function ne(r,t,e){let i=(e*r.width+t)*4;const n=[];return n.push(r.data[i++],r.data[i++],r.data[i++],r.data[i++]),n}function Dt(r,t){return Math.sqrt(Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2)+Math.pow(r[2]-t[2],2))}function Js(r){const t=[0,0,0];for(let e=0;e<r.length;e++)t[0]+=r[e][0],t[1]+=r[e][1],t[2]+=r[e][2];return t[0]/=r.length,t[1]/=r.length,t[2]/=r.length,t}function Zs(r,t){const e=ne(r,0,0),i=ne(r,r.width-1,0),n=ne(r,0,r.height-1),s=ne(r,r.width-1,r.height-1),a=t||10;if(Dt(e,i)<a&&Dt(i,s)<a&&Dt(s,n)<a&&Dt(n,e)<a){const o=Js([i,e,s,n]),h=[];for(let l=0;l<r.width*r.height;l++){const c=Dt(o,[r.data[l*4],r.data[l*4+1],r.data[l*4+2]]);h[l]=c<a?0:255}return h}}function tr(r,t){for(let e=0;e<r.width*r.height;e++)r.data[4*e+3]=t[e]}function er(r,t,e){const i=[1,1,1,1,0,1,1,1,1],n=Math.round(Math.sqrt(i.length)),s=Math.floor(n/2),a=[];for(let o=0;o<e;o++)for(let h=0;h<t;h++){const l=o*t+h;let c=0;for(let f=0;f<n;f++)for(let d=0;d<n;d++){const p=o+f-s,g=h+d-s;if(p>=0&&p<e&&g>=0&&g<t){const b=p*t+g,S=i[f*n+d];c+=r[b]*S}}a[l]=c===2040?255:0}return a}function ir(r,t,e){const i=[1,1,1,1,1,1,1,1,1],n=Math.round(Math.sqrt(i.length)),s=Math.floor(n/2),a=[];for(let o=0;o<e;o++)for(let h=0;h<t;h++){const l=o*t+h;let c=0;for(let f=0;f<n;f++)for(let d=0;d<n;d++){const p=o+f-s,g=h+d-s;if(p>=0&&p<e&&g>=0&&g<t){const b=p*t+g,S=i[f*n+d];c+=r[b]*S}}a[l]=c>=1020?255:0}return a}function nr(r,t,e){const i=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],n=Math.round(Math.sqrt(i.length)),s=Math.floor(n/2),a=[];for(let o=0;o<e;o++)for(let h=0;h<t;h++){const l=o*t+h;let c=0;for(let f=0;f<n;f++)for(let d=0;d<n;d++){const p=o+f-s,g=h+d-s;if(p>=0&&p<e&&g>=0&&g<t){const b=p*t+g,S=i[f*n+d];c+=r[b]*S}}a[l]=c}return a}const sr=function(r){const t=this.threshold();let e=Zs(r,t);return e&&(e=er(e,r.width,r.height),e=ir(e,r.width,r.height),e=nr(e,r.width,r.height),tr(r,e)),r};u.addGetterSetter(T,"threshold",0,w(),u.afterSetFilter);const rr=function(r){const t=this.noise()*255,e=r.data,i=e.length,n=t/2;for(let s=0;s<i;s+=4)e[s+0]+=n-2*n*Math.random(),e[s+1]+=n-2*n*Math.random(),e[s+2]+=n-2*n*Math.random()};u.addGetterSetter(T,"noise",.2,w(),u.afterSetFilter);const ar=function(r){let t=Math.ceil(this.pixelSize()),e=r.width,i=r.height,n=Math.ceil(e/t),s=Math.ceil(i/t),a=r.data;if(t<=0){m.error("pixelSize value can not be <= 0");return}for(let o=0;o<n;o+=1)for(let h=0;h<s;h+=1){let l=0,c=0,f=0,d=0;const p=o*t,g=p+t,b=h*t,S=b+t;let y=0;for(let _=p;_<g;_+=1)if(!(_>=e))for(let C=b;C<S;C+=1){if(C>=i)continue;const v=(e*C+_)*4;l+=a[v+0],c+=a[v+1],f+=a[v+2],d+=a[v+3],y+=1}l=l/y,c=c/y,f=f/y,d=d/y;for(let _=p;_<g;_+=1)if(!(_>=e))for(let C=b;C<S;C+=1){if(C>=i)continue;const v=(e*C+_)*4;a[v+0]=l,a[v+1]=c,a[v+2]=f,a[v+3]=d}}};u.addGetterSetter(T,"pixelSize",8,w(),u.afterSetFilter);const or=function(r){const t=Math.round(this.levels()*254)+1,e=r.data,i=e.length,n=255/t;for(let s=0;s<i;s+=1)e[s]=Math.floor(e[s]/n)*n};u.addGetterSetter(T,"levels",.5,w(),u.afterSetFilter);const hr=function(r){const t=r.data,e=t.length,i=this.red(),n=this.green(),s=this.blue();for(let a=0;a<e;a+=4){const o=(.34*t[a]+.5*t[a+1]+.16*t[a+2])/255;t[a]=o*i,t[a+1]=o*n,t[a+2]=o*s,t[a+3]=t[a+3]}};u.addGetterSetter(T,"red",0,function(r){return this._filterUpToDate=!1,r>255?255:r<0?0:Math.round(r)});u.addGetterSetter(T,"green",0,function(r){return this._filterUpToDate=!1,r>255?255:r<0?0:Math.round(r)});u.addGetterSetter(T,"blue",0,li,u.afterSetFilter);const lr=function(r){const t=r.data,e=t.length,i=this.red(),n=this.green(),s=this.blue(),a=this.alpha();for(let o=0;o<e;o+=4){const h=1-a;t[o]=i*a+t[o]*h,t[o+1]=n*a+t[o+1]*h,t[o+2]=s*a+t[o+2]*h}};u.addGetterSetter(T,"red",0,function(r){return this._filterUpToDate=!1,r>255?255:r<0?0:Math.round(r)});u.addGetterSetter(T,"green",0,function(r){return this._filterUpToDate=!1,r>255?255:r<0?0:Math.round(r)});u.addGetterSetter(T,"blue",0,li,u.afterSetFilter);u.addGetterSetter(T,"alpha",1,function(r){return this._filterUpToDate=!1,r>1?1:r<0?0:r});const cr=function(r){const t=r.data,e=t.length;for(let i=0;i<e;i+=4){const n=t[i+0],s=t[i+1],a=t[i+2];t[i+0]=Math.min(255,n*.393+s*.769+a*.189),t[i+1]=Math.min(255,n*.349+s*.686+a*.168),t[i+2]=Math.min(255,n*.272+s*.534+a*.131)}},dr=function(r){const e=r.data;for(let i=0;i<e.length;i+=4){const n=e[i],s=e[i+1],a=e[i+2];.2126*n+.7152*s+.0722*a>=128&&(e[i]=255-n,e[i+1]=255-s,e[i+2]=255-a)}return r},fr=function(r){const t=this.threshold()*255,e=r.data,i=e.length;for(let n=0;n<i;n+=1)e[n]=e[n]<t?0:255};u.addGetterSetter(T,"threshold",.5,w(),u.afterSetFilter);const ur=Qe.Util._assign(Qe,{Arc:ot,Arrow:Ct,Circle:Et,Ellipse:pt,Image:it,Label:Ie,Tag:xt,Line:ht,Path:q,Rect:qt,RegularPolygon:mt,Ring:wt,Sprite:rt,Star:_t,Text:j,TextPath:Q,Transformer:N,Wedge:lt,Filters:{Blur:Bs,Brightness:Ws,Brighten:Hs,Contrast:zs,Emboss:Ys,Enhance:Xs,Grayscale:Us,HSL:Vs,HSV:qs,Invert:js,Kaleidoscope:Qs,Mask:sr,Noise:rr,Pixelate:ar,Posterize:or,RGB:hr,RGBA:lr,Sepia:cr,Solarize:dr,Threshold:fr}}),gr=Object.freeze(Object.defineProperty({__proto__:null,default:ur},Symbol.toStringTag,{value:"Module"})),ce="__mf_module_cache__";globalThis[ce]||={share:{},remote:{}};globalThis[ce].share||={};globalThis[ce].remote||={};const Wi=globalThis[ce];let ut=Wi.share.konva;ut===void 0&&(ut=gr,Wi.share.konva=ut);const pr=ut,mr=ut.__esModule?ut.default:ut.default??ut,_r=zi({__proto__:null,default:mr},[pr]);export{Qe as K,_r as _,k as a,gr as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_}from"./__mfe_internal__admin_ui_host__loadShare__konva__loadShare__.mjs-g85Oidc0.js";import{b as a}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-C_6K4VBY.js";const o=a(_);export{o as r};
|
|
@@ -6,4 +6,4 @@ import{g as Y}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var T=Symbol.for("react.transitional.element"),$=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),G=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),V=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),h=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=h&&e[h]||e["@@iterator"],typeof e=="function"?e:null)}var H={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I=Object.assign,j={};function p(e,t,r){this.props=e,this.context=t,this.refs=j,this.updater=r||H}p.prototype.isReactComponent={};p.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};p.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function M(){}M.prototype=p.prototype;function v(e,t,r){this.props=e,this.context=t,this.refs=j,this.updater=r||H}var C=v.prototype=new M;C.constructor=v;I(C,p.prototype);C.isPureReactComponent=!0;var g=Array.isArray;function R(){}var _={H:null,A:null,T:null,S:null},b=Object.prototype.hasOwnProperty;function d(e,t,r){var n=r.ref;return{$$typeof:T,type:e,key:t,ref:n!==void 0?n:null,props:r}}function X(e,t){return d(e.type,t,e.props)}function S(e){return typeof e=="object"&&e!==null&&e.$$typeof===T}function Z(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var A=/\/+/g;function y(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Z(""+e.key):t.toString(36)}function J(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(R,R):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function l(e,t,r,n,o){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var f=!1;if(e===null)f=!0;else switch(s){case"bigint":case"string":case"number":f=!0;break;case"object":switch(e.$$typeof){case T:case $:f=!0;break;case w:return f=e._init,l(f(e._payload),t,r,n,o)}}if(f)return o=o(e),f=n===""?"."+y(e,0):n,g(o)?(r="",f!=null&&(r=f.replace(A,"$&/")+"/"),l(o,t,r,"",function(U){return U})):o!=null&&(S(o)&&(o=X(o,r+(o.key==null||e&&e.key===o.key?"":(""+o.key).replace(A,"$&/")+"/")+f)),t.push(o)),1;f=0;var c=n===""?".":n+":";if(g(e))for(var i=0;i<e.length;i++)n=e[i],s=c+y(n,i),f+=l(n,t,r,s,o);else if(i=Q(e),typeof i=="function")for(e=i.call(e),i=0;!(n=e.next()).done;)n=n.value,s=c+y(n,i++),f+=l(n,t,r,s,o);else if(s==="object"){if(typeof e.then=="function")return l(J(e),t,r,n,o);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return f}function m(e,t,r){if(e==null)return e;var n=[],o=0;return l(e,n,"","",function(s){return t.call(r,s,o++)}),n}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var O=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ee={map:m,forEach:function(e,t,r){m(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return m(e,function(){t++}),t},toArray:function(e){return m(e,function(t){return t})||[]},only:function(e){if(!S(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};u.Activity=B;u.Children=ee;u.Component=p;u.Fragment=D;u.Profiler=z;u.PureComponent=v;u.StrictMode=k;u.Suspense=W;u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_;u.__COMPILER_RUNTIME={__proto__:null,c:function(e){return _.H.useMemoCache(e)}};u.cache=function(e){return function(){return e.apply(null,arguments)}};u.cacheSignal=function(){return null};u.cloneElement=function(e,t,r){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=I({},e.props),o=e.key;if(t!=null)for(s in t.key!==void 0&&(o=""+t.key),t)!b.call(t,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&t.ref===void 0||(n[s]=t[s]);var s=arguments.length-2;if(s===1)n.children=r;else if(1<s){for(var f=Array(s),c=0;c<s;c++)f[c]=arguments[c+2];n.children=f}return d(e.type,o,n)};u.createContext=function(e){return e={$$typeof:G,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:q,_context:e},e};u.createElement=function(e,t,r){var n,o={},s=null;if(t!=null)for(n in t.key!==void 0&&(s=""+t.key),t)b.call(t,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(o[n]=t[n]);var f=arguments.length-2;if(f===1)o.children=r;else if(1<f){for(var c=Array(f),i=0;i<f;i++)c[i]=arguments[i+2];o.children=c}if(e&&e.defaultProps)for(n in f=e.defaultProps,f)o[n]===void 0&&(o[n]=f[n]);return d(e,s,o)};u.createRef=function(){return{current:null}};u.forwardRef=function(e){return{$$typeof:K,render:e}};u.isValidElement=S;u.lazy=function(e){return{$$typeof:w,_payload:{_status:-1,_result:e},_init:F}};u.memo=function(e,t){return{$$typeof:V,type:e,compare:t===void 0?null:t}};u.startTransition=function(e){var t=_.T,r={};_.T=r;try{var n=e(),o=_.S;o!==null&&o(r,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(R,O)}catch(s){O(s)}finally{t!==null&&r.types!==null&&(t.types=r.types),_.T=t}};u.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()};u.use=function(e){return _.H.use(e)};u.useActionState=function(e,t,r){return _.H.useActionState(e,t,r)};u.useCallback=function(e,t){return _.H.useCallback(e,t)};u.useContext=function(e){return _.H.useContext(e)};u.useDebugValue=function(){};u.useDeferredValue=function(e,t){return _.H.useDeferredValue(e,t)};u.useEffect=function(e,t){return _.H.useEffect(e,t)};u.useEffectEvent=function(e){return _.H.useEffectEvent(e)};u.useId=function(){return _.H.useId()};u.useImperativeHandle=function(e,t,r){return _.H.useImperativeHandle(e,t,r)};u.useInsertionEffect=function(e,t){return _.H.useInsertionEffect(e,t)};u.useLayoutEffect=function(e,t){return _.H.useLayoutEffect(e,t)};u.useMemo=function(e,t){return _.H.useMemo(e,t)};u.useOptimistic=function(e,t){return _.H.useOptimistic(e,t)};u.useReducer=function(e,t,r){return _.H.useReducer(e,t,r)};u.useRef=function(e){return _.H.useRef(e)};u.useState=function(e){return _.H.useState(e)};u.useSyncExternalStore=function(e,t,r){return _.H.useSyncExternalStore(e,t,r)};u.useTransition=function(){return _.H.useTransition()};u.version="19.2.5";N.exports=u;var x=N.exports;const te=Y(x),ne=P({__proto__:null,default:te},[x]),E="__mf_module_cache__";globalThis[E]||={share:{},remote:{}};globalThis[E].share||={};globalThis[E].remote||={};const L=globalThis[E];let a=L.share.react;a===void 0&&(a=ne,L.share.react=a);const re=a,ue=a.__esModule?a.default:a.default??a,{Activity:oe,Children:se,Component:fe,Fragment:_e,Profiler:ie,PureComponent:ce,StrictMode:ae,Suspense:le,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:pe,__COMPILER_RUNTIME:me,cache:Ee,cacheSignal:ye,cloneElement:Re,createContext:Te,createElement:ve,createRef:Ce,forwardRef:de,isValidElement:Se,lazy:he,memo:ge,startTransition:Ae,unstable_useCacheRefresh:Oe,use:Pe,useActionState:Ne,useCallback:we,useContext:He,useDebugValue:Ie,useDeferredValue:je,useEffect:Me,useEffectEvent:be,useId:xe,useImperativeHandle:Le,useInsertionEffect:Ue,useLayoutEffect:Ye,useMemo:$e,useOptimistic:De,useReducer:ke,useRef:ze,useState:qe,useSyncExternalStore:Ge,useTransition:Ke,version:We}=a,Be=P({__proto__:null,Activity:oe,Children:se,Component:fe,Fragment:_e,Profiler:ie,PureComponent:ce,StrictMode:ae,Suspense:le,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:pe,__COMPILER_RUNTIME:me,cache:Ee,cacheSignal:ye,cloneElement:Re,createContext:Te,createElement:ve,createRef:Ce,default:ue,forwardRef:de,isValidElement:Se,lazy:he,memo:ge,startTransition:Ae,unstable_useCacheRefresh:Oe,use:Pe,useActionState:Ne,useCallback:we,useContext:He,useDebugValue:Ie,useDeferredValue:je,useEffect:Me,useEffectEvent:be,useId:xe,useImperativeHandle:Le,useInsertionEffect:Ue,useLayoutEffect:Ye,useMemo:$e,useOptimistic:De,useReducer:ke,useRef:ze,useState:qe,useSyncExternalStore:Ge,useTransition:Ke,version:We},[re]);export{ue as R,ne as _,Be as a,Te as b,Me as c,He as d,qe as e,$e as f,Ge as g,we as h,ze as i,
|
|
9
|
+
*/var T=Symbol.for("react.transitional.element"),$=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),G=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),V=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),h=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=h&&e[h]||e["@@iterator"],typeof e=="function"?e:null)}var H={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I=Object.assign,j={};function p(e,t,r){this.props=e,this.context=t,this.refs=j,this.updater=r||H}p.prototype.isReactComponent={};p.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};p.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function M(){}M.prototype=p.prototype;function v(e,t,r){this.props=e,this.context=t,this.refs=j,this.updater=r||H}var C=v.prototype=new M;C.constructor=v;I(C,p.prototype);C.isPureReactComponent=!0;var g=Array.isArray;function R(){}var _={H:null,A:null,T:null,S:null},b=Object.prototype.hasOwnProperty;function d(e,t,r){var n=r.ref;return{$$typeof:T,type:e,key:t,ref:n!==void 0?n:null,props:r}}function X(e,t){return d(e.type,t,e.props)}function S(e){return typeof e=="object"&&e!==null&&e.$$typeof===T}function Z(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var A=/\/+/g;function y(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Z(""+e.key):t.toString(36)}function J(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(R,R):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function l(e,t,r,n,o){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var f=!1;if(e===null)f=!0;else switch(s){case"bigint":case"string":case"number":f=!0;break;case"object":switch(e.$$typeof){case T:case $:f=!0;break;case w:return f=e._init,l(f(e._payload),t,r,n,o)}}if(f)return o=o(e),f=n===""?"."+y(e,0):n,g(o)?(r="",f!=null&&(r=f.replace(A,"$&/")+"/"),l(o,t,r,"",function(U){return U})):o!=null&&(S(o)&&(o=X(o,r+(o.key==null||e&&e.key===o.key?"":(""+o.key).replace(A,"$&/")+"/")+f)),t.push(o)),1;f=0;var c=n===""?".":n+":";if(g(e))for(var i=0;i<e.length;i++)n=e[i],s=c+y(n,i),f+=l(n,t,r,s,o);else if(i=Q(e),typeof i=="function")for(e=i.call(e),i=0;!(n=e.next()).done;)n=n.value,s=c+y(n,i++),f+=l(n,t,r,s,o);else if(s==="object"){if(typeof e.then=="function")return l(J(e),t,r,n,o);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return f}function m(e,t,r){if(e==null)return e;var n=[],o=0;return l(e,n,"","",function(s){return t.call(r,s,o++)}),n}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var O=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ee={map:m,forEach:function(e,t,r){m(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return m(e,function(){t++}),t},toArray:function(e){return m(e,function(t){return t})||[]},only:function(e){if(!S(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};u.Activity=B;u.Children=ee;u.Component=p;u.Fragment=D;u.Profiler=z;u.PureComponent=v;u.StrictMode=k;u.Suspense=W;u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_;u.__COMPILER_RUNTIME={__proto__:null,c:function(e){return _.H.useMemoCache(e)}};u.cache=function(e){return function(){return e.apply(null,arguments)}};u.cacheSignal=function(){return null};u.cloneElement=function(e,t,r){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=I({},e.props),o=e.key;if(t!=null)for(s in t.key!==void 0&&(o=""+t.key),t)!b.call(t,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&t.ref===void 0||(n[s]=t[s]);var s=arguments.length-2;if(s===1)n.children=r;else if(1<s){for(var f=Array(s),c=0;c<s;c++)f[c]=arguments[c+2];n.children=f}return d(e.type,o,n)};u.createContext=function(e){return e={$$typeof:G,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:q,_context:e},e};u.createElement=function(e,t,r){var n,o={},s=null;if(t!=null)for(n in t.key!==void 0&&(s=""+t.key),t)b.call(t,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(o[n]=t[n]);var f=arguments.length-2;if(f===1)o.children=r;else if(1<f){for(var c=Array(f),i=0;i<f;i++)c[i]=arguments[i+2];o.children=c}if(e&&e.defaultProps)for(n in f=e.defaultProps,f)o[n]===void 0&&(o[n]=f[n]);return d(e,s,o)};u.createRef=function(){return{current:null}};u.forwardRef=function(e){return{$$typeof:K,render:e}};u.isValidElement=S;u.lazy=function(e){return{$$typeof:w,_payload:{_status:-1,_result:e},_init:F}};u.memo=function(e,t){return{$$typeof:V,type:e,compare:t===void 0?null:t}};u.startTransition=function(e){var t=_.T,r={};_.T=r;try{var n=e(),o=_.S;o!==null&&o(r,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(R,O)}catch(s){O(s)}finally{t!==null&&r.types!==null&&(t.types=r.types),_.T=t}};u.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()};u.use=function(e){return _.H.use(e)};u.useActionState=function(e,t,r){return _.H.useActionState(e,t,r)};u.useCallback=function(e,t){return _.H.useCallback(e,t)};u.useContext=function(e){return _.H.useContext(e)};u.useDebugValue=function(){};u.useDeferredValue=function(e,t){return _.H.useDeferredValue(e,t)};u.useEffect=function(e,t){return _.H.useEffect(e,t)};u.useEffectEvent=function(e){return _.H.useEffectEvent(e)};u.useId=function(){return _.H.useId()};u.useImperativeHandle=function(e,t,r){return _.H.useImperativeHandle(e,t,r)};u.useInsertionEffect=function(e,t){return _.H.useInsertionEffect(e,t)};u.useLayoutEffect=function(e,t){return _.H.useLayoutEffect(e,t)};u.useMemo=function(e,t){return _.H.useMemo(e,t)};u.useOptimistic=function(e,t){return _.H.useOptimistic(e,t)};u.useReducer=function(e,t,r){return _.H.useReducer(e,t,r)};u.useRef=function(e){return _.H.useRef(e)};u.useState=function(e){return _.H.useState(e)};u.useSyncExternalStore=function(e,t,r){return _.H.useSyncExternalStore(e,t,r)};u.useTransition=function(){return _.H.useTransition()};u.version="19.2.5";N.exports=u;var x=N.exports;const te=Y(x),ne=P({__proto__:null,default:te},[x]),E="__mf_module_cache__";globalThis[E]||={share:{},remote:{}};globalThis[E].share||={};globalThis[E].remote||={};const L=globalThis[E];let a=L.share.react;a===void 0&&(a=ne,L.share.react=a);const re=a,ue=a.__esModule?a.default:a.default??a,{Activity:oe,Children:se,Component:fe,Fragment:_e,Profiler:ie,PureComponent:ce,StrictMode:ae,Suspense:le,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:pe,__COMPILER_RUNTIME:me,cache:Ee,cacheSignal:ye,cloneElement:Re,createContext:Te,createElement:ve,createRef:Ce,forwardRef:de,isValidElement:Se,lazy:he,memo:ge,startTransition:Ae,unstable_useCacheRefresh:Oe,use:Pe,useActionState:Ne,useCallback:we,useContext:He,useDebugValue:Ie,useDeferredValue:je,useEffect:Me,useEffectEvent:be,useId:xe,useImperativeHandle:Le,useInsertionEffect:Ue,useLayoutEffect:Ye,useMemo:$e,useOptimistic:De,useReducer:ke,useRef:ze,useState:qe,useSyncExternalStore:Ge,useTransition:Ke,version:We}=a,Be=P({__proto__:null,Activity:oe,Children:se,Component:fe,Fragment:_e,Profiler:ie,PureComponent:ce,StrictMode:ae,Suspense:le,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:pe,__COMPILER_RUNTIME:me,cache:Ee,cacheSignal:ye,cloneElement:Re,createContext:Te,createElement:ve,createRef:Ce,default:ue,forwardRef:de,isValidElement:Se,lazy:he,memo:ge,startTransition:Ae,unstable_useCacheRefresh:Oe,use:Pe,useActionState:Ne,useCallback:we,useContext:He,useDebugValue:Ie,useDeferredValue:je,useEffect:Me,useEffectEvent:be,useId:xe,useImperativeHandle:Le,useInsertionEffect:Ue,useLayoutEffect:Ye,useMemo:$e,useOptimistic:De,useReducer:ke,useRef:ze,useState:qe,useSyncExternalStore:Ge,useTransition:Ke,version:We},[re]);export{ue as R,ne as _,Be as a,Te as b,Me as c,He as d,qe as e,$e as f,Ge as g,we as h,ze as i,fe as j,ve as k,Pe as l,xe as m,de as n,Ye as o,Ae as p,se as q,Se as r,_e as s,ge as t,Le as u,je as v,ae as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-
|
|
1
|
+
import{a as e}from"./__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-DC63qZbr.js";import{b as r}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-C_6K4VBY.js";const m=r(e);export{m as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as v}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-C_6K4VBY.js";import{r as T}from"./__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-
|
|
1
|
+
import{g as v}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-C_6K4VBY.js";import{r as T}from"./__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-D2C49VyZ.js";function d(r,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const f in i)if(f!=="default"&&!(f in r)){const o=Object.getOwnPropertyDescriptor(i,f);o&&Object.defineProperty(r,f,o.get?o:{enumerable:!0,get:()=>i[f]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var g={exports:{}},_={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-dom.production.js
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-
|
|
1
|
+
import{a as e}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-D3WbXy3O.js";import{b as r}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-C_6K4VBY.js";const m=r(e);export{m as r};
|