From fa7a0bdd0cebad074d9c7d9720e577d8a85e39d3 Mon Sep 17 00:00:00 2001 From: nextcloud-command Date: Sun, 30 Jul 2023 03:13:37 +0000 Subject: [PATCH] chore(deps): fix npm audit Signed-off-by: GitHub --- js/viewer-filerobot.js | 4 ++-- js/viewer-filerobot.js.map | 2 +- js/viewer-main.js | 4 ++-- js/viewer-main.js.map | 2 +- package-lock.json | 28 ++++++++++++++-------------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/js/viewer-filerobot.js b/js/viewer-filerobot.js index 7e9cd0943..cd01080fa 100644 --- a/js/viewer-filerobot.js +++ b/js/viewer-filerobot.js @@ -1,3 +1,3 @@ /*! For license information please see viewer-filerobot.js.LICENSE.txt */ -(self.webpackChunkviewer=self.webpackChunkviewer||[]).push([["filerobot"],{3300:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>V_});var r={};n.r(r),n.d(r,{appendChild:()=>_o,appendChildToContainer:()=>Lo,appendInitialChild:()=>lo,cancelTimeout:()=>xo,clearContainer:()=>Bo,commitMount:()=>Do,commitTextUpdate:()=>Ro,commitUpdate:()=>Ao,createInstance:()=>so,createTextInstance:()=>co,detachDeletedInstance:()=>Vo,finalizeInitialChildren:()=>uo,getChildHostContext:()=>wo,getCurrentEventPriority:()=>Wo,getPublicInstance:()=>fo,getRootHostContext:()=>bo,hideInstance:()=>zo,hideTextInstance:()=>No,idlePriority:()=>io.unstable_IdlePriority,insertBefore:()=>Io,insertInContainerBefore:()=>To,isPrimaryRenderer:()=>Oo,noTimeout:()=>Eo,now:()=>io.unstable_now,prepareForCommit:()=>ho,preparePortalMount:()=>po,prepareUpdate:()=>go,removeChild:()=>jo,removeChildFromContainer:()=>Mo,resetAfterCommit:()=>mo,resetTextContent:()=>vo,run:()=>io.unstable_runWithPriority,scheduleTimeout:()=>Co,shouldDeprioritizeSubtree:()=>yo,shouldSetTextContent:()=>So,supportsMutation:()=>Po,unhideInstance:()=>Fo,unhideTextInstance:()=>Ho,warnsIfNotActing:()=>ko});var i={};n.r(i),n.d(i,{Aden:()=>Pl,Amaro:()=>jl,Ashby:()=>qs,BlackAndWhite:()=>rl,Brannan:()=>ms,Brooklyn:()=>Ws,Charmes:()=>Qs,Clarendon:()=>ol,Crema:()=>xl,Dogpatch:()=>Hs,Earlybird:()=>hs,Gingham:()=>ll,Ginza:()=>As,Hefe:()=>ns,Helena:()=>Us,Hudson:()=>Bl,Juno:()=>vl,Kelvin:()=>Ts,Lark:()=>fl,LoFi:()=>es,Ludwig:()=>Sl,Maven:()=>Rs,Mayfair:()=>Dl,Moon:()=>cl,Nashville:()=>os,NinteenSeventySeven:()=>Ps,Perpetua:()=>Il,Reyes:()=>pl,Rise:()=>Nl,Sierra:()=>ql,Skyline:()=>Ns,Slumber:()=>bl,Stinson:()=>ls,Sutro:()=>ys,Toaster:()=>Cs,Valencia:()=>Gl,Vesper:()=>us,Walden:()=>Ss,Willow:()=>Ql,XPro2:()=>Xl});var o={};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function l(e){var t=function(e,t){if("object"!==a(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===a(t)?t:String(t)}function s(e,t){for(var n=0;nrc,Warmth:()=>tc});var h=n(7294),p=n(745);function g(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var m=n(5697),v=n.n(m),y=n(9864),b=n(6774),w=n.n(b);const C=function(e){function t(e,r,s,c,f){for(var h,p,g,m,w,x=0,E=0,S=0,O=0,k=0,j=0,R=g=h=0,A=0,z=0,N=0,F=0,H=s.length,B=H-1,V="",W="",G="",Z="";Ah)&&(F=(V=V.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0s.charCodeAt(8))break;case 115:a=a.replace(s,"-webkit-"+s)+";"+a;break;case 207:case 102:a=a.replace(s,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var V=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)(i<<=1)<0&&B(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o=Z&&(Z=t+1),W.set(e,t),G.set(t,e)},q="style["+z+'][data-styled-version="5.3.11"]',$=new RegExp("^"+z+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),K=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(z))return r}}(n),o=void 0!==i?i.nextSibling:null;r.setAttribute(z,"active"),r.setAttribute("data-styled-version","5.3.11");var a=J();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},te=function(){function e(e){var t=this.element=ee(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(c+=e+",")})),r+=""+l+s+'{content:"'+c+'"}/*!sc*/\n'}}}return r}(this)},e}(),le=/(a)(d)/gi,se=function(e){return String.fromCharCode(e+(e>25?39:97))};function ce(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=se(t%52)+n;return(se(t%52)+n).replace(le,"$1-$2")}var ue=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},de=function(e){return ue(5381,e)};function fe(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var l=n(o,"."+a,void 0,r);t.insertRules(r,a,l)}i.push(a),this.staticRulesId=a}else{for(var s=this.rules.length,c=ue(this.baseHash,n.hash),u="",d=0;d>>0);if(!t.hasNameForId(r,g)){var m=n(u,"."+g,void 0,r);t.insertRules(r,g,m)}i.push(g)}}return i.join(" ")},e}(),ge=/^\s*\/\/.*$/gm,me=[":","[",".","#"];function ve(e){var t,n,r,i,o=void 0===e?M:e,a=o.options,l=void 0===a?M:a,s=o.plugins,c=void 0===s?j:s,u=new C(l),d=[],f=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,i,o,a,l,s,c,u,d){switch(n){case 1:if(0===u&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===c)return r+"/*|*/";break;case 3:switch(c){case 102:case 112:return e(i[0]+r),"";default:return r+(0===d?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){d.push(e)})),h=function(e,r,o){return 0===r&&-1!==me.indexOf(o[n.length])||o.match(i)?e:"."+t};function p(e,o,a,l){void 0===l&&(l="&");var s=e.replace(ge,""),c=o&&a?a+" "+o+" { "+s+" }":s;return t=l,n=o,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),u(a||!o?"":o,c)}return u.use([].concat(c,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(n)>0&&(i[0]=i[0].replace(r,h))},f,function(e){if(-2===e){var t=d;return d=[],t}}])),p.hash=c.length?c.reduce((function(e,t){return t.name||B(15),ue(e,t.name)}),5381).toString():"",p}var ye=h.createContext(),be=(ye.Consumer,h.createContext()),we=(be.Consumer,new ae),Ce=ve();function xe(){return(0,h.useContext)(ye)||we}function Ee(){return(0,h.useContext)(be)||Ce}function Se(e){var t=(0,h.useState)(e.stylisPlugins),n=t[0],r=t[1],i=xe(),o=(0,h.useMemo)((function(){var t=i;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),a=(0,h.useMemo)((function(){return ve({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return(0,h.useEffect)((function(){w()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),h.createElement(ye.Provider,{value:o},h.createElement(be.Provider,{value:a},e.children))}var Oe=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ce);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return B(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=Ce),this.name+e.hash},e}(),ke=/([A-Z])/,Pe=/([A-Z])/g,_e=/^ms-/,Le=function(e){return"-"+e.toLowerCase()};function Ie(e){return ke.test(e)?e.replace(Pe,Le).replace(_e,"-ms-"):e}var Te=function(e){return null==e||!1===e||""===e};function je(e,t,n,r){if(Array.isArray(e)){for(var i,o=[],a=0,l=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,ze=/(^-|-$)/g;function Ne(e){return e.replace(Ae,"-").replace(ze,"")}var Fe=function(e){return ce(de(e)>>>0)};function He(e){return"string"==typeof e&&!0}var Be=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Ve=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function We(e,t,n){var r=e[n];Be(t)&&Be(r)?Ge(r,t):e[n]=t}function Ge(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(i[n]=e[n]);return i}(t,["componentId"]),o=r&&r+"-"+(He(e)?e:Ne(D(e)));return Ye(e,L({},i,{attrs:f,componentId:o}),n)},Object.defineProperty(g,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Ge({},e.defaultProps,t):t}}),Object.defineProperty(g,"toString",{value:function(){return"."+g.styledComponentId}}),i&&P()(g,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),g}var qe=function(e){return function e(t,n,r){if(void 0===r&&(r=M),!(0,y.isValidElementType)(n))return B(1,String(n));var i=function(){return t(n,r,Re.apply(void 0,arguments))};return i.withConfig=function(i){return e(t,n,L({},r,{},i))},i.attrs=function(i){return e(t,n,L({},r,{attrs:Array.prototype.concat(r.attrs,i).filter(Boolean)}))},i}(Ye,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){qe[e]=qe(e)}));var $e=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=fe(e),ae.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,n,r){var i=r(je(this.rules,t,n,r).join(""),""),o=this.componentId+e;n.insertRules(o,o,i)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&ae.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function Ke(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r"+t+""},this.getStyleTags=function(){return e.sealed?B(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return B(2);var n=((t={})[z]="",t["data-styled-version"]="5.3.11",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=J();return r&&(n.nonce=r),[h.createElement("style",L({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new ae({isServer:!0}),this.sealed=!1}var t=e.prototype;t.collectStyles=function(e){return this.sealed?B(2):h.createElement(Se,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return B(3)}}();const Qe=qe;var Je=n(2378),et=n.n(Je),tt=function(e,t){return e.reduce((function(e,n){return Object.assign(e,c({},n,t))}),{})};function nt(e){return Object.values(e)}function rt(e){return Object.keys(e)}var it,ot,at,lt,st,ct={Xs:"xs",Sm:"sm",Md:"md",Lg:"lg",Xl:"xl"},ut={TextPrimary:"txt-primary",TextPrimaryInvert:"txt-primary-invert",TextSecondary:"txt-secondary",TextSecondaryInvert:"txt-secondary-invert",TextPlaceholder:"txt-placeholder",AccentPrimary:"accent-primary",AccentPrimaryHover:"accent-primary-hover",AccentPrimaryActive:"accent-primary-active",AccentPrimaryDisabled:"accent-primary-disabled",BackgroundPrimary:"bg-primary",BackgroundPrimaryHover:"bg-primary-hover",BackgroundPrimaryActive:"bg-primary-active",BackgroundPrimary_0_5_Opacity:"bg-primary-0-5-opacity",BackgroundSecondary:"bg-secondary",IconsPrimary:"icons-primary",IconsPrimaryOpacity_0_6:"icons-primary-opacity-0-6",IconsSecondary:"icons-secondary",IconsPlaceholder:"icons-placeholder",ButtonPrimaryText:"btn-primary-text",ButtonDisabledText:"btn-disabled-text",LinkPrimary:"link-primary",LinkHover:"link-hover",LinkActive:"link-active",BordersPrimary:"borders-primary",BordersSecondary:"borders-secondary",BordersStrong:"borders-strong",BordersInvert:"borders-invert",BorderActiveBottom:"border-active-bottom",ActiveSecondary:"active-secondary",ActiveSecondaryHover:"active-secondary-hover",ActiveSecondaryActive:"active-secondary-active",Tag:"tag",Error:"error",Success:"success",Warning:"warning",Info:"info",LightShadow:"light-shadow"},dt={TextExtraSmall:"text-extra-small",TextSmall:"text-small",TextNormal:"text-normal",TextEmphasis:"text-emphasis",TextExtraLarge:"text-extra-large",LabelExtraSmall:"label-extra-small",LabelSmall:"label-small",LabelNormal:"label-normal",LabelEmphasis:"label-emphasis",LabelExtraLarge:"label-extra-large",ButtonXs:"btn-xs",ButtonSm:"btn-sm",ButtonMd:"btn-md",ButtonLg:"btn-lg",ButtonXl:"btn-xl",InputSm:"input-sm",InputMd:"input-md"},ft={Sm:"sm",Md:"md",Lg:"lg"};function ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pt(e){for(var t=1;t=n.xs&&e<=n.sm?t?r(i.xs):i.xs:e>=n.sm&&e=n.md&&e=n.lg&&e=n.xl?t?r(i.xl):i.xl:t?r(i.md):i.md},up:l,down:function(e){var t=n[e];return"@media (max-width:".concat(t).concat(o,")")},between:s,only:function(e){return a.indexOf(e)+11?t-1:0),r=1;re.length)&&(t=e.length);for(var n=0,r=new Array(t);nHt.angleDeg?e*Nt:e,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,pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>Ht.DD.isDragging,isDragReady:()=>!!Ht.DD.node,releaseCanvasOnDestroy:!0,document:Ft.document,_injectGlobal(e){Ft.Konva=e}},Bt=e=>{Ht[e.prototype.getClassName()]=e};Ht._injectGlobal(Ht);class Vt{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.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 Vt(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){var t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){var t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,i=this.m[1]*t+this.m[3]*n,o=this.m[0]*-n+this.m[2]*t,a=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=a,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){var n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,i=this.m[2]+this.m[0]*e,o=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this}multiply(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],i=this.m[1]*e.m[2]+this.m[3]*e.m[3],o=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],a=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=o,this.m[5]=a,this}invert(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,i=this.m[0]*e,o=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),a=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=o,this.m[5]=a,this}getMatrix(){return this.m}decompose(){var e=this.m[0],t=this.m[1],n=this.m[2],r=this.m[3],i=e*r-t*n;let o={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=e||0!=t){var a=Math.sqrt(e*e+t*t);o.rotation=t>0?Math.acos(e/a):-Math.acos(e/a),o.scaleX=a,o.scaleY=i/a,o.skewX=(e*n+t*r)/i,o.skewY=0}else if(0!=n||0!=r){var l=Math.sqrt(n*n+r*r);o.rotation=Math.PI/2-(r>0?Math.acos(-n/l):-Math.acos(n/l)),o.scaleX=i/l,o.scaleY=l,o.skewX=0,o.skewY=(e*n+t*r)/i}return o.rotation=$t._getRotation(o.rotation),o}}var Wt=Math.PI/180,Gt=180/Math.PI,Zt="Konva error: ",Ut={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]},Xt=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Yt=[];const qt="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||function(e){setTimeout(e,60)},$t={_isElement:e=>!(!e||1!=e.nodeType),_isFunction:e=>!!(e&&e.constructor&&e.call&&e.apply),_isPlainObject:e=>!!e&&e.constructor===Object,_isArray:e=>"[object Array]"===Object.prototype.toString.call(e),_isNumber:e=>"[object Number]"===Object.prototype.toString.call(e)&&!isNaN(e)&&isFinite(e),_isString:e=>"[object String]"===Object.prototype.toString.call(e),_isBoolean:e=>"[object Boolean]"===Object.prototype.toString.call(e),isObject:e=>e instanceof Object,isValidSelector(e){if("string"!=typeof e)return!1;var t=e[0];return"#"===t||"."===t||t===t.toUpperCase()},_sign:e=>0===e||e>0?1:-1,requestAnimFrame(e){Yt.push(e),1===Yt.length&&qt((function(){const e=Yt;Yt=[],e.forEach((function(e){e()}))}))},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(e){}return e},createImageElement:()=>document.createElement("img"),_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=$t.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex:(e,t,n)=>((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1),_hexToRgb(e){e=e.replace("#","");var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},getRandomColor(){for(var e=(16777215*Math.random()<<0).toString(16);e.length<6;)e="0"+e;return"#"+e},getRGB(e){var t;return e in Ut?{r:(t=Ut[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?(t=Xt.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA:e=>(e=e||"black",$t._namedColorToRBA(e)||$t._hex3ColorToRGBA(e)||$t._hex4ColorToRGBA(e)||$t._hex6ColorToRGBA(e)||$t._hex8ColorToRGBA(e)||$t._rgbColorToRGBA(e)||$t._rgbaColorToRGBA(e)||$t._hslColorToRGBA(e)),_namedColorToRBA(e){var t=Ut[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(0===e.indexOf("rgb(")){var t=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(0===e.indexOf("rgba(")){var t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(((e,t)=>"%"===e.slice(-1)?3===t?parseInt(e)/100:parseInt(e)/100*255:Number(e)));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(e){if("#"===e[0]&&9===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if("#"===e[0]&&7===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if("#"===e[0]&&5===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if("#"===e[0]&&4===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let a,l,s;if(0===i)return s=255*o,{r:Math.round(s),g:Math.round(s),b:Math.round(s),a:1};a=o<.5?o*(1+i):o+i-o*i;const c=2*o-a,u=[0,0,0];for(let e=0;e<3;e++)l=r+1/3*-(e-1),l<0&&l++,l>1&&l--,s=6*l<1?c+6*(a-c)*l:2*l<1?a:3*l<2?c+(a-c)*(2/3-l)*6:c,u[e]=255*s;return{r:Math.round(u[0]),g:Math.round(u[1]),b:Math.round(u[2]),a:1}}},haveIntersection:(e,t)=>!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.heighte.slice(0),degToRad:e=>e*Wt,radToDeg:e=>e*Gt,_degToRad:e=>($t.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),$t.degToRad(e)),_radToDeg:e=>($t.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),$t.radToDeg(e)),_getRotation:e=>Ht.angleDeg?$t.radToDeg(e):e,_capitalize:e=>e.charAt(0).toUpperCase()+e.slice(1),throw(e){throw new Error(Zt+e)},error(e){console.error(Zt+e)},warn(e){Ht.showWarnings&&console.warn("Konva warning: "+e)},each(e,t){for(var n in e)t(n,e[n])},_inRange:(e,t,n)=>t<=e&&e1?(a=n,l=r,s=(n-i)*(n-i)+(r-o)*(r-o)):s=((a=e+u*(n-e))-i)*(a-i)+((l=t+u*(r-t))-o)*(l-o)}return[a,l,s]},_getProjectionToLine(e,t,n){var r=$t.cloneObject(e),i=Number.MAX_VALUE;return t.forEach((function(o,a){if(n||a!==t.length-1){var l=t[(a+1)%t.length],s=$t._getProjectionToSegment(o.x,o.y,l.x,l.y,e.x,e.y),c=s[0],u=s[1],d=s[2];dt.length){var a=t;t=e,e=a}for(r=0;re.touches?e.changedTouches[0].identifier:e.pointerId||999,releaseCanvas(...e){Ht.releaseCanvasOnDestroy&&e.forEach((e=>{e.width=0,e.height=0}))},drawRoundedRectPath(e,t,n,r){let i=0,o=0,a=0,l=0;"number"==typeof r?i=o=a=l=Math.min(r,t/2,n/2):(i=Math.min(r[0]||0,t/2,n/2),o=Math.min(r[1]||0,t/2,n/2),l=Math.min(r[2]||0,t/2,n/2),a=Math.min(r[3]||0,t/2,n/2)),e.moveTo(i,0),e.lineTo(t-o,0),e.arc(t-o,o,o,3*Math.PI/2,0,!1),e.lineTo(t,n-l),e.arc(t-l,n-l,l,0,Math.PI/2,!1),e.lineTo(a,n),e.arc(a,n-a,a,Math.PI/2,Math.PI,!1),e.lineTo(0,i),e.arc(i,i,i,Math.PI,3*Math.PI/2,!1)}};function Kt(e){return $t._isString(e)?'"'+e+'"':"[object Number]"===Object.prototype.toString.call(e)||$t._isBoolean(e)?e:Object.prototype.toString.call(e)}function Qt(e){return e>255?255:e<0?0:Math.round(e)}function Jt(){if(Ht.isUnminified)return function(e,t){return $t._isNumber(e)||$t.warn(Kt(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function en(e){if(Ht.isUnminified)return function(t,n){let r=$t._isNumber(t),i=$t._isArray(t)&&t.length==e;return r||i||$t.warn(Kt(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function tn(){if(Ht.isUnminified)return function(e,t){return $t._isNumber(e)||"auto"===e||$t.warn(Kt(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function nn(){if(Ht.isUnminified)return function(e,t){return $t._isString(e)||$t.warn(Kt(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function rn(){if(Ht.isUnminified)return function(e,t){const n=$t._isString(e),r="[object CanvasGradient]"===Object.prototype.toString.call(e)||e&&e.addColorStop;return n||r||$t.warn(Kt(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function on(){if(Ht.isUnminified)return function(e,t){return!0===e||!1===e||$t.warn(Kt(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}var an="get",ln="set";const sn={addGetterSetter(e,t,n,r,i){sn.addGetter(e,t,n),sn.addSetter(e,t,r,i),sn.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=an+$t._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var e=this.attrs[t];return void 0===e?n:e}},addSetter(e,t,n,r){var i=ln+$t._capitalize(t);e.prototype[i]||sn.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=ln+$t._capitalize(t);e.prototype[i]=function(e){return n&&null!=e&&(e=n.call(this,e,t)),this._setAttr(t,e),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o,a,l=n.length,s=$t._capitalize,c=an+s(t),u=ln+s(t);e.prototype[c]=function(){var e={};for(o=0;o{this._setAttr(t+s(e),void 0)})),this._fireChangeEvent(t,a,e),i&&i.call(this),this},sn.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=$t._capitalize(t),r=ln+n,i=an+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){$t.error("Adding deprecated "+t);var i=an+$t._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){$t.error(o);var e=this.attrs[t];return void 0===e?n:e},sn.addSetter(e,t,r,(function(){$t.error(o)})),sn.addOverloadedGetterSetter(e,t)},backCompat(e,t){$t.each(t,(function(t,n){var r=e.prototype[n],i=an+$t._capitalize(t),o=ln+$t._capitalize(t);function a(){r.apply(this,arguments),$t.error('"'+t+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}e.prototype[t]=a,e.prototype[i]=a,e.prototype[o]=a}))},afterSetFilter(){this._filterUpToDate=!1}};var cn=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"];class un{constructor(e){this.canvas=e,Ht.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,t){var n,r,i,o,a=this.traceArr,l=a.length,s="";for(n=0;n"number"==typeof e?Math.floor(e):e))),s+="("+o.join(",")+")")):(s+=r.property,e||(s+="="+r.val)),s+=";";return s}clearTrace(){this.traceArr=[]}_trace(e){var t=this.traceArr;t.push(e),t.length>=100&&t.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){const t=e.attrs.lineCap;t&&this.setAttr("lineCap",t)}_applyOpacity(e){var t=e.getAbsoluteOpacity();1!==t&&this.setAttr("globalAlpha",t)}_applyLineJoin(e){const t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,i,o){this._context.arc(e,t,n,r,i,o)}arcTo(e,t,n,r,i){this._context.arcTo(e,t,n,r,i)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,i,o){this._context.bezierCurveTo(e,t,n,r,i,o)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(e,t){var n=arguments;return 2===n.length?this._context.createImageData(e,t):1===n.length?this._context.createImageData(e):void 0}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,i,o){return this._context.createRadialGradient(e,t,n,r,i,o)}drawImage(e,t,n,r,i,o,a,l,s){var c=arguments,u=this._context;3===c.length?u.drawImage(e,t,n):5===c.length?u.drawImage(e,t,n,r,i):9===c.length&&u.drawImage(e,t,n,r,i,o,a,l,s)}ellipse(e,t,n,r,i,o,a,l){this._context.ellipse(e,t,n,r,i,o,a,l)}isPointInPath(e,t,n,r){return n?this._context.isPointInPath(n,e,t,r):this._context.isPointInPath(e,t,r)}fill(e){e?this._context.fill(e):this._context.fill()}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,i,o){this._context.setTransform(e,t,n,r,i,o)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,i,o){this._context.transform(e,t,n,r,i,o)}translate(e,t){this._context.translate(e,t)}_enableTrace(){var e,t,n=this,r=cn.length,i=this.setAttr,o=function(e){var r,i=n[e];n[e]=function(){return t=function(e){var t,n,r=[],i=e.length,o=$t;for(t=0;t{"dragging"===t.dragStatus&&(e=!0)})),e},justDragged:!1,get node(){var e;return vn._dragElements.forEach((t=>{e=t.node})),e},_dragElements:new Map,_drag(e){const t=[];vn._dragElements.forEach(((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),void 0===n.pointerId&&(n.pointerId=$t._getFirstPointerId(e));const a=o._changedPointerPositions.find((e=>e.id===n.pointerId));if(a){if("dragging"!==n.dragStatus){var l=i.dragDistance();if(Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y)){t.fire("dragmove",{type:"dragmove",target:t,evt:e},!0)}))},_endDragBefore(e){const t=[];vn._dragElements.forEach((n=>{const{node:r}=n,i=r.getStage();e&&i.setPointersPositions(e);if(!i._changedPointerPositions.find((e=>e.id===n.pointerId)))return;"dragging"!==n.dragStatus&&"stopped"!==n.dragStatus||(vn.justDragged=!0,Ht._mouseListenClick=!1,Ht._touchListenClick=!1,Ht._pointerListenClick=!1,n.dragStatus="stopped");const o=n.node.getLayer()||n.node instanceof Ht.Stage&&n.node;o&&-1===t.indexOf(o)&&t.push(o)})),t.forEach((e=>{e.draw()}))},_endDragAfter(e){vn._dragElements.forEach(((t,n)=>{"stopped"===t.dragStatus&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),"dragging"!==t.dragStatus&&vn._dragElements.delete(n)}))}};Ht.isBrowser&&(window.addEventListener("mouseup",vn._endDragBefore,!0),window.addEventListener("touchend",vn._endDragBefore,!0),window.addEventListener("mousemove",vn._drag),window.addEventListener("touchmove",vn._drag),window.addEventListener("mouseup",vn._endDragAfter,!1),window.addEventListener("touchend",vn._endDragAfter,!1));var yn="absoluteOpacity",bn="allEventListeners",wn="absoluteTransform",Cn="absoluteScale",xn="canvas",En="listening",Sn="mouseenter",On="mouseleave",kn="Shape",Pn=" ",_n="stage",Ln="transform",In="visible",Tn=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Pn);let jn=1;class Mn{constructor(e){this._id=jn++,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(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){e!==Ln&&e!==wn||!this._cache.get(e)?e?this._cache.delete(e):this._cache.clear():this._cache.get(e).dirty=!0}_getCache(e,t){var n=this._cache.get(e);return(void 0===n||(e===Ln||e===wn)&&!0===n.dirty)&&(n=t.call(this),this._cache.set(e,n)),n}_calculate(e,t,n){if(!this._attachedDepsListeners.get(e)){const n=t.map((e=>e+"Change.konva")).join(Pn);this.on(n,(()=>{this._clearCache(e)})),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(xn)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===wn&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(xn)){const{scene:e,filter:t,hit:n}=this._cache.get(xn);$t.releaseCanvas(e,t,n),this._cache.delete(xn)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var t=e||{},n={};void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height||(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var r=Math.ceil(t.width||n.width),i=Math.ceil(t.height||n.height),o=t.pixelRatio,a=void 0===t.x?Math.floor(n.x):t.x,l=void 0===t.y?Math.floor(n.y):t.y,s=t.offset||0,c=t.drawBorder||!1,u=t.hitCanvasPixelRatio||1;if(r&&i){a-=s,l-=s;var d=new gn({pixelRatio:o,width:r+=2*s+1,height:i+=2*s+1}),f=new gn({pixelRatio:o,width:0,height:0}),h=new mn({pixelRatio:u,width:r,height:i}),p=d.getContext(),g=h.getContext();return h.isCache=!0,d.isCache=!0,this._cache.delete(xn),this._filterUpToDate=!1,!1===t.imageSmoothingEnabled&&(d.getContext()._context.imageSmoothingEnabled=!1,f.getContext()._context.imageSmoothingEnabled=!1),p.save(),g.save(),p.translate(-a,-l),g.translate(-a,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(yn),this._clearSelfAndDescendantCache(Cn),this.drawScene(d,this),this.drawHit(h,this),this._isUnderCache=!1,p.restore(),g.restore(),c&&(p.save(),p.beginPath(),p.rect(0,0,r,i),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set(xn,{scene:d,filter:f,hit:h,x:a,y:l}),this._requestDraw(),this}$t.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.")}isCached(){return this._cache.has(xn)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,t){var n,r,i,o,a=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],l=this.getAbsoluteTransform(t);return a.forEach((function(e){var t=l.point(e);void 0===n&&(n=i=t.x,r=o=t.y),n=Math.min(n,t.x),r=Math.min(r,t.y),i=Math.max(i,t.x),o=Math.max(o,t.y)})),{x:n,y:r,width:i-n,height:o-r}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const t=this._getCanvasCache();e.translate(t.x,t.y);var n=this._getCachedSceneCanvas(),r=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/r,n.height/r),e.restore()}_drawCachedHitCanvas(e){var t=this._getCanvasCache(),n=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e,t,n,r,i=this.filters(),o=this._getCanvasCache(),a=o.scene,l=o.filter,s=l.getContext();if(i){if(!this._filterUpToDate){var c=a.pixelRatio;l.setSize(a.width/a.pixelRatio,a.height/a.pixelRatio);try{for(e=i.length,s.clear(),s.drawImage(a._canvas,0,0,a.getWidth()/c,a.getHeight()/c),t=s.getImageData(0,0,l.getWidth(),l.getHeight()),n=0;n{var t,n;if(!e)return this;for(t in e)"children"!==t&&(n="set"+$t._capitalize(t),$t._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))})),this}isListening(){return this._getCache(En,this._isListening)}_isListening(e){if(!this.listening())return!1;const t=this.getParent();return!t||t===e||this===e||t._isListening(e)}isVisible(){return this._getCache(In,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const t=this.getParent();return!t||t===e||this===e||t._isVisible(e)}shouldDrawHit(e,t=!1){if(e)return this._isVisible(e)&&this._isListening(e);var n=this.getLayer(),r=!1;vn._dragElements.forEach((e=>{"dragging"===e.dragStatus&&("Stage"===e.node.nodeType||e.node.getLayer()===n)&&(r=!0)}));var i=!t&&!Ht.hitOnDragEnabled&&r;return this.isListening()&&this.isVisible()&&!i}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var e,t,n,r,i=this.getDepth(),o=this,a=0;return"Stage"!==o.nodeType&&function l(s){for(e=[],t=s.length,n=0;n0&&e[0].getDepth()<=i&&l(e)}(o.getStage().getChildren()),a}getDepth(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Ln),this._clearSelfAndDescendantCache(wn)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges((()=>{this.x(e.x),this.y(e.y)})),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var e=this.getStage().getPointerPosition();if(!e)return null;var t=this.getAbsoluteTransform().copy();return t.invert(),t.point(e)}getAbsolutePosition(e){let t=!1,n=this.parent;for(;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);var r=this.getAbsoluteTransform(e).getMatrix(),i=new Vt,o=this.offset();return i.m=r.slice(),i.translate(o.x,o.y),i.getTranslation()}setAbsolutePosition(e){var t=this._clearTransform();this.attrs.x=t.x,this.attrs.y=t.y,delete t.x,delete t.y,this._clearCache(Ln);var n=this._getAbsoluteTransform().copy();return n.invert(),n.translate(e.x,e.y),e={x:this.attrs.x+n.getTranslation().x,y:this.attrs.y+n.getTranslation().y},this._setTransform(t),this.setPosition({x:e.x,y:e.y}),this._clearCache(Ln),this._clearSelfAndDescendantCache(wn),this}_setTransform(e){var t;for(t in e)this.attrs[t]=e[t]}_clearTransform(){var e={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,e}move(e){var t=e.x,n=e.y,r=this.x(),i=this.y();return void 0!==t&&(r+=t),void 0!==n&&(i+=n),this.setPosition({x:r,y:i}),this}_eachAncestorReverse(e,t){var n,r,i=[],o=this.getParent();if(!t||t._id!==this._id){for(i.unshift(this);o&&(!t||o._id!==t._id);)i.unshift(o),o=o.parent;for(n=i.length,r=0;r0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}moveToBottom(){if(!this.parent)return $t.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}setZIndex(e){if(!this.parent)return $t.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&$t.warn("Unexpected value "+e+" 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)+".");var t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(yn,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e,t,n,r,i={},o=this.getAttrs();for(e in i.attrs={},o)t=o[e],$t.isObject(t)&&!$t._isPlainObject(t)&&!$t._isArray(t)||(n="function"==typeof this[e]&&this[e],delete o[e],r=n?n.call(this):null,o[e]=t,r!==t&&(i.attrs[e]=t));return i.className=this.getClassName(),$t._prepareToStringify(i)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,n){var r=[];t&&this._isMatch(e)&&r.push(this);for(var i=this.parent;i;){if(i===n)return r;i._isMatch(e)&&r.push(i),i=i.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(!e)return!1;if("function"==typeof e)return e(this);var t,n,r=e.replace(/ /g,"").split(","),i=r.length;for(t=0;t{try{const n=null==e?void 0:e.callback;n&&delete e.callback,$t._urlToImage(this.toDataURL(e),(function(e){t(e),null==n||n(e)}))}catch(e){n(e)}}))}toBlob(e){return new Promise(((t,n)=>{try{const n=null==e?void 0:e.callback;n&&delete e.callback,this.toCanvas(e).toBlob((e=>{t(e),null==n||n(e)}))}catch(e){n(e)}}))}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Ht.dragDistance}_off(e,t,n){var r,i,o,a=this.eventListeners[e];for(r=0;r=0)&&!this.isDragging()){var t=!1;vn._dragElements.forEach((e=>{this.isAncestorOf(e.node)&&(t=!0)})),t||this._createDragElement(e)}}))}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const e=vn._dragElements.get(this._id),t=e&&"dragging"===e.dragStatus,n=e&&"ready"===e.dragStatus;t?this.stopDrag():n&&vn._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const t=this.getStage();if(!t)return!1;const n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return $t.haveIntersection(n,this.getClientRect())}static create(e,t){return $t._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(e,t){var n,r,i,o=Mn.prototype.getClassName.call(e),a=e.children;t&&(e.attrs.container=t),Ht[o]||($t.warn('Can not find a node with class name "'+o+'". Fallback to "Shape".'),o="Shape");if(n=new(0,Ht[o])(e.attrs),a)for(r=a.length,i=0;i0}removeChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.remove()})),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.destroy()})),this.children=[],this._requestDraw(),this}add(...e){if(0===e.length)return this;if(e.length>1){for(var t=0;t0?t[0]:void 0}_generalFind(e,t){var n=[];return this._descendants((r=>{const i=r._isMatch(e);return i&&n.push(r),!(!i||!t)})),n}_descendants(e){let t=!1;const n=this.getChildren();for(const r of n){if(t=e(r),t)return!0;if(r.hasChildren()&&(t=r._descendants(e),t))return!0}return!1}toObject(){var e=Mn.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach((t=>{e.children.push(t.toObject())})),e}isAncestorOf(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){var t=Mn.prototype.clone.call(this,e);return this.getChildren().forEach((function(e){t.add(e.clone())})),t}getAllIntersections(e){var t=[];return this.find("Shape").forEach((function(n){n.isVisible()&&n.intersects(e)&&t.push(n)})),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),this.isCached()||null===(t=this.children)||void 0===t||t.forEach((function(t){t._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;null===(e=this.children)||void 0===e||e.forEach((function(e,t){e.index=t})),this._requestDraw()}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas(),i=r&&r.getContext(),o=this._getCanvasCache(),a=o&&o.scene,l=r&&r.isCache;if(!this.isVisible()&&!l)return this;if(a){i.save();var s=this.getAbsoluteTransform(t).getMatrix();i.transform(s[0],s[1],s[2],s[3],s[4],s[5]),this._drawCachedSceneCanvas(i),i.restore()}else this._drawChildren("drawScene",r,t);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;var n=this.getLayer(),r=e||n&&n.hitCanvas,i=r&&r.getContext(),o=this._getCanvasCache();if(o&&o.hit){i.save();var a=this.getAbsoluteTransform(t).getMatrix();i.transform(a[0],a[1],a[2],a[3],a[4],a[5]),this._drawCachedHitCanvas(i),i.restore()}else this._drawChildren("drawHit",r,t);return this}_drawChildren(e,t,n){var r,i=t&&t.getContext(),o=this.clipWidth(),a=this.clipHeight(),l=this.clipFunc(),s=o&&a||l;const c=n===this;if(s){i.save();var u=this.getAbsoluteTransform(n),d=u.getMatrix();if(i.transform(d[0],d[1],d[2],d[3],d[4],d[5]),i.beginPath(),l)l.call(this,i,this);else{var f=this.clipX(),h=this.clipY();i.rect(f,h,o,a)}i.clip(),d=u.copy().invert().getMatrix(),i.transform(d[0],d[1],d[2],d[3],d[4],d[5])}var p=!c&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===e;p&&(i.save(),i._applyGlobalCompositeOperation(this)),null===(r=this.children)||void 0===r||r.forEach((function(r){r[e](t,n)})),p&&i.restore(),s&&i.restore()}getClientRect(e){var t,n,r,i,o,a=(e=e||{}).skipTransform,l=e.relativeTo,s={x:1/0,y:1/0,width:0,height:0},c=this;null===(t=this.children)||void 0===t||t.forEach((function(t){if(t.visible()){var a=t.getClientRect({relativeTo:c,skipShadow:e.skipShadow,skipStroke:e.skipStroke});0===a.width&&0===a.height||(void 0===n?(n=a.x,r=a.y,i=a.x+a.width,o=a.y+a.height):(n=Math.min(n,a.x),r=Math.min(r,a.y),i=Math.max(i,a.x+a.width),o=Math.max(o,a.y+a.height)))}}));for(var u=this.find("Shape"),d=!1,f=0;fe.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",fr=e=>{const t=dr(e);return"pointer"===t?Ht.pointerEventsEnabled&&ur.pointer:"touch"===t?ur.touch:"mouse"===t?ur.mouse:void 0};function hr(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&$t.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const pr=[];class gr extends Dn{constructor(e){super(hr(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),pr.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(()=>{hr(this.attrs)})),this._checkVisibility()}_validateAdd(e){const t="Layer"===e.getType(),n="FastLayer"===e.getType();t||n||$t.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if("string"==typeof e){if("."===e.charAt(0)){var t=e.slice(1);e=document.getElementsByClassName(t)[0]}else{var n;n="#"!==e.charAt(0)?e:e.slice(1),e=document.getElementById(n)}if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var e,t=this.children,n=t.length;for(e=0;e-1&&pr.splice(t,1),$t.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:($t.warn("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);"),null)}_getPointerById(e){return this._pointerPositions.find((t=>t.id===e))}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){(e=e||{}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var t=new gn({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach((function(t){if(t.isVisible()){var r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}})),t}getIntersection(e){if(!e)return null;var t,n=this.children;for(t=n.length-1;t>=0;t--){const r=n[t].getIntersection(e);if(r)return r}return null}_resizeDOM(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach((n=>{n.setSize({width:e,height:t}),n.draw()}))}add(e,...t){if(arguments.length>1){for(var n=0;n5&&$t.warn("The stage has "+r+" 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."),e.setSize({width:this.width(),height:this.height()}),e.draw(),Ht.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return Hn(e,this)}setPointerCapture(e){Bn(e,this)}releaseCapture(e){Vn(e)}getLayers(){return this.children}_bindContentEvents(){Ht.isBrowser&&cr.forEach((([e,t])=>{this.content.addEventListener(e,(e=>{this[t](e)}),{passive:!1})}))}_pointerenter(e){this.setPointersPositions(e);const t=fr(e.type);this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const t=fr(e.type);this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+"targetShape"];return t&&!t.getStage()&&(t=null),t}_pointerleave(e){const t=fr(e.type),n=dr(e.type);if(t){this.setPointersPositions(e);var r=this._getTargetShape(n),i=!vn.isDragging||Ht.hitOnDragEnabled;r&&i?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):i&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(e){const t=fr(e.type),n=dr(e.type);if(t){this.setPointersPositions(e);var r=!1;this._changedPointerPositions.forEach((i=>{var o=this.getIntersection(i);vn.justDragged=!1,Ht["_"+n+"ListenClick"]=!0;if(!(o&&o.isListening()))return;Ht.capturePointerEventsEnabled&&o.setPointerCapture(i.id),this[n+"ClickStartShape"]=o,o._fireAndBubble(t.pointerdown,{evt:e,pointerId:i.id}),r=!0;const a=e.type.indexOf("touch")>=0;o.preventDefault()&&e.cancelable&&a&&e.preventDefault()})),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(e){const t=fr(e.type),n=dr(e.type);if(!t)return;if(vn.isDragging&&vn.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),!(!vn.isDragging||Ht.hitOnDragEnabled))return;var r={};let i=!1;var o=this._getTargetShape(n);this._changedPointerPositions.forEach((a=>{const l=Nn(a.id)||this.getIntersection(a),s=a.id,c={evt:e,pointerId:s};var u=o!==l;if(u&&o&&(o._fireAndBubble(t.pointerout,Object.assign({},c),l),o._fireAndBubble(t.pointerleave,Object.assign({},c),l)),l){if(r[l._id])return;r[l._id]=!0}l&&l.isListening()?(i=!0,u&&(l._fireAndBubble(t.pointerover,Object.assign({},c),o),l._fireAndBubble(t.pointerenter,Object.assign({},c),o),this[n+"targetShape"]=l),l._fireAndBubble(t.pointermove,Object.assign({},c))):o&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:s}),this[n+"targetShape"]=null)})),i||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const t=fr(e.type),n=dr(e.type);if(!t)return;this.setPointersPositions(e);const r=this[n+"ClickStartShape"],i=this[n+"ClickEndShape"];var o={};let a=!1;this._changedPointerPositions.forEach((l=>{const s=Nn(l.id)||this.getIntersection(l);if(s){if(s.releaseCapture(l.id),o[s._id])return;o[s._id]=!0}const c=l.id,u={evt:e,pointerId:c};let d=!1;Ht["_"+n+"InDblClickWindow"]?(d=!0,clearTimeout(this[n+"DblTimeout"])):vn.justDragged||(Ht["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout((function(){Ht["_"+n+"InDblClickWindow"]=!1}),Ht.dblClickWindow),s&&s.isListening()?(a=!0,this[n+"ClickEndShape"]=s,s._fireAndBubble(t.pointerup,Object.assign({},u)),Ht["_"+n+"ListenClick"]&&r&&r===s&&(s._fireAndBubble(t.pointerclick,Object.assign({},u)),d&&i&&i===s&&s._fireAndBubble(t.pointerdblclick,Object.assign({},u)))):(this[n+"ClickEndShape"]=null,Ht["_"+n+"ListenClick"]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:c}),d&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:c}))})),a||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Ht["_"+n+"ListenClick"]=!1,e.cancelable&&"touch"!==n&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(rr,{evt:e}):this._fire(rr,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(sr,{evt:e}):this._fire(sr,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const t=Nn(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(Kn,Fn(e)),Vn(e.pointerId)}_lostpointercapture(e){Vn(e.pointerId)}setPointersPositions(e){var t=this._getContentPosition(),n=null,r=null;void 0!==(e=e||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,(e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})})),Array.prototype.forEach.call(e.changedTouches||e.touches,(e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}))):(n=(e.clientX-t.left)/t.scaleX,r=(e.clientY-t.top)/t.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:$t._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:r,id:$t._getFirstPointerId(e)}])}_setPointerPosition(e){$t.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new gn({width:this.width(),height:this.height()}),this.bufferHitCanvas=new mn({pixelRatio:1,width:this.width(),height:this.height()}),Ht.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.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"),e.appendChild(this.content),this._resizeDOM()}}cache(){return $t.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(e){e.batchDraw()})),this}}gr.prototype.nodeType="Stage",Bt(gr),sn.addGetterSetter(gr,"container");var mr="hasShadow",vr="shadowRGBA",yr="patternImage",br="linearGradient",wr="radialGradient";let Cr;function xr(){return Cr||(Cr=$t.createCanvasElement().getContext("2d"),Cr)}const Er={};class Sr extends Mn{constructor(e){let t;for(super(e);t=$t.getRandomColor(),!t||t in Er;);this.colorKey=t,Er[t]=this}getContext(){return $t.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return $t.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(mr,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(yr,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const e=xr().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(e&&e.setTransform){const t=new Vt;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate(Ht.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const n=t.getMatrix(),r="undefined"==typeof DOMMatrix?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}_getLinearGradient(){return this._getCache(br,this.__getLinearGradient)}__getLinearGradient(){var e=this.fillLinearGradientColorStops();if(e){for(var t=xr(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),i=t.createLinearGradient(n.x,n.y,r.x,r.y),o=0;othis.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 e=this.hitStrokeWidth();return"auto"===e?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){var t=this.getStage().bufferHitCanvas;return t.getContext().clear(),this.drawHit(t,null,!0),t.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return Mn.prototype.destroy.call(this),delete Er[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var t;if(!this.getStage())return!1;if(!(null===(t=this.attrs.perfectDrawEnabled)||void 0===t||t))return!1;const n=e||this.hasFill(),r=this.hasStroke(),i=1!==this.getAbsoluteOpacity();if(n&&r&&i)return!0;const o=this.hasShadow(),a=this.shadowForStrokeEnabled();return!!(n&&r&&o&&a)}setStrokeHitEnabled(e){$t.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return 0!==this.hitStrokeWidth()}getSelfRect(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){const t=e.skipTransform,n=e.relativeTo,r=this.getSelfRect(),i=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,o=r.width+i,a=r.height+i,l=!e.skipShadow&&this.hasShadow(),s=l?this.shadowOffsetX():0,c=l?this.shadowOffsetY():0,u=o+Math.abs(s),d=a+Math.abs(c),f=l&&this.shadowBlur()||0,h={width:u+2*f,height:d+2*f,x:-(i/2+f)+Math.min(s,0)+r.x,y:-(i/2+f)+Math.min(c,0)+r.y};return t?h:this._transformedRect(h,n)}drawScene(e,t){var n,r,i=this.getLayer(),o=e||i.getCanvas(),a=o.getContext(),l=this._getCanvasCache(),s=this.getSceneFunc(),c=this.hasShadow(),u=o.isCache,d=t===this;if(!this.isVisible()&&!d)return this;if(l){a.save();var f=this.getAbsoluteTransform(t).getMatrix();return a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedSceneCanvas(a),a.restore(),this}if(!s)return this;if(a.save(),this._useBufferCanvas()&&!u){(r=(n=this.getStage().bufferCanvas).getContext()).clear(),r.save(),r._applyLineJoin(this);var h=this.getAbsoluteTransform(t).getMatrix();r.transform(h[0],h[1],h[2],h[3],h[4],h[5]),s.call(this,r,this),r.restore();var p=n.pixelRatio;c&&a._applyShadow(this),a._applyOpacity(this),a._applyGlobalCompositeOperation(this),a.drawImage(n._canvas,0,0,n.width/p,n.height/p)}else{if(a._applyLineJoin(this),!d){h=this.getAbsoluteTransform(t).getMatrix();a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),a._applyOpacity(this),a._applyGlobalCompositeOperation(this)}c&&a._applyShadow(this),s.call(this,a,this)}return a.restore(),this}drawHit(e,t,n=!1){if(!this.shouldDrawHit(t,n))return this;var r=this.getLayer(),i=e||r.hitCanvas,o=i&&i.getContext(),a=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),s=l&&l.hit;if(this.colorKey||$t.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()"),s){o.save();var c=this.getAbsoluteTransform(t).getMatrix();return o.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedHitCanvas(o),o.restore(),this}if(!a)return this;o.save(),o._applyLineJoin(this);if(!(this===t)){var u=this.getAbsoluteTransform(t).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5])}return a.call(this,o,this),o.restore(),this}drawHitFromCache(e=0){var t,n,r,i,o,a=this._getCanvasCache(),l=this._getCachedSceneCanvas(),s=a.hit,c=s.getContext(),u=s.getWidth(),d=s.getHeight();c.clear(),c.drawImage(l._canvas,0,0,u,d);try{for(r=(n=(t=c.getImageData(0,0,u,d)).data).length,i=$t._hexToRgb(this.colorKey),o=0;oe?(n[o]=i.r,n[o+1]=i.g,n[o+2]=i.b,n[o+3]=255):n[o+3]=0;c.putImageData(t,0,0)}catch(e){$t.error("Unable to draw hit graph from cached scene canvas. "+e.message)}return this}hasPointerCapture(e){return Hn(e,this)}setPointerCapture(e){Bn(e,this)}releaseCapture(e){Vn(e)}}Sr.prototype._fillFunc=function(e){e.fill()},Sr.prototype._strokeFunc=function(e){e.stroke()},Sr.prototype._fillFuncHit=function(e){e.fill()},Sr.prototype._strokeFuncHit=function(e){e.stroke()},Sr.prototype._centroid=!1,Sr.prototype.nodeType="Shape",Bt(Sr),Sr.prototype.eventListeners={},Sr.prototype.on.call(Sr.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(mr)})),Sr.prototype.on.call(Sr.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(vr)})),Sr.prototype.on.call(Sr.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",(function(){this._clearCache(yr)})),Sr.prototype.on.call(Sr.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",(function(){this._clearCache(br)})),Sr.prototype.on.call(Sr.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",(function(){this._clearCache(wr)})),sn.addGetterSetter(Sr,"stroke",void 0,rn()),sn.addGetterSetter(Sr,"strokeWidth",2,Jt()),sn.addGetterSetter(Sr,"fillAfterStrokeEnabled",!1),sn.addGetterSetter(Sr,"hitStrokeWidth","auto",tn()),sn.addGetterSetter(Sr,"strokeHitEnabled",!0,on()),sn.addGetterSetter(Sr,"perfectDrawEnabled",!0,on()),sn.addGetterSetter(Sr,"shadowForStrokeEnabled",!0,on()),sn.addGetterSetter(Sr,"lineJoin"),sn.addGetterSetter(Sr,"lineCap"),sn.addGetterSetter(Sr,"sceneFunc"),sn.addGetterSetter(Sr,"hitFunc"),sn.addGetterSetter(Sr,"dash"),sn.addGetterSetter(Sr,"dashOffset",0,Jt()),sn.addGetterSetter(Sr,"shadowColor",void 0,nn()),sn.addGetterSetter(Sr,"shadowBlur",0,Jt()),sn.addGetterSetter(Sr,"shadowOpacity",1,Jt()),sn.addComponentsGetterSetter(Sr,"shadowOffset",["x","y"]),sn.addGetterSetter(Sr,"shadowOffsetX",0,Jt()),sn.addGetterSetter(Sr,"shadowOffsetY",0,Jt()),sn.addGetterSetter(Sr,"fillPatternImage"),sn.addGetterSetter(Sr,"fill",void 0,rn()),sn.addGetterSetter(Sr,"fillPatternX",0,Jt()),sn.addGetterSetter(Sr,"fillPatternY",0,Jt()),sn.addGetterSetter(Sr,"fillLinearGradientColorStops"),sn.addGetterSetter(Sr,"strokeLinearGradientColorStops"),sn.addGetterSetter(Sr,"fillRadialGradientStartRadius",0),sn.addGetterSetter(Sr,"fillRadialGradientEndRadius",0),sn.addGetterSetter(Sr,"fillRadialGradientColorStops"),sn.addGetterSetter(Sr,"fillPatternRepeat","repeat"),sn.addGetterSetter(Sr,"fillEnabled",!0),sn.addGetterSetter(Sr,"strokeEnabled",!0),sn.addGetterSetter(Sr,"shadowEnabled",!0),sn.addGetterSetter(Sr,"dashEnabled",!0),sn.addGetterSetter(Sr,"strokeScaleEnabled",!0),sn.addGetterSetter(Sr,"fillPriority","color"),sn.addComponentsGetterSetter(Sr,"fillPatternOffset",["x","y"]),sn.addGetterSetter(Sr,"fillPatternOffsetX",0,Jt()),sn.addGetterSetter(Sr,"fillPatternOffsetY",0,Jt()),sn.addComponentsGetterSetter(Sr,"fillPatternScale",["x","y"]),sn.addGetterSetter(Sr,"fillPatternScaleX",1,Jt()),sn.addGetterSetter(Sr,"fillPatternScaleY",1,Jt()),sn.addComponentsGetterSetter(Sr,"fillLinearGradientStartPoint",["x","y"]),sn.addComponentsGetterSetter(Sr,"strokeLinearGradientStartPoint",["x","y"]),sn.addGetterSetter(Sr,"fillLinearGradientStartPointX",0),sn.addGetterSetter(Sr,"strokeLinearGradientStartPointX",0),sn.addGetterSetter(Sr,"fillLinearGradientStartPointY",0),sn.addGetterSetter(Sr,"strokeLinearGradientStartPointY",0),sn.addComponentsGetterSetter(Sr,"fillLinearGradientEndPoint",["x","y"]),sn.addComponentsGetterSetter(Sr,"strokeLinearGradientEndPoint",["x","y"]),sn.addGetterSetter(Sr,"fillLinearGradientEndPointX",0),sn.addGetterSetter(Sr,"strokeLinearGradientEndPointX",0),sn.addGetterSetter(Sr,"fillLinearGradientEndPointY",0),sn.addGetterSetter(Sr,"strokeLinearGradientEndPointY",0),sn.addComponentsGetterSetter(Sr,"fillRadialGradientStartPoint",["x","y"]),sn.addGetterSetter(Sr,"fillRadialGradientStartPointX",0),sn.addGetterSetter(Sr,"fillRadialGradientStartPointY",0),sn.addComponentsGetterSetter(Sr,"fillRadialGradientEndPoint",["x","y"]),sn.addGetterSetter(Sr,"fillRadialGradientEndPointX",0),sn.addGetterSetter(Sr,"fillRadialGradientEndPointY",0),sn.addGetterSetter(Sr,"fillPatternRotation",0),sn.backCompat(Sr,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var Or=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],kr=Or.length;class Pr extends Dn{constructor(e){super(e),this.canvas=new gn,this.hitCanvas=new mn({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(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e{this.draw(),this._waitingForDraw=!1}))),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var t=1,n=!1;;){for(let r=0;r0?{antialiased:!0}:{}}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),Dn.prototype.drawScene.call(this,r,t),this._fire("draw",{node:this}),this}drawHit(e,t){var n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),Dn.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){$t.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return $t.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(this.parent&&this.parent.content){var e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}destroy(){return $t.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}Pr.prototype.nodeType="Layer",Bt(Pr),sn.addGetterSetter(Pr,"imageSmoothingEnabled",!0),sn.addGetterSetter(Pr,"clearBeforeDraw",!0),sn.addGetterSetter(Pr,"hitGraphEnabled",!0,on());class _r extends Pr{constructor(e){super(e),this.listening(!1),$t.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}_r.prototype.nodeType="FastLayer",Bt(_r);class Lr extends Dn{_validateAdd(e){var t=e.getType();"Group"!==t&&"Shape"!==t&&$t.throw("You may only add groups and shapes to groups.")}}Lr.prototype.nodeType="Group",Bt(Lr);var Ir=Ft.performance&&Ft.performance.now?function(){return Ft.performance.now()}:function(){return(new Date).getTime()};class Tr{constructor(e,t){this.id=Tr.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Ir(),frameRate:0},this.func=e,this.setLayers(t)}setLayers(e){var t=[];return t=e?e.length>0?e:[e]:[],this.layers=t,this}getLayers(){return this.layers}addLayer(e){var t,n=this.layers,r=n.length;for(t=0;tthis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,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(){var e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)}pause(){this.state=1,this.fire("onPause")}getTimer(){return(new Date).getTime()}}class Ar{constructor(e){var t,n,r=this,i=e.node,o=i._id,a=e.easing||zr.Linear,l=!!e.yoyo;t=void 0===e.duration?.3:0===e.duration?.001:e.duration,this.node=i,this._id=Mr++;var s=i.getLayer()||(i instanceof Ht.Stage?i.getLayers():null);for(n in s||$t.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new Tr((function(){r.tween.onEnterFrame()}),s),this.tween=new Dr(n,(function(e){r._tweenFunc(e)}),a,0,1,1e3*t,l),this._addListeners(),Ar.attrs[o]||(Ar.attrs[o]={}),Ar.attrs[o][this._id]||(Ar.attrs[o][this._id]={}),Ar.tweens[o]||(Ar.tweens[o]={}),e)void 0===jr[n]&&this._addAttr(n,e[n]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,t){var n,r,i,o,a,l,s,c,u=this.node,d=u._id;if((i=Ar.tweens[d][e])&&delete Ar.attrs[d][i][e],n=u.getAttr(e),$t._isArray(t))if(r=[],a=Math.max(t.length,n.length),"points"===e&&t.length!==n.length&&(t.length>n.length?(s=n,n=$t._prepareArrayForTween(n,t,u.closed())):(l=t,t=$t._prepareArrayForTween(t,n,u.closed()))),0===e.indexOf("fill"))for(o=0;o{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var e=this.node,t=Ar.attrs[e._id][this._id];t.points&&t.points.trueEnd&&e.setAttr("points",t.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var e=this.node,t=Ar.attrs[e._id][this._id];t.points&&t.points.trueStart&&e.points(t.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(e){return this.tween.seek(1e3*e),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var e,t=this.node._id,n=this._id,r=Ar.tweens[t];for(e in this.pause(),r)delete Ar.tweens[t][e];delete Ar.attrs[t][n]}}Ar.attrs={},Ar.tweens={},Mn.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new Ar(e).play()};const zr={BackEaseIn(e,t,n,r){var i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){var i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*((1+(i*=1.525))*e-i))+t:n/2*((e-=2)*e*((1+(i*=1.525))*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return 0===e?t:1==(e/=r)?t+n:(o||(o=.3*r),!i||i(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t,BounceEaseIn:(e,t,n,r)=>n-zr.BounceEaseOut(r-e,0,n,r)+t,BounceEaseInOut:(e,t,n,r)=>en*(e/=r)*e+t,EaseOut:(e,t,n,r)=>-n*(e/=r)*(e-2)+t,EaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t,StrongEaseIn:(e,t,n,r)=>n*(e/=r)*e*e*e*e+t,StrongEaseOut:(e,t,n,r)=>n*((e=e/r-1)*e*e*e*e+1)+t,StrongEaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t,Linear:(e,t,n,r)=>n*e/r+t},Nr=$t._assign(Ht,{Util:$t,Transform:Vt,Node:Mn,Container:Dn,Stage:gr,stages:pr,Layer:Pr,FastLayer:_r,Group:Lr,DD:vn,Shape:Sr,shapes:Er,Animation:Tr,Tween:Ar,Easings:zr,Context:un,Canvas:pn});class Fr extends Sr{_sceneFunc(e){var t=Ht.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,t,n),e.arc(0,0,this.innerRadius(),t,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),t=this.outerRadius(),n=this.clockwise(),r=Ht.getAngle(n?360-this.angle():this.angle()),i=Math.cos(Math.min(r,Math.PI)),o=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),a=Math.sin(Math.min(r,Math.PI/2)),l=i*(i>0?e:t),s=o*(o>0?e:t),c=a*(a>0?t:e);return{x:l,y:n?-1*c:s,width:1*t-l,height:c-s}}}function Hr(e,t,n,r,i,o,a){var l=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),s=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),c=a*l/(l+s),u=a*s/(l+s);return[n-c*(i-e),r-c*(o-t),n+u*(i-e),r+u*(o-t)]}function Br(e,t){var n,r,i=e.length,o=[];for(n=2;n4){for(n=(t=this.getTensionPoints()).length,r=l?0:4,l||e.quadraticCurveTo(t[0],t[1],t[2],t[3]);rc?s:c,g=s>c?1:s/c,m=s>c?c/s:1;e.translate(a,l),e.rotate(f),e.scale(g,m),e.arc(0,0,p,u,u+d,1-h),e.scale(1/g,1/m),e.rotate(-f),e.translate(-a,-l);break;case"z":n=!0,e.closePath()}}n||this.hasFill()?e.fillStrokeShape(this):e.strokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach((function(t){if("A"===t.command){var n=t.points[4],r=t.points[5],i=t.points[4]+r,o=Math.PI/180;if(Math.abs(n-i)i;r-=o){const n=Wr.getPointOnEllipticalArc(t.points[0],t.points[1],t.points[2],t.points[3],r,0);e.push(n.x,n.y)}else for(let r=n+o;rthis.dataArray[n].pathLength;)e-=this.dataArray[n].pathLength,++n;if(n===r)return{x:(t=this.dataArray[n-1].points.slice(-2))[0],y:t[1]};if(e<.01)return{x:(t=this.dataArray[n].points.slice(0,2))[0],y:t[1]};var i=this.dataArray[n],o=i.points;switch(i.command){case"L":return Wr.getPointOnLine(e,i.start.x,i.start.y,o[0],o[1]);case"C":return Wr.getPointOnCubicBezier(e/i.pathLength,i.start.x,i.start.y,o[0],o[1],o[2],o[3],o[4],o[5]);case"Q":return Wr.getPointOnQuadraticBezier(e/i.pathLength,i.start.x,i.start.y,o[0],o[1],o[2],o[3]);case"A":var a=o[0],l=o[1],s=o[2],c=o[3],u=o[4],d=o[5],f=o[6];return u+=d*e/i.pathLength,Wr.getPointOnEllipticalArc(a,l,s,c,u,f)}return null}static getLineLength(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}static getPointOnLine(e,t,n,r,i,o,a){void 0===o&&(o=t),void 0===a&&(a=n);var l=(i-n)/(r-t+1e-8),s=Math.sqrt(e*e/(1+l*l));r0&&!isNaN(h[0]);){var v,y,b,w,C,x,E,S,O,k,P=null,_=[],L=s,I=c;switch(f){case"l":s+=h.shift(),c+=h.shift(),P="L",_.push(s,c);break;case"L":s=h.shift(),c=h.shift(),_.push(s,c);break;case"m":var T=h.shift(),j=h.shift();if(s+=T,c+=j,P="M",a.length>2&&"z"===a[a.length-1].command)for(var M=a.length-2;M>=0;M--)if("M"===a[M].command){s=a[M].points[0]+T,c=a[M].points[1]+j;break}_.push(s,c),f="l";break;case"M":s=h.shift(),c=h.shift(),P="M",_.push(s,c),f="L";break;case"h":s+=h.shift(),P="L",_.push(s,c);break;case"H":s=h.shift(),P="L",_.push(s,c);break;case"v":c+=h.shift(),P="L",_.push(s,c);break;case"V":c=h.shift(),P="L",_.push(s,c);break;case"C":_.push(h.shift(),h.shift(),h.shift(),h.shift()),s=h.shift(),c=h.shift(),_.push(s,c);break;case"c":_.push(s+h.shift(),c+h.shift(),s+h.shift(),c+h.shift()),s+=h.shift(),c+=h.shift(),P="C",_.push(s,c);break;case"S":y=s,b=c,"C"===(v=a[a.length-1]).command&&(y=s+(s-v.points[2]),b=c+(c-v.points[3])),_.push(y,b,h.shift(),h.shift()),s=h.shift(),c=h.shift(),P="C",_.push(s,c);break;case"s":y=s,b=c,"C"===(v=a[a.length-1]).command&&(y=s+(s-v.points[2]),b=c+(c-v.points[3])),_.push(y,b,s+h.shift(),c+h.shift()),s+=h.shift(),c+=h.shift(),P="C",_.push(s,c);break;case"Q":_.push(h.shift(),h.shift()),s=h.shift(),c=h.shift(),_.push(s,c);break;case"q":_.push(s+h.shift(),c+h.shift()),s+=h.shift(),c+=h.shift(),P="Q",_.push(s,c);break;case"T":y=s,b=c,"Q"===(v=a[a.length-1]).command&&(y=s+(s-v.points[0]),b=c+(c-v.points[1])),s=h.shift(),c=h.shift(),P="Q",_.push(y,b,s,c);break;case"t":y=s,b=c,"Q"===(v=a[a.length-1]).command&&(y=s+(s-v.points[0]),b=c+(c-v.points[1])),s+=h.shift(),c+=h.shift(),P="Q",_.push(y,b,s,c);break;case"A":w=h.shift(),C=h.shift(),x=h.shift(),E=h.shift(),S=h.shift(),O=s,k=c,s=h.shift(),c=h.shift(),P="A",_=this.convertEndpointToCenterParameterization(O,k,s,c,E,S,w,C,x);break;case"a":w=h.shift(),C=h.shift(),x=h.shift(),E=h.shift(),S=h.shift(),O=s,k=c,s+=h.shift(),c+=h.shift(),P="A",_=this.convertEndpointToCenterParameterization(O,k,s,c,E,S,w,C,x)}a.push({command:P||f,points:_,start:{x:L,y:I},pathLength:this.calcLength(L,I,P||f,_)})}"z"!==f&&"Z"!==f||a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,t,n,r){var i,o,a,l,s=Wr;switch(n){case"L":return s.getLineLength(e,t,r[0],r[1]);case"C":for(i=0,o=s.getPointOnCubicBezier(0,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),l=.01;l<=1;l+=.01)a=s.getPointOnCubicBezier(l,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),i+=s.getLineLength(o.x,o.y,a.x,a.y),o=a;return i;case"Q":for(i=0,o=s.getPointOnQuadraticBezier(0,e,t,r[0],r[1],r[2],r[3]),l=.01;l<=1;l+=.01)a=s.getPointOnQuadraticBezier(l,e,t,r[0],r[1],r[2],r[3]),i+=s.getLineLength(o.x,o.y,a.x,a.y),o=a;return i;case"A":i=0;var c=r[4],u=r[5],d=r[4]+u,f=Math.PI/180;if(Math.abs(c-d)d;l-=f)a=s.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],l,0),i+=s.getLineLength(o.x,o.y,a.x,a.y),o=a;else for(l=c+f;l1&&(a*=Math.sqrt(f),l*=Math.sqrt(f));var h=Math.sqrt((a*a*(l*l)-a*a*(d*d)-l*l*(u*u))/(a*a*(d*d)+l*l*(u*u)));i===o&&(h*=-1),isNaN(h)&&(h=0);var p=h*a*d/l,g=h*-l*u/a,m=(e+n)/2+Math.cos(c)*p-Math.sin(c)*g,v=(t+r)/2+Math.sin(c)*p+Math.cos(c)*g,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(S=0),0===o&&S>0&&(S-=2*Math.PI),1===o&&S<0&&(S+=2*Math.PI),[m,v,a,l,C,S,c,o]}}Wr.prototype.className="Path",Wr.prototype._attrsAffectingSize=["data"],Bt(Wr),sn.addGetterSetter(Wr,"data");class Gr extends Vr{_sceneFunc(e){super._sceneFunc(e);var t=2*Math.PI,n=this.points(),r=n,i=0!==this.tension()&&n.length>4;i&&(r=this.getTensionPoints());var o,a,l=this.pointerLength(),s=n.length;if(i){const e=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],n[s-2],n[s-1]],t=Wr.calcLength(r[r.length-4],r[r.length-3],"C",e),i=Wr.getPointOnQuadraticBezier(Math.min(1,1-l/t),e[0],e[1],e[2],e[3],e[4],e[5]);o=n[s-2]-i.x,a=n[s-1]-i.y}else o=n[s-2]-n[s-4],a=n[s-1]-n[s-3];var c=(Math.atan2(a,o)+t)%t,u=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[s-2],n[s-1]),e.rotate(c),e.moveTo(0,0),e.lineTo(-l,u/2),e.lineTo(-l,-u/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),i?(o=(r[0]+r[2])/2-n[0],a=(r[1]+r[3])/2-n[1]):(o=n[2]-n[0],a=n[3]-n[1]),e.rotate((Math.atan2(-a,-o)+t)%t),e.moveTo(0,0),e.lineTo(-l,u/2),e.lineTo(-l,-u/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),t=this.pointerWidth()/2;return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}}Gr.prototype.className="Arrow",Bt(Gr),sn.addGetterSetter(Gr,"pointerLength",10,Jt()),sn.addGetterSetter(Gr,"pointerWidth",10,Jt()),sn.addGetterSetter(Gr,"pointerAtBeginning",!1),sn.addGetterSetter(Gr,"pointerAtEnding",!0);class Zr extends Sr{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}Zr.prototype._centroid=!0,Zr.prototype.className="Circle",Zr.prototype._attrsAffectingSize=["radius"],Bt(Zr),sn.addGetterSetter(Zr,"radius",0,Jt());class Ur extends Sr{_sceneFunc(e){var t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,2*Math.PI,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radiusX()}getHeight(){return 2*this.radiusY()}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}Ur.prototype.className="Ellipse",Ur.prototype._centroid=!0,Ur.prototype._attrsAffectingSize=["radiusX","radiusY"],Bt(Ur),sn.addComponentsGetterSetter(Ur,"radius",["x","y"]),sn.addGetterSetter(Ur,"radiusX",0,Jt()),sn.addGetterSetter(Ur,"radiusY",0,Jt());class Xr extends Sr{constructor(e){super(e),this.on("imageChange.konva",(()=>{this._setImageLoad()})),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&4===e.readyState||e&&e.addEventListener&&e.addEventListener("load",(()=>{this._requestDraw()}))}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){const t=this.getWidth(),n=this.getHeight(),r=this.cornerRadius(),i=this.attrs.image;let o;if(i){const e=this.attrs.cropWidth,r=this.attrs.cropHeight;o=e&&r?[i,this.cropX(),this.cropY(),e,r,0,0,t,n]:[i,0,0,t,n]}(this.hasFill()||this.hasStroke()||r)&&(e.beginPath(),r?$t.drawRoundedRectPath(e,t,n,r):e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)),i&&(r&&e.clip(),e.drawImage.apply(e,o))}_hitFunc(e){var t=this.width(),n=this.height(),r=this.cornerRadius();e.beginPath(),r?$t.drawRoundedRectPath(e,t,n,r):e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,t;return null!==(e=this.attrs.width)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.width}getHeight(){var e,t;return null!==(e=this.attrs.height)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.height}static fromURL(e,t,n=null){var r=$t.createImageElement();r.onload=function(){var e=new Xr({image:r});t(e)},r.onerror=n,r.crossOrigin="Anonymous",r.src=e}}Xr.prototype.className="Image",Bt(Xr),sn.addGetterSetter(Xr,"cornerRadius",0,en(4)),sn.addGetterSetter(Xr,"image"),sn.addComponentsGetterSetter(Xr,"crop",["x","y","width","height"]),sn.addGetterSetter(Xr,"cropX",0,Jt()),sn.addGetterSetter(Xr,"cropY",0,Jt()),sn.addGetterSetter(Xr,"cropWidth",0,Jt()),sn.addGetterSetter(Xr,"cropHeight",0,Jt());var Yr=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],qr="up",$r="right",Kr="down",Qr="left",Jr=Yr.length;class ei extends Lr{constructor(e){super(e),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(e){var t,n=this,r=function(){n._sync()};for(t=0;t{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.y)})),{x:t,y:r,width:n-t,height:i-r}}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}ri.prototype.className="RegularPolygon",ri.prototype._centroid=!0,ri.prototype._attrsAffectingSize=["radius"],Bt(ri),sn.addGetterSetter(ri,"radius",0,Jt()),sn.addGetterSetter(ri,"sides",0,Jt());var ii=2*Math.PI;class oi extends Sr{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,ii,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),ii,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}oi.prototype.className="Ring",oi.prototype._centroid=!0,oi.prototype._attrsAffectingSize=["innerRadius","outerRadius"],Bt(oi),sn.addGetterSetter(oi,"innerRadius",0,Jt()),sn.addGetterSetter(oi,"outerRadius",0,Jt());class ai extends Sr{constructor(e){super(e),this._updated=!0,this.anim=new Tr((()=>{var 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(e){var t=this.animation(),n=this.frameIndex(),r=4*n,i=this.animations()[t],o=this.frameOffsets(),a=i[r+0],l=i[r+1],s=i[r+2],c=i[r+3],u=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,s,c),e.closePath(),e.fillStrokeShape(this)),u)if(o){var d=o[t],f=2*n;e.drawImage(u,a,l,s,c,d[f+0],d[f+1],s,c)}else e.drawImage(u,a,l,s,c,0,0,s,c)}_hitFunc(e){var t=this.animation(),n=this.frameIndex(),r=4*n,i=this.animations()[t],o=this.frameOffsets(),a=i[r+2],l=i[r+3];if(e.beginPath(),o){var s=o[t],c=2*n;e.rect(s[c+0],s[c+1],a,l)}else e.rect(0,0,a,l);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval((function(){e._updateIndex()}),1e3/this.frameRate())}start(){if(!this.isRunning()){var e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),t=this.animation();e1&&(m+=a)}}}_hitFunc(e){var t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){var t=$t._isString(e)?e:null==e?"":e+"";return this._setAttr("text",t),this}getWidth(){return this.attrs.width===ui||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width}getHeight(){return this.attrs.height===ui||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return $t.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var t,n=bi(),r=this.fontSize();return n.save(),n.font=this._getContextFont(),t=n.measureText(e),n.restore(),{width:t.width,height:r}}_getContextFont(){return this.fontStyle()+gi+this.fontVariant()+gi+(this.fontSize()+"px ")+function(e){return e.split(",").map((e=>{const t=(e=e.trim()).indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return t&&!n&&(e=`"${e}"`),e})).join(", ")}(this.fontFamily())}_addTextLine(e){this.align()===di&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){var t=this.letterSpacing(),n=e.length;return bi().measureText(e).width+(n?t*(n-1):0)}_setTextData(){var e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,i=this.attrs.width,o=this.attrs.height,a=i!==ui&&void 0!==i,l=o!==ui&&void 0!==o,s=this.padding(),c=i-2*s,u=o-2*s,d=0,f=this.wrap(),h="char"!==f&&f!==mi,p=this.ellipsis();this.textArr=[],bi().font=this._getContextFont();for(var g=p?this._getTextWidth("…"):0,m=0,v=e.length;mc)for(;y.length>0;){for(var w=0,C=y.length,x="",E=0;w>>1,O=y.slice(0,S+1),k=this._getTextWidth(O)+g;k<=c?(w=S+1,x=O,E=k):C=S}if(!x)break;if(h){var P,_=y[x.length];(P=(_===gi||"-"===_)&&E<=c?x.length:Math.max(x.lastIndexOf(gi),x.lastIndexOf("-"))+1)>0&&(w=P,x=x.slice(0,w),E=this._getTextWidth(x))}if(x=x.trimRight(),this._addTextLine(x),n=Math.max(n,E),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if((y=(y=y.slice(w)).trimLeft()).length>0&&(b=this._getTextWidth(y))<=c){this._addTextLine(y),d+=r,n=Math.max(n,b);break}}else this._addTextLine(y),d+=r,n=Math.max(n,b),this._shouldHandleEllipsis(d)&&mu)break}this.textHeight=t,this.textWidth=n}_shouldHandleEllipsis(e){var t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,i=r!==ui&&void 0!==r,o=r-2*this.padding();return!(this.wrap()!==mi)||i&&e+n>o}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,t=e!==ui&&void 0!==e,n=e-2*this.padding(),r=this.ellipsis(),i=this.textArr[this.textArr.length-1];if(i&&r){if(t)this._getTextWidth(i.text+"…")=1){var n=t[0].p0;e.moveTo(n.x,n.y)}for(var r=0;r0&&(a+=e.dataArray[l].pathLength);var s=0;"center"===r&&(s=Math.max(0,a/2-o/2)),"right"===r&&(s=Math.max(0,a-o));for(var c,u,d,f=si(this.text()),h=this.text().split(" ").length-1,p=-1,g=0,m=function(){g=0;for(var t=e.dataArray,n=p+1;n0)return p=n,t[n];"M"===t[n].command&&(c={x:t[n].points[0],y:t[n].points[1]})}return{}},v=function(t){var i=e._getTextSize(t).width+n;" "===t&&"justify"===r&&(i+=(a-o)/h);var l=0,s=0;for(u=void 0;Math.abs(i-l)/i>.01&&s<20;){s++;for(var f=l;void 0===d;)(d=m())&&f+d.pathLengthi?u=Wr.getPointOnLine(i,c.x,c.y,d.points[0],d.points[1],c.x,c.y):d=void 0;break;case"A":var v=d.points[4],y=d.points[5],b=d.points[4]+y;0===g?g=v+1e-8:i>l?g+=Math.PI/180*y/Math.abs(y):g-=Math.PI/360*y/Math.abs(y),(y<0&&g=0&&g>b)&&(g=b,p=!0),u=Wr.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],g,d.points[6]);break;case"C":0===g?g=i>d.pathLength?1e-8:i/d.pathLength:i>l?g+=(i-l)/d.pathLength/2:g=Math.max(g-(l-i)/d.pathLength/2,0),g>1&&(g=1,p=!0),u=Wr.getPointOnCubicBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3],d.points[4],d.points[5]);break;case"Q":0===g?g=i/d.pathLength:i>l?g+=(i-l)/d.pathLength:g-=(l-i)/d.pathLength,g>1&&(g=1,p=!0),u=Wr.getPointOnQuadraticBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3])}void 0!==u&&(l=Wr.getLineLength(c.x,c.y,u.x,u.y)),p&&(p=!1,d=void 0)}},y=s/(e._getTextSize("C").width+n)-1,b=0;be+`.${Oi}`)).join(" "),Pi="nodesRect",_i=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],Li={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const Ii="ontouchstart"in Ht._global;var Ti=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function ji(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function Mi(e,t){const n=function(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}(e);return ji(e,t,n)}class Ri extends Lr{constructor(e){super(e),this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(ki,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return $t.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return Oi+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const t=e.filter((e=>!e.isAncestorOf(this)||($t.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1)));return this._nodes=e=t,1===e.length&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach((e=>{const t=()=>{1===this.nodes().length&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),this._transforming||this.isDragging()||this.update()},n=e._attrsAffectingSize.map((e=>e+"Change."+this._getEventNamespace())).join(" ");e.on(n,t),e.on(_i.map((e=>e+`.${this._getEventNamespace()}`)).join(" "),t),e.on(`absoluteTransformChange.${this._getEventNamespace()}`,t),this._proxyDrag(e)})),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,(n=>{t=e.getAbsolutePosition(),this.isDragging()||e===this.findOne(".back")||this.startDrag(n,!1)})),e.on(`dragmove.${this._getEventNamespace()}`,(n=>{if(!t)return;const r=e.getAbsolutePosition(),i=r.x-t.x,o=r.y-t.y;this.nodes().forEach((t=>{if(t===e)return;if(t.isDragging())return;const r=t.getAbsolutePosition();t.setAbsolutePosition({x:r.x+i,y:r.y+o}),t.startDrag(n)})),t=null}))}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach((e=>{e.off("."+this._getEventNamespace())})),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(Pi),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(Pi,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){var r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),i=e.getAbsoluteScale(n),o=e.getAbsolutePosition(n),a=r.x*i.x-e.offsetX()*i.x,l=r.y*i.y-e.offsetY()*i.y;const s=(Ht.getAngle(e.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return ji({x:o.x+a*Math.cos(s)+l*Math.sin(-s),y:o.y+l*Math.cos(s)+a*Math.sin(s),width:r.width*i.x,height:r.height*i.y,rotation:s},-Ht.getAngle(t),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const e=[];this.nodes().map((t=>{const n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var r=[{x:n.x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}],i=t.getAbsoluteTransform();r.forEach((function(t){var n=i.point(t);e.push(n)}))}));const t=new Vt;var n,r,i,o;t.rotate(-Ht.getAngle(this.rotation())),e.forEach((function(e){var a=t.point(e);void 0===n&&(n=i=a.x,r=o=a.y),n=Math.min(n,a.x),r=Math.min(r,a.y),i=Math.max(i,a.x),o=Math.max(o,a.y)})),t.invert();const a=t.point({x:n,y:r});return{x:a.x,y:a.y,width:i-n,height:o-r,rotation:Ht.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(),Ti.forEach(function(e){this._createAnchor(e)}.bind(this)),this._createAnchor("rotater")}_createAnchor(e){var t=new ni({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Ii?10:"auto"}),n=this;t.on("mousedown touchstart",(function(e){n._handleMouseDown(e)})),t.on("dragstart",(e=>{t.stopDrag(),e.cancelBubble=!0})),t.on("dragend",(e=>{e.cancelBubble=!0})),t.on("mouseenter",(()=>{var n=Ht.getAngle(this.rotation()),r=function(e,t){if("rotater"===e)return"crosshair";t+=$t.degToRad(Li[e]||0);var n=($t.radToDeg(t)%360+360)%360;return $t._inRange(n,337.5,360)||$t._inRange(n,0,22.5)?"ns-resize":$t._inRange(n,22.5,67.5)?"nesw-resize":$t._inRange(n,67.5,112.5)?"ew-resize":$t._inRange(n,112.5,157.5)?"nwse-resize":$t._inRange(n,157.5,202.5)?"ns-resize":$t._inRange(n,202.5,247.5)?"nesw-resize":$t._inRange(n,247.5,292.5)?"ew-resize":$t._inRange(n,292.5,337.5)?"nwse-resize":($t.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}(e,n);t.getStage().content&&(t.getStage().content.style.cursor=r),this._cursorChange=!0})),t.on("mouseout",(()=>{t.getStage().content&&(t.getStage().content.style.cursor=""),this._cursorChange=!1})),this.add(t)}_createBack(){var e=new Sr({name:"back",width:0,height:0,draggable:!0,sceneFunc(e){var t=this.getParent(),n=t.padding();e.beginPath(),e.rect(-n,-n,this.width()+2*n,this.height()+2*n),e.moveTo(this.width()/2,-n),t.rotateEnabled()&&e.lineTo(this.width()/2,-t.rotateAnchorOffset()*$t._sign(this.height())-n),e.fillStrokeShape(this)},hitFunc:(e,t)=>{if(this.shouldOverdrawWholeArea()){var n=this.padding();e.beginPath(),e.rect(-n,-n,t.width()+2*n,t.height()+2*n),e.fillStrokeShape(t)}}});this.add(e),this._proxyDrag(e),e.on("dragstart",(e=>{e.cancelBubble=!0})),e.on("dragmove",(e=>{e.cancelBubble=!0})),e.on("dragend",(e=>{e.cancelBubble=!0})),this.on("dragmove",(e=>{this.update()}))}_handleMouseDown(e){this._movingAnchorName=e.target.name().split(" ")[0];var t=this._getNodeRect(),n=t.width,r=t.height,i=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/i),this.cos=Math.abs(n/i),"undefined"!=typeof window&&(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;var o=e.target.getAbsolutePosition(),a=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-o.x,y:a.y-o.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach((t=>{t._fire("transformstart",{evt:e.evt,target:t})}))}_handleMouseMove(e){var t,n,r,i=this.findOne("."+this._movingAnchorName),o=i.getStage();o.setPointersPositions(e);const a=o.getPointerPosition();let l={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y};const s=i.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(s,l,e)),i.setAbsolutePosition(l);const c=i.getAbsolutePosition();if(s.x!==c.x||s.y!==c.y)if("rotater"!==this._movingAnchorName){var u=this.keepRatio()||e.shiftKey,d=this.centeredScaling()||e.altKey;if("top-left"===this._movingAnchorName){if(u){var f=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(f.x-i.x(),2)+Math.pow(f.y-i.y(),2));var h=this.findOne(".top-left").x()>f.x?-1:1,p=this.findOne(".top-left").y()>f.y?-1:1;t=r*this.cos*h,n=r*this.sin*p,this.findOne(".top-left").x(f.x-t),this.findOne(".top-left").y(f.y-n)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(i.y());else if("top-right"===this._movingAnchorName){if(u){f=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(i.x()-f.x,2)+Math.pow(f.y-i.y(),2));h=this.findOne(".top-right").x()f.y?-1:1;t=r*this.cos*h,n=r*this.sin*p,this.findOne(".top-right").x(f.x+t),this.findOne(".top-right").y(f.y-n)}var g=i.position();this.findOne(".top-left").y(g.y),this.findOne(".bottom-right").x(g.x)}else if("middle-left"===this._movingAnchorName)this.findOne(".top-left").x(i.x());else if("middle-right"===this._movingAnchorName)this.findOne(".bottom-right").x(i.x());else if("bottom-left"===this._movingAnchorName){if(u){f=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(f.x-i.x(),2)+Math.pow(i.y()-f.y,2));h=f.x{t._fire("transformend",{evt:e,target:t})})),this._movingAnchorName=null}}_fitNodesInto(e,t){var n=this._getNodeRect();if($t._inRange(e.width,2*-this.padding()-1,1))return void this.update();if($t._inRange(e.height,2*-this.padding()-1,1))return void this.update();const r=this.flipEnabled();var i=new Vt;if(i.rotate(Ht.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const t=i.point({x:2*-this.padding(),y:0});if(e.x+=t.x,e.y+=t.y,e.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,!r)return void this.update()}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const t=i.point({x:2*this.padding(),y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.width+=2*this.padding(),!r)return void this.update()}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const t=i.point({x:0,y:2*-this.padding()});if(e.x+=t.x,e.y+=t.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const t=i.point({x:0,y:2*this.padding()});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}if(this.boundBoxFunc()){const t=this.boundBoxFunc()(n,e);t?e=t:$t.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,a=new Vt;a.translate(n.x,n.y),a.rotate(n.rotation),a.scale(n.width/o,n.height/o);const l=new Vt;l.translate(e.x,e.y),l.rotate(e.rotation),l.scale(e.width/o,e.height/o);const s=l.multiply(a.invert());this._nodes.forEach((e=>{var n;const r=e.getParent().getAbsoluteTransform(),i=e.getTransform().copy();i.translate(e.offsetX(),e.offsetY());const o=new Vt;o.multiply(r.copy().invert()).multiply(s).multiply(r).multiply(i);const a=o.decompose();e.setAttrs(a),this._fire("transform",{evt:t,target:e}),e._fire("transform",{evt:t,target:e}),null===(n=e.getLayer())||void 0===n||n.batchDraw()})),this.rotation($t._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e,t=this._getNodeRect();this.rotation($t._getRotation(t.rotation));var n=t.width,r=t.height,i=this.enabledAnchors(),o=this.resizeEnabled(),a=this.padding(),l=this.anchorSize();this.find("._anchor").forEach((e=>{e.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})})),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+a,offsetY:l/2+a,visible:o&&i.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:l/2+a,visible:o&&i.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:l/2-a,offsetY:l/2+a,visible:o&&i.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:l/2+a,visible:o&&i.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:l/2-a,visible:o&&i.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:l/2+a,offsetY:l/2-a,visible:o&&i.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:l/2-a,visible:o&&i.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:l/2-a,offsetY:l/2-a,visible:o&&i.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*$t._sign(r)-a,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),null===(e=this.getLayer())||void 0===e||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Lr.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Mn.prototype.toObject.call(this)}clone(e){return Mn.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}Ri.prototype.className="Transformer",Bt(Ri),sn.addGetterSetter(Ri,"enabledAnchors",Ti,(function(e){return e instanceof Array||$t.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach((function(e){-1===Ti.indexOf(e)&&$t.warn("Unknown anchor name: "+e+". Available names are: "+Ti.join(", "))})),e||[]})),sn.addGetterSetter(Ri,"flipEnabled",!0,on()),sn.addGetterSetter(Ri,"resizeEnabled",!0),sn.addGetterSetter(Ri,"anchorSize",10,Jt()),sn.addGetterSetter(Ri,"rotateEnabled",!0),sn.addGetterSetter(Ri,"rotationSnaps",[]),sn.addGetterSetter(Ri,"rotateAnchorOffset",50,Jt()),sn.addGetterSetter(Ri,"rotationSnapTolerance",5,Jt()),sn.addGetterSetter(Ri,"borderEnabled",!0),sn.addGetterSetter(Ri,"anchorStroke","rgb(0, 161, 255)"),sn.addGetterSetter(Ri,"anchorStrokeWidth",1,Jt()),sn.addGetterSetter(Ri,"anchorFill","white"),sn.addGetterSetter(Ri,"anchorCornerRadius",0,Jt()),sn.addGetterSetter(Ri,"borderStroke","rgb(0, 161, 255)"),sn.addGetterSetter(Ri,"borderStrokeWidth",1,Jt()),sn.addGetterSetter(Ri,"borderDash"),sn.addGetterSetter(Ri,"keepRatio",!0),sn.addGetterSetter(Ri,"centeredScaling",!1),sn.addGetterSetter(Ri,"ignoreStroke",!1),sn.addGetterSetter(Ri,"padding",0,Jt()),sn.addGetterSetter(Ri,"node"),sn.addGetterSetter(Ri,"nodes"),sn.addGetterSetter(Ri,"boundBoxFunc"),sn.addGetterSetter(Ri,"anchorDragBoundFunc"),sn.addGetterSetter(Ri,"shouldOverdrawWholeArea",!1),sn.addGetterSetter(Ri,"useSingleNodeRotation",!0),sn.backCompat(Ri,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class Di extends Sr{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,Ht.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}function Ai(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}Di.prototype.className="Wedge",Di.prototype._centroid=!0,Di.prototype._attrsAffectingSize=["radius"],Bt(Di),sn.addGetterSetter(Di,"radius",0,Jt()),sn.addGetterSetter(Di,"angle",0,Jt()),sn.addGetterSetter(Di,"clockwise",!1),sn.backCompat(Di,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var zi=[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],Ni=[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];sn.addGetterSetter(Mn,"blurRadius",0,Jt(),sn.afterSetFilter);sn.addGetterSetter(Mn,"brightness",0,Jt(),sn.afterSetFilter);sn.addGetterSetter(Mn,"contrast",0,Jt(),sn.afterSetFilter);function Fi(e,t,n,r,i){var o=n-t,a=i-r;return 0===o?r+a/2:0===a?r:a*((e-t)/o)+r}sn.addGetterSetter(Mn,"embossStrength",.5,Jt(),sn.afterSetFilter),sn.addGetterSetter(Mn,"embossWhiteLevel",.5,Jt(),sn.afterSetFilter),sn.addGetterSetter(Mn,"embossDirection","top-left",null,sn.afterSetFilter),sn.addGetterSetter(Mn,"embossBlend",!1,null,sn.afterSetFilter);sn.addGetterSetter(Mn,"enhance",0,Jt(),sn.afterSetFilter);sn.addGetterSetter(Mn,"hue",0,Jt(),sn.afterSetFilter),sn.addGetterSetter(Mn,"saturation",0,Jt(),sn.afterSetFilter),sn.addGetterSetter(Mn,"luminance",0,Jt(),sn.afterSetFilter);sn.addGetterSetter(Mn,"hue",0,Jt(),sn.afterSetFilter),sn.addGetterSetter(Mn,"saturation",0,Jt(),sn.afterSetFilter),sn.addGetterSetter(Mn,"value",0,Jt(),sn.afterSetFilter);function Hi(e,t,n){var r=4*(n*e.width+t),i=[];return i.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),i}function Bi(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}sn.addGetterSetter(Mn,"kaleidoscopePower",2,Jt(),sn.afterSetFilter),sn.addGetterSetter(Mn,"kaleidoscopeAngle",0,Jt(),sn.afterSetFilter);sn.addGetterSetter(Mn,"threshold",0,Jt(),sn.afterSetFilter);sn.addGetterSetter(Mn,"noise",.2,Jt(),sn.afterSetFilter);sn.addGetterSetter(Mn,"pixelSize",8,Jt(),sn.afterSetFilter);sn.addGetterSetter(Mn,"levels",.5,Jt(),sn.afterSetFilter);sn.addGetterSetter(Mn,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),sn.addGetterSetter(Mn,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),sn.addGetterSetter(Mn,"blue",0,Qt,sn.afterSetFilter);sn.addGetterSetter(Mn,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),sn.addGetterSetter(Mn,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),sn.addGetterSetter(Mn,"blue",0,Qt,sn.afterSetFilter),sn.addGetterSetter(Mn,"alpha",1,(function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e}));sn.addGetterSetter(Mn,"threshold",.5,Jt(),sn.afterSetFilter);const Vi=Nr.Util._assign(Nr,{Arc:Fr,Arrow:Gr,Circle:Zr,Ellipse:Ur,Image:Xr,Label:ei,Tag:ti,Line:Vr,Path:Wr,Rect:ni,RegularPolygon:ri,Ring:oi,Sprite:ai,Star:li,Text:wi,TextPath:Si,Transformer:Ri,Wedge:Di,Filters:{Blur:function(e){var t=Math.round(this.blurRadius());t>0&&function(e,t){var n,r,i,o,a,l,s,c,u,d,f,h,p,g,m,v,y,b,w,C,x,E,S,O,k=e.data,P=e.width,_=e.height,L=t+t+1,I=P-1,T=_-1,j=t+1,M=j*(j+1)/2,R=new Ai,D=null,A=R,z=null,N=null,F=zi[t],H=Ni[t];for(i=1;i>H,0!==S?(S=255/S,k[l]=(c*F>>H)*S,k[l+1]=(u*F>>H)*S,k[l+2]=(d*F>>H)*S):k[l]=k[l+1]=k[l+2]=0,c-=h,u-=p,d-=g,f-=m,h-=z.r,p-=z.g,g-=z.b,m-=z.a,o=s+((o=n+t+1)>H,S>0?(S=255/S,k[o]=(c*F>>H)*S,k[o+1]=(u*F>>H)*S,k[o+2]=(d*F>>H)*S):k[o]=k[o+1]=k[o+2]=0,c-=h,u-=p,d-=g,f-=m,h-=z.r,p-=z.g,g-=z.b,m-=z.a,o=n+((o=r+j)255?255:o,a=(a*=255)<0?0:a>255?255:a,l=(l*=255)<0?0:l>255?255:l,r[t]=o,r[t+1]=a,r[t+2]=l},Emboss:function(e){var t=10*this.embossStrength(),n=255*this.embossWhiteLevel(),r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,l=e.data,s=e.width,c=e.height,u=4*s,d=c;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:$t.error("Unknown emboss direction: "+r)}do{var f=(d-1)*u,h=o;d+h<1&&(h=0),d+h>c&&(h=0);var p=(d-1+h)*s*4,g=s;do{var m=f+4*(g-1),v=a;g+v<1&&(v=0),g+v>s&&(v=0);var y=p+4*(g-1+v),b=l[m]-l[y],w=l[m+1]-l[y+1],C=l[m+2]-l[y+2],x=b,E=x>0?x:-x;if((w>0?w:-w)>E&&(x=w),(C>0?C:-C)>E&&(x=C),x*=t,i){var S=l[m]+x,O=l[m+1]+x,k=l[m+2]+x;l[m]=S>255?255:S<0?0:S,l[m+1]=O>255?255:O<0?0:O,l[m+2]=k>255?255:k<0?0:k}else{var P=n-x;P<0?P=0:P>255&&(P=255),l[m]=l[m+1]=l[m+2]=P}}while(--g)}while(--d)},Enhance:function(e){var t,n,r,i,o=e.data,a=o.length,l=o[0],s=l,c=o[1],u=c,d=o[2],f=d,h=this.enhance();if(0!==h){for(i=0;is&&(s=t),(n=o[i+1])u&&(u=n),(r=o[i+2])f&&(f=r);var p,g,m,v,y,b,w,C,x;for(s===l&&(s=255,l=0),u===c&&(u=255,c=0),f===d&&(f=255,d=0),h>0?(g=s+h*(255-s),m=l-h*(l-0),y=u+h*(255-u),b=c-h*(c-0),C=f+h*(255-f),x=d-h*(d-0)):(g=s+h*(s-(p=.5*(s+l))),m=l+h*(l-p),y=u+h*(u-(v=.5*(u+c))),b=c+h*(c-v),C=f+h*(f-(w=.5*(f+d))),x=d+h*(d-w)),i=0;iv?a:v;var y,b,w,C,x=u,E=c,S=360/E*Math.PI/180;for(b=0;bu&&(b=y,w=0,C=-1),n=0;nb?s:b;var w,C,x,E=f,S=d,O=n.polarRotation||0;for(i=0;i=0&&h=0&&p=0&&h=0&&p=1020?255:0}return a}(t,e.width,e.height),t=function(e,t,n){for(var r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],l=0;l=0&&h=0&&p=m))for(n=u;n=v||(i+=w[(r=4*(m*n+t))+0],o+=w[r+1],a+=w[r+2],l+=w[r+3],p+=1);for(i/=p,o/=p,a/=p,l/=p,t=s;t=m))for(n=u;n=v||(w[(r=4*(m*n+t))+0]=i,w[r+1]=o,w[r+2]=a,w[r+3]=l)}},Posterize:function(e){var t,n=Math.round(254*this.levels())+1,r=e.data,i=r.length,o=255/n;for(t=0;t127&&(s=255-s),c>127&&(c=255-c),u>127&&(u=255-u),t[l]=s,t[l+1]=c,t[l+2]=u}while(--a)}while(--i)},Threshold:function(e){var t,n=255*this.threshold(),r=e.data,i=r.length;for(t=0;tXi.DefaultEventPriority;var Go=Object.defineProperty,Zo=Object.defineProperties,Uo=Object.getOwnPropertyDescriptors,Xo=Object.getOwnPropertySymbols,Yo=Object.prototype.hasOwnProperty,qo=Object.prototype.propertyIsEnumerable,$o=(e,t,n)=>t in e?Go(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ko=(e,t)=>{for(var n in t||(t={}))Yo.call(t,n)&&$o(e,n,t[n]);if(Xo)for(var n of Xo(t))qo.call(t,n)&&$o(e,n,t[n]);return e};function Qo(e,t,n){if(!e)return;if(!0===n(e))return e;let r=t?e.return:e.child;for(;r;){const e=Qo(r,t,n);if(e)return e;r=t?null:r.sibling}}function Jo(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(t){return e}}const ea=Jo(h.createContext(null));class ta extends h.Component{render(){return h.createElement(ea.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:na,ReactCurrentDispatcher:ra}=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function ia(){const e=h.useContext(ea);if(null===e)throw new Error("its-fine: useFiber must be called within a !");const t=h.useId();return h.useMemo((()=>{for(const n of[null==na?void 0:na.current,e,null==e?void 0:e.alternate]){if(!n)continue;const e=Qo(n,!1,(e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}}));if(e)return e}}),[e,t])}function oa(){const e=function(){var e,t;const n=ia(),[r]=h.useState((()=>new Map));r.clear();let i=n;for(;i;){const n=null==(e=i.type)?void 0:e._context;n&&n!==ea&&!r.has(n)&&r.set(n,null==(t=null==ra?void 0:ra.current)?void 0:t.readContext(Jo(n))),i=i.return}return r}();return h.useMemo((()=>Array.from(e.keys()).reduce(((t,n)=>r=>h.createElement(t,null,h.createElement(n.Provider,((e,t)=>Zo(e,Uo(t)))(Ko({},r),{value:e.get(n)})))),(e=>h.createElement(ta,Ko({},e))))),[e])}const aa=e=>{const t=h.useRef(),n=h.useRef(),r=h.useRef(),i=function(e){const t=h.useRef({});return h.useLayoutEffect((()=>{t.current=e})),h.useLayoutEffect((()=>()=>{t.current={}}),[]),t.current}(e),o=oa(),a=t=>{const{forwardedRef:n}=e;n&&("function"==typeof n?n(t):n.current=t)};return h.useLayoutEffect((()=>(n.current=new Gi.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=fa.createContainer(n.current,Xi.LegacyRoot,!1,null),fa.updateContainer(h.createElement(o,{},e.children),r.current),()=>{Gi.isBrowser&&(a(null),fa.updateContainer(null,r.current,null),n.current.destroy())})),[]),h.useLayoutEffect((()=>{a(n.current),no(n.current,e,i),fa.updateContainer(h.createElement(o,{},e.children),r.current,null)})),h.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},la="Layer",sa="Rect",ca="Ellipse",ua="Image",da="Transformer",fa=Ui()(r);fa.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:h.version,rendererPackageName:"react-konva"});const ha=h.forwardRef(((e,t)=>h.createElement(ta,{},h.createElement(aa,{...e,forwardedRef:t})))),pa=function(e){Qi=e};const ga=function(e,t,n,r){return Math.min(e/n,t/r)||1};var ma="FIE_root",va="FIE_transformers-layer",ya="FIE_original-image",ba="FIE_nodes-transformer",wa="watermark",Ca="353297d2-40b4-4684-a875-45a2178a8157",xa={FINETUNE:"Finetune",FILTERS:"Filters",ADJUST:"Adjust",WATERMARK:"Watermark",ANNOTATE:"Annotate",RESIZE:"Resize"},Ea={CROP:"Crop",ROTATE:"Rotate",FLIP_X:"Flip_X",FLIP_Y:"Flip_Y",BRIGHTNESS:"Brightness",CONTRAST:"Contrast",HSV:"HueSaturationValue",WARMTH:"Warmth",BLUR:"Blur",THRESHOLD:"Threshold",POSTERIZE:"Posterize",PIXELATE:"Pixelate",NOISE:"Noise",FILTERS:"Filters",RECT:"Rect",ELLIPSE:"Ellipse",POLYGON:"Polygon",TEXT:"Text",LINE:"Line",IMAGE:"Image",ARROW:"Arrow",WATERMARK:"Watermark",PEN:"Pen",RESIZE:"Resize"},Sa="X",Oa="Y",ka=["png","jpeg","jpg","webp"],Pa=[].concat(ka,["svg","gif","avif","apng"]),_a=ka[0],La={DEFAULT:"default",DRAW:"crosshair",SELECT:"pointer",MOVE:"move",DRAG:"GRAB"},Ia="original",Ta="custom",ja="ellipse",Ma={TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right",MIDDLE_LEFT:"middle-left",MIDDLE_CENTER:"middle-center",MIDDLE_RIGHT:"middle-right",BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right"},Ra=14,Da=14,Aa="after-saving",za="close-button-clicked",Na="warning",Fa="error";const Ha=function(e,t){var n=!!(2=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,e},f:function e(){try{o||null==n.return||n.return()}finally{if(a)throw e}}}}function Ja(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n(n=1n?-1:n;var r=t[0],i=t[1],o=t[2],a=.2989*r+.587*i+.114*o;return[-a*n+r*(1+n),-a*n+i*(1+n),-a*n+o*(1+n)]}},grayscale:function(){return function(e){var t=e[0],n=e[1],r=e[2];return[,,,].fill(.2126*t+.7152*n+.0722*r)}},sepia:function(e){return function(t){var n=t[0],r=t[1],i=t[2];return[n*(1-.607*e)+.769*r*e+.189*i*e,.349*n*e+r*(1-.314*e)+.168*i*e,.272*n*e+.534*r*e+i*(1-.869*e)]}},adjustRGB:function(e){return function(t){return[t[0]*e[0],t[1]*e[1],t[2]*e[2]]}},colorFilter:function(e){return function(t){var n=t[0],r=t[1],i=t[2],o=e[3];return[n-(n-e[0])*o,r-(r-e[1])*o,i-(i-e[2])*o]}}};const tl=el;function nl(e){tl.apply(e,(function(e){var t=(e[0]+e[1]+e[2])/3>100?255:0;return[t,t,t]}))}nl.filterName="BlackAndWhite";const rl=nl;function il(e){tl.apply(e,tl.brightness(.1),tl.contrast(.1),tl.saturation(.15))}il.filterName="Clarendon";const ol=il;function al(e){tl.apply(e,tl.sepia(.04),tl.contrast(-.15))}al.filterName="Gingham";const ll=al;function sl(e){tl.apply(e,tl.grayscale(),tl.brightness(.1));e.data.length}sl.filterName="Moon";const cl=sl;var ul=[1,1.03,1.05];function dl(e){tl.apply(e,tl.brightness(.08),tl.adjustRGB(ul),tl.saturation(.12))}dl.filterName="Lark";const fl=dl;function hl(e){tl.apply(e,tl.sepia(.4),tl.brightness(.13),tl.contrast(-.05))}hl.filterName="Reyes";const pl=hl;var gl=[1.01,1.04,1];function ml(e){tl.apply(e,tl.adjustRGB(gl),tl.saturation(.3))}ml.filterName="Juno";const vl=ml;function yl(e){tl.apply(e,tl.brightness(.1),tl.saturation(-.5))}yl.filterName="Slumber";const bl=yl;var wl=[1.04,1,1.02];function Cl(e){tl.apply(e,tl.adjustRGB(wl),tl.saturation(-.05))}Cl.filterName="Crema";const xl=Cl;function El(e){tl.apply(e,tl.brightness(.05),tl.saturation(-.03))}El.filterName="Ludwig";const Sl=El;var Ol=[228,130,225,.13];function kl(e){tl.apply(e,tl.colorFilter(Ol),tl.saturation(-.2))}kl.filterName="Aden";const Pl=kl;var _l=[1.05,1.1,1];function Ll(e){tl.apply(e,tl.adjustRGB(_l))}Ll.filterName="Perpetua";const Il=Ll;function Tl(e){tl.apply(e,tl.saturation(.3),tl.brightness(.15))}Tl.filterName="Amaro";const jl=Tl;var Ml=[230,115,108,.05];function Rl(e){tl.apply(e,tl.colorFilter(Ml),tl.saturation(.15))}Rl.filterName="Mayfair";const Dl=Rl;var Al=[255,170,0,.1];function zl(e){tl.apply(e,tl.colorFilter(Al),tl.brightness(.09),tl.saturation(.1))}zl.filterName="Rise";const Nl=zl;var Fl=[1,1,1.25];function Hl(e){tl.apply(e,tl.adjustRGB(Fl),tl.contrast(.1),tl.brightness(.15))}Hl.filterName="Hudson";const Bl=Hl;var Vl=[255,225,80,.08];function Wl(e){tl.apply(e,tl.colorFilter(Vl),tl.saturation(.1),tl.contrast(.05))}Wl.filterName="Valencia";const Gl=Wl;var Zl=[255,255,0,.07];function Ul(e){tl.apply(e,tl.colorFilter(Zl),tl.saturation(.2),tl.contrast(.15))}Ul.filterName="XPro2";const Xl=Ul;function Yl(e){tl.apply(e,tl.contrast(-.15),tl.saturation(.1))}Yl.filterName="Sierra";const ql=Yl;var $l=[100,28,210,.03];function Kl(e){tl.apply(e,tl.grayscale(),tl.colorFilter($l),tl.brightness(.1))}Kl.filterName="Willow";const Ql=Kl;function Jl(e){tl.apply(e,tl.contrast(.15),tl.saturation(.2))}Jl.filterName="LoFi";const es=Jl;function ts(e){tl.apply(e,tl.contrast(.1),tl.saturation(.15))}ts.filterName="Hefe";const ns=ts;var rs=[220,115,188,.12];function is(e){tl.apply(e,tl.colorFilter(rs),tl.contrast(-.05))}is.filterName="Nashville";const os=is;function as(e){tl.apply(e,tl.brightness(.1),tl.sepia(.3))}as.filterName="Stinson";const ls=as;var ss=[255,225,0,.05];function cs(e){tl.apply(e,tl.colorFilter(ss),tl.brightness(.06),tl.contrast(.06))}cs.filterName="Vesper";const us=cs;var ds=[255,165,40,.2];function fs(e){tl.apply(e,tl.colorFilter(ds))}fs.filterName="Earlybird";const hs=fs;var ps=[140,10,185,.1];function gs(e){tl.apply(e,tl.contrast(.2),tl.colorFilter(ps))}gs.filterName="Brannan";const ms=gs;function vs(e){tl.apply(e,tl.brightness(-.1),tl.saturation(-.1))}vs.filterName="Sutro";const ys=vs;var bs=[255,145,0,.2];function ws(e){tl.apply(e,tl.sepia(.1),tl.colorFilter(bs))}ws.filterName="Toaster";const Cs=ws;var xs=[255,255,0,.2];function Es(e){tl.apply(e,tl.brightness(.1),tl.colorFilter(xs))}Es.filterName="Walden";const Ss=Es;var Os=[255,25,0,.15];function ks(e){tl.apply(e,tl.colorFilter(Os),tl.brightness(.1))}ks.filterName="NinteenSeventySeven";const Ps=ks;var _s=[255,140,0,.1],Ls=[1.15,1.05,1];function Is(e){tl.apply(e,tl.colorFilter(_s),tl.adjustRGB(Ls),tl.saturation(.35))}Is.filterName="Kelvin";const Ts=Is;var js=[225,240,0,.1];function Ms(e){tl.apply(e,tl.colorFilter(js),tl.saturation(.25),tl.contrast(.05))}Ms.filterName="Maven";const Rs=Ms;function Ds(e){tl.apply(e,tl.sepia(.06),tl.brightness(.1))}Ds.filterName="Ginza";const As=Ds;function zs(e){tl.apply(e,tl.saturation(.35),tl.brightness(.1))}zs.filterName="Skyline";const Ns=zs;function Fs(e){tl.apply(e,tl.contrast(.15),tl.brightness(.1))}Fs.filterName="Dogpatch";const Hs=Fs;var Bs=[25,240,252,.05];function Vs(e){tl.apply(e,tl.colorFilter(Bs),tl.sepia(.3))}Vs.filterName="Brooklyn";const Ws=Vs;var Gs=[208,208,86,.2];function Zs(e){tl.apply(e,tl.colorFilter(Gs),tl.contrast(.15))}Zs.filterName="Helena";const Us=Zs;var Xs=[255,160,25,.1];function Ys(e){tl.apply(e,tl.colorFilter(Xs),tl.brightness(.1))}Ys.filterName="Ashby";const qs=Ys;var $s=[255,50,80,.12];function Ks(e){tl.apply(e,tl.colorFilter($s),tl.contrast(.05))}Ks.filterName="Charmes";const Qs=Ks;const Js=function(e){return e?i[e]||Wi.Filters[e]:null};function ec(e){for(var t=this.warmth(),n=e.data,r=n.length,i=0;i=t?255:0,n[i+1]=n[i+1]>=t?255:0,n[i+2]=n[i+2]>=t?255:0)}sn.addGetterSetter(Wi.Image,"warmth",0,Jt(),sn.afterSetFilter),nc.finetuneName="CustomThreshold";const rc=nc;sn.addGetterSetter(Wi.Image,"threshold",0,Jt,sn.afterSetFilter);const ic=function(e){return Array.isArray(e)&&0o.status){(o.response||[]).forEach((function(e){tu[i]=eu(eu({},tu[i]),{},c({},e.translation_key,e.translations[i]))}));var e=[];Object.keys(Qc).forEach((function(t){var n;t&&(null===(n=tu[i])||void 0===n||!n[t])&&e.push({key:t,lang:i,default:Qc[t]})})),0r.status?t(r.response):(console.warn("Error in sending translation key to backend ".concat(null===(e=r.response)||void 0===e?void 0:e.hint,", ").concat(r.status)),n())},r.onerror=function(){var e;console.warn("Error in sending translation key to backend ".concat(null===(e=r.response)||void 0===e?void 0:e.hint,", ").concat(r.status)),n()},r.open("POST","https://neo.wordplex.io/api/import/request-translations?grid_uuid=".concat(Ca)),r.send(JSON.stringify({grid_uuid:Ca,translations_requests:e}))}))}(e),iu(t,i),n(nu)}else{var a,l,s;console.error("Status code: ".concat(o.status)),console.error((null===(a=o.response)||void 0===a?void 0:a.msg)||(null===(l=o.response)||void 0===l?void 0:l.msg)||(null===(s=o.response)||void 0===s?void 0:s.details)||ru),r()}},o.onerror=function(){console.error("Status code ".concat(o.status,", error: ").concat(ru)),r()},o.open("GET","https://i18n.ultrafast.io/api/export?grid=".concat(Ca)),o.send()}))},au=function(e){return nu[e]||e||""};const lu=function(e,t){return YE[t.type]&&YE[t.type](e,t.payload)||e};function su(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cu(e){for(var t,n=1;nr,d=0>i;switch(t){case Ea.RECT:n?(l.width=Math.sqrt(s*s+c*c),l.height=l.width,l.x-=u?l.width-s:0,l.y-=d?l.height-c:0):(l.width=s,l.height=c);break;case Ea.ELLIPSE:n?(l.radiusX=Math.sqrt(s*s+c*c)/2,l.radiusY=l.radiusX,l.x-=u?2*l.radiusX-s:0,l.y-=d?2*l.radiusY-c:0):(l.radiusX=s/2,l.radiusY=c/2),l.offsetX=-l.radiusX,l.offsetY=-l.radiusY;break;case Ea.POLYGON:l.radius=(s+c)/2,l.x-=u?2*l.radius-s:0,l.y-=d?2*l.radius-c:0,l.offsetX=-l.radius,l.offsetY=-l.radius;break;case Ea.LINE:case Ea.ARROW:l.x=o,l.y=a,l.points=[0,0],n?l.points.push(s>=c?r:0,c>s?i:0):l.points=[0,0,r,i];break;default:l.width=s,l.height=c}return l}(e,Wu.name,t);Vu&&Vu.setAttrs(n),Bu.setAttrs(n),Wu=Nu(Nu({},Wu),n)},l=function(e){var t=Ou(n,i());a(ku(t,Fu,n),e.shiftKey)},s=function(){n&&Bu&&n.destroyChildren()},c=function(e){var r;if(!(1<(null===(r=e.evt.touches)||void 0===r?void 0:r.length))){var s=Ou(n,i());Fu.isOutOfCanvas&&(document.removeEventListener("mousemove",l,Hu),document.removeEventListener("touchmove",l,Hu),Fu.isOutOfCanvas=!1);var c=ku(s,Fu,n);if(Bu)a(c,e.evt.shiftKey);else{t.id,t.x,t.y,t.points;var u=g(t,Du);o(Nu(Nu({},u),c))}}},u=function(){Fu.isOutOfCanvas||(document.addEventListener("mousemove",l,Hu),document.addEventListener("touchmove",l,Hu),Fu.isOutOfCanvas=!0)},d=function(){var n,i;if(s(),Wu&&(Wu.width>=1&&Wu.height>=1||Wu.radiusX>=1&&Wu.radiusY>=1||null!==(n=Wu.points)&&void 0!==n&&n[2]||null!==(i=Wu.points)&&void 0!==i&&i[3]||Wu.radius>=1)){var o=Wu,a=(o.startedX,o.startedY,o.offsetX,o.offsetY,o.width),f=o.height,h=g(o,Au);Mu.includes(t.name)||(h.width=a,h.height=f),r(h,!0)}Bu=null,Vu=null,Wu=null,e.off("mousemove touchmove",c),e.off("mouseleave touchcancel",u),document.removeEventListener("mouseup",d,Hu),document.removeEventListener("touchend",d,Hu),document.removeEventListener("mouseleave",d,Hu),document.removeEventListener("touchcancel",d,Hu),document.removeEventListener("mousemove",l,Hu),document.removeEventListener("touchmove",l,Hu),Fu.isOutOfCanvas=!1},f=function(t){var r;if(t.evt.preventDefault(),!(t.target.attrs.draggable||1<(null===(r=t.evt.touches)||void 0===r?void 0:r.length))){s();var o=Ou(n,i());Fu.startedX=o.offsetX,Fu.startedY=o.offsetY,Fu.isOutOfCanvas=!1,e.on("mousemove touchmove",c),e.on("mouseleave touchcancel",u),document.addEventListener("mouseup",d,Hu),document.addEventListener("touchend",d,Hu),document.addEventListener("mouseleave",d,Hu),document.addEventListener("touchcancel",d,Hu)}};return e.on("mousedown touchstart",f),function(){s(),e.off("mousedown touchstart",f)}};const Zu=function(e,t){var n=2=i?0:0>i&&-90=i&&-90<=i?0:90>>32-t},pd=function(e){var t,n="";for(t=7;0<=t;t--)n+=(15&e>>>4*t).toString(16);return n};const gd=function(e){var t,n,r,i,o,a,l,s,c,u=e,d=Array(80),f=1732584193,h=4023233417,p=2562383102,g=271733878,m=3285377520;u=function(e){for(var t,n=e.replace(/\r\n/g,"\n"),r="",i=0;i(t=n.charCodeAt(i))?r+=String.fromCharCode(t):127t?(r+=String.fromCharCode(192|t>>6),r+=String.fromCharCode(128|63&t)):(r+=String.fromCharCode(224|t>>12),r+=String.fromCharCode(128|63&t>>6),r+=String.fromCharCode(128|63&t));return r}(u);var v=u.length,y=[];for(n=0;n>>29),y.push(4294967295&v<<3),t=0;tn;n++)d[n]=y[t+n];for(n=16;79>=n;n++)d[n]=hd(d[n-3]^d[n-8]^d[n-14]^d[n-16],1);for(i=f,o=h,a=p,l=g,s=m,n=0;19>=n;n++)c=4294967295&hd(i,5)+(o&a|~o&l)+s+d[n]+1518500249,s=l,l=a,a=hd(o,30),o=i,i=c;for(n=20;39>=n;n++)c=4294967295&hd(i,5)+(o^a^l)+s+d[n]+1859775393,s=l,l=a,a=hd(o,30),o=i,i=c;for(n=40;59>=n;n++)c=4294967295&hd(i,5)+(o&a|o&l|a&l)+s+d[n]+2400959708,s=l,l=a,a=hd(o,30),o=i,i=c;for(n=60;79>=n;n++)c=4294967295&hd(i,5)+(o^a^l)+s+d[n]+3395469782,s=l,l=a,a=hd(o,30),o=i,i=c;f=4294967295&f+i,h=4294967295&h+o,p=4294967295&p+a,g=4294967295&g+l,m=4294967295&m+s}return(c=pd(f)+pd(h)+pd(p)+pd(g)+pd(m)).toLowerCase()};var md=function(e,t,n,r){var i=function(e){return btoa(e).replace(/=*$/g,"")}(e),o=function(e,t){return gd(e).slice(0,t)}(t+i+n,r);return[o?"ci_seal=".concat(o):"",i?"ci_eqs=".concat(i):""].filter((function(e){return e})).join("&")};const vd=function(e,t,n){var r=t||{},i=r.salt,o=r.charCount,a=r.includeParams,l=void 0===a?[]:a,s=!l||0===(null==l?void 0:l.length),c="",u=[],d=[];return e.split("&").forEach((function(e){var t=At(e.split("="),1)[0];-1<(null==l?void 0:l.indexOf(t))||s?u.push(e):d.push(e)})),0 input{border:0px;clip:rect(0px,0px,0px,0px);height:100%;margin:-1px;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:100%;direction:ltr;}&::before{position:absolute;content:'';border-radius:inherit;width:100%;height:100%;box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%),0px 2px 2px 0px rgb(0 0 0 / 14%),0px 1px 5px 0px rgb(0 0 0 / 12%);}&::after{position:absolute;content:'';border-radius:50%;width:42px;height:42px;top:50%;left:50%;transform:translate(-50%,-50%);}"]),Xd=Qe.span.attrs({className:Ic(Vd,"label")}).withConfig({componentId:"sc-jjink6-4"})((function(e){var t=e.theme,n=e.open,r=void 0!==n&&n,i=e.disabled;return Re(["display:flex;align-items:center;justify-content:center;padding:6px 6px;border-radius:2px;position:absolute;top:-10px;font-size:10px;z-index:1;white-space:nowrap;transition:transform 150ms cubic-bezier(0.4,0,0.2,1) 0ms;transform-origin:bottom center;transform:",";background-color:",";color:#fff;cursor:pointer;&::before{position:absolute;content:'';background-color:inherit;width:8px;height:8px;bottom:0px;left:50%;transform:translate(-50%,50%) rotate(45deg);}"],r?"translateY(-100%) scale(1)":"translateY(-100%) scale(0)",void 0!==i&&i?t.palette[ut.AccentPrimaryDisabled]:t.palette[ut.LinkHover])}));const Yd=Tc({Slider:Wd,Rail:Gd,Track:Zd,Thumb:Ud,SliderAnnotation:Qe.div.attrs({className:Ic(Vd,"annotation")}).withConfig({componentId:"sc-jjink6-5"})((function(e){return Re(["display:flex;justify-content:space-between;margin-top:12px;color:",";"],e.theme.palette[ut.TextSecondary])})),LabelTooltip:Xd});var qd=["defaultValue","disabled","disableSwap","hideTrack","hideAnnotation","value","min","max","onChange","onMouseDown","onMouseUp","step","labelTooltip","annotation","components","componentsProps"];function $d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kd(e){for(var t=1;t2&&H(!0),ee(e,r,i)}else re(e)})),re=Hd((function(e){var t=Ad(e,W);H(!1),t&&(R(-1),"touchend"===e.type&&z(-1),w&&w(e),W.current=void 0,se())})),ie=Hd((function(e){var t=e.changedTouches[0];null!=t&&(W.current=t.identifier);var n=Ad(e,W),r=J({finger:n,values:Q}),i=r.newValue,o=r.activeIndex;Nd({sliderRef:G,activeIndex:o,setActive:R}),q(i),ee(e,i,o),B.current=0;var a=Rd(G.current);a.addEventListener("touchmove",ne),a.addEventListener("touchend",re)})),oe=Hd((function(e){var t=Number(e.currentTarget.getAttribute(Qd));z(t)})),ae=Hd((function(){z(-1)})),le=Hd((function(e){if(i)e.preventDefault();else{if(b&&b(e),0!==e.button)return;e.preventDefault();var t=Ad(e,W),n=J({finger:t,values:Q}),r=n.newValue,o=n.activeIndex;Nd({sliderRef:G,activeIndex:o,setActive:R}),q(r),ee(e,r,o),B.current=0;var a=Rd(G.current);a.addEventListener("mousemove",ne),a.addEventListener("mouseup",re)}})),se=(0,h.useCallback)((function(){var e=Rd(G.current);e.removeEventListener("mousemove",ne),e.removeEventListener("mouseup",re),e.removeEventListener("touchmove",ne),e.removeEventListener("touchend",re)}),[re,ne]);(0,h.useEffect)((function(){if(G.current)return function(){se()}}),[se,ie]),(0,h.useEffect)((function(){i&&se()}),[i,se]),i&&-1!==M&&R(-1);var ce=Td(K?Q[0]:p,p,v),ue=Td(Q[Q.length-1],p,v)-ce,de=Kd(Kd({},zd[$].offset(ce)),zd[$].leap(ue)),fe=I.rail,he="function"==typeof _.Rail?h.createElement(_.Rail,zt({},fe,{style:Kd({},null==fe?void 0:fe.style)})):h.createElement(Yd.Rail,zt({},fe,{style:Kd({},null==fe?void 0:fe.style)})),pe=I.track,ge=!s&&("function"==typeof _.Track?h.createElement(_.Track,zt({},pe,{style:Kd(Kd({},de),null==pe?void 0:pe.style)})):h.createElement(Yd.Track,zt({},pe,{style:Kd(Kd({},de),null==pe?void 0:pe.style)}))),me=I.thumb,ve=_.Thumb||Yd.Thumb,ye=_.LabelTooltip||Yd.LabelTooltip,be=I.labelTooltip,we=k?" ".concat(k):"";return h.createElement(Yd.Slider,zt({ref:Z,disabled:i,onTouchStart:ie,onMouseDown:le},T),he,ge,Q.map((function(e,t){var n=Td(e,p,v),r=zd[$].offset(n);return h.createElement(h.Fragment,{key:t},h.createElement(ve,zt({"data-index":t,onMouseOver:oe,onMouseLeave:ae},me,{style:Kd(Kd({},r),{},{pointerEvents:a&&M!==t?"none":void 0},null==me?void 0:me.style)}),h.createElement("input",{"data-index":t,type:"range",min:p,max:v,value:Q[t],step:x,disabled:i,onChange:te}),h.createElement(ye,{open:A===t||M===t||"on"===S,disabled:i,style:Kd({},null==be?void 0:be.style)},Q[t],we)))})),!u&&h.createElement(Yd.SliderAnnotation,null,h.createElement("span",null,p,we),h.createElement("span",null,v,we)))}));Jd.defaultProps={annotation:"MB",min:0,max:100,step:1,labelTooltip:Bd.Off},Jd.propTypes={defaultValue:v().oneOfType([v().array,v().number]),value:v().oneOfType([v().array,v().number]),min:v().number,max:v().number,onChange:v().func,onMouseDown:v().func,onMouseUp:v().func,step:v().number,annotation:v().string,disabled:v().bool,disableSwap:v().bool,hideTrack:v().bool,hideAnnotation:v().bool,labelTooltip:v().oneOf(nt(Bd)),components:v().shape({Rail:v().elementType,Track:v().elementType,Thumb:v().elementType,LabelTooltip:v().elementType}),componentsProps:v().object};const ef=Jd;var tf=Qe(ef).withConfig({componentId:"sc-1wort0h-0"})(["width:",";max-width:",";user-select:none;margin-bottom:24px;.SfxSlider-annotation{font-size:13px;line-height:16px;}"],(function(e){return e.width||"100px"}),(function(e){return e.width||"100px"})),nf=["onChange"];const rf=function(e){var t=e.onChange,n=g(e,nf);return h.createElement(tf,zt({annotation:"",onChange:function(e,n){return t?t(n):void 0}},n))};var of={brightness:0},af={width:150,padding:0};const lf=function(){var e,t=At(yu(Wi.Filters.Brighten,of),2),n=t[0],r=t[1];return h.createElement(rf,{className:"FIE_brightness-option",min:-1,step:.05,max:1,value:null!==(e=n.brightness)&&void 0!==e?e:of.brightness,onChange:function(e){r({brightness:Su(e,-1,1)})},style:af})};var sf=["color","size"],cf=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,sf);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{d:"M13.5968 11.0258H12.2124V2.22491H2.91714V0.444957C2.91714 0.197742 2.71937 -3.05176e-05 2.47215 -3.05176e-05C2.22494 -3.05176e-05 2.02716 0.197742 2.02716 0.444957V2.22491H0.444987C0.197772 2.22491 0 2.47212 0 2.71934C0 2.96655 0.197772 3.16432 0.444987 3.16432H2.02716V11.9157H11.273V13.4979C11.273 13.7451 11.4708 13.9429 11.718 13.9429C11.9652 13.9429 12.163 13.7451 12.163 13.4979V11.9157H13.5474C13.7946 11.9157 13.9924 11.718 13.9924 11.4707C14.0418 11.2235 13.844 11.0258 13.5968 11.0258ZM2.91714 11.0258V3.16432H11.273V11.0258H2.91714Z",fill:r}))}));var uf=n(3935);function df(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ff(e){return e instanceof df(e).Element||e instanceof Element}function hf(e){return e instanceof df(e).HTMLElement||e instanceof HTMLElement}function pf(e){return"undefined"!=typeof ShadowRoot&&(e instanceof df(e).ShadowRoot||e instanceof ShadowRoot)}var gf=Math.max,mf=Math.min,vf=Math.round;function yf(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function bf(){return!/^((?!chrome|android).)*safari/i.test(yf())}function wf(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&hf(e)&&(i=e.offsetWidth>0&&vf(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&vf(r.height)/e.offsetHeight||1);var a=(ff(e)?df(e):window).visualViewport,l=!bf()&&n,s=(r.left+(l&&a?a.offsetLeft:0))/i,c=(r.top+(l&&a?a.offsetTop:0))/o,u=r.width/i,d=r.height/o;return{width:u,height:d,top:c,right:s+u,bottom:c+d,left:s,x:s,y:c}}function Cf(e){var t=df(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function xf(e){return e?(e.nodeName||"").toLowerCase():null}function Ef(e){return((ff(e)?e.ownerDocument:e.document)||window.document).documentElement}function Sf(e){return wf(Ef(e)).left+Cf(e).scrollLeft}function Of(e){return df(e).getComputedStyle(e)}function kf(e){var t=Of(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Pf(e,t,n){void 0===n&&(n=!1);var r,i,o=hf(t),a=hf(t)&&function(e){var t=e.getBoundingClientRect(),n=vf(t.width)/e.offsetWidth||1,r=vf(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),l=Ef(t),s=wf(e,a,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==xf(t)||kf(l))&&(c=(r=t)!==df(r)&&hf(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:Cf(r)),hf(t)?((u=wf(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):l&&(u.x=Sf(l))),{x:s.left+c.scrollLeft-u.x,y:s.top+c.scrollTop-u.y,width:s.width,height:s.height}}function _f(e){var t=wf(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Lf(e){return"html"===xf(e)?e:e.assignedSlot||e.parentNode||(pf(e)?e.host:null)||Ef(e)}function If(e){return["html","body","#document"].indexOf(xf(e))>=0?e.ownerDocument.body:hf(e)&&kf(e)?e:If(Lf(e))}function Tf(e,t){var n;void 0===t&&(t=[]);var r=If(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=df(r),a=i?[o].concat(o.visualViewport||[],kf(r)?r:[]):r,l=t.concat(a);return i?l:l.concat(Tf(Lf(a)))}function jf(e){return["table","td","th"].indexOf(xf(e))>=0}function Mf(e){return hf(e)&&"fixed"!==Of(e).position?e.offsetParent:null}function Rf(e){for(var t=df(e),n=Mf(e);n&&jf(n)&&"static"===Of(n).position;)n=Mf(n);return n&&("html"===xf(n)||"body"===xf(n)&&"static"===Of(n).position)?t:n||function(e){var t=/firefox/i.test(yf());if(/Trident/i.test(yf())&&hf(e)&&"fixed"===Of(e).position)return null;var n=Lf(e);for(pf(n)&&(n=n.host);hf(n)&&["html","body"].indexOf(xf(n))<0;){var r=Of(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var Df="top",Af="bottom",zf="right",Nf="left",Ff="auto",Hf=[Df,Af,zf,Nf],Bf="start",Vf="end",Wf="clippingParents",Gf="viewport",Zf="popper",Uf="reference",Xf=Hf.reduce((function(e,t){return e.concat([t+"-"+Bf,t+"-"+Vf])}),[]),Yf=[].concat(Hf,[Ff]).reduce((function(e,t){return e.concat([t,t+"-"+Bf,t+"-"+Vf])}),[]),qf=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function $f(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var Kf={placement:"bottom",modifiers:[],strategy:"absolute"};function Qf(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function oh(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?nh(i):null,a=i?rh(i):null,l=n.x+n.width/2-r.width/2,s=n.y+n.height/2-r.height/2;switch(o){case Df:t={x:l,y:n.y-r.height};break;case Af:t={x:l,y:n.y+n.height};break;case zf:t={x:n.x+n.width,y:s};break;case Nf:t={x:n.x-r.width,y:s};break;default:t={x:n.x,y:n.y}}var c=o?ih(o):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case Bf:t[c]=t[c]-(n[u]/2-r[u]/2);break;case Vf:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}var ah={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lh(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,l=e.position,s=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=a.x,h=void 0===f?0:f,p=a.y,g=void 0===p?0:p,m="function"==typeof u?u({x:h,y:g}):{x:h,y:g};h=m.x,g=m.y;var v=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),b=Nf,w=Df,C=window;if(c){var x=Rf(n),E="clientHeight",S="clientWidth";if(x===df(n)&&"static"!==Of(x=Ef(n)).position&&"absolute"===l&&(E="scrollHeight",S="scrollWidth"),i===Df||(i===Nf||i===zf)&&o===Vf)w=Af,g-=(d&&x===C&&C.visualViewport?C.visualViewport.height:x[E])-r.height,g*=s?1:-1;if(i===Nf||(i===Df||i===Af)&&o===Vf)b=zf,h-=(d&&x===C&&C.visualViewport?C.visualViewport.width:x[S])-r.width,h*=s?1:-1}var O,k=Object.assign({position:l},c&&ah),P=!0===u?function(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:vf(n*i)/i||0,y:vf(r*i)/i||0}}({x:h,y:g},df(n)):{x:h,y:g};return h=P.x,g=P.y,s?Object.assign({},k,((O={})[w]=y?"0":"",O[b]=v?"0":"",O.transform=(C.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",O)):Object.assign({},k,((t={})[w]=y?g+"px":"",t[b]=v?h+"px":"",t.transform="",t))}const sh={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];hf(i)&&xf(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});hf(r)&&xf(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};const ch={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=Yf.reduce((function(e,n){return e[n]=function(e,t,n){var r=nh(e),i=[Nf,Df].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],l=o[1];return a=a||0,l=(l||0)*i,[Nf,zf].indexOf(r)>=0?{x:l,y:a}:{x:a,y:l}}(n,t.rects,o),e}),{}),l=a[t.placement],s=l.x,c=l.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}};var uh={left:"right",right:"left",bottom:"top",top:"bottom"};function dh(e){return e.replace(/left|right|bottom|top/g,(function(e){return uh[e]}))}var fh={start:"end",end:"start"};function hh(e){return e.replace(/start|end/g,(function(e){return fh[e]}))}function ph(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&pf(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function gh(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function mh(e,t,n){return t===Gf?gh(function(e,t){var n=df(e),r=Ef(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,l=0,s=0;if(i){o=i.width,a=i.height;var c=bf();(c||!c&&"fixed"===t)&&(l=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:l+Sf(e),y:s}}(e,n)):ff(t)?function(e,t){var n=wf(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):gh(function(e){var t,n=Ef(e),r=Cf(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=gf(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=gf(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Sf(e),s=-r.scrollTop;return"rtl"===Of(i||n).direction&&(l+=gf(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:l,y:s}}(Ef(e)))}function vh(e,t,n,r){var i="clippingParents"===t?function(e){var t=Tf(Lf(e)),n=["absolute","fixed"].indexOf(Of(e).position)>=0&&hf(e)?Rf(e):e;return ff(n)?t.filter((function(e){return ff(e)&&ph(e,n)&&"body"!==xf(e)})):[]}(e):[].concat(t),o=[].concat(i,[n]),a=o[0],l=o.reduce((function(t,n){var i=mh(e,n,r);return t.top=gf(i.top,t.top),t.right=mf(i.right,t.right),t.bottom=mf(i.bottom,t.bottom),t.left=gf(i.left,t.left),t}),mh(e,a,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function yh(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function bh(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function wh(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.strategy,a=void 0===o?e.strategy:o,l=n.boundary,s=void 0===l?Wf:l,c=n.rootBoundary,u=void 0===c?Gf:c,d=n.elementContext,f=void 0===d?Zf:d,h=n.altBoundary,p=void 0!==h&&h,g=n.padding,m=void 0===g?0:g,v=yh("number"!=typeof m?m:bh(m,Hf)),y=f===Zf?Uf:Zf,b=e.rects.popper,w=e.elements[p?y:f],C=vh(ff(w)?w:w.contextElement||Ef(e.elements.popper),s,u,a),x=wf(e.elements.reference),E=oh({reference:x,element:b,strategy:"absolute",placement:i}),S=gh(Object.assign({},b,E)),O=f===Zf?S:x,k={top:C.top-O.top+v.top,bottom:O.bottom-C.bottom+v.bottom,left:C.left-O.left+v.left,right:O.right-C.right+v.right},P=e.modifiersData.offset;if(f===Zf&&P){var _=P[i];Object.keys(k).forEach((function(e){var t=[zf,Af].indexOf(e)>=0?1:-1,n=[Df,Af].indexOf(e)>=0?"y":"x";k[e]+=_[n]*t}))}return k}const Ch={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,l=void 0===a||a,s=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=void 0===h||h,g=n.allowedAutoPlacements,m=t.options.placement,v=nh(m),y=s||(v===m||!p?[dh(m)]:function(e){if(nh(e)===Ff)return[];var t=dh(e);return[hh(e),t,hh(t)]}(m)),b=[m].concat(y).reduce((function(e,n){return e.concat(nh(n)===Ff?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,l=n.flipVariations,s=n.allowedAutoPlacements,c=void 0===s?Yf:s,u=rh(r),d=u?l?Xf:Xf.filter((function(e){return rh(e)===u})):Hf,f=d.filter((function(e){return c.indexOf(e)>=0}));0===f.length&&(f=d);var h=f.reduce((function(t,n){return t[n]=wh(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[nh(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):n)}),[]),w=t.rects.reference,C=t.rects.popper,x=new Map,E=!0,S=b[0],O=0;O=0,I=L?"width":"height",T=wh(t,{placement:k,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),j=L?_?zf:Nf:_?Af:Df;w[I]>C[I]&&(j=dh(j));var M=dh(j),R=[];if(o&&R.push(T[P]<=0),l&&R.push(T[j]<=0,T[M]<=0),R.every((function(e){return e}))){S=k,E=!1;break}x.set(k,R)}if(E)for(var D=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},A=p?3:1;A>0;A--){if("break"===D(A))break}t.placement!==S&&(t.modifiersData[r]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function xh(e,t,n){return gf(e,mf(t,n))}const Eh={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,l=void 0!==a&&a,s=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,h=void 0===f||f,p=n.tetherOffset,g=void 0===p?0:p,m=wh(t,{boundary:s,rootBoundary:c,padding:d,altBoundary:u}),v=nh(t.placement),y=rh(t.placement),b=!y,w=ih(v),C="x"===w?"y":"x",x=t.modifiersData.popperOffsets,E=t.rects.reference,S=t.rects.popper,O="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,k="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,_={x:0,y:0};if(x){if(o){var L,I="y"===w?Df:Nf,T="y"===w?Af:zf,j="y"===w?"height":"width",M=x[w],R=M+m[I],D=M-m[T],A=h?-S[j]/2:0,z=y===Bf?E[j]:S[j],N=y===Bf?-S[j]:-E[j],F=t.elements.arrow,H=h&&F?_f(F):{width:0,height:0},B=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=B[I],W=B[T],G=xh(0,E[j],H[j]),Z=b?E[j]/2-A-G-V-k.mainAxis:z-G-V-k.mainAxis,U=b?-E[j]/2+A+G+W+k.mainAxis:N+G+W+k.mainAxis,X=t.elements.arrow&&Rf(t.elements.arrow),Y=X?"y"===w?X.clientTop||0:X.clientLeft||0:0,q=null!=(L=null==P?void 0:P[w])?L:0,$=M+U-q,K=xh(h?mf(R,M+Z-q-Y):R,M,h?gf(D,$):D);x[w]=K,_[w]=K-M}if(l){var Q,J="x"===w?Df:Nf,ee="x"===w?Af:zf,te=x[C],ne="y"===C?"height":"width",re=te+m[J],ie=te-m[ee],oe=-1!==[Df,Nf].indexOf(v),ae=null!=(Q=null==P?void 0:P[C])?Q:0,le=oe?re:te-E[ne]-S[ne]-ae+k.altAxis,se=oe?te+E[ne]+S[ne]-ae-k.altAxis:ie,ce=h&&oe?function(e,t,n){var r=xh(e,t,n);return r>n?n:r}(le,te,se):xh(h?le:re,te,h?se:ie);x[C]=ce,_[C]=ce-te}t.modifiersData[r]=_}},requiresIfExists:["offset"]};const Sh={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,l=nh(n.placement),s=ih(l),c=[Nf,zf].indexOf(l)>=0?"height":"width";if(o&&a){var u=function(e,t){return yh("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:bh(e,Hf))}(i.padding,n),d=_f(o),f="y"===s?Df:Nf,h="y"===s?Af:zf,p=n.rects.reference[c]+n.rects.reference[s]-a[s]-n.rects.popper[c],g=a[s]-n.rects.reference[s],m=Rf(o),v=m?"y"===s?m.clientHeight||0:m.clientWidth||0:0,y=p/2-g/2,b=u[f],w=v-d[c]-u[h],C=v/2-d[c]/2+y,x=xh(b,C,w),E=s;n.modifiersData[r]=((t={})[E]=x,t.centerOffset=x-C,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&ph(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Oh(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function kh(e){return[Df,zf,Af,Nf].some((function(t){return e[t]>=0}))}var Ph=Jf({defaultModifiers:[th,{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=oh({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,l=n.roundOffsets,s=void 0===l||l,c={placement:nh(t.placement),variation:rh(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,lh(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,lh(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},sh,ch,Ch,Eh,Sh,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=wh(t,{elementContext:"reference"}),l=wh(t,{altBoundary:!0}),s=Oh(a,r),c=Oh(l,i,o),u=kh(s),d=kh(c);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]});const _h=function(e){var t=(0,h.useRef)(null);return(0,h.useEffect)((function(){var n,r=document.querySelector("#".concat(e)),i=r||function(e){var t=document.createElement("div");return t.setAttribute("id",e),t}(e);return r||(n=i,document.body.append(n)),t.current&&i.append(t.current),function(){t.current&&t.current.remove(),-1===i.childNodes.length&&i.remove()}}),[]),t.current||(t.current=document.createElement("div")),t.current};var Lh,Ih={AutoStart:"auto-start",Auto:"auto",AutoEnd:"auto-end",TopStart:"top-start",Top:"top",TopEnd:"top-end",BottomStart:"bottom-start",Bottom:"bottom",BottomEnd:"bottom-end",LeftStart:"left-start",Left:"left",LeftEnd:"left-end",RightStart:"right-start",Right:"right",RightEnd:"right-end"},Th=(c(Lh={},Ih.Auto,Re(["top:0px;bottom:0px;left:0px;right:0px;"])),c(Lh,Ih.AutoEnd,Re(["top:0px;bottom:0px;left:0px;right:0px;"])),c(Lh,Ih.AutoStart,Re(["top:0px;bottom:0px;left:0px;right:0px;"])),c(Lh,Ih.Right,Re(["left:-4px;"])),c(Lh,Ih.RightEnd,Re(["left:-4px;"])),c(Lh,Ih.RightStart,Re(["left:-4px;"])),c(Lh,Ih.Left,Re(["right:-4px;"])),c(Lh,Ih.LeftEnd,Re(["right:-4px;"])),c(Lh,Ih.LeftStart,Re(["right:-4px;"])),c(Lh,Ih.Top,Re(["bottom:-4px;"])),c(Lh,Ih.TopEnd,Re(["bottom:-4px;"])),c(Lh,Ih.TopStart,Re(["bottom:-4px;"])),c(Lh,Ih.Bottom,Re(["top:-4px;"])),c(Lh,Ih.BottomEnd,Re(["top:-4px;"])),c(Lh,Ih.BottomStart,Re(["top:-4px;"])),Lh),jh="Popper",Mh=Qe.div.attrs({className:Ic(jh,"root")}).withConfig({componentId:"sc-1373tsp-0"})((function(){return Re([""])})),Rh=Qe.div.attrs({className:Ic(jh,"wrapper")}).withConfig({componentId:"sc-1373tsp-1"})((function(e){return Re(["position:relative;z-index:",";"],e.zIndex)})),Dh=Qe.div.attrs({className:Ic(jh,"arrow")}).withConfig({componentId:"sc-1373tsp-2"})((function(e){var t=e.position,n=void 0===t?Ih.Right:t;return Re(["width:8px;height:8px;position:absolute;&::before{content:'';background:",";width:8px;height:8px;transform:rotate(45deg);position:absolute;top:0;left:0;z-index:-1;}",""],e.theme.palette[ut.IconsPrimary],Th[n])}));const Ah=Tc({Popper:Mh,Overlay:Qe.div.attrs({className:Ic(jh,"Overlay")}).withConfig({componentId:"sc-1373tsp-3"})((function(){return Re(["position:fixed;right:0px;bottom:0px;top:0px;left:0px;background-color:transparent;"])})),Arrow:Dh,PopperWrapper:Rh});function zh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nh(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:0;return e.map((function(e){var r,i=e.subList&&e.subList.length>0;if(b[n]===e.key&&i){var o=n+1;r=h.createElement($h,zt({key:e.key,position:"right",open:Boolean(m),anchorEl:m,enableOverlay:!1},e.subMenuProps),h.createElement(Jp,zt({list:e.subList,depth:o},d)))}return"divider"===e.content?h.createElement($p.MenuItemWrapper,{divider:!0,key:e.key}):h.createElement($p.MenuItemWrapper,{disabled:!1,key:e.key},h.createElement($p.MenuItem,zt({},d,{className:e.className,ref:t,active:Boolean(e.active),onClick:e.onClick?function(t){return e.onClick(function(e){for(var t=1;tf.width||r.height>f.height?Kh(f,r):1}})),n()};return h.createElement(h.Fragment,null,h.createElement(Gc,{className:"FIE_crop-tool-label FIE_selected-crop-preset-label"},o(u||"cropTool")),h.createElement(kp,{className:"FIE_crop-presets-opener-button",color:"link",size:"lg"},t?h.createElement(h.Fragment,null,"▴"):h.createElement(h.Fragment,null,"▾")),h.createElement($h,{className:"FIE_crop-presets-menu",anchorEl:t,enableOverlay:!0,onClose:n,open:!!t,position:"top"},g.map((function(e){var t=e.titleKey,n=e.descriptionKey,r=e.ratio,i=e.width,a=e.height,l=e.groups,s=e.icon,u=e.disableManualResize;return l?h.createElement(Ng,{key:t,titleKey:t,groups:l,Icon:s,onItemSelect:m,prefixIconDimensions:Fg,t:o,disableManualResize:u}):h.createElement(Tg,{key:r,ratio:null!=r?r:yd(i/a),titleKey:t,t:o,description:o(n),Icon:s,isActive:c===(null!=r?r:yd(i/a))&&!d,width:i,height:a,onClick:m,disableManualResize:u})}))))};Hg.defaultProps={anchorEl:null};const Bg=Hg;var Vg=function(e){var t=e.selectTool,n=e.isSelected,r=gu(),i=r.config,o=r.t,a=At((0,h.useState)(),2),l=a[0],s=a[1];return h.createElement(Xc,{className:"FIE_crop-tool",id:Ea.CROP,Icon:cf,onClick:function(e,n){t(e),s(n.currentTarget)},isSelected:n},i[Ea.CROP].noPresets?h.createElement(Gc,{className:"FIE_crop-tool-label"},o("cropTool")):h.createElement(Bg,{anchorEl:l,onClose:function(){s(null)}}))};Vg.defaultProps={isSelected:!1};const Wg=Vg;var Gg=["color","size"],Zg=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,Gg);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.0625 1.93758C24.0625 1.22909 23.5858 0.609274 22.901 0.427427C22.2163 0.245581 21.4949 0.547225 21.1434 1.16237L1.14337 39.2874C0.867028 39.771 0.869012 40.3651 1.14858 40.8468C1.42814 41.3286 1.94302 41.6251 2.5 41.6251H22.5C23.3629 41.6251 24.0625 40.9255 24.0625 40.0626V1.93758ZM20.9375 38.5001H5.19247L20.9375 7.82128V38.5001Z",fill:r}),h.createElement("path",{d:"M28.8566 1.16237C28.5051 0.547225 27.7837 0.245581 27.099 0.427428C26.4142 0.609274 25.9375 1.22909 25.9375 1.93758V4.12508H26.9504L27.3934 4.9003L28.75 4.12508H29.0625V3.94651L30.1066 3.34986L28.8566 1.16237Z",fill:r}),h.createElement("path",{d:"M35.1066 12.0999L32.6066 7.72486L29.8934 9.2753L32.3934 13.6503L35.1066 12.0999Z",fill:r}),h.createElement("path",{d:"M25.9375 8.50008V12.8751H29.0625V8.50008H25.9375Z",fill:r}),h.createElement("path",{d:"M40.1066 23.9749L37.6066 19.5999L34.8934 21.1503L37.3934 25.5253L40.1066 23.9749Z",fill:r}),h.createElement("path",{d:"M25.9375 20.3751V24.7501H29.0625V20.3751H25.9375Z",fill:r}),h.createElement("path",{d:"M45.1066 32.7249L42.6066 28.3499L39.8934 29.9003L42.3934 34.2753L45.1066 32.7249Z",fill:r}),h.createElement("path",{d:"M25.9375 29.1251V33.5001H29.0625V29.1251H25.9375Z",fill:r}),h.createElement("path",{d:"M48.8566 39.2874L47.6066 37.0999L45.1562 38.5001H45V38.5894L44.8934 38.6503L45 38.8369V41.6251H47.5C48.057 41.6251 48.5719 41.3286 48.8514 40.8468C49.131 40.3651 49.133 39.771 48.8566 39.2874Z",fill:r}),h.createElement("path",{d:"M25.9375 37.8751V40.0626C25.9375 40.9255 26.6371 41.6251 27.5 41.6251H30V38.5001H29.0625V37.8751H25.9375Z",fill:r}),h.createElement("path",{d:"M35 41.6251H40V38.5001H35V41.6251Z",fill:r}))}));var Ug={transform:"scaleX(-1)"},Xg=function(e){var t=e.selectTool,n=e.isSelected,r=e.t,i=gu(),o=i.dispatch,a=i.adjustments.isFlippedX,l=(0,h.useMemo)((function(){return{reverseLabelOfCurrXFlipDir:r(a?"unFlipX":"flipX"),reverseIconOfCurrXFlipDir:function(){return h.createElement(Zg,{style:a?Ug:void 0})}}}),[a]),s=l.reverseLabelOfCurrXFlipDir,c=l.reverseIconOfCurrXFlipDir,u=(0,h.useCallback)((function(){o({type:Vx,payload:{direction:Sa}})}),[]),d=(0,h.useCallback)((function(e){t(e),u()}),[]);return h.createElement(Xc,{className:"FIE_flip-x-tool-button",id:Ea.FLIP_X,label:s,Icon:c,onClick:d,isSelected:n})};Xg.defaultProps={isSelected:!1};const Yg=Xg;var qg=["color","size"],$g=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,qg);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.5001 24.0625C38.2086 24.0625 38.8284 23.5858 39.0102 22.901C39.1921 22.2162 38.8904 21.4948 38.2753 21.1433L3.27531 1.14333C2.79171 0.866989 2.19757 0.868973 1.71583 1.14854C1.23409 1.4281 0.937592 1.94298 0.937592 2.49996V22.5C0.937592 23.3629 1.63715 24.0625 2.50009 24.0625L37.5001 24.0625ZM4.06259 20.9375L4.06259 5.19243L31.6164 20.9375L4.06259 20.9375Z",fill:r}),h.createElement("path",{d:"M38.2753 28.8566C38.8904 28.5051 39.1921 27.7837 39.0102 27.0989C38.8284 26.4142 38.2086 25.9375 37.5001 25.9375H35.3126V26.9504L34.5374 27.3933L35.3126 28.75V29.0625H35.4912L36.0878 30.1066L38.2753 28.8566Z",fill:r}),h.createElement("path",{d:"M27.3378 35.1066L31.7128 32.6066L30.1624 29.8933L25.7874 32.3933L27.3378 35.1066Z",fill:r}),h.createElement("path",{d:"M30.9376 25.9375H26.5626L26.5626 29.0625H30.9376L30.9376 25.9375Z",fill:r}),h.createElement("path",{d:"M18.5878 40.1066L22.9628 37.6066L21.4124 34.8933L17.0374 37.3933L18.5878 40.1066Z",fill:r}),h.createElement("path",{d:"M22.1876 25.9375H17.8126V29.0625H22.1876V25.9375Z",fill:r}),h.createElement("path",{d:"M9.83781 45.1066L14.2128 42.6066L12.6624 39.8933L8.28738 42.3933L9.83781 45.1066Z",fill:r}),h.createElement("path",{d:"M13.4376 25.9375H9.0626V29.0625H13.4376V25.9375Z",fill:r}),h.createElement("path",{d:"M3.27531 48.8566L5.46281 47.6066L4.06259 45.1562V45H3.97331L3.91238 44.8933L3.72578 45H0.937592V47.5C0.937592 48.0569 1.23409 48.5718 1.71583 48.8514C2.19758 49.1309 2.79171 49.1329 3.27531 48.8566Z",fill:r}),h.createElement("path",{d:"M4.6876 25.9375L2.50009 25.9375C1.63715 25.9375 0.937592 26.637 0.937592 27.5V30H4.06259V29.0625H4.6876V25.9375Z",fill:r}),h.createElement("path",{d:"M0.937592 35V40L4.06259 40V35H0.937592Z",fill:r}))}));var Kg={transform:"scaleY(-1)"},Qg=function(e){var t=e.selectTool,n=e.isSelected,r=e.t,i=gu(),o=i.dispatch,a=i.adjustments.isFlippedY,l=(0,h.useMemo)((function(){return{reverseLabelOfCurrXFlipDir:r(a?"unFlipY":"flipY"),reverseIconOfCurrXFlipDir:function(){return h.createElement($g,{style:a?Kg:void 0})}}}),[a]),s=l.reverseLabelOfCurrXFlipDir,c=l.reverseIconOfCurrXFlipDir,u=(0,h.useCallback)((function(){o({type:Vx,payload:{direction:Oa}})}),[]),d=(0,h.useCallback)((function(e){t(e),u()}),[]);return h.createElement(Xc,{className:"FIE_flip-y-tool-button",id:Ea.FLIP_Y,label:s,Icon:c,onClick:d,isSelected:n})};Qg.defaultProps={isSelected:!1};const Jg=Qg;var em=["color","size"],tm=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,em);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{d:"M2.66029 14.6992L3.59754 14.4432L3.09234 3.93169C3.05919 3.24213 2.47333 2.71 1.78377 2.74314C1.09421 2.77628 0.562076 3.36215 0.595218 4.05171L1.16043 15.8118C1.19357 16.5014 1.77943 17.0335 2.46899 17.0004L14.2291 16.4351C14.9186 16.402 15.4508 15.8161 15.4176 15.1266C15.3845 14.437 14.7986 13.9049 14.1091 13.938L5.48449 14.3525C8.23226 7.41028 15.0052 2.5 22.925 2.5C33.2802 2.5 41.6748 10.8946 41.6748 21.2498C41.6748 22.403 41.5707 23.5319 41.3713 24.6276L43.7968 25.2605C44.0449 23.9617 44.1748 22.6209 44.1748 21.2498C44.1748 9.51386 34.6609 0 22.925 0C15.0467 0 8.16976 4.2873 4.50003 10.6561L2.66029 14.6992Z",fill:r}),h.createElement("path",{d:"M9.88493 34.7076L8.27775 36.6304C8.82615 37.1534 9.40249 37.6474 10.0043 38.1098L11.5276 36.1275C10.9528 35.6859 10.4044 35.2116 9.88493 34.7076Z",fill:r}),h.createElement("path",{d:"M12.3142 39.6562C13.9038 40.5759 15.6235 41.2956 17.439 41.7809L18.0846 39.3657C16.4846 38.938 14.9685 38.3036 13.5663 37.4923L12.3142 39.6562Z",fill:r}),h.createElement("path",{d:"M20.1654 42.3204C21.0738 42.4389 22.0002 42.5001 22.9408 42.5001C23.8815 42.5001 24.8079 42.4389 25.7163 42.3204L25.3929 39.8414C24.5915 39.946 23.7731 40.0001 22.9408 40.0001C22.1086 40.0001 21.2902 39.946 20.4888 39.8414L20.1654 42.3204Z",fill:r}),h.createElement("path",{d:"M28.4427 41.7809C30.2582 41.2956 31.9779 40.5759 33.5674 39.6562L32.3154 37.4923C30.9132 38.3036 29.3971 38.938 27.7971 39.3657L28.4427 41.7809Z",fill:r}),h.createElement("path",{d:"M35.8774 38.1098C37.3495 36.9786 38.6692 35.6589 39.8004 34.1868L37.8181 32.6635C36.8193 33.9633 35.6539 35.1287 34.3541 36.1275L35.8774 38.1098Z",fill:r}),h.createElement("path",{d:"M41.3468 31.8769C42.2665 30.2873 42.9862 28.5676 43.4715 26.7521L41.0563 26.1065C40.6286 27.7065 39.9942 29.2226 39.1829 30.6248L41.3468 31.8769Z",fill:r}))}));var nm=function(e){var t=e.selectTool,n=e.isSelected,r=e.t;return h.createElement(Xc,{className:"FIE_rotate-tool-button",id:Ea.ROTATE,label:r("rotateTool"),Icon:tm,onClick:t,isSelected:n})};nm.defaultProps={isSelected:!1};const rm=nm;var im="RotationSlider";const om=Tc({RotationSliderList:Qe.ul.attrs({className:Ic(im,"list")}).withConfig({componentId:"sc-1xuruq0-0"})(["display:flex;align-items:center;position:relative;padding:0;width:100%;list-style:none;"]),RotationSliderBigDot:Qe.li.attrs({className:Ic(im,"big-dot")}).withConfig({componentId:"sc-1xuruq0-1"})((function(e){return Re(["width:8px;height:8px;border-radius:50%;background-color:",";cursor:pointer;"],e.theme.palette[ut.LinkPrimary])})),RotationSliderSmallDotWrapper:Qe.div.attrs({className:Ic(im,"small-dot-wrapper")}).withConfig({componentId:"sc-1xuruq0-2"})(["padding:2px;"]),RotationSliderSmallDot:Qe.li.attrs({className:Ic(im,"small-dot")}).withConfig({componentId:"sc-1xuruq0-3"})((function(e){return Re(["width:2px;height:2px;border-radius:50%;background-color:",";cursor:pointer;"],e.theme.palette[ut.LinkPrimary])})),RotationSliderControl:Qe.span.attrs({className:Ic(im,"control")}).withConfig({componentId:"sc-1xuruq0-4"})((function(e){return Re(["display:flex;justify-content:center;align-items:center;position:absolute;height:18px;width:2px;transform:translate(-50%,-50%);top:50%;background-color:",";& > input{border:0px;clip:rect(0px,0px,0px,0px);height:100%;margin:-1px;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:100%;direction:ltr;}&::before{position:absolute;content:'';border-radius:inherit;width:100%;height:100%;box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%),0px 2px 2px 0px rgb(0 0 0 / 14%),0px 1px 5px 0px rgb(0 0 0 / 12%);}&::after{position:absolute;content:'';border-radius:50%;width:42px;height:42px;top:50%;left:50%;transform:translate(-50%,-50%);}"],e.theme.palette[ut.LinkActive])})),RotationSliderMark:Qe.div.attrs({className:Ic(im,"mark")}).withConfig({componentId:"sc-1xuruq0-5"})(["padding:4px;"]),RotationSliderMarkText:Qe.span.attrs({className:Ic(im,"mark-text")}).withConfig({componentId:"sc-1xuruq0-6"})((function(e){return Re(["position:absolute;top:20px;font-size:14px;transform:translateX(-10%);color:",";"],e.theme.palette[ut.TextPrimary])}))});var am=["min","max","angle","onChange","onMouseDown","onMouseUp","step","labelTooltipOptions","annotation","hideMarkText","value","railProps","trackProps","thumbProps","labelTooltipProps","markStyles","markTextStyles"];function lm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sm(e){for(var t=1;to?o:bc,d=u?60:45*c,f=u?60/c:45;return h.createElement(nv,{className:"FIE_filters-item",onClick:l,"aria-selected":i},h.createElement(rv,{className:"FIE_filters-item-preview",width:60,height:45},h.createElement(la,{onTap:l},h.createElement(ua,{image:o,filters:n?[n]:[],width:d,height:f,x:-(d-60)/2,y:-(f-45)/2,ref:a}))),h.createElement(iv,{className:"FIE_filters-item-label"},t))};ov.defaultProps={filterFn:void 0};const av=(0,h.memo)(ov);var lv=Wi.Filters,sv=[{label:"Original",filterFn:null},{label:"Invert",filterFn:lv.Invert},{label:"Black & White",filterFn:rl},{label:"Sepia",filterFn:lv.Sepia},{label:"Solarize",filterFn:lv.Solarize},{label:"Clarendon",filterFn:ol},{label:"Gingham",filterFn:ll},{label:"Moon",filterFn:cl},{label:"Lark",filterFn:fl},{label:"Reyes",filterFn:pl},{label:"Juno",filterFn:vl},{label:"Slumber",filterFn:bl},{label:"Crema",filterFn:xl},{label:"Ludwig",filterFn:Sl},{label:"Aden",filterFn:Pl},{label:"Perpetua",filterFn:Il},{label:"Amaro",filterFn:jl},{label:"Mayfair",filterFn:Dl},{label:"Rise",filterFn:Nl},{label:"Hudson",filterFn:Bl},{label:"Valencia",filterFn:Gl},{label:"X-Pro II",filterFn:Xl},{label:"Sierra",filterFn:ql},{label:"Willow",filterFn:Ql},{label:"Lo-Fi",filterFn:es},{label:"Inkwell",filterFn:lv.Grayscale},{label:"Hefe",filterFn:ns},{label:"Nashville",filterFn:os},{label:"Stinson",filterFn:ls},{label:"Vesper",filterFn:us},{label:"Earlybird",filterFn:hs},{label:"Brannan",filterFn:ms},{label:"Sutro",filterFn:ys},{label:"Toaster",filterFn:Cs},{label:"Walden",filterFn:Ss},{label:"1977",filterFn:Ps},{label:"Kelvin",filterFn:Ts},{label:"Maven",filterFn:Rs},{label:"Ginza",filterFn:As},{label:"Skyline",filterFn:Ns},{label:"Dogpatch",filterFn:Hs},{label:"Brooklyn",filterFn:Ws},{label:"Helena",filterFn:Us},{label:"Ashby",filterFn:qs},{label:"Charmes",filterFn:Qs}],cv={maxWidth:"100%",width:"100%"};const uv=function(){var e=gu().originalImage,t=At(bu(),2),n=t[0],r=t[1];return h.createElement(tv,{className:"FIE_filters",style:cv},sv.map((function(t){return h.createElement(av,{key:t.label,filterLabel:t.label,filterFn:t.filterFn,applyFilter:r,isActive:n===t.filterFn,image:e})})))};var dv=["color","size"],fv=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,dv);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{d:"M39.4229 8.89453L39.7891 16.6582H38.8613C38.6823 15.291 38.4382 14.3145 38.1289 13.7285C37.6243 12.7845 36.9489 12.0928 36.1025 11.6533C35.2725 11.1976 34.1738 10.9697 32.8066 10.9697H28.1436V36.2627C28.1436 38.2972 28.3633 39.5667 28.8027 40.0713C29.4212 40.7549 30.3734 41.0967 31.6592 41.0967H32.8066V42H18.7686V41.0967H19.9404C21.3402 41.0967 22.333 40.6735 22.9189 39.8271C23.277 39.3063 23.4561 38.1182 23.4561 36.2627V10.9697H19.4766C17.9303 10.9697 16.8317 11.0837 16.1807 11.3115C15.3343 11.6208 14.61 12.2148 14.0078 13.0938C13.4056 13.9727 13.0475 15.1608 12.9336 16.6582H12.0059L12.3965 8.89453H39.4229Z",fill:r}))}));const hv=fv;var pv=function(e){var t=e.selectTool,n=e.isSelected,r=e.t;return h.createElement(Xc,{className:"FIE_text-tool-button",id:Ea.TEXT,label:r("textTool"),Icon:fv,onClick:t,isSelected:n})};pv.defaultProps={isSelected:!1};const gv=pv;var mv=["color","size"];const vv=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,mv);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{d:"M0.214966 17.4813V0.518677H6.61123C8.82693 0.518677 10.5075 0.914783 11.653 1.70699C12.7985 2.49144 13.3712 3.64481 13.3712 5.16709C13.3712 5.99814 13.1413 6.7321 12.6814 7.36898C12.2216 7.99809 11.5819 8.46021 10.7625 8.75535C11.699 8.97282 12.4348 9.41164 12.9699 10.0718C13.5133 10.732 13.7851 11.5397 13.7851 12.4951C13.7851 14.1261 13.2249 15.361 12.1045 16.1998C10.9841 17.0386 9.38713 17.4658 7.31357 17.4813H0.214966ZM3.97748 10.0951V14.6736H7.20069C8.08697 14.6736 8.77677 14.4795 9.27007 14.0911C9.77174 13.695 10.0226 13.1513 10.0226 12.4601C10.0226 10.9067 9.1572 10.1184 7.42644 10.0951H3.97748ZM3.97748 7.62528H6.76173C8.65971 7.59421 9.6087 6.89132 9.6087 5.5166C9.6087 4.74769 9.36623 4.19625 8.88128 3.86228C8.4047 3.52054 7.64801 3.34967 6.61123 3.34967H3.97748V7.62528Z",fill:r}))}));var yv=["color","size"];const bv=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,yv);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{d:"M2.57409 19.3964H0.160461L3.42596 0.603638H5.83958L2.57409 19.3964Z",fill:r}))}));var wv=["color","size"];const Cv=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,wv);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{d:"M0.166672 0.166664H8.50001V8.5H0.166672V0.166664Z",fill:r}),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.8333 8.5H8.50001V16.8333H0.166672V25.1667H8.50001V33.5H0.166672V41.8333H8.50001V33.5H16.8333V41.8333H25.1667V33.5H33.5V41.8333H41.8333V33.5H33.5V25.1667H41.8333V16.8333H33.5V8.5H41.8333V0.166664H33.5V8.5H25.1667V0.166664H16.8333V8.5ZM16.8333 16.8333V8.5H25.1667V16.8333H16.8333ZM16.8333 25.1667V33.5H25.1667V25.1667H33.5V16.8333H25.1667V25.1667H16.8333ZM16.8333 25.1667H8.50001V16.8333H16.8333V25.1667Z",fill:r}))}));var xv=["color","size"];const Ev=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,xv);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.95831 0.458374C1.5776 0.458374 0.458313 1.57766 0.458313 2.95837V35.4584C0.458313 36.8391 1.5776 37.9584 2.95831 37.9584H7.54167V43.7917C7.54167 45.8627 9.2206 47.5417 11.2917 47.5417H43.7917C45.8627 47.5417 47.5417 45.8627 47.5417 43.7917V11.2917C47.5417 9.22059 45.8627 7.54166 43.7917 7.54166H37.9583V2.95837C37.9583 1.57766 36.839 0.458374 35.4583 0.458374H2.95831ZM35.4583 2.95837H2.95831L2.95831 35.4584H35.4583V2.95837ZM15.7267 37.9584L10.0417 43.746V37.9584H15.7267ZM11.5135 45.0417L18.4712 37.9584H28.5529L21.4696 45.0417H11.5135ZM24.4159 45.0417H34.2932L45.0417 34.1339V24.0207L37.9583 31.3242V35.4584C37.9583 36.8391 36.839 37.9584 35.4583 37.9584H31.4912C31.4689 37.9859 31.445 38.0126 31.4194 38.0382L24.4159 45.0417ZM45.0417 21.3515L37.9583 28.655V18.9107L45.0417 11.8338V21.3515ZM37.0311 45.0417H43.7917C44.482 45.0417 45.0417 44.482 45.0417 43.7917V36.9124L37.0311 45.0417ZM43.8844 10.045C43.8538 10.0428 43.8229 10.0417 43.7917 10.0417H37.9583V15.9657L43.8844 10.045Z",fill:r}))}));var Sv=["color","size"];const Ov=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,Sv);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.50015 7.9997C5.50015 6.61898 6.61944 5.49969 8.00015 5.49969H38.0002C39.3809 5.49969 40.5002 6.61898 40.5002 7.99969V37.9997C40.5002 39.3804 39.3809 40.4997 38.0002 40.4997H8.00015C6.61944 40.4997 5.50015 39.3804 5.50015 37.9997V7.9997ZM8.00015 7.99969H38.0002V37.9997H8.00015V7.99969Z",fill:r}),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.5 3C0.5 1.61929 1.61929 0.5 3 0.5H43C44.3807 0.5 45.5 1.61929 45.5 3V43C45.5 44.3807 44.3807 45.5 43 45.5H3C1.61929 45.5 0.5 44.3807 0.5 43V3ZM3 3H43V43H3V3Z",fill:r}))}));var kv=["color","size"];const Pv=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,kv);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{d:"M9.25008 9.24878H11.7501V10.9675H10.9688V11.7488H9.25008V9.24878Z",fill:r}),h.createElement("path",{d:"M9.25008 34.2488V36.7488H11.7501V35.03H10.9688V34.2488H9.25008Z",fill:r}),h.createElement("path",{d:"M34.2501 36.7488H36.7501V34.2488H35.0313V35.03H34.2501V36.7488Z",fill:r}),h.createElement("path",{d:"M36.7501 11.7488V9.24878H34.2501V10.9675H35.0313V11.7488H36.7501Z",fill:r}),h.createElement("path",{d:"M14.4063 9.24878V11.7488H17.8438V9.24878H14.4063Z",fill:r}),h.createElement("path",{d:"M21.2813 9.24878V11.7488H24.7188V9.24878H21.2813Z",fill:r}),h.createElement("path",{d:"M28.1563 9.24878V11.7488H31.5938V9.24878H28.1563Z",fill:r}),h.createElement("path",{d:"M36.7501 14.405H34.2501V17.8425H36.7501V14.405Z",fill:r}),h.createElement("path",{d:"M36.7501 21.28H34.2501V24.7175H36.7501V21.28Z",fill:r}),h.createElement("path",{d:"M36.7501 28.155H34.2501V31.5925H36.7501V28.155Z",fill:r}),h.createElement("path",{d:"M31.5938 36.7488V34.2488H28.1563V36.7488H31.5938Z",fill:r}),h.createElement("path",{d:"M24.7188 36.7488V34.2488H21.2813V36.7488H24.7188Z",fill:r}),h.createElement("path",{d:"M17.8438 36.7488V34.2488H14.4063V36.7488H17.8438Z",fill:r}),h.createElement("path",{d:"M9.25008 31.5925H11.7501V28.155H9.25008V31.5925Z",fill:r}),h.createElement("path",{d:"M9.25008 24.7175H11.7501V21.28H9.25008V24.7175Z",fill:r}),h.createElement("path",{d:"M9.25008 17.8425H11.7501V14.405H9.25008V17.8425Z",fill:r}),h.createElement("path",{d:"M23.0002 26.7497C25.0712 26.7497 26.7502 25.0708 26.7502 22.9997C26.7502 20.9286 25.0712 19.2497 23.0002 19.2497C20.9291 19.2497 19.2502 20.9286 19.2502 22.9997C19.2502 25.0708 20.9291 26.7497 23.0002 26.7497Z",fill:r}),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 0.5C1.61929 0.5 0.5 1.61929 0.5 3V43C0.5 44.3807 1.61929 45.5 3 45.5H43C44.3807 45.5 45.5 44.3807 45.5 43V3C45.5 1.61929 44.3807 0.5 43 0.5H3ZM43 3H3V43H43V3Z",fill:r}))}));var _v=Qe.div.withConfig({componentId:"sc-qvjmv1-0"})(["display:flex;align-items:center;justify-content:center;margin-top:8px;flex-wrap:wrap;"]),Lv=Qe.div.withConfig({componentId:"sc-qvjmv1-1"})(["background:",";box-shadow:0px 1px 2px ",";border-radius:2px;overflow:visible;*{font-family:'Roboto',sans-serif;}"],(function(e){return e.theme.palette["bg-secondary"]}),(function(e){return e.theme.palette["light-shadow"]})),Iv=Qe.div.withConfig({componentId:"sc-qvjmv1-2"})(["padding:8px 12px;"]),Tv=Qe(Hc).withConfig({componentId:"sc-qvjmv1-3"})(["font-weight:500;margin-bottom:12px;"]),jv=Qe.div.withConfig({componentId:"sc-qvjmv1-4"})(["display:flex;align-items:center;justify-content:space-between;"]),Mv=Qe.div.withConfig({componentId:"sc-qvjmv1-5"})(["&:not(:first-child){margin-left:12px;}"]),Rv=Qe.div.withConfig({componentId:"sc-qvjmv1-6"})((function(e){var t=e.theme,n=e.addThinBorder,r=e.noMargin,i=e.secondaryIconColor;return"\n cursor: pointer;\n padding: 3px 6px;\n margin: ".concat(r?0:"0 4px",";\n display: inline-block;\n\n svg {\n vertical-align: middle;\n margin: 0 auto;\n }\n\n ").concat(n?"border: 0.5px solid ".concat(t.palette["borders-secondary"]):"",";\n color: ").concat(i?"#959DA8":"",";\n\n &[aria-selected='true'] {\n background: ").concat(t.palette["bg-primary-active"],";\n\n * {\n color: ").concat(t.palette["accent-primary-active"],";\n }\n }\n\n :hover {\n background: ").concat(t.palette["bg-primary-active"],";\n }\n ")}));const Dv=function(e){var t=e.annotation,n=e.updateAnnotation,r=e.t,i=t.opacity;return h.createElement(Iv,null,h.createElement(Hc,null,r("opacity")),h.createElement(rf,{annotation:"%",onChange:function(e){n({opacity:Su(e/100,0,1)})},value:Math.round(100*i)}))};var Av=["color","size"],zv=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,Av);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{d:"M15.75 17.3125C15.75 16.4496 16.4496 15.75 17.3125 15.75C18.1754 15.75 18.875 16.4496 18.875 17.3125L18.875 32.9375C18.875 33.8005 18.1754 34.5 17.3125 34.5C16.4496 34.5 15.75 33.8005 15.75 32.9375L15.75 17.3125Z",fill:r}),h.createElement("path",{d:"M26.6875 15.75C25.8246 15.75 25.125 16.4496 25.125 17.3125L25.125 32.9375C25.125 33.8005 25.8246 34.5 26.6875 34.5C27.5504 34.5 28.25 33.8005 28.25 32.9375V17.3125C28.25 16.4496 27.5504 15.75 26.6875 15.75Z",fill:r}),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.625 6.37503V3.25003C12.625 1.52414 14.0241 0.125031 15.75 0.125031H28.25C29.9759 0.125031 31.375 1.52414 31.375 3.25003V6.37503H42.3125C43.1754 6.37503 43.875 7.07459 43.875 7.93753C43.875 8.80048 43.1754 9.50003 42.3125 9.50003H39.1875V40.75C39.1875 42.4759 37.7884 43.875 36.0625 43.875H7.9375C6.21161 43.875 4.8125 42.4759 4.8125 40.75V9.50003L1.6875 9.50003C0.824554 9.50003 0.125 8.80048 0.125 7.93753C0.125 7.07459 0.824555 6.37503 1.6875 6.37503H12.625ZM15.75 3.25003H28.25V6.37503H15.75V3.25003ZM7.9375 9.50003L7.9375 40.75H36.0625V9.50003H7.9375Z",fill:r}))}));const Nv=zv;var Fv=["color","size"],Hv=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,Fv);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M43.0081 15.2287L36.7869 17.6214L28.935 29.9601C30.5809 33.9266 30.3662 38.0903 27.1408 41.3158L26.5656 41.8909C25.9554 42.5011 24.9661 42.5011 24.3559 41.8909L14.4122 31.9472L2.99211 43.3673C2.38192 43.9775 1.3926 43.9775 0.782403 43.3673C0.17221 42.7571 0.172211 41.7678 0.782403 41.1576L12.2025 29.7375L2.25883 19.7938C1.64864 19.1836 1.64864 18.1943 2.25883 17.5841L2.50512 17.3378C5.73058 14.1123 10.2231 13.5688 14.1897 15.2147L26.5283 7.36283L28.9211 1.14165C29.327 0.0863053 30.6847 -0.201832 31.4843 0.597706L43.552 12.6655C44.3516 13.465 44.0634 14.8228 43.0081 15.2287ZM29.0752 9.44618L30.9747 4.50752L39.6422 13.1751L34.7035 15.0745L25.4251 29.655L26.0486 31.1577C27.234 34.0146 27.0773 36.5309 25.4342 38.5498L5.64209 18.7576C7.75439 17.2384 10.4304 17.0382 12.992 18.1011L14.4948 18.7246L29.0752 9.44618Z",fill:r}))}));var Bv=["color","size"];const Vv=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?12:i,a=g(e,Bv);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 55 55",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{d:"M3.40256 25.4517C2.58445 24.1661 3.05194 21.8287 4.45442 20.8937C5.85689 19.9587 8.31122 20.5431 9.24621 21.5949L19.6479 36.0872L40.685 4.41461C41.62 3.01213 43.9575 2.42777 45.5937 3.71337C46.7624 4.64835 47.4636 6.28457 46.6455 7.68705L21.6347 45.437C20.5829 46.6057 18.8298 46.6057 17.7779 45.437L3.40256 25.4517Z",fill:r}))}));var Wv=["children"],Gv=_c((function(e,t){var n=e.children,r=g(e,Wv);return h.createElement($p.Actions,zt({},r,{ref:t}),n&&"function"==typeof n?n({size:r.size}):n)}));Gv.displayName="MenuItemActions",Gv.defaultProps={size:Gp.Md},Gv.propTypes={size:v().oneOf(nt(Gp)),children:v().oneOfType([v().node,v().func]).isRequired};const Zv=Gv;var Uv=["children"],Xv=_c((function(e,t){var n=e.children,r=g(e,Uv);return h.createElement($p.Label,zt({},r,{ref:t}),n)}));Xv.displayName="MenuItemLabel";const Yv=Xv;var qv={Sm:"sm",Md:"md"};function $v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Kv,Qv=function(e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:qv.Md;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&e){var n=h.createElement(Zv,null,h.createElement(Vv,{size:t===qv.Md?11:9}));if(1===h.Children.count(e)){var r,i=e;return h.isValidElement(e)&&"MenuItemLabel"!==(null==e||null===(r=e.type)||void 0===r?void 0:r.displayName)&&(i=h.createElement(Yv,null,e)),h.createElement(h.Fragment,null,i,n)}if(h.Children.count(e)>1&&!h.Children.toArray(e).some((function(e){var t;return"MenuItemActions"===(null==e||null===(t=e.type)||void 0===t?void 0:t.displayName)})))return h.createElement(h.Fragment,null,e,n)}return e},Jv=function e(t){var n=t.props?t.props.children:t;return Array.isArray(n)?n.map((function(t){return e(t)})).join(" "):"object"===a(n)?e(n.props.children):n},ey=function(e){if(e&&e.children){for(var t=e.children;"string"!=typeof t;)t=Jv(t);return t}},ty=function(e){var t=e.value,n=e.multiple,r=void 0!==n&&n,i=e.children,o=[];h.Children.forEach(i,(function(e){h.isValidElement(e)&&("MenuItem"===(null==e?void 0:e.type).displayName&&Boolean(e.props)&&o.push(function(e){for(var t=1;t0?a.map(ey).join(", "):Array.isArray(t)?t.join(", "):t},ny={Primary:"primary",Secondary:"secondary"},ry=(c(Kv={},qv.Sm,(function(e){return Re(["padding:4px 8px;height:24px;",""],e.theme.typography.font[dt.InputSm])})),c(Kv,qv.Md,(function(e){return Re(["padding:8px 12px;height:30px;",""],e.theme.typography.font[dt.InputMd])})),Kv),iy=function(e){var t=e.theme.palette;return Re(["background:"," !important;border:1px solid "," !important;"],t[ut.BackgroundSecondary],t[ut.Error])},oy="Input",ay=Qe.span.attrs({className:Ic(oy,"Icon")}).withConfig({componentId:"sc-150k0cz-0"})((function(e){var t=e.iconClickStart,n=e.iconClickEnd,r=e.clearIconClick;return Re(["display:flex;color:",";cursor:",";&:first-child{margin-right:7px;}&:last-child{margin-left:10px;}"],e.theme.palette[ut.IconsPrimary],t||n||r?"pointer":"default")}));const ly=Tc({Input:Qe.div.attrs({className:Ic(oy,"root")}).withConfig({componentId:"sc-150k0cz-1"})((function(e){var t=e.size,n=void 0===t?qv.Md:t,r=e.error,i=void 0!==r&&r,o=e.fullWidth,a=void 0!==o&&o,l=e.theme,s=e.background;return Re(["position:relative;display:inline-flex;align-items:center;cursor:text;width:",";background:",";border:1px solid ",";border-radius:",";box-sizing:border-box;color:",";"," &:focus-within{background-color:","!important;border:1px solid ",";}&:hover{background-color:",";}",""],a?"100%":"300px","primary"===(void 0===s?ny.Primary:s)?l.palette[ut.BackgroundPrimary]:l.palette[ut.BackgroundSecondary],l.palette[ut.BordersSecondary],l.shape.borderRadius[ft.Sm],l.palette[ut.TextPrimary],ry[n],l.palette[ut.BackgroundSecondary],l.palette[ut.AccentPrimary],l.palette[ut.BackgroundPrimaryHover],i&&iy)})),Container:Qe.div.attrs({className:Ic(oy,"Container")}).withConfig({componentId:"sc-150k0cz-2"})((function(){return Re(["display:block;color:inherit;width:100%;min-width:0;margin:0;padding:0;border:0;background-color:transparent;outline:none;"])})),Tags:Qe.div.attrs({className:Ic(oy,"Tags")}).withConfig({componentId:"sc-150k0cz-3"})((function(){return Re(["display:inline;color:inherit;width:max-content;min-width:0;margin:0;padding:0;border:0;background-color:transparent;outline:none;"])})),Base:Qe.input.attrs({className:Ic(oy,"Base")}).withConfig({componentId:"sc-150k0cz-4"})((function(e){return Re(["display:block;color:inherit;width:100%;min-width:0;margin:0;padding:0;border:0;background-color:transparent;outline:none;&::placeholder{color:",";}"],e.theme.palette[ut.TextPlaceholder])})),Icon:ay});var sy="Select",cy=Qe.span.attrs({className:Ic(sy,"Icon")}).withConfig({componentId:"sc-mfrapg-0"})((function(e){return Re(["display:flex;flex-shrink:0;color:",";"],e.theme.palette[ut.IconsPrimary])})),uy=Qe.div.attrs({className:Ic(sy,"Container")}).withConfig({componentId:"sc-mfrapg-1"})((function(e){var t=e.fullWidth;return Re(["position:relative;display:inline-flex;",""],void 0!==t&&t?"width: 100%":"")})),dy=Qe(ly.Input).attrs({className:Ic(sy,"root")}).withConfig({componentId:"sc-mfrapg-2"})((function(e){var t=e.theme.palette,n=e.background;return Re(["cursor:pointer;user-select:none;background:",";"],"primary"===(void 0===n?ny.Primary:n)?t[ut.BackgroundPrimary]:t[ut.BackgroundSecondary])})),fy=Qe.label.attrs({className:Ic(sy,"Label")}).withConfig({componentId:"sc-mfrapg-3"})(["flex-grow:1;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;"]),hy=Qe.span.attrs({className:Ic(sy,"Placeholder")}).withConfig({componentId:"sc-mfrapg-4"})((function(e){return Re(["width:100%;color:",";"],e.theme.palette[ut.TextPlaceholder])}));const py=Tc({Container:uy,Select:dy,Label:fy,Icon:cy,Input:Qe.input.attrs({className:Ic(sy,"Input"),"aria-hidden":"true",tabindex:"-1"}).withConfig({componentId:"sc-mfrapg-5"})(["left:0;width:100%;bottom:0;opacity:0;position:absolute;pointer-events:none;box-sizing:border-box;"]),Placeholder:hy});var gy=["children","size","error","multiple","onChange","value","fullWidth","selectProps","MenuProps","readOnly","disabled","placeholder","background","renderLabel"],my=_c((function(e,t){var n=e.children,r=e.size,i=e.error,o=e.multiple,a=e.onChange,l=e.value,s=e.fullWidth,c=e.selectProps,u=e.MenuProps,d=e.readOnly,f=e.disabled,p=e.placeholder,m=e.background,v=e.renderLabel,y=g(e,gy),b=At((0,h.useState)(void 0),2),w=b[0],C=b[1],x=Boolean(w),E=function(){return C(void 0)};return h.createElement(py.Container,{ref:t,fullWidth:Boolean(s)},h.createElement(py.Select,zt({},y,{size:r,background:m,error:i,fullWidth:Boolean(s),readOnly:d,onClick:d||f?void 0:function(e){return C(e.currentTarget)}}),h.createElement(py.Label,null,"function"==typeof v?v(l):ty({value:l,multiple:o,children:n})),!l&&h.createElement(py.Placeholder,null,p),h.createElement(py.Icon,null,h.createElement(cg,{type:x?"top":"bottom",IconProps:{size:8}})),h.createElement(py.Input,c)),h.createElement($h,zt({onClose:E,open:x,anchorEl:w},u),h.Children.map(n,(function(e){return function(e,t){var n,r,i,o=t.value,a=t.multiple,l=void 0!==a&&a,s=t.size,c=void 0===s?qv.Md:s,u=t.onClose,d=t.onChange;if(!h.isValidElement(e))return e;if("MenuItem"!==(null===(n=e.type)||void 0===n?void 0:n.displayName))return h.cloneElement(e);var f=null==e||null===(r=e.props)||void 0===r?void 0:r.value,p=l?Array.isArray(o)?o:[]:[o],g=p.length>0&&p.includes(f);return h.cloneElement(e,{active:g,size:c,children:Qv(null==e||null===(i=e.props)||void 0===i?void 0:i.children,g,c),onClick:function(){if(l||"function"!=typeof u||u(),"function"==typeof d){var e=f;if(l){var t=(e=Mt(Array.isArray(o)?o:[])).indexOf(f);t>-1?e.splice(t,1):e.push(f)}d(e)}}})}(e,{value:l,multiple:o,size:r,onClose:E,onChange:d||f?void 0:a})}))))})),vy={size:qv.Md,error:!1,multiple:!1,fullWidth:!1,readOnly:!1,disabled:!1,background:ny.Primary};my.defaultProps=vy;var yy=v().oneOfType([v().string,v().number,v().oneOf([null])]),by={size:v().oneOf(nt(qv)),error:v().bool,multiple:v().bool,fullWidth:v().bool,children:v().oneOfType([v().element,v().arrayOf(v().element)]),value:v().oneOfType([v().string,v().number,v().oneOf([null]),v().arrayOf(yy)]),onChange:v().func,MenuProps:v().exact(qh),selectProps:v().object,readOnly:v().bool,disabled:v().bool,background:v().oneOf(nt(ny)),renderLabel:v().func};my.propTypes=by;const wy=my;var Cy=["children","iconStart","iconEnd","clearIcon","iconClickStart","iconClickEnd","clearIconClick","size","className","style","fullWidth","readOnly","background","focusOnMount","focusOnClick","error"],xy=_c((function(e,t){var n=e.children,r=e.iconStart,i=e.iconEnd,o=e.clearIcon,a=e.iconClickStart,l=e.iconClickEnd,s=e.clearIconClick,c=e.size,u=e.className,d=e.style,f=e.fullWidth,p=e.readOnly,m=e.background,v=void 0===m?"primary":m,y=e.focusOnMount,b=void 0!==y&&y,w=e.focusOnClick,C=void 0===w||w,x=e.error,E=g(e,Cy),S=(0,h.useRef)(null),O=E.value?"":E.placeholder,k=function(){var e;null===(e=S.current)||void 0===e||e.focus()};(0,h.useEffect)((function(){b&&k()}),[]);var P=function(e,t){return e?h.createElement(ly.Icon,{onClick:function(e){return function(e,t){C&&k(),"start"===t?a&&a():"end"===t?l&&l():s&&s(e)}(e,t)},iconClickStart:a,iconClickEnd:l,clearIconClick:s},"function"==typeof e?e({size:(n=c,n===qv.Md?16:14)}):e):void 0;var n};return h.createElement(ly.Input,{onClick:C?k:void 0,ref:t,size:c,className:u,style:d,fullWidth:Boolean(f),background:v,error:x},P(r,"start"),h.createElement(ly.Base,zt({},E,{placeholder:O,ref:S,readOnly:Boolean(p)})),P(o,"secondEnd"),P(i,"end"),n&&h.createElement(h.Fragment,null,n))})),Ey={size:qv.Md,background:ny.Primary,error:!1,fullWidth:!1,readOnly:!1};xy.defaultProps=Ey;var Sy={size:v().oneOf(nt(qv)),iconStart:v().oneOfType([v().node,v().func]),iconEnd:v().oneOfType([v().node,v().func]),clearIcon:v().node,error:v().bool,fullWidth:v().bool,value:v().any,readOnly:v().bool,iconClickStart:v().func,iconClickEnd:v().func,clearIconClick:v().func,background:v().oneOf(nt(ny)),focusOnMount:v().bool,focusOnClick:v().bool};xy.propTypes=Sy;const Oy=xy;const ky=function(e,t,n){var r=function(t){var n;"function"==typeof e&&e((null===(n=t.touches)||void 0===n?void 0:n[0])||t)},i=function e(t){var i;(document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",e),document.removeEventListener("mouseleave",e),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",e),document.removeEventListener("touchcancel",e),"function"==typeof n)&&n((null===(i=t.touches)||void 0===i?void 0:i[0])||t)},o=function(e){var n;(document.addEventListener("mousemove",r),document.addEventListener("mouseup",i),document.addEventListener("mouseleave",i),document.addEventListener("touchmove",r),document.addEventListener("touchend",i),document.addEventListener("touchcancel",i),"function"==typeof t)&&t((null===(n=e.touches)||void 0===n?void 0:n[0])||e)};return{onMouseDown:o,onTouchStart:o}};var Py=function(e){return e.replaceAll(/[^\d,]/gi,"").split(",").map((function(e){return+e}))},_y=function(e){return e?[Number.parseInt(e.slice(1,3),16),Number.parseInt(e.slice(3,5),16),Number.parseInt(e.slice(5,7),16)]:[0,0,0]},Ly=function(e){return e.toString(16).padStart(2,"0")},Iy=function(){for(var e=arguments.length,t=new Array(e),n=0;n.5?d/(2-c-s):d/(c+s),c){case r:a=(i-o)/d+(i1&&void 0!==arguments[1]?arguments[1]:0,n=(arguments.length>2?arguments[2]:void 0)||1e6,r=+e;return Math.min(Math.max(t,r),n)}function Hy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function By(e){for(var t=1;t .item{margin-right:8px;display:flex;justify-content:center;}"]),ColorItemWrapper:Jy,Select:Qe.div.attrs({className:Ic(Vy,"select")}).withConfig({componentId:"sc-qj4xo5-12"})((function(e){return Re(["width:",";"],"rgb"===e.value?"25%":"35%")}))});var tb=_c((function(e,t){var n=e.value,r=e.onChange,i=e.checked,o=e.size,a=void 0===o?24:o,l=(0,h.useMemo)((function(){return"#ffffff"===n||"rgba(0,0,0,0)"===n?"black":"white"}),[n]);return h.createElement(eb.ColorItemWrapper,{ref:t,color:n,size:a,stroke:"rgba(0,0,0,0)"===n?"#a8a8a8":"#E9EEF2",value:n},h.createElement("input",{type:"radio",value:n,checked:i,onChange:r}),i&&h.createElement(Vv,{color:l}))}));tb.defaultProps={},tb.propTypes={value:v().string.isRequired,checked:v().bool,onChange:v().func.isRequired,size:v().number};const nb=tb;var rb=["defaultColor","onChange","pinnedColors","showTransparentColor"];function ib(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ob(e){for(var t=1;t255||Number.isNaN(e))){var n=P;n[t]=e;var r=Iy.apply(void 0,Mt(n));_(Mt(n)),Ay(r)&&(b(ob(ob({},y),{},{color:r})),V(r))}}(Number(null===(n=e.target)||void 0===n?void 0:n.value),t)},style:{width:"20%"}})})),y.color!==lb&&h.createElement(eb.ColorPickerIcon,{onClick:function(){return C.some((function(e){return N(e)}))?B(y.color,"delete"):B(y.color,"add")}},C.some((function(e){return N(e)}))?h.createElement(zv,null):h.createElement(Hv,null))))}));sb.defaultProps={defaultColor:"#000000",pinnedColors:[],showTransparentColor:!1},sb.propTypes={defaultColor:v().string,onChange:v().func,pinnedColors:v().array,showTransparentColor:v().bool};const cb=sb;var ub=Qe.div.attrs((function(e){var t=e.$color;return{style:{background:"rgba(0,0,0,0)"===t?"repeating-conic-gradient(#5d6d7e 0% 25%, transparent 0% 50%) 50% / 8px 8px":t}}})).withConfig({componentId:"sc-zmv0gj-0"})(["background:",";border-radius:2px;width:24px;height:24px;border:2px solid ",";cursor:pointer;box-sizing:border-box;"],(function(e){return e.theme.palette["icons-primary"]}),(function(e){return e.theme.palette["borders-strong"]})),db=Qe(cb).withConfig({componentId:"sc-zmv0gj-1"})(["max-width:212px;"]),fb="FIE_pinnedColors",hb=function(e){var t,n=e.position,r=void 0===n?"top":n,i=e.onChange,o=e.color,a=e.colorFor,l=gu(),s=l.selectionsIds,u=void 0===s?[]:s,d=l.config.annotationsCommon,f=void 0===d?{}:d,p=l.dispatch,g=l.latestColors,m=(void 0===g?{}:g)[a],v=At((0,h.useState)(),2),y=v[0],b=v[1],w=At((0,h.useState)((function(){return m||o||f.fill})),2),C=w[0],x=w[1],E=At((0,h.useState)(null!==(t=window)&&void 0!==t&&t.localStorage?JSON.parse(localStorage.getItem(fb)||"[]"):[]),2),S=E[0],O=E[1],k=function(e){b(y?null:e.currentTarget)};return(0,h.useEffect)((function(){var e=0===u.length&&m||o;x(e),i(e)}),[o,u]),h.createElement(h.Fragment,null,h.createElement(ub,{className:"FIE_color-picker-triggerer",onClick:k,$color:C,onChange:i}),h.createElement(Bh,{className:"FIE_color-picker",anchorEl:y,open:!!y,position:r,onClick:k,overlay:!0,zIndex:11111},h.createElement(db,{onChange:function(e,t,n){x(t),i(t),function(e){var t;if(null!==(t=window)&&void 0!==t&&t.localStorage){var n=window.localStorage.getItem(fb);if(JSON.stringify(e)!==n){var r=e.slice(-9);window.localStorage.setItem(fb,JSON.stringify(r)),O(r)}}}(n),m!==t&&p({type:ZE,payload:{latestColors:c({},a,t)}})},defaultColor:C,pinnedColors:S,showTransparentColor:!0})))};hb.defaultProps={position:"top",color:void 0};const pb=hb;const gb=function(e){var t=e.annotation,n=e.updateAnnotation,r=e.t,i=t.stroke,o=t.strokeWidth;return h.createElement(Iv,null,h.createElement(Hc,null,r("stroke")),h.createElement(rf,{annotation:"px",onChange:function(e){n({strokeWidth:Su(e,0,100)})},value:o}),h.createElement(pb,{color:i,onChange:function(e){n({stroke:e})},colorFor:"stroke"}))};const mb=function(e){var t=e.annotation,n=e.updateAnnotation,r=e.t,i=t.shadowOffsetX,o=t.shadowOffsetY,a=t.shadowBlur,l=t.shadowColor,s=t.shadowOpacity,u=function(e,t){n(c({},e,Su(t,2v){var r=y*x/e.height;n.height=e.height*r,n.width=n.height*t}else{var a=v*x/e.width;n.width=e.width*a,n.height=n.width/t}var l=$C($C($C($C({},i.annotationsCommon),i[Ea.IMAGE]),n),{},{padding:1,image:e,x:b+v/2-n.width/2,y:w+y/2-n.height/2,id:KC,name:Ea.IMAGE,replaceCurrent:!0});o({type:yx,payload:l})},S=function(e){o({type:yx,payload:$C($C({},"function"==typeof e?e(m):e),{},{id:KC})})},O=[!i.useCloudimage&&{key:"upload-watermark",label:a("uploadWatermark"),icon:uw,onClick:function(){p.current&&p.current.click()}},{key:"add-text-watermark",label:a("addWatermarkAsText"),icon:hv,onClick:function(){var e={height:y*C,width:v*C},t=$C($C($C($C({},i.annotationsCommon),i[Ea.TEXT]),e),{},{padding:1,x:b+v/2-e.width/2,y:w+y/2-e.height/2,fill:"#000000",id:KC,name:Ea.TEXT,replaceCurrent:!0});o({type:yx,payload:t})}}];(0,h.useEffect)((function(){m&&(o({type:Ix}),o({type:kx,payload:{annotationId:"watermark"}}))}),[m]),(0,h.useEffect)((function(){m&&(0===r.length||r[0].id!==KC)&&o({type:kx,payload:{annotationId:"watermark"}})}),[r]);var k=function(){return h.createElement(YC,{watermark:m,saveWatermark:S,t:a})};return h.createElement("div",{className:"FIE_watermark-tool-wrapper"},(null==m?void 0:m.name)===Ea.TEXT&&h.createElement(VC,{className:"FIE_watermark-options-wrapper"},h.createElement(iw,{text:m,saveText:S,t:a},k())),(null==m?void 0:m.name)===Ea.IMAGE&&h.createElement(VC,{className:"FIE_watermark-options-wrapper"},h.createElement(Dw,{image:m,saveImage:S,t:a},k())),h.createElement(BC,{className:"FIE_watermark-add-wrapper",noWrap:!(null==m||!m.name)},h.createElement(Mw,{className:"FIE_watermark-add",color:"secondary",label:a(O[0]?"addWatermark":"addTextWatermark"),title:a("addWatermarkTitle"),menuPosition:"top",menuItems:O,menuFromBtn:!0}),h.createElement(ZC,{selectWatermark:E,style:c&&null!=m&&m.name?{width:"55%"}:void 0}),h.createElement(pw,{onChange:d?void 0:function(e){if(e.target.files){f(!0);var t=e.target.files[0];if(t.type.startsWith("image/")){var n=new Image;n.onload=function(){E(n),URL.revokeObjectURL(t),f(!1)},n.onerror=function(){(function(e){o({type:bc,payload:{feedback:{message:e,status:Na}}})})(a("uploadImageError")),f(!1)},n.src=URL.createObjectURL(t)}}e.target.value=""},disabled:d,ref:p})))};var JC,ex,tx=(c(JC={},Ea.CROP,{id:Ea.CROP,Item:Wg}),c(JC,Ea.ROTATE,{id:Ea.ROTATE,Item:rm,ItemOptions:gm}),c(JC,Ea.FLIP_X,{id:Ea.FLIP_X,Item:Yg}),c(JC,Ea.FLIP_Y,{id:Ea.FLIP_Y,Item:Jg}),c(JC,Ea.BRIGHTNESS,{id:Ea.BRIGHTNESS,Item:qc,ItemOptions:lf}),c(JC,Ea.CONTRAST,{id:Ea.CONTRAST,Item:bm,ItemOptions:xm}),c(JC,Ea.HSV,{id:Ea.HSV,Item:km,ItemOptions:Im,hideFn:function(e){return e.useCloudimage}}),c(JC,Ea.BLUR,{id:Ea.BLUR,Item:Rm,ItemOptions:zm}),c(JC,Ea.WARMTH,{id:Ea.WARMTH,Item:Bm,ItemOptions:Gm,hideFn:function(e){return e.useCloudimage}}),c(JC,Ea.FILTERS,{id:Ea.FILTERS,Item:uv}),c(JC,Ea.WATERMARK,{id:Ea.WATERMARK,Item:QC}),c(JC,Ea.TEXT,{id:Ea.TEXT,Item:gv,ItemOptions:ow}),c(JC,Ea.IMAGE,{id:Ea.IMAGE,Item:lw,ItemOptions:Hw}),c(JC,Ea.RECT,{id:Ea.RECT,Item:Gw,ItemOptions:$w}),c(JC,Ea.POLYGON,{id:Ea.POLYGON,Item:CC,ItemOptions:PC}),c(JC,Ea.ELLIPSE,{id:Ea.ELLIPSE,Item:Qw,ItemOptions:Jw}),c(JC,Ea.PEN,{id:Ea.PEN,Item:rC,ItemOptions:lC}),c(JC,Ea.LINE,{id:Ea.LINE,Item:dC,ItemOptions:fC}),c(JC,Ea.ARROW,{id:Ea.ARROW,Item:mC,ItemOptions:vC}),c(JC,Ea.RESIZE,{id:Ea.RESIZE,Item:HC}),JC),nx=(c(ex={},xa.ADJUST,[Ea.CROP,Ea.ROTATE,Ea.FLIP_X,Ea.FLIP_Y]),c(ex,xa.FINETUNE,[Ea.BRIGHTNESS,Ea.CONTRAST,Ea.HSV,Ea.BLUR,Ea.WARMTH]),c(ex,xa.FILTERS,[Ea.FILTERS]),c(ex,xa.WATERMARK,[Ea.WATERMARK]),c(ex,xa.ANNOTATE,[Ea.TEXT,Ea.IMAGE,Ea.RECT,Ea.ELLIPSE,Ea.POLYGON,Ea.PEN,Ea.LINE,Ea.ARROW]),c(ex,xa.RESIZE,[Ea.RESIZE]),ex);function rx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ix(e){for(var t,n=1;nt.factor,o=(e.x-t.x||0)/t.factor,a=(e.y-t.y||0)/t.factor,l={x:e.x-o*e.factor,y:e.y-a*e.factor};if(i&&1===t.factor||(l.x=Math.min(0,Math.max(l.x,n*(1-t.factor))),l.y=Math.min(0,Math.max(l.y,r*(1-t.factor)))),1>e.factor){var s=n-n*e.factor,c=r-r*e.factor;l.x+=s/2,l.y+=c/2}return Jx(Jx({},l),{},{factor:e.factor})};var tE=["preparedDimensions"];function nE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rE(e){for(var t,n=1;no.x+o.width&&(a.width=o.x+o.width-a.x),a.y+a.height>o.y+o.height&&(a.height=o.y+o.height-a.y),r&&!ZS(a.width/a.height,r)){var l=a.height*r,s=a.width/r;yd(a.y+s)<=o.y+o.height?a.height=s:a.width=l}return(i.minWidth&&a.width<=i.minWidth||i.maxWidth&&a.width>=i.maxWidth)&&(a.width=Su(a.width,i.minWidth,i.maxWidth),a.x=e.x,a.y=e.y,r&&(a.height=a.width/r)),(i.minHeight&&t.height<=i.minHeight||i.maxHeight&&t.height>=i.maxHeight)&&(a.height=Su(a.height,i.minHeight,i.maxHeight),a.x=e.x,a.y=e.y,r&&(a.width=a.height*r)),a};function YS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qS(e){for(var t,n=1;n=p.width&&c.height>=p.height;p.width&&p.height&&(ro.scaledBy?o.scaledBy:1,j=qS(qS({},o),{},{width:o.width/T,height:o.height/T});_=XS(j,qS(qS({},j),{},{x:0,y:0}),qS(qS({},j),{},{abstractX:0,abstractY:0}),!(E||S)&&O(),C)}var M=_,R=M.x,D=void 0===R?0:R,A=M.y,z=void 0===A?0:A,N=M.width,F=M.height,H={x:u?o.width-D-N:D,y:d?o.height-z-F:z,ref:v,fill:"#FFFFFF",scaleX:1,scaleY:1,globalCompositeOperation:"destination-out",onDragEnd:I,onDragMove:function(e){var t=e.target;t.setAttrs(function(e,t){var n=t.width-(2*e.radiusX||e.width),r=t.height-(2*e.radiusY||e.height);return{x:yd(Math.min(Math.max(e.x,0),n)),y:yd(Math.min(Math.max(e.y,0),r))}}(t.attrs,w.current))},onTransformEnd:I,draggable:!0};return h.createElement(h.Fragment,null,h.createElement(ua,{image:i,x:u?o.width:0,y:d?o.height:0,width:o.width,height:o.height,filters:[Wi.Filters.Blur,Wi.Filters.Brighten],blurRadius:10,brightness:-.3,scaleX:u?-1:1,scaleY:d?-1:1,ref:b}),S?h.createElement(ca,zt({},H,{radiusX:N/2,radiusY:F/2,offset:{x:-N/2,y:-F/2}})):h.createElement(sa,zt({},H,{width:N,height:F})),h.createElement(da,{centeredScaling:!1,flipEnabled:!1,rotateEnabled:!1,nodes:v.current?[v.current]:[],anchorSize:14,anchorCornerRadius:7,enabledAnchors:L,ignoreStroke:!1,anchorStroke:n.palette["accent-primary"],anchorFill:n.palette["access-primary"],anchorStrokeWidth:2,borderStroke:n.palette["accent-primary"],borderStrokeWidth:2,borderDash:[4],keepRatio:!E||!S,ref:y,boundBoxFunc:function(e,t){return XS(e,t,w.current,!(E||S)&&O(),C)}}))};const QS=function(){var e,t=gu(),n=t.selectionsIds,r=void 0===n?[]:n,i=t.theme,o=t.designLayer,a=t.dispatch,l=t.config.useCloudimage,s=(0,h.useMemo)((function(){return null!=o&&o.findOne?r.map((function(e){return o.findOne("#".concat(e))})).filter(Boolean):[]}),[r]),c=function(){1===s.length&&s[0].name()===Ea.TEXT&&a({type:_E,payload:{textIdOfEditableContent:s[0].id()}})};return h.createElement(da,{id:ba,centeredScaling:!1,rotationSnaps:[0,45,90,135,180,225,270,315],nodes:s,rotateAnchorOffset:30,anchorSize:14,anchorCornerRadius:7,padding:1===s.length&&null!==(e=s[0].attrs.padding)&&void 0!==e?e:1,ignoreStroke:!1,anchorStroke:i.palette["accent-primary"],anchorFill:i.palette["access-primary"],anchorStrokeWidth:2,borderStroke:i.palette["accent-primary"],borderStrokeWidth:2,borderDash:[4],rotateEnabled:!l,onMouseOver:function(){a({type:xx,payload:{pointerCssIcon:La.MOVE}})},onMouseLeave:function(){a({type:xx,payload:{pointerCssIcon:La.DRAW}})},onDblClick:c,onDblTap:c,flipEnabled:!0,shouldOverdrawWholeArea:!0})};const JS=function(){var e=gu(),t=e.toolId,n=e.shownImageDimensions;return h.createElement(la,{id:va,x:n.abstractX||0,y:n.abstractY||0},h.createElement(QS,null),t===Ea.CROP&&h.createElement(KS,null))};var eO=["color","size"];const tO=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,eO);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.312012 34.847V3.39883C0.312012 1.67294 1.71112 0.273834 3.43701 0.273834H26.807C28.5329 0.273834 29.932 1.67294 29.932 3.39883V34.847C29.932 36.5729 28.5329 37.972 26.807 37.972H3.43701C1.71112 37.972 0.312012 36.5729 0.312012 34.847ZM3.43701 34.847V3.39883L26.807 3.39883L26.807 34.847L3.43701 34.847Z",fill:r}),h.createElement("path",{d:"M35.6874 12.5434C35.6874 11.6805 34.9878 10.9809 34.1249 10.9809C33.2619 10.9809 32.5624 11.6805 32.5624 12.5434V40.6009H9.89033C9.02739 40.6009 8.32783 41.3005 8.32783 42.1634C8.32783 43.0263 9.02739 43.7259 9.89033 43.7259H34.1249C34.9878 43.7259 35.6874 43.0263 35.6874 42.1634V12.5434Z",fill:r}))}));var nO=Qe.div.withConfig({componentId:"sc-1tst9ex-0"})((function(e){var t=e.theme,n=e.top,r=e.left;return"\n position: absolute;\n z-index: 1;\n background: ".concat(t.palette["bg-secondary"],";\n border-radius: 2px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0px 1px 2px ").concat(t.palette["light-shadow"],";\n top: ").concat((n||0)+8,"px;\n left: ").concat((r||0)+4,"px;\n transform: translateX(-50%);\n height: 32px;\n")}));const rO=function(){var e=gu(),t=e.selectionsIds,n=void 0===t?[]:t,r=e.designLayer,i=e.annotations,o=e.dispatch,a=At((0,h.useState)({left:0,top:0}),2),l=a[0],s=a[1],c=(0,h.useMemo)((function(){var e;return null==r||null===(e=r.getStage())||void 0===e?void 0:e.findOne("#".concat(ba))}),[r]),u=n.length,d=Cu((function(){c&&s({left:(c.x()+c.width()/2)*c.scaleX(),top:(c.y()+c.height())*c.scaleY()})}),0);return(0,h.useEffect)((function(){d()}),[n,c,i]),0!==u&&c?h.createElement(nO,{className:"FIE_annotation-controls-overlay",left:l.left,top:l.top},n[0]!==wa&&h.createElement(Pw,{color:"link",size:"sm",onClick:function(){o({type:SE,payload:{annotationsIds:n}})}},h.createElement(tO,null)),h.createElement(Pw,{color:"link",size:"sm",onClick:function(){o({type:wE,payload:{annotationsIds:n}})}},h.createElement(Nv,null))):null};function iO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oO(e){for(var t,n=1;n1),2),C=w[0],x=w[1],E=(0,h.useMemo)((function(){return{cursor:o===La.DEFAULT&&a===xa.ANNOTATE?La.DRAW:o}}),[a,o]),S=function(e){i({type:iE,payload:e})},O=(0,h.useCallback)((function(e){var t,n;e.evt.preventDefault(),null===(t=(n=e.currentTarget).container)||void 0===t||t.call(n).focus(),e.target instanceof Wi.Stage&&01&&b&&(e.preventDefault(),x(!0),i({type:xx,payload:{pointerCssIcon:La.DRAG}}))},_=function(e){"Space"===e.code&&(e.preventDefault(),k())},L=function(){n.current&&n.current.container().focus()};(0,h.useEffect)((function(){i({type:xx,payload:{pointerCssIcon:La[C?"DRAG":"DEFAULT"]}})}),[C]),(0,h.useEffect)((function(){var e;return x(a!==xa.ANNOTATE&&a!==xa.WATERMARK&&g.factor>1),n.current&&((e=n.current.container()).addEventListener("mouseenter",L),e.addEventListener("keydown",P),e.addEventListener("keyup",_)),function(){e&&(e.removeEventListener("mouseenter",L),e.removeEventListener("keydown",P),e.removeEventListener("keyup",_))}}),[a,g.factor,1]);var I=u*(b&&g.factor||1);return h.createElement(fO,{className:"FIE_canvas-node",tabIndex:-1,ref:n,width:s,height:c,scaleX:I,scaleY:I,x:b&&g.x||null,y:b&&g.y||null,zoomFactor:b&&g.factor||1,onWheel:b?function(e){e.evt.preventDefault();var t=(g.factor||1)+-.006*e.evt.deltaY,n=e.currentTarget.getPointerPosition();S(pO(pO({},n),{},{factor:t}))}:void 0,onTap:O,onClick:O,onTouchMove:b?function(e){return cO(e,S)}:void 0,onDragStart:function(e){var t;1<(null===(t=e.evt.touches)||void 0===t?void 0:t.length)&&x(!1)},onTouchEnd:b?function(){!function(e){sO=0,lO=null,"function"==typeof e&&e()}(k)}:void 0,dragBoundFunc:function(e){return{x:Math.min(0,Math.max(e.x,s*(1-g.factor))),y:Math.min(0,Math.max(e.y,c*(1-g.factor)))}},draggable:b&&C,onDragEnd:function(e){e.currentTarget.draggable()&&"stage"===e.target.nodeType.toLowerCase()&&b&&C&&S({factor:g.factor,x:e.target.x(),y:e.target.y(),preparedDimensions:!0})},style:E},t)}));const mO=function(){var e=At(id(),1)[0],t=gu(),n=(0,h.useRef)(null),r=(0,h.useCallback)((function(e){var n=e.width,r=e.height;t.dispatch({type:sE,payload:{canvasWidth:n,canvasHeight:r}})}),[]);return(0,h.useEffect)((function(){e(n.current,r)}),[]),h.createElement(uO,{className:"FIE_canvas-container",ref:n},!t.textIdOfEditableContent&&h.createElement(rO,null),t.isShowOriginalImage&&h.createElement(dO,{className:"FIE_original-image-compare",src:t.originalImage.src}),h.createElement(gO,null,h.createElement(hu,{overridingValue:t},h.createElement(GS,null),h.createElement(JS,null))))};var vO=Qe.div.withConfig({componentId:"sc-etsyb6-0"})(["display:inline-block;height:",";width:",";border-radius:1px;background:#dfe7ed;"],(function(e){return e.height}),(function(e){return e.width})),yO=function(e){var t=e.height,n=e.width;return h.createElement(vO,{height:t,width:n})};yO.defaultProps={height:"11px",width:"1px"};const bO=yO;var wO=["color","size"];const CO=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,wO);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{d:"M29.5089 27.2774C30.1253 27.8938 30.1253 28.8932 29.5089 29.5096C28.8925 30.126 27.8932 30.126 27.2768 29.5096L15.0002 17.2327L2.72342 29.5097C2.10703 30.1261 1.10767 30.1261 0.491282 29.5097C-0.125105 28.8934 -0.125105 27.894 0.491283 27.2776L12.7681 15.0006L0.491159 2.72344C-0.125226 2.10704 -0.125228 1.10766 0.49116 0.49126C1.10755 -0.125138 2.10691 -0.125139 2.72329 0.49126L15.0002 12.7684L27.2769 0.491449C27.8933 -0.124948 28.8927 -0.12495 29.5091 0.491449C30.1254 1.10785 30.1254 2.10723 29.5091 2.72363L17.2323 15.0006L29.5089 27.2774Z",fill:r}))}));var xO=Qe.div.withConfig({componentId:"sc-21g986-0"})(["padding:12px 12px 8px 12px;box-sizing:border-box;position:relative;width:100%;display:flex;align-items:center;justify-content:space-between;",";[data-phone='true'] &{padding:6px 6px 4px 6px;}overflow:auto;"],(function(e){return e.reverseDirection?"flex-direction: row-reverse":""})),EO=Qe.div.withConfig({componentId:"sc-21g986-1"})(["display:flex;margin:0 4px;column-gap:4px;align-items:center;"]),SO=Qe(Pw).withConfig({componentId:"sc-21g986-2"})(["margin:",";display:flex;justify-content:center;align-items:center;width:16px;height:16px;padding:2px;"],(function(e){var t=e.margin;return null!=t?t:"0 4px"})),OO=Qe(Hc).withConfig({componentId:"sc-21g986-3"})(["flex-shrink:0;"]),kO=Qe(Pw).withConfig({componentId:"sc-21g986-4"})(["width:20px;height:20px;margin:0 ",";padding:4px;"],(function(e){var t;return null!==(t=e.horizontalMargin)&&void 0!==t?t:"4px"})),PO=Qe.div.withConfig({componentId:"sc-21g986-5"})(["display:flex;align-items:center;",";"],(function(e){return e.reverseDirection?"flex-direction: row-reverse":""})),_O=Qe(Hc).withConfig({componentId:"sc-21g986-6"})(["cursor:pointer;"]),LO=Qe.span.withConfig({componentId:"sc-21g986-7"})(["font-size:11px;line-height:12px;"]),IO=Qe(Pw).withConfig({componentId:"sc-21g986-8"})(["padding:0;z-index:111;"]),TO=(Qe(Op).withConfig({componentId:"sc-21g986-9"})(["padding:4px 12px;"]),Qe(Oy).withConfig({componentId:"sc-21g986-10"})(["width:200px;"])),jO=Qe(wy).withConfig({componentId:"sc-21g986-11"})(["width:60px;margin-left:4px;"]),MO=Qe.div.withConfig({componentId:"sc-21g986-12"})(["width:100%;margin-top:8px;"]),RO=Qe.div.withConfig({componentId:"sc-21g986-13"})(["margin-top:8px;width:100%;"]);const DO=function(){var e=gu(),t=e.haveNotSavedChanges,n=e.config.onClose;return"function"!=typeof n?h.createElement("span",null):h.createElement(IO,{className:"FIE_topbar-close-button",color:"link",size:"sm",onClick:function(){n(za,t)}},n&&h.createElement(CO,null))};var AO=["color","size"];const zO=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,AO);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{d:"M17.3945 21.1062H8.60547C8.20098 21.1062 7.87305 21.4342 7.87305 21.8387C7.87305 22.2431 8.20098 22.5711 8.60547 22.5711H17.3945C17.799 22.5711 18.127 22.2431 18.127 21.8387C18.127 21.4342 17.799 21.1062 17.3945 21.1062Z",fill:r}),h.createElement("path",{d:"M17.3945 15.2469H8.60547C8.20098 15.2469 7.87305 15.5748 7.87305 15.9793C7.87305 16.3838 8.20098 16.7117 8.60547 16.7117H17.3945C17.799 16.7117 18.127 16.3838 18.127 15.9793C18.127 15.5748 17.799 15.2469 17.3945 15.2469Z",fill:r}),h.createElement("path",{d:"M17.3945 18.1765H8.60547C8.20098 18.1765 7.87305 18.5045 7.87305 18.909C7.87305 19.3135 8.20098 19.6414 8.60547 19.6414H17.3945C17.799 19.6414 18.127 19.3135 18.127 18.909C18.127 18.5045 17.799 18.1765 17.3945 18.1765Z",fill:r}),h.createElement("path",{d:"M16.6621 0.5H6.4082V6.84766H16.6621V0.5Z",fill:r}),h.createElement("path",{d:"M25.2854 4.6208L21.3792 0.714551C21.2418 0.577197 21.0556 0.5 20.8613 0.5H18.127V7.58008C18.127 7.98457 17.799 8.3125 17.3945 8.3125H5.67578C5.27129 8.3125 4.94336 7.98457 4.94336 7.58008V0.5H1.23242C0.82793 0.5 0.5 0.82793 0.5 1.23242V24.7676C0.5 25.1721 0.82793 25.5 1.23242 25.5C1.45923 25.5 24.463 25.5 24.7676 25.5C25.1721 25.5 25.5 25.1721 25.5 24.7676V5.13867C25.5 4.94443 25.4228 4.75815 25.2854 4.6208ZM19.5918 24.0352H6.4082V13.7812H19.5918V24.0352Z",fill:r}))}));const NO=function(e){return 0>=e||1 *:not(:first-child){margin-left:8px;}"],n===ik.Right?"flex-end":n)}))});var ak=["children"],lk=_c((function(e,t){var n=e.children,r=g(e,ak);return h.createElement(ok.ModalActions,zt({},r,{ref:t}),n)}));lk.defaultProps={align:ik.Center},lk.propTypes={children:v().node.isRequired,align:v().oneOf(nt(ik))},lk.displayName="ModalActions";const sk=lk;var ck=["color","size"];const uk=Oc((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,o=void 0===i?14:i,a=g(e,ck);return h.createElement("svg",zt({ref:t,width:o,height:o,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),h.createElement("path",{d:"M29.9081 25.0577L45.8451 9.12074C46.5381 8.42782 46.8845 7.61942 46.8845 6.58005C46.8845 5.54068 46.5381 4.73228 45.8451 4.03937C44.4593 2.65354 42.1496 2.65354 40.8793 4.03937L24.9423 20.0919L9.00525 4.15486C7.61942 2.76903 5.4252 2.76903 4.03937 4.15486C3.34646 4.84777 3 5.65617 3 6.58005C3 7.50394 3.34646 8.42782 4.03937 9.12074L19.9764 25.0577L4.03937 40.9948C3.34646 41.6877 3 42.4961 3 43.42C3 44.3438 3.34646 45.2677 4.03937 45.9606C5.4252 47.3465 7.73491 47.3465 9.00525 45.9606L24.9423 30.0236L40.8793 45.9606C41.5722 46.6535 42.3806 47 43.42 47C44.4593 47 45.2677 46.6535 45.9606 45.9606C46.6535 45.2677 47 44.4593 47 43.42C47 42.3806 46.6535 41.5722 45.9606 40.8793L29.9081 25.0577Z",fill:r}))}));var dk={Default:"default",WithIcon:"with-icon"},fk="ModalTitle",hk=Qe.div.attrs({className:Ic(fk,"Icon")}).withConfig({componentId:"sc-l3tf49-0"})((function(e){var t=e.theme.palette;return Re(["display:flex;margin-bottom:8px;padding:12.5px;border-radius:50%;background:",";color:",";"],t[ut.BackgroundPrimary],t[ut.AccentPrimary])})),pk=Qe.div.attrs({className:Ic(fk,"LabelPrimary")}).withConfig({componentId:"sc-l3tf49-1"})((function(){return Re(["font-size:16px;line-height:18px;"])})),gk=Qe.div.attrs({className:Ic(fk,"LabelSecondary")}).withConfig({componentId:"sc-l3tf49-2"})(["font-size:12px;line-height:14px;margin-top:4px;"]),mk=Qe.div.attrs({className:Ic(fk,"Close")}).withConfig({componentId:"sc-l3tf49-3"})((function(e){var t=e.variant,n=void 0===t?dk.Default:t,r=e.theme.palette;return Re(["position:absolute;display:flex;top:","px;right:","px;color:",";&:hover{color:",";}cursor:pointer;"],n===dk.WithIcon?12:16,n===dk.WithIcon?12:16,r[ut.IconsSecondary],r[ut.IconsPrimary])}));const vk=Tc({ModalTitle:Qe.div.attrs({className:Ic(fk,"root")}).withConfig({componentId:"sc-l3tf49-4"})((function(e){var t=e.variant,n=void 0===t?dk.Default:t,r=e.theme,i=r.palette,o=r.shape.borderRadius;return Re(["position:relative;color:",";border-radius:","px ","px 0px 0px;"," "," ",""],i[ut.TextPrimary],o[ft.Md],o[ft.Md],(function(){var e=n===dk.WithIcon?12:11;return Re(["padding:","px ","px ","px ","px;"],e,n===dk.WithIcon?18:40,e,18)}),n===dk.Default&&Re(["background:",";border-bottom:1px solid ",";"],i[ut.BackgroundPrimary],i[ut.BordersSecondary]),n===dk.WithIcon&&Re(["display:flex;align-items:center;flex-direction:column;"]))})),LabelPrimary:pk,LabelSecondary:gk,Close:mk,Icon:hk});var yk=["secondary","onClose"],bk=_c((function(e,t){var n=e.secondary,r=e.onClose,i=g(e,yk);return h.createElement(vk.ModalTitle,zt({},i,{ref:t}),i.icon&&h.createElement(vk.Icon,{iconShadow:Boolean(i.iconShadow)},i.icon),h.createElement(vk.LabelPrimary,null,i.primary),i.variant===dk.WithIcon&&n&&h.createElement(vk.LabelSecondary,null,n),h.createElement(vk.Close,{variant:i.variant,onClick:r},h.createElement(uk,{size:11})))}));bk.defaultProps={iconShadow:!0,variant:dk.Default},bk.propTypes={primary:v().node.isRequired,secondary:v().node,icon:v().node,iconShadow:v().bool,onClose:v().func,variant:v().oneOf(nt(dk))},bk.displayName="ModalTitle";var wk=Qe(bk).withConfig({componentId:"sc-kpjpf5-0"})([".SfxModalTitle-LabelPrimary{font-size:14px;line-height:16px;font-weight:500;}"]);function Ck(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xk(e){for(var t,n=1;n1?t-1:0),r=1;r svg:not([color]){color:",'}:disabled,[aria-disabled="true"]{cursor:not-allowed;}&::-webkit-scrollbar{width:4px;height:4px;}&::-webkit-scrollbar-track{background:rgba(203,211,218,0.35);}&::-webkit-scrollbar-thumb{background:rgba(203,211,218,1);border-radius:10px;}}'],ma,ma,(function(e){return e.theme.palette["icons-primary"]})),M_=function(e){var t,n,r=e.img,i=e.source,o=e.useCloudimage,a=e.cloudimage;if(r)throw new Error("`img` is renamed to `source` please consider renaming it from your configurations.");if(!i||"string"!=typeof i&&!(i instanceof HTMLImageElement))throw new Error("`source` property is required either a string of image url or a HTMLImageElement for the image that will be edited.");if(o&&(null!=a&&null!==(t=a.imageSealing)&&void 0!==t&&t.enable&&(null==a||null===(n=a.imageSealing)||void 0===n||!n.salt)))throw new Error("`salt` property of imageSealing object is required in cloudimage mode as long as `imageSealing` is enabled.");var l=HE(Ka,e);return h.createElement(h.StrictMode,null,h.createElement(Lt,{theme:l.theme},h.createElement(T_,null),h.createElement(j_,null),h.createElement(fu,{config:l},h.createElement(I_,null))))};M_.defaultProps={useCloudimage:!1,cloudimage:{},img:void 0};const R_=(0,h.memo)(M_);function D_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A_(e){for(var t,n=1;n{"use strict";var r=n(1296),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?a:l[e.$$typeof]||i}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var i=h(n);i&&i!==p&&e(t,i,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var l=s(t),g=s(n),m=0;m{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case o:case l:case a:case h:return e;default:switch(e=e&&e.$$typeof){case c:case f:case m:case g:case s:return e;default:return t}}case i:return t}}}function x(e){return C(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=f,t.Fragment=o,t.Lazy=m,t.Memo=g,t.Portal=i,t.Profiler=l,t.StrictMode=a,t.Suspense=h,t.isAsyncMode=function(e){return x(e)||C(e)===u},t.isConcurrentMode=x,t.isContextConsumer=function(e){return C(e)===c},t.isContextProvider=function(e){return C(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return C(e)===f},t.isFragment=function(e){return C(e)===o},t.isLazy=function(e){return C(e)===m},t.isMemo=function(e){return C(e)===g},t.isPortal=function(e){return C(e)===i},t.isProfiler=function(e){return C(e)===l},t.isStrictMode=function(e){return C(e)===a},t.isSuspense=function(e){return C(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===l||e===a||e===h||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===s||e.$$typeof===c||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===w||e.$$typeof===v)},t.typeOf=C},1296:(e,t,n)=>{"use strict";e.exports=n(6103)},2378:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object AsyncFunction]",l="[object Function]",s="[object GeneratorFunction]",c="[object Null]",u="[object Object]",d="[object Proxy]",f="[object Undefined]",h=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[o]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[l]=g["[object Map]"]=g["[object Number]"]=g[u]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,v="object"==typeof self&&self&&self.Object===Object&&self,y=m||v||Function("return this")(),b=t&&!t.nodeType&&t,w=b&&e&&!e.nodeType&&e,C=w&&w.exports===b,x=C&&m.process,E=function(){try{var e=w&&w.require&&w.require("util").types;return e||x&&x.binding&&x.binding("util")}catch(e){}}(),S=E&&E.isTypedArray;var O,k,P,_=Array.prototype,L=Function.prototype,I=Object.prototype,T=y["__core-js_shared__"],j=L.toString,M=I.hasOwnProperty,R=(O=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"",D=I.toString,A=j.call(Object),z=RegExp("^"+j.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),N=C?y.Buffer:void 0,F=y.Symbol,H=y.Uint8Array,B=N?N.allocUnsafe:void 0,V=(k=Object.getPrototypeOf,P=Object,function(e){return k(P(e))}),W=Object.create,G=I.propertyIsEnumerable,Z=_.splice,U=F?F.toStringTag:void 0,X=function(){try{var e=be(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Y=N?N.isBuffer:void 0,q=Math.max,$=Date.now,K=be(y,"Map"),Q=be(Object,"create"),J=function(){function e(){}return function(t){if(!Te(t))return{};if(W)return W(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function ee(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},te.prototype.set=function(e,t){var n=this.__data__,r=le(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ne.prototype.clear=function(){this.size=0,this.__data__={hash:new ee,map:new(K||te),string:new ee}},ne.prototype.delete=function(e){var t=ye(this,e).delete(e);return this.size-=t?1:0,t},ne.prototype.get=function(e){return ye(this,e).get(e)},ne.prototype.has=function(e){return ye(this,e).has(e)},ne.prototype.set=function(e,t){var n=ye(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},re.prototype.clear=function(){this.__data__=new te,this.size=0},re.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},re.prototype.get=function(e){return this.__data__.get(e)},re.prototype.has=function(e){return this.__data__.has(e)},re.prototype.set=function(e,t){var n=this.__data__;if(n instanceof te){var r=n.__data__;if(!K||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ne(r)}return n.set(e,t),this.size=n.size,this};var ce,ue=function(e,t,n){for(var r=-1,i=Object(e),o=n(e),a=o.length;a--;){var l=o[ce?a:++r];if(!1===t(i[l],l,i))break}return e};function de(e){return null==e?void 0===e?f:c:U&&U in Object(e)?function(e){var t=M.call(e,U),n=e[U];try{e[U]=void 0;var r=!0}catch(e){}var i=D.call(e);r&&(t?e[U]=n:delete e[U]);return i}(e):function(e){return D.call(e)}(e)}function fe(e){return je(e)&&de(e)==o}function he(e){return!(!Te(e)||function(e){return!!R&&R in e}(e))&&(Le(e)?z:h).test(function(e){if(null!=e){try{return j.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function pe(e){if(!Te(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Ce(e),n=[];for(var r in e)("constructor"!=r||!t&&M.call(e,r))&&n.push(r);return n}function ge(e,t,n,r,i){e!==t&&ue(t,(function(o,a){if(i||(i=new re),Te(o))!function(e,t,n,r,i,o,a){var l=xe(e,n),s=xe(t,n),c=a.get(s);if(c)return void oe(e,n,c);var d=o?o(l,s,n+"",e,t,a):void 0,f=void 0===d;if(f){var h=ke(s),p=!h&&_e(s),g=!h&&!p&&Me(s);d=s,h||p||g?ke(l)?d=l:je(w=l)&&Pe(w)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ve);function Se(e,t){return e===t||e!=e&&t!=t}var Oe=fe(function(){return arguments}())?fe:function(e){return je(e)&&M.call(e,"callee")&&!G.call(e,"callee")},ke=Array.isArray;function Pe(e){return null!=e&&Ie(e.length)&&!Le(e)}var _e=Y||function(){return!1};function Le(e){if(!Te(e))return!1;var t=de(e);return t==l||t==s||t==a||t==d}function Ie(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Te(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function je(e){return null!=e&&"object"==typeof e}var Me=S?function(e){return function(t){return e(t)}}(S):function(e){return je(e)&&Ie(e.length)&&!!g[de(e)]};function Re(e){return Pe(e)?ie(e,!0):pe(e)}var De,Ae=(De=function(e,t,n){ge(e,t,n)},me((function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=De.length>3&&"function"==typeof i?(r--,i):void 0,o&&function(e,t,n){if(!Te(n))return!1;var r=typeof t;return!!("number"==r?Pe(n)&&we(t,n.length):"string"==r&&t in n)&&Se(n[t],e)}(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n{"use strict";var r=n(414);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4448:(e,t,n)=>{"use strict";var r=n(7294),i=n(3840);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n