(function(){var Xv=Object.create,tf=Object.defineProperty,Uv=Object.getOwnPropertyDescriptor,Vv=Object.getOwnPropertyNames,Wv=Object.getPrototypeOf,Qv=Object.prototype.hasOwnProperty,Et=(n,s)=>()=>(n&&(s=n(n=0)),s),Di=(n,s)=>()=>(s||(n((s={exports:{}}).exports,s),n=null),s.exports),gg=(n,s)=>{let u={};for(var r in n)tf(u,r,{get:n[r],enumerable:!0});return s||tf(u,Symbol.toStringTag,{value:"Module"}),u},qv=(n,s,u,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(var d=Vv(s),m=0,p=d.length,y;m
s[S]).bind(null,y),enumerable:!(r=Uv(s,y))||r.enumerable});return n},xc=(n,s,u)=>(u=n!=null?Xv(Wv(n)):{},qv(s||!n||!n.__esModule?tf(u,"default",{value:n,enumerable:!0}):u,n)),Kv=Di((n=>{function s(lt,nt){var et=lt.length;lt.push(nt);t:for(;0>>1,Nt=lt[Ct];if(0>>1;Ctd(tt,et))ytd(Ot,tt)?(lt[Ct]=Ot,lt[yt]=et,Ct=yt):(lt[Ct]=tt,lt[j]=et,Ct=j);else if(ytd(Ot,et))lt[Ct]=Ot,lt[yt]=et,Ct=yt;else break t}}return nt}function d(lt,nt){var et=lt.sortIndex-nt.sortIndex;return et!==0?et:lt.id-nt.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;n.unstable_now=function(){return m.now()}}else{var p=Date,y=p.now();n.unstable_now=function(){return p.now()-y}}var S=[],x=[],L=1,_=null,M=3,w=!1,N=!1,J=!1,q=!1,G=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;function F(lt){for(var nt=u(x);nt!==null;){if(nt.callback===null)r(x);else if(nt.startTime<=lt)r(x),nt.sortIndex=nt.expirationTime,s(S,nt);else break;nt=u(x)}}function ot(lt){if(J=!1,F(lt),!N)if(u(S)!==null)N=!0,ut||(ut=!0,jt());else{var nt=u(x);nt!==null&&Lt(ot,nt.startTime-lt)}}var ut=!1,at=-1,mt=5,Rt=-1;function zt(){return q?!0:!(n.unstable_now()-Rtlt&&zt());){var Ct=_.callback;if(typeof Ct=="function"){_.callback=null,M=_.priorityLevel;var Nt=Ct(_.expirationTime<=lt);if(lt=n.unstable_now(),typeof Nt=="function"){_.callback=Nt,F(lt),nt=!0;break e}_===u(S)&&r(S),F(lt)}else r(S);_=u(S)}if(_!==null)nt=!0;else{var te=u(x);te!==null&&Lt(ot,te.startTime-lt),nt=!1}}break t}finally{_=null,M=et,w=!1}nt=void 0}}finally{nt?jt():ut=!1}}}var jt;if(typeof U=="function")jt=function(){U(Gt)};else if(typeof MessageChannel<"u"){var Ht=new MessageChannel,Mt=Ht.port2;Ht.port1.onmessage=Gt,jt=function(){Mt.postMessage(null)}}else jt=function(){G(Gt,0)};function Lt(lt,nt){at=G(function(){lt(n.unstable_now())},nt)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(lt){lt.callback=null},n.unstable_forceFrameRate=function(lt){0>lt||125Ct?(lt.sortIndex=et,s(x,lt),u(S)===null&<===u(x)&&(J?(V(at),at=-1):J=!0,Lt(ot,et-Ct))):(lt.sortIndex=Nt,s(S,lt),N||w||(N=!0,ut||(ut=!0,jt()))),lt},n.unstable_shouldYield=zt,n.unstable_wrapCallback=function(lt){var nt=M;return function(){var et=M;M=nt;try{return lt.apply(this,arguments)}finally{M=et}}}})),gm=Di(((n,s)=>{s.exports=Kv()})),kv=Di((n=>{var s=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),y=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),L=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),w=Symbol.iterator;function N(j){return j===null||typeof j!="object"?null:(j=w&&j[w]||j["@@iterator"],typeof j=="function"?j:null)}var J={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},q=Object.assign,G={};function V(j,tt,yt){this.props=j,this.context=tt,this.refs=G,this.updater=yt||J}V.prototype.isReactComponent={},V.prototype.setState=function(j,tt){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,tt,"setState")},V.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function U(){}U.prototype=V.prototype;function F(j,tt,yt){this.props=j,this.context=tt,this.refs=G,this.updater=yt||J}var ot=F.prototype=new U;ot.constructor=F,q(ot,V.prototype),ot.isPureReactComponent=!0;var ut=Array.isArray;function at(){}var mt={H:null,A:null,T:null,S:null},Rt=Object.prototype.hasOwnProperty;function zt(j,tt,yt){var Ot=yt.ref;return{$$typeof:s,type:j,key:tt,ref:Ot!==void 0?Ot:null,props:yt}}function Gt(j,tt){return zt(j.type,tt,j.props)}function jt(j){return typeof j=="object"&&j!==null&&j.$$typeof===s}function Ht(j){var tt={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(yt){return tt[yt]})}var Mt=/\/+/g;function Lt(j,tt){return typeof j=="object"&&j!==null&&j.key!=null?Ht(""+j.key):tt.toString(36)}function lt(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(at,at):(j.status="pending",j.then(function(tt){j.status==="pending"&&(j.status="fulfilled",j.value=tt)},function(tt){j.status==="pending"&&(j.status="rejected",j.reason=tt)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function nt(j,tt,yt,Ot,Wt){var Bt=typeof j;(Bt==="undefined"||Bt==="boolean")&&(j=null);var kt=!1;if(j===null)kt=!0;else switch(Bt){case"bigint":case"string":case"number":kt=!0;break;case"object":switch(j.$$typeof){case s:case u:kt=!0;break;case _:return kt=j._init,nt(kt(j._payload),tt,yt,Ot,Wt)}}if(kt)return Wt=Wt(j),kt=Ot===""?"."+Lt(j,0):Ot,ut(Wt)?(yt="",kt!=null&&(yt=kt.replace(Mt,"$&/")+"/"),nt(Wt,tt,yt,"",function(ti){return ti})):Wt!=null&&(jt(Wt)&&(Wt=Gt(Wt,yt+(Wt.key==null||j&&j.key===Wt.key?"":(""+Wt.key).replace(Mt,"$&/")+"/")+kt)),tt.push(Wt)),1;kt=0;var fa=Ot===""?".":Ot+":";if(ut(j))for(var he=0;he{s.exports=kv()})),Fv=Di((n=>{var s=Cs();function u(x){var L="https://react.dev/errors/"+x;if(1{function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(r){console.error(r)}}u(),s.exports=Fv()})),$v=Di((n=>{var s=gm(),u=Cs(),r=Pv();function d(t){var e="https://react.dev/errors/"+t;if(1te||(t.current=Nt[te],Nt[te]=null,te--)}function yt(t,e){te++,Nt[te]=t.current,t.current=e}var Ot=j(null),Wt=j(null),Bt=j(null),kt=j(null);function fa(t,e){switch(yt(Bt,e),yt(Wt,t),yt(Ot,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?fv(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=fv(e),t=mv(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}tt(Ot),yt(Ot,t)}function he(){tt(Ot),tt(Wt),tt(Bt)}function ti(t){t.memoizedState!==null&&yt(kt,t);var e=Ot.current,l=mv(e,t.type);e!==l&&(yt(Wt,t),yt(Ot,l))}function an(t){Wt.current===t&&(tt(Ot),tt(Wt)),kt.current===t&&(tt(kt),Kh._currentValue=Ct)}var di,nn;function ei(t){if(di===void 0)try{throw Error()}catch(l){var e=l.stack.trim().match(/\n( *(at )?)/);di=e&&e[1]||"",nn=-1)":-1f||O[c]!==Q[f]){var it=`
`+O[c].replace(" at new "," at ");return t.displayName&&it.includes("")&&(it=it.replace("",t.displayName)),it}while(1<=c&&0<=f);break}}}finally{aa=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?ei(l):""}function za(t,e){switch(t.tag){case 26:case 27:case 5:return ei(t.type);case 16:return ei("Lazy");case 13:return t.child!==e&&e!==null?ei("Suspense Fallback"):ei("Suspense");case 19:return ei("SuspenseList");case 0:case 15:return La(t.type,!1);case 11:return La(t.type.render,!1);case 1:return La(t.type,!0);case 31:return ei("Activity");default:return""}}function Ma(t){try{var e="",l=null;do e+=za(t,l),l=t,t=t.return;while(t);return e}catch(c){return`
Error generating stack: `+c.message+`
`+c.stack}}var ai=Object.prototype.hasOwnProperty,ii=s.unstable_scheduleCallback,el=s.unstable_cancelCallback,En=s.unstable_shouldYield,ma=s.unstable_requestPaint,Na=s.unstable_now,Ko=s.unstable_getCurrentPriorityLevel,al=s.unstable_ImmediatePriority,Il=s.unstable_UserBlockingPriority,il=s.unstable_NormalPriority,Zi=s.unstable_LowPriority,zn=s.unstable_IdlePriority,Lu=s.log,Ns=s.unstable_setDisableYieldValue,Mn=null,Da=null;function Ji(t){if(typeof Lu=="function"&&Ns(t),Da&&typeof Da.setStrictMode=="function")try{Da.setStrictMode(Mn,t)}catch{}}var Qa=Math.clz32?Math.clz32:ko,xu=Math.log,Nd=Math.LN2;function ko(t){return t>>>=0,t===0?32:31-(xu(t)/Nd|0)|0}var ln=256,Bi=262144,Nn=4194304;function Tn(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function An(t,e,l){var c=t.pendingLanes;if(c===0)return 0;var f=0,g=t.suspendedLanes,C=t.pingedLanes;t=t.warmLanes;var z=c&134217727;return z!==0?(c=z&~g,c!==0?f=Tn(c):(C&=z,C!==0?f=Tn(C):l||(l=z&~t,l!==0&&(f=Tn(l))))):(z=c&~g,z!==0?f=Tn(z):C!==0?f=Tn(C):l||(l=c&~t,l!==0&&(f=Tn(l)))),f===0?0:e!==0&&e!==f&&(e&g)===0&&(g=f&-f,l=e&-e,g>=l||g===32&&(l&4194048)!==0)?e:f}function nl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Fo(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wn(){var t=Nn;return Nn<<=1,(Nn&62914560)===0&&(Nn=4194304),t}function _u(t){for(var e=[],l=0;31>l;l++)e.push(t);return e}function Zl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Eu(t,e,l,c,f,g){var C=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var z=t.entanglements,O=t.expirationTimes,Q=t.hiddenUpdates;for(l=C&~l;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var tr=/[\n"\\]/g;function ka(t){return t.replace(tr,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Nu(t,e,l,c,f,g,C,z){t.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.type=C:t.removeAttribute("type"),e!=null?C==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Ui(e)):t.value!==""+Ui(e)&&(t.value=""+Ui(e)):C!=="submit"&&C!=="reset"||t.removeAttribute("value"),e!=null?sn(t,C,Ui(e)):l!=null?sn(t,C,Ui(l)):c!=null&&t.removeAttribute("value"),f==null&&g!=null&&(t.defaultChecked=!!g),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?t.name=""+Ui(z):t.removeAttribute("name")}function er(t,e,l,c,f,g,C,z){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),e!=null||l!=null){if(!(g!=="submit"&&g!=="reset"||e!=null)){Hc(t);return}l=l!=null?""+Ui(l):"",e=e!=null?""+Ui(e):l,z||e===t.value||(t.value=e),t.defaultValue=e}c=c??f,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=z?t.checked:!!c,t.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(t.name=C),Hc(t)}function sn(t,e,l){e==="number"&&Ue(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function cl(t,e,l,c){if(t=t.options,e){e={};for(var f=0;f"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gd=!1;if(Rn)try{var Au={};Object.defineProperty(Au,"passive",{get:function(){Gd=!0}}),window.addEventListener("test",Au,Au),window.removeEventListener("test",Au,Au)}catch{Gd=!1}var Ti=null,cr=null,ws=null;function Ic(){if(ws)return ws;var t,e=cr,l=e.length,c,f="value"in Ti?Ti.value:Ti.textContent,g=f.length;for(t=0;t=Gu),Ud=" ",kf=!1;function Aa(t,e){switch(t){case"keyup":return Os.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vd(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ys=!1;function Ff(t,e){switch(t){case"compositionend":return Vd(e);case"keypress":return e.which!==32?null:(kf=!0,Ud);case"textInput":return t=e.data,t===Ud&&kf?null:t;default:return null}}function Pf(t,e){if(Ys)return t==="compositionend"||!ju&&Aa(t,e)?(t=Ic(),ws=cr=Ti=null,Ys=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:l,offset:e-t};t=c}t:{for(;l;){if(l.nextSibling){l=l.nextSibling;break t}l=l.parentNode}l=void 0}l=e0(l)}}function Vi(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Vi(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Kc(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ue(t.document);e instanceof t.HTMLIFrameElement;){try{var l=typeof e.contentWindow.location.href=="string"}catch{l=!1}if(l)t=e.contentWindow;else break;e=Ue(t.document)}return e}function vr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var $d=Rn&&"documentMode"in document&&11>=document.documentMode,js=null,yr=null,Gs=null,kc=!1;function th(t,e,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;kc||js==null||js!==Ue(c)||(c=js,"selectionStart"in c&&vr(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Gs&&Rs(Gs,c)||(Gs=c,c=me(yr,"onSelect"),0>=C,f-=C,gi=1<<32-Qa(e)+f|l<$t?(ve=Yt,Yt=null):ve=Yt.sibling;var ze=K(X,Yt,W[$t],st);if(ze===null){Yt===null&&(Yt=ve);break}t&&Yt&&ze.alternate===null&&e(X,Yt),H=g(ze,H,$t),Ee===null?Dt=ze:Ee.sibling=ze,Ee=ze,Yt=ve}if($t===W.length)return l(X,Yt),Xt&&qi(X,$t),Dt;if(Yt===null){for(;$t$t?(ve=Yt,Yt=null):ve=Yt.sibling;var Lc=K(X,Yt,ze.value,st);if(Lc===null){Yt===null&&(Yt=ve);break}t&&Yt&&Lc.alternate===null&&e(X,Yt),H=g(Lc,H,$t),Ee===null?Dt=Lc:Ee.sibling=Lc,Ee=Lc,Yt=ve}if(ze.done)return l(X,Yt),Xt&&qi(X,$t),Dt;if(Yt===null){for(;!ze.done;$t++,ze=W.next())ze=ct(X,ze.value,st),ze!==null&&(H=g(ze,H,$t),Ee===null?Dt=ze:Ee.sibling=ze,Ee=ze);return Xt&&qi(X,$t),Dt}for(Yt=c(Yt);!ze.done;$t++,ze=W.next())ze=$(Yt,X,$t,ze.value,st),ze!==null&&(t&&ze.alternate!==null&&Yt.delete(ze.key===null?$t:ze.key),H=g(ze,H,$t),Ee===null?Dt=ze:Ee.sibling=ze,Ee=ze);return t&&Yt.forEach(function(Pb){return e(X,Pb)}),Xt&&qi(X,$t),Dt}function He(X,H,W,st){if(typeof W=="object"&&W!==null&&W.type===q&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case N:t:{for(var Dt=W.key;H!==null;){if(H.key===Dt){if(Dt=W.type,Dt===q){if(H.tag===7){l(X,H.sibling),st=f(H,W.props.children),st.return=X,X=st;break t}}else if(H.elementType===Dt||typeof Dt=="object"&&Dt!==null&&Dt.$$typeof===Rt&&Us(Dt)===H.type){l(X,H.sibling),st=f(H,W.props),Ft(st,W),st.return=X,X=st;break t}l(X,H);break}else e(X,H);H=H.sibling}W.type===q?(st=ql(W.props.children,X.mode,st,W.key),st.return=X,X=st):(st=wa(W.type,W.key,W.props,null,X.mode,st),Ft(st,W),st.return=X,X=st)}return C(X);case J:t:{for(Dt=W.key;H!==null;){if(H.key===Dt)if(H.tag===4&&H.stateNode.containerInfo===W.containerInfo&&H.stateNode.implementation===W.implementation){l(X,H.sibling),st=f(H,W.children||[]),st.return=X,X=st;break t}else{l(X,H);break}else e(X,H);H=H.sibling}st=on(W,X.mode,st),st.return=X,X=st}return C(X);case Rt:return W=Us(W),He(X,H,W,st)}if(lt(W))return wt(X,H,W,st);if(Ht(W)){if(Dt=Ht(W),typeof Dt!="function")throw Error(d(150));return W=Dt.call(W),Jt(X,H,W,st)}if(typeof W.then=="function")return He(X,H,ku(W),st);if(W.$$typeof===F)return He(X,H,Js(X,W),st);Tr(X,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,H!==null&&H.tag===6?(l(X,H.sibling),st=f(H,W),st.return=X,X=st):(l(X,H),st=cn(W,X.mode,st),st.return=X,X=st),C(X)):l(X,H)}return function(X,H,W,st){try{Ku=0;var Dt=He(X,H,W,st);return Vs=null,Dt}catch(Yt){if(Yt===Xs||Yt===In)throw Yt;var Ee=Ai(29,Yt,null,X.mode);return Ee.lanes=st,Ee.return=X,Ee}}}var Sl=pi(!0),d0=pi(!1),fn=!1;function es(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function as(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function is(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Cl(t,e,l){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(oe&2)!==0){var f=c.pending;return f===null?e.next=e:(e.next=f.next,f.next=e),c.pending=e,e=Ju(t),Qi(t,null,l),e}return Sr(t,c,e,l),Ju(t)}function Fu(t,e,l){if(e=e.updateQueue,e!==null&&(e=e.shared,(l&4194048)!==0)){var c=e.lanes;c&=t.pendingLanes,l|=c,e.lanes=l,qa(t,l)}}function Zn(t,e){var l=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var f=null,g=null;if(l=l.firstBaseUpdate,l!==null){do{var C={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};g===null?f=g=C:g=g.next=C,l=l.next}while(l!==null);g===null?f=g=e:g=g.next=e}else f=g=e;l={baseState:c.baseState,firstBaseUpdate:f,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=e:t.next=e,l.lastBaseUpdate=e}var io=!1;function Ws(){if(io){var t=$l;if(t!==null)throw t}}function Qs(t,e,l,c){io=!1;var f=t.updateQueue;fn=!1;var g=f.firstBaseUpdate,C=f.lastBaseUpdate,z=f.shared.pending;if(z!==null){f.shared.pending=null;var O=z,Q=O.next;O.next=null,C===null?g=Q:C.next=Q,C=O;var it=t.alternate;it!==null&&(it=it.updateQueue,z=it.lastBaseUpdate,z!==C&&(z===null?it.firstBaseUpdate=Q:z.next=Q,it.lastBaseUpdate=O))}if(g!==null){var ct=f.baseState;C=0,it=Q=O=null,z=g;do{var K=z.lane&-536870913,$=K!==z.lane;if($?(ee&K)===K:(c&K)===K){K!==0&&K===le&&(io=!0),it!==null&&(it=it.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});t:{var wt=t,Jt=z;K=e;var He=l;switch(Jt.tag){case 1:if(wt=Jt.payload,typeof wt=="function"){ct=wt.call(He,ct,K);break t}ct=wt;break t;case 3:wt.flags=wt.flags&-65537|128;case 0:if(wt=Jt.payload,K=typeof wt=="function"?wt.call(He,ct,K):wt,K==null)break t;ct=M({},ct,K);break t;case 2:fn=!0}}K=z.callback,K!==null&&(t.flags|=64,$&&(t.flags|=8192),$=f.callbacks,$===null?f.callbacks=[K]:$.push(K))}else $={lane:K,tag:z.tag,payload:z.payload,callback:z.callback,next:null},it===null?(Q=it=$,O=ct):it=it.next=$,C|=K;if(z=z.next,z===null){if(z=f.shared.pending,z===null)break;$=z,z=$.next,$.next=null,f.lastBaseUpdate=$,f.shared.pending=null}}while(!0);it===null&&(O=ct),f.baseState=O,f.firstBaseUpdate=Q,f.lastBaseUpdate=it,g===null&&(f.shared.lanes=0),fe|=C,t.lanes=C,t.memoizedState=ct}}function Ar(t,e){if(typeof t!="function")throw Error(d(191,t));t.call(e)}function Ll(t,e){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;tg?g:8;var C=nt.T,z={};nt.T=z,Oh(t,!1,e,l);try{var O=f(),Q=nt.S;Q!==null&&Q(z,O),O!==null&&typeof O=="object"&&typeof O.then=="function"?oo(t,e,Z1(O,c),xe(t)):oo(t,e,c,xe(t))}catch(it){oo(t,e,{then:function(){},status:"rejected",reason:it},xe())}finally{et.p=g,C!==null&&z.types!==null&&(C.types=z.types),nt.T=C}}function X1(){}function Ah(t,e,l,c){if(t.tag!==5)throw Error(d(476));var f=R0(t).queue;Th(t,f,e,Ct,l===null?X1:function(){return j0(t),l(c)})}function R0(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Ct,baseState:Ct,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:Ct},next:null};var l={};return e.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:l},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function j0(t){var e=R0(t);e.next===null&&(e=t.alternate.memoizedState),oo(t,e.next.queue,{},xe())}function wh(){return ta(Kh)}function G0(){return ke().memoizedState}function H0(){return ke().memoizedState}function U1(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var l=xe();t=is(l);var c=Cl(e,t,l);c!==null&&(Qe(c,e,l),Fu(c,e,l)),e={cache:zr()},t.payload=e;return}e=e.return}}function V1(t,e,l){var c=xe();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Dr(t)?I0(e,l):(l=Cr(t,e,l,c),l!==null&&(Qe(l,t,c),Z0(l,e,c)))}function D0(t,e,l){oo(t,e,l,xe())}function oo(t,e,l,c){var f={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Dr(t))I0(e,f);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=e.lastRenderedReducer,g!==null))try{var C=e.lastRenderedState,z=g(C,l);if(f.hasEagerState=!0,f.eagerState=z,na(z,C))return Sr(t,e,f,0),Te===null&&$c(),!1}catch{}if(l=Cr(t,e,f,c),l!==null)return Qe(l,t,c),Z0(l,e,c),!0}return!1}function Oh(t,e,l,c){if(c={lane:2,revertLane:P(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Dr(t)){if(e)throw Error(d(479))}else e=Cr(t,l,c,2),e!==null&&Qe(e,t,2)}function Dr(t){var e=t.alternate;return t===Qt||e!==null&&e===Qt}function I0(t,e){tc=no=!0;var l=t.pending;l===null?e.next=e:(e.next=l.next,l.next=e),t.pending=e}function Z0(t,e,l){if((l&4194048)!==0){var c=e.lanes;c&=t.pendingLanes,l|=c,e.lanes=l,qa(t,l)}}var ro={readContext:ta,use:uo,useCallback:se,useContext:se,useEffect:se,useImperativeHandle:se,useLayoutEffect:se,useInsertionEffect:se,useMemo:se,useReducer:se,useRef:se,useState:se,useDebugValue:se,useDeferredValue:se,useTransition:se,useSyncExternalStore:se,useId:se,useHostTransitionStatus:se,useFormState:se,useActionState:se,useOptimistic:se,useMemoCache:se,useCacheRefresh:se};ro.useEffectEvent=se;var J0={readContext:ta,use:uo,useCallback:function(t,e){return li().memoizedState=[t,e===void 0?null:e],t},useContext:ta,useEffect:N0,useImperativeHandle:function(t,e,l){l=l!=null?l.concat([t]):null,Rr(4194308,4,Mh.bind(null,e,t),l)},useLayoutEffect:function(t,e){return Rr(4194308,4,t,e)},useInsertionEffect:function(t,e){Rr(4,2,t,e)},useMemo:function(t,e){var l=li();e=e===void 0?null:e;var c=t();if(qs){Ji(!0);try{t()}finally{Ji(!1)}}return l.memoizedState=[c,e],c},useReducer:function(t,e,l){var c=li();if(l!==void 0){var f=l(e);if(qs){Ji(!0);try{l(e)}finally{Ji(!1)}}}else f=e;return c.memoizedState=c.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},c.queue=t,t=t.dispatch=V1.bind(null,Qt,t),[c.memoizedState,t]},useRef:function(t){var e=li();return t={current:t},e.memoizedState=t},useState:function(t){t=xh(t);var e=t.queue,l=D0.bind(null,Qt,e);return e.dispatch=l,[t.memoizedState,l]},useDebugValue:co,useDeferredValue:function(t,e){return Nh(li(),t,e)},useTransition:function(){var t=xh(!1);return t=Th.bind(null,Qt,t.queue,!0,!1),li().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,l){var c=Qt,f=li();if(Xt){if(l===void 0)throw Error(d(407));l=l()}else{if(l=e(),Te===null)throw Error(d(349));(ee&127)!==0||ec(c,e,l)}f.memoizedState=l;var g={value:l,getSnapshot:e};return f.queue=g,N0(m0.bind(null,c,g,t),[t]),c.flags|=2048,ic(9,{destroy:void 0},f0.bind(null,c,g,l,e),null),l},useId:function(){var t=li(),e=Te.identifierPrefix;if(Xt){var l=rn,c=gi;l=(c&~(1<<32-Qa(c)-1)).toString(32)+l,e="_"+e+"R_"+l,l=Jn++,0<\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof c.is=="string"?C.createElement("select",{is:c.is}):C.createElement("select"),c.multiple?g.multiple=!0:c.size&&(g.size=c.size);break;default:g=typeof c.is=="string"?C.createElement(f,{is:c.is}):C.createElement(f)}}g[D]=e,g[rt]=c;t:for(C=e.child;C!==null;){if(C.tag===5||C.tag===6)g.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===e)break t;for(;C.sibling===null;){if(C.return===null||C.return===e)break t;C=C.return}C.sibling.return=C.return,C=C.sibling}e.stateNode=g;t:switch(ri(g,f,c),f){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break t;case"img":c=!0;break t;default:c=!1}c&&El(e)}}return Ne(e),mo(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,l),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==c&&El(e);else{if(typeof c!="string"&&e.stateNode===null)throw Error(d(166));if(t=Bt.current,Zs(e)){if(t=e.stateNode,l=e.memoizedProps,c=null,f=Ya,f!==null)switch(f.tag){case 27:case 5:c=f.memoizedProps}t[D]=e,t=!!(t.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||dv(t.nodeValue,l)),t||pl(e,!0)}else t=am(t).createTextNode(c),t[D]=e,e.stateNode=t}return Ne(e),null;case 31:if(l=e.memoizedState,t===null||t.memoizedState!==null){if(c=Zs(e),l!==null){if(t===null){if(!c)throw Error(d(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(d(557));t[D]=e}else yl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ne(e),t=!1}else l=kl(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return e.flags&256?(Oi(e),e):(Oi(e),null);if((e.flags&128)!==0)throw Error(d(558))}return Ne(e),null;case 13:if(c=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Zs(e),c!==null&&c.dehydrated!==null){if(t===null){if(!f)throw Error(d(318));if(f=e.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(d(317));f[D]=e}else yl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ne(e),f=!1}else f=kl(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return e.flags&256?(Oi(e),e):(Oi(e),null)}return Oi(e),(e.flags&128)!==0?(e.lanes=l,e):(l=c!==null,t=t!==null&&t.memoizedState!==null,l&&(c=e.child,f=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(f=c.alternate.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==f&&(c.flags|=2048)),l!==t&&l&&(e.child.flags|=8192),Qr(e,e.updateQueue),Ne(e),null);case 4:return he(),t===null&&ft(e.stateNode.containerInfo),Ne(e),null;case 10:return hn(e.type),Ne(e),null;case 19:if(tt(sa),c=e.memoizedState,c===null)return Ne(e),null;if(f=(e.flags&128)!==0,g=c.rendering,g===null)if(f)go(c,!1);else{if(At!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(g=Yr(t),g!==null){for(e.flags|=128,go(c,!1),t=g.updateQueue,e.updateQueue=t,Qr(e,t),e.subtreeFlags=0,t=l,l=e.child;l!==null;)ih(l,t),l=l.sibling;return yt(sa,sa.current&1|2),Xt&&qi(e,c.treeForkCount),e.child}t=t.sibling}c.tail!==null&&Na()>Lo&&(e.flags|=128,f=!0,go(c,!1),e.lanes=4194304)}else{if(!f)if(t=Yr(g),t!==null){if(e.flags|=128,f=!0,t=t.updateQueue,e.updateQueue=t,Qr(e,t),go(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!Xt)return Ne(e),null}else 2*Na()-c.renderingStartTime>Lo&&l!==536870912&&(e.flags|=128,f=!0,go(c,!1),e.lanes=4194304);c.isBackwards?(g.sibling=e.child,e.child=g):(t=c.last,t!==null?t.sibling=g:e.child=g,c.last=g)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Na(),t.sibling=null,l=sa.current,yt(sa,f?l&1|2:l&1),Xt&&qi(e,c.treeForkCount),t):(Ne(e),null);case 22:case 23:return Oi(e),Pu(),c=e.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(e.flags|=8192):c&&(e.flags|=8192),c?(l&536870912)!==0&&(e.flags&128)===0&&(Ne(e),e.subtreeFlags&6&&(e.flags|=8192)):Ne(e),l=e.updateQueue,l!==null&&Qr(e,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),c=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(c=e.memoizedState.cachePool.pool),c!==l&&(e.flags|=2048),t!==null&&tt(Bs),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),e.memoizedState.cache!==l&&(e.flags|=2048),hn(la),Ne(e),null;case 25:return null;case 30:return null}throw Error(d(156,e.tag))}function Gi(t,e){switch(eo(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return hn(la),he(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return an(e),null;case 31:if(e.memoizedState!==null){if(Oi(e),e.alternate===null)throw Error(d(340));yl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Oi(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(d(340));yl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return tt(sa),null;case 4:return he(),null;case 10:return hn(e.type),null;case 22:case 23:return Oi(e),Pu(),t!==null&&tt(Bs),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return hn(la),null;case 25:return null;default:return null}}function Uh(t,e){switch(eo(e),e.tag){case 3:hn(la),he();break;case 26:case 27:case 5:an(e);break;case 4:he();break;case 31:e.memoizedState!==null&&Oi(e);break;case 13:Oi(e);break;case 19:tt(sa);break;case 10:hn(e.type);break;case 22:case 23:Oi(e),Pu(),t!==null&&tt(Bs);break;case 24:hn(la)}}function po(t,e){try{var l=e.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var f=c.next;l=f;do{if((l.tag&t)===t){c=void 0;var g=l.create,C=l.inst;c=g(),C.destroy=c}l=l.next}while(l!==f)}}catch(z){_e(e,e.return,z)}}function Vn(t,e,l){try{var c=e.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var g=f.next;c=g;do{if((c.tag&t)===t){var C=c.inst,z=C.destroy;if(z!==void 0){C.destroy=void 0,f=e;var O=l,Q=z;try{Q()}catch(it){_e(f,O,it)}}}c=c.next}while(c!==g)}}catch(it){_e(e,e.return,it)}}function Vh(t){var e=t.updateQueue;if(e!==null){var l=t.stateNode;try{Ll(e,l)}catch(c){_e(t,t.return,c)}}}function qr(t,e,l){l.props=Ks(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(c){_e(t,e,c)}}function sc(t,e){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof l=="function"?t.refCleanup=l(c):l.current=c}}catch(f){_e(t,e,f)}}function ui(t,e){var l=t.ref,c=t.refCleanup;if(l!==null)if(typeof c=="function")try{c()}catch(f){_e(t,e,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){_e(t,e,f)}else l.current=null}function Ps(t){var e=t.type,l=t.memoizedProps,c=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break t;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(f){_e(t,t.return,f)}}function uc(t,e,l){try{var c=t.stateNode;bb(c,t.type,l,e),c[rt]=e}catch(f){_e(t,t.return,f)}}function cc(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&vc(t.type)||t.tag===4}function bi(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||cc(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&vc(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Si(t,e,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,e?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,e):(e=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,e.appendChild(t),l=l._reactRootContainer,l!=null||e.onclick!==null||(e.onclick=ol));else if(c!==4&&(c===27&&vc(t.type)&&(l=t.stateNode,e=null),t=t.child,t!==null))for(Si(t,e,l),t=t.sibling;t!==null;)Si(t,e,l),t=t.sibling}function mn(t,e,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,e?l.insertBefore(t,e):l.appendChild(t);else if(c!==4&&(c===27&&vc(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(mn(t,e,l),t=t.sibling;t!==null;)mn(t,e,l),t=t.sibling}function gn(t){var e=t.stateNode,l=t.memoizedProps;try{for(var c=t.type,f=e.attributes;f.length;)e.removeAttributeNode(f[0]);ri(e,c,l),e[D]=t,e[rt]=l}catch(g){_e(t,t.return,g)}}var Ra=!1,ue=!1,$s=!1,zl=typeof WeakSet=="function"?WeakSet:Set,oa=null;function Ja(t,e){if(t=t.containerInfo,F1=om,t=Kc(t),vr(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else t:{l=(l=t.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var f=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break t}var C=0,z=-1,O=-1,Q=0,it=0,ct=t,K=null;e:for(;;){for(var $;ct!==l||f!==0&&ct.nodeType!==3||(z=C+f),ct!==g||c!==0&&ct.nodeType!==3||(O=C+c),ct.nodeType===3&&(C+=ct.nodeValue.length),($=ct.firstChild)!==null;)K=ct,ct=$;for(;;){if(ct===t)break e;if(K===l&&++Q===f&&(z=C),K===g&&++it===c&&(O=C),($=ct.nextSibling)!==null)break;ct=K,K=ct.parentNode}ct=$}l=z===-1||O===-1?null:{start:z,end:O}}else l=null}l=l||{start:0,end:0}}else l=null;for(P1={focusedElem:t,selectionRange:l},om=!1,oa=e;oa!==null;)if(e=oa,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,oa=t;else for(;oa!==null;){switch(e=oa,g=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l title"))),ri(g,c,l),g[D]=t,ga(g),c=g;break t;case"link":var C=Nv("link","href",f).get(c+(l.href||""));if(C){for(var z=0;zHe&&(C=He,He=Jt,Jt=C);var X=Pd(z,Jt),H=Pd(z,He);if(X&&H&&($.rangeCount!==1||$.anchorNode!==X.node||$.anchorOffset!==X.offset||$.focusNode!==H.node||$.focusOffset!==H.offset)){var W=ct.createRange();W.setStart(X.node,X.offset),$.removeAllRanges(),Jt>He?($.addRange(W),$.extend(H.node,H.offset)):(W.setEnd(H.node,H.offset),$.addRange(W))}}}}for(ct=[],$=z;$=$.parentNode;)$.nodeType===1&&ct.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;zl?32:l,nt.T=null,l=ea,ea=null;var g=qn,C=bn;if(ra=0,Je=qn=null,bn=0,(oe&6)!==0)throw Error(d(331));var z=oe;if(oe|=4,iu(g.current),eu(g,g.current,C,l),oe=z,i(0,!1),Da&&typeof Da.onPostCommitFiberRoot=="function")try{Da.onPostCommitFiberRoot(Mn,g)}catch{}return!0}finally{et.p=f,nt.T=c,gc(t,e)}}function xo(t,e,l){e=mi(l,e),e=Ri(t.stateNode,e,2),t=Cl(t,e,2),t!==null&&(Zl(t,2),a(t))}function _e(t,e,l){if(t.tag===3)xo(t,t,l);else for(;e!==null;){if(e.tag===3){xo(e,t,l);break}else if(e.tag===1){var c=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Nl===null||!Nl.has(c))){t=mi(l,t),l=Gh(2),c=Cl(e,l,2),c!==null&&(Zr(l,c,e,t),Zl(c,2),a(c));break}}e=e.return}}function cu(t,e,l){var c=t.pingCache;if(c===null){c=t.pingCache=new Fi;var f=new Set;c.set(e,f)}else f=c.get(e),f===void 0&&(f=new Set,c.set(e,f));f.has(l)||(Fe=!0,f.add(l),t=id.bind(null,t,e,l),e.then(t,t))}function id(t,e,l){var c=t.pingCache;c!==null&&c.delete(e),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,Te===t&&(ee&l)===l&&(At===4||At===3&&(ee&62914560)===ee&&300>Na()-Fr?(oe&2)===0&&Tl(t,0):oc|=l,Pi===ee&&(Pi=0)),a(t)}function wl(t,e){e===0&&(e=wn()),t=Ql(t,e),t!==null&&(Zl(t,e),a(t))}function Ea(t){var e=t.memoizedState,l=0;e!==null&&(l=e.retryLane),wl(t,l)}function vs(t,e){var l=0;switch(t.tag){case 31:case 13:var c=t.stateNode,f=t.memoizedState;f!==null&&(l=f.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(d(314))}c!==null&&c.delete(e),wl(t,l)}function pc(t,e){return ii(t,e)}var $i=null,ys=null,_o=!1,Eo=!1,ou=!1,Kn=0;function a(t){t!==ys&&t.next===null&&(ys===null?$i=ys=t:ys=ys.next=t),Eo=!0,_o||(_o=!0,R())}function i(t,e){if(!ou&&Eo){ou=!0;do for(var l=!1,c=$i;c!==null;){if(!e)if(t!==0){var f=c.pendingLanes;if(f===0)var g=0;else{var C=c.suspendedLanes,z=c.pingedLanes;g=(1<<31-Qa(42|t)+1)-1,g&=f&~(C&~z),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(l=!0,E(c,g))}else g=ee,g=An(c,c===Te?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||nl(c,g)||(l=!0,E(c,g));c=c.next}while(l);ou=!1}}function o(){h()}function h(){Eo=_o=!1;var t=0;Kn!==0&&Cb()&&(t=Kn);for(var e=Na(),l=null,c=$i;c!==null;){var f=c.next,g=v(c,e);g===0?(c.next=null,l===null?$i=f:l.next=f,f===null&&(ys=l)):(l=c,(t!==0||(g&3)!==0)&&(Eo=!0)),c=f}ra!==0&&ra!==5||i(t,!1),Kn!==0&&(Kn=0)}function v(t,e){for(var l=t.suspendedLanes,c=t.pingedLanes,f=t.expirationTimes,g=t.pendingLanes&-62914561;0z)break;var it=O.transferSize,ct=O.initiatorType;it&&hv(ct)&&(O=O.responseEnd,C+=it*(O"u"?null:document;function _v(t,e,l){var c=nd;if(c&&typeof e=="string"&&e){var f=ka(e);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),xv.has(f)||(xv.add(f),t={rel:t,crossOrigin:l,href:e},c.querySelector(f)===null&&(e=c.createElement("link"),ri(e,"link",t),ga(e),c.head.appendChild(e)))}}function Ab(t){ru.D(t),_v("dns-prefetch",t,null)}function wb(t,e){ru.C(t,e),_v("preconnect",t,e)}function Ob(t,e,l){ru.L(t,e,l);var c=nd;if(c&&t&&e){var f='link[rel="preload"][as="'+ka(e)+'"]';e==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+ka(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+ka(l.imageSizes)+'"]')):f+='[href="'+ka(t)+'"]';var g=f;switch(e){case"style":g=ld(t);break;case"script":g=sd(t)}Fn.has(g)||(t=M({rel:"preload",href:e==="image"&&l&&l.imageSrcSet?void 0:t,as:e},l),Fn.set(g,t),c.querySelector(f)!==null||e==="style"&&c.querySelector(Qh(g))||e==="script"&&c.querySelector(qh(g))||(e=c.createElement("link"),ri(e,"link",t),ga(e),c.head.appendChild(e)))}}function Yb(t,e){ru.m(t,e);var l=nd;if(l&&t){var c=e&&typeof e.as=="string"?e.as:"script",f='link[rel="modulepreload"][as="'+ka(c)+'"][href="'+ka(t)+'"]',g=f;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=sd(t)}if(!Fn.has(g)&&(t=M({rel:"modulepreload",href:t},e),Fn.set(g,t),l.querySelector(f)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(qh(g)))return}c=l.createElement("link"),ri(c,"link",t),ga(c),l.head.appendChild(c)}}}function Rb(t,e,l){ru.S(t,e,l);var c=nd;if(c&&t){var f=Xl(c).hoistableStyles,g=ld(t);e=e||"default";var C=f.get(g);if(!C){var z={loading:0,preload:null};if(C=c.querySelector(Qh(g)))z.loading=5;else{t=M({rel:"stylesheet",href:t,"data-precedence":e},l),(l=Fn.get(g))&&lg(t,l);var O=C=c.createElement("link");ga(O),ri(O,"link",t),O._p=new Promise(function(Q,it){O.onload=Q,O.onerror=it}),O.addEventListener("load",function(){z.loading|=1}),O.addEventListener("error",function(){z.loading|=2}),z.loading|=4,nm(C,e,c)}C={type:"stylesheet",instance:C,count:1,state:z},f.set(g,C)}}}function jb(t,e){ru.X(t,e);var l=nd;if(l&&t){var c=Xl(l).hoistableScripts,f=sd(t),g=c.get(f);g||(g=l.querySelector(qh(f)),g||(t=M({src:t,async:!0},e),(e=Fn.get(f))&&sg(t,e),g=l.createElement("script"),ga(g),ri(g,"link",t),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(f,g))}}function Gb(t,e){ru.M(t,e);var l=nd;if(l&&t){var c=Xl(l).hoistableScripts,f=sd(t),g=c.get(f);g||(g=l.querySelector(qh(f)),g||(t=M({src:t,async:!0,type:"module"},e),(e=Fn.get(f))&&sg(t,e),g=l.createElement("script"),ga(g),ri(g,"link",t),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(f,g))}}function Ev(t,e,l,c){var f=(f=Bt.current)?im(f):null;if(!f)throw Error(d(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(e=ld(l.href),l=Xl(f).hoistableStyles,c=l.get(e),c||(c={type:"style",instance:null,count:0,state:null},l.set(e,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=ld(l.href);var g=Xl(f).hoistableStyles,C=g.get(t);if(C||(f=f.ownerDocument||f,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,C),(g=f.querySelector(Qh(t)))&&!g._p&&(C.instance=g,C.state.loading=5),Fn.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Fn.set(t,l),g||Hb(f,t,l,C.state))),e&&c===null)throw Error(d(528,""));return C}if(e&&c!==null)throw Error(d(529,""));return null;case"script":return e=l.async,l=l.src,typeof l=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=sd(l),l=Xl(f).hoistableScripts,c=l.get(e),c||(c={type:"script",instance:null,count:0,state:null},l.set(e,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,t))}}function ld(t){return'href="'+ka(t)+'"'}function Qh(t){return'link[rel="stylesheet"]['+t+"]"}function zv(t){return M({},t,{"data-precedence":t.precedence,precedence:null})}function Hb(t,e,l,c){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?c.loading=1:(e=t.createElement("link"),c.preload=e,e.addEventListener("load",function(){return c.loading|=1}),e.addEventListener("error",function(){return c.loading|=2}),ri(e,"link",l),ga(e),t.head.appendChild(e))}function sd(t){return'[src="'+ka(t)+'"]'}function qh(t){return"script[async]"+t}function Mv(t,e,l){if(e.count++,e.instance===null)switch(e.type){case"style":var c=t.querySelector('style[data-href~="'+ka(l.href)+'"]');if(c)return e.instance=c,ga(c),c;var f=M({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),ga(c),ri(c,"style",f),nm(c,l.precedence,t),e.instance=c;case"stylesheet":f=ld(l.href);var g=t.querySelector(Qh(f));if(g)return e.state.loading|=4,e.instance=g,ga(g),g;c=zv(l),(f=Fn.get(f))&&lg(c,f),g=(t.ownerDocument||t).createElement("link"),ga(g);var C=g;return C._p=new Promise(function(z,O){C.onload=z,C.onerror=O}),ri(g,"link",c),e.state.loading|=4,nm(g,l.precedence,t),e.instance=g;case"script":return g=sd(l.src),(f=t.querySelector(qh(g)))?(e.instance=f,ga(f),f):(c=l,(f=Fn.get(g))&&(c=M({},l),sg(c,f)),t=t.ownerDocument||t,f=t.createElement("script"),ga(f),ri(f,"link",c),t.head.appendChild(f),e.instance=f);case"void":return null;default:throw Error(d(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(c=e.instance,e.state.loading|=4,nm(c,l.precedence,t));return e.instance}function nm(t,e,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=c.length?c[c.length-1]:null,g=f,C=0;C title"):null)}function Db(t,e,l){if(l===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Av(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Ib(t,e,l,c){if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=ld(c.href),g=e.querySelector(Qh(f));if(g){e=g._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=sm.bind(t),e.then(t,t)),l.state.loading|=4,l.instance=g,ga(g);return}g=e.ownerDocument||e,c=zv(c),(f=Fn.get(f))&&lg(c,f),g=g.createElement("link"),ga(g);var C=g;C._p=new Promise(function(z,O){C.onload=z,C.onerror=O}),ri(g,"link",c),l.instance=g}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,e),(e=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=sm.bind(t),e.addEventListener("load",l),e.addEventListener("error",l))}}var ug=0;function Zb(t,e){return t.stylesheets&&t.count===0&&cm(t,t.stylesheets),0ug?50:800)+e);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(f)}}:null}function sm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cm(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var um=null;function cm(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,um=new Map,e.forEach(Jb,t),um=null,sm.call(t))}function Jb(t,e){if(!(e.state.loading&4)){var l=um.get(t);if(l)var c=l.get(null);else{l=new Map,um.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g{function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(r){console.error(r)}}u(),s.exports=$v()})),e4=Di((n=>{var s=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function r(d,m,p){var y=null;if(p!==void 0&&(y=""+p),m.key!==void 0&&(y=""+m.key),"key"in m){p={};for(var S in m)S!=="key"&&(p[S]=m[S])}else p=m;return m=p.ref,{$$typeof:s,type:d,key:y,ref:m!==void 0?m:null,props:p}}n.Fragment=u,n.jsx=r,n.jsxs=r})),pg=Di(((n,s)=>{s.exports=e4()})),a4=t4(),Kt=xc(Cs(),1),Y=pg();function i4(n){const s=(0,Kt.lazy)(async()=>({default:await n()}));return function(r){return(0,Y.jsx)(Kt.Suspense,{fallback:null,children:(0,Y.jsx)(s,{...r})})}}var Mo=["none","silver","multicolor"],Pn=[{id:"p01",code:"P-01",kind:"Single",label:"สีเดียว",tones:1},{id:"p02",code:"P-02",kind:"2 Tone",label:"แบ่งซ้ายขวา",tones:2},{id:"p03",code:"P-03",kind:"2 Tone",label:"สามแฉก",tones:2},{id:"p04",code:"P-04",kind:"3 Tone",label:"ซ้าย กลาง ขวา",tones:3},{id:"p05",code:"P-05",kind:"2 Tone",label:"หกแฉก",tones:2},{id:"p06",code:"P-06",kind:"2 Tone",label:"แบ่งบนล่าง",tones:2},{id:"p07",code:"P-07",kind:"Single",label:"ไล่ใส",tones:1},{id:"p08",code:"P-08",kind:"2 Tone",label:"ไล่เฉดบนลงล่าง",tones:2}],Ln=[{code:"Y01",name:"เหลืองนีออน",hex:"#E7FF1E"},{code:"Y02",name:"เหลืองทานตะวัน",hex:"#F1D20A"},{code:"Y03",name:"เหลืองราชพฤกษ์",hex:"#FFF11A"},{code:"O01",name:"ส้มคอร์เดีย",hex:"#CE722F"},{code:"R01",name:"แดงกุหลาบ",hex:"#F3223A"},{code:"R02",name:"แดงป็อปปี้",hex:"#FF3131"},{code:"R03",name:"แดงคอสมอส",hex:"#D6293F"},{code:"P01",name:"ชมพูบานเย็น",hex:"#F254B6"},{code:"P02",name:"ชมพูซากุระ",hex:"#F6B9D2"},{code:"G01",name:"เขียวอ่อนไบเตย",hex:"#72B74E"},{code:"G02",name:"เขียวเข้มมรกต",hex:"#199163"},{code:"B01",name:"ฟ้าโทแพซ",hex:"#91A3BB"},{code:"B02",name:"น้ำเงินรอยัล",hex:"#4866AC"},{code:"B03",name:"ฟ้าเทอร์ควอยซ์",hex:"#5AA1B5"},{code:"BL01",name:"น้ำเงินกรมท่า",hex:"#0B2A52"},{code:"BL02",name:"น้ำเงินเข้ม",hex:"#1B4FA0"},{code:"PU01",name:"ม่วงไลแลค",hex:"#B369A8"},{code:"PU02",name:"ม่วงไวน์",hex:"#6755C5"},{code:"BK01",name:"ดำสนิท",hex:"#141414"},{code:"C01",name:"ใส",hex:"#F7F5F0"},{code:"C02",name:"เบจ",hex:"#CCA996"}],_c=["ลายเพลต","สีเพลต","กลิตเตอร์","ลายหุ้มลวด","สีหุ้มลวด","สติกเกอร์","สรุปดีไซน์"],Ec=n=>Ln.find(s=>s.code===n)??Ln[0];function ef(){return{plate:{pattern:"p01",colors:[Ec("P01"),Ec("R01"),Ec("C02")]},cover:{pattern:"p01",colors:[Ec("C02"),Ec("P01"),Ec("R01")]},glitter:"none",coverGlitter:"none",stickerChoices:[null,null,null],pieces:[]}}function pm(n,s){const[u,r,d]=s.map(m=>m.hex);return n==="p02"?`linear-gradient(90deg,${u} 0 44%,${r} 56% 100%)`:n==="p03"?`conic-gradient(from 306deg at 50% 70%,${r} 0 30deg,${u} 42deg 66deg,${r} 78deg 360deg)`:n==="p04"?`linear-gradient(90deg,${u} 0 28%,${r} 38% 62%,${d} 72% 100%)`:n==="p05"?`conic-gradient(from 300deg at 50% 70%,${u} 0 15deg,${r} 21deg 33deg,${u} 39deg 51deg,${r} 57deg 69deg,${u} 75deg 87deg,${r} 93deg 105deg,${u} 111deg 360deg)`:n==="p06"?`linear-gradient(180deg,${u} 0 40%,${r} 52% 100%)`:n==="p07"?`linear-gradient(180deg,rgba(255,255,255,.92),${u} 92%)`:n==="p08"?`linear-gradient(180deg,${u},${r})`:u}function od(n){return Pn.find(s=>s.id===n)??Pn[0]}function _i(n){return Ec(n)}var af="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",nf=62,vg="A",vm=12,yg=7,bg=7,lf=10,ym=6,n4=360/ym,Sg=(n,s,u)=>Math.min(u,Math.max(s,n)),Ol=(n,s)=>{let u=Math.max(0,Math.round(n)),r="";for(let d=0;d{let s=0;for(const u of n){const r=af.indexOf(u);if(r<0)return null;s=s*nf+r}return s},Cg=n=>{let s=0;for(const u of n)s=(s+af.indexOf(u))%nf;return af[s]},l4=n=>(n.match(/.{1,4}/g)??[n]).join("-"),sf=n=>n.replace(/[^0-9A-Za-z]/g,"");function s4(n,s){const u=(p,y)=>{const S=p.findIndex(y);return S<0?0:S},r=p=>Ol(u(Ln,y=>y.code===p),1),d=n.pieces.slice(0,bg);let m=vg+Ol(u(Pn,p=>p.id===n.plate.pattern),1)+n.plate.colors.slice(0,3).map(p=>r(p.code)).join("")+Ol(u(Pn,p=>p.id===n.cover.pattern),1)+n.cover.colors.slice(0,3).map(p=>r(p.code)).join("")+Ol(Math.max(0,Mo.indexOf(n.glitter)),1)+Ol(Math.max(0,Mo.indexOf(n.coverGlitter)),1)+Ol(d.length,1);for(const p of d){const y=u(s,x=>x.id===p.sticker.id),S=Math.round((p.rotation%360+360)%360/ym)%n4;m+=Ol(y,2)+Ol(Sg(p.x,0,100)*lf,2)+Ol(Sg(p.y,0,100)*lf,2)+Ol(S,1)}return l4(m+Cg(m))}function u4(n,s,u){const r=sf(n);if(!r)return{ok:!1,reason:"กรุณากรอกโค้ดดีไซน์"};if(r[0]!==vg)return{ok:!1,reason:"โค้ดนี้มาจากเวอร์ชันอื่น"};if(r.lengthbg)return{ok:!1,reason:"โค้ดไม่ถูกต้อง"};if(d.length!==vm+m*yg)return{ok:!1,reason:"โค้ดไม่ครบถ้วน"};const p=(G,V)=>{const U=No(d.slice(G,G+1));return U===null||U>=V?null:U},y=p(1,Pn.length),S=p(5,Pn.length),x=p(9,Mo.length),L=p(10,Mo.length);if(y===null||S===null||x===null||L===null)return{ok:!1,reason:"โค้ดไม่ถูกต้อง"};const _=G=>{const V=[0,1,2].map(U=>p(G+U,Ln.length));return V.some(U=>U===null)?null:V.map(U=>Ln[U])},M=_(2),w=_(6);if(!M||!w)return{ok:!1,reason:"โค้ดไม่ถูกต้อง"};const N=ef();N.plate={pattern:Pn[y].id,colors:M},N.cover={pattern:Pn[S].id,colors:w},N.glitter=Mo[x],N.coverGlitter=Mo[L],N.pieces=[];let J=0;for(let G=0;G=3)break;q.some(V=>V?.id===G.sticker.id)||q.push(G.sticker)}for(;q.length<3;)q.push(null);return N.stickerChoices=q,{ok:!0,design:N,missingStickers:J}}var c4=[{id:"smile-and-go",title:"ยิ้มปุ๊บเที่ยวปั๊บ",desc:"เก็บบรรยากาศวันหยุดไว้ในทุกยิ้ม กับลาย Smile & Go สำหรับคนที่พร้อมออกเดินทาง",image:"https://www.smileseasons.com/wp-content/uploads/2026/09/smile-and-go-retainer.webp",isNew:!0},{id:"design-1",title:"อุ๊ย! เชอร์รี่",desc:"แดงสด หวานฉ่ำ และขี้เล่น เติมพลังเชอร์รี่ให้ทุกครั้งที่ยิ้ม",image:"https://www.smileseasons.com/wp-content/uploads/2026/08/opp-cherry.webp",isNew:!0},{id:"design-2",title:"มะแมว",desc:"ยิ้มธรรมดาโลกไม่จำ ยิ้มลายมะแมวมะม่วงฉ่ำๆ โลกจำแน่นอน",image:"https://www.smileseasons.com/wp-content/uploads/2026/06/mamaew_retainer.webp",isNew:!1},{id:"back-to-school",title:"Back to School",desc:"เติมสีสันให้วันเปิดเทอม ด้วยลายสนุกที่ดูสดใสทุกครั้งที่ยิ้ม",image:"https://www.smileseasons.com/wp-content/uploads/2026/05/Backtoschool.webp",isNew:!1},{id:"songkran",title:"สงกรานต์ (Songkran)",desc:"สาดความสดใสรับซัมเมอร์ ชุ่มฉ่ำไปกับรอยยิ้มของคุณ",image:"https://www.smileseasons.com/wp-content/uploads/2026/04/สงกรานต์รีเทนเนอร์_Website.webp",isNew:!1},{id:"popcorn",title:"Popcorn",desc:"เพลิดเพลินกับความสดใสและสนุกสุดเหวี่ยง เหมือนกำลังดูหนังเรื่องโปรด",image:"https://www.smileseasons.com/wp-content/uploads/2026/03/Popcornne_website1-scaled.webp",isNew:!1},{id:"design-6",title:"วาเลนไทน์",desc:"เติมความหวานและความรักให้รอยยิ้มของคุณ",image:"https://www.smileseasons.com/wp-content/uploads/2026/02/วาเลนไทน์-website-scaled.webp",isNew:!1},{id:"after-party",title:"After Party",desc:"ลายโทนเข้มที่ยังซ่อนประกายสนุก ๆ ไว้ทุกมุม",image:"https://www.smileseasons.com/wp-content/uploads/2026/02/AfterParty_website-scaled.webp",isNew:!1},{id:"ho-ho-ho",title:"Ho Ho Ho!",desc:"ฉลองเทศกาลแห่งความสุขด้วยรอยยิ้มจากซานต้า",image:"https://www.smileseasons.com/wp-content/uploads/2025/12/HoHoHo3-1.webp",isNew:!1},{id:"black-magic",title:"Black Magic",desc:"ทำทุกคนต้องมนต์สะกดด้วยรอยยิ้มของคุณ",image:"https://www.smileseasons.com/wp-content/uploads/2026/01/Black-Magic.webp",isNew:!1},{id:"my-smile",title:"My Smile",desc:"ลายน่ารักที่บอกความเป็นคุณได้แบบไม่ซ้ำใคร",image:"https://www.smileseasons.com/wp-content/uploads/2025/11/mysmile_website.webp",isNew:!1},{id:"sunday-beach",title:"Sunday Beach",desc:"รอยยิ้มสดใสเหมือนพักผ่อนกลางคลื่นทะเล",image:"https://www.smileseasons.com/wp-content/uploads/2025/10/SundayBeach_website.webp",isNew:!1},{id:"design-12",title:"เทรุ เทรุ",desc:"ตุ๊กตาไล่ฝนนำพาความสดใสมาให้ทุกวัน",image:"https://www.smileseasons.com/wp-content/uploads/2025/09/Teru4.webp",isNew:!1},{id:"deep-blue-sea",title:"Deep Blue Sea",desc:"ดำดิ่งสู่ความลึกลับของมหาสมุทรสีคราม",image:"https://www.smileseasons.com/wp-content/uploads/2025/06/2.webp",isNew:!1},{id:"sunny-sky",title:"Sunny Sky",desc:"ท้องฟ้าที่สดใสในวันที่แดดจ้าและเมฆสวย",image:"https://www.smileseasons.com/wp-content/uploads/2025/06/1.webp",isNew:!1},{id:"design-15",title:"แคนดี้",desc:"หวานน่ารักไปกับโลกของลูกกวาดหลากสี",image:"https://www.smileseasons.com/wp-content/uploads/2021/07/candy2-100.jpg",isNew:!1},{id:"pride",title:"Pride",desc:"เฉลิมฉลองความหลากหลายและความเท่าเทียม",image:"https://www.smileseasons.com/wp-content/uploads/2023/06/Pride-1080-2.png",isNew:!1},{id:"design-17",title:"กาแล็คซี่",desc:"เดินทางข้ามหมู่ดาวในจักรวาลอันกว้างใหญ่",image:"https://www.smileseasons.com/wp-content/uploads/2021/07/galaxy2-100.jpg",isNew:!1},{id:"design-18",title:"น้องส้มจี๊ด",desc:"ความเปรี้ยวซ่าและความสดใสของผลส้ม",image:"https://www.smileseasons.com/wp-content/uploads/2023/06/%E0%B8%99%E0%B9%89%E0%B8%AD%E0%B8%87%E0%B8%AA%E0%B9%89%E0%B8%A1%E0%B8%88%E0%B8%B5%E0%B9%8A%E0%B8%94%E0%B8%94%E0%B8%94%E0%B8%94%E0%B8%94-1080-2.png",isNew:!1},{id:"design-19",title:"บลู ฮาวาย",desc:"สัมผัสบรรยากาศทะเลฮาวายกับเครื่องดื่มแก้วโปรด",image:"https://www.smileseasons.com/wp-content/uploads/2020/09/bluehawaii@0.5x-80.jpg",isNew:!1},{id:"design-20",title:"แตงโม",desc:"ความสดชื่นหวานฉ่ำของแตงโมในฤดูร้อน",image:"https://www.smileseasons.com/wp-content/uploads/2017/11/watermelon@0.5x-100.jpg",isNew:!1},{id:"design-21",title:"แก้วมังกร",desc:"เสน่ห์ที่เป็นเอกลักษณ์ของผลไม้สีชมพูสด",image:"https://www.smileseasons.com/wp-content/uploads/2017/11/dragon@0.5x-100.jpg",isNew:!1},{id:"design-22",title:"กีวี",desc:"ความเปรี้ยวอมหวานที่มาพร้อมความสดชื่น",image:"https://www.smileseasons.com/wp-content/uploads/2017/11/kiwi-100.jpg",isNew:!1},{id:"design-23",title:"วุ้นใสผลไม้",desc:"รวมความอร่อยของผลไม้นานาชนิดในวุ้นใส",image:"https://www.smileseasons.com/wp-content/uploads/2017/11/jelly-100.jpg",isNew:!1},{id:"design-24",title:"ขบวนการห้าสี",desc:"รวมพลังฮีโร่หลากสีสันเพื่อปกป้องรอยยิ้ม",image:"https://www.smileseasons.com/wp-content/uploads/2017/11/pentacolor-100.jpg",isNew:!1},{id:"design-25",title:"สตรอว์เบอร์รี",desc:"ความหอมหวานที่เป็นที่ชื่นชอบของทุกคน",image:"https://www.smileseasons.com/wp-content/uploads/2017/11/Artboard-1-100.jpg",isNew:!1},{id:"strawberry-2",title:"สตรอว์เบอร์รี 2",desc:"เพิ่มความหวานฉ่ำให้รอยยิ้มอีกระดับ",image:"https://www.smileseasons.com/wp-content/uploads/2020/02/strawberry02-50.jpg",isNew:!1},{id:"design-27",title:"น้องเสือโคร่ง",desc:"ลวดลายที่สง่างามและน่าเกรงขามของเจ้าป่า",image:"https://www.smileseasons.com/wp-content/uploads/2017/11/tiger-100.jpg",isNew:!1},{id:"design-28",title:"รักเมืองไทย",desc:"ความภาคภูมิใจในสีธงชาติไทย",image:"https://www.smileseasons.com/wp-content/uploads/2017/11/Thaiflag@0.5x-100.jpg",isNew:!1},{id:"design-29",title:"ยูนิคอร์น",desc:"เวทมนตร์มหัศจรรย์จากดินแดนแห่งเทพนิยาย",image:"https://www.smileseasons.com/wp-content/uploads/2017/11/unicorn@0.5x-100.jpg",isNew:!1},{id:"design-30",title:"น้องเต่าทอง",desc:"แมลงตัวน้อยผู้นำโชคและความน่ารัก",image:"https://www.smileseasons.com/wp-content/uploads/2020/02/ladyBug-100.jpg",isNew:!1},{id:"design-31",title:"ชมพูฟ้าเสมา",desc:"สีสันอันเป็นเอกลักษณ์ของสถาบันการศึกษา",image:"https://www.smileseasons.com/wp-content/uploads/2017/11/sema@0.5x-100.jpg",isNew:!1}],Lg="ssdc-retainer-measurement-session",xg="ssdc-retainer-first-touch",o4="smile_seasons_retainer_designer",r4="release_1_measurement_v1",d4=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","ttclid","msclkid"],_g=null,bm=0,Eg=0,uf=!1,rd=!1;function h4(){if(!document.referrer)return"";try{const n=new URL(document.referrer);return`${n.origin}${n.pathname}`}catch{return""}}function Sm(n){return typeof crypto<"u"&&"randomUUID"in crypto?`${n}-${crypto.randomUUID()}`:`${n}-${Date.now()}-${Math.random().toString(36).slice(2)}`}function f4(){try{const n=sessionStorage.getItem(Lg);if(n)return n;const s=Sm("session");return sessionStorage.setItem(Lg,s),s}catch{return Sm("session")}}function m4(n){const s=Object.fromEntries(d4.flatMap(r=>{const d=n.get(r);return d?[[r,d]]:[]}));let u={};try{const r=localStorage.getItem(xg);r&&(u=JSON.parse(r)),!r&&Object.keys(s).length>0&&(u=s,localStorage.setItem(xg,JSON.stringify(s)))}catch{u=s}return{...Object.fromEntries(Object.entries(u).map(([r,d])=>[`first_${r}`,d])),...s}}function g4(n,s){typeof window>"u"||(Eg=performance.now(),bm=0,uf=!1,rd=!1,_g={app_name:o4,app_version:r4,session_id:f4(),embed_mode:s.embed?"elementor":"standalone",preset:s.preset,page_path:window.location.pathname,page_referrer:h4(),device_category:window.matchMedia("(max-width: 900px)").matches?"mobile":"desktop",...m4(n)})}function Pe(n,s={}){if(typeof window>"u")return;bm+=1;const u={..._g,...s,event:n,event_id:Sm("event"),event_sequence:bm,event_time:new Date().toISOString(),engagement_time_msec:Math.max(0,Math.round(performance.now()-Eg))};window.dataLayer=window.dataLayer??[],window.dataLayer.push(u),window.parent!==window&&window.parent.postMessage({type:"ssdc-retainer-analytics",payload:u},"*"),window.dispatchEvent(new CustomEvent("ssdc-retainer-analytics",{detail:u}))}function Yl(n){rd=!1,!uf&&(uf=!0,Pe("retainer_design_started",{source:n}))}function p4(n){rd||(rd=!0,Pe("retainer_design_completed",n))}function zg(){uf=!1,rd=!1}function v4(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}var Mg,du,vt,$e,Ce=Et((()=>{Mg=Math.PI/180,du=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},vt={_global:du,version:"10.3.0",isBrowser:v4(),isUnminified:/param/.test(function(n){}.toString()),dblClickWindow:400,getAngle(n){return vt.angleDeg?n*Mg:n},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return vt.DD.isDragging},isTransforming(){var n,s;return(s=(n=vt.Transformer)===null||n===void 0?void 0:n.isTransforming())!==null&&s!==void 0?s:!1},isDragReady(){return!!vt.DD.node},releaseCanvasOnDestroy:!0,document:du.document,_injectGlobal(n){typeof du.Konva<"u"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),du.Konva=n}},$e=n=>{vt[n.prototype.getClassName()]=n},vt._injectGlobal(vt)})),Ng,Cm,xn,Tg,Ag,wg,Og,Yg,Rg,To,jg,Gg,Hg,Lm,Dg,cf,Ig,dd,Ao,Zg,Z,ha=Et((()=>{Ce(),Ng=`Konva.js unsupported environment.
Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
bash: npm install canvas
js: import "konva/canvas-backend";
or
bash: npm install skia-canvas
js: import "konva/skia-backend";
`,Cm=()=>{if(typeof document>"u")throw new Error(Ng)},xn=class Jv{constructor(s=[1,0,0,1,0,0]){this.dirty=!1,this.m=s&&s.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 Jv(this.m)}copyInto(s){s.m[0]=this.m[0],s.m[1]=this.m[1],s.m[2]=this.m[2],s.m[3]=this.m[3],s.m[4]=this.m[4],s.m[5]=this.m[5]}point(s){const u=this.m;return{x:u[0]*s.x+u[2]*s.y+u[4],y:u[1]*s.x+u[3]*s.y+u[5]}}translate(s,u){return this.m[4]+=this.m[0]*s+this.m[2]*u,this.m[5]+=this.m[1]*s+this.m[3]*u,this}scale(s,u){return this.m[0]*=s,this.m[1]*=s,this.m[2]*=u,this.m[3]*=u,this}rotate(s){const u=Math.cos(s),r=Math.sin(s),d=this.m[0]*u+this.m[2]*r,m=this.m[1]*u+this.m[3]*r,p=this.m[0]*-r+this.m[2]*u,y=this.m[1]*-r+this.m[3]*u;return this.m[0]=d,this.m[1]=m,this.m[2]=p,this.m[3]=y,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(s,u){const r=this.m[0]+this.m[2]*u,d=this.m[1]+this.m[3]*u,m=this.m[2]+this.m[0]*s,p=this.m[3]+this.m[1]*s;return this.m[0]=r,this.m[1]=d,this.m[2]=m,this.m[3]=p,this}multiply(s){const u=this.m[0]*s.m[0]+this.m[2]*s.m[1],r=this.m[1]*s.m[0]+this.m[3]*s.m[1],d=this.m[0]*s.m[2]+this.m[2]*s.m[3],m=this.m[1]*s.m[2]+this.m[3]*s.m[3],p=this.m[0]*s.m[4]+this.m[2]*s.m[5]+this.m[4],y=this.m[1]*s.m[4]+this.m[3]*s.m[5]+this.m[5];return this.m[0]=u,this.m[1]=r,this.m[2]=d,this.m[3]=m,this.m[4]=p,this.m[5]=y,this}invert(){const s=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),u=this.m[3]*s,r=-this.m[1]*s,d=-this.m[2]*s,m=this.m[0]*s,p=s*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),y=s*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=u,this.m[1]=r,this.m[2]=d,this.m[3]=m,this.m[4]=p,this.m[5]=y,this}getMatrix(){return this.m}decompose(){const s=this.m[0],u=this.m[1],r=this.m[2],d=this.m[3],m=this.m[4],p=this.m[5],y=s*d-u*r,S={x:m,y:p,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(s!=0||u!=0){const x=Math.sqrt(s*s+u*u);S.rotation=u>0?Math.acos(s/x):-Math.acos(s/x),S.scaleX=x,S.scaleY=y/x,S.skewX=(s*r+u*d)/y,S.skewY=0}else if(r!=0||d!=0){const x=Math.sqrt(r*r+d*d);S.rotation=Math.PI/2-(d>0?Math.acos(-r/x):-Math.acos(r/x)),S.scaleX=y/x,S.scaleY=x,S.skewX=0,S.skewY=(s*r+u*d)/y}return S.rotation=Z._getRotation(S.rotation),S}},Tg="[object Array]",Ag="[object Number]",wg="[object String]",Og="[object Boolean]",Yg=Math.PI/180,Rg=180/Math.PI,To="#",jg="",Gg="0",Hg="Konva warning: ",Lm="Konva error: ",Dg="rgb(",cf={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]},Ig=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,dd=[],Ao=null,Zg=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(n){setTimeout(n,16)},Z={_isElement(n){return!!(n&&n.nodeType==1)},_isFunction(n){return!!(n&&n.constructor&&n.call&&n.apply)},_isPlainObject(n){return!!n&&n.constructor===Object},_isArray(n){return Object.prototype.toString.call(n)===Tg},_isNumber(n){return Object.prototype.toString.call(n)===Ag&&!isNaN(n)&&isFinite(n)},_isString(n){return Object.prototype.toString.call(n)===wg},_isBoolean(n){return Object.prototype.toString.call(n)===Og},isObject(n){return n instanceof Object},isValidSelector(n){if(typeof n!="string")return!1;const s=n[0];return s==="#"||s==="."||s===s.toUpperCase()},_sign(n){return n===0||n>0?1:-1},requestAnimFrame(n){dd.push(n),dd.length===1&&Zg(function(){const s=dd;dd=[],s.forEach(function(u){u()})})},createCanvasElement(){Cm();const n=document.createElement("canvas");try{n.style=n.style||{}}catch{}return n},createImageElement(){return Cm(),document.createElement("img")},_isInDocument(n){for(;n=n.parentNode;)if(n==document)return!0;return!1},_urlToImage(n,s){const u=Z.createImageElement();u.onload=function(){s(u)},u.src=n},_rgbToHex(n,s,u){return((1<<24)+(n<<16)+(s<<8)+u).toString(16).slice(1)},_hexToRgb(n){n=n.replace(To,jg);const s=parseInt(n,16);return{r:s>>16&255,g:s>>8&255,b:s&255}},getRandomColor(){let n=(Math.random()*16777215<<0).toString(16);for(;n.length<6;)n=Gg+n;return To+n},isCanvasFarblingActive(){if(Ao!==null)return Ao;if(typeof document>"u")return Ao=!1,!1;const n=this.createCanvasElement();n.width=10,n.height=10;const s=n.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,10,10),s.fillStyle="#282828",s.fillRect(0,0,10,10);const u=s.getImageData(0,0,10,10).data;let r=!1;for(let d=0;d<100;d++)if(u[d*4]!==40||u[d*4+1]!==40||u[d*4+2]!==40||u[d*4+3]!==255){r=!0;break}return Ao=r,this.releaseCanvas(n),Ao},getHitColor(){const n=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(n):n},getHitColorKey(n,s,u){return this.isCanvasFarblingActive()&&(n=Math.round(n/5)*5,s=Math.round(s/5)*5,u=Math.round(u/5)*5),To+this._rgbToHex(n,s,u)},getSnappedHexColor(n){const s=this._hexToRgb(n);return To+this._rgbToHex(Math.round(s.r/5)*5,Math.round(s.g/5)*5,Math.round(s.b/5)*5)},getRGB(n){let s;return n in cf?(s=cf[n],{r:s[0],g:s[1],b:s[2]}):n[0]===To?this._hexToRgb(n.substring(1)):n.substr(0,4)===Dg?(s=Ig.exec(n.replace(/ /g,"")),{r:parseInt(s[1],10),g:parseInt(s[2],10),b:parseInt(s[3],10)}):{r:0,g:0,b:0}},colorToRGBA(n){return n=n||"black",Z._namedColorToRBA(n)||Z._hex3ColorToRGBA(n)||Z._hex4ColorToRGBA(n)||Z._hex6ColorToRGBA(n)||Z._hex8ColorToRGBA(n)||Z._rgbColorToRGBA(n)||Z._rgbaColorToRGBA(n)||Z._hslColorToRGBA(n)},_namedColorToRBA(n){const s=cf[n.toLowerCase()];return s?{r:s[0],g:s[1],b:s[2],a:1}:null},_rgbColorToRGBA(n){if(n.indexOf("rgb(")===0){n=n.match(/rgb\(([^)]+)\)/)[1];const s=n.split(/ *, */).map(Number);return{r:s[0],g:s[1],b:s[2],a:1}}},_rgbaColorToRGBA(n){if(n.indexOf("rgba(")===0){n=n.match(/rgba\(([^)]+)\)/)[1];const s=n.split(/ *, */).map((u,r)=>u.slice(-1)==="%"?r===3?parseInt(u)/100:parseInt(u)/100*255:Number(u));return{r:s[0],g:s[1],b:s[2],a:s[3]}}},_hex8ColorToRGBA(n){if(n[0]==="#"&&n.length===9)return{r:parseInt(n.slice(1,3),16),g:parseInt(n.slice(3,5),16),b:parseInt(n.slice(5,7),16),a:parseInt(n.slice(7,9),16)/255}},_hex6ColorToRGBA(n){if(n[0]==="#"&&n.length===7)return{r:parseInt(n.slice(1,3),16),g:parseInt(n.slice(3,5),16),b:parseInt(n.slice(5,7),16),a:1}},_hex4ColorToRGBA(n){if(n[0]==="#"&&n.length===5)return{r:parseInt(n[1]+n[1],16),g:parseInt(n[2]+n[2],16),b:parseInt(n[3]+n[3],16),a:parseInt(n[4]+n[4],16)/255}},_hex3ColorToRGBA(n){if(n[0]==="#"&&n.length===4)return{r:parseInt(n[1]+n[1],16),g:parseInt(n[2]+n[2],16),b:parseInt(n[3]+n[3],16),a:1}},_hslColorToRGBA(n){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(n)){const[s,...u]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(n),r=Number(u[0])/360,d=Number(u[1])/100,m=Number(u[2])/100;let p,y,S;if(d===0)return S=m*255,{r:Math.round(S),g:Math.round(S),b:Math.round(S),a:1};m<.5?p=m*(1+d):p=m+d-m*d;const x=2*m-p,L=[0,0,0];for(let _=0;_<3;_++)y=r+1/3*-(_-1),y<0&&y++,y>1&&y--,6*y<1?S=x+(p-x)*6*y:2*y<1?S=p:3*y<2?S=x+(p-x)*(2/3-y)*6:S=x,L[_]=S*255;return{r:Math.round(L[0]),g:Math.round(L[1]),b:Math.round(L[2]),a:1}}},haveIntersection(n,s){return!(s.x>n.x+n.width||s.x+s.widthn.y+n.height||s.y+s.height1?(p=u,y=r,S=(u-d)*(u-d)+(r-m)*(r-m)):(p=n+L*(u-n),y=s+L*(r-s),S=(p-d)*(p-d)+(y-m)*(y-m))}return[p,y,S]},_getProjectionToLine(n,s,u){const r=Z.cloneObject(n);let d=Number.MAX_VALUE;return s.forEach(function(m,p){if(!u&&p===s.length-1)return;const y=s[(p+1)%s.length],S=Z._getProjectionToSegment(m.x,m.y,y.x,y.y,n.x,n.y),x=S[0],L=S[1],_=S[2];_s.length){const p=s;s=n,n=p}for(let p=0;p{s.width=0,s.height=0})},drawRoundedRectPath(n,s,u,r){let d=s<0?s:0,m=u<0?u:0;s=Math.abs(s),u=Math.abs(u);let p=0,y=0,S=0,x=0;typeof r=="number"?p=y=S=x=Math.min(r,s/2,u/2):(p=Math.min(r[0]||0,s/2,u/2),y=Math.min(r[1]||0,s/2,u/2),x=Math.min(r[2]||0,s/2,u/2),S=Math.min(r[3]||0,s/2,u/2)),n.moveTo(d+p,m),n.lineTo(d+s-y,m),n.arc(d+s-y,m+y,y,Math.PI*3/2,0,!1),n.lineTo(d+s,m+u-x),n.arc(d+s-x,m+u-x,x,0,Math.PI/2,!1),n.lineTo(d+S,m+u),n.arc(d+S,m+u-S,S,Math.PI/2,Math.PI,!1),n.lineTo(d,m+p),n.arc(d+p,m+p,p,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(n,s,u,r,d){r=Math.abs(r);for(let m=0;m{ha(),Ce(),xm=",",Bg="(",Xg=")",Ug="([",Vg="])",Wg=";",Qg="()",qg="=",_m=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],Kg=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],kg=100,hd=null,fd=class{constructor(n){this.canvas=n,vt.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(n){n.fillEnabled()&&this._fill(n)}_fill(n){}strokeShape(n){n.hasStroke()&&this._stroke(n)}_stroke(n){}fillStrokeShape(n){n.attrs.fillAfterStrokeEnabled?(this.strokeShape(n),this.fillShape(n)):(this.fillShape(n),this.strokeShape(n))}getTrace(n,s){let u=this.traceArr,r=u.length,d="",m,p,y,S;for(m=0;mtypeof x=="number"?Math.floor(x):x)),d+=Bg+S.join(xm)+Xg)):(d+=p.property,n||(d+=qg+p.val)),d+=Wg;return d}clearTrace(){this.traceArr=[]}_trace(n){let s=this.traceArr,u;s.push(n),u=s.length,u>=kg&&s.shift()}reset(){const n=this.getCanvas().getPixelRatio();this.setTransform(1*n,0,0,1*n,0,0)}getCanvas(){return this.canvas}clear(n){const s=this.getCanvas();n?this.clearRect(n.x||0,n.y||0,n.width||0,n.height||0):this.clearRect(0,0,s.getWidth()/s.pixelRatio,s.getHeight()/s.pixelRatio)}_applyLineCap(n){const s=n.attrs.lineCap;s&&this.setAttr("lineCap",s)}_applyOpacity(n){const s=n.getAbsoluteOpacity();s!==1&&this.setAttr("globalAlpha",s)}_applyLineJoin(n){const s=n.attrs.lineJoin;s&&this.setAttr("lineJoin",s)}_applyMiterLimit(n){const s=n.attrs.miterLimit;s!=null&&this.setAttr("miterLimit",s)}setAttr(n,s){this._context[n]=s}arc(n,s,u,r,d,m){this._context.arc(n,s,u,r,d,m)}arcTo(n,s,u,r,d){this._context.arcTo(n,s,u,r,d)}beginPath(){this._context.beginPath()}bezierCurveTo(n,s,u,r,d,m){this._context.bezierCurveTo(n,s,u,r,d,m)}clearRect(n,s,u,r){this._context.clearRect(n,s,u,r)}clip(...n){this._context.clip.apply(this._context,n)}closePath(){this._context.closePath()}createImageData(n,s){const u=arguments;if(u.length===2)return this._context.createImageData(n,s);if(u.length===1)return this._context.createImageData(n)}createLinearGradient(n,s,u,r){return this._context.createLinearGradient(n,s,u,r)}createPattern(n,s){return this._context.createPattern(n,s)}createRadialGradient(n,s,u,r,d,m){return this._context.createRadialGradient(n,s,u,r,d,m)}drawImage(n,s,u,r,d,m,p,y,S){const x=arguments,L=this._context;x.length===3?L.drawImage(n,s,u):x.length===5?L.drawImage(n,s,u,r,d):x.length===9&&L.drawImage(n,s,u,r,d,m,p,y,S)}ellipse(n,s,u,r,d,m,p,y){this._context.ellipse(n,s,u,r,d,m,p,y)}isPointInPath(n,s,u,r){return u?this._context.isPointInPath(u,n,s,r):this._context.isPointInPath(n,s,r)}fill(...n){this._context.fill.apply(this._context,n)}fillRect(n,s,u,r){this._context.fillRect(n,s,u,r)}strokeRect(n,s,u,r){this._context.strokeRect(n,s,u,r)}fillText(n,s,u,r){r?this._context.fillText(n,s,u,r):this._context.fillText(n,s,u)}measureText(n){return this._context.measureText(n)}getImageData(n,s,u,r){return this._context.getImageData(n,s,u,r)}lineTo(n,s){this._context.lineTo(n,s)}moveTo(n,s){this._context.moveTo(n,s)}rect(n,s,u,r){this._context.rect(n,s,u,r)}roundRect(n,s,u,r,d){this._context.roundRect(n,s,u,r,d)}putImageData(n,s,u){this._context.putImageData(n,s,u)}quadraticCurveTo(n,s,u,r){this._context.quadraticCurveTo(n,s,u,r)}restore(){this._context.restore()}rotate(n){this._context.rotate(n)}save(){this._context.save()}scale(n,s){this._context.scale(n,s)}setLineDash(n){this._context.setLineDash?this._context.setLineDash(n):"mozDash"in this._context?this._context.mozDash=n:"webkitLineDash"in this._context&&(this._context.webkitLineDash=n)}getLineDash(){return this._context.getLineDash()}setTransform(n,s,u,r,d,m){this._context.setTransform(n,s,u,r,d,m)}stroke(n){n?this._context.stroke(n):this._context.stroke()}strokeText(n,s,u,r){this._context.strokeText(n,s,u,r)}transform(n,s,u,r,d,m){this._context.transform(n,s,u,r,d,m)}translate(n,s){this._context.translate(n,s)}_enableTrace(){let n=this,s=_m.length,u=this.setAttr,r,d;const m=function(p){let y=n[p],S;n[p]=function(){return d=y4(Array.prototype.slice.call(arguments,0)),S=y.apply(n,arguments),n._trace({method:p,args:d}),S}};for(r=0;r{ha(),Em(),Ce(),rf=class{constructor(n){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const s=(n||{}).pixelRatio||vt.pixelRatio||b4();this.pixelRatio=s,this._canvas=Z.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(n){const s=this.pixelRatio;this.pixelRatio=n,this.setSize(this.getWidth()/s,this.getHeight()/s)}setWidth(n){this.width=this._canvas.width=n*this.pixelRatio,this._canvas.style.width=n+"px";const s=this.pixelRatio;this.getContext()._context.scale(s,s)}setHeight(n){this.height=this._canvas.height=n*this.pixelRatio,this._canvas.style.height=n+"px";const s=this.pixelRatio;this.getContext()._context.scale(s,s)}getWidth(){return this.width}getHeight(){return this.height}setSize(n,s){this.setWidth(n||0),this.setHeight(s||0)}toDataURL(n,s){try{return this._canvas.toDataURL(n,s)}catch{try{return this._canvas.toDataURL()}catch(r){return Z.error("Unable to get data URL. "+r.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}},Ls=class extends rf{constructor(n={width:0,height:0,willReadFrequently:!1}){super(n),this.context=new Fg(this,{willReadFrequently:n.willReadFrequently}),this.setSize(n.width,n.height)}},df=class extends rf{constructor(n={width:0,height:0}){super(n),this.hitCanvas=!0,this.context=new Pg(this),this.setSize(n.width,n.height)}}})),Se,zm=Et((()=>{Ce(),ha(),Se={get isDragging(){let n=!1;return Se._dragElements.forEach(s=>{s.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){let n;return Se._dragElements.forEach(s=>{n=s.node}),n},_dragElements:new Map,_drag(n){const s=[];Se._dragElements.forEach((u,r)=>{const{node:d}=u,m=d.getStage();m.setPointersPositions(n),u.pointerId===void 0&&(u.pointerId=Z._getFirstPointerId(n));const p=m._changedPointerPositions.find(y=>y.id===u.pointerId);if(p){if(u.dragStatus!=="dragging"){const y=d.dragDistance();if(Math.max(Math.abs(p.x-u.startPointerPos.x),Math.abs(p.y-u.startPointerPos.y)){u.getStage()&&u.fire("dragmove",{type:"dragmove",target:u,evt:n},!0)})},_endDragBefore(n){const s=[];Se._dragElements.forEach(u=>{const{node:r}=u,d=r.getStage();if(n&&d.setPointersPositions(n),!d._changedPointerPositions.find(p=>p.id===u.pointerId))return;(u.dragStatus==="dragging"||u.dragStatus==="stopped")&&(Se.justDragged=!0,vt._mouseListenClick=!1,vt._touchListenClick=!1,vt._pointerListenClick=!1,u.dragStatus="stopped");const m=u.node.getLayer()||u.node instanceof vt.Stage&&u.node;m&&s.indexOf(m)===-1&&s.push(m)}),s.forEach(u=>{u.draw()})},_endDragAfter(n){Se._dragElements.forEach((s,u)=>{s.dragStatus==="stopped"&&s.node.fire("dragend",{type:"dragend",target:s.node,evt:n},!0),s.dragStatus!=="dragging"&&Se._dragElements.delete(u)})}},vt.isBrowser&&(window.addEventListener("mouseup",Se._endDragBefore,!0),window.addEventListener("touchend",Se._endDragBefore,!0),window.addEventListener("touchcancel",Se._endDragBefore,!0),window.addEventListener("mousemove",Se._drag),window.addEventListener("touchmove",Se._drag),window.addEventListener("mouseup",Se._endDragAfter,!1),window.addEventListener("touchend",Se._endDragAfter,!1),window.addEventListener("touchcancel",Se._endDragAfter,!1))}));function hu(n){return Z._isString(n)?'"'+n+'"':Object.prototype.toString.call(n)==="[object Number]"||Z._isBoolean(n)?n:Object.prototype.toString.call(n)}function $g(n){return n>255?255:n<0?0:Math.round(n)}function gt(){if(vt.isUnminified)return function(n,s){return Z._isNumber(n)||Z.warn(hu(n)+' is a not valid value for "'+s+'" attribute. The value should be a number.'),n}}function ff(n){if(vt.isUnminified)return function(s,u){let r=Z._isNumber(s),d=Z._isArray(s)&&s.length==n;return!r&&!d&&Z.warn(hu(s)+' is a not valid value for "'+u+'" attribute. The value should be a number or Array('+n+")"),s}}function Mm(){if(vt.isUnminified)return function(n,s){return Z._isNumber(n)||n==="auto"||Z.warn(hu(n)+' is a not valid value for "'+s+'" attribute. The value should be a number or "auto".'),n}}function zc(){if(vt.isUnminified)return function(n,s){return Z._isString(n)||Z.warn(hu(n)+' is a not valid value for "'+s+'" attribute. The value should be a string.'),n}}function t2(){if(vt.isUnminified)return function(n,s){const u=Z._isString(n),r=Object.prototype.toString.call(n)==="[object CanvasGradient]"||n&&n.addColorStop;return u||r||Z.warn(hu(n)+' is a not valid value for "'+s+'" attribute. The value should be a string or a native gradient.'),n}}function S4(){if(vt.isUnminified)return function(n,s){const u=Int8Array?Object.getPrototypeOf(Int8Array):null;return u&&n instanceof u||(Z._isArray(n)?n.forEach(function(r){Z._isNumber(r)||Z.warn('"'+s+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):Z.warn(hu(n)+' is a not valid value for "'+s+'" attribute. The value should be a array of numbers.')),n}}function $n(){if(vt.isUnminified)return function(n,s){return n===!0||n===!1||Z.warn(hu(n)+' is a not valid value for "'+s+'" attribute. The value should be a boolean.'),n}}function C4(n){if(vt.isUnminified)return function(s,u){return s==null||Z.isObject(s)||Z.warn(hu(s)+' is a not valid value for "'+u+'" attribute. The value should be an object with properties '+n),s}}var ge=Et((()=>{Ce(),ha()})),wo,Oo,A,re=Et((()=>{ha(),ge(),wo="get",Oo="set",A={addGetterSetter(n,s,u,r,d){A.addGetter(n,s,u),A.addSetter(n,s,r,d),A.addOverloadedGetterSetter(n,s)},addGetter(n,s,u){const r=wo+Z._capitalize(s);n.prototype[r]=n.prototype[r]||function(){const d=this.attrs[s];return d===void 0?u:d}},addSetter(n,s,u,r){const d=Oo+Z._capitalize(s);n.prototype[d]||A.overWriteSetter(n,s,u,r)},overWriteSetter(n,s,u,r){const d=Oo+Z._capitalize(s);n.prototype[d]=function(m){return u&&m!==void 0&&m!==null&&(m=u.call(this,m,s)),this._setAttr(s,m),r&&r.call(this),this}},addComponentsGetterSetter(n,s,u,r,d){const m=u.length,p=Z._capitalize,y=wo+p(s),S=Oo+p(s);n.prototype[y]=function(){const L={};for(let _=0;_{this._setAttr(s+p(M),void 0)}),this._fireChangeEvent(s,_,L),d&&d.call(this),this},A.addOverloadedGetterSetter(n,s)},addOverloadedGetterSetter(n,s){const u=Z._capitalize(s),r=Oo+u,d=wo+u;n.prototype[s]=function(){return arguments.length?(this[r](arguments[0]),this):this[d]()}},addDeprecatedGetterSetter(n,s,u,r){Z.error("Adding deprecated "+s);const d=wo+Z._capitalize(s),m=s+" property is deprecated and will be removed soon. Look at Konva change log for more information.";n.prototype[d]=function(){Z.error(m);const p=this.attrs[s];return p===void 0?u:p},A.addSetter(n,s,r,function(){Z.error(m)}),A.addOverloadedGetterSetter(n,s)},backCompat(n,s){Z.each(s,function(u,r){const d=n.prototype[r],m=wo+Z._capitalize(u),p=Oo+Z._capitalize(u);function y(){d.apply(this,arguments),Z.error('"'+u+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}n.prototype[u]=y,n.prototype[m]=y,n.prototype[p]=y})},afterSetFilter(){this._filterUpToDate=!1}}}));function L4(n){const s=/(\w+)\(([^)]+)\)/g;let u;for(;(u=s.exec(n))!==null;){const[,r,d]=u;switch(r){case"blur":{const m=parseFloat(d.replace("px",""));return function(p){this.blurRadius(m*.5);const y=vt.Filters;y&&y.Blur&&y.Blur.call(this,p)}}case"brightness":{const m=d.includes("%")?parseFloat(d)/100:parseFloat(d);return function(p){this.brightness(m);const y=vt.Filters;y&&y.Brightness&&y.Brightness.call(this,p)}}case"contrast":{const m=parseFloat(d);return function(p){const y=100*(Math.sqrt(m)-1);this.contrast(y);const S=vt.Filters;S&&S.Contrast&&S.Contrast.call(this,p)}}case"grayscale":return function(m){const p=vt.Filters;p&&p.Grayscale&&p.Grayscale.call(this,m)};case"sepia":return function(m){const p=vt.Filters;p&&p.Sepia&&p.Sepia.call(this,m)};case"invert":return function(m){const p=vt.Filters;p&&p.Invert&&p.Invert.call(this,m)};default:Z.warn(`CSS filter "${r}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}var md,Nm,Rl,Tm,fu,e2,a2,i2,mf,n2,l2,s2,u2,c2,o2,Am,wm,gd,Om,xs,r2,gf,d2,h2,bt,Re,Sa=Et((()=>{hf(),Em(),zm(),re(),Ce(),ha(),ge(),md="absoluteOpacity",Nm="allEventListeners",Rl="absoluteTransform",Tm="absoluteScale",fu="canvas",e2="Change",a2="children",i2="konva",mf="listening",n2="mouseenter",l2="mouseleave",s2="pointerenter",u2="pointerleave",c2="touchenter",o2="touchleave",Am="set",wm="Shape",gd=" ",Om="stage",xs="transform",r2="Stage",gf="visible",d2=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(gd),h2=1,bt=class $h{constructor(s){this._id=h2++,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(s),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(s){(s===xs||s===Rl)&&this._cache.get(s)?this._cache.get(s).dirty=!0:s?this._cache.delete(s):this._cache.clear()}_getCache(s,u){let r=this._cache.get(s);return(r===void 0||(s===xs||s===Rl)&&r.dirty===!0)&&(r=u.call(this),this._cache.set(s,r)),r}_calculate(s,u,r){if(!this._attachedDepsListeners.get(s)){const d=u.map(m=>m+"Change.konva").join(gd);this.on(d,()=>{this._clearCache(s)}),this._attachedDepsListeners.set(s,!0)}return this._getCache(s,r)}_getCanvasCache(){return this._cache.get(fu)}_clearSelfAndDescendantCache(s){this._clearCache(s),s===Rl&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(fu)){const{scene:s,filter:u,hit:r}=this._cache.get(fu);Z.releaseCanvas(s._canvas,u._canvas,r._canvas),this._cache.delete(fu)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(s){const u=s||{};let r={};(u.x===void 0||u.y===void 0||u.width===void 0||u.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let d=Math.ceil(u.width||r.width),m=Math.ceil(u.height||r.height),p=u.pixelRatio,y=u.x===void 0?Math.floor(r.x):u.x,S=u.y===void 0?Math.floor(r.y):u.y,x=u.offset||0,L=u.drawBorder||!1,_=u.hitCanvasPixelRatio||1;if(!d||!m){Z.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const M=Math.abs(Math.round(r.x)-y)>.5?1:0,w=Math.abs(Math.round(r.y)-S)>.5?1:0;d+=x*2+M,m+=x*2+w,y-=x,S-=x;const N=new Ls({pixelRatio:p,width:d,height:m}),J=new Ls({pixelRatio:p,width:0,height:0,willReadFrequently:!0}),q=new df({pixelRatio:_,width:d,height:m}),G=N.getContext(),V=q.getContext(),U=new Ls({width:N.width/N.pixelRatio+Math.abs(y),height:N.height/N.pixelRatio+Math.abs(S),pixelRatio:N.pixelRatio}),F=U.getContext();return q.isCache=!0,N.isCache=!0,this._cache.delete(fu),this._filterUpToDate=!1,u.imageSmoothingEnabled===!1&&(N.getContext()._context.imageSmoothingEnabled=!1,J.getContext()._context.imageSmoothingEnabled=!1),G.save(),V.save(),F.save(),G.translate(-y,-S),V.translate(-y,-S),F.translate(-y,-S),U.x=y,U.y=S,this._isUnderCache=!0,this._clearSelfAndDescendantCache(md),this._clearSelfAndDescendantCache(Tm),this.drawScene(N,this,U),this.drawHit(q,this),this._isUnderCache=!1,G.restore(),V.restore(),L&&(G.save(),G.beginPath(),G.rect(0,0,d,m),G.closePath(),G.setAttr("strokeStyle","red"),G.setAttr("lineWidth",5),G.stroke(),G.restore()),Z.releaseCanvas(U._canvas),this._cache.set(fu,{scene:N,filter:J,hit:q,x:y,y:S}),this._requestDraw(),this}isCached(){return this._cache.has(fu)}getClientRect(s){throw new Error('abstract "getClientRect" method call')}_transformedRect(s,u){const r=[{x:s.x,y:s.y},{x:s.x+s.width,y:s.y},{x:s.x+s.width,y:s.y+s.height},{x:s.x,y:s.y+s.height}];let d=1/0,m=1/0,p=-1/0,y=-1/0;const S=this.getAbsoluteTransform(u);return r.forEach(function(x){const L=S.point(x);d===void 0&&(d=p=L.x,m=y=L.y),d=Math.min(d,L.x),m=Math.min(m,L.y),p=Math.max(p,L.x),y=Math.max(y,L.y)}),{x:d,y:m,width:p-d,height:y-m}}_drawCachedSceneCanvas(s){s.save(),s._applyOpacity(this),s._applyGlobalCompositeOperation(this);const u=this._getCanvasCache();s.translate(u.x,u.y);const r=this._getCachedSceneCanvas(),d=r.pixelRatio;s.drawImage(r._canvas,0,0,r.width/d,r.height/d),s.restore()}_drawCachedHitCanvas(s){const u=this._getCanvasCache(),r=u.hit;s.save(),s.translate(u.x,u.y),s.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),s.restore()}_getCachedSceneCanvas(){let s=this.filters(),u=this._getCanvasCache(),r=u.scene,d=u.filter,m=d.getContext(),p,y,S,x;if(!s||s.length===0)return r;if(this._filterUpToDate)return d;let L=!0;for(let M=0;M{this.isAncestorOf(s.node)&&Se._dragElements.delete(u)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Rl),this._clearSelfAndDescendantCache(md),this._clearSelfAndDescendantCache(Tm),this._clearSelfAndDescendantCache(Om),this._clearSelfAndDescendantCache(gf),this._clearSelfAndDescendantCache(mf)}_remove(){this._clearCaches();const s=this.getParent();s&&s.children&&(s.children.splice(this.index,1),s._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(s){const u="get"+Z._capitalize(s);return Z._isFunction(this[u])?this[u]():this.attrs[s]}getAncestors(){let s=this.getParent(),u=[];for(;s;)u.push(s),s=s.getParent();return u}getAttrs(){return this.attrs||{}}setAttrs(s){return this._batchTransformChanges(()=>{let u,r;if(!s)return this;for(u in s)u!==a2&&(r=Am+Z._capitalize(u),Z._isFunction(this[r])?this[r](s[u]):this._setAttr(u,s[u]))}),this}isListening(){return this._getCache(mf,this._isListening)}_isListening(s){if(!this.listening())return!1;const u=this.getParent();return u&&u!==s&&this!==s?u._isListening(s):!0}isVisible(){return this._getCache(gf,this._isVisible)}_isVisible(s){if(!this.visible())return!1;const u=this.getParent();return u&&u!==s&&this!==s?u._isVisible(s):!0}shouldDrawHit(s,u=!1){if(s)return this._isVisible(s)&&this._isListening(s);const r=this.getLayer();let d=!1;Se._dragElements.forEach(p=>{p.dragStatus==="dragging"&&(p.node.nodeType==="Stage"||p.node.getLayer()===r)&&(d=!0)});const m=!u&&!vt.hitOnDragEnabled&&(d||vt.isTransforming());return this.isListening()&&this.isVisible()&&!m}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let s=this.getDepth(),u=this,r=0,d,m,p,y;function S(L){for(d=[],m=L.length,p=0;p0&&d[0].getDepth()<=s&&S(d)}const x=this.getStage();return u.nodeType!==r2&&x&&S(x.getChildren()),r}getDepth(){let s=0,u=this.parent;for(;u;)s++,u=u.parent;return s}_batchTransformChanges(s){this._batchingTransformChange=!0,s(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(xs),this._clearSelfAndDescendantCache(Rl)),this._needClearTransformCache=!1}setPosition(s){return this._batchTransformChanges(()=>{this.x(s.x),this.y(s.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const s=this.getStage();if(!s)return null;const u=s.getPointerPosition();if(!u)return null;const r=this.getAbsoluteTransform().copy();return r.invert(),r.point(u)}getAbsolutePosition(s){let u=!1,r=this.parent;for(;r;){if(r.isCached()){u=!0;break}r=r.parent}u&&!s&&(s=!0);const d=this.getAbsoluteTransform(s).getMatrix(),m=new xn,p=this.offset();return m.m=d.slice(),m.translate(p.x,p.y),m.getTranslation()}setAbsolutePosition(s){const{x:u,y:r,...d}=this._clearTransform();this.attrs.x=u,this.attrs.y=r,this._clearCache(xs);const m=this._getAbsoluteTransform().copy();return m.invert(),m.translate(s.x,s.y),s={x:this.attrs.x+m.getTranslation().x,y:this.attrs.y+m.getTranslation().y},this._setTransform(d),this.setPosition({x:s.x,y:s.y}),this._clearCache(xs),this._clearSelfAndDescendantCache(Rl),this}_setTransform(s){let u;for(u in s)this.attrs[u]=s[u]}_clearTransform(){const s={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,s}move(s){let u=s.x,r=s.y,d=this.x(),m=this.y();return u!==void 0&&(d+=u),r!==void 0&&(m+=r),this.setPosition({x:d,y:m}),this}_eachAncestorReverse(s,u){let r=[],d=this.getParent(),m,p;if(!(u&&u._id===this._id)){for(r.unshift(this);d&&(!u||d._id!==u._id);)r.unshift(d),d=d.parent;for(m=r.length,p=0;p0?(this.parent.children.splice(s,1),this.parent.children.splice(s-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return Z.warn("Node has no parent. moveToBottom function is ignored."),!1;const s=this.index;return s>0?(this.parent.children.splice(s,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(s){if(!this.parent)return Z.warn("Node has no parent. zIndex parameter is ignored."),this;(s<0||s>=this.parent.children.length)&&Z.warn("Unexpected value "+s+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const u=this.index;return this.parent.children.splice(u,1),this.parent.children.splice(s,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(md,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let s=this.opacity();const u=this.getParent();return u&&!u._isUnderCache&&(s*=u.getAbsoluteOpacity()),s}moveTo(s){return this.getParent()!==s&&(this._remove(),s.add(this)),this}toObject(){let s=this.getAttrs(),u,r,d,m,p;const y={attrs:{},className:this.getClassName()};for(u in s)r=s[u],p=Z.isObject(r)&&!Z._isPlainObject(r)&&!Z._isArray(r),!p&&(d=typeof this[u]=="function"&&this[u],delete s[u],m=d?d.call(this):null,s[u]=r,m!==r&&(y.attrs[u]=r));return Z._prepareToStringify(y)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(s,u,r){const d=[];u&&this._isMatch(s)&&d.push(this);let m=this.parent;for(;m;){if(m===r)return d;m._isMatch(s)&&d.push(m),m=m.parent}return d}isAncestorOf(s){return!1}findAncestor(s,u,r){return this.findAncestors(s,u,r)[0]}_isMatch(s){if(!s)return!1;if(typeof s=="function")return s(this);let u=s.replace(/ /g,"").split(","),r=u.length,d,m;for(d=0;d{try{const d=s?.callback;d&&delete s.callback,Z._urlToImage(this.toDataURL(s),function(m){u(m),d?.(m)})}catch(d){r(d)}})}toBlob(s){return new Promise((u,r)=>{try{const d=s?.callback;d&&delete s.callback,this.toCanvas(s).toBlob(m=>{u(m),d?.(m)},s?.mimeType,s?.quality)}catch(d){r(d)}})}setSize(s){return this.width(s.width),this.height(s.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():vt.dragDistance}_off(s,u,r){let d=this.eventListeners[s],m,p,y;for(m=0;m=0)||this.isDragging())return;let u=!1;Se._dragElements.forEach(r=>{this.isAncestorOf(r.node)&&(u=!0)}),u||this._createDragElement(s)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const s=Se._dragElements.get(this._id),u=s&&s.dragStatus==="dragging",r=s&&s.dragStatus==="ready";u?this.stopDrag():r&&Se._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(s={x:0,y:0}){const u=this.getStage();if(!u)return!1;const r={x:-s.x,y:-s.y,width:u.width()+2*s.x,height:u.height()+2*s.y};return Z.haveIntersection(r,this.getClientRect())}static create(s,u){return Z._isString(s)&&(s=JSON.parse(s)),this._createNode(s,u)}static _createNode(s,u){let r=$h.prototype.getClassName.call(s),d=s.children,m,p,y;u&&(s.attrs.container=u),vt[r]||(Z.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const S=vt[r];if(m=new S(s.attrs),d)for(p=d.length,y=0;y{re(),Sa(),ge(),Ii=class extends bt{constructor(){super(...arguments),this.children=[]}getChildren(n){const s=this.children||[];return n?s.filter(n):s}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(n=>{n.parent=null,n.index=0,n.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(n=>{n.parent=null,n.index=0,n.destroy()}),this.children=[],this._requestDraw(),this}add(...n){if(n.length===0)return this;if(n.length>1){for(let u=0;u0?s[0]:void 0}_generalFind(n,s){const u=[];return this._descendants(r=>{const d=r._isMatch(n);return d&&u.push(r),!!(d&&s)}),u}_descendants(n){let s=!1;const u=this.getChildren();for(const r of u){if(s=n(r),s)return!0;if(r.hasChildren()&&(s=r._descendants(n),s))return!0}return!1}toObject(){const n=bt.prototype.toObject.call(this);return n.children=[],this.getChildren().forEach(s=>{n.children.push(s.toObject())}),n}isAncestorOf(n){let s=n.getParent();for(;s;){if(s._id===this._id)return!0;s=s.getParent()}return!1}clone(n){const s=bt.prototype.clone.call(this,n);return this.getChildren().forEach(function(u){s.add(u.clone())}),s}getAllIntersections(n){const s=[];return this.find("Shape").forEach(u=>{u.isVisible()&&u.intersects(n)&&s.push(u)}),s}_clearSelfAndDescendantCache(n){var s;super._clearSelfAndDescendantCache(n),!this.isCached()&&((s=this.children)===null||s===void 0||s.forEach(function(u){u._clearSelfAndDescendantCache(n)}))}_setChildrenIndices(){var n;(n=this.children)===null||n===void 0||n.forEach(function(s,u){s.index=u}),this._requestDraw()}drawScene(n,s,u){const r=this.getLayer(),d=n||r&&r.getCanvas(),m=d&&d.getContext(),p=this._getCanvasCache(),y=p&&p.scene,S=d&&d.isCache;if(!this.isVisible()&&!S)return this;if(y){m.save();const x=this.getAbsoluteTransform(s).getMatrix();m.transform(x[0],x[1],x[2],x[3],x[4],x[5]),this._drawCachedSceneCanvas(m),m.restore()}else this._drawChildren("drawScene",d,s,u);return this}drawHit(n,s){if(!this.shouldDrawHit(s))return this;const u=this.getLayer(),r=n||u&&u.hitCanvas,d=r&&r.getContext(),m=this._getCanvasCache();if(m&&m.hit){d.save();const p=this.getAbsoluteTransform(s).getMatrix();d.transform(p[0],p[1],p[2],p[3],p[4],p[5]),this._drawCachedHitCanvas(d),d.restore()}else this._drawChildren("drawHit",r,s);return this}_drawChildren(n,s,u,r){var d;const m=s&&s.getContext(),p=this.clipWidth(),y=this.clipHeight(),S=this.clipFunc(),x=typeof p=="number"&&typeof y=="number"||S,L=u===this;if(x){m.save();const M=this.getAbsoluteTransform(u);let w=M.getMatrix();m.transform(w[0],w[1],w[2],w[3],w[4],w[5]),m.beginPath();let N;if(S)N=S.call(this,m,this);else{const J=this.clipX(),q=this.clipY();m.rect(J||0,q||0,p,y)}m.clip.apply(m,N),w=M.copy().invert().getMatrix(),m.transform(w[0],w[1],w[2],w[3],w[4],w[5])}const _=!L&&this.globalCompositeOperation()!=="source-over"&&n==="drawScene";_&&(m.save(),m._applyGlobalCompositeOperation(this)),(d=this.children)===null||d===void 0||d.forEach(function(M){M[n](s,u,r)}),_&&m.restore(),x&&m.restore()}getClientRect(n={}){var s;const u=n.skipTransform,r=n.relativeTo;let d,m,p,y,S={x:1/0,y:1/0,width:0,height:0};const x=this;(s=this.children)===null||s===void 0||s.forEach(function(M){if(!M.visible())return;const w=M.getClientRect({relativeTo:x,skipShadow:n.skipShadow,skipStroke:n.skipStroke});w.width===0&&w.height===0||(d===void 0?(d=w.x,m=w.y,p=w.x+w.width,y=w.y+w.height):(d=Math.min(d,w.x),m=Math.min(m,w.y),p=Math.max(p,w.x+w.width),y=Math.max(y,w.y+w.height)))});const L=this.find("Shape");let _=!1;for(let M=0;M{Ce(),Yo=new Map,jm=vt._global.PointerEvent!==void 0}));function p2(n={}){return(n.clipFunc||n.clipWidth||n.clipHeight)&&Z.warn("Stage does not support clipping. Please use clip for Layers or Groups."),n}var v2,y2,Gm,b2,Hm,Dm,Im,Zm,Jm,Bm,Ro,jo,Mc,Go,S2,vd,Ho,yd,bd,vf,Xm,Um,Vm,Wm,yf,C2,L2,bf,Do,Nc,x2,Io,Sd,x4=Et((()=>{ha(),re(),pf(),Ce(),hf(),zm(),g2(),v2="Stage",y2="string",Gm="px",b2="mouseout",Hm="mouseleave",Dm="mouseover",Im="mouseenter",Zm="mousemove",Jm="mousedown",Bm="mouseup",Ro="pointermove",jo="pointerdown",Mc="pointerup",Go="pointercancel",S2="lostpointercapture",vd="pointerout",Ho="pointerleave",yd="pointerover",bd="pointerenter",vf="contextmenu",Xm="touchstart",Um="touchend",Vm="touchmove",Wm="touchcancel",yf="wheel",C2=5,L2=[[Im,"_pointerenter"],[Jm,"_pointerdown"],[Zm,"_pointermove"],[Bm,"_pointerup"],[Hm,"_pointerleave"],[Xm,"_pointerdown"],[Vm,"_pointermove"],[Um,"_pointerup"],[Wm,"_pointercancel"],[Dm,"_pointerover"],[yf,"_wheel"],[vf,"_contextmenu"],[jo,"_pointerdown"],[Ro,"_pointermove"],[Mc,"_pointerup"],[Go,"_pointercancel"],[Ho,"_pointerleave"],[S2,"_lostpointercapture"]],bf={mouse:{[vd]:b2,[Ho]:Hm,[yd]:Dm,[bd]:Im,[Ro]:Zm,[jo]:Jm,[Mc]:Bm,[Go]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[vd]:"touchout",[Ho]:"touchleave",[yd]:"touchover",[bd]:"touchenter",[Ro]:Vm,[jo]:Xm,[Mc]:Um,[Go]:Wm,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[vd]:vd,[Ho]:Ho,[yd]:yd,[bd]:bd,[Ro]:Ro,[jo]:jo,[Mc]:Mc,[Go]:Go,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},Do=n=>n.indexOf("pointer")>=0?"pointer":n.indexOf("touch")>=0?"touch":"mouse",Nc=n=>{const s=Do(n);if(s==="pointer")return vt.pointerEventsEnabled&&bf.pointer;if(s==="touch")return bf.touch;if(s==="mouse")return bf.mouse},x2="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);",Io=[],Sd=class extends Ii{constructor(n){super(p2(n)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Io.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{p2(this.attrs)}),this._checkVisibility()}_validateAdd(n){const s=n.getType()==="Layer",u=n.getType()==="FastLayer";s||u||Z.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const n=this.visible()?"":"none";this.content.style.display=n}setContainer(n){if(typeof n===y2){let s;if(n.charAt(0)==="."){const u=n.slice(1);n=document.getElementsByClassName(u)[0]}else n.charAt(0)!=="#"?s=n:s=n.slice(1),n=document.getElementById(s);if(!n)throw"Can not find container in document with id "+s}return this._setAttr("container",n),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),n.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const n=this.children,s=n.length;for(let u=0;u-1&&Io.splice(s,1),Z.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const n=this._pointerPositions[0]||this._changedPointerPositions[0];return n?{x:n.x,y:n.y}:(Z.warn(x2),null)}_getPointerById(n){return this._pointerPositions.find(s=>s.id===n)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(n){n={...n},n.x=n.x||0,n.y=n.y||0,n.width=n.width||this.width(),n.height=n.height||this.height();const s=new Ls({width:n.width,height:n.height,pixelRatio:n.pixelRatio||1}),u=s.getContext()._context,r=this.children;return(n.x||n.y)&&u.translate(-1*n.x,-1*n.y),r.forEach(function(d){if(!d.isVisible())return;const m=d._toKonvaCanvas(n);u.drawImage(m._canvas,n.x,n.y,m.getWidth()/m.getPixelRatio(),m.getHeight()/m.getPixelRatio())}),s}getIntersection(n){if(!n)return null;const s=this.children,u=s.length-1;for(let r=u;r>=0;r--){const d=s[r].getIntersection(n);if(d)return d}return null}_resizeDOM(){const n=this.width(),s=this.height();this.content&&(this.content.style.width=n+Gm,this.content.style.height=s+Gm),this.bufferCanvas.setSize(n,s),this.bufferHitCanvas.setSize(n,s),this.children.forEach(u=>{u.setSize({width:n,height:s}),u.draw()})}add(n,...s){if(arguments.length>1){for(let r=0;rC2&&Z.warn("The stage has "+u+" 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."),n.setSize({width:this.width(),height:this.height()}),n.draw(),vt.isBrowser&&this.content.appendChild(n.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(n){return f2(n,this)}setPointerCapture(n){m2(n,this)}releaseCapture(n){pd(n,this)}getLayers(){return this.children}_bindContentEvents(){vt.isBrowser&&L2.forEach(([n,s])=>{this.content.addEventListener(n,u=>{this[s](u)},{passive:!1})})}_pointerenter(n){this.setPointersPositions(n);const s=Nc(n.type);s&&this._fire(s.pointerenter,{evt:n,target:this,currentTarget:this})}_pointerover(n){this.setPointersPositions(n);const s=Nc(n.type);s&&this._fire(s.pointerover,{evt:n,target:this,currentTarget:this})}_getTargetShape(n){let s=this[n+"targetShape"];return s&&!s.getStage()&&(s=null),s}_pointerleave(n){const s=Nc(n.type),u=Do(n.type);if(!s)return;this.setPointersPositions(n);const r=this._getTargetShape(u),d=!(vt.isDragging()||vt.isTransforming())||vt.hitOnDragEnabled;r&&d?(r._fireAndBubble(s.pointerout,{evt:n}),r._fireAndBubble(s.pointerleave,{evt:n}),this._fire(s.pointerleave,{evt:n,target:this,currentTarget:this}),this[u+"targetShape"]=null):d&&(this._fire(s.pointerleave,{evt:n,target:this,currentTarget:this}),this._fire(s.pointerout,{evt:n,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(n){const s=Nc(n.type),u=Do(n.type);if(!s)return;this.setPointersPositions(n);let r=!1;this._changedPointerPositions.forEach(d=>{const m=this.getIntersection(d);if(Se.justDragged=!1,vt["_"+u+"ListenClick"]=!0,!m||!m.isListening()){this[u+"ClickStartShape"]=void 0;return}vt.capturePointerEventsEnabled&&m.setPointerCapture(d.id),this[u+"ClickStartShape"]=m,m._fireAndBubble(s.pointerdown,{evt:n,pointerId:d.id}),r=!0;const p=n.type.indexOf("touch")>=0;m.preventDefault()&&n.cancelable&&p&&n.preventDefault()}),r||this._fire(s.pointerdown,{evt:n,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(n){const s=Nc(n.type),u=Do(n.type);if(!s)return;const r=n.type.indexOf("touch")>=0||n.pointerType==="touch";if(vt.isDragging()&&Se.node.preventDefault()&&n.cancelable&&r&&n.preventDefault(),this.setPointersPositions(n),!(!(vt.isDragging()||vt.isTransforming())||vt.hitOnDragEnabled))return;const d={};let m=!1;const p=this._getTargetShape(u);this._changedPointerPositions.forEach(y=>{const S=Ym(y.id)||this.getIntersection(y),x=y.id,L={evt:n,pointerId:x},_=p!==S;if(_&&p&&(p._fireAndBubble(s.pointerout,{...L},S),p._fireAndBubble(s.pointerleave,{...L},S)),S){if(d[S._id])return;d[S._id]=!0}S&&S.isListening()?(m=!0,_&&(S._fireAndBubble(s.pointerover,{...L},p),S._fireAndBubble(s.pointerenter,{...L},p),this[u+"targetShape"]=S),S._fireAndBubble(s.pointermove,{...L})):p&&(this._fire(s.pointerover,{evt:n,target:this,currentTarget:this,pointerId:x}),this[u+"targetShape"]=null)}),m||this._fire(s.pointermove,{evt:n,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(n){const s=Nc(n.type),u=Do(n.type);if(!s)return;this.setPointersPositions(n);const r=this[u+"ClickStartShape"],d=this[u+"ClickEndShape"],m={};let p=!1;this._changedPointerPositions.forEach(y=>{const S=Ym(y.id)||this.getIntersection(y);if(S){if(S.releaseCapture(y.id),m[S._id])return;m[S._id]=!0}const x=y.id,L={evt:n,pointerId:x};let _=!1;vt["_"+u+"InDblClickWindow"]?(_=!0,clearTimeout(this[u+"DblTimeout"])):Se.justDragged||(vt["_"+u+"InDblClickWindow"]=!0,clearTimeout(this[u+"DblTimeout"])),this[u+"DblTimeout"]=setTimeout(function(){vt["_"+u+"InDblClickWindow"]=!1},vt.dblClickWindow),S&&S.isListening()?(p=!0,this[u+"ClickEndShape"]=S,S._fireAndBubble(s.pointerup,{...L}),vt["_"+u+"ListenClick"]&&r&&r===S&&(S._fireAndBubble(s.pointerclick,{...L}),_&&d&&d===S&&S._fireAndBubble(s.pointerdblclick,{...L}))):(this[u+"ClickEndShape"]=null,p||(this._fire(s.pointerup,{evt:n,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),p=!0),vt["_"+u+"ListenClick"]&&this._fire(s.pointerclick,{evt:n,target:this,currentTarget:this,pointerId:x}),_&&this._fire(s.pointerdblclick,{evt:n,target:this,currentTarget:this,pointerId:x}))}),p||this._fire(s.pointerup,{evt:n,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),vt["_"+u+"ListenClick"]=!1,n.cancelable&&u!=="touch"&&u!=="pointer"&&n.preventDefault()}_contextmenu(n){this.setPointersPositions(n);const s=this.getIntersection(this.getPointerPosition());s&&s.isListening()?s._fireAndBubble(vf,{evt:n}):this._fire(vf,{evt:n,target:this,currentTarget:this})}_wheel(n){this.setPointersPositions(n);const s=this.getIntersection(this.getPointerPosition());s&&s.isListening()?s._fireAndBubble(yf,{evt:n}):this._fire(yf,{evt:n,target:this,currentTarget:this})}_pointercancel(n){this.setPointersPositions(n);const s=Ym(n.pointerId)||this.getIntersection(this.getPointerPosition());s&&s._fireAndBubble(Mc,Rm(n)),pd(n.pointerId)}_lostpointercapture(n){pd(n.pointerId)}setPointersPositions(n){const s=this._getContentPosition();let u=null,r=null;n=n||window.event,n.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(n.touches,d=>{this._pointerPositions.push({id:d.identifier,x:(d.clientX-s.left)/s.scaleX,y:(d.clientY-s.top)/s.scaleY})}),Array.prototype.forEach.call(n.changedTouches||n.touches,d=>{this._changedPointerPositions.push({id:d.identifier,x:(d.clientX-s.left)/s.scaleX,y:(d.clientY-s.top)/s.scaleY})})):(u=(n.clientX-s.left)/s.scaleX,r=(n.clientY-s.top)/s.scaleY,this.pointerPos={x:u,y:r},this._pointerPositions=[{x:u,y:r,id:Z._getFirstPointerId(n)}],this._changedPointerPositions=[{x:u,y:r,id:Z._getFirstPointerId(n)}])}_setPointerPosition(n){Z.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(n)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const n=this.content.getBoundingClientRect();return{top:n.top,left:n.left,scaleX:n.width/this.content.clientWidth||1,scaleY:n.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Ls({width:this.width(),height:this.height()}),this.bufferHitCanvas=new df({pixelRatio:1,width:this.width(),height:this.height()}),!vt.isBrowser)return;const n=this.container();if(!n)throw"Stage has no container. A container is required.";n.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"),n.appendChild(this.content),this._resizeDOM()}cache(){return Z.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(n){n.batchDraw()}),this}},Sd.prototype.nodeType=v2,$e(Sd),A.addGetterSetter(Sd,"container"),vt.isBrowser&&document.addEventListener("visibilitychange",()=>{Io.forEach(n=>{n.batchDraw()})})}));function Qm(){return Sf||(Sf=Z.createCanvasElement().getContext("2d"),Sf)}function _4(n){const s=this.attrs.fillRule;s?n.fill(s):n.fill()}function E4(n){n.stroke()}function z4(n){const s=this.attrs.fillRule;s?n.fill(s):n.fill()}function M4(n){n.stroke()}function N4(){this._clearCache(qm)}function T4(){this._clearCache(Km)}function A4(){this._clearCache(km)}function w4(){this._clearCache(Fm)}function O4(){this._clearCache(Pm)}var qm,Km,km,Fm,Pm,Sf,Zo,ht,Va=Et((()=>{Ce(),ha(),re(),Sa(),ge(),g2(),qm="hasShadow",Km="shadowRGBA",km="patternImage",Fm="linearGradient",Pm="radialGradient",Zo={},ht=class extends bt{constructor(n){super(n);let s,u=0;for(;s=Z.getHitColor(),!(s&&!(s in Zo));)if(u++,u>=1e4){Z.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),s=Z.getRandomColor();break}this.colorKey=s,Zo[s]=this}getContext(){return Z.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return Z.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(qm,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(km,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const n=Qm().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const s=new xn;s.translate(this.fillPatternX(),this.fillPatternY()),s.rotate(vt.getAngle(this.fillPatternRotation())),s.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),s.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const u=s.getMatrix(),r=typeof DOMMatrix>"u"?{a:u[0],b:u[1],c:u[2],d:u[3],e:u[4],f:u[5]}:new DOMMatrix(u);n.setTransform(r)}return n}}_getLinearGradient(){return this._getCache(Fm,this.__getLinearGradient)}__getLinearGradient(){const n=this.fillLinearGradientColorStops();if(n){const s=Qm(),u=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),d=s.createLinearGradient(u.x,u.y,r.x,r.y);for(let m=0;mthis.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 n=this.hitStrokeWidth();return n==="auto"?this.hasStroke():this.strokeEnabled()&&!!n}intersects(n){const s=this.getStage();if(!s)return!1;const u=s.bufferHitCanvas;return u.getContext().clear(),this.drawHit(u,void 0,!0),u.context.getImageData(Math.round(n.x),Math.round(n.y),1,1).data[3]>0}destroy(){return bt.prototype.destroy.call(this),delete Zo[this.colorKey],delete this.colorKey,this}_useBufferCanvas(n){var s;if(!(!((s=this.attrs.perfectDrawEnabled)!==null&&s!==void 0)||s))return!1;const u=n||this.hasFill(),r=this.hasStroke(),d=this.getAbsoluteOpacity()!==1;if(u&&r&&d)return!0;const m=this.hasShadow(),p=this.shadowForStrokeEnabled();return!!(u&&r&&m&&p)}setStrokeHitEnabled(n){Z.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),n?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const n=this.size();return{x:this._centroid?-n.width/2:0,y:this._centroid?-n.height/2:0,width:n.width,height:n.height}}getClientRect(n={}){let s=!1,u=this.getParent();for(;u;){if(u.isCached()){s=!0;break}u=u.getParent()}const r=n.skipTransform,d=n.relativeTo||s&&this.getStage()||void 0,m=this.getSelfRect(),p=!n.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,y=m.width+p,S=m.height+p,x=!n.skipShadow&&this.hasShadow(),L=x?this.shadowOffsetX():0,_=x?this.shadowOffsetY():0,M=y+Math.abs(L),w=S+Math.abs(_),N=x&&this.shadowBlur()||0,J={width:M+N*2,height:w+N*2,x:-(p/2+N)+Math.min(L,0)+m.x,y:-(p/2+N)+Math.min(_,0)+m.y};return r?J:this._transformedRect(J,d)}drawScene(n,s,u){const r=this.getLayer(),d=(n||r.getCanvas()).getContext(),m=this._getCanvasCache(),p=this.getSceneFunc(),y=this.hasShadow();let S;const x=s===this;if(!this.isVisible()&&!x)return this;if(m){d.save();const L=this.getAbsoluteTransform(s).getMatrix();return d.transform(L[0],L[1],L[2],L[3],L[4],L[5]),this._drawCachedSceneCanvas(d),d.restore(),this}if(!p)return this;if(d.save(),this._useBufferCanvas()){S=this.getStage();const L=u||S.bufferCanvas,_=L.getContext();u?(_.save(),_.setTransform(1,0,0,1,0,0),_.clearRect(0,0,L.width,L.height),_.restore()):_.clear(),_.save(),_._applyLineJoin(this),_._applyMiterLimit(this);const M=this.getAbsoluteTransform(s).getMatrix();_.transform(M[0],M[1],M[2],M[3],M[4],M[5]),p.call(this,_,this),_.restore();const w=L.pixelRatio;y&&d._applyShadow(this),x||(d._applyOpacity(this),d._applyGlobalCompositeOperation(this)),d.drawImage(L._canvas,L.x||0,L.y||0,L.width/w,L.height/w)}else{if(d._applyLineJoin(this),d._applyMiterLimit(this),!x){const L=this.getAbsoluteTransform(s).getMatrix();d.transform(L[0],L[1],L[2],L[3],L[4],L[5]),d._applyOpacity(this),d._applyGlobalCompositeOperation(this)}y&&d._applyShadow(this),p.call(this,d,this)}return d.restore(),this}drawHit(n,s,u=!1){if(!this.shouldDrawHit(s,u))return this;const r=this.getLayer(),d=n||r.hitCanvas,m=d&&d.getContext(),p=this.hitFunc()||this.sceneFunc(),y=this._getCanvasCache(),S=y&&y.hit;if(this.colorKey||Z.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){m.save();const x=this.getAbsoluteTransform(s).getMatrix();return m.transform(x[0],x[1],x[2],x[3],x[4],x[5]),this._drawCachedHitCanvas(m),m.restore(),this}if(!p)return this;if(m.save(),m._applyLineJoin(this),m._applyMiterLimit(this),this!==s){const x=this.getAbsoluteTransform(s).getMatrix();m.transform(x[0],x[1],x[2],x[3],x[4],x[5])}return p.call(this,m,this),m.restore(),this}drawHitFromCache(n=0){const s=this._getCanvasCache(),u=this._getCachedSceneCanvas(),r=s.hit,d=r.getContext(),m=r.getWidth(),p=r.getHeight();d.clear(),d.drawImage(u._canvas,0,0,m,p);try{const y=d.getImageData(0,0,m,p),S=y.data,x=S.length,L=Z._hexToRgb(this.colorKey);for(let _=0;_n?(S[_]=L.r,S[_+1]=L.g,S[_+2]=L.b,S[_+3]=255):S[_+3]=0;d.putImageData(y,0,0)}catch(y){Z.error("Unable to draw hit graph from cached scene canvas. "+y.message)}return this}hasPointerCapture(n){return f2(n,this)}setPointerCapture(n){m2(n,this)}releaseCapture(n){pd(n,this)}},ht.prototype._fillFunc=_4,ht.prototype._strokeFunc=E4,ht.prototype._fillFuncHit=z4,ht.prototype._strokeFuncHit=M4,ht.prototype._centroid=!1,ht.prototype.nodeType="Shape",$e(ht),ht.prototype.eventListeners={},ht.prototype.on("shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",N4),ht.prototype.on("shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",T4),ht.prototype.on("fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",A4),ht.prototype.on("fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",w4),ht.prototype.on("fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",O4),A.addGetterSetter(ht,"stroke",void 0,t2()),A.addGetterSetter(ht,"strokeWidth",2,gt()),A.addGetterSetter(ht,"fillAfterStrokeEnabled",!1),A.addGetterSetter(ht,"hitStrokeWidth","auto",Mm()),A.addGetterSetter(ht,"strokeHitEnabled",!0,$n()),A.addGetterSetter(ht,"perfectDrawEnabled",!0,$n()),A.addGetterSetter(ht,"shadowForStrokeEnabled",!0,$n()),A.addGetterSetter(ht,"lineJoin"),A.addGetterSetter(ht,"lineCap"),A.addGetterSetter(ht,"miterLimit"),A.addGetterSetter(ht,"sceneFunc"),A.addGetterSetter(ht,"hitFunc"),A.addGetterSetter(ht,"dash"),A.addGetterSetter(ht,"dashOffset",0,gt()),A.addGetterSetter(ht,"shadowColor",void 0,zc()),A.addGetterSetter(ht,"shadowBlur",0,gt()),A.addGetterSetter(ht,"shadowOpacity",1,gt()),A.addComponentsGetterSetter(ht,"shadowOffset",["x","y"]),A.addGetterSetter(ht,"shadowOffsetX",0,gt()),A.addGetterSetter(ht,"shadowOffsetY",0,gt()),A.addGetterSetter(ht,"fillPatternImage"),A.addGetterSetter(ht,"fill",void 0,t2()),A.addGetterSetter(ht,"fillPatternX",0,gt()),A.addGetterSetter(ht,"fillPatternY",0,gt()),A.addGetterSetter(ht,"fillLinearGradientColorStops"),A.addGetterSetter(ht,"strokeLinearGradientColorStops"),A.addGetterSetter(ht,"fillRadialGradientStartRadius",0),A.addGetterSetter(ht,"fillRadialGradientEndRadius",0),A.addGetterSetter(ht,"fillRadialGradientColorStops"),A.addGetterSetter(ht,"fillPatternRepeat","repeat"),A.addGetterSetter(ht,"fillEnabled",!0),A.addGetterSetter(ht,"strokeEnabled",!0),A.addGetterSetter(ht,"shadowEnabled",!0),A.addGetterSetter(ht,"dashEnabled",!0),A.addGetterSetter(ht,"strokeScaleEnabled",!0),A.addGetterSetter(ht,"fillPriority","color"),A.addComponentsGetterSetter(ht,"fillPatternOffset",["x","y"]),A.addGetterSetter(ht,"fillPatternOffsetX",0,gt()),A.addGetterSetter(ht,"fillPatternOffsetY",0,gt()),A.addComponentsGetterSetter(ht,"fillPatternScale",["x","y"]),A.addGetterSetter(ht,"fillPatternScaleX",1,gt()),A.addGetterSetter(ht,"fillPatternScaleY",1,gt()),A.addComponentsGetterSetter(ht,"fillLinearGradientStartPoint",["x","y"]),A.addComponentsGetterSetter(ht,"strokeLinearGradientStartPoint",["x","y"]),A.addGetterSetter(ht,"fillLinearGradientStartPointX",0),A.addGetterSetter(ht,"strokeLinearGradientStartPointX",0),A.addGetterSetter(ht,"fillLinearGradientStartPointY",0),A.addGetterSetter(ht,"strokeLinearGradientStartPointY",0),A.addComponentsGetterSetter(ht,"fillLinearGradientEndPoint",["x","y"]),A.addComponentsGetterSetter(ht,"strokeLinearGradientEndPoint",["x","y"]),A.addGetterSetter(ht,"fillLinearGradientEndPointX",0),A.addGetterSetter(ht,"strokeLinearGradientEndPointX",0),A.addGetterSetter(ht,"fillLinearGradientEndPointY",0),A.addGetterSetter(ht,"strokeLinearGradientEndPointY",0),A.addComponentsGetterSetter(ht,"fillRadialGradientStartPoint",["x","y"]),A.addGetterSetter(ht,"fillRadialGradientStartPointX",0),A.addGetterSetter(ht,"fillRadialGradientStartPointY",0),A.addComponentsGetterSetter(ht,"fillRadialGradientEndPoint",["x","y"]),A.addGetterSetter(ht,"fillRadialGradientEndPointX",0),A.addGetterSetter(ht,"fillRadialGradientEndPointY",0),A.addGetterSetter(ht,"fillPatternRotation",0),A.addGetterSetter(ht,"fillRule",void 0,zc()),A.backCompat(ht,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})),_2,E2,$m,z2,mu,M2=Et((()=>{ha(),pf(),Sa(),re(),hf(),ge(),Va(),Ce(),_2="beforeDraw",E2="draw",$m=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],z2=$m.length,mu=class extends Ii{constructor(n){super(n),this.canvas=new Ls,this.hitCanvas=new df({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(n){return this.getContext().clear(n),this.getHitCanvas().getContext().clear(n),this}setZIndex(n){super.setZIndex(n);const s=this.getStage();return s&&s.content&&(s.content.removeChild(this.getNativeCanvasElement()),n{this.draw(),this._waitingForDraw=!1})),this}getIntersection(n){if(!this.isListening()||!this.isVisible())return null;let s=1,u=!1;for(;;){for(let r=0;r0)return{antialiased:!0};return{}}drawScene(n,s,u){const r=this.getLayer(),d=n||r&&r.getCanvas();return this._fire(_2,{node:this}),this.clearBeforeDraw()&&d.getContext().clear(),Ii.prototype.drawScene.call(this,d,s,u),this._fire(E2,{node:this}),this}drawHit(n,s){const u=this.getLayer(),r=n||u&&u.hitCanvas;return u&&u.clearBeforeDraw()&&u.getHitCanvas().getContext().clear(),Ii.prototype.drawHit.call(this,r,s),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(n){Z.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(n)}getHitGraphEnabled(n){return Z.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const n=this.parent;this.hitCanvas._canvas.parentNode?n.content.removeChild(this.hitCanvas._canvas):n.content.appendChild(this.hitCanvas._canvas)}destroy(){return Z.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}},mu.prototype.nodeType="Layer",$e(mu),A.addGetterSetter(mu,"imageSmoothingEnabled",!0),A.addGetterSetter(mu,"clearBeforeDraw",!0),A.addGetterSetter(mu,"hitGraphEnabled",!0,$n())})),Cf,Y4=Et((()=>{ha(),M2(),Ce(),Cf=class extends mu{constructor(n){super(n),this.listening(!1),Z.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}},Cf.prototype.nodeType="FastLayer",$e(Cf)})),Tc,t1=Et((()=>{ha(),pf(),Ce(),Tc=class extends Ii{_validateAdd(n){const s=n.getType();s!=="Group"&&s!=="Shape"&&Z.throw("You may only add groups and shapes to groups.")}},Tc.prototype.nodeType="Group",$e(Tc)})),Lf,Ac,e1=Et((()=>{Ce(),ha(),Lf=(function(){return du.performance&&du.performance.now?function(){return du.performance.now()}:function(){return new Date().getTime()}})(),Ac=class cd{constructor(s,u){this.id=cd.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Lf(),frameRate:0},this.func=s,this.setLayers(u)}setLayers(s){let u=[];return s&&(u=Array.isArray(s)?s:[s]),this.layers=u,this}getLayers(){return this.layers}addLayer(s){const u=this.layers,r=u.length;for(let d=0;d{ha(),e1(),Sa(),Ce(),N2={node:1,duration:1,easing:1,onFinish:1,yoyo:1},T2=1,a1=2,i1=3,n1=["fill","stroke","shadowColor"],A2=0,w2=class{constructor(n,s,u,r,d,m,p){this.prop=n,this.propFunc=s,this.begin=r,this._pos=r,this.duration=m,this._change=0,this.prevPos=0,this.yoyo=p,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=u,this._change=d-this.begin,this.pause()}fire(n){const s=this[n];s&&s()}setTime(n){n>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():n<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=n,this.update())}getTime(){return this._time}setPosition(n){this.prevPos=this._pos,this.propFunc(n),this._pos=n}getPosition(n){return n===void 0&&(n=this._time),this.func(n,this.begin,this._change,this.duration)}play(){this.state=a1,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=i1,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(n){this.pause(),this._time=n,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const n=this.getTimer()-this._startTime;this.state===a1?this.setTime(n):this.state===i1&&this.setTime(this.duration-n)}pause(){this.state=T2,this.fire("onPause")}getTimer(){return new Date().getTime()}},Cd=class ba{constructor(s){const u=this,r=s.node,d=r._id,m=s.easing||Jo.Linear,p=!!s.yoyo;let y,S;typeof s.duration>"u"?y=.3:s.duration===0?y=.001:y=s.duration,this.node=r,this._id=A2++;const x=r.getLayer()||(r instanceof vt.Stage?r.getLayers():null);x||Z.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new Ac(function(){u.tween.onEnterFrame()},x),this.tween=new w2(S,function(L){u._tweenFunc(L)},m,0,1,y*1e3,p),this._addListeners(),ba.attrs[d]||(ba.attrs[d]={}),ba.attrs[d][this._id]||(ba.attrs[d][this._id]={}),ba.tweens[d]||(ba.tweens[d]={});for(S in s)N2[S]===void 0&&this._addAttr(S,s[S]);this.reset(),this.onFinish=s.onFinish,this.onReset=s.onReset,this.onUpdate=s.onUpdate}_addAttr(s,u){const r=this.node,d=r._id;let m,p,y,S,x;const L=ba.tweens[d][s];L&&delete ba.attrs[d][L][s];let _=r.getAttr(s);if(Z._isArray(u))if(m=[],p=Math.max(u.length,_.length),s==="points"&&u.length!==_.length&&(u.length>_.length?(S=_,_=Z._prepareArrayForTween(_,u,r.closed())):(y=u,u=Z._prepareArrayForTween(u,_,r.closed()))),s.indexOf("fill")===0)for(let M=0;M{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const s=this.node,u=ba.attrs[s._id][this._id];u.points&&u.points.trueEnd&&s.setAttr("points",u.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const s=this.node,u=ba.attrs[s._id][this._id];u.points&&u.points.trueStart&&s.points(u.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(s){return this.tween.seek(s*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const s=this.node._id,u=this._id,r=ba.tweens[s];this.pause(),this.anim&&this.anim.stop();for(const d in r)delete ba.tweens[s][d];delete ba.attrs[s][u],ba.tweens[s]&&(Object.keys(ba.tweens[s]).length===0&&delete ba.tweens[s],Object.keys(ba.attrs[s]).length===0&&delete ba.attrs[s])}},Cd.attrs={},Cd.tweens={},bt.prototype.to=function(n){const s=n.onFinish;n.node=this,n.onFinish=function(){this.destroy(),s&&s()},new Cd(n).play()},Jo={BackEaseIn(n,s,u,r){return u*(n/=r)*n*((1.70158+1)*n-1.70158)+s},BackEaseOut(n,s,u,r){return u*((n=n/r-1)*n*((1.70158+1)*n+1.70158)+1)+s},BackEaseInOut(n,s,u,r){let d=1.70158;return(n/=r/2)<1?u/2*(n*n*(((d*=1.525)+1)*n-d))+s:u/2*((n-=2)*n*(((d*=1.525)+1)*n+d)+2)+s},ElasticEaseIn(n,s,u,r,d,m){let p=0;return n===0?s:(n/=r)===1?s+u:(m||(m=r*.3),!d||d{Ce(),ha(),Sa(),pf(),x4(),M2(),Y4(),t1(),zm(),Va(),e1(),R4(),Em(),hf(),xf=Z._assign(vt,{Util:Z,Transform:xn,Node:bt,Container:Ii,Stage:Sd,stages:Io,Layer:mu,FastLayer:Cf,Group:Tc,DD:Se,Shape:ht,shapes:Zo,Animation:Ac,Tween:Cd,Easings:Jo,Context:fd,Canvas:rf})})),jl,j4=Et((()=>{re(),Va(),Ce(),ge(),jl=class extends ht{_sceneFunc(n){const s=vt.getAngle(this.angle()),u=this.clockwise();n.beginPath(),n.arc(0,0,this.outerRadius(),0,s,u),n.arc(0,0,this.innerRadius(),s,0,!u),n.closePath(),n.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(n){this.outerRadius(n/2)}setHeight(n){this.outerRadius(n/2)}getSelfRect(){const n=this.innerRadius(),s=this.outerRadius(),u=this.clockwise(),r=vt.getAngle(u?360-this.angle():this.angle()),d=Math.cos(Math.min(r,Math.PI)),m=1,p=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),y=Math.sin(Math.min(r,Math.PI/2)),S=d*(d>0?n:s),x=m*(m>0?s:n),L=p*(p>0?n:s),_=y*(y>0?s:n);return{x:S,y:u?-1*_:L,width:x-S,height:_-L}}},jl.prototype._centroid=!0,jl.prototype.className="Arc",jl.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],$e(jl),A.addGetterSetter(jl,"innerRadius",0,gt()),A.addGetterSetter(jl,"outerRadius",0,gt()),A.addGetterSetter(jl,"angle",0,gt()),A.addGetterSetter(jl,"clockwise",!1,$n())}));function l1(n,s,u,r,d,m,p){const y=Math.sqrt(Math.pow(u-n,2)+Math.pow(r-s,2)),S=Math.sqrt(Math.pow(d-u,2)+Math.pow(m-r,2)),x=p*y/(y+S),L=p*S/(y+S);return[u-x*(d-n),r-x*(m-s),u+L*(d-n),r+L*(m-s)]}function Y2(n,s){const u=n.length,r=[];for(let d=2;d=0){const S=Math.sqrt(y);u.push((-m+S)/(2*d)),u.push((-m-S)/(2*d))}}}return u.filter(r=>r>0&&r<1).flatMap(r=>s.map(d=>{const m=1-r;return m*m*m*d[0]+3*m*m*r*d[1]+3*m*r*r*d[2]+r*r*r*d[3]}))}var Gl,R2=Et((()=>{re(),Ce(),Va(),ge(),Gl=class extends ht{constructor(n){super(n),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(n){const s=this.points(),u=s.length,r=this.tension(),d=this.closed(),m=this.bezier();if(!u)return;let p=0;if(n.beginPath(),n.moveTo(s[0],s[1]),r!==0&&u>4){const y=this.getTensionPoints(),S=y.length;for(p=d?0:4,d||n.quadraticCurveTo(y[0],y[1],y[2],y[3]);p{j2=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],G2=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],H2=[[1],[1,1],[1,2,1],[1,3,3,1]],s1=(n,s,u)=>{let r,d;const p=u/2;r=0;for(let y=0;y<20;y++)d=p*j2[20][y]+p,r+=G2[20][y]*H4(n,s,d);return p*r},u1=(n,s,u)=>{u===void 0&&(u=1);const r=n[0]-2*n[1]+n[2],d=s[0]-2*s[1]+s[2],m=2*n[1]-2*n[0],p=2*s[1]-2*s[0],y=4*(r*r+d*d),S=4*(r*m+d*p),x=m*m+p*p;if(y===0)return u*Math.sqrt(Math.pow(n[2]-n[0],2)+Math.pow(s[2]-s[0],2));const L=S/(2*y),_=x/y,M=u+L,w=_-L*L,N=M*M+w>0?Math.sqrt(M*M+w):0,J=L*L+w>0?Math.sqrt(L*L+w):0,q=L+Math.sqrt(L*L+w)!==0?w*Math.log(Math.abs((M+N)/(L+J))):0;return Math.sqrt(y)/2*(M*N-L*J+q)},_f=(n,s,u)=>{const r=u.length-1;let d,m;if(r===0)return 0;if(n===0){m=0;for(let p=0;p<=r;p++)m+=H2[r][p]*Math.pow(1-s,r-p)*Math.pow(s,p)*u[p];return m}else{d=new Array(r);for(let p=0;p{let r=1,d=n/s,m=(n-u(d))/s,p=0;for(;r>.001;){const y=u(d+m),S=Math.abs(n-y)/s;if(S500)break}return d}})),en,o1=Et((()=>{re(),Ce(),Va(),D4(),en=class tn extends ht{constructor(s){super(s),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=tn.parsePathData(this.data()),this.pathLength=tn.getPathLength(this.dataArray)}_sceneFunc(s){const u=this.dataArray;s.beginPath();let r=!1;for(let d=0;dL?x:L,q=x>L?1:x/L,G=x>L?L/x:1;s.translate(y,S),s.rotate(w),s.scale(q,G),s.arc(0,0,J,_,_+M,1-N),s.scale(1/q,1/G),s.rotate(-w),s.translate(-y,-S);break;case"z":r=!0,s.closePath();break}}!r&&!this.hasFill()?s.strokeShape(this):s.fillStrokeShape(this)}getSelfRect(){let s=[];this.dataArray.forEach(function(S){if(S.command==="A"){const x=S.points[4],L=S.points[5],_=S.points[4]+L;let M=Math.PI/180;if(Math.abs(x-_)_;w-=M){const N=tn.getPointOnEllipticalArc(S.points[0],S.points[1],S.points[2],S.points[3],w,0);s.push(N.x,N.y)}else for(let w=x+M;w<_;w+=M){const N=tn.getPointOnEllipticalArc(S.points[0],S.points[1],S.points[2],S.points[3],w,0);s.push(N.x,N.y)}}else if(S.command==="C")for(let x=0;x<=1;x+=.01){const L=tn.getPointOnCubicBezier(x,S.start.x,S.start.y,S.points[0],S.points[1],S.points[2],S.points[3],S.points[4],S.points[5]);s.push(L.x,L.y)}else s=s.concat(S.points)});let u=s[0],r=s[0],d=s[1],m=s[1],p,y;for(let S=0;Su[d].pathLength;)s-=u[d].pathLength,++d;if(d===m)return r=u[d-1].points.slice(-2),{x:r[0],y:r[1]};if(s<.01)return u[d].command==="M"?(r=u[d].points.slice(0,2),{x:r[0],y:r[1]}):{x:u[d].start.x,y:u[d].start.y};const p=u[d],y=p.points;switch(p.command){case"L":return tn.getPointOnLine(s,p.start.x,p.start.y,y[0],y[1]);case"C":return tn.getPointOnCubicBezier(c1(s,tn.getPathLength(u),J=>s1([p.start.x,y[0],y[2],y[4]],[p.start.y,y[1],y[3],y[5]],J)),p.start.x,p.start.y,y[0],y[1],y[2],y[3],y[4],y[5]);case"Q":return tn.getPointOnQuadraticBezier(c1(s,tn.getPathLength(u),J=>u1([p.start.x,y[0],y[2]],[p.start.y,y[1],y[3]],J)),p.start.x,p.start.y,y[0],y[1],y[2],y[3]);case"A":const S=y[0],x=y[1],L=y[2],_=y[3],M=y[5],w=y[6];let N=y[4];return N+=M*s/p.pathLength,tn.getPointOnEllipticalArc(S,x,L,_,N,w)}return null}static getPointOnLine(s,u,r,d,m,p,y){p=p??u,y=y??r;const S=this.getLineLength(u,r,d,m);if(S<1e-10)return{x:u,y:r};if(d===u)return{x:p,y:y+(m>r?s:-s)};const x=(m-r)/(d-u),L=Math.sqrt(s*s/(1+x*x))*(d=0&&(J+=2,J>=7&&(J-=7));continue}if(J>=0){if(J===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(V)){N.push(parseInt(V[0],10)),N.push(parseInt(V[1],10)),N.push(parseFloat(V.slice(2))),J+=3,J>=7&&(J-=7);continue}if(V==="11"||V==="10"||V==="01"){N.push(parseInt(V[0],10)),N.push(parseInt(V[1],10)),J+=2,J>=7&&(J-=7);continue}if(V==="0"||V==="1"){N.push(parseInt(V,10)),J+=1,J>=7&&(J-=7);continue}}else if(J===4){if(/^[01]\d+(?:\.\d+)?$/.test(V)){N.push(parseInt(V[0],10)),N.push(parseFloat(V.slice(1))),J+=2,J>=7&&(J-=7);continue}if(V==="0"||V==="1"){N.push(parseInt(V,10)),J+=1,J>=7&&(J-=7);continue}}const U=parseFloat(V);isNaN(U)?N.push(0):N.push(U),J+=1,J>=7&&(J-=7)}else{const U=parseFloat(V);isNaN(U)?N.push(0):N.push(U)}}for(;N.length>0&&!isNaN(N[0]);){let q="",G=[];const V=y,U=S;let F,ot,ut,at,mt,Rt,zt,Gt,jt,Ht;switch(w){case"l":y+=N.shift(),S+=N.shift(),q="L",G.push(y,S);break;case"L":y=N.shift(),S=N.shift(),G.push(y,S);break;case"m":const Mt=N.shift(),Lt=N.shift();if(y+=Mt,S+=Lt,q="M",m.length>2&&m[m.length-1].command==="z"){for(let lt=m.length-2;lt>=0;lt--)if(m[lt].command==="M"){y=m[lt].points[0]+Mt,S=m[lt].points[1]+Lt;break}}G.push(y,S),w="l";break;case"M":y=N.shift(),S=N.shift(),q="M",G.push(y,S),w="L";break;case"h":y+=N.shift(),q="L",G.push(y,S);break;case"H":y=N.shift(),q="L",G.push(y,S);break;case"v":S+=N.shift(),q="L",G.push(y,S);break;case"V":S=N.shift(),q="L",G.push(y,S);break;case"C":G.push(N.shift(),N.shift(),N.shift(),N.shift()),y=N.shift(),S=N.shift(),G.push(y,S);break;case"c":G.push(y+N.shift(),S+N.shift(),y+N.shift(),S+N.shift()),y+=N.shift(),S+=N.shift(),q="C",G.push(y,S);break;case"S":ot=y,ut=S,F=m[m.length-1],F.command==="C"&&(ot=y+(y-F.points[2]),ut=S+(S-F.points[3])),G.push(ot,ut,N.shift(),N.shift()),y=N.shift(),S=N.shift(),q="C",G.push(y,S);break;case"s":ot=y,ut=S,F=m[m.length-1],F.command==="C"&&(ot=y+(y-F.points[2]),ut=S+(S-F.points[3])),G.push(ot,ut,y+N.shift(),S+N.shift()),y+=N.shift(),S+=N.shift(),q="C",G.push(y,S);break;case"Q":G.push(N.shift(),N.shift()),y=N.shift(),S=N.shift(),G.push(y,S);break;case"q":G.push(y+N.shift(),S+N.shift()),y+=N.shift(),S+=N.shift(),q="Q",G.push(y,S);break;case"T":ot=y,ut=S,F=m[m.length-1],F.command==="Q"&&(ot=y+(y-F.points[0]),ut=S+(S-F.points[1])),y=N.shift(),S=N.shift(),q="Q",G.push(ot,ut,y,S);break;case"t":ot=y,ut=S,F=m[m.length-1],F.command==="Q"&&(ot=y+(y-F.points[0]),ut=S+(S-F.points[1])),y+=N.shift(),S+=N.shift(),q="Q",G.push(ot,ut,y,S);break;case"A":at=N.shift(),mt=N.shift(),Rt=N.shift(),zt=N.shift(),Gt=N.shift(),jt=y,Ht=S,y=N.shift(),S=N.shift(),q="A",G=this.convertEndpointToCenterParameterization(jt,Ht,y,S,zt,Gt,at,mt,Rt);break;case"a":at=N.shift(),mt=N.shift(),Rt=N.shift(),zt=N.shift(),Gt=N.shift(),jt=y,Ht=S,y+=N.shift(),S+=N.shift(),q="A",G=this.convertEndpointToCenterParameterization(jt,Ht,y,S,zt,Gt,at,mt,Rt);break}m.push({command:q||w,points:G,start:{x:V,y:U},pathLength:this.calcLength(V,U,q||w,G)})}(w==="z"||w==="Z")&&m.push({command:"z",points:[],start:void 0,pathLength:0})}return m}static calcLength(s,u,r,d){let m,p,y,S;const x=tn;switch(r){case"L":return x.getLineLength(s,u,d[0],d[1]);case"C":return s1([s,d[0],d[2],d[4]],[u,d[1],d[3],d[5]],1);case"Q":return u1([s,d[0],d[2]],[u,d[1],d[3]],1);case"A":m=0;const L=d[4],_=d[5],M=d[4]+_;let w=Math.PI/180;if(Math.abs(L-M)M;S-=w)y=x.getPointOnEllipticalArc(d[0],d[1],d[2],d[3],S,0),m+=x.getLineLength(p.x,p.y,y.x,y.y),p=y;else for(S=L+w;S1&&(y*=Math.sqrt(w),S*=Math.sqrt(w));let N=Math.sqrt((y*y*(S*S)-y*y*(M*M)-S*S*(_*_))/(y*y*(M*M)+S*S*(_*_)));m===p&&(N*=-1),isNaN(N)&&(N=0);const J=N*y*M/S,q=N*-S*_/y,G=(s+r)/2+Math.cos(L)*J-Math.sin(L)*q,V=(u+d)/2+Math.sin(L)*J+Math.cos(L)*q,U=function(zt){return Math.sqrt(zt[0]*zt[0]+zt[1]*zt[1])},F=function(zt,Gt){return(zt[0]*Gt[0]+zt[1]*Gt[1])/(U(zt)*U(Gt))},ot=function(zt,Gt){return(zt[0]*Gt[1]=1&&(Rt=0),p===0&&Rt>0&&(Rt=Rt-2*Math.PI),p===1&&Rt<0&&(Rt=Rt+2*Math.PI),[G,V,y,S,ut,Rt,L,p]}},en.prototype.className="Path",en.prototype._attrsAffectingSize=["data"],$e(en),A.addGetterSetter(en,"data")})),gu,I4=Et((()=>{re(),R2(),ge(),Ce(),o1(),gu=class extends Gl{_sceneFunc(n){super._sceneFunc(n);const s=Math.PI*2,u=this.points();let r=u;const d=this.tension()!==0&&u.length>4;d&&(r=this.getTensionPoints());const m=this.pointerLength(),p=u.length;let y,S;if(d){const _=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],u[p-2],u[p-1]],M=en.calcLength(r[r.length-4],r[r.length-3],"C",_),w=en.getPointOnQuadraticBezier(Math.min(1,1-m/M),_[0],_[1],_[2],_[3],_[4],_[5]);y=u[p-2]-w.x,S=u[p-1]-w.y}else y=u[p-2]-u[p-4],S=u[p-1]-u[p-3];const x=(Math.atan2(S,y)+s)%s,L=this.pointerWidth();this.pointerAtEnding()&&(n.save(),n.beginPath(),n.translate(u[p-2],u[p-1]),n.rotate(x),n.moveTo(0,0),n.lineTo(-m,L/2),n.lineTo(-m,-L/2),n.closePath(),n.restore(),this.__fillStroke(n)),this.pointerAtBeginning()&&(n.save(),n.beginPath(),n.translate(u[0],u[1]),d?(y=(r[0]+r[2])/2-u[0],S=(r[1]+r[3])/2-u[1]):(y=u[2]-u[0],S=u[3]-u[1]),n.rotate((Math.atan2(-S,-y)+s)%s),n.moveTo(0,0),n.lineTo(-m,L/2),n.lineTo(-m,-L/2),n.closePath(),n.restore(),this.__fillStroke(n))}__fillStroke(n){const s=this.dashEnabled();s&&(this.attrs.dashEnabled=!1,n.setLineDash([])),n.fillStrokeShape(this),s&&(this.attrs.dashEnabled=!0)}getSelfRect(){const n=super.getSelfRect(),s=this.pointerWidth()/2;return{x:n.x,y:n.y-s,width:n.width,height:n.height+s*2}}},gu.prototype.className="Arrow",$e(gu),A.addGetterSetter(gu,"pointerLength",10,gt()),A.addGetterSetter(gu,"pointerWidth",10,gt()),A.addGetterSetter(gu,"pointerAtBeginning",!1),A.addGetterSetter(gu,"pointerAtEnding",!0)})),wc,Z4=Et((()=>{re(),Va(),ge(),Ce(),wc=class extends ht{_sceneFunc(n){n.beginPath(),n.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),n.closePath(),n.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(n){this.radius()!==n/2&&this.radius(n/2)}setHeight(n){this.radius()!==n/2&&this.radius(n/2)}},wc.prototype._centroid=!0,wc.prototype.className="Circle",wc.prototype._attrsAffectingSize=["radius"],$e(wc),A.addGetterSetter(wc,"radius",0,gt())})),_s,J4=Et((()=>{re(),Va(),ge(),Ce(),_s=class extends ht{_sceneFunc(n){const s=this.radiusX(),u=this.radiusY();n.beginPath(),n.save(),s!==u&&n.scale(1,u/s),n.arc(0,0,s,0,Math.PI*2,!1),n.restore(),n.closePath(),n.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(n){this.radiusX(n/2)}setHeight(n){this.radiusY(n/2)}},_s.prototype.className="Ellipse",_s.prototype._centroid=!0,_s.prototype._attrsAffectingSize=["radiusX","radiusY"],$e(_s),A.addComponentsGetterSetter(_s,"radius",["x","y"]),A.addGetterSetter(_s,"radiusX",0,gt()),A.addGetterSetter(_s,"radiusY",0,gt())})),_n,B4=Et((()=>{ha(),re(),Va(),Ce(),ge(),_n=class Bv extends ht{constructor(s){super(s),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",u=>{this._removeImageLoad(u.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const s=this.image();s&&s.complete||s&&s.readyState===4||s&&s.addEventListener&&s.addEventListener("load",this._loadListener)}_removeImageLoad(s){s&&s.removeEventListener&&s.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const s=!!this.cornerRadius(),u=this.hasShadow();return s&&u?!0:super._useBufferCanvas(!0)}_sceneFunc(s){const u=this.getWidth(),r=this.getHeight(),d=this.cornerRadius(),m=this.attrs.image;let p;if(m){const y=this.attrs.cropWidth,S=this.attrs.cropHeight;y&&S?p=[m,this.cropX(),this.cropY(),y,S,0,0,u,r]:p=[m,0,0,u,r]}(this.hasFill()||this.hasStroke()||d)&&(s.beginPath(),d?Z.drawRoundedRectPath(s,u,r,d):s.rect(0,0,u,r),s.closePath(),s.fillStrokeShape(this)),m&&(d&&s.clip(),s.drawImage.apply(s,p))}_hitFunc(s){const u=this.width(),r=this.height(),d=this.cornerRadius();s.beginPath(),d?Z.drawRoundedRectPath(s,u,r,d):s.rect(0,0,u,r),s.closePath(),s.fillStrokeShape(this)}getWidth(){var s,u,r;return(r=(s=this.attrs.width)!==null&&s!==void 0?s:(u=this.image())===null||u===void 0?void 0:u.width)!==null&&r!==void 0?r:0}getHeight(){var s,u,r;return(r=(s=this.attrs.height)!==null&&s!==void 0?s:(u=this.image())===null||u===void 0?void 0:u.height)!==null&&r!==void 0?r:0}static fromURL(s,u,r=null){const d=Z.createImageElement();d.onload=function(){u(new Bv({image:d}))},d.onerror=r,d.crossOrigin="Anonymous",d.src=s}},_n.prototype.className="Image",_n.prototype._attrsAffectingSize=["image"],$e(_n),A.addGetterSetter(_n,"cornerRadius",0,ff(4)),A.addGetterSetter(_n,"image"),A.addComponentsGetterSetter(_n,"crop",["x","y","width","height"]),A.addGetterSetter(_n,"cropX",0,gt()),A.addGetterSetter(_n,"cropY",0,gt()),A.addGetterSetter(_n,"cropWidth",0,gt()),A.addGetterSetter(_n,"cropHeight",0,gt())})),r1,D2,I2,Ef,zf,Mf,Nf,Z2,Tf,pu,X4=Et((()=>{re(),Va(),t1(),ge(),Ce(),r1=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],D2="Change.konva",I2="none",Ef="up",zf="right",Mf="down",Nf="left",Z2=r1.length,Tf=class extends Tc{constructor(n){super(n),this.on("add.konva",function(s){this._addListeners(s.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(n){let s=this,u;const r=function(){s._sync()};for(u=0;u{re(),Va(),Ce(),ha(),ge(),Bo=class extends ht{_sceneFunc(n){const s=this.cornerRadius(),u=this.width(),r=this.height();n.beginPath(),s?Z.drawRoundedRectPath(n,u,r,s):n.rect(0,0,u,r),n.closePath(),n.fillStrokeShape(this)}},Bo.prototype.className="Rect",$e(Bo),A.addGetterSetter(Bo,"cornerRadius",0,ff(4))})),Es,U4=Et((()=>{re(),Va(),ge(),Ce(),ha(),Es=class extends ht{_sceneFunc(n){const s=this._getPoints(),u=this.radius(),r=this.sides(),d=this.cornerRadius();if(n.beginPath(),d)Z.drawRoundedPolygonPath(n,s,r,u,d);else{n.moveTo(s[0].x,s[0].y);for(let m=1;m{s=Math.min(s,m.x),u=Math.max(u,m.x),r=Math.min(r,m.y),d=Math.max(d,m.y)}),{x:s,y:r,width:u-s,height:d-r}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(n){this.radius(n/2)}setHeight(n){this.radius(n/2)}},Es.prototype.className="RegularPolygon",Es.prototype._centroid=!0,Es.prototype._attrsAffectingSize=["radius"],$e(Es),A.addGetterSetter(Es,"radius",0,gt()),A.addGetterSetter(Es,"sides",0,gt()),A.addGetterSetter(Es,"cornerRadius",0,ff(4))})),d1,vu,V4=Et((()=>{re(),Va(),ge(),Ce(),d1=Math.PI*2,vu=class extends ht{_sceneFunc(n){n.beginPath(),n.arc(0,0,this.innerRadius(),0,d1,!1),n.moveTo(this.outerRadius(),0),n.arc(0,0,this.outerRadius(),d1,0,!0),n.closePath(),n.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(n){this.outerRadius(n/2)}setHeight(n){this.outerRadius(n/2)}},vu.prototype.className="Ring",vu.prototype._centroid=!0,vu.prototype._attrsAffectingSize=["innerRadius","outerRadius"],$e(vu),A.addGetterSetter(vu,"innerRadius",0,gt()),A.addGetterSetter(vu,"outerRadius",0,gt())})),tl,W4=Et((()=>{re(),Va(),e1(),ge(),Ce(),tl=class extends ht{constructor(n){super(n),this._updated=!0,this.anim=new Ac(()=>{const s=this._updated;return this._updated=!1,s}),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(n){const s=this.animation(),u=this.frameIndex(),r=u*4,d=this.animations()[s],m=this.frameOffsets(),p=d[r+0],y=d[r+1],S=d[r+2],x=d[r+3],L=this.image();if((this.hasFill()||this.hasStroke())&&(n.beginPath(),n.rect(0,0,S,x),n.closePath(),n.fillStrokeShape(this)),L)if(m){const _=m[s],M=u*2;n.drawImage(L,p,y,S,x,_[M+0],_[M+1],S,x)}else n.drawImage(L,p,y,S,x,0,0,S,x)}_hitFunc(n){const s=this.animation(),u=this.frameIndex(),r=u*4,d=this.animations()[s],m=this.frameOffsets(),p=d[r+2],y=d[r+3];if(n.beginPath(),m){const S=m[s],x=u*2;n.rect(S[x+0],S[x+1],p,y)}else n.rect(0,0,p,y);n.closePath(),n.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const n=this;this.interval=setInterval(function(){n._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const n=this.getLayer();this.anim.setLayers(n),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const n=this.frameIndex(),s=this.animation();n{re(),Va(),ge(),Ce(),zs=class extends ht{_sceneFunc(n){const s=this.innerRadius(),u=this.outerRadius(),r=this.numPoints();n.beginPath(),n.moveTo(0,0-u);for(let d=1;d{if(new RegExp("\\p{Emoji}","u").test(u)){const m=d[r+1];m&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(m)?(s.push(u+m),d[r+1]=""):s.push(u)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(u+(d[r+1]||""))?s.push(u+d[r+1]):r>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(u)?s[s.length-1]+=u:u&&s.push(u);return s},[])}function q4(){if(Uo!==null)return Uo;Uo=!1;try{const n=document.createElement("canvas");n.width=10,n.height=10;const s=n.getContext(m1);if(s){s.globalAlpha=0,s.shadowColor="black",s.shadowBlur=5,s.shadowOffsetX=5,s.shadowOffsetY=5,s.fillStyle="black",s.font="10px Arial",s.fillText("X",0,10);const u=s.getImageData(0,0,10,10).data;for(let r=3;r0){Uo=!0;break}}}catch{}return Uo}function K4(n){return n.split(",").map(s=>{s=s.trim();const u=s.indexOf(" ")>=0,r=s.indexOf('"')>=0||s.indexOf("'")>=0;return u&&!r&&(s=`"${s}"`),s}).join(", ")}function h1(){return wf||(wf=Z.createCanvasElement().getContext(m1),wf)}function k4(n){n.fillText(this._partialText,this._partialTextX,this._partialTextY)}function F4(n){n.setAttr("miterLimit",2),n.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function P4(n){return n=n||{},!n.fillLinearGradientColorStops&&!n.fillRadialGradientColorStops&&!n.fillPatternImage&&(n.fill=n.fill||"black"),n}var Oc,B2,f1,Xo,X2,m1,g1,p1,U2,V2,W2,Q2,v1,y1,q2,Ld,K2,b1,k2,F2,S1,Af,C1,P2,Uo,wf,De,$2=Et((()=>{ha(),re(),Va(),Ce(),ge(),Oc="auto",B2="center",f1="inherit",Xo="justify",X2="Change.konva",m1="2d",g1="-",p1="left",U2="text",V2="Text",W2="top",Q2="bottom",v1="middle",y1="normal",q2="px ",Ld=" ",K2="right",b1="rtl",k2="word",F2="char",S1="none",Af="…",C1=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],P2=C1.length,Uo=null,De=class extends ht{constructor(n){super(P4(n)),this._partialTextX=0,this._partialTextY=0;for(let s=0;sCt+yu(Nt.text).length,0);N({char:nt,index:lt+et,x:at,y:ot+mt,lineIndex:F,column:lt,isLastInLine:jt,width:this.measureSize(nt).width,context:n})}n.fillStrokeShape(this),N&&n.restore(),at+=this.measureSize(nt).width+w}}else w!==0&&n.setAttr("letterSpacing",`${w}px`),this._partialTextX=at,this._partialTextY=ot+mt,this._partialText=zt,n.fillStrokeShape(this);if(U){n.save(),n.beginPath();const Mt=vt.legacyTextRendering?0:-Math.round(p/4),Lt=Ht;n.moveTo(Lt,ot+mt+Mt);const lt=_===Xo&&!jt?M-m*2:Gt;n.lineTo(Lt+Math.round(lt),ot+mt+Mt),n.lineWidth=p/15,n.strokeStyle=this._getLinearGradient()||J,n.stroke(),n.restore()}n.restore(),d>1&&(ot+=y)}}_hitFunc(n){const s=this.getWidth(),u=this.getHeight();n.beginPath(),n.rect(0,0,s,u),n.closePath(),n.fillStrokeShape(this)}setText(n){const s=Z._isString(n)?n:n==null?"":n+"";return this._setAttr(U2,s),this}getWidth(){return this.attrs.width===Oc||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Oc||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return Z.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(n){var s,u,r,d,m,p,y,S,x,L,_;let M=h1(),w=this.fontSize(),N;M.save(),M.font=this._getContextFont(),N=M.measureText(n),M.restore();const J=w/100;return{actualBoundingBoxAscent:(s=N.actualBoundingBoxAscent)!==null&&s!==void 0?s:71.58203125*J,actualBoundingBoxDescent:(u=N.actualBoundingBoxDescent)!==null&&u!==void 0?u:0,actualBoundingBoxLeft:(r=N.actualBoundingBoxLeft)!==null&&r!==void 0?r:-7.421875*J,actualBoundingBoxRight:(d=N.actualBoundingBoxRight)!==null&&d!==void 0?d:75.732421875*J,alphabeticBaseline:(m=N.alphabeticBaseline)!==null&&m!==void 0?m:0,emHeightAscent:(p=N.emHeightAscent)!==null&&p!==void 0?p:100*J,emHeightDescent:(y=N.emHeightDescent)!==null&&y!==void 0?y:-20*J,fontBoundingBoxAscent:(S=N.fontBoundingBoxAscent)!==null&&S!==void 0?S:91*J,fontBoundingBoxDescent:(x=N.fontBoundingBoxDescent)!==null&&x!==void 0?x:21*J,hangingBaseline:(L=N.hangingBaseline)!==null&&L!==void 0?L:72.80000305175781*J,ideographicBaseline:(_=N.ideographicBaseline)!==null&&_!==void 0?_:-21*J,width:N.width,height:w}}_getContextFont(){return this.fontStyle()+Ld+this.fontVariant()+Ld+(this.fontSize()+q2)+K4(this.fontFamily())}_addTextLine(n){this.align()===Xo&&(n=n.trim());const s=this._getTextWidth(n);return this.textArr.push({text:n,width:s,lastInParagraph:!1})}_getTextWidth(n){const s=this.letterSpacing(),u=n.length;return h1().measureText(n).width+s*u}_setTextData(){let n=this.text().split(`
`),s=+this.fontSize(),u=0,r=this.lineHeight()*s,d=this.attrs.width,m=this.attrs.height,p=d!==Oc&&d!==void 0,y=m!==Oc&&m!==void 0,S=this.padding(),x=d-S*2,L=m-S*2,_=0,M=this.wrap(),w=M!==F2&&M!==S1,N=this.ellipsis();this.textArr=[],h1().font=this._getContextFont();const J=N?this._getTextWidth(Af):0;for(let q=0,G=n.length;qx)for(;V.length>0;){let F=0,ot=yu(V).length,ut="",at=0;for(;F>>1,Rt=yu(V).slice(0,mt+1).join(""),zt=this._getTextWidth(Rt);(N&&y&&_+r>L?zt+J:zt)<=x?(F=mt+1,ut=Rt,at=zt):ot=mt}if(ut){if(w){const mt=yu(V),Rt=yu(ut),zt=mt[Rt.length],Gt=zt===Ld||zt===g1;let jt;if(Gt&&at<=x)jt=Rt.length;else{const Ht=Rt.lastIndexOf(Ld),Mt=Rt.lastIndexOf(g1);jt=Math.max(Ht,Mt)+1}jt>0&&(F=jt,ut=mt.slice(0,F).join(""),at=this._getTextWidth(ut))}if(ut=ut.trimRight(),this._addTextLine(ut),u=Math.max(u,at),_+=r,this._shouldHandleEllipsis(_)){this._tryToAddEllipsisToLastLine();break}if(V=yu(V).slice(F).join("").trimLeft(),V.length>0&&(U=this._getTextWidth(V),U<=x)){this._addTextLine(V),_+=r,u=Math.max(u,U);break}}else break}else this._addTextLine(V),_+=r,u=Math.max(u,U),this._shouldHandleEllipsis(_)&&qL)break}this.textHeight=s,this.textWidth=u}_shouldHandleEllipsis(n){const s=+this.fontSize(),u=this.lineHeight()*s,r=this.attrs.height,d=r!==Oc&&r!==void 0,m=r-this.padding()*2;return this.wrap()===S1||d&&n+u>m}_tryToAddEllipsisToLastLine(){const n=this.attrs.width,s=n!==Oc&&n!==void 0,u=n-this.padding()*2,r=this.ellipsis(),d=this.textArr[this.textArr.length-1];!d||!r||(s&&(this._getTextWidth(d.text+Af){ha(),re(),Va(),o1(),$2(),ge(),Ce(),ap="",L1="normal",Ca=class extends ht{constructor(n){super(n),this.dummyCanvas=Z.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva directionChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return en.getPathLength(this.dataArray)}_getPointAtLength(n){return!this.attrs.data||n>this.pathLength?null:en.getPointAtLengthOfDataArray(n,this.dataArray)}_readDataAttribute(){this.dataArray=en.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(n){n.setAttr("font",this._getContextFont()),n.setAttr("textBaseline",this.textBaseline()),n.setAttr("textAlign","left"),n.save();const s=this.textDecoration(),u=this.fill(),r=this.fontSize(),d=this.glyphInfo,m=s.indexOf("underline")!==-1,p=s.indexOf("line-through")!==-1;m&&n.beginPath();for(let y=0;y=1){const u=s[0].p0;n.moveTo(u.x,u.y)}for(let u=0;uthis.pathLength&&q-this.pathLength<=S?this.pathLength:q);if(!G)return;const V=en.getLineLength(w.x,w.y,G.x,G.y);let U=0;if(y)try{U=y(s[M-1].char,N)*this.fontSize()}catch{U=0}w.x+=U,G.x+=U,this.textWidth+=U;const F=en.getPointOnLine(U+V/2,w.x,w.y,G.x,G.y),ot=Math.atan2(G.y-w.y,G.x-w.x);this.glyphInfo.push({transposeX:F.x,transposeY:F.y,text:n[M],rotation:ot,p0:w,p1:G,width:V}),_+=J}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const n=[];this.glyphInfo.forEach(function(S){n.push(S.p0.x),n.push(S.p0.y),n.push(S.p1.x),n.push(S.p1.y)});let s=n[0]||0,u=n[0]||0,r=n[1]||0,d=n[1]||0,m,p;for(let S=0;S{ha(),re(),Sa(),Va(),J2(),t1(),Ce(),ge(),x1="tr-konva",np=["resizeEnabledChange","rotateAnchorOffsetChange","rotateAnchorAngleChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(n=>n+`.${x1}`).join(" "),_1="nodesRect",lp=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],sp={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},up="ontouchstart"in vt._global,xd=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],E1=1e8,Of=0,de=class extends Tc{constructor(n){super(n),this._movingAnchorName=null,this._transforming=!1,this._elementsCreated=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(np,this.update),this.getNode()&&this.update()}attachTo(n){return this.setNode(n),this}setNode(n){return Z.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([n])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return x1+this._id}setNodes(n=[]){this._nodes&&this._nodes.length&&this.detach();const s=n.filter(u=>u.isAncestorOf(this)?(Z.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=n=s,n.length===1&&this.useSingleNodeRotation()?this.rotation(n[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(u=>{const r=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(u._attrsAffectingSize.length){const d=u._attrsAffectingSize.map(m=>m+"Change."+this._getEventNamespace()).join(" ");u.on(d,r)}u.on(lp.map(d=>d+`.${this._getEventNamespace()}`).join(" "),r),u.on(`absoluteTransformChange.${this._getEventNamespace()}`,r),this._proxyDrag(u)}),this._resetTransformCache(),this.findOne(".top-left")&&this.update(),this}_proxyDrag(n){let s;n.on(`dragstart.${this._getEventNamespace()}`,u=>{s=n.getAbsolutePosition(),!this.isDragging()&&n!==this.findOne(".back")&&this.startDrag(u,!1)}),n.on(`dragmove.${this._getEventNamespace()}`,u=>{if(!s)return;const r=n.getAbsolutePosition(),d=r.x-s.x,m=r.y-s.y;this.nodes().forEach(p=>{if(p===n||p.isDragging())return;const y=p.getAbsolutePosition();p.setAbsolutePosition({x:y.x+d,y:y.y+m}),p.startDrag(u)}),s=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(n=>{n.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(_1),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(_1,this.__getNodeRect)}__getNodeShape(n,s=this.rotation(),u){const r=n.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),d=n.getAbsoluteScale(u),m=n.getAbsolutePosition(u),p=r.x*d.x-n.offsetX()*d.x,y=r.y*d.y-n.offsetY()*d.y,S=(vt.getAngle(n.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2);return ip({x:m.x+p*Math.cos(S)+y*Math.sin(-S),y:m.y+y*Math.cos(S)+p*Math.sin(S),width:r.width*d.x,height:r.height*d.y,rotation:S},-vt.getAngle(s),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-E1,y:-E1,width:0,height:0,rotation:0};const n=[];this.nodes().map(y=>{const S=y.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),x=[{x:S.x,y:S.y},{x:S.x+S.width,y:S.y},{x:S.x+S.width,y:S.y+S.height},{x:S.x,y:S.y+S.height}],L=y.getAbsoluteTransform();x.forEach(function(_){const M=L.point(_);n.push(M)})});const s=new xn;s.rotate(-vt.getAngle(this.rotation()));let u=1/0,r=1/0,d=-1/0,m=-1/0;n.forEach(function(y){const S=s.point(y);u===void 0&&(u=d=S.x,r=m=S.y),u=Math.min(u,S.x),r=Math.min(r,S.y),d=Math.max(d,S.x),m=Math.max(m,S.y)}),s.invert();const p=s.point({x:u,y:r});return{x:p.x,y:p.y,width:d-u,height:m-r,rotation:vt.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(),xd.forEach(n=>{this._createAnchor(n)}),this._createAnchor("rotater"),this._elementsCreated=!0}_createAnchor(n){const s=new Bo({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:n+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:up?10:"auto"}),u=this;s.on("mousedown touchstart",function(r){u._handleMouseDown(r)}),s.on("dragstart",r=>{s.stopDrag(),r.cancelBubble=!0}),s.on("dragend",r=>{r.cancelBubble=!0}),s.on("mouseenter",()=>{const r=ty(n,vt.getAngle(this.rotation()),this.rotateAnchorCursor());s.getStage().content&&(s.getStage().content.style.cursor=r),this._cursorChange=!0}),s.on("mouseout",()=>{s.getStage().content&&(s.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(s)}_createBack(){const n=new ht({name:"back",width:0,height:0,sceneFunc(s,u){const r=u.getParent(),d=r.padding(),m=u.width(),p=u.height();if(s.beginPath(),s.rect(-d,-d,m+d*2,p+d*2),r.rotateEnabled()&&r.rotateLineVisible()){const y=r.rotateAnchorAngle(),S=r.rotateAnchorOffset(),x=Z.degToRad(y),L=Math.sin(x),_=-Math.cos(x),M=m/2,w=p/2;let N=1/0;_<0?N=Math.min(N,-w/_):_>0&&(N=Math.min(N,(p-w)/_)),L<0?N=Math.min(N,-M/L):L>0&&(N=Math.min(N,(m-M)/L));const J=M+L*N,q=w+_*N,G=Z._sign(p),V=J+L*S*G,U=q+_*S*G;s.moveTo(J,q),s.lineTo(V,U)}s.fillStrokeShape(u)},hitFunc:(s,u)=>{if(!this.shouldOverdrawWholeArea())return;const r=this.padding();s.beginPath(),s.rect(-r,-r,u.width()+r*2,u.height()+r*2),s.fillStrokeShape(u)}});this.add(n),this._proxyDrag(n),n.on("dragstart",s=>{s.cancelBubble=!0}),n.on("dragmove",s=>{s.cancelBubble=!0}),n.on("dragend",s=>{s.cancelBubble=!0}),this.on("dragmove",s=>{this.update()})}_handleMouseDown(n){if(this._transforming)return;this._movingAnchorName=n.target.name().split(" ")[0];const s=this._getNodeRect(),u=s.width,r=s.height,d=Math.sqrt(Math.pow(u,2)+Math.pow(r,2));this.sin=Math.abs(r/d),this.cos=Math.abs(u/d),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const m=n.target.getAbsolutePosition(),p=n.target.getStage().getPointerPosition();this._anchorDragOffset={x:p.x-m.x,y:p.y-m.y},Of++,this._fire("transformstart",{evt:n.evt,target:this.getNode()}),this._nodes.forEach(y=>{y._fire("transformstart",{evt:n.evt,target:y})})}_handleMouseMove(n){let s,u,r;const d=this.findOne("."+this._movingAnchorName),m=d.getStage();m.setPointersPositions(n);const p=m.getPointerPosition();let y={x:p.x-this._anchorDragOffset.x,y:p.y-this._anchorDragOffset.y};const S=d.getAbsolutePosition();this.anchorDragBoundFunc()&&(y=this.anchorDragBoundFunc()(S,y,n)),d.setAbsolutePosition(y);const x=d.getAbsolutePosition();if(S.x===x.x&&S.y===x.y)return;if(this._movingAnchorName==="rotater"){const G=this._getNodeRect();s=d.x()-G.width/2,u=-d.y()+G.height/2;const V=vt.getAngle(this.rotateAnchorAngle());let U=Math.atan2(-u,s)+Math.PI/2-V;G.height<0&&(U-=Math.PI);const F=vt.getAngle(this.rotation())+U,ot=vt.getAngle(this.rotationSnapTolerance()),ut=ay(G,iy(this.rotationSnaps(),F,ot)-G.rotation);this._fitNodesInto(ut,n);return}const L=this.shiftBehavior();let _;L==="inverted"?_=this.keepRatio()&&!n.shiftKey:L==="none"?_=this.keepRatio():_=this.keepRatio()||n.shiftKey;let M=this.centeredScaling()||n.altKey;if(this._movingAnchorName==="top-left"){if(_){const G=M?{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(G.x-d.x(),2)+Math.pow(G.y-d.y(),2));const V=this.findOne(".top-left").x()>G.x?-1:1,U=this.findOne(".top-left").y()>G.y?-1:1;s=r*this.cos*V,u=r*this.sin*U,this.findOne(".top-left").x(G.x-s),this.findOne(".top-left").y(G.y-u)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(d.y());else if(this._movingAnchorName==="top-right"){if(_){const G=M?{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(d.x()-G.x,2)+Math.pow(G.y-d.y(),2));const V=this.findOne(".top-right").x()G.y?-1:1;s=r*this.cos*V,u=r*this.sin*U,this.findOne(".top-right").x(G.x+s),this.findOne(".top-right").y(G.y-u)}var w=d.position();this.findOne(".top-left").y(w.y),this.findOne(".bottom-right").x(w.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(d.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(d.x());else if(this._movingAnchorName==="bottom-left"){if(_){const G=M?{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(G.x-d.x(),2)+Math.pow(d.y()-G.y,2));const V=G.x{var d;r._fire("transformend",{evt:n,target:r}),(d=r.getLayer())===null||d===void 0||d.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(n,s){const u=this._getNodeRect(),r=1;if(Z._inRange(n.width,-this.padding()*2-r,r)){this.update();return}if(Z._inRange(n.height,-this.padding()*2-r,r)){this.update();return}const d=new xn;if(d.rotate(vt.getAngle(this.rotation())),this._movingAnchorName&&n.width<0&&this._movingAnchorName.indexOf("left")>=0){const _=d.point({x:-this.padding()*2,y:0});n.x+=_.x,n.y+=_.y,n.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y}else if(this._movingAnchorName&&n.width<0&&this._movingAnchorName.indexOf("right")>=0){const _=d.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,n.width+=this.padding()*2}if(this._movingAnchorName&&n.height<0&&this._movingAnchorName.indexOf("top")>=0){const _=d.point({x:0,y:-this.padding()*2});n.x+=_.x,n.y+=_.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,n.height+=this.padding()*2}else if(this._movingAnchorName&&n.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const _=d.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,n.height+=this.padding()*2}if(this.boundBoxFunc()){const _=this.boundBoxFunc()(u,n);_?n=_:Z.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const m=1e7,p=new xn;p.translate(u.x,u.y),p.rotate(u.rotation),p.scale(u.width/m,u.height/m);const y=new xn,S=n.width/m,x=n.height/m;this.flipEnabled()===!1?(y.translate(n.x,n.y),y.rotate(n.rotation),y.translate(n.width<0?n.width:0,n.height<0?n.height:0),y.scale(Math.abs(S),Math.abs(x))):(y.translate(n.x,n.y),y.rotate(n.rotation),y.scale(S,x));const L=y.multiply(p.invert());this._nodes.forEach(_=>{var M;if(!_.getStage())return;const w=_.getParent().getAbsoluteTransform(),N=_.getTransform().copy();N.translate(_.offsetX(),_.offsetY());const J=new xn;J.multiply(w.copy().invert()).multiply(L).multiply(w).multiply(N);const q=J.decompose();_.setAttrs(q),(M=_.getLayer())===null||M===void 0||M.batchDraw()}),this.rotation(Z._getRotation(n.rotation)),this._nodes.forEach(_=>{this._fire("transform",{evt:s,target:_}),_._fire("transform",{evt:s,target:_})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(n,s){this.findOne(n).setAttrs(s)}update(){var n;const s=this._getNodeRect();this.rotation(Z._getRotation(s.rotation));const u=s.width,r=s.height,d=this.enabledAnchors(),m=this.resizeEnabled(),p=this.padding(),y=this.anchorSize(),S=this.find("._anchor");S.forEach(ot=>{ot.setAttrs({width:y,height:y,offsetX:y/2,offsetY:y/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:y/2+p,offsetY:y/2+p,visible:m&&d.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:u/2,y:0,offsetY:y/2+p,visible:m&&d.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:u,y:0,offsetX:y/2-p,offsetY:y/2+p,visible:m&&d.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:y/2+p,visible:m&&d.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:u,y:r/2,offsetX:y/2-p,visible:m&&d.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:y/2+p,offsetY:y/2-p,visible:m&&d.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:u/2,y:r,offsetY:y/2-p,visible:m&&d.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:u,y:r,offsetX:y/2-p,offsetY:y/2-p,visible:m&&d.indexOf("bottom-right")>=0});const x=this.rotateAnchorAngle(),L=this.rotateAnchorOffset(),_=Z.degToRad(x),M=Math.sin(_),w=-Math.cos(_),N=u/2,J=r/2;let q=1/0;w<0?q=Math.min(q,-J/w):w>0&&(q=Math.min(q,(r-J)/w)),M<0?q=Math.min(q,-N/M):M>0&&(q=Math.min(q,(u-N)/M));const G=N+M*q,V=J+w*q,U=Z._sign(r);this._batchChangeChild(".rotater",{x:G+M*L*U,y:V+w*L*U-p*w,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:u,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(ot=>ot.draggable()),x:0,y:0});const F=this.anchorStyleFunc();F&&S.forEach(ot=>{F(ot)}),(n=this.getLayer())===null||n===void 0||n.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const n=this.findOne("."+this._movingAnchorName);n&&n.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Tc.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...n){return this._elementsCreated?(Z.error("You cannot add external nodes to the Transformer. Use tr.nodes([node]) instead."),this):super.add(...n)}toObject(){return bt.prototype.toObject.call(this)}clone(n){return bt.prototype.clone.call(this,n)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}},de.isTransforming=()=>Of>0,de.prototype.className="Transformer",$e(de),A.addGetterSetter(de,"enabledAnchors",xd,ny),A.addGetterSetter(de,"flipEnabled",!0,$n()),A.addGetterSetter(de,"resizeEnabled",!0),A.addGetterSetter(de,"anchorSize",10,gt()),A.addGetterSetter(de,"rotateEnabled",!0),A.addGetterSetter(de,"rotateLineVisible",!0),A.addGetterSetter(de,"rotationSnaps",[]),A.addGetterSetter(de,"rotateAnchorOffset",50,gt()),A.addGetterSetter(de,"rotateAnchorAngle",0,gt()),A.addGetterSetter(de,"rotateAnchorCursor","crosshair"),A.addGetterSetter(de,"rotationSnapTolerance",5,gt()),A.addGetterSetter(de,"borderEnabled",!0),A.addGetterSetter(de,"anchorStroke","rgb(0, 161, 255)"),A.addGetterSetter(de,"anchorStrokeWidth",1,gt()),A.addGetterSetter(de,"anchorFill","white"),A.addGetterSetter(de,"anchorCornerRadius",0,gt()),A.addGetterSetter(de,"borderStroke","rgb(0, 161, 255)"),A.addGetterSetter(de,"borderStrokeWidth",1,gt()),A.addGetterSetter(de,"borderDash"),A.addGetterSetter(de,"keepRatio",!0),A.addGetterSetter(de,"shiftBehavior","default"),A.addGetterSetter(de,"centeredScaling",!1),A.addGetterSetter(de,"ignoreStroke",!1),A.addGetterSetter(de,"padding",0,gt()),A.addGetterSetter(de,"nodes"),A.addGetterSetter(de,"node"),A.addGetterSetter(de,"boundBoxFunc"),A.addGetterSetter(de,"anchorDragBoundFunc"),A.addGetterSetter(de,"anchorStyleFunc"),A.addGetterSetter(de,"shouldOverdrawWholeArea",!1),A.addGetterSetter(de,"useSingleNodeRotation",!0),A.backCompat(de,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"})})),Hl,sy=Et((()=>{re(),Va(),Ce(),ge(),Hl=class extends ht{_sceneFunc(n){n.beginPath(),n.arc(0,0,this.radius(),0,vt.getAngle(this.angle()),this.clockwise()),n.lineTo(0,0),n.closePath(),n.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(n){this.radius(n/2)}setHeight(n){this.radius(n/2)}},Hl.prototype.className="Wedge",Hl.prototype._centroid=!0,Hl.prototype._attrsAffectingSize=["radius"],$e(Hl),A.addGetterSetter(Hl,"radius",0,gt()),A.addGetterSetter(Hl,"angle",0,gt()),A.addGetterSetter(Hl,"clockwise",!1),A.backCompat(Hl,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"})}));function cp(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}function uy(n,s){const u=n.data,r=n.width,d=n.height;let m,p,y,S,x,L,_,M,w,N,J,q,G,V,U,F,ot,ut,at,mt;const Rt=s+s+1,zt=r-1,Gt=d-1,jt=s+1,Ht=jt*(jt+1)/2,Mt=new cp,Lt=op[s],lt=rp[s];let nt=null,et=Mt,Ct=null,Nt=null;for(let te=1;te