From f8937e4319d2cdd80bf17089e3c61dab7cd7ec08 Mon Sep 17 00:00:00 2001 From: leon-kfd Date: Tue, 24 Oct 2023 02:20:28 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20ccf7f?= =?UTF-8?q?c8e52a22666cfb9d75e4b9bb00688cfe443=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/{index-2fc7e446.js => index-7afb1527.js} | 12 ++++++------ index.html | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) rename assets/{index-2fc7e446.js => index-7afb1527.js} (61%) diff --git a/assets/index-2fc7e446.js b/assets/index-7afb1527.js similarity index 61% rename from assets/index-2fc7e446.js rename to assets/index-7afb1527.js index 268bd9d..ea9f564 100644 --- a/assets/index-2fc7e446.js +++ b/assets/index-7afb1527.js @@ -23,7 +23,7 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){var t,n,r,i;if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}if(typeof window>"u"||typeof MessageChannel!="function"){var l=null,u=null,f=function(){if(l!==null)try{var I=e.unstable_now();l(!0,I),l=null}catch(Y){throw setTimeout(f,0),Y}};t=function(I){l!==null?setTimeout(t,0,I):(l=I,setTimeout(f,0))},n=function(I,Y){u=setTimeout(I,Y)},r=function(){clearTimeout(u)},e.unstable_shouldYield=function(){return!1},i=e.unstable_forceFrameRate=function(){}}else{var c=window.setTimeout,h=window.clearTimeout;if(typeof console<"u"){var p=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof p!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var v=!1,y=null,d=-1,m=5,g=0;e.unstable_shouldYield=function(){return e.unstable_now()>=g},i=function(){},e.unstable_forceFrameRate=function(I){0>I||125>>1,ue=I[ie];if(ue!==void 0&&0S(mt,j))Rt!==void 0&&0>S(Rt,mt)?(I[ie]=Rt,I[Bt]=j,ie=Bt):(I[ie]=mt,I[Re]=j,ie=Re);else if(Rt!==void 0&&0>S(Rt,j))I[ie]=Rt,I[Bt]=j,ie=Bt;else break e}}return Y}return null}function S(I,Y){var j=I.sortIndex-Y.sortIndex;return j!==0?j:I.id-Y.id}var T=[],C=[],k=1,N=null,_=3,A=!1,z=!1,W=!1;function L(I){for(var Y=x(C);Y!==null;){if(Y.callback===null)M(C);else if(Y.startTime<=I)M(C),Y.sortIndex=Y.expirationTime,w(T,Y);else break;Y=x(C)}}function H(I){if(W=!1,L(I),!z)if(x(T)!==null)z=!0,t($);else{var Y=x(C);Y!==null&&n(H,Y.startTime-I)}}function $(I,Y){z=!1,W&&(W=!1,r()),A=!0;var j=_;try{for(L(Y),N=x(T);N!==null&&(!(N.expirationTime>Y)||I&&!e.unstable_shouldYield());){var ie=N.callback;if(typeof ie=="function"){N.callback=null,_=N.priorityLevel;var ue=ie(N.expirationTime<=Y);Y=e.unstable_now(),typeof ue=="function"?N.callback=ue:N===x(T)&&M(T),L(Y)}else M(T);N=x(T)}if(N!==null)var Re=!0;else{var mt=x(C);mt!==null&&n(H,mt.startTime-Y),Re=!1}return Re}finally{N=null,_=j,A=!1}}var Te=i;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_continueExecution=function(){z||A||(z=!0,t($))},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return x(T)},e.unstable_next=function(I){switch(_){case 1:case 2:case 3:var Y=3;break;default:Y=_}var j=_;_=Y;try{return I()}finally{_=j}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=Te,e.unstable_runWithPriority=function(I,Y){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var j=_;_=I;try{return Y()}finally{_=j}},e.unstable_scheduleCallback=function(I,Y,j){var ie=e.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0ie?(I.sortIndex=j,w(C,I),x(T)===null&&I===x(C)&&(W?r():W=!0,n(H,j-ie))):(I.sortIndex=ue,w(T,I),z||A||(z=!0,t($))),I},e.unstable_wrapCallback=function(I){var Y=_;return function(){var j=_;_=Y;try{return I.apply(this,arguments)}finally{_=j}}}})(Wd);Vd.exports=Wd;var oy=Vd.exports;/** @license React v17.0.2 + */(function(e){var t,n,r,i;if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}if(typeof window>"u"||typeof MessageChannel!="function"){var l=null,u=null,f=function(){if(l!==null)try{var I=e.unstable_now();l(!0,I),l=null}catch(Y){throw setTimeout(f,0),Y}};t=function(I){l!==null?setTimeout(t,0,I):(l=I,setTimeout(f,0))},n=function(I,Y){u=setTimeout(I,Y)},r=function(){clearTimeout(u)},e.unstable_shouldYield=function(){return!1},i=e.unstable_forceFrameRate=function(){}}else{var c=window.setTimeout,h=window.clearTimeout;if(typeof console<"u"){var p=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof p!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var v=!1,m=null,d=-1,y=5,g=0;e.unstable_shouldYield=function(){return e.unstable_now()>=g},i=function(){},e.unstable_forceFrameRate=function(I){0>I||125>>1,ue=I[ie];if(ue!==void 0&&0S(mt,j))Rt!==void 0&&0>S(Rt,mt)?(I[ie]=Rt,I[Bt]=j,ie=Bt):(I[ie]=mt,I[Re]=j,ie=Re);else if(Rt!==void 0&&0>S(Rt,j))I[ie]=Rt,I[Bt]=j,ie=Bt;else break e}}return Y}return null}function S(I,Y){var j=I.sortIndex-Y.sortIndex;return j!==0?j:I.id-Y.id}var T=[],C=[],k=1,N=null,_=3,A=!1,z=!1,W=!1;function L(I){for(var Y=x(C);Y!==null;){if(Y.callback===null)M(C);else if(Y.startTime<=I)M(C),Y.sortIndex=Y.expirationTime,w(T,Y);else break;Y=x(C)}}function H(I){if(W=!1,L(I),!z)if(x(T)!==null)z=!0,t($);else{var Y=x(C);Y!==null&&n(H,Y.startTime-I)}}function $(I,Y){z=!1,W&&(W=!1,r()),A=!0;var j=_;try{for(L(Y),N=x(T);N!==null&&(!(N.expirationTime>Y)||I&&!e.unstable_shouldYield());){var ie=N.callback;if(typeof ie=="function"){N.callback=null,_=N.priorityLevel;var ue=ie(N.expirationTime<=Y);Y=e.unstable_now(),typeof ue=="function"?N.callback=ue:N===x(T)&&M(T),L(Y)}else M(T);N=x(T)}if(N!==null)var Re=!0;else{var mt=x(C);mt!==null&&n(H,mt.startTime-Y),Re=!1}return Re}finally{N=null,_=j,A=!1}}var Te=i;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_continueExecution=function(){z||A||(z=!0,t($))},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return x(T)},e.unstable_next=function(I){switch(_){case 1:case 2:case 3:var Y=3;break;default:Y=_}var j=_;_=Y;try{return I()}finally{_=j}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=Te,e.unstable_runWithPriority=function(I,Y){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var j=_;_=I;try{return Y()}finally{_=j}},e.unstable_scheduleCallback=function(I,Y,j){var ie=e.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0ie?(I.sortIndex=j,w(C,I),x(T)===null&&I===x(C)&&(W?r():W=!0,n(H,j-ie))):(I.sortIndex=ue,w(T,I),z||A||(z=!0,t($))),I},e.unstable_wrapCallback=function(I){var Y=_;return function(){var j=_;_=Y;try{return I.apply(this,arguments)}finally{_=j}}}})(Wd);Vd.exports=Wd;var oy=Vd.exports;/** @license React v17.0.2 * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -34,11 +34,11 @@ object-assign `+Fs+e}var Bs=!1;function Fa(e,t){if(!e||Bs)return"";Bs=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}catch(l){if(l&&r&&typeof l.stack=="string"){for(var i=l.stack.split(` `),a=r.stack.split(` `),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s])return` -`+i[o].replace(" at new "," at ");while(1<=o&&0<=s);break}}}finally{Bs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?_i(e):""}function cy(e){switch(e.tag){case 5:return _i(e.type);case 16:return _i("Lazy");case 13:return _i("Suspense");case 19:return _i("SuspenseList");case 0:case 2:case 15:return e=Fa(e.type,!1),e;case 11:return e=Fa(e.type.render,!1),e;case 22:return e=Fa(e.type._render,!1),e;case 1:return e=Fa(e.type,!0),e;default:return""}}function zr(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case yn:return"Fragment";case Jn:return"Portal";case zi:return"Profiler";case Ku:return"StrictMode";case Ui:return"Suspense";case Ao:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Qu:return(e.displayName||"Context")+".Consumer";case qu:return(e._context.displayName||"Context")+".Provider";case ps:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case vs:return zr(e.type);case Ju:return zr(e._render);case Zu:t=e._payload,e=e._init;try{return zr(e(t))}catch{}}return null}function Ln(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function $d(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hy(e){var t=$d(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ba(e){e._valueTracker||(e._valueTracker=hy(e))}function jd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$d(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Lo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function kl(e,t){var n=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function hc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ln(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Kd(e,t){t=t.checked,t!=null&&ju(e,"checked",t,!1)}function Nl(e,t){Kd(e,t);var n=Ln(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ol(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ol(e,t.type,Ln(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function dc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ol(e,t,n){(t!=="number"||Lo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function dy(e){var t="";return ds.Children.forEach(e,function(n){n!=null&&(t+=n)}),t}function Rl(e,t){return e=Ee({children:void 0},t),(t=dy(t.children))&&(e.children=t),e}function Ur(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i=n.length))throw Error(b(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ln(n)}}function qd(e,t){var n=Ln(t.value),r=Ln(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function vc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}var Al={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Qd(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ll(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Qd(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var za,Zd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==Al.svg||"innerHTML"in e)e.innerHTML=t;else{for(za=za||document.createElement("div"),za.innerHTML=""+t.valueOf().toString()+"",t=za.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ta(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gi={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},py=["Webkit","ms","Moz","O"];Object.keys(Gi).forEach(function(e){py.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Gi[t]=Gi[e]})});function Jd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Gi.hasOwnProperty(e)&&Gi[e]?(""+t).trim():t+"px"}function ep(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Jd(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var vy=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Il(e,t){if(t){if(vy[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(b(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(b(60));if(!(typeof t.dangerouslySetInnerHTML=="object"&&"__html"in t.dangerouslySetInnerHTML))throw Error(b(61))}if(t.style!=null&&typeof t.style!="object")throw Error(b(62))}}function Dl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function nf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bl=null,Gr=null,Hr=null;function yc(e){if(e=Ta(e)){if(typeof bl!="function")throw Error(b(280));var t=e.stateNode;t&&(t=ws(t),bl(e.stateNode,e.type,t))}}function tp(e){Gr?Hr?Hr.push(e):Hr=[e]:Gr=e}function np(){if(Gr){var e=Gr,t=Hr;if(Hr=Gr=null,yc(e),t)for(e=0;er?0:1<n;n++)t.push(e);return t}function ms(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,e=e.eventTimes,t=31-In(t),e[t]=n}var In=Math.clz32?Math.clz32:_y,Oy=Math.log,Ry=Math.LN2;function _y(e){return e===0?32:31-(Oy(e)/Ry|0)|0}var Ay=be.unstable_UserBlockingPriority,Ly=be.unstable_runWithPriority,xo=!0;function Iy(e,t,n,r){er||af();var i=ff,a=er;er=!0;try{rp(i,e,t,n,r)}finally{(er=a)||of()}}function Dy(e,t,n,r){Ly(Ay,ff.bind(null,e,t,n,r))}function ff(e,t,n,r){if(xo){var i;if((i=(t&4)===0)&&0=Vi),Cc=String.fromCharCode(32),kc=!1;function Ep(e,t){switch(e){case"keyup":return im.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ar=!1;function om(e,t){switch(e){case"compositionend":return wp(t);case"keypress":return t.which!==32?null:(kc=!0,Cc);case"textInput":return e=t.data,e===Cc&&kc?null:e;default:return null}}function sm(e,t){if(Ar)return e==="compositionend"||!vf&&Ep(e,t)?(e=gp(),Eo=hf=gn=null,Ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_c(n)}}function Tp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lc(){for(var e=window,t=Lo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lo(e.document)}return t}function Gl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var mm=fn&&"documentMode"in document&&11>=document.documentMode,Lr=null,Hl=null,Yi=null,Vl=!1;function Ic(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vl||Lr==null||Lr!==Lo(r)||(r=Lr,"selectionStart"in r&&Gl(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Yi&&sa(Yi,r)||(Yi=r,r=Fo(Hl,"onSelect"),0Dr||(e.current=Yl[Dr],Yl[Dr]=null,Dr--)}function Se(e,t){Dr++,Yl[Dr]=e.current,e.current=t}var Dn={},Xe=Un(Dn),at=Un(!1),sr=Dn;function ti(e,t){var n=e.type.contextTypes;if(!n)return Dn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ot(e){return e=e.childContextTypes,e!=null}function Uo(){me(at),me(Xe)}function Vc(e,t,n){if(Xe.current!==Dn)throw Error(b(168));Se(Xe,t),Se(at,n)}function Lp(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(b(108,zr(t)||"Unknown",i));return Ee({},n,r)}function Po(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Dn,sr=Xe.current,Se(Xe,e),Se(at,at.current),!0}function Wc(e,t,n){var r=e.stateNode;if(!r)throw Error(b(169));n?(e=Lp(e,t,sr),r.__reactInternalMemoizedMergedChildContext=e,me(at),me(Xe),Se(Xe,e)):me(at),Se(at,n)}var mf=null,ar=null,Em=be.unstable_runWithPriority,gf=be.unstable_scheduleCallback,Xl=be.unstable_cancelCallback,wm=be.unstable_shouldYield,Yc=be.unstable_requestPaint,$l=be.unstable_now,Pm=be.unstable_getCurrentPriorityLevel,Ps=be.unstable_ImmediatePriority,Ip=be.unstable_UserBlockingPriority,Dp=be.unstable_NormalPriority,bp=be.unstable_LowPriority,Fp=be.unstable_IdlePriority,Qs={},Mm=Yc!==void 0?Yc:function(){},tn=null,Mo=null,Zs=!1,Xc=$l(),Ve=1e4>Xc?$l:function(){return $l()-Xc};function ni(){switch(Pm()){case Ps:return 99;case Ip:return 98;case Dp:return 97;case bp:return 96;case Fp:return 95;default:throw Error(b(332))}}function Bp(e){switch(e){case 99:return Ps;case 98:return Ip;case 97:return Dp;case 96:return bp;case 95:return Fp;default:throw Error(b(332))}}function lr(e,t){return e=Bp(e),Em(e,t)}function ua(e,t,n){return e=Bp(e),gf(e,t,n)}function Qt(){if(Mo!==null){var e=Mo;Mo=null,Xl(e)}zp()}function zp(){if(!Zs&&tn!==null){Zs=!0;var e=0;try{var t=tn;lr(99,function(){for(;eM?(S=x,x=null):S=x.sibling;var T=h(d,x,g[M],E);if(T===null){x===null&&(x=S);break}e&&x&&T.alternate===null&&t(d,x),m=a(T,m,M),w===null?P=T:w.sibling=T,w=T,x=S}if(M===g.length)return n(d,x),P;if(x===null){for(;MM?(S=x,x=null):S=x.sibling;var C=h(d,x,T.value,E);if(C===null){x===null&&(x=S);break}e&&x&&C.alternate===null&&t(d,x),m=a(C,m,M),w===null?P=C:w.sibling=C,w=C,x=S}if(T.done)return n(d,x),P;if(x===null){for(;!T.done;M++,T=g.next())T=c(d,T.value,E),T!==null&&(m=a(T,m,M),w===null?P=T:w.sibling=T,w=T);return P}for(x=r(d,x);!T.done;M++,T=g.next())T=p(x,d,M,T.value,E),T!==null&&(e&&T.alternate!==null&&x.delete(T.key===null?M:T.key),m=a(T,m,M),w===null?P=T:w.sibling=T,w=T);return e&&x.forEach(function(k){return t(d,k)}),P}return function(d,m,g,E){var P=typeof g=="object"&&g!==null&&g.type===yn&&g.key===null;P&&(g=g.props.children);var w=typeof g=="object"&&g!==null;if(w)switch(g.$$typeof){case Ri:e:{for(w=g.key,P=m;P!==null;){if(P.key===w){switch(P.tag){case 7:if(g.type===yn){n(d,P.sibling),m=i(P,g.props.children),m.return=d,d=m;break e}break;default:if(P.elementType===g.type){n(d,P.sibling),m=i(P,g.props),m.ref=Ei(d,P,g),m.return=d,d=m;break e}}n(d,P);break}else t(d,P);P=P.sibling}g.type===yn?(m=jr(g.props.children,d.mode,E,g.key),m.return=d,d=m):(E=ko(g.type,g.key,g.props,null,d.mode,E),E.ref=Ei(d,m,g),E.return=d,d=E)}return o(d);case Jn:e:{for(P=g.key;m!==null;){if(m.key===P)if(m.tag===4&&m.stateNode.containerInfo===g.containerInfo&&m.stateNode.implementation===g.implementation){n(d,m.sibling),m=i(m,g.children||[]),m.return=d,d=m;break e}else{n(d,m);break}else t(d,m);m=m.sibling}m=il(g,d.mode,E),m.return=d,d=m}return o(d)}if(typeof g=="string"||typeof g=="number")return g=""+g,m!==null&&m.tag===6?(n(d,m.sibling),m=i(m,g),m.return=d,d=m):(n(d,m),m=rl(g,d.mode,E),m.return=d,d=m),o(d);if(Ha(g))return v(d,m,g,E);if(pi(g))return y(d,m,g,E);if(w&&Va(d,g),typeof g>"u"&&!P)switch(d.tag){case 1:case 22:case 0:case 11:case 15:throw Error(b(152,zr(d.type)||"Component"))}return n(d,m)}}var Yo=Wp(!0),Yp=Wp(!1),Ca={},$t=Un(Ca),ca=Un(Ca),ha=Un(Ca);function nr(e){if(e===Ca)throw Error(b(174));return e}function Kl(e,t){switch(Se(ha,t),Se(ca,e),Se($t,Ca),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ll(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ll(t,e)}me($t),Se($t,t)}function ri(){me($t),me(ca),me(ha)}function Qc(e){nr(ha.current);var t=nr($t.current),n=Ll(t,e.type);t!==n&&(Se(ca,e),Se($t,n))}function Pf(e){ca.current===e&&(me($t),me(ca))}var Me=Un(0);function Xo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&64)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var an=null,En=null,jt=!1;function Xp(e,t){var n=Mt(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,e.lastEffect!==null?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Zc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,!0):!1;case 13:return!1;default:return!1}}function ql(e){if(jt){var t=En;if(t){var n=t;if(!Zc(e,t)){if(t=Vr(n.nextSibling),!t||!Zc(e,t)){e.flags=e.flags&-1025|2,jt=!1,an=e;return}Xp(an,n)}an=e,En=Vr(t.firstChild)}else e.flags=e.flags&-1025|2,jt=!1,an=e}}function Jc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;an=e}function Wa(e){if(e!==an)return!1;if(!jt)return Jc(e),jt=!0,!1;var t=e.type;if(e.tag!==5||t!=="head"&&t!=="body"&&!Wl(t,e.memoizedProps))for(t=En;t;)Xp(e,t),t=Vr(t.nextSibling);if(Jc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(b(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){En=Vr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}En=null}}else En=an?Vr(e.stateNode.nextSibling):null;return!0}function Js(){En=an=null,jt=!1}var Yr=[];function Mf(){for(var e=0;ea))throw Error(b(301));a+=1,Be=Ge=null,t.updateQueue=null,Xi.current=Nm,e=n(r,i)}while($i)}if(Xi.current=Qo,t=Ge!==null&&Ge.next!==null,da=0,Be=Ge=ke=null,$o=!1,t)throw Error(b(300));return e}function rr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Be===null?ke.memoizedState=Be=e:Be=Be.next=e,Be}function gr(){if(Ge===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=Be===null?ke.memoizedState:Be.next;if(t!==null)Be=t,Ge=e;else{if(e===null)throw Error(b(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},Be===null?ke.memoizedState=Be=e:Be=Be.next=e}return Be}function Ht(e,t){return typeof t=="function"?t(e):t}function wi(e){var t=gr(),n=t.queue;if(n===null)throw Error(b(311));n.lastRenderedReducer=e;var r=Ge,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}r.baseQueue=i=a,n.pending=null}if(i!==null){i=i.next,r=r.baseState;var s=o=a=null,l=i;do{var u=l.lane;if((da&u)===u)s!==null&&(s=s.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),r=l.eagerReducer===e?l.eagerState:e(r,l.action);else{var f={lane:u,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};s===null?(o=s=f,a=r):s=s.next=f,ke.lanes|=u,ka|=u}l=l.next}while(l!==null&&l!==i);s===null?a=r:s.next=o,Pt(r,t.memoizedState)||(bt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Pi(e){var t=gr(),n=t.queue;if(n===null)throw Error(b(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);Pt(a,t.memoizedState)||(bt=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function eh(e,t,n){var r=t._getVersion;r=r(t._source);var i=t._workInProgressVersionPrimary;if(i!==null?e=i===r:(e=e.mutableReadLanes,(e=(da&e)===e)&&(t._workInProgressVersionPrimary=r,Yr.push(t))),e)return n(t._source);throw Yr.push(t),Error(b(350))}function $p(e,t,n,r){var i=Qe;if(i===null)throw Error(b(349));var a=t._getVersion,o=a(t._source),s=Xi.current,l=s.useState(function(){return eh(i,t,n)}),u=l[1],f=l[0];l=Be;var c=e.memoizedState,h=c.refs,p=h.getSnapshot,v=c.source;c=c.subscribe;var y=ke;return e.memoizedState={refs:h,source:t,subscribe:r},s.useEffect(function(){h.getSnapshot=n,h.setSnapshot=u;var d=a(t._source);if(!Pt(o,d)){d=n(t._source),Pt(f,d)||(u(d),d=Nn(y),i.mutableReadLanes|=d&i.pendingLanes),d=i.mutableReadLanes,i.entangledLanes|=d;for(var m=i.entanglements,g=d;0n?98:n,function(){e(!0)}),lr(97<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[xn]=t,e[zo]=r,nv(e,t,!1,!1),t.stateNode=e,o=Dl(n,r),n){case"dialog":ve("cancel",e),ve("close",e),i=r;break;case"iframe":case"object":case"embed":ve("load",e),i=r;break;case"video":case"audio":for(i=0;iou&&(t.flags|=64,a=!0,Si(r,!1),t.lanes=33554432)}else{if(!a)if(e=Xo(o),e!==null){if(t.flags|=64,a=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Si(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!jt)return t=t.lastEffect=r.lastEffect,t!==null&&(t.nextEffect=null),null}else 2*Ve()-r.renderingStartTime>ou&&n!==1073741824&&(t.flags|=64,a=!0,Si(r,!1),t.lanes=33554432);r.isBackwards?(o.sibling=t.child,t.child=o):(n=r.last,n!==null?n.sibling=o:t.child=o,r.last=o)}return r.tail!==null?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Ve(),n.sibling=null,t=Me.current,Se(Me,a?t&1|2:t&1),n):null;case 23:case 24:return Lf(),e!==null&&e.memoizedState!==null!=(t.memoizedState!==null)&&r.mode!=="unstable-defer-without-hiding"&&(t.flags|=4),null}throw Error(b(156,t.tag))}function _m(e){switch(e.tag){case 1:ot(e.type)&&Uo();var t=e.flags;return t&4096?(e.flags=t&-4097|64,e):null;case 3:if(ri(),me(at),me(Xe),Mf(),t=e.flags,t&64)throw Error(b(285));return e.flags=t&-4097|64,e;case 5:return Pf(e),null;case 13:return me(Me),t=e.flags,t&4096?(e.flags=t&-4097|64,e):null;case 19:return me(Me),null;case 4:return ri(),null;case 10:return Ef(e),null;case 23:case 24:return Lf(),null;default:return null}}function Of(e,t){try{var n="",r=t;do n+=cy(r),r=r.return;while(r);var i=n}catch(a){i=` +`+i[o].replace(" at new "," at ");while(1<=o&&0<=s);break}}}finally{Bs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?_i(e):""}function cy(e){switch(e.tag){case 5:return _i(e.type);case 16:return _i("Lazy");case 13:return _i("Suspense");case 19:return _i("SuspenseList");case 0:case 2:case 15:return e=Fa(e.type,!1),e;case 11:return e=Fa(e.type.render,!1),e;case 22:return e=Fa(e.type._render,!1),e;case 1:return e=Fa(e.type,!0),e;default:return""}}function zr(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case yn:return"Fragment";case Jn:return"Portal";case zi:return"Profiler";case Ku:return"StrictMode";case Ui:return"Suspense";case Ao:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Qu:return(e.displayName||"Context")+".Consumer";case qu:return(e._context.displayName||"Context")+".Provider";case ps:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case vs:return zr(e.type);case Ju:return zr(e._render);case Zu:t=e._payload,e=e._init;try{return zr(e(t))}catch{}}return null}function Ln(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function $d(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hy(e){var t=$d(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ba(e){e._valueTracker||(e._valueTracker=hy(e))}function jd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$d(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Lo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function kl(e,t){var n=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function hc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ln(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Kd(e,t){t=t.checked,t!=null&&ju(e,"checked",t,!1)}function Nl(e,t){Kd(e,t);var n=Ln(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ol(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ol(e,t.type,Ln(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function dc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ol(e,t,n){(t!=="number"||Lo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function dy(e){var t="";return ds.Children.forEach(e,function(n){n!=null&&(t+=n)}),t}function Rl(e,t){return e=Ee({children:void 0},t),(t=dy(t.children))&&(e.children=t),e}function Ur(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i=n.length))throw Error(b(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ln(n)}}function qd(e,t){var n=Ln(t.value),r=Ln(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function vc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}var Al={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Qd(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ll(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Qd(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var za,Zd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==Al.svg||"innerHTML"in e)e.innerHTML=t;else{for(za=za||document.createElement("div"),za.innerHTML=""+t.valueOf().toString()+"",t=za.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ta(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gi={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},py=["Webkit","ms","Moz","O"];Object.keys(Gi).forEach(function(e){py.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Gi[t]=Gi[e]})});function Jd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Gi.hasOwnProperty(e)&&Gi[e]?(""+t).trim():t+"px"}function ep(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Jd(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var vy=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Il(e,t){if(t){if(vy[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(b(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(b(60));if(!(typeof t.dangerouslySetInnerHTML=="object"&&"__html"in t.dangerouslySetInnerHTML))throw Error(b(61))}if(t.style!=null&&typeof t.style!="object")throw Error(b(62))}}function Dl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function nf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bl=null,Gr=null,Hr=null;function yc(e){if(e=Ta(e)){if(typeof bl!="function")throw Error(b(280));var t=e.stateNode;t&&(t=ws(t),bl(e.stateNode,e.type,t))}}function tp(e){Gr?Hr?Hr.push(e):Hr=[e]:Gr=e}function np(){if(Gr){var e=Gr,t=Hr;if(Hr=Gr=null,yc(e),t)for(e=0;er?0:1<n;n++)t.push(e);return t}function ms(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,e=e.eventTimes,t=31-In(t),e[t]=n}var In=Math.clz32?Math.clz32:_y,Oy=Math.log,Ry=Math.LN2;function _y(e){return e===0?32:31-(Oy(e)/Ry|0)|0}var Ay=be.unstable_UserBlockingPriority,Ly=be.unstable_runWithPriority,xo=!0;function Iy(e,t,n,r){er||af();var i=ff,a=er;er=!0;try{rp(i,e,t,n,r)}finally{(er=a)||of()}}function Dy(e,t,n,r){Ly(Ay,ff.bind(null,e,t,n,r))}function ff(e,t,n,r){if(xo){var i;if((i=(t&4)===0)&&0=Vi),Cc=String.fromCharCode(32),kc=!1;function Ep(e,t){switch(e){case"keyup":return im.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ar=!1;function om(e,t){switch(e){case"compositionend":return wp(t);case"keypress":return t.which!==32?null:(kc=!0,Cc);case"textInput":return e=t.data,e===Cc&&kc?null:e;default:return null}}function sm(e,t){if(Ar)return e==="compositionend"||!vf&&Ep(e,t)?(e=gp(),Eo=hf=gn=null,Ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_c(n)}}function Tp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lc(){for(var e=window,t=Lo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lo(e.document)}return t}function Gl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var mm=fn&&"documentMode"in document&&11>=document.documentMode,Lr=null,Hl=null,Yi=null,Vl=!1;function Ic(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vl||Lr==null||Lr!==Lo(r)||(r=Lr,"selectionStart"in r&&Gl(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Yi&&sa(Yi,r)||(Yi=r,r=Fo(Hl,"onSelect"),0Dr||(e.current=Yl[Dr],Yl[Dr]=null,Dr--)}function Se(e,t){Dr++,Yl[Dr]=e.current,e.current=t}var Dn={},Xe=Un(Dn),at=Un(!1),sr=Dn;function ti(e,t){var n=e.type.contextTypes;if(!n)return Dn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ot(e){return e=e.childContextTypes,e!=null}function Uo(){me(at),me(Xe)}function Vc(e,t,n){if(Xe.current!==Dn)throw Error(b(168));Se(Xe,t),Se(at,n)}function Lp(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(b(108,zr(t)||"Unknown",i));return Ee({},n,r)}function Po(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Dn,sr=Xe.current,Se(Xe,e),Se(at,at.current),!0}function Wc(e,t,n){var r=e.stateNode;if(!r)throw Error(b(169));n?(e=Lp(e,t,sr),r.__reactInternalMemoizedMergedChildContext=e,me(at),me(Xe),Se(Xe,e)):me(at),Se(at,n)}var mf=null,ar=null,Em=be.unstable_runWithPriority,gf=be.unstable_scheduleCallback,Xl=be.unstable_cancelCallback,wm=be.unstable_shouldYield,Yc=be.unstable_requestPaint,$l=be.unstable_now,Pm=be.unstable_getCurrentPriorityLevel,Ps=be.unstable_ImmediatePriority,Ip=be.unstable_UserBlockingPriority,Dp=be.unstable_NormalPriority,bp=be.unstable_LowPriority,Fp=be.unstable_IdlePriority,Qs={},Mm=Yc!==void 0?Yc:function(){},tn=null,Mo=null,Zs=!1,Xc=$l(),Ve=1e4>Xc?$l:function(){return $l()-Xc};function ni(){switch(Pm()){case Ps:return 99;case Ip:return 98;case Dp:return 97;case bp:return 96;case Fp:return 95;default:throw Error(b(332))}}function Bp(e){switch(e){case 99:return Ps;case 98:return Ip;case 97:return Dp;case 96:return bp;case 95:return Fp;default:throw Error(b(332))}}function lr(e,t){return e=Bp(e),Em(e,t)}function ua(e,t,n){return e=Bp(e),gf(e,t,n)}function Qt(){if(Mo!==null){var e=Mo;Mo=null,Xl(e)}zp()}function zp(){if(!Zs&&tn!==null){Zs=!0;var e=0;try{var t=tn;lr(99,function(){for(;eM?(S=x,x=null):S=x.sibling;var T=h(d,x,g[M],E);if(T===null){x===null&&(x=S);break}e&&x&&T.alternate===null&&t(d,x),y=a(T,y,M),w===null?P=T:w.sibling=T,w=T,x=S}if(M===g.length)return n(d,x),P;if(x===null){for(;MM?(S=x,x=null):S=x.sibling;var C=h(d,x,T.value,E);if(C===null){x===null&&(x=S);break}e&&x&&C.alternate===null&&t(d,x),y=a(C,y,M),w===null?P=C:w.sibling=C,w=C,x=S}if(T.done)return n(d,x),P;if(x===null){for(;!T.done;M++,T=g.next())T=c(d,T.value,E),T!==null&&(y=a(T,y,M),w===null?P=T:w.sibling=T,w=T);return P}for(x=r(d,x);!T.done;M++,T=g.next())T=p(x,d,M,T.value,E),T!==null&&(e&&T.alternate!==null&&x.delete(T.key===null?M:T.key),y=a(T,y,M),w===null?P=T:w.sibling=T,w=T);return e&&x.forEach(function(k){return t(d,k)}),P}return function(d,y,g,E){var P=typeof g=="object"&&g!==null&&g.type===yn&&g.key===null;P&&(g=g.props.children);var w=typeof g=="object"&&g!==null;if(w)switch(g.$$typeof){case Ri:e:{for(w=g.key,P=y;P!==null;){if(P.key===w){switch(P.tag){case 7:if(g.type===yn){n(d,P.sibling),y=i(P,g.props.children),y.return=d,d=y;break e}break;default:if(P.elementType===g.type){n(d,P.sibling),y=i(P,g.props),y.ref=Ei(d,P,g),y.return=d,d=y;break e}}n(d,P);break}else t(d,P);P=P.sibling}g.type===yn?(y=jr(g.props.children,d.mode,E,g.key),y.return=d,d=y):(E=ko(g.type,g.key,g.props,null,d.mode,E),E.ref=Ei(d,y,g),E.return=d,d=E)}return o(d);case Jn:e:{for(P=g.key;y!==null;){if(y.key===P)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){n(d,y.sibling),y=i(y,g.children||[]),y.return=d,d=y;break e}else{n(d,y);break}else t(d,y);y=y.sibling}y=il(g,d.mode,E),y.return=d,d=y}return o(d)}if(typeof g=="string"||typeof g=="number")return g=""+g,y!==null&&y.tag===6?(n(d,y.sibling),y=i(y,g),y.return=d,d=y):(n(d,y),y=rl(g,d.mode,E),y.return=d,d=y),o(d);if(Ha(g))return v(d,y,g,E);if(pi(g))return m(d,y,g,E);if(w&&Va(d,g),typeof g>"u"&&!P)switch(d.tag){case 1:case 22:case 0:case 11:case 15:throw Error(b(152,zr(d.type)||"Component"))}return n(d,y)}}var Yo=Wp(!0),Yp=Wp(!1),Ca={},$t=Un(Ca),ca=Un(Ca),ha=Un(Ca);function nr(e){if(e===Ca)throw Error(b(174));return e}function Kl(e,t){switch(Se(ha,t),Se(ca,e),Se($t,Ca),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ll(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ll(t,e)}me($t),Se($t,t)}function ri(){me($t),me(ca),me(ha)}function Qc(e){nr(ha.current);var t=nr($t.current),n=Ll(t,e.type);t!==n&&(Se(ca,e),Se($t,n))}function Pf(e){ca.current===e&&(me($t),me(ca))}var Me=Un(0);function Xo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&64)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var an=null,En=null,jt=!1;function Xp(e,t){var n=Mt(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,e.lastEffect!==null?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Zc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,!0):!1;case 13:return!1;default:return!1}}function ql(e){if(jt){var t=En;if(t){var n=t;if(!Zc(e,t)){if(t=Vr(n.nextSibling),!t||!Zc(e,t)){e.flags=e.flags&-1025|2,jt=!1,an=e;return}Xp(an,n)}an=e,En=Vr(t.firstChild)}else e.flags=e.flags&-1025|2,jt=!1,an=e}}function Jc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;an=e}function Wa(e){if(e!==an)return!1;if(!jt)return Jc(e),jt=!0,!1;var t=e.type;if(e.tag!==5||t!=="head"&&t!=="body"&&!Wl(t,e.memoizedProps))for(t=En;t;)Xp(e,t),t=Vr(t.nextSibling);if(Jc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(b(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){En=Vr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}En=null}}else En=an?Vr(e.stateNode.nextSibling):null;return!0}function Js(){En=an=null,jt=!1}var Yr=[];function Mf(){for(var e=0;ea))throw Error(b(301));a+=1,Be=Ge=null,t.updateQueue=null,Xi.current=Nm,e=n(r,i)}while($i)}if(Xi.current=Qo,t=Ge!==null&&Ge.next!==null,da=0,Be=Ge=ke=null,$o=!1,t)throw Error(b(300));return e}function rr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Be===null?ke.memoizedState=Be=e:Be=Be.next=e,Be}function gr(){if(Ge===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=Be===null?ke.memoizedState:Be.next;if(t!==null)Be=t,Ge=e;else{if(e===null)throw Error(b(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},Be===null?ke.memoizedState=Be=e:Be=Be.next=e}return Be}function Ht(e,t){return typeof t=="function"?t(e):t}function wi(e){var t=gr(),n=t.queue;if(n===null)throw Error(b(311));n.lastRenderedReducer=e;var r=Ge,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}r.baseQueue=i=a,n.pending=null}if(i!==null){i=i.next,r=r.baseState;var s=o=a=null,l=i;do{var u=l.lane;if((da&u)===u)s!==null&&(s=s.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),r=l.eagerReducer===e?l.eagerState:e(r,l.action);else{var f={lane:u,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};s===null?(o=s=f,a=r):s=s.next=f,ke.lanes|=u,ka|=u}l=l.next}while(l!==null&&l!==i);s===null?a=r:s.next=o,Pt(r,t.memoizedState)||(bt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Pi(e){var t=gr(),n=t.queue;if(n===null)throw Error(b(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);Pt(a,t.memoizedState)||(bt=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function eh(e,t,n){var r=t._getVersion;r=r(t._source);var i=t._workInProgressVersionPrimary;if(i!==null?e=i===r:(e=e.mutableReadLanes,(e=(da&e)===e)&&(t._workInProgressVersionPrimary=r,Yr.push(t))),e)return n(t._source);throw Yr.push(t),Error(b(350))}function $p(e,t,n,r){var i=Qe;if(i===null)throw Error(b(349));var a=t._getVersion,o=a(t._source),s=Xi.current,l=s.useState(function(){return eh(i,t,n)}),u=l[1],f=l[0];l=Be;var c=e.memoizedState,h=c.refs,p=h.getSnapshot,v=c.source;c=c.subscribe;var m=ke;return e.memoizedState={refs:h,source:t,subscribe:r},s.useEffect(function(){h.getSnapshot=n,h.setSnapshot=u;var d=a(t._source);if(!Pt(o,d)){d=n(t._source),Pt(f,d)||(u(d),d=Nn(m),i.mutableReadLanes|=d&i.pendingLanes),d=i.mutableReadLanes,i.entangledLanes|=d;for(var y=i.entanglements,g=d;0n?98:n,function(){e(!0)}),lr(97<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[xn]=t,e[zo]=r,nv(e,t,!1,!1),t.stateNode=e,o=Dl(n,r),n){case"dialog":ve("cancel",e),ve("close",e),i=r;break;case"iframe":case"object":case"embed":ve("load",e),i=r;break;case"video":case"audio":for(i=0;iou&&(t.flags|=64,a=!0,Si(r,!1),t.lanes=33554432)}else{if(!a)if(e=Xo(o),e!==null){if(t.flags|=64,a=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Si(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!jt)return t=t.lastEffect=r.lastEffect,t!==null&&(t.nextEffect=null),null}else 2*Ve()-r.renderingStartTime>ou&&n!==1073741824&&(t.flags|=64,a=!0,Si(r,!1),t.lanes=33554432);r.isBackwards?(o.sibling=t.child,t.child=o):(n=r.last,n!==null?n.sibling=o:t.child=o,r.last=o)}return r.tail!==null?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Ve(),n.sibling=null,t=Me.current,Se(Me,a?t&1|2:t&1),n):null;case 23:case 24:return Lf(),e!==null&&e.memoizedState!==null!=(t.memoizedState!==null)&&r.mode!=="unstable-defer-without-hiding"&&(t.flags|=4),null}throw Error(b(156,t.tag))}function _m(e){switch(e.tag){case 1:ot(e.type)&&Uo();var t=e.flags;return t&4096?(e.flags=t&-4097|64,e):null;case 3:if(ri(),me(at),me(Xe),Mf(),t=e.flags,t&64)throw Error(b(285));return e.flags=t&-4097|64,e;case 5:return Pf(e),null;case 13:return me(Me),t=e.flags,t&4096?(e.flags=t&-4097|64,e):null;case 19:return me(Me),null;case 4:return ri(),null;case 10:return Ef(e),null;case 23:case 24:return Lf(),null;default:return null}}function Of(e,t){try{var n="",r=t;do n+=cy(r),r=r.return;while(r);var i=n}catch(a){i=` Error generating stack: `+a.message+` -`+a.stack}return{value:e,source:t,stack:i}}function tu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Am=typeof WeakMap=="function"?WeakMap:Map;function av(e,t,n){n=Cn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Jo||(Jo=!0,su=r),tu(e,t)},n}function ov(e,t,n){n=Cn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return tu(e,t),r(i)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){typeof r!="function"&&(Vt===null?Vt=new Set([this]):Vt.add(this),tu(e,t));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}var Lm=typeof WeakSet=="function"?WeakSet:Set;function dh(e){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){Rn(e,n)}else t.current=null}function Im(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(t.flags&256&&e!==null){var n=e.memoizedProps,r=e.memoizedState;e=t.stateNode,t=e.getSnapshotBeforeUpdate(t.elementType===t.type?n:It(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:t.flags&256&&yf(t.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(b(163))}function Dm(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(t=n.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{if((e.tag&3)===3){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(t=n.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{var i=e;r=i.next,i=i.tag,i&4&&i&1&&(vv(n,e),Vm(n,e)),e=r}while(e!==t)}return;case 1:e=n.stateNode,n.flags&4&&(t===null?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:It(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),t=n.updateQueue,t!==null&&jc(n,t,e);return;case 3:if(t=n.updateQueue,t!==null){if(e=null,n.child!==null)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}jc(n,t,e)}return;case 5:e=n.stateNode,t===null&&n.flags&4&&_p(n.type,n.memoizedProps)&&e.focus();return;case 6:return;case 4:return;case 12:return;case 13:n.memoizedState===null&&(n=n.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&fp(n))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(b(163))}function ph(e,t){for(var n=e;;){if(n.tag===5){var r=n.stateNode;if(t)r=r.style,typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=i!=null&&i.hasOwnProperty("display")?i.display:null,r.style.display=Jd("display",i)}}else if(n.tag===6)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((n.tag!==23&&n.tag!==24||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function vh(e,t){if(ar&&typeof ar.onCommitFiberUnmount=="function")try{ar.onCommitFiberUnmount(mf,t)}catch{}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(e=t.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,i!==void 0)if(r&4)vv(t,n);else{r=t;try{i()}catch(a){Rn(r,a)}}n=n.next}while(n!==e)}break;case 1:if(dh(t),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(a){Rn(t,a)}break;case 5:dh(t);break;case 4:sv(e,t)}}function yh(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function mh(e){return e.tag===5||e.tag===3||e.tag===4}function gh(e){e:{for(var t=e.return;t!==null;){if(mh(t))break e;t=t.return}throw Error(b(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:t=t.containerInfo,r=!0;break;case 4:t=t.containerInfo,r=!0;break;default:throw Error(b(161))}n.flags&16&&(ta(t,""),n.flags&=-17);e:t:for(n=e;;){for(;n.sibling===null;){if(n.return===null||mh(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue t;n.child.return=n,n=n.child}if(!(n.flags&2)){n=n.stateNode;break e}}r?nu(e,n,t):ru(e,n,t)}function nu(e,t,n){var r=e.tag,i=r===5||r===6;if(i)e=i?e.stateNode:e.stateNode.instance,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Bo));else if(r!==4&&(e=e.child,e!==null))for(nu(e,t,n),e=e.sibling;e!==null;)nu(e,t,n),e=e.sibling}function ru(e,t,n){var r=e.tag,i=r===5||r===6;if(i)e=i?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ru(e,t,n),e=e.sibling;e!==null;)ru(e,t,n),e=e.sibling}function sv(e,t){for(var n=t,r=!1,i,a;;){if(!r){r=n.return;e:for(;;){if(r===null)throw Error(b(160));switch(i=r.stateNode,r.tag){case 5:a=!1;break e;case 3:i=i.containerInfo,a=!0;break e;case 4:i=i.containerInfo,a=!0;break e}r=r.return}r=!0}if(n.tag===5||n.tag===6){e:for(var o=e,s=n,l=s;;)if(vh(o,l),l.child!==null&&l.tag!==4)l.child.return=l,l=l.child;else{if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}a?(o=i,s=n.stateNode,o.nodeType===8?o.parentNode.removeChild(s):o.removeChild(s)):i.removeChild(n.stateNode)}else if(n.tag===4){if(n.child!==null){i=n.stateNode.containerInfo,a=!0,n.child.return=n,n=n.child;continue}}else if(vh(e,n),n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return,n.tag===4&&(r=!1)}n.sibling.return=n.return,n=n.sibling}}function nl(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do(r.tag&3)===3&&(e=r.destroy,r.destroy=void 0,e!==void 0&&e()),r=r.next;while(r!==n)}return;case 1:return;case 5:if(n=t.stateNode,n!=null){r=t.memoizedProps;var i=e!==null?e.memoizedProps:r;e=t.type;var a=t.updateQueue;if(t.updateQueue=null,a!==null){for(n[zo]=r,e==="input"&&r.type==="radio"&&r.name!=null&&Kd(n,r),Dl(e,i),t=Dl(e,r),i=0;ii&&(i=o),n&=~a}if(n=i,n=Ve()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Fm(n/1960))-n,10i&&(i=o),n&=~a}if(n=i,n=Ve()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Fm(n/1960))-n,10 component higher in the tree to provide a loading indicator or placeholder to display.`)}ze!==5&&(ze=2),l=Of(l,s),h=o;do{switch(h.tag){case 3:a=l,h.flags|=4096,t&=-t,h.lanes|=t;var w=av(h,a,t);$c(h,w);break e;case 1:a=l;var x=h.type,M=h.stateNode;if(!(h.flags&64)&&(typeof x.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function"&&(Vt===null||!Vt.has(M)))){h.flags|=4096,t&=-t,h.lanes|=t;var S=ov(h,a,t);$c(h,S);break e}}h=h.return}while(h!==null)}pv(n)}catch(T){t=T,_e===n&&n!==null&&(_e=n=n.return);continue}break}while(1)}function hv(){var e=Zo.current;return Zo.current=Qo,e===null?Qo:e}function Ii(e,t){var n=q;q|=16;var r=hv();Qe===e&&Ye===t||$r(e,t);do try{zm();break}catch(i){cv(e,i)}while(1);if(xf(),q=n,Zo.current=r,_e!==null)throw Error(b(261));return Qe=null,Ye=0,ze}function zm(){for(;_e!==null;)dv(_e)}function Um(){for(;_e!==null&&!wm();)dv(_e)}function dv(e){var t=yv(e.alternate,e,ur);e.memoizedProps=e.pendingProps,t===null?pv(e):_e=t,Rf.current=null}function pv(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&2048){if(n=_m(t),n!==null){n.flags&=2047,_e=n;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(n=Rm(n,t,ur),n!==null){_e=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||ur&1073741824||!(n.mode&4)){for(var r=0,i=n.child;i!==null;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}e!==null&&!(e.flags&2048)&&(e.firstEffect===null&&(e.firstEffect=t.firstEffect),t.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1o&&(s=o,o=w,w=s),s=Ac(g,w),a=Ac(g,o),s&&a&&(P.rangeCount!==1||P.anchorNode!==s.node||P.anchorOffset!==s.offset||P.focusNode!==a.node||P.focusOffset!==a.offset)&&(E=E.createRange(),E.setStart(s.node,s.offset),P.removeAllRanges(),w>o?(P.addRange(E),P.extend(a.node,a.offset)):(E.setEnd(a.node,a.offset),P.addRange(E)))))),E=[],P=g;P=P.parentNode;)P.nodeType===1&&E.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;gVe()-Af?$r(e,0):_f|=n),kt(e,t)}function Xm(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,t&2?t&4?(nn===0&&(nn=ci),t=Or(62914560&~nn),t===0&&(t=4194304)):t=ni()===99?1:2:t=1),n=pt(),e=Ts(e,t),e!==null&&(ms(e,t,n),kt(e,n))}var yv;yv=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||at.current)bt=!0;else if(n&r)bt=!!(e.flags&16384);else{switch(bt=!1,t.tag){case 3:oh(t),Js();break;case 5:Qc(t);break;case 1:ot(t.type)&&Po(t);break;case 4:Kl(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;Se(Go,i._currentValue),i._currentValue=r;break;case 13:if(t.memoizedState!==null)return n&t.child.childLanes?sh(e,t,n):(Se(Me,Me.current&1),t=on(e,t,n),t!==null?t.sibling:null);Se(Me,Me.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&64){if(r)return hh(e,t,n);t.flags|=64}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Se(Me,Me.current),r)break;return null;case 23:case 24:return t.lanes=0,el(e,t,n)}return on(e,t,n)}else bt=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=ti(t,Xe.current),Wr(t,n),i=Tf(null,t,r,e,i,n),t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,ot(r)){var a=!0;Po(t)}else a=!1;t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,wf(t);var o=r.getDerivedStateFromProps;typeof o=="function"&&Wo(t,r,o,e),i.updater=Ms,t.stateNode=i,i._reactInternals=t,jl(t,r,e,n),t=Jl(null,t,r,!0,a,n)}else t.tag=0,nt(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=jm(i),e=It(i,e),a){case 0:t=Zl(null,t,i,e,n);break e;case 1:t=ah(null,t,i,e,n);break e;case 11:t=rh(null,t,i,e,n);break e;case 14:t=ih(null,t,i,It(i.type,e),r,n);break e}throw Error(b(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),Zl(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),ah(e,t,r,i,n);case 3:if(oh(t),r=t.updateQueue,e===null||r===null)throw Error(b(282));if(r=t.pendingProps,i=t.memoizedState,i=i!==null?i.element:null,Gp(e,t),fa(t,r,null,n),r=t.memoizedState.element,r===i)Js(),t=on(e,t,n);else{if(i=t.stateNode,(a=i.hydrate)&&(En=Vr(t.stateNode.containerInfo.firstChild),an=t,a=jt=!0),a){if(e=i.mutableSourceEagerHydrationData,e!=null)for(i=0;i"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(gv)}catch(e){console.error(e)}}gv(),Hd.exports=Nt;var tg=Hd.exports;const ng=Uu(tg);const Zt=new window.AudioContext;class rg{constructor(t){wr(this,"analyser");wr(this,"gainNode");wr(this,"audioSource");wr(this,"options");wr(this,"visualArr");const n={size:128};this.options={...n,...t},this.analyser=Zt.createAnalyser(),this.analyser.fftSize=this.options.size*2,this.gainNode=Zt.createGain(),this.gainNode.connect(Zt.destination),this.analyser.connect(this.gainNode),this.options.audioEl&&(this.audioSource=Zt.createMediaElementSource(this.options.audioEl),this.audioSource.connect(this.analyser)),this.visualArr=new Uint8Array(this.analyser.frequencyBinCount),this.resumeAudioContext()}resumeAudioContext(){if(Zt){const t=()=>{Zt.state==="suspended"&&Zt.resume(),document.removeEventListener("click",t)};document.addEventListener("click",t)}}destory(){var t;this.analyser.disconnect(this.gainNode),(t=this.audioSource)==null||t.disconnect(this.analyser),this.gainNode.disconnect(Zt.destination)}setAudioEl(t){this.audioSource&&this.audioSource.disconnect(this.analyser),this.audioSource=Zt.createMediaElementSource(t),this.audioSource.connect(this.analyser)}changeVolumn(t){this.gainNode.gain.value=t}getVisualizeValue(){return this.analyser.getByteFrequencyData(this.visualArr),this.visualArr}}const ig="_page_1wv6c_1",ag="_operationWrapper_1wv6c_4",og="_audioWrapper_1wv6c_10",sg="_exampleWrapper_1wv6c_14",lg="_footer_1wv6c_22",ug="_github_1wv6c_35",Mr={page:ig,operationWrapper:ag,audioWrapper:og,exampleWrapper:sg,footer:lg,github:ug};var hu=function(e,t){return hu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},hu(e,t)};function Q(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");hu(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var X=function(){return X=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function F(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Z(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r0?(n[0]=(s*o+f*r+l*a-u*i)*2/c,n[1]=(l*o+f*i+u*r-s*a)*2/c,n[2]=(u*o+f*a+s*i-l*r)*2/c):(n[0]=(s*o+f*r+l*a-u*i)*2,n[1]=(l*o+f*i+u*r-s*a)*2,n[2]=(u*o+f*a+s*i-l*r)*2),Nv(e,t,n),e}function ns(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function ii(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],s=t[6],l=t[8],u=t[9],f=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,o,s),e[2]=Math.hypot(l,u,f),e}function rs(e,t){var n=new Ne(3);ii(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],o=t[0]*r,s=t[1]*i,l=t[2]*a,u=t[4]*r,f=t[5]*i,c=t[6]*a,h=t[8]*r,p=t[9]*i,v=t[10]*a,y=o+f+v,d=0;return y>0?(d=Math.sqrt(y+1)*2,e[3]=.25*d,e[0]=(c-p)/d,e[1]=(h-l)/d,e[2]=(s-u)/d):o>f&&o>v?(d=Math.sqrt(1+o-f-v)*2,e[3]=(c-p)/d,e[0]=.25*d,e[1]=(s+u)/d,e[2]=(h+l)/d):f>v?(d=Math.sqrt(1+f-o-v)*2,e[3]=(h-l)/d,e[0]=(s+u)/d,e[1]=.25*d,e[2]=(c+p)/d):(d=Math.sqrt(1+v-o-f)*2,e[3]=(s-u)/d,e[0]=(h+l)/d,e[1]=(c+p)/d,e[2]=.25*d),e}function Pg(e,t,n,r){var i=t[0],a=t[1],o=t[2],s=t[3],l=i+i,u=a+a,f=o+o,c=i*l,h=i*u,p=i*f,v=a*u,y=a*f,d=o*f,m=s*l,g=s*u,E=s*f,P=r[0],w=r[1],x=r[2];return e[0]=(1-(v+d))*P,e[1]=(h+E)*P,e[2]=(p-g)*P,e[3]=0,e[4]=(h-E)*w,e[5]=(1-(c+d))*w,e[6]=(y+m)*w,e[7]=0,e[8]=(p+g)*x,e[9]=(y-m)*x,e[10]=(1-(c+v))*x,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Qi(e,t,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],u=a+a,f=o+o,c=s+s,h=a*u,p=a*f,v=a*c,y=o*f,d=o*c,m=s*c,g=l*u,E=l*f,P=l*c,w=r[0],x=r[1],M=r[2],S=i[0],T=i[1],C=i[2],k=(1-(y+m))*w,N=(p+P)*w,_=(v-E)*w,A=(p-P)*x,z=(1-(h+m))*x,W=(d+g)*x,L=(v+E)*M,H=(d-g)*M,$=(1-(h+y))*M;return e[0]=k,e[1]=N,e[2]=_,e[3]=0,e[4]=A,e[5]=z,e[6]=W,e[7]=0,e[8]=L,e[9]=H,e[10]=$,e[11]=0,e[12]=n[0]+S-(k*S+A*T+L*C),e[13]=n[1]+T-(N*S+z*T+H*C),e[14]=n[2]+C-(_*S+W*T+$*C),e[15]=1,e}function zf(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n+n,s=r+r,l=i+i,u=n*o,f=r*o,c=r*s,h=i*o,p=i*s,v=i*l,y=a*o,d=a*s,m=a*l;return e[0]=1-c-v,e[1]=f+m,e[2]=h-d,e[3]=0,e[4]=f-m,e[5]=1-u-v,e[6]=p+y,e[7]=0,e[8]=h+d,e[9]=p-y,e[10]=1-u-c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Mg(e,t,n,r,i,a,o){var s=1/(n-t),l=1/(i-r),u=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*l,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(i+r)*l,e[10]=(o+a)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*u,e[15]=0,e}function Ov(e,t,n,r,i){var a=1/Math.tan(t/2),o;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(o=1/(r-i),e[10]=(i+r)*o,e[14]=2*i*r*o):(e[10]=-1,e[14]=-2*r),e}var Sg=Ov;function Tg(e,t,n,r,i){var a=1/Math.tan(t/2),o;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(o=1/(r-i),e[10]=i*o,e[14]=i*r*o):(e[10]=-1,e[14]=-r),e}function Cg(e,t,n,r){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-((o-s)*l*.5),e[9]=(i-a)*u*.5,e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e}function Rv(e,t,n,r,i,a,o){var s=1/(t-n),l=1/(r-i),u=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=(o+a)*u,e[15]=1,e}var _v=Rv;function Av(e,t,n,r,i,a,o){var s=1/(t-n),l=1/(r-i),u=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=u,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=a*u,e[15]=1,e}function Lv(e,t,n,r){var i,a,o,s,l,u,f,c,h,p,v=t[0],y=t[1],d=t[2],m=r[0],g=r[1],E=r[2],P=n[0],w=n[1],x=n[2];return Math.abs(v-P)0&&(p=1/Math.sqrt(p),f*=p,c*=p,h*=p);var v=l*h-u*c,y=u*f-s*h,d=s*c-l*f;return p=v*v+y*y+d*d,p>0&&(p=1/Math.sqrt(p),v*=p,y*=p,d*=p),e[0]=v,e[1]=y,e[2]=d,e[3]=0,e[4]=c*d-h*y,e[5]=h*v-f*d,e[6]=f*y-c*v,e[7]=0,e[8]=f,e[9]=c,e[10]=h,e[11]=0,e[12]=i,e[13]=a,e[14]=o,e[15]=1,e}function Ng(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function Og(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Rg(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function Iv(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function _g(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}function Ag(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e[9]=t[9]+n[9]*r,e[10]=t[10]+n[10]*r,e[11]=t[11]+n[11]*r,e[12]=t[12]+n[12]*r,e[13]=t[13]+n[13]*r,e[14]=t[14]+n[14]*r,e[15]=t[15]+n[15]*r,e}function Lg(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function Ig(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],c=e[9],h=e[10],p=e[11],v=e[12],y=e[13],d=e[14],m=e[15],g=t[0],E=t[1],P=t[2],w=t[3],x=t[4],M=t[5],S=t[6],T=t[7],C=t[8],k=t[9],N=t[10],_=t[11],A=t[12],z=t[13],W=t[14],L=t[15];return Math.abs(n-g)<=ye*Math.max(1,Math.abs(n),Math.abs(g))&&Math.abs(r-E)<=ye*Math.max(1,Math.abs(r),Math.abs(E))&&Math.abs(i-P)<=ye*Math.max(1,Math.abs(i),Math.abs(P))&&Math.abs(a-w)<=ye*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-x)<=ye*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(s-M)<=ye*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-S)<=ye*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(u-T)<=ye*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(f-C)<=ye*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(c-k)<=ye*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(h-N)<=ye*Math.max(1,Math.abs(h),Math.abs(N))&&Math.abs(p-_)<=ye*Math.max(1,Math.abs(p),Math.abs(_))&&Math.abs(v-A)<=ye*Math.max(1,Math.abs(v),Math.abs(A))&&Math.abs(y-z)<=ye*Math.max(1,Math.abs(y),Math.abs(z))&&Math.abs(d-W)<=ye*Math.max(1,Math.abs(d),Math.abs(W))&&Math.abs(m-L)<=ye*Math.max(1,Math.abs(m),Math.abs(L))}var Dg=We,bg=Iv;const Fg=Object.freeze(Object.defineProperty({__proto__:null,add:Rg,adjoint:pg,clone:wv,copy:fr,create:he,determinant:Mv,equals:Ig,exactEquals:Lg,frob:Og,fromQuat:zf,fromQuat2:wg,fromRotation:mg,fromRotationTranslation:Nv,fromRotationTranslationScale:Pg,fromRotationTranslationScaleOrigin:Qi,fromScaling:kv,fromTranslation:Cv,fromValues:dg,fromXRotation:gg,fromYRotation:xg,fromZRotation:Eg,frustum:Mg,getRotation:rs,getScaling:ii,getTranslation:ns,identity:Oa,invert:Wt,lookAt:Lv,mul:Dg,multiply:We,multiplyScalar:_g,multiplyScalarAndAdd:Ag,ortho:_v,orthoNO:Rv,orthoZO:Av,perspective:Sg,perspectiveFromFieldOfView:Cg,perspectiveNO:Ov,perspectiveZO:Tg,rotate:vg,rotateX:Sv,rotateY:Tv,rotateZ:yg,scale:ts,set:du,str:Ng,sub:bg,subtract:Iv,targetTo:kg,translate:_n,transpose:Pv},Symbol.toStringTag,{value:"Module"}));function J(){var e=new Ne(3);return Ne!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function en(e){var t=new Ne(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function rn(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function fe(e,t,n){var r=new Ne(3);return r[0]=e,r[1]=t,r[2]=n,r}function rt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Dt(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function Kr(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function Ph(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function Bg(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function pu(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function zg(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return Math.hypot(n,r,i)}function or(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function Yt(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function No(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],l=n[2];return e[0]=i*l-a*s,e[1]=a*o-r*l,e[2]=r*s-i*o,e}function vu(e,t,n,r){var i=t[0],a=t[1],o=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=o+r*(n[2]-o),e}function St(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,e[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,e[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,e}function Ug(e,t,n){var r=t[0],i=t[1],a=t[2];return e[0]=r*n[0]+i*n[3]+a*n[6],e[1]=r*n[1]+i*n[4]+a*n[7],e[2]=r*n[2]+i*n[5]+a*n[8],e}function Gg(e,t,n){var r=n[0],i=n[1],a=n[2],o=n[3],s=t[0],l=t[1],u=t[2],f=i*u-a*l,c=a*s-r*u,h=r*l-i*s,p=i*h-a*c,v=a*f-r*h,y=r*c-i*f,d=o*2;return f*=d,c*=d,h*=d,p*=2,v*=2,y*=2,e[0]=s+f+p,e[1]=l+c+v,e[2]=u+h+y,e}function Ci(e,t){var n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],s=t[2];return Math.abs(n-a)<=ye*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=ye*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=ye*Math.max(1,Math.abs(i),Math.abs(s))}var Mh=zg,Dv=rn;(function(){var e=J();return function(t,n,r,i,a,o){var s,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,s=r;s0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=r*o,e[2]=i*o,e[3]=a*o,e}function Di(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,e}(function(){var e=Fr();return function(t,n,r,i,a,o){var s,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,s=r;sye?(h=Math.acos(p),v=Math.sin(h),y=Math.sin((1-r)*h)/v,d=Math.sin(r*h)/v):(y=1-r,d=r),e[0]=y*i+d*l,e[1]=y*a+d*u,e[2]=y*o+d*f,e[3]=y*s+d*c,e}function sl(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=a*s,e}function Yg(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+o]-t[o*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[o]=(t[o*3+i]+t[i*3+o])*r}return e}function ja(e,t,n,r){var i=.5*Math.PI/180;t*=i,n*=i,r*=i;var a=Math.sin(t),o=Math.cos(t),s=Math.sin(n),l=Math.cos(n),u=Math.sin(r),f=Math.cos(r);return e[0]=a*l*f-o*s*u,e[1]=o*s*f+a*l*u,e[2]=o*l*u-a*s*f,e[3]=o*l*f+a*s*u,e}var ll=Hg,Ka=Vg,Sh=An,is=Wg;(function(){var e=J(),t=fe(1,0,0),n=fe(0,1,0);return function(r,i,a){var o=Yt(i,a);return o<-.999999?(No(e,t,i),Dv(e)<1e-6&&No(e,n,i),or(e,e),wn(r,e,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(No(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+o,is(r,r))}})();(function(){var e=Ce(),t=Ce();return function(n,r,i,a,o,s){return ol(e,r,o,s),ol(t,i,a,s),ol(n,e,t,2*s*(1-s)),n}})();(function(){var e=Ev();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],is(t,Yg(t,e))}})();function Xg(){var e=new Ne(2);return Ne!=Float32Array&&(e[0]=0,e[1]=0),e}function $g(e,t){var n=new Ne(2);return n[0]=e,n[1]=t,n}function jg(e,t){return e[0]=t[0],e[1]=t[1],e}function Kg(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e}function qg(e,t){return e[0]*t[0]+e[1]*t[1]}function Qg(e,t){return e[0]===t[0]&&e[1]===t[1]}(function(){var e=Xg();return function(t,n,r,i,a,o){var s,l;for(n||(n=2),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,s=r;sn?n:e};const ht=t1;var n1=function(e){return ks(e,"Number")};const Ft=n1;var r1=1e-5;function Zi(e,t,n){return n===void 0&&(n=r1),Math.abs(e-t)7){e[n].shift();for(var r=e[n],i=n;r.length;)t[n]="A",e.splice(i+=1,0,["C"].concat(r.splice(0,6)));e.splice(n,1)}}var Ji={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function zv(e){return Array.isArray(e)&&e.every(function(t){var n=t[0].toLowerCase();return Ji[n]===t.length-1&&"achlmqstvz".includes(n)})}function Uv(e){return zv(e)&&e.every(function(t){var n=t[0];return n===n.toUpperCase()})}function Gv(e){return Uv(e)&&e.every(function(t){var n=t[0];return"ACLMQZ".includes(n)})}function Nh(e){for(var t=e.pathValue[e.segmentStart],n=t.toLowerCase(),r=e.data;r.length>=Ji[n]&&(n==="m"&&r.length>2?(e.segments.push([t].concat(r.splice(0,2))),n="l",t=t==="m"?"l":"L"):e.segments.push([t].concat(r.splice(0,Ji[n]))),!!Ji[n]););}function l1(e){var t=e.index,n=e.pathValue,r=n.charCodeAt(t);if(r===48){e.param=0,e.index+=1;return}if(r===49){e.param=1,e.index+=1;return}e.err='[path-util]: invalid Arc flag "'+n[t]+'", expecting 0 or 1 at index '+t}function u1(e){return e>=48&&e<=57||e===43||e===45||e===46}function Sr(e){return e>=48&&e<=57}function f1(e){var t=e.max,n=e.pathValue,r=e.index,i=r,a=!1,o=!1,s=!1,l=!1,u;if(i>=t){e.err="[path-util]: Invalid path value at index "+i+', "pathValue" is missing param';return}if(u=n.charCodeAt(i),(u===43||u===45)&&(i+=1,u=n.charCodeAt(i)),!Sr(u)&&u!==46){e.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" is not a number';return}if(u!==46){if(a=u===48,i+=1,u=n.charCodeAt(i),a&&i=5760&&t.includes(e)}function Ro(e){for(var t=e.pathValue,n=e.max;e.index0;o-=1){if(d1(i)&&(o===3||o===4)?l1(e):f1(e),e.err.length)return;e.data.push(e.param),Ro(e),e.index=e.max||!u1(n.charCodeAt(e.index)))break}Nh(e)}var v1=function(){function e(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return e}();function y1(e){if(zv(e))return[].concat(e);var t=new v1(e);for(Ro(t);t.index1&&(C=Math.sqrt(C),h*=C,p*=C);var k=h*h,N=p*p,_=(a===o?-1:1)*Math.sqrt(Math.abs((k*N-k*T*T-N*S*S)/(k*T*T+N*S*S)));x=_*h*T/p+(f+v)/2,M=_*-p*S/h+(c+y)/2,P=Math.asin(((c-M)/p*Math.pow(10,9)>>0)/Math.pow(10,9)),w=Math.asin(((y-M)/p*Math.pow(10,9)>>0)/Math.pow(10,9)),P=fw&&(P-=Math.PI*2),!o&&w>P&&(w-=Math.PI*2)}var A=w-P;if(Math.abs(A)>d){var z=w,W=v,L=y;w=P+d*(o&&w>P?1:-1),v=x+h*Math.cos(w),y=M+p*Math.sin(w),g=Uf(v,y,h,p,i,0,o,W,L,[w,z,x,M])}A=w-P;var H=Math.cos(P),$=Math.sin(P),Te=Math.cos(w),I=Math.sin(w),Y=Math.tan(A/4),j=4/3*h*Y,ie=4/3*p*Y,ue=[f,c],Re=[f+j*$,c-ie*H],mt=[v+j*I,y-ie*Te],Bt=[v,y];if(Re[0]=2*ue[0]-Re[0],Re[1]=2*ue[1]-Re[1],u)return Re.concat(mt,Bt,g);g=Re.concat(mt,Bt,g);for(var Rt=[],_t=0,La=g.length;_t=a)o={x:n,y:r};else{var s=pn([e,t],[n,r],i/a),l=s[0],u=s[1];o={x:l,y:u}}return{length:a,point:o,min:{x:Math.min(e,n),y:Math.min(t,r)},max:{x:Math.max(e,n),y:Math.max(t,r)}}}function Rh(e,t){var n=e.x,r=e.y,i=t.x,a=t.y,o=n*i+r*a,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))),l=n*a-r*i<0?-1:1,u=l*Math.acos(o/s);return u}function S1(e,t,n,r,i,a,o,s,l,u){var f=Math.abs,c=Math.sin,h=Math.cos,p=Math.sqrt,v=Math.PI,y=f(n),d=f(r),m=(i%360+360)%360,g=m*(v/180);if(e===s&&t===l)return{x:e,y:t};if(y===0||d===0)return mu(e,t,s,l,u).point;var E=(e-s)/2,P=(t-l)/2,w={x:h(g)*E+c(g)*P,y:-c(g)*E+h(g)*P},x=Math.pow(w.x,2)/Math.pow(y,2)+Math.pow(w.y,2)/Math.pow(d,2);x>1&&(y*=p(x),d*=p(x));var M=Math.pow(y,2)*Math.pow(d,2)-Math.pow(y,2)*Math.pow(w.y,2)-Math.pow(d,2)*Math.pow(w.x,2),S=Math.pow(y,2)*Math.pow(w.y,2)+Math.pow(d,2)*Math.pow(w.x,2),T=M/S;T=T<0?0:T;var C=(a!==o?1:-1)*p(T),k={x:C*(y*w.y/d),y:C*(-(d*w.x)/y)},N={x:h(g)*k.x-c(g)*k.y+(e+s)/2,y:c(g)*k.x+h(g)*k.y+(t+l)/2},_={x:(w.x-k.x)/y,y:(w.y-k.y)/d},A=Rh({x:1,y:0},_),z={x:(-w.x-k.x)/y,y:(-w.y-k.y)/d},W=Rh(_,z);!o&&W>0?W-=2*v:o&&W<0&&(W+=2*v),W%=2*v;var L=A+W*u,H=y*h(L),$=d*c(L),Te={x:h(g)*H-c(g)*$+N.x,y:c(g)*H+h(g)*$+N.y};return Te}function T1(e,t,n,r,i,a,o,s,l,u,f){var c,h=f.bbox,p=h===void 0?!0:h,v=f.length,y=v===void 0?!0:v,d=f.sampleSize,m=d===void 0?30:d,g=typeof u=="number",E=e,P=t,w=0,x=[E,P,w],M=[E,P],S=0,T={x:0,y:0},C=[{x:E,y:P}];g&&u<=0&&(T={x:E,y:P});for(var k=0;k<=m;k+=1){if(S=k/m,c=S1(e,t,n,r,i,a,o,s,l,S),E=c.x,P=c.y,p&&C.push({x:E,y:P}),y&&(w+=ut(M,[E,P])),M=[E,P],g&&w>=u&&u>x[2]){var N=(w-u)/(w-x[2]);T={x:M[0]*(1-N)+x[0]*N,y:M[1]*(1-N)+x[1]*N}}x=[E,P,w]}return g&&u>=w&&(T={x:s,y:l}),{length:w,point:T,min:{x:Math.min.apply(null,C.map(function(_){return _.x})),y:Math.min.apply(null,C.map(function(_){return _.y}))},max:{x:Math.max.apply(null,C.map(function(_){return _.x})),y:Math.max.apply(null,C.map(function(_){return _.y}))}}}function C1(e,t,n,r,i,a,o,s,l){var u=1-l;return{x:Math.pow(u,3)*e+3*Math.pow(u,2)*l*n+3*u*Math.pow(l,2)*i+Math.pow(l,3)*o,y:Math.pow(u,3)*t+3*Math.pow(u,2)*l*r+3*u*Math.pow(l,2)*a+Math.pow(l,3)*s}}function Hv(e,t,n,r,i,a,o,s,l,u){var f,c=u.bbox,h=c===void 0?!0:c,p=u.length,v=p===void 0?!0:p,y=u.sampleSize,d=y===void 0?10:y,m=typeof l=="number",g=e,E=t,P=0,w=[g,E,P],x=[g,E],M=0,S={x:0,y:0},T=[{x:g,y:E}];m&&l<=0&&(S={x:g,y:E});for(var C=0;C<=d;C+=1){if(M=C/d,f=C1(e,t,n,r,i,a,o,s,M),g=f.x,E=f.y,h&&T.push({x:g,y:E}),v&&(P+=ut(x,[g,E])),x=[g,E],m&&P>=l&&l>w[2]){var k=(P-l)/(P-w[2]);S={x:x[0]*(1-k)+w[0]*k,y:x[1]*(1-k)+w[1]*k}}w=[g,E,P]}return m&&l>=P&&(S={x:o,y:s}),{length:P,point:S,min:{x:Math.min.apply(null,T.map(function(N){return N.x})),y:Math.min.apply(null,T.map(function(N){return N.y}))},max:{x:Math.max.apply(null,T.map(function(N){return N.x})),y:Math.max.apply(null,T.map(function(N){return N.y}))}}}function k1(e,t,n,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*e+2*s*o*n+Math.pow(o,2)*i,y:Math.pow(s,2)*t+2*s*o*r+Math.pow(o,2)*a}}function N1(e,t,n,r,i,a,o,s){var l,u=s.bbox,f=u===void 0?!0:u,c=s.length,h=c===void 0?!0:c,p=s.sampleSize,v=p===void 0?10:p,y=typeof o=="number",d=e,m=t,g=0,E=[d,m,g],P=[d,m],w=0,x={x:0,y:0},M=[{x:d,y:m}];y&&o<=0&&(x={x:d,y:m});for(var S=0;S<=v;S+=1){if(w=S/v,l=k1(e,t,n,r,i,a,w),d=l.x,m=l.y,f&&M.push({x:d,y:m}),h&&(g+=ut(P,[d,m])),P=[d,m],y&&g>=o&&o>E[2]){var T=(g-o)/(g-E[2]);x={x:P[0]*(1-T)+E[0]*T,y:P[1]*(1-T)+E[1]*T}}E=[d,m,g]}return y&&o>=g&&(x={x:i,y:a}),{length:g,point:x,min:{x:Math.min.apply(null,M.map(function(C){return C.x})),y:Math.min.apply(null,M.map(function(C){return C.y}))},max:{x:Math.max.apply(null,M.map(function(C){return C.x})),y:Math.max.apply(null,M.map(function(C){return C.y}))}}}function Vv(e,t,n){for(var r,i,a,o,s,l,u=as(e),f=typeof t=="number",c,h=[],p,v=0,y=0,d=0,m=0,g,E=[],P=[],w=0,x={x:0,y:0},M=x,S=x,T=x,C=0,k=0,N=u.length;k=t&&(T=S),P.push(M),E.push(x),C+=w,l=p!=="Z"?g.slice(-2):[d,m],v=l[0],y=l[1];return f&&t>=C&&(T={x:v,y}),{length:C,point:T,min:{x:Math.min.apply(null,E.map(function(_){return _.x})),y:Math.min.apply(null,E.map(function(_){return _.y}))},max:{x:Math.max.apply(null,P.map(function(_){return _.x})),y:Math.max.apply(null,P.map(function(_){return _.y}))}}}function O1(e,t){return Vv(e,void 0,X(X({},t),{bbox:!1,length:!0})).length}function R1(e){var t=e.length,n=t-1;return e.map(function(r,i){return e.map(function(a,o){var s=i+o,l;return o===0||e[s]&&e[s][0]==="M"?(l=e[s],["M"].concat(l.slice(-2))):(s>=t&&(s-=n),e[s])})})}function _1(e,t){var n=e.length-1,r=[],i=0,a=0,o=R1(e);return o.forEach(function(s,l){e.slice(1).forEach(function(u,f){a+=ut(e[(l+f)%n].slice(-2),t[f%n].slice(-2))}),r[l]=a,a=0}),i=r.indexOf(Math.min.apply(null,r)),o[i]}function A1(e,t,n,r,i,a,o,s){return 3*((s-t)*(n+i)-(o-e)*(r+a)+r*(e-i)-n*(t-a)+s*(i+e/3)-o*(a+t/3))/20}function L1(e){var t=0,n=0,r=0;return yu(e).map(function(i){var a;switch(i[0]){case"M":return t=i[1],n=i[2],0;default:var o=i.slice(1),s=o[0],l=o[1],u=o[2],f=o[3],c=o[4],h=o[5];return r=A1(t,n,s,l,u,f,c,h),a=i.slice(-2),t=a[0],n=a[1],r}}).reduce(function(i,a){return i+a},0)}function _h(e){return L1(e)>=0}function I1(e,t,n){return Vv(e,t,X(X({},n),{bbox:!1,length:!0})).point}function D1(e,t){t===void 0&&(t=.5);var n=e.slice(0,2),r=e.slice(2,4),i=e.slice(4,6),a=e.slice(6,8),o=pn(n,r,t),s=pn(r,i,t),l=pn(i,a,t),u=pn(o,s,t),f=pn(s,l,t),c=pn(u,f,t);return[["C"].concat(o,u,c),["C"].concat(f,l,a)]}function Ah(e){return e.map(function(t,n,r){var i=n&&r[n-1].slice(-2).concat(t.slice(1)),a=n?Hv(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0,o;return n?o=a?D1(i):[t,t]:o=[t],{s:t,ss:o,l:a}})}function Wv(e,t,n){var r=Ah(e),i=Ah(t),a=r.length,o=i.length,s=r.filter(function(d){return d.l}).length,l=i.filter(function(d){return d.l}).length,u=r.filter(function(d){return d.l}).reduce(function(d,m){var g=m.l;return d+g},0)/s||0,f=i.filter(function(d){return d.l}).reduce(function(d,m){var g=m.l;return d+g},0)/l||0,c=n||Math.max(a,o),h=[u,f],p=[c-a,c-o],v=0,y=[r,i].map(function(d,m){return d.l===c?d.map(function(g){return g.s}):d.map(function(g,E){return v=E&&p[m]&&g.l>=h[m],p[m]-=v?1:0,v?g.ss:[g.s]}).flat()});return y[0].length===y[1].length?y:Wv(y[0],y[1],c)}function Gf(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Yv(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ra(){}var ya=.7,os=1/ya,qr="\\s*([+-]?\\d+)\\s*",ma="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Kt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",b1=/^#([0-9a-f]{3,8})$/,F1=new RegExp("^rgb\\("+[qr,qr,qr]+"\\)$"),B1=new RegExp("^rgb\\("+[Kt,Kt,Kt]+"\\)$"),z1=new RegExp("^rgba\\("+[qr,qr,qr,ma]+"\\)$"),U1=new RegExp("^rgba\\("+[Kt,Kt,Kt,ma]+"\\)$"),G1=new RegExp("^hsl\\("+[ma,Kt,Kt]+"\\)$"),H1=new RegExp("^hsla\\("+[ma,Kt,Kt,ma]+"\\)$"),Lh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Gf(Ra,Ns,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:Ih,formatHex:Ih,formatHsl:V1,formatRgb:Dh,toString:Dh});function Ih(){return this.rgb().formatHex()}function V1(){return Xv(this).formatHsl()}function Dh(){return this.rgb().formatRgb()}function Ns(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=b1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?bh(t):n===3?new dt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Qa(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Qa(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=F1.exec(e))?new dt(t[1],t[2],t[3],1):(t=B1.exec(e))?new dt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=z1.exec(e))?Qa(t[1],t[2],t[3],t[4]):(t=U1.exec(e))?Qa(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=G1.exec(e))?zh(t[1],t[2]/100,t[3]/100,1):(t=H1.exec(e))?zh(t[1],t[2]/100,t[3]/100,t[4]):Lh.hasOwnProperty(e)?bh(Lh[e]):e==="transparent"?new dt(NaN,NaN,NaN,0):null}function bh(e){return new dt(e>>16&255,e>>8&255,e&255,1)}function Qa(e,t,n,r){return r<=0&&(e=t=n=NaN),new dt(e,t,n,r)}function W1(e){return e instanceof Ra||(e=Ns(e)),e?(e=e.rgb(),new dt(e.r,e.g,e.b,e.opacity)):new dt}function Y1(e,t,n,r){return arguments.length===1?W1(e):new dt(e,t,n,r??1)}function dt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Gf(dt,Y1,Yv(Ra,{brighter:function(e){return e=e==null?os:Math.pow(os,e),new dt(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=e==null?ya:Math.pow(ya,e),new dt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Fh,formatHex:Fh,formatRgb:Bh,toString:Bh}));function Fh(){return"#"+ul(this.r)+ul(this.g)+ul(this.b)}function Bh(){var e=this.opacity;return e=isNaN(e)?1:Math.max(0,Math.min(1,e)),(e===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(e===1?")":", "+e+")")}function ul(e){return e=Math.max(0,Math.min(255,Math.round(e)||0)),(e<16?"0":"")+e.toString(16)}function zh(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ut(e,t,n,r)}function Xv(e){if(e instanceof Ut)return new Ut(e.h,e.s,e.l,e.opacity);if(e instanceof Ra||(e=Ns(e)),!e)return new Ut;if(e instanceof Ut)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(n-r)/s+(n0&&l<1?0:o,new Ut(o,s,l,e.opacity)}function X1(e,t,n,r){return arguments.length===1?Xv(e):new Ut(e,t,n,r??1)}function Ut(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Gf(Ut,X1,Yv(Ra,{brighter:function(e){return e=e==null?os:Math.pow(os,e),new Ut(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=e==null?ya:Math.pow(ya,e),new Ut(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new dt(fl(e>=240?e-240:e+120,i,r),fl(e,i,r),fl(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return e=isNaN(e)?1:Math.max(0,Math.min(1,e)),(e===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(e===1?")":", "+e+")")}}));function fl(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function un(e,t,n,r){var i=e-n,a=t-r;return Math.sqrt(i*i+a*a)}function $v(e,t){var n=Math.min.apply(Math,Z([],F(e),!1)),r=Math.min.apply(Math,Z([],F(t),!1)),i=Math.max.apply(Math,Z([],F(e),!1)),a=Math.max.apply(Math,Z([],F(t),!1));return{x:n,y:r,width:i-n,height:a-r}}function $1(e,t,n){return Math.atan(-t/e*Math.tan(n))}function j1(e,t,n){return Math.atan(t/(e*Math.tan(n)))}function K1(e,t,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+e}function q1(e,t,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+t}function Q1(e,t,n,r,i,a,o){for(var s=$1(n,r,i),l=1/0,u=-1/0,f=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var h=s+c;au&&(u=p)}for(var v=j1(n,r,i),y=1/0,d=-1/0,m=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var g=v+c;ad&&(d=E)}return{x:l,y,width:u-l,height:d-y}}var Z1=1e-4;function jv(e,t,n,r,i,a){var o=-1,s=1/0,l=[n,r],u=20;a&&a>200&&(u=a/10);for(var f=1/u,c=f/10,h=0;h<=u;h++){var p=h*f,v=[i.apply(void 0,Z([],F(e.concat([p])),!1)),i.apply(void 0,Z([],F(t.concat([p])),!1))],y=un(l[0],l[1],v[0],v[1]);y=0&&y=0&&l<=1&&s.push(l));else{var c=a*a-4*i*o;Zi(c,0)?s.push(-a/(2*i)):c>0&&(f=Math.sqrt(c),l=(-a+f)/(2*i),u=(-a-f)/(2*i),l>=0&&l<=1&&s.push(l),u>=0&&u<=1&&s.push(u))}return s}function ex(e,t,n,r,i,a,o,s){for(var l=[e,o],u=[t,s],f=Uh(e,n,i,o),c=Uh(t,r,a,s),h=0;h=0?[i]:[]}function ix(e,t,n,r,i,a){var o=Hh(e,n,i)[0],s=Hh(t,r,a)[0],l=[e,i],u=[t,a];return o!==void 0&&l.push(xu(e,n,i,o)),s!==void 0&&u.push(xu(t,r,a,s)),$v(l,u)}function ax(e,t,n,r,i,a,o,s){return jv([e,n,i],[t,r,a],o,s,xu)}function ox(e,t,n,r,i,a,o,s){var l=ax(e,t,n,r,i,a,o,s);return un(l.x,l.y,o,s)}var sx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Qv={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(sx,function(){function n(w,x,M,S,T){r(w,x,M||0,S||w.length-1,T||a)}function r(w,x,M,S,T){for(;S>M;){if(S-M>600){var C=S-M+1,k=x-M+1,N=Math.log(C),_=.5*Math.exp(2*N/3),A=.5*Math.sqrt(N*_*(C-_)/C)*(k-C/2<0?-1:1),z=Math.max(M,Math.floor(x-k*_/C+A)),W=Math.min(S,Math.floor(x+(C-k)*_/C+A));r(w,x,z,W,T)}var L=w[x],H=M,$=S;for(i(w,M,x),T(w[S],L)>0&&i(w,M,S);H<$;){for(i(w,H,$),H++,$--;T(w[H],L)<0;)H++;for(;T(w[$],L)>0;)$--}T(w[M],L)===0?i(w,M,$):($++,i(w,$,S)),$<=x&&(M=$+1),x<=$&&(S=$-1)}}function i(w,x,M){var S=w[x];w[x]=w[M],w[M]=S}function a(w,x){return wx?1:0}var o=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(x){var M=this.data,S=[];if(!g(x,M))return S;for(var T=this.toBBox,C=[];M;){for(var k=0;k=0&&C[M].children.length>this._maxEntries;)this._split(C,M),M--;this._adjustParentBBoxes(T,C,M)},o.prototype._split=function(x,M){var S=x[M],T=S.children.length,C=this._minEntries;this._chooseSplitAxis(S,C,T);var k=this._chooseSplitIndex(S,C,T),N=E(S.children.splice(k,S.children.length-k));N.height=S.height,N.leaf=S.leaf,l(S,this.toBBox),l(N,this.toBBox),M?x[M-1].children.push(N):this._splitRoot(S,N)},o.prototype._splitRoot=function(x,M){this.data=E([x,M]),this.data.height=x.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(x,M,S){for(var T,C=1/0,k=1/0,N=M;N<=S-M;N++){var _=u(x,0,N,this.toBBox),A=u(x,N,S,this.toBBox),z=d(_,A),W=p(_)+p(A);z=M;W--){var L=x.children[W];f(N,x.leaf?C(L):L),_+=v(N)}return _},o.prototype._adjustParentBBoxes=function(x,M,S){for(var T=S;T>=0;T--)f(M[T],x)},o.prototype._condense=function(x){for(var M=x.length-1,S=void 0;M>=0;M--)x[M].children.length===0?M>0?(S=x[M-1].children,S.splice(S.indexOf(x[M]),1)):this.clear():l(x[M],this.toBBox)};function s(w,x,M){if(!M)return x.indexOf(w);for(var S=0;S=w.minX&&x.maxY>=w.minY}function E(w){return{children:w,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(w,x,M,S,T){for(var C=[x,M];C.length;)if(M=C.pop(),x=C.pop(),!(M-x<=S)){var k=x+Math.ceil((M-x)/S/2)*S;n(w,k,x,M,T),C.push(x,k,k,M)}}return o})})(Qv);var lx=Qv.exports,O;(function(e){e.GROUP="g",e.CIRCLE="circle",e.ELLIPSE="ellipse",e.IMAGE="image",e.RECT="rect",e.LINE="line",e.POLYLINE="polyline",e.POLYGON="polygon",e.TEXT="text",e.PATH="path",e.HTML="html",e.MESH="mesh"})(O||(O={}));var Qr;(function(e){e[e.ZERO=0]="ZERO",e[e.NEGATIVE_ONE=1]="NEGATIVE_ONE"})(Qr||(Qr={}));var xr=function(){function e(){this.plugins=[]}return e.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},e.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach(function(n){var r=t.context.renderingPlugins.indexOf(n);r>=0&&t.context.renderingPlugins.splice(r,1)})},e}(),ux=function(){function e(t){this.clipSpaceNearZ=Qr.NEGATIVE_ONE,this.plugins=[],this.config=X({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}return e.prototype.registerPlugin=function(t){var n=this.plugins.findIndex(function(r){return r===t});n===-1&&this.plugins.push(t)},e.prototype.unregisterPlugin=function(t){var n=this.plugins.findIndex(function(r){return r===t});n>-1&&this.plugins.splice(n,1)},e.prototype.getPlugins=function(){return this.plugins},e.prototype.getPlugin=function(t){return this.plugins.find(function(n){return n.name===t})},e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(t){Object.assign(this.config,t)},e}();function Tr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function cl(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function _o(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function Vh(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function fx(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function cx(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function Zr(e){return e===void 0?0:e>360||e<-360?e%360:e}function qe(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=0),Array.isArray(e)&&e.length===3?en(e):Ft(e)?fe(e,t,n):fe(e[0],e[1]||t,e[2]||n)}function ge(e){return e*(Math.PI/180)}function wt(e){return e*(180/Math.PI)}function hx(e){return 360*e}function dx(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n*n,s=r*r,l=i*i,u=a*a,f=o+s+l+u,c=n*a-r*i;return c>.499995*f?(e[0]=Math.PI/2,e[1]=2*Math.atan2(r,n),e[2]=0):c<-.499995*f?(e[0]=-Math.PI/2,e[1]=2*Math.atan2(r,n),e[2]=0):(e[0]=Math.asin(2*(n*i-a*r)),e[1]=Math.atan2(2*(n*a+r*i),1-2*(l+u)),e[2]=Math.atan2(2*(n*r+i*a),1-2*(s+l))),e}function px(e,t){var n,r,i=Math.PI*.5,a=F(ii(J(),t),3),o=a[0],s=a[1],l=a[2],u=Math.asin(-t[2]/o);return u-i?(n=Math.atan2(t[6]/s,t[10]/l),r=Math.atan2(t[1]/o,t[0]/o)):(r=0,n=-Math.atan2(t[4]/s,t[5]/s)):(r=0,n=Math.atan2(t[4]/s,t[5]/s)),e[0]=n,e[1]=u,e[2]=r,e}function hl(e,t){return t.length===16?px(e,t):dx(e,t)}function vx(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e);return hg(r*a,i*o,0,-r*o,i*a,0,t,n,1)}function yx(e,t,n,r,i,a,o,s){s===void 0&&(s=!1);var l=2*a/(n-t),u=2*a/(r-i),f=(n+t)/(n-t),c=(r+i)/(r-i),h,p;return s?(h=-o/(o-a),p=-o*a/(o-a)):(h=-(o+a)/(o-a),p=-2*o*a/(o-a)),e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=f,e[9]=c,e[10]=h,e[11]=-1,e[12]=0,e[13]=0,e[14]=p,e[15]=0,e}function Wh(e){var t=e[0],n=e[1],r=e[3],i=e[4],a=Math.sqrt(t*t+n*n),o=Math.sqrt(r*r+i*i),s=t*i-n*r;s<0&&(tK[1][2]&&(a[0]=-a[0]),K[0][2]>K[2][0]&&(a[1]=-a[1]),K[1][0]>K[0][1]&&(a[2]=-a[2]),!0}function gx(e,t){var n=t[15];if(n===0)return!1;for(var r=1/n,i=0;i<16;i++)e[i]=t[i]*r;return!0}function xx(e,t){e[0][0]=t[0],e[0][1]=t[1],e[0][2]=t[2],e[1][0]=t[4],e[1][1]=t[5],e[1][2]=t[6],e[2][0]=t[8],e[2][1]=t[9],e[2][2]=t[10]}function dl(e,t,n,r,i){e[0]=t[0]*r+n[0]*i,e[1]=t[1]*r+n[1]*i,e[2]=t[2]*r+n[2]*i}var Oe=function(){function e(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return e.isEmpty=function(t){return!t||t.halfExtents[0]===0&&t.halfExtents[1]===0&&t.halfExtents[2]===0},e.prototype.update=function(t,n){Tr(this.center,t),Tr(this.halfExtents,n),cl(this.min,this.center,this.halfExtents),_o(this.max,this.center,this.halfExtents)},e.prototype.setMinMax=function(t,n){_o(this.center,n,t),Vh(this.center,this.center,.5),cl(this.halfExtents,n,t),Vh(this.halfExtents,this.halfExtents,.5),Tr(this.min,t),Tr(this.max,n)},e.prototype.getMin=function(){return this.min},e.prototype.getMax=function(){return this.max},e.prototype.add=function(t){if(!e.isEmpty(t)){if(e.isEmpty(this)){this.setMinMax(t.getMin(),t.getMax());return}var n=this.center,r=n[0],i=n[1],a=n[2],o=this.halfExtents,s=o[0],l=o[1],u=o[2],f=r-s,c=r+s,h=i-l,p=i+l,v=a-u,y=a+u,d=t.center,m=d[0],g=d[1],E=d[2],P=t.halfExtents,w=P[0],x=P[1],M=P[2],S=m-w,T=m+w,C=g-x,k=g+x,N=E-M,_=E+M;Sc&&(c=T),Cp&&(p=k),Ny&&(y=_),n[0]=(f+c)*.5,n[1]=(h+p)*.5,n[2]=(v+y)*.5,o[0]=(c-f)*.5,o[1]=(p-h)*.5,o[2]=(y-v)*.5,this.min[0]=f,this.min[1]=h,this.min[2]=v,this.max[0]=c,this.max[1]=p,this.max[2]=y}},e.prototype.setFromTransformedAABB=function(t,n){var r=this.center,i=this.halfExtents,a=t.center,o=t.halfExtents,s=n[0],l=n[4],u=n[8],f=n[1],c=n[5],h=n[9],p=n[2],v=n[6],y=n[10],d=Math.abs(s),m=Math.abs(l),g=Math.abs(u),E=Math.abs(f),P=Math.abs(c),w=Math.abs(h),x=Math.abs(p),M=Math.abs(v),S=Math.abs(y);r[0]=n[12]+s*a[0]+l*a[1]+u*a[2],r[1]=n[13]+f*a[0]+c*a[1]+h*a[2],r[2]=n[14]+p*a[0]+v*a[1]+y*a[2],i[0]=d*o[0]+m*o[1]+g*o[2],i[1]=E*o[0]+P*o[1]+w*o[2],i[2]=x*o[0]+M*o[1]+S*o[2],cl(this.min,r,i),_o(this.max,r,i)},e.prototype.intersects=function(t){var n=this.getMax(),r=this.getMin(),i=t.getMax(),a=t.getMin();return r[0]<=i[0]&&n[0]>=a[0]&&r[1]<=i[1]&&n[1]>=a[1]&&r[2]<=i[2]&&n[2]>=a[2]},e.prototype.intersection=function(t){if(!this.intersects(t))return null;var n=new e,r=fx([0,0,0],this.getMin(),t.getMin()),i=cx([0,0,0],this.getMax(),t.getMax());return n.setMinMax(r,i),n},e.prototype.getNegativeFarPoint=function(t){return t.pnVertexFlag===273?Tr([0,0,0],this.min):t.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:t.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},e.prototype.getPositiveFarPoint=function(t){return t.pnVertexFlag===273?Tr([0,0,0],this.max):t.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:t.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},e}(),Ex=function(){function e(t,n){this.distance=t||0,this.normal=n||fe(0,1,0),this.updatePNVertexFlag()}return e.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)},e.prototype.distanceToPoint=function(t){return Yt(t,this.normal)-this.distance},e.prototype.normalize=function(){var t=1/Dv(this.normal);pu(this.normal,this.normal,t),this.distance*=t},e.prototype.intersectsLine=function(t,n,r){var i=this.distanceToPoint(t),a=this.distanceToPoint(n),o=i/(i-a),s=o>=0&&o<=1;return s&&r&&vu(r,t,n,o),s},e}(),vn;(function(e){e[e.OUTSIDE=4294967295]="OUTSIDE",e[e.INSIDE=0]="INSIDE",e[e.INDETERMINATE=2147483647]="INDETERMINATE"})(vn||(vn={}));var wx=function(){function e(t){if(this.planes=[],t)this.planes=t;else for(var n=0;n<6;n++)this.planes.push(new Ex)}return e.prototype.extractFromVPMatrix=function(t){var n=F(t,16),r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],u=n[6],f=n[7],c=n[8],h=n[9],p=n[10],v=n[11],y=n[12],d=n[13],m=n[14],g=n[15];Dt(this.planes[0].normal,o-r,f-s,v-c),this.planes[0].distance=g-y,Dt(this.planes[1].normal,o+r,f+s,v+c),this.planes[1].distance=g+y,Dt(this.planes[2].normal,o+i,f+l,v+h),this.planes[2].distance=g+d,Dt(this.planes[3].normal,o-i,f-l,v-h),this.planes[3].distance=g-d,Dt(this.planes[4].normal,o-a,f-u,v-p),this.planes[4].distance=g-m,Dt(this.planes[5].normal,o+a,f+u,v+p),this.planes[5].distance=g+m,this.planes.forEach(function(E){E.normalize(),E.updatePNVertexFlag()})},e}(),De=function(){function e(t,n){t===void 0&&(t=0),n===void 0&&(n=0),this.x=0,this.y=0,this.x=t,this.y=n}return e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},e}(),cr=function(){function e(t,n,r,i){this.x=t,this.y=n,this.width=r,this.height=i,this.left=t,this.right=t+r,this.top=n,this.bottom=n+i}return e.prototype.toJSON=function(){},e}(),le="Method not implemented.",Cr="Use document.documentElement instead.",Px="Cannot append a destroyed element.",ae;(function(e){e[e.ORBITING=0]="ORBITING",e[e.EXPLORING=1]="EXPLORING",e[e.TRACKING=2]="TRACKING"})(ae||(ae={}));var ga;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ROTATIONAL=1]="ROTATIONAL",e[e.TRANSLATIONAL=2]="TRANSLATIONAL",e[e.CINEMATIC=3]="CINEMATIC"})(ga||(ga={}));var tt;(function(e){e[e.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",e[e.PERSPECTIVE=1]="PERSPECTIVE"})(tt||(tt={}));var Zv={UPDATED:"updated"},Xh=2e-4,Jv=function(){function e(){this.clipSpaceNearZ=Qr.NEGATIVE_ONE,this.eventEmitter=new Bf,this.matrix=he(),this.right=fe(1,0,0),this.up=fe(0,1,0),this.forward=fe(0,0,1),this.position=fe(0,0,1),this.focalPoint=fe(0,0,0),this.distanceVector=fe(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=he(),this.projectionMatrixInverse=he(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=ae.EXPLORING,this.trackingMode=ga.DEFAULT,this.projectionMode=tt.PERSPECTIVE,this.frustum=new wx,this.orthoMatrix=he()}return e.prototype.isOrtho=function(){return this.projectionMode===tt.ORTHOGRAPHIC},e.prototype.getProjectionMode=function(){return this.projectionMode},e.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},e.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},e.prototype.getFrustum=function(){return this.frustum},e.prototype.getPosition=function(){return this.position},e.prototype.getFocalPoint=function(){return this.focalPoint},e.prototype.getDollyingStep=function(){return this.dollyingStep},e.prototype.getNear=function(){return this.near},e.prototype.getFar=function(){return this.far},e.prototype.getZoom=function(){return this.zoom},e.prototype.getOrthoMatrix=function(){return this.orthoMatrix},e.prototype.getView=function(){return this.view},e.prototype.setEnableUpdate=function(t){this.enableUpdate=t},e.prototype.setType=function(t,n){return this.type=t,this.type===ae.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===ae.TRACKING&&n!==void 0&&this.setTrackingMode(n),this},e.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},e.prototype.setTrackingMode=function(t){if(this.type!==ae.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},e.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},e.prototype.getViewTransform=function(){return Wt(he(),this.matrix)},e.prototype.getWorldTransform=function(){return this.matrix},e.prototype.jitterProjectionMatrix=function(t,n){var r=Cv(he(),[t,n,0]);this.jitteredProjectionMatrix=We(he(),r,this.projectionMatrix)},e.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},e.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},e.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},e.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},e.prototype.setNear=function(t){return this.projectionMode===tt.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},e.prototype.setFar=function(t){return this.projectionMode===tt.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},e.prototype.setViewOffset=function(t,n,r,i,a,o){return this.aspect=t/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=o,this.projectionMode===tt.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.clearViewOffset=function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===tt.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===tt.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===tt.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},e.prototype.setZoomByViewportPoint=function(t,n){var r=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),i=r.x,a=r.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(i,a),this.setFocalPoint(i,a),this.setZoom(t),this.rotate(0,0,o);var s=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),l=s.x,u=s.y,f=fe(l-i,u-a,0),c=Yt(f,this.right)/rn(this.right),h=Yt(f,this.up)/rn(this.up);return this.pan(-c,-h),this},e.prototype.setPerspective=function(t,n,r,i){var a;this.projectionMode=tt.PERSPECTIVE,this.fov=r,this.near=t,this.far=n,this.aspect=i;var o=this.near*Math.tan(ge(.5*this.fov))/this.zoom,s=2*o,l=this.aspect*s,u=-.5*l;if(!((a=this.view)===null||a===void 0)&&a.enabled){var f=this.view.fullWidth,c=this.view.fullHeight;u+=this.view.offsetX*l/f,o-=this.view.offsetY*s/c,l*=this.view.width/f,s*=this.view.height/c}return yx(this.projectionMatrix,u,u+l,o,o-s,t,this.far,this.clipSpaceNearZ===Qr.ZERO),ts(this.projectionMatrix,this.projectionMatrix,fe(1,-1,1)),Wt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},e.prototype.setOrthographic=function(t,n,r,i,a,o){var s;this.projectionMode=tt.ORTHOGRAPHIC,this.rright=n,this.left=t,this.top=r,this.bottom=i,this.near=a,this.far=o;var l=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),f=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,h=f-l,p=f+l,v=c+u,y=c-u;if(!((s=this.view)===null||s===void 0)&&s.enabled){var d=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h+=d*this.view.offsetX,p=h+d*this.view.width,v-=m*this.view.offsetY,y=v-m*this.view.height}return this.clipSpaceNearZ===Qr.NEGATIVE_ONE?_v(this.projectionMatrix,h,p,y,v,a,o):Av(this.projectionMatrix,h,p,y,v,a,o),ts(this.projectionMatrix,this.projectionMatrix,fe(1,-1,1)),Wt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},e.prototype.setPosition=function(t,n,r){n===void 0&&(n=this.position[1]),r===void 0&&(r=this.position[2]);var i=qe(t,n,r);return this._setPosition(i),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},e.prototype.setFocalPoint=function(t,n,r){n===void 0&&(n=this.focalPoint[1]),r===void 0&&(r=this.focalPoint[2]);var i=fe(0,1,0);if(this.focalPoint=qe(t,n,r),this.trackingMode===ga.CINEMATIC){var a=Ph(J(),this.focalPoint,this.position);t=a[0],n=a[1],r=a[2];var o=rn(a),s=wt(Math.asin(n/o)),l=90+wt(Math.atan2(r,t)),u=he();Tv(u,u,ge(l)),Sv(u,u,ge(s)),i=St(J(),[0,1,0],u)}return Wt(this.matrix,Lv(he(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},e.prototype.getDistance=function(){return this.distance},e.prototype.getDistanceVector=function(){return this.distanceVector},e.prototype.setDistance=function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance=D.kEms&&t=Bn.kUnitType&&this.getType()<=Bn.kClampType},e}(),Nx=function(e){Q(t,e);function t(n){var r=e.call(this)||this;return r.colorSpace=n,r}return t.prototype.getType=function(){return Bn.kColorType},t.prototype.to=function(n){return this},t}(Os),Xt;(function(e){e[e.Constant=0]="Constant",e[e.LinearGradient=1]="LinearGradient",e[e.RadialGradient=2]="RadialGradient"})(Xt||(Xt={}));var Za=function(e){Q(t,e);function t(n,r){var i=e.call(this)||this;return i.type=n,i.value=r,i}return t.prototype.clone=function(){return new t(this.type,this.value)},t.prototype.buildCSSText=function(n,r,i){return i},t.prototype.getType=function(){return Bn.kColorType},t}(Os),st=function(e){Q(t,e);function t(n){var r=e.call(this)||this;return r.value=n,r}return t.prototype.clone=function(){return new t(this.value)},t.prototype.getType=function(){return Bn.kKeywordType},t.prototype.buildCSSText=function(n,r,i){return i+this.value},t}(Os),Ox=je(function(e){return e===void 0&&(e=""),e.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})}),Kh=function(e){return e.split("").map(function(t,n){return t.toUpperCase()===t?"".concat(n!==0?"-":"").concat(t.toLowerCase()):t}).join("")};function Rx(e){if(!e)throw new Error}function Br(e){return typeof e=="function"}function _x(e){return typeof e=="symbol"}var Ax={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Mu=je(function(e){var t=Ox(e),n=Ax[t];return t=(n==null?void 0:n.alias)||t,t}),Lx=function(e,t){t===void 0&&(t="");var n="";return Number.isFinite(e)?(Rx(Number.isNaN(e)),n="NaN"):e>0?n="infinity":n="-infinity",n+=t},Su=function(e){return kx(Cx(e))},Le=function(e){Q(t,e);function t(n,r){r===void 0&&(r=D.kNumber);var i=e.call(this)||this,a;return typeof r=="string"?a=Tx(r):a=r,i.unit=a,i.value=n,i}return t.prototype.clone=function(){return new t(this.value,this.unit)},t.prototype.equals=function(n){var r=n;return this.value===r.value&&this.unit===r.unit},t.prototype.getType=function(){return Bn.kUnitType},t.prototype.convertTo=function(n){if(this.unit===n)return new t(this.value,this.unit);var r=Su(this.unit);if(r!==Su(n)||r===D.kUnknown)return null;var i=jh(this.unit)/jh(n);return new t(this.value*i,n)},t.prototype.buildCSSText=function(n,r,i){var a;switch(this.unit){case D.kUnknown:break;case D.kInteger:a=Number(this.value).toFixed(0);break;case D.kNumber:case D.kPercentage:case D.kEms:case D.kRems:case D.kPixels:case D.kDegrees:case D.kRadians:case D.kGradians:case D.kMilliseconds:case D.kSeconds:case D.kTurns:{var o=-999999,s=999999,l=this.value,u=Pu(this.unit);if(ls){var f=Pu(this.unit);!Number.isFinite(l)||Number.isNaN(l)?a=Lx(l,f):a=l+(f||"")}else a="".concat(l).concat(u)}}return i+=a,i},t}(Os),Ie=new Le(0,"px");new Le(1,"px");var sn=new Le(0,"deg"),Hf=function(e){Q(t,e);function t(n,r,i,a,o){a===void 0&&(a=1),o===void 0&&(o=!1);var s=e.call(this,"rgb")||this;return s.r=n,s.g=r,s.b=i,s.alpha=a,s.isNone=o,s}return t.prototype.clone=function(){return new t(this.r,this.g,this.b,this.alpha)},t.prototype.buildCSSText=function(n,r,i){return i+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},t}(Nx),ce=new st("unset"),Ix=new st("initial"),Dx=new st("inherit"),pl={"":ce,unset:ce,initial:Ix,inherit:Dx},Tu=function(e){return pl[e]||(pl[e]=new st(e)),pl[e]},Cu=new Hf(0,0,0,0,!0),e0=new Hf(0,0,0,0),bx=je(function(e,t,n,r){return new Hf(e,t,n,r)},function(e,t,n,r){return"rgba(".concat(e,",").concat(t,",").concat(n,",").concat(r,")")}),xe=function(e,t){return t===void 0&&(t=D.kNumber),new Le(e,t)},ss=new Le(50,"%"),ku;(function(e){e[e.Standard=0]="Standard"})(ku||(ku={}));var ai;(function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"})(ai||(ai={}));var t0={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new cr(0,0,0,0)},B;(function(e){e.COORDINATE="",e.COLOR="",e.PAINT="",e.NUMBER="",e.ANGLE="",e.OPACITY_VALUE="",e.SHADOW_BLUR="",e.LENGTH="",e.PERCENTAGE="",e.LENGTH_PERCENTAGE=" | ",e.LENGTH_PERCENTAGE_12="[ | ]{1,2}",e.LENGTH_PERCENTAGE_14="[ | ]{1,4}",e.LIST_OF_POINTS="",e.PATH="",e.FILTER="",e.Z_INDEX="",e.OFFSET_DISTANCE="",e.DEFINED_PATH="",e.MARKER="",e.TRANSFORM="",e.TRANSFORM_ORIGIN="",e.TEXT="",e.TEXT_TRANSFORM=""})(B||(B={}));function Fx(e){var t=e.type,n=e.value;return t==="hex"?"#".concat(n):t==="literal"?n:t==="rgb"?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}var Bx=function(){var e={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function n(L){throw new Error(t+": "+L)}function r(){var L=i();return t.length>0&&n("Invalid input not EOF"),L}function i(){return E(a)}function a(){return o("linear-gradient",e.linearGradient,l)||o("repeating-linear-gradient",e.repeatingLinearGradient,l)||o("radial-gradient",e.radialGradient,c)||o("repeating-radial-gradient",e.repeatingRadialGradient,c)||o("conic-gradient",e.conicGradient,c)}function o(L,H,$){return s(H,function(Te){var I=$();return I&&(z(e.comma)||n("Missing comma before color stops")),{type:L,orientation:I,colorStops:E(P)}})}function s(L,H){var $=z(L);if($){z(e.startCall)||n("Missing (");var Te=H($);return z(e.endCall)||n("Missing )"),Te}}function l(){return u()||f()}function u(){return A("directional",e.sideOrCorner,1)}function f(){return A("angular",e.angleValue,1)}function c(){var L,H=h(),$;return H&&(L=[],L.push(H),$=t,z(e.comma)&&(H=h(),H?L.push(H):t=$)),L}function h(){var L=p()||v();if(L)L.at=d();else{var H=y();if(H){L=H;var $=d();$&&(L.at=$)}else{var Te=m();Te&&(L={type:"default-radial",at:Te})}}return L}function p(){var L=A("shape",/^(circle)/i,0);return L&&(L.style=_()||y()),L}function v(){var L=A("shape",/^(ellipse)/i,0);return L&&(L.style=k()||y()),L}function y(){return A("extent-keyword",e.extentKeywords,1)}function d(){if(A("position",/^at/,0)){var L=m();return L||n("Missing positioning value"),L}}function m(){var L=g();if(L.x||L.y)return{type:"position",value:L}}function g(){return{x:k(),y:k()}}function E(L){var H=L(),$=[];if(H)for($.push(H);z(e.comma);)H=L(),H?$.push(H):n("One extra comma");return $}function P(){var L=w();return L||n("Expected color definition"),L.length=k(),L}function w(){return M()||T()||S()||x()}function x(){return A("literal",e.literalColor,0)}function M(){return A("hex",e.hexColor,1)}function S(){return s(e.rgbColor,function(){return{type:"rgb",value:E(C)}})}function T(){return s(e.rgbaColor,function(){return{type:"rgba",value:E(C)}})}function C(){return z(e.number)[1]}function k(){return A("%",e.percentageValue,1)||N()||_()}function N(){return A("position-keyword",e.positionKeywords,1)}function _(){return A("px",e.pixelValue,1)||A("em",e.emValue,1)}function A(L,H,$){var Te=z(H);if(Te)return{type:L,value:Te[$]}}function z(L){var H=/^[\n\r\t\s]+/.exec(t);H&&W(H[0].length);var $=L.exec(t);return $&&W($[0].length),$}function W(L){t=t.substring(L)}return function(L){return t=L,r()}}();function zx(e,t,n){var r=ge(n.value),i=0,a=0,o=i+e/2,s=a+t/2,l=Math.abs(e*Math.cos(r))+Math.abs(t*Math.sin(r)),u=o-Math.cos(r)*l/2,f=s-Math.sin(r)*l/2,c=o+Math.cos(r)*l/2,h=s+Math.sin(r)*l/2;return{x1:u,y1:f,x2:c,y2:h}}function Ux(e,t,n,r,i){var a=n.value,o=r.value;n.unit===D.kPercentage&&(a=n.value/100*e),r.unit===D.kPercentage&&(o=r.value/100*t);var s=Math.max(ut([0,0],[a,o]),ut([0,t],[a,o]),ut([e,t],[a,o]),ut([e,0],[a,o]));return i&&(i instanceof Le?s=i.value:i instanceof st&&(i.value==="closest-side"?s=Math.min(a,e-a,o,t-o):i.value==="farthest-side"?s=Math.max(a,e-a,o,t-o):i.value==="closest-corner"&&(s=Math.min(ut([0,0],[a,o]),ut([0,t],[a,o]),ut([e,t],[a,o]),ut([e,0],[a,o]))))),{x:a,y:o,r:s}}var Gx=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Hx=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Vx=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,n0=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function Wx(e){var t,n,r,i=e.length;e[i-1].length=(t=e[i-1].length)!==null&&t!==void 0?t:{type:"%",value:"100"},i>1&&(e[0].length=(n=e[0].length)!==null&&n!==void 0?n:{type:"%",value:"0"});for(var a=0,o=Number(e[0].length.value),s=1;s-1||e.indexOf("radial")>-1){var n=Bx(e);return n.map(function(s){var l=s.type,u=s.orientation,f=s.colorStops;Wx(f);var c=f.map(function(E){return{offset:xe(Number(E.length.value),"%"),color:Fx(E)}});if(l==="linear-gradient")return new Za(Xt.LinearGradient,{angle:u?Xx(u):sn,steps:c});if(l==="radial-gradient"&&(u||(u=[{type:"shape",value:"circle"}]),u[0].type==="shape"&&u[0].value==="circle")){var h=$x(u[0].at),p=h.cx,v=h.cy,y=void 0;if(u[0].style){var d=u[0].style,m=d.type,g=d.value;m==="extent-keyword"?y=Tu(g):y=xe(g,m)}return new Za(Xt.RadialGradient,{cx:p,cy:v,size:y,steps:c})}})}var r=e[0];if(e[1]==="("||e[2]==="("){if(r==="l"){var i=Gx.exec(e);if(i){var a=((t=i[2].match(n0))===null||t===void 0?void 0:t.map(function(s){return s.split(":")}))||[];return[new Za(Xt.LinearGradient,{angle:xe(parseFloat(i[1]),"deg"),steps:a.map(function(s){var l=F(s,2),u=l[0],f=l[1];return{offset:xe(Number(u)*100,"%"),color:f}})})]}}else if(r==="r"){var o=Kx(e);if(o)if($e(o))e=o;else return[new Za(Xt.RadialGradient,o)]}else if(r==="p")return qx(e)}});function Kx(e){var t,n=Hx.exec(e);if(n){var r=((t=n[4].match(n0))===null||t===void 0?void 0:t.map(function(i){return i.split(":")}))||[];return{cx:xe(50,"%"),cy:xe(50,"%"),steps:r.map(function(i){var a=F(i,2),o=a[0],s=a[1];return{offset:xe(Number(o)*100,"%"),color:s}})}}return null}function qx(e){var t=Vx.exec(e);if(t){var n=t[1],r=t[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;case"n":n="no-repeat";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}function xa(e){return e&&!!e.image}function ls(e){return e&&!U(e.r)&&!U(e.g)&&!U(e.b)}var Jr=je(function(e){if(xa(e))return X({repetition:"repeat"},e);if(U(e)&&(e=""),e==="transparent")return e0;e==="currentColor"&&(e="black");var t=jx(e);if(t)return t;var n=Ns(e),r=[0,0,0,0];return n!==null&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),bx.apply(void 0,Z([],F(r),!1))});function Qx(e,t){if(!(!ls(e)||!ls(t)))return[[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],function(n){var r=n.slice();if(r[3])for(var i=0;i<3;i++)r[i]=Math.round(ht(r[i],0,255));return r[3]=ht(r[3],0,1),"rgba(".concat(r.join(","),")")}]}function _a(e,t){if(U(t))return xe(0,"px");if(t="".concat(t).trim().toLowerCase(),isFinite(Number(t))){if("px".search(e)>=0)return xe(Number(t),"px");if("deg".search(e)>=0)return xe(Number(t),"deg")}var n=[];t=t.replace(e,function(i){return n.push(i),"U"+i});var r="U("+e.source+")";return n.map(function(i){return xe(Number(t.replace(new RegExp("U"+i,"g"),"").replace(new RegExp(r,"g"),"*0")),i)})[0]}var Zx=je(function(e){return _a(new RegExp("px","g"),e)});je(function(e){return _a(new RegExp("%","g"),e)});var oi=function(e){return Ft(e)||isFinite(Number(e))?xe(Number(e)||0,"px"):_a(new RegExp("px|%|em|rem","g"),e)},r0=je(function(e){return _a(new RegExp("deg|rad|grad|turn","g"),e)});function Jx(e,t,n,r,i){i===void 0&&(i=0);var a="",o=e.value||0,s=t.value||0,l=Su(e.unit),u=e.convertTo(l),f=t.convertTo(l);return u&&f?(o=u.value,s=f.value,a=Pu(e.unit)):(Le.isLength(e.unit)||Le.isLength(t.unit))&&(o=lt(e,i,n),s=lt(t,i,n),a="px"),[o,s,function(c){return r&&(c=Math.max(c,0)),c+a}]}function ft(e){var t=0;return e.unit===D.kDegrees?t=e.value:e.unit===D.kRadians?t=wt(Number(e.value)):e.unit===D.kTurns&&(t=hx(Number(e.value))),t}function vl(e,t){var n;return Array.isArray(e)?n=e.map(function(r){return Number(r)}):$e(e)?n=e.split(" ").map(function(r){return Number(r)}):Ft(e)&&(n=[e]),t===2?n.length===1?[n[0],n[0]]:[n[0],n[1]]:n.length===1?[n[0],n[0],n[0],n[0]]:n.length===2?[n[0],n[1],n[0],n[1]]:n.length===3?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function i0(e){return $e(e)?e.split(" ").map(function(t){return oi(t)}):e.map(function(t){return oi(t.toString())})}function lt(e,t,n){if(e.value===0)return 0;if(e.unit===D.kPixels)return Number(e.value);if(e.unit===D.kPercentage&&n){var r=n.nodeName===O.GROUP?n.getLocalBounds():n.geometry.contentBounds;return e.value/100*r.halfExtents[t]*2}return 0}var e2=function(e){return _a(/deg|rad|grad|turn|px|%/g,e)},t2=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function a0(e){if(e===void 0&&(e=""),e=e.toLowerCase().trim(),e==="none")return[];for(var t=/\s*([\w-]+)\(([^)]*)\)/g,n=[],r,i=0;r=t.exec(e);){if(r.index!==i)return[];if(i=r.index+r[0].length,t2.indexOf(r[1])>-1&&n.push({name:r[1],params:r[2].split(" ").map(function(a){return e2(a)||Jr(a)})}),t.lastIndex===e.length)return n}return[]}function o0(e){return e.toString()}var hr=je(function(e){return typeof e=="number"?xe(e):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(e)?xe(Number(e)):xe(0)});je(function(e){return $e(e)?e.split(" ").map(hr):e.map(hr)});function Vf(e,t){return[e,t,o0]}function Wf(e,t){return function(n,r){return[n,r,function(i){return o0(ht(i,e,t))}]}}function s0(e,t){if(e.length===t.length)return[e,t,function(n){return n}]}function Nu(e){return e.parsedStyle.path.totalLength===0&&(e.parsedStyle.path.totalLength=O1(e.parsedStyle.path.absolutePath)),e.parsedStyle.path.totalLength}function n2(e){for(var t=0;t0&&n.push(r),{polygons:t,polylines:n}}function us(e,t){return e[0]===t[0]&&e[1]===t[1]}function a2(e,t){for(var n=[],r=[],i=[],a=0;aMath.PI/2?Math.PI-u:u,f=f>Math.PI/2?Math.PI-f:f;var c={xExtra:Math.cos(l/2-u)*(t/2*(1/Math.sin(l/2)))-t/2||0,yExtra:Math.cos(f-l/2)*(t/2*(1/Math.sin(l/2)))-t/2||0};return c}function qh(e,t){return[t[0]+(t[0]-e[0]),t[1]+(t[1]-e[1])]}var Qh=function(e,t){var n=e.x*t.x+e.y*t.y,r=Math.sqrt((Math.pow(e.x,2)+Math.pow(e.y,2))*(Math.pow(t.x,2)+Math.pow(t.y,2))),i=e.x*t.y-e.y*t.x<0?-1:1,a=i*Math.acos(n/r);return a},Zh=function(e,t,n,r,i,a,o,s){t=Math.abs(t),n=Math.abs(n),r=Fv(r,360);var l=ge(r);if(e.x===o.x&&e.y===o.y)return{x:e.x,y:e.y,ellipticalArcAngle:0};if(t===0||n===0)return{x:0,y:0,ellipticalArcAngle:0};var u=(e.x-o.x)/2,f=(e.y-o.y)/2,c={x:Math.cos(l)*u+Math.sin(l)*f,y:-Math.sin(l)*u+Math.cos(l)*f},h=Math.pow(c.x,2)/Math.pow(t,2)+Math.pow(c.y,2)/Math.pow(n,2);h>1&&(t=Math.sqrt(h)*t,n=Math.sqrt(h)*n);var p=Math.pow(t,2)*Math.pow(n,2)-Math.pow(t,2)*Math.pow(c.y,2)-Math.pow(n,2)*Math.pow(c.x,2),v=Math.pow(t,2)*Math.pow(c.y,2)+Math.pow(n,2)*Math.pow(c.x,2),y=p/v;y=y<0?0:y;var d=(i!==a?1:-1)*Math.sqrt(y),m={x:d*(t*c.y/n),y:d*(-(n*c.x)/t)},g={x:Math.cos(l)*m.x-Math.sin(l)*m.y+(e.x+o.x)/2,y:Math.sin(l)*m.x+Math.cos(l)*m.y+(e.y+o.y)/2},E={x:(c.x-m.x)/t,y:(c.y-m.y)/n},P=Qh({x:1,y:0},E),w={x:(-c.x-m.x)/t,y:(-c.y-m.y)/n},x=Qh(E,w);!a&&x>0?x-=2*Math.PI:a&&x<0&&(x+=2*Math.PI),x%=2*Math.PI;var M=P+x*s,S=t*Math.cos(M),T=n*Math.sin(M),C={x:Math.cos(l)*S-Math.sin(l)*T+g.x,y:Math.sin(l)*S+Math.cos(l)*T+g.y,ellipticalArcStartAngle:P,ellipticalArcEndAngle:P+x,ellipticalArcAngle:M,ellipticalArcCenter:g,resultantRx:t,resultantRy:n};return C};function o2(e){for(var t=[],n=null,r=null,i=null,a=0,o=e.length,s=0;s1&&(n*=Math.sqrt(p),r*=Math.sqrt(p));var v=n*n*(h*h)+r*r*(c*c),y=v?Math.sqrt((n*n*(r*r)-v)/v):1;a===o&&(y*=-1),isNaN(y)&&(y=0);var d=r?y*n*h/r:0,m=n?y*-r*c/n:0,g=(s+u)/2+Math.cos(i)*d-Math.sin(i)*m,E=(l+f)/2+Math.sin(i)*d+Math.cos(i)*m,P=[(c-d)/n,(h-m)/r],w=[(-1*c-d)/n,(-1*h-m)/r],x=ed([1,0],P),M=ed(P,w);return Ou(P,w)<=-1&&(M=Math.PI),Ou(P,w)>=1&&(M=0),o===0&&M>0&&(M=M-2*Math.PI),o===1&&M<0&&(M=M+2*Math.PI),{cx:g,cy:E,rx:us(e,[u,f])?0:n,ry:us(e,[u,f])?0:r,startAngle:x,endAngle:x+M,xRotation:i,arcFlag:a,sweepFlag:o}}var l0=function(e){if(e===""||Array.isArray(e)&&e.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var t;try{t=as(e)}catch{t=as(""),console.error("[g]: Invalid SVG Path definition: ".concat(e))}n2(t);var n=r2(t),r=i2(t),i=r.polygons,a=r.polylines,o=o2(t),s=a2(o,0),l=s.x,u=s.y,f=s.width,c=s.height;return{absolutePath:t,hasArc:n,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(l)?l:0,y:Number.isFinite(u)?u:0,width:Number.isFinite(f)?f:0,height:Number.isFinite(c)?c:0}}},l2=je(l0);function Ru(e){return $e(e)?l2(e):l0(e)}function u2(e,t,n){var r=e.curve,i=t.curve;(!r||r.length===0)&&(r=yu(e.absolutePath,!1),e.curve=r),(!i||i.length===0)&&(i=yu(t.absolutePath,!1),t.curve=i);var a=[r,i];r.length!==i.length&&(a=Wv(r,i));var o=_h(a[0])!==_h(a[1])?M1(a[0]):P1(a[0]);return[o,_1(a[1],o),function(s){return s}]}function u0(e,t){var n;$e(e)?n=e.split(" ").map(function(f){var c=F(f.split(","),2),h=c[0],p=c[1];return[Number(h),Number(p)]}):n=e;var r=[],i=0,a,o,s=rx(n);n.forEach(function(f,c){n[c+1]&&(a=[0,0],a[0]=i/s,o=Kv(f[0],f[1],n[c+1][0],n[c+1][1]),i+=o,a[1]=i/s,r.push(a))});var l=Math.min.apply(Math,Z([],F(n.map(function(f){return f[0]})),!1)),u=Math.min.apply(Math,Z([],F(n.map(function(f){return f[1]})),!1));return t&&(t.parsedStyle.defX=l,t.parsedStyle.defY=u),{points:n,totalLength:s,segments:r}}function f2(e,t){return[e.points,t.points,function(n){return n}]}var Pe=null;function et(e){return function(t){var n=0;return e.map(function(r){return r===Pe?t[n++]:r})}}function Kn(e){return e}var _u={matrix:["NNNNNN",[Pe,Pe,0,0,Pe,Pe,0,0,0,0,1,0,Pe,Pe,0,1],Kn],matrix3d:["NNNNNNNNNNNNNNNN",Kn],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",et([Pe,Pe,new Le(1)]),Kn],scalex:["N",et([Pe,new Le(1),new Le(1)]),et([Pe,new Le(1)])],scaley:["N",et([new Le(1),Pe,new Le(1)]),et([new Le(1),Pe])],scalez:["N",et([new Le(1),new Le(1),Pe])],scale3d:["NNN",Kn],skew:["Aa",null,Kn],skewx:["A",null,et([Pe,sn])],skewy:["A",null,et([sn,Pe])],translate:["Tt",et([Pe,Pe,Ie]),Kn],translatex:["T",et([Pe,Ie,Ie]),et([Pe,Ie])],translatey:["T",et([Ie,Pe,Ie]),et([Ie,Pe])],translatez:["L",et([Ie,Ie,Pe])],translate3d:["TTL",Kn]};function fs(e){if(e=(e||"none").toLowerCase().trim(),e==="none")return[];for(var t=/\s*(\w+)\(([^)]*)\)/g,n=[],r,i=0;r=t.exec(e);){if(r.index!==i)return[];i=r.index+r[0].length;var a=r[1],o=_u[a];if(!o)return[];var s=r[2].split(","),l=o[0];if(l.length"].calculator(null,null,{value:n.textTransform},t,null),n.clipPath&&this.runtime.CSSPropertySyntaxFactory[""].calculator("clipPath",o,n.clipPath,t,this.runtime),n.offsetPath&&this.runtime.CSSPropertySyntaxFactory[""].calculator("offsetPath",s,n.offsetPath,t,this.runtime),n.anchor&&(t.parsedStyle.anchor=vl(n.anchor,2)),n.transform&&(t.parsedStyle.transform=fs(n.transform)),n.transformOrigin&&(t.parsedStyle.transformOrigin=f0(n.transformOrigin)),n.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[""].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[""].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[""].calculator("",n.markerMid,n.markerMid,null,null)),((t.nodeName===O.CIRCLE||t.nodeName===O.ELLIPSE)&&(!U(n.cx)||!U(n.cy))||(t.nodeName===O.RECT||t.nodeName===O.IMAGE||t.nodeName===O.GROUP||t.nodeName===O.HTML||t.nodeName===O.TEXT||t.nodeName===O.MESH)&&(!U(n.x)||!U(n.y)||!U(n.z))||t.nodeName===O.LINE&&(!U(n.x1)||!U(n.y1)||!U(n.z1)||!U(n.x2)||!U(n.y2)||!U(n.z2)))&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(t,a),U(n.zIndex)||this.runtime.CSSPropertySyntaxFactory[""].postProcessor(t,a),n.path&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(t,a),n.points&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(t,a),U(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory[""].postProcessor(t,a),n.transform&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(t,a),l&&this.updateGeometry(t);return}var f=r.skipUpdateAttribute,c=r.skipParse,h=r.forceUpdateGeometry,p=r.usedAttributes,v=h,y=Object.keys(n);y.forEach(function(d){var m;f||(t.attributes[d]=n[d]),!v&&(!((m=hn[d])===null||m===void 0)&&m.l)&&(v=!0)}),c||y.forEach(function(d){t.computedStyle[d]=i.parseProperty(d,t.attributes[d],t)}),p!=null&&p.length&&(y=Array.from(new Set(y.concat(p)))),y.forEach(function(d){d in t.computedStyle&&(t.parsedStyle[d]=i.computeProperty(d,t.computedStyle[d],t))}),v&&this.updateGeometry(t),y.forEach(function(d){d in t.parsedStyle&&i.postProcessProperty(d,t,y)}),this.runtime.enableCSSParsing&&t.children.length&&y.forEach(function(d){d in t.parsedStyle&&i.isPropertyInheritable(d)&&t.children.forEach(function(m){m.internalSetAttribute(d,null,{skipUpdateAttribute:!0,skipParse:!0})})})},e.prototype.parseProperty=function(t,n,r){var i=hn[t],a=n;if((n===""||U(n))&&(n="unset"),n==="unset"||n==="initial"||n==="inherit")a=Tu(n);else if(i){var o=i.k,s=i.syntax,l=s&&this.getPropertySyntax(s);o&&o.indexOf(n)>-1?a=Tu(n):l&&l.parser&&(a=l.parser(n,r))}return a},e.prototype.computeProperty=function(t,n,r){var i=hn[t],a=r.id==="g-root",o=n;if(i){var s=i.syntax,l=i.inh,u=i.d;if(n instanceof st){var f=n.value;if(f==="unset"&&(l&&!a?f="inherit":f="initial"),f==="initial")U(u)||(n=this.parseProperty(t,Br(u)?u(r.nodeName):u,r));else if(f==="inherit"){var c=this.tryToResolveProperty(r,t,{inherited:!0});if(U(c)){this.addUnresolveProperty(r,t);return}else return c}}var h=s&&this.getPropertySyntax(s);if(h&&h.calculator){var p=r.parsedStyle[t];o=h.calculator(t,p,n,r,this.runtime)}else n instanceof st?o=n.value:o=n}return o},e.prototype.postProcessProperty=function(t,n,r){var i=hn[t];if(i&&i.syntax){var a=i.syntax&&this.getPropertySyntax(i.syntax),o=a;o&&o.postProcessor&&o.postProcessor(n,r)}},e.prototype.addUnresolveProperty=function(t,n){var r=Rr.get(t);r||(Rr.set(t,[]),r=Rr.get(t)),r.indexOf(n)===-1&&r.push(n)},e.prototype.tryToResolveProperty=function(t,n,r){r===void 0&&(r={});var i=r.inherited;if(i&&t.parentElement&&E2(t.parentElement,n)){var a=t.parentElement.parsedStyle[n];return a==="unset"||a==="initial"||a==="inherit"?void 0:a}},e.prototype.recalc=function(t){var n=Rr.get(t);if(n&&n.length){var r={};n.forEach(function(i){r[i]=t.attributes[i]}),this.processProperties(t,r),Rr.delete(t)}},e.prototype.updateGeometry=function(t){var n=t.nodeName,r=this.runtime.geometryUpdaterFactory[n];if(r){var i=t.geometry;i.contentBounds||(i.contentBounds=new Oe),i.renderBounds||(i.renderBounds=new Oe);var a=t.parsedStyle,o=r.update(a,t),s=o.width,l=o.height,u=o.depth,f=u===void 0?0:u,c=o.offsetX,h=c===void 0?0:c,p=o.offsetY,v=p===void 0?0:p,y=o.offsetZ,d=y===void 0?0:y,m=[Math.abs(s)/2,Math.abs(l)/2,f/2],g=a,E=g.stroke,P=g.lineWidth,w=g.increasedLineWidthForHitTesting,x=g.shadowType,M=g.shadowColor,S=g.filter,T=S===void 0?[]:S,C=g.transformOrigin,k=a.anchor;n===O.TEXT?delete a.anchor:n===O.MESH&&(a.anchor[2]=.5);var N=[(1-(k&&k[0]||0)*2)*s/2+h,(1-(k&&k[1]||0)*2)*l/2+v,(1-(k&&k[2]||0)*2)*m[2]+d];i.contentBounds.update(N,m);var _=n===O.POLYLINE||n===O.POLYGON||n===O.PATH?Math.SQRT2:.5,A=E&&!E.isNone;if(A){var z=((P||0)+(w||0))*_;m[0]+=z,m[1]+=z}if(i.renderBounds.update(N,m),M&&x&&x!=="inner"){var W=i.renderBounds,L=W.min,H=W.max,$=a,Te=$.shadowBlur,I=$.shadowOffsetX,Y=$.shadowOffsetY,j=Te||0,ie=I||0,ue=Y||0,Re=L[0]-j+ie,mt=H[0]+j+ie,Bt=L[1]-j+ue,Rt=H[1]+j+ue;L[0]=Math.min(L[0],Re),H[0]=Math.max(H[0],mt),L[1]=Math.min(L[1],Bt),H[1]=Math.max(H[1],Rt),i.renderBounds.setMinMax(L,H)}T.forEach(function(Zf){var Jf=Zf.name,Ia=Zf.params;if(Jf==="blur"){var ec=Ia[0].value;i.renderBounds.update(i.renderBounds.center,_o(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[ec,ec,0]))}else if(Jf==="drop-shadow"){var tc=Ia[0].value,nc=Ia[1].value,Da=Ia[2].value,rc=i.renderBounds,$n=rc.min,jn=rc.max,U0=$n[0]-Da+tc,G0=jn[0]+Da+tc,H0=$n[1]-Da+nc,V0=jn[1]+Da+nc;$n[0]=Math.min($n[0],U0),jn[0]=Math.max(jn[0],G0),$n[1]=Math.min($n[1],H0),jn[1]=Math.max(jn[1],V0),i.renderBounds.setMinMax($n,jn)}}),k=a.anchor;var _t=s<0,La=l<0,Is=(_t?-1:1)*(C?lt(C[0],0,t):0),Ds=(La?-1:1)*(C?lt(C[1],1,t):0);Is=Is-(_t?-1:1)*(k&&k[0]||0)*i.contentBounds.halfExtents[0]*2,Ds=Ds-(La?-1:1)*(k&&k[1]||0)*i.contentBounds.halfExtents[1]*2,t.setOrigin(Is,Ds),this.runtime.sceneGraphService.dirtifyToRoot(t)}},e.prototype.isPropertyInheritable=function(t){var n=hn[t];return n?n.inh:!1},e}(),P2=function(){function e(){this.parser=r0,this.parserWithCSSDisabled=null,this.mixer=Vf}return e.prototype.calculator=function(t,n,r,i){return ft(r)},e}(),M2=function(){function e(){}return e.prototype.calculator=function(t,n,r,i,a){return r instanceof st&&(r=null),a.sceneGraphService.updateDisplayObjectDependency(t,n,r,i),t==="clipPath"&&i.forEach(function(o){o.childNodes.length===0&&a.sceneGraphService.dirtifyToRoot(o)}),r},e}(),S2=function(){function e(){this.parser=Jr,this.parserWithCSSDisabled=Jr,this.mixer=Qx}return e.prototype.calculator=function(t,n,r,i){return r instanceof st?r.value==="none"?Cu:e0:r},e}(),T2=function(){function e(){this.parser=a0}return e.prototype.calculator=function(t,n,r){return r instanceof st?[]:r},e}();function id(e){var t=e.parsedStyle.fontSize;return U(t)?null:t}var Xf=function(){function e(){this.parser=oi,this.parserWithCSSDisabled=null,this.mixer=Vf}return e.prototype.calculator=function(t,n,r,i,a){var o;if(Ft(r))return r;if(Le.isRelativeUnit(r.unit)){var s=a.styleValueRegistry;if(r.unit===D.kPercentage)return 0;if(r.unit===D.kEms){if(i.parentNode){var l=id(i.parentNode);if(l)return l*=r.value,l;s.addUnresolveProperty(i,t)}else s.addUnresolveProperty(i,t);return 0}else if(r.unit===D.kRems){if(!((o=i==null?void 0:i.ownerDocument)===null||o===void 0)&&o.documentElement){var l=id(i.ownerDocument.documentElement);if(l)return l*=r.value,l;s.addUnresolveProperty(i,t)}else s.addUnresolveProperty(i,t);return 0}}else return r.value},e}(),C2=function(){function e(){this.mixer=s0}return e.prototype.parser=function(t){var n=i0(Ft(t)?[t]:t),r;return n.length===1?r=[n[0],n[0]]:r=[n[0],n[1]],r},e.prototype.calculator=function(t,n,r){return r.map(function(i){return i.value})},e}(),k2=function(){function e(){this.mixer=s0}return e.prototype.parser=function(t){var n=i0(Ft(t)?[t]:t),r;return n.length===1?r=[n[0],n[0],n[0],n[0]]:n.length===2?r=[n[0],n[1],n[0],n[1]]:n.length===3?r=[n[0],n[1],n[2],n[1]]:r=[n[0],n[1],n[2],n[3]],r},e.prototype.calculator=function(t,n,r){return r.map(function(i){return i.value})},e}(),Ni=he();function $f(e,t){var n=t.parsedStyle.defX||0,r=t.parsedStyle.defY||0;return t.resetLocalTransform(),t.setLocalPosition(n,r),e.forEach(function(i){var a=i.t,o=i.d;if(a==="scale"){var s=(o==null?void 0:o.map(function(g){return g.value}))||[1,1];t.scaleLocal(s[0],s[1],1)}else if(a==="scalex"){var s=(o==null?void 0:o.map(function(E){return E.value}))||[1];t.scaleLocal(s[0],1,1)}else if(a==="scaley"){var s=(o==null?void 0:o.map(function(E){return E.value}))||[1];t.scaleLocal(1,s[0],1)}else if(a==="scalez"){var s=(o==null?void 0:o.map(function(E){return E.value}))||[1];t.scaleLocal(1,1,s[0])}else if(a==="scale3d"){var s=(o==null?void 0:o.map(function(E){return E.value}))||[1,1,1];t.scaleLocal(s[0],s[1],s[2])}else if(a==="translate"){var l=o||[Ie,Ie];t.translateLocal(l[0].value,l[1].value,0)}else if(a==="translatex"){var l=o||[Ie];t.translateLocal(l[0].value,0,0)}else if(a==="translatey"){var l=o||[Ie];t.translateLocal(0,l[0].value,0)}else if(a==="translatez"){var l=o||[Ie];t.translateLocal(0,0,l[0].value)}else if(a==="translate3d"){var l=o||[Ie,Ie,Ie];t.translateLocal(l[0].value,l[1].value,l[2].value)}else if(a==="rotate"){var u=o||[sn];t.rotateLocal(0,0,ft(u[0]))}else if(a==="rotatex"){var u=o||[sn];t.rotateLocal(ft(u[0]),0,0)}else if(a==="rotatey"){var u=o||[sn];t.rotateLocal(0,ft(u[0]),0)}else if(a==="rotatez"){var u=o||[sn];t.rotateLocal(0,0,ft(u[0]))}else if(a!=="rotate3d")if(a==="skew"){var f=(o==null?void 0:o.map(function(g){return g.value}))||[0,0];t.setLocalSkew(ge(f[0]),ge(f[1]))}else if(a==="skewx"){var f=(o==null?void 0:o.map(function(E){return E.value}))||[0];t.setLocalSkew(ge(f[0]),t.getLocalSkew()[1])}else if(a==="skewy"){var f=(o==null?void 0:o.map(function(E){return E.value}))||[0];t.setLocalSkew(t.getLocalSkew()[0],ge(f[0]))}else if(a==="matrix"){var c=F(o.map(function(g){return g.value}),6),h=c[0],p=c[1],v=c[2],y=c[3],d=c[4],m=c[5];t.setLocalTransform(du(Ni,h,p,0,0,v,y,0,0,0,0,1,0,d+n,m+r,0,1))}else a==="matrix3d"&&(du.apply(Fg,Z([Ni],F(o.map(function(g){return g.value})),!1)),Ni[12]+=n,Ni[13]+=r,t.setLocalTransform(Ni))}),t.getLocalTransform()}var N2=function(e){Q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.postProcessor=function(n,r){var i,a,o;switch(n.nodeName){case O.CIRCLE:case O.ELLIPSE:var s=n.parsedStyle,l=s.cx,u=s.cy,f=s.cz;U(l)||(i=l),U(u)||(a=u),U(f)||(o=f);break;case O.LINE:var c=n.parsedStyle,h=c.x1,p=c.x2,v=c.y1,y=c.y2,d=Math.min(h,p),m=Math.min(v,y);i=d,a=m,o=0;break;case O.RECT:case O.IMAGE:case O.GROUP:case O.HTML:case O.TEXT:case O.MESH:U(n.parsedStyle.x)||(i=n.parsedStyle.x),U(n.parsedStyle.y)||(a=n.parsedStyle.y),U(n.parsedStyle.z)||(o=n.parsedStyle.z);break}n.nodeName!==O.PATH&&n.nodeName!==O.POLYLINE&&n.nodeName!==O.POLYGON&&(n.parsedStyle.defX=i||0,n.parsedStyle.defY=a||0);var g=!U(i)||!U(a)||!U(o);if(g&&r.indexOf("transform")===-1){var E=n.parsedStyle.transform;if(E&&E.length)$f(E,n);else{var P=F(n.getLocalPosition(),3),w=P[0],x=P[1],M=P[2];n.setLocalPosition(U(i)?w:i,U(a)?x:a,U(o)?M:o)}}},t}(Xf),O2=function(){function e(){}return e.prototype.calculator=function(t,n,r,i){r instanceof st&&(r=null);var a=r==null?void 0:r.cloneNode(!0);return a&&(a.style.isMarker=!0),a},e}(),R2=function(){function e(){this.mixer=Vf,this.parser=hr,this.parserWithCSSDisabled=null}return e.prototype.calculator=function(t,n,r){return r.value},e}(),_2=function(){function e(){this.parser=hr,this.parserWithCSSDisabled=null,this.mixer=Wf(0,1)}return e.prototype.calculator=function(t,n,r){return r.value},e.prototype.postProcessor=function(t){var n=t.parsedStyle,r=n.offsetPath,i=n.offsetDistance;if(r){var a=r.nodeName;if(a===O.LINE||a===O.PATH||a===O.POLYLINE){var o=r.getPoint(i);o&&(t.parsedStyle.defX=o.x,t.parsedStyle.defY=o.y,t.setLocalPosition(o.x,o.y))}}},e}(),A2=function(){function e(){this.parser=hr,this.parserWithCSSDisabled=null,this.mixer=Wf(0,1)}return e.prototype.calculator=function(t,n,r){return r.value},e}(),L2=function(){function e(){this.parser=Ru,this.parserWithCSSDisabled=Ru,this.mixer=u2}return e.prototype.calculator=function(t,n,r){return r instanceof st&&r.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new cr(0,0,0,0)}:r},e.prototype.postProcessor=function(t,n){if(t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y,t.nodeName===O.PATH&&n.indexOf("transform")===-1){var r=t.parsedStyle,i=r.defX,a=i===void 0?0:i,o=r.defY,s=o===void 0?0:o;t.setLocalPosition(a,s)}},e}(),I2=function(){function e(){this.parser=u0,this.mixer=f2}return e.prototype.postProcessor=function(t,n){if((t.nodeName===O.POLYGON||t.nodeName===O.POLYLINE)&&n.indexOf("transform")===-1){var r=t.parsedStyle,i=r.defX,a=r.defY;t.setLocalPosition(i,a)}},e}(),D2=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mixer=Wf(0,1/0),n}return t}(Xf),b2=function(){function e(){}return e.prototype.calculator=function(t,n,r,i){return r instanceof st?r.value==="unset"?"":r.value:"".concat(r)},e.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},e}(),F2=function(){function e(){}return e.prototype.calculator=function(t,n,r,i){var a=i.getAttribute("text");if(a){var o=a;r.value==="capitalize"?o=a.charAt(0).toUpperCase()+a.slice(1):r.value==="lowercase"?o=a.toLowerCase():r.value==="uppercase"&&(o=a.toUpperCase()),i.parsedStyle.text=o}return r.value},e}(),xl={},B2=0;function z2(e,t){if(e){var n=typeof e=="string"?e:e.id||B2++;xl[n]&&xl[n].destroy(),xl[n]=t}}var Aa=typeof window<"u"&&typeof window.document<"u";function U2(e){return!!e.getAttribute}function G2(e,t){for(var n=0,r=e.length;n>>1;c0(e[i],t)<0?n=i+1:r=i}return n}function c0(e,t){var n=Number(e.parsedStyle.zIndex),r=Number(t.parsedStyle.zIndex);if(n===r){var i=e.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(e)-a.indexOf(t)}}return n-r}function h0(e){var t,n=e;do{var r=(t=n.parsedStyle)===null||t===void 0?void 0:t.clipPath;if(r)return n;n=n.parentElement}while(n!==null);return null}var ad="px";function H2(e,t,n){Aa&&e.style&&(e.style.width=t+ad,e.style.height=n+ad)}function d0(e,t){if(Aa)return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function V2(e){var t=d0(e,"width");return t==="auto"?e.offsetWidth:parseFloat(t)}function W2(e){var t=d0(e,"height");return t==="auto"?e.offsetHeight:parseFloat(t)}var Y2=1,X2={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Au=typeof performance=="object"&&performance.now?performance:Date;function Er(e,t,n){var r=!1,i=!1,a=!!t&&!t.isNone,o=!!n&&!n.isNone;return e==="visiblepainted"||e==="painted"||e==="auto"?(r=a,i=o):e==="visiblefill"||e==="fill"?r=!0:e==="visiblestroke"||e==="stroke"?i=!0:(e==="visible"||e==="all")&&(r=!0,i=!0),[r,i]}var $2=1,j2=function(){return $2++},qt=typeof self=="object"&&self.self==self?self:typeof global=="object"&&global.global==global?global:{},K2=Date.now(),q2=function(){return qt.performance&&typeof qt.performance.now=="function"?qt.performance.now():Date.now()-K2},bi={},od=Date.now(),Q2=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");var t=Date.now(),n=t-od,r=n>16?0:16-n,i=j2();return bi[i]=e,Object.keys(bi).length>1||setTimeout(function(){od=t;var a=bi;bi={},Object.keys(a).forEach(function(o){return a[o](q2())})},r),i},Z2=function(e){delete bi[e]},J2=["","webkit","moz","ms","o"],p0=function(e){return typeof e!="string"?Q2:e===""?qt.requestAnimationFrame:qt[e+"RequestAnimationFrame"]},eE=function(e){return typeof e!="string"?Z2:e===""?qt.cancelAnimationFrame:qt[e+"CancelAnimationFrame"]||qt[e+"CancelRequestAnimationFrame"]},tE=function(e,t){for(var n=0;e[n]!==void 0;){if(t(e[n]))return e[n];n=n+1}},v0=tE(J2,function(e){return!!p0(e)}),y0=p0(v0),m0=eE(v0);qt.requestAnimationFrame=y0;qt.cancelAnimationFrame=m0;var nE=function(){function e(){this.callbacks=[]}return e.prototype.getCallbacksNum=function(){return this.callbacks.length},e.prototype.tapPromise=function(t,n){this.callbacks.push(n)},e.prototype.promise=function(){for(var t=[],n=0;n=0;l--){var u=s[l].trim();!aE.test(u)&&iE.indexOf(u)<0&&(u='"'.concat(u,'"')),s[l]=u}return"".concat(r," ").concat(i," ").concat(a," ").concat(o," ").concat(s.join(","))}var sE=function(){function e(){this.parser=fs,this.parserWithCSSDisabled=fs,this.mixer=x2}return e.prototype.calculator=function(t,n,r,i){return r instanceof st?[]:r},e.prototype.postProcessor=function(t){var n=t.parsedStyle.transform;$f(n,t)},e}(),lE=function(){function e(){this.parser=f0}return e}(),uE=function(){function e(){this.parser=hr}return e.prototype.calculator=function(t,n,r,i){return r.value},e.prototype.postProcessor=function(t){if(t.parentNode){var n=t.parentNode,r=n.renderable,i=n.sortable;r&&(r.dirty=!0),i&&(i.dirty=!0,i.dirtyReason=ai.Z_INDEX_CHANGED)}},e}(),fE=function(){function e(){}return e.prototype.update=function(t,n){var r=t.r,i=r*2,a=r*2;return{width:i,height:a}},e}(),cE=function(){function e(){}return e.prototype.update=function(t,n){var r=t.rx,i=t.ry,a=r*2,o=i*2;return{width:a,height:o}},e}(),hE=function(){function e(){}return e.prototype.update=function(t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2,o=Math.min(n,i),s=Math.max(n,i),l=Math.min(r,a),u=Math.max(r,a),f=s-o,c=u-l;return{width:f,height:c}},e}(),dE=function(){function e(){}return e.prototype.update=function(t){var n=t.path,r=n.rect,i=r.width,a=r.height;return{width:i,height:a}},e}(),pE=function(){function e(){}return e.prototype.update=function(t){var n=t.points.points,r=Math.min.apply(Math,Z([],F(n.map(function(u){return u[0]})),!1)),i=Math.max.apply(Math,Z([],F(n.map(function(u){return u[0]})),!1)),a=Math.min.apply(Math,Z([],F(n.map(function(u){return u[1]})),!1)),o=Math.max.apply(Math,Z([],F(n.map(function(u){return u[1]})),!1)),s=i-r,l=o-a;return{width:s,height:l}},e}(),vE=function(){function e(){}return e.prototype.update=function(t,n){var r=t.img,i=t.width,a=i===void 0?0:i,o=t.height,s=o===void 0?0:o,l=a,u=s;return r&&!$e(r)&&(l||(l=r.width,t.width=l),u||(u=r.height,t.height=u)),{width:l,height:u}},e}(),yE=function(){function e(t){this.globalRuntime=t}return e.prototype.isReadyToMeasure=function(t,n){var r=t.text,i=t.textAlign,a=t.textBaseline,o=t.fontSize,s=t.fontStyle,l=t.fontWeight,u=t.fontVariant,f=t.lineWidth;return r&&o&&s&&l&&u&&i&&a&&!U(f)},e.prototype.update=function(t,n){var r,i,a=t.text,o=t.textAlign,s=t.lineWidth,l=t.textBaseline,u=t.dx,f=t.dy;if(!this.isReadyToMeasure(t,n))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var c=(((i=(r=n==null?void 0:n.ownerDocument)===null||r===void 0?void 0:r.defaultView)===null||i===void 0?void 0:i.getConfig())||{}).offscreenCanvas,h=this.globalRuntime.textService.measureText(a,t,c);t.metrics=h;var p=h.width,v=h.height,y=h.lineHeight,d=h.fontProperties,m=[p/2,v/2,0],g=[0,1],E=0;o==="center"||o==="middle"?(E=s/2,g=[.5,1]):(o==="right"||o==="end")&&(E=s,g=[1,1]);var P=0;return l==="middle"?P=m[1]:l==="top"||l==="hanging"?P=m[1]*2:l==="alphabetic"?P=this.globalRuntime.enableCSSParsing?y-d.ascent:0:(l==="bottom"||l==="ideographic")&&(P=0),u&&(E+=u),f&&(P+=f),t.anchor=[g[0],g[1],0],{width:m[0]*2,height:m[1]*2,offsetX:E,offsetY:P}},e}();function mE(e){return!!e.type}var Rs=function(){function e(t){this.eventPhase=e.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new De,this.page=new De,this.canvas=new De,this.viewport=new De,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),e.prototype.composedPath=function(){return this.manager&&(!this.path||this.path[0]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(e.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.prototype.stopPropagation=function(){this.propagationStopped=!0},e.prototype.initEvent=function(){},e.prototype.initUIEvent=function(){},e.prototype.clone=function(){throw new Error(le)},e}(),g0=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.client=new De,n.movement=new De,n.offset=new De,n.global=new De,n.screen=new De,n}return Object.defineProperty(t.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),t.prototype.getModifierState=function(n){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(n)},t.prototype.initMouseEvent=function(){throw new Error(le)},t}(Rs),Lu=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.width=0,n.height=0,n.isPrimary=!1,n}return t.prototype.getCoalescedEvents=function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]},t.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},t.prototype.clone=function(){return this.manager.clonePointerEvent(this)},t}(g0),Iu=function(e){Q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},t}(g0),He=function(e){Q(t,e);function t(n,r){var i=e.call(this,null)||this;return i.type=n,i.detail=r,Object.assign(i,r),i}return t}(Rs),sd=":",x0=function(){function e(){this.emitter=new Bf}return e.prototype.on=function(t,n,r){return this.addEventListener(t,n,r),this},e.prototype.addEventListener=function(t,n,r){var i=kh(r)&&r||Oo(r)&&r.capture,a=Oo(r)&&r.once,o=Br(n)?void 0:n,s=!1,l="";if(t.indexOf(sd)>-1){var u=F(t.split(sd),2),f=u[0],c=u[1];t=c,l=f,s=!0}if(t=i?"".concat(t,"capture"):t,n=Br(n)?n:n.handleEvent,s){var h=n;n=function(){for(var p,v=[],y=0;y0},t.prototype.isDefaultNamespace=function(n){throw new Error(le)},t.prototype.lookupNamespaceURI=function(n){throw new Error(le)},t.prototype.lookupPrefix=function(n){throw new Error(le)},t.prototype.normalize=function(){throw new Error(le)},t.prototype.isEqualNode=function(n){return this===n},t.prototype.isSameNode=function(n){return this.isEqualNode(n)},Object.defineProperty(t.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),t.prototype.compareDocumentPosition=function(n){var r;if(n===this)return 0;for(var i=n,a=this,o=[i],s=[a];(r=i.parentNode)!==null&&r!==void 0?r:a.parentNode;)i=i.parentNode?(o.push(i.parentNode),i.parentNode):i,a=a.parentNode?(s.push(a.parentNode),a.parentNode):a;if(i!==a)return t.DOCUMENT_POSITION_DISCONNECTED|t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|t.DOCUMENT_POSITION_PRECEDING;var l=o.length>s.length?o:s,u=l===o?s:o;if(l[l.length-u.length]===u[0])return l===o?t.DOCUMENT_POSITION_CONTAINED_BY|t.DOCUMENT_POSITION_FOLLOWING:t.DOCUMENT_POSITION_CONTAINS|t.DOCUMENT_POSITION_PRECEDING;for(var f=l.length-u.length,c=u.length-1;c>=0;c--){var h=u[c],p=l[f+c];if(p!==h){var v=h.parentNode.childNodes;return v.indexOf(h)0&&r;)r=r.parentNode,n--;return r},t.prototype.forEach=function(n,r){r===void 0&&(r=!1),n(this)||(r?this.childNodes.slice():this.childNodes).forEach(function(i){i.forEach(n)})},t.DOCUMENT_POSITION_DISCONNECTED=1,t.DOCUMENT_POSITION_PRECEDING=2,t.DOCUMENT_POSITION_FOLLOWING=4,t.DOCUMENT_POSITION_CONTAINS=8,t.DOCUMENT_POSITION_CONTAINED_BY=16,t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,t}(x0),gE=2048,xE=function(){function e(t,n){var r=this;this.globalRuntime=t,this.context=n,this.emitter=new Bf,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=he(),this.tmpVec3=J(),this.onPointerDown=function(i){var a=r.createPointerEvent(i);if(r.dispatchEvent(a,"pointerdown"),a.pointerType==="touch")r.dispatchEvent(a,"touchstart");else if(a.pointerType==="mouse"||a.pointerType==="pen"){var o=a.button===2;r.dispatchEvent(a,o?"rightdown":"mousedown")}var s=r.trackingData(i.pointerId);s.pressTargetsByButton[i.button]=a.composedPath(),r.freeEvent(a)},this.onPointerUp=function(i){var a,o=Au.now(),s=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(s,"pointerup"),s.pointerType==="touch")r.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var l=s.button===2;r.dispatchEvent(s,l?"rightup":"mouseup")}var u=r.trackingData(i.pointerId),f=r.findMountedTarget(u.pressTargetsByButton[i.button]),c=f;if(f&&!s.composedPath().includes(f)){for(var h=f;h&&!s.composedPath().includes(h);){if(s.currentTarget=h,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")r.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var l=s.button===2;r.notifyTarget(s,l?"rightupoutside":"mouseupoutside")}Fe.isNode(h)&&(h=h.parentNode)}delete u.pressTargetsByButton[i.button],c=h}if(c){var p=r.clonePointerEvent(s,"click");p.target=c,p.path=[],u.clicksByButton[i.button]||(u.clicksByButton[i.button]={clickCount:0,target:p.target,timeStamp:o});var v=u.clicksByButton[i.button];v.target===p.target&&o-v.timeStamp<200?++v.clickCount:v.clickCount=1,v.target=p.target,v.timeStamp=o,p.detail=v.clickCount,!((a=s.detail)===null||a===void 0)&&a.preventClick||(!r.context.config.useNativeClickEvent&&(p.pointerType==="mouse"||p.pointerType==="touch")&&r.dispatchEvent(p,"click"),r.dispatchEvent(p,"pointertap")),r.freeEvent(p)}r.freeEvent(s)},this.onPointerMove=function(i){var a=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),o=a.pointerType==="mouse"||a.pointerType==="pen",s=r.trackingData(i.pointerId),l=r.findMountedTarget(s.overTargets);if(s.overTargets&&l!==a.target){var u=i.type==="mousemove"?"mouseout":"pointerout",f=r.createPointerEvent(i,u,l||void 0);if(r.dispatchEvent(f,"pointerout"),o&&r.dispatchEvent(f,"mouseout"),!a.composedPath().includes(l)){var c=r.createPointerEvent(i,"pointerleave",l||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!a.composedPath().includes(c.target);)c.currentTarget=c.target,r.notifyTarget(c),o&&r.notifyTarget(c,"mouseleave"),Fe.isNode(c.target)&&(c.target=c.target.parentNode);r.freeEvent(c)}r.freeEvent(f)}if(l!==a.target){var h=i.type==="mousemove"?"mouseover":"pointerover",p=r.clonePointerEvent(a,h);r.dispatchEvent(p,"pointerover"),o&&r.dispatchEvent(p,"mouseover");for(var v=l&&Fe.isNode(l)&&l.parentNode;v&&v!==(Fe.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&v!==a.target;)v=v.parentNode;var y=!v||v===(Fe.isNode(r.rootTarget)&&r.rootTarget.parentNode);if(y){var d=r.clonePointerEvent(a,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==l&&d.target!==(Fe.isNode(r.rootTarget)&&r.rootTarget.parentNode);)d.currentTarget=d.target,r.notifyTarget(d),o&&r.notifyTarget(d,"mouseenter"),Fe.isNode(d.target)&&(d.target=d.target.parentNode);r.freeEvent(d)}r.freeEvent(p)}r.dispatchEvent(a,"pointermove"),a.pointerType==="touch"&&r.dispatchEvent(a,"touchmove"),o&&(r.dispatchEvent(a,"mousemove"),r.cursor=r.getCursor(a.target)),s.overTargets=a.composedPath(),r.freeEvent(a)},this.onPointerOut=function(i){var a=r.trackingData(i.pointerId);if(a.overTargets){var o=i.pointerType==="mouse"||i.pointerType==="pen",s=r.findMountedTarget(a.overTargets),l=r.createPointerEvent(i,"pointerout",s||void 0);r.dispatchEvent(l),o&&r.dispatchEvent(l,"mouseout");var u=r.createPointerEvent(i,"pointerleave",s||void 0);for(u.eventPhase=u.AT_TARGET;u.target&&u.target!==(Fe.isNode(r.rootTarget)&&r.rootTarget.parentNode);)u.currentTarget=u.target,r.notifyTarget(u),o&&r.notifyTarget(u,"mouseleave"),Fe.isNode(u.target)&&(u.target=u.target.parentNode);a.overTargets=null,r.freeEvent(l),r.freeEvent(u)}r.cursor=null},this.onPointerOver=function(i){var a=r.trackingData(i.pointerId),o=r.createPointerEvent(i),s=o.pointerType==="mouse"||o.pointerType==="pen";r.dispatchEvent(o,"pointerover"),s&&r.dispatchEvent(o,"mouseover"),o.pointerType==="mouse"&&(r.cursor=r.getCursor(o.target));var l=r.clonePointerEvent(o,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==(Fe.isNode(r.rootTarget)&&r.rootTarget.parentNode);)l.currentTarget=l.target,r.notifyTarget(l),s&&r.notifyTarget(l,"mouseenter"),Fe.isNode(l.target)&&(l.target=l.target.parentNode);a.overTargets=o.composedPath(),r.freeEvent(o),r.freeEvent(l)},this.onPointerUpOutside=function(i){var a=r.trackingData(i.pointerId),o=r.findMountedTarget(a.pressTargetsByButton[i.button]),s=r.createPointerEvent(i);if(o){for(var l=o;l;)s.currentTarget=l,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"||(s.pointerType==="mouse"||s.pointerType==="pen")&&r.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),Fe.isNode(l)&&(l=l.parentNode);delete a.pressTargetsByButton[i.button]}r.freeEvent(s)},this.onWheel=function(i){var a=r.createWheelEvent(i);r.dispatchEvent(a),r.freeEvent(a)},this.onClick=function(i){if(r.context.config.useNativeClickEvent){var a=r.createPointerEvent(i);r.dispatchEvent(a),r.freeEvent(a)}},this.onPointerCancel=function(i){var a=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(a),r.freeEvent(a)}}return e.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},e.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},e.prototype.client2Viewport=function(t){var n=this.context.contextService.getBoundingClientRect();return new De(t.x-((n==null?void 0:n.left)||0),t.y-((n==null?void 0:n.top)||0))},e.prototype.viewport2Client=function(t){var n=this.context.contextService.getBoundingClientRect();return new De(t.x+((n==null?void 0:n.left)||0),t.y+((n==null?void 0:n.top)||0))},e.prototype.viewport2Canvas=function(t){var n=t.x,r=t.y,i=this.rootTarget.defaultView,a=i.getCamera(),o=this.context.config,s=o.width,l=o.height,u=a.getPerspectiveInverse(),f=a.getWorldTransform(),c=We(this.tmpMatrix,f,u),h=Dt(this.tmpVec3,n/s*2-1,(1-r/l)*2-1,0);return St(h,h,c),new De(h[0],h[1])},e.prototype.canvas2Viewport=function(t){var n=this.rootTarget.defaultView,r=n.getCamera(),i=r.getPerspective(),a=r.getViewTransform(),o=We(this.tmpMatrix,i,a),s=Dt(this.tmpVec3,t.x,t.y,0);St(this.tmpVec3,this.tmpVec3,o);var l=this.context.config,u=l.width,f=l.height;return new De((s[0]+1)/2*u,(1-(s[1]+1)/2)*f)},e.prototype.setPickHandler=function(t){this.pickHandler=t},e.prototype.addEventMapping=function(t,n){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:n,priority:0}),this.mappingTable[t].sort(function(r,i){return r.priority-i.priority})},e.prototype.mapEvent=function(t){if(this.rootTarget){var n=this.mappingTable[t.type];if(n)for(var r=0,i=n.length;r=1;i--)if(t.currentTarget=r[i],this.notifyTarget(t,n),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,n),!(t.propagationStopped||t.propagationImmediatelyStopped)){var a=r.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var i=a+1;ia||r>o?null:this.pickHandler(t)||this.rootTarget||null},e.prototype.isNativeEventFromCanvas=function(t){var n,r=this.context.contextService.getDomElement(),i=(n=t.nativeEvent)===null||n===void 0?void 0:n.target;if(i){if(i===r)return!0;if(r&&r.contains)return r.contains(i)}return t.nativeEvent.composedPath?t.nativeEvent.composedPath().indexOf(r)>-1:!1},e.prototype.getExistedHTML=function(t){var n,r;if(t.nativeEvent.composedPath)try{for(var i=mn(t.nativeEvent.composedPath()),a=i.next();!a.done;a=i.next()){var o=a.value,s=this.globalRuntime.nativeHTMLMap.get(o);if(s)return s}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null},e.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},e.prototype.createPointerEvent=function(t,n,r,i){var a=this.allocateEvent(Lu);this.copyPointerData(t,a),this.copyMouseData(t,a),this.copyData(t,a),a.nativeEvent=t.nativeEvent,a.originalEvent=t;var o=this.getExistedHTML(a);return a.target=r??(o||this.isNativeEventFromCanvas(a)&&this.pickTarget(a)||i),typeof n=="string"&&(a.type=n),a},e.prototype.createWheelEvent=function(t){var n=this.allocateEvent(Iu);this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t;var r=this.getExistedHTML(n);return n.target=r||this.isNativeEventFromCanvas(n)&&this.pickTarget(n),n},e.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.prototype.cloneWheelEvent=function(t){var n=this.allocateEvent(Iu);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=t.type,n},e.prototype.clonePointerEvent=function(t,n){var r=this.allocateEvent(Lu);return r.nativeEvent=t.nativeEvent,r.originalEvent=t.originalEvent,this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.target=t.target,r.path=t.composedPath().slice(),r.type=n??r.type,r},e.prototype.copyPointerData=function(t,n){n.pointerId=t.pointerId,n.width=t.width,n.height=t.height,n.isPrimary=t.isPrimary,n.pointerType=t.pointerType,n.pressure=t.pressure,n.tangentialPressure=t.tangentialPressure,n.tiltX=t.tiltX,n.tiltY=t.tiltY,n.twist=t.twist},e.prototype.copyMouseData=function(t,n){n.altKey=t.altKey,n.button=t.button,n.buttons=t.buttons,n.ctrlKey=t.ctrlKey,n.metaKey=t.metaKey,n.shiftKey=t.shiftKey,n.client.copyFrom(t.client),n.movement.copyFrom(t.movement),n.canvas.copyFrom(t.canvas),n.screen.copyFrom(t.screen),n.global.copyFrom(t.global),n.offset.copyFrom(t.offset)},e.prototype.copyWheelData=function(t,n){n.deltaMode=t.deltaMode,n.deltaX=t.deltaX,n.deltaY=t.deltaY,n.deltaZ=t.deltaZ},e.prototype.copyData=function(t,n){n.isTrusted=t.isTrusted,n.timeStamp=Au.now(),n.type=t.type,n.detail=t.detail,n.view=t.view,n.page.copyFrom(t.page),n.viewport.copyFrom(t.viewport)},e.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var n=this.eventPool.get(t).pop()||new t(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n},e.prototype.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var n=t.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),this.eventPool.get(n).push(t)},e.prototype.notifyTarget=function(t,n){n=n??t.type;var r=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(n,"capture"):n;this.notifyListeners(t,r),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,n)},e.prototype.notifyListeners=function(t,n){var r=t.currentTarget.emitter,i=r._events[n];if(i)if("fn"in i)i.once&&r.removeListener(n,i.fn,void 0,!0),i.fn.call(t.currentTarget||i.context,t);else for(var a=0;a=0;r--){var i=t[r];if(i===this.rootTarget||Fe.isNode(i)&&i.parentNode===n)n=t[r];else break}return n},e.prototype.getCursor=function(t){for(var n=t;n;){var r=U2(n)&&n.getAttribute("cursor");if(r)return r;n=Fe.isNode(n)&&n.parentNode}},e}(),EE=function(){function e(){}return e.prototype.getOrCreateCanvas=function(t,n){if(this.canvas)return this.canvas;if(t||R.offscreenCanvas)this.canvas=t||R.offscreenCanvas,this.context=this.canvas.getContext("2d",n);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",n),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch{this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",n)}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.prototype.getOrCreateContext=function(t,n){return this.context?this.context:(this.getOrCreateCanvas(t,n),this.context)},e}(),dr;(function(e){e[e.CAMERA_CHANGED=0]="CAMERA_CHANGED",e[e.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",e[e.NONE=2]="NONE"})(dr||(dr={}));var wE=function(){function e(t,n){this.globalRuntime=t,this.context=n,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ke,initAsync:new nE,dirtycheck:new El,cull:new El,beginFrame:new Ke,beforeRender:new Ke,render:new Ke,afterRender:new Ke,endFrame:new Ke,destroy:new Ke,pick:new rE,pickSync:new El,pointerDown:new Ke,pointerUp:new Ke,pointerMove:new Ke,pointerOut:new Ke,pointerOver:new Ke,pointerWheel:new Ke,pointerCancel:new Ke,click:new Ke}}return e.prototype.init=function(t){var n=this,r=X(X({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(i){i.apply(r,n.globalRuntime)}),this.hooks.init.call(),this.hooks.initAsync.getCallbacksNum()===0?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){n.inited=!0,t()})},e.prototype.getStats=function(){return this.stats},e.prototype.disableDirtyRectangleRendering=function(){var t=this.context.config.renderer,n=t.getConfig().enableDirtyRectangleRendering;return!n||this.context.renderingContext.renderReasons.has(dr.CAMERA_CHANGED)},e.prototype.render=function(t,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited&&(this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(),i.renderListCurrentFrame.forEach(function(a){r.hooks.beforeRender.call(a),r.hooks.render.call(a),r.hooks.afterRender.call(a)}),this.hooks.endFrame.call(),i.renderListCurrentFrame=[],i.renderReasons.clear(),n())},e.prototype.renderDisplayObject=function(t,n,r){var i=this,a=n.renderer.getConfig(),o=a.enableDirtyCheck,s=a.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var l=o?this.hooks.dirtycheck.call(t):t;if(l){var u=s?this.hooks.cull.call(l,this.context.camera):l;u&&(this.stats.rendered++,r.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var f=t.sortable;f.dirty&&(this.sort(t,f),f.dirty=!1,f.dirtyChildren=[],f.dirtyReason=void 0),(f.sorted||t.childNodes).forEach(function(c){i.renderDisplayObject(c,n,r)})},e.prototype.sort=function(t,n){n.sorted&&n.dirtyReason!==ai.Z_INDEX_CHANGED?n.dirtyChildren.forEach(function(r){var i=t.childNodes.indexOf(r);if(i===-1){var a=n.sorted.indexOf(r);a>=0&&n.sorted.splice(a,1)}else if(n.sorted.length===0)n.sorted.push(r);else{var o=G2(n.sorted,r);n.sorted.splice(o,0,r)}}):n.sorted=t.childNodes.slice().sort(c0)},e.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},e.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(dr.DISPLAY_OBJECT_CHANGED)},e}(),PE=/\[\s*(.*)=(.*)\s*\]/,ME=function(){function e(){}return e.prototype.selectOne=function(t,n){var r=this;if(t.startsWith("."))return n.find(function(s){return((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.find(function(s){return s.id===r.getIdOrClassname(t)});if(t.startsWith("[")){var i=this.getAttribute(t),a=i.name,o=i.value;return a?n.find(function(s){return n!==s&&(a==="name"?s.name===o:r.attributeToString(s,a)===o)}):null}else return n.find(function(s){return n!==s&&s.nodeName===t})},e.prototype.selectAll=function(t,n){var r=this;if(t.startsWith("."))return n.findAll(function(s){return n!==s&&((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.findAll(function(s){return n!==s&&s.id===r.getIdOrClassname(t)});if(t.startsWith("[")){var i=this.getAttribute(t),a=i.name,o=i.value;return a?n.findAll(function(s){return n!==s&&(a==="name"?s.name===o:r.attributeToString(s,a)===o)}):[]}else return n.findAll(function(s){return n!==s&&s.nodeName===t})},e.prototype.is=function(t,n){if(t.startsWith("."))return n.className===this.getIdOrClassname(t);if(t.startsWith("#"))return n.id===this.getIdOrClassname(t);if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i==="name"?n.name===a:this.attributeToString(n,i)===a}else return n.nodeName===t},e.prototype.getIdOrClassname=function(t){return t.substring(1)},e.prototype.getAttribute=function(t){var n=t.match(PE),r="",i="";return n&&n.length>2&&(r=n[1].replace(/"/g,""),i=n[2].replace(/"/g,"")),{name:r,value:i}},e.prototype.attributeToString=function(t,n){if(!t.getAttribute)return"";var r=t.getAttribute(n);return U(r)?"":r.toString?r.toString():""},e}(),pr=function(e){Q(t,e);function t(n,r,i,a,o,s,l,u){var f=e.call(this,null)||this;return f.relatedNode=r,f.prevValue=i,f.newValue=a,f.attrName=o,f.attrChange=s,f.prevParsedValue=l,f.newParsedValue=u,f.type=n,f}return t.ADDITION=2,t.MODIFICATION=1,t.REMOVAL=3,t}(Rs),ee;(function(e){e.REPARENT="reparent",e.DESTROY="destroy",e.ATTR_MODIFIED="DOMAttrModified",e.INSERTED="DOMNodeInserted",e.REMOVED="removed",e.MOUNTED="DOMNodeInsertedIntoDocument",e.UNMOUNTED="DOMNodeRemovedFromDocument",e.BOUNDS_CHANGED="bounds-changed",e.CULLED="culled"})(ee||(ee={}));function ld(e){var t=e.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}var SE=new pr(ee.REPARENT,null,"","","",0,"",""),TE=function(){function e(t){var n=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new He(ee.BOUNDS_CHANGED),this.rotate=function(){var r=Ce();return function(i,a,o,s){o===void 0&&(o=0),s===void 0&&(s=0),typeof a=="number"&&(a=fe(a,o,s));var l=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.rotateLocal(i,a);else{var u=Ce();ja(u,a[0],a[1],a[2]);var f=n.getRotation(i),c=n.getRotation(i.parentNode);Ka(r,c),sl(r,r),An(u,r,u),An(l.localRotation,u,f),is(l.localRotation,l.localRotation),n.dirtifyLocal(i,l)}}}(),this.rotateLocal=function(){var r=Ce();return function(i,a,o,s){o===void 0&&(o=0),s===void 0&&(s=0),typeof a=="number"&&(a=fe(a,o,s));var l=i.transformable;ja(r,a[0],a[1],a[2]),Sh(l.localRotation,l.localRotation,r),n.dirtifyLocal(i,l)}}(),this.setEulerAngles=function(){var r=Ce();return function(i,a,o,s){o===void 0&&(o=0),s===void 0&&(s=0),typeof a=="number"&&(a=fe(a,o,s));var l=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.setLocalEulerAngles(i,a);else{ja(l.localRotation,a[0],a[1],a[2]);var u=n.getRotation(i.parentNode);Ka(r,sl(Ce(),u)),Sh(l.localRotation,l.localRotation,r),n.dirtifyLocal(i,l)}}}(),this.translateLocal=function(){return function(r,i,a,o){a===void 0&&(a=0),o===void 0&&(o=0),typeof i=="number"&&(i=fe(i,a,o));var s=r.transformable;Ci(i,J())||(Gg(i,i,s.localRotation),Kr(s.localPosition,s.localPosition,i),n.dirtifyLocal(r,s))}}(),this.setPosition=function(){var r=he(),i=J();return function(a,o){var s=a.transformable;if(i[0]=o[0],i[1]=o[1],i[2]=o[2]||0,!Ci(n.getPosition(a),i)){if(rt(s.position,i),a.parentNode===null||!a.parentNode.transformable)rt(s.localPosition,i);else{var l=a.parentNode.transformable;fr(r,l.worldTransform),Wt(r,r),St(s.localPosition,i,r)}n.dirtifyLocal(a,s)}}}(),this.setLocalPosition=function(){var r=J();return function(i,a){var o=i.transformable;r[0]=a[0],r[1]=a[1],r[2]=a[2]||0,!Ci(o.localPosition,r)&&(rt(o.localPosition,r),n.dirtifyLocal(i,o))}}(),this.translate=function(){var r=J(),i=J(),a=J();return function(o,s,l,u){l===void 0&&(l=0),u===void 0&&(u=0),typeof s=="number"&&(s=Dt(i,s,l,u)),!Ci(s,r)&&(Kr(a,n.getPosition(o),s),n.setPosition(o,a))}}(),this.setRotation=function(){var r=Ce();return function(i,a,o,s,l){var u=i.transformable;if(typeof a=="number"&&(a=ll(a,o,s,l)),i.parentNode===null||!i.parentNode.transformable)n.setLocalRotation(i,a);else{var f=n.getRotation(i.parentNode);Ka(r,f),sl(r,r),An(u.localRotation,r,a),is(u.localRotation,u.localRotation),n.dirtifyLocal(i,u)}}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var r=he(),i=J(),a=ll(0,0,0,1);return function(o){var s=o.localSkew[0]!==0||o.localSkew[1]!==0;if(s){if(Qi(o.localTransform,o.localRotation,o.localPosition,fe(1,1,1),o.origin),o.localSkew[0]!==0||o.localSkew[1]!==0){var l=Oa(r);l[4]=Math.tan(o.localSkew[0]),l[1]=Math.tan(o.localSkew[1]),We(o.localTransform,o.localTransform,l)}var u=Qi(r,a,i,o.localScale,o.origin);We(o.localTransform,o.localTransform,u)}else Qi(o.localTransform,o.localRotation,o.localPosition,o.localScale,o.origin)}}()}return e.prototype.matches=function(t,n){return this.runtime.sceneGraphSelector.is(t,n)},e.prototype.querySelector=function(t,n){return this.runtime.sceneGraphSelector.selectOne(t,n)},e.prototype.querySelectorAll=function(t,n){return this.runtime.sceneGraphSelector.selectAll(t,n)},e.prototype.attach=function(t,n,r){var i,a,o=!1;t.parentNode&&(o=t.parentNode!==n,this.detach(t)),t.parentNode=n,U(r)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(r,0,t);var s=n.sortable;(!((i=s==null?void 0:s.sorted)===null||i===void 0)&&i.length||!((a=t.style)===null||a===void 0)&&a.zIndex)&&(s.dirtyChildren.indexOf(t)===-1&&s.dirtyChildren.push(t),s.dirty=!0,s.dirtyReason=ai.ADDED);var l=t.transformable;l&&this.dirtifyWorld(t,l),l.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(SE)},e.prototype.detach=function(t){var n,r;if(t.parentNode){var i=t.transformable,a=t.parentNode.sortable;(!((n=a==null?void 0:a.sorted)===null||n===void 0)&&n.length||!((r=t.style)===null||r===void 0)&&r.zIndex)&&(a.dirtyChildren.indexOf(t)===-1&&a.dirtyChildren.push(t),a.dirty=!0,a.dirtyReason=ai.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),i&&this.dirtifyWorld(t,i),t.parentNode=null}},e.prototype.getOrigin=function(t){return t.transformable.origin},e.prototype.setOrigin=function(t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=0),typeof n=="number"&&(n=[n,r,i]);var a=t.transformable;if(!(n[0]===a.origin[0]&&n[1]===a.origin[1]&&n[2]===a.origin[2])){var o=a.origin;o[0]=n[0],o[1]=n[1],o[2]=n[2]||0,this.dirtifyLocal(t,a)}},e.prototype.setLocalEulerAngles=function(t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=0),typeof n=="number"&&(n=fe(n,r,i));var a=t.transformable;ja(a.localRotation,n[0],n[1],n[2]),this.dirtifyLocal(t,a)},e.prototype.scaleLocal=function(t,n){var r=t.transformable;Bg(r.localScale,r.localScale,fe(n[0],n[1],n[2]||1)),this.dirtifyLocal(t,r)},e.prototype.setLocalScale=function(t,n){var r=t.transformable,i=fe(n[0],n[1],n[2]||r.localScale[2]);Ci(i,r.localScale)||(rt(r.localScale,i),this.dirtifyLocal(t,r))},e.prototype.setLocalRotation=function(t,n,r,i,a){typeof n=="number"&&(n=ll(n,r,i,a));var o=t.transformable;Ka(o.localRotation,n),this.dirtifyLocal(t,o)},e.prototype.setLocalSkew=function(t,n,r){typeof n=="number"&&(n=$g(n,r));var i=t.transformable;jg(i.localSkew,n),this.dirtifyLocal(t,i)},e.prototype.dirtifyLocal=function(t,n){n.localDirtyFlag||(n.localDirtyFlag=!0,n.dirtyFlag||this.dirtifyWorld(t,n))},e.prototype.dirtifyWorld=function(t,n){n.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,n),this.dirtifyToRoot(t,!0)},e.prototype.triggerPendingEvents=function(){var t=this,n=new Set,r=function(i,a){i.isConnected&&!n.has(i.entity)&&(t.boundsChangedEvent.detail=a,t.boundsChangedEvent.target=i,i.isMutationObserved?i.dispatchEvent(t.boundsChangedEvent):i.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),n.add(i.entity))};this.pendingEvents.forEach(function(i){var a=F(i,2),o=a[0],s=a[1];s.affectChildren?o.forEach(function(l){r(l,s)}):r(o,s)}),this.clearPendingEvents(),n.clear()},e.prototype.clearPendingEvents=function(){this.pendingEvents=[]},e.prototype.dirtifyToRoot=function(t,n){n===void 0&&(n=!1);var r=t;for(r.renderable&&(r.renderable.dirty=!0);r;)ld(r),r=r.parentNode;n&&t.forEach(function(i){ld(i)}),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:n}])},e.prototype.updateDisplayObjectDependency=function(t,n,r,i){if(n&&n!==r){var a=this.displayObjectDependencyMap.get(n);if(a&&a[t]){var o=a[t].indexOf(i);a[t].splice(o,1)}}if(r){var s=this.displayObjectDependencyMap.get(r);s||(this.displayObjectDependencyMap.set(r,{}),s=this.displayObjectDependencyMap.get(r)),s[t]||(s[t]=[]),s[t].push(i)}},e.prototype.informDependentDisplayObjects=function(t){var n=this,r=this.displayObjectDependencyMap.get(t);r&&Object.keys(r).forEach(function(i){r[i].forEach(function(a){n.dirtifyToRoot(a,!0),a.dispatchEvent(new pr(ee.ATTR_MODIFIED,a,n,n,i,pr.MODIFICATION,n,n)),a.isCustomElement&&a.isConnected&&a.attributeChangedCallback&&a.attributeChangedCallback(i,n,n)})})},e.prototype.getPosition=function(t){var n=t.transformable;return ns(n.position,this.getWorldTransform(t,n))},e.prototype.getRotation=function(t){var n=t.transformable;return rs(n.rotation,this.getWorldTransform(t,n))},e.prototype.getScale=function(t){var n=t.transformable;return ii(n.scaling,this.getWorldTransform(t,n))},e.prototype.getWorldTransform=function(t,n){return n===void 0&&(n=t.transformable),!n.localDirtyFlag&&!n.dirtyFlag||(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,n)),n.worldTransform},e.prototype.getLocalPosition=function(t){return t.transformable.localPosition},e.prototype.getLocalRotation=function(t){return t.transformable.localRotation},e.prototype.getLocalScale=function(t){return t.transformable.localScale},e.prototype.getLocalSkew=function(t){return t.transformable.localSkew},e.prototype.getLocalTransform=function(t){var n=t.transformable;return n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.localTransform},e.prototype.setLocalTransform=function(t,n){var r=ns(J(),n),i=rs(Ce(),n),a=ii(J(),n);this.setLocalScale(t,a),this.setLocalPosition(t,r),this.setLocalRotation(t,i)},e.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},e.prototype.getTransformedGeometryBounds=function(t,n,r){n===void 0&&(n=!1);var i=this.getGeometryBounds(t,n);if(Oe.isEmpty(i))return null;var a=r||new Oe;return a.setFromTransformedAABB(i,this.getWorldTransform(t)),a},e.prototype.getGeometryBounds=function(t,n){n===void 0&&(n=!1);var r=t.geometry,i=n?r.renderBounds:r.contentBounds||null;return i||new Oe},e.prototype.getBounds=function(t,n){var r=this;n===void 0&&(n=!1);var i=t.renderable;if(!i.boundsDirty&&!n&&i.bounds)return i.bounds;if(!i.renderBoundsDirty&&n&&i.renderBounds)return i.renderBounds;var a=n?i.renderBounds:i.bounds,o=this.getTransformedGeometryBounds(t,n,a),s=t.childNodes;if(s.forEach(function(f){var c=r.getBounds(f,n);c&&(o?o.add(c):(o=a||new Oe,o.update(c.center,c.halfExtents)))}),n){var l=h0(t);if(l){var u=l.parsedStyle.clipPath.getBounds(n);o?u&&(o=u.intersection(o)):o=u}}return o||(o=new Oe),o&&(n?i.renderBounds=o:i.bounds=o),n?i.renderBoundsDirty=!1:i.boundsDirty=!1,o},e.prototype.getLocalBounds=function(t){if(t.parentNode){var n=he();t.parentNode.transformable&&(n=Wt(he(),this.getWorldTransform(t.parentNode)));var r=this.getBounds(t);if(!Oe.isEmpty(r)){var i=new Oe;return i.setFromTransformedAABB(r,n),i}}return this.getBounds(t)},e.prototype.getBoundingClientRect=function(t){var n,r,i,a=this.getGeometryBounds(t);Oe.isEmpty(a)||(i=new Oe,i.setFromTransformedAABB(a,this.getWorldTransform(t)));var o=(r=(n=t.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||r===void 0?void 0:r.getContextService().getBoundingClientRect();if(i){var s=F(i.getMin(),2),l=s[0],u=s[1],f=F(i.getMax(),2),c=f[0],h=f[1];return new cr(l+((o==null?void 0:o.left)||0),u+((o==null?void 0:o.top)||0),c-l,h-u)}return new cr((o==null?void 0:o.left)||0,(o==null?void 0:o.top)||0,0,0)},e.prototype.dirtifyWorldInternal=function(t,n){var r=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,t.childNodes.forEach(function(a){var o=a.transformable;o.dirtyFlag||r.dirtifyWorldInternal(a,o)});var i=t.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0)}},e.prototype.syncHierarchy=function(t){var n=t.transformable;if(!n.frozen){n.frozen=!0,(n.localDirtyFlag||n.dirtyFlag)&&this.sync(t,n);for(var r=t.childNodes,i=0;il;--p){for(var d=0;d=u){n.isOverflowing=!0;break}d=0,v[y]="";continue}if(d>0&&d+T>h){if(y+1>=u){if(n.isOverflowing=!0,E>0&&E<=h){for(var C=v[y].length,k=0,N=C,_=0;_h){N=_;break}k+=A}v[y]=(v[y]||"").slice(0,N)+p}break}if(y++,d=0,v[y]="",this.isBreakingSpace(x))continue;this.canBreakInLastChar(x)||(v=this.trimToBreakable(v),d=this.sumTextWidthByCache(v[y]||"",m)),this.shouldBreakByKinsokuShorui(x,S)&&(v=this.trimByKinsokuShorui(v),d+=g(M||""))}d+=T,v[y]=(v[y]||"")+x}return v.join(` -`)},e.prototype.isBreakingSpace=function(t){return typeof t!="string"?!1:qn.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.prototype.isNewline=function(t){return typeof t!="string"?!1:qn.Newlines.indexOf(t.charCodeAt(0))>=0},e.prototype.trimToBreakable=function(t){var n=Z([],F(t),!1),r=n[n.length-2],i=this.findBreakableIndex(r);if(i===-1||!r)return n;var a=r.slice(i,i+1),o=this.isBreakingSpace(a),s=i+1,l=i+(o?0:1);return n[n.length-1]+=r.slice(s,r.length),n[n.length-2]=r.slice(0,l),n},e.prototype.canBreakInLastChar=function(t){return!(t&&ud.test(t))},e.prototype.sumTextWidthByCache=function(t,n){return t.split("").reduce(function(r,i){if(!n[i])throw Error("cannot count the word without cache");return r+n[i]},0)},e.prototype.findBreakableIndex=function(t){for(var n=t.length-1;n>=0;n--)if(!ud.test(t[n]))return n;return-1},e.prototype.getFromCache=function(t,n,r,i){var a=r[t];if(typeof a!="number"){var o=t.length*n;a=i.measureText(t).width+o,r[t]=a}return a},e}(),R={},FE=function(){var e,t=new vE,n=new pE;return e={},e[O.CIRCLE]=new fE,e[O.ELLIPSE]=new cE,e[O.RECT]=t,e[O.IMAGE]=t,e[O.GROUP]=t,e[O.LINE]=new hE,e[O.TEXT]=new yE(R),e[O.POLYLINE]=n,e[O.POLYGON]=n,e[O.PATH]=new dE,e[O.HTML]=null,e[O.MESH]=null,e}(),BE=function(){var e,t=new S2,n=new Xf;return e={},e[B.PERCENTAGE]=null,e[B.NUMBER]=new R2,e[B.ANGLE]=new P2,e[B.DEFINED_PATH]=new M2,e[B.PAINT]=t,e[B.COLOR]=t,e[B.FILTER]=new T2,e[B.LENGTH]=n,e[B.LENGTH_PERCENTAGE]=n,e[B.LENGTH_PERCENTAGE_12]=new C2,e[B.LENGTH_PERCENTAGE_14]=new k2,e[B.COORDINATE]=new N2,e[B.OFFSET_DISTANCE]=new _2,e[B.OPACITY_VALUE]=new A2,e[B.PATH]=new L2,e[B.LIST_OF_POINTS]=new I2,e[B.SHADOW_BLUR]=new D2,e[B.TEXT]=new b2,e[B.TEXT_TRANSFORM]=new F2,e[B.TRANSFORM]=new sE,e[B.TRANSFORM_ORIGIN]=new lE,e[B.Z_INDEX]=new uE,e[B.MARKER]=new O2,e}(),zE=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}};R.CameraContribution=Jv;R.AnimationTimeline=null;R.EasingFunction=null;R.offscreenCanvasCreator=new EE;R.nativeHTMLMap=new WeakMap;R.sceneGraphSelector=new ME;R.sceneGraphService=new TE(R);R.textService=new bE(R);R.geometryUpdaterFactory=FE;R.CSSPropertySyntaxFactory=BE;R.styleValueRegistry=new w2(R);R.layoutRegistry=null;R.globalThis=zE();R.enableCSSParsing=!0;R.enableDataset=!1;R.enableStyleSyntax=!0;var UE=0,fd=new pr(ee.INSERTED,null,"","","",0,"",""),cd=new pr(ee.REMOVED,null,"","","",0,"",""),GE=new He(ee.DESTROY),HE=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.entity=UE++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},n.cullable={strategy:ku.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},n.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},n.geometry={contentBounds:void 0,renderBounds:void 0},n.rBushNode={aabb:void 0},n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle=R.enableCSSParsing?{anchor:ce,opacity:ce,fillOpacity:ce,strokeOpacity:ce,fill:ce,stroke:ce,transform:ce,transformOrigin:ce,visibility:ce,pointerEvents:ce,lineWidth:ce,lineCap:ce,lineJoin:ce,increasedLineWidthForHitTesting:ce,fontSize:ce,fontFamily:ce,fontStyle:ce,fontWeight:ce,fontVariant:ce,textAlign:ce,textBaseline:ce,textTransform:ce,zIndex:ce,filter:ce,shadowType:ce}:null,n.parsedStyle={},n.attributes={},n}return Object.defineProperty(t.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(n){this.setAttribute("class",n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"classList",{get:function(){return this.className.split(" ").filter(function(n){return n!==""})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n-1]||null}return null},enumerable:!1,configurable:!0}),t.prototype.cloneNode=function(n){throw new Error(le)},t.prototype.appendChild=function(n,r){var i;if(n.destroyed)throw new Error(Px);return R.sceneGraphService.attach(n,this,r),!((i=this.ownerDocument)===null||i===void 0)&&i.defaultView&&this.ownerDocument.defaultView.mountChildren(n),fd.relatedNode=this,n.dispatchEvent(fd),n},t.prototype.insertBefore=function(n,r){if(!r)this.appendChild(n);else{var i=this.childNodes.indexOf(r);this.appendChild(n,i-1)}return n},t.prototype.replaceChild=function(n,r){var i=this.childNodes.indexOf(r);return this.removeChild(r),this.appendChild(n,i),r},t.prototype.removeChild=function(n){var r;return cd.relatedNode=this,n.dispatchEvent(cd),!((r=n.ownerDocument)===null||r===void 0)&&r.defaultView&&n.ownerDocument.defaultView.unmountChildren(n),R.sceneGraphService.detach(n),n},t.prototype.removeChildren=function(){for(var n=this.childNodes.length-1;n>=0;n--){var r=this.childNodes[n];this.removeChild(r)}},t.prototype.destroyChildren=function(){for(var n=this.childNodes.length-1;n>=0;n--){var r=this.childNodes[n];r.childNodes.length&&r.destroyChildren(),r.destroy()}},t.prototype.matches=function(n){return R.sceneGraphService.matches(n,this)},t.prototype.getElementById=function(n){return R.sceneGraphService.querySelector("#".concat(n),this)},t.prototype.getElementsByName=function(n){return R.sceneGraphService.querySelectorAll('[name="'.concat(n,'"]'),this)},t.prototype.getElementsByClassName=function(n){return R.sceneGraphService.querySelectorAll(".".concat(n),this)},t.prototype.getElementsByTagName=function(n){return R.sceneGraphService.querySelectorAll(n,this)},t.prototype.querySelector=function(n){return R.sceneGraphService.querySelector(n,this)},t.prototype.querySelectorAll=function(n){return R.sceneGraphService.querySelectorAll(n,this)},t.prototype.closest=function(n){var r=this;do{if(R.sceneGraphService.matches(n,r))return r;r=r.parentElement}while(r!==null);return null},t.prototype.find=function(n){var r=this,i=null;return this.forEach(function(a){return a!==r&&n(a)?(i=a,!0):!1}),i},t.prototype.findAll=function(n){var r=this,i=[];return this.forEach(function(a){a!==r&&n(a)&&i.push(a)}),i},t.prototype.after=function(){for(var n=this,r=[],i=0;i1){var i=n[0].currentPoint,a=n[1].currentPoint,o=n[1].startTangent;r=[],o?(r.push([i[0]-o[0],i[1]-o[1]]),r.push([i[0],i[1]])):(r.push([a[0],a[1]]),r.push([i[0],i[1]]))}return r},t.prototype.getEndTangent=function(){var n=this.parsedStyle.path.segments,r=n.length,i=[];if(r>1){var a=n[r-2].currentPoint,o=n[r-1].currentPoint,s=n[r-1].endTangent;i=[],s?(i.push([o[0]-s[0],o[1]-s[1]]),i.push([o[0],o[1]])):(i.push([a[0],a[1]]),i.push([o[0],o[1]]))}return i},t}(yt),P0=function(e){Q(t,e);function t(n){n===void 0&&(n={});var r=this,i=n.style,a=Ot(n,["style"]);r=e.call(this,X({type:O.POLYGON,style:R.enableCSSParsing?X({points:"",miterLimit:"",isClosed:!0},i):X({},i),initialParsedStyle:R.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a))||this,r.markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var o=r.parsedStyle,s=o.markerStart,l=o.markerEnd,u=o.markerMid;return s&&ne(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),u&&ne(u)&&r.placeMarkerMid(u),l&&ne(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}return t.prototype.attributeChangedCallback=function(n,r,i,a,o){n==="points"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(a&&ne(a)&&(this.markerStartAngle=0,a.remove()),o&&ne(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(a&&ne(a)&&(this.markerEndAngle=0,a.remove()),o&&ne(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(o)},t.prototype.transformMarker=function(n){var r=this.parsedStyle,i=r.markerStart,a=r.markerEnd,o=r.markerStartOffset,s=r.markerEndOffset,l=r.points.points,u=r.defX,f=r.defY,c=n?i:a;if(!(!c||!ne(c))){var h=0,p,v,y,d,m,g;if(y=l[0][0]-u,d=l[0][1]-f,n)p=l[1][0]-l[0][0],v=l[1][1]-l[0][1],m=o||0,g=this.markerStartAngle;else{var E=l.length;this.parsedStyle.isClosed?(p=l[E-1][0]-l[0][0],v=l[E-1][1]-l[0][1]):(y=l[E-1][0]-u,d=l[E-1][1]-f,p=l[E-2][0]-l[E-1][0],v=l[E-2][1]-l[E-1][1]),m=s||0,g=this.markerEndAngle}h=Math.atan2(v,p),c.setLocalEulerAngles(h*180/Math.PI+g),c.setLocalPosition(y+Math.cos(h)*m,d+Math.sin(h)*m)}},t.prototype.placeMarkerMid=function(n){var r=this.parsedStyle,i=r.points.points,a=r.defX,o=r.defY;if(this.markerMidList.forEach(function(c){c.remove()}),this.markerMidList=[],n&&ne(n))for(var s=1;s<(this.parsedStyle.isClosed?i.length:i.length-1);s++){var l=i[s][0]-a,u=i[s][1]-o,f=s===1?n:n.cloneNode(!0);this.markerMidList.push(f),this.appendChild(f),f.setLocalPosition(l,u)}},t}(yt),KE=function(e){Q(t,e);function t(n){n===void 0&&(n={});var r=n.style,i=Ot(n,["style"]);return e.call(this,X({type:O.POLYLINE,style:R.enableCSSParsing?X({points:"",miterLimit:"",isClosed:!1},r):X({},r),initialParsedStyle:R.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i))||this}return t.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},t.prototype.getPointAtLength=function(n,r){return r===void 0&&(r=!1),this.getPoint(n/this.getTotalLength(),r)},t.prototype.getPoint=function(n,r){r===void 0&&(r=!1);var i=this.parsedStyle,a=i.defX,o=i.defY,s=i.points,l=s.points,u=s.segments,f=0,c=0;u.forEach(function(d,m){n>=d[0]&&n<=d[1]&&(f=(n-d[0])/(d[1]-d[0]),c=m)});var h=qv(l[c][0],l[c][1],l[c+1][0],l[c+1][1],f),p=h.x,v=h.y,y=St(J(),fe(p-a,v-o,0),r?this.getWorldTransform():this.getLocalTransform());return new De(y[0],y[1])},t.prototype.getStartTangent=function(){var n=this.parsedStyle.points.points,r=[];return r.push([n[1][0],n[1][1]]),r.push([n[0][0],n[0][1]]),r},t.prototype.getEndTangent=function(){var n=this.parsedStyle.points.points,r=n.length-1,i=[];return i.push([n[r-1][0],n[r-1][1]]),i.push([n[r][0],n[r][1]]),i},t}(P0),M0=function(e){Q(t,e);function t(n){n===void 0&&(n={});var r=n.style,i=Ot(n,["style"]);return e.call(this,X({type:O.RECT,style:R.enableCSSParsing?X({x:"",y:"",width:"",height:"",radius:""},r):X({},r)},i))||this}return t}(yt),S0=function(e){Q(t,e);function t(n){n===void 0&&(n={});var r=n.style,i=Ot(n,["style"]);return e.call(this,X({type:O.TEXT,style:R.enableCSSParsing?X({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},r):X({fill:"black"},r),initialParsedStyle:R.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0}},i))||this}return t.prototype.getComputedTextLength=function(){var n;return((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.maxLineWidth)||0},t.prototype.getLineBoundingRects=function(){var n;return((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.lineMetrics)||[]},t.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},t}(yt),qE=function(){function e(){this.registry={},this.define(O.CIRCLE,zn),this.define(O.ELLIPSE,$E),this.define(O.RECT,M0),this.define(O.IMAGE,w0),this.define(O.LINE,jf),this.define(O.GROUP,Du),this.define(O.PATH,_s),this.define(O.POLYGON,P0),this.define(O.POLYLINE,KE),this.define(O.TEXT,S0),this.define(O.HTML,jE)}return e.prototype.define=function(t,n){this.registry[t]=n},e.prototype.get=function(t){return this.registry[t]},e}(),QE=function(e){Q(t,e);function t(){var n=e.call(this)||this;n.defaultView=null,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new R.AnimationTimeline(n)}catch{}var r={};return Yf.forEach(function(i){var a=i.n,o=i.inh,s=i.d;o&&s&&(r[a]=Br(s)?s(O.GROUP):s)}),n.documentElement=new Du({id:"g-root",style:r}),n.documentElement.ownerDocument=n,n.documentElement.parentNode=n,n.childNodes=[n.documentElement],n}return Object.defineProperty(t.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),t.prototype.createElement=function(n,r){if(n==="svg")return this.documentElement;var i=this.defaultView.customElements.get(n);i||(console.warn("Unsupported tagName: ",n),i=n==="tspan"?S0:Du);var a=new i(r);return a.ownerDocument=this,a},t.prototype.createElementNS=function(n,r,i){return this.createElement(r,i)},t.prototype.cloneNode=function(n){throw new Error(le)},t.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch{}},t.prototype.elementsFromBBox=function(n,r,i,a){var o=this.defaultView.context.rBushRoot,s=o.search({minX:n,minY:r,maxX:i,maxY:a}),l=[];return s.forEach(function(u){var f=u.displayObject,c=f.parsedStyle.pointerEvents,h=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(c);(!h||h&&f.isVisible())&&!f.isCulled()&&f.isInteractive()&&l.push(f)}),l.sort(function(u,f){return f.sortable.renderOrder-u.sortable.renderOrder}),l},t.prototype.elementFromPointSync=function(n,r){var i=this.defaultView.canvas2Viewport({x:n,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),l=s.width,u=s.height;if(a<0||o<0||a>l||o>u)return null;var f=this.defaultView.viewport2Client({x:a,y:o}),c=f.x,h=f.y,p=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:n,y:r,viewportX:a,viewportY:o,clientX:c,clientY:h},picked:[]}).picked;return p&&p[0]||this.documentElement},t.prototype.elementFromPoint=function(n,r){return pa(this,void 0,void 0,function(){var i,a,o,s,l,u,f,c,h,p;return va(this,function(v){switch(v.label){case 0:return i=this.defaultView.canvas2Viewport({x:n,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),l=s.width,u=s.height,a<0||o<0||a>l||o>u?[2,null]:(f=this.defaultView.viewport2Client({x:a,y:o}),c=f.x,h=f.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:n,y:r,viewportX:a,viewportY:o,clientX:c,clientY:h},picked:[]})]);case 1:return p=v.sent().picked,[2,p&&p[0]||this.documentElement]}})})},t.prototype.elementsFromPointSync=function(n,r){var i=this.defaultView.canvas2Viewport({x:n,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),l=s.width,u=s.height;if(a<0||o<0||a>l||o>u)return[];var f=this.defaultView.viewport2Client({x:a,y:o}),c=f.x,h=f.y,p=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:n,y:r,viewportX:a,viewportY:o,clientX:c,clientY:h},picked:[]}).picked;return p[p.length-1]!==this.documentElement&&p.push(this.documentElement),p},t.prototype.elementsFromPoint=function(n,r){return pa(this,void 0,void 0,function(){var i,a,o,s,l,u,f,c,h,p;return va(this,function(v){switch(v.label){case 0:return i=this.defaultView.canvas2Viewport({x:n,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),l=s.width,u=s.height,a<0||o<0||a>l||o>u?[2,[]]:(f=this.defaultView.viewport2Client({x:a,y:o}),c=f.x,h=f.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:n,y:r,viewportX:a,viewportY:o,clientX:c,clientY:h},picked:[]})]);case 1:return p=v.sent().picked,p[p.length-1]!==this.documentElement&&p.push(this.documentElement),[2,p]}})})},t.prototype.appendChild=function(n,r){throw new Error(Cr)},t.prototype.insertBefore=function(n,r){throw new Error(Cr)},t.prototype.removeChild=function(n,r){throw new Error(Cr)},t.prototype.replaceChild=function(n,r,i){throw new Error(Cr)},t.prototype.append=function(){throw new Error(Cr)},t.prototype.prepend=function(){throw new Error(Cr)},t.prototype.getElementById=function(n){return this.documentElement.getElementById(n)},t.prototype.getElementsByName=function(n){return this.documentElement.getElementsByName(n)},t.prototype.getElementsByTagName=function(n){return this.documentElement.getElementsByTagName(n)},t.prototype.getElementsByClassName=function(n){return this.documentElement.getElementsByClassName(n)},t.prototype.querySelector=function(n){return this.documentElement.querySelector(n)},t.prototype.querySelectorAll=function(n){return this.documentElement.querySelectorAll(n)},t.prototype.find=function(n){return this.documentElement.find(n)},t.prototype.findAll=function(n){return this.documentElement.findAll(n)},t}(Fe),ZE=function(){function e(t){this.strategies=t}return e.prototype.apply=function(t){var n=t.camera,r=t.renderingService,i=t.renderingContext,a=this.strategies;r.hooks.cull.tap(e.tag,function(o){if(o){var s=o.cullable;return a.length===0?s.visible=i.unculledEntities.indexOf(o.entity)>-1:s.visible=a.every(function(l){return l.isVisible(n,o)}),!o.isCulled()&&o.isVisible()?o:(o.dispatchEvent(new He(ee.CULLED)),null)}return o}),r.hooks.afterRender.tap(e.tag,function(o){o.cullable.visibilityPlaneMask=-1})},e.tag="Culling",e}(),JE=function(){function e(){}return e.prototype.apply=function(t){var n=t.renderingService;n.hooks.dirtycheck.tap(e.tag,function(r){if(r){var i=r.renderable,a=i.dirty||n.disableDirtyRectangleRendering();return a?r:null}return r})},e.tag="DirtyCheck",e}(),ew=function(){function e(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Lu(null),this.rootWheelEvent=new Iu(null),this.onPointerMove=function(n){var r,i,a,o,s=(o=(a=t.context.renderingContext.root)===null||a===void 0?void 0:a.ownerDocument)===null||o===void 0?void 0:o.defaultView;if(!(s.supportsTouchEvents&&n.pointerType==="touch")){var l=t.normalizeToPointerEvent(n,s);try{for(var u=mn(l),f=u.next();!f.done;f=u.next()){var c=f.value,h=t.bootstrapEvent(t.rootPointerEvent,c,s,n);t.context.eventService.mapEvent(h)}}catch(p){r={error:p}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(n){var r,i,a,o,s=(o=(a=t.context.renderingContext.root)===null||a===void 0?void 0:a.ownerDocument)===null||o===void 0?void 0:o.defaultView,l=t.normalizeToPointerEvent(n,s);try{for(var u=mn(l),f=u.next();!f.done;f=u.next()){var c=f.value,h=t.bootstrapEvent(t.rootPointerEvent,c,s,n);t.context.eventService.mapEvent(h)}}catch(p){r={error:p}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}t.setCursor(t.context.eventService.cursor)}}return e.prototype.apply=function(t){var n=this;this.context=t;var r=t.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(a){var o=n.context.renderingService.hooks.pickSync.call({position:a,picked:[],topmost:!0}).picked;return o[0]||null}),r.hooks.pointerWheel.tap(e.tag,function(a){var o=n.normalizeWheelEvent(a);n.context.eventService.mapEvent(o)}),r.hooks.pointerDown.tap(e.tag,function(a){var o,s;if(!(i.supportsTouchEvents&&a.pointerType==="touch")){var l=n.normalizeToPointerEvent(a,i);if(n.autoPreventDefault&&l[0].isNormalized){var u=a.cancelable||!("cancelable"in a);u&&a.preventDefault()}try{for(var f=mn(l),c=f.next();!c.done;c=f.next()){var h=c.value,p=n.bootstrapEvent(n.rootPointerEvent,h,i,a);n.context.eventService.mapEvent(p)}}catch(v){o={error:v}}finally{try{c&&!c.done&&(s=f.return)&&s.call(f)}finally{if(o)throw o.error}}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerUp.tap(e.tag,function(a){var o,s;if(!(i.supportsTouchEvents&&a.pointerType==="touch")){var l=n.context.contextService.getDomElement(),u="outside";try{u=l&&a.target&&a.target!==l&&l.contains&&!l.contains(a.target)?"outside":""}catch{}var f=n.normalizeToPointerEvent(a,i);try{for(var c=mn(f),h=c.next();!h.done;h=c.next()){var p=h.value,v=n.bootstrapEvent(n.rootPointerEvent,p,i,a);v.type+=u,n.context.eventService.mapEvent(v)}}catch(y){o={error:y}}finally{try{h&&!h.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerMove.tap(e.tag,this.onPointerMove),r.hooks.pointerOver.tap(e.tag,this.onPointerMove),r.hooks.pointerOut.tap(e.tag,this.onPointerMove),r.hooks.click.tap(e.tag,this.onClick),r.hooks.pointerCancel.tap(e.tag,function(a){var o,s,l=n.normalizeToPointerEvent(a,i);try{for(var u=mn(l),f=u.next();!f.done;f=u.next()){var c=f.value,h=n.bootstrapEvent(n.rootPointerEvent,c,i,a);n.context.eventService.mapEvent(h)}}catch(p){o={error:p}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}n.setCursor(n.context.eventService.cursor)})},e.prototype.getViewportXY=function(t){var n,r,i=t.offsetX,a=t.offsetY,o=t.clientX,s=t.clientY;if(this.context.config.supportsCSSTransform&&!U(i)&&!U(a))n=i,r=a;else{var l=this.context.eventService.client2Viewport(new De(o,s));n=l.x,r=l.y}return{x:n,y:r}},e.prototype.bootstrapEvent=function(t,n,r,i){var a,o;t.view=r,t.originalEvent=null,t.nativeEvent=i,t.pointerId=n.pointerId,t.width=n.width,t.height=n.height,t.isPrimary=n.isPrimary,t.pointerType=n.pointerType,t.pressure=n.pressure,t.tangentialPressure=n.tangentialPressure,t.tiltX=n.tiltX,t.tiltY=n.tiltY,t.twist=n.twist,this.transferMouseData(t,n);var s=(a=this.getViewportXY(n),a.x),l=a.y;t.viewport.x=s,t.viewport.y=l;var u=(o=this.context.eventService.viewport2Canvas(t.viewport),o.x),f=o.y;return t.canvas.x=u,t.canvas.y=f,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=i.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=X2[t.type]||t.type),t},e.prototype.normalizeWheelEvent=function(t){var n,r,i=this.rootWheelEvent;this.transferMouseData(i,t),i.deltaMode=t.deltaMode,i.deltaX=t.deltaX,i.deltaY=t.deltaY,i.deltaZ=t.deltaZ;var a=(n=this.getViewportXY(t),n.x),o=n.y;i.viewport.x=a,i.viewport.y=o;var s=(r=this.context.eventService.viewport2Canvas(i.viewport),r.x),l=r.y;return i.canvas.x=s,i.canvas.y=l,i.global.copyFrom(i.canvas),i.offset.copyFrom(i.canvas),i.nativeEvent=t,i.type=t.type,i},e.prototype.transferMouseData=function(t,n){t.isTrusted=n.isTrusted,t.srcElement=n.srcElement,t.timeStamp=Au.now(),t.type=n.type,t.altKey=n.altKey,t.metaKey=n.metaKey,t.shiftKey=n.shiftKey,t.ctrlKey=n.ctrlKey,t.button=n.button,t.buttons=n.buttons,t.client.x=n.clientX,t.client.y=n.clientY,t.movement.x=n.movementX,t.movement.y=n.movementY,t.page.x=n.pageX,t.page.y=n.pageY,t.screen.x=n.screenX,t.screen.y=n.screenY,t.relatedTarget=null},e.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},e.prototype.normalizeToPointerEvent=function(t,n){var r=[];if(n.isTouchEvent(t))for(var i=0;i-1,s=0,l=i.length;s=1?Math.ceil(k):1,T=s||V2(a)||a.width/k,C=l||W2(a)||a.height/k),o&&(R.offscreenCanvas=o),r.devicePixelRatio=k,r.requestAnimationFrame=v??y0.bind(R.globalThis),r.cancelAnimationFrame=y??m0.bind(R.globalThis),r.supportsTouchEvents=g??"ontouchstart"in R.globalThis,r.supportsPointerEvents=m??!!R.globalThis.PointerEvent,r.isTouchEvent=M??function(N){return r.supportsTouchEvents&&N instanceof R.globalThis.TouchEvent},r.isMouseEvent=S??function(N){return!R.globalThis.MouseEvent||N instanceof R.globalThis.MouseEvent&&(!r.supportsPointerEvents||!(N instanceof R.globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:a,width:T,height:C,renderer:f,offscreenCanvas:o,devicePixelRatio:k,cursor:h||"default",background:c||"transparent",createImage:d,document:p,supportsCSSTransform:E,useNativeClickEvent:w,alwaysTriggerPointerEventOnCanvas:x}),r.initDefaultCamera(T,C,f.clipSpaceNearZ),r.initRenderer(f,!0),r}return t.prototype.initRenderingContext=function(n){this.context.config=n,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},t.prototype.initDefaultCamera=function(n,r,i){var a=this,o=new R.CameraContribution;o.clipSpaceNearZ=i,o.setType(ae.EXPLORING,ga.DEFAULT).setPosition(n/2,r/2,dd).setFocalPoint(n/2,r/2,0).setOrthographic(n/-2,n/2,r/2,r/-2,iw,aw),o.canvas=this,o.eventEmitter.on(Zv.UPDATED,function(){a.context.renderingContext.renderReasons.add(dr.CAMERA_CHANGED)}),this.context.camera=o},t.prototype.getConfig=function(){return this.context.config},t.prototype.getRoot=function(){return this.document.documentElement},t.prototype.getCamera=function(){return this.context.camera},t.prototype.getContextService=function(){return this.context.contextService},t.prototype.getEventService=function(){return this.context.eventService},t.prototype.getRenderingService=function(){return this.context.renderingService},t.prototype.getRenderingContext=function(){return this.context.renderingContext},t.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(t.prototype,"ready",{get:function(){var n=this;return this.readyPromise||(this.readyPromise=new Promise(function(r){n.resolveReadyPromise=function(){r(n)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),t.prototype.destroy=function(n,r){if(n===void 0&&(n=!0),r===void 0&&(r=!1),r||this.dispatchEvent(new He(it.BEFORE_DESTROY)),this.frameId){var i=this.getConfig().cancelAnimationFrame||cancelAnimationFrame;i(this.frameId)}var a=this.getRoot();this.unmountChildren(a),n&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),n&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),r||this.dispatchEvent(new He(it.AFTER_DESTROY))},t.prototype.changeSize=function(n,r){this.resize(n,r)},t.prototype.resize=function(n,r){var i=this.context.config;i.width=n,i.height=r,this.getContextService().resize(n,r);var a=this.context.camera,o=a.getProjectionMode();a.setPosition(n/2,r/2,dd).setFocalPoint(n/2,r/2,0),o===tt.ORTHOGRAPHIC?a.setOrthographic(n/-2,n/2,r/2,r/-2,a.getNear(),a.getFar()):a.setAspect(n/r),this.dispatchEvent(new He(it.RESIZE,{width:n,height:r}))},t.prototype.appendChild=function(n,r){return this.document.documentElement.appendChild(n,r)},t.prototype.insertBefore=function(n,r){return this.document.documentElement.insertBefore(n,r)},t.prototype.removeChild=function(n){return this.document.documentElement.removeChild(n)},t.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},t.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},t.prototype.render=function(){var n=this;this.dispatchEvent(ow);var r=this.getRenderingService();r.render(this.getConfig(),function(){n.dispatchEvent(sw)}),this.dispatchEvent(lw)},t.prototype.run=function(){var n=this,r=function(){n.render(),n.frameId=n.requestAnimationFrame(r)};r()},t.prototype.initRenderer=function(n,r){var i=this;if(r===void 0&&(r=!1),!n)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new lx,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new ew,new rw,new JE,new ZE([new nw])),this.loadRendererContainerModule(n),this.context.contextService=new this.context.ContextService(X(X({},R),this.context)),this.context.renderingService=new wE(R,this.context),this.context.eventService=new xE(R,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(n,r,!0)):this.context.contextService.initAsync().then(function(){i.initRenderingService(n,r)})},t.prototype.initRenderingService=function(n,r,i){var a=this;r===void 0&&(r=!1),i===void 0&&(i=!1),this.context.renderingService.init(function(){a.inited=!0,r?(i?a.requestAnimationFrame(function(){a.dispatchEvent(new He(it.READY))}):a.dispatchEvent(new He(it.READY)),a.readyPromise&&a.resolveReadyPromise()):a.dispatchEvent(new He(it.RENDERER_CHANGED)),r||a.getRoot().forEach(function(o){var s=o.renderable;s&&(s.renderBoundsDirty=!0,s.boundsDirty=!0,s.dirty=!0)}),a.mountChildren(a.getRoot()),n.getConfig().enableAutoRendering&&a.run()})},t.prototype.loadRendererContainerModule=function(n){var r=this,i=n.getPlugins();i.forEach(function(a){a.context=r.context,a.init(R)})},t.prototype.setRenderer=function(n){var r=this.getConfig();if(r.renderer!==n){var i=r.renderer;r.renderer=n,this.destroy(!1,!0),Z([],F(i==null?void 0:i.getPlugins()),!1).reverse().forEach(function(a){a.destroy(R)}),this.initRenderer(n)}},t.prototype.setCursor=function(n){var r=this.getConfig();r.cursor=n,this.getContextService().applyCursorStyle(n)},t.prototype.unmountChildren=function(n){var r=this;n.childNodes.forEach(function(i){r.unmountChildren(i)}),this.inited&&(n.isMutationObserved?n.dispatchEvent(Pl):(Pl.target=n,this.dispatchEvent(Pl,!0)),n!==this.document.documentElement&&(n.ownerDocument=null),n.isConnected=!1),n.isCustomElement&&n.disconnectedCallback&&n.disconnectedCallback()},t.prototype.mountChildren=function(n){var r=this;this.inited?n.isConnected||(n.ownerDocument=this.document,n.isConnected=!0,n.isMutationObserved?n.dispatchEvent(wl):(wl.target=n,this.dispatchEvent(wl,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",n.nodeName),n.childNodes.forEach(function(i){r.mountChildren(i)}),n.isCustomElement&&n.connectedCallback&&n.connectedCallback()},t.prototype.client2Viewport=function(n){return this.getEventService().client2Viewport(n)},t.prototype.viewport2Client=function(n){return this.getEventService().viewport2Client(n)},t.prototype.viewport2Canvas=function(n){return this.getEventService().viewport2Canvas(n)},t.prototype.canvas2Viewport=function(n){return this.getEventService().canvas2Viewport(n)},t.prototype.getPointByClient=function(n,r){return this.client2Viewport({x:n,y:r})},t.prototype.getClientByPoint=function(n,r){return this.viewport2Client({x:n,y:r})},t}(x0),uw=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.landmarks=[],n}return t.prototype.rotate=function(n,r,i){if(this.relElevation=Zr(r),this.relAzimuth=Zr(n),this.relRoll=Zr(i),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===ae.EXPLORING){var a=wn(Ce(),[1,0,0],ge((this.rotateWorld?1:-1)*this.relElevation)),o=wn(Ce(),[0,1,0],ge((this.rotateWorld?1:-1)*this.relAzimuth)),s=wn(Ce(),[0,0,1],ge(this.relRoll)),l=An(Ce(),o,a);l=An(Ce(),l,s);var u=zf(he(),l);_n(this.matrix,this.matrix,[0,0,-this.distance]),We(this.matrix,this.matrix,u),_n(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===ae.ORBITING||this.type===ae.EXPLORING?this._getPosition():this.type===ae.TRACKING&&this._getFocalPoint(),this._update(),this},t.prototype.pan=function(n,r){var i=qe(n,r,0),a=en(this.position);return Kr(a,a,pu(J(),this.right,i[0])),Kr(a,a,pu(J(),this.up,i[1])),this._setPosition(a),this.triggerUpdate(),this},t.prototype.dolly=function(n){var r=this.forward,i=en(this.position),a=n*this.dollyingStep,o=this.distance+n*this.dollyingStep;return a=Math.max(Math.min(o,this.maxDistance),this.minDistance)-this.distance,i[0]+=a*r[0],i[1]+=a*r[1],i[2]+=a*r[2],this._setPosition(i),this.type===ae.ORBITING||this.type===ae.EXPLORING?this._getDistance():this.type===ae.TRACKING&&Kr(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},t.prototype.cancelLandmarkAnimation=function(){this.landmarkAnimationID!==void 0&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},t.prototype.createLandmark=function(n,r){var i,a,o,s;r===void 0&&(r={});var l=r.position,u=l===void 0?this.position:l,f=r.focalPoint,c=f===void 0?this.focalPoint:f,h=r.roll,p=r.zoom,v=new R.CameraContribution;v.setType(this.type,void 0),v.setPosition(u[0],(i=u[1])!==null&&i!==void 0?i:this.position[1],(a=u[2])!==null&&a!==void 0?a:this.position[2]),v.setFocalPoint(c[0],(o=c[1])!==null&&o!==void 0?o:this.focalPoint[1],(s=c[2])!==null&&s!==void 0?s:this.focalPoint[2]),v.setRoll(h??this.roll),v.setZoom(p??this.zoom);var y={name:n,matrix:wv(v.getWorldTransform()),right:en(v.right),up:en(v.up),forward:en(v.forward),position:en(v.getPosition()),focalPoint:en(v.getFocalPoint()),distanceVector:en(v.getDistanceVector()),distance:v.getDistance(),dollyingStep:v.getDollyingStep(),azimuth:v.getAzimuth(),elevation:v.getElevation(),roll:v.getRoll(),relAzimuth:v.relAzimuth,relElevation:v.relElevation,relRoll:v.relRoll,zoom:v.getZoom()};return this.landmarks.push(y),y},t.prototype.gotoLandmark=function(n,r){var i=this;r===void 0&&(r={});var a=$e(n)?this.landmarks.find(function(S){return S.name===n}):n;if(a){var o=Ft(r)?{duration:r}:r,s=o.easing,l=s===void 0?"linear":s,u=o.duration,f=u===void 0?100:u,c=o.easingFunction,h=c===void 0?void 0:c,p=o.onfinish,v=p===void 0?void 0:p,y=.01;if(f===0){this.syncFromLandmark(a),v&&v();return}this.cancelLandmarkAnimation();var d=a.position,m=a.focalPoint,g=a.zoom,E=a.roll,P=h||R.EasingFunction(l),w,x=function(){i.setFocalPoint(m),i.setPosition(d),i.setRoll(E),i.setZoom(g),i.computeMatrix(),i.triggerUpdate(),v&&v()},M=function(S){w===void 0&&(w=S);var T=S-w;if(T>f){x();return}var C=P(T/f),k=J(),N=J(),_=1,A=0;vu(k,i.focalPoint,m,C),vu(N,i.position,d,C),A=i.roll*(1-C)+E*C,_=i.zoom*(1-C)+g*C,i.setFocalPoint(k),i.setPosition(N),i.setRoll(A),i.setZoom(_);var z=Mh(k,m)+Mh(N,d);if(z<=y&&g==null&&E==null){x();return}i.computeMatrix(),i.triggerUpdate(),T0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_needsTick",{get:function(){return this.pending||this.playState==="running"||!this._finishedFlag},enumerable:!1,configurable:!0}),e.prototype.updatePromises=function(){var t=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==t&&(n==="idle"?(this.rejectReadyPromise(),this.readyPromise=void 0):t==="pending"?this.resolveReadyPromise():n==="pending"&&(this.readyPromise=void 0)),this.finishedPromise&&n!==t&&(n==="idle"?(this.rejectFinishedPromise(),this.finishedPromise=void 0):n==="finished"?this.resolveFinishedPromise():t==="finished"&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise},e.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),this.timeline.animations.indexOf(this)===-1&&this.timeline.animations.push(this),this.updatePromises()},e.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),!this._isFinished&&!this._paused&&!this._idle?this.currentTimePending=!0:this._idle&&(this.rewind(),this._idle=!1),this._startTime=null,this._paused=!0,this.updatePromises()},e.prototype.finish=function(){this.updatePromises(),!this._idle&&(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.prototype.cancel=function(){var t=this;if(this.updatePromises(),!!this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var n=new Ml(null,this,this.currentTime,null);setTimeout(function(){t.oncancel(n)})}},e.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),t!==null&&(this.currentTime=t),this.updatePromises()},e.prototype.updatePlaybackRate=function(t){this.playbackRate=t},e.prototype.targetAnimations=function(){var t,n=(t=this.effect)===null||t===void 0?void 0:t.target;return n.getAnimations()},e.prototype.markTarget=function(){var t=this.targetAnimations();t.indexOf(this)===-1&&t.push(this)},e.prototype.unmarkTarget=function(){var t=this.targetAnimations(),n=t.indexOf(this);n!==-1&&t.splice(n,1)},e.prototype.tick=function(t,n){!this._idle&&!this._paused&&(this._startTime===null?n&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),n&&(this.currentTimePending=!1,this.fireEvents(t))},e.prototype.rewind=function(){if(this.playbackRate>=0)this.currentTime=0;else if(this._totalDuration<1/0)this.currentTime=this._totalDuration;else throw new Error("Unable to rewind negative playback rate animation with infinite duration")},e.prototype.persist=function(){throw new Error(le)},e.prototype.addEventListener=function(t,n,r){throw new Error(le)},e.prototype.removeEventListener=function(t,n,r){throw new Error(le)},e.prototype.dispatchEvent=function(t){throw new Error(le)},e.prototype.commitStyles=function(){throw new Error(le)},e.prototype.ensureAlive=function(){var t,n;this.playbackRate<0&&this.currentTime===0?this._inEffect=!!(!((t=this.effect)===null||t===void 0)&&t.update(-1)):this._inEffect=!!(!((n=this.effect)===null||n===void 0)&&n.update(this.currentTime)),!this._inTimeline&&(this._inEffect||!this._finishedFlag)&&(this._inTimeline=!0,this.timeline.animations.push(this))},e.prototype.tickCurrentTime=function(t,n){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!n&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},e.prototype.fireEvents=function(t){var n=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var r=new Ml(null,this,this.currentTime,t);setTimeout(function(){n.onfinish&&n.onfinish(r)})}this._finishedFlag=!0}}else{if(this.onframe&&this.playState==="running"){var i=new Ml(null,this,this.currentTime,t);this.onframe(i)}this._finishedFlag=!1}},e}(),hw=4,dw=.001,pw=1e-7,vw=10,Fi=11,to=1/(Fi-1),yw=typeof Float32Array=="function",T0=function(e,t){return 1-3*t+3*e},C0=function(e,t){return 3*t-6*e},k0=function(e){return 3*e},cs=function(e,t,n){return((T0(t,n)*e+C0(t,n))*e+k0(t))*e},N0=function(e,t,n){return 3*T0(t,n)*e*e+2*C0(t,n)*e+k0(t)},mw=function(e,t,n,r,i){var a,o,s=0;do o=t+(n-t)/2,a=cs(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>pw&&++s=dw?gw(s,h,e,n):p===0?h:mw(s,l,l+to,e,n)};return function(s){return s===0||s===1?s:cs(o(s),t,r)}},xw=function(e){return e=e.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())}),e.charAt(0)==="-"?e.substring(1):e},no=function(e){return Math.pow(e,2)},ro=function(e){return Math.pow(e,3)},io=function(e){return Math.pow(e,4)},ao=function(e){return Math.pow(e,5)},oo=function(e){return Math.pow(e,6)},so=function(e){return 1-Math.cos(e*Math.PI/2)},lo=function(e){return 1-Math.sqrt(1-e*e)},uo=function(e){return e*e*(3*e-2)},fo=function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)},co=function(e,t){t===void 0&&(t=[]);var n=F(t,2),r=n[0],i=r===void 0?1:r,a=n[1],o=a===void 0?.5:a,s=ht(Number(i),1,10),l=ht(Number(o),.1,2);return e===0||e===1?e:-s*Math.pow(2,10*(e-1))*Math.sin((e-1-l/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/l)},Oi=function(e,t,n){t===void 0&&(t=[]);var r=F(t,4),i=r[0],a=i===void 0?1:i,o=r[1],s=o===void 0?100:o,l=r[2],u=l===void 0?10:l,f=r[3],c=f===void 0?0:f;a=ht(a,.1,1e3),s=ht(s,.1,1e3),u=ht(u,.1,1e3),c=ht(c,.1,1e3);var h=Math.sqrt(s/a),p=u/(2*Math.sqrt(s*a)),v=p<1?h*Math.sqrt(1-p*p):0,y=1,d=p<1?(p*h+-c)/v:-c+h,m=n?n*e/1e3:e;return p<1?m=Math.exp(-m*p*h)*(y*Math.cos(v*m)+d*Math.sin(v*m)):m=(y+d*m)*Math.exp(-m*h),e===0||e===1?e:1-m},Sl=function(e,t){t===void 0&&(t=[]);var n=F(t,2),r=n[0],i=r===void 0?10:r,a=n[1],o=a=="start"?Math.ceil:Math.floor;return o(ht(e,0,1)*i)/i},pd=function(e,t){t===void 0&&(t=[]);var n=F(t,4),r=n[0],i=n[1],a=n[2],o=n[3];return Kf(r,i,a,o)(e)},ho=Kf(.42,0,1,1),gt=function(e){return function(t,n,r){return n===void 0&&(n=[]),1-e(1-t,n,r)}},xt=function(e){return function(t,n,r){return n===void 0&&(n=[]),t<.5?e(t*2,n,r)/2:1-e(t*-2+2,n,r)/2}},Et=function(e){return function(t,n,r){return n===void 0&&(n=[]),t<.5?(1-e(1-t*2,n,r))/2:(e(t*2-1,n,r)+1)/2}},vd={steps:Sl,"step-start":function(e){return Sl(e,[1,"start"])},"step-end":function(e){return Sl(e,[1,"end"])},linear:function(e){return e},"cubic-bezier":pd,ease:function(e){return pd(e,[.25,.1,.25,1])},in:ho,out:gt(ho),"in-out":xt(ho),"out-in":Et(ho),"in-quad":no,"out-quad":gt(no),"in-out-quad":xt(no),"out-in-quad":Et(no),"in-cubic":ro,"out-cubic":gt(ro),"in-out-cubic":xt(ro),"out-in-cubic":Et(ro),"in-quart":io,"out-quart":gt(io),"in-out-quart":xt(io),"out-in-quart":Et(io),"in-quint":ao,"out-quint":gt(ao),"in-out-quint":xt(ao),"out-in-quint":Et(ao),"in-expo":oo,"out-expo":gt(oo),"in-out-expo":xt(oo),"out-in-expo":Et(oo),"in-sine":so,"out-sine":gt(so),"in-out-sine":xt(so),"out-in-sine":Et(so),"in-circ":lo,"out-circ":gt(lo),"in-out-circ":xt(lo),"out-in-circ":Et(lo),"in-back":uo,"out-back":gt(uo),"in-out-back":xt(uo),"out-in-back":Et(uo),"in-bounce":fo,"out-bounce":gt(fo),"in-out-bounce":xt(fo),"out-in-bounce":Et(fo),"in-elastic":co,"out-elastic":gt(co),"in-out-elastic":xt(co),"out-in-elastic":Et(co),spring:Oi,"spring-in":Oi,"spring-out":gt(Oi),"spring-in-out":xt(Oi),"spring-out-in":Et(Oi)},Ew=function(e){return xw(e).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},ww=function(e){return vd[Ew(e)]||vd.linear},Pw=function(e){return e},Mw=1,Sw=.5,yd=0;function md(e,t){return function(n){if(n>=1)return 1;var r=1/e;return n+=t*r,n-n%r}}var po="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Tw=new RegExp("cubic-bezier\\("+po+","+po+","+po+","+po+"\\)"),Cw=/steps\(\s*(\d+)\s*\)/,kw=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function qf(e){var t=Tw.exec(e);if(t)return Kf.apply(void 0,Z([],F(t.slice(1).map(Number)),!1));var n=Cw.exec(e);if(n)return md(Number(n[1]),yd);var r=kw.exec(e);return r?md(Number(r[1]),{start:Mw,middle:Sw,end:yd}[r[2]]):ww(e)}function Nw(e){return Math.abs(Ow(e)/(e.playbackRate||1))}function Ow(e){var t;return e.duration===0||e.iterations===0?0:(e.duration==="auto"?0:Number(e.duration))*((t=e.iterations)!==null&&t!==void 0?t:1)}var O0=0,Qf=1,As=2,R0=3;function Rw(e,t,n){if(t===null)return O0;var r=n.endTime;return t=Math.min(n.delay+e+n.endDelay,r)?As:R0}function _w(e,t,n,r,i){switch(r){case Qf:return t==="backwards"||t==="both"?0:null;case R0:return n-i;case As:return t==="forwards"||t==="both"?e:null;case O0:return null}}function Aw(e,t,n,r,i){var a=i;return e===0?t!==Qf&&(a+=n):a+=r/e,a}function Lw(e,t,n,r,i,a){var o=e===1/0?t%1:e%1;return o===0&&n===As&&r!==0&&(i!==0||a===0)&&(o=1),o}function Iw(e,t,n,r){return e===As&&t===1/0?1/0:n===1?Math.floor(r)-1:Math.floor(r)}function Dw(e,t,n){var r=e;if(e!=="normal"&&e!=="reverse"){var i=t;e==="alternate-reverse"&&(i+=1),r="normal",i!==1/0&&i%2!==0&&(r="reverse")}return r==="normal"?n:1-n}function bw(e,t,n){var r=Rw(e,t,n),i=_w(e,n.fill,t,r,n.delay);if(i===null)return null;var a=n.duration==="auto"?0:n.duration,o=Aw(a,r,n.iterations,i,n.iterationStart),s=Lw(o,n.iterationStart,r,n.iterations,i,a),l=Iw(r,n.iterations,s,o),u=Dw(n.direction,l,s);return n.currentIteration=l,n.progress=u,n.easingFunction(u)}function Fw(e,t,n){var r=Bw(e,t),i=zw(r,n);return function(a,o){if(o!==null)i.filter(function(l){return o>=l.applyFrom&&o1)throw new Error("Keyframe offsets must be between 0 and 1.");u.computedOffset=c}}else if(f==="composite"&&["replace","add","accumulate","auto"].indexOf(c)===-1)throw new Error("".concat(c," compositing is not supported"));u[f]=c}return u.offset===void 0&&(u.offset=null),u.easing===void 0&&(u.easing=(t==null?void 0:t.easing)||"linear"),u.composite===void 0&&(u.composite="auto"),u}),r=!0,i=-1/0,a=0;a=0&&Number(l.offset)<=1});function s(){var l,u,f=n.length;n[f-1].computedOffset=Number((l=n[f-1].offset)!==null&&l!==void 0?l:1),f>1&&(n[0].computedOffset=Number((u=n[0].offset)!==null&&u!==void 0?u:0));for(var c=0,h=Number(n[0].computedOffset),p=1;pa?i:a,s=i>a?1:i/a,l=i>a?a/i:1;e.save(),e.scale(s,l),e.arc(o,o,o,0,Math.PI*2)}}function Zw(e,t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2,o=t.defX,s=o===void 0?0:o,l=t.defY,u=l===void 0?0:l,f=t.markerStart,c=t.markerEnd,h=t.markerStartOffset,p=t.markerEndOffset,v=0,y=0,d=0,m=0,g=0,E,P;f&&ne(f)&&h&&(E=i-n,P=a-r,g=Math.atan2(P,E),v=Math.cos(g)*(h||0),y=Math.sin(g)*(h||0)),c&&ne(c)&&p&&(E=n-i,P=r-a,g=Math.atan2(P,E),d=Math.cos(g)*(p||0),m=Math.sin(g)*(p||0)),e.moveTo(n-s+v,r-u+y),e.lineTo(i-s+d,a-u+m)}function Jw(e,t){var n=t.defX,r=n===void 0?0:n,i=t.defY,a=i===void 0?0:i,o=t.markerStart,s=t.markerEnd,l=t.markerStartOffset,u=t.markerEndOffset,f=t.path,c=f.absolutePath,h=f.segments,p=0,v=0,y=0,d=0,m=0,g,E;if(o&&ne(o)&&l){var P=F(o.parentNode.getStartTangent(),2),w=P[0],x=P[1];g=w[0]-x[0],E=w[1]-x[1],m=Math.atan2(E,g),p=Math.cos(m)*(l||0),v=Math.sin(m)*(l||0)}if(s&&ne(s)&&u){var M=F(s.parentNode.getEndTangent(),2),w=M[0],x=M[1];g=w[0]-x[0],E=w[1]-x[1],m=Math.atan2(E,g),y=Math.cos(m)*(u||0),d=Math.sin(m)*(u||0)}for(var S=0;SH?L:H,ie=L>H?1:L/H,ue=L>H?H/L:1;e.translate(z-r,W-a),e.rotate(I),e.scale(ie,ue),e.arc(0,0,j,$,Te,!!(1-Y)),e.scale(1/ie,1/ue),e.rotate(-I),e.translate(-(z-r),-(W-a))}_&&e.lineTo(T[6]-r+y,T[7]-a+d);break}case"Z":e.closePath();break}}}function eP(e,t){var n=t.defX,r=n===void 0?0:n,i=t.defY,a=i===void 0?0:i,o=t.markerStart,s=t.markerEnd,l=t.markerStartOffset,u=t.markerEndOffset,f=t.points.points,c=f.length,h=f[0][0]-r,p=f[0][1]-a,v=f[c-1][0]-r,y=f[c-1][1]-a,d=0,m=0,g=0,E=0,P=0,w,x;o&&ne(o)&&l&&(w=f[1][0]-f[0][0],x=f[1][1]-f[0][1],P=Math.atan2(x,w),d=Math.cos(P)*(l||0),m=Math.sin(P)*(l||0)),s&&ne(s)&&u&&(w=f[c-1][0]-f[0][0],x=f[c-1][1]-f[0][1],P=Math.atan2(x,w),g=Math.cos(P)*(u||0),E=Math.sin(P)*(u||0)),e.moveTo(h+(d||g),p+(m||E));for(var M=1;M0?1:-1,u=i>0?1:-1,f=l+u===0,c=F(n.map(function(d){return ht(d,0,Math.min(Math.abs(a)/2,Math.abs(o)/2))}),4),h=c[0],p=c[1],v=c[2],y=c[3];e.moveTo(l*h,0),e.lineTo(a-l*p,0),p!==0&&e.arc(a-l*p,u*p,p,-u*Math.PI/2,l>0?0:Math.PI,f),e.lineTo(a,o-u*v),v!==0&&e.arc(a-l*v,o-u*v,v,l>0?0:Math.PI,u>0?Math.PI/2:1.5*Math.PI,f),e.lineTo(l*y,o),y!==0&&e.arc(l*y,o-u*y,y,u>0?Math.PI/2:-Math.PI/2,l>0?Math.PI:0,f),e.lineTo(0,u*h),h!==0&&e.arc(l*h,u*h,h,l>0?Math.PI:0,u>0?Math.PI*1.5:Math.PI/2,f)}}var rP=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.name="canvas-path-generator",n}return t.prototype.init=function(){var n,r=(n={},n[O.CIRCLE]=qw,n[O.ELLIPSE]=Qw,n[O.RECT]=nP,n[O.LINE]=Zw,n[O.POLYLINE]=tP,n[O.POLYGON]=eP,n[O.PATH]=Jw,n[O.TEXT]=void 0,n[O.GROUP]=void 0,n[O.IMAGE]=void 0,n[O.HTML]=void 0,n[O.MESH]=void 0,n);this.context.pathGeneratorFactory=r},t.prototype.destroy=function(){delete this.context.pathGeneratorFactory},t}(xr),iP=J(),aP=J(),oP=J(),sP=he(),lP=function(){function e(){var t=this;this.isHit=function(n,r,i,a){var o=t.context.pointInPathPickerFactory[n.nodeName];if(o){var s=Wt(sP,i),l=St(aP,Dt(oP,r[0],r[1],0),s),u=n.getGeometryBounds().halfExtents,f=n.parsedStyle.anchor;if(l[0]+=(f&&f[0]||0)*u[0]*2,l[1]+=(f&&f[1]||0)*u[1]*2,o(n,new De(l[0],l[1]),a,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(n,r){var i=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),a=t.context.pathGeneratorFactory[n.nodeName];return a&&(i.beginPath(),a(i,n.parsedStyle),i.closePath()),i.isPointInPath(r.x,r.y)}}return e.prototype.apply=function(t,n){var r=this,i,a=t.renderingService,o=t.renderingContext;this.context=t,this.runtime=n;var s=(i=o.root)===null||i===void 0?void 0:i.ownerDocument;a.hooks.pick.tapPromise(e.tag,function(l){return pa(r,void 0,void 0,function(){return va(this,function(u){return[2,this.pick(s,l)]})})}),a.hooks.pickSync.tap(e.tag,function(l){return r.pick(s,l)})},e.prototype.pick=function(t,n){var r,i,a=n.topmost,o=n.position,s=o.x,l=o.y,u=Dt(iP,s,l,0),f=t.elementsFromBBox(u[0],u[1],u[0],u[1]),c=[];try{for(var h=mn(f),p=h.next();!p.done;p=h.next()){var v=p.value,y=v.getWorldTransform(),d=this.isHit(v,u,y,!1);if(d){var m=h0(v);if(m){var g=m.parsedStyle.clipPath,E=this.isHit(g,u,g.getWorldTransform(),!0);if(E){if(a)return n.picked=[v],n;c.push(v)}}else{if(a)return n.picked=[v],n;c.push(v)}}}}catch(P){r={error:P}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return n.picked=c,n},e.tag="CanvasPicker",e}();function uP(e,t,n){var r=e.parsedStyle,i=r.r,a=r.fill,o=r.stroke,s=r.lineWidth,l=r.increasedLineWidthForHitTesting,u=r.pointerEvents,f=((s||0)+(l||0))/2,c=un(i,i,t.x,t.y),h=F(Er(u,a,o),2),p=h[0],v=h[1];return p&&v||n?c<=i+f:p?c<=i:v?c>=i-f&&c<=i+f:!1}function vo(e,t,n,r){return e/(n*n)+t/(r*r)}function fP(e,t,n){var r=e.parsedStyle,i=r.rx,a=r.ry,o=r.fill,s=r.stroke,l=r.lineWidth,u=r.increasedLineWidthForHitTesting,f=r.pointerEvents,c=t.x,h=t.y,p=F(Er(f,o,s),2),v=p[0],y=p[1],d=((l||0)+(u||0))/2,m=(c-i)*(c-i),g=(h-a)*(h-a);return v&&y||n?vo(m,g,i+d,a+d)<=1:v?vo(m,g,i,a)<=1:y?vo(m,g,i-d,a-d)>=1&&vo(m,g,i+d,a+d)<=1:!1}function ir(e,t,n,r,i,a){return i>=e&&i<=e+n&&a>=t&&a<=t+r}function cP(e,t,n,r,i,a,o){var s=i/2;return ir(e-s,t-s,n,i,a,o)||ir(e+n-s,t-s,i,r,a,o)||ir(e+s,t+r-s,n,i,a,o)||ir(e-s,t+s,i,r,a,o)}function yo(e,t,n,r,i,a,o,s){var l=(Math.atan2(s-t,o-e)+Math.PI*2)%(Math.PI*2),u={x:e+n*Math.cos(l),y:t+n*Math.sin(l)};return un(u.x,u.y,o,s)<=a/2}function Pn(e,t,n,r,i,a,o){var s=Math.min(e,n),l=Math.max(e,n),u=Math.min(t,r),f=Math.max(t,r),c=i/2;return a>=s-c&&a<=l+c&&o>=u-c&&o<=f+c?J1(e,t,n,r,a,o)<=i/2:!1}function L0(e,t,n,r,i){var a=e.length;if(a<2)return!1;for(var o=0;o0!=Tl(s[1]-n)>0&&Tl(t-(n-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}function wd(e,t,n){for(var r=!1,i=0;iP&&T>w,y&&(y.resetTransform?y.resetTransform():y.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(y,0,0,m*d,g*d,i.background))});var v=function(y,d){y.isVisible()&&!y.isCulled()&&(r.renderDisplayObject(y,d,r.context,r.restoreStack,n),r.saveDirtyAABB(y));var m=y.sortable.sorted||y.childNodes;m.forEach(function(g){v(g,d)})};o.hooks.endFrame.tap(e.tag,function(){var y=f.getContext(),d=f.getDPR();if(kv(r.dprMatrix,[d,d,1]),We(r.vpMatrix,r.dprMatrix,a.getOrthoMatrix()),r.clearFullScreen)v(s.root,y);else{var m=r.safeMergeAABB.apply(r,Z([r.mergeDirtyAABBs(r.renderQueue)],F(r.removedRBushNodeAABBs.map(function(I){var Y=I.minX,j=I.minY,ie=I.maxX,ue=I.maxY,Re=new Oe;return Re.setMinMax([Y,j,0],[ie,ue,0]),Re})),!1));if(r.removedRBushNodeAABBs=[],Oe.isEmpty(m)){r.renderQueue=[];return}var g=r.convertAABB2Rect(m),E=g.x,P=g.y,w=g.width,x=g.height,M=St(r.vec3a,[E,P,0],r.vpMatrix),S=St(r.vec3b,[E+w,P,0],r.vpMatrix),T=St(r.vec3c,[E,P+x,0],r.vpMatrix),C=St(r.vec3d,[E+w,P+x,0],r.vpMatrix),k=Math.min(M[0],S[0],C[0],T[0]),N=Math.min(M[1],S[1],C[1],T[1]),_=Math.max(M[0],S[0],C[0],T[0]),A=Math.max(M[1],S[1],C[1],T[1]),z=Math.floor(k),W=Math.floor(N),L=Math.ceil(_-k),H=Math.ceil(A-N);y.save(),r.clearRect(y,z,W,L,H,i.background),y.beginPath(),y.rect(z,W,L,H),y.clip(),y.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]);var $=i.renderer.getConfig().enableDirtyRectangleRenderingDebug;$&&c.dispatchEvent(new He(it.DIRTY_RECTANGLE,{dirtyRect:{x:z,y:W,width:L,height:H}}));var Te=r.searchDirtyObjects(m);Te.sort(function(I,Y){return I.sortable.renderOrder-Y.sortable.renderOrder}).forEach(function(I){I&&I.isVisible()&&!I.isCulled()&&r.renderDisplayObject(I,y,r.context,r.restoreStack,n)}),y.restore(),r.renderQueue.forEach(function(I){r.saveDirtyAABB(I)}),r.renderQueue=[]}r.restoreStack.forEach(function(){y.restore()}),r.restoreStack=[]}),o.hooks.render.tap(e.tag,function(y){r.clearFullScreen||r.renderQueue.push(y)})},e.prototype.clearRect=function(t,n,r,i,a,o){t.clearRect(n,r,i,a),o&&(t.fillStyle=o,t.fillRect(n,r,i,a))},e.prototype.renderDisplayObject=function(t,n,r,i,a){var o=t.nodeName,s=i[i.length-1];s&&!(t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINS)&&(n.restore(),i.pop());var l=this.context.styleRendererFactory[o],u=this.pathGeneratorFactory[o],f=t.parsedStyle.clipPath;if(f){this.applyWorldTransform(n,f);var c=this.pathGeneratorFactory[f.nodeName];c&&(n.save(),i.push(t),n.beginPath(),c(n,f.parsedStyle),n.closePath(),n.clip())}l&&(this.applyWorldTransform(n,t),n.save(),this.applyAttributesToContext(n,t)),u&&(n.beginPath(),u(n,t.parsedStyle),t.nodeName!==O.LINE&&t.nodeName!==O.PATH&&t.nodeName!==O.POLYLINE&&n.closePath()),l&&(l.render(n,t.parsedStyle,t,r,this,a),n.restore()),t.renderable.dirty=!1},e.prototype.convertAABB2Rect=function(t){var n=t.getMin(),r=t.getMax(),i=2,a=Math.floor(n[0])-i,o=Math.floor(n[1])-i,s=Math.ceil(r[0])+i,l=Math.ceil(r[1])+i,u=s-a,f=l-o;return{x:a,y:o,width:u,height:f}},e.prototype.mergeDirtyAABBs=function(t){var n=new Oe;return t.forEach(function(r){var i=r.getRenderBounds();n.add(i);var a=r.renderable.dirtyRenderBounds;a&&n.add(a)}),n},e.prototype.searchDirtyObjects=function(t){var n=F(t.getMin(),2),r=n[0],i=n[1],a=F(t.getMax(),2),o=a[0],s=a[1],l=this.rBush.search({minX:r,minY:i,maxX:o,maxY:s});return l.map(function(u){var f=u.displayObject;return f})},e.prototype.saveDirtyAABB=function(t){var n=t.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new Oe);var r=t.getRenderBounds();r&&n.dirtyRenderBounds.update(r.center,r.halfExtents)},e.prototype.applyAttributesToContext=function(t,n){var r=n.parsedStyle,i=r.stroke,a=r.fill,o=r.opacity,s=r.lineDash,l=r.lineDashOffset;s&&t.setLineDash(s),U(l)||(t.lineDashOffset=l),U(o)||(t.globalAlpha*=o),!U(i)&&!Array.isArray(i)&&!i.isNone&&(t.strokeStyle=n.attributes.stroke),!U(a)&&!Array.isArray(a)&&!a.isNone&&(t.fillStyle=n.attributes.fill)},e.prototype.applyWorldTransform=function(t,n,r){var i=0,a=0,o=(n.parsedStyle||{}).anchor,s=o&&o[0]||0,l=o&&o[1]||0;if(s!==0||l!==0){var u=n.geometry.contentBounds,f=u&&u.halfExtents[0]*2||0,c=u&&u.halfExtents[1]*2||0;i=-(s*f),a=-(l*c)}r?(fr(this.tmpMat4,n.getLocalTransform()),this.vec3a[0]=i,this.vec3a[1]=a,this.vec3a[2]=0,_n(this.tmpMat4,this.tmpMat4,this.vec3a),We(this.tmpMat4,r,this.tmpMat4),We(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(fr(this.tmpMat4,n.getWorldTransform()),this.vec3a[0]=i,this.vec3a[1]=a,this.vec3a[2]=0,_n(this.tmpMat4,this.tmpMat4,this.vec3a),We(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},e.prototype.safeMergeAABB=function(){for(var t=[],n=0;n0,M=s.alpha===0,S=!!(E&&E.length),T=!U(m)&&g>0,C=r.nodeName,k=d==="inner",N=x&&T&&(C===O.PATH||C===O.LINE||C===O.POLYLINE||M||k);w&&(t.globalAlpha=u*f,N||hs(r,t,T),this.fill(t,r,s,l,i,a,o),N||this.clearShadowAndFilter(t,S,T)),x&&(t.globalAlpha=u*h,t.lineWidth=p,U(P)||(t.miterLimit=P),U(v)||(t.lineCap=v),U(y)||(t.lineJoin=y),N&&(k&&(t.globalCompositeOperation="source-atop"),hs(r,t,!0),k&&(this.stroke(t,r,c,i,a,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,S,!0))),this.stroke(t,r,c,i,a,o))},e.prototype.clearShadowAndFilter=function(t,n,r){if(r&&(t.shadowColor="transparent",t.shadowBlur=0),n){var i=t.filter;!U(i)&&i.indexOf("drop-shadow")>-1&&(t.filter=i.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},e.prototype.fill=function(t,n,r,i,a,o,s){var l=this;Array.isArray(r)?r.forEach(function(u){t.fillStyle=l.getColor(u,n,t),i?t.fill(i):t.fill()}):(xa(r)&&(t.fillStyle=this.getPattern(r,n,t,a,o,s)),i?t.fill(i):t.fill())},e.prototype.stroke=function(t,n,r,i,a,o){var s=this;Array.isArray(r)?r.forEach(function(l){t.strokeStyle=s.getColor(l,n,t),t.stroke()}):(xa(r)&&(t.strokeStyle=this.getPattern(r,n,t,i,a,o)),t.stroke())},e.prototype.getPattern=function(t,n,r,i,a,o){var s,l;if(t.image.nodeName==="rect"){var u=t.image.parsedStyle,f=u.width,c=u.height;l=i.contextService.getDPR();var h=i.config.offscreenCanvas;s=o.offscreenCanvasCreator.getOrCreateCanvas(h),s.width=f*l,s.height=c*l;var p=o.offscreenCanvasCreator.getOrCreateContext(h),v=[];t.image.forEach(function(d){a.renderDisplayObject(d,p,i,v,o)}),v.forEach(function(){p.restore()})}var y=this.imagePool.getOrCreatePatternSync(t,r,s,l,function(){n.renderable.dirty=!0,i.renderingService.dirtify()});return y},e.prototype.getColor=function(t,n,r){var i;if(t.type===Xt.LinearGradient||t.type===Xt.RadialGradient){var a=n.getGeometryBounds(),o=a&&a.halfExtents[0]*2||1,s=a&&a.halfExtents[1]*2||1;i=this.imagePool.getOrCreateGradient(X(X({type:t.type},t.value),{width:o,height:s}),r)}return i},e}();function hs(e,t,n){var r=e.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,l=r.shadowOffsetY;i&&i.length&&(t.filter=e.style.filter),n&&(t.shadowColor=a.toString(),t.shadowBlur=o||0,t.shadowOffsetX=s||0,t.shadowOffsetY=l||0)}var SP=function(){function e(t){this.imagePool=t}return e.prototype.render=function(t,n,r){var i=n.width,a=n.height,o=n.img,s=n.shadowColor,l=n.shadowBlur,u,f=i,c=a;if($e(o)?u=this.imagePool.getImageSync(o):(f||(f=o.width),c||(c=o.height),u=o),u){var h=!U(s)&&l>0;hs(r,t,h);try{t.drawImage(u,0,0,f,c)}catch{}}},e}(),TP=function(){function e(){}return e.prototype.render=function(t,n,r,i,a,o){var s=n,l=s.lineWidth,u=s.textAlign,f=s.textBaseline,c=s.lineJoin,h=s.miterLimit,p=s.letterSpacing,v=s.stroke,y=s.fill,d=s.fillOpacity,m=s.strokeOpacity,g=s.opacity,E=s.metrics,P=s.dx,w=s.dy,x=s.shadowColor,M=s.shadowBlur,S=E.font,T=E.lines,C=E.height,k=E.lineHeight,N=E.lineMetrics;t.font=S,t.lineWidth=l,t.textAlign=u==="middle"?"center":u;var _=f;!o.enableCSSParsing&&_==="alphabetic"&&(_="bottom"),t.lineJoin=c,U(h)||(t.miterLimit=h);var A=0;f==="middle"?A=-C/2-k/2:f==="bottom"||f==="alphabetic"||f==="ideographic"?A=-C:(f==="top"||f==="hanging")&&(A=-k);var z=P||0;A+=w||0,T.length===1&&(_==="bottom"?(_="middle",A-=.5*C):_==="top"&&(_="middle",A+=.5*C)),t.textBaseline=_;var W=!U(x)&&M>0;hs(r,t,W);for(var L=0;L=1?Math.ceil(i):1,this.dpr=i,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*n,H2(this.$canvas,t,n)),this.renderingContext.renderReasons.add(dr.CAMERA_CHANGED)},e.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},e.prototype.toDataURL=function(t){return t===void 0&&(t={}),pa(this,void 0,void 0,function(){var n,r;return va(this,function(i){return n=t.type,r=t.encoderOptions,[2,this.context.canvas.toDataURL(n,r)]})})},e}(),bP=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.name="canvas-context-register",n}return t.prototype.init=function(){this.context.ContextService=DP},t.prototype.destroy=function(){delete this.context.ContextService},t}(xr),Wn=function(e){Q(t,e);function t(n){var r=e.call(this,n)||this;return r.registerPlugin(new bP),r.registerPlugin(new IP),r.registerPlugin(new rP),r.registerPlugin(new CP),r.registerPlugin(new NP),r.registerPlugin(new PP),r.registerPlugin(new _P),r}return t}(ux);const FP="https://kongfandong.cn",D0="https://dogefs.s3.ladydaily.com/~/source/unsplash/photo-1459749411175-04bf5292ceea?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=320&h=320&q=80";function Yn(e,{x:t,y:n,r,shadowColor:i}){const a=i?{shadowColor:i,shadowBlur:16}:{},o=new zn({style:{cx:t,cy:n,r,fill:"#262626",...a}}),s=new w0({id:"audioImg",style:{x:t-r,y:n-r,width:2*r,height:2*r,transformOrigin:"center",clipPath:new zn({style:{cx:t,cy:n,r}}),img:D0}});e==null||e.appendChild(o),e==null||e.appendChild(s);const l=s==null?void 0:s.animate([{transform:"rotate(0)"},{transform:"rotate(360deg)"}],{duration:12e3,iterations:1/0});return setTimeout(()=>{l==null||l.pause()}),s}const oe=150,se=150,de=80;function Xn(e,t,n,r){G.useEffect(()=>{setTimeout(()=>{var a;const i=(a=t.current)==null?void 0:a.getAnimations();if(i&&i.length){const o=i[0];n?o.play():o.pause()}})},[n]),G.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.document.querySelector("#audioImg");i&&i.setAttribute("img",r)},[r])}function BP(e){const i="#e9dcf7",a=G.useRef(),o=G.useRef(),s=G.useRef([]);function l(u){return u.reduce((c,h,p)=>(p%2&&c.push(h),c),[])}return G.useEffect(()=>{var u;(u=e.data)!=null&&u.length&&l(e.data).map((c,h)=>{s.current[h].attr("height",c*c/65025*50+4)})},[e.data]),G.useEffect(()=>{a.current=new Hn({container:"SLine",width:2*oe,height:2*se,renderer:new Wn}),o.current=Yn(a.current,{x:oe,y:se,r:de,shadowColor:i}),s.current=Array.from({length:64},(u,f)=>{var d;const c=f*5.625-150,h=Math.cos(c*Math.PI/180),p=Math.sin(c*Math.PI/180),v=de+10,y=new M0({style:{width:4,height:4,radius:4/2,x:oe+h*v,y:se+p*v,fill:i}});return y.setOrigin(oe+h*v,se+p*v),y.rotate(c-90),(d=a.current)==null||d.appendChild(y),y})},[]),Xn(a,o,e.isPlaying,e.audioImg),te.jsx("div",{id:"SLine",className:"s-canvas-wrapper"})}function Ls(e,t=5,n=.8){if(t<3||t>13||t%2===0)throw new Error("num value muse be singular, num >= 3, num <= 13");return e.map((r,i)=>{const a=i%t,o=(t-1)/2-a,s=e[i+o];return~~(s?s*n**Math.abs(o):r)})}function zP(e,t,n){return`M ${e-n}, ${t} +Add a component higher in the tree to provide a loading indicator or placeholder to display.`)}ze!==5&&(ze=2),l=Of(l,s),h=o;do{switch(h.tag){case 3:a=l,h.flags|=4096,t&=-t,h.lanes|=t;var w=av(h,a,t);$c(h,w);break e;case 1:a=l;var x=h.type,M=h.stateNode;if(!(h.flags&64)&&(typeof x.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function"&&(Vt===null||!Vt.has(M)))){h.flags|=4096,t&=-t,h.lanes|=t;var S=ov(h,a,t);$c(h,S);break e}}h=h.return}while(h!==null)}pv(n)}catch(T){t=T,_e===n&&n!==null&&(_e=n=n.return);continue}break}while(1)}function hv(){var e=Zo.current;return Zo.current=Qo,e===null?Qo:e}function Ii(e,t){var n=q;q|=16;var r=hv();Qe===e&&Ye===t||$r(e,t);do try{zm();break}catch(i){cv(e,i)}while(1);if(xf(),q=n,Zo.current=r,_e!==null)throw Error(b(261));return Qe=null,Ye=0,ze}function zm(){for(;_e!==null;)dv(_e)}function Um(){for(;_e!==null&&!wm();)dv(_e)}function dv(e){var t=yv(e.alternate,e,ur);e.memoizedProps=e.pendingProps,t===null?pv(e):_e=t,Rf.current=null}function pv(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&2048){if(n=_m(t),n!==null){n.flags&=2047,_e=n;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(n=Rm(n,t,ur),n!==null){_e=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||ur&1073741824||!(n.mode&4)){for(var r=0,i=n.child;i!==null;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}e!==null&&!(e.flags&2048)&&(e.firstEffect===null&&(e.firstEffect=t.firstEffect),t.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1o&&(s=o,o=w,w=s),s=Ac(g,w),a=Ac(g,o),s&&a&&(P.rangeCount!==1||P.anchorNode!==s.node||P.anchorOffset!==s.offset||P.focusNode!==a.node||P.focusOffset!==a.offset)&&(E=E.createRange(),E.setStart(s.node,s.offset),P.removeAllRanges(),w>o?(P.addRange(E),P.extend(a.node,a.offset)):(E.setEnd(a.node,a.offset),P.addRange(E)))))),E=[],P=g;P=P.parentNode;)P.nodeType===1&&E.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;gVe()-Af?$r(e,0):_f|=n),kt(e,t)}function Xm(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,t&2?t&4?(nn===0&&(nn=ci),t=Or(62914560&~nn),t===0&&(t=4194304)):t=ni()===99?1:2:t=1),n=pt(),e=Ts(e,t),e!==null&&(ms(e,t,n),kt(e,n))}var yv;yv=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||at.current)bt=!0;else if(n&r)bt=!!(e.flags&16384);else{switch(bt=!1,t.tag){case 3:oh(t),Js();break;case 5:Qc(t);break;case 1:ot(t.type)&&Po(t);break;case 4:Kl(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;Se(Go,i._currentValue),i._currentValue=r;break;case 13:if(t.memoizedState!==null)return n&t.child.childLanes?sh(e,t,n):(Se(Me,Me.current&1),t=on(e,t,n),t!==null?t.sibling:null);Se(Me,Me.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&64){if(r)return hh(e,t,n);t.flags|=64}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Se(Me,Me.current),r)break;return null;case 23:case 24:return t.lanes=0,el(e,t,n)}return on(e,t,n)}else bt=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=ti(t,Xe.current),Wr(t,n),i=Tf(null,t,r,e,i,n),t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,ot(r)){var a=!0;Po(t)}else a=!1;t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,wf(t);var o=r.getDerivedStateFromProps;typeof o=="function"&&Wo(t,r,o,e),i.updater=Ms,t.stateNode=i,i._reactInternals=t,jl(t,r,e,n),t=Jl(null,t,r,!0,a,n)}else t.tag=0,nt(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=jm(i),e=It(i,e),a){case 0:t=Zl(null,t,i,e,n);break e;case 1:t=ah(null,t,i,e,n);break e;case 11:t=rh(null,t,i,e,n);break e;case 14:t=ih(null,t,i,It(i.type,e),r,n);break e}throw Error(b(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),Zl(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),ah(e,t,r,i,n);case 3:if(oh(t),r=t.updateQueue,e===null||r===null)throw Error(b(282));if(r=t.pendingProps,i=t.memoizedState,i=i!==null?i.element:null,Gp(e,t),fa(t,r,null,n),r=t.memoizedState.element,r===i)Js(),t=on(e,t,n);else{if(i=t.stateNode,(a=i.hydrate)&&(En=Vr(t.stateNode.containerInfo.firstChild),an=t,a=jt=!0),a){if(e=i.mutableSourceEagerHydrationData,e!=null)for(i=0;i"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(gv)}catch(e){console.error(e)}}gv(),Hd.exports=Nt;var tg=Hd.exports;const ng=Uu(tg);const Zt=new window.AudioContext;class rg{constructor(t){wr(this,"analyser");wr(this,"gainNode");wr(this,"audioSource");wr(this,"options");wr(this,"visualArr");const n={size:128};this.options={...n,...t},this.analyser=Zt.createAnalyser(),this.analyser.fftSize=this.options.size*2,this.gainNode=Zt.createGain(),this.gainNode.connect(Zt.destination),this.analyser.connect(this.gainNode),this.options.audioEl&&(this.audioSource=Zt.createMediaElementSource(this.options.audioEl),this.audioSource.connect(this.analyser)),this.visualArr=new Uint8Array(this.analyser.frequencyBinCount),this.resumeAudioContext()}resumeAudioContext(){if(Zt){const t=()=>{Zt.state==="suspended"&&Zt.resume(),document.removeEventListener("click",t)};document.addEventListener("click",t)}}destory(){var t;this.analyser.disconnect(this.gainNode),(t=this.audioSource)==null||t.disconnect(this.analyser),this.gainNode.disconnect(Zt.destination)}setAudioEl(t){this.audioSource&&this.audioSource.disconnect(this.analyser),this.audioSource=Zt.createMediaElementSource(t),this.audioSource.connect(this.analyser)}changeVolumn(t){this.gainNode.gain.value=t}getVisualizeValue(){return this.analyser.getByteFrequencyData(this.visualArr),this.visualArr}}const ig="_page_1wv6c_1",ag="_operationWrapper_1wv6c_4",og="_audioWrapper_1wv6c_10",sg="_exampleWrapper_1wv6c_14",lg="_footer_1wv6c_22",ug="_github_1wv6c_35",Mr={page:ig,operationWrapper:ag,audioWrapper:og,exampleWrapper:sg,footer:lg,github:ug};var hu=function(e,t){return hu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},hu(e,t)};function Q(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");hu(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var X=function(){return X=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function F(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Z(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r0?(n[0]=(s*o+f*r+l*a-u*i)*2/c,n[1]=(l*o+f*i+u*r-s*a)*2/c,n[2]=(u*o+f*a+s*i-l*r)*2/c):(n[0]=(s*o+f*r+l*a-u*i)*2,n[1]=(l*o+f*i+u*r-s*a)*2,n[2]=(u*o+f*a+s*i-l*r)*2),Nv(e,t,n),e}function ns(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function ii(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],s=t[6],l=t[8],u=t[9],f=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,o,s),e[2]=Math.hypot(l,u,f),e}function rs(e,t){var n=new Ne(3);ii(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],o=t[0]*r,s=t[1]*i,l=t[2]*a,u=t[4]*r,f=t[5]*i,c=t[6]*a,h=t[8]*r,p=t[9]*i,v=t[10]*a,m=o+f+v,d=0;return m>0?(d=Math.sqrt(m+1)*2,e[3]=.25*d,e[0]=(c-p)/d,e[1]=(h-l)/d,e[2]=(s-u)/d):o>f&&o>v?(d=Math.sqrt(1+o-f-v)*2,e[3]=(c-p)/d,e[0]=.25*d,e[1]=(s+u)/d,e[2]=(h+l)/d):f>v?(d=Math.sqrt(1+f-o-v)*2,e[3]=(h-l)/d,e[0]=(s+u)/d,e[1]=.25*d,e[2]=(c+p)/d):(d=Math.sqrt(1+v-o-f)*2,e[3]=(s-u)/d,e[0]=(h+l)/d,e[1]=(c+p)/d,e[2]=.25*d),e}function Pg(e,t,n,r){var i=t[0],a=t[1],o=t[2],s=t[3],l=i+i,u=a+a,f=o+o,c=i*l,h=i*u,p=i*f,v=a*u,m=a*f,d=o*f,y=s*l,g=s*u,E=s*f,P=r[0],w=r[1],x=r[2];return e[0]=(1-(v+d))*P,e[1]=(h+E)*P,e[2]=(p-g)*P,e[3]=0,e[4]=(h-E)*w,e[5]=(1-(c+d))*w,e[6]=(m+y)*w,e[7]=0,e[8]=(p+g)*x,e[9]=(m-y)*x,e[10]=(1-(c+v))*x,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Qi(e,t,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],u=a+a,f=o+o,c=s+s,h=a*u,p=a*f,v=a*c,m=o*f,d=o*c,y=s*c,g=l*u,E=l*f,P=l*c,w=r[0],x=r[1],M=r[2],S=i[0],T=i[1],C=i[2],k=(1-(m+y))*w,N=(p+P)*w,_=(v-E)*w,A=(p-P)*x,z=(1-(h+y))*x,W=(d+g)*x,L=(v+E)*M,H=(d-g)*M,$=(1-(h+m))*M;return e[0]=k,e[1]=N,e[2]=_,e[3]=0,e[4]=A,e[5]=z,e[6]=W,e[7]=0,e[8]=L,e[9]=H,e[10]=$,e[11]=0,e[12]=n[0]+S-(k*S+A*T+L*C),e[13]=n[1]+T-(N*S+z*T+H*C),e[14]=n[2]+C-(_*S+W*T+$*C),e[15]=1,e}function zf(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n+n,s=r+r,l=i+i,u=n*o,f=r*o,c=r*s,h=i*o,p=i*s,v=i*l,m=a*o,d=a*s,y=a*l;return e[0]=1-c-v,e[1]=f+y,e[2]=h-d,e[3]=0,e[4]=f-y,e[5]=1-u-v,e[6]=p+m,e[7]=0,e[8]=h+d,e[9]=p-m,e[10]=1-u-c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Mg(e,t,n,r,i,a,o){var s=1/(n-t),l=1/(i-r),u=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*l,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(i+r)*l,e[10]=(o+a)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*u,e[15]=0,e}function Ov(e,t,n,r,i){var a=1/Math.tan(t/2),o;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(o=1/(r-i),e[10]=(i+r)*o,e[14]=2*i*r*o):(e[10]=-1,e[14]=-2*r),e}var Sg=Ov;function Tg(e,t,n,r,i){var a=1/Math.tan(t/2),o;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(o=1/(r-i),e[10]=i*o,e[14]=i*r*o):(e[10]=-1,e[14]=-r),e}function Cg(e,t,n,r){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-((o-s)*l*.5),e[9]=(i-a)*u*.5,e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e}function Rv(e,t,n,r,i,a,o){var s=1/(t-n),l=1/(r-i),u=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=(o+a)*u,e[15]=1,e}var _v=Rv;function Av(e,t,n,r,i,a,o){var s=1/(t-n),l=1/(r-i),u=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=u,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=a*u,e[15]=1,e}function Lv(e,t,n,r){var i,a,o,s,l,u,f,c,h,p,v=t[0],m=t[1],d=t[2],y=r[0],g=r[1],E=r[2],P=n[0],w=n[1],x=n[2];return Math.abs(v-P)0&&(p=1/Math.sqrt(p),f*=p,c*=p,h*=p);var v=l*h-u*c,m=u*f-s*h,d=s*c-l*f;return p=v*v+m*m+d*d,p>0&&(p=1/Math.sqrt(p),v*=p,m*=p,d*=p),e[0]=v,e[1]=m,e[2]=d,e[3]=0,e[4]=c*d-h*m,e[5]=h*v-f*d,e[6]=f*m-c*v,e[7]=0,e[8]=f,e[9]=c,e[10]=h,e[11]=0,e[12]=i,e[13]=a,e[14]=o,e[15]=1,e}function Ng(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function Og(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Rg(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function Iv(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function _g(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}function Ag(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e[9]=t[9]+n[9]*r,e[10]=t[10]+n[10]*r,e[11]=t[11]+n[11]*r,e[12]=t[12]+n[12]*r,e[13]=t[13]+n[13]*r,e[14]=t[14]+n[14]*r,e[15]=t[15]+n[15]*r,e}function Lg(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function Ig(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],c=e[9],h=e[10],p=e[11],v=e[12],m=e[13],d=e[14],y=e[15],g=t[0],E=t[1],P=t[2],w=t[3],x=t[4],M=t[5],S=t[6],T=t[7],C=t[8],k=t[9],N=t[10],_=t[11],A=t[12],z=t[13],W=t[14],L=t[15];return Math.abs(n-g)<=ye*Math.max(1,Math.abs(n),Math.abs(g))&&Math.abs(r-E)<=ye*Math.max(1,Math.abs(r),Math.abs(E))&&Math.abs(i-P)<=ye*Math.max(1,Math.abs(i),Math.abs(P))&&Math.abs(a-w)<=ye*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-x)<=ye*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(s-M)<=ye*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-S)<=ye*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(u-T)<=ye*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(f-C)<=ye*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(c-k)<=ye*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(h-N)<=ye*Math.max(1,Math.abs(h),Math.abs(N))&&Math.abs(p-_)<=ye*Math.max(1,Math.abs(p),Math.abs(_))&&Math.abs(v-A)<=ye*Math.max(1,Math.abs(v),Math.abs(A))&&Math.abs(m-z)<=ye*Math.max(1,Math.abs(m),Math.abs(z))&&Math.abs(d-W)<=ye*Math.max(1,Math.abs(d),Math.abs(W))&&Math.abs(y-L)<=ye*Math.max(1,Math.abs(y),Math.abs(L))}var Dg=We,bg=Iv;const Fg=Object.freeze(Object.defineProperty({__proto__:null,add:Rg,adjoint:pg,clone:wv,copy:fr,create:he,determinant:Mv,equals:Ig,exactEquals:Lg,frob:Og,fromQuat:zf,fromQuat2:wg,fromRotation:mg,fromRotationTranslation:Nv,fromRotationTranslationScale:Pg,fromRotationTranslationScaleOrigin:Qi,fromScaling:kv,fromTranslation:Cv,fromValues:dg,fromXRotation:gg,fromYRotation:xg,fromZRotation:Eg,frustum:Mg,getRotation:rs,getScaling:ii,getTranslation:ns,identity:Oa,invert:Wt,lookAt:Lv,mul:Dg,multiply:We,multiplyScalar:_g,multiplyScalarAndAdd:Ag,ortho:_v,orthoNO:Rv,orthoZO:Av,perspective:Sg,perspectiveFromFieldOfView:Cg,perspectiveNO:Ov,perspectiveZO:Tg,rotate:vg,rotateX:Sv,rotateY:Tv,rotateZ:yg,scale:ts,set:du,str:Ng,sub:bg,subtract:Iv,targetTo:kg,translate:_n,transpose:Pv},Symbol.toStringTag,{value:"Module"}));function J(){var e=new Ne(3);return Ne!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function en(e){var t=new Ne(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function rn(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function fe(e,t,n){var r=new Ne(3);return r[0]=e,r[1]=t,r[2]=n,r}function rt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Dt(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function Kr(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function Ph(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function Bg(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function pu(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function zg(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return Math.hypot(n,r,i)}function or(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function Yt(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function No(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],l=n[2];return e[0]=i*l-a*s,e[1]=a*o-r*l,e[2]=r*s-i*o,e}function vu(e,t,n,r){var i=t[0],a=t[1],o=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=o+r*(n[2]-o),e}function St(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,e[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,e[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,e}function Ug(e,t,n){var r=t[0],i=t[1],a=t[2];return e[0]=r*n[0]+i*n[3]+a*n[6],e[1]=r*n[1]+i*n[4]+a*n[7],e[2]=r*n[2]+i*n[5]+a*n[8],e}function Gg(e,t,n){var r=n[0],i=n[1],a=n[2],o=n[3],s=t[0],l=t[1],u=t[2],f=i*u-a*l,c=a*s-r*u,h=r*l-i*s,p=i*h-a*c,v=a*f-r*h,m=r*c-i*f,d=o*2;return f*=d,c*=d,h*=d,p*=2,v*=2,m*=2,e[0]=s+f+p,e[1]=l+c+v,e[2]=u+h+m,e}function Ci(e,t){var n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],s=t[2];return Math.abs(n-a)<=ye*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=ye*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=ye*Math.max(1,Math.abs(i),Math.abs(s))}var Mh=zg,Dv=rn;(function(){var e=J();return function(t,n,r,i,a,o){var s,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,s=r;s0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=r*o,e[2]=i*o,e[3]=a*o,e}function Di(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,e}(function(){var e=Fr();return function(t,n,r,i,a,o){var s,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,s=r;sye?(h=Math.acos(p),v=Math.sin(h),m=Math.sin((1-r)*h)/v,d=Math.sin(r*h)/v):(m=1-r,d=r),e[0]=m*i+d*l,e[1]=m*a+d*u,e[2]=m*o+d*f,e[3]=m*s+d*c,e}function sl(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=a*s,e}function Yg(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+o]-t[o*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[o]=(t[o*3+i]+t[i*3+o])*r}return e}function ja(e,t,n,r){var i=.5*Math.PI/180;t*=i,n*=i,r*=i;var a=Math.sin(t),o=Math.cos(t),s=Math.sin(n),l=Math.cos(n),u=Math.sin(r),f=Math.cos(r);return e[0]=a*l*f-o*s*u,e[1]=o*s*f+a*l*u,e[2]=o*l*u-a*s*f,e[3]=o*l*f+a*s*u,e}var ll=Hg,Ka=Vg,Sh=An,is=Wg;(function(){var e=J(),t=fe(1,0,0),n=fe(0,1,0);return function(r,i,a){var o=Yt(i,a);return o<-.999999?(No(e,t,i),Dv(e)<1e-6&&No(e,n,i),or(e,e),wn(r,e,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(No(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+o,is(r,r))}})();(function(){var e=Ce(),t=Ce();return function(n,r,i,a,o,s){return ol(e,r,o,s),ol(t,i,a,s),ol(n,e,t,2*s*(1-s)),n}})();(function(){var e=Ev();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],is(t,Yg(t,e))}})();function Xg(){var e=new Ne(2);return Ne!=Float32Array&&(e[0]=0,e[1]=0),e}function $g(e,t){var n=new Ne(2);return n[0]=e,n[1]=t,n}function jg(e,t){return e[0]=t[0],e[1]=t[1],e}function Kg(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e}function qg(e,t){return e[0]*t[0]+e[1]*t[1]}function Qg(e,t){return e[0]===t[0]&&e[1]===t[1]}(function(){var e=Xg();return function(t,n,r,i,a,o){var s,l;for(n||(n=2),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,s=r;sn?n:e};const ht=t1;var n1=function(e){return ks(e,"Number")};const Ft=n1;var r1=1e-5;function Zi(e,t,n){return n===void 0&&(n=r1),Math.abs(e-t)7){e[n].shift();for(var r=e[n],i=n;r.length;)t[n]="A",e.splice(i+=1,0,["C"].concat(r.splice(0,6)));e.splice(n,1)}}var Ji={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function zv(e){return Array.isArray(e)&&e.every(function(t){var n=t[0].toLowerCase();return Ji[n]===t.length-1&&"achlmqstvz".includes(n)})}function Uv(e){return zv(e)&&e.every(function(t){var n=t[0];return n===n.toUpperCase()})}function Gv(e){return Uv(e)&&e.every(function(t){var n=t[0];return"ACLMQZ".includes(n)})}function Nh(e){for(var t=e.pathValue[e.segmentStart],n=t.toLowerCase(),r=e.data;r.length>=Ji[n]&&(n==="m"&&r.length>2?(e.segments.push([t].concat(r.splice(0,2))),n="l",t=t==="m"?"l":"L"):e.segments.push([t].concat(r.splice(0,Ji[n]))),!!Ji[n]););}function l1(e){var t=e.index,n=e.pathValue,r=n.charCodeAt(t);if(r===48){e.param=0,e.index+=1;return}if(r===49){e.param=1,e.index+=1;return}e.err='[path-util]: invalid Arc flag "'+n[t]+'", expecting 0 or 1 at index '+t}function u1(e){return e>=48&&e<=57||e===43||e===45||e===46}function Sr(e){return e>=48&&e<=57}function f1(e){var t=e.max,n=e.pathValue,r=e.index,i=r,a=!1,o=!1,s=!1,l=!1,u;if(i>=t){e.err="[path-util]: Invalid path value at index "+i+', "pathValue" is missing param';return}if(u=n.charCodeAt(i),(u===43||u===45)&&(i+=1,u=n.charCodeAt(i)),!Sr(u)&&u!==46){e.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" is not a number';return}if(u!==46){if(a=u===48,i+=1,u=n.charCodeAt(i),a&&i=5760&&t.includes(e)}function Ro(e){for(var t=e.pathValue,n=e.max;e.index0;o-=1){if(d1(i)&&(o===3||o===4)?l1(e):f1(e),e.err.length)return;e.data.push(e.param),Ro(e),e.index=e.max||!u1(n.charCodeAt(e.index)))break}Nh(e)}var v1=function(){function e(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return e}();function y1(e){if(zv(e))return[].concat(e);var t=new v1(e);for(Ro(t);t.index1&&(C=Math.sqrt(C),h*=C,p*=C);var k=h*h,N=p*p,_=(a===o?-1:1)*Math.sqrt(Math.abs((k*N-k*T*T-N*S*S)/(k*T*T+N*S*S)));x=_*h*T/p+(f+v)/2,M=_*-p*S/h+(c+m)/2,P=Math.asin(((c-M)/p*Math.pow(10,9)>>0)/Math.pow(10,9)),w=Math.asin(((m-M)/p*Math.pow(10,9)>>0)/Math.pow(10,9)),P=fw&&(P-=Math.PI*2),!o&&w>P&&(w-=Math.PI*2)}var A=w-P;if(Math.abs(A)>d){var z=w,W=v,L=m;w=P+d*(o&&w>P?1:-1),v=x+h*Math.cos(w),m=M+p*Math.sin(w),g=Uf(v,m,h,p,i,0,o,W,L,[w,z,x,M])}A=w-P;var H=Math.cos(P),$=Math.sin(P),Te=Math.cos(w),I=Math.sin(w),Y=Math.tan(A/4),j=4/3*h*Y,ie=4/3*p*Y,ue=[f,c],Re=[f+j*$,c-ie*H],mt=[v+j*I,m-ie*Te],Bt=[v,m];if(Re[0]=2*ue[0]-Re[0],Re[1]=2*ue[1]-Re[1],u)return Re.concat(mt,Bt,g);g=Re.concat(mt,Bt,g);for(var Rt=[],_t=0,La=g.length;_t=a)o={x:n,y:r};else{var s=pn([e,t],[n,r],i/a),l=s[0],u=s[1];o={x:l,y:u}}return{length:a,point:o,min:{x:Math.min(e,n),y:Math.min(t,r)},max:{x:Math.max(e,n),y:Math.max(t,r)}}}function Rh(e,t){var n=e.x,r=e.y,i=t.x,a=t.y,o=n*i+r*a,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))),l=n*a-r*i<0?-1:1,u=l*Math.acos(o/s);return u}function S1(e,t,n,r,i,a,o,s,l,u){var f=Math.abs,c=Math.sin,h=Math.cos,p=Math.sqrt,v=Math.PI,m=f(n),d=f(r),y=(i%360+360)%360,g=y*(v/180);if(e===s&&t===l)return{x:e,y:t};if(m===0||d===0)return mu(e,t,s,l,u).point;var E=(e-s)/2,P=(t-l)/2,w={x:h(g)*E+c(g)*P,y:-c(g)*E+h(g)*P},x=Math.pow(w.x,2)/Math.pow(m,2)+Math.pow(w.y,2)/Math.pow(d,2);x>1&&(m*=p(x),d*=p(x));var M=Math.pow(m,2)*Math.pow(d,2)-Math.pow(m,2)*Math.pow(w.y,2)-Math.pow(d,2)*Math.pow(w.x,2),S=Math.pow(m,2)*Math.pow(w.y,2)+Math.pow(d,2)*Math.pow(w.x,2),T=M/S;T=T<0?0:T;var C=(a!==o?1:-1)*p(T),k={x:C*(m*w.y/d),y:C*(-(d*w.x)/m)},N={x:h(g)*k.x-c(g)*k.y+(e+s)/2,y:c(g)*k.x+h(g)*k.y+(t+l)/2},_={x:(w.x-k.x)/m,y:(w.y-k.y)/d},A=Rh({x:1,y:0},_),z={x:(-w.x-k.x)/m,y:(-w.y-k.y)/d},W=Rh(_,z);!o&&W>0?W-=2*v:o&&W<0&&(W+=2*v),W%=2*v;var L=A+W*u,H=m*h(L),$=d*c(L),Te={x:h(g)*H-c(g)*$+N.x,y:c(g)*H+h(g)*$+N.y};return Te}function T1(e,t,n,r,i,a,o,s,l,u,f){var c,h=f.bbox,p=h===void 0?!0:h,v=f.length,m=v===void 0?!0:v,d=f.sampleSize,y=d===void 0?30:d,g=typeof u=="number",E=e,P=t,w=0,x=[E,P,w],M=[E,P],S=0,T={x:0,y:0},C=[{x:E,y:P}];g&&u<=0&&(T={x:E,y:P});for(var k=0;k<=y;k+=1){if(S=k/y,c=S1(e,t,n,r,i,a,o,s,l,S),E=c.x,P=c.y,p&&C.push({x:E,y:P}),m&&(w+=ut(M,[E,P])),M=[E,P],g&&w>=u&&u>x[2]){var N=(w-u)/(w-x[2]);T={x:M[0]*(1-N)+x[0]*N,y:M[1]*(1-N)+x[1]*N}}x=[E,P,w]}return g&&u>=w&&(T={x:s,y:l}),{length:w,point:T,min:{x:Math.min.apply(null,C.map(function(_){return _.x})),y:Math.min.apply(null,C.map(function(_){return _.y}))},max:{x:Math.max.apply(null,C.map(function(_){return _.x})),y:Math.max.apply(null,C.map(function(_){return _.y}))}}}function C1(e,t,n,r,i,a,o,s,l){var u=1-l;return{x:Math.pow(u,3)*e+3*Math.pow(u,2)*l*n+3*u*Math.pow(l,2)*i+Math.pow(l,3)*o,y:Math.pow(u,3)*t+3*Math.pow(u,2)*l*r+3*u*Math.pow(l,2)*a+Math.pow(l,3)*s}}function Hv(e,t,n,r,i,a,o,s,l,u){var f,c=u.bbox,h=c===void 0?!0:c,p=u.length,v=p===void 0?!0:p,m=u.sampleSize,d=m===void 0?10:m,y=typeof l=="number",g=e,E=t,P=0,w=[g,E,P],x=[g,E],M=0,S={x:0,y:0},T=[{x:g,y:E}];y&&l<=0&&(S={x:g,y:E});for(var C=0;C<=d;C+=1){if(M=C/d,f=C1(e,t,n,r,i,a,o,s,M),g=f.x,E=f.y,h&&T.push({x:g,y:E}),v&&(P+=ut(x,[g,E])),x=[g,E],y&&P>=l&&l>w[2]){var k=(P-l)/(P-w[2]);S={x:x[0]*(1-k)+w[0]*k,y:x[1]*(1-k)+w[1]*k}}w=[g,E,P]}return y&&l>=P&&(S={x:o,y:s}),{length:P,point:S,min:{x:Math.min.apply(null,T.map(function(N){return N.x})),y:Math.min.apply(null,T.map(function(N){return N.y}))},max:{x:Math.max.apply(null,T.map(function(N){return N.x})),y:Math.max.apply(null,T.map(function(N){return N.y}))}}}function k1(e,t,n,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*e+2*s*o*n+Math.pow(o,2)*i,y:Math.pow(s,2)*t+2*s*o*r+Math.pow(o,2)*a}}function N1(e,t,n,r,i,a,o,s){var l,u=s.bbox,f=u===void 0?!0:u,c=s.length,h=c===void 0?!0:c,p=s.sampleSize,v=p===void 0?10:p,m=typeof o=="number",d=e,y=t,g=0,E=[d,y,g],P=[d,y],w=0,x={x:0,y:0},M=[{x:d,y}];m&&o<=0&&(x={x:d,y});for(var S=0;S<=v;S+=1){if(w=S/v,l=k1(e,t,n,r,i,a,w),d=l.x,y=l.y,f&&M.push({x:d,y}),h&&(g+=ut(P,[d,y])),P=[d,y],m&&g>=o&&o>E[2]){var T=(g-o)/(g-E[2]);x={x:P[0]*(1-T)+E[0]*T,y:P[1]*(1-T)+E[1]*T}}E=[d,y,g]}return m&&o>=g&&(x={x:i,y:a}),{length:g,point:x,min:{x:Math.min.apply(null,M.map(function(C){return C.x})),y:Math.min.apply(null,M.map(function(C){return C.y}))},max:{x:Math.max.apply(null,M.map(function(C){return C.x})),y:Math.max.apply(null,M.map(function(C){return C.y}))}}}function Vv(e,t,n){for(var r,i,a,o,s,l,u=as(e),f=typeof t=="number",c,h=[],p,v=0,m=0,d=0,y=0,g,E=[],P=[],w=0,x={x:0,y:0},M=x,S=x,T=x,C=0,k=0,N=u.length;k=t&&(T=S),P.push(M),E.push(x),C+=w,l=p!=="Z"?g.slice(-2):[d,y],v=l[0],m=l[1];return f&&t>=C&&(T={x:v,y:m}),{length:C,point:T,min:{x:Math.min.apply(null,E.map(function(_){return _.x})),y:Math.min.apply(null,E.map(function(_){return _.y}))},max:{x:Math.max.apply(null,P.map(function(_){return _.x})),y:Math.max.apply(null,P.map(function(_){return _.y}))}}}function O1(e,t){return Vv(e,void 0,X(X({},t),{bbox:!1,length:!0})).length}function R1(e){var t=e.length,n=t-1;return e.map(function(r,i){return e.map(function(a,o){var s=i+o,l;return o===0||e[s]&&e[s][0]==="M"?(l=e[s],["M"].concat(l.slice(-2))):(s>=t&&(s-=n),e[s])})})}function _1(e,t){var n=e.length-1,r=[],i=0,a=0,o=R1(e);return o.forEach(function(s,l){e.slice(1).forEach(function(u,f){a+=ut(e[(l+f)%n].slice(-2),t[f%n].slice(-2))}),r[l]=a,a=0}),i=r.indexOf(Math.min.apply(null,r)),o[i]}function A1(e,t,n,r,i,a,o,s){return 3*((s-t)*(n+i)-(o-e)*(r+a)+r*(e-i)-n*(t-a)+s*(i+e/3)-o*(a+t/3))/20}function L1(e){var t=0,n=0,r=0;return yu(e).map(function(i){var a;switch(i[0]){case"M":return t=i[1],n=i[2],0;default:var o=i.slice(1),s=o[0],l=o[1],u=o[2],f=o[3],c=o[4],h=o[5];return r=A1(t,n,s,l,u,f,c,h),a=i.slice(-2),t=a[0],n=a[1],r}}).reduce(function(i,a){return i+a},0)}function _h(e){return L1(e)>=0}function I1(e,t,n){return Vv(e,t,X(X({},n),{bbox:!1,length:!0})).point}function D1(e,t){t===void 0&&(t=.5);var n=e.slice(0,2),r=e.slice(2,4),i=e.slice(4,6),a=e.slice(6,8),o=pn(n,r,t),s=pn(r,i,t),l=pn(i,a,t),u=pn(o,s,t),f=pn(s,l,t),c=pn(u,f,t);return[["C"].concat(o,u,c),["C"].concat(f,l,a)]}function Ah(e){return e.map(function(t,n,r){var i=n&&r[n-1].slice(-2).concat(t.slice(1)),a=n?Hv(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0,o;return n?o=a?D1(i):[t,t]:o=[t],{s:t,ss:o,l:a}})}function Wv(e,t,n){var r=Ah(e),i=Ah(t),a=r.length,o=i.length,s=r.filter(function(d){return d.l}).length,l=i.filter(function(d){return d.l}).length,u=r.filter(function(d){return d.l}).reduce(function(d,y){var g=y.l;return d+g},0)/s||0,f=i.filter(function(d){return d.l}).reduce(function(d,y){var g=y.l;return d+g},0)/l||0,c=n||Math.max(a,o),h=[u,f],p=[c-a,c-o],v=0,m=[r,i].map(function(d,y){return d.l===c?d.map(function(g){return g.s}):d.map(function(g,E){return v=E&&p[y]&&g.l>=h[y],p[y]-=v?1:0,v?g.ss:[g.s]}).flat()});return m[0].length===m[1].length?m:Wv(m[0],m[1],c)}function Gf(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Yv(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ra(){}var ya=.7,os=1/ya,qr="\\s*([+-]?\\d+)\\s*",ma="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Kt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",b1=/^#([0-9a-f]{3,8})$/,F1=new RegExp("^rgb\\("+[qr,qr,qr]+"\\)$"),B1=new RegExp("^rgb\\("+[Kt,Kt,Kt]+"\\)$"),z1=new RegExp("^rgba\\("+[qr,qr,qr,ma]+"\\)$"),U1=new RegExp("^rgba\\("+[Kt,Kt,Kt,ma]+"\\)$"),G1=new RegExp("^hsl\\("+[ma,Kt,Kt]+"\\)$"),H1=new RegExp("^hsla\\("+[ma,Kt,Kt,ma]+"\\)$"),Lh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Gf(Ra,Ns,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:Ih,formatHex:Ih,formatHsl:V1,formatRgb:Dh,toString:Dh});function Ih(){return this.rgb().formatHex()}function V1(){return Xv(this).formatHsl()}function Dh(){return this.rgb().formatRgb()}function Ns(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=b1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?bh(t):n===3?new dt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Qa(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Qa(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=F1.exec(e))?new dt(t[1],t[2],t[3],1):(t=B1.exec(e))?new dt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=z1.exec(e))?Qa(t[1],t[2],t[3],t[4]):(t=U1.exec(e))?Qa(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=G1.exec(e))?zh(t[1],t[2]/100,t[3]/100,1):(t=H1.exec(e))?zh(t[1],t[2]/100,t[3]/100,t[4]):Lh.hasOwnProperty(e)?bh(Lh[e]):e==="transparent"?new dt(NaN,NaN,NaN,0):null}function bh(e){return new dt(e>>16&255,e>>8&255,e&255,1)}function Qa(e,t,n,r){return r<=0&&(e=t=n=NaN),new dt(e,t,n,r)}function W1(e){return e instanceof Ra||(e=Ns(e)),e?(e=e.rgb(),new dt(e.r,e.g,e.b,e.opacity)):new dt}function Y1(e,t,n,r){return arguments.length===1?W1(e):new dt(e,t,n,r??1)}function dt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Gf(dt,Y1,Yv(Ra,{brighter:function(e){return e=e==null?os:Math.pow(os,e),new dt(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=e==null?ya:Math.pow(ya,e),new dt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Fh,formatHex:Fh,formatRgb:Bh,toString:Bh}));function Fh(){return"#"+ul(this.r)+ul(this.g)+ul(this.b)}function Bh(){var e=this.opacity;return e=isNaN(e)?1:Math.max(0,Math.min(1,e)),(e===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(e===1?")":", "+e+")")}function ul(e){return e=Math.max(0,Math.min(255,Math.round(e)||0)),(e<16?"0":"")+e.toString(16)}function zh(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ut(e,t,n,r)}function Xv(e){if(e instanceof Ut)return new Ut(e.h,e.s,e.l,e.opacity);if(e instanceof Ra||(e=Ns(e)),!e)return new Ut;if(e instanceof Ut)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(n-r)/s+(n0&&l<1?0:o,new Ut(o,s,l,e.opacity)}function X1(e,t,n,r){return arguments.length===1?Xv(e):new Ut(e,t,n,r??1)}function Ut(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Gf(Ut,X1,Yv(Ra,{brighter:function(e){return e=e==null?os:Math.pow(os,e),new Ut(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=e==null?ya:Math.pow(ya,e),new Ut(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new dt(fl(e>=240?e-240:e+120,i,r),fl(e,i,r),fl(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return e=isNaN(e)?1:Math.max(0,Math.min(1,e)),(e===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(e===1?")":", "+e+")")}}));function fl(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function un(e,t,n,r){var i=e-n,a=t-r;return Math.sqrt(i*i+a*a)}function $v(e,t){var n=Math.min.apply(Math,Z([],F(e),!1)),r=Math.min.apply(Math,Z([],F(t),!1)),i=Math.max.apply(Math,Z([],F(e),!1)),a=Math.max.apply(Math,Z([],F(t),!1));return{x:n,y:r,width:i-n,height:a-r}}function $1(e,t,n){return Math.atan(-t/e*Math.tan(n))}function j1(e,t,n){return Math.atan(t/(e*Math.tan(n)))}function K1(e,t,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+e}function q1(e,t,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+t}function Q1(e,t,n,r,i,a,o){for(var s=$1(n,r,i),l=1/0,u=-1/0,f=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var h=s+c;au&&(u=p)}for(var v=j1(n,r,i),m=1/0,d=-1/0,y=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var g=v+c;ad&&(d=E)}return{x:l,y:m,width:u-l,height:d-m}}var Z1=1e-4;function jv(e,t,n,r,i,a){var o=-1,s=1/0,l=[n,r],u=20;a&&a>200&&(u=a/10);for(var f=1/u,c=f/10,h=0;h<=u;h++){var p=h*f,v=[i.apply(void 0,Z([],F(e.concat([p])),!1)),i.apply(void 0,Z([],F(t.concat([p])),!1))],m=un(l[0],l[1],v[0],v[1]);m=0&&m=0&&l<=1&&s.push(l));else{var c=a*a-4*i*o;Zi(c,0)?s.push(-a/(2*i)):c>0&&(f=Math.sqrt(c),l=(-a+f)/(2*i),u=(-a-f)/(2*i),l>=0&&l<=1&&s.push(l),u>=0&&u<=1&&s.push(u))}return s}function ex(e,t,n,r,i,a,o,s){for(var l=[e,o],u=[t,s],f=Uh(e,n,i,o),c=Uh(t,r,a,s),h=0;h=0?[i]:[]}function ix(e,t,n,r,i,a){var o=Hh(e,n,i)[0],s=Hh(t,r,a)[0],l=[e,i],u=[t,a];return o!==void 0&&l.push(xu(e,n,i,o)),s!==void 0&&u.push(xu(t,r,a,s)),$v(l,u)}function ax(e,t,n,r,i,a,o,s){return jv([e,n,i],[t,r,a],o,s,xu)}function ox(e,t,n,r,i,a,o,s){var l=ax(e,t,n,r,i,a,o,s);return un(l.x,l.y,o,s)}var sx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Qv={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(sx,function(){function n(w,x,M,S,T){r(w,x,M||0,S||w.length-1,T||a)}function r(w,x,M,S,T){for(;S>M;){if(S-M>600){var C=S-M+1,k=x-M+1,N=Math.log(C),_=.5*Math.exp(2*N/3),A=.5*Math.sqrt(N*_*(C-_)/C)*(k-C/2<0?-1:1),z=Math.max(M,Math.floor(x-k*_/C+A)),W=Math.min(S,Math.floor(x+(C-k)*_/C+A));r(w,x,z,W,T)}var L=w[x],H=M,$=S;for(i(w,M,x),T(w[S],L)>0&&i(w,M,S);H<$;){for(i(w,H,$),H++,$--;T(w[H],L)<0;)H++;for(;T(w[$],L)>0;)$--}T(w[M],L)===0?i(w,M,$):($++,i(w,$,S)),$<=x&&(M=$+1),x<=$&&(S=$-1)}}function i(w,x,M){var S=w[x];w[x]=w[M],w[M]=S}function a(w,x){return wx?1:0}var o=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(x){var M=this.data,S=[];if(!g(x,M))return S;for(var T=this.toBBox,C=[];M;){for(var k=0;k=0&&C[M].children.length>this._maxEntries;)this._split(C,M),M--;this._adjustParentBBoxes(T,C,M)},o.prototype._split=function(x,M){var S=x[M],T=S.children.length,C=this._minEntries;this._chooseSplitAxis(S,C,T);var k=this._chooseSplitIndex(S,C,T),N=E(S.children.splice(k,S.children.length-k));N.height=S.height,N.leaf=S.leaf,l(S,this.toBBox),l(N,this.toBBox),M?x[M-1].children.push(N):this._splitRoot(S,N)},o.prototype._splitRoot=function(x,M){this.data=E([x,M]),this.data.height=x.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(x,M,S){for(var T,C=1/0,k=1/0,N=M;N<=S-M;N++){var _=u(x,0,N,this.toBBox),A=u(x,N,S,this.toBBox),z=d(_,A),W=p(_)+p(A);z=M;W--){var L=x.children[W];f(N,x.leaf?C(L):L),_+=v(N)}return _},o.prototype._adjustParentBBoxes=function(x,M,S){for(var T=S;T>=0;T--)f(M[T],x)},o.prototype._condense=function(x){for(var M=x.length-1,S=void 0;M>=0;M--)x[M].children.length===0?M>0?(S=x[M-1].children,S.splice(S.indexOf(x[M]),1)):this.clear():l(x[M],this.toBBox)};function s(w,x,M){if(!M)return x.indexOf(w);for(var S=0;S=w.minX&&x.maxY>=w.minY}function E(w){return{children:w,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(w,x,M,S,T){for(var C=[x,M];C.length;)if(M=C.pop(),x=C.pop(),!(M-x<=S)){var k=x+Math.ceil((M-x)/S/2)*S;n(w,k,x,M,T),C.push(x,k,k,M)}}return o})})(Qv);var lx=Qv.exports,O;(function(e){e.GROUP="g",e.CIRCLE="circle",e.ELLIPSE="ellipse",e.IMAGE="image",e.RECT="rect",e.LINE="line",e.POLYLINE="polyline",e.POLYGON="polygon",e.TEXT="text",e.PATH="path",e.HTML="html",e.MESH="mesh"})(O||(O={}));var Qr;(function(e){e[e.ZERO=0]="ZERO",e[e.NEGATIVE_ONE=1]="NEGATIVE_ONE"})(Qr||(Qr={}));var xr=function(){function e(){this.plugins=[]}return e.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},e.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach(function(n){var r=t.context.renderingPlugins.indexOf(n);r>=0&&t.context.renderingPlugins.splice(r,1)})},e}(),ux=function(){function e(t){this.clipSpaceNearZ=Qr.NEGATIVE_ONE,this.plugins=[],this.config=X({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}return e.prototype.registerPlugin=function(t){var n=this.plugins.findIndex(function(r){return r===t});n===-1&&this.plugins.push(t)},e.prototype.unregisterPlugin=function(t){var n=this.plugins.findIndex(function(r){return r===t});n>-1&&this.plugins.splice(n,1)},e.prototype.getPlugins=function(){return this.plugins},e.prototype.getPlugin=function(t){return this.plugins.find(function(n){return n.name===t})},e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(t){Object.assign(this.config,t)},e}();function Tr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function cl(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function _o(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function Vh(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function fx(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function cx(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function Zr(e){return e===void 0?0:e>360||e<-360?e%360:e}function qe(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=0),Array.isArray(e)&&e.length===3?en(e):Ft(e)?fe(e,t,n):fe(e[0],e[1]||t,e[2]||n)}function ge(e){return e*(Math.PI/180)}function wt(e){return e*(180/Math.PI)}function hx(e){return 360*e}function dx(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n*n,s=r*r,l=i*i,u=a*a,f=o+s+l+u,c=n*a-r*i;return c>.499995*f?(e[0]=Math.PI/2,e[1]=2*Math.atan2(r,n),e[2]=0):c<-.499995*f?(e[0]=-Math.PI/2,e[1]=2*Math.atan2(r,n),e[2]=0):(e[0]=Math.asin(2*(n*i-a*r)),e[1]=Math.atan2(2*(n*a+r*i),1-2*(l+u)),e[2]=Math.atan2(2*(n*r+i*a),1-2*(s+l))),e}function px(e,t){var n,r,i=Math.PI*.5,a=F(ii(J(),t),3),o=a[0],s=a[1],l=a[2],u=Math.asin(-t[2]/o);return u-i?(n=Math.atan2(t[6]/s,t[10]/l),r=Math.atan2(t[1]/o,t[0]/o)):(r=0,n=-Math.atan2(t[4]/s,t[5]/s)):(r=0,n=Math.atan2(t[4]/s,t[5]/s)),e[0]=n,e[1]=u,e[2]=r,e}function hl(e,t){return t.length===16?px(e,t):dx(e,t)}function vx(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e);return hg(r*a,i*o,0,-r*o,i*a,0,t,n,1)}function yx(e,t,n,r,i,a,o,s){s===void 0&&(s=!1);var l=2*a/(n-t),u=2*a/(r-i),f=(n+t)/(n-t),c=(r+i)/(r-i),h,p;return s?(h=-o/(o-a),p=-o*a/(o-a)):(h=-(o+a)/(o-a),p=-2*o*a/(o-a)),e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=f,e[9]=c,e[10]=h,e[11]=-1,e[12]=0,e[13]=0,e[14]=p,e[15]=0,e}function Wh(e){var t=e[0],n=e[1],r=e[3],i=e[4],a=Math.sqrt(t*t+n*n),o=Math.sqrt(r*r+i*i),s=t*i-n*r;s<0&&(tK[1][2]&&(a[0]=-a[0]),K[0][2]>K[2][0]&&(a[1]=-a[1]),K[1][0]>K[0][1]&&(a[2]=-a[2]),!0}function gx(e,t){var n=t[15];if(n===0)return!1;for(var r=1/n,i=0;i<16;i++)e[i]=t[i]*r;return!0}function xx(e,t){e[0][0]=t[0],e[0][1]=t[1],e[0][2]=t[2],e[1][0]=t[4],e[1][1]=t[5],e[1][2]=t[6],e[2][0]=t[8],e[2][1]=t[9],e[2][2]=t[10]}function dl(e,t,n,r,i){e[0]=t[0]*r+n[0]*i,e[1]=t[1]*r+n[1]*i,e[2]=t[2]*r+n[2]*i}var Oe=function(){function e(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return e.isEmpty=function(t){return!t||t.halfExtents[0]===0&&t.halfExtents[1]===0&&t.halfExtents[2]===0},e.prototype.update=function(t,n){Tr(this.center,t),Tr(this.halfExtents,n),cl(this.min,this.center,this.halfExtents),_o(this.max,this.center,this.halfExtents)},e.prototype.setMinMax=function(t,n){_o(this.center,n,t),Vh(this.center,this.center,.5),cl(this.halfExtents,n,t),Vh(this.halfExtents,this.halfExtents,.5),Tr(this.min,t),Tr(this.max,n)},e.prototype.getMin=function(){return this.min},e.prototype.getMax=function(){return this.max},e.prototype.add=function(t){if(!e.isEmpty(t)){if(e.isEmpty(this)){this.setMinMax(t.getMin(),t.getMax());return}var n=this.center,r=n[0],i=n[1],a=n[2],o=this.halfExtents,s=o[0],l=o[1],u=o[2],f=r-s,c=r+s,h=i-l,p=i+l,v=a-u,m=a+u,d=t.center,y=d[0],g=d[1],E=d[2],P=t.halfExtents,w=P[0],x=P[1],M=P[2],S=y-w,T=y+w,C=g-x,k=g+x,N=E-M,_=E+M;Sc&&(c=T),Cp&&(p=k),Nm&&(m=_),n[0]=(f+c)*.5,n[1]=(h+p)*.5,n[2]=(v+m)*.5,o[0]=(c-f)*.5,o[1]=(p-h)*.5,o[2]=(m-v)*.5,this.min[0]=f,this.min[1]=h,this.min[2]=v,this.max[0]=c,this.max[1]=p,this.max[2]=m}},e.prototype.setFromTransformedAABB=function(t,n){var r=this.center,i=this.halfExtents,a=t.center,o=t.halfExtents,s=n[0],l=n[4],u=n[8],f=n[1],c=n[5],h=n[9],p=n[2],v=n[6],m=n[10],d=Math.abs(s),y=Math.abs(l),g=Math.abs(u),E=Math.abs(f),P=Math.abs(c),w=Math.abs(h),x=Math.abs(p),M=Math.abs(v),S=Math.abs(m);r[0]=n[12]+s*a[0]+l*a[1]+u*a[2],r[1]=n[13]+f*a[0]+c*a[1]+h*a[2],r[2]=n[14]+p*a[0]+v*a[1]+m*a[2],i[0]=d*o[0]+y*o[1]+g*o[2],i[1]=E*o[0]+P*o[1]+w*o[2],i[2]=x*o[0]+M*o[1]+S*o[2],cl(this.min,r,i),_o(this.max,r,i)},e.prototype.intersects=function(t){var n=this.getMax(),r=this.getMin(),i=t.getMax(),a=t.getMin();return r[0]<=i[0]&&n[0]>=a[0]&&r[1]<=i[1]&&n[1]>=a[1]&&r[2]<=i[2]&&n[2]>=a[2]},e.prototype.intersection=function(t){if(!this.intersects(t))return null;var n=new e,r=fx([0,0,0],this.getMin(),t.getMin()),i=cx([0,0,0],this.getMax(),t.getMax());return n.setMinMax(r,i),n},e.prototype.getNegativeFarPoint=function(t){return t.pnVertexFlag===273?Tr([0,0,0],this.min):t.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:t.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},e.prototype.getPositiveFarPoint=function(t){return t.pnVertexFlag===273?Tr([0,0,0],this.max):t.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:t.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},e}(),Ex=function(){function e(t,n){this.distance=t||0,this.normal=n||fe(0,1,0),this.updatePNVertexFlag()}return e.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)},e.prototype.distanceToPoint=function(t){return Yt(t,this.normal)-this.distance},e.prototype.normalize=function(){var t=1/Dv(this.normal);pu(this.normal,this.normal,t),this.distance*=t},e.prototype.intersectsLine=function(t,n,r){var i=this.distanceToPoint(t),a=this.distanceToPoint(n),o=i/(i-a),s=o>=0&&o<=1;return s&&r&&vu(r,t,n,o),s},e}(),vn;(function(e){e[e.OUTSIDE=4294967295]="OUTSIDE",e[e.INSIDE=0]="INSIDE",e[e.INDETERMINATE=2147483647]="INDETERMINATE"})(vn||(vn={}));var wx=function(){function e(t){if(this.planes=[],t)this.planes=t;else for(var n=0;n<6;n++)this.planes.push(new Ex)}return e.prototype.extractFromVPMatrix=function(t){var n=F(t,16),r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],u=n[6],f=n[7],c=n[8],h=n[9],p=n[10],v=n[11],m=n[12],d=n[13],y=n[14],g=n[15];Dt(this.planes[0].normal,o-r,f-s,v-c),this.planes[0].distance=g-m,Dt(this.planes[1].normal,o+r,f+s,v+c),this.planes[1].distance=g+m,Dt(this.planes[2].normal,o+i,f+l,v+h),this.planes[2].distance=g+d,Dt(this.planes[3].normal,o-i,f-l,v-h),this.planes[3].distance=g-d,Dt(this.planes[4].normal,o-a,f-u,v-p),this.planes[4].distance=g-y,Dt(this.planes[5].normal,o+a,f+u,v+p),this.planes[5].distance=g+y,this.planes.forEach(function(E){E.normalize(),E.updatePNVertexFlag()})},e}(),De=function(){function e(t,n){t===void 0&&(t=0),n===void 0&&(n=0),this.x=0,this.y=0,this.x=t,this.y=n}return e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},e}(),cr=function(){function e(t,n,r,i){this.x=t,this.y=n,this.width=r,this.height=i,this.left=t,this.right=t+r,this.top=n,this.bottom=n+i}return e.prototype.toJSON=function(){},e}(),le="Method not implemented.",Cr="Use document.documentElement instead.",Px="Cannot append a destroyed element.",ae;(function(e){e[e.ORBITING=0]="ORBITING",e[e.EXPLORING=1]="EXPLORING",e[e.TRACKING=2]="TRACKING"})(ae||(ae={}));var ga;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ROTATIONAL=1]="ROTATIONAL",e[e.TRANSLATIONAL=2]="TRANSLATIONAL",e[e.CINEMATIC=3]="CINEMATIC"})(ga||(ga={}));var tt;(function(e){e[e.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",e[e.PERSPECTIVE=1]="PERSPECTIVE"})(tt||(tt={}));var Zv={UPDATED:"updated"},Xh=2e-4,Jv=function(){function e(){this.clipSpaceNearZ=Qr.NEGATIVE_ONE,this.eventEmitter=new Bf,this.matrix=he(),this.right=fe(1,0,0),this.up=fe(0,1,0),this.forward=fe(0,0,1),this.position=fe(0,0,1),this.focalPoint=fe(0,0,0),this.distanceVector=fe(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=he(),this.projectionMatrixInverse=he(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=ae.EXPLORING,this.trackingMode=ga.DEFAULT,this.projectionMode=tt.PERSPECTIVE,this.frustum=new wx,this.orthoMatrix=he()}return e.prototype.isOrtho=function(){return this.projectionMode===tt.ORTHOGRAPHIC},e.prototype.getProjectionMode=function(){return this.projectionMode},e.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},e.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},e.prototype.getFrustum=function(){return this.frustum},e.prototype.getPosition=function(){return this.position},e.prototype.getFocalPoint=function(){return this.focalPoint},e.prototype.getDollyingStep=function(){return this.dollyingStep},e.prototype.getNear=function(){return this.near},e.prototype.getFar=function(){return this.far},e.prototype.getZoom=function(){return this.zoom},e.prototype.getOrthoMatrix=function(){return this.orthoMatrix},e.prototype.getView=function(){return this.view},e.prototype.setEnableUpdate=function(t){this.enableUpdate=t},e.prototype.setType=function(t,n){return this.type=t,this.type===ae.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===ae.TRACKING&&n!==void 0&&this.setTrackingMode(n),this},e.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},e.prototype.setTrackingMode=function(t){if(this.type!==ae.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},e.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},e.prototype.getViewTransform=function(){return Wt(he(),this.matrix)},e.prototype.getWorldTransform=function(){return this.matrix},e.prototype.jitterProjectionMatrix=function(t,n){var r=Cv(he(),[t,n,0]);this.jitteredProjectionMatrix=We(he(),r,this.projectionMatrix)},e.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},e.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},e.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},e.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},e.prototype.setNear=function(t){return this.projectionMode===tt.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},e.prototype.setFar=function(t){return this.projectionMode===tt.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},e.prototype.setViewOffset=function(t,n,r,i,a,o){return this.aspect=t/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=o,this.projectionMode===tt.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.clearViewOffset=function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===tt.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===tt.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===tt.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},e.prototype.setZoomByViewportPoint=function(t,n){var r=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),i=r.x,a=r.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(i,a),this.setFocalPoint(i,a),this.setZoom(t),this.rotate(0,0,o);var s=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),l=s.x,u=s.y,f=fe(l-i,u-a,0),c=Yt(f,this.right)/rn(this.right),h=Yt(f,this.up)/rn(this.up);return this.pan(-c,-h),this},e.prototype.setPerspective=function(t,n,r,i){var a;this.projectionMode=tt.PERSPECTIVE,this.fov=r,this.near=t,this.far=n,this.aspect=i;var o=this.near*Math.tan(ge(.5*this.fov))/this.zoom,s=2*o,l=this.aspect*s,u=-.5*l;if(!((a=this.view)===null||a===void 0)&&a.enabled){var f=this.view.fullWidth,c=this.view.fullHeight;u+=this.view.offsetX*l/f,o-=this.view.offsetY*s/c,l*=this.view.width/f,s*=this.view.height/c}return yx(this.projectionMatrix,u,u+l,o,o-s,t,this.far,this.clipSpaceNearZ===Qr.ZERO),ts(this.projectionMatrix,this.projectionMatrix,fe(1,-1,1)),Wt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},e.prototype.setOrthographic=function(t,n,r,i,a,o){var s;this.projectionMode=tt.ORTHOGRAPHIC,this.rright=n,this.left=t,this.top=r,this.bottom=i,this.near=a,this.far=o;var l=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),f=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,h=f-l,p=f+l,v=c+u,m=c-u;if(!((s=this.view)===null||s===void 0)&&s.enabled){var d=(this.rright-this.left)/this.view.fullWidth/this.zoom,y=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h+=d*this.view.offsetX,p=h+d*this.view.width,v-=y*this.view.offsetY,m=v-y*this.view.height}return this.clipSpaceNearZ===Qr.NEGATIVE_ONE?_v(this.projectionMatrix,h,p,m,v,a,o):Av(this.projectionMatrix,h,p,m,v,a,o),ts(this.projectionMatrix,this.projectionMatrix,fe(1,-1,1)),Wt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},e.prototype.setPosition=function(t,n,r){n===void 0&&(n=this.position[1]),r===void 0&&(r=this.position[2]);var i=qe(t,n,r);return this._setPosition(i),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},e.prototype.setFocalPoint=function(t,n,r){n===void 0&&(n=this.focalPoint[1]),r===void 0&&(r=this.focalPoint[2]);var i=fe(0,1,0);if(this.focalPoint=qe(t,n,r),this.trackingMode===ga.CINEMATIC){var a=Ph(J(),this.focalPoint,this.position);t=a[0],n=a[1],r=a[2];var o=rn(a),s=wt(Math.asin(n/o)),l=90+wt(Math.atan2(r,t)),u=he();Tv(u,u,ge(l)),Sv(u,u,ge(s)),i=St(J(),[0,1,0],u)}return Wt(this.matrix,Lv(he(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},e.prototype.getDistance=function(){return this.distance},e.prototype.getDistanceVector=function(){return this.distanceVector},e.prototype.setDistance=function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance=D.kEms&&t=Bn.kUnitType&&this.getType()<=Bn.kClampType},e}(),Nx=function(e){Q(t,e);function t(n){var r=e.call(this)||this;return r.colorSpace=n,r}return t.prototype.getType=function(){return Bn.kColorType},t.prototype.to=function(n){return this},t}(Os),Xt;(function(e){e[e.Constant=0]="Constant",e[e.LinearGradient=1]="LinearGradient",e[e.RadialGradient=2]="RadialGradient"})(Xt||(Xt={}));var Za=function(e){Q(t,e);function t(n,r){var i=e.call(this)||this;return i.type=n,i.value=r,i}return t.prototype.clone=function(){return new t(this.type,this.value)},t.prototype.buildCSSText=function(n,r,i){return i},t.prototype.getType=function(){return Bn.kColorType},t}(Os),st=function(e){Q(t,e);function t(n){var r=e.call(this)||this;return r.value=n,r}return t.prototype.clone=function(){return new t(this.value)},t.prototype.getType=function(){return Bn.kKeywordType},t.prototype.buildCSSText=function(n,r,i){return i+this.value},t}(Os),Ox=je(function(e){return e===void 0&&(e=""),e.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})}),Kh=function(e){return e.split("").map(function(t,n){return t.toUpperCase()===t?"".concat(n!==0?"-":"").concat(t.toLowerCase()):t}).join("")};function Rx(e){if(!e)throw new Error}function Br(e){return typeof e=="function"}function _x(e){return typeof e=="symbol"}var Ax={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Mu=je(function(e){var t=Ox(e),n=Ax[t];return t=(n==null?void 0:n.alias)||t,t}),Lx=function(e,t){t===void 0&&(t="");var n="";return Number.isFinite(e)?(Rx(Number.isNaN(e)),n="NaN"):e>0?n="infinity":n="-infinity",n+=t},Su=function(e){return kx(Cx(e))},Le=function(e){Q(t,e);function t(n,r){r===void 0&&(r=D.kNumber);var i=e.call(this)||this,a;return typeof r=="string"?a=Tx(r):a=r,i.unit=a,i.value=n,i}return t.prototype.clone=function(){return new t(this.value,this.unit)},t.prototype.equals=function(n){var r=n;return this.value===r.value&&this.unit===r.unit},t.prototype.getType=function(){return Bn.kUnitType},t.prototype.convertTo=function(n){if(this.unit===n)return new t(this.value,this.unit);var r=Su(this.unit);if(r!==Su(n)||r===D.kUnknown)return null;var i=jh(this.unit)/jh(n);return new t(this.value*i,n)},t.prototype.buildCSSText=function(n,r,i){var a;switch(this.unit){case D.kUnknown:break;case D.kInteger:a=Number(this.value).toFixed(0);break;case D.kNumber:case D.kPercentage:case D.kEms:case D.kRems:case D.kPixels:case D.kDegrees:case D.kRadians:case D.kGradians:case D.kMilliseconds:case D.kSeconds:case D.kTurns:{var o=-999999,s=999999,l=this.value,u=Pu(this.unit);if(ls){var f=Pu(this.unit);!Number.isFinite(l)||Number.isNaN(l)?a=Lx(l,f):a=l+(f||"")}else a="".concat(l).concat(u)}}return i+=a,i},t}(Os),Ie=new Le(0,"px");new Le(1,"px");var sn=new Le(0,"deg"),Hf=function(e){Q(t,e);function t(n,r,i,a,o){a===void 0&&(a=1),o===void 0&&(o=!1);var s=e.call(this,"rgb")||this;return s.r=n,s.g=r,s.b=i,s.alpha=a,s.isNone=o,s}return t.prototype.clone=function(){return new t(this.r,this.g,this.b,this.alpha)},t.prototype.buildCSSText=function(n,r,i){return i+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},t}(Nx),ce=new st("unset"),Ix=new st("initial"),Dx=new st("inherit"),pl={"":ce,unset:ce,initial:Ix,inherit:Dx},Tu=function(e){return pl[e]||(pl[e]=new st(e)),pl[e]},Cu=new Hf(0,0,0,0,!0),e0=new Hf(0,0,0,0),bx=je(function(e,t,n,r){return new Hf(e,t,n,r)},function(e,t,n,r){return"rgba(".concat(e,",").concat(t,",").concat(n,",").concat(r,")")}),xe=function(e,t){return t===void 0&&(t=D.kNumber),new Le(e,t)},ss=new Le(50,"%"),ku;(function(e){e[e.Standard=0]="Standard"})(ku||(ku={}));var ai;(function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"})(ai||(ai={}));var t0={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new cr(0,0,0,0)},B;(function(e){e.COORDINATE="",e.COLOR="",e.PAINT="",e.NUMBER="",e.ANGLE="",e.OPACITY_VALUE="",e.SHADOW_BLUR="",e.LENGTH="",e.PERCENTAGE="",e.LENGTH_PERCENTAGE=" | ",e.LENGTH_PERCENTAGE_12="[ | ]{1,2}",e.LENGTH_PERCENTAGE_14="[ | ]{1,4}",e.LIST_OF_POINTS="",e.PATH="",e.FILTER="",e.Z_INDEX="",e.OFFSET_DISTANCE="",e.DEFINED_PATH="",e.MARKER="",e.TRANSFORM="",e.TRANSFORM_ORIGIN="",e.TEXT="",e.TEXT_TRANSFORM=""})(B||(B={}));function Fx(e){var t=e.type,n=e.value;return t==="hex"?"#".concat(n):t==="literal"?n:t==="rgb"?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}var Bx=function(){var e={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function n(L){throw new Error(t+": "+L)}function r(){var L=i();return t.length>0&&n("Invalid input not EOF"),L}function i(){return E(a)}function a(){return o("linear-gradient",e.linearGradient,l)||o("repeating-linear-gradient",e.repeatingLinearGradient,l)||o("radial-gradient",e.radialGradient,c)||o("repeating-radial-gradient",e.repeatingRadialGradient,c)||o("conic-gradient",e.conicGradient,c)}function o(L,H,$){return s(H,function(Te){var I=$();return I&&(z(e.comma)||n("Missing comma before color stops")),{type:L,orientation:I,colorStops:E(P)}})}function s(L,H){var $=z(L);if($){z(e.startCall)||n("Missing (");var Te=H($);return z(e.endCall)||n("Missing )"),Te}}function l(){return u()||f()}function u(){return A("directional",e.sideOrCorner,1)}function f(){return A("angular",e.angleValue,1)}function c(){var L,H=h(),$;return H&&(L=[],L.push(H),$=t,z(e.comma)&&(H=h(),H?L.push(H):t=$)),L}function h(){var L=p()||v();if(L)L.at=d();else{var H=m();if(H){L=H;var $=d();$&&(L.at=$)}else{var Te=y();Te&&(L={type:"default-radial",at:Te})}}return L}function p(){var L=A("shape",/^(circle)/i,0);return L&&(L.style=_()||m()),L}function v(){var L=A("shape",/^(ellipse)/i,0);return L&&(L.style=k()||m()),L}function m(){return A("extent-keyword",e.extentKeywords,1)}function d(){if(A("position",/^at/,0)){var L=y();return L||n("Missing positioning value"),L}}function y(){var L=g();if(L.x||L.y)return{type:"position",value:L}}function g(){return{x:k(),y:k()}}function E(L){var H=L(),$=[];if(H)for($.push(H);z(e.comma);)H=L(),H?$.push(H):n("One extra comma");return $}function P(){var L=w();return L||n("Expected color definition"),L.length=k(),L}function w(){return M()||T()||S()||x()}function x(){return A("literal",e.literalColor,0)}function M(){return A("hex",e.hexColor,1)}function S(){return s(e.rgbColor,function(){return{type:"rgb",value:E(C)}})}function T(){return s(e.rgbaColor,function(){return{type:"rgba",value:E(C)}})}function C(){return z(e.number)[1]}function k(){return A("%",e.percentageValue,1)||N()||_()}function N(){return A("position-keyword",e.positionKeywords,1)}function _(){return A("px",e.pixelValue,1)||A("em",e.emValue,1)}function A(L,H,$){var Te=z(H);if(Te)return{type:L,value:Te[$]}}function z(L){var H=/^[\n\r\t\s]+/.exec(t);H&&W(H[0].length);var $=L.exec(t);return $&&W($[0].length),$}function W(L){t=t.substring(L)}return function(L){return t=L,r()}}();function zx(e,t,n){var r=ge(n.value),i=0,a=0,o=i+e/2,s=a+t/2,l=Math.abs(e*Math.cos(r))+Math.abs(t*Math.sin(r)),u=o-Math.cos(r)*l/2,f=s-Math.sin(r)*l/2,c=o+Math.cos(r)*l/2,h=s+Math.sin(r)*l/2;return{x1:u,y1:f,x2:c,y2:h}}function Ux(e,t,n,r,i){var a=n.value,o=r.value;n.unit===D.kPercentage&&(a=n.value/100*e),r.unit===D.kPercentage&&(o=r.value/100*t);var s=Math.max(ut([0,0],[a,o]),ut([0,t],[a,o]),ut([e,t],[a,o]),ut([e,0],[a,o]));return i&&(i instanceof Le?s=i.value:i instanceof st&&(i.value==="closest-side"?s=Math.min(a,e-a,o,t-o):i.value==="farthest-side"?s=Math.max(a,e-a,o,t-o):i.value==="closest-corner"&&(s=Math.min(ut([0,0],[a,o]),ut([0,t],[a,o]),ut([e,t],[a,o]),ut([e,0],[a,o]))))),{x:a,y:o,r:s}}var Gx=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Hx=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Vx=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,n0=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function Wx(e){var t,n,r,i=e.length;e[i-1].length=(t=e[i-1].length)!==null&&t!==void 0?t:{type:"%",value:"100"},i>1&&(e[0].length=(n=e[0].length)!==null&&n!==void 0?n:{type:"%",value:"0"});for(var a=0,o=Number(e[0].length.value),s=1;s-1||e.indexOf("radial")>-1){var n=Bx(e);return n.map(function(s){var l=s.type,u=s.orientation,f=s.colorStops;Wx(f);var c=f.map(function(E){return{offset:xe(Number(E.length.value),"%"),color:Fx(E)}});if(l==="linear-gradient")return new Za(Xt.LinearGradient,{angle:u?Xx(u):sn,steps:c});if(l==="radial-gradient"&&(u||(u=[{type:"shape",value:"circle"}]),u[0].type==="shape"&&u[0].value==="circle")){var h=$x(u[0].at),p=h.cx,v=h.cy,m=void 0;if(u[0].style){var d=u[0].style,y=d.type,g=d.value;y==="extent-keyword"?m=Tu(g):m=xe(g,y)}return new Za(Xt.RadialGradient,{cx:p,cy:v,size:m,steps:c})}})}var r=e[0];if(e[1]==="("||e[2]==="("){if(r==="l"){var i=Gx.exec(e);if(i){var a=((t=i[2].match(n0))===null||t===void 0?void 0:t.map(function(s){return s.split(":")}))||[];return[new Za(Xt.LinearGradient,{angle:xe(parseFloat(i[1]),"deg"),steps:a.map(function(s){var l=F(s,2),u=l[0],f=l[1];return{offset:xe(Number(u)*100,"%"),color:f}})})]}}else if(r==="r"){var o=Kx(e);if(o)if($e(o))e=o;else return[new Za(Xt.RadialGradient,o)]}else if(r==="p")return qx(e)}});function Kx(e){var t,n=Hx.exec(e);if(n){var r=((t=n[4].match(n0))===null||t===void 0?void 0:t.map(function(i){return i.split(":")}))||[];return{cx:xe(50,"%"),cy:xe(50,"%"),steps:r.map(function(i){var a=F(i,2),o=a[0],s=a[1];return{offset:xe(Number(o)*100,"%"),color:s}})}}return null}function qx(e){var t=Vx.exec(e);if(t){var n=t[1],r=t[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;case"n":n="no-repeat";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}function xa(e){return e&&!!e.image}function ls(e){return e&&!U(e.r)&&!U(e.g)&&!U(e.b)}var Jr=je(function(e){if(xa(e))return X({repetition:"repeat"},e);if(U(e)&&(e=""),e==="transparent")return e0;e==="currentColor"&&(e="black");var t=jx(e);if(t)return t;var n=Ns(e),r=[0,0,0,0];return n!==null&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),bx.apply(void 0,Z([],F(r),!1))});function Qx(e,t){if(!(!ls(e)||!ls(t)))return[[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],function(n){var r=n.slice();if(r[3])for(var i=0;i<3;i++)r[i]=Math.round(ht(r[i],0,255));return r[3]=ht(r[3],0,1),"rgba(".concat(r.join(","),")")}]}function _a(e,t){if(U(t))return xe(0,"px");if(t="".concat(t).trim().toLowerCase(),isFinite(Number(t))){if("px".search(e)>=0)return xe(Number(t),"px");if("deg".search(e)>=0)return xe(Number(t),"deg")}var n=[];t=t.replace(e,function(i){return n.push(i),"U"+i});var r="U("+e.source+")";return n.map(function(i){return xe(Number(t.replace(new RegExp("U"+i,"g"),"").replace(new RegExp(r,"g"),"*0")),i)})[0]}var Zx=je(function(e){return _a(new RegExp("px","g"),e)});je(function(e){return _a(new RegExp("%","g"),e)});var oi=function(e){return Ft(e)||isFinite(Number(e))?xe(Number(e)||0,"px"):_a(new RegExp("px|%|em|rem","g"),e)},r0=je(function(e){return _a(new RegExp("deg|rad|grad|turn","g"),e)});function Jx(e,t,n,r,i){i===void 0&&(i=0);var a="",o=e.value||0,s=t.value||0,l=Su(e.unit),u=e.convertTo(l),f=t.convertTo(l);return u&&f?(o=u.value,s=f.value,a=Pu(e.unit)):(Le.isLength(e.unit)||Le.isLength(t.unit))&&(o=lt(e,i,n),s=lt(t,i,n),a="px"),[o,s,function(c){return r&&(c=Math.max(c,0)),c+a}]}function ft(e){var t=0;return e.unit===D.kDegrees?t=e.value:e.unit===D.kRadians?t=wt(Number(e.value)):e.unit===D.kTurns&&(t=hx(Number(e.value))),t}function vl(e,t){var n;return Array.isArray(e)?n=e.map(function(r){return Number(r)}):$e(e)?n=e.split(" ").map(function(r){return Number(r)}):Ft(e)&&(n=[e]),t===2?n.length===1?[n[0],n[0]]:[n[0],n[1]]:n.length===1?[n[0],n[0],n[0],n[0]]:n.length===2?[n[0],n[1],n[0],n[1]]:n.length===3?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function i0(e){return $e(e)?e.split(" ").map(function(t){return oi(t)}):e.map(function(t){return oi(t.toString())})}function lt(e,t,n){if(e.value===0)return 0;if(e.unit===D.kPixels)return Number(e.value);if(e.unit===D.kPercentage&&n){var r=n.nodeName===O.GROUP?n.getLocalBounds():n.geometry.contentBounds;return e.value/100*r.halfExtents[t]*2}return 0}var e2=function(e){return _a(/deg|rad|grad|turn|px|%/g,e)},t2=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function a0(e){if(e===void 0&&(e=""),e=e.toLowerCase().trim(),e==="none")return[];for(var t=/\s*([\w-]+)\(([^)]*)\)/g,n=[],r,i=0;r=t.exec(e);){if(r.index!==i)return[];if(i=r.index+r[0].length,t2.indexOf(r[1])>-1&&n.push({name:r[1],params:r[2].split(" ").map(function(a){return e2(a)||Jr(a)})}),t.lastIndex===e.length)return n}return[]}function o0(e){return e.toString()}var hr=je(function(e){return typeof e=="number"?xe(e):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(e)?xe(Number(e)):xe(0)});je(function(e){return $e(e)?e.split(" ").map(hr):e.map(hr)});function Vf(e,t){return[e,t,o0]}function Wf(e,t){return function(n,r){return[n,r,function(i){return o0(ht(i,e,t))}]}}function s0(e,t){if(e.length===t.length)return[e,t,function(n){return n}]}function Nu(e){return e.parsedStyle.path.totalLength===0&&(e.parsedStyle.path.totalLength=O1(e.parsedStyle.path.absolutePath)),e.parsedStyle.path.totalLength}function n2(e){for(var t=0;t0&&n.push(r),{polygons:t,polylines:n}}function us(e,t){return e[0]===t[0]&&e[1]===t[1]}function a2(e,t){for(var n=[],r=[],i=[],a=0;aMath.PI/2?Math.PI-u:u,f=f>Math.PI/2?Math.PI-f:f;var c={xExtra:Math.cos(l/2-u)*(t/2*(1/Math.sin(l/2)))-t/2||0,yExtra:Math.cos(f-l/2)*(t/2*(1/Math.sin(l/2)))-t/2||0};return c}function qh(e,t){return[t[0]+(t[0]-e[0]),t[1]+(t[1]-e[1])]}var Qh=function(e,t){var n=e.x*t.x+e.y*t.y,r=Math.sqrt((Math.pow(e.x,2)+Math.pow(e.y,2))*(Math.pow(t.x,2)+Math.pow(t.y,2))),i=e.x*t.y-e.y*t.x<0?-1:1,a=i*Math.acos(n/r);return a},Zh=function(e,t,n,r,i,a,o,s){t=Math.abs(t),n=Math.abs(n),r=Fv(r,360);var l=ge(r);if(e.x===o.x&&e.y===o.y)return{x:e.x,y:e.y,ellipticalArcAngle:0};if(t===0||n===0)return{x:0,y:0,ellipticalArcAngle:0};var u=(e.x-o.x)/2,f=(e.y-o.y)/2,c={x:Math.cos(l)*u+Math.sin(l)*f,y:-Math.sin(l)*u+Math.cos(l)*f},h=Math.pow(c.x,2)/Math.pow(t,2)+Math.pow(c.y,2)/Math.pow(n,2);h>1&&(t=Math.sqrt(h)*t,n=Math.sqrt(h)*n);var p=Math.pow(t,2)*Math.pow(n,2)-Math.pow(t,2)*Math.pow(c.y,2)-Math.pow(n,2)*Math.pow(c.x,2),v=Math.pow(t,2)*Math.pow(c.y,2)+Math.pow(n,2)*Math.pow(c.x,2),m=p/v;m=m<0?0:m;var d=(i!==a?1:-1)*Math.sqrt(m),y={x:d*(t*c.y/n),y:d*(-(n*c.x)/t)},g={x:Math.cos(l)*y.x-Math.sin(l)*y.y+(e.x+o.x)/2,y:Math.sin(l)*y.x+Math.cos(l)*y.y+(e.y+o.y)/2},E={x:(c.x-y.x)/t,y:(c.y-y.y)/n},P=Qh({x:1,y:0},E),w={x:(-c.x-y.x)/t,y:(-c.y-y.y)/n},x=Qh(E,w);!a&&x>0?x-=2*Math.PI:a&&x<0&&(x+=2*Math.PI),x%=2*Math.PI;var M=P+x*s,S=t*Math.cos(M),T=n*Math.sin(M),C={x:Math.cos(l)*S-Math.sin(l)*T+g.x,y:Math.sin(l)*S+Math.cos(l)*T+g.y,ellipticalArcStartAngle:P,ellipticalArcEndAngle:P+x,ellipticalArcAngle:M,ellipticalArcCenter:g,resultantRx:t,resultantRy:n};return C};function o2(e){for(var t=[],n=null,r=null,i=null,a=0,o=e.length,s=0;s1&&(n*=Math.sqrt(p),r*=Math.sqrt(p));var v=n*n*(h*h)+r*r*(c*c),m=v?Math.sqrt((n*n*(r*r)-v)/v):1;a===o&&(m*=-1),isNaN(m)&&(m=0);var d=r?m*n*h/r:0,y=n?m*-r*c/n:0,g=(s+u)/2+Math.cos(i)*d-Math.sin(i)*y,E=(l+f)/2+Math.sin(i)*d+Math.cos(i)*y,P=[(c-d)/n,(h-y)/r],w=[(-1*c-d)/n,(-1*h-y)/r],x=ed([1,0],P),M=ed(P,w);return Ou(P,w)<=-1&&(M=Math.PI),Ou(P,w)>=1&&(M=0),o===0&&M>0&&(M=M-2*Math.PI),o===1&&M<0&&(M=M+2*Math.PI),{cx:g,cy:E,rx:us(e,[u,f])?0:n,ry:us(e,[u,f])?0:r,startAngle:x,endAngle:x+M,xRotation:i,arcFlag:a,sweepFlag:o}}var l0=function(e){if(e===""||Array.isArray(e)&&e.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var t;try{t=as(e)}catch{t=as(""),console.error("[g]: Invalid SVG Path definition: ".concat(e))}n2(t);var n=r2(t),r=i2(t),i=r.polygons,a=r.polylines,o=o2(t),s=a2(o,0),l=s.x,u=s.y,f=s.width,c=s.height;return{absolutePath:t,hasArc:n,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(l)?l:0,y:Number.isFinite(u)?u:0,width:Number.isFinite(f)?f:0,height:Number.isFinite(c)?c:0}}},l2=je(l0);function Ru(e){return $e(e)?l2(e):l0(e)}function u2(e,t,n){var r=e.curve,i=t.curve;(!r||r.length===0)&&(r=yu(e.absolutePath,!1),e.curve=r),(!i||i.length===0)&&(i=yu(t.absolutePath,!1),t.curve=i);var a=[r,i];r.length!==i.length&&(a=Wv(r,i));var o=_h(a[0])!==_h(a[1])?M1(a[0]):P1(a[0]);return[o,_1(a[1],o),function(s){return s}]}function u0(e,t){var n;$e(e)?n=e.split(" ").map(function(f){var c=F(f.split(","),2),h=c[0],p=c[1];return[Number(h),Number(p)]}):n=e;var r=[],i=0,a,o,s=rx(n);n.forEach(function(f,c){n[c+1]&&(a=[0,0],a[0]=i/s,o=Kv(f[0],f[1],n[c+1][0],n[c+1][1]),i+=o,a[1]=i/s,r.push(a))});var l=Math.min.apply(Math,Z([],F(n.map(function(f){return f[0]})),!1)),u=Math.min.apply(Math,Z([],F(n.map(function(f){return f[1]})),!1));return t&&(t.parsedStyle.defX=l,t.parsedStyle.defY=u),{points:n,totalLength:s,segments:r}}function f2(e,t){return[e.points,t.points,function(n){return n}]}var Pe=null;function et(e){return function(t){var n=0;return e.map(function(r){return r===Pe?t[n++]:r})}}function Kn(e){return e}var _u={matrix:["NNNNNN",[Pe,Pe,0,0,Pe,Pe,0,0,0,0,1,0,Pe,Pe,0,1],Kn],matrix3d:["NNNNNNNNNNNNNNNN",Kn],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",et([Pe,Pe,new Le(1)]),Kn],scalex:["N",et([Pe,new Le(1),new Le(1)]),et([Pe,new Le(1)])],scaley:["N",et([new Le(1),Pe,new Le(1)]),et([new Le(1),Pe])],scalez:["N",et([new Le(1),new Le(1),Pe])],scale3d:["NNN",Kn],skew:["Aa",null,Kn],skewx:["A",null,et([Pe,sn])],skewy:["A",null,et([sn,Pe])],translate:["Tt",et([Pe,Pe,Ie]),Kn],translatex:["T",et([Pe,Ie,Ie]),et([Pe,Ie])],translatey:["T",et([Ie,Pe,Ie]),et([Ie,Pe])],translatez:["L",et([Ie,Ie,Pe])],translate3d:["TTL",Kn]};function fs(e){if(e=(e||"none").toLowerCase().trim(),e==="none")return[];for(var t=/\s*(\w+)\(([^)]*)\)/g,n=[],r,i=0;r=t.exec(e);){if(r.index!==i)return[];i=r.index+r[0].length;var a=r[1],o=_u[a];if(!o)return[];var s=r[2].split(","),l=o[0];if(l.length"].calculator(null,null,{value:n.textTransform},t,null),n.clipPath&&this.runtime.CSSPropertySyntaxFactory[""].calculator("clipPath",o,n.clipPath,t,this.runtime),n.offsetPath&&this.runtime.CSSPropertySyntaxFactory[""].calculator("offsetPath",s,n.offsetPath,t,this.runtime),n.anchor&&(t.parsedStyle.anchor=vl(n.anchor,2)),n.transform&&(t.parsedStyle.transform=fs(n.transform)),n.transformOrigin&&(t.parsedStyle.transformOrigin=f0(n.transformOrigin)),n.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[""].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[""].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[""].calculator("",n.markerMid,n.markerMid,null,null)),((t.nodeName===O.CIRCLE||t.nodeName===O.ELLIPSE)&&(!U(n.cx)||!U(n.cy))||(t.nodeName===O.RECT||t.nodeName===O.IMAGE||t.nodeName===O.GROUP||t.nodeName===O.HTML||t.nodeName===O.TEXT||t.nodeName===O.MESH)&&(!U(n.x)||!U(n.y)||!U(n.z))||t.nodeName===O.LINE&&(!U(n.x1)||!U(n.y1)||!U(n.z1)||!U(n.x2)||!U(n.y2)||!U(n.z2)))&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(t,a),U(n.zIndex)||this.runtime.CSSPropertySyntaxFactory[""].postProcessor(t,a),n.path&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(t,a),n.points&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(t,a),U(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory[""].postProcessor(t,a),n.transform&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(t,a),l&&this.updateGeometry(t);return}var f=r.skipUpdateAttribute,c=r.skipParse,h=r.forceUpdateGeometry,p=r.usedAttributes,v=h,m=Object.keys(n);m.forEach(function(d){var y;f||(t.attributes[d]=n[d]),!v&&(!((y=hn[d])===null||y===void 0)&&y.l)&&(v=!0)}),c||m.forEach(function(d){t.computedStyle[d]=i.parseProperty(d,t.attributes[d],t)}),p!=null&&p.length&&(m=Array.from(new Set(m.concat(p)))),m.forEach(function(d){d in t.computedStyle&&(t.parsedStyle[d]=i.computeProperty(d,t.computedStyle[d],t))}),v&&this.updateGeometry(t),m.forEach(function(d){d in t.parsedStyle&&i.postProcessProperty(d,t,m)}),this.runtime.enableCSSParsing&&t.children.length&&m.forEach(function(d){d in t.parsedStyle&&i.isPropertyInheritable(d)&&t.children.forEach(function(y){y.internalSetAttribute(d,null,{skipUpdateAttribute:!0,skipParse:!0})})})},e.prototype.parseProperty=function(t,n,r){var i=hn[t],a=n;if((n===""||U(n))&&(n="unset"),n==="unset"||n==="initial"||n==="inherit")a=Tu(n);else if(i){var o=i.k,s=i.syntax,l=s&&this.getPropertySyntax(s);o&&o.indexOf(n)>-1?a=Tu(n):l&&l.parser&&(a=l.parser(n,r))}return a},e.prototype.computeProperty=function(t,n,r){var i=hn[t],a=r.id==="g-root",o=n;if(i){var s=i.syntax,l=i.inh,u=i.d;if(n instanceof st){var f=n.value;if(f==="unset"&&(l&&!a?f="inherit":f="initial"),f==="initial")U(u)||(n=this.parseProperty(t,Br(u)?u(r.nodeName):u,r));else if(f==="inherit"){var c=this.tryToResolveProperty(r,t,{inherited:!0});if(U(c)){this.addUnresolveProperty(r,t);return}else return c}}var h=s&&this.getPropertySyntax(s);if(h&&h.calculator){var p=r.parsedStyle[t];o=h.calculator(t,p,n,r,this.runtime)}else n instanceof st?o=n.value:o=n}return o},e.prototype.postProcessProperty=function(t,n,r){var i=hn[t];if(i&&i.syntax){var a=i.syntax&&this.getPropertySyntax(i.syntax),o=a;o&&o.postProcessor&&o.postProcessor(n,r)}},e.prototype.addUnresolveProperty=function(t,n){var r=Rr.get(t);r||(Rr.set(t,[]),r=Rr.get(t)),r.indexOf(n)===-1&&r.push(n)},e.prototype.tryToResolveProperty=function(t,n,r){r===void 0&&(r={});var i=r.inherited;if(i&&t.parentElement&&E2(t.parentElement,n)){var a=t.parentElement.parsedStyle[n];return a==="unset"||a==="initial"||a==="inherit"?void 0:a}},e.prototype.recalc=function(t){var n=Rr.get(t);if(n&&n.length){var r={};n.forEach(function(i){r[i]=t.attributes[i]}),this.processProperties(t,r),Rr.delete(t)}},e.prototype.updateGeometry=function(t){var n=t.nodeName,r=this.runtime.geometryUpdaterFactory[n];if(r){var i=t.geometry;i.contentBounds||(i.contentBounds=new Oe),i.renderBounds||(i.renderBounds=new Oe);var a=t.parsedStyle,o=r.update(a,t),s=o.width,l=o.height,u=o.depth,f=u===void 0?0:u,c=o.offsetX,h=c===void 0?0:c,p=o.offsetY,v=p===void 0?0:p,m=o.offsetZ,d=m===void 0?0:m,y=[Math.abs(s)/2,Math.abs(l)/2,f/2],g=a,E=g.stroke,P=g.lineWidth,w=g.increasedLineWidthForHitTesting,x=g.shadowType,M=g.shadowColor,S=g.filter,T=S===void 0?[]:S,C=g.transformOrigin,k=a.anchor;n===O.TEXT?delete a.anchor:n===O.MESH&&(a.anchor[2]=.5);var N=[(1-(k&&k[0]||0)*2)*s/2+h,(1-(k&&k[1]||0)*2)*l/2+v,(1-(k&&k[2]||0)*2)*y[2]+d];i.contentBounds.update(N,y);var _=n===O.POLYLINE||n===O.POLYGON||n===O.PATH?Math.SQRT2:.5,A=E&&!E.isNone;if(A){var z=((P||0)+(w||0))*_;y[0]+=z,y[1]+=z}if(i.renderBounds.update(N,y),M&&x&&x!=="inner"){var W=i.renderBounds,L=W.min,H=W.max,$=a,Te=$.shadowBlur,I=$.shadowOffsetX,Y=$.shadowOffsetY,j=Te||0,ie=I||0,ue=Y||0,Re=L[0]-j+ie,mt=H[0]+j+ie,Bt=L[1]-j+ue,Rt=H[1]+j+ue;L[0]=Math.min(L[0],Re),H[0]=Math.max(H[0],mt),L[1]=Math.min(L[1],Bt),H[1]=Math.max(H[1],Rt),i.renderBounds.setMinMax(L,H)}T.forEach(function(Zf){var Jf=Zf.name,Ia=Zf.params;if(Jf==="blur"){var ec=Ia[0].value;i.renderBounds.update(i.renderBounds.center,_o(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[ec,ec,0]))}else if(Jf==="drop-shadow"){var tc=Ia[0].value,nc=Ia[1].value,Da=Ia[2].value,rc=i.renderBounds,$n=rc.min,jn=rc.max,U0=$n[0]-Da+tc,G0=jn[0]+Da+tc,H0=$n[1]-Da+nc,V0=jn[1]+Da+nc;$n[0]=Math.min($n[0],U0),jn[0]=Math.max(jn[0],G0),$n[1]=Math.min($n[1],H0),jn[1]=Math.max(jn[1],V0),i.renderBounds.setMinMax($n,jn)}}),k=a.anchor;var _t=s<0,La=l<0,Is=(_t?-1:1)*(C?lt(C[0],0,t):0),Ds=(La?-1:1)*(C?lt(C[1],1,t):0);Is=Is-(_t?-1:1)*(k&&k[0]||0)*i.contentBounds.halfExtents[0]*2,Ds=Ds-(La?-1:1)*(k&&k[1]||0)*i.contentBounds.halfExtents[1]*2,t.setOrigin(Is,Ds),this.runtime.sceneGraphService.dirtifyToRoot(t)}},e.prototype.isPropertyInheritable=function(t){var n=hn[t];return n?n.inh:!1},e}(),P2=function(){function e(){this.parser=r0,this.parserWithCSSDisabled=null,this.mixer=Vf}return e.prototype.calculator=function(t,n,r,i){return ft(r)},e}(),M2=function(){function e(){}return e.prototype.calculator=function(t,n,r,i,a){return r instanceof st&&(r=null),a.sceneGraphService.updateDisplayObjectDependency(t,n,r,i),t==="clipPath"&&i.forEach(function(o){o.childNodes.length===0&&a.sceneGraphService.dirtifyToRoot(o)}),r},e}(),S2=function(){function e(){this.parser=Jr,this.parserWithCSSDisabled=Jr,this.mixer=Qx}return e.prototype.calculator=function(t,n,r,i){return r instanceof st?r.value==="none"?Cu:e0:r},e}(),T2=function(){function e(){this.parser=a0}return e.prototype.calculator=function(t,n,r){return r instanceof st?[]:r},e}();function id(e){var t=e.parsedStyle.fontSize;return U(t)?null:t}var Xf=function(){function e(){this.parser=oi,this.parserWithCSSDisabled=null,this.mixer=Vf}return e.prototype.calculator=function(t,n,r,i,a){var o;if(Ft(r))return r;if(Le.isRelativeUnit(r.unit)){var s=a.styleValueRegistry;if(r.unit===D.kPercentage)return 0;if(r.unit===D.kEms){if(i.parentNode){var l=id(i.parentNode);if(l)return l*=r.value,l;s.addUnresolveProperty(i,t)}else s.addUnresolveProperty(i,t);return 0}else if(r.unit===D.kRems){if(!((o=i==null?void 0:i.ownerDocument)===null||o===void 0)&&o.documentElement){var l=id(i.ownerDocument.documentElement);if(l)return l*=r.value,l;s.addUnresolveProperty(i,t)}else s.addUnresolveProperty(i,t);return 0}}else return r.value},e}(),C2=function(){function e(){this.mixer=s0}return e.prototype.parser=function(t){var n=i0(Ft(t)?[t]:t),r;return n.length===1?r=[n[0],n[0]]:r=[n[0],n[1]],r},e.prototype.calculator=function(t,n,r){return r.map(function(i){return i.value})},e}(),k2=function(){function e(){this.mixer=s0}return e.prototype.parser=function(t){var n=i0(Ft(t)?[t]:t),r;return n.length===1?r=[n[0],n[0],n[0],n[0]]:n.length===2?r=[n[0],n[1],n[0],n[1]]:n.length===3?r=[n[0],n[1],n[2],n[1]]:r=[n[0],n[1],n[2],n[3]],r},e.prototype.calculator=function(t,n,r){return r.map(function(i){return i.value})},e}(),Ni=he();function $f(e,t){var n=t.parsedStyle.defX||0,r=t.parsedStyle.defY||0;return t.resetLocalTransform(),t.setLocalPosition(n,r),e.forEach(function(i){var a=i.t,o=i.d;if(a==="scale"){var s=(o==null?void 0:o.map(function(g){return g.value}))||[1,1];t.scaleLocal(s[0],s[1],1)}else if(a==="scalex"){var s=(o==null?void 0:o.map(function(E){return E.value}))||[1];t.scaleLocal(s[0],1,1)}else if(a==="scaley"){var s=(o==null?void 0:o.map(function(E){return E.value}))||[1];t.scaleLocal(1,s[0],1)}else if(a==="scalez"){var s=(o==null?void 0:o.map(function(E){return E.value}))||[1];t.scaleLocal(1,1,s[0])}else if(a==="scale3d"){var s=(o==null?void 0:o.map(function(E){return E.value}))||[1,1,1];t.scaleLocal(s[0],s[1],s[2])}else if(a==="translate"){var l=o||[Ie,Ie];t.translateLocal(l[0].value,l[1].value,0)}else if(a==="translatex"){var l=o||[Ie];t.translateLocal(l[0].value,0,0)}else if(a==="translatey"){var l=o||[Ie];t.translateLocal(0,l[0].value,0)}else if(a==="translatez"){var l=o||[Ie];t.translateLocal(0,0,l[0].value)}else if(a==="translate3d"){var l=o||[Ie,Ie,Ie];t.translateLocal(l[0].value,l[1].value,l[2].value)}else if(a==="rotate"){var u=o||[sn];t.rotateLocal(0,0,ft(u[0]))}else if(a==="rotatex"){var u=o||[sn];t.rotateLocal(ft(u[0]),0,0)}else if(a==="rotatey"){var u=o||[sn];t.rotateLocal(0,ft(u[0]),0)}else if(a==="rotatez"){var u=o||[sn];t.rotateLocal(0,0,ft(u[0]))}else if(a!=="rotate3d")if(a==="skew"){var f=(o==null?void 0:o.map(function(g){return g.value}))||[0,0];t.setLocalSkew(ge(f[0]),ge(f[1]))}else if(a==="skewx"){var f=(o==null?void 0:o.map(function(E){return E.value}))||[0];t.setLocalSkew(ge(f[0]),t.getLocalSkew()[1])}else if(a==="skewy"){var f=(o==null?void 0:o.map(function(E){return E.value}))||[0];t.setLocalSkew(t.getLocalSkew()[0],ge(f[0]))}else if(a==="matrix"){var c=F(o.map(function(g){return g.value}),6),h=c[0],p=c[1],v=c[2],m=c[3],d=c[4],y=c[5];t.setLocalTransform(du(Ni,h,p,0,0,v,m,0,0,0,0,1,0,d+n,y+r,0,1))}else a==="matrix3d"&&(du.apply(Fg,Z([Ni],F(o.map(function(g){return g.value})),!1)),Ni[12]+=n,Ni[13]+=r,t.setLocalTransform(Ni))}),t.getLocalTransform()}var N2=function(e){Q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.postProcessor=function(n,r){var i,a,o;switch(n.nodeName){case O.CIRCLE:case O.ELLIPSE:var s=n.parsedStyle,l=s.cx,u=s.cy,f=s.cz;U(l)||(i=l),U(u)||(a=u),U(f)||(o=f);break;case O.LINE:var c=n.parsedStyle,h=c.x1,p=c.x2,v=c.y1,m=c.y2,d=Math.min(h,p),y=Math.min(v,m);i=d,a=y,o=0;break;case O.RECT:case O.IMAGE:case O.GROUP:case O.HTML:case O.TEXT:case O.MESH:U(n.parsedStyle.x)||(i=n.parsedStyle.x),U(n.parsedStyle.y)||(a=n.parsedStyle.y),U(n.parsedStyle.z)||(o=n.parsedStyle.z);break}n.nodeName!==O.PATH&&n.nodeName!==O.POLYLINE&&n.nodeName!==O.POLYGON&&(n.parsedStyle.defX=i||0,n.parsedStyle.defY=a||0);var g=!U(i)||!U(a)||!U(o);if(g&&r.indexOf("transform")===-1){var E=n.parsedStyle.transform;if(E&&E.length)$f(E,n);else{var P=F(n.getLocalPosition(),3),w=P[0],x=P[1],M=P[2];n.setLocalPosition(U(i)?w:i,U(a)?x:a,U(o)?M:o)}}},t}(Xf),O2=function(){function e(){}return e.prototype.calculator=function(t,n,r,i){r instanceof st&&(r=null);var a=r==null?void 0:r.cloneNode(!0);return a&&(a.style.isMarker=!0),a},e}(),R2=function(){function e(){this.mixer=Vf,this.parser=hr,this.parserWithCSSDisabled=null}return e.prototype.calculator=function(t,n,r){return r.value},e}(),_2=function(){function e(){this.parser=hr,this.parserWithCSSDisabled=null,this.mixer=Wf(0,1)}return e.prototype.calculator=function(t,n,r){return r.value},e.prototype.postProcessor=function(t){var n=t.parsedStyle,r=n.offsetPath,i=n.offsetDistance;if(r){var a=r.nodeName;if(a===O.LINE||a===O.PATH||a===O.POLYLINE){var o=r.getPoint(i);o&&(t.parsedStyle.defX=o.x,t.parsedStyle.defY=o.y,t.setLocalPosition(o.x,o.y))}}},e}(),A2=function(){function e(){this.parser=hr,this.parserWithCSSDisabled=null,this.mixer=Wf(0,1)}return e.prototype.calculator=function(t,n,r){return r.value},e}(),L2=function(){function e(){this.parser=Ru,this.parserWithCSSDisabled=Ru,this.mixer=u2}return e.prototype.calculator=function(t,n,r){return r instanceof st&&r.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new cr(0,0,0,0)}:r},e.prototype.postProcessor=function(t,n){if(t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y,t.nodeName===O.PATH&&n.indexOf("transform")===-1){var r=t.parsedStyle,i=r.defX,a=i===void 0?0:i,o=r.defY,s=o===void 0?0:o;t.setLocalPosition(a,s)}},e}(),I2=function(){function e(){this.parser=u0,this.mixer=f2}return e.prototype.postProcessor=function(t,n){if((t.nodeName===O.POLYGON||t.nodeName===O.POLYLINE)&&n.indexOf("transform")===-1){var r=t.parsedStyle,i=r.defX,a=r.defY;t.setLocalPosition(i,a)}},e}(),D2=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mixer=Wf(0,1/0),n}return t}(Xf),b2=function(){function e(){}return e.prototype.calculator=function(t,n,r,i){return r instanceof st?r.value==="unset"?"":r.value:"".concat(r)},e.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},e}(),F2=function(){function e(){}return e.prototype.calculator=function(t,n,r,i){var a=i.getAttribute("text");if(a){var o=a;r.value==="capitalize"?o=a.charAt(0).toUpperCase()+a.slice(1):r.value==="lowercase"?o=a.toLowerCase():r.value==="uppercase"&&(o=a.toUpperCase()),i.parsedStyle.text=o}return r.value},e}(),xl={},B2=0;function z2(e,t){if(e){var n=typeof e=="string"?e:e.id||B2++;xl[n]&&xl[n].destroy(),xl[n]=t}}var Aa=typeof window<"u"&&typeof window.document<"u";function U2(e){return!!e.getAttribute}function G2(e,t){for(var n=0,r=e.length;n>>1;c0(e[i],t)<0?n=i+1:r=i}return n}function c0(e,t){var n=Number(e.parsedStyle.zIndex),r=Number(t.parsedStyle.zIndex);if(n===r){var i=e.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(e)-a.indexOf(t)}}return n-r}function h0(e){var t,n=e;do{var r=(t=n.parsedStyle)===null||t===void 0?void 0:t.clipPath;if(r)return n;n=n.parentElement}while(n!==null);return null}var ad="px";function H2(e,t,n){Aa&&e.style&&(e.style.width=t+ad,e.style.height=n+ad)}function d0(e,t){if(Aa)return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function V2(e){var t=d0(e,"width");return t==="auto"?e.offsetWidth:parseFloat(t)}function W2(e){var t=d0(e,"height");return t==="auto"?e.offsetHeight:parseFloat(t)}var Y2=1,X2={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Au=typeof performance=="object"&&performance.now?performance:Date;function Er(e,t,n){var r=!1,i=!1,a=!!t&&!t.isNone,o=!!n&&!n.isNone;return e==="visiblepainted"||e==="painted"||e==="auto"?(r=a,i=o):e==="visiblefill"||e==="fill"?r=!0:e==="visiblestroke"||e==="stroke"?i=!0:(e==="visible"||e==="all")&&(r=!0,i=!0),[r,i]}var $2=1,j2=function(){return $2++},qt=typeof self=="object"&&self.self==self?self:typeof global=="object"&&global.global==global?global:{},K2=Date.now(),q2=function(){return qt.performance&&typeof qt.performance.now=="function"?qt.performance.now():Date.now()-K2},bi={},od=Date.now(),Q2=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");var t=Date.now(),n=t-od,r=n>16?0:16-n,i=j2();return bi[i]=e,Object.keys(bi).length>1||setTimeout(function(){od=t;var a=bi;bi={},Object.keys(a).forEach(function(o){return a[o](q2())})},r),i},Z2=function(e){delete bi[e]},J2=["","webkit","moz","ms","o"],p0=function(e){return typeof e!="string"?Q2:e===""?qt.requestAnimationFrame:qt[e+"RequestAnimationFrame"]},eE=function(e){return typeof e!="string"?Z2:e===""?qt.cancelAnimationFrame:qt[e+"CancelAnimationFrame"]||qt[e+"CancelRequestAnimationFrame"]},tE=function(e,t){for(var n=0;e[n]!==void 0;){if(t(e[n]))return e[n];n=n+1}},v0=tE(J2,function(e){return!!p0(e)}),y0=p0(v0),m0=eE(v0);qt.requestAnimationFrame=y0;qt.cancelAnimationFrame=m0;var nE=function(){function e(){this.callbacks=[]}return e.prototype.getCallbacksNum=function(){return this.callbacks.length},e.prototype.tapPromise=function(t,n){this.callbacks.push(n)},e.prototype.promise=function(){for(var t=[],n=0;n=0;l--){var u=s[l].trim();!aE.test(u)&&iE.indexOf(u)<0&&(u='"'.concat(u,'"')),s[l]=u}return"".concat(r," ").concat(i," ").concat(a," ").concat(o," ").concat(s.join(","))}var sE=function(){function e(){this.parser=fs,this.parserWithCSSDisabled=fs,this.mixer=x2}return e.prototype.calculator=function(t,n,r,i){return r instanceof st?[]:r},e.prototype.postProcessor=function(t){var n=t.parsedStyle.transform;$f(n,t)},e}(),lE=function(){function e(){this.parser=f0}return e}(),uE=function(){function e(){this.parser=hr}return e.prototype.calculator=function(t,n,r,i){return r.value},e.prototype.postProcessor=function(t){if(t.parentNode){var n=t.parentNode,r=n.renderable,i=n.sortable;r&&(r.dirty=!0),i&&(i.dirty=!0,i.dirtyReason=ai.Z_INDEX_CHANGED)}},e}(),fE=function(){function e(){}return e.prototype.update=function(t,n){var r=t.r,i=r*2,a=r*2;return{width:i,height:a}},e}(),cE=function(){function e(){}return e.prototype.update=function(t,n){var r=t.rx,i=t.ry,a=r*2,o=i*2;return{width:a,height:o}},e}(),hE=function(){function e(){}return e.prototype.update=function(t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2,o=Math.min(n,i),s=Math.max(n,i),l=Math.min(r,a),u=Math.max(r,a),f=s-o,c=u-l;return{width:f,height:c}},e}(),dE=function(){function e(){}return e.prototype.update=function(t){var n=t.path,r=n.rect,i=r.width,a=r.height;return{width:i,height:a}},e}(),pE=function(){function e(){}return e.prototype.update=function(t){var n=t.points.points,r=Math.min.apply(Math,Z([],F(n.map(function(u){return u[0]})),!1)),i=Math.max.apply(Math,Z([],F(n.map(function(u){return u[0]})),!1)),a=Math.min.apply(Math,Z([],F(n.map(function(u){return u[1]})),!1)),o=Math.max.apply(Math,Z([],F(n.map(function(u){return u[1]})),!1)),s=i-r,l=o-a;return{width:s,height:l}},e}(),vE=function(){function e(){}return e.prototype.update=function(t,n){var r=t.img,i=t.width,a=i===void 0?0:i,o=t.height,s=o===void 0?0:o,l=a,u=s;return r&&!$e(r)&&(l||(l=r.width,t.width=l),u||(u=r.height,t.height=u)),{width:l,height:u}},e}(),yE=function(){function e(t){this.globalRuntime=t}return e.prototype.isReadyToMeasure=function(t,n){var r=t.text,i=t.textAlign,a=t.textBaseline,o=t.fontSize,s=t.fontStyle,l=t.fontWeight,u=t.fontVariant,f=t.lineWidth;return r&&o&&s&&l&&u&&i&&a&&!U(f)},e.prototype.update=function(t,n){var r,i,a=t.text,o=t.textAlign,s=t.lineWidth,l=t.textBaseline,u=t.dx,f=t.dy;if(!this.isReadyToMeasure(t,n))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var c=(((i=(r=n==null?void 0:n.ownerDocument)===null||r===void 0?void 0:r.defaultView)===null||i===void 0?void 0:i.getConfig())||{}).offscreenCanvas,h=this.globalRuntime.textService.measureText(a,t,c);t.metrics=h;var p=h.width,v=h.height,m=h.lineHeight,d=h.fontProperties,y=[p/2,v/2,0],g=[0,1],E=0;o==="center"||o==="middle"?(E=s/2,g=[.5,1]):(o==="right"||o==="end")&&(E=s,g=[1,1]);var P=0;return l==="middle"?P=y[1]:l==="top"||l==="hanging"?P=y[1]*2:l==="alphabetic"?P=this.globalRuntime.enableCSSParsing?m-d.ascent:0:(l==="bottom"||l==="ideographic")&&(P=0),u&&(E+=u),f&&(P+=f),t.anchor=[g[0],g[1],0],{width:y[0]*2,height:y[1]*2,offsetX:E,offsetY:P}},e}();function mE(e){return!!e.type}var Rs=function(){function e(t){this.eventPhase=e.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new De,this.page=new De,this.canvas=new De,this.viewport=new De,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),e.prototype.composedPath=function(){return this.manager&&(!this.path||this.path[0]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(e.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.prototype.stopPropagation=function(){this.propagationStopped=!0},e.prototype.initEvent=function(){},e.prototype.initUIEvent=function(){},e.prototype.clone=function(){throw new Error(le)},e}(),g0=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.client=new De,n.movement=new De,n.offset=new De,n.global=new De,n.screen=new De,n}return Object.defineProperty(t.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),t.prototype.getModifierState=function(n){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(n)},t.prototype.initMouseEvent=function(){throw new Error(le)},t}(Rs),Lu=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.width=0,n.height=0,n.isPrimary=!1,n}return t.prototype.getCoalescedEvents=function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]},t.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},t.prototype.clone=function(){return this.manager.clonePointerEvent(this)},t}(g0),Iu=function(e){Q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},t}(g0),He=function(e){Q(t,e);function t(n,r){var i=e.call(this,null)||this;return i.type=n,i.detail=r,Object.assign(i,r),i}return t}(Rs),sd=":",x0=function(){function e(){this.emitter=new Bf}return e.prototype.on=function(t,n,r){return this.addEventListener(t,n,r),this},e.prototype.addEventListener=function(t,n,r){var i=kh(r)&&r||Oo(r)&&r.capture,a=Oo(r)&&r.once,o=Br(n)?void 0:n,s=!1,l="";if(t.indexOf(sd)>-1){var u=F(t.split(sd),2),f=u[0],c=u[1];t=c,l=f,s=!0}if(t=i?"".concat(t,"capture"):t,n=Br(n)?n:n.handleEvent,s){var h=n;n=function(){for(var p,v=[],m=0;m0},t.prototype.isDefaultNamespace=function(n){throw new Error(le)},t.prototype.lookupNamespaceURI=function(n){throw new Error(le)},t.prototype.lookupPrefix=function(n){throw new Error(le)},t.prototype.normalize=function(){throw new Error(le)},t.prototype.isEqualNode=function(n){return this===n},t.prototype.isSameNode=function(n){return this.isEqualNode(n)},Object.defineProperty(t.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),t.prototype.compareDocumentPosition=function(n){var r;if(n===this)return 0;for(var i=n,a=this,o=[i],s=[a];(r=i.parentNode)!==null&&r!==void 0?r:a.parentNode;)i=i.parentNode?(o.push(i.parentNode),i.parentNode):i,a=a.parentNode?(s.push(a.parentNode),a.parentNode):a;if(i!==a)return t.DOCUMENT_POSITION_DISCONNECTED|t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|t.DOCUMENT_POSITION_PRECEDING;var l=o.length>s.length?o:s,u=l===o?s:o;if(l[l.length-u.length]===u[0])return l===o?t.DOCUMENT_POSITION_CONTAINED_BY|t.DOCUMENT_POSITION_FOLLOWING:t.DOCUMENT_POSITION_CONTAINS|t.DOCUMENT_POSITION_PRECEDING;for(var f=l.length-u.length,c=u.length-1;c>=0;c--){var h=u[c],p=l[f+c];if(p!==h){var v=h.parentNode.childNodes;return v.indexOf(h)0&&r;)r=r.parentNode,n--;return r},t.prototype.forEach=function(n,r){r===void 0&&(r=!1),n(this)||(r?this.childNodes.slice():this.childNodes).forEach(function(i){i.forEach(n)})},t.DOCUMENT_POSITION_DISCONNECTED=1,t.DOCUMENT_POSITION_PRECEDING=2,t.DOCUMENT_POSITION_FOLLOWING=4,t.DOCUMENT_POSITION_CONTAINS=8,t.DOCUMENT_POSITION_CONTAINED_BY=16,t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,t}(x0),gE=2048,xE=function(){function e(t,n){var r=this;this.globalRuntime=t,this.context=n,this.emitter=new Bf,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=he(),this.tmpVec3=J(),this.onPointerDown=function(i){var a=r.createPointerEvent(i);if(r.dispatchEvent(a,"pointerdown"),a.pointerType==="touch")r.dispatchEvent(a,"touchstart");else if(a.pointerType==="mouse"||a.pointerType==="pen"){var o=a.button===2;r.dispatchEvent(a,o?"rightdown":"mousedown")}var s=r.trackingData(i.pointerId);s.pressTargetsByButton[i.button]=a.composedPath(),r.freeEvent(a)},this.onPointerUp=function(i){var a,o=Au.now(),s=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(s,"pointerup"),s.pointerType==="touch")r.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var l=s.button===2;r.dispatchEvent(s,l?"rightup":"mouseup")}var u=r.trackingData(i.pointerId),f=r.findMountedTarget(u.pressTargetsByButton[i.button]),c=f;if(f&&!s.composedPath().includes(f)){for(var h=f;h&&!s.composedPath().includes(h);){if(s.currentTarget=h,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")r.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var l=s.button===2;r.notifyTarget(s,l?"rightupoutside":"mouseupoutside")}Fe.isNode(h)&&(h=h.parentNode)}delete u.pressTargetsByButton[i.button],c=h}if(c){var p=r.clonePointerEvent(s,"click");p.target=c,p.path=[],u.clicksByButton[i.button]||(u.clicksByButton[i.button]={clickCount:0,target:p.target,timeStamp:o});var v=u.clicksByButton[i.button];v.target===p.target&&o-v.timeStamp<200?++v.clickCount:v.clickCount=1,v.target=p.target,v.timeStamp=o,p.detail=v.clickCount,!((a=s.detail)===null||a===void 0)&&a.preventClick||(!r.context.config.useNativeClickEvent&&(p.pointerType==="mouse"||p.pointerType==="touch")&&r.dispatchEvent(p,"click"),r.dispatchEvent(p,"pointertap")),r.freeEvent(p)}r.freeEvent(s)},this.onPointerMove=function(i){var a=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),o=a.pointerType==="mouse"||a.pointerType==="pen",s=r.trackingData(i.pointerId),l=r.findMountedTarget(s.overTargets);if(s.overTargets&&l!==a.target){var u=i.type==="mousemove"?"mouseout":"pointerout",f=r.createPointerEvent(i,u,l||void 0);if(r.dispatchEvent(f,"pointerout"),o&&r.dispatchEvent(f,"mouseout"),!a.composedPath().includes(l)){var c=r.createPointerEvent(i,"pointerleave",l||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!a.composedPath().includes(c.target);)c.currentTarget=c.target,r.notifyTarget(c),o&&r.notifyTarget(c,"mouseleave"),Fe.isNode(c.target)&&(c.target=c.target.parentNode);r.freeEvent(c)}r.freeEvent(f)}if(l!==a.target){var h=i.type==="mousemove"?"mouseover":"pointerover",p=r.clonePointerEvent(a,h);r.dispatchEvent(p,"pointerover"),o&&r.dispatchEvent(p,"mouseover");for(var v=l&&Fe.isNode(l)&&l.parentNode;v&&v!==(Fe.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&v!==a.target;)v=v.parentNode;var m=!v||v===(Fe.isNode(r.rootTarget)&&r.rootTarget.parentNode);if(m){var d=r.clonePointerEvent(a,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==l&&d.target!==(Fe.isNode(r.rootTarget)&&r.rootTarget.parentNode);)d.currentTarget=d.target,r.notifyTarget(d),o&&r.notifyTarget(d,"mouseenter"),Fe.isNode(d.target)&&(d.target=d.target.parentNode);r.freeEvent(d)}r.freeEvent(p)}r.dispatchEvent(a,"pointermove"),a.pointerType==="touch"&&r.dispatchEvent(a,"touchmove"),o&&(r.dispatchEvent(a,"mousemove"),r.cursor=r.getCursor(a.target)),s.overTargets=a.composedPath(),r.freeEvent(a)},this.onPointerOut=function(i){var a=r.trackingData(i.pointerId);if(a.overTargets){var o=i.pointerType==="mouse"||i.pointerType==="pen",s=r.findMountedTarget(a.overTargets),l=r.createPointerEvent(i,"pointerout",s||void 0);r.dispatchEvent(l),o&&r.dispatchEvent(l,"mouseout");var u=r.createPointerEvent(i,"pointerleave",s||void 0);for(u.eventPhase=u.AT_TARGET;u.target&&u.target!==(Fe.isNode(r.rootTarget)&&r.rootTarget.parentNode);)u.currentTarget=u.target,r.notifyTarget(u),o&&r.notifyTarget(u,"mouseleave"),Fe.isNode(u.target)&&(u.target=u.target.parentNode);a.overTargets=null,r.freeEvent(l),r.freeEvent(u)}r.cursor=null},this.onPointerOver=function(i){var a=r.trackingData(i.pointerId),o=r.createPointerEvent(i),s=o.pointerType==="mouse"||o.pointerType==="pen";r.dispatchEvent(o,"pointerover"),s&&r.dispatchEvent(o,"mouseover"),o.pointerType==="mouse"&&(r.cursor=r.getCursor(o.target));var l=r.clonePointerEvent(o,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==(Fe.isNode(r.rootTarget)&&r.rootTarget.parentNode);)l.currentTarget=l.target,r.notifyTarget(l),s&&r.notifyTarget(l,"mouseenter"),Fe.isNode(l.target)&&(l.target=l.target.parentNode);a.overTargets=o.composedPath(),r.freeEvent(o),r.freeEvent(l)},this.onPointerUpOutside=function(i){var a=r.trackingData(i.pointerId),o=r.findMountedTarget(a.pressTargetsByButton[i.button]),s=r.createPointerEvent(i);if(o){for(var l=o;l;)s.currentTarget=l,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"||(s.pointerType==="mouse"||s.pointerType==="pen")&&r.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),Fe.isNode(l)&&(l=l.parentNode);delete a.pressTargetsByButton[i.button]}r.freeEvent(s)},this.onWheel=function(i){var a=r.createWheelEvent(i);r.dispatchEvent(a),r.freeEvent(a)},this.onClick=function(i){if(r.context.config.useNativeClickEvent){var a=r.createPointerEvent(i);r.dispatchEvent(a),r.freeEvent(a)}},this.onPointerCancel=function(i){var a=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(a),r.freeEvent(a)}}return e.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},e.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},e.prototype.client2Viewport=function(t){var n=this.context.contextService.getBoundingClientRect();return new De(t.x-((n==null?void 0:n.left)||0),t.y-((n==null?void 0:n.top)||0))},e.prototype.viewport2Client=function(t){var n=this.context.contextService.getBoundingClientRect();return new De(t.x+((n==null?void 0:n.left)||0),t.y+((n==null?void 0:n.top)||0))},e.prototype.viewport2Canvas=function(t){var n=t.x,r=t.y,i=this.rootTarget.defaultView,a=i.getCamera(),o=this.context.config,s=o.width,l=o.height,u=a.getPerspectiveInverse(),f=a.getWorldTransform(),c=We(this.tmpMatrix,f,u),h=Dt(this.tmpVec3,n/s*2-1,(1-r/l)*2-1,0);return St(h,h,c),new De(h[0],h[1])},e.prototype.canvas2Viewport=function(t){var n=this.rootTarget.defaultView,r=n.getCamera(),i=r.getPerspective(),a=r.getViewTransform(),o=We(this.tmpMatrix,i,a),s=Dt(this.tmpVec3,t.x,t.y,0);St(this.tmpVec3,this.tmpVec3,o);var l=this.context.config,u=l.width,f=l.height;return new De((s[0]+1)/2*u,(1-(s[1]+1)/2)*f)},e.prototype.setPickHandler=function(t){this.pickHandler=t},e.prototype.addEventMapping=function(t,n){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:n,priority:0}),this.mappingTable[t].sort(function(r,i){return r.priority-i.priority})},e.prototype.mapEvent=function(t){if(this.rootTarget){var n=this.mappingTable[t.type];if(n)for(var r=0,i=n.length;r=1;i--)if(t.currentTarget=r[i],this.notifyTarget(t,n),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,n),!(t.propagationStopped||t.propagationImmediatelyStopped)){var a=r.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var i=a+1;ia||r>o?null:this.pickHandler(t)||this.rootTarget||null},e.prototype.isNativeEventFromCanvas=function(t){var n,r=this.context.contextService.getDomElement(),i=(n=t.nativeEvent)===null||n===void 0?void 0:n.target;if(i){if(i===r)return!0;if(r&&r.contains)return r.contains(i)}return t.nativeEvent.composedPath?t.nativeEvent.composedPath().indexOf(r)>-1:!1},e.prototype.getExistedHTML=function(t){var n,r;if(t.nativeEvent.composedPath)try{for(var i=mn(t.nativeEvent.composedPath()),a=i.next();!a.done;a=i.next()){var o=a.value,s=this.globalRuntime.nativeHTMLMap.get(o);if(s)return s}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null},e.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},e.prototype.createPointerEvent=function(t,n,r,i){var a=this.allocateEvent(Lu);this.copyPointerData(t,a),this.copyMouseData(t,a),this.copyData(t,a),a.nativeEvent=t.nativeEvent,a.originalEvent=t;var o=this.getExistedHTML(a);return a.target=r??(o||this.isNativeEventFromCanvas(a)&&this.pickTarget(a)||i),typeof n=="string"&&(a.type=n),a},e.prototype.createWheelEvent=function(t){var n=this.allocateEvent(Iu);this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t;var r=this.getExistedHTML(n);return n.target=r||this.isNativeEventFromCanvas(n)&&this.pickTarget(n),n},e.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.prototype.cloneWheelEvent=function(t){var n=this.allocateEvent(Iu);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=t.type,n},e.prototype.clonePointerEvent=function(t,n){var r=this.allocateEvent(Lu);return r.nativeEvent=t.nativeEvent,r.originalEvent=t.originalEvent,this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.target=t.target,r.path=t.composedPath().slice(),r.type=n??r.type,r},e.prototype.copyPointerData=function(t,n){n.pointerId=t.pointerId,n.width=t.width,n.height=t.height,n.isPrimary=t.isPrimary,n.pointerType=t.pointerType,n.pressure=t.pressure,n.tangentialPressure=t.tangentialPressure,n.tiltX=t.tiltX,n.tiltY=t.tiltY,n.twist=t.twist},e.prototype.copyMouseData=function(t,n){n.altKey=t.altKey,n.button=t.button,n.buttons=t.buttons,n.ctrlKey=t.ctrlKey,n.metaKey=t.metaKey,n.shiftKey=t.shiftKey,n.client.copyFrom(t.client),n.movement.copyFrom(t.movement),n.canvas.copyFrom(t.canvas),n.screen.copyFrom(t.screen),n.global.copyFrom(t.global),n.offset.copyFrom(t.offset)},e.prototype.copyWheelData=function(t,n){n.deltaMode=t.deltaMode,n.deltaX=t.deltaX,n.deltaY=t.deltaY,n.deltaZ=t.deltaZ},e.prototype.copyData=function(t,n){n.isTrusted=t.isTrusted,n.timeStamp=Au.now(),n.type=t.type,n.detail=t.detail,n.view=t.view,n.page.copyFrom(t.page),n.viewport.copyFrom(t.viewport)},e.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var n=this.eventPool.get(t).pop()||new t(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n},e.prototype.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var n=t.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),this.eventPool.get(n).push(t)},e.prototype.notifyTarget=function(t,n){n=n??t.type;var r=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(n,"capture"):n;this.notifyListeners(t,r),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,n)},e.prototype.notifyListeners=function(t,n){var r=t.currentTarget.emitter,i=r._events[n];if(i)if("fn"in i)i.once&&r.removeListener(n,i.fn,void 0,!0),i.fn.call(t.currentTarget||i.context,t);else for(var a=0;a=0;r--){var i=t[r];if(i===this.rootTarget||Fe.isNode(i)&&i.parentNode===n)n=t[r];else break}return n},e.prototype.getCursor=function(t){for(var n=t;n;){var r=U2(n)&&n.getAttribute("cursor");if(r)return r;n=Fe.isNode(n)&&n.parentNode}},e}(),EE=function(){function e(){}return e.prototype.getOrCreateCanvas=function(t,n){if(this.canvas)return this.canvas;if(t||R.offscreenCanvas)this.canvas=t||R.offscreenCanvas,this.context=this.canvas.getContext("2d",n);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",n),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch{this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",n)}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.prototype.getOrCreateContext=function(t,n){return this.context?this.context:(this.getOrCreateCanvas(t,n),this.context)},e}(),dr;(function(e){e[e.CAMERA_CHANGED=0]="CAMERA_CHANGED",e[e.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",e[e.NONE=2]="NONE"})(dr||(dr={}));var wE=function(){function e(t,n){this.globalRuntime=t,this.context=n,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ke,initAsync:new nE,dirtycheck:new El,cull:new El,beginFrame:new Ke,beforeRender:new Ke,render:new Ke,afterRender:new Ke,endFrame:new Ke,destroy:new Ke,pick:new rE,pickSync:new El,pointerDown:new Ke,pointerUp:new Ke,pointerMove:new Ke,pointerOut:new Ke,pointerOver:new Ke,pointerWheel:new Ke,pointerCancel:new Ke,click:new Ke}}return e.prototype.init=function(t){var n=this,r=X(X({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(i){i.apply(r,n.globalRuntime)}),this.hooks.init.call(),this.hooks.initAsync.getCallbacksNum()===0?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){n.inited=!0,t()})},e.prototype.getStats=function(){return this.stats},e.prototype.disableDirtyRectangleRendering=function(){var t=this.context.config.renderer,n=t.getConfig().enableDirtyRectangleRendering;return!n||this.context.renderingContext.renderReasons.has(dr.CAMERA_CHANGED)},e.prototype.render=function(t,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited&&(this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(),i.renderListCurrentFrame.forEach(function(a){r.hooks.beforeRender.call(a),r.hooks.render.call(a),r.hooks.afterRender.call(a)}),this.hooks.endFrame.call(),i.renderListCurrentFrame=[],i.renderReasons.clear(),n())},e.prototype.renderDisplayObject=function(t,n,r){var i=this,a=n.renderer.getConfig(),o=a.enableDirtyCheck,s=a.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var l=o?this.hooks.dirtycheck.call(t):t;if(l){var u=s?this.hooks.cull.call(l,this.context.camera):l;u&&(this.stats.rendered++,r.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var f=t.sortable;f.dirty&&(this.sort(t,f),f.dirty=!1,f.dirtyChildren=[],f.dirtyReason=void 0),(f.sorted||t.childNodes).forEach(function(c){i.renderDisplayObject(c,n,r)})},e.prototype.sort=function(t,n){n.sorted&&n.dirtyReason!==ai.Z_INDEX_CHANGED?n.dirtyChildren.forEach(function(r){var i=t.childNodes.indexOf(r);if(i===-1){var a=n.sorted.indexOf(r);a>=0&&n.sorted.splice(a,1)}else if(n.sorted.length===0)n.sorted.push(r);else{var o=G2(n.sorted,r);n.sorted.splice(o,0,r)}}):n.sorted=t.childNodes.slice().sort(c0)},e.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},e.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(dr.DISPLAY_OBJECT_CHANGED)},e}(),PE=/\[\s*(.*)=(.*)\s*\]/,ME=function(){function e(){}return e.prototype.selectOne=function(t,n){var r=this;if(t.startsWith("."))return n.find(function(s){return((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.find(function(s){return s.id===r.getIdOrClassname(t)});if(t.startsWith("[")){var i=this.getAttribute(t),a=i.name,o=i.value;return a?n.find(function(s){return n!==s&&(a==="name"?s.name===o:r.attributeToString(s,a)===o)}):null}else return n.find(function(s){return n!==s&&s.nodeName===t})},e.prototype.selectAll=function(t,n){var r=this;if(t.startsWith("."))return n.findAll(function(s){return n!==s&&((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.findAll(function(s){return n!==s&&s.id===r.getIdOrClassname(t)});if(t.startsWith("[")){var i=this.getAttribute(t),a=i.name,o=i.value;return a?n.findAll(function(s){return n!==s&&(a==="name"?s.name===o:r.attributeToString(s,a)===o)}):[]}else return n.findAll(function(s){return n!==s&&s.nodeName===t})},e.prototype.is=function(t,n){if(t.startsWith("."))return n.className===this.getIdOrClassname(t);if(t.startsWith("#"))return n.id===this.getIdOrClassname(t);if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i==="name"?n.name===a:this.attributeToString(n,i)===a}else return n.nodeName===t},e.prototype.getIdOrClassname=function(t){return t.substring(1)},e.prototype.getAttribute=function(t){var n=t.match(PE),r="",i="";return n&&n.length>2&&(r=n[1].replace(/"/g,""),i=n[2].replace(/"/g,"")),{name:r,value:i}},e.prototype.attributeToString=function(t,n){if(!t.getAttribute)return"";var r=t.getAttribute(n);return U(r)?"":r.toString?r.toString():""},e}(),pr=function(e){Q(t,e);function t(n,r,i,a,o,s,l,u){var f=e.call(this,null)||this;return f.relatedNode=r,f.prevValue=i,f.newValue=a,f.attrName=o,f.attrChange=s,f.prevParsedValue=l,f.newParsedValue=u,f.type=n,f}return t.ADDITION=2,t.MODIFICATION=1,t.REMOVAL=3,t}(Rs),ee;(function(e){e.REPARENT="reparent",e.DESTROY="destroy",e.ATTR_MODIFIED="DOMAttrModified",e.INSERTED="DOMNodeInserted",e.REMOVED="removed",e.MOUNTED="DOMNodeInsertedIntoDocument",e.UNMOUNTED="DOMNodeRemovedFromDocument",e.BOUNDS_CHANGED="bounds-changed",e.CULLED="culled"})(ee||(ee={}));function ld(e){var t=e.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}var SE=new pr(ee.REPARENT,null,"","","",0,"",""),TE=function(){function e(t){var n=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new He(ee.BOUNDS_CHANGED),this.rotate=function(){var r=Ce();return function(i,a,o,s){o===void 0&&(o=0),s===void 0&&(s=0),typeof a=="number"&&(a=fe(a,o,s));var l=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.rotateLocal(i,a);else{var u=Ce();ja(u,a[0],a[1],a[2]);var f=n.getRotation(i),c=n.getRotation(i.parentNode);Ka(r,c),sl(r,r),An(u,r,u),An(l.localRotation,u,f),is(l.localRotation,l.localRotation),n.dirtifyLocal(i,l)}}}(),this.rotateLocal=function(){var r=Ce();return function(i,a,o,s){o===void 0&&(o=0),s===void 0&&(s=0),typeof a=="number"&&(a=fe(a,o,s));var l=i.transformable;ja(r,a[0],a[1],a[2]),Sh(l.localRotation,l.localRotation,r),n.dirtifyLocal(i,l)}}(),this.setEulerAngles=function(){var r=Ce();return function(i,a,o,s){o===void 0&&(o=0),s===void 0&&(s=0),typeof a=="number"&&(a=fe(a,o,s));var l=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.setLocalEulerAngles(i,a);else{ja(l.localRotation,a[0],a[1],a[2]);var u=n.getRotation(i.parentNode);Ka(r,sl(Ce(),u)),Sh(l.localRotation,l.localRotation,r),n.dirtifyLocal(i,l)}}}(),this.translateLocal=function(){return function(r,i,a,o){a===void 0&&(a=0),o===void 0&&(o=0),typeof i=="number"&&(i=fe(i,a,o));var s=r.transformable;Ci(i,J())||(Gg(i,i,s.localRotation),Kr(s.localPosition,s.localPosition,i),n.dirtifyLocal(r,s))}}(),this.setPosition=function(){var r=he(),i=J();return function(a,o){var s=a.transformable;if(i[0]=o[0],i[1]=o[1],i[2]=o[2]||0,!Ci(n.getPosition(a),i)){if(rt(s.position,i),a.parentNode===null||!a.parentNode.transformable)rt(s.localPosition,i);else{var l=a.parentNode.transformable;fr(r,l.worldTransform),Wt(r,r),St(s.localPosition,i,r)}n.dirtifyLocal(a,s)}}}(),this.setLocalPosition=function(){var r=J();return function(i,a){var o=i.transformable;r[0]=a[0],r[1]=a[1],r[2]=a[2]||0,!Ci(o.localPosition,r)&&(rt(o.localPosition,r),n.dirtifyLocal(i,o))}}(),this.translate=function(){var r=J(),i=J(),a=J();return function(o,s,l,u){l===void 0&&(l=0),u===void 0&&(u=0),typeof s=="number"&&(s=Dt(i,s,l,u)),!Ci(s,r)&&(Kr(a,n.getPosition(o),s),n.setPosition(o,a))}}(),this.setRotation=function(){var r=Ce();return function(i,a,o,s,l){var u=i.transformable;if(typeof a=="number"&&(a=ll(a,o,s,l)),i.parentNode===null||!i.parentNode.transformable)n.setLocalRotation(i,a);else{var f=n.getRotation(i.parentNode);Ka(r,f),sl(r,r),An(u.localRotation,r,a),is(u.localRotation,u.localRotation),n.dirtifyLocal(i,u)}}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var r=he(),i=J(),a=ll(0,0,0,1);return function(o){var s=o.localSkew[0]!==0||o.localSkew[1]!==0;if(s){if(Qi(o.localTransform,o.localRotation,o.localPosition,fe(1,1,1),o.origin),o.localSkew[0]!==0||o.localSkew[1]!==0){var l=Oa(r);l[4]=Math.tan(o.localSkew[0]),l[1]=Math.tan(o.localSkew[1]),We(o.localTransform,o.localTransform,l)}var u=Qi(r,a,i,o.localScale,o.origin);We(o.localTransform,o.localTransform,u)}else Qi(o.localTransform,o.localRotation,o.localPosition,o.localScale,o.origin)}}()}return e.prototype.matches=function(t,n){return this.runtime.sceneGraphSelector.is(t,n)},e.prototype.querySelector=function(t,n){return this.runtime.sceneGraphSelector.selectOne(t,n)},e.prototype.querySelectorAll=function(t,n){return this.runtime.sceneGraphSelector.selectAll(t,n)},e.prototype.attach=function(t,n,r){var i,a,o=!1;t.parentNode&&(o=t.parentNode!==n,this.detach(t)),t.parentNode=n,U(r)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(r,0,t);var s=n.sortable;(!((i=s==null?void 0:s.sorted)===null||i===void 0)&&i.length||!((a=t.style)===null||a===void 0)&&a.zIndex)&&(s.dirtyChildren.indexOf(t)===-1&&s.dirtyChildren.push(t),s.dirty=!0,s.dirtyReason=ai.ADDED);var l=t.transformable;l&&this.dirtifyWorld(t,l),l.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(SE)},e.prototype.detach=function(t){var n,r;if(t.parentNode){var i=t.transformable,a=t.parentNode.sortable;(!((n=a==null?void 0:a.sorted)===null||n===void 0)&&n.length||!((r=t.style)===null||r===void 0)&&r.zIndex)&&(a.dirtyChildren.indexOf(t)===-1&&a.dirtyChildren.push(t),a.dirty=!0,a.dirtyReason=ai.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),i&&this.dirtifyWorld(t,i),t.parentNode=null}},e.prototype.getOrigin=function(t){return t.transformable.origin},e.prototype.setOrigin=function(t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=0),typeof n=="number"&&(n=[n,r,i]);var a=t.transformable;if(!(n[0]===a.origin[0]&&n[1]===a.origin[1]&&n[2]===a.origin[2])){var o=a.origin;o[0]=n[0],o[1]=n[1],o[2]=n[2]||0,this.dirtifyLocal(t,a)}},e.prototype.setLocalEulerAngles=function(t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=0),typeof n=="number"&&(n=fe(n,r,i));var a=t.transformable;ja(a.localRotation,n[0],n[1],n[2]),this.dirtifyLocal(t,a)},e.prototype.scaleLocal=function(t,n){var r=t.transformable;Bg(r.localScale,r.localScale,fe(n[0],n[1],n[2]||1)),this.dirtifyLocal(t,r)},e.prototype.setLocalScale=function(t,n){var r=t.transformable,i=fe(n[0],n[1],n[2]||r.localScale[2]);Ci(i,r.localScale)||(rt(r.localScale,i),this.dirtifyLocal(t,r))},e.prototype.setLocalRotation=function(t,n,r,i,a){typeof n=="number"&&(n=ll(n,r,i,a));var o=t.transformable;Ka(o.localRotation,n),this.dirtifyLocal(t,o)},e.prototype.setLocalSkew=function(t,n,r){typeof n=="number"&&(n=$g(n,r));var i=t.transformable;jg(i.localSkew,n),this.dirtifyLocal(t,i)},e.prototype.dirtifyLocal=function(t,n){n.localDirtyFlag||(n.localDirtyFlag=!0,n.dirtyFlag||this.dirtifyWorld(t,n))},e.prototype.dirtifyWorld=function(t,n){n.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,n),this.dirtifyToRoot(t,!0)},e.prototype.triggerPendingEvents=function(){var t=this,n=new Set,r=function(i,a){i.isConnected&&!n.has(i.entity)&&(t.boundsChangedEvent.detail=a,t.boundsChangedEvent.target=i,i.isMutationObserved?i.dispatchEvent(t.boundsChangedEvent):i.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),n.add(i.entity))};this.pendingEvents.forEach(function(i){var a=F(i,2),o=a[0],s=a[1];s.affectChildren?o.forEach(function(l){r(l,s)}):r(o,s)}),this.clearPendingEvents(),n.clear()},e.prototype.clearPendingEvents=function(){this.pendingEvents=[]},e.prototype.dirtifyToRoot=function(t,n){n===void 0&&(n=!1);var r=t;for(r.renderable&&(r.renderable.dirty=!0);r;)ld(r),r=r.parentNode;n&&t.forEach(function(i){ld(i)}),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:n}])},e.prototype.updateDisplayObjectDependency=function(t,n,r,i){if(n&&n!==r){var a=this.displayObjectDependencyMap.get(n);if(a&&a[t]){var o=a[t].indexOf(i);a[t].splice(o,1)}}if(r){var s=this.displayObjectDependencyMap.get(r);s||(this.displayObjectDependencyMap.set(r,{}),s=this.displayObjectDependencyMap.get(r)),s[t]||(s[t]=[]),s[t].push(i)}},e.prototype.informDependentDisplayObjects=function(t){var n=this,r=this.displayObjectDependencyMap.get(t);r&&Object.keys(r).forEach(function(i){r[i].forEach(function(a){n.dirtifyToRoot(a,!0),a.dispatchEvent(new pr(ee.ATTR_MODIFIED,a,n,n,i,pr.MODIFICATION,n,n)),a.isCustomElement&&a.isConnected&&a.attributeChangedCallback&&a.attributeChangedCallback(i,n,n)})})},e.prototype.getPosition=function(t){var n=t.transformable;return ns(n.position,this.getWorldTransform(t,n))},e.prototype.getRotation=function(t){var n=t.transformable;return rs(n.rotation,this.getWorldTransform(t,n))},e.prototype.getScale=function(t){var n=t.transformable;return ii(n.scaling,this.getWorldTransform(t,n))},e.prototype.getWorldTransform=function(t,n){return n===void 0&&(n=t.transformable),!n.localDirtyFlag&&!n.dirtyFlag||(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,n)),n.worldTransform},e.prototype.getLocalPosition=function(t){return t.transformable.localPosition},e.prototype.getLocalRotation=function(t){return t.transformable.localRotation},e.prototype.getLocalScale=function(t){return t.transformable.localScale},e.prototype.getLocalSkew=function(t){return t.transformable.localSkew},e.prototype.getLocalTransform=function(t){var n=t.transformable;return n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.localTransform},e.prototype.setLocalTransform=function(t,n){var r=ns(J(),n),i=rs(Ce(),n),a=ii(J(),n);this.setLocalScale(t,a),this.setLocalPosition(t,r),this.setLocalRotation(t,i)},e.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},e.prototype.getTransformedGeometryBounds=function(t,n,r){n===void 0&&(n=!1);var i=this.getGeometryBounds(t,n);if(Oe.isEmpty(i))return null;var a=r||new Oe;return a.setFromTransformedAABB(i,this.getWorldTransform(t)),a},e.prototype.getGeometryBounds=function(t,n){n===void 0&&(n=!1);var r=t.geometry,i=n?r.renderBounds:r.contentBounds||null;return i||new Oe},e.prototype.getBounds=function(t,n){var r=this;n===void 0&&(n=!1);var i=t.renderable;if(!i.boundsDirty&&!n&&i.bounds)return i.bounds;if(!i.renderBoundsDirty&&n&&i.renderBounds)return i.renderBounds;var a=n?i.renderBounds:i.bounds,o=this.getTransformedGeometryBounds(t,n,a),s=t.childNodes;if(s.forEach(function(f){var c=r.getBounds(f,n);c&&(o?o.add(c):(o=a||new Oe,o.update(c.center,c.halfExtents)))}),n){var l=h0(t);if(l){var u=l.parsedStyle.clipPath.getBounds(n);o?u&&(o=u.intersection(o)):o=u}}return o||(o=new Oe),o&&(n?i.renderBounds=o:i.bounds=o),n?i.renderBoundsDirty=!1:i.boundsDirty=!1,o},e.prototype.getLocalBounds=function(t){if(t.parentNode){var n=he();t.parentNode.transformable&&(n=Wt(he(),this.getWorldTransform(t.parentNode)));var r=this.getBounds(t);if(!Oe.isEmpty(r)){var i=new Oe;return i.setFromTransformedAABB(r,n),i}}return this.getBounds(t)},e.prototype.getBoundingClientRect=function(t){var n,r,i,a=this.getGeometryBounds(t);Oe.isEmpty(a)||(i=new Oe,i.setFromTransformedAABB(a,this.getWorldTransform(t)));var o=(r=(n=t.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||r===void 0?void 0:r.getContextService().getBoundingClientRect();if(i){var s=F(i.getMin(),2),l=s[0],u=s[1],f=F(i.getMax(),2),c=f[0],h=f[1];return new cr(l+((o==null?void 0:o.left)||0),u+((o==null?void 0:o.top)||0),c-l,h-u)}return new cr((o==null?void 0:o.left)||0,(o==null?void 0:o.top)||0,0,0)},e.prototype.dirtifyWorldInternal=function(t,n){var r=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,t.childNodes.forEach(function(a){var o=a.transformable;o.dirtyFlag||r.dirtifyWorldInternal(a,o)});var i=t.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0)}},e.prototype.syncHierarchy=function(t){var n=t.transformable;if(!n.frozen){n.frozen=!0,(n.localDirtyFlag||n.dirtyFlag)&&this.sync(t,n);for(var r=t.childNodes,i=0;il;--p){for(var d=0;d=u){n.isOverflowing=!0;break}d=0,v[m]="";continue}if(d>0&&d+T>h){if(m+1>=u){if(n.isOverflowing=!0,E>0&&E<=h){for(var C=v[m].length,k=0,N=C,_=0;_h){N=_;break}k+=A}v[m]=(v[m]||"").slice(0,N)+p}break}if(m++,d=0,v[m]="",this.isBreakingSpace(x))continue;this.canBreakInLastChar(x)||(v=this.trimToBreakable(v),d=this.sumTextWidthByCache(v[m]||"",y)),this.shouldBreakByKinsokuShorui(x,S)&&(v=this.trimByKinsokuShorui(v),d+=g(M||""))}d+=T,v[m]=(v[m]||"")+x}return v.join(` +`)},e.prototype.isBreakingSpace=function(t){return typeof t!="string"?!1:qn.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.prototype.isNewline=function(t){return typeof t!="string"?!1:qn.Newlines.indexOf(t.charCodeAt(0))>=0},e.prototype.trimToBreakable=function(t){var n=Z([],F(t),!1),r=n[n.length-2],i=this.findBreakableIndex(r);if(i===-1||!r)return n;var a=r.slice(i,i+1),o=this.isBreakingSpace(a),s=i+1,l=i+(o?0:1);return n[n.length-1]+=r.slice(s,r.length),n[n.length-2]=r.slice(0,l),n},e.prototype.canBreakInLastChar=function(t){return!(t&&ud.test(t))},e.prototype.sumTextWidthByCache=function(t,n){return t.split("").reduce(function(r,i){if(!n[i])throw Error("cannot count the word without cache");return r+n[i]},0)},e.prototype.findBreakableIndex=function(t){for(var n=t.length-1;n>=0;n--)if(!ud.test(t[n]))return n;return-1},e.prototype.getFromCache=function(t,n,r,i){var a=r[t];if(typeof a!="number"){var o=t.length*n;a=i.measureText(t).width+o,r[t]=a}return a},e}(),R={},FE=function(){var e,t=new vE,n=new pE;return e={},e[O.CIRCLE]=new fE,e[O.ELLIPSE]=new cE,e[O.RECT]=t,e[O.IMAGE]=t,e[O.GROUP]=t,e[O.LINE]=new hE,e[O.TEXT]=new yE(R),e[O.POLYLINE]=n,e[O.POLYGON]=n,e[O.PATH]=new dE,e[O.HTML]=null,e[O.MESH]=null,e}(),BE=function(){var e,t=new S2,n=new Xf;return e={},e[B.PERCENTAGE]=null,e[B.NUMBER]=new R2,e[B.ANGLE]=new P2,e[B.DEFINED_PATH]=new M2,e[B.PAINT]=t,e[B.COLOR]=t,e[B.FILTER]=new T2,e[B.LENGTH]=n,e[B.LENGTH_PERCENTAGE]=n,e[B.LENGTH_PERCENTAGE_12]=new C2,e[B.LENGTH_PERCENTAGE_14]=new k2,e[B.COORDINATE]=new N2,e[B.OFFSET_DISTANCE]=new _2,e[B.OPACITY_VALUE]=new A2,e[B.PATH]=new L2,e[B.LIST_OF_POINTS]=new I2,e[B.SHADOW_BLUR]=new D2,e[B.TEXT]=new b2,e[B.TEXT_TRANSFORM]=new F2,e[B.TRANSFORM]=new sE,e[B.TRANSFORM_ORIGIN]=new lE,e[B.Z_INDEX]=new uE,e[B.MARKER]=new O2,e}(),zE=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}};R.CameraContribution=Jv;R.AnimationTimeline=null;R.EasingFunction=null;R.offscreenCanvasCreator=new EE;R.nativeHTMLMap=new WeakMap;R.sceneGraphSelector=new ME;R.sceneGraphService=new TE(R);R.textService=new bE(R);R.geometryUpdaterFactory=FE;R.CSSPropertySyntaxFactory=BE;R.styleValueRegistry=new w2(R);R.layoutRegistry=null;R.globalThis=zE();R.enableCSSParsing=!0;R.enableDataset=!1;R.enableStyleSyntax=!0;var UE=0,fd=new pr(ee.INSERTED,null,"","","",0,"",""),cd=new pr(ee.REMOVED,null,"","","",0,"",""),GE=new He(ee.DESTROY),HE=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.entity=UE++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},n.cullable={strategy:ku.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},n.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},n.geometry={contentBounds:void 0,renderBounds:void 0},n.rBushNode={aabb:void 0},n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle=R.enableCSSParsing?{anchor:ce,opacity:ce,fillOpacity:ce,strokeOpacity:ce,fill:ce,stroke:ce,transform:ce,transformOrigin:ce,visibility:ce,pointerEvents:ce,lineWidth:ce,lineCap:ce,lineJoin:ce,increasedLineWidthForHitTesting:ce,fontSize:ce,fontFamily:ce,fontStyle:ce,fontWeight:ce,fontVariant:ce,textAlign:ce,textBaseline:ce,textTransform:ce,zIndex:ce,filter:ce,shadowType:ce}:null,n.parsedStyle={},n.attributes={},n}return Object.defineProperty(t.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(n){this.setAttribute("class",n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"classList",{get:function(){return this.className.split(" ").filter(function(n){return n!==""})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n-1]||null}return null},enumerable:!1,configurable:!0}),t.prototype.cloneNode=function(n){throw new Error(le)},t.prototype.appendChild=function(n,r){var i;if(n.destroyed)throw new Error(Px);return R.sceneGraphService.attach(n,this,r),!((i=this.ownerDocument)===null||i===void 0)&&i.defaultView&&this.ownerDocument.defaultView.mountChildren(n),fd.relatedNode=this,n.dispatchEvent(fd),n},t.prototype.insertBefore=function(n,r){if(!r)this.appendChild(n);else{var i=this.childNodes.indexOf(r);this.appendChild(n,i-1)}return n},t.prototype.replaceChild=function(n,r){var i=this.childNodes.indexOf(r);return this.removeChild(r),this.appendChild(n,i),r},t.prototype.removeChild=function(n){var r;return cd.relatedNode=this,n.dispatchEvent(cd),!((r=n.ownerDocument)===null||r===void 0)&&r.defaultView&&n.ownerDocument.defaultView.unmountChildren(n),R.sceneGraphService.detach(n),n},t.prototype.removeChildren=function(){for(var n=this.childNodes.length-1;n>=0;n--){var r=this.childNodes[n];this.removeChild(r)}},t.prototype.destroyChildren=function(){for(var n=this.childNodes.length-1;n>=0;n--){var r=this.childNodes[n];r.childNodes.length&&r.destroyChildren(),r.destroy()}},t.prototype.matches=function(n){return R.sceneGraphService.matches(n,this)},t.prototype.getElementById=function(n){return R.sceneGraphService.querySelector("#".concat(n),this)},t.prototype.getElementsByName=function(n){return R.sceneGraphService.querySelectorAll('[name="'.concat(n,'"]'),this)},t.prototype.getElementsByClassName=function(n){return R.sceneGraphService.querySelectorAll(".".concat(n),this)},t.prototype.getElementsByTagName=function(n){return R.sceneGraphService.querySelectorAll(n,this)},t.prototype.querySelector=function(n){return R.sceneGraphService.querySelector(n,this)},t.prototype.querySelectorAll=function(n){return R.sceneGraphService.querySelectorAll(n,this)},t.prototype.closest=function(n){var r=this;do{if(R.sceneGraphService.matches(n,r))return r;r=r.parentElement}while(r!==null);return null},t.prototype.find=function(n){var r=this,i=null;return this.forEach(function(a){return a!==r&&n(a)?(i=a,!0):!1}),i},t.prototype.findAll=function(n){var r=this,i=[];return this.forEach(function(a){a!==r&&n(a)&&i.push(a)}),i},t.prototype.after=function(){for(var n=this,r=[],i=0;i1){var i=n[0].currentPoint,a=n[1].currentPoint,o=n[1].startTangent;r=[],o?(r.push([i[0]-o[0],i[1]-o[1]]),r.push([i[0],i[1]])):(r.push([a[0],a[1]]),r.push([i[0],i[1]]))}return r},t.prototype.getEndTangent=function(){var n=this.parsedStyle.path.segments,r=n.length,i=[];if(r>1){var a=n[r-2].currentPoint,o=n[r-1].currentPoint,s=n[r-1].endTangent;i=[],s?(i.push([o[0]-s[0],o[1]-s[1]]),i.push([o[0],o[1]])):(i.push([a[0],a[1]]),i.push([o[0],o[1]]))}return i},t}(yt),P0=function(e){Q(t,e);function t(n){n===void 0&&(n={});var r=this,i=n.style,a=Ot(n,["style"]);r=e.call(this,X({type:O.POLYGON,style:R.enableCSSParsing?X({points:"",miterLimit:"",isClosed:!0},i):X({},i),initialParsedStyle:R.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a))||this,r.markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var o=r.parsedStyle,s=o.markerStart,l=o.markerEnd,u=o.markerMid;return s&&ne(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),u&&ne(u)&&r.placeMarkerMid(u),l&&ne(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}return t.prototype.attributeChangedCallback=function(n,r,i,a,o){n==="points"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(a&&ne(a)&&(this.markerStartAngle=0,a.remove()),o&&ne(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(a&&ne(a)&&(this.markerEndAngle=0,a.remove()),o&&ne(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(o)},t.prototype.transformMarker=function(n){var r=this.parsedStyle,i=r.markerStart,a=r.markerEnd,o=r.markerStartOffset,s=r.markerEndOffset,l=r.points.points,u=r.defX,f=r.defY,c=n?i:a;if(!(!c||!ne(c))){var h=0,p,v,m,d,y,g;if(m=l[0][0]-u,d=l[0][1]-f,n)p=l[1][0]-l[0][0],v=l[1][1]-l[0][1],y=o||0,g=this.markerStartAngle;else{var E=l.length;this.parsedStyle.isClosed?(p=l[E-1][0]-l[0][0],v=l[E-1][1]-l[0][1]):(m=l[E-1][0]-u,d=l[E-1][1]-f,p=l[E-2][0]-l[E-1][0],v=l[E-2][1]-l[E-1][1]),y=s||0,g=this.markerEndAngle}h=Math.atan2(v,p),c.setLocalEulerAngles(h*180/Math.PI+g),c.setLocalPosition(m+Math.cos(h)*y,d+Math.sin(h)*y)}},t.prototype.placeMarkerMid=function(n){var r=this.parsedStyle,i=r.points.points,a=r.defX,o=r.defY;if(this.markerMidList.forEach(function(c){c.remove()}),this.markerMidList=[],n&&ne(n))for(var s=1;s<(this.parsedStyle.isClosed?i.length:i.length-1);s++){var l=i[s][0]-a,u=i[s][1]-o,f=s===1?n:n.cloneNode(!0);this.markerMidList.push(f),this.appendChild(f),f.setLocalPosition(l,u)}},t}(yt),KE=function(e){Q(t,e);function t(n){n===void 0&&(n={});var r=n.style,i=Ot(n,["style"]);return e.call(this,X({type:O.POLYLINE,style:R.enableCSSParsing?X({points:"",miterLimit:"",isClosed:!1},r):X({},r),initialParsedStyle:R.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i))||this}return t.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},t.prototype.getPointAtLength=function(n,r){return r===void 0&&(r=!1),this.getPoint(n/this.getTotalLength(),r)},t.prototype.getPoint=function(n,r){r===void 0&&(r=!1);var i=this.parsedStyle,a=i.defX,o=i.defY,s=i.points,l=s.points,u=s.segments,f=0,c=0;u.forEach(function(d,y){n>=d[0]&&n<=d[1]&&(f=(n-d[0])/(d[1]-d[0]),c=y)});var h=qv(l[c][0],l[c][1],l[c+1][0],l[c+1][1],f),p=h.x,v=h.y,m=St(J(),fe(p-a,v-o,0),r?this.getWorldTransform():this.getLocalTransform());return new De(m[0],m[1])},t.prototype.getStartTangent=function(){var n=this.parsedStyle.points.points,r=[];return r.push([n[1][0],n[1][1]]),r.push([n[0][0],n[0][1]]),r},t.prototype.getEndTangent=function(){var n=this.parsedStyle.points.points,r=n.length-1,i=[];return i.push([n[r-1][0],n[r-1][1]]),i.push([n[r][0],n[r][1]]),i},t}(P0),M0=function(e){Q(t,e);function t(n){n===void 0&&(n={});var r=n.style,i=Ot(n,["style"]);return e.call(this,X({type:O.RECT,style:R.enableCSSParsing?X({x:"",y:"",width:"",height:"",radius:""},r):X({},r)},i))||this}return t}(yt),S0=function(e){Q(t,e);function t(n){n===void 0&&(n={});var r=n.style,i=Ot(n,["style"]);return e.call(this,X({type:O.TEXT,style:R.enableCSSParsing?X({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},r):X({fill:"black"},r),initialParsedStyle:R.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0}},i))||this}return t.prototype.getComputedTextLength=function(){var n;return((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.maxLineWidth)||0},t.prototype.getLineBoundingRects=function(){var n;return((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.lineMetrics)||[]},t.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},t}(yt),qE=function(){function e(){this.registry={},this.define(O.CIRCLE,zn),this.define(O.ELLIPSE,$E),this.define(O.RECT,M0),this.define(O.IMAGE,w0),this.define(O.LINE,jf),this.define(O.GROUP,Du),this.define(O.PATH,_s),this.define(O.POLYGON,P0),this.define(O.POLYLINE,KE),this.define(O.TEXT,S0),this.define(O.HTML,jE)}return e.prototype.define=function(t,n){this.registry[t]=n},e.prototype.get=function(t){return this.registry[t]},e}(),QE=function(e){Q(t,e);function t(){var n=e.call(this)||this;n.defaultView=null,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new R.AnimationTimeline(n)}catch{}var r={};return Yf.forEach(function(i){var a=i.n,o=i.inh,s=i.d;o&&s&&(r[a]=Br(s)?s(O.GROUP):s)}),n.documentElement=new Du({id:"g-root",style:r}),n.documentElement.ownerDocument=n,n.documentElement.parentNode=n,n.childNodes=[n.documentElement],n}return Object.defineProperty(t.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),t.prototype.createElement=function(n,r){if(n==="svg")return this.documentElement;var i=this.defaultView.customElements.get(n);i||(console.warn("Unsupported tagName: ",n),i=n==="tspan"?S0:Du);var a=new i(r);return a.ownerDocument=this,a},t.prototype.createElementNS=function(n,r,i){return this.createElement(r,i)},t.prototype.cloneNode=function(n){throw new Error(le)},t.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch{}},t.prototype.elementsFromBBox=function(n,r,i,a){var o=this.defaultView.context.rBushRoot,s=o.search({minX:n,minY:r,maxX:i,maxY:a}),l=[];return s.forEach(function(u){var f=u.displayObject,c=f.parsedStyle.pointerEvents,h=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(c);(!h||h&&f.isVisible())&&!f.isCulled()&&f.isInteractive()&&l.push(f)}),l.sort(function(u,f){return f.sortable.renderOrder-u.sortable.renderOrder}),l},t.prototype.elementFromPointSync=function(n,r){var i=this.defaultView.canvas2Viewport({x:n,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),l=s.width,u=s.height;if(a<0||o<0||a>l||o>u)return null;var f=this.defaultView.viewport2Client({x:a,y:o}),c=f.x,h=f.y,p=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:n,y:r,viewportX:a,viewportY:o,clientX:c,clientY:h},picked:[]}).picked;return p&&p[0]||this.documentElement},t.prototype.elementFromPoint=function(n,r){return pa(this,void 0,void 0,function(){var i,a,o,s,l,u,f,c,h,p;return va(this,function(v){switch(v.label){case 0:return i=this.defaultView.canvas2Viewport({x:n,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),l=s.width,u=s.height,a<0||o<0||a>l||o>u?[2,null]:(f=this.defaultView.viewport2Client({x:a,y:o}),c=f.x,h=f.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:n,y:r,viewportX:a,viewportY:o,clientX:c,clientY:h},picked:[]})]);case 1:return p=v.sent().picked,[2,p&&p[0]||this.documentElement]}})})},t.prototype.elementsFromPointSync=function(n,r){var i=this.defaultView.canvas2Viewport({x:n,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),l=s.width,u=s.height;if(a<0||o<0||a>l||o>u)return[];var f=this.defaultView.viewport2Client({x:a,y:o}),c=f.x,h=f.y,p=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:n,y:r,viewportX:a,viewportY:o,clientX:c,clientY:h},picked:[]}).picked;return p[p.length-1]!==this.documentElement&&p.push(this.documentElement),p},t.prototype.elementsFromPoint=function(n,r){return pa(this,void 0,void 0,function(){var i,a,o,s,l,u,f,c,h,p;return va(this,function(v){switch(v.label){case 0:return i=this.defaultView.canvas2Viewport({x:n,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),l=s.width,u=s.height,a<0||o<0||a>l||o>u?[2,[]]:(f=this.defaultView.viewport2Client({x:a,y:o}),c=f.x,h=f.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:n,y:r,viewportX:a,viewportY:o,clientX:c,clientY:h},picked:[]})]);case 1:return p=v.sent().picked,p[p.length-1]!==this.documentElement&&p.push(this.documentElement),[2,p]}})})},t.prototype.appendChild=function(n,r){throw new Error(Cr)},t.prototype.insertBefore=function(n,r){throw new Error(Cr)},t.prototype.removeChild=function(n,r){throw new Error(Cr)},t.prototype.replaceChild=function(n,r,i){throw new Error(Cr)},t.prototype.append=function(){throw new Error(Cr)},t.prototype.prepend=function(){throw new Error(Cr)},t.prototype.getElementById=function(n){return this.documentElement.getElementById(n)},t.prototype.getElementsByName=function(n){return this.documentElement.getElementsByName(n)},t.prototype.getElementsByTagName=function(n){return this.documentElement.getElementsByTagName(n)},t.prototype.getElementsByClassName=function(n){return this.documentElement.getElementsByClassName(n)},t.prototype.querySelector=function(n){return this.documentElement.querySelector(n)},t.prototype.querySelectorAll=function(n){return this.documentElement.querySelectorAll(n)},t.prototype.find=function(n){return this.documentElement.find(n)},t.prototype.findAll=function(n){return this.documentElement.findAll(n)},t}(Fe),ZE=function(){function e(t){this.strategies=t}return e.prototype.apply=function(t){var n=t.camera,r=t.renderingService,i=t.renderingContext,a=this.strategies;r.hooks.cull.tap(e.tag,function(o){if(o){var s=o.cullable;return a.length===0?s.visible=i.unculledEntities.indexOf(o.entity)>-1:s.visible=a.every(function(l){return l.isVisible(n,o)}),!o.isCulled()&&o.isVisible()?o:(o.dispatchEvent(new He(ee.CULLED)),null)}return o}),r.hooks.afterRender.tap(e.tag,function(o){o.cullable.visibilityPlaneMask=-1})},e.tag="Culling",e}(),JE=function(){function e(){}return e.prototype.apply=function(t){var n=t.renderingService;n.hooks.dirtycheck.tap(e.tag,function(r){if(r){var i=r.renderable,a=i.dirty||n.disableDirtyRectangleRendering();return a?r:null}return r})},e.tag="DirtyCheck",e}(),ew=function(){function e(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Lu(null),this.rootWheelEvent=new Iu(null),this.onPointerMove=function(n){var r,i,a,o,s=(o=(a=t.context.renderingContext.root)===null||a===void 0?void 0:a.ownerDocument)===null||o===void 0?void 0:o.defaultView;if(!(s.supportsTouchEvents&&n.pointerType==="touch")){var l=t.normalizeToPointerEvent(n,s);try{for(var u=mn(l),f=u.next();!f.done;f=u.next()){var c=f.value,h=t.bootstrapEvent(t.rootPointerEvent,c,s,n);t.context.eventService.mapEvent(h)}}catch(p){r={error:p}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(n){var r,i,a,o,s=(o=(a=t.context.renderingContext.root)===null||a===void 0?void 0:a.ownerDocument)===null||o===void 0?void 0:o.defaultView,l=t.normalizeToPointerEvent(n,s);try{for(var u=mn(l),f=u.next();!f.done;f=u.next()){var c=f.value,h=t.bootstrapEvent(t.rootPointerEvent,c,s,n);t.context.eventService.mapEvent(h)}}catch(p){r={error:p}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}t.setCursor(t.context.eventService.cursor)}}return e.prototype.apply=function(t){var n=this;this.context=t;var r=t.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(a){var o=n.context.renderingService.hooks.pickSync.call({position:a,picked:[],topmost:!0}).picked;return o[0]||null}),r.hooks.pointerWheel.tap(e.tag,function(a){var o=n.normalizeWheelEvent(a);n.context.eventService.mapEvent(o)}),r.hooks.pointerDown.tap(e.tag,function(a){var o,s;if(!(i.supportsTouchEvents&&a.pointerType==="touch")){var l=n.normalizeToPointerEvent(a,i);if(n.autoPreventDefault&&l[0].isNormalized){var u=a.cancelable||!("cancelable"in a);u&&a.preventDefault()}try{for(var f=mn(l),c=f.next();!c.done;c=f.next()){var h=c.value,p=n.bootstrapEvent(n.rootPointerEvent,h,i,a);n.context.eventService.mapEvent(p)}}catch(v){o={error:v}}finally{try{c&&!c.done&&(s=f.return)&&s.call(f)}finally{if(o)throw o.error}}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerUp.tap(e.tag,function(a){var o,s;if(!(i.supportsTouchEvents&&a.pointerType==="touch")){var l=n.context.contextService.getDomElement(),u="outside";try{u=l&&a.target&&a.target!==l&&l.contains&&!l.contains(a.target)?"outside":""}catch{}var f=n.normalizeToPointerEvent(a,i);try{for(var c=mn(f),h=c.next();!h.done;h=c.next()){var p=h.value,v=n.bootstrapEvent(n.rootPointerEvent,p,i,a);v.type+=u,n.context.eventService.mapEvent(v)}}catch(m){o={error:m}}finally{try{h&&!h.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerMove.tap(e.tag,this.onPointerMove),r.hooks.pointerOver.tap(e.tag,this.onPointerMove),r.hooks.pointerOut.tap(e.tag,this.onPointerMove),r.hooks.click.tap(e.tag,this.onClick),r.hooks.pointerCancel.tap(e.tag,function(a){var o,s,l=n.normalizeToPointerEvent(a,i);try{for(var u=mn(l),f=u.next();!f.done;f=u.next()){var c=f.value,h=n.bootstrapEvent(n.rootPointerEvent,c,i,a);n.context.eventService.mapEvent(h)}}catch(p){o={error:p}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}n.setCursor(n.context.eventService.cursor)})},e.prototype.getViewportXY=function(t){var n,r,i=t.offsetX,a=t.offsetY,o=t.clientX,s=t.clientY;if(this.context.config.supportsCSSTransform&&!U(i)&&!U(a))n=i,r=a;else{var l=this.context.eventService.client2Viewport(new De(o,s));n=l.x,r=l.y}return{x:n,y:r}},e.prototype.bootstrapEvent=function(t,n,r,i){var a,o;t.view=r,t.originalEvent=null,t.nativeEvent=i,t.pointerId=n.pointerId,t.width=n.width,t.height=n.height,t.isPrimary=n.isPrimary,t.pointerType=n.pointerType,t.pressure=n.pressure,t.tangentialPressure=n.tangentialPressure,t.tiltX=n.tiltX,t.tiltY=n.tiltY,t.twist=n.twist,this.transferMouseData(t,n);var s=(a=this.getViewportXY(n),a.x),l=a.y;t.viewport.x=s,t.viewport.y=l;var u=(o=this.context.eventService.viewport2Canvas(t.viewport),o.x),f=o.y;return t.canvas.x=u,t.canvas.y=f,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=i.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=X2[t.type]||t.type),t},e.prototype.normalizeWheelEvent=function(t){var n,r,i=this.rootWheelEvent;this.transferMouseData(i,t),i.deltaMode=t.deltaMode,i.deltaX=t.deltaX,i.deltaY=t.deltaY,i.deltaZ=t.deltaZ;var a=(n=this.getViewportXY(t),n.x),o=n.y;i.viewport.x=a,i.viewport.y=o;var s=(r=this.context.eventService.viewport2Canvas(i.viewport),r.x),l=r.y;return i.canvas.x=s,i.canvas.y=l,i.global.copyFrom(i.canvas),i.offset.copyFrom(i.canvas),i.nativeEvent=t,i.type=t.type,i},e.prototype.transferMouseData=function(t,n){t.isTrusted=n.isTrusted,t.srcElement=n.srcElement,t.timeStamp=Au.now(),t.type=n.type,t.altKey=n.altKey,t.metaKey=n.metaKey,t.shiftKey=n.shiftKey,t.ctrlKey=n.ctrlKey,t.button=n.button,t.buttons=n.buttons,t.client.x=n.clientX,t.client.y=n.clientY,t.movement.x=n.movementX,t.movement.y=n.movementY,t.page.x=n.pageX,t.page.y=n.pageY,t.screen.x=n.screenX,t.screen.y=n.screenY,t.relatedTarget=null},e.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},e.prototype.normalizeToPointerEvent=function(t,n){var r=[];if(n.isTouchEvent(t))for(var i=0;i-1,s=0,l=i.length;s=1?Math.ceil(k):1,T=s||V2(a)||a.width/k,C=l||W2(a)||a.height/k),o&&(R.offscreenCanvas=o),r.devicePixelRatio=k,r.requestAnimationFrame=v??y0.bind(R.globalThis),r.cancelAnimationFrame=m??m0.bind(R.globalThis),r.supportsTouchEvents=g??"ontouchstart"in R.globalThis,r.supportsPointerEvents=y??!!R.globalThis.PointerEvent,r.isTouchEvent=M??function(N){return r.supportsTouchEvents&&N instanceof R.globalThis.TouchEvent},r.isMouseEvent=S??function(N){return!R.globalThis.MouseEvent||N instanceof R.globalThis.MouseEvent&&(!r.supportsPointerEvents||!(N instanceof R.globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:a,width:T,height:C,renderer:f,offscreenCanvas:o,devicePixelRatio:k,cursor:h||"default",background:c||"transparent",createImage:d,document:p,supportsCSSTransform:E,useNativeClickEvent:w,alwaysTriggerPointerEventOnCanvas:x}),r.initDefaultCamera(T,C,f.clipSpaceNearZ),r.initRenderer(f,!0),r}return t.prototype.initRenderingContext=function(n){this.context.config=n,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},t.prototype.initDefaultCamera=function(n,r,i){var a=this,o=new R.CameraContribution;o.clipSpaceNearZ=i,o.setType(ae.EXPLORING,ga.DEFAULT).setPosition(n/2,r/2,dd).setFocalPoint(n/2,r/2,0).setOrthographic(n/-2,n/2,r/2,r/-2,iw,aw),o.canvas=this,o.eventEmitter.on(Zv.UPDATED,function(){a.context.renderingContext.renderReasons.add(dr.CAMERA_CHANGED)}),this.context.camera=o},t.prototype.getConfig=function(){return this.context.config},t.prototype.getRoot=function(){return this.document.documentElement},t.prototype.getCamera=function(){return this.context.camera},t.prototype.getContextService=function(){return this.context.contextService},t.prototype.getEventService=function(){return this.context.eventService},t.prototype.getRenderingService=function(){return this.context.renderingService},t.prototype.getRenderingContext=function(){return this.context.renderingContext},t.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(t.prototype,"ready",{get:function(){var n=this;return this.readyPromise||(this.readyPromise=new Promise(function(r){n.resolveReadyPromise=function(){r(n)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),t.prototype.destroy=function(n,r){if(n===void 0&&(n=!0),r===void 0&&(r=!1),r||this.dispatchEvent(new He(it.BEFORE_DESTROY)),this.frameId){var i=this.getConfig().cancelAnimationFrame||cancelAnimationFrame;i(this.frameId)}var a=this.getRoot();this.unmountChildren(a),n&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),n&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),r||this.dispatchEvent(new He(it.AFTER_DESTROY))},t.prototype.changeSize=function(n,r){this.resize(n,r)},t.prototype.resize=function(n,r){var i=this.context.config;i.width=n,i.height=r,this.getContextService().resize(n,r);var a=this.context.camera,o=a.getProjectionMode();a.setPosition(n/2,r/2,dd).setFocalPoint(n/2,r/2,0),o===tt.ORTHOGRAPHIC?a.setOrthographic(n/-2,n/2,r/2,r/-2,a.getNear(),a.getFar()):a.setAspect(n/r),this.dispatchEvent(new He(it.RESIZE,{width:n,height:r}))},t.prototype.appendChild=function(n,r){return this.document.documentElement.appendChild(n,r)},t.prototype.insertBefore=function(n,r){return this.document.documentElement.insertBefore(n,r)},t.prototype.removeChild=function(n){return this.document.documentElement.removeChild(n)},t.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},t.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},t.prototype.render=function(){var n=this;this.dispatchEvent(ow);var r=this.getRenderingService();r.render(this.getConfig(),function(){n.dispatchEvent(sw)}),this.dispatchEvent(lw)},t.prototype.run=function(){var n=this,r=function(){n.render(),n.frameId=n.requestAnimationFrame(r)};r()},t.prototype.initRenderer=function(n,r){var i=this;if(r===void 0&&(r=!1),!n)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new lx,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new ew,new rw,new JE,new ZE([new nw])),this.loadRendererContainerModule(n),this.context.contextService=new this.context.ContextService(X(X({},R),this.context)),this.context.renderingService=new wE(R,this.context),this.context.eventService=new xE(R,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(n,r,!0)):this.context.contextService.initAsync().then(function(){i.initRenderingService(n,r)})},t.prototype.initRenderingService=function(n,r,i){var a=this;r===void 0&&(r=!1),i===void 0&&(i=!1),this.context.renderingService.init(function(){a.inited=!0,r?(i?a.requestAnimationFrame(function(){a.dispatchEvent(new He(it.READY))}):a.dispatchEvent(new He(it.READY)),a.readyPromise&&a.resolveReadyPromise()):a.dispatchEvent(new He(it.RENDERER_CHANGED)),r||a.getRoot().forEach(function(o){var s=o.renderable;s&&(s.renderBoundsDirty=!0,s.boundsDirty=!0,s.dirty=!0)}),a.mountChildren(a.getRoot()),n.getConfig().enableAutoRendering&&a.run()})},t.prototype.loadRendererContainerModule=function(n){var r=this,i=n.getPlugins();i.forEach(function(a){a.context=r.context,a.init(R)})},t.prototype.setRenderer=function(n){var r=this.getConfig();if(r.renderer!==n){var i=r.renderer;r.renderer=n,this.destroy(!1,!0),Z([],F(i==null?void 0:i.getPlugins()),!1).reverse().forEach(function(a){a.destroy(R)}),this.initRenderer(n)}},t.prototype.setCursor=function(n){var r=this.getConfig();r.cursor=n,this.getContextService().applyCursorStyle(n)},t.prototype.unmountChildren=function(n){var r=this;n.childNodes.forEach(function(i){r.unmountChildren(i)}),this.inited&&(n.isMutationObserved?n.dispatchEvent(Pl):(Pl.target=n,this.dispatchEvent(Pl,!0)),n!==this.document.documentElement&&(n.ownerDocument=null),n.isConnected=!1),n.isCustomElement&&n.disconnectedCallback&&n.disconnectedCallback()},t.prototype.mountChildren=function(n){var r=this;this.inited?n.isConnected||(n.ownerDocument=this.document,n.isConnected=!0,n.isMutationObserved?n.dispatchEvent(wl):(wl.target=n,this.dispatchEvent(wl,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",n.nodeName),n.childNodes.forEach(function(i){r.mountChildren(i)}),n.isCustomElement&&n.connectedCallback&&n.connectedCallback()},t.prototype.client2Viewport=function(n){return this.getEventService().client2Viewport(n)},t.prototype.viewport2Client=function(n){return this.getEventService().viewport2Client(n)},t.prototype.viewport2Canvas=function(n){return this.getEventService().viewport2Canvas(n)},t.prototype.canvas2Viewport=function(n){return this.getEventService().canvas2Viewport(n)},t.prototype.getPointByClient=function(n,r){return this.client2Viewport({x:n,y:r})},t.prototype.getClientByPoint=function(n,r){return this.viewport2Client({x:n,y:r})},t}(x0),uw=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.landmarks=[],n}return t.prototype.rotate=function(n,r,i){if(this.relElevation=Zr(r),this.relAzimuth=Zr(n),this.relRoll=Zr(i),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===ae.EXPLORING){var a=wn(Ce(),[1,0,0],ge((this.rotateWorld?1:-1)*this.relElevation)),o=wn(Ce(),[0,1,0],ge((this.rotateWorld?1:-1)*this.relAzimuth)),s=wn(Ce(),[0,0,1],ge(this.relRoll)),l=An(Ce(),o,a);l=An(Ce(),l,s);var u=zf(he(),l);_n(this.matrix,this.matrix,[0,0,-this.distance]),We(this.matrix,this.matrix,u),_n(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===ae.ORBITING||this.type===ae.EXPLORING?this._getPosition():this.type===ae.TRACKING&&this._getFocalPoint(),this._update(),this},t.prototype.pan=function(n,r){var i=qe(n,r,0),a=en(this.position);return Kr(a,a,pu(J(),this.right,i[0])),Kr(a,a,pu(J(),this.up,i[1])),this._setPosition(a),this.triggerUpdate(),this},t.prototype.dolly=function(n){var r=this.forward,i=en(this.position),a=n*this.dollyingStep,o=this.distance+n*this.dollyingStep;return a=Math.max(Math.min(o,this.maxDistance),this.minDistance)-this.distance,i[0]+=a*r[0],i[1]+=a*r[1],i[2]+=a*r[2],this._setPosition(i),this.type===ae.ORBITING||this.type===ae.EXPLORING?this._getDistance():this.type===ae.TRACKING&&Kr(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},t.prototype.cancelLandmarkAnimation=function(){this.landmarkAnimationID!==void 0&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},t.prototype.createLandmark=function(n,r){var i,a,o,s;r===void 0&&(r={});var l=r.position,u=l===void 0?this.position:l,f=r.focalPoint,c=f===void 0?this.focalPoint:f,h=r.roll,p=r.zoom,v=new R.CameraContribution;v.setType(this.type,void 0),v.setPosition(u[0],(i=u[1])!==null&&i!==void 0?i:this.position[1],(a=u[2])!==null&&a!==void 0?a:this.position[2]),v.setFocalPoint(c[0],(o=c[1])!==null&&o!==void 0?o:this.focalPoint[1],(s=c[2])!==null&&s!==void 0?s:this.focalPoint[2]),v.setRoll(h??this.roll),v.setZoom(p??this.zoom);var m={name:n,matrix:wv(v.getWorldTransform()),right:en(v.right),up:en(v.up),forward:en(v.forward),position:en(v.getPosition()),focalPoint:en(v.getFocalPoint()),distanceVector:en(v.getDistanceVector()),distance:v.getDistance(),dollyingStep:v.getDollyingStep(),azimuth:v.getAzimuth(),elevation:v.getElevation(),roll:v.getRoll(),relAzimuth:v.relAzimuth,relElevation:v.relElevation,relRoll:v.relRoll,zoom:v.getZoom()};return this.landmarks.push(m),m},t.prototype.gotoLandmark=function(n,r){var i=this;r===void 0&&(r={});var a=$e(n)?this.landmarks.find(function(S){return S.name===n}):n;if(a){var o=Ft(r)?{duration:r}:r,s=o.easing,l=s===void 0?"linear":s,u=o.duration,f=u===void 0?100:u,c=o.easingFunction,h=c===void 0?void 0:c,p=o.onfinish,v=p===void 0?void 0:p,m=.01;if(f===0){this.syncFromLandmark(a),v&&v();return}this.cancelLandmarkAnimation();var d=a.position,y=a.focalPoint,g=a.zoom,E=a.roll,P=h||R.EasingFunction(l),w,x=function(){i.setFocalPoint(y),i.setPosition(d),i.setRoll(E),i.setZoom(g),i.computeMatrix(),i.triggerUpdate(),v&&v()},M=function(S){w===void 0&&(w=S);var T=S-w;if(T>f){x();return}var C=P(T/f),k=J(),N=J(),_=1,A=0;vu(k,i.focalPoint,y,C),vu(N,i.position,d,C),A=i.roll*(1-C)+E*C,_=i.zoom*(1-C)+g*C,i.setFocalPoint(k),i.setPosition(N),i.setRoll(A),i.setZoom(_);var z=Mh(k,y)+Mh(N,d);if(z<=m&&g==null&&E==null){x();return}i.computeMatrix(),i.triggerUpdate(),T0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_needsTick",{get:function(){return this.pending||this.playState==="running"||!this._finishedFlag},enumerable:!1,configurable:!0}),e.prototype.updatePromises=function(){var t=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==t&&(n==="idle"?(this.rejectReadyPromise(),this.readyPromise=void 0):t==="pending"?this.resolveReadyPromise():n==="pending"&&(this.readyPromise=void 0)),this.finishedPromise&&n!==t&&(n==="idle"?(this.rejectFinishedPromise(),this.finishedPromise=void 0):n==="finished"?this.resolveFinishedPromise():t==="finished"&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise},e.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),this.timeline.animations.indexOf(this)===-1&&this.timeline.animations.push(this),this.updatePromises()},e.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),!this._isFinished&&!this._paused&&!this._idle?this.currentTimePending=!0:this._idle&&(this.rewind(),this._idle=!1),this._startTime=null,this._paused=!0,this.updatePromises()},e.prototype.finish=function(){this.updatePromises(),!this._idle&&(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.prototype.cancel=function(){var t=this;if(this.updatePromises(),!!this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var n=new Ml(null,this,this.currentTime,null);setTimeout(function(){t.oncancel(n)})}},e.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),t!==null&&(this.currentTime=t),this.updatePromises()},e.prototype.updatePlaybackRate=function(t){this.playbackRate=t},e.prototype.targetAnimations=function(){var t,n=(t=this.effect)===null||t===void 0?void 0:t.target;return n.getAnimations()},e.prototype.markTarget=function(){var t=this.targetAnimations();t.indexOf(this)===-1&&t.push(this)},e.prototype.unmarkTarget=function(){var t=this.targetAnimations(),n=t.indexOf(this);n!==-1&&t.splice(n,1)},e.prototype.tick=function(t,n){!this._idle&&!this._paused&&(this._startTime===null?n&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),n&&(this.currentTimePending=!1,this.fireEvents(t))},e.prototype.rewind=function(){if(this.playbackRate>=0)this.currentTime=0;else if(this._totalDuration<1/0)this.currentTime=this._totalDuration;else throw new Error("Unable to rewind negative playback rate animation with infinite duration")},e.prototype.persist=function(){throw new Error(le)},e.prototype.addEventListener=function(t,n,r){throw new Error(le)},e.prototype.removeEventListener=function(t,n,r){throw new Error(le)},e.prototype.dispatchEvent=function(t){throw new Error(le)},e.prototype.commitStyles=function(){throw new Error(le)},e.prototype.ensureAlive=function(){var t,n;this.playbackRate<0&&this.currentTime===0?this._inEffect=!!(!((t=this.effect)===null||t===void 0)&&t.update(-1)):this._inEffect=!!(!((n=this.effect)===null||n===void 0)&&n.update(this.currentTime)),!this._inTimeline&&(this._inEffect||!this._finishedFlag)&&(this._inTimeline=!0,this.timeline.animations.push(this))},e.prototype.tickCurrentTime=function(t,n){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!n&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},e.prototype.fireEvents=function(t){var n=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var r=new Ml(null,this,this.currentTime,t);setTimeout(function(){n.onfinish&&n.onfinish(r)})}this._finishedFlag=!0}}else{if(this.onframe&&this.playState==="running"){var i=new Ml(null,this,this.currentTime,t);this.onframe(i)}this._finishedFlag=!1}},e}(),hw=4,dw=.001,pw=1e-7,vw=10,Fi=11,to=1/(Fi-1),yw=typeof Float32Array=="function",T0=function(e,t){return 1-3*t+3*e},C0=function(e,t){return 3*t-6*e},k0=function(e){return 3*e},cs=function(e,t,n){return((T0(t,n)*e+C0(t,n))*e+k0(t))*e},N0=function(e,t,n){return 3*T0(t,n)*e*e+2*C0(t,n)*e+k0(t)},mw=function(e,t,n,r,i){var a,o,s=0;do o=t+(n-t)/2,a=cs(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>pw&&++s=dw?gw(s,h,e,n):p===0?h:mw(s,l,l+to,e,n)};return function(s){return s===0||s===1?s:cs(o(s),t,r)}},xw=function(e){return e=e.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())}),e.charAt(0)==="-"?e.substring(1):e},no=function(e){return Math.pow(e,2)},ro=function(e){return Math.pow(e,3)},io=function(e){return Math.pow(e,4)},ao=function(e){return Math.pow(e,5)},oo=function(e){return Math.pow(e,6)},so=function(e){return 1-Math.cos(e*Math.PI/2)},lo=function(e){return 1-Math.sqrt(1-e*e)},uo=function(e){return e*e*(3*e-2)},fo=function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)},co=function(e,t){t===void 0&&(t=[]);var n=F(t,2),r=n[0],i=r===void 0?1:r,a=n[1],o=a===void 0?.5:a,s=ht(Number(i),1,10),l=ht(Number(o),.1,2);return e===0||e===1?e:-s*Math.pow(2,10*(e-1))*Math.sin((e-1-l/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/l)},Oi=function(e,t,n){t===void 0&&(t=[]);var r=F(t,4),i=r[0],a=i===void 0?1:i,o=r[1],s=o===void 0?100:o,l=r[2],u=l===void 0?10:l,f=r[3],c=f===void 0?0:f;a=ht(a,.1,1e3),s=ht(s,.1,1e3),u=ht(u,.1,1e3),c=ht(c,.1,1e3);var h=Math.sqrt(s/a),p=u/(2*Math.sqrt(s*a)),v=p<1?h*Math.sqrt(1-p*p):0,m=1,d=p<1?(p*h+-c)/v:-c+h,y=n?n*e/1e3:e;return p<1?y=Math.exp(-y*p*h)*(m*Math.cos(v*y)+d*Math.sin(v*y)):y=(m+d*y)*Math.exp(-y*h),e===0||e===1?e:1-y},Sl=function(e,t){t===void 0&&(t=[]);var n=F(t,2),r=n[0],i=r===void 0?10:r,a=n[1],o=a=="start"?Math.ceil:Math.floor;return o(ht(e,0,1)*i)/i},pd=function(e,t){t===void 0&&(t=[]);var n=F(t,4),r=n[0],i=n[1],a=n[2],o=n[3];return Kf(r,i,a,o)(e)},ho=Kf(.42,0,1,1),gt=function(e){return function(t,n,r){return n===void 0&&(n=[]),1-e(1-t,n,r)}},xt=function(e){return function(t,n,r){return n===void 0&&(n=[]),t<.5?e(t*2,n,r)/2:1-e(t*-2+2,n,r)/2}},Et=function(e){return function(t,n,r){return n===void 0&&(n=[]),t<.5?(1-e(1-t*2,n,r))/2:(e(t*2-1,n,r)+1)/2}},vd={steps:Sl,"step-start":function(e){return Sl(e,[1,"start"])},"step-end":function(e){return Sl(e,[1,"end"])},linear:function(e){return e},"cubic-bezier":pd,ease:function(e){return pd(e,[.25,.1,.25,1])},in:ho,out:gt(ho),"in-out":xt(ho),"out-in":Et(ho),"in-quad":no,"out-quad":gt(no),"in-out-quad":xt(no),"out-in-quad":Et(no),"in-cubic":ro,"out-cubic":gt(ro),"in-out-cubic":xt(ro),"out-in-cubic":Et(ro),"in-quart":io,"out-quart":gt(io),"in-out-quart":xt(io),"out-in-quart":Et(io),"in-quint":ao,"out-quint":gt(ao),"in-out-quint":xt(ao),"out-in-quint":Et(ao),"in-expo":oo,"out-expo":gt(oo),"in-out-expo":xt(oo),"out-in-expo":Et(oo),"in-sine":so,"out-sine":gt(so),"in-out-sine":xt(so),"out-in-sine":Et(so),"in-circ":lo,"out-circ":gt(lo),"in-out-circ":xt(lo),"out-in-circ":Et(lo),"in-back":uo,"out-back":gt(uo),"in-out-back":xt(uo),"out-in-back":Et(uo),"in-bounce":fo,"out-bounce":gt(fo),"in-out-bounce":xt(fo),"out-in-bounce":Et(fo),"in-elastic":co,"out-elastic":gt(co),"in-out-elastic":xt(co),"out-in-elastic":Et(co),spring:Oi,"spring-in":Oi,"spring-out":gt(Oi),"spring-in-out":xt(Oi),"spring-out-in":Et(Oi)},Ew=function(e){return xw(e).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},ww=function(e){return vd[Ew(e)]||vd.linear},Pw=function(e){return e},Mw=1,Sw=.5,yd=0;function md(e,t){return function(n){if(n>=1)return 1;var r=1/e;return n+=t*r,n-n%r}}var po="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Tw=new RegExp("cubic-bezier\\("+po+","+po+","+po+","+po+"\\)"),Cw=/steps\(\s*(\d+)\s*\)/,kw=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function qf(e){var t=Tw.exec(e);if(t)return Kf.apply(void 0,Z([],F(t.slice(1).map(Number)),!1));var n=Cw.exec(e);if(n)return md(Number(n[1]),yd);var r=kw.exec(e);return r?md(Number(r[1]),{start:Mw,middle:Sw,end:yd}[r[2]]):ww(e)}function Nw(e){return Math.abs(Ow(e)/(e.playbackRate||1))}function Ow(e){var t;return e.duration===0||e.iterations===0?0:(e.duration==="auto"?0:Number(e.duration))*((t=e.iterations)!==null&&t!==void 0?t:1)}var O0=0,Qf=1,As=2,R0=3;function Rw(e,t,n){if(t===null)return O0;var r=n.endTime;return t=Math.min(n.delay+e+n.endDelay,r)?As:R0}function _w(e,t,n,r,i){switch(r){case Qf:return t==="backwards"||t==="both"?0:null;case R0:return n-i;case As:return t==="forwards"||t==="both"?e:null;case O0:return null}}function Aw(e,t,n,r,i){var a=i;return e===0?t!==Qf&&(a+=n):a+=r/e,a}function Lw(e,t,n,r,i,a){var o=e===1/0?t%1:e%1;return o===0&&n===As&&r!==0&&(i!==0||a===0)&&(o=1),o}function Iw(e,t,n,r){return e===As&&t===1/0?1/0:n===1?Math.floor(r)-1:Math.floor(r)}function Dw(e,t,n){var r=e;if(e!=="normal"&&e!=="reverse"){var i=t;e==="alternate-reverse"&&(i+=1),r="normal",i!==1/0&&i%2!==0&&(r="reverse")}return r==="normal"?n:1-n}function bw(e,t,n){var r=Rw(e,t,n),i=_w(e,n.fill,t,r,n.delay);if(i===null)return null;var a=n.duration==="auto"?0:n.duration,o=Aw(a,r,n.iterations,i,n.iterationStart),s=Lw(o,n.iterationStart,r,n.iterations,i,a),l=Iw(r,n.iterations,s,o),u=Dw(n.direction,l,s);return n.currentIteration=l,n.progress=u,n.easingFunction(u)}function Fw(e,t,n){var r=Bw(e,t),i=zw(r,n);return function(a,o){if(o!==null)i.filter(function(l){return o>=l.applyFrom&&o1)throw new Error("Keyframe offsets must be between 0 and 1.");u.computedOffset=c}}else if(f==="composite"&&["replace","add","accumulate","auto"].indexOf(c)===-1)throw new Error("".concat(c," compositing is not supported"));u[f]=c}return u.offset===void 0&&(u.offset=null),u.easing===void 0&&(u.easing=(t==null?void 0:t.easing)||"linear"),u.composite===void 0&&(u.composite="auto"),u}),r=!0,i=-1/0,a=0;a=0&&Number(l.offset)<=1});function s(){var l,u,f=n.length;n[f-1].computedOffset=Number((l=n[f-1].offset)!==null&&l!==void 0?l:1),f>1&&(n[0].computedOffset=Number((u=n[0].offset)!==null&&u!==void 0?u:0));for(var c=0,h=Number(n[0].computedOffset),p=1;pa?i:a,s=i>a?1:i/a,l=i>a?a/i:1;e.save(),e.scale(s,l),e.arc(o,o,o,0,Math.PI*2)}}function Zw(e,t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2,o=t.defX,s=o===void 0?0:o,l=t.defY,u=l===void 0?0:l,f=t.markerStart,c=t.markerEnd,h=t.markerStartOffset,p=t.markerEndOffset,v=0,m=0,d=0,y=0,g=0,E,P;f&&ne(f)&&h&&(E=i-n,P=a-r,g=Math.atan2(P,E),v=Math.cos(g)*(h||0),m=Math.sin(g)*(h||0)),c&&ne(c)&&p&&(E=n-i,P=r-a,g=Math.atan2(P,E),d=Math.cos(g)*(p||0),y=Math.sin(g)*(p||0)),e.moveTo(n-s+v,r-u+m),e.lineTo(i-s+d,a-u+y)}function Jw(e,t){var n=t.defX,r=n===void 0?0:n,i=t.defY,a=i===void 0?0:i,o=t.markerStart,s=t.markerEnd,l=t.markerStartOffset,u=t.markerEndOffset,f=t.path,c=f.absolutePath,h=f.segments,p=0,v=0,m=0,d=0,y=0,g,E;if(o&&ne(o)&&l){var P=F(o.parentNode.getStartTangent(),2),w=P[0],x=P[1];g=w[0]-x[0],E=w[1]-x[1],y=Math.atan2(E,g),p=Math.cos(y)*(l||0),v=Math.sin(y)*(l||0)}if(s&&ne(s)&&u){var M=F(s.parentNode.getEndTangent(),2),w=M[0],x=M[1];g=w[0]-x[0],E=w[1]-x[1],y=Math.atan2(E,g),m=Math.cos(y)*(u||0),d=Math.sin(y)*(u||0)}for(var S=0;SH?L:H,ie=L>H?1:L/H,ue=L>H?H/L:1;e.translate(z-r,W-a),e.rotate(I),e.scale(ie,ue),e.arc(0,0,j,$,Te,!!(1-Y)),e.scale(1/ie,1/ue),e.rotate(-I),e.translate(-(z-r),-(W-a))}_&&e.lineTo(T[6]-r+m,T[7]-a+d);break}case"Z":e.closePath();break}}}function eP(e,t){var n=t.defX,r=n===void 0?0:n,i=t.defY,a=i===void 0?0:i,o=t.markerStart,s=t.markerEnd,l=t.markerStartOffset,u=t.markerEndOffset,f=t.points.points,c=f.length,h=f[0][0]-r,p=f[0][1]-a,v=f[c-1][0]-r,m=f[c-1][1]-a,d=0,y=0,g=0,E=0,P=0,w,x;o&&ne(o)&&l&&(w=f[1][0]-f[0][0],x=f[1][1]-f[0][1],P=Math.atan2(x,w),d=Math.cos(P)*(l||0),y=Math.sin(P)*(l||0)),s&&ne(s)&&u&&(w=f[c-1][0]-f[0][0],x=f[c-1][1]-f[0][1],P=Math.atan2(x,w),g=Math.cos(P)*(u||0),E=Math.sin(P)*(u||0)),e.moveTo(h+(d||g),p+(y||E));for(var M=1;M0?1:-1,u=i>0?1:-1,f=l+u===0,c=F(n.map(function(d){return ht(d,0,Math.min(Math.abs(a)/2,Math.abs(o)/2))}),4),h=c[0],p=c[1],v=c[2],m=c[3];e.moveTo(l*h,0),e.lineTo(a-l*p,0),p!==0&&e.arc(a-l*p,u*p,p,-u*Math.PI/2,l>0?0:Math.PI,f),e.lineTo(a,o-u*v),v!==0&&e.arc(a-l*v,o-u*v,v,l>0?0:Math.PI,u>0?Math.PI/2:1.5*Math.PI,f),e.lineTo(l*m,o),m!==0&&e.arc(l*m,o-u*m,m,u>0?Math.PI/2:-Math.PI/2,l>0?Math.PI:0,f),e.lineTo(0,u*h),h!==0&&e.arc(l*h,u*h,h,l>0?Math.PI:0,u>0?Math.PI*1.5:Math.PI/2,f)}}var rP=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.name="canvas-path-generator",n}return t.prototype.init=function(){var n,r=(n={},n[O.CIRCLE]=qw,n[O.ELLIPSE]=Qw,n[O.RECT]=nP,n[O.LINE]=Zw,n[O.POLYLINE]=tP,n[O.POLYGON]=eP,n[O.PATH]=Jw,n[O.TEXT]=void 0,n[O.GROUP]=void 0,n[O.IMAGE]=void 0,n[O.HTML]=void 0,n[O.MESH]=void 0,n);this.context.pathGeneratorFactory=r},t.prototype.destroy=function(){delete this.context.pathGeneratorFactory},t}(xr),iP=J(),aP=J(),oP=J(),sP=he(),lP=function(){function e(){var t=this;this.isHit=function(n,r,i,a){var o=t.context.pointInPathPickerFactory[n.nodeName];if(o){var s=Wt(sP,i),l=St(aP,Dt(oP,r[0],r[1],0),s),u=n.getGeometryBounds().halfExtents,f=n.parsedStyle.anchor;if(l[0]+=(f&&f[0]||0)*u[0]*2,l[1]+=(f&&f[1]||0)*u[1]*2,o(n,new De(l[0],l[1]),a,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(n,r){var i=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),a=t.context.pathGeneratorFactory[n.nodeName];return a&&(i.beginPath(),a(i,n.parsedStyle),i.closePath()),i.isPointInPath(r.x,r.y)}}return e.prototype.apply=function(t,n){var r=this,i,a=t.renderingService,o=t.renderingContext;this.context=t,this.runtime=n;var s=(i=o.root)===null||i===void 0?void 0:i.ownerDocument;a.hooks.pick.tapPromise(e.tag,function(l){return pa(r,void 0,void 0,function(){return va(this,function(u){return[2,this.pick(s,l)]})})}),a.hooks.pickSync.tap(e.tag,function(l){return r.pick(s,l)})},e.prototype.pick=function(t,n){var r,i,a=n.topmost,o=n.position,s=o.x,l=o.y,u=Dt(iP,s,l,0),f=t.elementsFromBBox(u[0],u[1],u[0],u[1]),c=[];try{for(var h=mn(f),p=h.next();!p.done;p=h.next()){var v=p.value,m=v.getWorldTransform(),d=this.isHit(v,u,m,!1);if(d){var y=h0(v);if(y){var g=y.parsedStyle.clipPath,E=this.isHit(g,u,g.getWorldTransform(),!0);if(E){if(a)return n.picked=[v],n;c.push(v)}}else{if(a)return n.picked=[v],n;c.push(v)}}}}catch(P){r={error:P}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return n.picked=c,n},e.tag="CanvasPicker",e}();function uP(e,t,n){var r=e.parsedStyle,i=r.r,a=r.fill,o=r.stroke,s=r.lineWidth,l=r.increasedLineWidthForHitTesting,u=r.pointerEvents,f=((s||0)+(l||0))/2,c=un(i,i,t.x,t.y),h=F(Er(u,a,o),2),p=h[0],v=h[1];return p&&v||n?c<=i+f:p?c<=i:v?c>=i-f&&c<=i+f:!1}function vo(e,t,n,r){return e/(n*n)+t/(r*r)}function fP(e,t,n){var r=e.parsedStyle,i=r.rx,a=r.ry,o=r.fill,s=r.stroke,l=r.lineWidth,u=r.increasedLineWidthForHitTesting,f=r.pointerEvents,c=t.x,h=t.y,p=F(Er(f,o,s),2),v=p[0],m=p[1],d=((l||0)+(u||0))/2,y=(c-i)*(c-i),g=(h-a)*(h-a);return v&&m||n?vo(y,g,i+d,a+d)<=1:v?vo(y,g,i,a)<=1:m?vo(y,g,i-d,a-d)>=1&&vo(y,g,i+d,a+d)<=1:!1}function ir(e,t,n,r,i,a){return i>=e&&i<=e+n&&a>=t&&a<=t+r}function cP(e,t,n,r,i,a,o){var s=i/2;return ir(e-s,t-s,n,i,a,o)||ir(e+n-s,t-s,i,r,a,o)||ir(e+s,t+r-s,n,i,a,o)||ir(e-s,t+s,i,r,a,o)}function yo(e,t,n,r,i,a,o,s){var l=(Math.atan2(s-t,o-e)+Math.PI*2)%(Math.PI*2),u={x:e+n*Math.cos(l),y:t+n*Math.sin(l)};return un(u.x,u.y,o,s)<=a/2}function Pn(e,t,n,r,i,a,o){var s=Math.min(e,n),l=Math.max(e,n),u=Math.min(t,r),f=Math.max(t,r),c=i/2;return a>=s-c&&a<=l+c&&o>=u-c&&o<=f+c?J1(e,t,n,r,a,o)<=i/2:!1}function L0(e,t,n,r,i){var a=e.length;if(a<2)return!1;for(var o=0;o0!=Tl(s[1]-n)>0&&Tl(t-(n-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}function wd(e,t,n){for(var r=!1,i=0;iP&&T>w,m&&(m.resetTransform?m.resetTransform():m.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(m,0,0,y*d,g*d,i.background))});var v=function(m,d){m.isVisible()&&!m.isCulled()&&(r.renderDisplayObject(m,d,r.context,r.restoreStack,n),r.saveDirtyAABB(m));var y=m.sortable.sorted||m.childNodes;y.forEach(function(g){v(g,d)})};o.hooks.endFrame.tap(e.tag,function(){var m=f.getContext(),d=f.getDPR();if(kv(r.dprMatrix,[d,d,1]),We(r.vpMatrix,r.dprMatrix,a.getOrthoMatrix()),r.clearFullScreen)v(s.root,m);else{var y=r.safeMergeAABB.apply(r,Z([r.mergeDirtyAABBs(r.renderQueue)],F(r.removedRBushNodeAABBs.map(function(I){var Y=I.minX,j=I.minY,ie=I.maxX,ue=I.maxY,Re=new Oe;return Re.setMinMax([Y,j,0],[ie,ue,0]),Re})),!1));if(r.removedRBushNodeAABBs=[],Oe.isEmpty(y)){r.renderQueue=[];return}var g=r.convertAABB2Rect(y),E=g.x,P=g.y,w=g.width,x=g.height,M=St(r.vec3a,[E,P,0],r.vpMatrix),S=St(r.vec3b,[E+w,P,0],r.vpMatrix),T=St(r.vec3c,[E,P+x,0],r.vpMatrix),C=St(r.vec3d,[E+w,P+x,0],r.vpMatrix),k=Math.min(M[0],S[0],C[0],T[0]),N=Math.min(M[1],S[1],C[1],T[1]),_=Math.max(M[0],S[0],C[0],T[0]),A=Math.max(M[1],S[1],C[1],T[1]),z=Math.floor(k),W=Math.floor(N),L=Math.ceil(_-k),H=Math.ceil(A-N);m.save(),r.clearRect(m,z,W,L,H,i.background),m.beginPath(),m.rect(z,W,L,H),m.clip(),m.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]);var $=i.renderer.getConfig().enableDirtyRectangleRenderingDebug;$&&c.dispatchEvent(new He(it.DIRTY_RECTANGLE,{dirtyRect:{x:z,y:W,width:L,height:H}}));var Te=r.searchDirtyObjects(y);Te.sort(function(I,Y){return I.sortable.renderOrder-Y.sortable.renderOrder}).forEach(function(I){I&&I.isVisible()&&!I.isCulled()&&r.renderDisplayObject(I,m,r.context,r.restoreStack,n)}),m.restore(),r.renderQueue.forEach(function(I){r.saveDirtyAABB(I)}),r.renderQueue=[]}r.restoreStack.forEach(function(){m.restore()}),r.restoreStack=[]}),o.hooks.render.tap(e.tag,function(m){r.clearFullScreen||r.renderQueue.push(m)})},e.prototype.clearRect=function(t,n,r,i,a,o){t.clearRect(n,r,i,a),o&&(t.fillStyle=o,t.fillRect(n,r,i,a))},e.prototype.renderDisplayObject=function(t,n,r,i,a){var o=t.nodeName,s=i[i.length-1];s&&!(t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINS)&&(n.restore(),i.pop());var l=this.context.styleRendererFactory[o],u=this.pathGeneratorFactory[o],f=t.parsedStyle.clipPath;if(f){this.applyWorldTransform(n,f);var c=this.pathGeneratorFactory[f.nodeName];c&&(n.save(),i.push(t),n.beginPath(),c(n,f.parsedStyle),n.closePath(),n.clip())}l&&(this.applyWorldTransform(n,t),n.save(),this.applyAttributesToContext(n,t)),u&&(n.beginPath(),u(n,t.parsedStyle),t.nodeName!==O.LINE&&t.nodeName!==O.PATH&&t.nodeName!==O.POLYLINE&&n.closePath()),l&&(l.render(n,t.parsedStyle,t,r,this,a),n.restore()),t.renderable.dirty=!1},e.prototype.convertAABB2Rect=function(t){var n=t.getMin(),r=t.getMax(),i=2,a=Math.floor(n[0])-i,o=Math.floor(n[1])-i,s=Math.ceil(r[0])+i,l=Math.ceil(r[1])+i,u=s-a,f=l-o;return{x:a,y:o,width:u,height:f}},e.prototype.mergeDirtyAABBs=function(t){var n=new Oe;return t.forEach(function(r){var i=r.getRenderBounds();n.add(i);var a=r.renderable.dirtyRenderBounds;a&&n.add(a)}),n},e.prototype.searchDirtyObjects=function(t){var n=F(t.getMin(),2),r=n[0],i=n[1],a=F(t.getMax(),2),o=a[0],s=a[1],l=this.rBush.search({minX:r,minY:i,maxX:o,maxY:s});return l.map(function(u){var f=u.displayObject;return f})},e.prototype.saveDirtyAABB=function(t){var n=t.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new Oe);var r=t.getRenderBounds();r&&n.dirtyRenderBounds.update(r.center,r.halfExtents)},e.prototype.applyAttributesToContext=function(t,n){var r=n.parsedStyle,i=r.stroke,a=r.fill,o=r.opacity,s=r.lineDash,l=r.lineDashOffset;s&&t.setLineDash(s),U(l)||(t.lineDashOffset=l),U(o)||(t.globalAlpha*=o),!U(i)&&!Array.isArray(i)&&!i.isNone&&(t.strokeStyle=n.attributes.stroke),!U(a)&&!Array.isArray(a)&&!a.isNone&&(t.fillStyle=n.attributes.fill)},e.prototype.applyWorldTransform=function(t,n,r){var i=0,a=0,o=(n.parsedStyle||{}).anchor,s=o&&o[0]||0,l=o&&o[1]||0;if(s!==0||l!==0){var u=n.geometry.contentBounds,f=u&&u.halfExtents[0]*2||0,c=u&&u.halfExtents[1]*2||0;i=-(s*f),a=-(l*c)}r?(fr(this.tmpMat4,n.getLocalTransform()),this.vec3a[0]=i,this.vec3a[1]=a,this.vec3a[2]=0,_n(this.tmpMat4,this.tmpMat4,this.vec3a),We(this.tmpMat4,r,this.tmpMat4),We(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(fr(this.tmpMat4,n.getWorldTransform()),this.vec3a[0]=i,this.vec3a[1]=a,this.vec3a[2]=0,_n(this.tmpMat4,this.tmpMat4,this.vec3a),We(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},e.prototype.safeMergeAABB=function(){for(var t=[],n=0;n0,M=s.alpha===0,S=!!(E&&E.length),T=!U(y)&&g>0,C=r.nodeName,k=d==="inner",N=x&&T&&(C===O.PATH||C===O.LINE||C===O.POLYLINE||M||k);w&&(t.globalAlpha=u*f,N||hs(r,t,T),this.fill(t,r,s,l,i,a,o),N||this.clearShadowAndFilter(t,S,T)),x&&(t.globalAlpha=u*h,t.lineWidth=p,U(P)||(t.miterLimit=P),U(v)||(t.lineCap=v),U(m)||(t.lineJoin=m),N&&(k&&(t.globalCompositeOperation="source-atop"),hs(r,t,!0),k&&(this.stroke(t,r,c,i,a,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,S,!0))),this.stroke(t,r,c,i,a,o))},e.prototype.clearShadowAndFilter=function(t,n,r){if(r&&(t.shadowColor="transparent",t.shadowBlur=0),n){var i=t.filter;!U(i)&&i.indexOf("drop-shadow")>-1&&(t.filter=i.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},e.prototype.fill=function(t,n,r,i,a,o,s){var l=this;Array.isArray(r)?r.forEach(function(u){t.fillStyle=l.getColor(u,n,t),i?t.fill(i):t.fill()}):(xa(r)&&(t.fillStyle=this.getPattern(r,n,t,a,o,s)),i?t.fill(i):t.fill())},e.prototype.stroke=function(t,n,r,i,a,o){var s=this;Array.isArray(r)?r.forEach(function(l){t.strokeStyle=s.getColor(l,n,t),t.stroke()}):(xa(r)&&(t.strokeStyle=this.getPattern(r,n,t,i,a,o)),t.stroke())},e.prototype.getPattern=function(t,n,r,i,a,o){var s,l;if(t.image.nodeName==="rect"){var u=t.image.parsedStyle,f=u.width,c=u.height;l=i.contextService.getDPR();var h=i.config.offscreenCanvas;s=o.offscreenCanvasCreator.getOrCreateCanvas(h),s.width=f*l,s.height=c*l;var p=o.offscreenCanvasCreator.getOrCreateContext(h),v=[];t.image.forEach(function(d){a.renderDisplayObject(d,p,i,v,o)}),v.forEach(function(){p.restore()})}var m=this.imagePool.getOrCreatePatternSync(t,r,s,l,function(){n.renderable.dirty=!0,i.renderingService.dirtify()});return m},e.prototype.getColor=function(t,n,r){var i;if(t.type===Xt.LinearGradient||t.type===Xt.RadialGradient){var a=n.getGeometryBounds(),o=a&&a.halfExtents[0]*2||1,s=a&&a.halfExtents[1]*2||1;i=this.imagePool.getOrCreateGradient(X(X({type:t.type},t.value),{width:o,height:s}),r)}return i},e}();function hs(e,t,n){var r=e.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,l=r.shadowOffsetY;i&&i.length&&(t.filter=e.style.filter),n&&(t.shadowColor=a.toString(),t.shadowBlur=o||0,t.shadowOffsetX=s||0,t.shadowOffsetY=l||0)}var SP=function(){function e(t){this.imagePool=t}return e.prototype.render=function(t,n,r){var i=n.width,a=n.height,o=n.img,s=n.shadowColor,l=n.shadowBlur,u,f=i,c=a;if($e(o)?u=this.imagePool.getImageSync(o):(f||(f=o.width),c||(c=o.height),u=o),u){var h=!U(s)&&l>0;hs(r,t,h);try{t.drawImage(u,0,0,f,c)}catch{}}},e}(),TP=function(){function e(){}return e.prototype.render=function(t,n,r,i,a,o){var s=n,l=s.lineWidth,u=s.textAlign,f=s.textBaseline,c=s.lineJoin,h=s.miterLimit,p=s.letterSpacing,v=s.stroke,m=s.fill,d=s.fillOpacity,y=s.strokeOpacity,g=s.opacity,E=s.metrics,P=s.dx,w=s.dy,x=s.shadowColor,M=s.shadowBlur,S=E.font,T=E.lines,C=E.height,k=E.lineHeight,N=E.lineMetrics;t.font=S,t.lineWidth=l,t.textAlign=u==="middle"?"center":u;var _=f;!o.enableCSSParsing&&_==="alphabetic"&&(_="bottom"),t.lineJoin=c,U(h)||(t.miterLimit=h);var A=0;f==="middle"?A=-C/2-k/2:f==="bottom"||f==="alphabetic"||f==="ideographic"?A=-C:(f==="top"||f==="hanging")&&(A=-k);var z=P||0;A+=w||0,T.length===1&&(_==="bottom"?(_="middle",A-=.5*C):_==="top"&&(_="middle",A+=.5*C)),t.textBaseline=_;var W=!U(x)&&M>0;hs(r,t,W);for(var L=0;L=1?Math.ceil(i):1,this.dpr=i,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*n,H2(this.$canvas,t,n)),this.renderingContext.renderReasons.add(dr.CAMERA_CHANGED)},e.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},e.prototype.toDataURL=function(t){return t===void 0&&(t={}),pa(this,void 0,void 0,function(){var n,r;return va(this,function(i){return n=t.type,r=t.encoderOptions,[2,this.context.canvas.toDataURL(n,r)]})})},e}(),bP=function(e){Q(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.name="canvas-context-register",n}return t.prototype.init=function(){this.context.ContextService=DP},t.prototype.destroy=function(){delete this.context.ContextService},t}(xr),Wn=function(e){Q(t,e);function t(n){var r=e.call(this,n)||this;return r.registerPlugin(new bP),r.registerPlugin(new IP),r.registerPlugin(new rP),r.registerPlugin(new CP),r.registerPlugin(new NP),r.registerPlugin(new PP),r.registerPlugin(new _P),r}return t}(ux);const FP="https://kongfandong.cn",D0="https://dogefs.s3.ladydaily.com/~/source/unsplash/photo-1459749411175-04bf5292ceea?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=320&h=320&q=80";function Yn(e,{x:t,y:n,r,shadowColor:i}){const a=i?{shadowColor:i,shadowBlur:16}:{},o=new zn({style:{cx:t,cy:n,r,fill:"#262626",...a}}),s=new w0({id:"audioImg",style:{x:t-r,y:n-r,width:2*r,height:2*r,transformOrigin:"center",clipPath:new zn({style:{cx:t,cy:n,r}}),img:D0}});e==null||e.appendChild(o),e==null||e.appendChild(s);const l=s==null?void 0:s.animate([{transform:"rotate(0)"},{transform:"rotate(360deg)"}],{duration:12e3,iterations:1/0});return setTimeout(()=>{l==null||l.pause()}),s}const oe=150,se=150,de=80;function Xn(e,t,n,r){G.useEffect(()=>{setTimeout(()=>{var a;const i=(a=t.current)==null?void 0:a.getAnimations();if(i&&i.length){const o=i[0];n?o.play():o.pause()}})},[n]),G.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.document.querySelector("#audioImg");i&&i.setAttribute("img",r)},[r])}function BP(e){const i="#e9dcf7",a=G.useRef(),o=G.useRef(),s=G.useRef([]);function l(u){return u.reduce((c,h,p)=>(p%2&&c.push(h),c),[])}return G.useEffect(()=>{var u;(u=e.data)!=null&&u.length&&l(e.data).map((c,h)=>{s.current[h].attr("height",c*c/65025*50+4)})},[e.data]),G.useEffect(()=>{a.current=new Hn({container:"SLine",width:2*oe,height:2*se,renderer:new Wn}),o.current=Yn(a.current,{x:oe,y:se,r:de,shadowColor:i}),s.current=Array.from({length:64},(u,f)=>{var d;const c=f*5.625-150,h=Math.cos(c*Math.PI/180),p=Math.sin(c*Math.PI/180),v=de+10,m=new M0({style:{width:4,height:4,radius:4/2,x:oe+h*v,y:se+p*v,fill:i}});return m.setOrigin(oe+h*v,se+p*v),m.rotate(c-90),(d=a.current)==null||d.appendChild(m),m})},[]),Xn(a,o,e.isPlaying,e.audioImg),te.jsx("div",{id:"SLine",className:"s-canvas-wrapper"})}function Ls(e,t=5,n=.8){if(t<3||t>13||t%2===0)throw new Error("num value muse be singular, num >= 3, num <= 13");return e.map((r,i)=>{const a=i%t,o=(t-1)/2-a,s=e[i+o];return~~(s?s*n**Math.abs(o):r)})}function zP(e,t,n){return`M ${e-n}, ${t} a ${n}, ${n} 0 1, 0 ${n*2}, 0 - a ${n}, ${n} 0 1, 0 ${-n*2}, 0`}const bu=Math.PI,Fu=2*bu,Zn=1e-6,UP=Fu-Zn;function Bu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function b0(){return new Bu}Bu.prototype=b0.prototype={constructor:Bu,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,l=r-t,u=a-e,f=o-t,c=u*u+f*f;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(c>Zn)if(!(Math.abs(f*s-l*u)>Zn)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-a,p=r-o,v=s*s+l*l,y=h*h+p*p,d=Math.sqrt(v),m=Math.sqrt(c),g=i*Math.tan((bu-Math.acos((v+c-y)/(2*d*m)))/2),E=g/m,P=g/d;Math.abs(E-1)>Zn&&(this._+="L"+(e+E*u)+","+(t+E*f)),this._+="A"+i+","+i+",0,0,"+ +(f*h>u*p)+","+(this._x1=e+P*s)+","+(this._y1=t+P*l)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),l=e+o,u=t+s,f=1^a,c=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>Zn||Math.abs(this._y1-u)>Zn)&&(this._+="L"+l+","+u),n&&(c<0&&(c=c%Fu+Fu),c>UP?this._+="A"+n+","+n+",0,1,"+f+","+(e-o)+","+(t-s)+"A"+n+","+n+",0,1,"+f+","+(this._x1=l)+","+(this._y1=u):c>Zn&&(this._+="A"+n+","+n+",0,"+ +(c>=bu)+","+f+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function kr(e){return function(){return e}}function GP(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function F0(e){this._context=e}F0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function HP(e){return new F0(e)}function VP(e){return e[0]}function WP(e){return e[1]}function Ea(e,t){var n=kr(!0),r=null,i=HP,a=null;e=typeof e=="function"?e:e===void 0?VP:kr(e),t=typeof t=="function"?t:t===void 0?WP:kr(t);function o(s){var l,u=(s=GP(s)).length,f,c=!1,h;for(r==null&&(a=i(h=b0())),l=0;l<=u;++l)!(l{p%2&&c.push(h)}),Ls(c,5,.75)}function u(f,c=0){const h=f*5.625-150,p=Math.cos(h*Math.PI/180),v=Math.sin(h*Math.PI/180),y=de+4+c;return[oe+p*y,se+v*y]}return G.useEffect(()=>{var f;if((f=e.data)!=null&&f.length){const c=[[],[],[],[]];l(e.data).map((h,p)=>{c[p%4].push(u(p,h*h/65025*42+4))}),c.map((h,p)=>{var y;const v=Ea().x(d=>d[0]).y(d=>d[1]).curve(wa)(h);v&&((y=s.current[p])==null||y.attr("path",v))})}},[e.data]),G.useEffect(()=>{a.current=new Hn({container:"SPath",width:2*oe,height:2*se,renderer:new Wn}),o.current=Yn(a.current,{x:oe,y:se,r:de,shadowColor:i[0]});const f=Array.from({length:64/4},(h,p)=>u(p*4)),c=Ea().x(h=>h[0]).y(h=>h[1]).curve(wa)(f);Array.from({length:4},(h,p)=>{var v;if(c){const y=new _s({style:{stroke:i[p],lineWidth:1,path:c}});(v=a.current)==null||v.appendChild(y),s.current.push(y)}})},[]),Xn(a,o,e.isPlaying,e.audioImg),te.jsx("div",{id:"SPath",className:"s-canvas-wrapper"})}function XP(e){const r=["#90E3F5","#5C8AF4","#BEABF0","#E1A2E1"],i=G.useRef(),a=G.useRef(),o=G.useRef([]);function s(u){let f=[];return u.map((c,h)=>{h%2&&f.push(c)}),Ls(f,5,.75)}function l(u,f=0){const c=u*5.625-150,h=Math.cos(c*Math.PI/180),p=Math.sin(c*Math.PI/180),v=de+f;return[oe+h*v,se+p*v]}return G.useEffect(()=>{var u;if((u=e.data)!=null&&u.length){const f=[[],[],[],[]];s(e.data).map((c,h)=>{f[h%4].push(l(h,c*c/65025*60))}),f.map((c,h)=>{const p=Ea().x(v=>v[0]).y(v=>v[1]).curve(wa)(c);p&&o.current[h].attr("path",p)})}},[e.data]),G.useEffect(()=>{i.current=new Hn({container:"SPathFill",width:2*oe,height:2*se,renderer:new Wn});const u=Array.from({length:64/4},(c,h)=>l(h*4)),f=Ea().x(c=>c[0]).y(c=>c[1]).curve(wa)(u);Array.from({length:4},(c,h)=>{var p;if(f){const v=new _s({style:{stroke:r[h],lineWidth:2,path:f,fill:"rgba(255,255,255,0.2)"}});(p=i.current)==null||p.appendChild(v),o.current.push(v)}}),a.current=Yn(i.current,{x:oe,y:se,r:de,shadowColor:"#ffffff"})},[]),Xn(i,a,e.isPlaying,e.audioImg),te.jsx("div",{id:"SPathFill",className:"s-canvas-wrapper"})}function $P(e){const t="#fff",n="#fa7",s=G.useRef(),l=G.useRef(),u=G.useRef([]),f=G.useRef([]),c=G.useRef([]),h=G.useRef(!1),p=()=>{const y=c.current||[],d=y.sort((w,x)=>x-w).slice(0,10),m=~~(Math.random()*10),g=d[m],E=y.findIndex(w=>w===g);return~E?E*360/y.length:1};G.useEffect(()=>{c.current=e.data||[]},[e.data]),G.useEffect(()=>{var y,d,m,g;if(!s.current){s.current=new Hn({container:"SCircle",width:2*oe,height:2*se,renderer:new Wn}),l.current=Yn(s.current,{x:oe,y:se,r:de,shadowColor:"#fcc8d9"});const E=()=>{var M,S;const w=new zn({style:{cx:oe,cy:se,stroke:t,lineWidth:2,opacity:1,r:de}}),x=new zn({style:{r:5,fill:t,shadowColor:n,shadowBlur:5,opacity:0}});return(M=s.current)==null||M.appendChild(w),(S=s.current)==null||S.appendChild(x),[w,x]},P={duration:2e3*3,iterations:1/0};Array.from({length:3},(w,x)=>{f.current.push(!1);const[M,S]=E();u.current.push({circle:M,dot:S}),u.current[x].circle.animate([{transform:"scale(1)",opacity:.8},{transform:"scale(2)",opacity:0}],P)})}if(e.isPlaying)for(let E=0;E{var P,w;h.current&&((w=(P=u.current[E].circle.getAnimations())==null?void 0:P[0])==null||w.play(),v(u.current[E].dot),f.current[E]=!0)},E*2e3);else setTimeout(()=>{var E,P,w,x;for(let M=0;M{h.current=e.isPlaying},[e.isPlaying]),Xn(s,l,e.isPlaying,e.audioImg);function v(y){const d=-135+p(),m=Math.cos(d*Math.PI/180),g=Math.sin(d*Math.PI/180);y.setAttribute("cx",oe+m*de),y.setAttribute("cy",se+g*de),y.setAttribute("transformOrigin",`${-m*de+5}px ${-g*de+5}px`);const E=y.animate([{transform:"rotate(0) translate(0, 0)",opacity:0,offset:.01},{opacity:.9,offset:.02},{transform:`rotate(360deg) translate(${m*de}, ${g*de})`,opacity:0}],{duration:2e3*3});E&&(E.onfinish=()=>{E.cancel(),v(y)})}return te.jsx("div",{id:"SCircle",className:"s-canvas-wrapper"})}function jP(e){const r="#e9dcf7",i=G.useRef(),a=G.useRef(),o=G.useRef(),s=G.useRef([]);function l(f){let c=[];return f.map((h,p)=>{p%2&&c.push(h)}),Ls(c,3,.5)}function u(f,c=0){const h=f*5.625-150,p=Math.cos(h*Math.PI/180),v=Math.sin(h*Math.PI/180),y=de+10+c;return[oe+p*y,se+v*y]}return G.useEffect(()=>{var f,c;if((f=e.data)!=null&&f.length){const h=[],p=l(e.data);p.map((y,d)=>{const m=u(d,y*y/65025*60),g=u(d,-y*y/65025*12);h[d]=m,h[p.length+d]=g,s.current[d].attr("x1",m[0]),s.current[d].attr("y1",m[1]),s.current[d].attr("x2",g[0]),s.current[d].attr("y2",g[1])});const v=Ea().x(y=>y[0]).y(y=>y[1]).curve(wa)(h);v&&((c=o.current)==null||c.attr("path",v))}},[e.data]),G.useEffect(()=>{i.current=new Hn({container:"SPathDouble",width:2*oe,height:2*se,renderer:new Wn}),a.current=Yn(i.current,{x:oe,y:se,r:de,shadowColor:r}),o.current=new _s({style:{stroke:r,lineWidth:1,path:zP(oe,se,de+10)}}),i.current.appendChild(o.current),s.current=Array.from({length:64},(f,c)=>{var p;const h=new jf({style:{x1:oe,y1:se-de,x2:oe,y2:se-de,stroke:r,lineWidth:1}});return(p=i.current)==null||p.appendChild(h),h})},[]),Xn(i,a,e.isPlaying,e.audioImg),te.jsx("div",{id:"SPathDouble",className:"s-canvas-wrapper"})}function KP(e){const i="#e9dcf7",o=G.useRef(),s=G.useRef(),l=G.useRef([]),u=G.useRef([]);function f(h){return h.reduce((p,v,y)=>y%2?[...p,v]:p,[])}function c(h,p=0){const v=h*5.625-150,y=Math.cos(v*Math.PI/180),d=Math.sin(v*Math.PI/180),m=de+10+p;return[oe+y*m,se+d*m,y,d]}return G.useEffect(()=>{var h;(h=e.data)!=null&&h.length&&f(e.data).map((p,v)=>{const[y,d]=c(v,p*p/65025*24+4);l.current[v].attr("cx",y),l.current[v].attr("cy",d),u.current[v].attr("x2",y),u.current[v].attr("y2",d)})},[e.data]),G.useEffect(()=>{o.current=new Hn({container:"SDot",width:2*oe,height:2*se,renderer:new Wn}),s.current=Yn(o.current,{x:oe,y:se,r:de,shadowColor:i}),Array.from({length:64},(h,p)=>{var w,x;const[v,y,d,m]=c(p),g=~~(p*(360/64)+210),E=new zn({style:{cx:v,cy:y,r:2,fill:i}}),P=new jf({style:{x1:v,y1:y,x2:v,y2:y,lineWidth:2*1.4,stroke:`l(${g}) 0.3:rgba(255,255,255,0) 1:${i}`}});(w=o.current)==null||w.appendChild(E),(x=o.current)==null||x.appendChild(P),l.current.push(E),u.current.push(P)})},[]),Xn(o,s,e.isPlaying,e.audioImg),te.jsx("div",{id:"SDot",className:"s-canvas-wrapper"})}R.enableDataset=!0;function qP(e){const l=G.useRef(),u=G.useRef(),f=G.useRef([]),c=G.useRef([]),h=G.useRef(-1),p=G.useRef(),v=G.useRef(!1);G.useEffect(()=>{if(e.isPlaying&&e.data&&e.data.length){if(p.current)return;p.current=setTimeout(()=>{const d=e.data?e.data.reduce((w,x,M)=>M%2?[...w,x]:w,[]):[],m=d.sort((w,x)=>x-w).slice(0,10),g=~~(Math.random()*10),E=m[g],P=d.findIndex(w=>w===E);h.current=P,p.current=void 0,clearTimeout(p.current)},300)}},[e.isPlaying,e.data]),G.useEffect(()=>{l.current||(l.current=new Hn({container:"SParticle",width:2*oe,height:2*se,renderer:new Wn}),u.current=Yn(l.current,{x:oe,y:se,r:de,shadowColor:"#fcc8d9"}),Array.from({length:64},(d,m)=>{Array.from({length:12},(g,E)=>{var k;const P=m*5.625-150+(Math.random()-.5)*10,w=Math.cos(P*Math.PI/180),x=Math.sin(P*Math.PI/180),M=de+0,S=oe+w*M,T=se+x*M,C=new zn({style:{cx:S,cy:T,r:.5,fill:"#fff",opacity:0,transformOrigin:`${-w*de+.5}px ${-x*de+.5}px`}});C.dataset.deg=P,C.dataset.index1=m,(k=l.current)==null||k.appendChild(C),f.current.push(C),c.current.push(!1)})})),e.isPlaying?f.current.map((d,m)=>{var g,E;c.current[m]?(E=(g=d.getAnimations())==null?void 0:g[0])==null||E.play():setTimeout(()=>{v.current&&(y(d),c.current[m]=!0)},Math.random()*4e3)}):setTimeout(()=>{f.current.map(d=>{var m,g;(g=(m=d.getAnimations())==null?void 0:m[0])==null||g.pause()})})},[e.isPlaying]),G.useEffect(()=>{v.current=e.isPlaying},[e.isPlaying]),Xn(l,u,e.isPlaying,e.audioImg);function y(d){const m=~~d.dataset.deg,g=~~d.dataset.index1,E=Math.cos(m*Math.PI/180),P=Math.sin(m*Math.PI/180),x=g>=h.current-1&&g<=h.current+1?64:24,M=Array.from({length:4},(T,C)=>{const k=.2*(C+1),N=m+Math.sin(k*20)*4,_=Math.cos(N*Math.PI/180),A=Math.sin(N*Math.PI/180);return{transform:`translate(${_*x*k}, ${A*x*k})`,offset:k}}),S=d.animate([{transform:"translate(0, 0)",opacity:1},...M,{transform:`translate(${E*x}, ${P*x})`,opacity:0}],{duration:4e3});S&&(S.onfinish=()=>{S.cancel(),y(d)})}return te.jsx("div",{id:"SParticle",className:"s-canvas-wrapper"})}function QP(e){const r="#e9dcf7",i=G.useRef(),a=G.useRef(),o=G.useRef([]);function s(l){let u=[];return l.map((f,c)=>{c%2&&u.push(f)}),Ls(u,5,.75)}return G.useEffect(()=>{var l;if((l=e.data)!=null&&l.length){const u=s(e.data),f=64/8;u.map((c,h)=>{var p,v;if(h%f===0){const y=h/f,d=c/8,m=y*(360/8)-150,g=Math.cos(m*Math.PI/180),E=Math.sin(m*Math.PI/180);(p=o.current[y])==null||p.attr("cx",oe+g*d),(v=o.current[y])==null||v.attr("cy",se+E*d)}})}},[e.data]),G.useEffect(()=>{i.current=new Hn({container:"SCircleMultiple",width:2*oe,height:2*se,renderer:new Wn}),o.current=Array.from({length:8},(l,u)=>{var c;const f=new zn({style:{cx:oe,cy:se,r:de+8,stroke:r,strokeWidth:1,shadowColor:"#ffaa44",shadowBlur:2}});return(c=i.current)==null||c.appendChild(f),f}),a.current=Yn(i.current,{x:oe,y:se,r:de,shadowColor:r})},[]),Xn(i,a,e.isPlaying,e.audioImg),te.jsx("div",{id:"SCircleMultiple",className:"s-canvas-wrapper"})}const Md=new rg,ZP=[BP,jP,YP,XP,KP,qP,$P,QP];function JP(){const e=G.useRef(null);G.useEffect(()=>{Md.setAudioEl(e.current)},[]);const[t,n]=G.useState("Please load a music..."),[r,i]=G.useState(),[a,o]=G.useState([]),[s,l]=G.useState(D0),[u,f]=G.useState(!1),[c,h]=G.useState([]),p=G.useRef(null);let v,y=G.useRef();function d(M){v||(v=M);const S=M-v;(S===0||S>0)&&(o([...Md.getVisualizeValue()]),v=M),y.current=requestAnimationFrame(d)}function m(){f(!0),y.current=requestAnimationFrame(d)}function g(){f(!1),y.current&&cancelAnimationFrame(y.current)}async function E(){try{const M=await(await fetch("https://api.injahow.cn/meting/?type=playlist&id=8577182717")).json();M&&M.length>0&&h(M)}catch{}}G.useEffect(()=>{E()},[]);async function P(){var M;try{let S="",T="",C="";if(c&&c.length>0){const k=~~[Math.random()*c.length],{name:N,url:_,artist:A,pic:z}=c[k];console.log("playList[randomIdx]",c[k]);const{url:W}=await fetch(z,{method:"HEAD"});console.log("picURL",W),S=`${N} - ${A}`,T=_,C=W.split("?")[0]}else{const k=encodeURIComponent("https://api.wqwlkj.cn/wqwlapi/wyy_random.php?type=json"),N=await fetch(`${FP}/api/transfer?target=${k}`,{headers:{"content-type":"application/json; charset=utf-8"}}),{data:_}=await N.json(),{name:A,url:z,artistsname:W,picurl:L}=_;S=`${A} - ${W}`,T=z,C=L}n(S),i(T),l(C),g()}catch(S){console.error(S),(M=e.current)==null||M.pause(),g(),alert("API busy...")}}function w(){var M;(M=p.current)==null||M.click()}function x(M){const S=M.target.files[0],T=URL.createObjectURL(S);n(S.name),i(T)}return te.jsxs(te.Fragment,{children:[te.jsxs("main",{className:Mr.page,children:[te.jsxs("div",{className:Mr.operationWrapper,children:[te.jsx("button",{className:"btn m10",onClick:P,children:"Random an online music"}),te.jsx("button",{className:"btn m10",onClick:w,children:"Choose a local muisc"}),te.jsx("div",{className:"strong-text m10",style:{minWidth:"200px"},children:t}),te.jsx("input",{type:"file",style:{display:"none"},ref:p,onChange:x})]}),te.jsx("div",{className:Mr.audioWrapper,children:te.jsx("audio",{controls:!0,onPlay:m,onPause:g,ref:e,src:r,crossOrigin:"anonymous"})}),te.jsxs("div",{className:Mr.exampleWrapper,children:[ZP.map((M,S)=>te.jsxs("div",{className:"s-model",children:[te.jsx("div",{className:"img-bg-wrapper",children:te.jsx("img",{src:s})}),te.jsx(M,{isPlaying:u,data:a,audioImg:s})]},S)),Array.from({length:5}).map((M,S)=>te.jsx("div",{className:"s-module-fake"},S))]})]}),te.jsxs("footer",{className:Mr.footer,children:["©",te.jsx("a",{href:"mailto://kfd_personal@163.com",children:"Leon.D"}),te.jsxs("a",{className:Mr.github,href:"https://github.com/leon-kfd/g-music-visualizer",target:"_blank",children:[te.jsx("svg",{viewBox:"0 0 1024 1024",width:"20",height:"20",children:te.jsx("path",{d:"M960 512c0 97.76-28.704 185.216-85.664 263.264-56.96 78.016-130.496 131.84-220.64 161.856-10.304 1.824-18.368 0.448-22.848-4.032a22.4 22.4 0 0 1-7.2-17.504v-122.88c0-37.632-10.304-65.44-30.464-82.912a409.856 409.856 0 0 0 59.616-10.368 222.752 222.752 0 0 0 54.72-22.816c18.848-10.784 34.528-23.36 47.104-38.592 12.544-15.232 22.848-35.904 30.912-61.44 8.096-25.568 12.128-54.688 12.128-87.904 0-47.072-15.232-86.976-46.208-120.16 14.368-35.456 13.024-74.912-4.48-118.848-10.752-3.616-26.432-1.344-47.072 6.272s-38.56 16.16-53.824 25.568l-21.984 13.888c-36.32-10.304-73.536-15.232-112.096-15.232s-75.776 4.928-112.096 15.232a444.48 444.48 0 0 0-24.672-15.68c-10.336-6.272-26.464-13.888-48.896-22.432-21.952-8.96-39.008-11.232-50.24-8.064-17.024 43.936-18.368 83.424-4.032 118.848-30.496 33.632-46.176 73.536-46.176 120.608 0 33.216 4.032 62.336 12.128 87.456 8.032 25.12 18.368 45.76 30.496 61.44 12.544 15.68 28.224 28.704 47.072 39.04 18.848 10.304 37.216 17.92 54.72 22.816a409.6 409.6 0 0 0 59.648 10.368c-15.712 13.856-25.12 34.048-28.704 60.064a99.744 99.744 0 0 1-26.464 8.512 178.208 178.208 0 0 1-33.184 2.688c-13.024 0-25.568-4.032-38.144-12.544-12.544-8.512-23.296-20.64-32.256-36.32a97.472 97.472 0 0 0-28.256-30.496c-11.232-8.064-21.088-12.576-28.704-13.92l-11.648-1.792c-8.096 0-13.92 0.928-17.056 2.688-3.136 1.792-4.032 4.032-2.688 6.72s3.136 5.408 5.376 8.096 4.928 4.928 7.616 7.168l4.032 2.688c8.544 4.032 17.056 11.232 25.568 21.984 8.544 10.752 14.368 20.64 18.4 29.6l5.824 13.44c4.928 14.816 13.44 26.912 25.568 35.872 12.096 8.992 25.088 14.816 39.008 17.504 13.888 2.688 27.36 4.032 40.352 4.032s23.776-0.448 32.288-2.24l13.472-2.24c0 14.784 0 32.288 0.416 52.032 0 19.744 0.48 30.496 0.48 31.392a22.624 22.624 0 0 1-7.648 17.472c-4.928 4.48-12.992 5.824-23.296 4.032-90.144-30.048-163.68-83.84-220.64-161.888C92.256 697.216 64 609.312 64 512c0-81.152 20.192-156.064 60.096-224.672s94.176-122.88 163.232-163.232C355.936 84.192 430.816 64 512 64s156.064 20.192 224.672 60.096 122.88 94.176 163.232 163.232C939.808 355.488 960 430.848 960 512",fill:"#585862"})}),te.jsx("span",{children:" Github"})]})]})]})}function eM(){return te.jsx("div",{className:"App",children:te.jsx(JP,{})})}ng.render(te.jsx(ty.StrictMode,{children:te.jsx(eM,{})}),document.getElementById("root")); + a ${n}, ${n} 0 1, 0 ${-n*2}, 0`}const bu=Math.PI,Fu=2*bu,Zn=1e-6,UP=Fu-Zn;function Bu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function b0(){return new Bu}Bu.prototype=b0.prototype={constructor:Bu,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,l=r-t,u=a-e,f=o-t,c=u*u+f*f;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(c>Zn)if(!(Math.abs(f*s-l*u)>Zn)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-a,p=r-o,v=s*s+l*l,m=h*h+p*p,d=Math.sqrt(v),y=Math.sqrt(c),g=i*Math.tan((bu-Math.acos((v+c-m)/(2*d*y)))/2),E=g/y,P=g/d;Math.abs(E-1)>Zn&&(this._+="L"+(e+E*u)+","+(t+E*f)),this._+="A"+i+","+i+",0,0,"+ +(f*h>u*p)+","+(this._x1=e+P*s)+","+(this._y1=t+P*l)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),l=e+o,u=t+s,f=1^a,c=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>Zn||Math.abs(this._y1-u)>Zn)&&(this._+="L"+l+","+u),n&&(c<0&&(c=c%Fu+Fu),c>UP?this._+="A"+n+","+n+",0,1,"+f+","+(e-o)+","+(t-s)+"A"+n+","+n+",0,1,"+f+","+(this._x1=l)+","+(this._y1=u):c>Zn&&(this._+="A"+n+","+n+",0,"+ +(c>=bu)+","+f+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function kr(e){return function(){return e}}function GP(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function F0(e){this._context=e}F0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function HP(e){return new F0(e)}function VP(e){return e[0]}function WP(e){return e[1]}function Ea(e,t){var n=kr(!0),r=null,i=HP,a=null;e=typeof e=="function"?e:e===void 0?VP:kr(e),t=typeof t=="function"?t:t===void 0?WP:kr(t);function o(s){var l,u=(s=GP(s)).length,f,c=!1,h;for(r==null&&(a=i(h=b0())),l=0;l<=u;++l)!(l{p%2&&c.push(h)}),Ls(c,5,.75)}function u(f,c=0){const h=f*5.625-150,p=Math.cos(h*Math.PI/180),v=Math.sin(h*Math.PI/180),m=de+4+c;return[oe+p*m,se+v*m]}return G.useEffect(()=>{var f;if((f=e.data)!=null&&f.length){const c=[[],[],[],[]];l(e.data).map((h,p)=>{c[p%4].push(u(p,h*h/65025*42+4))}),c.map((h,p)=>{var m;const v=Ea().x(d=>d[0]).y(d=>d[1]).curve(wa)(h);v&&((m=s.current[p])==null||m.attr("path",v))})}},[e.data]),G.useEffect(()=>{a.current=new Hn({container:"SPath",width:2*oe,height:2*se,renderer:new Wn}),o.current=Yn(a.current,{x:oe,y:se,r:de,shadowColor:i[0]});const f=Array.from({length:64/4},(h,p)=>u(p*4)),c=Ea().x(h=>h[0]).y(h=>h[1]).curve(wa)(f);Array.from({length:4},(h,p)=>{var v;if(c){const m=new _s({style:{stroke:i[p],lineWidth:1,path:c}});(v=a.current)==null||v.appendChild(m),s.current.push(m)}})},[]),Xn(a,o,e.isPlaying,e.audioImg),te.jsx("div",{id:"SPath",className:"s-canvas-wrapper"})}function XP(e){const r=["#90E3F5","#5C8AF4","#BEABF0","#E1A2E1"],i=G.useRef(),a=G.useRef(),o=G.useRef([]);function s(u){let f=[];return u.map((c,h)=>{h%2&&f.push(c)}),Ls(f,5,.75)}function l(u,f=0){const c=u*5.625-150,h=Math.cos(c*Math.PI/180),p=Math.sin(c*Math.PI/180),v=de+f;return[oe+h*v,se+p*v]}return G.useEffect(()=>{var u;if((u=e.data)!=null&&u.length){const f=[[],[],[],[]];s(e.data).map((c,h)=>{f[h%4].push(l(h,c*c/65025*60))}),f.map((c,h)=>{const p=Ea().x(v=>v[0]).y(v=>v[1]).curve(wa)(c);p&&o.current[h].attr("path",p)})}},[e.data]),G.useEffect(()=>{i.current=new Hn({container:"SPathFill",width:2*oe,height:2*se,renderer:new Wn});const u=Array.from({length:64/4},(c,h)=>l(h*4)),f=Ea().x(c=>c[0]).y(c=>c[1]).curve(wa)(u);Array.from({length:4},(c,h)=>{var p;if(f){const v=new _s({style:{stroke:r[h],lineWidth:2,path:f,fill:"rgba(255,255,255,0.2)"}});(p=i.current)==null||p.appendChild(v),o.current.push(v)}}),a.current=Yn(i.current,{x:oe,y:se,r:de,shadowColor:"#ffffff"})},[]),Xn(i,a,e.isPlaying,e.audioImg),te.jsx("div",{id:"SPathFill",className:"s-canvas-wrapper"})}function $P(e){const t="#fff",n="#fa7",s=G.useRef(),l=G.useRef(),u=G.useRef([]),f=G.useRef([]),c=G.useRef([]),h=G.useRef(!1),p=()=>{const d=c.current||[],y=d.sort((x,M)=>M-x).slice(0,10),g=~~(Math.random()*10),E=y[g],P=d.findIndex(x=>x===E);return~P?P*360/d.length:1};G.useEffect(()=>{c.current=e.data||[]},[e.data]),G.useEffect(()=>{var d,y,g,E;if(!s.current){s.current=new Hn({container:"SCircle",width:2*oe,height:2*se,renderer:new Wn}),l.current=Yn(s.current,{x:oe,y:se,r:de,shadowColor:"#fcc8d9"});const P=()=>{var M,S;const w=new zn({style:{cx:oe,cy:se,stroke:t,lineWidth:2,opacity:1,r:de}}),x=new zn({style:{r:5,fill:t,shadowColor:n,shadowBlur:5,opacity:0}});return(M=s.current)==null||M.appendChild(w),(S=s.current)==null||S.appendChild(x),[w,x]};Array.from({length:3},(w,x)=>{f.current.push(!1);const[M,S]=P();u.current.push({circle:M,dot:S})})}if(e.isPlaying)for(let P=0;P{h.current&&(v(u.current[P].circle),m(u.current[P].dot),f.current[P]=!0)},P*2e3);else setTimeout(()=>{var P,w,x,M;for(let S=0;S{h.current=e.isPlaying},[e.isPlaying]),Xn(s,l,e.isPlaying,e.audioImg);function v(d){const y=d.animate([{transform:"scale(1)",opacity:.8},{transform:"scale(2)",opacity:0}],{duration:6e3});y&&(y.onfinish=()=>{y.cancel(),v(d)})}function m(d){const y=-135+p(),g=Math.cos(y*Math.PI/180),E=Math.sin(y*Math.PI/180);d.setAttribute("cx",oe+g*de),d.setAttribute("cy",se+E*de),d.setAttribute("transformOrigin",`${-g*de+5}px ${-E*de+5}px`);const P=d.animate([{transform:"rotate(0) translate(0, 0)",opacity:0,offset:.01},{opacity:.9,offset:.02},{transform:`rotate(360deg) translate(${g*de}, ${E*de})`,opacity:0}],{duration:2e3*3});P&&(P.onfinish=()=>{P.cancel(),m(d)})}return te.jsx("div",{id:"SCircle",className:"s-canvas-wrapper"})}function jP(e){const r="#e9dcf7",i=G.useRef(),a=G.useRef(),o=G.useRef(),s=G.useRef([]);function l(f){let c=[];return f.map((h,p)=>{p%2&&c.push(h)}),Ls(c,3,.5)}function u(f,c=0){const h=f*5.625-150,p=Math.cos(h*Math.PI/180),v=Math.sin(h*Math.PI/180),m=de+10+c;return[oe+p*m,se+v*m]}return G.useEffect(()=>{var f,c;if((f=e.data)!=null&&f.length){const h=[],p=l(e.data);p.map((m,d)=>{const y=u(d,m*m/65025*60),g=u(d,-m*m/65025*12);h[d]=y,h[p.length+d]=g,s.current[d].attr("x1",y[0]),s.current[d].attr("y1",y[1]),s.current[d].attr("x2",g[0]),s.current[d].attr("y2",g[1])});const v=Ea().x(m=>m[0]).y(m=>m[1]).curve(wa)(h);v&&((c=o.current)==null||c.attr("path",v))}},[e.data]),G.useEffect(()=>{i.current=new Hn({container:"SPathDouble",width:2*oe,height:2*se,renderer:new Wn}),a.current=Yn(i.current,{x:oe,y:se,r:de,shadowColor:r}),o.current=new _s({style:{stroke:r,lineWidth:1,path:zP(oe,se,de+10)}}),i.current.appendChild(o.current),s.current=Array.from({length:64},(f,c)=>{var p;const h=new jf({style:{x1:oe,y1:se-de,x2:oe,y2:se-de,stroke:r,lineWidth:1}});return(p=i.current)==null||p.appendChild(h),h})},[]),Xn(i,a,e.isPlaying,e.audioImg),te.jsx("div",{id:"SPathDouble",className:"s-canvas-wrapper"})}function KP(e){const i="#e9dcf7",o=G.useRef(),s=G.useRef(),l=G.useRef([]),u=G.useRef([]);function f(h){return h.reduce((p,v,m)=>m%2?[...p,v]:p,[])}function c(h,p=0){const v=h*5.625-150,m=Math.cos(v*Math.PI/180),d=Math.sin(v*Math.PI/180),y=de+10+p;return[oe+m*y,se+d*y,m,d]}return G.useEffect(()=>{var h;(h=e.data)!=null&&h.length&&f(e.data).map((p,v)=>{const[m,d]=c(v,p*p/65025*24+4);l.current[v].attr("cx",m),l.current[v].attr("cy",d),u.current[v].attr("x2",m),u.current[v].attr("y2",d)})},[e.data]),G.useEffect(()=>{o.current=new Hn({container:"SDot",width:2*oe,height:2*se,renderer:new Wn}),s.current=Yn(o.current,{x:oe,y:se,r:de,shadowColor:i}),Array.from({length:64},(h,p)=>{var w,x;const[v,m,d,y]=c(p),g=~~(p*(360/64)+210),E=new zn({style:{cx:v,cy:m,r:2,fill:i}}),P=new jf({style:{x1:v,y1:m,x2:v,y2:m,lineWidth:2*1.4,stroke:`l(${g}) 0.3:rgba(255,255,255,0) 1:${i}`}});(w=o.current)==null||w.appendChild(E),(x=o.current)==null||x.appendChild(P),l.current.push(E),u.current.push(P)})},[]),Xn(o,s,e.isPlaying,e.audioImg),te.jsx("div",{id:"SDot",className:"s-canvas-wrapper"})}R.enableDataset=!0;function qP(e){const l=G.useRef(),u=G.useRef(),f=G.useRef([]),c=G.useRef([]),h=G.useRef(-1),p=G.useRef(),v=G.useRef(!1);G.useEffect(()=>{if(e.isPlaying&&e.data&&e.data.length){if(p.current)return;p.current=setTimeout(()=>{const d=e.data?e.data.reduce((w,x,M)=>M%2?[...w,x]:w,[]):[],y=d.sort((w,x)=>x-w).slice(0,10),g=~~(Math.random()*10),E=y[g],P=d.findIndex(w=>w===E);h.current=P,p.current=void 0,clearTimeout(p.current)},300)}},[e.isPlaying,e.data]),G.useEffect(()=>{l.current||(l.current=new Hn({container:"SParticle",width:2*oe,height:2*se,renderer:new Wn}),u.current=Yn(l.current,{x:oe,y:se,r:de,shadowColor:"#fcc8d9"}),Array.from({length:64},(d,y)=>{Array.from({length:12},(g,E)=>{var k;const P=y*5.625-150+(Math.random()-.5)*10,w=Math.cos(P*Math.PI/180),x=Math.sin(P*Math.PI/180),M=de+0,S=oe+w*M,T=se+x*M,C=new zn({style:{cx:S,cy:T,r:.5,fill:"#fff",opacity:0,transformOrigin:`${-w*de+.5}px ${-x*de+.5}px`}});C.dataset.deg=P,C.dataset.index1=y,(k=l.current)==null||k.appendChild(C),f.current.push(C),c.current.push(!1)})})),e.isPlaying?f.current.map((d,y)=>{var g,E;c.current[y]?(E=(g=d.getAnimations())==null?void 0:g[0])==null||E.play():setTimeout(()=>{v.current&&(m(d),c.current[y]=!0)},Math.random()*4e3)}):setTimeout(()=>{f.current.map(d=>{var y,g;(g=(y=d.getAnimations())==null?void 0:y[0])==null||g.pause()})})},[e.isPlaying]),G.useEffect(()=>{v.current=e.isPlaying},[e.isPlaying]),Xn(l,u,e.isPlaying,e.audioImg);function m(d){const y=~~d.dataset.deg,g=~~d.dataset.index1,E=Math.cos(y*Math.PI/180),P=Math.sin(y*Math.PI/180),x=g>=h.current-1&&g<=h.current+1?64:24,M=Array.from({length:4},(T,C)=>{const k=.2*(C+1),N=y+Math.sin(k*20)*4,_=Math.cos(N*Math.PI/180),A=Math.sin(N*Math.PI/180);return{transform:`translate(${_*x*k}, ${A*x*k})`,offset:k}}),S=d.animate([{transform:"translate(0, 0)",opacity:1},...M,{transform:`translate(${E*x}, ${P*x})`,opacity:0}],{duration:4e3});S&&(S.onfinish=()=>{S.cancel(),m(d)})}return te.jsx("div",{id:"SParticle",className:"s-canvas-wrapper"})}function QP(e){const r="#e9dcf7",i=G.useRef(),a=G.useRef(),o=G.useRef([]);function s(l){let u=[];return l.map((f,c)=>{c%2&&u.push(f)}),Ls(u,5,.75)}return G.useEffect(()=>{var l;if((l=e.data)!=null&&l.length){const u=s(e.data),f=64/8;u.map((c,h)=>{var p,v;if(h%f===0){const m=h/f,d=c/8,y=m*(360/8)-150,g=Math.cos(y*Math.PI/180),E=Math.sin(y*Math.PI/180);(p=o.current[m])==null||p.attr("cx",oe+g*d),(v=o.current[m])==null||v.attr("cy",se+E*d)}})}},[e.data]),G.useEffect(()=>{i.current=new Hn({container:"SCircleMultiple",width:2*oe,height:2*se,renderer:new Wn}),o.current=Array.from({length:8},(l,u)=>{var c;const f=new zn({style:{cx:oe,cy:se,r:de+8,stroke:r,strokeWidth:1,shadowColor:"#ffaa44",shadowBlur:2}});return(c=i.current)==null||c.appendChild(f),f}),a.current=Yn(i.current,{x:oe,y:se,r:de,shadowColor:r})},[]),Xn(i,a,e.isPlaying,e.audioImg),te.jsx("div",{id:"SCircleMultiple",className:"s-canvas-wrapper"})}const Md=new rg,ZP=[BP,jP,YP,XP,KP,qP,$P,QP];function JP(){const e=G.useRef(null);G.useEffect(()=>{Md.setAudioEl(e.current)},[]);const[t,n]=G.useState("Please load a music..."),[r,i]=G.useState(),[a,o]=G.useState([]),[s,l]=G.useState(D0),[u,f]=G.useState(!1),[c,h]=G.useState([]),p=G.useRef(null);let v,m=G.useRef();function d(M){v||(v=M);const S=M-v;(S===0||S>0)&&(o([...Md.getVisualizeValue()]),v=M),m.current=requestAnimationFrame(d)}function y(){f(!0),m.current=requestAnimationFrame(d)}function g(){f(!1),m.current&&cancelAnimationFrame(m.current)}async function E(){try{const M=await(await fetch("https://api.injahow.cn/meting/?type=playlist&id=8577182717")).json();M&&M.length>0&&h(M)}catch{}}G.useEffect(()=>{E()},[]);async function P(){var M;try{let S="",T="",C="";if(c&&c.length>0){const k=~~[Math.random()*c.length],{name:N,url:_,artist:A,pic:z}=c[k];console.log("playList[randomIdx]",c[k]);const{url:W}=await fetch(z,{method:"HEAD"});console.log("picURL",W),S=`${N} - ${A}`,T=_,C=W.split("?")[0]}else{const k=encodeURIComponent("https://api.wqwlkj.cn/wqwlapi/wyy_random.php?type=json"),N=await fetch(`${FP}/api/transfer?target=${k}`,{headers:{"content-type":"application/json; charset=utf-8"}}),{data:_}=await N.json(),{name:A,url:z,artistsname:W,picurl:L}=_;S=`${A} - ${W}`,T=z,C=L}n(S),i(T),l(C),g()}catch(S){console.error(S),(M=e.current)==null||M.pause(),g(),alert("API busy...")}}function w(){var M;(M=p.current)==null||M.click()}function x(M){const S=M.target.files[0],T=URL.createObjectURL(S);n(S.name),i(T)}return te.jsxs(te.Fragment,{children:[te.jsxs("main",{className:Mr.page,children:[te.jsxs("div",{className:Mr.operationWrapper,children:[te.jsx("button",{className:"btn m10",onClick:P,children:"Random an online music"}),te.jsx("button",{className:"btn m10",onClick:w,children:"Choose a local muisc"}),te.jsx("div",{className:"strong-text m10",style:{minWidth:"200px"},children:t}),te.jsx("input",{type:"file",style:{display:"none"},ref:p,onChange:x})]}),te.jsx("div",{className:Mr.audioWrapper,children:te.jsx("audio",{controls:!0,onPlay:y,onPause:g,ref:e,src:r,crossOrigin:"anonymous"})}),te.jsxs("div",{className:Mr.exampleWrapper,children:[ZP.map((M,S)=>te.jsxs("div",{className:"s-model",children:[te.jsx("div",{className:"img-bg-wrapper",children:te.jsx("img",{src:s})}),te.jsx(M,{isPlaying:u,data:a,audioImg:s})]},S)),Array.from({length:5}).map((M,S)=>te.jsx("div",{className:"s-module-fake"},S))]})]}),te.jsxs("footer",{className:Mr.footer,children:["©",te.jsx("a",{href:"mailto://kfd_personal@163.com",children:"Leon.D"}),te.jsxs("a",{className:Mr.github,href:"https://github.com/leon-kfd/g-music-visualizer",target:"_blank",children:[te.jsx("svg",{viewBox:"0 0 1024 1024",width:"20",height:"20",children:te.jsx("path",{d:"M960 512c0 97.76-28.704 185.216-85.664 263.264-56.96 78.016-130.496 131.84-220.64 161.856-10.304 1.824-18.368 0.448-22.848-4.032a22.4 22.4 0 0 1-7.2-17.504v-122.88c0-37.632-10.304-65.44-30.464-82.912a409.856 409.856 0 0 0 59.616-10.368 222.752 222.752 0 0 0 54.72-22.816c18.848-10.784 34.528-23.36 47.104-38.592 12.544-15.232 22.848-35.904 30.912-61.44 8.096-25.568 12.128-54.688 12.128-87.904 0-47.072-15.232-86.976-46.208-120.16 14.368-35.456 13.024-74.912-4.48-118.848-10.752-3.616-26.432-1.344-47.072 6.272s-38.56 16.16-53.824 25.568l-21.984 13.888c-36.32-10.304-73.536-15.232-112.096-15.232s-75.776 4.928-112.096 15.232a444.48 444.48 0 0 0-24.672-15.68c-10.336-6.272-26.464-13.888-48.896-22.432-21.952-8.96-39.008-11.232-50.24-8.064-17.024 43.936-18.368 83.424-4.032 118.848-30.496 33.632-46.176 73.536-46.176 120.608 0 33.216 4.032 62.336 12.128 87.456 8.032 25.12 18.368 45.76 30.496 61.44 12.544 15.68 28.224 28.704 47.072 39.04 18.848 10.304 37.216 17.92 54.72 22.816a409.6 409.6 0 0 0 59.648 10.368c-15.712 13.856-25.12 34.048-28.704 60.064a99.744 99.744 0 0 1-26.464 8.512 178.208 178.208 0 0 1-33.184 2.688c-13.024 0-25.568-4.032-38.144-12.544-12.544-8.512-23.296-20.64-32.256-36.32a97.472 97.472 0 0 0-28.256-30.496c-11.232-8.064-21.088-12.576-28.704-13.92l-11.648-1.792c-8.096 0-13.92 0.928-17.056 2.688-3.136 1.792-4.032 4.032-2.688 6.72s3.136 5.408 5.376 8.096 4.928 4.928 7.616 7.168l4.032 2.688c8.544 4.032 17.056 11.232 25.568 21.984 8.544 10.752 14.368 20.64 18.4 29.6l5.824 13.44c4.928 14.816 13.44 26.912 25.568 35.872 12.096 8.992 25.088 14.816 39.008 17.504 13.888 2.688 27.36 4.032 40.352 4.032s23.776-0.448 32.288-2.24l13.472-2.24c0 14.784 0 32.288 0.416 52.032 0 19.744 0.48 30.496 0.48 31.392a22.624 22.624 0 0 1-7.648 17.472c-4.928 4.48-12.992 5.824-23.296 4.032-90.144-30.048-163.68-83.84-220.64-161.888C92.256 697.216 64 609.312 64 512c0-81.152 20.192-156.064 60.096-224.672s94.176-122.88 163.232-163.232C355.936 84.192 430.816 64 512 64s156.064 20.192 224.672 60.096 122.88 94.176 163.232 163.232C939.808 355.488 960 430.848 960 512",fill:"#585862"})}),te.jsx("span",{children:" Github"})]})]})]})}function eM(){return te.jsx("div",{className:"App",children:te.jsx(JP,{})})}ng.render(te.jsx(ty.StrictMode,{children:te.jsx(eM,{})}),document.getElementById("root")); diff --git a/index.html b/index.html index 4d6afaf..764e49f 100644 --- a/index.html +++ b/index.html @@ -11,7 +11,7 @@ left: auto !important; } - +