polotno-node 2.9.24 → 2.9.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,281 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var we=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Do(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var G_={exports:{}},bt={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var tf=Symbol.for("react.element"),SE=Symbol.for("react.portal"),EE=Symbol.for("react.fragment"),OE=Symbol.for("react.strict_mode"),xE=Symbol.for("react.profiler"),PE=Symbol.for("react.provider"),CE=Symbol.for("react.context"),TE=Symbol.for("react.forward_ref"),AE=Symbol.for("react.suspense"),kE=Symbol.for("react.memo"),RE=Symbol.for("react.lazy"),g3=Symbol.iterator;function LE(e){return e===null||typeof e!="object"?null:(e=g3&&e[g3]||e["@@iterator"],typeof e=="function"?e:null)}var $_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V_=Object.assign,q_={};function pu(e,t,r){this.props=e,this.context=t,this.refs=q_,this.updater=r||$_}pu.prototype.isReactComponent={};pu.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};pu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function W_(){}W_.prototype=pu.prototype;function Fm(e,t,r){this.props=e,this.context=t,this.refs=q_,this.updater=r||$_}var jm=Fm.prototype=new W_;jm.constructor=Fm;V_(jm,pu.prototype);jm.isPureReactComponent=!0;var v3=Array.isArray,Y_=Object.prototype.hasOwnProperty,zm={current:null},K_={key:!0,ref:!0,__self:!0,__source:!0};function X_(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)Y_.call(t,n)&&!K_.hasOwnProperty(n)&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){for(var u=Array(l),f=0;f<l;f++)u[f]=arguments[f+2];i.children=u}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return{$$typeof:tf,type:e,key:a,ref:o,props:i,_owner:zm.current}}function ME(e,t){return{$$typeof:tf,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Bm(e){return typeof e=="object"&&e!==null&&e.$$typeof===tf}function NE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var m3=/\/+/g;function T1(e,t){return typeof e=="object"&&e!==null&&e.key!=null?NE(""+e.key):t.toString(36)}function $d(e,t,r,n,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case tf:case SE:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+T1(o,0):n,v3(i)?(r="",e!=null&&(r=e.replace(m3,"$&/")+"/"),$d(i,t,r,"",function(f){return f})):i!=null&&(Bm(i)&&(i=ME(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(m3,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",v3(e))for(var l=0;l<e.length;l++){a=e[l];var u=n+T1(a,l);o+=$d(a,t,r,u,i)}else if(u=LE(e),typeof u=="function")for(e=u.call(e),l=0;!(a=e.next()).done;)a=a.value,u=n+T1(a,l++),o+=$d(a,t,r,u,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function vd(e,t,r){if(e==null)return e;var n=[],i=0;return $d(e,n,"","",function(a){return t.call(r,a,i++)}),n}function IE(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var pn={current:null},Vd={transition:null},DE={ReactCurrentDispatcher:pn,ReactCurrentBatchConfig:Vd,ReactCurrentOwner:zm};function Z_(){throw Error("act(...) is not supported in production builds of React.")}bt.Children={map:vd,forEach:function(e,t,r){vd(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return vd(e,function(){t++}),t},toArray:function(e){return vd(e,function(t){return t})||[]},only:function(e){if(!Bm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};bt.Component=pu;bt.Fragment=EE;bt.Profiler=xE;bt.PureComponent=Fm;bt.StrictMode=OE;bt.Suspense=AE;bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=DE;bt.act=Z_;bt.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=V_({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=zm.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)Y_.call(t,u)&&!K_.hasOwnProperty(u)&&(n[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)n.children=r;else if(1<u){l=Array(u);for(var f=0;f<u;f++)l[f]=arguments[f+2];n.children=l}return{$$typeof:tf,type:e.type,key:i,ref:a,props:n,_owner:o}};bt.createContext=function(e){return e={$$typeof:CE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:PE,_context:e},e.Consumer=e};bt.createElement=X_;bt.createFactory=function(e){var t=X_.bind(null,e);return t.type=e,t};bt.createRef=function(){return{current:null}};bt.forwardRef=function(e){return{$$typeof:TE,render:e}};bt.isValidElement=Bm;bt.lazy=function(e){return{$$typeof:RE,_payload:{_status:-1,_result:e},_init:IE}};bt.memo=function(e,t){return{$$typeof:kE,type:e,compare:t===void 0?null:t}};bt.startTransition=function(e){var t=Vd.transition;Vd.transition={};try{e()}finally{Vd.transition=t}};bt.unstable_act=Z_;bt.useCallback=function(e,t){return pn.current.useCallback(e,t)};bt.useContext=function(e){return pn.current.useContext(e)};bt.useDebugValue=function(){};bt.useDeferredValue=function(e){return pn.current.useDeferredValue(e)};bt.useEffect=function(e,t){return pn.current.useEffect(e,t)};bt.useId=function(){return pn.current.useId()};bt.useImperativeHandle=function(e,t,r){return pn.current.useImperativeHandle(e,t,r)};bt.useInsertionEffect=function(e,t){return pn.current.useInsertionEffect(e,t)};bt.useLayoutEffect=function(e,t){return pn.current.useLayoutEffect(e,t)};bt.useMemo=function(e,t){return pn.current.useMemo(e,t)};bt.useReducer=function(e,t,r){return pn.current.useReducer(e,t,r)};bt.useRef=function(e){return pn.current.useRef(e)};bt.useState=function(e){return pn.current.useState(e)};bt.useSyncExternalStore=function(e,t,r){return pn.current.useSyncExternalStore(e,t,r)};bt.useTransition=function(){return pn.current.useTransition()};bt.version="18.3.1";G_.exports=bt;var at=G_.exports;const yt=Kh(at);var oh={},Q_={exports:{}},qn={},J_={exports:{}},e6={};/**
10
+ * @license React
11
+ * scheduler.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */(function(e){function t(N,H){var R=N.length;N.push(H);e:for(;0<R;){var F=R-1>>>1,B=N[F];if(0<i(B,H))N[F]=H,N[R]=B,R=F;else break e}}function r(N){return N.length===0?null:N[0]}function n(N){if(N.length===0)return null;var H=N[0],R=N.pop();if(R!==H){N[0]=R;e:for(var F=0,B=N.length,D=B>>>1;F<D;){var V=2*(F+1)-1,Y=N[V],q=V+1,G=N[q];if(0>i(Y,R))q<B&&0>i(G,Y)?(N[F]=G,N[q]=R,F=q):(N[F]=Y,N[V]=R,F=V);else if(q<B&&0>i(G,R))N[F]=G,N[q]=R,F=q;else break e}}return H}function i(N,H){var R=N.sortIndex-H.sortIndex;return R!==0?R:N.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],f=[],v=1,w=null,b=3,h=!1,E=!1,y=!1,m=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(N){for(var H=r(f);H!==null;){if(H.callback===null)n(f);else if(H.startTime<=N)n(f),H.sortIndex=H.expirationTime,t(u,H);else break;H=r(f)}}function _(N){if(y=!1,d(N),!E)if(r(u)!==null)E=!0,Z(O);else{var H=r(f);H!==null&&z(_,H.startTime-N)}}function O(N,H){E=!1,y&&(y=!1,p(S),S=-1),h=!0;var R=b;try{for(d(H),w=r(u);w!==null&&(!(w.expirationTime>H)||N&&!T());){var F=w.callback;if(typeof F=="function"){w.callback=null,b=w.priorityLevel;var B=F(w.expirationTime<=H);H=e.unstable_now(),typeof B=="function"?w.callback=B:w===r(u)&&n(u),d(H)}else n(u);w=r(u)}if(w!==null)var D=!0;else{var V=r(f);V!==null&&z(_,V.startTime-H),D=!1}return D}finally{w=null,b=R,h=!1}}var k=!1,C=null,S=-1,x=5,P=-1;function T(){return!(e.unstable_now()-P<x)}function L(){if(C!==null){var N=e.unstable_now();P=N;var H=!0;try{H=C(!0,N)}finally{H?M():(k=!1,C=null)}}else k=!1}var M;if(typeof g=="function")M=function(){g(L)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,$=U.port2;U.port1.onmessage=L,M=function(){$.postMessage(null)}}else M=function(){m(L,0)};function Z(N){C=N,k||(k=!0,M())}function z(N,H){S=m(function(){N(e.unstable_now())},H)}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(N){N.callback=null},e.unstable_continueExecution=function(){E||h||(E=!0,Z(O))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(N){switch(b){case 1:case 2:case 3:var H=3;break;default:H=b}var R=b;b=H;try{return N()}finally{b=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,H){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var R=b;b=N;try{return H()}finally{b=R}},e.unstable_scheduleCallback=function(N,H,R){var F=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?F+R:F):R=F,N){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=R+B,N={id:v++,callback:H,priorityLevel:N,startTime:R,expirationTime:B,sortIndex:-1},R>F?(N.sortIndex=R,t(f,N),r(u)===null&&N===r(f)&&(y?(p(S),S=-1):y=!0,z(_,R-F))):(N.sortIndex=B,t(u,N),E||h||(E=!0,Z(O))),N},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(N){var H=b;return function(){var R=b;b=H;try{return N.apply(this,arguments)}finally{b=R}}}})(e6);J_.exports=e6;var hc=J_.exports;/**
18
+ * @license React
19
+ * react-dom.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var FE=at,$n=hc;function Ce(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var t6=new Set,Cc={};function Rl(e,t){Vs(e,t),Vs(e+"Capture",t)}function Vs(e,t){for(Cc[e]=t,e=0;e<t.length;e++)t6.add(t[e])}var Da=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_v=Object.prototype.hasOwnProperty,jE=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,y3={},b3={};function zE(e){return _v.call(b3,e)?!0:_v.call(y3,e)?!1:jE.test(e)?b3[e]=!0:(y3[e]=!0,!1)}function BE(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function UE(e,t,r,n){if(t===null||typeof t>"u"||BE(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function gn(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Wr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Wr[e]=new gn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Wr[t]=new gn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Wr[e]=new gn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Wr[e]=new gn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Wr[e]=new gn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Wr[e]=new gn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Wr[e]=new gn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Wr[e]=new gn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Wr[e]=new gn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Um=/[\-:]([a-z])/g;function Hm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Um,Hm);Wr[t]=new gn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Um,Hm);Wr[t]=new gn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Um,Hm);Wr[t]=new gn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Wr[e]=new gn(e,1,!1,e.toLowerCase(),null,!1,!1)});Wr.xlinkHref=new gn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Wr[e]=new gn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gm(e,t,r,n){var i=Wr.hasOwnProperty(t)?Wr[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(UE(t,r,i,n)&&(r=null),n||i===null?zE(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Ha=FE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,md=Symbol.for("react.element"),Es=Symbol.for("react.portal"),Os=Symbol.for("react.fragment"),$m=Symbol.for("react.strict_mode"),wv=Symbol.for("react.profiler"),r6=Symbol.for("react.provider"),n6=Symbol.for("react.context"),Vm=Symbol.for("react.forward_ref"),Sv=Symbol.for("react.suspense"),Ev=Symbol.for("react.suspense_list"),qm=Symbol.for("react.memo"),ho=Symbol.for("react.lazy"),i6=Symbol.for("react.offscreen"),_3=Symbol.iterator;function Xu(e){return e===null||typeof e!="object"?null:(e=_3&&e[_3]||e["@@iterator"],typeof e=="function"?e:null)}var nr=Object.assign,A1;function sc(e){if(A1===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);A1=t&&t[1]||""}return`
26
+ `+A1+e}var k1=!1;function R1(e,t){if(!e||k1)return"";k1=!0;var r=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(f){var n=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){n=f}e.call(t.prototype)}else{try{throw Error()}catch(f){n=f}e()}}catch(f){if(f&&n&&typeof f.stack=="string"){for(var i=f.stack.split(`
27
+ `),a=n.stack.split(`
28
+ `),o=i.length-1,l=a.length-1;1<=o&&0<=l&&i[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==a[l]){var u=`
29
+ `+i[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=l);break}}}finally{k1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?sc(e):""}function HE(e){switch(e.tag){case 5:return sc(e.type);case 16:return sc("Lazy");case 13:return sc("Suspense");case 19:return sc("SuspenseList");case 0:case 2:case 15:return e=R1(e.type,!1),e;case 11:return e=R1(e.type.render,!1),e;case 1:return e=R1(e.type,!0),e;default:return""}}function Ov(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 Os:return"Fragment";case Es:return"Portal";case wv:return"Profiler";case $m:return"StrictMode";case Sv:return"Suspense";case Ev:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n6:return(e.displayName||"Context")+".Consumer";case r6:return(e._context.displayName||"Context")+".Provider";case Vm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qm:return t=e.displayName||null,t!==null?t:Ov(e.type)||"Memo";case ho:t=e._payload,e=e._init;try{return Ov(e(t))}catch{}}return null}function GE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ov(t);case 8:return t===$m?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ro(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function a6(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $E(e){var t=a6(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yd(e){e._valueTracker||(e._valueTracker=$E(e))}function o6(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=a6(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function lh(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 xv(e,t){var r=t.checked;return nr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function w3(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Ro(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function l6(e,t){t=t.checked,t!=null&&Gm(e,"checked",t,!1)}function Pv(e,t){l6(e,t);var r=Ro(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Cv(e,t.type,r):t.hasOwnProperty("defaultValue")&&Cv(e,t.type,Ro(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function S3(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Cv(e,t,r){(t!=="number"||lh(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var uc=Array.isArray;function js(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Ro(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Tv(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Ce(91));return nr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function E3(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Ce(92));if(uc(r)){if(1<r.length)throw Error(Ce(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Ro(r)}}function s6(e,t){var r=Ro(t.value),n=Ro(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function O3(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function u6(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 Av(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?u6(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var bd,c6=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(bd=bd||document.createElement("div"),bd.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=bd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Tc(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var pc={animationIterationCount:!0,aspectRatio:!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},VE=["Webkit","ms","Moz","O"];Object.keys(pc).forEach(function(e){VE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pc[t]=pc[e]})});function f6(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||pc.hasOwnProperty(e)&&pc[e]?(""+t).trim():t+"px"}function d6(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=f6(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var qE=nr({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 kv(e,t){if(t){if(qE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ce(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ce(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ce(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ce(62))}}function Rv(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}}var Lv=null;function Wm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mv=null,zs=null,Bs=null;function x3(e){if(e=af(e)){if(typeof Mv!="function")throw Error(Ce(280));var t=e.stateNode;t&&(t=ep(t),Mv(e.stateNode,e.type,t))}}function h6(e){zs?Bs?Bs.push(e):Bs=[e]:zs=e}function p6(){if(zs){var e=zs,t=Bs;if(Bs=zs=null,x3(e),t)for(e=0;e<t.length;e++)x3(t[e])}}function g6(e,t){return e(t)}function v6(){}var L1=!1;function m6(e,t,r){if(L1)return e(t,r);L1=!0;try{return g6(e,t,r)}finally{L1=!1,(zs!==null||Bs!==null)&&(v6(),p6())}}function Ac(e,t){var r=e.stateNode;if(r===null)return null;var n=ep(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(Ce(231,t,typeof r));return r}var Nv=!1;if(Da)try{var Zu={};Object.defineProperty(Zu,"passive",{get:function(){Nv=!0}}),window.addEventListener("test",Zu,Zu),window.removeEventListener("test",Zu,Zu)}catch{Nv=!1}function WE(e,t,r,n,i,a,o,l,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(v){this.onError(v)}}var gc=!1,sh=null,uh=!1,Iv=null,YE={onError:function(e){gc=!0,sh=e}};function KE(e,t,r,n,i,a,o,l,u){gc=!1,sh=null,WE.apply(YE,arguments)}function XE(e,t,r,n,i,a,o,l,u){if(KE.apply(this,arguments),gc){if(gc){var f=sh;gc=!1,sh=null}else throw Error(Ce(198));uh||(uh=!0,Iv=f)}}function Ll(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function y6(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function P3(e){if(Ll(e)!==e)throw Error(Ce(188))}function ZE(e){var t=e.alternate;if(!t){if(t=Ll(e),t===null)throw Error(Ce(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var a=i.alternate;if(a===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return P3(i),e;if(a===n)return P3(i),t;a=a.sibling}throw Error(Ce(188))}if(r.return!==n.return)r=i,n=a;else{for(var o=!1,l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o)throw Error(Ce(189))}}if(r.alternate!==n)throw Error(Ce(190))}if(r.tag!==3)throw Error(Ce(188));return r.stateNode.current===r?e:t}function b6(e){return e=ZE(e),e!==null?_6(e):null}function _6(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=_6(e);if(t!==null)return t;e=e.sibling}return null}var w6=$n.unstable_scheduleCallback,C3=$n.unstable_cancelCallback,QE=$n.unstable_shouldYield,JE=$n.unstable_requestPaint,pr=$n.unstable_now,eO=$n.unstable_getCurrentPriorityLevel,Ym=$n.unstable_ImmediatePriority,S6=$n.unstable_UserBlockingPriority,ch=$n.unstable_NormalPriority,tO=$n.unstable_LowPriority,E6=$n.unstable_IdlePriority,Xh=null,aa=null;function rO(e){if(aa&&typeof aa.onCommitFiberRoot=="function")try{aa.onCommitFiberRoot(Xh,e,void 0,(e.current.flags&128)===128)}catch{}}var Mi=Math.clz32?Math.clz32:aO,nO=Math.log,iO=Math.LN2;function aO(e){return e>>>=0,e===0?32:31-(nO(e)/iO|0)|0}var _d=64,wd=4194304;function cc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function fh(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~i;l!==0?n=cc(l):(a&=o,a!==0&&(n=cc(a)))}else o=r&~i,o!==0?n=cc(o):a!==0&&(n=cc(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Mi(t),i=1<<r,n|=e[r],t&=~i;return n}function oO(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lO(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Mi(a),l=1<<o,u=i[o];u===-1?(!(l&r)||l&n)&&(i[o]=oO(l,t)):u<=t&&(e.expiredLanes|=l),a&=~l}}function Dv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function O6(){var e=_d;return _d<<=1,!(_d&4194240)&&(_d=64),e}function M1(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function rf(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mi(t),e[t]=r}function sO(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-Mi(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function Km(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Mi(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Lt=0;function x6(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var P6,Xm,C6,T6,A6,Fv=!1,Sd=[],wo=null,So=null,Eo=null,kc=new Map,Rc=new Map,go=[],uO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function T3(e,t){switch(e){case"focusin":case"focusout":wo=null;break;case"dragenter":case"dragleave":So=null;break;case"mouseover":case"mouseout":Eo=null;break;case"pointerover":case"pointerout":kc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rc.delete(t.pointerId)}}function Qu(e,t,r,n,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},t!==null&&(t=af(t),t!==null&&Xm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function cO(e,t,r,n,i){switch(t){case"focusin":return wo=Qu(wo,e,t,r,n,i),!0;case"dragenter":return So=Qu(So,e,t,r,n,i),!0;case"mouseover":return Eo=Qu(Eo,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return kc.set(a,Qu(kc.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,Rc.set(a,Qu(Rc.get(a)||null,e,t,r,n,i)),!0}return!1}function k6(e){var t=dl(e.target);if(t!==null){var r=Ll(t);if(r!==null){if(t=r.tag,t===13){if(t=y6(r),t!==null){e.blockedOn=t,A6(e.priority,function(){C6(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function qd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=jv(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Lv=n,r.target.dispatchEvent(n),Lv=null}else return t=af(r),t!==null&&Xm(t),e.blockedOn=r,!1;t.shift()}return!0}function A3(e,t,r){qd(e)&&r.delete(t)}function fO(){Fv=!1,wo!==null&&qd(wo)&&(wo=null),So!==null&&qd(So)&&(So=null),Eo!==null&&qd(Eo)&&(Eo=null),kc.forEach(A3),Rc.forEach(A3)}function Ju(e,t){e.blockedOn===t&&(e.blockedOn=null,Fv||(Fv=!0,$n.unstable_scheduleCallback($n.unstable_NormalPriority,fO)))}function Lc(e){function t(i){return Ju(i,e)}if(0<Sd.length){Ju(Sd[0],e);for(var r=1;r<Sd.length;r++){var n=Sd[r];n.blockedOn===e&&(n.blockedOn=null)}}for(wo!==null&&Ju(wo,e),So!==null&&Ju(So,e),Eo!==null&&Ju(Eo,e),kc.forEach(t),Rc.forEach(t),r=0;r<go.length;r++)n=go[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<go.length&&(r=go[0],r.blockedOn===null);)k6(r),r.blockedOn===null&&go.shift()}var Us=Ha.ReactCurrentBatchConfig,dh=!0;function dO(e,t,r,n){var i=Lt,a=Us.transition;Us.transition=null;try{Lt=1,Zm(e,t,r,n)}finally{Lt=i,Us.transition=a}}function hO(e,t,r,n){var i=Lt,a=Us.transition;Us.transition=null;try{Lt=4,Zm(e,t,r,n)}finally{Lt=i,Us.transition=a}}function Zm(e,t,r,n){if(dh){var i=jv(e,t,r,n);if(i===null)G1(e,t,n,hh,r),T3(e,n);else if(cO(i,e,t,r,n))n.stopPropagation();else if(T3(e,n),t&4&&-1<uO.indexOf(e)){for(;i!==null;){var a=af(i);if(a!==null&&P6(a),a=jv(e,t,r,n),a===null&&G1(e,t,n,hh,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else G1(e,t,n,null,r)}}var hh=null;function jv(e,t,r,n){if(hh=null,e=Wm(n),e=dl(e),e!==null)if(t=Ll(e),t===null)e=null;else if(r=t.tag,r===13){if(e=y6(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return hh=e,null}function R6(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(eO()){case Ym:return 1;case S6:return 4;case ch:case tO:return 16;case E6:return 536870912;default:return 16}default:return 16}}var yo=null,Qm=null,Wd=null;function L6(){if(Wd)return Wd;var e,t=Qm,r=t.length,n,i="value"in yo?yo.value:yo.textContent,a=i.length;for(e=0;e<r&&t[e]===i[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===i[a-n];n++);return Wd=i.slice(e,1<n?1-n:void 0)}function Yd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ed(){return!0}function k3(){return!1}function Wn(e){function t(r,n,i,a,o){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Ed:k3,this.isPropagationStopped=k3,this}return nr(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ed)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ed)},persist:function(){},isPersistent:Ed}),t}var gu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jm=Wn(gu),nf=nr({},gu,{view:0,detail:0}),pO=Wn(nf),N1,I1,ec,Zh=nr({},nf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ey,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ec&&(ec&&e.type==="mousemove"?(N1=e.screenX-ec.screenX,I1=e.screenY-ec.screenY):I1=N1=0,ec=e),N1)},movementY:function(e){return"movementY"in e?e.movementY:I1}}),R3=Wn(Zh),gO=nr({},Zh,{dataTransfer:0}),vO=Wn(gO),mO=nr({},nf,{relatedTarget:0}),D1=Wn(mO),yO=nr({},gu,{animationName:0,elapsedTime:0,pseudoElement:0}),bO=Wn(yO),_O=nr({},gu,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wO=Wn(_O),SO=nr({},gu,{data:0}),L3=Wn(SO),EO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},OO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function PO(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xO[e])?!!t[e]:!1}function ey(){return PO}var CO=nr({},nf,{key:function(e){if(e.key){var t=EO[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?OO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ey,charCode:function(e){return e.type==="keypress"?Yd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),TO=Wn(CO),AO=nr({},Zh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),M3=Wn(AO),kO=nr({},nf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ey}),RO=Wn(kO),LO=nr({},gu,{propertyName:0,elapsedTime:0,pseudoElement:0}),MO=Wn(LO),NO=nr({},Zh,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),IO=Wn(NO),DO=[9,13,27,32],ty=Da&&"CompositionEvent"in window,vc=null;Da&&"documentMode"in document&&(vc=document.documentMode);var FO=Da&&"TextEvent"in window&&!vc,M6=Da&&(!ty||vc&&8<vc&&11>=vc),N3=" ",I3=!1;function N6(e,t){switch(e){case"keyup":return DO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function I6(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xs=!1;function jO(e,t){switch(e){case"compositionend":return I6(t);case"keypress":return t.which!==32?null:(I3=!0,N3);case"textInput":return e=t.data,e===N3&&I3?null:e;default:return null}}function zO(e,t){if(xs)return e==="compositionend"||!ty&&N6(e,t)?(e=L6(),Wd=Qm=yo=null,xs=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return M6&&t.locale!=="ko"?null:t.data;default:return null}}var BO={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function D3(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!BO[e.type]:t==="textarea"}function D6(e,t,r,n){h6(n),t=ph(t,"onChange"),0<t.length&&(r=new Jm("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var mc=null,Mc=null;function UO(e){W6(e,0)}function Qh(e){var t=Ts(e);if(o6(t))return e}function HO(e,t){if(e==="change")return t}var F6=!1;if(Da){var F1;if(Da){var j1="oninput"in document;if(!j1){var F3=document.createElement("div");F3.setAttribute("oninput","return;"),j1=typeof F3.oninput=="function"}F1=j1}else F1=!1;F6=F1&&(!document.documentMode||9<document.documentMode)}function j3(){mc&&(mc.detachEvent("onpropertychange",j6),Mc=mc=null)}function j6(e){if(e.propertyName==="value"&&Qh(Mc)){var t=[];D6(t,Mc,e,Wm(e)),m6(UO,t)}}function GO(e,t,r){e==="focusin"?(j3(),mc=t,Mc=r,mc.attachEvent("onpropertychange",j6)):e==="focusout"&&j3()}function $O(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qh(Mc)}function VO(e,t){if(e==="click")return Qh(t)}function qO(e,t){if(e==="input"||e==="change")return Qh(t)}function WO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zi=typeof Object.is=="function"?Object.is:WO;function Nc(e,t){if(zi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!_v.call(t,i)||!zi(e[i],t[i]))return!1}return!0}function z3(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function B3(e,t){var r=z3(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=z3(r)}}function z6(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?z6(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function B6(){for(var e=window,t=lh();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=lh(e.document)}return t}function ry(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")}function YO(e){var t=B6(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&z6(r.ownerDocument.documentElement,r)){if(n!==null&&ry(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=B3(r,a);var o=B3(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var KO=Da&&"documentMode"in document&&11>=document.documentMode,Ps=null,zv=null,yc=null,Bv=!1;function U3(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Bv||Ps==null||Ps!==lh(n)||(n=Ps,"selectionStart"in n&&ry(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),yc&&Nc(yc,n)||(yc=n,n=ph(zv,"onSelect"),0<n.length&&(t=new Jm("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ps)))}function Od(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Cs={animationend:Od("Animation","AnimationEnd"),animationiteration:Od("Animation","AnimationIteration"),animationstart:Od("Animation","AnimationStart"),transitionend:Od("Transition","TransitionEnd")},z1={},U6={};Da&&(U6=document.createElement("div").style,"AnimationEvent"in window||(delete Cs.animationend.animation,delete Cs.animationiteration.animation,delete Cs.animationstart.animation),"TransitionEvent"in window||delete Cs.transitionend.transition);function Jh(e){if(z1[e])return z1[e];if(!Cs[e])return e;var t=Cs[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in U6)return z1[e]=t[r];return e}var H6=Jh("animationend"),G6=Jh("animationiteration"),$6=Jh("animationstart"),V6=Jh("transitionend"),q6=new Map,H3="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Fo(e,t){q6.set(e,t),Rl(t,[e])}for(var B1=0;B1<H3.length;B1++){var U1=H3[B1],XO=U1.toLowerCase(),ZO=U1[0].toUpperCase()+U1.slice(1);Fo(XO,"on"+ZO)}Fo(H6,"onAnimationEnd");Fo(G6,"onAnimationIteration");Fo($6,"onAnimationStart");Fo("dblclick","onDoubleClick");Fo("focusin","onFocus");Fo("focusout","onBlur");Fo(V6,"onTransitionEnd");Vs("onMouseEnter",["mouseout","mouseover"]);Vs("onMouseLeave",["mouseout","mouseover"]);Vs("onPointerEnter",["pointerout","pointerover"]);Vs("onPointerLeave",["pointerout","pointerover"]);Rl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Rl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Rl("onBeforeInput",["compositionend","keypress","textInput","paste"]);Rl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Rl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Rl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),QO=new Set("cancel close invalid load scroll toggle".split(" ").concat(fc));function G3(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,XE(n,t,void 0,e),e.currentTarget=null}function W6(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],u=l.instance,f=l.currentTarget;if(l=l.listener,u!==a&&i.isPropagationStopped())break e;G3(i,l,f),a=u}else for(o=0;o<n.length;o++){if(l=n[o],u=l.instance,f=l.currentTarget,l=l.listener,u!==a&&i.isPropagationStopped())break e;G3(i,l,f),a=u}}}if(uh)throw e=Iv,uh=!1,Iv=null,e}function qt(e,t){var r=t[Vv];r===void 0&&(r=t[Vv]=new Set);var n=e+"__bubble";r.has(n)||(Y6(t,e,2,!1),r.add(n))}function H1(e,t,r){var n=0;t&&(n|=4),Y6(r,e,n,t)}var xd="_reactListening"+Math.random().toString(36).slice(2);function Ic(e){if(!e[xd]){e[xd]=!0,t6.forEach(function(r){r!=="selectionchange"&&(QO.has(r)||H1(r,!1,e),H1(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,H1("selectionchange",!1,t))}}function Y6(e,t,r,n){switch(R6(t)){case 1:var i=dO;break;case 4:i=hO;break;default:i=Zm}r=i.bind(null,t,r,e),i=void 0,!Nv||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function G1(e,t,r,n,i){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=n.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;o=o.return}for(;l!==null;){if(o=dl(l),o===null)return;if(u=o.tag,u===5||u===6){n=a=o;continue e}l=l.parentNode}}n=n.return}m6(function(){var f=a,v=Wm(r),w=[];e:{var b=q6.get(e);if(b!==void 0){var h=Jm,E=e;switch(e){case"keypress":if(Yd(r)===0)break e;case"keydown":case"keyup":h=TO;break;case"focusin":E="focus",h=D1;break;case"focusout":E="blur",h=D1;break;case"beforeblur":case"afterblur":h=D1;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=R3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=vO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=RO;break;case H6:case G6:case $6:h=bO;break;case V6:h=MO;break;case"scroll":h=pO;break;case"wheel":h=IO;break;case"copy":case"cut":case"paste":h=wO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=M3}var y=(t&4)!==0,m=!y&&e==="scroll",p=y?b!==null?b+"Capture":null:b;y=[];for(var g=f,d;g!==null;){d=g;var _=d.stateNode;if(d.tag===5&&_!==null&&(d=_,p!==null&&(_=Ac(g,p),_!=null&&y.push(Dc(g,_,d)))),m)break;g=g.return}0<y.length&&(b=new h(b,E,null,r,v),w.push({event:b,listeners:y}))}}if(!(t&7)){e:{if(b=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",b&&r!==Lv&&(E=r.relatedTarget||r.fromElement)&&(dl(E)||E[Fa]))break e;if((h||b)&&(b=v.window===v?v:(b=v.ownerDocument)?b.defaultView||b.parentWindow:window,h?(E=r.relatedTarget||r.toElement,h=f,E=E?dl(E):null,E!==null&&(m=Ll(E),E!==m||E.tag!==5&&E.tag!==6)&&(E=null)):(h=null,E=f),h!==E)){if(y=R3,_="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(y=M3,_="onPointerLeave",p="onPointerEnter",g="pointer"),m=h==null?b:Ts(h),d=E==null?b:Ts(E),b=new y(_,g+"leave",h,r,v),b.target=m,b.relatedTarget=d,_=null,dl(v)===f&&(y=new y(p,g+"enter",E,r,v),y.target=d,y.relatedTarget=m,_=y),m=_,h&&E)t:{for(y=h,p=E,g=0,d=y;d;d=ms(d))g++;for(d=0,_=p;_;_=ms(_))d++;for(;0<g-d;)y=ms(y),g--;for(;0<d-g;)p=ms(p),d--;for(;g--;){if(y===p||p!==null&&y===p.alternate)break t;y=ms(y),p=ms(p)}y=null}else y=null;h!==null&&$3(w,b,h,y,!1),E!==null&&m!==null&&$3(w,m,E,y,!0)}}e:{if(b=f?Ts(f):window,h=b.nodeName&&b.nodeName.toLowerCase(),h==="select"||h==="input"&&b.type==="file")var O=HO;else if(D3(b))if(F6)O=qO;else{O=$O;var k=GO}else(h=b.nodeName)&&h.toLowerCase()==="input"&&(b.type==="checkbox"||b.type==="radio")&&(O=VO);if(O&&(O=O(e,f))){D6(w,O,r,v);break e}k&&k(e,b,f),e==="focusout"&&(k=b._wrapperState)&&k.controlled&&b.type==="number"&&Cv(b,"number",b.value)}switch(k=f?Ts(f):window,e){case"focusin":(D3(k)||k.contentEditable==="true")&&(Ps=k,zv=f,yc=null);break;case"focusout":yc=zv=Ps=null;break;case"mousedown":Bv=!0;break;case"contextmenu":case"mouseup":case"dragend":Bv=!1,U3(w,r,v);break;case"selectionchange":if(KO)break;case"keydown":case"keyup":U3(w,r,v)}var C;if(ty)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else xs?N6(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(M6&&r.locale!=="ko"&&(xs||S!=="onCompositionStart"?S==="onCompositionEnd"&&xs&&(C=L6()):(yo=v,Qm="value"in yo?yo.value:yo.textContent,xs=!0)),k=ph(f,S),0<k.length&&(S=new L3(S,e,null,r,v),w.push({event:S,listeners:k}),C?S.data=C:(C=I6(r),C!==null&&(S.data=C)))),(C=FO?jO(e,r):zO(e,r))&&(f=ph(f,"onBeforeInput"),0<f.length&&(v=new L3("onBeforeInput","beforeinput",null,r,v),w.push({event:v,listeners:f}),v.data=C))}W6(w,t)})}function Dc(e,t,r){return{instance:e,listener:t,currentTarget:r}}function ph(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Ac(e,r),a!=null&&n.unshift(Dc(e,a,i)),a=Ac(e,t),a!=null&&n.push(Dc(e,a,i))),e=e.return}return n}function ms(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function $3(e,t,r,n,i){for(var a=t._reactName,o=[];r!==null&&r!==n;){var l=r,u=l.alternate,f=l.stateNode;if(u!==null&&u===n)break;l.tag===5&&f!==null&&(l=f,i?(u=Ac(r,a),u!=null&&o.unshift(Dc(r,u,l))):i||(u=Ac(r,a),u!=null&&o.push(Dc(r,u,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var JO=/\r\n?/g,ex=/\u0000|\uFFFD/g;function V3(e){return(typeof e=="string"?e:""+e).replace(JO,`
30
+ `).replace(ex,"")}function Pd(e,t,r){if(t=V3(t),V3(e)!==t&&r)throw Error(Ce(425))}function gh(){}var Uv=null,Hv=null;function Gv(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var $v=typeof setTimeout=="function"?setTimeout:void 0,tx=typeof clearTimeout=="function"?clearTimeout:void 0,q3=typeof Promise=="function"?Promise:void 0,rx=typeof queueMicrotask=="function"?queueMicrotask:typeof q3<"u"?function(e){return q3.resolve(null).then(e).catch(nx)}:$v;function nx(e){setTimeout(function(){throw e})}function $1(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),Lc(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);Lc(t)}function Oo(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function W3(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var vu=Math.random().toString(36).slice(2),ta="__reactFiber$"+vu,Fc="__reactProps$"+vu,Fa="__reactContainer$"+vu,Vv="__reactEvents$"+vu,ix="__reactListeners$"+vu,ax="__reactHandles$"+vu;function dl(e){var t=e[ta];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Fa]||r[ta]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=W3(e);e!==null;){if(r=e[ta])return r;e=W3(e)}return t}e=r,r=e.parentNode}return null}function af(e){return e=e[ta]||e[Fa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ts(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Ce(33))}function ep(e){return e[Fc]||null}var qv=[],As=-1;function jo(e){return{current:e}}function Wt(e){0>As||(e.current=qv[As],qv[As]=null,As--)}function Ut(e,t){As++,qv[As]=e.current,e.current=t}var Lo={},nn=jo(Lo),Cn=jo(!1),_l=Lo;function qs(e,t){var r=e.type.contextTypes;if(!r)return Lo;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Tn(e){return e=e.childContextTypes,e!=null}function vh(){Wt(Cn),Wt(nn)}function Y3(e,t,r){if(nn.current!==Lo)throw Error(Ce(168));Ut(nn,t),Ut(Cn,r)}function K6(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(Ce(108,GE(e)||"Unknown",i));return nr({},r,n)}function mh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Lo,_l=nn.current,Ut(nn,e),Ut(Cn,Cn.current),!0}function K3(e,t,r){var n=e.stateNode;if(!n)throw Error(Ce(169));r?(e=K6(e,t,_l),n.__reactInternalMemoizedMergedChildContext=e,Wt(Cn),Wt(nn),Ut(nn,e)):Wt(Cn),Ut(Cn,r)}var Ta=null,tp=!1,V1=!1;function X6(e){Ta===null?Ta=[e]:Ta.push(e)}function ox(e){tp=!0,X6(e)}function zo(){if(!V1&&Ta!==null){V1=!0;var e=0,t=Lt;try{var r=Ta;for(Lt=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Ta=null,tp=!1}catch(i){throw Ta!==null&&(Ta=Ta.slice(e+1)),w6(Ym,zo),i}finally{Lt=t,V1=!1}}return null}var ks=[],Rs=0,yh=null,bh=0,li=[],si=0,wl=null,Aa=1,ka="";function cl(e,t){ks[Rs++]=bh,ks[Rs++]=yh,yh=e,bh=t}function Z6(e,t,r){li[si++]=Aa,li[si++]=ka,li[si++]=wl,wl=e;var n=Aa;e=ka;var i=32-Mi(n)-1;n&=~(1<<i),r+=1;var a=32-Mi(t)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,Aa=1<<32-Mi(t)+i|r<<i|n,ka=a+e}else Aa=1<<a|r<<i|n,ka=e}function ny(e){e.return!==null&&(cl(e,1),Z6(e,1,0))}function iy(e){for(;e===yh;)yh=ks[--Rs],ks[Rs]=null,bh=ks[--Rs],ks[Rs]=null;for(;e===wl;)wl=li[--si],li[si]=null,ka=li[--si],li[si]=null,Aa=li[--si],li[si]=null}var Gn=null,Hn=null,Zt=!1,Li=null;function Q6(e,t){var r=fi(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function X3(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Gn=e,Hn=Oo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Gn=e,Hn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=wl!==null?{id:Aa,overflow:ka}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=fi(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Gn=e,Hn=null,!0):!1;default:return!1}}function Wv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Yv(e){if(Zt){var t=Hn;if(t){var r=t;if(!X3(e,t)){if(Wv(e))throw Error(Ce(418));t=Oo(r.nextSibling);var n=Gn;t&&X3(e,t)?Q6(n,r):(e.flags=e.flags&-4097|2,Zt=!1,Gn=e)}}else{if(Wv(e))throw Error(Ce(418));e.flags=e.flags&-4097|2,Zt=!1,Gn=e}}}function Z3(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Gn=e}function Cd(e){if(e!==Gn)return!1;if(!Zt)return Z3(e),Zt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Gv(e.type,e.memoizedProps)),t&&(t=Hn)){if(Wv(e))throw J6(),Error(Ce(418));for(;t;)Q6(e,t),t=Oo(t.nextSibling)}if(Z3(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ce(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Hn=Oo(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Hn=null}}else Hn=Gn?Oo(e.stateNode.nextSibling):null;return!0}function J6(){for(var e=Hn;e;)e=Oo(e.nextSibling)}function Ws(){Hn=Gn=null,Zt=!1}function ay(e){Li===null?Li=[e]:Li.push(e)}var lx=Ha.ReactCurrentBatchConfig;function tc(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Ce(309));var n=r.stateNode}if(!n)throw Error(Ce(147,e));var i=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(Ce(284));if(!r._owner)throw Error(Ce(290,e))}return e}function Td(e,t){throw e=Object.prototype.toString.call(t),Error(Ce(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Q3(e){var t=e._init;return t(e._payload)}function ew(e){function t(p,g){if(e){var d=p.deletions;d===null?(p.deletions=[g],p.flags|=16):d.push(g)}}function r(p,g){if(!e)return null;for(;g!==null;)t(p,g),g=g.sibling;return null}function n(p,g){for(p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function i(p,g){return p=To(p,g),p.index=0,p.sibling=null,p}function a(p,g,d){return p.index=d,e?(d=p.alternate,d!==null?(d=d.index,d<g?(p.flags|=2,g):d):(p.flags|=2,g)):(p.flags|=1048576,g)}function o(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,g,d,_){return g===null||g.tag!==6?(g=Q1(d,p.mode,_),g.return=p,g):(g=i(g,d),g.return=p,g)}function u(p,g,d,_){var O=d.type;return O===Os?v(p,g,d.props.children,_,d.key):g!==null&&(g.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===ho&&Q3(O)===g.type)?(_=i(g,d.props),_.ref=tc(p,g,d),_.return=p,_):(_=th(d.type,d.key,d.props,null,p.mode,_),_.ref=tc(p,g,d),_.return=p,_)}function f(p,g,d,_){return g===null||g.tag!==4||g.stateNode.containerInfo!==d.containerInfo||g.stateNode.implementation!==d.implementation?(g=J1(d,p.mode,_),g.return=p,g):(g=i(g,d.children||[]),g.return=p,g)}function v(p,g,d,_,O){return g===null||g.tag!==7?(g=ml(d,p.mode,_,O),g.return=p,g):(g=i(g,d),g.return=p,g)}function w(p,g,d){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Q1(""+g,p.mode,d),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case md:return d=th(g.type,g.key,g.props,null,p.mode,d),d.ref=tc(p,null,g),d.return=p,d;case Es:return g=J1(g,p.mode,d),g.return=p,g;case ho:var _=g._init;return w(p,_(g._payload),d)}if(uc(g)||Xu(g))return g=ml(g,p.mode,d,null),g.return=p,g;Td(p,g)}return null}function b(p,g,d,_){var O=g!==null?g.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return O!==null?null:l(p,g,""+d,_);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case md:return d.key===O?u(p,g,d,_):null;case Es:return d.key===O?f(p,g,d,_):null;case ho:return O=d._init,b(p,g,O(d._payload),_)}if(uc(d)||Xu(d))return O!==null?null:v(p,g,d,_,null);Td(p,d)}return null}function h(p,g,d,_,O){if(typeof _=="string"&&_!==""||typeof _=="number")return p=p.get(d)||null,l(g,p,""+_,O);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case md:return p=p.get(_.key===null?d:_.key)||null,u(g,p,_,O);case Es:return p=p.get(_.key===null?d:_.key)||null,f(g,p,_,O);case ho:var k=_._init;return h(p,g,d,k(_._payload),O)}if(uc(_)||Xu(_))return p=p.get(d)||null,v(g,p,_,O,null);Td(g,_)}return null}function E(p,g,d,_){for(var O=null,k=null,C=g,S=g=0,x=null;C!==null&&S<d.length;S++){C.index>S?(x=C,C=null):x=C.sibling;var P=b(p,C,d[S],_);if(P===null){C===null&&(C=x);break}e&&C&&P.alternate===null&&t(p,C),g=a(P,g,S),k===null?O=P:k.sibling=P,k=P,C=x}if(S===d.length)return r(p,C),Zt&&cl(p,S),O;if(C===null){for(;S<d.length;S++)C=w(p,d[S],_),C!==null&&(g=a(C,g,S),k===null?O=C:k.sibling=C,k=C);return Zt&&cl(p,S),O}for(C=n(p,C);S<d.length;S++)x=h(C,p,S,d[S],_),x!==null&&(e&&x.alternate!==null&&C.delete(x.key===null?S:x.key),g=a(x,g,S),k===null?O=x:k.sibling=x,k=x);return e&&C.forEach(function(T){return t(p,T)}),Zt&&cl(p,S),O}function y(p,g,d,_){var O=Xu(d);if(typeof O!="function")throw Error(Ce(150));if(d=O.call(d),d==null)throw Error(Ce(151));for(var k=O=null,C=g,S=g=0,x=null,P=d.next();C!==null&&!P.done;S++,P=d.next()){C.index>S?(x=C,C=null):x=C.sibling;var T=b(p,C,P.value,_);if(T===null){C===null&&(C=x);break}e&&C&&T.alternate===null&&t(p,C),g=a(T,g,S),k===null?O=T:k.sibling=T,k=T,C=x}if(P.done)return r(p,C),Zt&&cl(p,S),O;if(C===null){for(;!P.done;S++,P=d.next())P=w(p,P.value,_),P!==null&&(g=a(P,g,S),k===null?O=P:k.sibling=P,k=P);return Zt&&cl(p,S),O}for(C=n(p,C);!P.done;S++,P=d.next())P=h(C,p,S,P.value,_),P!==null&&(e&&P.alternate!==null&&C.delete(P.key===null?S:P.key),g=a(P,g,S),k===null?O=P:k.sibling=P,k=P);return e&&C.forEach(function(L){return t(p,L)}),Zt&&cl(p,S),O}function m(p,g,d,_){if(typeof d=="object"&&d!==null&&d.type===Os&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case md:e:{for(var O=d.key,k=g;k!==null;){if(k.key===O){if(O=d.type,O===Os){if(k.tag===7){r(p,k.sibling),g=i(k,d.props.children),g.return=p,p=g;break e}}else if(k.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===ho&&Q3(O)===k.type){r(p,k.sibling),g=i(k,d.props),g.ref=tc(p,k,d),g.return=p,p=g;break e}r(p,k);break}else t(p,k);k=k.sibling}d.type===Os?(g=ml(d.props.children,p.mode,_,d.key),g.return=p,p=g):(_=th(d.type,d.key,d.props,null,p.mode,_),_.ref=tc(p,g,d),_.return=p,p=_)}return o(p);case Es:e:{for(k=d.key;g!==null;){if(g.key===k)if(g.tag===4&&g.stateNode.containerInfo===d.containerInfo&&g.stateNode.implementation===d.implementation){r(p,g.sibling),g=i(g,d.children||[]),g.return=p,p=g;break e}else{r(p,g);break}else t(p,g);g=g.sibling}g=J1(d,p.mode,_),g.return=p,p=g}return o(p);case ho:return k=d._init,m(p,g,k(d._payload),_)}if(uc(d))return E(p,g,d,_);if(Xu(d))return y(p,g,d,_);Td(p,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,g!==null&&g.tag===6?(r(p,g.sibling),g=i(g,d),g.return=p,p=g):(r(p,g),g=Q1(d,p.mode,_),g.return=p,p=g),o(p)):r(p,g)}return m}var Ys=ew(!0),tw=ew(!1),_h=jo(null),wh=null,Ls=null,oy=null;function ly(){oy=Ls=wh=null}function sy(e){var t=_h.current;Wt(_h),e._currentValue=t}function Kv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Hs(e,t){wh=e,oy=Ls=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(On=!0),e.firstContext=null)}function pi(e){var t=e._currentValue;if(oy!==e)if(e={context:e,memoizedValue:t,next:null},Ls===null){if(wh===null)throw Error(Ce(308));Ls=e,wh.dependencies={lanes:0,firstContext:e}}else Ls=Ls.next=e;return t}var hl=null;function uy(e){hl===null?hl=[e]:hl.push(e)}function rw(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,uy(t)):(r.next=i.next,i.next=r),t.interleaved=r,ja(e,n)}function ja(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var po=!1;function cy(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ra(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xo(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ot&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ja(e,r)}return i=n.interleaved,i===null?(t.next=t,uy(n)):(t.next=i.next,i.next=t),n.interleaved=t,ja(e,r)}function Kd(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Km(e,r)}}function J3(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Sh(e,t,r,n){var i=e.updateQueue;po=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,f=u.next;u.next=null,o===null?a=f:o.next=f,o=u;var v=e.alternate;v!==null&&(v=v.updateQueue,l=v.lastBaseUpdate,l!==o&&(l===null?v.firstBaseUpdate=f:l.next=f,v.lastBaseUpdate=u))}if(a!==null){var w=i.baseState;o=0,v=f=u=null,l=a;do{var b=l.lane,h=l.eventTime;if((n&b)===b){v!==null&&(v=v.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var E=e,y=l;switch(b=t,h=r,y.tag){case 1:if(E=y.payload,typeof E=="function"){w=E.call(h,w,b);break e}w=E;break e;case 3:E.flags=E.flags&-65537|128;case 0:if(E=y.payload,b=typeof E=="function"?E.call(h,w,b):E,b==null)break e;w=nr({},w,b);break e;case 2:po=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,b=i.effects,b===null?i.effects=[l]:b.push(l))}else h={eventTime:h,lane:b,tag:l.tag,payload:l.payload,callback:l.callback,next:null},v===null?(f=v=h,u=w):v=v.next=h,o|=b;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;b=l,l=b.next,b.next=null,i.lastBaseUpdate=b,i.shared.pending=null}}while(!0);if(v===null&&(u=w),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=v,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);El|=o,e.lanes=o,e.memoizedState=w}}function e5(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(Ce(191,i));i.call(n)}}}var of={},oa=jo(of),jc=jo(of),zc=jo(of);function pl(e){if(e===of)throw Error(Ce(174));return e}function fy(e,t){switch(Ut(zc,t),Ut(jc,e),Ut(oa,of),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Av(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Av(t,e)}Wt(oa),Ut(oa,t)}function Ks(){Wt(oa),Wt(jc),Wt(zc)}function iw(e){pl(zc.current);var t=pl(oa.current),r=Av(t,e.type);t!==r&&(Ut(jc,e),Ut(oa,r))}function dy(e){jc.current===e&&(Wt(oa),Wt(jc))}var tr=jo(0);function Eh(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 q1=[];function hy(){for(var e=0;e<q1.length;e++)q1[e]._workInProgressVersionPrimary=null;q1.length=0}var Xd=Ha.ReactCurrentDispatcher,W1=Ha.ReactCurrentBatchConfig,Sl=0,rr=null,xr=null,Fr=null,Oh=!1,bc=!1,Bc=0,sx=0;function en(){throw Error(Ce(321))}function py(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!zi(e[r],t[r]))return!1;return!0}function gy(e,t,r,n,i,a){if(Sl=a,rr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Xd.current=e===null||e.memoizedState===null?dx:hx,e=r(n,i),bc){a=0;do{if(bc=!1,Bc=0,25<=a)throw Error(Ce(301));a+=1,Fr=xr=null,t.updateQueue=null,Xd.current=px,e=r(n,i)}while(bc)}if(Xd.current=xh,t=xr!==null&&xr.next!==null,Sl=0,Fr=xr=rr=null,Oh=!1,t)throw Error(Ce(300));return e}function vy(){var e=Bc!==0;return Bc=0,e}function ea(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fr===null?rr.memoizedState=Fr=e:Fr=Fr.next=e,Fr}function gi(){if(xr===null){var e=rr.alternate;e=e!==null?e.memoizedState:null}else e=xr.next;var t=Fr===null?rr.memoizedState:Fr.next;if(t!==null)Fr=t,xr=e;else{if(e===null)throw Error(Ce(310));xr=e,e={memoizedState:xr.memoizedState,baseState:xr.baseState,baseQueue:xr.baseQueue,queue:xr.queue,next:null},Fr===null?rr.memoizedState=Fr=e:Fr=Fr.next=e}return Fr}function Uc(e,t){return typeof t=="function"?t(e):t}function Y1(e){var t=gi(),r=t.queue;if(r===null)throw Error(Ce(311));r.lastRenderedReducer=e;var n=xr,i=n.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}n.baseQueue=i=a,r.pending=null}if(i!==null){a=i.next,n=n.baseState;var l=o=null,u=null,f=a;do{var v=f.lane;if((Sl&v)===v)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),n=f.hasEagerState?f.eagerState:e(n,f.action);else{var w={lane:v,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=w,o=n):u=u.next=w,rr.lanes|=v,El|=v}f=f.next}while(f!==null&&f!==a);u===null?o=n:u.next=l,zi(n,t.memoizedState)||(On=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=u,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do a=i.lane,rr.lanes|=a,El|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function K1(e){var t=gi(),r=t.queue;if(r===null)throw Error(Ce(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);zi(a,t.memoizedState)||(On=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function aw(){}function ow(e,t){var r=rr,n=gi(),i=t(),a=!zi(n.memoizedState,i);if(a&&(n.memoizedState=i,On=!0),n=n.queue,my(uw.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Fr!==null&&Fr.memoizedState.tag&1){if(r.flags|=2048,Hc(9,sw.bind(null,r,n,i,t),void 0,null),jr===null)throw Error(Ce(349));Sl&30||lw(r,t,i)}return i}function lw(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=rr.updateQueue,t===null?(t={lastEffect:null,stores:null},rr.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function sw(e,t,r,n){t.value=r,t.getSnapshot=n,cw(t)&&fw(e)}function uw(e,t,r){return r(function(){cw(t)&&fw(e)})}function cw(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!zi(e,r)}catch{return!0}}function fw(e){var t=ja(e,1);t!==null&&Ni(t,e,1,-1)}function t5(e){var t=ea();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Uc,lastRenderedState:e},t.queue=e,e=e.dispatch=fx.bind(null,rr,e),[t.memoizedState,e]}function Hc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=rr.updateQueue,t===null?(t={lastEffect:null,stores:null},rr.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function dw(){return gi().memoizedState}function Zd(e,t,r,n){var i=ea();rr.flags|=e,i.memoizedState=Hc(1|t,r,void 0,n===void 0?null:n)}function rp(e,t,r,n){var i=gi();n=n===void 0?null:n;var a=void 0;if(xr!==null){var o=xr.memoizedState;if(a=o.destroy,n!==null&&py(n,o.deps)){i.memoizedState=Hc(t,r,a,n);return}}rr.flags|=e,i.memoizedState=Hc(1|t,r,a,n)}function r5(e,t){return Zd(8390656,8,e,t)}function my(e,t){return rp(2048,8,e,t)}function hw(e,t){return rp(4,2,e,t)}function pw(e,t){return rp(4,4,e,t)}function gw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vw(e,t,r){return r=r!=null?r.concat([e]):null,rp(4,4,gw.bind(null,t,e),r)}function yy(){}function mw(e,t){var r=gi();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&py(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function yw(e,t){var r=gi();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&py(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function bw(e,t,r){return Sl&21?(zi(r,t)||(r=O6(),rr.lanes|=r,El|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,On=!0),e.memoizedState=r)}function ux(e,t){var r=Lt;Lt=r!==0&&4>r?r:4,e(!0);var n=W1.transition;W1.transition={};try{e(!1),t()}finally{Lt=r,W1.transition=n}}function _w(){return gi().memoizedState}function cx(e,t,r){var n=Co(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},ww(e))Sw(t,r);else if(r=rw(e,t,r,n),r!==null){var i=dn();Ni(r,e,n,i),Ew(r,t,n)}}function fx(e,t,r){var n=Co(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(ww(e))Sw(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,r);if(i.hasEagerState=!0,i.eagerState=l,zi(l,o)){var u=t.interleaved;u===null?(i.next=i,uy(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}r=rw(e,t,i,n),r!==null&&(i=dn(),Ni(r,e,n,i),Ew(r,t,n))}}function ww(e){var t=e.alternate;return e===rr||t!==null&&t===rr}function Sw(e,t){bc=Oh=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Ew(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Km(e,r)}}var xh={readContext:pi,useCallback:en,useContext:en,useEffect:en,useImperativeHandle:en,useInsertionEffect:en,useLayoutEffect:en,useMemo:en,useReducer:en,useRef:en,useState:en,useDebugValue:en,useDeferredValue:en,useTransition:en,useMutableSource:en,useSyncExternalStore:en,useId:en,unstable_isNewReconciler:!1},dx={readContext:pi,useCallback:function(e,t){return ea().memoizedState=[e,t===void 0?null:t],e},useContext:pi,useEffect:r5,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Zd(4194308,4,gw.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Zd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zd(4,2,e,t)},useMemo:function(e,t){var r=ea();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ea();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=cx.bind(null,rr,e),[n.memoizedState,e]},useRef:function(e){var t=ea();return e={current:e},t.memoizedState=e},useState:t5,useDebugValue:yy,useDeferredValue:function(e){return ea().memoizedState=e},useTransition:function(){var e=t5(!1),t=e[0];return e=ux.bind(null,e[1]),ea().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=rr,i=ea();if(Zt){if(r===void 0)throw Error(Ce(407));r=r()}else{if(r=t(),jr===null)throw Error(Ce(349));Sl&30||lw(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,r5(uw.bind(null,n,a,e),[e]),n.flags|=2048,Hc(9,sw.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=ea(),t=jr.identifierPrefix;if(Zt){var r=ka,n=Aa;r=(n&~(1<<32-Mi(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Bc++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=sx++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},hx={readContext:pi,useCallback:mw,useContext:pi,useEffect:my,useImperativeHandle:vw,useInsertionEffect:hw,useLayoutEffect:pw,useMemo:yw,useReducer:Y1,useRef:dw,useState:function(){return Y1(Uc)},useDebugValue:yy,useDeferredValue:function(e){var t=gi();return bw(t,xr.memoizedState,e)},useTransition:function(){var e=Y1(Uc)[0],t=gi().memoizedState;return[e,t]},useMutableSource:aw,useSyncExternalStore:ow,useId:_w,unstable_isNewReconciler:!1},px={readContext:pi,useCallback:mw,useContext:pi,useEffect:my,useImperativeHandle:vw,useInsertionEffect:hw,useLayoutEffect:pw,useMemo:yw,useReducer:K1,useRef:dw,useState:function(){return K1(Uc)},useDebugValue:yy,useDeferredValue:function(e){var t=gi();return xr===null?t.memoizedState=e:bw(t,xr.memoizedState,e)},useTransition:function(){var e=K1(Uc)[0],t=gi().memoizedState;return[e,t]},useMutableSource:aw,useSyncExternalStore:ow,useId:_w,unstable_isNewReconciler:!1};function ki(e,t){if(e&&e.defaultProps){t=nr({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Xv(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:nr({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var np={isMounted:function(e){return(e=e._reactInternals)?Ll(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=dn(),i=Co(e),a=Ra(n,i);a.payload=t,r!=null&&(a.callback=r),t=xo(e,a,i),t!==null&&(Ni(t,e,i,n),Kd(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=dn(),i=Co(e),a=Ra(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=xo(e,a,i),t!==null&&(Ni(t,e,i,n),Kd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=dn(),n=Co(e),i=Ra(r,n);i.tag=2,t!=null&&(i.callback=t),t=xo(e,i,n),t!==null&&(Ni(t,e,n,r),Kd(t,e,n))}};function n5(e,t,r,n,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,o):t.prototype&&t.prototype.isPureReactComponent?!Nc(r,n)||!Nc(i,a):!0}function Ow(e,t,r){var n=!1,i=Lo,a=t.contextType;return typeof a=="object"&&a!==null?a=pi(a):(i=Tn(t)?_l:nn.current,n=t.contextTypes,a=(n=n!=null)?qs(e,i):Lo),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=np,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function i5(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&np.enqueueReplaceState(t,t.state,null)}function Zv(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},cy(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=pi(a):(a=Tn(t)?_l:nn.current,i.context=qs(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Xv(e,t,a,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&np.enqueueReplaceState(i,i.state,null),Sh(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Xs(e,t){try{var r="",n=t;do r+=HE(n),n=n.return;while(n);var i=r}catch(a){i=`
31
+ Error generating stack: `+a.message+`
32
+ `+a.stack}return{value:e,source:t,stack:i,digest:null}}function X1(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Qv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var gx=typeof WeakMap=="function"?WeakMap:Map;function xw(e,t,r){r=Ra(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Ch||(Ch=!0,sm=n),Qv(e,t)},r}function Pw(e,t,r){r=Ra(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){Qv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Qv(e,t),typeof n!="function"&&(Po===null?Po=new Set([this]):Po.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function a5(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new gx;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=Ax.bind(null,e,t,r),t.then(e,e))}function o5(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function l5(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Ra(-1,1),t.tag=2,xo(r,t,1))),r.lanes|=1),e)}var vx=Ha.ReactCurrentOwner,On=!1;function fn(e,t,r,n){t.child=e===null?tw(t,null,r,n):Ys(t,e.child,r,n)}function s5(e,t,r,n,i){r=r.render;var a=t.ref;return Hs(t,i),n=gy(e,t,r,n,a,i),r=vy(),e!==null&&!On?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,za(e,t,i)):(Zt&&r&&ny(t),t.flags|=1,fn(e,t,n,i),t.child)}function u5(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!Py(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,Cw(e,t,a,n,i)):(e=th(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:Nc,r(o,n)&&e.ref===t.ref)return za(e,t,i)}return t.flags|=1,e=To(a,n),e.ref=t.ref,e.return=t,t.child=e}function Cw(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(Nc(a,n)&&e.ref===t.ref)if(On=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(On=!0);else return t.lanes=e.lanes,za(e,t,i)}return Jv(e,t,r,n,i)}function Tw(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ut(Ns,Bn),Bn|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ut(Ns,Bn),Bn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Ut(Ns,Bn),Bn|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Ut(Ns,Bn),Bn|=n;return fn(e,t,i,r),t.child}function Aw(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Jv(e,t,r,n,i){var a=Tn(r)?_l:nn.current;return a=qs(t,a),Hs(t,i),r=gy(e,t,r,n,a,i),n=vy(),e!==null&&!On?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,za(e,t,i)):(Zt&&n&&ny(t),t.flags|=1,fn(e,t,r,i),t.child)}function c5(e,t,r,n,i){if(Tn(r)){var a=!0;mh(t)}else a=!1;if(Hs(t,i),t.stateNode===null)Qd(e,t),Ow(t,r,n),Zv(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var u=o.context,f=r.contextType;typeof f=="object"&&f!==null?f=pi(f):(f=Tn(r)?_l:nn.current,f=qs(t,f));var v=r.getDerivedStateFromProps,w=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function";w||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||u!==f)&&i5(t,o,n,f),po=!1;var b=t.memoizedState;o.state=b,Sh(t,n,o,i),u=t.memoizedState,l!==n||b!==u||Cn.current||po?(typeof v=="function"&&(Xv(t,r,v,n),u=t.memoizedState),(l=po||n5(t,r,l,n,b,u,f))?(w||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),o.props=n,o.state=u,o.context=f,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,nw(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:ki(t.type,l),o.props=f,w=t.pendingProps,b=o.context,u=r.contextType,typeof u=="object"&&u!==null?u=pi(u):(u=Tn(r)?_l:nn.current,u=qs(t,u));var h=r.getDerivedStateFromProps;(v=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==w||b!==u)&&i5(t,o,n,u),po=!1,b=t.memoizedState,o.state=b,Sh(t,n,o,i);var E=t.memoizedState;l!==w||b!==E||Cn.current||po?(typeof h=="function"&&(Xv(t,r,h,n),E=t.memoizedState),(f=po||n5(t,r,f,n,b,E,u)||!1)?(v||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,E,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,E,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&b===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&b===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=E),o.props=n,o.state=E,o.context=u,n=f):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&b===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&b===e.memoizedState||(t.flags|=1024),n=!1)}return em(e,t,r,n,a,i)}function em(e,t,r,n,i,a){Aw(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&K3(t,r,!1),za(e,t,a);n=t.stateNode,vx.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Ys(t,e.child,null,a),t.child=Ys(t,null,l,a)):fn(e,t,l,a),t.memoizedState=n.state,i&&K3(t,r,!0),t.child}function kw(e){var t=e.stateNode;t.pendingContext?Y3(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Y3(e,t.context,!1),fy(e,t.containerInfo)}function f5(e,t,r,n,i){return Ws(),ay(i),t.flags|=256,fn(e,t,r,n),t.child}var tm={dehydrated:null,treeContext:null,retryLane:0};function rm(e){return{baseLanes:e,cachePool:null,transitions:null}}function Rw(e,t,r){var n=t.pendingProps,i=tr.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ut(tr,i&1),e===null)return Yv(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,a?(n=t.mode,a=t.child,o={mode:"hidden",children:o},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=op(o,n,0,null),e=ml(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=rm(r),t.memoizedState=tm,e):by(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return mx(e,t,o,n,l,i,r);if(a){a=n.fallback,o=t.mode,i=e.child,l=i.sibling;var u={mode:"hidden",children:n.children};return!(o&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=u,t.deletions=null):(n=To(i,u),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=To(l,a):(a=ml(a,o,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,o=e.child.memoizedState,o=o===null?rm(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=tm,n}return a=e.child,e=a.sibling,n=To(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function by(e,t){return t=op({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ad(e,t,r,n){return n!==null&&ay(n),Ys(t,e.child,null,r),e=by(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mx(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=X1(Error(Ce(422))),Ad(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=op({mode:"visible",children:n.children},i,0,null),a=ml(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&Ys(t,e.child,null,o),t.child.memoizedState=rm(o),t.memoizedState=tm,a);if(!(t.mode&1))return Ad(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(Ce(419)),n=X1(a,n,void 0),Ad(e,t,o,n)}if(l=(o&e.childLanes)!==0,On||l){if(n=jr,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,ja(e,i),Ni(n,e,i,-1))}return xy(),n=X1(Error(Ce(421))),Ad(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=kx.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Hn=Oo(i.nextSibling),Gn=t,Zt=!0,Li=null,e!==null&&(li[si++]=Aa,li[si++]=ka,li[si++]=wl,Aa=e.id,ka=e.overflow,wl=t),t=by(t,n.children),t.flags|=4096,t)}function d5(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Kv(e.return,t,r)}function Z1(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function Lw(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(fn(e,t,n.children,r),n=tr.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&d5(e,r,t);else if(e.tag===19)d5(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ut(tr,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&Eh(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Z1(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Eh(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Z1(t,!0,r,null,a);break;case"together":Z1(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Qd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function za(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),El|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Ce(153));if(t.child!==null){for(e=t.child,r=To(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=To(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function yx(e,t,r){switch(t.tag){case 3:kw(t),Ws();break;case 5:iw(t);break;case 1:Tn(t.type)&&mh(t);break;case 4:fy(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Ut(_h,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ut(tr,tr.current&1),t.flags|=128,null):r&t.child.childLanes?Rw(e,t,r):(Ut(tr,tr.current&1),e=za(e,t,r),e!==null?e.sibling:null);Ut(tr,tr.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Lw(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ut(tr,tr.current),n)break;return null;case 22:case 23:return t.lanes=0,Tw(e,t,r)}return za(e,t,r)}var Mw,nm,Nw,Iw;Mw=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};nm=function(){};Nw=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,pl(oa.current);var a=null;switch(r){case"input":i=xv(e,i),n=xv(e,n),a=[];break;case"select":i=nr({},i,{value:void 0}),n=nr({},n,{value:void 0}),a=[];break;case"textarea":i=Tv(e,i),n=Tv(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=gh)}kv(r,n);var o;r=null;for(f in i)if(!n.hasOwnProperty(f)&&i.hasOwnProperty(f)&&i[f]!=null)if(f==="style"){var l=i[f];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(Cc.hasOwnProperty(f)?a||(a=[]):(a=a||[]).push(f,null));for(f in n){var u=n[f];if(l=i!=null?i[f]:void 0,n.hasOwnProperty(f)&&u!==l&&(u!=null||l!=null))if(f==="style")if(l){for(o in l)!l.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in u)u.hasOwnProperty(o)&&l[o]!==u[o]&&(r||(r={}),r[o]=u[o])}else r||(a||(a=[]),a.push(f,r)),r=u;else f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(a=a||[]).push(f,u)):f==="children"?typeof u!="string"&&typeof u!="number"||(a=a||[]).push(f,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(Cc.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&qt("scroll",e),a||l===u||(a=[])):(a=a||[]).push(f,u))}r&&(a=a||[]).push("style",r);var f=a;(t.updateQueue=f)&&(t.flags|=4)}};Iw=function(e,t,r,n){r!==n&&(t.flags|=4)};function rc(e,t){if(!Zt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function tn(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function bx(e,t,r){var n=t.pendingProps;switch(iy(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tn(t),null;case 1:return Tn(t.type)&&vh(),tn(t),null;case 3:return n=t.stateNode,Ks(),Wt(Cn),Wt(nn),hy(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Cd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li!==null&&(fm(Li),Li=null))),nm(e,t),tn(t),null;case 5:dy(t);var i=pl(zc.current);if(r=t.type,e!==null&&t.stateNode!=null)Nw(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(Ce(166));return tn(t),null}if(e=pl(oa.current),Cd(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[ta]=t,n[Fc]=a,e=(t.mode&1)!==0,r){case"dialog":qt("cancel",n),qt("close",n);break;case"iframe":case"object":case"embed":qt("load",n);break;case"video":case"audio":for(i=0;i<fc.length;i++)qt(fc[i],n);break;case"source":qt("error",n);break;case"img":case"image":case"link":qt("error",n),qt("load",n);break;case"details":qt("toggle",n);break;case"input":w3(n,a),qt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},qt("invalid",n);break;case"textarea":E3(n,a),qt("invalid",n)}kv(r,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?n.textContent!==l&&(a.suppressHydrationWarning!==!0&&Pd(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Pd(n.textContent,l,e),i=["children",""+l]):Cc.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&qt("scroll",n)}switch(r){case"input":yd(n),S3(n,a,!0);break;case"textarea":yd(n),O3(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=gh)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=u6(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[ta]=t,e[Fc]=n,Mw(e,t,!1,!1),t.stateNode=e;e:{switch(o=Rv(r,n),r){case"dialog":qt("cancel",e),qt("close",e),i=n;break;case"iframe":case"object":case"embed":qt("load",e),i=n;break;case"video":case"audio":for(i=0;i<fc.length;i++)qt(fc[i],e);i=n;break;case"source":qt("error",e),i=n;break;case"img":case"image":case"link":qt("error",e),qt("load",e),i=n;break;case"details":qt("toggle",e),i=n;break;case"input":w3(e,n),i=xv(e,n),qt("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=nr({},n,{value:void 0}),qt("invalid",e);break;case"textarea":E3(e,n),i=Tv(e,n),qt("invalid",e);break;default:i=n}kv(r,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var u=l[a];a==="style"?d6(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&c6(e,u)):a==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Tc(e,u):typeof u=="number"&&Tc(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Cc.hasOwnProperty(a)?u!=null&&a==="onScroll"&&qt("scroll",e):u!=null&&Gm(e,a,u,o))}switch(r){case"input":yd(e),S3(e,n,!1);break;case"textarea":yd(e),O3(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Ro(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?js(e,!!n.multiple,a,!1):n.defaultValue!=null&&js(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=gh)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return tn(t),null;case 6:if(e&&t.stateNode!=null)Iw(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(Ce(166));if(r=pl(zc.current),pl(oa.current),Cd(t)){if(n=t.stateNode,r=t.memoizedProps,n[ta]=t,(a=n.nodeValue!==r)&&(e=Gn,e!==null))switch(e.tag){case 3:Pd(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Pd(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[ta]=t,t.stateNode=n}return tn(t),null;case 13:if(Wt(tr),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Zt&&Hn!==null&&t.mode&1&&!(t.flags&128))J6(),Ws(),t.flags|=98560,a=!1;else if(a=Cd(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(Ce(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Ce(317));a[ta]=t}else Ws(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;tn(t),a=!1}else Li!==null&&(fm(Li),Li=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||tr.current&1?Cr===0&&(Cr=3):xy())),t.updateQueue!==null&&(t.flags|=4),tn(t),null);case 4:return Ks(),nm(e,t),e===null&&Ic(t.stateNode.containerInfo),tn(t),null;case 10:return sy(t.type._context),tn(t),null;case 17:return Tn(t.type)&&vh(),tn(t),null;case 19:if(Wt(tr),a=t.memoizedState,a===null)return tn(t),null;if(n=(t.flags&128)!==0,o=a.rendering,o===null)if(n)rc(a,!1);else{if(Cr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Eh(e),o!==null){for(t.flags|=128,rc(a,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ut(tr,tr.current&1|2),t.child}e=e.sibling}a.tail!==null&&pr()>Zs&&(t.flags|=128,n=!0,rc(a,!1),t.lanes=4194304)}else{if(!n)if(e=Eh(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),rc(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Zt)return tn(t),null}else 2*pr()-a.renderingStartTime>Zs&&r!==1073741824&&(t.flags|=128,n=!0,rc(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=pr(),t.sibling=null,r=tr.current,Ut(tr,n?r&1|2:r&1),t):(tn(t),null);case 22:case 23:return Oy(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Bn&1073741824&&(tn(t),t.subtreeFlags&6&&(t.flags|=8192)):tn(t),null;case 24:return null;case 25:return null}throw Error(Ce(156,t.tag))}function _x(e,t){switch(iy(t),t.tag){case 1:return Tn(t.type)&&vh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ks(),Wt(Cn),Wt(nn),hy(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return dy(t),null;case 13:if(Wt(tr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ce(340));Ws()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Wt(tr),null;case 4:return Ks(),null;case 10:return sy(t.type._context),null;case 22:case 23:return Oy(),null;case 24:return null;default:return null}}var kd=!1,rn=!1,wx=typeof WeakSet=="function"?WeakSet:Set,$e=null;function Ms(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){sr(e,t,n)}else r.current=null}function im(e,t,r){try{r()}catch(n){sr(e,t,n)}}var h5=!1;function Sx(e,t){if(Uv=dh,e=B6(),ry(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,l=-1,u=-1,f=0,v=0,w=e,b=null;t:for(;;){for(var h;w!==r||i!==0&&w.nodeType!==3||(l=o+i),w!==a||n!==0&&w.nodeType!==3||(u=o+n),w.nodeType===3&&(o+=w.nodeValue.length),(h=w.firstChild)!==null;)b=w,w=h;for(;;){if(w===e)break t;if(b===r&&++f===i&&(l=o),b===a&&++v===n&&(u=o),(h=w.nextSibling)!==null)break;w=b,b=w.parentNode}w=h}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Hv={focusedElem:e,selectionRange:r},dh=!1,$e=t;$e!==null;)if(t=$e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$e=e;else for(;$e!==null;){t=$e;try{var E=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(E!==null){var y=E.memoizedProps,m=E.memoizedState,p=t.stateNode,g=p.getSnapshotBeforeUpdate(t.elementType===t.type?y:ki(t.type,y),m);p.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ce(163))}}catch(_){sr(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,$e=e;break}$e=t.return}return E=h5,h5=!1,E}function _c(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&im(t,r,a)}i=i.next}while(i!==n)}}function ip(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function am(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Dw(e){var t=e.alternate;t!==null&&(e.alternate=null,Dw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ta],delete t[Fc],delete t[Vv],delete t[ix],delete t[ax])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Fw(e){return e.tag===5||e.tag===3||e.tag===4}function p5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function om(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=gh));else if(n!==4&&(e=e.child,e!==null))for(om(e,t,r),e=e.sibling;e!==null;)om(e,t,r),e=e.sibling}function lm(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(lm(e,t,r),e=e.sibling;e!==null;)lm(e,t,r),e=e.sibling}var $r=null,Ri=!1;function uo(e,t,r){for(r=r.child;r!==null;)jw(e,t,r),r=r.sibling}function jw(e,t,r){if(aa&&typeof aa.onCommitFiberUnmount=="function")try{aa.onCommitFiberUnmount(Xh,r)}catch{}switch(r.tag){case 5:rn||Ms(r,t);case 6:var n=$r,i=Ri;$r=null,uo(e,t,r),$r=n,Ri=i,$r!==null&&(Ri?(e=$r,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):$r.removeChild(r.stateNode));break;case 18:$r!==null&&(Ri?(e=$r,r=r.stateNode,e.nodeType===8?$1(e.parentNode,r):e.nodeType===1&&$1(e,r),Lc(e)):$1($r,r.stateNode));break;case 4:n=$r,i=Ri,$r=r.stateNode.containerInfo,Ri=!0,uo(e,t,r),$r=n,Ri=i;break;case 0:case 11:case 14:case 15:if(!rn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&im(r,t,o),i=i.next}while(i!==n)}uo(e,t,r);break;case 1:if(!rn&&(Ms(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){sr(r,t,l)}uo(e,t,r);break;case 21:uo(e,t,r);break;case 22:r.mode&1?(rn=(n=rn)||r.memoizedState!==null,uo(e,t,r),rn=n):uo(e,t,r);break;default:uo(e,t,r)}}function g5(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new wx),t.forEach(function(n){var i=Rx.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Ci(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:$r=l.stateNode,Ri=!1;break e;case 3:$r=l.stateNode.containerInfo,Ri=!0;break e;case 4:$r=l.stateNode.containerInfo,Ri=!0;break e}l=l.return}if($r===null)throw Error(Ce(160));jw(a,o,i),$r=null,Ri=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(f){sr(i,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)zw(t,e),t=t.sibling}function zw(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ci(t,e),Qi(e),n&4){try{_c(3,e,e.return),ip(3,e)}catch(y){sr(e,e.return,y)}try{_c(5,e,e.return)}catch(y){sr(e,e.return,y)}}break;case 1:Ci(t,e),Qi(e),n&512&&r!==null&&Ms(r,r.return);break;case 5:if(Ci(t,e),Qi(e),n&512&&r!==null&&Ms(r,r.return),e.flags&32){var i=e.stateNode;try{Tc(i,"")}catch(y){sr(e,e.return,y)}}if(n&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=r!==null?r.memoizedProps:a,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&l6(i,a),Rv(l,o);var f=Rv(l,a);for(o=0;o<u.length;o+=2){var v=u[o],w=u[o+1];v==="style"?d6(i,w):v==="dangerouslySetInnerHTML"?c6(i,w):v==="children"?Tc(i,w):Gm(i,v,w,f)}switch(l){case"input":Pv(i,a);break;case"textarea":s6(i,a);break;case"select":var b=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var h=a.value;h!=null?js(i,!!a.multiple,h,!1):b!==!!a.multiple&&(a.defaultValue!=null?js(i,!!a.multiple,a.defaultValue,!0):js(i,!!a.multiple,a.multiple?[]:"",!1))}i[Fc]=a}catch(y){sr(e,e.return,y)}}break;case 6:if(Ci(t,e),Qi(e),n&4){if(e.stateNode===null)throw Error(Ce(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(y){sr(e,e.return,y)}}break;case 3:if(Ci(t,e),Qi(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Lc(t.containerInfo)}catch(y){sr(e,e.return,y)}break;case 4:Ci(t,e),Qi(e);break;case 13:Ci(t,e),Qi(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(Sy=pr())),n&4&&g5(e);break;case 22:if(v=r!==null&&r.memoizedState!==null,e.mode&1?(rn=(f=rn)||v,Ci(t,e),rn=f):Ci(t,e),Qi(e),n&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!v&&e.mode&1)for($e=e,v=e.child;v!==null;){for(w=$e=v;$e!==null;){switch(b=$e,h=b.child,b.tag){case 0:case 11:case 14:case 15:_c(4,b,b.return);break;case 1:Ms(b,b.return);var E=b.stateNode;if(typeof E.componentWillUnmount=="function"){n=b,r=b.return;try{t=n,E.props=t.memoizedProps,E.state=t.memoizedState,E.componentWillUnmount()}catch(y){sr(n,r,y)}}break;case 5:Ms(b,b.return);break;case 22:if(b.memoizedState!==null){m5(w);continue}}h!==null?(h.return=b,$e=h):m5(w)}v=v.sibling}e:for(v=null,w=e;;){if(w.tag===5){if(v===null){v=w;try{i=w.stateNode,f?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=w.stateNode,u=w.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=f6("display",o))}catch(y){sr(e,e.return,y)}}}else if(w.tag===6){if(v===null)try{w.stateNode.nodeValue=f?"":w.memoizedProps}catch(y){sr(e,e.return,y)}}else if((w.tag!==22&&w.tag!==23||w.memoizedState===null||w===e)&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===e)break e;for(;w.sibling===null;){if(w.return===null||w.return===e)break e;v===w&&(v=null),w=w.return}v===w&&(v=null),w.sibling.return=w.return,w=w.sibling}}break;case 19:Ci(t,e),Qi(e),n&4&&g5(e);break;case 21:break;default:Ci(t,e),Qi(e)}}function Qi(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Fw(r)){var n=r;break e}r=r.return}throw Error(Ce(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(Tc(i,""),n.flags&=-33);var a=p5(e);lm(e,a,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=p5(e);om(e,l,o);break;default:throw Error(Ce(161))}}catch(u){sr(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ex(e,t,r){$e=e,Bw(e)}function Bw(e,t,r){for(var n=(e.mode&1)!==0;$e!==null;){var i=$e,a=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||kd;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||rn;l=kd;var f=rn;if(kd=o,(rn=u)&&!f)for($e=i;$e!==null;)o=$e,u=o.child,o.tag===22&&o.memoizedState!==null?y5(i):u!==null?(u.return=o,$e=u):y5(i);for(;a!==null;)$e=a,Bw(a),a=a.sibling;$e=i,kd=l,rn=f}v5(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,$e=a):v5(e)}}function v5(e){for(;$e!==null;){var t=$e;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:rn||ip(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!rn)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:ki(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&e5(t,a,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}e5(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var v=f.memoizedState;if(v!==null){var w=v.dehydrated;w!==null&&Lc(w)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Ce(163))}rn||t.flags&512&&am(t)}catch(b){sr(t,t.return,b)}}if(t===e){$e=null;break}if(r=t.sibling,r!==null){r.return=t.return,$e=r;break}$e=t.return}}function m5(e){for(;$e!==null;){var t=$e;if(t===e){$e=null;break}var r=t.sibling;if(r!==null){r.return=t.return,$e=r;break}$e=t.return}}function y5(e){for(;$e!==null;){var t=$e;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{ip(4,t)}catch(u){sr(t,r,u)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(u){sr(t,i,u)}}var a=t.return;try{am(t)}catch(u){sr(t,a,u)}break;case 5:var o=t.return;try{am(t)}catch(u){sr(t,o,u)}}}catch(u){sr(t,t.return,u)}if(t===e){$e=null;break}var l=t.sibling;if(l!==null){l.return=t.return,$e=l;break}$e=t.return}}var Ox=Math.ceil,Ph=Ha.ReactCurrentDispatcher,_y=Ha.ReactCurrentOwner,di=Ha.ReactCurrentBatchConfig,Ot=0,jr=null,_r=null,qr=0,Bn=0,Ns=jo(0),Cr=0,Gc=null,El=0,ap=0,wy=0,wc=null,En=null,Sy=0,Zs=1/0,Ca=null,Ch=!1,sm=null,Po=null,Rd=!1,bo=null,Th=0,Sc=0,um=null,Jd=-1,eh=0;function dn(){return Ot&6?pr():Jd!==-1?Jd:Jd=pr()}function Co(e){return e.mode&1?Ot&2&&qr!==0?qr&-qr:lx.transition!==null?(eh===0&&(eh=O6()),eh):(e=Lt,e!==0||(e=window.event,e=e===void 0?16:R6(e.type)),e):1}function Ni(e,t,r,n){if(50<Sc)throw Sc=0,um=null,Error(Ce(185));rf(e,r,n),(!(Ot&2)||e!==jr)&&(e===jr&&(!(Ot&2)&&(ap|=r),Cr===4&&vo(e,qr)),An(e,n),r===1&&Ot===0&&!(t.mode&1)&&(Zs=pr()+500,tp&&zo()))}function An(e,t){var r=e.callbackNode;lO(e,t);var n=fh(e,e===jr?qr:0);if(n===0)r!==null&&C3(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&C3(r),t===1)e.tag===0?ox(b5.bind(null,e)):X6(b5.bind(null,e)),rx(function(){!(Ot&6)&&zo()}),r=null;else{switch(x6(n)){case 1:r=Ym;break;case 4:r=S6;break;case 16:r=ch;break;case 536870912:r=E6;break;default:r=ch}r=Yw(r,Uw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Uw(e,t){if(Jd=-1,eh=0,Ot&6)throw Error(Ce(327));var r=e.callbackNode;if(Gs()&&e.callbackNode!==r)return null;var n=fh(e,e===jr?qr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Ah(e,n);else{t=n;var i=Ot;Ot|=2;var a=Gw();(jr!==e||qr!==t)&&(Ca=null,Zs=pr()+500,vl(e,t));do try{Cx();break}catch(l){Hw(e,l)}while(!0);ly(),Ph.current=a,Ot=i,_r!==null?t=0:(jr=null,qr=0,t=Cr)}if(t!==0){if(t===2&&(i=Dv(e),i!==0&&(n=i,t=cm(e,i))),t===1)throw r=Gc,vl(e,0),vo(e,n),An(e,pr()),r;if(t===6)vo(e,n);else{if(i=e.current.alternate,!(n&30)&&!xx(i)&&(t=Ah(e,n),t===2&&(a=Dv(e),a!==0&&(n=a,t=cm(e,a))),t===1))throw r=Gc,vl(e,0),vo(e,n),An(e,pr()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(Ce(345));case 2:fl(e,En,Ca);break;case 3:if(vo(e,n),(n&130023424)===n&&(t=Sy+500-pr(),10<t)){if(fh(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){dn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=$v(fl.bind(null,e,En,Ca),t);break}fl(e,En,Ca);break;case 4:if(vo(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-Mi(n);a=1<<o,o=t[o],o>i&&(i=o),n&=~a}if(n=i,n=pr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Ox(n/1960))-n,10<n){e.timeoutHandle=$v(fl.bind(null,e,En,Ca),n);break}fl(e,En,Ca);break;case 5:fl(e,En,Ca);break;default:throw Error(Ce(329))}}}return An(e,pr()),e.callbackNode===r?Uw.bind(null,e):null}function cm(e,t){var r=wc;return e.current.memoizedState.isDehydrated&&(vl(e,t).flags|=256),e=Ah(e,t),e!==2&&(t=En,En=r,t!==null&&fm(t)),e}function fm(e){En===null?En=e:En.push.apply(En,e)}function xx(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!zi(a(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vo(e,t){for(t&=~wy,t&=~ap,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Mi(t),n=1<<r;e[r]=-1,t&=~n}}function b5(e){if(Ot&6)throw Error(Ce(327));Gs();var t=fh(e,0);if(!(t&1))return An(e,pr()),null;var r=Ah(e,t);if(e.tag!==0&&r===2){var n=Dv(e);n!==0&&(t=n,r=cm(e,n))}if(r===1)throw r=Gc,vl(e,0),vo(e,t),An(e,pr()),r;if(r===6)throw Error(Ce(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,fl(e,En,Ca),An(e,pr()),null}function Ey(e,t){var r=Ot;Ot|=1;try{return e(t)}finally{Ot=r,Ot===0&&(Zs=pr()+500,tp&&zo())}}function Ol(e){bo!==null&&bo.tag===0&&!(Ot&6)&&Gs();var t=Ot;Ot|=1;var r=di.transition,n=Lt;try{if(di.transition=null,Lt=1,e)return e()}finally{Lt=n,di.transition=r,Ot=t,!(Ot&6)&&zo()}}function Oy(){Bn=Ns.current,Wt(Ns)}function vl(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,tx(r)),_r!==null)for(r=_r.return;r!==null;){var n=r;switch(iy(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&vh();break;case 3:Ks(),Wt(Cn),Wt(nn),hy();break;case 5:dy(n);break;case 4:Ks();break;case 13:Wt(tr);break;case 19:Wt(tr);break;case 10:sy(n.type._context);break;case 22:case 23:Oy()}r=r.return}if(jr=e,_r=e=To(e.current,null),qr=Bn=t,Cr=0,Gc=null,wy=ap=El=0,En=wc=null,hl!==null){for(t=0;t<hl.length;t++)if(r=hl[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,a=r.pending;if(a!==null){var o=a.next;a.next=i,n.next=o}r.pending=n}hl=null}return e}function Hw(e,t){do{var r=_r;try{if(ly(),Xd.current=xh,Oh){for(var n=rr.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Oh=!1}if(Sl=0,Fr=xr=rr=null,bc=!1,Bc=0,_y.current=null,r===null||r.return===null){Cr=1,Gc=t,_r=null;break}e:{var a=e,o=r.return,l=r,u=t;if(t=qr,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,v=l,w=v.tag;if(!(v.mode&1)&&(w===0||w===11||w===15)){var b=v.alternate;b?(v.updateQueue=b.updateQueue,v.memoizedState=b.memoizedState,v.lanes=b.lanes):(v.updateQueue=null,v.memoizedState=null)}var h=o5(o);if(h!==null){h.flags&=-257,l5(h,o,l,a,t),h.mode&1&&a5(a,f,t),t=h,u=f;var E=t.updateQueue;if(E===null){var y=new Set;y.add(u),t.updateQueue=y}else E.add(u);break e}else{if(!(t&1)){a5(a,f,t),xy();break e}u=Error(Ce(426))}}else if(Zt&&l.mode&1){var m=o5(o);if(m!==null){!(m.flags&65536)&&(m.flags|=256),l5(m,o,l,a,t),ay(Xs(u,l));break e}}a=u=Xs(u,l),Cr!==4&&(Cr=2),wc===null?wc=[a]:wc.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var p=xw(a,u,t);J3(a,p);break e;case 1:l=u;var g=a.type,d=a.stateNode;if(!(a.flags&128)&&(typeof g.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Po===null||!Po.has(d)))){a.flags|=65536,t&=-t,a.lanes|=t;var _=Pw(a,l,t);J3(a,_);break e}}a=a.return}while(a!==null)}Vw(r)}catch(O){t=O,_r===r&&r!==null&&(_r=r=r.return);continue}break}while(!0)}function Gw(){var e=Ph.current;return Ph.current=xh,e===null?xh:e}function xy(){(Cr===0||Cr===3||Cr===2)&&(Cr=4),jr===null||!(El&268435455)&&!(ap&268435455)||vo(jr,qr)}function Ah(e,t){var r=Ot;Ot|=2;var n=Gw();(jr!==e||qr!==t)&&(Ca=null,vl(e,t));do try{Px();break}catch(i){Hw(e,i)}while(!0);if(ly(),Ot=r,Ph.current=n,_r!==null)throw Error(Ce(261));return jr=null,qr=0,Cr}function Px(){for(;_r!==null;)$w(_r)}function Cx(){for(;_r!==null&&!QE();)$w(_r)}function $w(e){var t=Ww(e.alternate,e,Bn);e.memoizedProps=e.pendingProps,t===null?Vw(e):_r=t,_y.current=null}function Vw(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=_x(r,t),r!==null){r.flags&=32767,_r=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Cr=6,_r=null;return}}else if(r=bx(r,t,Bn),r!==null){_r=r;return}if(t=t.sibling,t!==null){_r=t;return}_r=t=e}while(t!==null);Cr===0&&(Cr=5)}function fl(e,t,r){var n=Lt,i=di.transition;try{di.transition=null,Lt=1,Tx(e,t,r,n)}finally{di.transition=i,Lt=n}return null}function Tx(e,t,r,n){do Gs();while(bo!==null);if(Ot&6)throw Error(Ce(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Ce(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(sO(e,a),e===jr&&(_r=jr=null,qr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Rd||(Rd=!0,Yw(ch,function(){return Gs(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=di.transition,di.transition=null;var o=Lt;Lt=1;var l=Ot;Ot|=4,_y.current=null,Sx(e,r),zw(r,e),YO(Hv),dh=!!Uv,Hv=Uv=null,e.current=r,Ex(r),JE(),Ot=l,Lt=o,di.transition=a}else e.current=r;if(Rd&&(Rd=!1,bo=e,Th=i),a=e.pendingLanes,a===0&&(Po=null),rO(r.stateNode),An(e,pr()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Ch)throw Ch=!1,e=sm,sm=null,e;return Th&1&&e.tag!==0&&Gs(),a=e.pendingLanes,a&1?e===um?Sc++:(Sc=0,um=e):Sc=0,zo(),null}function Gs(){if(bo!==null){var e=x6(Th),t=di.transition,r=Lt;try{if(di.transition=null,Lt=16>e?16:e,bo===null)var n=!1;else{if(e=bo,bo=null,Th=0,Ot&6)throw Error(Ce(331));var i=Ot;for(Ot|=4,$e=e.current;$e!==null;){var a=$e,o=a.child;if($e.flags&16){var l=a.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for($e=f;$e!==null;){var v=$e;switch(v.tag){case 0:case 11:case 15:_c(8,v,a)}var w=v.child;if(w!==null)w.return=v,$e=w;else for(;$e!==null;){v=$e;var b=v.sibling,h=v.return;if(Dw(v),v===f){$e=null;break}if(b!==null){b.return=h,$e=b;break}$e=h}}}var E=a.alternate;if(E!==null){var y=E.child;if(y!==null){E.child=null;do{var m=y.sibling;y.sibling=null,y=m}while(y!==null)}}$e=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,$e=o;else e:for(;$e!==null;){if(a=$e,a.flags&2048)switch(a.tag){case 0:case 11:case 15:_c(9,a,a.return)}var p=a.sibling;if(p!==null){p.return=a.return,$e=p;break e}$e=a.return}}var g=e.current;for($e=g;$e!==null;){o=$e;var d=o.child;if(o.subtreeFlags&2064&&d!==null)d.return=o,$e=d;else e:for(o=g;$e!==null;){if(l=$e,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ip(9,l)}}catch(O){sr(l,l.return,O)}if(l===o){$e=null;break e}var _=l.sibling;if(_!==null){_.return=l.return,$e=_;break e}$e=l.return}}if(Ot=i,zo(),aa&&typeof aa.onPostCommitFiberRoot=="function")try{aa.onPostCommitFiberRoot(Xh,e)}catch{}n=!0}return n}finally{Lt=r,di.transition=t}}return!1}function _5(e,t,r){t=Xs(r,t),t=xw(e,t,1),e=xo(e,t,1),t=dn(),e!==null&&(rf(e,1,t),An(e,t))}function sr(e,t,r){if(e.tag===3)_5(e,e,r);else for(;t!==null;){if(t.tag===3){_5(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Po===null||!Po.has(n))){e=Xs(r,e),e=Pw(t,e,1),t=xo(t,e,1),e=dn(),t!==null&&(rf(t,1,e),An(t,e));break}}t=t.return}}function Ax(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=dn(),e.pingedLanes|=e.suspendedLanes&r,jr===e&&(qr&r)===r&&(Cr===4||Cr===3&&(qr&130023424)===qr&&500>pr()-Sy?vl(e,0):wy|=r),An(e,t)}function qw(e,t){t===0&&(e.mode&1?(t=wd,wd<<=1,!(wd&130023424)&&(wd=4194304)):t=1);var r=dn();e=ja(e,t),e!==null&&(rf(e,t,r),An(e,r))}function kx(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),qw(e,r)}function Rx(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Ce(314))}n!==null&&n.delete(t),qw(e,r)}var Ww;Ww=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Cn.current)On=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return On=!1,yx(e,t,r);On=!!(e.flags&131072)}else On=!1,Zt&&t.flags&1048576&&Z6(t,bh,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Qd(e,t),e=t.pendingProps;var i=qs(t,nn.current);Hs(t,r),i=gy(null,t,n,e,i,r);var a=vy();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tn(n)?(a=!0,mh(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,cy(t),i.updater=np,t.stateNode=i,i._reactInternals=t,Zv(t,n,e,r),t=em(null,t,n,!0,a,r)):(t.tag=0,Zt&&a&&ny(t),fn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Qd(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Mx(n),e=ki(n,e),i){case 0:t=Jv(null,t,n,e,r);break e;case 1:t=c5(null,t,n,e,r);break e;case 11:t=s5(null,t,n,e,r);break e;case 14:t=u5(null,t,n,ki(n.type,e),r);break e}throw Error(Ce(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ki(n,i),Jv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ki(n,i),c5(e,t,n,i,r);case 3:e:{if(kw(t),e===null)throw Error(Ce(387));n=t.pendingProps,a=t.memoizedState,i=a.element,nw(e,t),Sh(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Xs(Error(Ce(423)),t),t=f5(e,t,n,r,i);break e}else if(n!==i){i=Xs(Error(Ce(424)),t),t=f5(e,t,n,r,i);break e}else for(Hn=Oo(t.stateNode.containerInfo.firstChild),Gn=t,Zt=!0,Li=null,r=tw(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ws(),n===i){t=za(e,t,r);break e}fn(e,t,n,r)}t=t.child}return t;case 5:return iw(t),e===null&&Yv(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Gv(n,i)?o=null:a!==null&&Gv(n,a)&&(t.flags|=32),Aw(e,t),fn(e,t,o,r),t.child;case 6:return e===null&&Yv(t),null;case 13:return Rw(e,t,r);case 4:return fy(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ys(t,null,n,r):fn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ki(n,i),s5(e,t,n,i,r);case 7:return fn(e,t,t.pendingProps,r),t.child;case 8:return fn(e,t,t.pendingProps.children,r),t.child;case 12:return fn(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Ut(_h,n._currentValue),n._currentValue=o,a!==null)if(zi(a.value,o)){if(a.children===i.children&&!Cn.current){t=za(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var u=l.firstContext;u!==null;){if(u.context===n){if(a.tag===1){u=Ra(-1,r&-r),u.tag=2;var f=a.updateQueue;if(f!==null){f=f.shared;var v=f.pending;v===null?u.next=u:(u.next=v.next,v.next=u),f.pending=u}}a.lanes|=r,u=a.alternate,u!==null&&(u.lanes|=r),Kv(a.return,r,t),l.lanes|=r;break}u=u.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Ce(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Kv(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}fn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Hs(t,r),i=pi(i),n=n(i),t.flags|=1,fn(e,t,n,r),t.child;case 14:return n=t.type,i=ki(n,t.pendingProps),i=ki(n.type,i),u5(e,t,n,i,r);case 15:return Cw(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ki(n,i),Qd(e,t),t.tag=1,Tn(n)?(e=!0,mh(t)):e=!1,Hs(t,r),Ow(t,n,i),Zv(t,n,i,r),em(null,t,n,!0,e,r);case 19:return Lw(e,t,r);case 22:return Tw(e,t,r)}throw Error(Ce(156,t.tag))};function Yw(e,t){return w6(e,t)}function Lx(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fi(e,t,r,n){return new Lx(e,t,r,n)}function Py(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mx(e){if(typeof e=="function")return Py(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Vm)return 11;if(e===qm)return 14}return 2}function To(e,t){var r=e.alternate;return r===null?(r=fi(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function th(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")Py(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Os:return ml(r.children,i,a,t);case $m:o=8,i|=8;break;case wv:return e=fi(12,r,t,i|2),e.elementType=wv,e.lanes=a,e;case Sv:return e=fi(13,r,t,i),e.elementType=Sv,e.lanes=a,e;case Ev:return e=fi(19,r,t,i),e.elementType=Ev,e.lanes=a,e;case i6:return op(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case r6:o=10;break e;case n6:o=9;break e;case Vm:o=11;break e;case qm:o=14;break e;case ho:o=16,n=null;break e}throw Error(Ce(130,e==null?e:typeof e,""))}return t=fi(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function ml(e,t,r,n){return e=fi(7,e,n,t),e.lanes=r,e}function op(e,t,r,n){return e=fi(22,e,n,t),e.elementType=i6,e.lanes=r,e.stateNode={isHidden:!1},e}function Q1(e,t,r){return e=fi(6,e,null,t),e.lanes=r,e}function J1(e,t,r){return t=fi(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Nx(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=M1(0),this.expirationTimes=M1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=M1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Cy(e,t,r,n,i,a,o,l,u){return e=new Nx(e,t,r,l,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=fi(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},cy(a),e}function Ix(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Es,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Kw(e){if(!e)return Lo;e=e._reactInternals;e:{if(Ll(e)!==e||e.tag!==1)throw Error(Ce(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Tn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Ce(171))}if(e.tag===1){var r=e.type;if(Tn(r))return K6(e,r,t)}return t}function Xw(e,t,r,n,i,a,o,l,u){return e=Cy(r,n,!0,e,i,a,o,l,u),e.context=Kw(null),r=e.current,n=dn(),i=Co(r),a=Ra(n,i),a.callback=t??null,xo(r,a,i),e.current.lanes=i,rf(e,i,n),An(e,n),e}function lp(e,t,r,n){var i=t.current,a=dn(),o=Co(i);return r=Kw(r),t.context===null?t.context=r:t.pendingContext=r,t=Ra(a,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=xo(i,t,o),e!==null&&(Ni(e,i,o,a),Kd(e,i,o)),o}function kh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function w5(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ty(e,t){w5(e,t),(e=e.alternate)&&w5(e,t)}function Dx(){return null}var Zw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ay(e){this._internalRoot=e}sp.prototype.render=Ay.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Ce(409));lp(e,t,null,null)};sp.prototype.unmount=Ay.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ol(function(){lp(null,e,null,null)}),t[Fa]=null}};function sp(e){this._internalRoot=e}sp.prototype.unstable_scheduleHydration=function(e){if(e){var t=T6();e={blockedOn:null,target:e,priority:t};for(var r=0;r<go.length&&t!==0&&t<go[r].priority;r++);go.splice(r,0,e),r===0&&k6(e)}};function ky(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function up(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function S5(){}function Fx(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var f=kh(o);a.call(f)}}var o=Xw(t,n,e,0,null,!1,!1,"",S5);return e._reactRootContainer=o,e[Fa]=o.current,Ic(e.nodeType===8?e.parentNode:e),Ol(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var f=kh(u);l.call(f)}}var u=Cy(e,0,!1,null,null,!1,!1,"",S5);return e._reactRootContainer=u,e[Fa]=u.current,Ic(e.nodeType===8?e.parentNode:e),Ol(function(){lp(t,u,r,n)}),u}function cp(e,t,r,n,i){var a=r._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;i=function(){var u=kh(o);l.call(u)}}lp(t,o,e,i)}else o=Fx(r,t,e,i,n);return kh(o)}P6=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=cc(t.pendingLanes);r!==0&&(Km(t,r|1),An(t,pr()),!(Ot&6)&&(Zs=pr()+500,zo()))}break;case 13:Ol(function(){var n=ja(e,1);if(n!==null){var i=dn();Ni(n,e,1,i)}}),Ty(e,1)}};Xm=function(e){if(e.tag===13){var t=ja(e,134217728);if(t!==null){var r=dn();Ni(t,e,134217728,r)}Ty(e,134217728)}};C6=function(e){if(e.tag===13){var t=Co(e),r=ja(e,t);if(r!==null){var n=dn();Ni(r,e,t,n)}Ty(e,t)}};T6=function(){return Lt};A6=function(e,t){var r=Lt;try{return Lt=e,t()}finally{Lt=r}};Mv=function(e,t,r){switch(t){case"input":if(Pv(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=ep(n);if(!i)throw Error(Ce(90));o6(n),Pv(n,i)}}}break;case"textarea":s6(e,r);break;case"select":t=r.value,t!=null&&js(e,!!r.multiple,t,!1)}};g6=Ey;v6=Ol;var jx={usingClientEntryPoint:!1,Events:[af,Ts,ep,h6,p6,Ey]},nc={findFiberByHostInstance:dl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zx={bundleType:nc.bundleType,version:nc.version,rendererPackageName:nc.rendererPackageName,rendererConfig:nc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ha.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=b6(e),e===null?null:e.stateNode},findFiberByHostInstance:nc.findFiberByHostInstance||Dx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ld=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ld.isDisabled&&Ld.supportsFiber)try{Xh=Ld.inject(zx),aa=Ld}catch{}}qn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jx;qn.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ky(t))throw Error(Ce(200));return Ix(e,t,null,r)};qn.createRoot=function(e,t){if(!ky(e))throw Error(Ce(299));var r=!1,n="",i=Zw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Cy(e,1,!1,null,null,r,!1,n,i),e[Fa]=t.current,Ic(e.nodeType===8?e.parentNode:e),new Ay(t)};qn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Ce(188)):(e=Object.keys(e).join(","),Error(Ce(268,e)));return e=b6(t),e=e===null?null:e.stateNode,e};qn.flushSync=function(e){return Ol(e)};qn.hydrate=function(e,t,r){if(!up(t))throw Error(Ce(200));return cp(null,e,t,!0,r)};qn.hydrateRoot=function(e,t,r){if(!ky(e))throw Error(Ce(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",o=Zw;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=Xw(t,null,e,1,r??null,i,!1,a,o),e[Fa]=t.current,Ic(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new sp(t)};qn.render=function(e,t,r){if(!up(t))throw Error(Ce(200));return cp(null,e,t,!1,r)};qn.unmountComponentAtNode=function(e){if(!up(e))throw Error(Ce(40));return e._reactRootContainer?(Ol(function(){cp(null,null,e,!1,function(){e._reactRootContainer=null,e[Fa]=null})}),!0):!1};qn.unstable_batchedUpdates=Ey;qn.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!up(r))throw Error(Ce(200));if(e==null||e._reactInternals===void 0)throw Error(Ce(38));return cp(e,t,r,!1,n)};qn.version="18.3.1-next-f1338f8080-20240426";function Qw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Qw)}catch(e){console.error(e)}}Qw(),Q_.exports=qn;var Jw=Q_.exports,E5=Jw;oh.createRoot=E5.createRoot,oh.hydrateRoot=E5.hydrateRoot;var e8={};function ot(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(r.length?" "+r.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var Bx={};function Ry(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Bx}var t8=Object.assign,Rh=Object.getOwnPropertyDescriptor,la=Object.defineProperty,lf=Object.prototype,dm=[];Object.freeze(dm);var Ly={};Object.freeze(Ly);var Ux=typeof Proxy<"u",Hx=Object.toString();function r8(){Ux||ot("Proxy not available")}function n8(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var Is=function(){};function Vn(e){return typeof e=="function"}function xl(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function fp(e){return e!==null&&typeof e=="object"}function Ba(e){if(!fp(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===Hx}function i8(e){var t=e==null?void 0:e.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function sf(e,t,r){la(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function a8(e,t,r){la(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function Bo(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return fp(n)&&n[r]===!0}}function mu(e){return e instanceof Map}function uf(e){return e instanceof Set}var o8=typeof Object.getOwnPropertySymbols<"u";function Gx(e){var t=Object.keys(e);if(!o8)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return lf.propertyIsEnumerable.call(e,n)})):t}var Qs=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:o8?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function l8(e){return e===null?null:typeof e=="object"?""+e:e}function La(e,t){return lf.hasOwnProperty.call(e,t)}var $x=Object.getOwnPropertyDescriptors||function(t){var r={};return Qs(t).forEach(function(n){r[n]=Rh(t,n)}),r};function Vx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yx(n.key),n)}}function My(e,t,r){return t&&Vx(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mo(){return Mo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mo.apply(this,arguments)}function s8(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,hm(e,t)}function hm(e,t){return hm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hm(e,t)}function eg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qx(e,t){if(e){if(typeof e=="string")return O5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O5(e,t)}}function O5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ds(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=qx(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wx(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Yx(e){var t=Wx(e,"string");return typeof t=="symbol"?t:String(t)}var ia=Symbol("mobx-stored-annotations");function Ii(e){function t(r,n){if(cf(n))return e.decorate_20223_(r,n);yu(r,n,e)}return Object.assign(t,e)}function yu(e,t,r){La(e,ia)||sf(e,ia,Mo({},e[ia])),nP(r)||(e[ia][t]=r)}function Kx(e){return La(e,ia)||sf(e,ia,Mo({},e[ia])),e[ia]}function cf(e){return typeof e=="object"&&typeof e.kind=="string"}var Xe=Symbol("mobx administration"),ff=function(){function e(r){r===void 0&&(r="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Tt.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.reportObserved=function(){return A8(this)},t.reportChanged=function(){xn(),k8(this),Pn()},t.toString=function(){return this.name_},e}(),Ny=Bo("Atom",ff);function $c(e,t,r){t===void 0&&(t=Is),r===void 0&&(r=Is);var n=new ff(e);return t!==Is&&z8(n,t),r!==Is&&By(n,r),n}function Xx(e,t){return e===t}function Zx(e,t){return Xy(e,t)}function Qx(e,t){return Xy(e,t,1)}function Jx(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Pl={identity:Xx,structural:Zx,default:Jx,shallow:Qx};function Cl(e,t,r){return bp(e)?e:Array.isArray(e)?Ft.array(e,{name:r}):Ba(e)?Ft.object(e,void 0,{name:r}):mu(e)?Ft.map(e,{name:r}):uf(e)?Ft.set(e,{name:r}):typeof e=="function"&&!hf(e)&&!nu(e)?i8(e)?Al(e):tu(r,e):e}function eP(e,t,r){if(e==null||zr(e)||vn(e)||Yr(e)||hn(e))return e;if(Array.isArray(e))return Ft.array(e,{name:r,deep:!1});if(Ba(e))return Ft.object(e,void 0,{name:r,deep:!1});if(mu(e))return Ft.map(e,{name:r,deep:!1});if(uf(e))return Ft.set(e,{name:r,deep:!1})}function dp(e){return e}function tP(e,t){return Xy(e,t)?t:e}var u8="override",rP=Ii({annotationType_:u8,make_:iP,extend_:aP,decorate_20223_:oP});function nP(e){return e.annotationType_===u8}function iP(e,t){return 0}function aP(e,t,r,n){ot("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function oP(e,t){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function df(e,t){return{annotationType_:e,options_:t,make_:lP,extend_:sP,decorate_20223_:uP}}function lP(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(hf(r.value))return 1;var a=c8(e,this,t,r,!1);return la(n,t,a),2}function sP(e,t,r,n){var i=c8(e,this,t,r);return e.defineProperty_(t,i,n)}function uP(e,t){var r=t.kind,n=t.name,i=t.addInitializer,a=this,o=function(f){var v,w,b,h;return No((v=(w=a.options_)==null?void 0:w.name)!=null?v:n.toString(),f,(b=(h=a.options_)==null?void 0:h.autoAction)!=null?b:!1)};if(r=="field"){i(function(){yu(this,n,a)});return}if(r=="method"){var l;return hf(e)||(e=o(e)),(l=this.options_)!=null&&l.bound&&i(function(){var u=this,f=u[n].bind(u);f.isMobxAction=!0,u[n]=f}),e}ot("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
34
+ '`+a.annotationType_+"' can only be used on properties with a function value."))}function cP(e,t,r,n){t.annotationType_,n.value}function c8(e,t,r,n,i){var a,o,l,u,f,v,w;i===void 0&&(i=Me.safeDescriptors),cP(e,t,r,n);var b=n.value;if((a=t.options_)!=null&&a.bound){var h;b=b.bind((h=e.proxy_)!=null?h:e.target_)}return{value:No((o=(l=t.options_)==null?void 0:l.name)!=null?o:r.toString(),b,(u=(f=t.options_)==null?void 0:f.autoAction)!=null?u:!1,(v=t.options_)!=null&&v.bound?(w=e.proxy_)!=null?w:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function f8(e,t){return{annotationType_:e,options_:t,make_:fP,extend_:dP,decorate_20223_:hP}}function fP(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!La(e.target_,t)||!nu(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(nu(r.value))return 1;var a=d8(e,this,t,r,!1,!1);return la(n,t,a),2}function dP(e,t,r,n){var i,a=d8(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,n)}function hP(e,t){var r,n=t.name,i=t.addInitializer;return nu(e)||(e=Al(e)),(r=this.options_)!=null&&r.bound&&i(function(){var a=this,o=a[n].bind(a);o.isMobXFlow=!0,a[n]=o}),e}function pP(e,t,r,n){t.annotationType_,n.value}function d8(e,t,r,n,i,a){a===void 0&&(a=Me.safeDescriptors),pP(e,t,r,n);var o=n.value;if(nu(o)||(o=Al(o)),i){var l;o=o.bind((l=e.proxy_)!=null?l:e.target_),o.isMobXFlow=!0}return{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function Iy(e,t){return{annotationType_:e,options_:t,make_:gP,extend_:vP,decorate_20223_:mP}}function gP(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function vP(e,t,r,n){return yP(e,this,t,r),e.defineComputedProperty_(t,Mo({},this.options_,{get:r.get,set:r.set}),n)}function mP(e,t){var r=this,n=t.name,i=t.addInitializer;return i(function(){var a=Il(this)[Xe],o=Mo({},r.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new Js(o))}),function(){return this[Xe].getObservablePropValue_(n)}}function yP(e,t,r,n){t.annotationType_,n.get}function hp(e,t){return{annotationType_:e,options_:t,make_:bP,extend_:_P,decorate_20223_:wP}}function bP(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function _P(e,t,r,n){var i,a;return SP(e,this),e.defineObservableProperty_(t,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:Cl,n)}function wP(e,t){var r=this,n=t.kind,i=t.name,a=new WeakSet;function o(l,u){var f,v,w=Il(l)[Xe],b=new Ao(u,(f=(v=r.options_)==null?void 0:v.enhancer)!=null?f:Cl,"ObservableObject."+i.toString(),!1);w.values_.set(i,b),a.add(l)}if(n=="accessor")return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[Xe].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[Xe].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function SP(e,t,r,n){t.annotationType_}var EP="true",OP=h8();function h8(e){return{annotationType_:EP,options_:e,make_:xP,extend_:PP,decorate_20223_:CP}}function xP(e,t,r,n){var i,a;if(r.get)return Ml.make_(e,t,r,n);if(r.set){var o=No(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:Me.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(la(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var l;if(i8(r.value)){var u,f=(u=this.options_)!=null&&u.autoBind?Al.bound:Al;return f.make_(e,t,r,n)}var v=(l=this.options_)!=null&&l.autoBind?tu.bound:tu;return v.make_(e,t,r,n)}var w=((i=this.options_)==null?void 0:i.deep)===!1?Ft.ref:Ft;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var b;r.value=r.value.bind((b=e.proxy_)!=null?b:e.target_)}return w.make_(e,t,r,n)}function PP(e,t,r,n){var i,a;if(r.get)return Ml.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:Me.safeDescriptors?e.isPlainObject_:!0,set:No(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=e.proxy_)!=null?o:e.target_)}var l=((a=this.options_)==null?void 0:a.deep)===!1?Ft.ref:Ft;return l.extend_(e,t,r,n)}function CP(e,t){ot("'"+this.annotationType_+"' cannot be used as a decorator")}var TP="observable",AP="observable.ref",kP="observable.shallow",RP="observable.struct",p8={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(p8);function Md(e){return e||p8}var pm=hp(TP),LP=hp(AP,{enhancer:dp}),MP=hp(kP,{enhancer:eP}),NP=hp(RP,{enhancer:tP}),g8=Ii(pm);function Nd(e){return e.deep===!0?Cl:e.deep===!1?dp:DP(e.defaultDecorator)}function IP(e){var t;return e?(t=e.defaultDecorator)!=null?t:h8(e):void 0}function DP(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:Cl}function v8(e,t,r){if(cf(t))return pm.decorate_20223_(e,t);if(xl(t)){yu(e,t,pm);return}return bp(e)?e:Ba(e)?Ft.object(e,t,r):Array.isArray(e)?Ft.array(e,t):mu(e)?Ft.map(e,t):uf(e)?Ft.set(e,t):typeof e=="object"&&e!==null?e:Ft.box(e,t)}t8(v8,g8);var FP={box:function(t,r){var n=Md(r);return new Ao(t,Nd(n),n.name,!0,n.equals)},array:function(t,r){var n=Md(r);return(Me.useProxies===!1||n.proxy===!1?GC:MC)(t,Nd(n),n.name)},map:function(t,r){var n=Md(r);return new wp(t,Nd(n),n.name)},set:function(t,r){var n=Md(r);return new Yy(t,Nd(n),n.name)},object:function(t,r,n){return Uo(function(){return Uy(Me.useProxies===!1||(n==null?void 0:n.proxy)===!1?Il({},n):AC({},n),t,r)})},ref:Ii(LP),shallow:Ii(MP),deep:g8,struct:Ii(NP)},Ft=t8(v8,FP),m8="computed",jP="computed.struct",gm=Iy(m8),zP=Iy(jP,{equals:Pl.structural}),Ml=function(t,r){if(cf(r))return gm.decorate_20223_(t,r);if(xl(r))return yu(t,r,gm);if(Ba(t))return Ii(Iy(m8,t));var n=Ba(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new Js(n)};Object.assign(Ml,gm);Ml.struct=Ii(zP);var x5,P5,Lh=0,BP=1,UP=(x5=(P5=Rh(function(){},"name"))==null?void 0:P5.configurable)!=null?x5:!1,C5={value:"action",configurable:!0,writable:!1,enumerable:!1};function No(e,t,r,n){r===void 0&&(r=!1);function i(){return y8(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},UP&&(C5.value=e,la(i,"name",C5)),i}function y8(e,t,r,n,i){var a=b8(e,t);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{_8(a)}}function b8(e,t,r,n){var i=!1,a=0,o=Me.trackingDerivation,l=!t||!o;xn();var u=Me.allowStateChanges;l&&(Nl(),u=pp(!0));var f=vp(!0),v={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:f,notifySpy_:i,startTime_:a,actionId_:BP++,parentActionId_:Lh};return Lh=v.actionId_,v}function _8(e){Lh!==e.actionId_&&ot(30),Lh=e.parentActionId_,e.error_!==void 0&&(Me.suppressReactionErrors=!0),gp(e.prevAllowStateChanges_),$s(e.prevAllowStateReads_),Pn(),e.runAsAction_&&Ma(e.prevDerivation_),Me.suppressReactionErrors=!1}function Dy(e,t){var r=pp(e);try{return t()}finally{gp(r)}}function pp(e){var t=Me.allowStateChanges;return Me.allowStateChanges=e,t}function gp(e){Me.allowStateChanges=e}var w8;w8=Symbol.toPrimitive;var Ao=function(e){s8(t,e);function t(n,i,a,o,l){var u;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=Pl.default),u=e.call(this,a)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=a,u.equals=l,u.value_=i(n,void 0,a),u}var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==Me.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(ui(this)){var a=ci(this,{object:this,type:sa,newValue:i});if(!a)return Me.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Me.UNCHANGED:i},r.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),Di(this)&&Fi(this,{type:sa,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return pf(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:sa,newValue:this.value_,oldValue:void 0}),gf(this,i)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return l8(this.get())},r[w8]=function(){return this.valueOf()},t}(ff),Fy=Bo("ObservableValue",Ao),S8;S8=Symbol.toPrimitive;var Js=function(){function e(r){this.dependenciesState_=Tt.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Tt.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Nh(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Mh.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,r.get||ot(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=No("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?Pl.structural:Pl.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){ZP(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing_&&ot(32,this.name_,this.derivation),Me.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)vm(this)&&(this.warnAboutUntrackedRead_(),xn(),this.value_=this.computeValue_(!1),Pn());else if(A8(this),vm(this)){var n=Me.trackingContext;this.keepAlive_&&!n&&(Me.trackingContext=this),this.trackAndCompute()&&XP(this),Me.trackingContext=n}var i=this.value_;if(rh(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter_&&ot(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter_=!1}}else ot(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===Tt.NOT_TRACKING_,a=this.computeValue_(!0),o=i||rh(n)||rh(a)||!this.equals_(n,a);return o&&(this.value_=a),o},t.computeValue_=function(n){this.isComputing_=!0;var i=pp(!1),a;if(n)a=E8(this,this.derivation,this.scope_);else if(Me.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new Nh(o)}return gp(i),this.isComputing_=!1,a},t.suspend_=function(){this.keepAlive_||(mm(this),this.value_=void 0)},t.observe_=function(n,i){var a=this,o=!0,l=void 0;return zy(function(){var u=a.get();if(!o||i){var f=Nl();n({observableKind:"computed",debugObjectName:a.name_,type:sa,object:a,newValue:u,oldValue:l}),Ma(f)}o=!1,l=u})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return l8(this.get())},t[S8]=function(){return this.valueOf()},e}(),Tl=Bo("ComputedValue",Js),Tt;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(Tt||(Tt={}));var Mh;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(Mh||(Mh={}));var Nh=function(t){this.cause=void 0,this.cause=t};function rh(e){return e instanceof Nh}function vm(e){switch(e.dependenciesState_){case Tt.UP_TO_DATE_:return!1;case Tt.NOT_TRACKING_:case Tt.STALE_:return!0;case Tt.POSSIBLY_STALE_:{for(var t=vp(!0),r=Nl(),n=e.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if(Tl(o)){if(Me.disableErrorBoundaries)o.get();else try{o.get()}catch{return Ma(r),$s(t),!0}if(e.dependenciesState_===Tt.STALE_)return Ma(r),$s(t),!0}}return O8(e),Ma(r),$s(t),!1}}}function HP(){return Me.trackingDerivation!==null}function E8(e,t,r){var n=vp(!0);O8(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Me.runId;var i=Me.trackingDerivation;Me.trackingDerivation=e,Me.inBatch++;var a;if(Me.disableErrorBoundaries===!0)a=t.call(r);else try{a=t.call(r)}catch(o){a=new Nh(o)}return Me.inBatch--,Me.trackingDerivation=i,GP(e),$s(n),a}function GP(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=Tt.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var l=r[o];l.diffValue_===0&&(l.diffValue_=1,i!==o&&(r[i]=l),i++),l.dependenciesState_>n&&(n=l.dependenciesState_)}for(r.length=i,e.newObserving_=null,a=t.length;a--;){var u=t[a];u.diffValue_===0&&C8(u,e),u.diffValue_=0}for(;i--;){var f=r[i];f.diffValue_===1&&(f.diffValue_=0,KP(f,e))}n!==Tt.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function mm(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)C8(t[r],e);e.dependenciesState_=Tt.NOT_TRACKING_}function jy(e){var t=Nl();try{return e()}finally{Ma(t)}}function Nl(){var e=Me.trackingDerivation;return Me.trackingDerivation=null,e}function Ma(e){Me.trackingDerivation=e}function vp(e){var t=Me.allowStateReads;return Me.allowStateReads=e,t}function $s(e){Me.allowStateReads=e}function O8(e){if(e.dependenciesState_!==Tt.UP_TO_DATE_){e.dependenciesState_=Tt.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=Tt.UP_TO_DATE_}}var $P=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],Ec=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},nh=!0,x8=!1,Me=function(){var e=Ry();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(nh=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Ec().version&&(nh=!1),nh?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ec):(setTimeout(function(){x8||ot(35)},1),new Ec)}();function VP(){if((Me.pendingReactions.length||Me.inBatch||Me.isRunningReactions)&&ot(36),x8=!0,nh){var e=Ry();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Me=new Ec}}function P8(){return Me}function qP(){var e=new Ec;for(var t in e)$P.indexOf(t)===-1&&(Me[t]=e[t]);Me.allowStateChanges=!Me.enforceActions}function WP(e){return e.observers_&&e.observers_.size>0}function YP(e){return e.observers_}function KP(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function C8(e,t){e.observers_.delete(t),e.observers_.size===0&&T8(e)}function T8(e){e.isPendingUnobservation_===!1&&(e.isPendingUnobservation_=!0,Me.pendingUnobservations.push(e))}function xn(){Me.inBatch++}function Pn(){if(--Me.inBatch===0){R8();for(var e=Me.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation_=!1,r.observers_.size===0&&(r.isBeingObserved_&&(r.isBeingObserved_=!1,r.onBUO()),r instanceof Js&&r.suspend_())}Me.pendingUnobservations=[]}}function A8(e){var t=Me.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved_&&Me.trackingContext&&(e.isBeingObserved_=!0,e.onBO())),e.isBeingObserved_):(e.observers_.size===0&&Me.inBatch>0&&T8(e),!1)}function k8(e){e.lowestObserverState_!==Tt.STALE_&&(e.lowestObserverState_=Tt.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Tt.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=Tt.STALE_}))}function XP(e){e.lowestObserverState_!==Tt.STALE_&&(e.lowestObserverState_=Tt.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Tt.POSSIBLY_STALE_?t.dependenciesState_=Tt.STALE_:t.dependenciesState_===Tt.UP_TO_DATE_&&(e.lowestObserverState_=Tt.UP_TO_DATE_)}))}function ZP(e){e.lowestObserverState_===Tt.UP_TO_DATE_&&(e.lowestObserverState_=Tt.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Tt.UP_TO_DATE_&&(t.dependenciesState_=Tt.POSSIBLY_STALE_,t.onBecomeStale_())}))}var eu=function(){function e(r,n,i,a){r===void 0&&(r="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Tt.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=Mh.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=a}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,Me.pendingReactions.push(this),R8())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){xn(),this.isScheduled_=!1;var n=Me.trackingContext;if(Me.trackingContext=this,vm(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Me.trackingContext=n,Pn()}},t.track=function(n){if(!this.isDisposed_){xn(),this.isRunning_=!0;var i=Me.trackingContext;Me.trackingContext=this;var a=E8(this,n,void 0);Me.trackingContext=i,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&mm(this),rh(a)&&this.reportExceptionInDerivation_(a.cause),Pn()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Me.disableErrorBoundaries)throw n;var a="[mobx] uncaught error in '"+this+"'";Me.suppressReactionErrors||console.error(a,n),Me.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(xn(),mm(this),Pn()))},t.getDisposer_=function(n){var i=this,a=function o(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",a),a[Xe]=this,a},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){},e}();function QP(e){return Me.globalReactionErrorHandlers.push(e),function(){var t=Me.globalReactionErrorHandlers.indexOf(e);t>=0&&Me.globalReactionErrorHandlers.splice(t,1)}}var JP=100,ym=function(t){return t()};function R8(){Me.inBatch>0||Me.isRunningReactions||ym(eC)}function eC(){Me.isRunningReactions=!0;for(var e=Me.pendingReactions,t=0;e.length>0;){++t===JP&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}Me.isRunningReactions=!1}var Ih=Bo("Reaction",eu);function tC(e){var t=ym;ym=function(n){return e(function(){return t(n)})}}function Oc(){return!1}function L8(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var M8="action",rC="action.bound",N8="autoAction",nC="autoAction.bound",I8="<unnamed action>",bm=df(M8),iC=df(rC,{bound:!0}),_m=df(N8,{autoAction:!0}),aC=df(nC,{autoAction:!0,bound:!0});function D8(e){var t=function(n,i){if(Vn(n))return No(n.name||I8,n,e);if(Vn(i))return No(n,i,e);if(cf(i))return(e?_m:bm).decorate_20223_(n,i);if(xl(i))return yu(n,i,e?_m:bm);if(xl(n))return Ii(df(e?N8:M8,{name:n,autoAction:e}))};return t}var wr=D8(!1);Object.assign(wr,bm);var tu=D8(!0);Object.assign(tu,_m);wr.bound=Ii(iC);tu.bound=Ii(aC);function ru(e){return y8(e.name||I8,!1,e,this,void 0)}function hf(e){return Vn(e)&&e.isMobxAction===!0}function zy(e,t){var r,n,i,a,o;t===void 0&&(t=Ly);var l=(r=(n=t)==null?void 0:n.name)!=null?r:"Autorun",u=!t.scheduler&&!t.delay,f;if(u)f=new eu(l,function(){this.track(b)},t.onError,t.requiresObservable);else{var v=F8(t),w=!1;f=new eu(l,function(){w||(w=!0,v(function(){w=!1,f.isDisposed_||f.track(b)}))},t.onError,t.requiresObservable)}function b(){e(f)}return(i=t)!=null&&(a=i.signal)!=null&&a.aborted||f.schedule_(),f.getDisposer_((o=t)==null?void 0:o.signal)}var oC=function(t){return t()};function F8(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:oC}function j8(e,t,r){var n,i,a,o;r===void 0&&(r=Ly);var l=(n=r.name)!=null?n:"Reaction",u=wr(l,r.onError?lC(r.onError,t):t),f=!r.scheduler&&!r.delay,v=F8(r),w=!0,b=!1,h,E=r.compareStructural?Pl.structural:r.equals||Pl.default,y=new eu(l,function(){w||f?m():b||(b=!0,v(m))},r.onError,r.requiresObservable);function m(){if(b=!1,!y.isDisposed_){var p=!1,g=h;y.track(function(){var d=Dy(!1,function(){return e(y)});p=w||!E(h,d),h=d}),(w&&r.fireImmediately||!w&&p)&&u(h,g,y),w=!1}}return(i=r)!=null&&(a=i.signal)!=null&&a.aborted||y.schedule_(),y.getDisposer_((o=r)==null?void 0:o.signal)}function lC(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var sC="onBO",uC="onBUO";function z8(e,t,r){return B8(sC,e,t,r)}function By(e,t,r){return B8(uC,e,t,r)}function B8(e,t,r,n){var i=typeof n=="function"?ca(t,r):ca(t),a=Vn(n)?n:r,o=e+"L";return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var l=i[o];l&&(l.delete(a),l.size===0&&delete i[o])}}var cC="never",Id="always",fC="observed";function U8(e){e.isolateGlobalState===!0&&VP();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(Me.useProxies=t===Id?!0:t===cC?!1:typeof Proxy<"u"),t==="ifavailable"&&(Me.verifyProxies=!0),r!==void 0){var n=r===Id?Id:r===fC;Me.enforceActions=n,Me.allowStateChanges=!(n===!0||n===Id)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(Me[i]=!!e[i])}),Me.allowStateReads=!Me.observableRequiresReaction,e.reactionScheduler&&tC(e.reactionScheduler)}function Uy(e,t,r,n){var i=$x(t);return Uo(function(){var a=Il(e,n)[Xe];Qs(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function H8(e,t){return G8(ca(e,t))}function G8(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=hC(e.observing_).map(G8)),t}function dC(e,t){return $8(ca(e,t))}function $8(e){var t={name:e.name_};return WP(e)&&(t.observers=Array.from(YP(e)).map($8)),t}function hC(e){return Array.from(new Set(e))}var pC=0;function mp(){this.message="FLOW_CANCELLED"}mp.prototype=Object.create(Error.prototype);function gC(e){return e instanceof mp}var tg=f8("flow"),vC=f8("flow.bound",{bound:!0}),Al=Object.assign(function(t,r){if(cf(r))return tg.decorate_20223_(t,r);if(xl(r))return yu(t,r,tg);var n=t,i=n.name||"<unnamed flow>",a=function(){var l=this,u=arguments,f=++pC,v=wr(i+" - runid: "+f+" - init",n).apply(l,u),w,b=void 0,h=new Promise(function(E,y){var m=0;w=y;function p(_){b=void 0;var O;try{O=wr(i+" - runid: "+f+" - yield "+m++,v.next).call(v,_)}catch(k){return y(k)}d(O)}function g(_){b=void 0;var O;try{O=wr(i+" - runid: "+f+" - yield "+m++,v.throw).call(v,_)}catch(k){return y(k)}d(O)}function d(_){if(Vn(_==null?void 0:_.then)){_.then(d,y);return}return _.done?E(_.value):(b=Promise.resolve(_.value),b.then(p,g))}p(void 0)});return h.cancel=wr(i+" - runid: "+f+" - cancel",function(){try{b&&T5(b);var E=v.return(void 0),y=Promise.resolve(E.value);y.then(Is,Is),T5(y),w(new mp)}catch(m){w(m)}}),h};return a.isMobXFlow=!0,a},tg);Al.bound=Ii(vC);function T5(e){Vn(e.cancel)&&e.cancel()}function mC(e){return e}function nu(e){return(e==null?void 0:e.isMobXFlow)===!0}function Hy(e,t,r){var n;return Yr(e)||vn(e)||Fy(e)?n=Bi(e):zr(e)&&(n=Bi(e,t)),n.dehancer=typeof t=="function"?t:r,function(){n.dehancer=void 0}}function yp(e,t,r){return Vn(r)?bC(e,t,r):yC(e,t)}function yC(e,t){return Bi(e).intercept_(t)}function bC(e,t,r){return Bi(e,t).intercept_(r)}function V8(e,t){if(t===void 0)return Tl(e);if(zr(e)===!1||!e[Xe].values_.has(t))return!1;var r=ca(e,t);return Tl(r)}function _C(e){return V8(e)}function q8(e,t){return V8(e,t)}function W8(e,t){return e?t!==void 0?zr(e)?e[Xe].values_.has(t):!1:zr(e)||!!e[Xe]||Ny(e)||Ih(e)||Tl(e):!1}function bp(e){return W8(e)}function Y8(e,t){return W8(e,t)}function Vc(e){if(zr(e))return e[Xe].keys_();if(Yr(e)||hn(e))return Array.from(e.keys());if(vn(e))return e.map(function(t,r){return r});ot(5)}function Gy(e){if(zr(e))return Vc(e).map(function(t){return e[t]});if(Yr(e))return Vc(e).map(function(t){return e.get(t)});if(hn(e))return Array.from(e.values());if(vn(e))return e.slice();ot(6)}function K8(e){if(zr(e))return Vc(e).map(function(t){return[t,e[t]]});if(Yr(e))return Vc(e).map(function(t){return[t,e.get(t)]});if(hn(e))return Array.from(e.entries());if(vn(e))return e.map(function(t,r){return[r,t]});ot(7)}function $y(e,t,r){if(arguments.length===2&&!hn(e)){xn();var n=t;try{for(var i in n)$y(e,i,n[i])}finally{Pn()}return}zr(e)?e[Xe].set_(t,r):Yr(e)?e.set(t,r):hn(e)?e.add(t):vn(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&ot("Invalid index: '"+t+"'"),xn(),t>=e.length&&(e.length=t+1),e[t]=r,Pn()):ot(8)}function wC(e,t){zr(e)?e[Xe].delete_(t):Yr(e)||hn(e)?e.delete(t):vn(e)?(typeof t!="number"&&(t=parseInt(t,10)),e.splice(t,1)):ot(9)}function X8(e,t){if(zr(e))return e[Xe].has_(t);if(Yr(e))return e.has(t);if(hn(e))return e.has(t);if(vn(e))return t>=0&&t<e.length;ot(10)}function SC(e,t){if(X8(e,t)){if(zr(e))return e[Xe].get_(t);if(Yr(e))return e.get(t);if(vn(e))return e[t];ot(11)}}function Vy(e,t,r){if(zr(e))return e[Xe].defineProperty_(t,r);ot(39)}function Z8(e){if(zr(e))return e[Xe].ownKeys_();ot(38)}function _p(e,t,r,n){return Vn(r)?OC(e,t,r,n):EC(e,t,r)}function EC(e,t,r){return Bi(e).observe_(t,r)}function OC(e,t,r,n){return Bi(e,t).observe_(r,n)}function Dd(e,t,r){return e.set(t,r),r}function Ss(e,t){if(e==null||typeof e!="object"||e instanceof Date||!bp(e))return e;if(Fy(e)||Tl(e))return Ss(e.get(),t);if(t.has(e))return t.get(e);if(vn(e)){var r=Dd(t,e,new Array(e.length));return e.forEach(function(o,l){r[l]=Ss(o,t)}),r}if(hn(e)){var n=Dd(t,e,new Set);return e.forEach(function(o){n.add(Ss(o,t))}),n}if(Yr(e)){var i=Dd(t,e,new Map);return e.forEach(function(o,l){i.set(l,Ss(o,t))}),i}else{var a=Dd(t,e,{});return Z8(e).forEach(function(o){lf.propertyIsEnumerable.call(e,o)&&(a[o]=Ss(e[o],t))}),a}}function xC(e,t){return Ss(e,new Map)}function PC(){}function ra(e,t){t===void 0&&(t=void 0),xn();try{return e.apply(t)}finally{Pn()}}function wm(e,t,r){return arguments.length===1||t&&typeof t=="object"?CC(e,t):Q8(e,t,r||{})}function Q8(e,t,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[Xe].isDisposed_)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=No("When-effect",t),o=zy(function(l){var u=Dy(!1,e);u&&(l.dispose(),n&&clearTimeout(n),a())},r);return o}function CC(e,t){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,i,a=new Promise(function(o,l){var u,f=Q8(e,o,Mo({},t,{onError:l}));n=function(){f(),l(new Error("WHEN_CANCELLED"))},i=function(){f(),l(new Error("WHEN_ABORTED"))},t==null||(u=t.signal)==null||u.addEventListener==null||u.addEventListener("abort",i)}).finally(function(){var o;return t==null||(o=t.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",i)});return a.cancel=n,a}function ys(e){return e[Xe]}var TC={has:function(t,r){return ys(t).has_(r)},get:function(t,r){return ys(t).get_(r)},set:function(t,r,n){var i;return xl(r)?(i=ys(t).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(t,r){var n;return xl(r)?(n=ys(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return(i=ys(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return ys(t).ownKeys_()},preventExtensions:function(t){ot(13)}};function AC(e,t){var r,n;return r8(),e=Il(e,t),(n=(r=e[Xe]).proxy_)!=null?n:r.proxy_=new Proxy(e,TC)}function ui(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function pf(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),n8(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function ci(e,t){var r=Nl();try{for(var n=[].concat(e.interceptors_||[]),i=0,a=n.length;i<a&&(t=n[i](t),t&&!t.type&&ot(14),!!t);i++);return t}finally{Ma(r)}}function Di(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function gf(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),n8(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Fi(e,t){var r=Nl(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](t);Ma(r)}}function qy(e,t,r){return Uo(function(){var n,i=Il(e,r)[Xe];(n=t)!=null||(t=Kx(e)),Qs(t).forEach(function(a){return i.make_(a,t[a])})}),e}var rg=Symbol("mobx-keys");function kC(e,t,r){return Ba(e)?Uy(e,e,t,r):(Uo(function(){var n=Il(e,r)[Xe];if(!e[rg]){var i=Object.getPrototypeOf(e),a=new Set([].concat(Qs(e),Qs(i)));a.delete("constructor"),a.delete(Xe),sf(i,rg,a)}e[rg].forEach(function(o){return n.make_(o,t&&o in t?t[o]:!0)})}),e)}var A5="splice",sa="update",RC=1e4,LC={get:function(t,r){var n=t[Xe];return r===Xe?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):La(Dh,r)?Dh[r]:t[r]},set:function(t,r,n){var i=t[Xe];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){ot(15)}},Wy=function(){function e(r,n,i,a){r===void 0&&(r="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new ff(r),this.enhancer_=function(o,l){return n(o,l,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return pf(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),gf(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&ot("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var a=new Array(n-i),o=0;o<n-i;o++)a[o]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&ot(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&l9(n+i+1)},t.spliceWithArray_=function(n,i,a){var o=this;this.atom_;var l=this.values_.length;if(n===void 0?n=0:n>l?n=l:n<0&&(n=Math.max(0,l+n)),arguments.length===1?i=l-n:i==null?i=0:i=Math.max(0,Math.min(i,l-n)),a===void 0&&(a=dm),ui(this)){var u=ci(this,{object:this.proxy_,type:A5,index:n,removedCount:i,added:a});if(!u)return dm;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(w){return o.enhancer_(w,void 0)}),this.legacyMode_){var f=a.length-i;this.updateArrayLength_(l,f)}var v=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,v),this.dehanceValues_(v)},t.spliceItemsIntoValues_=function(n,i,a){if(a.length<RC){var o;return(o=this.values_).splice.apply(o,[n,i].concat(a))}else{var l=this.values_.slice(n,n+i),u=this.values_.slice(n+i);this.values_.length+=a.length-i;for(var f=0;f<a.length;f++)this.values_[n+f]=a[f];for(var v=0;v<u.length;v++)this.values_[n+a.length+v]=u[v];return l}},t.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&Oc(),l=Di(this),u=l||o?{observableKind:"array",object:this.proxy_,type:sa,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&Fi(this,u)},t.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&Oc(),l=Di(this),u=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:A5,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&Fi(this,u)},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx] Out of bounds read: "+n);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var a=this.values_;if(this.legacyMode_&&n>a.length&&ot(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(ui(this)){var l=ci(this,{type:sa,object:this.proxy_,index:n,newValue:i});if(!l)return;i=l.newValue}i=this.enhancer_(i,o);var u=i!==o;u&&(a[n]=i,this.notifyArrayChildUpdate_(n,i,o))}else{for(var f=new Array(n+1-a.length),v=0;v<f.length-1;v++)f[v]=void 0;f[f.length-1]=i,this.spliceWithArray_(a.length,0,f)}},e}();function MC(e,t,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),r8(),Uo(function(){var i=new Wy(r,t,n,!1);a8(i.values_,Xe,i);var a=new Proxy(i.values_,LC);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var Dh={clear:function(){return this.splice(0)},replace:function(t){var r=this[Xe];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];var o=this[Xe];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,r)}return o.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[Xe].spliceWithArray_(t,r,n)},push:function(){for(var t=this[Xe],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[Xe].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[Xe],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return Me.trackingDerivation&&ot(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Me.trackingDerivation&&ot(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[Xe],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};Ht("at",Yn);Ht("concat",Yn);Ht("flat",Yn);Ht("includes",Yn);Ht("indexOf",Yn);Ht("join",Yn);Ht("lastIndexOf",Yn);Ht("slice",Yn);Ht("toString",Yn);Ht("toLocaleString",Yn);Ht("toSorted",Yn);Ht("toSpliced",Yn);Ht("with",Yn);Ht("every",Ui);Ht("filter",Ui);Ht("find",Ui);Ht("findIndex",Ui);Ht("findLast",Ui);Ht("findLastIndex",Ui);Ht("flatMap",Ui);Ht("forEach",Ui);Ht("map",Ui);Ht("some",Ui);Ht("toReversed",Ui);Ht("reduce",J8);Ht("reduceRight",J8);function Ht(e,t){typeof Array.prototype[e]=="function"&&(Dh[e]=t(e))}function Yn(e){return function(){var t=this[Xe];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Ui(e){return function(t,r){var n=this,i=this[Xe];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[e](function(o,l){return t.call(r,o,l,n)})}}function J8(e){return function(){var t=this,r=this[Xe];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(a,o,l){return i(a,o,l,t)},n[e].apply(n,arguments)}}var NC=Bo("ObservableArrayAdministration",Wy);function vn(e){return fp(e)&&NC(e[Xe])}var e9,t9,IC={},_o="add",Fh="delete";e9=Symbol.iterator;t9=Symbol.toStringTag;var wp=function(){function e(r,n,i){var a=this;n===void 0&&(n=Cl),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Xe]=IC,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=i,Vn(Map)||ot(18),Uo(function(){a.keysAtom_=$c("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,r&&a.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!Me.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var o=a=new Ao(this.has_(n),dp,"ObservableMap.key?",!1);this.hasMap_.set(n,o),By(o,function(){return i.hasMap_.delete(n)})}return a.get()},t.set=function(n,i){var a=this.has_(n);if(ui(this)){var o=ci(this,{type:a?sa:_o,object:this,newValue:i,name:n});if(!o)return this;i=o.newValue}return a?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(this.keysAtom_,ui(this)){var a=ci(this,{type:Fh,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=Oc(),l=Di(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Fh,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return ra(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var v=i.data_.get(n);v.setNewValue_(void 0),i.data_.delete(n)}),l&&Fi(this,u),!0}return!1},t.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==Me.UNCHANGED){var o=Oc(),l=Di(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:sa,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&Fi(this,u)}},t.addValue_=function(n,i){var a=this;this.keysAtom_,ra(function(){var f,v=new Ao(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,v),i=v.value_,(f=a.hasMap_.get(n))==null||f.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Oc(),l=Di(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:_o,object:this,name:n,newValue:i}:null;l&&Fi(this,u)},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return qc({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:n.get(u)}}})},t.entries=function(){var n=this,i=this.keys();return qc({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:[u,n.get(u)]}}})},t[e9]=function(){return this.entries()},t.forEach=function(n,i){for(var a=Ds(this),o;!(o=a()).done;){var l=o.value,u=l[0],f=l[1];n.call(i,f,u,this)}},t.merge=function(n){var i=this;return Yr(n)&&(n=new Map(n)),ra(function(){Ba(n)?Gx(n).forEach(function(a){return i.set(a,n[a])}):Array.isArray(n)?n.forEach(function(a){var o=a[0],l=a[1];return i.set(o,l)}):mu(n)?(n.constructor!==Map&&ot(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&ot(20,n)}),this},t.clear=function(){var n=this;ra(function(){jy(function(){for(var i=Ds(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.replace=function(n){var i=this;return ra(function(){for(var a=DC(n),o=new Map,l=!1,u=Ds(i.data_.keys()),f;!(f=u()).done;){var v=f.value;if(!a.has(v)){var w=i.delete(v);if(w)l=!0;else{var b=i.data_.get(v);o.set(v,b)}}}for(var h=Ds(a.entries()),E;!(E=h()).done;){var y=E.value,m=y[0],p=y[1],g=i.data_.has(m);if(i.set(m,p),i.data_.has(m)){var d=i.data_.get(m);o.set(m,d),g||(l=!0)}}if(!l)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var _=i.data_.keys(),O=o.keys(),k=_.next(),C=O.next();!k.done;){if(k.value!==C.value){i.keysAtom_.reportChanged();break}k=_.next(),C=O.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return gf(this,n)},t.intercept_=function(n){return pf(this,n)},My(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:t9,get:function(){return"Map"}}]),e}(),Yr=Bo("ObservableMap",wp);function DC(e){if(mu(e)||Yr(e))return e;if(Array.isArray(e))return new Map(e);if(Ba(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return ot(21,e)}var r9,n9,FC={};r9=Symbol.iterator;n9=Symbol.toStringTag;var Yy=function(){function e(r,n,i){var a=this;n===void 0&&(n=Cl),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Xe]=FC,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,Vn(Set)||ot(22),this.enhancer_=function(o,l){return n(o,l,i)},Uo(function(){a.atom_=$c(a.name_),r&&a.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;ra(function(){jy(function(){for(var i=Ds(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.forEach=function(n,i){for(var a=Ds(this),o;!(o=a()).done;){var l=o.value;n.call(i,l,l,this)}},t.add=function(n){var i=this;if(this.atom_,ui(this)){var a=ci(this,{type:_o,object:this,newValue:n});if(!a)return this}if(!this.has(n)){ra(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,l=Di(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:_o,object:this,newValue:n}:null;l&&Fi(this,u)}return this},t.delete=function(n){var i=this;if(ui(this)){var a=ci(this,{type:Fh,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,l=Di(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:Fh,object:this,oldValue:n}:null;return ra(function(){i.atom_.reportChanged(),i.data_.delete(n)}),l&&Fi(this,u),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=0,i=Array.from(this.keys()),a=Array.from(this.values());return qc({next:function(){var l=n;return n+=1,l<a.length?{value:[i[l],a[l]],done:!1}:{done:!0}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=0,a=Array.from(this.data_.values());return qc({next:function(){return i<a.length?{value:n.dehanceValue_(a[i++]),done:!1}:{done:!0}}})},t.replace=function(n){var i=this;return hn(n)&&(n=new Set(n)),ra(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):uf(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&ot("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return gf(this,n)},t.intercept_=function(n){return pf(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[r9]=function(){return this.values()},My(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:n9,get:function(){return"Set"}}]),e}(),hn=Bo("ObservableSet",Yy),k5=Object.create(null),R5="remove",i9=function(){function e(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=OP),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=r,this.values_=n,this.name_=i,this.defaultAnnotation_=a,this.keysAtom_=new ff("ObservableObject.keys"),this.isPlainObject_=Ba(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var a=this.values_.get(n);if(a instanceof Js)return a.set(i),!0;if(ui(this)){var o=ci(this,{type:sa,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Me.UNCHANGED){var l=Di(this),u=!1,f=l||u?{type:sa,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&Fi(this,f)}return!0},t.get_=function(n){return Me.trackingDerivation&&!La(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,a){return a===void 0&&(a=!1),La(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):a?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},t.has_=function(n){if(!Me.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new Ao(n in this.target_,dp,"ObservableObject.key?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(n in this.target_)){var a;if((a=this.target_[ia])!=null&&a[n])return;ot(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==lf;){var l=Rh(o,n);if(l){var u=i.make_(this,n,l,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}M5(this,i,n)}},t.extend_=function(n,i,a,o){if(o===void 0&&(o=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(n,i,o);var l=a.extend_(this,n,i,o);return l&&M5(this,a,n),l},t.defineProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{xn();var o=this.delete_(n);if(!o)return o;if(ui(this)){var l=ci(this,{object:this.proxy_||this.target_,name:n,type:_o,newValue:i.value});if(!l)return null;var u=l.newValue;i.value!==u&&(i=Mo({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else la(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{Pn()}return!0},t.defineObservableProperty_=function(n,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{xn();var l=this.delete_(n);if(!l)return l;if(ui(this)){var u=ci(this,{object:this.proxy_||this.target_,name:n,type:_o,newValue:i});if(!u)return null;i=u.newValue}var f=L5(n),v={configurable:Me.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(o){if(!Reflect.defineProperty(this.target_,n,v))return!1}else la(this.target_,n,v);var w=new Ao(i,a,"ObservableObject.key",!1);this.values_.set(n,w),this.notifyPropertyAddition_(n,w.value_)}finally{Pn()}return!0},t.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{xn();var o=this.delete_(n);if(!o)return o;if(ui(this)){var l=ci(this,{object:this.proxy_||this.target_,name:n,type:_o,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=L5(n),f={configurable:Me.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,n,f))return!1}else la(this.target_,n,f);this.values_.set(n,new Js(i)),this.notifyPropertyAddition_(n,void 0)}finally{Pn()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!La(this.target_,n))return!0;if(ui(this)){var a=ci(this,{object:this.proxy_||this.target_,name:n,type:R5});if(!a)return null}try{var o,l;xn();var u=Di(this),f=!1,v=this.values_.get(n),w=void 0;if(!v&&(u||f)){var b;w=(b=Rh(this.target_,n))==null?void 0:b.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(v&&(this.values_.delete(n),v instanceof Ao&&(w=v.value_),k8(v)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(l=o.get(n))==null||l.set(n in this.target_),u||f){var h={type:R5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:w,name:n};u&&Fi(this,h)}}finally{Pn()}return!0},t.observe_=function(n,i){return gf(this,n)},t.intercept_=function(n){return pf(this,n)},t.notifyPropertyAddition_=function(n,i){var a,o,l=Di(this),u=!1;if(l||u){var f=l||u?{type:_o,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;l&&Fi(this,f)}(a=this.pendingKeys_)==null||(o=a.get(n))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Qs(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Il(e,t){var r;if(La(e,Xe))return e;var n=(r=t==null?void 0:t.name)!=null?r:"ObservableObject",i=new i9(e,new Map,String(n),IP(t));return sf(e,Xe,i),e}var jC=Bo("ObservableObjectAdministration",i9);function L5(e){return k5[e]||(k5[e]={get:function(){return this[Xe].getObservablePropValue_(e)},set:function(r){return this[Xe].setObservablePropValue_(e,r)}})}function zr(e){return fp(e)?jC(e[Xe]):!1}function M5(e,t,r){var n;(n=e.target_[ia])==null||delete n[r]}var zC=o9(0),BC=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),ng=0,a9=function(){};function UC(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}UC(a9,Array.prototype);var Ky=function(e,t,r){s8(n,e);function n(a,o,l,u){var f;return l===void 0&&(l="ObservableArray"),u===void 0&&(u=!1),f=e.call(this)||this,Uo(function(){var v=new Wy(l,o,u,!0);v.proxy_=eg(f),a8(eg(f),Xe,v),a&&a.length&&f.spliceWithArray(0,0,a),BC&&Object.defineProperty(eg(f),"0",zC)}),f}var i=n.prototype;return i.concat=function(){this[Xe].atom_.reportObserved();for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];return Array.prototype.concat.apply(this.slice(),l.map(function(f){return vn(f)?f.slice():f}))},i[r]=function(){var a=this,o=0;return qc({next:function(){return o<a.length?{value:a[o++],done:!1}:{done:!0,value:void 0}}})},My(n,[{key:"length",get:function(){return this[Xe].getArrayLength_()},set:function(o){this[Xe].setArrayLength_(o)}},{key:t,get:function(){return"Array"}}]),n}(a9,Symbol.toStringTag,Symbol.iterator);Object.entries(Dh).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&sf(Ky.prototype,t,r)});function o9(e){return{enumerable:!1,configurable:!0,get:function(){return this[Xe].get_(e)},set:function(r){this[Xe].set_(e,r)}}}function HC(e){la(Ky.prototype,""+e,o9(e))}function l9(e){if(e>ng){for(var t=ng;t<e+100;t++)HC(t);ng=e}}l9(1e3);function GC(e,t,r){return new Ky(e,t,r)}function ca(e,t){if(typeof e=="object"&&e!==null){if(vn(e))return t!==void 0&&ot(23),e[Xe].atom_;if(hn(e))return e.atom_;if(Yr(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||ot(25,t,jh(e)),r}if(zr(e)){if(!t)return ot(26);var n=e[Xe].values_.get(t);return n||ot(27,t,jh(e)),n}if(Ny(e)||Tl(e)||Ih(e))return e}else if(Vn(e)&&Ih(e[Xe]))return e[Xe];ot(28)}function Bi(e,t){if(e||ot(29),t!==void 0)return Bi(ca(e,t));if(Ny(e)||Tl(e)||Ih(e)||Yr(e)||hn(e))return e;if(e[Xe])return e[Xe];ot(24,e)}function jh(e,t){var r;if(t!==void 0)r=ca(e,t);else{if(hf(e))return e.name;zr(e)||Yr(e)||hn(e)?r=Bi(e):r=ca(e)}return r.name_}function Uo(e){var t=Nl(),r=pp(!0);xn();try{return e()}finally{Pn(),gp(r),Ma(t)}}var N5=lf.toString;function Xy(e,t,r){return r===void 0&&(r=-1),Sm(e,t,r)}function Sm(e,t,r,n,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!=="function"&&a!=="object"&&typeof t!="object")return!1;var o=N5.call(e);if(o!==N5.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++;break}e=I5(e),t=I5(t);var l=o==="[object Array]";if(!l){if(typeof e!="object"||typeof t!="object")return!1;var u=e.constructor,f=t.constructor;if(u!==f&&!(Vn(u)&&u instanceof u&&Vn(f)&&f instanceof f)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var v=n.length;v--;)if(n[v]===e)return i[v]===t;if(n.push(e),i.push(t),l){if(v=e.length,v!==t.length)return!1;for(;v--;)if(!Sm(e[v],t[v],r-1,n,i))return!1}else{var w=Object.keys(e),b;if(v=w.length,Object.keys(t).length!==v)return!1;for(;v--;)if(b=w[v],!(La(t,b)&&Sm(e[b],t[b],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function I5(e){return vn(e)?e.slice():mu(e)||Yr(e)||uf(e)||hn(e)?Array.from(e.entries()):e}function qc(e){return e[Symbol.iterator]=$C,e}function $C(){return this}["Symbol","Map","Set"].forEach(function(e){var t=Ry();typeof t[e]>"u"&&ot("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:L8,extras:{getDebugName:jh},$mobx:Xe});const VC=Object.freeze(Object.defineProperty({__proto__:null,$mobx:Xe,FlowCancellationError:mp,ObservableMap:wp,ObservableSet:Yy,Reaction:eu,_allowStateChanges:Dy,_allowStateChangesInsideComputed:ru,_allowStateReadsEnd:$s,_allowStateReadsStart:vp,_autoAction:tu,_endAction:_8,_getAdministration:Bi,_getGlobalState:P8,_interceptReads:Hy,_isComputingDerivation:HP,_resetGlobalState:qP,_startAction:b8,action:wr,autorun:zy,comparer:Pl,computed:Ml,configure:U8,createAtom:$c,defineProperty:Vy,entries:K8,extendObservable:Uy,flow:Al,flowResult:mC,get:SC,getAtom:ca,getDebugName:jh,getDependencyTree:H8,getObserverTree:dC,has:X8,intercept:yp,isAction:hf,isBoxedObservable:Fy,isComputed:_C,isComputedProp:q8,isFlow:nu,isFlowCancellationError:gC,isObservable:bp,isObservableArray:vn,isObservableMap:Yr,isObservableObject:zr,isObservableProp:Y8,isObservableSet:hn,keys:Vc,makeAutoObservable:kC,makeObservable:qy,observable:Ft,observe:_p,onBecomeObserved:z8,onBecomeUnobserved:By,onReactionError:QP,override:rP,ownKeys:Z8,reaction:j8,remove:wC,runInAction:ru,set:$y,spy:L8,toJS:xC,trace:PC,transaction:ra,untracked:jy,values:Gy,when:wm},Symbol.toStringTag,{value:"Module"}));if(!at.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!qy)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function qC(e){e()}function s9(e){e||(e=qC),U8({reactionScheduler:e})}var WC=function(){return!0};function YC(e){return H8(e)}var u9=!1;function c9(e){u9=e}function Zy(){return u9}var KC=1e4,XC=1e4,ZC=function(){function e(t){var r=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=KC),clearTimeout(r.sweepTimeout),r.sweepTimeout=void 0;var i=Date.now();r.registrations.forEach(function(a,o){i-a.registeredAt>=n&&(r.finalize(a.value),r.registrations.delete(o))}),r.registrations.size>0&&r.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){r.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){this.registrations.set(n,{value:r,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.registrations.delete(t)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,XC))}}),e}(),QC=typeof FinalizationRegistry<"u"?FinalizationRegistry:ZC,zh=new QC(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),f9={exports:{}},d9={};/**
35
+ * @license React
36
+ * use-sync-external-store-shim.production.min.js
37
+ *
38
+ * Copyright (c) Facebook, Inc. and its affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var iu=at;function JC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var eT=typeof Object.is=="function"?Object.is:JC,tT=iu.useState,rT=iu.useEffect,nT=iu.useLayoutEffect,iT=iu.useDebugValue;function aT(e,t){var r=t(),n=tT({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return nT(function(){i.value=r,i.getSnapshot=t,ig(i)&&a({inst:i})},[e,r,t]),rT(function(){return ig(i)&&a({inst:i}),e(function(){ig(i)&&a({inst:i})})},[e]),iT(r),r}function ig(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!eT(e,r)}catch{return!0}}function oT(e,t){return t()}var lT=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?oT:aT;d9.useSyncExternalStore=iu.useSyncExternalStore!==void 0?iu.useSyncExternalStore:lT;f9.exports=d9;var sT=f9.exports;function D5(e){e.reaction=new eu("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function Qy(e,t){if(t===void 0&&(t="observed"),Zy())return e();var r=yt.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(l){return zh.unregister(n),n.onStoreChange=l,n.reaction||(D5(n),n.stateVersion=Symbol()),function(){var u;n.onStoreChange=null,(u=n.reaction)===null||u===void 0||u.dispose(),n.reaction=null}},getSnapshot:function(){return n.stateVersion}};r.current=n}var i=r.current;i.reaction||(D5(i),zh.register(r,i,i)),yt.useDebugValue(i.reaction,YC),sT.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var a,o;if(i.reaction.track(function(){try{a=e()}catch(l){o=l}}),o)throw o;return a}var ag,og,h9=typeof Symbol=="function"&&Symbol.for,uT=(og=(ag=Object.getOwnPropertyDescriptor(function(){},"name"))===null||ag===void 0?void 0:ag.configurable)!==null&&og!==void 0?og:!1,F5=h9?Symbol.for("react.forward_ref"):typeof at.forwardRef=="function"&&at.forwardRef(function(e){return null}).$$typeof,j5=h9?Symbol.for("react.memo"):typeof at.memo=="function"&&at.memo(function(e){return null}).$$typeof;function cT(e,t){var r;if(j5&&e.$$typeof===j5)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(Zy())return e;var n=(r=t==null?void 0:t.forwardRef)!==null&&r!==void 0?r:!1,i=e,a=e.displayName||e.name;if(F5&&e.$$typeof===F5&&(n=!0,i=e.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(l,u){return Qy(function(){return i(l,u)},a)};return o.displayName=e.displayName,uT&&Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),n&&(o=at.forwardRef(o)),o=at.memo(o),dT(e,o),o}var fT={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function dT(e,t){Object.keys(e).forEach(function(r){fT[r]||Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}function p9(e){var t=e.children,r=e.render,n=t||r;return typeof n!="function"?null:Qy(n)}p9.displayName="Observer";function hT(e,t){return at.useState(function(){return Ft(e(),t,{autoBind:!0})})[0]}function g9(e){var t=at.useState(function(){return Ft(e,{},{deep:!1})})[0];return ru(function(){Object.assign(t,e)}),t}function pT(e,t){var r=t&&g9(t);return at.useState(function(){return Ft(e(r),void 0,{autoBind:!0})})[0]}var lg;s9(Jw.unstable_batchedUpdates);var gT=(lg=zh.finalizeAllImmediately)!==null&&lg!==void 0?lg:function(){};function vT(e,t){return t===void 0&&(t="observed"),Qy(e,t)}function mT(e){c9(e)}const yT=Object.freeze(Object.defineProperty({__proto__:null,Observer:p9,_observerFinalizationRegistry:zh,clearTimers:gT,enableStaticRendering:c9,isObserverBatched:WC,isUsingStaticRendering:Zy,observer:cT,observerBatching:s9,useAsObservableSource:g9,useLocalObservable:hT,useLocalStore:pT,useObserver:vT,useStaticRendering:mT},Symbol.toStringTag,{value:"Module"})),Hi=Do(yT);var v9={};const ha=Do(VC);var Jy={exports:{}},Sp={},Bh={},gt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const t=Math.PI/180;function r(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof we<"u"?we:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.11",isBrowser:r(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return e.Konva.angleDeg?i*t:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var i;return(i=e.Konva.Transformer)===null||i===void 0?void 0:i.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(i){e.glob.Konva=i}};const n=i=>{e.Konva[i.prototype.getClassName()]=i};e._registerNode=n,e.Konva._injectGlobal(e.Konva)})(gt);var ir={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=gt;class r{constructor(_=[1,0,0,1,0,0]){this.dirty=!1,this.m=_&&_.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new r(this.m)}copyInto(_){_.m[0]=this.m[0],_.m[1]=this.m[1],_.m[2]=this.m[2],_.m[3]=this.m[3],_.m[4]=this.m[4],_.m[5]=this.m[5]}point(_){var O=this.m;return{x:O[0]*_.x+O[2]*_.y+O[4],y:O[1]*_.x+O[3]*_.y+O[5]}}translate(_,O){return this.m[4]+=this.m[0]*_+this.m[2]*O,this.m[5]+=this.m[1]*_+this.m[3]*O,this}scale(_,O){return this.m[0]*=_,this.m[1]*=_,this.m[2]*=O,this.m[3]*=O,this}rotate(_){var O=Math.cos(_),k=Math.sin(_),C=this.m[0]*O+this.m[2]*k,S=this.m[1]*O+this.m[3]*k,x=this.m[0]*-k+this.m[2]*O,P=this.m[1]*-k+this.m[3]*O;return this.m[0]=C,this.m[1]=S,this.m[2]=x,this.m[3]=P,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(_,O){var k=this.m[0]+this.m[2]*O,C=this.m[1]+this.m[3]*O,S=this.m[2]+this.m[0]*_,x=this.m[3]+this.m[1]*_;return this.m[0]=k,this.m[1]=C,this.m[2]=S,this.m[3]=x,this}multiply(_){var O=this.m[0]*_.m[0]+this.m[2]*_.m[1],k=this.m[1]*_.m[0]+this.m[3]*_.m[1],C=this.m[0]*_.m[2]+this.m[2]*_.m[3],S=this.m[1]*_.m[2]+this.m[3]*_.m[3],x=this.m[0]*_.m[4]+this.m[2]*_.m[5]+this.m[4],P=this.m[1]*_.m[4]+this.m[3]*_.m[5]+this.m[5];return this.m[0]=O,this.m[1]=k,this.m[2]=C,this.m[3]=S,this.m[4]=x,this.m[5]=P,this}invert(){var _=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),O=this.m[3]*_,k=-this.m[1]*_,C=-this.m[2]*_,S=this.m[0]*_,x=_*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),P=_*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=O,this.m[1]=k,this.m[2]=C,this.m[3]=S,this.m[4]=x,this.m[5]=P,this}getMatrix(){return this.m}decompose(){var _=this.m[0],O=this.m[1],k=this.m[2],C=this.m[3],S=this.m[4],x=this.m[5],P=_*C-O*k;let T={x:S,y:x,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(_!=0||O!=0){var L=Math.sqrt(_*_+O*O);T.rotation=O>0?Math.acos(_/L):-Math.acos(_/L),T.scaleX=L,T.scaleY=P/L,T.skewX=(_*k+O*C)/P,T.skewY=0}else if(k!=0||C!=0){var M=Math.sqrt(k*k+C*C);T.rotation=Math.PI/2-(C>0?Math.acos(-k/M):-Math.acos(k/M)),T.scaleX=P/M,T.scaleY=M,T.skewX=0,T.skewY=(_*k+O*C)/P}return T.rotation=e.Util._getRotation(T.rotation),T}}e.Transform=r;var n="[object Array]",i="[object Number]",a="[object String]",o="[object Boolean]",l=Math.PI/180,u=180/Math.PI,f="#",v="",w="0",b="Konva warning: ",h="Konva error: ",E="rgb(",y={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},m=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,p=[];const g=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(d){setTimeout(d,60)};e.Util={_isElement(d){return!!(d&&d.nodeType==1)},_isFunction(d){return!!(d&&d.constructor&&d.call&&d.apply)},_isPlainObject(d){return!!d&&d.constructor===Object},_isArray(d){return Object.prototype.toString.call(d)===n},_isNumber(d){return Object.prototype.toString.call(d)===i&&!isNaN(d)&&isFinite(d)},_isString(d){return Object.prototype.toString.call(d)===a},_isBoolean(d){return Object.prototype.toString.call(d)===o},isObject(d){return d instanceof Object},isValidSelector(d){if(typeof d!="string")return!1;var _=d[0];return _==="#"||_==="."||_===_.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){p.push(d),p.length===1&&g(function(){const _=p;p=[],_.forEach(function(O){O()})})},createCanvasElement(){var d=document.createElement("canvas");try{d.style=d.style||{}}catch{}return d},createImageElement(){return document.createElement("img")},_isInDocument(d){for(;d=d.parentNode;)if(d==document)return!0;return!1},_urlToImage(d,_){var O=e.Util.createImageElement();O.onload=function(){_(O)},O.src=d},_rgbToHex(d,_,O){return((1<<24)+(d<<16)+(_<<8)+O).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,v);var _=parseInt(d,16);return{r:_>>16&255,g:_>>8&255,b:_&255}},getRandomColor(){for(var d=(Math.random()*16777215<<0).toString(16);d.length<6;)d=w+d;return f+d},getRGB(d){var _;return d in y?(_=y[d],{r:_[0],g:_[1],b:_[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===E?(_=m.exec(d.replace(/ /g,"")),{r:parseInt(_[1],10),g:parseInt(_[2],10),b:parseInt(_[3],10)}):{r:0,g:0,b:0}},colorToRGBA(d){return d=d||"black",e.Util._namedColorToRBA(d)||e.Util._hex3ColorToRGBA(d)||e.Util._hex4ColorToRGBA(d)||e.Util._hex6ColorToRGBA(d)||e.Util._hex8ColorToRGBA(d)||e.Util._rgbColorToRGBA(d)||e.Util._rgbaColorToRGBA(d)||e.Util._hslColorToRGBA(d)},_namedColorToRBA(d){var _=y[d.toLowerCase()];return _?{r:_[0],g:_[1],b:_[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];var _=d.split(/ *, */).map(Number);return{r:_[0],g:_[1],b:_[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];var _=d.split(/ *, */).map((O,k)=>O.slice(-1)==="%"?k===3?parseInt(O)/100:parseInt(O)/100*255:Number(O));return{r:_[0],g:_[1],b:_[2],a:_[3]}}},_hex8ColorToRGBA(d){if(d[0]==="#"&&d.length===9)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:parseInt(d.slice(7,9),16)/255}},_hex6ColorToRGBA(d){if(d[0]==="#"&&d.length===7)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:1}},_hex4ColorToRGBA(d){if(d[0]==="#"&&d.length===5)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:parseInt(d[4]+d[4],16)/255}},_hex3ColorToRGBA(d){if(d[0]==="#"&&d.length===4)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:1}},_hslColorToRGBA(d){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(d)){const[_,...O]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),k=Number(O[0])/360,C=Number(O[1])/100,S=Number(O[2])/100;let x,P,T;if(C===0)return T=S*255,{r:Math.round(T),g:Math.round(T),b:Math.round(T),a:1};S<.5?x=S*(1+C):x=S+C-S*C;const L=2*S-x,M=[0,0,0];for(let U=0;U<3;U++)P=k+1/3*-(U-1),P<0&&P++,P>1&&P--,6*P<1?T=L+(x-L)*6*P:2*P<1?T=x:3*P<2?T=L+(x-L)*(2/3-P)*6:T=L,M[U]=T*255;return{r:Math.round(M[0]),g:Math.round(M[1]),b:Math.round(M[2]),a:1}}},haveIntersection(d,_){return!(_.x>d.x+d.width||_.x+_.width<d.x||_.y>d.y+d.height||_.y+_.height<d.y)},cloneObject(d){var _={};for(var O in d)this._isPlainObject(d[O])?_[O]=this.cloneObject(d[O]):this._isArray(d[O])?_[O]=this.cloneArray(d[O]):_[O]=d[O];return _},cloneArray(d){return d.slice(0)},degToRad(d){return d*l},radToDeg(d){return d*u},_degToRad(d){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(d)},_radToDeg(d){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(d)},_getRotation(d){return t.Konva.angleDeg?e.Util.radToDeg(d):d},_capitalize(d){return d.charAt(0).toUpperCase()+d.slice(1)},throw(d){throw new Error(h+d)},error(d){console.error(h+d)},warn(d){t.Konva.showWarnings&&console.warn(b+d)},each(d,_){for(var O in d)_(O,d[O])},_inRange(d,_,O){return _<=d&&d<O},_getProjectionToSegment(d,_,O,k,C,S){var x,P,T,L=(d-O)*(d-O)+(_-k)*(_-k);if(L==0)x=d,P=_,T=(C-O)*(C-O)+(S-k)*(S-k);else{var M=((C-d)*(O-d)+(S-_)*(k-_))/L;M<0?(x=d,P=_,T=(d-C)*(d-C)+(_-S)*(_-S)):M>1?(x=O,P=k,T=(O-C)*(O-C)+(k-S)*(k-S)):(x=d+M*(O-d),P=_+M*(k-_),T=(x-C)*(x-C)+(P-S)*(P-S))}return[x,P,T]},_getProjectionToLine(d,_,O){var k=e.Util.cloneObject(d),C=Number.MAX_VALUE;return _.forEach(function(S,x){if(!(!O&&x===_.length-1)){var P=_[(x+1)%_.length],T=e.Util._getProjectionToSegment(S.x,S.y,P.x,P.y,d.x,d.y),L=T[0],M=T[1],U=T[2];U<C&&(k.x=L,k.y=M,C=U)}}),k},_prepareArrayForTween(d,_,O){var k,C=[],S=[];if(d.length>_.length){var x=_;_=d,d=x}for(k=0;k<d.length;k+=2)C.push({x:d[k],y:d[k+1]});for(k=0;k<_.length;k+=2)S.push({x:_[k],y:_[k+1]});var P=[];return S.forEach(function(T){var L=e.Util._getProjectionToLine(T,C,O);P.push(L.x),P.push(L.y)}),P},_prepareToStringify(d){var _;d.visitedByCircularReferenceRemoval=!0;for(var O in d)if(d.hasOwnProperty(O)&&d[O]&&typeof d[O]=="object"){if(_=Object.getOwnPropertyDescriptor(d,O),d[O].visitedByCircularReferenceRemoval||e.Util._isElement(d[O]))if(_.configurable)delete d[O];else return null;else if(e.Util._prepareToStringify(d[O])===null)if(_.configurable)delete d[O];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,_){for(var O in _)d[O]=_[O];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){t.Konva.releaseCanvasOnDestroy&&d.forEach(_=>{_.width=0,_.height=0})},drawRoundedRectPath(d,_,O,k){let C=0,S=0,x=0,P=0;typeof k=="number"?C=S=x=P=Math.min(k,_/2,O/2):(C=Math.min(k[0]||0,_/2,O/2),S=Math.min(k[1]||0,_/2,O/2),P=Math.min(k[2]||0,_/2,O/2),x=Math.min(k[3]||0,_/2,O/2)),d.moveTo(C,0),d.lineTo(_-S,0),d.arc(_-S,S,S,Math.PI*3/2,0,!1),d.lineTo(_,O-P),d.arc(_-P,O-P,P,0,Math.PI/2,!1),d.lineTo(x,O),d.arc(x,O-x,x,Math.PI/2,Math.PI,!1),d.lineTo(0,C),d.arc(C,C,C,Math.PI,Math.PI*3/2,!1)}}})(ir);var Qt={},vt={},Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.getComponentValidator=Ye.getBooleanValidator=Ye.getNumberArrayValidator=Ye.getFunctionValidator=Ye.getStringOrGradientValidator=Ye.getStringValidator=Ye.getNumberOrAutoValidator=Ye.getNumberOrArrayOfNumbersValidator=Ye.getNumberValidator=Ye.alphaComponent=Ye.RGBComponent=void 0;const Ga=gt,ur=ir;function $a(e){return ur.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||ur.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function bT(e){return e>255?255:e<0?0:Math.round(e)}Ye.RGBComponent=bT;function _T(e){return e>1?1:e<1e-4?1e-4:e}Ye.alphaComponent=_T;function wT(){if(Ga.Konva.isUnminified)return function(e,t){return ur.Util._isNumber(e)||ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}Ye.getNumberValidator=wT;function ST(e){if(Ga.Konva.isUnminified)return function(t,r){let n=ur.Util._isNumber(t),i=ur.Util._isArray(t)&&t.length==e;return!n&&!i&&ur.Util.warn($a(t)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+e+")"),t}}Ye.getNumberOrArrayOfNumbersValidator=ST;function ET(){if(Ga.Konva.isUnminified)return function(e,t){var r=ur.Util._isNumber(e),n=e==="auto";return r||n||ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}Ye.getNumberOrAutoValidator=ET;function OT(){if(Ga.Konva.isUnminified)return function(e,t){return ur.Util._isString(e)||ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}Ye.getStringValidator=OT;function xT(){if(Ga.Konva.isUnminified)return function(e,t){const r=ur.Util._isString(e),n=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return r||n||ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}Ye.getStringOrGradientValidator=xT;function PT(){if(Ga.Konva.isUnminified)return function(e,t){return ur.Util._isFunction(e)||ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}Ye.getFunctionValidator=PT;function CT(){if(Ga.Konva.isUnminified)return function(e,t){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&e instanceof r||(ur.Util._isArray(e)?e.forEach(function(n){ur.Util._isNumber(n)||ur.Util.warn('"'+t+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}Ye.getNumberArrayValidator=CT;function TT(){if(Ga.Konva.isUnminified)return function(e,t){var r=e===!0||e===!1;return r||ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}Ye.getBooleanValidator=TT;function AT(e){if(Ga.Konva.isUnminified)return function(t,r){return t==null||ur.Util.isObject(t)||ur.Util.warn($a(t)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+e),t}}Ye.getComponentValidator=AT;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=ir,r=Ye;var n="get",i="set";e.Factory={addGetterSetter(a,o,l,u,f){e.Factory.addGetter(a,o,l),e.Factory.addSetter(a,o,u,f),e.Factory.addOverloadedGetterSetter(a,o)},addGetter(a,o,l){var u=n+t.Util._capitalize(o);a.prototype[u]=a.prototype[u]||function(){var f=this.attrs[o];return f===void 0?l:f}},addSetter(a,o,l,u){var f=i+t.Util._capitalize(o);a.prototype[f]||e.Factory.overWriteSetter(a,o,l,u)},overWriteSetter(a,o,l,u){var f=i+t.Util._capitalize(o);a.prototype[f]=function(v){return l&&v!==void 0&&v!==null&&(v=l.call(this,v,o)),this._setAttr(o,v),u&&u.call(this),this}},addComponentsGetterSetter(a,o,l,u,f){var v=l.length,w=t.Util._capitalize,b=n+w(o),h=i+w(o),E,y;a.prototype[b]=function(){var p={};for(E=0;E<v;E++)y=l[E],p[y]=this.getAttr(o+w(y));return p};var m=(0,r.getComponentValidator)(l);a.prototype[h]=function(p){var g=this.attrs[o],d;u&&(p=u.call(this,p)),m&&m.call(this,p,o);for(d in p)p.hasOwnProperty(d)&&this._setAttr(o+w(d),p[d]);return p||l.forEach(_=>{this._setAttr(o+w(_),void 0)}),this._fireChangeEvent(o,g,p),f&&f.call(this),this},e.Factory.addOverloadedGetterSetter(a,o)},addOverloadedGetterSetter(a,o){var l=t.Util._capitalize(o),u=i+l,f=n+l;a.prototype[o]=function(){return arguments.length?(this[u](arguments[0]),this):this[f]()}},addDeprecatedGetterSetter(a,o,l,u){t.Util.error("Adding deprecated "+o);var f=n+t.Util._capitalize(o),v=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[f]=function(){t.Util.error(v);var w=this.attrs[o];return w===void 0?l:w},e.Factory.addSetter(a,o,u,function(){t.Util.error(v)}),e.Factory.addOverloadedGetterSetter(a,o)},backCompat(a,o){t.Util.each(o,function(l,u){var f=a.prototype[u],v=n+t.Util._capitalize(l),w=i+t.Util._capitalize(l);function b(){f.apply(this,arguments),t.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}a.prototype[l]=b,a.prototype[v]=b,a.prototype[w]=b})},afterSetFilter(){this._filterUpToDate=!1}}})(vt);var ji={},Na={};Object.defineProperty(Na,"__esModule",{value:!0});Na.HitContext=Na.SceneContext=Na.Context=void 0;const m9=ir,kT=gt;function RT(e){var t=[],r=e.length,n=m9.Util,i,a;for(i=0;i<r;i++)a=e[i],n._isNumber(a)?a=Math.round(a*1e3)/1e3:n._isString(a)||(a=a+""),t.push(a);return t}var z5=",",LT="(",MT=")",NT="([",IT="])",DT=";",FT="()",jT="=",B5=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],zT=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const BT=100;class Ep{constructor(t){this.canvas=t,kT.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,r){var n=this.traceArr,i=n.length,a="",o,l,u,f;for(o=0;o<i;o++)l=n[o],u=l.method,u?(f=l.args,a+=u,t?a+=FT:m9.Util._isArray(f[0])?a+=NT+f.join(z5)+IT:(r&&(f=f.map(v=>typeof v=="number"?Math.floor(v):v)),a+=LT+f.join(z5)+MT)):(a+=l.property,t||(a+=jT+l.val)),a+=DT;return a}clearTrace(){this.traceArr=[]}_trace(t){var r=this.traceArr,n;r.push(t),n=r.length,n>=BT&&r.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var r=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,r.getWidth()/r.pixelRatio,r.getHeight()/r.pixelRatio)}_applyLineCap(t){const r=t.attrs.lineCap;r&&this.setAttr("lineCap",r)}_applyOpacity(t){var r=t.getAbsoluteOpacity();r!==1&&this.setAttr("globalAlpha",r)}_applyLineJoin(t){const r=t.attrs.lineJoin;r&&this.setAttr("lineJoin",r)}setAttr(t,r){this._context[t]=r}arc(t,r,n,i,a,o){this._context.arc(t,r,n,i,a,o)}arcTo(t,r,n,i,a){this._context.arcTo(t,r,n,i,a)}beginPath(){this._context.beginPath()}bezierCurveTo(t,r,n,i,a,o){this._context.bezierCurveTo(t,r,n,i,a,o)}clearRect(t,r,n,i){this._context.clearRect(t,r,n,i)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,r){var n=arguments;if(n.length===2)return this._context.createImageData(t,r);if(n.length===1)return this._context.createImageData(t)}createLinearGradient(t,r,n,i){return this._context.createLinearGradient(t,r,n,i)}createPattern(t,r){return this._context.createPattern(t,r)}createRadialGradient(t,r,n,i,a,o){return this._context.createRadialGradient(t,r,n,i,a,o)}drawImage(t,r,n,i,a,o,l,u,f){var v=arguments,w=this._context;v.length===3?w.drawImage(t,r,n):v.length===5?w.drawImage(t,r,n,i,a):v.length===9&&w.drawImage(t,r,n,i,a,o,l,u,f)}ellipse(t,r,n,i,a,o,l,u){this._context.ellipse(t,r,n,i,a,o,l,u)}isPointInPath(t,r,n,i){return n?this._context.isPointInPath(n,t,r,i):this._context.isPointInPath(t,r,i)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,r,n,i){this._context.fillRect(t,r,n,i)}strokeRect(t,r,n,i){this._context.strokeRect(t,r,n,i)}fillText(t,r,n,i){i?this._context.fillText(t,r,n,i):this._context.fillText(t,r,n)}measureText(t){return this._context.measureText(t)}getImageData(t,r,n,i){return this._context.getImageData(t,r,n,i)}lineTo(t,r){this._context.lineTo(t,r)}moveTo(t,r){this._context.moveTo(t,r)}rect(t,r,n,i){this._context.rect(t,r,n,i)}roundRect(t,r,n,i,a){this._context.roundRect(t,r,n,i,a)}putImageData(t,r,n){this._context.putImageData(t,r,n)}quadraticCurveTo(t,r,n,i){this._context.quadraticCurveTo(t,r,n,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,r){this._context.scale(t,r)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,r,n,i,a,o){this._context.setTransform(t,r,n,i,a,o)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,r,n,i){this._context.strokeText(t,r,n,i)}transform(t,r,n,i,a,o){this._context.transform(t,r,n,i,a,o)}translate(t,r){this._context.translate(t,r)}_enableTrace(){var t=this,r=B5.length,n=this.setAttr,i,a,o=function(l){var u=t[l],f;t[l]=function(){return a=RT(Array.prototype.slice.call(arguments,0)),f=u.apply(t,arguments),t._trace({method:l,args:a}),f}};for(i=0;i<r;i++)o(B5[i]);t.setAttr=function(){n.apply(t,arguments);var l=arguments[0],u=arguments[1];(l==="shadowOffsetX"||l==="shadowOffsetY"||l==="shadowBlur")&&(u=u/this.canvas.getPixelRatio()),t._trace({property:l,val:u})}}_applyGlobalCompositeOperation(t){const r=t.attrs.globalCompositeOperation;var n=!r||r==="source-over";n||this.setAttr("globalCompositeOperation",r)}}Na.Context=Ep;zT.forEach(function(e){Object.defineProperty(Ep.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class UT extends Ep{constructor(t,{willReadFrequently:r=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:r})}_fillColor(t){var r=t.fill();this.setAttr("fillStyle",r),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var r=t._getLinearGradient();r&&(this.setAttr("fillStyle",r),t._fillFunc(this))}_fillRadialGradient(t){const r=t._getRadialGradient();r&&(this.setAttr("fillStyle",r),t._fillFunc(this))}_fill(t){const r=t.fill(),n=t.getFillPriority();if(r&&n==="color"){this._fillColor(t);return}const i=t.getFillPatternImage();if(i&&n==="pattern"){this._fillPattern(t);return}const a=t.getFillLinearGradientColorStops();if(a&&n==="linear-gradient"){this._fillLinearGradient(t);return}const o=t.getFillRadialGradientColorStops();if(o&&n==="radial-gradient"){this._fillRadialGradient(t);return}r?this._fillColor(t):i?this._fillPattern(t):a?this._fillLinearGradient(t):o&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const r=t.getStrokeLinearGradientStartPoint(),n=t.getStrokeLinearGradientEndPoint(),i=t.getStrokeLinearGradientColorStops(),a=this.createLinearGradient(r.x,r.y,n.x,n.y);if(i){for(var o=0;o<i.length;o+=2)a.addColorStop(i[o],i[o+1]);this.setAttr("strokeStyle",a)}}_stroke(t){var r=t.dash(),n=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!n){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t),r&&t.dashEnabled()&&(this.setLineDash(r),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var a=t.getStrokeLinearGradientColorStops();a?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),n||this.restore()}}_applyShadow(t){var r,n,i,a=(r=t.getShadowRGBA())!==null&&r!==void 0?r:"black",o=(n=t.getShadowBlur())!==null&&n!==void 0?n:5,l=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},u=t.getAbsoluteScale(),f=this.canvas.getPixelRatio(),v=u.x*f,w=u.y*f;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(v),Math.abs(w))),this.setAttr("shadowOffsetX",l.x*v),this.setAttr("shadowOffsetY",l.y*w)}}Na.SceneContext=UT;class HT extends Ep{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const a=t.getStrokeScaleEnabled();if(!a){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t);var n=t.hitStrokeWidth(),i=n==="auto"?t.strokeWidth():n;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),a||this.restore()}}}Na.HitContext=HT;Object.defineProperty(ji,"__esModule",{value:!0});ji.HitCanvas=ji.SceneCanvas=ji.Canvas=void 0;const Uh=ir,y9=Na,b9=gt,GT=vt,$T=Ye;var Fd;function VT(){if(Fd)return Fd;var e=Uh.Util.createCanvasElement(),t=e.getContext("2d");return Fd=function(){var r=b9.Konva._global.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return r/n}(),Uh.Util.releaseCanvas(e),Fd}class Op{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var r=t||{},n=r.pixelRatio||b9.Konva.pixelRatio||VT();this.pixelRatio=n,this._canvas=Uh.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var r=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/r,this.getHeight()/r)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var r=this.pixelRatio,n=this.getContext()._context;n.scale(r,r)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var r=this.pixelRatio,n=this.getContext()._context;n.scale(r,r)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,r){this.setWidth(t||0),this.setHeight(r||0)}toDataURL(t,r){try{return this._canvas.toDataURL(t,r)}catch{try{return this._canvas.toDataURL()}catch(i){return Uh.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}ji.Canvas=Op;GT.Factory.addGetterSetter(Op,"pixelRatio",void 0,(0,$T.getNumberValidator)());class qT extends Op{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new y9.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}ji.SceneCanvas=qT;class WT extends Op{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new y9.HitContext(this),this.setSize(t.width,t.height)}}ji.HitCanvas=WT;var xp={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=gt,r=ir;e.DD={get isDragging(){var n=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){var n;return e.DD._dragElements.forEach(i=>{n=i.node}),n},_dragElements:new Map,_drag(n){const i=[];e.DD._dragElements.forEach((a,o)=>{const{node:l}=a,u=l.getStage();u.setPointersPositions(n),a.pointerId===void 0&&(a.pointerId=r.Util._getFirstPointerId(n));const f=u._changedPointerPositions.find(b=>b.id===a.pointerId);if(f){if(a.dragStatus!=="dragging"){var v=l.dragDistance(),w=Math.max(Math.abs(f.x-a.startPointerPos.x),Math.abs(f.y-a.startPointerPos.y));if(w<v||(l.startDrag({evt:n}),!l.isDragging()))return}l._setDragPosition(n,a),i.push(l)}}),i.forEach(a=>{a.fire("dragmove",{type:"dragmove",target:a,evt:n},!0)})},_endDragBefore(n){const i=[];e.DD._dragElements.forEach(a=>{const{node:o}=a,l=o.getStage();if(n&&l.setPointersPositions(n),!l._changedPointerPositions.find(v=>v.id===a.pointerId))return;(a.dragStatus==="dragging"||a.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,a.dragStatus="stopped");const f=a.node.getLayer()||a.node instanceof t.Konva.Stage&&a.node;f&&i.indexOf(f)===-1&&i.push(f)}),i.forEach(a=>{a.draw()})},_endDragAfter(n){e.DD._dragElements.forEach((i,a)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:n},!0),i.dragStatus!=="dragging"&&e.DD._dragElements.delete(a)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(xp);Object.defineProperty(Qt,"__esModule",{value:!0});Qt.Node=void 0;const _t=ir,vf=vt,ic=ji,co=gt,oi=xp,gr=Ye;var ih="absoluteOpacity",jd="allEventListeners",Pa="absoluteTransform",U5="absoluteScale",ll="canvas",YT="Change",KT="children",XT="konva",Em="listening",H5="mouseenter",G5="mouseleave",$5="set",V5="Shape",ah=" ",q5="stage",fo="transform",ZT="Stage",Om="visible",QT=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(ah);let JT=1,ct=class xm{constructor(t){this._id=JT++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===fo||t===Pa)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,r){var n=this._cache.get(t),i=t===fo||t===Pa,a=n===void 0||i&&n.dirty===!0;return a&&(n=r.call(this),this._cache.set(t,n)),n}_calculate(t,r,n){if(!this._attachedDepsListeners.get(t)){const i=r.map(a=>a+"Change.konva").join(ah);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get(ll)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Pa&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(ll)){const{scene:t,filter:r,hit:n}=this._cache.get(ll);_t.Util.releaseCanvas(t,r,n),this._cache.delete(ll)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var r=t||{},n={};(r.x===void 0||r.y===void 0||r.width===void 0||r.height===void 0)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var i=Math.ceil(r.width||n.width),a=Math.ceil(r.height||n.height),o=r.pixelRatio,l=r.x===void 0?Math.floor(n.x):r.x,u=r.y===void 0?Math.floor(n.y):r.y,f=r.offset||0,v=r.drawBorder||!1,w=r.hitCanvasPixelRatio||1;if(!i||!a){_t.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const b=Math.abs(Math.round(n.x)-l)>.5?1:0,h=Math.abs(Math.round(n.y)-u)>.5?1:0;i+=f*2+b,a+=f*2+h,l-=f,u-=f;var E=new ic.SceneCanvas({pixelRatio:o,width:i,height:a}),y=new ic.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),m=new ic.HitCanvas({pixelRatio:w,width:i,height:a}),p=E.getContext(),g=m.getContext();return m.isCache=!0,E.isCache=!0,this._cache.delete(ll),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(E.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),p.save(),g.save(),p.translate(-l,-u),g.translate(-l,-u),this._isUnderCache=!0,this._clearSelfAndDescendantCache(ih),this._clearSelfAndDescendantCache(U5),this.drawScene(E,this),this.drawHit(m,this),this._isUnderCache=!1,p.restore(),g.restore(),v&&(p.save(),p.beginPath(),p.rect(0,0,i,a),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set(ll,{scene:E,filter:y,hit:m,x:l,y:u}),this._requestDraw(),this}isCached(){return this._cache.has(ll)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,r){var n=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i=1/0,a=1/0,o=-1/0,l=-1/0,u=this.getAbsoluteTransform(r);return n.forEach(function(f){var v=u.point(f);i===void 0&&(i=o=v.x,a=l=v.y),i=Math.min(i,v.x),a=Math.min(a,v.y),o=Math.max(o,v.x),l=Math.max(l,v.y)}),{x:i,y:a,width:o-i,height:l-a}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const r=this._getCanvasCache();t.translate(r.x,r.y);var n=this._getCachedSceneCanvas(),i=n.pixelRatio;t.drawImage(n._canvas,0,0,n.width/i,n.height/i),t.restore()}_drawCachedHitCanvas(t){var r=this._getCanvasCache(),n=r.hit;t.save(),t.translate(r.x,r.y),t.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),r=this._getCanvasCache(),n=r.scene,i=r.filter,a=i.getContext(),o,l,u,f;if(t){if(!this._filterUpToDate){var v=n.pixelRatio;i.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio);try{for(o=t.length,a.clear(),a.drawImage(n._canvas,0,0,n.getWidth()/v,n.getHeight()/v),l=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++){if(f=t[u],typeof f!="function"){_t.Util.error("Filter should be type of function, but got "+typeof f+" instead. Please check correct filters");continue}f.call(this,l),a.putImageData(l,0,0)}}catch(w){_t.Util.error("Unable to apply filter. "+w.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return n}on(t,r){if(this._cache&&this._cache.delete(jd),arguments.length===3)return this._delegate.apply(this,arguments);var n=t.split(ah),i=n.length,a,o,l,u,f;for(a=0;a<i;a++)o=n[a],l=o.split("."),u=l[0],f=l[1]||"",this.eventListeners[u]||(this.eventListeners[u]=[]),this.eventListeners[u].push({name:f,handler:r});return this}off(t,r){var n=(t||"").split(ah),i=n.length,a,o,l,u,f,v;if(this._cache&&this._cache.delete(jd),!t)for(o in this.eventListeners)this._off(o);for(a=0;a<i;a++)if(l=n[a],u=l.split("."),f=u[0],v=u[1],f)this.eventListeners[f]&&this._off(f,v,r);else for(o in this.eventListeners)this._off(o,v,r);return this}dispatchEvent(t){var r={target:this,type:t.type,evt:t};return this.fire(t.type,r),this}addEventListener(t,r){return this.on(t,function(n){r.call(this,n.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,r,n){var i=this;this.on(t,function(a){for(var o=a.target.findAncestors(r,!0,i),l=0;l<o.length;l++)a=_t.Util.cloneObject(a),a.currentTarget=o[l],n.call(o[l],a)})}remove(){return this.isDragging()&&this.stopDrag(),oi.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Pa),this._clearSelfAndDescendantCache(ih),this._clearSelfAndDescendantCache(U5),this._clearSelfAndDescendantCache(q5),this._clearSelfAndDescendantCache(Om),this._clearSelfAndDescendantCache(Em)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var r="get"+_t.Util._capitalize(t);return _t.Util._isFunction(this[r])?this[r]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),r=[];t;)r.push(t),t=t.getParent();return r}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var r,n;if(!t)return this;for(r in t)r!==KT&&(n=$5+_t.Util._capitalize(r),_t.Util._isFunction(this[n])?this[n](t[r]):this._setAttr(r,t[r]))}),this}isListening(){return this._getCache(Em,this._isListening)}_isListening(t){if(!this.listening())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isListening(t):!0}isVisible(){return this._getCache(Om,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isVisible(t):!0}shouldDrawHit(t,r=!1){if(t)return this._isVisible(t)&&this._isListening(t);var n=this.getLayer(),i=!1;oi.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(i=!0)});var a=!r&&!co.Konva.hitOnDragEnabled&&(i||co.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!a}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),r=this,n=0,i,a,o,l;function u(v){for(i=[],a=v.length,o=0;o<a;o++)l=v[o],n++,l.nodeType!==V5&&(i=i.concat(l.getChildren().slice())),l._id===r._id&&(o=a);i.length>0&&i[0].getDepth()<=t&&u(i)}const f=this.getStage();return r.nodeType!==ZT&&f&&u(f.getChildren()),n}getDepth(){for(var t=0,r=this.parent;r;)t++,r=r.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(fo),this._clearSelfAndDescendantCache(Pa)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;var r=t.getPointerPosition();if(!r)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(r)}getAbsolutePosition(t){let r=!1,n=this.parent;for(;n;){if(n.isCached()){r=!0;break}n=n.parent}r&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),a=new _t.Transform,o=this.offset();return a.m=i.slice(),a.translate(o.x,o.y),a.getTranslation()}setAbsolutePosition(t){const{x:r,y:n,...i}=this._clearTransform();this.attrs.x=r,this.attrs.y=n,this._clearCache(fo);var a=this._getAbsoluteTransform().copy();return a.invert(),a.translate(t.x,t.y),t={x:this.attrs.x+a.getTranslation().x,y:this.attrs.y+a.getTranslation().y},this._setTransform(i),this.setPosition({x:t.x,y:t.y}),this._clearCache(fo),this._clearSelfAndDescendantCache(Pa),this}_setTransform(t){var r;for(r in t)this.attrs[r]=t[r]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var r=t.x,n=t.y,i=this.x(),a=this.y();return r!==void 0&&(i+=r),n!==void 0&&(a+=n),this.setPosition({x:i,y:a}),this}_eachAncestorReverse(t,r){var n=[],i=this.getParent(),a,o;if(!(r&&r._id===this._id)){for(n.unshift(this);i&&(!r||i._id!==r._id);)n.unshift(i),i=i.parent;for(a=n.length,o=0;o<a;o++)t(n[o])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return _t.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index,r=this.parent.getChildren().length;return t<r-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return _t.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,r=this.parent.getChildren().length;return t<r-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return _t.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return _t.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return _t.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&_t.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var r=this.index;return this.parent.children.splice(r,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(ih,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),r=this.getParent();return r&&!r._isUnderCache&&(t*=r.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t=this.getAttrs(),r,n,i,a,o;const l={attrs:{},className:this.getClassName()};for(r in t)n=t[r],o=_t.Util.isObject(n)&&!_t.Util._isPlainObject(n)&&!_t.Util._isArray(n),!o&&(i=typeof this[r]=="function"&&this[r],delete t[r],a=i?i.call(this):null,t[r]=n,a!==n&&(l.attrs[r]=n));return _t.Util._prepareToStringify(l)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,r,n){var i=[];r&&this._isMatch(t)&&i.push(this);for(var a=this.parent;a;){if(a===n)return i;a._isMatch(t)&&i.push(a),a=a.parent}return i}isAncestorOf(t){return!1}findAncestor(t,r,n){return this.findAncestors(t,r,n)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var r=t.replace(/ /g,"").split(","),n=r.length,i,a;for(i=0;i<n;i++)if(a=r[i],_t.Util.isValidSelector(a)||(_t.Util.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),_t.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),_t.Util.warn("Konva is awesome, right?")),a.charAt(0)==="#"){if(this.id()===a.slice(1))return!0}else if(a.charAt(0)==="."){if(this.hasName(a.slice(1)))return!0}else if(this.className===a||this.nodeType===a)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(q5,this._getStage)}_getStage(){var t=this.getParent();return t?t.getStage():null}fire(t,r={},n){return r.target=r.target||this,n?this._fireAndBubble(t,r):this._fire(t,r),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(Pa,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var r;if(t)return r=new _t.Transform,this._eachAncestorReverse(function(i){var a=i.transformsEnabled();a==="all"?r.multiply(i.getTransform()):a==="position"&&r.translate(i.x()-i.offsetX(),i.y()-i.offsetY())},t),r;r=this._cache.get(Pa)||new _t.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(r):r.reset();var n=this.transformsEnabled();if(n==="all")r.multiply(this.getTransform());else if(n==="position"){const i=this.attrs.x||0,a=this.attrs.y||0,o=this.attrs.offsetX||0,l=this.attrs.offsetY||0;r.translate(i-o,a-l)}return r.dirty=!1,r}getAbsoluteScale(t){for(var r=this;r;)r._isUnderCache&&(t=r),r=r.getParent();const i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(fo,this._getTransform)}_getTransform(){var t,r,n=this._cache.get(fo)||new _t.Transform;n.reset();var i=this.x(),a=this.y(),o=co.Konva.getAngle(this.rotation()),l=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,u=(r=this.attrs.scaleY)!==null&&r!==void 0?r:1,f=this.attrs.skewX||0,v=this.attrs.skewY||0,w=this.attrs.offsetX||0,b=this.attrs.offsetY||0;return(i!==0||a!==0)&&n.translate(i,a),o!==0&&n.rotate(o),(f!==0||v!==0)&&n.skew(f,v),(l!==1||u!==1)&&n.scale(l,u),(w!==0||b!==0)&&n.translate(-1*w,-1*b),n.dirty=!1,n}clone(t){var r=_t.Util.cloneObject(this.attrs),n,i,a,o,l;for(n in t)r[n]=t[n];var u=new this.constructor(r);for(n in this.eventListeners)for(i=this.eventListeners[n],a=i.length,o=0;o<a;o++)l=i[o],l.name.indexOf(XT)<0&&(u.eventListeners[n]||(u.eventListeners[n]=[]),u.eventListeners[n].push(l));return u}_toKonvaCanvas(t){t=t||{};var r=this.getClientRect(),n=this.getStage(),i=t.x!==void 0?t.x:Math.floor(r.x),a=t.y!==void 0?t.y:Math.floor(r.y),o=t.pixelRatio||1,l=new ic.SceneCanvas({width:t.width||Math.ceil(r.width)||(n?n.width():0),height:t.height||Math.ceil(r.height)||(n?n.height():0),pixelRatio:o}),u=l.getContext();const f=new ic.SceneCanvas({width:l.width/l.pixelRatio+Math.abs(i),height:l.height/l.pixelRatio+Math.abs(a),pixelRatio:l.pixelRatio});return t.imageSmoothingEnabled===!1&&(u._context.imageSmoothingEnabled=!1),u.save(),(i||a)&&u.translate(-1*i,-1*a),this.drawScene(l,void 0,f),u.restore(),l}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var r=t.mimeType||null,n=t.quality||null,i=this._toKonvaCanvas(t).toDataURL(r,n);return t.callback&&t.callback(i),i}toImage(t){return new Promise((r,n)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,_t.Util._urlToImage(this.toDataURL(t),function(a){r(a),i==null||i(a)})}catch(i){n(i)}})}toBlob(t){return new Promise((r,n)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(a=>{r(a),i==null||i(a)},t==null?void 0:t.mimeType,t==null?void 0:t.quality)}catch(i){n(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():co.Konva.dragDistance}_off(t,r,n){var i=this.eventListeners[t],a,o,l;for(a=0;a<i.length;a++)if(o=i[a].name,l=i[a].handler,(o!=="konva"||r==="konva")&&(!r||o===r)&&(!n||n===l)){if(i.splice(a,1),i.length===0){delete this.eventListeners[t];break}a--}}_fireChangeEvent(t,r,n){this._fire(t+YT,{oldVal:r,newVal:n})}addName(t){if(!this.hasName(t)){var r=this.name(),n=r?r+" "+t:t;this.name(n)}return this}hasName(t){if(!t)return!1;const r=this.name();if(!r)return!1;var n=(r||"").split(/\s/g);return n.indexOf(t)!==-1}removeName(t){var r=(this.name()||"").split(/\s/g),n=r.indexOf(t);return n!==-1&&(r.splice(n,1),this.name(r.join(" "))),this}setAttr(t,r){var n=this[$5+_t.Util._capitalize(t)];return _t.Util._isFunction(n)?n.call(this,r):this._setAttr(t,r),this}_requestDraw(){if(co.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,r){var n=this.attrs[t];n===r&&!_t.Util.isObject(r)||(r==null?delete this.attrs[t]:this.attrs[t]=r,this._shouldFireChangeEvents&&this._fireChangeEvent(t,n,r),this._requestDraw())}_setComponentAttr(t,r,n){var i;n!==void 0&&(i=this.attrs[t],i||(this.attrs[t]=this.getAttr(t)),this.attrs[t][r]=n,this._fireChangeEvent(t,i,n))}_fireAndBubble(t,r,n){r&&this.nodeType===V5&&(r.target=this);var i=(t===H5||t===G5)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n);if(!i){this._fire(t,r);var a=(t===H5||t===G5)&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(r&&!r.cancelBubble||!r)&&this.parent&&this.parent.isListening()&&!a&&(n&&n.parent?this._fireAndBubble.call(this.parent,t,r,n):this._fireAndBubble.call(this.parent,t,r))}}_getProtoListeners(t){var r,n,i;const a=(r=this._cache.get(jd))!==null&&r!==void 0?r:{};let o=a==null?void 0:a[t];if(o===void 0){o=[];let l=Object.getPrototypeOf(this);for(;l;){const u=(i=(n=l.eventListeners)===null||n===void 0?void 0:n[t])!==null&&i!==void 0?i:[];o.push(...u),l=Object.getPrototypeOf(l)}a[t]=o,this._cache.set(jd,a)}return o}_fire(t,r){r=r||{},r.currentTarget=this,r.type=t;const n=this._getProtoListeners(t);if(n)for(var i=0;i<n.length;i++)n[i].handler.call(this,r);const a=this.eventListeners[t];if(a)for(var i=0;i<a.length;i++)a[i].handler.call(this,r)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var r=t?t.pointerId:void 0,n=this.getStage(),i=this.getAbsolutePosition();if(n){var a=n._getPointerById(r)||n._changedPointerPositions[0]||i;oi.DD._dragElements.set(this._id,{node:this,startPointerPos:a,offset:{x:a.x-i.x,y:a.y-i.y},dragStatus:"ready",pointerId:r})}}startDrag(t,r=!0){oi.DD._dragElements.has(this._id)||this._createDragElement(t);const n=oi.DD._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},r)}_setDragPosition(t,r){const n=this.getStage()._getPointerById(r.pointerId);if(n){var i={x:n.x-r.offset.x,y:n.y-r.offset.y},a=this.dragBoundFunc();if(a!==void 0){const o=a.call(this,i,t);o?i=o:_t.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}}stopDrag(t){const r=oi.DD._dragElements.get(this._id);r&&(r.dragStatus="stopped"),oi.DD._endDragBefore(t),oi.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=oi.DD._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){var r=t.evt.button!==void 0,n=!r||co.Konva.dragButtons.indexOf(t.evt.button)>=0;if(n&&!this.isDragging()){var i=!1;oi.DD._dragElements.forEach(a=>{this.isAncestorOf(a.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const r=oi.DD._dragElements.get(this._id),n=r&&r.dragStatus==="dragging",i=r&&r.dragStatus==="ready";n?this.stopDrag():i&&oi.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const r=this.getStage();if(!r)return!1;const n={x:-t.x,y:-t.y,width:r.width()+2*t.x,height:r.height()+2*t.y};return _t.Util.haveIntersection(n,this.getClientRect())}static create(t,r){return _t.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,r)}static _createNode(t,r){var n=xm.prototype.getClassName.call(t),i=t.children,a,o,l;r&&(t.attrs.container=r),co.Konva[n]||(_t.Util.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=co.Konva[n];if(a=new u(t.attrs),i)for(o=i.length,l=0;l<o;l++)a.add(xm._createNode(i[l]));return a}};Qt.Node=ct;ct.prototype.nodeType="Node";ct.prototype._attrsAffectingSize=[];ct.prototype.eventListeners={};ct.prototype.on.call(ct.prototype,QT,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(fo),this._clearSelfAndDescendantCache(Pa)});ct.prototype.on.call(ct.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(Om)});ct.prototype.on.call(ct.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(Em)});ct.prototype.on.call(ct.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(ih)});const zt=vf.Factory.addGetterSetter;zt(ct,"zIndex");zt(ct,"absolutePosition");zt(ct,"position");zt(ct,"x",0,(0,gr.getNumberValidator)());zt(ct,"y",0,(0,gr.getNumberValidator)());zt(ct,"globalCompositeOperation","source-over",(0,gr.getStringValidator)());zt(ct,"opacity",1,(0,gr.getNumberValidator)());zt(ct,"name","",(0,gr.getStringValidator)());zt(ct,"id","",(0,gr.getStringValidator)());zt(ct,"rotation",0,(0,gr.getNumberValidator)());vf.Factory.addComponentsGetterSetter(ct,"scale",["x","y"]);zt(ct,"scaleX",1,(0,gr.getNumberValidator)());zt(ct,"scaleY",1,(0,gr.getNumberValidator)());vf.Factory.addComponentsGetterSetter(ct,"skew",["x","y"]);zt(ct,"skewX",0,(0,gr.getNumberValidator)());zt(ct,"skewY",0,(0,gr.getNumberValidator)());vf.Factory.addComponentsGetterSetter(ct,"offset",["x","y"]);zt(ct,"offsetX",0,(0,gr.getNumberValidator)());zt(ct,"offsetY",0,(0,gr.getNumberValidator)());zt(ct,"dragDistance",null,(0,gr.getNumberValidator)());zt(ct,"width",0,(0,gr.getNumberValidator)());zt(ct,"height",0,(0,gr.getNumberValidator)());zt(ct,"listening",!0,(0,gr.getBooleanValidator)());zt(ct,"preventDefault",!0,(0,gr.getBooleanValidator)());zt(ct,"filters",null,function(e){return this._filterUpToDate=!1,e});zt(ct,"visible",!0,(0,gr.getBooleanValidator)());zt(ct,"transformsEnabled","all",(0,gr.getStringValidator)());zt(ct,"size");zt(ct,"dragBoundFunc");zt(ct,"draggable",!1,(0,gr.getBooleanValidator)());vf.Factory.backCompat(ct,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var Dl={};Object.defineProperty(Dl,"__esModule",{value:!0});Dl.Container=void 0;const bu=vt,sg=Qt,Pp=Ye;class Fl extends sg.Node{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const r=this.children||[];var n=[];return r.forEach(function(i){t(i)&&n.push(i)}),n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(var r=0;r<t.length;r++)this.add(t[r]);return this}const n=t[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){var r=this._generalFind(t,!0);return r.length>0?r[0]:void 0}_generalFind(t,r){var n=[];return this._descendants(i=>{const a=i._isMatch(t);return a&&n.push(i),!!(a&&r)}),n}_descendants(t){let r=!1;const n=this.getChildren();for(const i of n){if(r=t(i),r)return!0;if(i.hasChildren()&&(r=i._descendants(t),r))return!0}return!1}toObject(){var t=sg.Node.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(r=>{t.children.push(r.toObject())}),t}isAncestorOf(t){for(var r=t.getParent();r;){if(r._id===this._id)return!0;r=r.getParent()}return!1}clone(t){var r=sg.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(n){r.add(n.clone())}),r}getAllIntersections(t){var r=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(t)&&r.push(n)}),r}_clearSelfAndDescendantCache(t){var r;super._clearSelfAndDescendantCache(t),!this.isCached()&&((r=this.children)===null||r===void 0||r.forEach(function(n){n._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(r,n){r.index=n}),this._requestDraw()}drawScene(t,r,n){var i=this.getLayer(),a=t||i&&i.getCanvas(),o=a&&a.getContext(),l=this._getCanvasCache(),u=l&&l.scene,f=a&&a.isCache;if(!this.isVisible()&&!f)return this;if(u){o.save();var v=this.getAbsoluteTransform(r).getMatrix();o.transform(v[0],v[1],v[2],v[3],v[4],v[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",a,r,n);return this}drawHit(t,r){if(!this.shouldDrawHit(r))return this;var n=this.getLayer(),i=t||n&&n.hitCanvas,a=i&&i.getContext(),o=this._getCanvasCache(),l=o&&o.hit;if(l){a.save();var u=this.getAbsoluteTransform(r).getMatrix();a.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",i,r);return this}_drawChildren(t,r,n,i){var a,o=r&&r.getContext(),l=this.clipWidth(),u=this.clipHeight(),f=this.clipFunc(),v=typeof l=="number"&&typeof u=="number"||f;const w=n===this;if(v){o.save();var b=this.getAbsoluteTransform(n),h=b.getMatrix();o.transform(h[0],h[1],h[2],h[3],h[4],h[5]),o.beginPath();let p;if(f)p=f.call(this,o,this);else{var E=this.clipX(),y=this.clipY();o.rect(E||0,y||0,l,u)}o.clip.apply(o,p),h=b.copy().invert().getMatrix(),o.transform(h[0],h[1],h[2],h[3],h[4],h[5])}var m=!w&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";m&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(p){p[t](r,n,i)}),m&&o.restore(),v&&o.restore()}getClientRect(t={}){var r,n=t.skipTransform,i=t.relativeTo,a,o,l,u,f={x:1/0,y:1/0,width:0,height:0},v=this;(r=this.children)===null||r===void 0||r.forEach(function(y){if(y.visible()){var m=y.getClientRect({relativeTo:v,skipShadow:t.skipShadow,skipStroke:t.skipStroke});m.width===0&&m.height===0||(a===void 0?(a=m.x,o=m.y,l=m.x+m.width,u=m.y+m.height):(a=Math.min(a,m.x),o=Math.min(o,m.y),l=Math.max(l,m.x+m.width),u=Math.max(u,m.y+m.height)))}});for(var w=this.find("Shape"),b=!1,h=0;h<w.length;h++){var E=w[h];if(E._isVisible(this)){b=!0;break}}return b&&a!==void 0?f={x:a,y:o,width:l-a,height:u-o}:f={x:0,y:0,width:0,height:0},n?f:this._transformedRect(f,i)}}Dl.Container=Fl;bu.Factory.addComponentsGetterSetter(Fl,"clip",["x","y","width","height"]);bu.Factory.addGetterSetter(Fl,"clipX",void 0,(0,Pp.getNumberValidator)());bu.Factory.addGetterSetter(Fl,"clipY",void 0,(0,Pp.getNumberValidator)());bu.Factory.addGetterSetter(Fl,"clipWidth",void 0,(0,Pp.getNumberValidator)());bu.Factory.addGetterSetter(Fl,"clipHeight",void 0,(0,Pp.getNumberValidator)());bu.Factory.addGetterSetter(Fl,"clipFunc");var _9={},Un={};Object.defineProperty(Un,"__esModule",{value:!0});Un.releaseCapture=Un.setPointerCapture=Un.hasPointerCapture=Un.createEvent=Un.getCapturedShape=void 0;const eA=gt,Wc=new Map,w9=eA.Konva._global.PointerEvent!==void 0;function tA(e){return Wc.get(e)}Un.getCapturedShape=tA;function e2(e){return{evt:e,pointerId:e.pointerId}}Un.createEvent=e2;function rA(e,t){return Wc.get(e)===t}Un.hasPointerCapture=rA;function nA(e,t){S9(e),t.getStage()&&(Wc.set(e,t),w9&&t._fire("gotpointercapture",e2(new PointerEvent("gotpointercapture"))))}Un.setPointerCapture=nA;function S9(e,t){const r=Wc.get(e);if(!r)return;const n=r.getStage();n&&n.content,Wc.delete(e),w9&&r._fire("lostpointercapture",e2(new PointerEvent("lostpointercapture")))}Un.releaseCapture=S9;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=ir,r=vt,n=Dl,i=gt,a=ji,o=xp,l=gt,u=Un;var f="Stage",v="string",w="px",b="mouseout",h="mouseleave",E="mouseover",y="mouseenter",m="mousemove",p="mousedown",g="mouseup",d="pointermove",_="pointerdown",O="pointerup",k="pointercancel",C="lostpointercapture",S="pointerout",x="pointerleave",P="pointerover",T="pointerenter",L="contextmenu",M="touchstart",U="touchend",$="touchmove",Z="touchcancel",z="wheel",N=5,H=[[y,"_pointerenter"],[p,"_pointerdown"],[m,"_pointermove"],[g,"_pointerup"],[h,"_pointerleave"],[M,"_pointerdown"],[$,"_pointermove"],[U,"_pointerup"],[Z,"_pointercancel"],[E,"_pointerover"],[z,"_wheel"],[L,"_contextmenu"],[_,"_pointerdown"],[d,"_pointermove"],[O,"_pointerup"],[k,"_pointercancel"],[C,"_lostpointercapture"]];const R={mouse:{[S]:b,[x]:h,[P]:E,[T]:y,[d]:m,[_]:p,[O]:g,[k]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[S]:"touchout",[x]:"touchleave",[P]:"touchover",[T]:"touchenter",[d]:$,[_]:M,[O]:U,[k]:Z,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[S]:S,[x]:x,[P]:P,[T]:T,[d]:d,[_]:_,[O]:O,[k]:k,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},F=q=>q.indexOf("pointer")>=0?"pointer":q.indexOf("touch")>=0?"touch":"mouse",B=q=>{const G=F(q);if(G==="pointer")return i.Konva.pointerEventsEnabled&&R.pointer;if(G==="touch")return R.touch;if(G==="mouse")return R.mouse};function D(q={}){return(q.clipFunc||q.clipWidth||q.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),q}const V="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class Y extends n.Container{constructor(G){super(D(G)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{D(this.attrs)}),this._checkVisibility()}_validateAdd(G){const K=G.getType()==="Layer",X=G.getType()==="FastLayer";K||X||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const G=this.visible()?"":"none";this.content.style.display=G}setContainer(G){if(typeof G===v){if(G.charAt(0)==="."){var K=G.slice(1);G=document.getElementsByClassName(K)[0]}else{var X;G.charAt(0)!=="#"?X=G:X=G.slice(1),G=document.getElementById(X)}if(!G)throw"Can not find container in document with id "+X}return this._setAttr("container",G),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),G.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var G=this.children,K=G.length,X;for(X=0;X<K;X++)G[X].clear();return this}clone(G){return G||(G={}),G.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,G)}destroy(){super.destroy();var G=this.content;G&&t.Util._isInDocument(G)&&this.container().removeChild(G);var K=e.stages.indexOf(this);return K>-1&&e.stages.splice(K,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const G=this._pointerPositions[0]||this._changedPointerPositions[0];return G?{x:G.x,y:G.y}:(t.Util.warn(V),null)}_getPointerById(G){return this._pointerPositions.find(K=>K.id===G)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(G){G=G||{},G.x=G.x||0,G.y=G.y||0,G.width=G.width||this.width(),G.height=G.height||this.height();var K=new a.SceneCanvas({width:G.width,height:G.height,pixelRatio:G.pixelRatio||1}),X=K.getContext()._context,Q=this.children;return(G.x||G.y)&&X.translate(-1*G.x,-1*G.y),Q.forEach(function(ee){if(ee.isVisible()){var te=ee._toKonvaCanvas(G);X.drawImage(te._canvas,G.x,G.y,te.getWidth()/te.getPixelRatio(),te.getHeight()/te.getPixelRatio())}}),K}getIntersection(G){if(!G)return null;var K=this.children,X=K.length,Q=X-1,ee;for(ee=Q;ee>=0;ee--){const te=K[ee].getIntersection(G);if(te)return te}return null}_resizeDOM(){var G=this.width(),K=this.height();this.content&&(this.content.style.width=G+w,this.content.style.height=K+w),this.bufferCanvas.setSize(G,K),this.bufferHitCanvas.setSize(G,K),this.children.forEach(X=>{X.setSize({width:G,height:K}),X.draw()})}add(G,...K){if(arguments.length>1){for(var X=0;X<arguments.length;X++)this.add(arguments[X]);return this}super.add(G);var Q=this.children.length;return Q>N&&t.Util.warn("The stage has "+Q+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),G.setSize({width:this.width(),height:this.height()}),G.draw(),i.Konva.isBrowser&&this.content.appendChild(G.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(G){return u.hasPointerCapture(G,this)}setPointerCapture(G){u.setPointerCapture(G,this)}releaseCapture(G){u.releaseCapture(G,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&H.forEach(([G,K])=>{this.content.addEventListener(G,X=>{this[K](X)},{passive:!1})})}_pointerenter(G){this.setPointersPositions(G);const K=B(G.type);K&&this._fire(K.pointerenter,{evt:G,target:this,currentTarget:this})}_pointerover(G){this.setPointersPositions(G);const K=B(G.type);K&&this._fire(K.pointerover,{evt:G,target:this,currentTarget:this})}_getTargetShape(G){let K=this[G+"targetShape"];return K&&!K.getStage()&&(K=null),K}_pointerleave(G){const K=B(G.type),X=F(G.type);if(K){this.setPointersPositions(G);var Q=this._getTargetShape(X),ee=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;Q&&ee?(Q._fireAndBubble(K.pointerout,{evt:G}),Q._fireAndBubble(K.pointerleave,{evt:G}),this._fire(K.pointerleave,{evt:G,target:this,currentTarget:this}),this[X+"targetShape"]=null):ee&&(this._fire(K.pointerleave,{evt:G,target:this,currentTarget:this}),this._fire(K.pointerout,{evt:G,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(G){const K=B(G.type),X=F(G.type);if(K){this.setPointersPositions(G);var Q=!1;this._changedPointerPositions.forEach(ee=>{var te=this.getIntersection(ee);if(o.DD.justDragged=!1,i.Konva["_"+X+"ListenClick"]=!0,!te||!te.isListening()){this[X+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&te.setPointerCapture(ee.id),this[X+"ClickStartShape"]=te,te._fireAndBubble(K.pointerdown,{evt:G,pointerId:ee.id}),Q=!0;const ae=G.type.indexOf("touch")>=0;te.preventDefault()&&G.cancelable&&ae&&G.preventDefault()}),Q||this._fire(K.pointerdown,{evt:G,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(G){const K=B(G.type),X=F(G.type);if(!K)return;i.Konva.isDragging()&&o.DD.node.preventDefault()&&G.cancelable&&G.preventDefault(),this.setPointersPositions(G);var Q=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;if(!Q)return;var ee={};let te=!1;var ae=this._getTargetShape(X);this._changedPointerPositions.forEach(oe=>{const se=u.getCapturedShape(oe.id)||this.getIntersection(oe),ke=oe.id,Fe={evt:G,pointerId:ke};var fe=ae!==se;if(fe&&ae&&(ae._fireAndBubble(K.pointerout,{...Fe},se),ae._fireAndBubble(K.pointerleave,{...Fe},se)),se){if(ee[se._id])return;ee[se._id]=!0}se&&se.isListening()?(te=!0,fe&&(se._fireAndBubble(K.pointerover,{...Fe},ae),se._fireAndBubble(K.pointerenter,{...Fe},ae),this[X+"targetShape"]=se),se._fireAndBubble(K.pointermove,{...Fe})):ae&&(this._fire(K.pointerover,{evt:G,target:this,currentTarget:this,pointerId:ke}),this[X+"targetShape"]=null)}),te||this._fire(K.pointermove,{evt:G,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(G){const K=B(G.type),X=F(G.type);if(!K)return;this.setPointersPositions(G);const Q=this[X+"ClickStartShape"],ee=this[X+"ClickEndShape"];var te={};let ae=!1;this._changedPointerPositions.forEach(oe=>{const se=u.getCapturedShape(oe.id)||this.getIntersection(oe);if(se){if(se.releaseCapture(oe.id),te[se._id])return;te[se._id]=!0}const ke=oe.id,Fe={evt:G,pointerId:ke};let fe=!1;i.Konva["_"+X+"InDblClickWindow"]?(fe=!0,clearTimeout(this[X+"DblTimeout"])):o.DD.justDragged||(i.Konva["_"+X+"InDblClickWindow"]=!0,clearTimeout(this[X+"DblTimeout"])),this[X+"DblTimeout"]=setTimeout(function(){i.Konva["_"+X+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),se&&se.isListening()?(ae=!0,this[X+"ClickEndShape"]=se,se._fireAndBubble(K.pointerup,{...Fe}),i.Konva["_"+X+"ListenClick"]&&Q&&Q===se&&(se._fireAndBubble(K.pointerclick,{...Fe}),fe&&ee&&ee===se&&se._fireAndBubble(K.pointerdblclick,{...Fe}))):(this[X+"ClickEndShape"]=null,i.Konva["_"+X+"ListenClick"]&&this._fire(K.pointerclick,{evt:G,target:this,currentTarget:this,pointerId:ke}),fe&&this._fire(K.pointerdblclick,{evt:G,target:this,currentTarget:this,pointerId:ke}))}),ae||this._fire(K.pointerup,{evt:G,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+X+"ListenClick"]=!1,G.cancelable&&X!=="touch"&&G.preventDefault()}_contextmenu(G){this.setPointersPositions(G);var K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(L,{evt:G}):this._fire(L,{evt:G,target:this,currentTarget:this})}_wheel(G){this.setPointersPositions(G);var K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(z,{evt:G}):this._fire(z,{evt:G,target:this,currentTarget:this})}_pointercancel(G){this.setPointersPositions(G);const K=u.getCapturedShape(G.pointerId)||this.getIntersection(this.getPointerPosition());K&&K._fireAndBubble(O,u.createEvent(G)),u.releaseCapture(G.pointerId)}_lostpointercapture(G){u.releaseCapture(G.pointerId)}setPointersPositions(G){var K=this._getContentPosition(),X=null,Q=null;G=G||window.event,G.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(G.touches,ee=>{this._pointerPositions.push({id:ee.identifier,x:(ee.clientX-K.left)/K.scaleX,y:(ee.clientY-K.top)/K.scaleY})}),Array.prototype.forEach.call(G.changedTouches||G.touches,ee=>{this._changedPointerPositions.push({id:ee.identifier,x:(ee.clientX-K.left)/K.scaleX,y:(ee.clientY-K.top)/K.scaleY})})):(X=(G.clientX-K.left)/K.scaleX,Q=(G.clientY-K.top)/K.scaleY,this.pointerPos={x:X,y:Q},this._pointerPositions=[{x:X,y:Q,id:t.Util._getFirstPointerId(G)}],this._changedPointerPositions=[{x:X,y:Q,id:t.Util._getFirstPointerId(G)}])}_setPointerPosition(G){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(G)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var G=this.content.getBoundingClientRect();return{top:G.top,left:G.left,scaleX:G.width/this.content.clientWidth||1,scaleY:G.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new a.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new a.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!i.Konva.isBrowser){var G=this.container();if(!G)throw"Stage has no container. A container is required.";G.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),G.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(G){G.batchDraw()}),this}}e.Stage=Y,Y.prototype.nodeType=f,(0,l._registerNode)(Y),r.Factory.addGetterSetter(Y,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(q=>{q.batchDraw()})})})(_9);var mf={},Ar={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=gt,r=ir,n=vt,i=Qt,a=Ye,o=gt,l=Un;var u="hasShadow",f="shadowRGBA",v="patternImage",w="linearGradient",b="radialGradient";let h;function E(){return h||(h=r.Util.createCanvasElement().getContext("2d"),h)}e.shapes={};function y(x){const P=this.attrs.fillRule;P?x.fill(P):x.fill()}function m(x){x.stroke()}function p(x){x.fill()}function g(x){x.stroke()}function d(){this._clearCache(u)}function _(){this._clearCache(f)}function O(){this._clearCache(v)}function k(){this._clearCache(w)}function C(){this._clearCache(b)}class S extends i.Node{constructor(P){super(P);let T;for(;T=r.Util.getRandomColor(),!(T&&!(T in e.shapes)););this.colorKey=T,e.shapes[T]=this}getContext(){return r.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return r.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(u,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(v,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var P=E();const T=P.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(T&&T.setTransform){const L=new r.Transform;L.translate(this.fillPatternX(),this.fillPatternY()),L.rotate(t.Konva.getAngle(this.fillPatternRotation())),L.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),L.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const M=L.getMatrix(),U=typeof DOMMatrix>"u"?{a:M[0],b:M[1],c:M[2],d:M[3],e:M[4],f:M[5]}:new DOMMatrix(M);T.setTransform(U)}return T}}_getLinearGradient(){return this._getCache(w,this.__getLinearGradient)}__getLinearGradient(){var P=this.fillLinearGradientColorStops();if(P){for(var T=E(),L=this.fillLinearGradientStartPoint(),M=this.fillLinearGradientEndPoint(),U=T.createLinearGradient(L.x,L.y,M.x,M.y),$=0;$<P.length;$+=2)U.addColorStop(P[$],P[$+1]);return U}}_getRadialGradient(){return this._getCache(b,this.__getRadialGradient)}__getRadialGradient(){var P=this.fillRadialGradientColorStops();if(P){for(var T=E(),L=this.fillRadialGradientStartPoint(),M=this.fillRadialGradientEndPoint(),U=T.createRadialGradient(L.x,L.y,this.fillRadialGradientStartRadius(),M.x,M.y,this.fillRadialGradientEndRadius()),$=0;$<P.length;$+=2)U.addColorStop(P[$],P[$+1]);return U}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var P=r.Util.colorToRGBA(this.shadowColor());if(P)return"rgba("+P.r+","+P.g+","+P.b+","+P.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const P=this.hitStrokeWidth();return P==="auto"?this.hasStroke():this.strokeEnabled()&&!!P}intersects(P){var T=this.getStage();if(!T)return!1;const L=T.bufferHitCanvas;return L.getContext().clear(),this.drawHit(L,void 0,!0),L.context.getImageData(Math.round(P.x),Math.round(P.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(P){var T;if(!((T=this.attrs.perfectDrawEnabled)!==null&&T!==void 0?T:!0))return!1;const M=P||this.hasFill(),U=this.hasStroke(),$=this.getAbsoluteOpacity()!==1;if(M&&U&&$)return!0;const Z=this.hasShadow(),z=this.shadowForStrokeEnabled();return!!(M&&U&&Z&&z)}setStrokeHitEnabled(P){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),P?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var P=this.size();return{x:this._centroid?-P.width/2:0,y:this._centroid?-P.height/2:0,width:P.width,height:P.height}}getClientRect(P={}){const T=P.skipTransform,L=P.relativeTo,M=this.getSelfRect(),$=!P.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,Z=M.width+$,z=M.height+$,N=!P.skipShadow&&this.hasShadow(),H=N?this.shadowOffsetX():0,R=N?this.shadowOffsetY():0,F=Z+Math.abs(H),B=z+Math.abs(R),D=N&&this.shadowBlur()||0,V=F+D*2,Y=B+D*2,q={width:V,height:Y,x:-($/2+D)+Math.min(H,0)+M.x,y:-($/2+D)+Math.min(R,0)+M.y};return T?q:this._transformedRect(q,L)}drawScene(P,T,L){var M=this.getLayer(),U=P||M.getCanvas(),$=U.getContext(),Z=this._getCanvasCache(),z=this.getSceneFunc(),N=this.hasShadow(),H,R,F=U.isCache,B=T===this;if(!this.isVisible()&&!B)return this;if(Z){$.save();var D=this.getAbsoluteTransform(T).getMatrix();return $.transform(D[0],D[1],D[2],D[3],D[4],D[5]),this._drawCachedSceneCanvas($),$.restore(),this}if(!z)return this;if($.save(),this._useBufferCanvas()&&!F){H=this.getStage();const q=L||H.bufferCanvas;R=q.getContext(),R.clear(),R.save(),R._applyLineJoin(this);var V=this.getAbsoluteTransform(T).getMatrix();R.transform(V[0],V[1],V[2],V[3],V[4],V[5]),z.call(this,R,this),R.restore();var Y=q.pixelRatio;N&&$._applyShadow(this),$._applyOpacity(this),$._applyGlobalCompositeOperation(this),$.drawImage(q._canvas,0,0,q.width/Y,q.height/Y)}else{if($._applyLineJoin(this),!B){var V=this.getAbsoluteTransform(T).getMatrix();$.transform(V[0],V[1],V[2],V[3],V[4],V[5]),$._applyOpacity(this),$._applyGlobalCompositeOperation(this)}N&&$._applyShadow(this),z.call(this,$,this)}return $.restore(),this}drawHit(P,T,L=!1){if(!this.shouldDrawHit(T,L))return this;var M=this.getLayer(),U=P||M.hitCanvas,$=U&&U.getContext(),Z=this.hitFunc()||this.sceneFunc(),z=this._getCanvasCache(),N=z&&z.hit;if(this.colorKey||r.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),N){$.save();var H=this.getAbsoluteTransform(T).getMatrix();return $.transform(H[0],H[1],H[2],H[3],H[4],H[5]),this._drawCachedHitCanvas($),$.restore(),this}if(!Z)return this;if($.save(),$._applyLineJoin(this),!(this===T)){var F=this.getAbsoluteTransform(T).getMatrix();$.transform(F[0],F[1],F[2],F[3],F[4],F[5])}return Z.call(this,$,this),$.restore(),this}drawHitFromCache(P=0){var T=this._getCanvasCache(),L=this._getCachedSceneCanvas(),M=T.hit,U=M.getContext(),$=M.getWidth(),Z=M.getHeight(),z,N,H,R,F,B;U.clear(),U.drawImage(L._canvas,0,0,$,Z);try{for(z=U.getImageData(0,0,$,Z),N=z.data,H=N.length,R=r.Util._hexToRgb(this.colorKey),F=0;F<H;F+=4)B=N[F+3],B>P?(N[F]=R.r,N[F+1]=R.g,N[F+2]=R.b,N[F+3]=255):N[F+3]=0;U.putImageData(z,0,0)}catch(D){r.Util.error("Unable to draw hit graph from cached scene canvas. "+D.message)}return this}hasPointerCapture(P){return l.hasPointerCapture(P,this)}setPointerCapture(P){l.setPointerCapture(P,this)}releaseCapture(P){l.releaseCapture(P,this)}}e.Shape=S,S.prototype._fillFunc=y,S.prototype._strokeFunc=m,S.prototype._fillFuncHit=p,S.prototype._strokeFuncHit=g,S.prototype._centroid=!1,S.prototype.nodeType="Shape",(0,o._registerNode)(S),S.prototype.eventListeners={},S.prototype.on.call(S.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),S.prototype.on.call(S.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",_),S.prototype.on.call(S.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",O),S.prototype.on.call(S.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",k),S.prototype.on.call(S.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",C),n.Factory.addGetterSetter(S,"stroke",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(S,"strokeWidth",2,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(S,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(S,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(S,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(S,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(S,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(S,"lineJoin"),n.Factory.addGetterSetter(S,"lineCap"),n.Factory.addGetterSetter(S,"sceneFunc"),n.Factory.addGetterSetter(S,"hitFunc"),n.Factory.addGetterSetter(S,"dash"),n.Factory.addGetterSetter(S,"dashOffset",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(S,"shadowColor",void 0,(0,a.getStringValidator)()),n.Factory.addGetterSetter(S,"shadowBlur",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(S,"shadowOpacity",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(S,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(S,"shadowOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(S,"shadowOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(S,"fillPatternImage"),n.Factory.addGetterSetter(S,"fill",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(S,"fillPatternX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(S,"fillPatternY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(S,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(S,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(S,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(S,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(S,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(S,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(S,"fillEnabled",!0),n.Factory.addGetterSetter(S,"strokeEnabled",!0),n.Factory.addGetterSetter(S,"shadowEnabled",!0),n.Factory.addGetterSetter(S,"dashEnabled",!0),n.Factory.addGetterSetter(S,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(S,"fillPriority","color"),n.Factory.addComponentsGetterSetter(S,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(S,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(S,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(S,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(S,"fillPatternScaleX",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(S,"fillPatternScaleY",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(S,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(S,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(S,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(S,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(S,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(S,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(S,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(S,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(S,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(S,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(S,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(S,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(S,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(S,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(S,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(S,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(S,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(S,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(S,"fillPatternRotation",0),n.Factory.addGetterSetter(S,"fillRule",void 0,(0,a.getStringValidator)()),n.Factory.backCompat(S,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(Ar);Object.defineProperty(mf,"__esModule",{value:!0});mf.Layer=void 0;const xa=ir,ug=Dl,bs=Qt,t2=vt,W5=ji,iA=Ye,aA=Ar,oA=gt;var lA="#",sA="beforeDraw",uA="draw",E9=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],cA=E9.length;let _u=class extends ug.Container{constructor(t){super(t),this.canvas=new W5.SceneCanvas,this.hitCanvas=new W5.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var r=this.getStage();return r&&r.content&&(r.content.removeChild(this.getNativeCanvasElement()),t<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[t+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){bs.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var t=bs.Node.prototype.moveUp.call(this);if(!t)return!1;var r=this.getStage();return!r||!r.content?!1:(r.content.removeChild(this.getNativeCanvasElement()),this.index<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[this.index+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(bs.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var r=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),r[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(bs.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var r=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),r[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return bs.Node.prototype.remove.call(this),t&&t.parentNode&&xa.Util._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:r}){return this.canvas.setSize(t,r),this.hitCanvas.setSize(t,r),this._setSmoothEnabled(),this}_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&xa.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t=t||{},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),bs.Node.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){xa.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){xa.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,xa.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var r=1,n=!1;;){for(let i=0;i<cA;i++){const a=E9[i],o=this._getIntersection({x:t.x+a.x*r,y:t.y+a.y*r}),l=o.shape;if(l)return l;if(n=!!o.antialiased,!o.antialiased)break}if(n)r+=1;else return null}}_getIntersection(t){const r=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(t.x*r),Math.round(t.y*r),1,1).data,i=n[3];if(i===255){const a=xa.Util._rgbToHex(n[0],n[1],n[2]),o=aA.shapes[lA+a];return o?{shape:o}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,r){var n=this.getLayer(),i=t||n&&n.getCanvas();return this._fire(sA,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),ug.Container.prototype.drawScene.call(this,i,r),this._fire(uA,{node:this}),this}drawHit(t,r){var n=this.getLayer(),i=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),ug.Container.prototype.drawHit.call(this,i,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){xa.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return xa.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,r=!!this.hitCanvas._canvas.parentNode;r?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return xa.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};mf.Layer=_u;_u.prototype.nodeType="Layer";(0,oA._registerNode)(_u);t2.Factory.addGetterSetter(_u,"imageSmoothingEnabled",!0);t2.Factory.addGetterSetter(_u,"clearBeforeDraw",!0);t2.Factory.addGetterSetter(_u,"hitGraphEnabled",!0,(0,iA.getBooleanValidator)());var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.FastLayer=void 0;const fA=ir,dA=mf,hA=gt;let r2=class extends dA.Layer{constructor(t){super(t),this.listening(!1),fA.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};Cp.FastLayer=r2;r2.prototype.nodeType="FastLayer";(0,hA._registerNode)(r2);var wu={};Object.defineProperty(wu,"__esModule",{value:!0});wu.Group=void 0;const pA=ir,gA=Dl,vA=gt;let n2=class extends gA.Container{_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&pA.Util.throw("You may only add groups and shapes to groups.")}};wu.Group=n2;n2.prototype.nodeType="Group";(0,vA._registerNode)(n2);var Su={};Object.defineProperty(Su,"__esModule",{value:!0});Su.Animation=void 0;const cg=gt,Y5=ir,fg=function(){return cg.glob.performance&&cg.glob.performance.now?function(){return cg.glob.performance.now()}:function(){return new Date().getTime()}}();class na{constructor(t,r){this.id=na.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:fg(),frameRate:0},this.func=t,this.setLayers(r)}setLayers(t){let r=[];return t&&(r=Array.isArray(t)?t:[t]),this.layers=r,this}getLayers(){return this.layers}addLayer(t){const r=this.layers,n=r.length;for(let i=0;i<n;i++)if(r[i]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const r=na.animations,n=r.length;for(let i=0;i<n;i++)if(r[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=fg(),na._addAnimation(this),this}stop(){return na._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const r=t.id,n=this.animations,i=n.length;for(let a=0;a<i;a++)if(n[a].id===r){this.animations.splice(a,1);break}}static _runFrames(){const t={},r=this.animations;for(let n=0;n<r.length;n++){const i=r[n],a=i.layers,o=i.func;i._updateFrameObject(fg());const l=a.length;let u;if(o?u=o.call(i,i.frame)!==!1:u=!0,!!u)for(let f=0;f<l;f++){const v=a[f];v._id!==void 0&&(t[v._id]=v)}}for(let n in t)t.hasOwnProperty(n)&&t[n].batchDraw()}static _animationLoop(){const t=na;t.animations.length?(t._runFrames(),Y5.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,Y5.Util.requestAnimFrame(this._animationLoop))}}Su.Animation=na;na.animations=[];na.animIdCounter=0;na.animRunning=!1;var O9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=ir,r=Su,n=Qt,i=gt;var a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,f=0,v=["fill","stroke","shadowColor"];class w{constructor(E,y,m,p,g,d,_){this.prop=E,this.propFunc=y,this.begin=p,this._pos=p,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=_,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=m,this._change=g-this.begin,this.pause()}fire(E){var y=this[E];y&&y()}setTime(E){E>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():E<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=E,this.update())}getTime(){return this._time}setPosition(E){this.prevPos=this._pos,this.propFunc(E),this._pos=E}getPosition(E){return E===void 0&&(E=this._time),this.func(E,this.begin,this._change,this.duration)}play(){this.state=l,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=u,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(E){this.pause(),this._time=E,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var E=this.getTimer()-this._startTime;this.state===l?this.setTime(E):this.state===u&&this.setTime(this.duration-E)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class b{constructor(E){var y=this,m=E.node,p=m._id,g,d=E.easing||e.Easings.Linear,_=!!E.yoyo,O;typeof E.duration>"u"?g=.3:E.duration===0?g=.001:g=E.duration,this.node=m,this._id=f++;var k=m.getLayer()||(m instanceof i.Konva.Stage?m.getLayers():null);k||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new r.Animation(function(){y.tween.onEnterFrame()},k),this.tween=new w(O,function(C){y._tweenFunc(C)},d,0,1,g*1e3,_),this._addListeners(),b.attrs[p]||(b.attrs[p]={}),b.attrs[p][this._id]||(b.attrs[p][this._id]={}),b.tweens[p]||(b.tweens[p]={});for(O in E)a[O]===void 0&&this._addAttr(O,E[O]);this.reset(),this.onFinish=E.onFinish,this.onReset=E.onReset,this.onUpdate=E.onUpdate}_addAttr(E,y){var m=this.node,p=m._id,g,d,_,O,k,C,S,x;if(_=b.tweens[p][E],_&&delete b.attrs[p][_][E],g=m.getAttr(E),t.Util._isArray(y))if(d=[],k=Math.max(y.length,g.length),E==="points"&&y.length!==g.length&&(y.length>g.length?(S=g,g=t.Util._prepareArrayForTween(g,y,m.closed())):(C=y,y=t.Util._prepareArrayForTween(y,g,m.closed()))),E.indexOf("fill")===0)for(O=0;O<k;O++)if(O%2===0)d.push(y[O]-g[O]);else{var P=t.Util.colorToRGBA(g[O]);x=t.Util.colorToRGBA(y[O]),g[O]=P,d.push({r:x.r-P.r,g:x.g-P.g,b:x.b-P.b,a:x.a-P.a})}else for(O=0;O<k;O++)d.push(y[O]-g[O]);else v.indexOf(E)!==-1?(g=t.Util.colorToRGBA(g),x=t.Util.colorToRGBA(y),d={r:x.r-g.r,g:x.g-g.g,b:x.b-g.b,a:x.a-g.a}):d=y-g;b.attrs[p][this._id][E]={start:g,diff:d,end:y,trueEnd:C,trueStart:S},b.tweens[p][E]=this._id}_tweenFunc(E){var y=this.node,m=b.attrs[y._id][this._id],p,g,d,_,O,k,C,S;for(p in m){if(g=m[p],d=g.start,_=g.diff,S=g.end,t.Util._isArray(d))if(O=[],C=Math.max(d.length,S.length),p.indexOf("fill")===0)for(k=0;k<C;k++)k%2===0?O.push((d[k]||0)+_[k]*E):O.push("rgba("+Math.round(d[k].r+_[k].r*E)+","+Math.round(d[k].g+_[k].g*E)+","+Math.round(d[k].b+_[k].b*E)+","+(d[k].a+_[k].a*E)+")");else for(k=0;k<C;k++)O.push((d[k]||0)+_[k]*E);else v.indexOf(p)!==-1?O="rgba("+Math.round(d.r+_.r*E)+","+Math.round(d.g+_.g*E)+","+Math.round(d.b+_.b*E)+","+(d.a+_.a*E)+")":O=d+_*E;y.setAttr(p,O)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var E=this.node,y=b.attrs[E._id][this._id];y.points&&y.points.trueEnd&&E.setAttr("points",y.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var E=this.node,y=b.attrs[E._id][this._id];y.points&&y.points.trueStart&&E.points(y.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(E){return this.tween.seek(E*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var E=this.node._id,y=this._id,m=b.tweens[E],p;this.pause();for(p in m)delete b.tweens[E][p];delete b.attrs[E][y]}}e.Tween=b,b.attrs={},b.tweens={},n.Node.prototype.to=function(h){var E=h.onFinish;h.node=this,h.onFinish=function(){this.destroy(),E&&E()};var y=new b(h);y.play()},e.Easings={BackEaseIn(h,E,y,m){var p=1.70158;return y*(h/=m)*h*((p+1)*h-p)+E},BackEaseOut(h,E,y,m){var p=1.70158;return y*((h=h/m-1)*h*((p+1)*h+p)+1)+E},BackEaseInOut(h,E,y,m){var p=1.70158;return(h/=m/2)<1?y/2*(h*h*(((p*=1.525)+1)*h-p))+E:y/2*((h-=2)*h*(((p*=1.525)+1)*h+p)+2)+E},ElasticEaseIn(h,E,y,m,p,g){var d=0;return h===0?E:(h/=m)===1?E+y:(g||(g=m*.3),!p||p<Math.abs(y)?(p=y,d=g/4):d=g/(2*Math.PI)*Math.asin(y/p),-(p*Math.pow(2,10*(h-=1))*Math.sin((h*m-d)*(2*Math.PI)/g))+E)},ElasticEaseOut(h,E,y,m,p,g){var d=0;return h===0?E:(h/=m)===1?E+y:(g||(g=m*.3),!p||p<Math.abs(y)?(p=y,d=g/4):d=g/(2*Math.PI)*Math.asin(y/p),p*Math.pow(2,-10*h)*Math.sin((h*m-d)*(2*Math.PI)/g)+y+E)},ElasticEaseInOut(h,E,y,m,p,g){var d=0;return h===0?E:(h/=m/2)===2?E+y:(g||(g=m*(.3*1.5)),!p||p<Math.abs(y)?(p=y,d=g/4):d=g/(2*Math.PI)*Math.asin(y/p),h<1?-.5*(p*Math.pow(2,10*(h-=1))*Math.sin((h*m-d)*(2*Math.PI)/g))+E:p*Math.pow(2,-10*(h-=1))*Math.sin((h*m-d)*(2*Math.PI)/g)*.5+y+E)},BounceEaseOut(h,E,y,m){return(h/=m)<1/2.75?y*(7.5625*h*h)+E:h<2/2.75?y*(7.5625*(h-=1.5/2.75)*h+.75)+E:h<2.5/2.75?y*(7.5625*(h-=2.25/2.75)*h+.9375)+E:y*(7.5625*(h-=2.625/2.75)*h+.984375)+E},BounceEaseIn(h,E,y,m){return y-e.Easings.BounceEaseOut(m-h,0,y,m)+E},BounceEaseInOut(h,E,y,m){return h<m/2?e.Easings.BounceEaseIn(h*2,0,y,m)*.5+E:e.Easings.BounceEaseOut(h*2-m,0,y,m)*.5+y*.5+E},EaseIn(h,E,y,m){return y*(h/=m)*h+E},EaseOut(h,E,y,m){return-y*(h/=m)*(h-2)+E},EaseInOut(h,E,y,m){return(h/=m/2)<1?y/2*h*h+E:-y/2*(--h*(h-2)-1)+E},StrongEaseIn(h,E,y,m){return y*(h/=m)*h*h*h*h+E},StrongEaseOut(h,E,y,m){return y*((h=h/m-1)*h*h*h*h+1)+E},StrongEaseInOut(h,E,y,m){return(h/=m/2)<1?y/2*h*h*h*h*h+E:y/2*((h-=2)*h*h*h*h+2)+E},Linear(h,E,y,m){return y*h/m+E}}})(O9);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=gt,r=ir,n=Qt,i=Dl,a=_9,o=mf,l=Cp,u=wu,f=xp,v=Ar,w=Su,b=O9,h=Na,E=ji;e.Konva=r.Util._assign(t.Konva,{Util:r.Util,Transform:r.Transform,Node:n.Node,Container:i.Container,Stage:a.Stage,stages:a.stages,Layer:o.Layer,FastLayer:l.FastLayer,Group:u.Group,DD:f.DD,Shape:v.Shape,shapes:v.shapes,Animation:w.Animation,Tween:b.Tween,Easings:b.Easings,Context:h.Context,Canvas:E.Canvas}),e.default=e.Konva})(Bh);var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0});Tp.Arc=void 0;const Ap=vt,mA=Ar,K5=gt,kp=Ye,yA=gt;let Va=class extends mA.Shape{_sceneFunc(t){var r=K5.Konva.getAngle(this.angle()),n=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,r,n),t.arc(0,0,this.innerRadius(),r,0,!n),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),r=this.outerRadius(),n=this.clockwise(),i=K5.Konva.getAngle(n?360-this.angle():this.angle()),a=Math.cos(Math.min(i,Math.PI)),o=1,l=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),u=Math.sin(Math.min(i,Math.PI/2)),f=a*(a>0?t:r),v=o*r,w=l*(l>0?t:r),b=u*(u>0?r:t);return{x:f,y:n?-1*b:w,width:v-f,height:b-w}}};Tp.Arc=Va;Va.prototype._centroid=!0;Va.prototype.className="Arc";Va.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,yA._registerNode)(Va);Ap.Factory.addGetterSetter(Va,"innerRadius",0,(0,kp.getNumberValidator)());Ap.Factory.addGetterSetter(Va,"outerRadius",0,(0,kp.getNumberValidator)());Ap.Factory.addGetterSetter(Va,"angle",0,(0,kp.getNumberValidator)());Ap.Factory.addGetterSetter(Va,"clockwise",!1,(0,kp.getBooleanValidator)());var Rp={},yf={};Object.defineProperty(yf,"__esModule",{value:!0});yf.Line=void 0;const Lp=vt,bA=Ar,x9=Ye,_A=gt;function Pm(e,t,r,n,i,a,o){var l=Math.sqrt(Math.pow(r-e,2)+Math.pow(n-t,2)),u=Math.sqrt(Math.pow(i-r,2)+Math.pow(a-n,2)),f=o*l/(l+u),v=o*u/(l+u),w=r-f*(i-e),b=n-f*(a-t),h=r+v*(i-e),E=n+v*(a-t);return[w,b,h,E]}function X5(e,t){var r=e.length,n=[],i,a;for(i=2;i<r-2;i+=2)a=Pm(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t),!isNaN(a[0])&&(n.push(a[0]),n.push(a[1]),n.push(e[i]),n.push(e[i+1]),n.push(a[2]),n.push(a[3]));return n}let Ho=class extends bA.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var r=this.points(),n=r.length,i=this.tension(),a=this.closed(),o=this.bezier(),l,u,f;if(n){if(t.beginPath(),t.moveTo(r[0],r[1]),i!==0&&n>4){for(l=this.getTensionPoints(),u=l.length,f=a?0:4,a||t.quadraticCurveTo(l[0],l[1],l[2],l[3]);f<u-2;)t.bezierCurveTo(l[f++],l[f++],l[f++],l[f++],l[f++],l[f++]);a||t.quadraticCurveTo(l[u-2],l[u-1],r[n-2],r[n-1])}else if(o)for(f=2;f<n;)t.bezierCurveTo(r[f++],r[f++],r[f++],r[f++],r[f++],r[f++]);else for(f=2;f<n;f+=2)t.lineTo(r[f],r[f+1]);a?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():X5(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),r=t.length,n=this.tension(),i=Pm(t[r-2],t[r-1],t[0],t[1],t[2],t[3],n),a=Pm(t[r-4],t[r-3],t[r-2],t[r-1],t[0],t[1],n),o=X5(t,n),l=[i[2],i[3]].concat(o).concat([a[0],a[1],t[r-2],t[r-1],a[2],a[3],i[0],i[1],t[0],t[1]]);return l}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();for(var r=t[0],n=t[0],i=t[1],a=t[1],o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,l),a=Math.max(a,l);return{x:r,y:i,width:n-r,height:a-i}}};yf.Line=Ho;Ho.prototype.className="Line";Ho.prototype._attrsAffectingSize=["points","bezier","tension"];(0,_A._registerNode)(Ho);Lp.Factory.addGetterSetter(Ho,"closed",!1);Lp.Factory.addGetterSetter(Ho,"bezier",!1);Lp.Factory.addGetterSetter(Ho,"tension",0,(0,x9.getNumberValidator)());Lp.Factory.addGetterSetter(Ho,"points",[],(0,x9.getNumberArrayValidator)());var Eu={},P9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(o,l,u)=>{let f,v,w;f=u/2,v=0;for(let h=0;h<20;h++)w=f*e.tValues[20][h]+f,v+=e.cValues[20][h]*n(o,l,w);return f*v};e.getCubicArcLength=t;const r=(o,l,u)=>{u===void 0&&(u=1);const f=o[0]-2*o[1]+o[2],v=l[0]-2*l[1]+l[2],w=2*o[1]-2*o[0],b=2*l[1]-2*l[0],h=4*(f*f+v*v),E=4*(f*w+v*b),y=w*w+b*b;if(h===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(l[2]-l[0],2));const m=E/(2*h),p=y/h,g=u+m,d=p-m*m,_=g*g+d>0?Math.sqrt(g*g+d):0,O=m*m+d>0?Math.sqrt(m*m+d):0,k=m+Math.sqrt(m*m+d)!==0?d*Math.log(Math.abs((g+_)/(m+O))):0;return Math.sqrt(h)/2*(g*_-m*O+k)};e.getQuadraticArcLength=r;function n(o,l,u){const f=i(1,u,o),v=i(1,u,l),w=f*f+v*v;return Math.sqrt(w)}const i=(o,l,u)=>{const f=u.length-1;let v,w;if(f===0)return 0;if(o===0){w=0;for(let b=0;b<=f;b++)w+=e.binomialCoefficients[f][b]*Math.pow(1-l,f-b)*Math.pow(l,b)*u[b];return w}else{v=new Array(f);for(let b=0;b<f;b++)v[b]=f*(u[b+1]-u[b]);return i(o-1,l,v)}},a=(o,l,u)=>{let f=1,v=o/l,w=(o-u(v))/l,b=0;for(;f>.001;){const h=u(v+w),E=Math.abs(o-h)/l;if(E<f)f=E,v+=w;else{const y=u(v-w),m=Math.abs(o-y)/l;m<f?(f=m,v-=w):w/=2}if(b++,b>500)break}return v};e.t2length=a})(P9);Object.defineProperty(Eu,"__esModule",{value:!0});Eu.Path=void 0;const wA=vt,SA=Ar,EA=gt,_s=P9;let bf=class Sn extends SA.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Sn.parsePathData(this.data()),this.pathLength=Sn.getPathLength(this.dataArray)}_sceneFunc(t){var r=this.dataArray;t.beginPath();for(var n=!1,i=0;i<r.length;i++){var a=r[i].command,o=r[i].points;switch(a){case"L":t.lineTo(o[0],o[1]);break;case"M":t.moveTo(o[0],o[1]);break;case"C":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":t.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":var l=o[0],u=o[1],f=o[2],v=o[3],w=o[4],b=o[5],h=o[6],E=o[7],y=f>v?f:v,m=f>v?1:f/v,p=f>v?v/f:1;t.translate(l,u),t.rotate(h),t.scale(m,p),t.arc(0,0,y,w,w+b,1-E),t.scale(1/m,1/p),t.rotate(-h),t.translate(-l,-u);break;case"z":n=!0,t.closePath();break}}!n&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(f){if(f.command==="A"){var v=f.points[4],w=f.points[5],b=f.points[4]+w,h=Math.PI/180;if(Math.abs(v-b)<h&&(h=Math.abs(v-b)),w<0)for(let E=v-h;E>b;E-=h){const y=Sn.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],E,0);t.push(y.x,y.y)}else for(let E=v+h;E<b;E+=h){const y=Sn.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],E,0);t.push(y.x,y.y)}}else if(f.command==="C")for(let E=0;E<=1;E+=.01){const y=Sn.getPointOnCubicBezier(E,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3],f.points[4],f.points[5]);t.push(y.x,y.y)}else t=t.concat(f.points)});for(var r=t[0],n=t[0],i=t[1],a=t[1],o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],isNaN(o)||(r=Math.min(r,o),n=Math.max(n,o)),isNaN(l)||(i=Math.min(i,l),a=Math.max(a,l));return{x:r,y:i,width:n-r,height:a-i}}getLength(){return this.pathLength}getPointAtLength(t){return Sn.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,r,n,i){return Math.sqrt((n-t)*(n-t)+(i-r)*(i-r))}static getPathLength(t){let r=0;for(var n=0;n<t.length;++n)r+=t[n].pathLength;return r}static getPointAtLengthOfDataArray(t,r){var n,i=0,a=r.length;if(!a)return null;for(;i<a&&t>r[i].pathLength;)t-=r[i].pathLength,++i;if(i===a)return n=r[i-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=r[i].points.slice(0,2),{x:n[0],y:n[1]};var o=r[i],l=o.points;switch(o.command){case"L":return Sn.getPointOnLine(t,o.start.x,o.start.y,l[0],l[1]);case"C":return Sn.getPointOnCubicBezier((0,_s.t2length)(t,Sn.getPathLength(r),y=>(0,_s.getCubicArcLength)([o.start.x,l[0],l[2],l[4]],[o.start.y,l[1],l[3],l[5]],y)),o.start.x,o.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return Sn.getPointOnQuadraticBezier((0,_s.t2length)(t,Sn.getPathLength(r),y=>(0,_s.getQuadraticArcLength)([o.start.x,l[0],l[2]],[o.start.y,l[1],l[3]],y)),o.start.x,o.start.y,l[0],l[1],l[2],l[3]);case"A":var u=l[0],f=l[1],v=l[2],w=l[3],b=l[4],h=l[5],E=l[6];return b+=h*t/o.pathLength,Sn.getPointOnEllipticalArc(u,f,v,w,b,E)}return null}static getPointOnLine(t,r,n,i,a,o,l){o===void 0&&(o=r),l===void 0&&(l=n);var u=(a-n)/(i-r+1e-8),f=Math.sqrt(t*t/(1+u*u));i<r&&(f*=-1);var v=u*f,w;if(i===r)w={x:o,y:l+v};else if((l-n)/(o-r+1e-8)===u)w={x:o+f,y:l+v};else{var b,h,E=this.getLineLength(r,n,i,a),y=(o-r)*(i-r)+(l-n)*(a-n);y=y/(E*E),b=r+y*(i-r),h=n+y*(a-n);var m=this.getLineLength(o,l,b,h),p=Math.sqrt(t*t-m*m);f=Math.sqrt(p*p/(1+u*u)),i<r&&(f*=-1),v=u*f,w={x:b+f,y:h+v}}return w}static getPointOnCubicBezier(t,r,n,i,a,o,l,u,f){function v(m){return m*m*m}function w(m){return 3*m*m*(1-m)}function b(m){return 3*m*(1-m)*(1-m)}function h(m){return(1-m)*(1-m)*(1-m)}var E=u*v(t)+o*w(t)+i*b(t)+r*h(t),y=f*v(t)+l*w(t)+a*b(t)+n*h(t);return{x:E,y}}static getPointOnQuadraticBezier(t,r,n,i,a,o,l){function u(h){return h*h}function f(h){return 2*h*(1-h)}function v(h){return(1-h)*(1-h)}var w=o*u(t)+i*f(t)+r*v(t),b=l*u(t)+a*f(t)+n*v(t);return{x:w,y:b}}static getPointOnEllipticalArc(t,r,n,i,a,o){var l=Math.cos(o),u=Math.sin(o),f={x:n*Math.cos(a),y:i*Math.sin(a)};return{x:t+(f.x*l-f.y*u),y:r+(f.x*u+f.y*l)}}static parsePathData(t){if(!t)return[];var r=t,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];r=r.replace(new RegExp(" ","g"),",");for(var i=0;i<n.length;i++)r=r.replace(new RegExp(n[i],"g"),"|"+n[i]);var a=r.split("|"),o=[],l=[],u=0,f=0,v=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,w;for(i=1;i<a.length;i++){var b=a[i],h=b.charAt(0);for(b=b.slice(1),l.length=0;w=v.exec(b);)l.push(w[0]);for(var E=[],y=0,m=l.length;y<m;y++){if(l[y]==="00"){E.push(0,0);continue}var p=parseFloat(l[y]);isNaN(p)?E.push(0):E.push(p)}for(;E.length>0&&!isNaN(E[0]);){var g="",d=[],_=u,O=f,k,C,S,x,P,T,L,M,U,$;switch(h){case"l":u+=E.shift(),f+=E.shift(),g="L",d.push(u,f);break;case"L":u=E.shift(),f=E.shift(),d.push(u,f);break;case"m":var Z=E.shift(),z=E.shift();if(u+=Z,f+=z,g="M",o.length>2&&o[o.length-1].command==="z"){for(var N=o.length-2;N>=0;N--)if(o[N].command==="M"){u=o[N].points[0]+Z,f=o[N].points[1]+z;break}}d.push(u,f),h="l";break;case"M":u=E.shift(),f=E.shift(),g="M",d.push(u,f),h="L";break;case"h":u+=E.shift(),g="L",d.push(u,f);break;case"H":u=E.shift(),g="L",d.push(u,f);break;case"v":f+=E.shift(),g="L",d.push(u,f);break;case"V":f=E.shift(),g="L",d.push(u,f);break;case"C":d.push(E.shift(),E.shift(),E.shift(),E.shift()),u=E.shift(),f=E.shift(),d.push(u,f);break;case"c":d.push(u+E.shift(),f+E.shift(),u+E.shift(),f+E.shift()),u+=E.shift(),f+=E.shift(),g="C",d.push(u,f);break;case"S":C=u,S=f,k=o[o.length-1],k.command==="C"&&(C=u+(u-k.points[2]),S=f+(f-k.points[3])),d.push(C,S,E.shift(),E.shift()),u=E.shift(),f=E.shift(),g="C",d.push(u,f);break;case"s":C=u,S=f,k=o[o.length-1],k.command==="C"&&(C=u+(u-k.points[2]),S=f+(f-k.points[3])),d.push(C,S,u+E.shift(),f+E.shift()),u+=E.shift(),f+=E.shift(),g="C",d.push(u,f);break;case"Q":d.push(E.shift(),E.shift()),u=E.shift(),f=E.shift(),d.push(u,f);break;case"q":d.push(u+E.shift(),f+E.shift()),u+=E.shift(),f+=E.shift(),g="Q",d.push(u,f);break;case"T":C=u,S=f,k=o[o.length-1],k.command==="Q"&&(C=u+(u-k.points[0]),S=f+(f-k.points[1])),u=E.shift(),f=E.shift(),g="Q",d.push(C,S,u,f);break;case"t":C=u,S=f,k=o[o.length-1],k.command==="Q"&&(C=u+(u-k.points[0]),S=f+(f-k.points[1])),u+=E.shift(),f+=E.shift(),g="Q",d.push(C,S,u,f);break;case"A":x=E.shift(),P=E.shift(),T=E.shift(),L=E.shift(),M=E.shift(),U=u,$=f,u=E.shift(),f=E.shift(),g="A",d=this.convertEndpointToCenterParameterization(U,$,u,f,L,M,x,P,T);break;case"a":x=E.shift(),P=E.shift(),T=E.shift(),L=E.shift(),M=E.shift(),U=u,$=f,u+=E.shift(),f+=E.shift(),g="A",d=this.convertEndpointToCenterParameterization(U,$,u,f,L,M,x,P,T);break}o.push({command:g||h,points:d,start:{x:_,y:O},pathLength:this.calcLength(_,O,g||h,d)})}(h==="z"||h==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(t,r,n,i){var a,o,l,u,f=Sn;switch(n){case"L":return f.getLineLength(t,r,i[0],i[1]);case"C":return(0,_s.getCubicArcLength)([t,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return(0,_s.getQuadraticArcLength)([t,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;var v=i[4],w=i[5],b=i[4]+w,h=Math.PI/180;if(Math.abs(v-b)<h&&(h=Math.abs(v-b)),o=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],v,0),w<0)for(u=v-h;u>b;u-=h)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;else for(u=v+h;u<b;u+=h)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;return l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],b,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),a}return 0}static convertEndpointToCenterParameterization(t,r,n,i,a,o,l,u,f){var v=f*(Math.PI/180),w=Math.cos(v)*(t-n)/2+Math.sin(v)*(r-i)/2,b=-1*Math.sin(v)*(t-n)/2+Math.cos(v)*(r-i)/2,h=w*w/(l*l)+b*b/(u*u);h>1&&(l*=Math.sqrt(h),u*=Math.sqrt(h));var E=Math.sqrt((l*l*(u*u)-l*l*(b*b)-u*u*(w*w))/(l*l*(b*b)+u*u*(w*w)));a===o&&(E*=-1),isNaN(E)&&(E=0);var y=E*l*b/u,m=E*-u*w/l,p=(t+n)/2+Math.cos(v)*y-Math.sin(v)*m,g=(r+i)/2+Math.sin(v)*y+Math.cos(v)*m,d=function(P){return Math.sqrt(P[0]*P[0]+P[1]*P[1])},_=function(P,T){return(P[0]*T[0]+P[1]*T[1])/(d(P)*d(T))},O=function(P,T){return(P[0]*T[1]<P[1]*T[0]?-1:1)*Math.acos(_(P,T))},k=O([1,0],[(w-y)/l,(b-m)/u]),C=[(w-y)/l,(b-m)/u],S=[(-1*w-y)/l,(-1*b-m)/u],x=O(C,S);return _(C,S)<=-1&&(x=Math.PI),_(C,S)>=1&&(x=0),o===0&&x>0&&(x=x-2*Math.PI),o===1&&x<0&&(x=x+2*Math.PI),[p,g,l,u,k,x,v,o]}};Eu.Path=bf;bf.prototype.className="Path";bf.prototype._attrsAffectingSize=["data"];(0,EA._registerNode)(bf);wA.Factory.addGetterSetter(bf,"data");Object.defineProperty(Rp,"__esModule",{value:!0});Rp.Arrow=void 0;const Mp=vt,OA=yf,C9=Ye,xA=gt,Z5=Eu;let jl=class extends OA.Line{_sceneFunc(t){super._sceneFunc(t);var r=Math.PI*2,n=this.points(),i=n,a=this.tension()!==0&&n.length>4;a&&(i=this.getTensionPoints());var o=this.pointerLength(),l=n.length,u,f;if(a){const b=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],n[l-2],n[l-1]],h=Z5.Path.calcLength(i[i.length-4],i[i.length-3],"C",b),E=Z5.Path.getPointOnQuadraticBezier(Math.min(1,1-o/h),b[0],b[1],b[2],b[3],b[4],b[5]);u=n[l-2]-E.x,f=n[l-1]-E.y}else u=n[l-2]-n[l-4],f=n[l-1]-n[l-3];var v=(Math.atan2(f,u)+r)%r,w=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(n[l-2],n[l-1]),t.rotate(v),t.moveTo(0,0),t.lineTo(-o,w/2),t.lineTo(-o,-w/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(n[0],n[1]),a?(u=(i[0]+i[2])/2-n[0],f=(i[1]+i[3])/2-n[1]):(u=n[2]-n[0],f=n[3]-n[1]),t.rotate((Math.atan2(-f,-u)+r)%r),t.moveTo(0,0),t.lineTo(-o,w/2),t.lineTo(-o,-w/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var r=this.dashEnabled();r&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),r&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),r=this.pointerWidth()/2;return{x:t.x-r,y:t.y-r,width:t.width+r*2,height:t.height+r*2}}};Rp.Arrow=jl;jl.prototype.className="Arrow";(0,xA._registerNode)(jl);Mp.Factory.addGetterSetter(jl,"pointerLength",10,(0,C9.getNumberValidator)());Mp.Factory.addGetterSetter(jl,"pointerWidth",10,(0,C9.getNumberValidator)());Mp.Factory.addGetterSetter(jl,"pointerAtBeginning",!1);Mp.Factory.addGetterSetter(jl,"pointerAtEnding",!0);var Np={};Object.defineProperty(Np,"__esModule",{value:!0});Np.Circle=void 0;const PA=vt,CA=Ar,TA=Ye,AA=gt;let Ou=class extends CA.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};Np.Circle=Ou;Ou.prototype._centroid=!0;Ou.prototype.className="Circle";Ou.prototype._attrsAffectingSize=["radius"];(0,AA._registerNode)(Ou);PA.Factory.addGetterSetter(Ou,"radius",0,(0,TA.getNumberValidator)());var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.Ellipse=void 0;const i2=vt,kA=Ar,T9=Ye,RA=gt;let Go=class extends kA.Shape{_sceneFunc(t){var r=this.radiusX(),n=this.radiusY();t.beginPath(),t.save(),r!==n&&t.scale(1,n/r),t.arc(0,0,r,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}};Ip.Ellipse=Go;Go.prototype.className="Ellipse";Go.prototype._centroid=!0;Go.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,RA._registerNode)(Go);i2.Factory.addComponentsGetterSetter(Go,"radius",["x","y"]);i2.Factory.addGetterSetter(Go,"radiusX",0,(0,T9.getNumberValidator)());i2.Factory.addGetterSetter(Go,"radiusY",0,(0,T9.getNumberValidator)());var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0});Dp.Image=void 0;const dg=ir,zl=vt,LA=Ar,MA=gt,_f=Ye;let pa=class A9 extends LA.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const r=this.getWidth(),n=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image;let o;if(a){const l=this.attrs.cropWidth,u=this.attrs.cropHeight;l&&u?o=[a,this.cropX(),this.cropY(),l,u,0,0,r,n]:o=[a,0,0,r,n]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?dg.Util.drawRoundedRectPath(t,r,n,i):t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)),a&&(i&&t.clip(),t.drawImage.apply(t,o))}_hitFunc(t){var r=this.width(),n=this.height(),i=this.cornerRadius();t.beginPath(),i?dg.Util.drawRoundedRectPath(t,r,n,i):t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,r;return(t=this.attrs.width)!==null&&t!==void 0?t:(r=this.image())===null||r===void 0?void 0:r.width}getHeight(){var t,r;return(t=this.attrs.height)!==null&&t!==void 0?t:(r=this.image())===null||r===void 0?void 0:r.height}static fromURL(t,r,n=null){var i=dg.Util.createImageElement();i.onload=function(){var a=new A9({image:i});r(a)},i.onerror=n,i.crossOrigin="Anonymous",i.src=t}};Dp.Image=pa;pa.prototype.className="Image";(0,MA._registerNode)(pa);zl.Factory.addGetterSetter(pa,"cornerRadius",0,(0,_f.getNumberOrArrayOfNumbersValidator)(4));zl.Factory.addGetterSetter(pa,"image");zl.Factory.addComponentsGetterSetter(pa,"crop",["x","y","width","height"]);zl.Factory.addGetterSetter(pa,"cropX",0,(0,_f.getNumberValidator)());zl.Factory.addGetterSetter(pa,"cropY",0,(0,_f.getNumberValidator)());zl.Factory.addGetterSetter(pa,"cropWidth",0,(0,_f.getNumberValidator)());zl.Factory.addGetterSetter(pa,"cropHeight",0,(0,_f.getNumberValidator)());var au={};Object.defineProperty(au,"__esModule",{value:!0});au.Tag=au.Label=void 0;const Fp=vt,NA=Ar,IA=wu,a2=Ye,k9=gt;var R9=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],DA="Change.konva",FA="none",Cm="up",Tm="right",Am="down",km="left",jA=R9.length;let o2=class extends IA.Group{constructor(t){super(t),this.on("add.konva",function(r){this._addListeners(r.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var r=this,n,i=function(){r._sync()};for(n=0;n<jA;n++)t.on(R9[n]+DA,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),r=this.getTag(),n,i,a,o,l,u,f;if(t&&r){switch(n=t.width(),i=t.height(),a=r.pointerDirection(),o=r.pointerWidth(),f=r.pointerHeight(),l=0,u=0,a){case Cm:l=n/2,u=-1*f;break;case Tm:l=n+o,u=i/2;break;case Am:l=n/2,u=i+f;break;case km:l=-1*o,u=i/2;break}r.setAttrs({x:-1*l,y:-1*u,width:n,height:i}),t.setAttrs({x:-1*l,y:-1*u})}}};au.Label=o2;o2.prototype.className="Label";(0,k9._registerNode)(o2);let Bl=class extends NA.Shape{_sceneFunc(t){var r=this.width(),n=this.height(),i=this.pointerDirection(),a=this.pointerWidth(),o=this.pointerHeight(),l=this.cornerRadius();let u=0,f=0,v=0,w=0;typeof l=="number"?u=f=v=w=Math.min(l,r/2,n/2):(u=Math.min(l[0]||0,r/2,n/2),f=Math.min(l[1]||0,r/2,n/2),w=Math.min(l[2]||0,r/2,n/2),v=Math.min(l[3]||0,r/2,n/2)),t.beginPath(),t.moveTo(u,0),i===Cm&&(t.lineTo((r-a)/2,0),t.lineTo(r/2,-1*o),t.lineTo((r+a)/2,0)),t.lineTo(r-f,0),t.arc(r-f,f,f,Math.PI*3/2,0,!1),i===Tm&&(t.lineTo(r,(n-o)/2),t.lineTo(r+a,n/2),t.lineTo(r,(n+o)/2)),t.lineTo(r,n-w),t.arc(r-w,n-w,w,0,Math.PI/2,!1),i===Am&&(t.lineTo((r+a)/2,n),t.lineTo(r/2,n+o),t.lineTo((r-a)/2,n)),t.lineTo(v,n),t.arc(v,n-v,v,Math.PI/2,Math.PI,!1),i===km&&(t.lineTo(0,(n+o)/2),t.lineTo(-1*a,n/2),t.lineTo(0,(n-o)/2)),t.lineTo(0,u),t.arc(u,u,u,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){var t=0,r=0,n=this.pointerWidth(),i=this.pointerHeight(),a=this.pointerDirection(),o=this.width(),l=this.height();return a===Cm?(r-=i,l+=i):a===Am?l+=i:a===km?(t-=n*1.5,o+=n):a===Tm&&(o+=n*1.5),{x:t,y:r,width:o,height:l}}};au.Tag=Bl;Bl.prototype.className="Tag";(0,k9._registerNode)(Bl);Fp.Factory.addGetterSetter(Bl,"pointerDirection",FA);Fp.Factory.addGetterSetter(Bl,"pointerWidth",0,(0,a2.getNumberValidator)());Fp.Factory.addGetterSetter(Bl,"pointerHeight",0,(0,a2.getNumberValidator)());Fp.Factory.addGetterSetter(Bl,"cornerRadius",0,(0,a2.getNumberOrArrayOfNumbersValidator)(4));var wf={};Object.defineProperty(wf,"__esModule",{value:!0});wf.Rect=void 0;const zA=vt,BA=Ar,UA=gt,HA=ir,GA=Ye;let jp=class extends BA.Shape{_sceneFunc(t){var r=this.cornerRadius(),n=this.width(),i=this.height();t.beginPath(),r?HA.Util.drawRoundedRectPath(t,n,i,r):t.rect(0,0,n,i),t.closePath(),t.fillStrokeShape(this)}};wf.Rect=jp;jp.prototype.className="Rect";(0,UA._registerNode)(jp);zA.Factory.addGetterSetter(jp,"cornerRadius",0,(0,GA.getNumberOrArrayOfNumbersValidator)(4));var zp={};Object.defineProperty(zp,"__esModule",{value:!0});zp.RegularPolygon=void 0;const L9=vt,$A=Ar,M9=Ye,VA=gt;let Ul=class extends $A.Shape{_sceneFunc(t){const r=this._getPoints();t.beginPath(),t.moveTo(r[0].x,r[0].y);for(var n=1;n<r.length;n++)t.lineTo(r[n].x,r[n].y);t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,r=this.attrs.radius||0,n=[];for(var i=0;i<t;i++)n.push({x:r*Math.sin(i*2*Math.PI/t),y:-1*r*Math.cos(i*2*Math.PI/t)});return n}getSelfRect(){const t=this._getPoints();var r=t[0].x,n=t[0].y,i=t[0].x,a=t[0].y;return t.forEach(o=>{r=Math.min(r,o.x),n=Math.max(n,o.x),i=Math.min(i,o.y),a=Math.max(a,o.y)}),{x:r,y:i,width:n-r,height:a-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}};zp.RegularPolygon=Ul;Ul.prototype.className="RegularPolygon";Ul.prototype._centroid=!0;Ul.prototype._attrsAffectingSize=["radius"];(0,VA._registerNode)(Ul);L9.Factory.addGetterSetter(Ul,"radius",0,(0,M9.getNumberValidator)());L9.Factory.addGetterSetter(Ul,"sides",0,(0,M9.getNumberValidator)());var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0});Bp.Ring=void 0;const N9=vt,qA=Ar,I9=Ye,WA=gt;var Q5=Math.PI*2;let Hl=class extends qA.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,Q5,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),Q5,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}};Bp.Ring=Hl;Hl.prototype.className="Ring";Hl.prototype._centroid=!0;Hl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,WA._registerNode)(Hl);N9.Factory.addGetterSetter(Hl,"innerRadius",0,(0,I9.getNumberValidator)());N9.Factory.addGetterSetter(Hl,"outerRadius",0,(0,I9.getNumberValidator)());var Up={};Object.defineProperty(Up,"__esModule",{value:!0});Up.Sprite=void 0;const Gl=vt,YA=Ar,KA=Su,D9=Ye,XA=gt;let ga=class extends YA.Shape{constructor(t){super(t),this._updated=!0,this.anim=new KA.Animation(()=>{var r=this._updated;return this._updated=!1,r}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),l=a[i+0],u=a[i+1],f=a[i+2],v=a[i+3],w=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,f,v),t.closePath(),t.fillStrokeShape(this)),w)if(o){var b=o[r],h=n*2;t.drawImage(w,l,u,f,v,b[h+0],b[h+1],f,v)}else t.drawImage(w,l,u,f,v,0,0,f,v)}_hitFunc(t){var r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),l=a[i+2],u=a[i+3];if(t.beginPath(),o){var f=o[r],v=n*2;t.rect(f[v+0],f[v+1],l,u)}else t.rect(0,0,l,u);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),r=this.animation(),n=this.animations(),i=n[r],a=i.length/4;t<a-1?this.frameIndex(t+1):this.frameIndex(0)}};Up.Sprite=ga;ga.prototype.className="Sprite";(0,XA._registerNode)(ga);Gl.Factory.addGetterSetter(ga,"animation");Gl.Factory.addGetterSetter(ga,"animations");Gl.Factory.addGetterSetter(ga,"frameOffsets");Gl.Factory.addGetterSetter(ga,"image");Gl.Factory.addGetterSetter(ga,"frameIndex",0,(0,D9.getNumberValidator)());Gl.Factory.addGetterSetter(ga,"frameRate",17,(0,D9.getNumberValidator)());Gl.Factory.backCompat(ga,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var Hp={};Object.defineProperty(Hp,"__esModule",{value:!0});Hp.Star=void 0;const l2=vt,ZA=Ar,s2=Ye,QA=gt;let $o=class extends ZA.Shape{_sceneFunc(t){var r=this.innerRadius(),n=this.outerRadius(),i=this.numPoints();t.beginPath(),t.moveTo(0,0-n);for(var a=1;a<i*2;a++){var o=a%2===0?n:r,l=o*Math.sin(a*Math.PI/i),u=-1*o*Math.cos(a*Math.PI/i);t.lineTo(l,u)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}};Hp.Star=$o;$o.prototype.className="Star";$o.prototype._centroid=!0;$o.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,QA._registerNode)($o);l2.Factory.addGetterSetter($o,"numPoints",5,(0,s2.getNumberValidator)());l2.Factory.addGetterSetter($o,"innerRadius",0,(0,s2.getNumberValidator)());l2.Factory.addGetterSetter($o,"outerRadius",0,(0,s2.getNumberValidator)());var kl={};Object.defineProperty(kl,"__esModule",{value:!0});kl.Text=kl.stringToArray=void 0;const Rm=ir,on=vt,JA=Ar,hg=gt,Vo=Ye,ek=gt;function F9(e){return Array.from(e)}kl.stringToArray=F9;var ws="auto",tk="center",j9="inherit",ac="justify",rk="Change.konva",nk="2d",J5="-",z9="left",ik="text",ak="Text",ok="top",lk="bottom",e4="middle",B9="normal",sk="px ",zd=" ",uk="right",t4="rtl",ck="word",fk="char",r4="none",pg="…",U9=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],dk=U9.length;function hk(e){return e.split(",").map(t=>{t=t.trim();const r=t.indexOf(" ")>=0,n=t.indexOf('"')>=0||t.indexOf("'")>=0;return r&&!n&&(t=`"${t}"`),t}).join(", ")}var Bd;function gg(){return Bd||(Bd=Rm.Util.createCanvasElement().getContext(nk),Bd)}function pk(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function gk(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function vk(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let cr=class extends JA.Shape{constructor(t){super(vk(t)),this._partialTextX=0,this._partialTextY=0;for(var r=0;r<dk;r++)this.on(U9[r]+rk,this._setTextData);this._setTextData()}_sceneFunc(t){var r=this.textArr,n=r.length;if(this.text()){var i=this.padding(),a=this.fontSize(),o=this.lineHeight()*a,l=this.verticalAlign(),u=this.direction(),f=0,v=this.align(),w=this.getWidth(),b=this.letterSpacing(),h=this.fill(),E=this.textDecoration(),y=E.indexOf("underline")!==-1,m=E.indexOf("line-through")!==-1,p;u=u===j9?t.direction:u;var g=o/2,d=e4;if(hg.Konva._fixTextRendering){var _=this.measureSize("M");d="alphabetic",g=(_.fontBoundingBoxAscent-_.fontBoundingBoxDescent)/2+o/2}var O=0,k=0;for(u===t4&&t.setAttr("direction",u),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",d),t.setAttr("textAlign",z9),l===e4?f=(this.getHeight()-n*o-i*2)/2:l===lk&&(f=this.getHeight()-n*o-i*2),t.translate(i,f+i),p=0;p<n;p++){var O=0,k=0,C=r[p],S=C.text,x=C.width,P=C.lastInParagraph,T,L,M;if(t.save(),v===uk?O+=w-x-i*2:v===tk&&(O+=(w-x-i*2)/2),y){t.save(),t.beginPath();let H=hg.Konva._fixTextRendering?Math.round(a/4):Math.round(a/2);const R=O,F=g+k+H;t.moveTo(R,F),T=S.split(" ").length-1,L=T===0,M=v===ac&&!P?w-i*2:x,t.lineTo(R+Math.round(M),F),t.lineWidth=a/15;const B=this._getLinearGradient();t.strokeStyle=B||h,t.stroke(),t.restore()}if(m){t.save(),t.beginPath();let H=hg.Konva._fixTextRendering?-Math.round(a/4):0;t.moveTo(O,g+k+H),T=S.split(" ").length-1,L=T===0,M=v===ac&&P&&!L?w-i*2:x,t.lineTo(O+Math.round(M),g+k+H),t.lineWidth=a/15;const R=this._getLinearGradient();t.strokeStyle=R||h,t.stroke(),t.restore()}if(u!==t4&&(b!==0||v===ac)){T=S.split(" ").length-1;for(var U=F9(S),$=0;$<U.length;$++){var Z=U[$];Z===" "&&!P&&v===ac&&(O+=(w-i*2-x)/T),this._partialTextX=O,this._partialTextY=g+k,this._partialText=Z,t.fillStrokeShape(this),O+=this.measureSize(Z).width+b}}else b!==0&&t.setAttr("letterSpacing",`${b}px`),this._partialTextX=O,this._partialTextY=g+k,this._partialText=S,t.fillStrokeShape(this);t.restore(),n>1&&(g+=o)}}}_hitFunc(t){var r=this.getWidth(),n=this.getHeight();t.beginPath(),t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)}setText(t){var r=Rm.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(ik,r),this}getWidth(){var t=this.attrs.width===ws||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===ws||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return Rm.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var r=gg(),n=this.fontSize(),i;return r.save(),r.font=this._getContextFont(),i=r.measureText(t),r.restore(),{actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,alphabeticBaseline:i.alphabeticBaseline,emHeightAscent:i.emHeightAscent,emHeightDescent:i.emHeightDescent,fontBoundingBoxAscent:i.fontBoundingBoxAscent,fontBoundingBoxDescent:i.fontBoundingBoxDescent,hangingBaseline:i.hangingBaseline,ideographicBaseline:i.ideographicBaseline,width:i.width,height:n}}_getContextFont(){return this.fontStyle()+zd+this.fontVariant()+zd+(this.fontSize()+sk)+hk(this.fontFamily())}_addTextLine(t){this.align()===ac&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var r=this.letterSpacing(),n=t.length;return gg().measureText(t).width+(n?r*(n-1):0)}_setTextData(){var t=this.text().split(`
43
+ `),r=+this.fontSize(),n=0,i=this.lineHeight()*r,a=this.attrs.width,o=this.attrs.height,l=a!==ws&&a!==void 0,u=o!==ws&&o!==void 0,f=this.padding(),v=a-f*2,w=o-f*2,b=0,h=this.wrap(),E=h!==r4,y=h!==fk&&E,m=this.ellipsis();this.textArr=[],gg().font=this._getContextFont();for(var p=m?this._getTextWidth(pg):0,g=0,d=t.length;g<d;++g){var _=t[g],O=this._getTextWidth(_);if(l&&O>v)for(;_.length>0;){for(var k=0,C=_.length,S="",x=0;k<C;){var P=k+C>>>1,T=_.slice(0,P+1),L=this._getTextWidth(T)+p;L<=v?(k=P+1,S=T,x=L):C=P}if(S){if(y){var M,U=_[S.length],$=U===zd||U===J5;$&&x<=v?M=S.length:M=Math.max(S.lastIndexOf(zd),S.lastIndexOf(J5))+1,M>0&&(k=M,S=S.slice(0,k),x=this._getTextWidth(S))}S=S.trimRight(),this._addTextLine(S),n=Math.max(n,x),b+=i;var Z=this._shouldHandleEllipsis(b);if(Z){this._tryToAddEllipsisToLastLine();break}if(_=_.slice(k),_=_.trimLeft(),_.length>0&&(O=this._getTextWidth(_),O<=v)){this._addTextLine(_),b+=i,n=Math.max(n,O);break}}else break}else this._addTextLine(_),b+=i,n=Math.max(n,O),this._shouldHandleEllipsis(b)&&g<d-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&b+i>w)break}this.textHeight=r,this.textWidth=n}_shouldHandleEllipsis(t){var r=+this.fontSize(),n=this.lineHeight()*r,i=this.attrs.height,a=i!==ws&&i!==void 0,o=this.padding(),l=i-o*2,u=this.wrap(),f=u!==r4;return!f||a&&t+n>l}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,r=t!==ws&&t!==void 0,n=this.padding(),i=t-n*2,a=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(!(!o||!a)){if(r){var l=this._getTextWidth(o.text+pg)<i;l||(o.text=o.text.slice(0,o.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+pg)}}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,r=this.hasShadow();return t&&r?!0:super._useBufferCanvas()}};kl.Text=cr;cr.prototype._fillFunc=pk;cr.prototype._strokeFunc=gk;cr.prototype.className=ak;cr.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,ek._registerNode)(cr);on.Factory.overWriteSetter(cr,"width",(0,Vo.getNumberOrAutoValidator)());on.Factory.overWriteSetter(cr,"height",(0,Vo.getNumberOrAutoValidator)());on.Factory.addGetterSetter(cr,"direction",j9);on.Factory.addGetterSetter(cr,"fontFamily","Arial");on.Factory.addGetterSetter(cr,"fontSize",12,(0,Vo.getNumberValidator)());on.Factory.addGetterSetter(cr,"fontStyle",B9);on.Factory.addGetterSetter(cr,"fontVariant",B9);on.Factory.addGetterSetter(cr,"padding",0,(0,Vo.getNumberValidator)());on.Factory.addGetterSetter(cr,"align",z9);on.Factory.addGetterSetter(cr,"verticalAlign",ok);on.Factory.addGetterSetter(cr,"lineHeight",1,(0,Vo.getNumberValidator)());on.Factory.addGetterSetter(cr,"wrap",ck);on.Factory.addGetterSetter(cr,"ellipsis",!1,(0,Vo.getBooleanValidator)());on.Factory.addGetterSetter(cr,"letterSpacing",0,(0,Vo.getNumberValidator)());on.Factory.addGetterSetter(cr,"text","",(0,Vo.getStringValidator)());on.Factory.addGetterSetter(cr,"textDecoration","");var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0});Gp.TextPath=void 0;const vg=ir,Gi=vt,mk=Ar,oc=Eu,mg=kl,H9=Ye,yk=gt;var bk="",G9="normal";function $9(e){e.fillText(this.partialText,0,0)}function V9(e){e.strokeText(this.partialText,0,0)}let kr=class extends mk.Shape{constructor(t){super(t),this.dummyCanvas=vg.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return oc.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const r=this.pathLength;return t-1>r?null:oc.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=oc.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var r=this.textDecoration(),n=this.fill(),i=this.fontSize(),a=this.glyphInfo;r==="underline"&&t.beginPath();for(var o=0;o<a.length;o++){t.save();var l=a[o].p0;t.translate(l.x,l.y),t.rotate(a[o].rotation),this.partialText=a[o].text,t.fillStrokeShape(this),r==="underline"&&(o===0&&t.moveTo(0,i/2+1),t.lineTo(i,i/2+1)),t.restore()}r==="underline"&&(t.strokeStyle=n,t.lineWidth=i/20,t.stroke()),t.restore()}_hitFunc(t){t.beginPath();var r=this.glyphInfo;if(r.length>=1){var n=r[0].p0;t.moveTo(n.x,n.y)}for(var i=0;i<r.length;i++){var a=r[i].p1;t.lineTo(a.x,a.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return vg.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return mg.Text.prototype.setText.call(this,t)}_getContextFont(){return mg.Text.prototype._getContextFont.call(this)}_getTextSize(t){var r=this.dummyCanvas,n=r.getContext("2d");n.save(),n.font=this._getContextFont();var i=n.measureText(t);return n.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:t,height:r}=this._getTextSize(this.attrs.text);if(this.textWidth=t,this.textHeight=r,this.glyphInfo=[],!this.attrs.data)return null;const n=this.letterSpacing(),i=this.align(),a=this.kerningFunc(),o=Math.max(this.textWidth+((this.attrs.text||"").length-1)*n,0);let l=0;i==="center"&&(l=Math.max(0,this.pathLength/2-o/2)),i==="right"&&(l=Math.max(0,this.pathLength-o));const u=(0,mg.stringToArray)(this.text());let f=l;for(var v=0;v<u.length;v++){const w=this._getPointAtLength(f);if(!w)return;let b=this._getTextSize(u[v]).width+n;if(u[v]===" "&&i==="justify"){const g=this.text().split(" ").length-1;b+=(this.pathLength-o)/g}const h=this._getPointAtLength(f+b);if(!h)return;const E=oc.Path.getLineLength(w.x,w.y,h.x,h.y);let y=0;if(a)try{y=a(u[v-1],u[v])*this.fontSize()}catch{y=0}w.x+=y,h.x+=y,this.textWidth+=y;const m=oc.Path.getPointOnLine(y+E/2,w.x,w.y,h.x,h.y),p=Math.atan2(h.y-w.y,h.x-w.x);this.glyphInfo.push({transposeX:m.x,transposeY:m.y,text:u[v],rotation:p,p0:w,p1:h}),f+=b}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(v){t.push(v.p0.x),t.push(v.p0.y),t.push(v.p1.x),t.push(v.p1.y)});for(var r=t[0]||0,n=t[0]||0,i=t[1]||0,a=t[1]||0,o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,l),a=Math.max(a,l);var f=this.fontSize();return{x:r-f/2,y:i-f/2,width:n-r+f,height:a-i+f}}destroy(){return vg.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};Gp.TextPath=kr;kr.prototype._fillFunc=$9;kr.prototype._strokeFunc=V9;kr.prototype._fillFuncHit=$9;kr.prototype._strokeFuncHit=V9;kr.prototype.className="TextPath";kr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,yk._registerNode)(kr);Gi.Factory.addGetterSetter(kr,"data");Gi.Factory.addGetterSetter(kr,"fontFamily","Arial");Gi.Factory.addGetterSetter(kr,"fontSize",12,(0,H9.getNumberValidator)());Gi.Factory.addGetterSetter(kr,"fontStyle",G9);Gi.Factory.addGetterSetter(kr,"align","left");Gi.Factory.addGetterSetter(kr,"letterSpacing",0,(0,H9.getNumberValidator)());Gi.Factory.addGetterSetter(kr,"textBaseline","middle");Gi.Factory.addGetterSetter(kr,"fontVariant",G9);Gi.Factory.addGetterSetter(kr,"text",bk);Gi.Factory.addGetterSetter(kr,"textDecoration",null);Gi.Factory.addGetterSetter(kr,"kerningFunc",null);var $p={};Object.defineProperty($p,"__esModule",{value:!0});$p.Transformer=void 0;const Dt=ir,At=vt,n4=Qt,_k=Ar,wk=wf,i4=wu,Ti=gt,qo=Ye,Sk=gt;var q9="tr-konva",Ek=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${q9}`).join(" "),a4="nodesRect",Ok=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],xk={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const Pk="ontouchstart"in Ti.Konva._global;function Ck(e,t,r){if(e==="rotater")return r;t+=Dt.Util.degToRad(xk[e]||0);var n=(Dt.Util.radToDeg(t)%360+360)%360;return Dt.Util._inRange(n,315+22.5,360)||Dt.Util._inRange(n,0,22.5)?"ns-resize":Dt.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":Dt.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":Dt.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":Dt.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":Dt.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":Dt.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":Dt.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(Dt.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var Hh=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],o4=1e8;function Tk(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function W9(e,t,r){const n=r.x+(e.x-r.x)*Math.cos(t)-(e.y-r.y)*Math.sin(t),i=r.y+(e.x-r.x)*Math.sin(t)+(e.y-r.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:n,y:i}}function Ak(e,t){const r=Tk(e);return W9(e,t,r)}function kk(e,t,r){let n=t;for(let i=0;i<e.length;i++){const a=Ti.Konva.getAngle(e[i]),o=Math.abs(a-t)%(Math.PI*2);Math.min(o,Math.PI*2-o)<r&&(n=a)}return n}let Lm=0,St=class extends i4.Group{constructor(t){super(t),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(Ek,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return Dt.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return q9+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const r=t.filter(i=>i.isAncestorOf(this)?(Dt.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=r,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const a=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=i._attrsAffectingSize.map(l=>l+"Change."+this._getEventNamespace()).join(" ");i.on(o,a),i.on(Ok.map(l=>l+`.${this._getEventNamespace()}`).join(" "),a),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,a),this._proxyDrag(i)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let r;t.on(`dragstart.${this._getEventNamespace()}`,n=>{r=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(n,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!r)return;const i=t.getAbsolutePosition(),a=i.x-r.x,o=i.y-r.y;this.nodes().forEach(l=>{if(l===t||l.isDragging())return;const u=l.getAbsolutePosition();l.setAbsolutePosition({x:u.x+a,y:u.y+o}),l.startDrag(n)}),r=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(a4),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(a4,this.__getNodeRect)}__getNodeShape(t,r=this.rotation(),n){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=t.getAbsoluteScale(n),o=t.getAbsolutePosition(n),l=i.x*a.x-t.offsetX()*a.x,u=i.y*a.y-t.offsetY()*a.y;const f=(Ti.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),v={x:o.x+l*Math.cos(f)+u*Math.sin(-f),y:o.y+u*Math.cos(f)+l*Math.sin(f),width:i.width*a.x,height:i.height*a.y,rotation:f};return W9(v,-Ti.Konva.getAngle(r),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-o4,y:-o4,width:0,height:0,rotation:0};const r=[];this.nodes().map(f=>{const v=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var w=[{x:v.x,y:v.y},{x:v.x+v.width,y:v.y},{x:v.x+v.width,y:v.y+v.height},{x:v.x,y:v.y+v.height}],b=f.getAbsoluteTransform();w.forEach(function(h){var E=b.point(h);r.push(E)})});const n=new Dt.Transform;n.rotate(-Ti.Konva.getAngle(this.rotation()));var i=1/0,a=1/0,o=-1/0,l=-1/0;r.forEach(function(f){var v=n.point(f);i===void 0&&(i=o=v.x,a=l=v.y),i=Math.min(i,v.x),a=Math.min(a,v.y),o=Math.max(o,v.x),l=Math.max(l,v.y)}),n.invert();const u=n.point({x:i,y:a});return{x:u.x,y:u.y,width:o-i,height:l-a,rotation:Ti.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),Hh.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var r=new wk.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Pk?10:"auto"}),n=this;r.on("mousedown touchstart",function(i){n._handleMouseDown(i)}),r.on("dragstart",i=>{r.stopDrag(),i.cancelBubble=!0}),r.on("dragend",i=>{i.cancelBubble=!0}),r.on("mouseenter",()=>{var i=Ti.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=Ck(t,i,a);r.getStage().content&&(r.getStage().content.style.cursor=o),this._cursorChange=!0}),r.on("mouseout",()=>{r.getStage().content&&(r.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(r)}_createBack(){var t=new _k.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(r,n){var i=n.getParent(),a=i.padding();r.beginPath(),r.rect(-a,-a,n.width()+a*2,n.height()+a*2),r.moveTo(n.width()/2,-a),i.rotateEnabled()&&i.rotateLineVisible()&&r.lineTo(n.width()/2,-i.rotateAnchorOffset()*Dt.Util._sign(n.height())-a),r.fillStrokeShape(n)},hitFunc:(r,n)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();r.beginPath(),r.rect(-i,-i,n.width()+i*2,n.height()+i*2),r.fillStrokeShape(n)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",r=>{r.cancelBubble=!0}),t.on("dragmove",r=>{r.cancelBubble=!0}),t.on("dragend",r=>{r.cancelBubble=!0}),this.on("dragmove",r=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var r=this._getNodeRect(),n=r.width,i=r.height,a=Math.sqrt(Math.pow(n,2)+Math.pow(i,2));this.sin=Math.abs(i/a),this.cos=Math.abs(n/a),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var o=t.target.getAbsolutePosition(),l=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:l.x-o.x,y:l.y-o.y},Lm++,this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(u=>{u._fire("transformstart",{evt:t.evt,target:u})})}_handleMouseMove(t){var r,n,i,a=this.findOne("."+this._movingAnchorName),o=a.getStage();o.setPointersPositions(t);const l=o.getPointerPosition();let u={x:l.x-this._anchorDragOffset.x,y:l.y-this._anchorDragOffset.y};const f=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(u=this.anchorDragBoundFunc()(f,u,t)),a.setAbsolutePosition(u);const v=a.getAbsolutePosition();if(!(f.x===v.x&&f.y===v.y)){if(this._movingAnchorName==="rotater"){var w=this._getNodeRect();r=a.x()-w.width/2,n=-a.y()+w.height/2;let M=Math.atan2(-n,r)+Math.PI/2;w.height<0&&(M-=Math.PI);var b=Ti.Konva.getAngle(this.rotation());const U=b+M,$=Ti.Konva.getAngle(this.rotationSnapTolerance()),z=kk(this.rotationSnaps(),U,$)-w.rotation,N=Ak(w,z);this._fitNodesInto(N,t);return}var h=this.shiftBehavior(),E;h==="inverted"?E=this.keepRatio()&&!t.shiftKey:h==="none"?E=this.keepRatio():E=this.keepRatio()||t.shiftKey;var d=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(E){var y=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(y.x-a.x(),2)+Math.pow(y.y-a.y(),2));var m=this.findOne(".top-left").x()>y.x?-1:1,p=this.findOne(".top-left").y()>y.y?-1:1;r=i*this.cos*m,n=i*this.sin*p,this.findOne(".top-left").x(y.x-r),this.findOne(".top-left").y(y.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(E){var y=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(a.x()-y.x,2)+Math.pow(y.y-a.y(),2));var m=this.findOne(".top-right").x()<y.x?-1:1,p=this.findOne(".top-right").y()>y.y?-1:1;r=i*this.cos*m,n=i*this.sin*p,this.findOne(".top-right").x(y.x+r),this.findOne(".top-right").y(y.y-n)}var g=a.position();this.findOne(".top-left").y(g.y),this.findOne(".bottom-right").x(g.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(E){var y=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(y.x-a.x(),2)+Math.pow(a.y()-y.y,2));var m=y.x<a.x()?-1:1,p=a.y()<y.y?-1:1;r=i*this.cos*m,n=i*this.sin*p,a.x(y.x-r),a.y(y.y+n)}g=a.position(),this.findOne(".top-left").x(g.x),this.findOne(".bottom-right").y(g.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(E){var y=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(a.x()-y.x,2)+Math.pow(a.y()-y.y,2));var m=this.findOne(".bottom-right").x()<y.x?-1:1,p=this.findOne(".bottom-right").y()<y.y?-1:1;r=i*this.cos*m,n=i*this.sin*p,this.findOne(".bottom-right").x(y.x+r),this.findOne(".bottom-right").y(y.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var d=this.centeredScaling()||t.altKey;if(d){var _=this.findOne(".top-left"),O=this.findOne(".bottom-right"),k=_.x(),C=_.y(),S=this.getWidth()-O.x(),x=this.getHeight()-O.y();O.move({x:-k,y:-C}),_.move({x:S,y:x})}var P=this.findOne(".top-left").getAbsolutePosition();r=P.x,n=P.y;var T=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),L=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:r,y:n,width:T,height:L,rotation:Ti.Konva.getAngle(this.rotation())},t)}}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){var r;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));var n=this.getNode();Lm--,this._fire("transformend",{evt:t,target:n}),(r=this.getLayer())===null||r===void 0||r.batchDraw(),n&&this._nodes.forEach(i=>{var a;i._fire("transformend",{evt:t,target:i}),(a=i.getLayer())===null||a===void 0||a.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(t,r){var n=this._getNodeRect();const i=1;if(Dt.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(Dt.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}var a=new Dt.Transform;if(a.rotate(Ti.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const b=a.point({x:-this.padding()*2,y:0});t.x+=b.x,t.y+=b.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=b.x,this._anchorDragOffset.y-=b.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const b=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=b.x,this._anchorDragOffset.y-=b.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const b=a.point({x:0,y:-this.padding()*2});t.x+=b.x,t.y+=b.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=b.x,this._anchorDragOffset.y-=b.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const b=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=b.x,this._anchorDragOffset.y-=b.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const b=this.boundBoxFunc()(n,t);b?t=b:Dt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,l=new Dt.Transform;l.translate(n.x,n.y),l.rotate(n.rotation),l.scale(n.width/o,n.height/o);const u=new Dt.Transform,f=t.width/o,v=t.height/o;this.flipEnabled()===!1?(u.translate(t.x,t.y),u.rotate(t.rotation),u.translate(t.width<0?t.width:0,t.height<0?t.height:0),u.scale(Math.abs(f),Math.abs(v))):(u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(f,v));const w=u.multiply(l.invert());this._nodes.forEach(b=>{var h;const E=b.getParent().getAbsoluteTransform(),y=b.getTransform().copy();y.translate(b.offsetX(),b.offsetY());const m=new Dt.Transform;m.multiply(E.copy().invert()).multiply(w).multiply(E).multiply(y);const p=m.decompose();b.setAttrs(p),(h=b.getLayer())===null||h===void 0||h.batchDraw()}),this.rotation(Dt.Util._getRotation(t.rotation)),this._nodes.forEach(b=>{this._fire("transform",{evt:r,target:b}),b._fire("transform",{evt:r,target:b})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,r){this.findOne(t).setAttrs(r)}update(){var t,r=this._getNodeRect();this.rotation(Dt.Util._getRotation(r.rotation));var n=r.width,i=r.height,a=this.enabledAnchors(),o=this.resizeEnabled(),l=this.padding(),u=this.anchorSize();const f=this.find("._anchor");f.forEach(w=>{w.setAttrs({width:u,height:u,offsetX:u/2,offsetY:u/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:u/2+l,offsetY:u/2+l,visible:o&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:u/2+l,visible:o&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:u/2-l,offsetY:u/2+l,visible:o&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:u/2+l,visible:o&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:i/2,offsetX:u/2-l,visible:o&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:u/2+l,offsetY:u/2-l,visible:o&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:i,offsetY:u/2-l,visible:o&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:i,offsetX:u/2-l,offsetY:u/2-l,visible:o&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*Dt.Util._sign(i)-l,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const v=this.anchorStyleFunc();v&&f.forEach(w=>{v(w)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),i4.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return n4.Node.prototype.toObject.call(this)}clone(t){var r=n4.Node.prototype.clone.call(this,t);return r}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};$p.Transformer=St;St.isTransforming=()=>Lm>0;function Rk(e){return e instanceof Array||Dt.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){Hh.indexOf(t)===-1&&Dt.Util.warn("Unknown anchor name: "+t+". Available names are: "+Hh.join(", "))}),e||[]}St.prototype.className="Transformer";(0,Sk._registerNode)(St);At.Factory.addGetterSetter(St,"enabledAnchors",Hh,Rk);At.Factory.addGetterSetter(St,"flipEnabled",!0,(0,qo.getBooleanValidator)());At.Factory.addGetterSetter(St,"resizeEnabled",!0);At.Factory.addGetterSetter(St,"anchorSize",10,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"rotateEnabled",!0);At.Factory.addGetterSetter(St,"rotateLineVisible",!0);At.Factory.addGetterSetter(St,"rotationSnaps",[]);At.Factory.addGetterSetter(St,"rotateAnchorOffset",50,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"rotateAnchorCursor","crosshair");At.Factory.addGetterSetter(St,"rotationSnapTolerance",5,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"borderEnabled",!0);At.Factory.addGetterSetter(St,"anchorStroke","rgb(0, 161, 255)");At.Factory.addGetterSetter(St,"anchorStrokeWidth",1,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"anchorFill","white");At.Factory.addGetterSetter(St,"anchorCornerRadius",0,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"borderStroke","rgb(0, 161, 255)");At.Factory.addGetterSetter(St,"borderStrokeWidth",1,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"borderDash");At.Factory.addGetterSetter(St,"keepRatio",!0);At.Factory.addGetterSetter(St,"shiftBehavior","default");At.Factory.addGetterSetter(St,"centeredScaling",!1);At.Factory.addGetterSetter(St,"ignoreStroke",!1);At.Factory.addGetterSetter(St,"padding",0,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"node");At.Factory.addGetterSetter(St,"nodes");At.Factory.addGetterSetter(St,"boundBoxFunc");At.Factory.addGetterSetter(St,"anchorDragBoundFunc");At.Factory.addGetterSetter(St,"anchorStyleFunc");At.Factory.addGetterSetter(St,"shouldOverdrawWholeArea",!1);At.Factory.addGetterSetter(St,"useSingleNodeRotation",!0);At.Factory.backCompat(St,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Vp={};Object.defineProperty(Vp,"__esModule",{value:!0});Vp.Wedge=void 0;const qp=vt,Lk=Ar,Mk=gt,Y9=Ye,Nk=gt;let qa=class extends Lk.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,Mk.Konva.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}};Vp.Wedge=qa;qa.prototype.className="Wedge";qa.prototype._centroid=!0;qa.prototype._attrsAffectingSize=["radius"];(0,Nk._registerNode)(qa);qp.Factory.addGetterSetter(qa,"radius",0,(0,Y9.getNumberValidator)());qp.Factory.addGetterSetter(qa,"angle",0,(0,Y9.getNumberValidator)());qp.Factory.addGetterSetter(qa,"clockwise",!1);qp.Factory.backCompat(qa,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Wp={};Object.defineProperty(Wp,"__esModule",{value:!0});Wp.Blur=void 0;const l4=vt,Ik=Qt,Dk=Ye;function s4(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var Fk=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],jk=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function zk(e,t){var r=e.data,n=e.width,i=e.height,a,o,l,u,f,v,w,b,h,E,y,m,p,g,d,_,O,k,C,S,x,P,T,L,M=t+t+1,U=n-1,$=i-1,Z=t+1,z=Z*(Z+1)/2,N=new s4,H=null,R=N,F=null,B=null,D=Fk[t],V=jk[t];for(l=1;l<M;l++)R=R.next=new s4,l===Z&&(H=R);for(R.next=N,w=v=0,o=0;o<i;o++){for(_=O=k=C=b=h=E=y=0,m=Z*(S=r[v]),p=Z*(x=r[v+1]),g=Z*(P=r[v+2]),d=Z*(T=r[v+3]),b+=z*S,h+=z*x,E+=z*P,y+=z*T,R=N,l=0;l<Z;l++)R.r=S,R.g=x,R.b=P,R.a=T,R=R.next;for(l=1;l<Z;l++)u=v+((U<l?U:l)<<2),b+=(R.r=S=r[u])*(L=Z-l),h+=(R.g=x=r[u+1])*L,E+=(R.b=P=r[u+2])*L,y+=(R.a=T=r[u+3])*L,_+=S,O+=x,k+=P,C+=T,R=R.next;for(F=N,B=H,a=0;a<n;a++)r[v+3]=T=y*D>>V,T!==0?(T=255/T,r[v]=(b*D>>V)*T,r[v+1]=(h*D>>V)*T,r[v+2]=(E*D>>V)*T):r[v]=r[v+1]=r[v+2]=0,b-=m,h-=p,E-=g,y-=d,m-=F.r,p-=F.g,g-=F.b,d-=F.a,u=w+((u=a+t+1)<U?u:U)<<2,_+=F.r=r[u],O+=F.g=r[u+1],k+=F.b=r[u+2],C+=F.a=r[u+3],b+=_,h+=O,E+=k,y+=C,F=F.next,m+=S=B.r,p+=x=B.g,g+=P=B.b,d+=T=B.a,_-=S,O-=x,k-=P,C-=T,B=B.next,v+=4;w+=n}for(a=0;a<n;a++){for(O=k=C=_=h=E=y=b=0,v=a<<2,m=Z*(S=r[v]),p=Z*(x=r[v+1]),g=Z*(P=r[v+2]),d=Z*(T=r[v+3]),b+=z*S,h+=z*x,E+=z*P,y+=z*T,R=N,l=0;l<Z;l++)R.r=S,R.g=x,R.b=P,R.a=T,R=R.next;for(f=n,l=1;l<=t;l++)v=f+a<<2,b+=(R.r=S=r[v])*(L=Z-l),h+=(R.g=x=r[v+1])*L,E+=(R.b=P=r[v+2])*L,y+=(R.a=T=r[v+3])*L,_+=S,O+=x,k+=P,C+=T,R=R.next,l<$&&(f+=n);for(v=a,F=N,B=H,o=0;o<i;o++)u=v<<2,r[u+3]=T=y*D>>V,T>0?(T=255/T,r[u]=(b*D>>V)*T,r[u+1]=(h*D>>V)*T,r[u+2]=(E*D>>V)*T):r[u]=r[u+1]=r[u+2]=0,b-=m,h-=p,E-=g,y-=d,m-=F.r,p-=F.g,g-=F.b,d-=F.a,u=a+((u=o+Z)<$?u:$)*n<<2,b+=_+=F.r=r[u],h+=O+=F.g=r[u+1],E+=k+=F.b=r[u+2],y+=C+=F.a=r[u+3],F=F.next,m+=S=B.r,p+=x=B.g,g+=P=B.b,d+=T=B.a,_-=S,O-=x,k-=P,C-=T,B=B.next,v+=n}}const Bk=function(t){var r=Math.round(this.blurRadius());r>0&&zk(t,r)};Wp.Blur=Bk;l4.Factory.addGetterSetter(Ik.Node,"blurRadius",0,(0,Dk.getNumberValidator)(),l4.Factory.afterSetFilter);var Yp={};Object.defineProperty(Yp,"__esModule",{value:!0});Yp.Brighten=void 0;const u4=vt,Uk=Qt,Hk=Ye,Gk=function(e){var t=this.brightness()*255,r=e.data,n=r.length,i;for(i=0;i<n;i+=4)r[i]+=t,r[i+1]+=t,r[i+2]+=t};Yp.Brighten=Gk;u4.Factory.addGetterSetter(Uk.Node,"brightness",0,(0,Hk.getNumberValidator)(),u4.Factory.afterSetFilter);var Kp={};Object.defineProperty(Kp,"__esModule",{value:!0});Kp.Contrast=void 0;const c4=vt,$k=Qt,Vk=Ye,qk=function(e){var t=Math.pow((this.contrast()+100)/100,2),r=e.data,n=r.length,i=150,a=150,o=150,l;for(l=0;l<n;l+=4)i=r[l],a=r[l+1],o=r[l+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,r[l]=i,r[l+1]=a,r[l+2]=o};Kp.Contrast=qk;c4.Factory.addGetterSetter($k.Node,"contrast",0,(0,Vk.getNumberValidator)(),c4.Factory.afterSetFilter);var Xp={};Object.defineProperty(Xp,"__esModule",{value:!0});Xp.Emboss=void 0;const Io=vt,Zp=Qt,Wk=ir,K9=Ye,Yk=function(e){var t=this.embossStrength()*10,r=this.embossWhiteLevel()*255,n=this.embossDirection(),i=this.embossBlend(),a=0,o=0,l=e.data,u=e.width,f=e.height,v=u*4,w=f;switch(n){case"top-left":a=-1,o=-1;break;case"top":a=-1,o=0;break;case"top-right":a=-1,o=1;break;case"right":a=0,o=1;break;case"bottom-right":a=1,o=1;break;case"bottom":a=1,o=0;break;case"bottom-left":a=1,o=-1;break;case"left":a=0,o=-1;break;default:Wk.Util.error("Unknown emboss direction: "+n)}do{var b=(w-1)*v,h=a;w+h<1&&(h=0),w+h>f&&(h=0);var E=(w-1+h)*u*4,y=u;do{var m=b+(y-1)*4,p=o;y+p<1&&(p=0),y+p>u&&(p=0);var g=E+(y-1+p)*4,d=l[m]-l[g],_=l[m+1]-l[g+1],O=l[m+2]-l[g+2],k=d,C=k>0?k:-k,S=_>0?_:-_,x=O>0?O:-O;if(S>C&&(k=_),x>C&&(k=O),k*=t,i){var P=l[m]+k,T=l[m+1]+k,L=l[m+2]+k;l[m]=P>255?255:P<0?0:P,l[m+1]=T>255?255:T<0?0:T,l[m+2]=L>255?255:L<0?0:L}else{var M=r-k;M<0?M=0:M>255&&(M=255),l[m]=l[m+1]=l[m+2]=M}}while(--y)}while(--w)};Xp.Emboss=Yk;Io.Factory.addGetterSetter(Zp.Node,"embossStrength",.5,(0,K9.getNumberValidator)(),Io.Factory.afterSetFilter);Io.Factory.addGetterSetter(Zp.Node,"embossWhiteLevel",.5,(0,K9.getNumberValidator)(),Io.Factory.afterSetFilter);Io.Factory.addGetterSetter(Zp.Node,"embossDirection","top-left",null,Io.Factory.afterSetFilter);Io.Factory.addGetterSetter(Zp.Node,"embossBlend",!1,null,Io.Factory.afterSetFilter);var Qp={};Object.defineProperty(Qp,"__esModule",{value:!0});Qp.Enhance=void 0;const f4=vt,Kk=Qt,Xk=Ye;function yg(e,t,r,n,i){var a=r-t,o=i-n,l;return a===0?n+o/2:o===0?n:(l=(e-t)/a,l=o*l+n,l)}const Zk=function(e){var t=e.data,r=t.length,n=t[0],i=n,a,o=t[1],l=o,u,f=t[2],v=f,w,b,h=this.enhance();if(h!==0){for(b=0;b<r;b+=4)a=t[b+0],a<n?n=a:a>i&&(i=a),u=t[b+1],u<o?o=u:u>l&&(l=u),w=t[b+2],w<f?f=w:w>v&&(v=w);i===n&&(i=255,n=0),l===o&&(l=255,o=0),v===f&&(v=255,f=0);var E,y,m,p,g,d,_,O,k;for(h>0?(y=i+h*(255-i),m=n-h*(n-0),g=l+h*(255-l),d=o-h*(o-0),O=v+h*(255-v),k=f-h*(f-0)):(E=(i+n)*.5,y=i+h*(i-E),m=n+h*(n-E),p=(l+o)*.5,g=l+h*(l-p),d=o+h*(o-p),_=(v+f)*.5,O=v+h*(v-_),k=f+h*(f-_)),b=0;b<r;b+=4)t[b+0]=yg(t[b+0],n,i,m,y),t[b+1]=yg(t[b+1],o,l,d,g),t[b+2]=yg(t[b+2],f,v,k,O)}};Qp.Enhance=Zk;f4.Factory.addGetterSetter(Kk.Node,"enhance",0,(0,Xk.getNumberValidator)(),f4.Factory.afterSetFilter);var Jp={};Object.defineProperty(Jp,"__esModule",{value:!0});Jp.Grayscale=void 0;const Qk=function(e){var t=e.data,r=t.length,n,i;for(n=0;n<r;n+=4)i=.34*t[n]+.5*t[n+1]+.16*t[n+2],t[n]=i,t[n+1]=i,t[n+2]=i};Jp.Grayscale=Qk;var e0={};Object.defineProperty(e0,"__esModule",{value:!0});e0.HSL=void 0;const ou=vt,u2=Qt,c2=Ye;ou.Factory.addGetterSetter(u2.Node,"hue",0,(0,c2.getNumberValidator)(),ou.Factory.afterSetFilter);ou.Factory.addGetterSetter(u2.Node,"saturation",0,(0,c2.getNumberValidator)(),ou.Factory.afterSetFilter);ou.Factory.addGetterSetter(u2.Node,"luminance",0,(0,c2.getNumberValidator)(),ou.Factory.afterSetFilter);const Jk=function(e){var t=e.data,r=t.length,n=1,i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=this.luminance()*127,l,u=n*i*Math.cos(a*Math.PI/180),f=n*i*Math.sin(a*Math.PI/180),v=.299*n+.701*u+.167*f,w=.587*n-.587*u+.33*f,b=.114*n-.114*u-.497*f,h=.299*n-.299*u-.328*f,E=.587*n+.413*u+.035*f,y=.114*n-.114*u+.293*f,m=.299*n-.3*u+1.25*f,p=.587*n-.586*u-1.05*f,g=.114*n+.886*u-.2*f,d,_,O,k;for(l=0;l<r;l+=4)d=t[l+0],_=t[l+1],O=t[l+2],k=t[l+3],t[l+0]=v*d+w*_+b*O+o,t[l+1]=h*d+E*_+y*O+o,t[l+2]=m*d+p*_+g*O+o,t[l+3]=k};e0.HSL=Jk;var t0={};Object.defineProperty(t0,"__esModule",{value:!0});t0.HSV=void 0;const lu=vt,f2=Qt,d2=Ye,eR=function(e){var t=e.data,r=t.length,n=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o,l=n*i*Math.cos(a*Math.PI/180),u=n*i*Math.sin(a*Math.PI/180),f=.299*n+.701*l+.167*u,v=.587*n-.587*l+.33*u,w=.114*n-.114*l-.497*u,b=.299*n-.299*l-.328*u,h=.587*n+.413*l+.035*u,E=.114*n-.114*l+.293*u,y=.299*n-.3*l+1.25*u,m=.587*n-.586*l-1.05*u,p=.114*n+.886*l-.2*u,g,d,_,O;for(o=0;o<r;o+=4)g=t[o+0],d=t[o+1],_=t[o+2],O=t[o+3],t[o+0]=f*g+v*d+w*_,t[o+1]=b*g+h*d+E*_,t[o+2]=y*g+m*d+p*_,t[o+3]=O};t0.HSV=eR;lu.Factory.addGetterSetter(f2.Node,"hue",0,(0,d2.getNumberValidator)(),lu.Factory.afterSetFilter);lu.Factory.addGetterSetter(f2.Node,"saturation",0,(0,d2.getNumberValidator)(),lu.Factory.afterSetFilter);lu.Factory.addGetterSetter(f2.Node,"value",0,(0,d2.getNumberValidator)(),lu.Factory.afterSetFilter);var r0={};Object.defineProperty(r0,"__esModule",{value:!0});r0.Invert=void 0;const tR=function(e){var t=e.data,r=t.length,n;for(n=0;n<r;n+=4)t[n]=255-t[n],t[n+1]=255-t[n+1],t[n+2]=255-t[n+2]};r0.Invert=tR;var n0={};Object.defineProperty(n0,"__esModule",{value:!0});n0.Kaleidoscope=void 0;const Gh=vt,X9=Qt,d4=ir,Z9=Ye;var rR=function(e,t,r){var n=e.data,i=t.data,a=e.width,o=e.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,v,w,b=0,h=0,E=0,y=0,m,p=Math.sqrt(l*l+u*u);v=a-l,w=o-u,m=Math.sqrt(v*v+w*w),p=m>p?m:p;var g=o,d=a,_,O,k=360/d*Math.PI/180,C,S;for(O=0;O<d;O+=1)for(C=Math.sin(O*k),S=Math.cos(O*k),_=0;_<g;_+=1)v=Math.floor(l+p*_/g*S),w=Math.floor(u+p*_/g*C),f=(w*a+v)*4,b=n[f+0],h=n[f+1],E=n[f+2],y=n[f+3],f=(O+_*a)*4,i[f+0]=b,i[f+1]=h,i[f+2]=E,i[f+3]=y},nR=function(e,t,r){var n=e.data,i=t.data,a=e.width,o=e.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,v,w,b,h,E=0,y=0,m=0,p=0,g,d=Math.sqrt(l*l+u*u);v=a-l,w=o-u,g=Math.sqrt(v*v+w*w),d=g>d?g:d;var _=o,O=a,k,C,S=0,x,P;for(v=0;v<a;v+=1)for(w=0;w<o;w+=1)b=v-l,h=w-u,k=Math.sqrt(b*b+h*h)*_/d,C=(Math.atan2(h,b)*180/Math.PI+360+S)%360,C=C*O/360,x=Math.floor(C),P=Math.floor(k),f=(P*a+x)*4,E=n[f+0],y=n[f+1],m=n[f+2],p=n[f+3],f=(w*a+v)*4,i[f+0]=E,i[f+1]=y,i[f+2]=m,i[f+3]=p};const iR=function(e){var t=e.width,r=e.height,n,i,a,o,l,u,f,v,w,b,h=Math.round(this.kaleidoscopePower()),E=Math.round(this.kaleidoscopeAngle()),y=Math.floor(t*(E%360)/360);if(!(h<1)){var m=d4.Util.createCanvasElement();m.width=t,m.height=r;var p=m.getContext("2d").getImageData(0,0,t,r);d4.Util.releaseCanvas(m),rR(e,p,{polarCenterX:t/2,polarCenterY:r/2});for(var g=t/Math.pow(2,h);g<=8;)g=g*2,h-=1;g=Math.ceil(g);var d=g,_=0,O=d,k=1;for(y+g>t&&(_=d,O=0,k=-1),i=0;i<r;i+=1)for(n=_;n!==O;n+=k)a=Math.round(n+y)%t,w=(t*i+a)*4,l=p.data[w+0],u=p.data[w+1],f=p.data[w+2],v=p.data[w+3],b=(t*i+n)*4,p.data[b+0]=l,p.data[b+1]=u,p.data[b+2]=f,p.data[b+3]=v;for(i=0;i<r;i+=1)for(d=Math.floor(g),o=0;o<h;o+=1){for(n=0;n<d+1;n+=1)w=(t*i+n)*4,l=p.data[w+0],u=p.data[w+1],f=p.data[w+2],v=p.data[w+3],b=(t*i+d*2-n-1)*4,p.data[b+0]=l,p.data[b+1]=u,p.data[b+2]=f,p.data[b+3]=v;d*=2}nR(p,e,{polarRotation:0})}};n0.Kaleidoscope=iR;Gh.Factory.addGetterSetter(X9.Node,"kaleidoscopePower",2,(0,Z9.getNumberValidator)(),Gh.Factory.afterSetFilter);Gh.Factory.addGetterSetter(X9.Node,"kaleidoscopeAngle",0,(0,Z9.getNumberValidator)(),Gh.Factory.afterSetFilter);var i0={};Object.defineProperty(i0,"__esModule",{value:!0});i0.Mask=void 0;const h4=vt,aR=Qt,oR=Ye;function Ud(e,t,r){var n=(r*e.width+t)*4,i=[];return i.push(e.data[n++],e.data[n++],e.data[n++],e.data[n++]),i}function lc(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function lR(e){for(var t=[0,0,0],r=0;r<e.length;r++)t[0]+=e[r][0],t[1]+=e[r][1],t[2]+=e[r][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function sR(e,t){var r=Ud(e,0,0),n=Ud(e,e.width-1,0),i=Ud(e,0,e.height-1),a=Ud(e,e.width-1,e.height-1),o=t||10;if(lc(r,n)<o&&lc(n,a)<o&&lc(a,i)<o&&lc(i,r)<o){for(var l=lR([n,r,a,i]),u=[],f=0;f<e.width*e.height;f++){var v=lc(l,[e.data[f*4],e.data[f*4+1],e.data[f*4+2]]);u[f]=v<o?0:255}return u}}function uR(e,t){for(var r=0;r<e.width*e.height;r++)e.data[4*r+3]=t[r]}function cR(e,t,r){for(var n=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,v=0,w=0;w<i;w++)for(var b=0;b<i;b++){var h=l+w-a,E=u+b-a;if(h>=0&&h<r&&E>=0&&E<t){var y=h*t+E,m=n[w*i+b];v+=e[y]*m}}o[f]=v===255*8?255:0}return o}function fR(e,t,r){for(var n=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,v=0,w=0;w<i;w++)for(var b=0;b<i;b++){var h=l+w-a,E=u+b-a;if(h>=0&&h<r&&E>=0&&E<t){var y=h*t+E,m=n[w*i+b];v+=e[y]*m}}o[f]=v>=255*4?255:0}return o}function dR(e,t,r){for(var n=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,v=0,w=0;w<i;w++)for(var b=0;b<i;b++){var h=l+w-a,E=u+b-a;if(h>=0&&h<r&&E>=0&&E<t){var y=h*t+E,m=n[w*i+b];v+=e[y]*m}}o[f]=v}return o}const hR=function(e){var t=this.threshold(),r=sR(e,t);return r&&(r=cR(r,e.width,e.height),r=fR(r,e.width,e.height),r=dR(r,e.width,e.height),uR(e,r)),e};i0.Mask=hR;h4.Factory.addGetterSetter(aR.Node,"threshold",0,(0,oR.getNumberValidator)(),h4.Factory.afterSetFilter);var a0={};Object.defineProperty(a0,"__esModule",{value:!0});a0.Noise=void 0;const p4=vt,pR=Qt,gR=Ye,vR=function(e){var t=this.noise()*255,r=e.data,n=r.length,i=t/2,a;for(a=0;a<n;a+=4)r[a+0]+=i-2*i*Math.random(),r[a+1]+=i-2*i*Math.random(),r[a+2]+=i-2*i*Math.random()};a0.Noise=vR;p4.Factory.addGetterSetter(pR.Node,"noise",.2,(0,gR.getNumberValidator)(),p4.Factory.afterSetFilter);var o0={};Object.defineProperty(o0,"__esModule",{value:!0});o0.Pixelate=void 0;const g4=vt,mR=ir,yR=Qt,bR=Ye,_R=function(e){var t=Math.ceil(this.pixelSize()),r=e.width,n=e.height,i,a,o,l,u,f,v,w=Math.ceil(r/t),b=Math.ceil(n/t),h,E,y,m,p,g,d,_=e.data;if(t<=0){mR.Util.error("pixelSize value can not be <= 0");return}for(p=0;p<w;p+=1)for(g=0;g<b;g+=1){for(l=0,u=0,f=0,v=0,h=p*t,E=h+t,y=g*t,m=y+t,d=0,i=h;i<E;i+=1)if(!(i>=r))for(a=y;a<m;a+=1)a>=n||(o=(r*a+i)*4,l+=_[o+0],u+=_[o+1],f+=_[o+2],v+=_[o+3],d+=1);for(l=l/d,u=u/d,f=f/d,v=v/d,i=h;i<E;i+=1)if(!(i>=r))for(a=y;a<m;a+=1)a>=n||(o=(r*a+i)*4,_[o+0]=l,_[o+1]=u,_[o+2]=f,_[o+3]=v)}};o0.Pixelate=_R;g4.Factory.addGetterSetter(yR.Node,"pixelSize",8,(0,bR.getNumberValidator)(),g4.Factory.afterSetFilter);var l0={};Object.defineProperty(l0,"__esModule",{value:!0});l0.Posterize=void 0;const v4=vt,wR=Qt,SR=Ye,ER=function(e){var t=Math.round(this.levels()*254)+1,r=e.data,n=r.length,i=255/t,a;for(a=0;a<n;a+=1)r[a]=Math.floor(r[a]/i)*i};l0.Posterize=ER;v4.Factory.addGetterSetter(wR.Node,"levels",.5,(0,SR.getNumberValidator)(),v4.Factory.afterSetFilter);var s0={};Object.defineProperty(s0,"__esModule",{value:!0});s0.RGB=void 0;const $h=vt,h2=Qt,OR=Ye,xR=function(e){var t=e.data,r=t.length,n=this.red(),i=this.green(),a=this.blue(),o,l;for(o=0;o<r;o+=4)l=(.34*t[o]+.5*t[o+1]+.16*t[o+2])/255,t[o]=l*n,t[o+1]=l*i,t[o+2]=l*a,t[o+3]=t[o+3]};s0.RGB=xR;$h.Factory.addGetterSetter(h2.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});$h.Factory.addGetterSetter(h2.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});$h.Factory.addGetterSetter(h2.Node,"blue",0,OR.RGBComponent,$h.Factory.afterSetFilter);var u0={};Object.defineProperty(u0,"__esModule",{value:!0});u0.RGBA=void 0;const Yc=vt,c0=Qt,PR=Ye,CR=function(e){var t=e.data,r=t.length,n=this.red(),i=this.green(),a=this.blue(),o=this.alpha(),l,u;for(l=0;l<r;l+=4)u=1-o,t[l]=n*o+t[l]*u,t[l+1]=i*o+t[l+1]*u,t[l+2]=a*o+t[l+2]*u};u0.RGBA=CR;Yc.Factory.addGetterSetter(c0.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Yc.Factory.addGetterSetter(c0.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Yc.Factory.addGetterSetter(c0.Node,"blue",0,PR.RGBComponent,Yc.Factory.afterSetFilter);Yc.Factory.addGetterSetter(c0.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var f0={};Object.defineProperty(f0,"__esModule",{value:!0});f0.Sepia=void 0;const TR=function(e){var t=e.data,r=t.length,n,i,a,o;for(n=0;n<r;n+=4)i=t[n+0],a=t[n+1],o=t[n+2],t[n+0]=Math.min(255,i*.393+a*.769+o*.189),t[n+1]=Math.min(255,i*.349+a*.686+o*.168),t[n+2]=Math.min(255,i*.272+a*.534+o*.131)};f0.Sepia=TR;var d0={};Object.defineProperty(d0,"__esModule",{value:!0});d0.Solarize=void 0;const AR=function(e){var t=e.data,r=e.width,n=e.height,i=r*4,a=n;do{var o=(a-1)*i,l=r;do{var u=o+(l-1)*4,f=t[u],v=t[u+1],w=t[u+2];f>127&&(f=255-f),v>127&&(v=255-v),w>127&&(w=255-w),t[u]=f,t[u+1]=v,t[u+2]=w}while(--l)}while(--a)};d0.Solarize=AR;var h0={};Object.defineProperty(h0,"__esModule",{value:!0});h0.Threshold=void 0;const m4=vt,kR=Qt,RR=Ye,LR=function(e){var t=this.threshold()*255,r=e.data,n=r.length,i;for(i=0;i<n;i+=1)r[i]=r[i]<t?0:255};h0.Threshold=LR;m4.Factory.addGetterSetter(kR.Node,"threshold",.5,(0,RR.getNumberValidator)(),m4.Factory.afterSetFilter);Object.defineProperty(Sp,"__esModule",{value:!0});Sp.Konva=void 0;const y4=Bh,MR=Tp,NR=Rp,IR=Np,DR=Ip,FR=Dp,b4=au,jR=yf,zR=Eu,BR=wf,UR=zp,HR=Bp,GR=Up,$R=Hp,VR=kl,qR=Gp,WR=$p,YR=Vp,KR=Wp,XR=Yp,ZR=Kp,QR=Xp,JR=Qp,eL=Jp,tL=e0,rL=t0,nL=r0,iL=n0,aL=i0,oL=a0,lL=o0,sL=l0,uL=s0,cL=u0,fL=f0,dL=d0,hL=h0;Sp.Konva=y4.Konva.Util._assign(y4.Konva,{Arc:MR.Arc,Arrow:NR.Arrow,Circle:IR.Circle,Ellipse:DR.Ellipse,Image:FR.Image,Label:b4.Label,Tag:b4.Tag,Line:jR.Line,Path:zR.Path,Rect:BR.Rect,RegularPolygon:UR.RegularPolygon,Ring:HR.Ring,Sprite:GR.Sprite,Star:$R.Star,Text:VR.Text,TextPath:qR.TextPath,Transformer:WR.Transformer,Wedge:YR.Wedge,Filters:{Blur:KR.Blur,Brighten:XR.Brighten,Contrast:ZR.Contrast,Emboss:QR.Emboss,Enhance:JR.Enhance,Grayscale:eL.Grayscale,HSL:tL.HSL,HSV:rL.HSV,Invert:nL.Invert,Kaleidoscope:iL.Kaleidoscope,Mask:aL.Mask,Noise:oL.Noise,Pixelate:lL.Pixelate,Posterize:sL.Posterize,RGB:uL.RGB,RGBA:cL.RGBA,Sepia:fL.Sepia,Solarize:dL.Solarize,Threshold:hL.Threshold}});var pL=Jy.exports;Object.defineProperty(pL,"__esModule",{value:!0});const gL=Sp;Jy.exports=gL.Konva;var vi=Jy.exports,Mm={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=Bh;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=Bh;e.exports=n.Konva})(Mm,Mm.exports);var vL=Mm.exports;const Kc=Kh(vL);var Q9={exports:{}};/**
44
+ * @license React
45
+ * react-reconciler.production.min.js
46
+ *
47
+ * Copyright (c) Facebook, Inc. and its affiliates.
48
+ *
49
+ * This source code is licensed under the MIT license found in the
50
+ * LICENSE file in the root directory of this source tree.
51
+ */var mL=function(t){var r={},n=at,i=hc,a=Object.assign;function o(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,A=1;A<arguments.length;A++)c+="&args[]="+encodeURIComponent(arguments[A]);return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),f=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),E=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),_=Symbol.for("react.offscreen"),O=Symbol.iterator;function k(s){return s===null||typeof s!="object"?null:(s=O&&s[O]||s["@@iterator"],typeof s=="function"?s:null)}function C(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case v:return"Fragment";case f:return"Portal";case b:return"Profiler";case w:return"StrictMode";case m:return"Suspense";case p:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case E:return(s.displayName||"Context")+".Consumer";case h:return(s._context.displayName||"Context")+".Provider";case y:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case g:return c=s.displayName||null,c!==null?c:C(s.type)||"Memo";case d:c=s._payload,s=s._init;try{return C(s(c))}catch{}}return null}function S(s){var c=s.type;switch(s.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=c.render,s=s.displayName||s.name||"",c.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return C(c);case 8:return c===w?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function x(s){var c=s,A=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,c.flags&4098&&(A=c.return),s=c.return;while(s)}return c.tag===3?A:null}function P(s){if(x(s)!==s)throw Error(o(188))}function T(s){var c=s.alternate;if(!c){if(c=x(s),c===null)throw Error(o(188));return c!==s?null:s}for(var A=s,I=c;;){var j=A.return;if(j===null)break;var W=j.alternate;if(W===null){if(I=j.return,I!==null){A=I;continue}break}if(j.child===W.child){for(W=j.child;W;){if(W===A)return P(j),s;if(W===I)return P(j),c;W=W.sibling}throw Error(o(188))}if(A.return!==I.return)A=j,I=W;else{for(var J=!1,le=j.child;le;){if(le===A){J=!0,A=j,I=W;break}if(le===I){J=!0,I=j,A=W;break}le=le.sibling}if(!J){for(le=W.child;le;){if(le===A){J=!0,A=W,I=j;break}if(le===I){J=!0,I=W,A=j;break}le=le.sibling}if(!J)throw Error(o(189))}}if(A.alternate!==I)throw Error(o(190))}if(A.tag!==3)throw Error(o(188));return A.stateNode.current===A?s:c}function L(s){return s=T(s),s!==null?M(s):null}function M(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=M(s);if(c!==null)return c;s=s.sibling}return null}function U(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){if(s.tag!==4){var c=U(s);if(c!==null)return c}s=s.sibling}return null}var $=Array.isArray,Z=t.getPublicInstance,z=t.getRootHostContext,N=t.getChildHostContext,H=t.prepareForCommit,R=t.resetAfterCommit,F=t.createInstance,B=t.appendInitialChild,D=t.finalizeInitialChildren,V=t.prepareUpdate,Y=t.shouldSetTextContent,q=t.createTextInstance,G=t.scheduleTimeout,K=t.cancelTimeout,X=t.noTimeout,Q=t.isPrimaryRenderer,ee=t.supportsMutation,te=t.supportsPersistence,ae=t.supportsHydration,oe=t.getInstanceFromNode,se=t.preparePortalMount,ke=t.getCurrentEventPriority,Fe=t.detachDeletedInstance,fe=t.supportsMicrotasks,ie=t.scheduleMicrotask,ge=t.supportsTestSelectors,pe=t.findFiberRoot,re=t.getBoundingRect,de=t.getTextContent,be=t.isHiddenSubtree,ye=t.matchAccessibilityRole,Ie=t.setFocusIfFocusable,Ee=t.setupIntersectionObserver,Ae=t.appendChild,Ze=t.appendChildToContainer,We=t.commitTextUpdate,dt=t.commitMount,Bt=t.commitUpdate,ue=t.insertBefore,he=t.insertInContainerBefore,nt=t.removeChild,Oe=t.removeChildFromContainer,je=t.resetTextContent,Le=t.hideInstance,Se=t.hideTextInstance,Je=t.unhideInstance,xe=t.unhideTextInstance,Ke=t.clearContainer,Sr=t.cloneInstance,Pe=t.createContainerChildSet,He=t.appendChildToContainerChildSet,et=t.finalizeContainerChildren,Et=t.replaceContainerChildren,xt=t.cloneHiddenInstance,ar=t.cloneHiddenTextInstance,Rr=t.canHydrateInstance,Lr=t.canHydrateTextInstance,ln=t.canHydrateSuspenseInstance,De=t.isSuspenseInstancePending,it=t.isSuspenseInstanceFallback,Qe=t.getSuspenseInstanceFallbackErrorDetails,kt=t.registerSuspenseInstanceRetry,tt=t.getNextHydratableSibling,fr=t.getFirstHydratableChild,ht=t.getFirstHydratableChildWithinContainer,$t=t.getFirstHydratableChildWithinSuspenseInstance,Br=t.hydrateInstance,vr=t.hydrateTextInstance,Mr=t.hydrateSuspenseInstance,Mn=t.getNextHydratableInstanceAfterSuspenseInstance,mi=t.commitHydratedContainer,mn=t.commitHydratedSuspenseInstance,sn=t.clearSuspenseBoundary,Kn=t.clearSuspenseBoundaryFromContainer,Ka=t.shouldDeleteUnhydratedTailInstances,yi=t.didNotMatchHydratedContainerTextInstance,Kl=t.didNotMatchHydratedTextInstance,Xa;function Za(s){if(Xa===void 0)try{throw Error()}catch(A){var c=A.stack.trim().match(/\n( *(at )?)/);Xa=c&&c[1]||""}return`
52
+ `+Xa+s}var Xl=!1;function ku(s,c){if(!s||Xl)return"";Xl=!0;var A=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(Re){var I=Re}Reflect.construct(s,[],c)}else{try{c.call()}catch(Re){I=Re}s.call(c.prototype)}else{try{throw Error()}catch(Re){I=Re}s()}}catch(Re){if(Re&&I&&typeof Re.stack=="string"){for(var j=Re.stack.split(`
53
+ `),W=I.stack.split(`
54
+ `),J=j.length-1,le=W.length-1;1<=J&&0<=le&&j[J]!==W[le];)le--;for(;1<=J&&0<=le;J--,le--)if(j[J]!==W[le]){if(J!==1||le!==1)do if(J--,le--,0>le||j[J]!==W[le]){var me=`
55
+ `+j[J].replace(" at new "," at ");return s.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",s.displayName)),me}while(1<=J&&0<=le);break}}}finally{Xl=!1,Error.prepareStackTrace=A}return(s=s?s.displayName||s.name:"")?Za(s):""}var Ru=Object.prototype.hasOwnProperty,va=[],Nn=-1;function un(s){return{current:s}}function Nt(s){0>Nn||(s.current=va[Nn],va[Nn]=null,Nn--)}function Rt(s,c){Nn++,va[Nn]=s.current,s.current=c}var bi={},mr=un(bi),Ur=un(!1),Xn=bi;function _i(s,c){var A=s.type.contextTypes;if(!A)return bi;var I=s.stateNode;if(I&&I.__reactInternalMemoizedUnmaskedChildContext===c)return I.__reactInternalMemoizedMaskedChildContext;var j={},W;for(W in A)j[W]=c[W];return I&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=j),j}function Yt(s){return s=s.childContextTypes,s!=null}function wi(){Nt(Ur),Nt(mr)}function Zl(s,c,A){if(mr.current!==bi)throw Error(o(168));Rt(mr,c),Rt(Ur,A)}function Ql(s,c,A){var I=s.stateNode;if(c=c.childContextTypes,typeof I.getChildContext!="function")return A;I=I.getChildContext();for(var j in I)if(!(j in c))throw Error(o(108,S(s)||"Unknown",j));return a({},A,I)}function Jl(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||bi,Xn=mr.current,Rt(mr,s),Rt(Ur,Ur.current),!0}function ma(s,c,A){var I=s.stateNode;if(!I)throw Error(o(169));A?(s=Ql(s,c,Xn),I.__reactInternalMemoizedMergedChildContext=s,Nt(Ur),Nt(mr),Rt(mr,s)):Nt(Ur),Rt(Ur,A)}var In=Math.clz32?Math.clz32:Qa,E0=Math.log,yr=Math.LN2;function Qa(s){return s>>>=0,s===0?32:31-(E0(s)/yr|0)|0}var es=64,Xo=4194304;function ya(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function Zo(s,c){var A=s.pendingLanes;if(A===0)return 0;var I=0,j=s.suspendedLanes,W=s.pingedLanes,J=A&268435455;if(J!==0){var le=J&~j;le!==0?I=ya(le):(W&=J,W!==0&&(I=ya(W)))}else J=A&~j,J!==0?I=ya(J):W!==0&&(I=ya(W));if(I===0)return 0;if(c!==0&&c!==I&&!(c&j)&&(j=I&-I,W=c&-c,j>=W||j===16&&(W&4194240)!==0))return c;if(I&4&&(I|=A&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=I;0<c;)A=31-In(c),j=1<<A,I|=s[A],c&=~j;return I}function Tf(s,c){switch(s){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function O0(s,c){for(var A=s.suspendedLanes,I=s.pingedLanes,j=s.expirationTimes,W=s.pendingLanes;0<W;){var J=31-In(W),le=1<<J,me=j[J];me===-1?(!(le&A)||le&I)&&(j[J]=Tf(le,c)):me<=c&&(s.expiredLanes|=le),W&=~le}}function Ja(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function ts(){var s=es;return es<<=1,!(es&4194240)&&(es=64),s}function Lu(s){for(var c=[],A=0;31>A;A++)c.push(s);return c}function Dn(s,c,A){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-In(c),s[c]=A}function Mu(s,c){var A=s.pendingLanes&~c;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=c,s.mutableReadLanes&=c,s.entangledLanes&=c,c=s.entanglements;var I=s.eventTimes;for(s=s.expirationTimes;0<A;){var j=31-In(A),W=1<<j;c[j]=0,I[j]=-1,s[j]=-1,A&=~W}}function rs(s,c){var A=s.entangledLanes|=c;for(s=s.entanglements;A;){var I=31-In(A),j=1<<I;j&c|s[I]&c&&(s[I]|=c),A&=~j}}var wt=0;function Af(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var eo=i.unstable_scheduleCallback,Zn=i.unstable_cancelCallback,kf=i.unstable_shouldYield,Rf=i.unstable_requestPaint,dr=i.unstable_now,ns=i.unstable_ImmediatePriority,x0=i.unstable_UserBlockingPriority,ne=i.unstable_NormalPriority,Te=i.unstable_IdlePriority,Ne=null,ft=null;function or(s){if(ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Ne,s,void 0,(s.current.flags&128)===128)}catch{}}function Kr(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var lr=typeof Object.is=="function"?Object.is:Kr,It=null,Si=!1,is=!1;function P0(s){It===null?It=[s]:It.push(s)}function GS(s){Si=!0,P0(s)}function Vi(){if(!is&&It!==null){is=!0;var s=0,c=wt;try{var A=It;for(wt=1;s<A.length;s++){var I=A[s];do I=I(!0);while(I!==null)}It=null,Si=!1}catch(j){throw It!==null&&(It=It.slice(s+1)),eo(ns,Vi),j}finally{wt=c,is=!1}}return null}var as=[],os=0,Lf=null,Mf=0,Qn=[],Jn=0,Qo=null,ba=1,_a="";function Jo(s,c){as[os++]=Mf,as[os++]=Lf,Lf=s,Mf=c}function U2(s,c,A){Qn[Jn++]=ba,Qn[Jn++]=_a,Qn[Jn++]=Qo,Qo=s;var I=ba;s=_a;var j=32-In(I)-1;I&=~(1<<j),A+=1;var W=32-In(c)+j;if(30<W){var J=j-j%5;W=(I&(1<<J)-1).toString(32),I>>=J,j-=J,ba=1<<32-In(c)+j|A<<j|I,_a=W+s}else ba=1<<W|A<<j|I,_a=s}function C0(s){s.return!==null&&(Jo(s,1),U2(s,1,0))}function T0(s){for(;s===Lf;)Lf=as[--os],as[os]=null,Mf=as[--os],as[os]=null;for(;s===Qo;)Qo=Qn[--Jn],Qn[Jn]=null,_a=Qn[--Jn],Qn[Jn]=null,ba=Qn[--Jn],Qn[Jn]=null}var Fn=null,ei=null,Kt=!1,Nu=!1,Ei=null;function H2(s,c){var A=ai(5,null,null,0);A.elementType="DELETED",A.stateNode=c,A.return=s,c=s.deletions,c===null?(s.deletions=[A],s.flags|=16):c.push(A)}function G2(s,c){switch(s.tag){case 5:return c=Rr(c,s.type,s.pendingProps),c!==null?(s.stateNode=c,Fn=s,ei=fr(c),!0):!1;case 6:return c=Lr(c,s.pendingProps),c!==null?(s.stateNode=c,Fn=s,ei=null,!0):!1;case 13:if(c=ln(c),c!==null){var A=Qo!==null?{id:ba,overflow:_a}:null;return s.memoizedState={dehydrated:c,treeContext:A,retryLane:1073741824},A=ai(18,null,null,0),A.stateNode=c,A.return=s,s.child=A,Fn=s,ei=null,!0}return!1;default:return!1}}function A0(s){return(s.mode&1)!==0&&(s.flags&128)===0}function k0(s){if(Kt){var c=ei;if(c){var A=c;if(!G2(s,c)){if(A0(s))throw Error(o(418));c=tt(A);var I=Fn;c&&G2(s,c)?H2(I,A):(s.flags=s.flags&-4097|2,Kt=!1,Fn=s)}}else{if(A0(s))throw Error(o(418));s.flags=s.flags&-4097|2,Kt=!1,Fn=s}}}function $2(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;Fn=s}function Nf(s){if(!ae||s!==Fn)return!1;if(!Kt)return $2(s),Kt=!0,!1;if(s.tag!==3&&(s.tag!==5||Ka(s.type)&&!Y(s.type,s.memoizedProps))){var c=ei;if(c){if(A0(s))throw V2(),Error(o(418));for(;c;)H2(s,c),c=tt(c)}}if($2(s),s.tag===13){if(!ae)throw Error(o(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));ei=Mn(s)}else ei=Fn?tt(s.stateNode):null;return!0}function V2(){for(var s=ei;s;)s=tt(s)}function ls(){ae&&(ei=Fn=null,Nu=Kt=!1)}function R0(s){Ei===null?Ei=[s]:Ei.push(s)}var $S=l.ReactCurrentBatchConfig;function If(s,c){if(lr(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var A=Object.keys(s),I=Object.keys(c);if(A.length!==I.length)return!1;for(I=0;I<A.length;I++){var j=A[I];if(!Ru.call(c,j)||!lr(s[j],c[j]))return!1}return!0}function VS(s){switch(s.tag){case 5:return Za(s.type);case 16:return Za("Lazy");case 13:return Za("Suspense");case 19:return Za("SuspenseList");case 0:case 2:case 15:return s=ku(s.type,!1),s;case 11:return s=ku(s.type.render,!1),s;case 1:return s=ku(s.type,!0),s;default:return""}}function Iu(s,c,A){if(s=A.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(A._owner){if(A=A._owner,A){if(A.tag!==1)throw Error(o(309));var I=A.stateNode}if(!I)throw Error(o(147,s));var j=I,W=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===W?c.ref:(c=function(J){var le=j.refs;J===null?delete le[W]:le[W]=J},c._stringRef=W,c)}if(typeof s!="string")throw Error(o(284));if(!A._owner)throw Error(o(290,s))}return s}function Df(s,c){throw s=Object.prototype.toString.call(c),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function q2(s){var c=s._init;return c(s._payload)}function W2(s){function c(ve,ce){if(s){var _e=ve.deletions;_e===null?(ve.deletions=[ce],ve.flags|=16):_e.push(ce)}}function A(ve,ce){if(!s)return null;for(;ce!==null;)c(ve,ce),ce=ce.sibling;return null}function I(ve,ce){for(ve=new Map;ce!==null;)ce.key!==null?ve.set(ce.key,ce):ve.set(ce.index,ce),ce=ce.sibling;return ve}function j(ve,ce){return ve=lo(ve,ce),ve.index=0,ve.sibling=null,ve}function W(ve,ce,_e){return ve.index=_e,s?(_e=ve.alternate,_e!==null?(_e=_e.index,_e<ce?(ve.flags|=2,ce):_e):(ve.flags|=2,ce)):(ve.flags|=1048576,ce)}function J(ve){return s&&ve.alternate===null&&(ve.flags|=2),ve}function le(ve,ce,_e,Be){return ce===null||ce.tag!==6?(ce=P1(_e,ve.mode,Be),ce.return=ve,ce):(ce=j(ce,_e),ce.return=ve,ce)}function me(ve,ce,_e,Be){var rt=_e.type;return rt===v?Ve(ve,ce,_e.props.children,Be,_e.key):ce!==null&&(ce.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===d&&q2(rt)===ce.type)?(Be=j(ce,_e.props),Be.ref=Iu(ve,ce,_e),Be.return=ve,Be):(Be=hd(_e.type,_e.key,_e.props,null,ve.mode,Be),Be.ref=Iu(ve,ce,_e),Be.return=ve,Be)}function Re(ve,ce,_e,Be){return ce===null||ce.tag!==4||ce.stateNode.containerInfo!==_e.containerInfo||ce.stateNode.implementation!==_e.implementation?(ce=C1(_e,ve.mode,Be),ce.return=ve,ce):(ce=j(ce,_e.children||[]),ce.return=ve,ce)}function Ve(ve,ce,_e,Be,rt){return ce===null||ce.tag!==7?(ce=ol(_e,ve.mode,Be,rt),ce.return=ve,ce):(ce=j(ce,_e),ce.return=ve,ce)}function lt(ve,ce,_e){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return ce=P1(""+ce,ve.mode,_e),ce.return=ve,ce;if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case u:return _e=hd(ce.type,ce.key,ce.props,null,ve.mode,_e),_e.ref=Iu(ve,null,ce),_e.return=ve,_e;case f:return ce=C1(ce,ve.mode,_e),ce.return=ve,ce;case d:var Be=ce._init;return lt(ve,Be(ce._payload),_e)}if($(ce)||k(ce))return ce=ol(ce,ve.mode,_e,null),ce.return=ve,ce;Df(ve,ce)}return null}function ze(ve,ce,_e,Be){var rt=ce!==null?ce.key:null;if(typeof _e=="string"&&_e!==""||typeof _e=="number")return rt!==null?null:le(ve,ce,""+_e,Be);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case u:return _e.key===rt?me(ve,ce,_e,Be):null;case f:return _e.key===rt?Re(ve,ce,_e,Be):null;case d:return rt=_e._init,ze(ve,ce,rt(_e._payload),Be)}if($(_e)||k(_e))return rt!==null?null:Ve(ve,ce,_e,Be,null);Df(ve,_e)}return null}function Vt(ve,ce,_e,Be,rt){if(typeof Be=="string"&&Be!==""||typeof Be=="number")return ve=ve.get(_e)||null,le(ce,ve,""+Be,rt);if(typeof Be=="object"&&Be!==null){switch(Be.$$typeof){case u:return ve=ve.get(Be.key===null?_e:Be.key)||null,me(ce,ve,Be,rt);case f:return ve=ve.get(Be.key===null?_e:Be.key)||null,Re(ce,ve,Be,rt);case d:var pt=Be._init;return Vt(ve,ce,_e,pt(Be._payload),rt)}if($(Be)||k(Be))return ve=ve.get(_e)||null,Ve(ce,ve,Be,rt,null);Df(ce,Be)}return null}function jt(ve,ce,_e,Be){for(var rt=null,pt=null,st=ce,Pt=ce=0,Dr=null;st!==null&&Pt<_e.length;Pt++){st.index>Pt?(Dr=st,st=null):Dr=st.sibling;var Ct=ze(ve,st,_e[Pt],Be);if(Ct===null){st===null&&(st=Dr);break}s&&st&&Ct.alternate===null&&c(ve,st),ce=W(Ct,ce,Pt),pt===null?rt=Ct:pt.sibling=Ct,pt=Ct,st=Dr}if(Pt===_e.length)return A(ve,st),Kt&&Jo(ve,Pt),rt;if(st===null){for(;Pt<_e.length;Pt++)st=lt(ve,_e[Pt],Be),st!==null&&(ce=W(st,ce,Pt),pt===null?rt=st:pt.sibling=st,pt=st);return Kt&&Jo(ve,Pt),rt}for(st=I(ve,st);Pt<_e.length;Pt++)Dr=Vt(st,ve,Pt,_e[Pt],Be),Dr!==null&&(s&&Dr.alternate!==null&&st.delete(Dr.key===null?Pt:Dr.key),ce=W(Dr,ce,Pt),pt===null?rt=Dr:pt.sibling=Dr,pt=Dr);return s&&st.forEach(function(so){return c(ve,so)}),Kt&&Jo(ve,Pt),rt}function wn(ve,ce,_e,Be){var rt=k(_e);if(typeof rt!="function")throw Error(o(150));if(_e=rt.call(_e),_e==null)throw Error(o(151));for(var pt=rt=null,st=ce,Pt=ce=0,Dr=null,Ct=_e.next();st!==null&&!Ct.done;Pt++,Ct=_e.next()){st.index>Pt?(Dr=st,st=null):Dr=st.sibling;var so=ze(ve,st,Ct.value,Be);if(so===null){st===null&&(st=Dr);break}s&&st&&so.alternate===null&&c(ve,st),ce=W(so,ce,Pt),pt===null?rt=so:pt.sibling=so,pt=so,st=Dr}if(Ct.done)return A(ve,st),Kt&&Jo(ve,Pt),rt;if(st===null){for(;!Ct.done;Pt++,Ct=_e.next())Ct=lt(ve,Ct.value,Be),Ct!==null&&(ce=W(Ct,ce,Pt),pt===null?rt=Ct:pt.sibling=Ct,pt=Ct);return Kt&&Jo(ve,Pt),rt}for(st=I(ve,st);!Ct.done;Pt++,Ct=_e.next())Ct=Vt(st,ve,Pt,Ct.value,Be),Ct!==null&&(s&&Ct.alternate!==null&&st.delete(Ct.key===null?Pt:Ct.key),ce=W(Ct,ce,Pt),pt===null?rt=Ct:pt.sibling=Ct,pt=Ct);return s&&st.forEach(function(wE){return c(ve,wE)}),Kt&&Jo(ve,Pt),rt}function Oa(ve,ce,_e,Be){if(typeof _e=="object"&&_e!==null&&_e.type===v&&_e.key===null&&(_e=_e.props.children),typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case u:e:{for(var rt=_e.key,pt=ce;pt!==null;){if(pt.key===rt){if(rt=_e.type,rt===v){if(pt.tag===7){A(ve,pt.sibling),ce=j(pt,_e.props.children),ce.return=ve,ve=ce;break e}}else if(pt.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===d&&q2(rt)===pt.type){A(ve,pt.sibling),ce=j(pt,_e.props),ce.ref=Iu(ve,pt,_e),ce.return=ve,ve=ce;break e}A(ve,pt);break}else c(ve,pt);pt=pt.sibling}_e.type===v?(ce=ol(_e.props.children,ve.mode,Be,_e.key),ce.return=ve,ve=ce):(Be=hd(_e.type,_e.key,_e.props,null,ve.mode,Be),Be.ref=Iu(ve,ce,_e),Be.return=ve,ve=Be)}return J(ve);case f:e:{for(pt=_e.key;ce!==null;){if(ce.key===pt)if(ce.tag===4&&ce.stateNode.containerInfo===_e.containerInfo&&ce.stateNode.implementation===_e.implementation){A(ve,ce.sibling),ce=j(ce,_e.children||[]),ce.return=ve,ve=ce;break e}else{A(ve,ce);break}else c(ve,ce);ce=ce.sibling}ce=C1(_e,ve.mode,Be),ce.return=ve,ve=ce}return J(ve);case d:return pt=_e._init,Oa(ve,ce,pt(_e._payload),Be)}if($(_e))return jt(ve,ce,_e,Be);if(k(_e))return wn(ve,ce,_e,Be);Df(ve,_e)}return typeof _e=="string"&&_e!==""||typeof _e=="number"?(_e=""+_e,ce!==null&&ce.tag===6?(A(ve,ce.sibling),ce=j(ce,_e),ce.return=ve,ve=ce):(A(ve,ce),ce=P1(_e,ve.mode,Be),ce.return=ve,ve=ce),J(ve)):A(ve,ce)}return Oa}var ss=W2(!0),Y2=W2(!1),Ff=un(null),jf=null,us=null,L0=null;function M0(){L0=us=jf=null}function K2(s,c,A){Q?(Rt(Ff,c._currentValue),c._currentValue=A):(Rt(Ff,c._currentValue2),c._currentValue2=A)}function N0(s){var c=Ff.current;Nt(Ff),Q?s._currentValue=c:s._currentValue2=c}function I0(s,c,A){for(;s!==null;){var I=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,I!==null&&(I.childLanes|=c)):I!==null&&(I.childLanes&c)!==c&&(I.childLanes|=c),s===A)break;s=s.return}}function cs(s,c){jf=s,L0=us=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&c&&(yn=!0),s.firstContext=null)}function ti(s){var c=Q?s._currentValue:s._currentValue2;if(L0!==s)if(s={context:s,memoizedValue:c,next:null},us===null){if(jf===null)throw Error(o(308));us=s,jf.dependencies={lanes:0,firstContext:s}}else us=us.next=s;return c}var el=null;function D0(s){el===null?el=[s]:el.push(s)}function X2(s,c,A,I){var j=c.interleaved;return j===null?(A.next=A,D0(c)):(A.next=j.next,j.next=A),c.interleaved=A,qi(s,I)}function qi(s,c){s.lanes|=c;var A=s.alternate;for(A!==null&&(A.lanes|=c),A=s,s=s.return;s!==null;)s.childLanes|=c,A=s.alternate,A!==null&&(A.childLanes|=c),A=s,s=s.return;return A.tag===3?A.stateNode:null}var to=!1;function F0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Z2(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function wa(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function ro(s,c,A){var I=s.updateQueue;if(I===null)return null;if(I=I.shared,mt&2){var j=I.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),I.pending=c,qi(s,A)}return j=I.interleaved,j===null?(c.next=c,D0(I)):(c.next=j.next,j.next=c),I.interleaved=c,qi(s,A)}function zf(s,c,A){if(c=c.updateQueue,c!==null&&(c=c.shared,(A&4194240)!==0)){var I=c.lanes;I&=s.pendingLanes,A|=I,c.lanes=A,rs(s,A)}}function Q2(s,c){var A=s.updateQueue,I=s.alternate;if(I!==null&&(I=I.updateQueue,A===I)){var j=null,W=null;if(A=A.firstBaseUpdate,A!==null){do{var J={eventTime:A.eventTime,lane:A.lane,tag:A.tag,payload:A.payload,callback:A.callback,next:null};W===null?j=W=J:W=W.next=J,A=A.next}while(A!==null);W===null?j=W=c:W=W.next=c}else j=W=c;A={baseState:I.baseState,firstBaseUpdate:j,lastBaseUpdate:W,shared:I.shared,effects:I.effects},s.updateQueue=A;return}s=A.lastBaseUpdate,s===null?A.firstBaseUpdate=c:s.next=c,A.lastBaseUpdate=c}function Bf(s,c,A,I){var j=s.updateQueue;to=!1;var W=j.firstBaseUpdate,J=j.lastBaseUpdate,le=j.shared.pending;if(le!==null){j.shared.pending=null;var me=le,Re=me.next;me.next=null,J===null?W=Re:J.next=Re,J=me;var Ve=s.alternate;Ve!==null&&(Ve=Ve.updateQueue,le=Ve.lastBaseUpdate,le!==J&&(le===null?Ve.firstBaseUpdate=Re:le.next=Re,Ve.lastBaseUpdate=me))}if(W!==null){var lt=j.baseState;J=0,Ve=Re=me=null,le=W;do{var ze=le.lane,Vt=le.eventTime;if((I&ze)===ze){Ve!==null&&(Ve=Ve.next={eventTime:Vt,lane:0,tag:le.tag,payload:le.payload,callback:le.callback,next:null});e:{var jt=s,wn=le;switch(ze=c,Vt=A,wn.tag){case 1:if(jt=wn.payload,typeof jt=="function"){lt=jt.call(Vt,lt,ze);break e}lt=jt;break e;case 3:jt.flags=jt.flags&-65537|128;case 0:if(jt=wn.payload,ze=typeof jt=="function"?jt.call(Vt,lt,ze):jt,ze==null)break e;lt=a({},lt,ze);break e;case 2:to=!0}}le.callback!==null&&le.lane!==0&&(s.flags|=64,ze=j.effects,ze===null?j.effects=[le]:ze.push(le))}else Vt={eventTime:Vt,lane:ze,tag:le.tag,payload:le.payload,callback:le.callback,next:null},Ve===null?(Re=Ve=Vt,me=lt):Ve=Ve.next=Vt,J|=ze;if(le=le.next,le===null){if(le=j.shared.pending,le===null)break;ze=le,le=ze.next,ze.next=null,j.lastBaseUpdate=ze,j.shared.pending=null}}while(!0);if(Ve===null&&(me=lt),j.baseState=me,j.firstBaseUpdate=Re,j.lastBaseUpdate=Ve,c=j.shared.interleaved,c!==null){j=c;do J|=j.lane,j=j.next;while(j!==c)}else W===null&&(j.shared.lanes=0);rl|=J,s.lanes=J,s.memoizedState=lt}}function J2(s,c,A){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var I=s[c],j=I.callback;if(j!==null){if(I.callback=null,I=A,typeof j!="function")throw Error(o(191,j));j.call(I)}}}var Du={},ri=un(Du),Fu=un(Du),fs=un(Du);function Wi(s){if(s===Du)throw Error(o(174));return s}function j0(s,c){Rt(fs,c),Rt(Fu,s),Rt(ri,Du),s=z(c),Nt(ri),Rt(ri,s)}function ds(){Nt(ri),Nt(Fu),Nt(fs)}function eb(s){var c=Wi(fs.current),A=Wi(ri.current);c=N(A,s.type,c),A!==c&&(Rt(Fu,s),Rt(ri,c))}function z0(s){Fu.current===s&&(Nt(ri),Nt(Fu))}var Jt=un(0);function Uf(s){for(var c=s;c!==null;){if(c.tag===13){var A=c.memoizedState;if(A!==null&&(A=A.dehydrated,A===null||De(A)||it(A)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var B0=[];function U0(){for(var s=0;s<B0.length;s++){var c=B0[s];Q?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}B0.length=0}var Hf=l.ReactCurrentDispatcher,H0=l.ReactCurrentBatchConfig,tl=0,er=null,Er=null,Nr=null,Gf=!1,ju=!1,zu=0,qS=0;function Xr(){throw Error(o(321))}function G0(s,c){if(c===null)return!1;for(var A=0;A<c.length&&A<s.length;A++)if(!lr(s[A],c[A]))return!1;return!0}function $0(s,c,A,I,j,W){if(tl=W,er=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Hf.current=s===null||s.memoizedState===null?XS:ZS,s=A(I,j),ju){W=0;do{if(ju=!1,zu=0,25<=W)throw Error(o(301));W+=1,Nr=Er=null,c.updateQueue=null,Hf.current=QS,s=A(I,j)}while(ju)}if(Hf.current=qf,c=Er!==null&&Er.next!==null,tl=0,Nr=Er=er=null,Gf=!1,c)throw Error(o(300));return s}function V0(){var s=zu!==0;return zu=0,s}function Yi(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nr===null?er.memoizedState=Nr=s:Nr=Nr.next=s,Nr}function ni(){if(Er===null){var s=er.alternate;s=s!==null?s.memoizedState:null}else s=Er.next;var c=Nr===null?er.memoizedState:Nr.next;if(c!==null)Nr=c,Er=s;else{if(s===null)throw Error(o(310));Er=s,s={memoizedState:Er.memoizedState,baseState:Er.baseState,baseQueue:Er.baseQueue,queue:Er.queue,next:null},Nr===null?er.memoizedState=Nr=s:Nr=Nr.next=s}return Nr}function Bu(s,c){return typeof c=="function"?c(s):c}function q0(s){var c=ni(),A=c.queue;if(A===null)throw Error(o(311));A.lastRenderedReducer=s;var I=Er,j=I.baseQueue,W=A.pending;if(W!==null){if(j!==null){var J=j.next;j.next=W.next,W.next=J}I.baseQueue=j=W,A.pending=null}if(j!==null){W=j.next,I=I.baseState;var le=J=null,me=null,Re=W;do{var Ve=Re.lane;if((tl&Ve)===Ve)me!==null&&(me=me.next={lane:0,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null}),I=Re.hasEagerState?Re.eagerState:s(I,Re.action);else{var lt={lane:Ve,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null};me===null?(le=me=lt,J=I):me=me.next=lt,er.lanes|=Ve,rl|=Ve}Re=Re.next}while(Re!==null&&Re!==W);me===null?J=I:me.next=le,lr(I,c.memoizedState)||(yn=!0),c.memoizedState=I,c.baseState=J,c.baseQueue=me,A.lastRenderedState=I}if(s=A.interleaved,s!==null){j=s;do W=j.lane,er.lanes|=W,rl|=W,j=j.next;while(j!==s)}else j===null&&(A.lanes=0);return[c.memoizedState,A.dispatch]}function W0(s){var c=ni(),A=c.queue;if(A===null)throw Error(o(311));A.lastRenderedReducer=s;var I=A.dispatch,j=A.pending,W=c.memoizedState;if(j!==null){A.pending=null;var J=j=j.next;do W=s(W,J.action),J=J.next;while(J!==j);lr(W,c.memoizedState)||(yn=!0),c.memoizedState=W,c.baseQueue===null&&(c.baseState=W),A.lastRenderedState=W}return[W,I]}function tb(){}function rb(s,c){var A=er,I=ni(),j=c(),W=!lr(I.memoizedState,j);if(W&&(I.memoizedState=j,yn=!0),I=I.queue,Y0(ab.bind(null,A,I,s),[s]),I.getSnapshot!==c||W||Nr!==null&&Nr.memoizedState.tag&1){if(A.flags|=2048,Uu(9,ib.bind(null,A,I,j,c),void 0,null),Ir===null)throw Error(o(349));tl&30||nb(A,c,j)}return j}function nb(s,c,A){s.flags|=16384,s={getSnapshot:c,value:A},c=er.updateQueue,c===null?(c={lastEffect:null,stores:null},er.updateQueue=c,c.stores=[s]):(A=c.stores,A===null?c.stores=[s]:A.push(s))}function ib(s,c,A,I){c.value=A,c.getSnapshot=I,ob(c)&&lb(s)}function ab(s,c,A){return A(function(){ob(c)&&lb(s)})}function ob(s){var c=s.getSnapshot;s=s.value;try{var A=c();return!lr(s,A)}catch{return!0}}function lb(s){var c=qi(s,1);c!==null&&ii(c,s,1,-1)}function sb(s){var c=Yi();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bu,lastRenderedState:s},c.queue=s,s=s.dispatch=KS.bind(null,er,s),[c.memoizedState,s]}function Uu(s,c,A,I){return s={tag:s,create:c,destroy:A,deps:I,next:null},c=er.updateQueue,c===null?(c={lastEffect:null,stores:null},er.updateQueue=c,c.lastEffect=s.next=s):(A=c.lastEffect,A===null?c.lastEffect=s.next=s:(I=A.next,A.next=s,s.next=I,c.lastEffect=s)),s}function ub(){return ni().memoizedState}function $f(s,c,A,I){var j=Yi();er.flags|=s,j.memoizedState=Uu(1|c,A,void 0,I===void 0?null:I)}function Vf(s,c,A,I){var j=ni();I=I===void 0?null:I;var W=void 0;if(Er!==null){var J=Er.memoizedState;if(W=J.destroy,I!==null&&G0(I,J.deps)){j.memoizedState=Uu(c,A,W,I);return}}er.flags|=s,j.memoizedState=Uu(1|c,A,W,I)}function cb(s,c){return $f(8390656,8,s,c)}function Y0(s,c){return Vf(2048,8,s,c)}function fb(s,c){return Vf(4,2,s,c)}function db(s,c){return Vf(4,4,s,c)}function hb(s,c){if(typeof c=="function")return s=s(),c(s),function(){c(null)};if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function pb(s,c,A){return A=A!=null?A.concat([s]):null,Vf(4,4,hb.bind(null,c,s),A)}function K0(){}function gb(s,c){var A=ni();c=c===void 0?null:c;var I=A.memoizedState;return I!==null&&c!==null&&G0(c,I[1])?I[0]:(A.memoizedState=[s,c],s)}function vb(s,c){var A=ni();c=c===void 0?null:c;var I=A.memoizedState;return I!==null&&c!==null&&G0(c,I[1])?I[0]:(s=s(),A.memoizedState=[s,c],s)}function mb(s,c,A){return tl&21?(lr(A,c)||(A=ts(),er.lanes|=A,rl|=A,s.baseState=!0),c):(s.baseState&&(s.baseState=!1,yn=!0),s.memoizedState=A)}function WS(s,c){var A=wt;wt=A!==0&&4>A?A:4,s(!0);var I=H0.transition;H0.transition={};try{s(!1),c()}finally{wt=A,H0.transition=I}}function yb(){return ni().memoizedState}function YS(s,c,A){var I=ao(s);if(A={lane:I,action:A,hasEagerState:!1,eagerState:null,next:null},bb(s))_b(c,A);else if(A=X2(s,c,A,I),A!==null){var j=Jr();ii(A,s,I,j),wb(A,c,I)}}function KS(s,c,A){var I=ao(s),j={lane:I,action:A,hasEagerState:!1,eagerState:null,next:null};if(bb(s))_b(c,j);else{var W=s.alternate;if(s.lanes===0&&(W===null||W.lanes===0)&&(W=c.lastRenderedReducer,W!==null))try{var J=c.lastRenderedState,le=W(J,A);if(j.hasEagerState=!0,j.eagerState=le,lr(le,J)){var me=c.interleaved;me===null?(j.next=j,D0(c)):(j.next=me.next,me.next=j),c.interleaved=j;return}}catch{}finally{}A=X2(s,c,j,I),A!==null&&(j=Jr(),ii(A,s,I,j),wb(A,c,I))}}function bb(s){var c=s.alternate;return s===er||c!==null&&c===er}function _b(s,c){ju=Gf=!0;var A=s.pending;A===null?c.next=c:(c.next=A.next,A.next=c),s.pending=c}function wb(s,c,A){if(A&4194240){var I=c.lanes;I&=s.pendingLanes,A|=I,c.lanes=A,rs(s,A)}}var qf={readContext:ti,useCallback:Xr,useContext:Xr,useEffect:Xr,useImperativeHandle:Xr,useInsertionEffect:Xr,useLayoutEffect:Xr,useMemo:Xr,useReducer:Xr,useRef:Xr,useState:Xr,useDebugValue:Xr,useDeferredValue:Xr,useTransition:Xr,useMutableSource:Xr,useSyncExternalStore:Xr,useId:Xr,unstable_isNewReconciler:!1},XS={readContext:ti,useCallback:function(s,c){return Yi().memoizedState=[s,c===void 0?null:c],s},useContext:ti,useEffect:cb,useImperativeHandle:function(s,c,A){return A=A!=null?A.concat([s]):null,$f(4194308,4,hb.bind(null,c,s),A)},useLayoutEffect:function(s,c){return $f(4194308,4,s,c)},useInsertionEffect:function(s,c){return $f(4,2,s,c)},useMemo:function(s,c){var A=Yi();return c=c===void 0?null:c,s=s(),A.memoizedState=[s,c],s},useReducer:function(s,c,A){var I=Yi();return c=A!==void 0?A(c):c,I.memoizedState=I.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},I.queue=s,s=s.dispatch=YS.bind(null,er,s),[I.memoizedState,s]},useRef:function(s){var c=Yi();return s={current:s},c.memoizedState=s},useState:sb,useDebugValue:K0,useDeferredValue:function(s){return Yi().memoizedState=s},useTransition:function(){var s=sb(!1),c=s[0];return s=WS.bind(null,s[1]),Yi().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,A){var I=er,j=Yi();if(Kt){if(A===void 0)throw Error(o(407));A=A()}else{if(A=c(),Ir===null)throw Error(o(349));tl&30||nb(I,c,A)}j.memoizedState=A;var W={value:A,getSnapshot:c};return j.queue=W,cb(ab.bind(null,I,W,s),[s]),I.flags|=2048,Uu(9,ib.bind(null,I,W,A,c),void 0,null),A},useId:function(){var s=Yi(),c=Ir.identifierPrefix;if(Kt){var A=_a,I=ba;A=(I&~(1<<32-In(I)-1)).toString(32)+A,c=":"+c+"R"+A,A=zu++,0<A&&(c+="H"+A.toString(32)),c+=":"}else A=qS++,c=":"+c+"r"+A.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},ZS={readContext:ti,useCallback:gb,useContext:ti,useEffect:Y0,useImperativeHandle:pb,useInsertionEffect:fb,useLayoutEffect:db,useMemo:vb,useReducer:q0,useRef:ub,useState:function(){return q0(Bu)},useDebugValue:K0,useDeferredValue:function(s){var c=ni();return mb(c,Er.memoizedState,s)},useTransition:function(){var s=q0(Bu)[0],c=ni().memoizedState;return[s,c]},useMutableSource:tb,useSyncExternalStore:rb,useId:yb,unstable_isNewReconciler:!1},QS={readContext:ti,useCallback:gb,useContext:ti,useEffect:Y0,useImperativeHandle:pb,useInsertionEffect:fb,useLayoutEffect:db,useMemo:vb,useReducer:W0,useRef:ub,useState:function(){return W0(Bu)},useDebugValue:K0,useDeferredValue:function(s){var c=ni();return Er===null?c.memoizedState=s:mb(c,Er.memoizedState,s)},useTransition:function(){var s=W0(Bu)[0],c=ni().memoizedState;return[s,c]},useMutableSource:tb,useSyncExternalStore:rb,useId:yb,unstable_isNewReconciler:!1};function Oi(s,c){if(s&&s.defaultProps){c=a({},c),s=s.defaultProps;for(var A in s)c[A]===void 0&&(c[A]=s[A]);return c}return c}function X0(s,c,A,I){c=s.memoizedState,A=A(I,c),A=A==null?c:a({},c,A),s.memoizedState=A,s.lanes===0&&(s.updateQueue.baseState=A)}var Wf={isMounted:function(s){return(s=s._reactInternals)?x(s)===s:!1},enqueueSetState:function(s,c,A){s=s._reactInternals;var I=Jr(),j=ao(s),W=wa(I,j);W.payload=c,A!=null&&(W.callback=A),c=ro(s,W,j),c!==null&&(ii(c,s,j,I),zf(c,s,j))},enqueueReplaceState:function(s,c,A){s=s._reactInternals;var I=Jr(),j=ao(s),W=wa(I,j);W.tag=1,W.payload=c,A!=null&&(W.callback=A),c=ro(s,W,j),c!==null&&(ii(c,s,j,I),zf(c,s,j))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var A=Jr(),I=ao(s),j=wa(A,I);j.tag=2,c!=null&&(j.callback=c),c=ro(s,j,I),c!==null&&(ii(c,s,I,A),zf(c,s,I))}};function Sb(s,c,A,I,j,W,J){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(I,W,J):c.prototype&&c.prototype.isPureReactComponent?!If(A,I)||!If(j,W):!0}function Eb(s,c,A){var I=!1,j=bi,W=c.contextType;return typeof W=="object"&&W!==null?W=ti(W):(j=Yt(c)?Xn:mr.current,I=c.contextTypes,W=(I=I!=null)?_i(s,j):bi),c=new c(A,W),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Wf,s.stateNode=c,c._reactInternals=s,I&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=j,s.__reactInternalMemoizedMaskedChildContext=W),c}function Ob(s,c,A,I){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(A,I),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(A,I),c.state!==s&&Wf.enqueueReplaceState(c,c.state,null)}function Z0(s,c,A,I){var j=s.stateNode;j.props=A,j.state=s.memoizedState,j.refs={},F0(s);var W=c.contextType;typeof W=="object"&&W!==null?j.context=ti(W):(W=Yt(c)?Xn:mr.current,j.context=_i(s,W)),j.state=s.memoizedState,W=c.getDerivedStateFromProps,typeof W=="function"&&(X0(s,c,W,A),j.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(c=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),c!==j.state&&Wf.enqueueReplaceState(j,j.state,null),Bf(s,A,j,I),j.state=s.memoizedState),typeof j.componentDidMount=="function"&&(s.flags|=4194308)}function hs(s,c){try{var A="",I=c;do A+=VS(I),I=I.return;while(I);var j=A}catch(W){j=`
56
+ Error generating stack: `+W.message+`
57
+ `+W.stack}return{value:s,source:c,stack:j,digest:null}}function Q0(s,c,A){return{value:s,source:null,stack:A??null,digest:c??null}}function J0(s,c){try{console.error(c.value)}catch(A){setTimeout(function(){throw A})}}var JS=typeof WeakMap=="function"?WeakMap:Map;function xb(s,c,A){A=wa(-1,A),A.tag=3,A.payload={element:null};var I=c.value;return A.callback=function(){ld||(ld=!0,b1=I),J0(s,c)},A}function Pb(s,c,A){A=wa(-1,A),A.tag=3;var I=s.type.getDerivedStateFromError;if(typeof I=="function"){var j=c.value;A.payload=function(){return I(j)},A.callback=function(){J0(s,c)}}var W=s.stateNode;return W!==null&&typeof W.componentDidCatch=="function"&&(A.callback=function(){J0(s,c),typeof I!="function"&&(no===null?no=new Set([this]):no.add(this));var J=c.stack;this.componentDidCatch(c.value,{componentStack:J!==null?J:""})}),A}function Cb(s,c,A){var I=s.pingCache;if(I===null){I=s.pingCache=new JS;var j=new Set;I.set(c,j)}else j=I.get(c),j===void 0&&(j=new Set,I.set(c,j));j.has(A)||(j.add(A),s=hE.bind(null,s,c,A),c.then(s,s))}function Tb(s){do{var c;if((c=s.tag===13)&&(c=s.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return s;s=s.return}while(s!==null);return null}function Ab(s,c,A,I,j){return s.mode&1?(s.flags|=65536,s.lanes=j,s):(s===c?s.flags|=65536:(s.flags|=128,A.flags|=131072,A.flags&=-52805,A.tag===1&&(A.alternate===null?A.tag=17:(c=wa(-1,1),c.tag=2,ro(A,c,1))),A.lanes|=1),s)}var eE=l.ReactCurrentOwner,yn=!1;function cn(s,c,A,I){c.child=s===null?Y2(c,null,A,I):ss(c,s.child,A,I)}function kb(s,c,A,I,j){A=A.render;var W=c.ref;return cs(c,j),I=$0(s,c,A,I,W,j),A=V0(),s!==null&&!yn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~j,Sa(s,c,j)):(Kt&&A&&C0(c),c.flags|=1,cn(s,c,I,j),c.child)}function Rb(s,c,A,I,j){if(s===null){var W=A.type;return typeof W=="function"&&!x1(W)&&W.defaultProps===void 0&&A.compare===null&&A.defaultProps===void 0?(c.tag=15,c.type=W,Lb(s,c,W,I,j)):(s=hd(A.type,null,I,c,c.mode,j),s.ref=c.ref,s.return=c,c.child=s)}if(W=s.child,!(s.lanes&j)){var J=W.memoizedProps;if(A=A.compare,A=A!==null?A:If,A(J,I)&&s.ref===c.ref)return Sa(s,c,j)}return c.flags|=1,s=lo(W,I),s.ref=c.ref,s.return=c,c.child=s}function Lb(s,c,A,I,j){if(s!==null){var W=s.memoizedProps;if(If(W,I)&&s.ref===c.ref)if(yn=!1,c.pendingProps=I=W,(s.lanes&j)!==0)s.flags&131072&&(yn=!0);else return c.lanes=s.lanes,Sa(s,c,j)}return e1(s,c,A,I,j)}function Mb(s,c,A){var I=c.pendingProps,j=I.children,W=s!==null?s.memoizedState:null;if(I.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Rt(gs,jn),jn|=A;else{if(!(A&1073741824))return s=W!==null?W.baseLanes|A:A,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Rt(gs,jn),jn|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},I=W!==null?W.baseLanes:A,Rt(gs,jn),jn|=I}else W!==null?(I=W.baseLanes|A,c.memoizedState=null):I=A,Rt(gs,jn),jn|=I;return cn(s,c,j,A),c.child}function Nb(s,c){var A=c.ref;(s===null&&A!==null||s!==null&&s.ref!==A)&&(c.flags|=512,c.flags|=2097152)}function e1(s,c,A,I,j){var W=Yt(A)?Xn:mr.current;return W=_i(c,W),cs(c,j),A=$0(s,c,A,I,W,j),I=V0(),s!==null&&!yn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~j,Sa(s,c,j)):(Kt&&I&&C0(c),c.flags|=1,cn(s,c,A,j),c.child)}function Ib(s,c,A,I,j){if(Yt(A)){var W=!0;Jl(c)}else W=!1;if(cs(c,j),c.stateNode===null)Kf(s,c),Eb(c,A,I),Z0(c,A,I,j),I=!0;else if(s===null){var J=c.stateNode,le=c.memoizedProps;J.props=le;var me=J.context,Re=A.contextType;typeof Re=="object"&&Re!==null?Re=ti(Re):(Re=Yt(A)?Xn:mr.current,Re=_i(c,Re));var Ve=A.getDerivedStateFromProps,lt=typeof Ve=="function"||typeof J.getSnapshotBeforeUpdate=="function";lt||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(le!==I||me!==Re)&&Ob(c,J,I,Re),to=!1;var ze=c.memoizedState;J.state=ze,Bf(c,I,J,j),me=c.memoizedState,le!==I||ze!==me||Ur.current||to?(typeof Ve=="function"&&(X0(c,A,Ve,I),me=c.memoizedState),(le=to||Sb(c,A,le,I,ze,me,Re))?(lt||typeof J.UNSAFE_componentWillMount!="function"&&typeof J.componentWillMount!="function"||(typeof J.componentWillMount=="function"&&J.componentWillMount(),typeof J.UNSAFE_componentWillMount=="function"&&J.UNSAFE_componentWillMount()),typeof J.componentDidMount=="function"&&(c.flags|=4194308)):(typeof J.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=I,c.memoizedState=me),J.props=I,J.state=me,J.context=Re,I=le):(typeof J.componentDidMount=="function"&&(c.flags|=4194308),I=!1)}else{J=c.stateNode,Z2(s,c),le=c.memoizedProps,Re=c.type===c.elementType?le:Oi(c.type,le),J.props=Re,lt=c.pendingProps,ze=J.context,me=A.contextType,typeof me=="object"&&me!==null?me=ti(me):(me=Yt(A)?Xn:mr.current,me=_i(c,me));var Vt=A.getDerivedStateFromProps;(Ve=typeof Vt=="function"||typeof J.getSnapshotBeforeUpdate=="function")||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(le!==lt||ze!==me)&&Ob(c,J,I,me),to=!1,ze=c.memoizedState,J.state=ze,Bf(c,I,J,j);var jt=c.memoizedState;le!==lt||ze!==jt||Ur.current||to?(typeof Vt=="function"&&(X0(c,A,Vt,I),jt=c.memoizedState),(Re=to||Sb(c,A,Re,I,ze,jt,me)||!1)?(Ve||typeof J.UNSAFE_componentWillUpdate!="function"&&typeof J.componentWillUpdate!="function"||(typeof J.componentWillUpdate=="function"&&J.componentWillUpdate(I,jt,me),typeof J.UNSAFE_componentWillUpdate=="function"&&J.UNSAFE_componentWillUpdate(I,jt,me)),typeof J.componentDidUpdate=="function"&&(c.flags|=4),typeof J.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof J.componentDidUpdate!="function"||le===s.memoizedProps&&ze===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||le===s.memoizedProps&&ze===s.memoizedState||(c.flags|=1024),c.memoizedProps=I,c.memoizedState=jt),J.props=I,J.state=jt,J.context=me,I=Re):(typeof J.componentDidUpdate!="function"||le===s.memoizedProps&&ze===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||le===s.memoizedProps&&ze===s.memoizedState||(c.flags|=1024),I=!1)}return t1(s,c,A,I,W,j)}function t1(s,c,A,I,j,W){Nb(s,c);var J=(c.flags&128)!==0;if(!I&&!J)return j&&ma(c,A,!1),Sa(s,c,W);I=c.stateNode,eE.current=c;var le=J&&typeof A.getDerivedStateFromError!="function"?null:I.render();return c.flags|=1,s!==null&&J?(c.child=ss(c,s.child,null,W),c.child=ss(c,null,le,W)):cn(s,c,le,W),c.memoizedState=I.state,j&&ma(c,A,!0),c.child}function Db(s){var c=s.stateNode;c.pendingContext?Zl(s,c.pendingContext,c.pendingContext!==c.context):c.context&&Zl(s,c.context,!1),j0(s,c.containerInfo)}function Fb(s,c,A,I,j){return ls(),R0(j),c.flags|=256,cn(s,c,A,I),c.child}var r1={dehydrated:null,treeContext:null,retryLane:0};function n1(s){return{baseLanes:s,cachePool:null,transitions:null}}function jb(s,c,A){var I=c.pendingProps,j=Jt.current,W=!1,J=(c.flags&128)!==0,le;if((le=J)||(le=s!==null&&s.memoizedState===null?!1:(j&2)!==0),le?(W=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(j|=1),Rt(Jt,j&1),s===null)return k0(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(c.mode&1?it(s)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(J=I.children,s=I.fallback,W?(I=c.mode,W=c.child,J={mode:"hidden",children:J},!(I&1)&&W!==null?(W.childLanes=0,W.pendingProps=J):W=pd(J,I,0,null),s=ol(s,I,A,null),W.return=c,s.return=c,W.sibling=s,c.child=W,c.child.memoizedState=n1(A),c.memoizedState=r1,s):i1(c,J));if(j=s.memoizedState,j!==null&&(le=j.dehydrated,le!==null))return tE(s,c,J,I,le,j,A);if(W){W=I.fallback,J=c.mode,j=s.child,le=j.sibling;var me={mode:"hidden",children:I.children};return!(J&1)&&c.child!==j?(I=c.child,I.childLanes=0,I.pendingProps=me,c.deletions=null):(I=lo(j,me),I.subtreeFlags=j.subtreeFlags&14680064),le!==null?W=lo(le,W):(W=ol(W,J,A,null),W.flags|=2),W.return=c,I.return=c,I.sibling=W,c.child=I,I=W,W=c.child,J=s.child.memoizedState,J=J===null?n1(A):{baseLanes:J.baseLanes|A,cachePool:null,transitions:J.transitions},W.memoizedState=J,W.childLanes=s.childLanes&~A,c.memoizedState=r1,I}return W=s.child,s=W.sibling,I=lo(W,{mode:"visible",children:I.children}),!(c.mode&1)&&(I.lanes=A),I.return=c,I.sibling=null,s!==null&&(A=c.deletions,A===null?(c.deletions=[s],c.flags|=16):A.push(s)),c.child=I,c.memoizedState=null,I}function i1(s,c){return c=pd({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function Yf(s,c,A,I){return I!==null&&R0(I),ss(c,s.child,null,A),s=i1(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function tE(s,c,A,I,j,W,J){if(A)return c.flags&256?(c.flags&=-257,I=Q0(Error(o(422))),Yf(s,c,J,I)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(W=I.fallback,j=c.mode,I=pd({mode:"visible",children:I.children},j,0,null),W=ol(W,j,J,null),W.flags|=2,I.return=c,W.return=c,I.sibling=W,c.child=I,c.mode&1&&ss(c,s.child,null,J),c.child.memoizedState=n1(J),c.memoizedState=r1,W);if(!(c.mode&1))return Yf(s,c,J,null);if(it(j))return I=Qe(j).digest,W=Error(o(419)),I=Q0(W,I,void 0),Yf(s,c,J,I);if(A=(J&s.childLanes)!==0,yn||A){if(I=Ir,I!==null){switch(J&-J){case 4:j=2;break;case 16:j=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:j=32;break;case 536870912:j=268435456;break;default:j=0}j=j&(I.suspendedLanes|J)?0:j,j!==0&&j!==W.retryLane&&(W.retryLane=j,qi(s,j),ii(I,s,j,-1))}return O1(),I=Q0(Error(o(421))),Yf(s,c,J,I)}return De(j)?(c.flags|=128,c.child=s.child,c=pE.bind(null,s),kt(j,c),null):(s=W.treeContext,ae&&(ei=$t(j),Fn=c,Kt=!0,Ei=null,Nu=!1,s!==null&&(Qn[Jn++]=ba,Qn[Jn++]=_a,Qn[Jn++]=Qo,ba=s.id,_a=s.overflow,Qo=c)),c=i1(c,I.children),c.flags|=4096,c)}function zb(s,c,A){s.lanes|=c;var I=s.alternate;I!==null&&(I.lanes|=c),I0(s.return,c,A)}function a1(s,c,A,I,j){var W=s.memoizedState;W===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:I,tail:A,tailMode:j}:(W.isBackwards=c,W.rendering=null,W.renderingStartTime=0,W.last=I,W.tail=A,W.tailMode=j)}function Bb(s,c,A){var I=c.pendingProps,j=I.revealOrder,W=I.tail;if(cn(s,c,I.children,A),I=Jt.current,I&2)I=I&1|2,c.flags|=128;else{if(s!==null&&s.flags&128)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&zb(s,A,c);else if(s.tag===19)zb(s,A,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}I&=1}if(Rt(Jt,I),!(c.mode&1))c.memoizedState=null;else switch(j){case"forwards":for(A=c.child,j=null;A!==null;)s=A.alternate,s!==null&&Uf(s)===null&&(j=A),A=A.sibling;A=j,A===null?(j=c.child,c.child=null):(j=A.sibling,A.sibling=null),a1(c,!1,j,A,W);break;case"backwards":for(A=null,j=c.child,c.child=null;j!==null;){if(s=j.alternate,s!==null&&Uf(s)===null){c.child=j;break}s=j.sibling,j.sibling=A,A=j,j=s}a1(c,!0,A,null,W);break;case"together":a1(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Kf(s,c){!(c.mode&1)&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function Sa(s,c,A){if(s!==null&&(c.dependencies=s.dependencies),rl|=c.lanes,!(A&c.childLanes))return null;if(s!==null&&c.child!==s.child)throw Error(o(153));if(c.child!==null){for(s=c.child,A=lo(s,s.pendingProps),c.child=A,A.return=c;s.sibling!==null;)s=s.sibling,A=A.sibling=lo(s,s.pendingProps),A.return=c;A.sibling=null}return c.child}function rE(s,c,A){switch(c.tag){case 3:Db(c),ls();break;case 5:eb(c);break;case 1:Yt(c.type)&&Jl(c);break;case 4:j0(c,c.stateNode.containerInfo);break;case 10:K2(c,c.type._context,c.memoizedProps.value);break;case 13:var I=c.memoizedState;if(I!==null)return I.dehydrated!==null?(Rt(Jt,Jt.current&1),c.flags|=128,null):A&c.child.childLanes?jb(s,c,A):(Rt(Jt,Jt.current&1),s=Sa(s,c,A),s!==null?s.sibling:null);Rt(Jt,Jt.current&1);break;case 19:if(I=(A&c.childLanes)!==0,s.flags&128){if(I)return Bb(s,c,A);c.flags|=128}var j=c.memoizedState;if(j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),Rt(Jt,Jt.current),I)break;return null;case 22:case 23:return c.lanes=0,Mb(s,c,A)}return Sa(s,c,A)}function Ki(s){s.flags|=4}function Ub(s,c){if(s!==null&&s.child===c.child)return!0;if(c.flags&16)return!1;for(s=c.child;s!==null;){if(s.flags&12854||s.subtreeFlags&12854)return!1;s=s.sibling}return!0}var Hu,Gu,Xf,Zf;if(ee)Hu=function(s,c){for(var A=c.child;A!==null;){if(A.tag===5||A.tag===6)B(s,A.stateNode);else if(A.tag!==4&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===c)break;for(;A.sibling===null;){if(A.return===null||A.return===c)return;A=A.return}A.sibling.return=A.return,A=A.sibling}},Gu=function(){},Xf=function(s,c,A,I,j){if(s=s.memoizedProps,s!==I){var W=c.stateNode,J=Wi(ri.current);A=V(W,A,s,I,j,J),(c.updateQueue=A)&&Ki(c)}},Zf=function(s,c,A,I){A!==I&&Ki(c)};else if(te){Hu=function(s,c,A,I){for(var j=c.child;j!==null;){if(j.tag===5){var W=j.stateNode;A&&I&&(W=xt(W,j.type,j.memoizedProps,j)),B(s,W)}else if(j.tag===6)W=j.stateNode,A&&I&&(W=ar(W,j.memoizedProps,j)),B(s,W);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)W=j.child,W!==null&&(W.return=j),Hu(s,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}};var Hb=function(s,c,A,I){for(var j=c.child;j!==null;){if(j.tag===5){var W=j.stateNode;A&&I&&(W=xt(W,j.type,j.memoizedProps,j)),He(s,W)}else if(j.tag===6)W=j.stateNode,A&&I&&(W=ar(W,j.memoizedProps,j)),He(s,W);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)W=j.child,W!==null&&(W.return=j),Hb(s,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}};Gu=function(s,c){var A=c.stateNode;if(!Ub(s,c)){s=A.containerInfo;var I=Pe(s);Hb(I,c,!1,!1),A.pendingChildren=I,Ki(c),et(s,I)}},Xf=function(s,c,A,I,j){var W=s.stateNode,J=s.memoizedProps;if((s=Ub(s,c))&&J===I)c.stateNode=W;else{var le=c.stateNode,me=Wi(ri.current),Re=null;J!==I&&(Re=V(le,A,J,I,j,me)),s&&Re===null?c.stateNode=W:(W=Sr(W,Re,A,J,I,c,s,le),D(W,A,I,j,me)&&Ki(c),c.stateNode=W,s?Ki(c):Hu(W,c,!1,!1))}},Zf=function(s,c,A,I){A!==I?(s=Wi(fs.current),A=Wi(ri.current),c.stateNode=q(I,s,A,c),Ki(c)):c.stateNode=s.stateNode}}else Gu=function(){},Xf=function(){},Zf=function(){};function $u(s,c){if(!Kt)switch(s.tailMode){case"hidden":c=s.tail;for(var A=null;c!==null;)c.alternate!==null&&(A=c),c=c.sibling;A===null?s.tail=null:A.sibling=null;break;case"collapsed":A=s.tail;for(var I=null;A!==null;)A.alternate!==null&&(I=A),A=A.sibling;I===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:I.sibling=null}}function Zr(s){var c=s.alternate!==null&&s.alternate.child===s.child,A=0,I=0;if(c)for(var j=s.child;j!==null;)A|=j.lanes|j.childLanes,I|=j.subtreeFlags&14680064,I|=j.flags&14680064,j.return=s,j=j.sibling;else for(j=s.child;j!==null;)A|=j.lanes|j.childLanes,I|=j.subtreeFlags,I|=j.flags,j.return=s,j=j.sibling;return s.subtreeFlags|=I,s.childLanes=A,c}function nE(s,c,A){var I=c.pendingProps;switch(T0(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zr(c),null;case 1:return Yt(c.type)&&wi(),Zr(c),null;case 3:return A=c.stateNode,ds(),Nt(Ur),Nt(mr),U0(),A.pendingContext&&(A.context=A.pendingContext,A.pendingContext=null),(s===null||s.child===null)&&(Nf(c)?Ki(c):s===null||s.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,Ei!==null&&(S1(Ei),Ei=null))),Gu(s,c),Zr(c),null;case 5:z0(c),A=Wi(fs.current);var j=c.type;if(s!==null&&c.stateNode!=null)Xf(s,c,j,I,A),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!I){if(c.stateNode===null)throw Error(o(166));return Zr(c),null}if(s=Wi(ri.current),Nf(c)){if(!ae)throw Error(o(175));s=Br(c.stateNode,c.type,c.memoizedProps,A,s,c,!Nu),c.updateQueue=s,s!==null&&Ki(c)}else{var W=F(j,I,A,s,c);Hu(W,c,!1,!1),c.stateNode=W,D(W,j,I,A,s)&&Ki(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Zr(c),null;case 6:if(s&&c.stateNode!=null)Zf(s,c,s.memoizedProps,I);else{if(typeof I!="string"&&c.stateNode===null)throw Error(o(166));if(s=Wi(fs.current),A=Wi(ri.current),Nf(c)){if(!ae)throw Error(o(176));if(s=c.stateNode,A=c.memoizedProps,(I=vr(s,A,c,!Nu))&&(j=Fn,j!==null))switch(j.tag){case 3:yi(j.stateNode.containerInfo,s,A,(j.mode&1)!==0);break;case 5:Kl(j.type,j.memoizedProps,j.stateNode,s,A,(j.mode&1)!==0)}I&&Ki(c)}else c.stateNode=q(I,s,A,c)}return Zr(c),null;case 13:if(Nt(Jt),I=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Kt&&ei!==null&&c.mode&1&&!(c.flags&128))V2(),ls(),c.flags|=98560,j=!1;else if(j=Nf(c),I!==null&&I.dehydrated!==null){if(s===null){if(!j)throw Error(o(318));if(!ae)throw Error(o(344));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(o(317));Mr(j,c)}else ls(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Zr(c),j=!1}else Ei!==null&&(S1(Ei),Ei=null),j=!0;if(!j)return c.flags&65536?c:null}return c.flags&128?(c.lanes=A,c):(A=I!==null,A!==(s!==null&&s.memoizedState!==null)&&A&&(c.child.flags|=8192,c.mode&1&&(s===null||Jt.current&1?Or===0&&(Or=3):O1())),c.updateQueue!==null&&(c.flags|=4),Zr(c),null);case 4:return ds(),Gu(s,c),s===null&&se(c.stateNode.containerInfo),Zr(c),null;case 10:return N0(c.type._context),Zr(c),null;case 17:return Yt(c.type)&&wi(),Zr(c),null;case 19:if(Nt(Jt),j=c.memoizedState,j===null)return Zr(c),null;if(I=(c.flags&128)!==0,W=j.rendering,W===null)if(I)$u(j,!1);else{if(Or!==0||s!==null&&s.flags&128)for(s=c.child;s!==null;){if(W=Uf(s),W!==null){for(c.flags|=128,$u(j,!1),s=W.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),c.subtreeFlags=0,s=A,A=c.child;A!==null;)I=A,j=s,I.flags&=14680066,W=I.alternate,W===null?(I.childLanes=0,I.lanes=j,I.child=null,I.subtreeFlags=0,I.memoizedProps=null,I.memoizedState=null,I.updateQueue=null,I.dependencies=null,I.stateNode=null):(I.childLanes=W.childLanes,I.lanes=W.lanes,I.child=W.child,I.subtreeFlags=0,I.deletions=null,I.memoizedProps=W.memoizedProps,I.memoizedState=W.memoizedState,I.updateQueue=W.updateQueue,I.type=W.type,j=W.dependencies,I.dependencies=j===null?null:{lanes:j.lanes,firstContext:j.firstContext}),A=A.sibling;return Rt(Jt,Jt.current&1|2),c.child}s=s.sibling}j.tail!==null&&dr()>y1&&(c.flags|=128,I=!0,$u(j,!1),c.lanes=4194304)}else{if(!I)if(s=Uf(W),s!==null){if(c.flags|=128,I=!0,s=s.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),$u(j,!0),j.tail===null&&j.tailMode==="hidden"&&!W.alternate&&!Kt)return Zr(c),null}else 2*dr()-j.renderingStartTime>y1&&A!==1073741824&&(c.flags|=128,I=!0,$u(j,!1),c.lanes=4194304);j.isBackwards?(W.sibling=c.child,c.child=W):(s=j.last,s!==null?s.sibling=W:c.child=W,j.last=W)}return j.tail!==null?(c=j.tail,j.rendering=c,j.tail=c.sibling,j.renderingStartTime=dr(),c.sibling=null,s=Jt.current,Rt(Jt,I?s&1|2:s&1),c):(Zr(c),null);case 22:case 23:return E1(),A=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==A&&(c.flags|=8192),A&&c.mode&1?jn&1073741824&&(Zr(c),ee&&c.subtreeFlags&6&&(c.flags|=8192)):Zr(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}function iE(s,c){switch(T0(c),c.tag){case 1:return Yt(c.type)&&wi(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return ds(),Nt(Ur),Nt(mr),U0(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return z0(c),null;case 13:if(Nt(Jt),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(o(340));ls()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return Nt(Jt),null;case 4:return ds(),null;case 10:return N0(c.type._context),null;case 22:case 23:return E1(),null;case 24:return null;default:return null}}var Qf=!1,Qr=!1,aE=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function ps(s,c){var A=s.ref;if(A!==null)if(typeof A=="function")try{A(null)}catch(I){Xt(s,c,I)}else A.current=null}function o1(s,c,A){try{A()}catch(I){Xt(s,c,I)}}var Gb=!1;function oE(s,c){for(H(s.containerInfo),Ge=c;Ge!==null;)if(s=Ge,c=s.child,(s.subtreeFlags&1028)!==0&&c!==null)c.return=s,Ge=c;else for(;Ge!==null;){s=Ge;try{var A=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(A!==null){var I=A.memoizedProps,j=A.memoizedState,W=s.stateNode,J=W.getSnapshotBeforeUpdate(s.elementType===s.type?I:Oi(s.type,I),j);W.__reactInternalSnapshotBeforeUpdate=J}break;case 3:ee&&Ke(s.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(le){Xt(s,s.return,le)}if(c=s.sibling,c!==null){c.return=s.return,Ge=c;break}Ge=s.return}return A=Gb,Gb=!1,A}function Vu(s,c,A){var I=c.updateQueue;if(I=I!==null?I.lastEffect:null,I!==null){var j=I=I.next;do{if((j.tag&s)===s){var W=j.destroy;j.destroy=void 0,W!==void 0&&o1(c,A,W)}j=j.next}while(j!==I)}}function Jf(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var A=c=c.next;do{if((A.tag&s)===s){var I=A.create;A.destroy=I()}A=A.next}while(A!==c)}}function l1(s){var c=s.ref;if(c!==null){var A=s.stateNode;switch(s.tag){case 5:s=Z(A);break;default:s=A}typeof c=="function"?c(s):c.current=s}}function $b(s){var c=s.alternate;c!==null&&(s.alternate=null,$b(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&Fe(c)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Vb(s){return s.tag===5||s.tag===3||s.tag===4}function qb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Vb(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function s1(s,c,A){var I=s.tag;if(I===5||I===6)s=s.stateNode,c?he(A,s,c):Ze(A,s);else if(I!==4&&(s=s.child,s!==null))for(s1(s,c,A),s=s.sibling;s!==null;)s1(s,c,A),s=s.sibling}function u1(s,c,A){var I=s.tag;if(I===5||I===6)s=s.stateNode,c?ue(A,s,c):Ae(A,s);else if(I!==4&&(s=s.child,s!==null))for(u1(s,c,A),s=s.sibling;s!==null;)u1(s,c,A),s=s.sibling}var Hr=null,xi=!1;function Xi(s,c,A){for(A=A.child;A!==null;)c1(s,c,A),A=A.sibling}function c1(s,c,A){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Ne,A)}catch{}switch(A.tag){case 5:Qr||ps(A,c);case 6:if(ee){var I=Hr,j=xi;Hr=null,Xi(s,c,A),Hr=I,xi=j,Hr!==null&&(xi?Oe(Hr,A.stateNode):nt(Hr,A.stateNode))}else Xi(s,c,A);break;case 18:ee&&Hr!==null&&(xi?Kn(Hr,A.stateNode):sn(Hr,A.stateNode));break;case 4:ee?(I=Hr,j=xi,Hr=A.stateNode.containerInfo,xi=!0,Xi(s,c,A),Hr=I,xi=j):(te&&(I=A.stateNode.containerInfo,j=Pe(I),Et(I,j)),Xi(s,c,A));break;case 0:case 11:case 14:case 15:if(!Qr&&(I=A.updateQueue,I!==null&&(I=I.lastEffect,I!==null))){j=I=I.next;do{var W=j,J=W.destroy;W=W.tag,J!==void 0&&(W&2||W&4)&&o1(A,c,J),j=j.next}while(j!==I)}Xi(s,c,A);break;case 1:if(!Qr&&(ps(A,c),I=A.stateNode,typeof I.componentWillUnmount=="function"))try{I.props=A.memoizedProps,I.state=A.memoizedState,I.componentWillUnmount()}catch(le){Xt(A,c,le)}Xi(s,c,A);break;case 21:Xi(s,c,A);break;case 22:A.mode&1?(Qr=(I=Qr)||A.memoizedState!==null,Xi(s,c,A),Qr=I):Xi(s,c,A);break;default:Xi(s,c,A)}}function Wb(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var A=s.stateNode;A===null&&(A=s.stateNode=new aE),c.forEach(function(I){var j=gE.bind(null,s,I);A.has(I)||(A.add(I),I.then(j,j))})}}function Pi(s,c){var A=c.deletions;if(A!==null)for(var I=0;I<A.length;I++){var j=A[I];try{var W=s,J=c;if(ee){var le=J;e:for(;le!==null;){switch(le.tag){case 5:Hr=le.stateNode,xi=!1;break e;case 3:Hr=le.stateNode.containerInfo,xi=!0;break e;case 4:Hr=le.stateNode.containerInfo,xi=!0;break e}le=le.return}if(Hr===null)throw Error(o(160));c1(W,J,j),Hr=null,xi=!1}else c1(W,J,j);var me=j.alternate;me!==null&&(me.return=null),j.return=null}catch(Re){Xt(j,c,Re)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Yb(c,s),c=c.sibling}function Yb(s,c){var A=s.alternate,I=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Pi(c,s),Zi(s),I&4){try{Vu(3,s,s.return),Jf(3,s)}catch(ze){Xt(s,s.return,ze)}try{Vu(5,s,s.return)}catch(ze){Xt(s,s.return,ze)}}break;case 1:Pi(c,s),Zi(s),I&512&&A!==null&&ps(A,A.return);break;case 5:if(Pi(c,s),Zi(s),I&512&&A!==null&&ps(A,A.return),ee){if(s.flags&32){var j=s.stateNode;try{je(j)}catch(ze){Xt(s,s.return,ze)}}if(I&4&&(j=s.stateNode,j!=null)){var W=s.memoizedProps;if(A=A!==null?A.memoizedProps:W,I=s.type,c=s.updateQueue,s.updateQueue=null,c!==null)try{Bt(j,c,I,A,W,s)}catch(ze){Xt(s,s.return,ze)}}}break;case 6:if(Pi(c,s),Zi(s),I&4&&ee){if(s.stateNode===null)throw Error(o(162));j=s.stateNode,W=s.memoizedProps,A=A!==null?A.memoizedProps:W;try{We(j,A,W)}catch(ze){Xt(s,s.return,ze)}}break;case 3:if(Pi(c,s),Zi(s),I&4){if(ee&&ae&&A!==null&&A.memoizedState.isDehydrated)try{mi(c.containerInfo)}catch(ze){Xt(s,s.return,ze)}if(te){j=c.containerInfo,W=c.pendingChildren;try{Et(j,W)}catch(ze){Xt(s,s.return,ze)}}}break;case 4:if(Pi(c,s),Zi(s),I&4&&te){W=s.stateNode,j=W.containerInfo,W=W.pendingChildren;try{Et(j,W)}catch(ze){Xt(s,s.return,ze)}}break;case 13:Pi(c,s),Zi(s),j=s.child,j.flags&8192&&(W=j.memoizedState!==null,j.stateNode.isHidden=W,!W||j.alternate!==null&&j.alternate.memoizedState!==null||(m1=dr())),I&4&&Wb(s);break;case 22:var J=A!==null&&A.memoizedState!==null;if(s.mode&1?(Qr=(A=Qr)||J,Pi(c,s),Qr=A):Pi(c,s),Zi(s),I&8192){if(A=s.memoizedState!==null,(s.stateNode.isHidden=A)&&!J&&s.mode&1)for(Ge=s,I=s.child;I!==null;){for(c=Ge=I;Ge!==null;){J=Ge;var le=J.child;switch(J.tag){case 0:case 11:case 14:case 15:Vu(4,J,J.return);break;case 1:ps(J,J.return);var me=J.stateNode;if(typeof me.componentWillUnmount=="function"){var Re=J,Ve=J.return;try{var lt=Re;me.props=lt.memoizedProps,me.state=lt.memoizedState,me.componentWillUnmount()}catch(ze){Xt(Re,Ve,ze)}}break;case 5:ps(J,J.return);break;case 22:if(J.memoizedState!==null){Zb(c);continue}}le!==null?(le.return=J,Ge=le):Zb(c)}I=I.sibling}if(ee){e:if(I=null,ee)for(c=s;;){if(c.tag===5){if(I===null){I=c;try{j=c.stateNode,A?Le(j):Je(c.stateNode,c.memoizedProps)}catch(ze){Xt(s,s.return,ze)}}}else if(c.tag===6){if(I===null)try{W=c.stateNode,A?Se(W):xe(W,c.memoizedProps)}catch(ze){Xt(s,s.return,ze)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;I===c&&(I=null),c=c.return}I===c&&(I=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:Pi(c,s),Zi(s),I&4&&Wb(s);break;case 21:break;default:Pi(c,s),Zi(s)}}function Zi(s){var c=s.flags;if(c&2){try{if(ee){e:{for(var A=s.return;A!==null;){if(Vb(A)){var I=A;break e}A=A.return}throw Error(o(160))}switch(I.tag){case 5:var j=I.stateNode;I.flags&32&&(je(j),I.flags&=-33);var W=qb(s);u1(s,W,j);break;case 3:case 4:var J=I.stateNode.containerInfo,le=qb(s);s1(s,le,J);break;default:throw Error(o(161))}}}catch(me){Xt(s,s.return,me)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function lE(s,c,A){Ge=s,Kb(s)}function Kb(s,c,A){for(var I=(s.mode&1)!==0;Ge!==null;){var j=Ge,W=j.child;if(j.tag===22&&I){var J=j.memoizedState!==null||Qf;if(!J){var le=j.alternate,me=le!==null&&le.memoizedState!==null||Qr;le=Qf;var Re=Qr;if(Qf=J,(Qr=me)&&!Re)for(Ge=j;Ge!==null;)J=Ge,me=J.child,J.tag===22&&J.memoizedState!==null?Qb(j):me!==null?(me.return=J,Ge=me):Qb(j);for(;W!==null;)Ge=W,Kb(W),W=W.sibling;Ge=j,Qf=le,Qr=Re}Xb(s)}else j.subtreeFlags&8772&&W!==null?(W.return=j,Ge=W):Xb(s)}}function Xb(s){for(;Ge!==null;){var c=Ge;if(c.flags&8772){var A=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:Qr||Jf(5,c);break;case 1:var I=c.stateNode;if(c.flags&4&&!Qr)if(A===null)I.componentDidMount();else{var j=c.elementType===c.type?A.memoizedProps:Oi(c.type,A.memoizedProps);I.componentDidUpdate(j,A.memoizedState,I.__reactInternalSnapshotBeforeUpdate)}var W=c.updateQueue;W!==null&&J2(c,W,I);break;case 3:var J=c.updateQueue;if(J!==null){if(A=null,c.child!==null)switch(c.child.tag){case 5:A=Z(c.child.stateNode);break;case 1:A=c.child.stateNode}J2(c,J,A)}break;case 5:var le=c.stateNode;A===null&&c.flags&4&&dt(le,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(ae&&c.memoizedState===null){var me=c.alternate;if(me!==null){var Re=me.memoizedState;if(Re!==null){var Ve=Re.dehydrated;Ve!==null&&mn(Ve)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Qr||c.flags&512&&l1(c)}catch(lt){Xt(c,c.return,lt)}}if(c===s){Ge=null;break}if(A=c.sibling,A!==null){A.return=c.return,Ge=A;break}Ge=c.return}}function Zb(s){for(;Ge!==null;){var c=Ge;if(c===s){Ge=null;break}var A=c.sibling;if(A!==null){A.return=c.return,Ge=A;break}Ge=c.return}}function Qb(s){for(;Ge!==null;){var c=Ge;try{switch(c.tag){case 0:case 11:case 15:var A=c.return;try{Jf(4,c)}catch(me){Xt(c,A,me)}break;case 1:var I=c.stateNode;if(typeof I.componentDidMount=="function"){var j=c.return;try{I.componentDidMount()}catch(me){Xt(c,j,me)}}var W=c.return;try{l1(c)}catch(me){Xt(c,W,me)}break;case 5:var J=c.return;try{l1(c)}catch(me){Xt(c,J,me)}}}catch(me){Xt(c,c.return,me)}if(c===s){Ge=null;break}var le=c.sibling;if(le!==null){le.return=c.return,Ge=le;break}Ge=c.return}}var ed=0,td=1,rd=2,nd=3,id=4;if(typeof Symbol=="function"&&Symbol.for){var qu=Symbol.for;ed=qu("selector.component"),td=qu("selector.has_pseudo_class"),rd=qu("selector.role"),nd=qu("selector.test_id"),id=qu("selector.text")}function f1(s){var c=oe(s);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(o(364));return c}if(s=pe(s),s===null)throw Error(o(362));return s.stateNode.current}function d1(s,c){switch(c.$$typeof){case ed:if(s.type===c.value)return!0;break;case td:e:{c=c.value,s=[s,0];for(var A=0;A<s.length;){var I=s[A++],j=s[A++],W=c[j];if(I.tag!==5||!be(I)){for(;W!=null&&d1(I,W);)j++,W=c[j];if(j===c.length){c=!0;break e}else for(I=I.child;I!==null;)s.push(I,j),I=I.sibling}}c=!1}return c;case rd:if(s.tag===5&&ye(s.stateNode,c.value))return!0;break;case id:if((s.tag===5||s.tag===6)&&(s=de(s),s!==null&&0<=s.indexOf(c.value)))return!0;break;case nd:if(s.tag===5&&(s=s.memoizedProps["data-testname"],typeof s=="string"&&s.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function h1(s){switch(s.$$typeof){case ed:return"<"+(C(s.value)||"Unknown")+">";case td:return":has("+(h1(s)||"")+")";case rd:return'[role="'+s.value+'"]';case id:return'"'+s.value+'"';case nd:return'[data-testname="'+s.value+'"]';default:throw Error(o(365))}}function Jb(s,c){var A=[];s=[s,0];for(var I=0;I<s.length;){var j=s[I++],W=s[I++],J=c[W];if(j.tag!==5||!be(j)){for(;J!=null&&d1(j,J);)W++,J=c[W];if(W===c.length)A.push(j);else for(j=j.child;j!==null;)s.push(j,W),j=j.sibling}}return A}function p1(s,c){if(!ge)throw Error(o(363));s=f1(s),s=Jb(s,c),c=[],s=Array.from(s);for(var A=0;A<s.length;){var I=s[A++];if(I.tag===5)be(I)||c.push(I.stateNode);else for(I=I.child;I!==null;)s.push(I),I=I.sibling}return c}var sE=Math.ceil,ad=l.ReactCurrentDispatcher,g1=l.ReactCurrentOwner,hr=l.ReactCurrentBatchConfig,mt=0,Ir=null,br=null,Gr=0,jn=0,gs=un(0),Or=0,Wu=null,rl=0,od=0,v1=0,Yu=null,bn=null,m1=0,y1=1/0,Ea=null;function vs(){y1=dr()+500}var ld=!1,b1=null,no=null,sd=!1,io=null,ud=0,Ku=0,_1=null,cd=-1,fd=0;function Jr(){return mt&6?dr():cd!==-1?cd:cd=dr()}function ao(s){return s.mode&1?mt&2&&Gr!==0?Gr&-Gr:$S.transition!==null?(fd===0&&(fd=ts()),fd):(s=wt,s!==0?s:ke()):1}function ii(s,c,A,I){if(50<Ku)throw Ku=0,_1=null,Error(o(185));Dn(s,A,I),(!(mt&2)||s!==Ir)&&(s===Ir&&(!(mt&2)&&(od|=A),Or===4&&oo(s,Gr)),_n(s,I),A===1&&mt===0&&!(c.mode&1)&&(vs(),Si&&Vi()))}function _n(s,c){var A=s.callbackNode;O0(s,c);var I=Zo(s,s===Ir?Gr:0);if(I===0)A!==null&&Zn(A),s.callbackNode=null,s.callbackPriority=0;else if(c=I&-I,s.callbackPriority!==c){if(A!=null&&Zn(A),c===1)s.tag===0?GS(t3.bind(null,s)):P0(t3.bind(null,s)),fe?ie(function(){!(mt&6)&&Vi()}):eo(ns,Vi),A=null;else{switch(Af(I)){case 1:A=ns;break;case 4:A=x0;break;case 16:A=ne;break;case 536870912:A=Te;break;default:A=ne}A=c3(A,e3.bind(null,s))}s.callbackPriority=c,s.callbackNode=A}}function e3(s,c){if(cd=-1,fd=0,mt&6)throw Error(o(327));var A=s.callbackNode;if(al()&&s.callbackNode!==A)return null;var I=Zo(s,s===Ir?Gr:0);if(I===0)return null;if(I&30||I&s.expiredLanes||c)c=dd(s,I);else{c=I;var j=mt;mt|=2;var W=i3();(Ir!==s||Gr!==c)&&(Ea=null,vs(),nl(s,c));do try{fE();break}catch(le){n3(s,le)}while(!0);M0(),ad.current=W,mt=j,br!==null?c=0:(Ir=null,Gr=0,c=Or)}if(c!==0){if(c===2&&(j=Ja(s),j!==0&&(I=j,c=w1(s,j))),c===1)throw A=Wu,nl(s,0),oo(s,I),_n(s,dr()),A;if(c===6)oo(s,I);else{if(j=s.current.alternate,!(I&30)&&!uE(j)&&(c=dd(s,I),c===2&&(W=Ja(s),W!==0&&(I=W,c=w1(s,W))),c===1))throw A=Wu,nl(s,0),oo(s,I),_n(s,dr()),A;switch(s.finishedWork=j,s.finishedLanes=I,c){case 0:case 1:throw Error(o(345));case 2:il(s,bn,Ea);break;case 3:if(oo(s,I),(I&130023424)===I&&(c=m1+500-dr(),10<c)){if(Zo(s,0)!==0)break;if(j=s.suspendedLanes,(j&I)!==I){Jr(),s.pingedLanes|=s.suspendedLanes&j;break}s.timeoutHandle=G(il.bind(null,s,bn,Ea),c);break}il(s,bn,Ea);break;case 4:if(oo(s,I),(I&4194240)===I)break;for(c=s.eventTimes,j=-1;0<I;){var J=31-In(I);W=1<<J,J=c[J],J>j&&(j=J),I&=~W}if(I=j,I=dr()-I,I=(120>I?120:480>I?480:1080>I?1080:1920>I?1920:3e3>I?3e3:4320>I?4320:1960*sE(I/1960))-I,10<I){s.timeoutHandle=G(il.bind(null,s,bn,Ea),I);break}il(s,bn,Ea);break;case 5:il(s,bn,Ea);break;default:throw Error(o(329))}}}return _n(s,dr()),s.callbackNode===A?e3.bind(null,s):null}function w1(s,c){var A=Yu;return s.current.memoizedState.isDehydrated&&(nl(s,c).flags|=256),s=dd(s,c),s!==2&&(c=bn,bn=A,c!==null&&S1(c)),s}function S1(s){bn===null?bn=s:bn.push.apply(bn,s)}function uE(s){for(var c=s;;){if(c.flags&16384){var A=c.updateQueue;if(A!==null&&(A=A.stores,A!==null))for(var I=0;I<A.length;I++){var j=A[I],W=j.getSnapshot;j=j.value;try{if(!lr(W(),j))return!1}catch{return!1}}}if(A=c.child,c.subtreeFlags&16384&&A!==null)A.return=c,c=A;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function oo(s,c){for(c&=~v1,c&=~od,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var A=31-In(c),I=1<<A;s[A]=-1,c&=~I}}function t3(s){if(mt&6)throw Error(o(327));al();var c=Zo(s,0);if(!(c&1))return _n(s,dr()),null;var A=dd(s,c);if(s.tag!==0&&A===2){var I=Ja(s);I!==0&&(c=I,A=w1(s,I))}if(A===1)throw A=Wu,nl(s,0),oo(s,c),_n(s,dr()),A;if(A===6)throw Error(o(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,il(s,bn,Ea),_n(s,dr()),null}function r3(s){io!==null&&io.tag===0&&!(mt&6)&&al();var c=mt;mt|=1;var A=hr.transition,I=wt;try{if(hr.transition=null,wt=1,s)return s()}finally{wt=I,hr.transition=A,mt=c,!(mt&6)&&Vi()}}function E1(){jn=gs.current,Nt(gs)}function nl(s,c){s.finishedWork=null,s.finishedLanes=0;var A=s.timeoutHandle;if(A!==X&&(s.timeoutHandle=X,K(A)),br!==null)for(A=br.return;A!==null;){var I=A;switch(T0(I),I.tag){case 1:I=I.type.childContextTypes,I!=null&&wi();break;case 3:ds(),Nt(Ur),Nt(mr),U0();break;case 5:z0(I);break;case 4:ds();break;case 13:Nt(Jt);break;case 19:Nt(Jt);break;case 10:N0(I.type._context);break;case 22:case 23:E1()}A=A.return}if(Ir=s,br=s=lo(s.current,null),Gr=jn=c,Or=0,Wu=null,v1=od=rl=0,bn=Yu=null,el!==null){for(c=0;c<el.length;c++)if(A=el[c],I=A.interleaved,I!==null){A.interleaved=null;var j=I.next,W=A.pending;if(W!==null){var J=W.next;W.next=j,I.next=J}A.pending=I}el=null}return s}function n3(s,c){do{var A=br;try{if(M0(),Hf.current=qf,Gf){for(var I=er.memoizedState;I!==null;){var j=I.queue;j!==null&&(j.pending=null),I=I.next}Gf=!1}if(tl=0,Nr=Er=er=null,ju=!1,zu=0,g1.current=null,A===null||A.return===null){Or=1,Wu=c,br=null;break}e:{var W=s,J=A.return,le=A,me=c;if(c=Gr,le.flags|=32768,me!==null&&typeof me=="object"&&typeof me.then=="function"){var Re=me,Ve=le,lt=Ve.tag;if(!(Ve.mode&1)&&(lt===0||lt===11||lt===15)){var ze=Ve.alternate;ze?(Ve.updateQueue=ze.updateQueue,Ve.memoizedState=ze.memoizedState,Ve.lanes=ze.lanes):(Ve.updateQueue=null,Ve.memoizedState=null)}var Vt=Tb(J);if(Vt!==null){Vt.flags&=-257,Ab(Vt,J,le,W,c),Vt.mode&1&&Cb(W,Re,c),c=Vt,me=Re;var jt=c.updateQueue;if(jt===null){var wn=new Set;wn.add(me),c.updateQueue=wn}else jt.add(me);break e}else{if(!(c&1)){Cb(W,Re,c),O1();break e}me=Error(o(426))}}else if(Kt&&le.mode&1){var Oa=Tb(J);if(Oa!==null){!(Oa.flags&65536)&&(Oa.flags|=256),Ab(Oa,J,le,W,c),R0(hs(me,le));break e}}W=me=hs(me,le),Or!==4&&(Or=2),Yu===null?Yu=[W]:Yu.push(W),W=J;do{switch(W.tag){case 3:W.flags|=65536,c&=-c,W.lanes|=c;var ve=xb(W,me,c);Q2(W,ve);break e;case 1:le=me;var ce=W.type,_e=W.stateNode;if(!(W.flags&128)&&(typeof ce.getDerivedStateFromError=="function"||_e!==null&&typeof _e.componentDidCatch=="function"&&(no===null||!no.has(_e)))){W.flags|=65536,c&=-c,W.lanes|=c;var Be=Pb(W,le,c);Q2(W,Be);break e}}W=W.return}while(W!==null)}o3(A)}catch(rt){c=rt,br===A&&A!==null&&(br=A=A.return);continue}break}while(!0)}function i3(){var s=ad.current;return ad.current=qf,s===null?qf:s}function O1(){(Or===0||Or===3||Or===2)&&(Or=4),Ir===null||!(rl&268435455)&&!(od&268435455)||oo(Ir,Gr)}function dd(s,c){var A=mt;mt|=2;var I=i3();(Ir!==s||Gr!==c)&&(Ea=null,nl(s,c));do try{cE();break}catch(j){n3(s,j)}while(!0);if(M0(),mt=A,ad.current=I,br!==null)throw Error(o(261));return Ir=null,Gr=0,Or}function cE(){for(;br!==null;)a3(br)}function fE(){for(;br!==null&&!kf();)a3(br)}function a3(s){var c=u3(s.alternate,s,jn);s.memoizedProps=s.pendingProps,c===null?o3(s):br=c,g1.current=null}function o3(s){var c=s;do{var A=c.alternate;if(s=c.return,c.flags&32768){if(A=iE(A,c),A!==null){A.flags&=32767,br=A;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{Or=6,br=null;return}}else if(A=nE(A,c,jn),A!==null){br=A;return}if(c=c.sibling,c!==null){br=c;return}br=c=s}while(c!==null);Or===0&&(Or=5)}function il(s,c,A){var I=wt,j=hr.transition;try{hr.transition=null,wt=1,dE(s,c,A,I)}finally{hr.transition=j,wt=I}return null}function dE(s,c,A,I){do al();while(io!==null);if(mt&6)throw Error(o(327));A=s.finishedWork;var j=s.finishedLanes;if(A===null)return null;if(s.finishedWork=null,s.finishedLanes=0,A===s.current)throw Error(o(177));s.callbackNode=null,s.callbackPriority=0;var W=A.lanes|A.childLanes;if(Mu(s,W),s===Ir&&(br=Ir=null,Gr=0),!(A.subtreeFlags&2064)&&!(A.flags&2064)||sd||(sd=!0,c3(ne,function(){return al(),null})),W=(A.flags&15990)!==0,A.subtreeFlags&15990||W){W=hr.transition,hr.transition=null;var J=wt;wt=1;var le=mt;mt|=4,g1.current=null,oE(s,A),Yb(A,s),R(s.containerInfo),s.current=A,lE(A),Rf(),mt=le,wt=J,hr.transition=W}else s.current=A;if(sd&&(sd=!1,io=s,ud=j),W=s.pendingLanes,W===0&&(no=null),or(A.stateNode),_n(s,dr()),c!==null)for(I=s.onRecoverableError,A=0;A<c.length;A++)j=c[A],I(j.value,{componentStack:j.stack,digest:j.digest});if(ld)throw ld=!1,s=b1,b1=null,s;return ud&1&&s.tag!==0&&al(),W=s.pendingLanes,W&1?s===_1?Ku++:(Ku=0,_1=s):Ku=0,Vi(),null}function al(){if(io!==null){var s=Af(ud),c=hr.transition,A=wt;try{if(hr.transition=null,wt=16>s?16:s,io===null)var I=!1;else{if(s=io,io=null,ud=0,mt&6)throw Error(o(331));var j=mt;for(mt|=4,Ge=s.current;Ge!==null;){var W=Ge,J=W.child;if(Ge.flags&16){var le=W.deletions;if(le!==null){for(var me=0;me<le.length;me++){var Re=le[me];for(Ge=Re;Ge!==null;){var Ve=Ge;switch(Ve.tag){case 0:case 11:case 15:Vu(8,Ve,W)}var lt=Ve.child;if(lt!==null)lt.return=Ve,Ge=lt;else for(;Ge!==null;){Ve=Ge;var ze=Ve.sibling,Vt=Ve.return;if($b(Ve),Ve===Re){Ge=null;break}if(ze!==null){ze.return=Vt,Ge=ze;break}Ge=Vt}}}var jt=W.alternate;if(jt!==null){var wn=jt.child;if(wn!==null){jt.child=null;do{var Oa=wn.sibling;wn.sibling=null,wn=Oa}while(wn!==null)}}Ge=W}}if(W.subtreeFlags&2064&&J!==null)J.return=W,Ge=J;else e:for(;Ge!==null;){if(W=Ge,W.flags&2048)switch(W.tag){case 0:case 11:case 15:Vu(9,W,W.return)}var ve=W.sibling;if(ve!==null){ve.return=W.return,Ge=ve;break e}Ge=W.return}}var ce=s.current;for(Ge=ce;Ge!==null;){J=Ge;var _e=J.child;if(J.subtreeFlags&2064&&_e!==null)_e.return=J,Ge=_e;else e:for(J=ce;Ge!==null;){if(le=Ge,le.flags&2048)try{switch(le.tag){case 0:case 11:case 15:Jf(9,le)}}catch(rt){Xt(le,le.return,rt)}if(le===J){Ge=null;break e}var Be=le.sibling;if(Be!==null){Be.return=le.return,Ge=Be;break e}Ge=le.return}}if(mt=j,Vi(),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Ne,s)}catch{}I=!0}return I}finally{wt=A,hr.transition=c}}return!1}function l3(s,c,A){c=hs(A,c),c=xb(s,c,1),s=ro(s,c,1),c=Jr(),s!==null&&(Dn(s,1,c),_n(s,c))}function Xt(s,c,A){if(s.tag===3)l3(s,s,A);else for(;c!==null;){if(c.tag===3){l3(c,s,A);break}else if(c.tag===1){var I=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof I.componentDidCatch=="function"&&(no===null||!no.has(I))){s=hs(A,s),s=Pb(c,s,1),c=ro(c,s,1),s=Jr(),c!==null&&(Dn(c,1,s),_n(c,s));break}}c=c.return}}function hE(s,c,A){var I=s.pingCache;I!==null&&I.delete(c),c=Jr(),s.pingedLanes|=s.suspendedLanes&A,Ir===s&&(Gr&A)===A&&(Or===4||Or===3&&(Gr&130023424)===Gr&&500>dr()-m1?nl(s,0):v1|=A),_n(s,c)}function s3(s,c){c===0&&(s.mode&1?(c=Xo,Xo<<=1,!(Xo&130023424)&&(Xo=4194304)):c=1);var A=Jr();s=qi(s,c),s!==null&&(Dn(s,c,A),_n(s,A))}function pE(s){var c=s.memoizedState,A=0;c!==null&&(A=c.retryLane),s3(s,A)}function gE(s,c){var A=0;switch(s.tag){case 13:var I=s.stateNode,j=s.memoizedState;j!==null&&(A=j.retryLane);break;case 19:I=s.stateNode;break;default:throw Error(o(314))}I!==null&&I.delete(c),s3(s,A)}var u3;u3=function(s,c,A){if(s!==null)if(s.memoizedProps!==c.pendingProps||Ur.current)yn=!0;else{if(!(s.lanes&A)&&!(c.flags&128))return yn=!1,rE(s,c,A);yn=!!(s.flags&131072)}else yn=!1,Kt&&c.flags&1048576&&U2(c,Mf,c.index);switch(c.lanes=0,c.tag){case 2:var I=c.type;Kf(s,c),s=c.pendingProps;var j=_i(c,mr.current);cs(c,A),j=$0(null,c,I,s,j,A);var W=V0();return c.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Yt(I)?(W=!0,Jl(c)):W=!1,c.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,F0(c),j.updater=Wf,c.stateNode=j,j._reactInternals=c,Z0(c,I,s,A),c=t1(null,c,I,!0,W,A)):(c.tag=0,Kt&&W&&C0(c),cn(null,c,j,A),c=c.child),c;case 16:I=c.elementType;e:{switch(Kf(s,c),s=c.pendingProps,j=I._init,I=j(I._payload),c.type=I,j=c.tag=mE(I),s=Oi(I,s),j){case 0:c=e1(null,c,I,s,A);break e;case 1:c=Ib(null,c,I,s,A);break e;case 11:c=kb(null,c,I,s,A);break e;case 14:c=Rb(null,c,I,Oi(I.type,s),A);break e}throw Error(o(306,I,""))}return c;case 0:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:Oi(I,j),e1(s,c,I,j,A);case 1:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:Oi(I,j),Ib(s,c,I,j,A);case 3:e:{if(Db(c),s===null)throw Error(o(387));I=c.pendingProps,W=c.memoizedState,j=W.element,Z2(s,c),Bf(c,I,null,A);var J=c.memoizedState;if(I=J.element,ae&&W.isDehydrated)if(W={element:I,isDehydrated:!1,cache:J.cache,pendingSuspenseBoundaries:J.pendingSuspenseBoundaries,transitions:J.transitions},c.updateQueue.baseState=W,c.memoizedState=W,c.flags&256){j=hs(Error(o(423)),c),c=Fb(s,c,I,A,j);break e}else if(I!==j){j=hs(Error(o(424)),c),c=Fb(s,c,I,A,j);break e}else for(ae&&(ei=ht(c.stateNode.containerInfo),Fn=c,Kt=!0,Ei=null,Nu=!1),A=Y2(c,null,I,A),c.child=A;A;)A.flags=A.flags&-3|4096,A=A.sibling;else{if(ls(),I===j){c=Sa(s,c,A);break e}cn(s,c,I,A)}c=c.child}return c;case 5:return eb(c),s===null&&k0(c),I=c.type,j=c.pendingProps,W=s!==null?s.memoizedProps:null,J=j.children,Y(I,j)?J=null:W!==null&&Y(I,W)&&(c.flags|=32),Nb(s,c),cn(s,c,J,A),c.child;case 6:return s===null&&k0(c),null;case 13:return jb(s,c,A);case 4:return j0(c,c.stateNode.containerInfo),I=c.pendingProps,s===null?c.child=ss(c,null,I,A):cn(s,c,I,A),c.child;case 11:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:Oi(I,j),kb(s,c,I,j,A);case 7:return cn(s,c,c.pendingProps,A),c.child;case 8:return cn(s,c,c.pendingProps.children,A),c.child;case 12:return cn(s,c,c.pendingProps.children,A),c.child;case 10:e:{if(I=c.type._context,j=c.pendingProps,W=c.memoizedProps,J=j.value,K2(c,I,J),W!==null)if(lr(W.value,J)){if(W.children===j.children&&!Ur.current){c=Sa(s,c,A);break e}}else for(W=c.child,W!==null&&(W.return=c);W!==null;){var le=W.dependencies;if(le!==null){J=W.child;for(var me=le.firstContext;me!==null;){if(me.context===I){if(W.tag===1){me=wa(-1,A&-A),me.tag=2;var Re=W.updateQueue;if(Re!==null){Re=Re.shared;var Ve=Re.pending;Ve===null?me.next=me:(me.next=Ve.next,Ve.next=me),Re.pending=me}}W.lanes|=A,me=W.alternate,me!==null&&(me.lanes|=A),I0(W.return,A,c),le.lanes|=A;break}me=me.next}}else if(W.tag===10)J=W.type===c.type?null:W.child;else if(W.tag===18){if(J=W.return,J===null)throw Error(o(341));J.lanes|=A,le=J.alternate,le!==null&&(le.lanes|=A),I0(J,A,c),J=W.sibling}else J=W.child;if(J!==null)J.return=W;else for(J=W;J!==null;){if(J===c){J=null;break}if(W=J.sibling,W!==null){W.return=J.return,J=W;break}J=J.return}W=J}cn(s,c,j.children,A),c=c.child}return c;case 9:return j=c.type,I=c.pendingProps.children,cs(c,A),j=ti(j),I=I(j),c.flags|=1,cn(s,c,I,A),c.child;case 14:return I=c.type,j=Oi(I,c.pendingProps),j=Oi(I.type,j),Rb(s,c,I,j,A);case 15:return Lb(s,c,c.type,c.pendingProps,A);case 17:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:Oi(I,j),Kf(s,c),c.tag=1,Yt(I)?(s=!0,Jl(c)):s=!1,cs(c,A),Eb(c,I,j),Z0(c,I,j,A),t1(null,c,I,!0,s,A);case 19:return Bb(s,c,A);case 22:return Mb(s,c,A)}throw Error(o(156,c.tag))};function c3(s,c){return eo(s,c)}function vE(s,c,A,I){this.tag=s,this.key=A,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=I,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(s,c,A,I){return new vE(s,c,A,I)}function x1(s){return s=s.prototype,!(!s||!s.isReactComponent)}function mE(s){if(typeof s=="function")return x1(s)?1:0;if(s!=null){if(s=s.$$typeof,s===y)return 11;if(s===g)return 14}return 2}function lo(s,c){var A=s.alternate;return A===null?(A=ai(s.tag,c,s.key,s.mode),A.elementType=s.elementType,A.type=s.type,A.stateNode=s.stateNode,A.alternate=s,s.alternate=A):(A.pendingProps=c,A.type=s.type,A.flags=0,A.subtreeFlags=0,A.deletions=null),A.flags=s.flags&14680064,A.childLanes=s.childLanes,A.lanes=s.lanes,A.child=s.child,A.memoizedProps=s.memoizedProps,A.memoizedState=s.memoizedState,A.updateQueue=s.updateQueue,c=s.dependencies,A.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},A.sibling=s.sibling,A.index=s.index,A.ref=s.ref,A}function hd(s,c,A,I,j,W){var J=2;if(I=s,typeof s=="function")x1(s)&&(J=1);else if(typeof s=="string")J=5;else e:switch(s){case v:return ol(A.children,j,W,c);case w:J=8,j|=8;break;case b:return s=ai(12,A,c,j|2),s.elementType=b,s.lanes=W,s;case m:return s=ai(13,A,c,j),s.elementType=m,s.lanes=W,s;case p:return s=ai(19,A,c,j),s.elementType=p,s.lanes=W,s;case _:return pd(A,j,W,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case h:J=10;break e;case E:J=9;break e;case y:J=11;break e;case g:J=14;break e;case d:J=16,I=null;break e}throw Error(o(130,s==null?s:typeof s,""))}return c=ai(J,A,c,j),c.elementType=s,c.type=I,c.lanes=W,c}function ol(s,c,A,I){return s=ai(7,s,I,c),s.lanes=A,s}function pd(s,c,A,I){return s=ai(22,s,I,c),s.elementType=_,s.lanes=A,s.stateNode={isHidden:!1},s}function P1(s,c,A){return s=ai(6,s,null,c),s.lanes=A,s}function C1(s,c,A){return c=ai(4,s.children!==null?s.children:[],s.key,c),c.lanes=A,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function yE(s,c,A,I,j){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=X,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Lu(0),this.expirationTimes=Lu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lu(0),this.identifierPrefix=I,this.onRecoverableError=j,ae&&(this.mutableSourceEagerHydrationData=null)}function f3(s,c,A,I,j,W,J,le,me){return s=new yE(s,c,A,le,me),c===1?(c=1,W===!0&&(c|=8)):c=0,W=ai(3,null,null,c),s.current=W,W.stateNode=s,W.memoizedState={element:I,isDehydrated:A,cache:null,transitions:null,pendingSuspenseBoundaries:null},F0(W),s}function d3(s){if(!s)return bi;s=s._reactInternals;e:{if(x(s)!==s||s.tag!==1)throw Error(o(170));var c=s;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Yt(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(o(171))}if(s.tag===1){var A=s.type;if(Yt(A))return Ql(s,A,c)}return c}function h3(s){var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(o(188)):(s=Object.keys(s).join(","),Error(o(268,s)));return s=L(c),s===null?null:s.stateNode}function p3(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var A=s.retryLane;s.retryLane=A!==0&&A<c?A:c}}function gd(s,c){p3(s,c),(s=s.alternate)&&p3(s,c)}function bE(s){return s=L(s),s===null?null:s.stateNode}function _E(){return null}return r.attemptContinuousHydration=function(s){if(s.tag===13){var c=qi(s,134217728);if(c!==null){var A=Jr();ii(c,s,134217728,A)}gd(s,134217728)}},r.attemptDiscreteHydration=function(s){if(s.tag===13){var c=qi(s,1);if(c!==null){var A=Jr();ii(c,s,1,A)}gd(s,1)}},r.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var c=ao(s),A=qi(s,c);if(A!==null){var I=Jr();ii(A,s,c,I)}gd(s,c)}},r.attemptSynchronousHydration=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var A=ya(c.pendingLanes);A!==0&&(rs(c,A|1),_n(c,dr()),!(mt&6)&&(vs(),Vi()))}break;case 13:r3(function(){var I=qi(s,1);if(I!==null){var j=Jr();ii(I,s,1,j)}}),gd(s,1)}},r.batchedUpdates=function(s,c){var A=mt;mt|=1;try{return s(c)}finally{mt=A,mt===0&&(vs(),Si&&Vi())}},r.createComponentSelector=function(s){return{$$typeof:ed,value:s}},r.createContainer=function(s,c,A,I,j,W,J){return f3(s,c,!1,null,A,I,j,W,J)},r.createHasPseudoClassSelector=function(s){return{$$typeof:td,value:s}},r.createHydrationContainer=function(s,c,A,I,j,W,J,le,me){return s=f3(A,I,!0,s,j,W,J,le,me),s.context=d3(null),A=s.current,I=Jr(),j=ao(A),W=wa(I,j),W.callback=c??null,ro(A,W,j),s.current.lanes=j,Dn(s,j,I),_n(s,I),s},r.createPortal=function(s,c,A){var I=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:I==null?null:""+I,children:s,containerInfo:c,implementation:A}},r.createRoleSelector=function(s){return{$$typeof:rd,value:s}},r.createTestNameSelector=function(s){return{$$typeof:nd,value:s}},r.createTextSelector=function(s){return{$$typeof:id,value:s}},r.deferredUpdates=function(s){var c=wt,A=hr.transition;try{return hr.transition=null,wt=16,s()}finally{wt=c,hr.transition=A}},r.discreteUpdates=function(s,c,A,I,j){var W=wt,J=hr.transition;try{return hr.transition=null,wt=1,s(c,A,I,j)}finally{wt=W,hr.transition=J,mt===0&&vs()}},r.findAllNodes=p1,r.findBoundingRects=function(s,c){if(!ge)throw Error(o(363));c=p1(s,c),s=[];for(var A=0;A<c.length;A++)s.push(re(c[A]));for(c=s.length-1;0<c;c--){A=s[c];for(var I=A.x,j=I+A.width,W=A.y,J=W+A.height,le=c-1;0<=le;le--)if(c!==le){var me=s[le],Re=me.x,Ve=Re+me.width,lt=me.y,ze=lt+me.height;if(I>=Re&&W>=lt&&j<=Ve&&J<=ze){s.splice(c,1);break}else if(I!==Re||A.width!==me.width||ze<W||lt>J){if(!(W!==lt||A.height!==me.height||Ve<I||Re>j)){Re>I&&(me.width+=Re-I,me.x=I),Ve<j&&(me.width=j-Re),s.splice(c,1);break}}else{lt>W&&(me.height+=lt-W,me.y=W),ze<J&&(me.height=J-lt),s.splice(c,1);break}}}return s},r.findHostInstance=h3,r.findHostInstanceWithNoPortals=function(s){return s=T(s),s=s!==null?U(s):null,s===null?null:s.stateNode},r.findHostInstanceWithWarning=function(s){return h3(s)},r.flushControlled=function(s){var c=mt;mt|=1;var A=hr.transition,I=wt;try{hr.transition=null,wt=1,s()}finally{wt=I,hr.transition=A,mt=c,mt===0&&(vs(),Vi())}},r.flushPassiveEffects=al,r.flushSync=r3,r.focusWithin=function(s,c){if(!ge)throw Error(o(363));for(s=f1(s),c=Jb(s,c),c=Array.from(c),s=0;s<c.length;){var A=c[s++];if(!be(A)){if(A.tag===5&&Ie(A.stateNode))return!0;for(A=A.child;A!==null;)c.push(A),A=A.sibling}}return!1},r.getCurrentUpdatePriority=function(){return wt},r.getFindAllNodesFailureDescription=function(s,c){if(!ge)throw Error(o(363));var A=0,I=[];s=[f1(s),0];for(var j=0;j<s.length;){var W=s[j++],J=s[j++],le=c[J];if((W.tag!==5||!be(W))&&(d1(W,le)&&(I.push(h1(le)),J++,J>A&&(A=J)),J<c.length))for(W=W.child;W!==null;)s.push(W,J),W=W.sibling}if(A<c.length){for(s=[];A<c.length;A++)s.push(h1(c[A]));return`findAllNodes was able to match part of the selector:
58
+ `+(I.join(" > ")+`
59
+
60
+ No matching component was found for:
61
+ `)+s.join(" > ")}return null},r.getPublicRootInstance=function(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return Z(s.child.stateNode);default:return s.child.stateNode}},r.injectIntoDevTools=function(s){if(s={bundleType:s.bundleType,version:s.version,rendererPackageName:s.rendererPackageName,rendererConfig:s.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:bE,findFiberByHostInstance:s.findFiberByHostInstance||_E,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")s=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)s=!0;else{try{Ne=c.inject(s),ft=c}catch{}s=!!c.checkDCE}}return s},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(s,c,A,I){if(!ge)throw Error(o(363));s=p1(s,c);var j=Ee(s,A,I).disconnect;return{disconnect:function(){j()}}},r.registerMutableSourceForHydration=function(s,c){var A=c._getVersion;A=A(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,A]:s.mutableSourceEagerHydrationData.push(c,A)},r.runWithPriority=function(s,c){var A=wt;try{return wt=s,c()}finally{wt=A}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(s,c,A,I){var j=c.current,W=Jr(),J=ao(j);return A=d3(A),c.context===null?c.context=A:c.pendingContext=A,c=wa(W,J),c.payload={element:s},I=I===void 0?null:I,I!==null&&(c.callback=I),s=ro(j,c,J),s!==null&&(ii(s,j,J,W),zf(s,j,J)),J},r};Q9.exports=mL;var yL=Q9.exports;const bL=Kh(yL);var J9={exports:{}},$l={};/**
62
+ * @license React
63
+ * react-reconciler-constants.production.min.js
64
+ *
65
+ * Copyright (c) Facebook, Inc. and its affiliates.
66
+ *
67
+ * This source code is licensed under the MIT license found in the
68
+ * LICENSE file in the root directory of this source tree.
69
+ */$l.ConcurrentRoot=1;$l.ContinuousEventPriority=4;$l.DefaultEventPriority=16;$l.DiscreteEventPriority=1;$l.IdleEventPriority=536870912;$l.LegacyRoot=0;J9.exports=$l;var e7=J9.exports;const _4={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let w4=!1,S4=!1;const p2=".react-konva-event";let t7=!1;function _L(e){t7=e}const wL=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
70
+ Position of a node will be changed during drag&drop, so you should update state of the react app as well.
71
+ Consider to add onDragMove or onDragEnd events.
72
+ For more info see: https://github.com/konvajs/react-konva/issues/256
73
+ `,SL=`ReactKonva: You are using "zIndex" attribute for a Konva node.
74
+ react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
75
+ For more info see: https://github.com/konvajs/react-konva/issues/194
76
+ `,EL={};function p0(e,t,r=EL){if(!w4&&"zIndex"in t&&(console.warn(SL),w4=!0),!S4&&t.draggable){var n=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;n&&!i&&(console.warn(wL),S4=!0)}for(var a in r)if(!_4[a]){var o=a.slice(0,2)==="on",l=r[a]!==t[a];if(o&&l){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,r[a])}var f=!t.hasOwnProperty(a);f&&e.setAttr(a,void 0)}var v=t7||t._useStrictMode,w={},b=!1;const h={};for(var a in t)if(!_4[a]){var o=a.slice(0,2)==="on",E=r[a]!==t[a];if(o&&E){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[a]&&(h[u]=t[a])}!o&&(t[a]!==r[a]||v&&t[a]!==e.getAttr(a))&&(b=!0,w[a]=t[a])}b&&(e.setAttrs(w),Wo(e));for(var u in h)e.on(u+p2,h[u])}function Wo(e){if(!gt.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const r7={},OL={};Kc.Node.prototype._applyProps=p0;function xL(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),Wo(e)}function PL(e,t,r){let n=Kc[e];n||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),n=Kc.Group);const i={},a={};for(var o in t){var l=o.slice(0,2)==="on";l?a[o]=t[o]:i[o]=t[o]}const u=new n(i);return p0(u,a),u}function CL(e,t,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function TL(e,t,r){return!1}function AL(e){return e}function kL(){return null}function RL(){return null}function LL(e,t,r,n){return OL}function ML(){}function NL(e){}function IL(e,t){return!1}function DL(){return r7}function FL(){return r7}const jL=setTimeout,zL=clearTimeout,BL=-1;function UL(e,t){return!1}const HL=!1,GL=!0,$L=!0;function VL(e,t){t.parent===e?t.moveToTop():e.add(t),Wo(e)}function qL(e,t){t.parent===e?t.moveToTop():e.add(t),Wo(e)}function n7(e,t,r){t._remove(),e.add(t),t.setZIndex(r.getZIndex()),Wo(e)}function WL(e,t,r){n7(e,t,r)}function YL(e,t){t.destroy(),t.off(p2),Wo(e)}function KL(e,t){t.destroy(),t.off(p2),Wo(e)}function XL(e,t,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function ZL(e,t,r){}function QL(e,t,r,n,i){p0(e,i,n)}function JL(e){e.hide(),Wo(e)}function eM(e){}function tM(e,t){(t.visible==null||t.visible)&&e.show()}function rM(e,t){}function nM(e){}function iM(){}const aM=()=>e7.DefaultEventPriority,oM=Object.freeze(Object.defineProperty({__proto__:null,appendChild:VL,appendChildToContainer:qL,appendInitialChild:xL,cancelTimeout:zL,clearContainer:nM,commitMount:ZL,commitTextUpdate:XL,commitUpdate:QL,createInstance:PL,createTextInstance:CL,detachDeletedInstance:iM,finalizeInitialChildren:TL,getChildHostContext:FL,getCurrentEventPriority:aM,getPublicInstance:AL,getRootHostContext:DL,hideInstance:JL,hideTextInstance:eM,idlePriority:hc.unstable_IdlePriority,insertBefore:n7,insertInContainerBefore:WL,isPrimaryRenderer:HL,noTimeout:BL,now:hc.unstable_now,prepareForCommit:kL,preparePortalMount:RL,prepareUpdate:LL,removeChild:YL,removeChildFromContainer:KL,resetAfterCommit:ML,resetTextContent:NL,run:hc.unstable_runWithPriority,scheduleTimeout:jL,shouldDeprioritizeSubtree:IL,shouldSetTextContent:UL,supportsMutation:$L,unhideInstance:tM,unhideTextInstance:rM,warnsIfNotActing:GL},Symbol.toStringTag,{value:"Module"}));var lM=Object.defineProperty,sM=Object.defineProperties,uM=Object.getOwnPropertyDescriptors,E4=Object.getOwnPropertySymbols,cM=Object.prototype.hasOwnProperty,fM=Object.prototype.propertyIsEnumerable,O4=(e,t,r)=>t in e?lM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x4=(e,t)=>{for(var r in t||(t={}))cM.call(t,r)&&O4(e,r,t[r]);if(E4)for(var r of E4(t))fM.call(t,r)&&O4(e,r,t[r]);return e},dM=(e,t)=>sM(e,uM(t)),P4,C4;typeof window<"u"&&((P4=window.document)!=null&&P4.createElement||((C4=window.navigator)==null?void 0:C4.product)==="ReactNative")?at.useLayoutEffect:at.useEffect;function i7(e,t,r){if(!e)return;if(r(e)===!0)return e;let n=e.child;for(;n;){const i=i7(n,t,r);if(i)return i;n=n.sibling}}function a7(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const T4=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=T4;return}return T4.apply(this,arguments)};const g2=a7(at.createContext(null));class o7 extends at.Component{render(){return at.createElement(g2.Provider,{value:this._reactInternals},this.props.children)}}function hM(){const e=at.useContext(g2);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=at.useId();return at.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const i=i7(n,!1,a=>{let o=a.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}});if(i)return i}},[e,t])}function pM(){const e=hM(),[t]=at.useState(()=>new Map);t.clear();let r=e;for(;r;){if(r.type&&typeof r.type=="object"){const i=r.type._context===void 0&&r.type.Provider===r.type?r.type:r.type._context;i&&i!==g2&&!t.has(i)&&t.set(i,at.useContext(a7(i)))}r=r.return}return t}function l7(){const e=pM();return at.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>n=>at.createElement(t,null,at.createElement(r.Provider,dM(x4({},n),{value:e.get(r)}))),t=>at.createElement(o7,x4({},t))),[e])}function gM(e){const t=yt.useRef({});return yt.useLayoutEffect(()=>{t.current=e}),yt.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const vM=e=>{const t=yt.useRef(),r=yt.useRef(),n=yt.useRef(),i=gM(e),a=l7(),o=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return yt.useLayoutEffect(()=>(r.current=new Kc.Stage({width:e.width,height:e.height,container:t.current}),o(r.current),n.current=Fs.createContainer(r.current,e7.LegacyRoot,!1,null),Fs.updateContainer(yt.createElement(a,{},e.children),n.current),()=>{Kc.isBrowser&&(o(null),Fs.updateContainer(null,n.current,null),r.current.destroy())}),[]),yt.useLayoutEffect(()=>{o(r.current),p0(r.current,e,i),Fs.updateContainer(yt.createElement(a,{},e.children),n.current,null)}),yt.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},mM="Layer",yM="FastLayer",Vh="Group",bM="Label",_M="Rect",wM="Circle",SM="Ellipse",EM="Wedge",OM="Line",xM="Sprite",PM="Image",CM="Text",TM="TextPath",AM="Star",kM="Ring",RM="Arc",LM="Tag",MM="Path",NM="RegularPolygon",IM="Arrow",DM="Shape",FM="Transformer",Fs=bL(oM);Fs.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:yt.version,rendererPackageName:"react-konva"});const jM=yt.forwardRef((e,t)=>yt.createElement(o7,{},yt.createElement(vM,{...e,forwardedRef:t}))),zM=_L,BM=Object.freeze(Object.defineProperty({__proto__:null,Arc:RM,Arrow:IM,Circle:wM,Ellipse:SM,FastLayer:yM,Group:Vh,Image:PM,KonvaRenderer:Fs,Label:bM,Layer:mM,Line:OM,Path:MM,Rect:_M,RegularPolygon:NM,Ring:kM,Shape:DM,Sprite:xM,Stage:jM,Star:AM,Tag:LM,Text:CM,TextPath:TM,Transformer:FM,Wedge:EM,useStrictMode:zM},Symbol.toStringTag,{value:"Module"})),Wa=Do(BM);var sl=at,g0=function(t,r,n){const i=sl.useRef("loading"),a=sl.useRef(),[o,l]=sl.useState(0),u=sl.useRef(),f=sl.useRef(),v=sl.useRef();return(u.current!==t||f.current!==r||v.current!==n)&&(i.current="loading",a.current=void 0,u.current=t,f.current=r,v.current=n),sl.useLayoutEffect(function(){if(!t)return;var w=document.createElement("img");function b(){i.current="loaded",a.current=w,l(Math.random())}function h(){i.current="failed",a.current=void 0,l(Math.random())}return w.addEventListener("load",b),w.addEventListener("error",h),r&&(w.crossOrigin=r),n&&(w.referrerPolicy=n),w.src=t,function(){w.removeEventListener("load",b),w.removeEventListener("error",h)}},[t,r,n]),[a.current,i.current]};const UM=Kh(g0);var s7={},v2={},HM=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const GM=e=>{const t=window.getComputedStyle(e).position;return!(t==="absolute"||t==="relative")};function u7(e=()=>{}){const t=yt.useRef(e);return t.current=e,yt.useCallback((...r)=>t.current.apply(null,r),[])}const $M=({children:e,groupProps:t,divProps:r,transform:n,transformFunc:i})=>{const a=l7(),o=yt.useRef(null);yt.useRef();const[l]=yt.useState(()=>document.createElement("div")),u=yt.useMemo(()=>oh.createRoot(l),[l]),f=n??!0,v=u7(()=>{if(f&&o.current){let y=o.current.getAbsoluteTransform().decompose();i&&(y=i(y)),l.style.position="absolute",l.style.zIndex="10",l.style.top="0px",l.style.left="0px",l.style.transform=`translate(${y.x}px, ${y.y}px) rotate(${y.rotation}deg) scaleX(${y.scaleX}) scaleY(${y.scaleY})`,l.style.transformOrigin="top left"}else l.style.position="",l.style.zIndex="",l.style.top="",l.style.left="",l.style.transform="",l.style.transformOrigin="";const w=r||{},{style:b}=w,h=HM(w,["style"]);Object.assign(l.style,b),Object.assign(l,h)});return yt.useLayoutEffect(()=>{var w;const b=o.current;if(!b)return;const h=(w=b.getStage())===null||w===void 0?void 0:w.container();if(h)return h.appendChild(l),f&&GM(h)&&(h.style.position="relative"),b.on("absoluteTransformChange",v),v(),()=>{var E;b.off("absoluteTransformChange",v),(E=l.parentNode)===null||E===void 0||E.removeChild(l)}},[f]),yt.useLayoutEffect(()=>{v()},[r,i]),yt.useLayoutEffect(()=>{u.render(yt.createElement(a,null,e))}),yt.useLayoutEffect(()=>()=>{setTimeout(()=>{u.unmount()})},[]),yt.createElement(Vh,Object.assign({ref:o},t))},VM=({selector:e,enabled:t,children:r})=>{const n=yt.useRef(null),i=yt.useRef(null),a=yt.useRef(),o=t??!0;return yt.useLayoutEffect(()=>{if(!n.current||!i.current)return;a.current=i.current;const u=n.current.getStage().findOne(e);o&&u?i.current.moveTo(u):i.current.moveTo(n.current);const f=n.current.getLayer();if(f&&(f.batchDraw(),u)){const v=u.getLayer();if(!v)return;v.batchDraw()}},[e,o]),yt.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.destroy()},[]),yt.createElement(Vh,{name:"_outer_portal",ref:n},yt.createElement(Vh,{name:"_inner_portal",ref:i},r))},qM=Object.freeze(Object.defineProperty({__proto__:null,Html:$M,Portal:VM,useEvent:u7,useImage:UM},Symbol.toStringTag,{value:"Module"})),Sf=Do(qM);function WM(e,t){return Object.keys(e.values).forEach(r=>e.values[r]=e.values[r]&&parseFloat(e.values[r].toFixed(t))),e}function c7(e,t,r){const n=t-1,i=r[d7(n,r.length)];return i.marker!=="Z"?i:c7(e,n,r)}function f7(e,t,r){const n=t+1,i=r[d7(n,r.length)];return i.marker==="Z"?f7(e,n,r):i}function YM(e,t,r){let n=r[t-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"L":case"A":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"H":e.marker="L",e.values.x+=n.values.x,e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x,e.values.y+=n.values.y;break;case"C":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"S":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"Q":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y;break;case"T":e.values.x+=n.values.x,e.values.y+=n.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x;break}if(e.marker==="Z"){let a=function(l,u){return l[u].marker==="M"?l[u]:a(l,u-1)};var i=a;let o=a(r,t);e.values.x=o.values.x,e.values.y=o.values.y}return e}function KM(e,t){const r=[];switch(e.toUpperCase()){case"M":for(let n=0;n<t.length;n+=2){let i;e===e.toUpperCase()?i=n===0?"M":"L":i=n===0?"m":"l",r.push({marker:i,values:{x:t[n],y:t[n+1]}})}break;case"L":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"H":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:t[n],y:0}});break;case"V":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:0,y:t[n]}});break;case"C":for(let n=0;n<t.length;n+=6)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x2:t[n+2],y2:t[n+3],x:t[n+4],y:t[n+5]}});break;case"S":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x2:t[n],y2:t[n+1],x:t[n+2],y:t[n+3]}});break;case"Q":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x:t[n+2],y:t[n+3]}});break;case"T":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"A":for(let n=0;n<t.length;n+=7)r.push({marker:e,values:{radiusX:t[n],radiusY:t[n+1],rotation:t[n+2],largeArc:t[n+3],sweep:t[n+4],x:t[n+5],y:t[n+6]}});break;case"Z":r.push({marker:e,values:{x:0,y:0}});break}return r}function d7(e,t){return(e%t+t)%t}function XM(e,t,r){if(t!==0&&e.marker==="L"){let n=r[t-1];["x","y"].every(a=>Math.round(Math.abs(n.values[a]-e.values[a]))===0)&&(e.overlap=!0)}return e}function Nm(e,t){const r=["x","y"].every(n=>Math.round(Math.abs(e[t].values[n]-e[0].values[n]))===0);e[t].marker==="L"&&r&&(e[t].overlap=!0,Nm(e,t-1)),e[t].marker==="Z"&&Nm(e,t-1)}function ZM(e,t,r){const n=k4(e.values,r.values),i=k4(t.values,e.values);return Math.min(i,n)}function A4(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function k4(e,t){const r=e.x-t.x,n=e.y-t.y;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2))}function R4(e,t){return Math.sin(e)*t}function L4(e,t){return Math.cos(e)*t}function M4(e,t){const r=t/Math.tan(e);return r===1/0||r===-1/0||isNaN(r)?t:r}function QM(e,t){return t*Math.tan(e)}function JM(e,t){let r,n=0,i=e*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=M4(e/2,-t):(r=M4(e/2,t),n=1,r===1/0&&(r=t)),{offset:r,sweepFlag:n}}function eN(e){const t=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(r=>{let n="";if(r.marker!=="Z"){const i=Object.keys(r.values);n=t.filter(a=>i.indexOf(a)!==-1).map(a=>r.values[a]).join()}return`${r.marker}${n}`}).join("").trim()}function h7(e){const t=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,r=/-?[0-9]*\.?\d+/g;return[...e.matchAll(t)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,i)=>{const a=e.substring(i.index,n.length?n[n.length-1].index:e.length);return n.concat([{marker:i.marker,index:i.index,chunk:a.length>0?a.substr(1,a.length-1):a}])},[]).reverse().flatMap(n=>{const i=n.chunk.match(r),a=i?i.map(parseFloat):[];return KM(n.marker,a)}).map(YM)}function p7(e,t,r){let n=[],i=[];return r&&e.forEach(a=>WM(a,r)),e.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(XM),Nm(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(l=>!l.overlap).map((l,u,f)=>{const w=c7(l,u,f),b=f7(l,u,f),h=A4(l.values,w.values),E=A4(l.values,b.values),y=E-h,m=y*(180/Math.PI),p=ZM(l,w,b),g=Math.abs(QM(y/2,p/2)),d=Math.min(t,g),_=JM(y,d),O=_.offset,k=_.sweepFlag,C=(u==0||u==f.length-1)&&!o;switch(l.marker){case"M":case"L":const S=[l.values.x+R4(h,O),l.values.y+L4(h,O)],x=[l.values.x+R4(E,O),l.values.y+L4(E,O)];C?i.push({marker:l.marker,values:l.values}):i.push({marker:l.marker,values:{x:parseFloat(S[0].toFixed(3)),y:parseFloat(S[1].toFixed(3))}}),!C&&(b.marker==="L"||b.marker==="M")&&i.push({marker:"A",radius:d,values:{radiusX:parseFloat(d.toFixed(3)),radiusY:parseFloat(d.toFixed(3)),rotation:m,largeArc:0,sweep:k,x:parseFloat(x[0].toFixed(3)),y:parseFloat(x[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":i.push({marker:l.marker,values:l.values});break}})}),{path:eN(i),commands:i}}function tN(e,t,r){return p7([...h7(e)],t,r)}const rN=Object.freeze(Object.defineProperty({__proto__:null,parsePath:h7,roundCommands:p7,roundCorners:tN},Symbol.toStringTag,{value:"Module"})),nN=Do(rN);var Ef={},m2={},y2={},Vl=Vl||{};Vl.stringify=function(){var e={"visit_linear-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return e.visit_gradient(t)},"visit_radial-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return e.visit_gradient(t)},visit_gradient:function(t){var r=e.visit(t.orientation);return r&&(r+=", "),t.type+"("+r+e.visit(t.colorStops)+")"},visit_shape:function(t){var r=t.value,n=e.visit(t.at),i=e.visit(t.style);return i&&(r+=" "+i),n&&(r+=" at "+n),r},"visit_default-radial":function(t){var r="",n=e.visit(t.at);return n&&(r+=n),r},"visit_extent-keyword":function(t){var r=t.value,n=e.visit(t.at);return n&&(r+=" at "+n),r},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return e.visit(t.value.x)+" "+e.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_literal:function(t){return e.visit_color(t.value,t)},visit_hex:function(t){return e.visit_color("#"+t.value,t)},visit_rgb:function(t){return e.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return e.visit_color("rgba("+t.value.join(", ")+")",t)},visit_color:function(t,r){var n=t,i=e.visit(r.length);return i&&(n+=" "+i),n},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var r="",n=t.length;return t.forEach(function(i,a){r+=e.visit(i),a<n-1&&(r+=", ")}),r},visit:function(t){if(!t)return"";var r="";if(t instanceof Array)return e.visit_array(t,r);if(t.type){var n=e["visit_"+t.type];if(n)return n(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return e.visit(t)}}();var Vl=Vl||{};Vl.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|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 r(z){var N=new Error(t+": "+z);throw N.source=t,N}function n(){var z=i();return t.length>0&&r("Invalid input not EOF"),z}function i(){return d(a)}function a(){return o("linear-gradient",e.linearGradient,u)||o("repeating-linear-gradient",e.repeatingLinearGradient,u)||o("radial-gradient",e.radialGradient,w)||o("repeating-radial-gradient",e.repeatingRadialGradient,w)}function o(z,N,H){return l(N,function(R){var F=H();return F&&($(e.comma)||r("Missing comma before color stops")),{type:z,orientation:F,colorStops:d(_)}})}function l(z,N){var H=$(z);if(H){$(e.startCall)||r("Missing (");var R=N(H);return $(e.endCall)||r("Missing )"),R}}function u(){return f()||v()}function f(){return U("directional",e.sideOrCorner,1)}function v(){return U("angular",e.angleValue,1)}function w(){var z,N=b(),H;return N&&(z=[],z.push(N),H=t,$(e.comma)&&(N=b(),N?z.push(N):t=H)),z}function b(){var z=h()||E();if(z)z.at=m();else{var N=y();if(N){z=N;var H=m();H&&(z.at=H)}else{var R=p();R&&(z={type:"default-radial",at:R})}}return z}function h(){var z=U("shape",/^(circle)/i,0);return z&&(z.style=M()||y()),z}function E(){var z=U("shape",/^(ellipse)/i,0);return z&&(z.style=T()||y()),z}function y(){return U("extent-keyword",e.extentKeywords,1)}function m(){if(U("position",/^at/,0)){var z=p();return z||r("Missing positioning value"),z}}function p(){var z=g();if(z.x||z.y)return{type:"position",value:z}}function g(){return{x:T(),y:T()}}function d(z){var N=z(),H=[];if(N)for(H.push(N);$(e.comma);)N=z(),N?H.push(N):r("One extra comma");return H}function _(){var z=O();return z||r("Expected color definition"),z.length=T(),z}function O(){return C()||x()||S()||k()}function k(){return U("literal",e.literalColor,0)}function C(){return U("hex",e.hexColor,1)}function S(){return l(e.rgbColor,function(){return{type:"rgb",value:d(P)}})}function x(){return l(e.rgbaColor,function(){return{type:"rgba",value:d(P)}})}function P(){return $(e.number)[1]}function T(){return U("%",e.percentageValue,1)||L()||M()}function L(){return U("position-keyword",e.positionKeywords,1)}function M(){return U("px",e.pixelValue,1)||U("em",e.emValue,1)}function U(z,N,H){var R=$(N);if(R)return{type:z,value:R[H]}}function $(z){var N,H;return H=/^[\n\r\t\s]+/.exec(t),H&&Z(H[0].length),N=z.exec(t),N&&Z(N[0].length),N}function Z(z){t=t.substr(z)}return function(z){return t=z.toString(),n()}}();y2.parse=Vl.parse;y2.stringify=Vl.stringify;(function(e){var t=we&&we.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.isGradient=void 0;const r=t(y2),n=o=>o.indexOf("linear-gradient")>=0;e.isGradient=n;const i=o=>o.type==="hex"?"#"+o.value:o.type==="literal"?o.value:`${o.type}(${o.value.join(",")})`,a=o=>{if(!(0,e.isGradient)(o))return{rotation:0,stops:[{offset:0,color:o},{offset:1,color:o}]};const l=r.default.parse(o)[0];return{rotation:parseFloat(l.orientation.value),stops:l.colorStops.map((u,f)=>({color:i(u),offset:u.length?parseFloat(u.length.value)/100:f/(l.colorStops.length-1)}))}};e.parseColor=a})(m2);(function(e){var t=we&&we.__createBinding||(Object.create?function(f,v,w,b){b===void 0&&(b=w);var h=Object.getOwnPropertyDescriptor(v,w);h&&!("get"in h?!v.__esModule:h.writable||h.configurable)||(h={enumerable:!0,get:function(){return v[w]}}),Object.defineProperty(f,b,h)}:function(f,v,w,b){b===void 0&&(b=w),f[b]=v[w]}),r=we&&we.__setModuleDefault||(Object.create?function(f,v){Object.defineProperty(f,"default",{enumerable:!0,value:v})}:function(f,v){f.default=v}),n=we&&we.__importStar||function(f){if(f&&f.__esModule)return f;var v={};if(f!=null)for(var w in f)w!=="default"&&Object.prototype.hasOwnProperty.call(f,w)&&t(v,f,w);return r(v,f),v},i=we&&we.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const a=i(at),o=n(m2),l=i(vi),u=(f,v=f.fill,w="fill")=>a.default.useMemo(()=>{if(!o.isGradient(v))return{[w]:v};const{stops:b,rotation:h}=o.parseColor(v),E={x:f.a.width/2,y:f.a.height/2},y=Math.sqrt(Math.pow(E.x,2)+Math.pow(E.y,2)),m=l.default.Util.degToRad(h)-Math.PI/2,p=[];return b.forEach(({offset:g,color:d})=>{p.push(g,d)}),w==="fill"?{fillLinearGradientStartPointX:E.x-y*Math.cos(m),fillLinearGradientStartPointY:E.y-y*Math.sin(m),fillLinearGradientColorStops:p,fillLinearGradientEndPointX:E.x+y*Math.cos(m),fillLinearGradientEndPointY:E.y+y*Math.sin(m),fill:b[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:E.x-y*Math.cos(m),strokeLinearGradientStartPointY:E.y-y*Math.sin(m),strokeLinearGradientColorStops:p,strokeLinearGradientEndPointX:E.x+y*Math.cos(m),strokeLinearGradientEndPointY:E.y+y*Math.sin(m)}},[v,f.width,f.height]);e.useColor=u})(Ef);var ua={},ql={};(function(e){var t=we&&we.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.useFadeIn=e.isAnimationUsed=e.toggleFadeInAnimation=void 0;const r=t(at),n=t(vi);let i=!1;const a=(u=!i)=>{i=u};e.toggleFadeInAnimation=a;const o=()=>i;function l(u,f){const v=r.default.useRef();r.default.useLayoutEffect(()=>{v.current&&v.current.destroy()},[f]),r.default.useLayoutEffect(()=>{if(!i)return;const w=u.current.opacity();return w?(u.current.opacity(0),v.current=new n.default.Tween({node:u.current,opacity:w,onFinish:()=>{var b;(b=v.current)===null||b===void 0||b.destroy()}}),v.current.play(),()=>{var b;(b=v.current)===null||b===void 0||b.destroy()}):void 0},[])}e.isAnimationUsed=o,e.useFadeIn=l})(ql);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.triggerLoadError=e.onLoadError=e.whenLoaded=e.decrementLoader=e.incrementLoader=e.getFontLoadTimeout=e.setFontLoadTimeout=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0;const t=ql;let r=0,n=[],i=3e4;const a=p=>{i=p};e.setAssetLoadTimeout=a;const o=()=>i;e.getAssetLoadTimeout=o;let l=6e3;const u=p=>{l=p};e.setFontLoadTimeout=u;const f=()=>l;function v(p){r+=1;let g=!1;const d=setTimeout(()=>{g||(m(`Timeout loading asset ${p}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",p),g=!0,w())},i);return()=>{g||(clearTimeout(d),w())}}function w(){r-=1,r===0&&(n.forEach(p=>p()),n=[])}function b(p){r===0?p():n.push(p)}function h(){return new Promise(p=>b(()=>{(0,t.isAnimationUsed)()?setTimeout(p,300):p(!0)}))}e.getFontLoadTimeout=f,e.incrementLoader=v,e.decrementLoader=w,e.whenLoaded=h;let E=[];function y(p){E.push(p)}function m(p){E.forEach(g=>g(p))}e.onLoadError=y,e.triggerLoadError=m})(ua);var xu={};(function(e){var t=we&&we.__createBinding||(Object.create?function(M,U,$,Z){Z===void 0&&(Z=$);var z=Object.getOwnPropertyDescriptor(U,$);z&&!("get"in z?!U.__esModule:z.writable||z.configurable)||(z={enumerable:!0,get:function(){return U[$]}}),Object.defineProperty(M,Z,z)}:function(M,U,$,Z){Z===void 0&&(Z=$),M[Z]=U[$]}),r=we&&we.__setModuleDefault||(Object.create?function(M,U){Object.defineProperty(M,"default",{enumerable:!0,value:U})}:function(M,U){M.default=U}),n=we&&we.__importStar||function(M){if(M&&M.__esModule)return M;var U={};if(M!=null)for(var $ in M)$!=="default"&&Object.prototype.hasOwnProperty.call(M,$)&&t(U,M,$);return r(U,M),U};Object.defineProperty(e,"__esModule",{value:!0}),e.injectCustomFont=e.injectGoogleFont=e.getGoogleFontsVariants=e.setGoogleFontsVariants=e.loadFont=e.isFontLoaded=e.replaceGlobalFonts=e.removeGlobalFont=e.addGlobalFont=e.globalFonts=e.getFontsList=e.setGoogleFonts=e.isGoogleFontChanged=void 0;const i=n(ha),a=ua;let o=i.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),l=i.observable({value:!1});function u(){return l.value}function f(M){M!=="default"?(l.value=!0,o.splice(0,o.length),o.push(...M)):l.value=!1}function v(){return o}function w(M){e.globalFonts.push(M)}function b(M){const U=e.globalFonts.findIndex($=>$.fontFamily===M);U!==-1&&e.globalFonts.splice(U,1)}function h(M){e.globalFonts.replace(M)}e.isGoogleFontChanged=u,e.setGoogleFonts=f,e.getFontsList=v,e.globalFonts=i.observable([]),e.addGlobalFont=w,e.removeGlobalFont=b,e.replaceGlobalFonts=h;var E="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",y=document.createElement("canvas");function m(){return g("Arial")}function p(){return g("Times","Times")}function g(M,U="Arial"){var $=y.getContext("2d");return $.font=`normal 40px '${M}', ${U}`,$.measureText(E).width}const d={Arial:!0},_=M=>!!d[M];async function O(M){var U;if(d[M])return;const $=!!(!((U=document.fonts)===null||U===void 0)&&U.load),Z=m();if($)try{await document.fonts.load(`16px '${M}'`);const R=g(M);if(Z!==R)return void(d[M]=!0)}catch{}const z=p(),N=g(M),H=Math.min(6e3,(0,a.getFontLoadTimeout)())/60;for(let R=0;R<H;R++){const F=g(M,"Arial"),B=g(M,"Times");if(F!==N||F!==Z||B!==z)return void(d[M]=!0);await new Promise(D=>setTimeout(D,60))}console.warn(`Timeout for loading font "${M}". Looks like polotno can't load it. Is it a correct font family?`),(0,a.triggerLoadError)(`Timeout for loading font "${M}"`)}e.isFontLoaded=_,e.loadFont=O;const k={};let C="400,400italic,700,700italic";function S(M){C=M}function x(){return C}function P(M){if(k[M])return;const U=`https://fonts.googleapis.com/css?family=${M.replace(/ /g,"+")}:${C}`,$=document.createElement("link");$.type="text/css",$.href=U,$.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild($),k[M]=!0}e.setGoogleFontsVariants=S,e.getGoogleFontsVariants=x,e.injectGoogleFont=P;const T={};function L(M){const U=M.fontFamily;if(T[U]||!M.url&&!M.styles)return;const $=document.createElement("style");$.type="text/css";const Z=M.styles||(M.url?[{src:`url("${M.url}")`}]:[]);let z="";Z.forEach(N=>{z+=`
77
+ @font-face {
78
+ font-family: '${U}';
79
+ src: ${N.src};
80
+ font-style: ${N.fontStyle||"normal"};
81
+ font-weight: ${N.fontWeight||"normal"};
82
+ }
83
+ `}),$.innerHTML=z,document.getElementsByTagName("head")[0].appendChild($),T[M.fontFamily]=!0}e.injectCustomFont=L})(xu);var hi={};(function(e){var t=we&&we.__createBinding||(Object.create?function(a,o,l,u){u===void 0&&(u=l);var f=Object.getOwnPropertyDescriptor(o,l);f&&!("get"in f?!o.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return o[l]}}),Object.defineProperty(a,u,f)}:function(a,o,l,u){u===void 0&&(u=l),a[u]=o[l]}),r=we&&we.__setModuleDefault||(Object.create?function(a,o){Object.defineProperty(a,"default",{enumerable:!0,value:o})}:function(a,o){a.default=o}),n=we&&we.__importStar||function(a){if(a&&a.__esModule)return a;var o={};if(a!=null)for(var l in a)l!=="default"&&Object.prototype.hasOwnProperty.call(a,l)&&t(o,a,l);return r(o,a),o};Object.defineProperty(e,"__esModule",{value:!0}),e.setAnimationsEnabled=e.setTextOverflow=e.setForceTextFit=e.useDownScaling=e.setDownScalingEnabled=e.useHtmlTextRender=e.useRemoveBackground=e.setTextVerticalResizeEnabled=e.flags=void 0;const i=n(ha);e.flags=i.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",animationsEnabled:!1}),e.setTextVerticalResizeEnabled=i.action(a=>{e.flags.textVerticalResizeEnabled=a}),e.useRemoveBackground=i.action(a=>{e.flags.removeBackgroundEnabled=a}),e.useHtmlTextRender=i.action(a=>{e.flags.htmlRenderEnabled=a}),e.setDownScalingEnabled=i.action(a=>{e.flags.imageDownScalingEnabled=a}),e.useDownScaling=i.action(a=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,e.setDownScalingEnabled)(a)}),e.setForceTextFit=i.action(a=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}),e.setTextOverflow=i.action(a=>{e.flags.textOverflow=a}),e.setAnimationsEnabled=i.action(a=>{e.flags.animationsEnabled=a})})(hi);var b2={};(function(e){function t(r=""){return(r=r.replace(/<\/p>/gi,`
84
+ `)).replace(/(<([^>]+)>)/gi,"")}Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=void 0,e.removeTags=t})(b2);var Of={};(function(e){var t=we&&we.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=void 0;const r=t(vi);function n(i,a){var o;const l={filters:[]};a.brightnessEnabled&&(l.filters.push(r.default.Filters.Brighten),l.brightness=a.brightness),a.blurEnabled&&(l.filters.push(r.default.Filters.Blur),l.blurRadius=a.blurRadius),a.sepiaEnabled&&l.filters.push(r.default.Filters.Sepia),a.grayscaleEnabled&&l.filters.push(r.default.Filters.Grayscale),i.setAttrs(l),l.filters.length?i.cache({pixelRatio:a.store._elementsPixelRatio}):i.clearCache(),(o=i.getLayer())===null||o===void 0||o.batchDraw()}e.applyFilter=n})(Of);var Wl={};(function(e){var t=we&&we.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.Highlighter=e.setHighlighterStyle=void 0;const r=t(at),n=Hi,i=Wa,a={stroke:"rgb(0, 161, 255)",strokeWidth:2},o=l=>{Object.assign(a,l)};e.setHighlighterStyle=o,e.Highlighter=(0,n.observer)(({element:l})=>r.default.createElement(i.Rect,Object.assign({name:"highlighter",x:l.a.x,y:l.a.y,rotation:l.a.rotation,width:l.a.width,height:l.a.height,listening:!1,strokeScaleEnabled:!1},a)))})(Wl);var Yo={};(function(e){var t=we&&we.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const r=t(at);e.MOBILE_BREAKPOINT=800;const n=()=>window.innerWidth<=e.MOBILE_BREAKPOINT;e.isMobile=n;const i=o=>`
85
+ @media (max-width: ${e.MOBILE_BREAKPOINT}px) {
86
+ ${o}
87
+ }
88
+
89
+ .polotno-mobile & {
90
+ ${o}
91
+ }
92
+ `;e.mobileStyle=i;const a=()=>{const[o,l]=r.default.useState((0,e.isMobile)());return r.default.useEffect(()=>{const u=()=>{l((0,e.isMobile)())};return window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}},[]),o};e.useMobile=a})(Yo);var N4={},g7="warn";function v7(e){g7=e}function m7(){return g7}function iN(e){v7(e)}var Pr;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(Pr||(Pr={}));var Im=function(e,t){return Im=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Im(e,t)};function Gt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Im(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Tr=function(){return Tr=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Tr.apply(this,arguments)};function aN(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function y7(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(f){return function(v){return u([f,v])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,f[0]&&(r=0)),r;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){r.label=f[1];break}if(f[0]===6&&r.label<a[1]){r.label=a[1],a=f;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(f);break}a[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(v){f=[6,v],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function xc(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function fa(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function da(e,t,r){if(arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function xf(e){return qe(e).type}function oN(e,t){return qe(e).getChildType(t)}function b7(e,t){return qe(e).onPatch(t)}function lN(e,t){return qe(e).onSnapshot(t)}function su(e,t){qe(e).applyPatches(C2(t))}function sN(e,t){var r={patches:[],inversePatches:[]},n={},i,a={get recording(){return!!i},get patches(){return n.patches||(n.patches=r.patches.slice()),n.patches},get reversedInversePatches(){return n.reversedInversePatches||(n.reversedInversePatches=r.inversePatches.slice().reverse()),n.reversedInversePatches},get inversePatches(){return n.inversePatches||(n.inversePatches=r.inversePatches.slice()),n.inversePatches},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=b7(e,function(o,l){t&&!t(o,l,E2())||(r.patches.push(o),r.inversePatches.push(l),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){su(o||e,r.patches)},undo:function(o){su(o||e,r.inversePatches.slice().reverse())}};return a.resume(),a}function uN(e){var t=qe(e);if(!t.isRoot)throw new Ue("`protect` can only be invoked on root nodes");t.isProtectionEnabled=!0}function cN(e){var t=qe(e);if(!t.isRoot)throw new Ue("`unprotect` can only be invoked on root nodes");t.isProtectionEnabled=!1}function fN(e){return qe(e).isProtected}function _7(e,t){return qe(e).applySnapshot(t)}function _2(e,t){t===void 0&&(t=!0);var r=qe(e);return t?r.snapshot:r.type.getSnapshot(r,!1)}function dN(e,t){t===void 0&&(t=1);for(var r=qe(e).parent;r;){if(--t===0)return!0;r=r.parent}return!1}function hN(e,t){t===void 0&&(t=1);for(var r=t,n=qe(e).parent;n;){if(--r===0)return n.storedValue;n=n.parent}throw new Ue("Failed to find the parent of ".concat(qe(e)," at depth ").concat(t))}function pN(e,t){for(var r=qe(e).parent;r;){if(t.is(r.storedValue))return!0;r=r.parent}return!1}function gN(e,t){for(var r=qe(e).parent;r;){if(t.is(r.storedValue))return r.storedValue;r=r.parent}throw new Ue("Failed to find the parent of ".concat(qe(e)," of a given type"))}function w7(e){return qe(e).root.storedValue}function S7(e){return qe(e).path}function vN(e){return hu(qe(e).path)}function mN(e){return qe(e).isRoot}function yN(e,t){var r=B7(qe(e),t);return r?r.value:void 0}function bN(e,t,r){var n=qe(t).root.identifierCache.resolve(e,Pu(r));return n==null?void 0:n.value}function E7(e){return qe(e).identifier}function _N(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return;if(Mt(r))return t?w2(r)?r:void 0:r;throw new Ue("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof T2)return;throw n}}function wN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return!1;if(Mt(r))return t?w2(r):!0;throw new Ue("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof T2)return!1;throw n}}function O7(e,t){var r=B7(qe(e),t,!1);if(r!==void 0)try{return r.value}catch{return}}function SN(e,t){return z7(qe(e),qe(t))}function EN(e,t){t===void 0&&(t=!0);var r=qe(e);return r.type.create(r.snapshot,t===!0?r.root.environment:t===!1?void 0:t)}function ON(e){return qe(e).detach(),e}function xN(e){var t=qe(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function w2(e){return qe(e).observableIsAlive}function PN(e,t){var r=qe(e);return r.addDisposer(t),t}function CN(e){var t=qe(e),r=t.root.environment;if(!r)throw new Ue("Failed to find the environment of ".concat(t," ").concat(t.path));return r}function TN(e){var t=qe(e),r=t.root.environment;return!!r}function x7(e,t){var r=qe(e);r.getChildren().forEach(function(n){Mt(n.storedValue)&&x7(n.storedValue,t)}),t(r.storedValue)}function P7(e){var t;return Mt(e)?t=xf(e):t=e,{name:t.name,properties:Tr({},t.properties)}}function AN(e){var t=qe(e).type,r=Tr(Tr({},P7(t)),{actions:[],volatile:[],views:[],flowActions:[]}),n=Object.getOwnPropertyNames(e);return n.forEach(function(i){if(!(i in r.properties)){var a=Object.getOwnPropertyDescriptor(e,i);if(a.get){q8(e,i)?r.views.push(i):r.volatile.push(i);return}a.value._isFlowAction===!0&&r.flowActions.push(i),a.value._isMSTAction===!0?r.actions.push(i):Y8(e,i)?r.volatile.push(i):r.views.push(i)}}),r}function kN(e){return e}function RN(e){return e}function LN(e){return e}function MN(e){return qe(e).nodeId}var C7=function(){function e(t,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:Vr.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(t){var r=this.isAlive;this._state=t;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._hookSubscribers&&this._hookSubscribers.emit(t,this,t)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._hookSubscribers||(this._hookSubscribers=new V7),this._hookSubscribers.register(t,r)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this._parent=t,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.pathAtom||(this.pathAtom=$c("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?ko(this._subpath):""),this.parent.getEscapedPath(t)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==Vr.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Vr.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=$c("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===Vr.CREATED){if(this.parent){if(this.parent.state!==Vr.FINALIZED)return;this.fireHook(Pr.afterAttach)}this.state=Vr.FINALIZED,t&&t()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=Vr.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(Pr.beforeDestroy)}}),e}(),Xc=function(e){Gt(t,e);function t(r,n,i,a,o){var l=e.call(this,r,n,i,a)||this;try{l.storedValue=r.createNewInstance(o)}catch(u){throw l.state=Vr.DEAD,u}return l.state=Vr.CREATED,l.finalizeCreation(),l}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw new Ue("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,a=this.subpath!==n;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Vr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),t}(C7);Xc.prototype.die=wr(Xc.prototype.die);var NN=1,Ai;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(Ai||(Ai={}));var zn;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(zn||(zn={}));var IN={onError:function(e){throw e}},kn=function(e){Gt(t,e);function t(r,n,i,a,o){var l=e.call(this,r,n,i,a)||this;if(Object.defineProperty(l,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++NN}),Object.defineProperty(l,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:Ai.UNINITIALIZED}),Object.defineProperty(l,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),l._snapshotComputed=Ml(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=o,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new tI),l._childNodes=r.initializeChildNodes(l,l._initialSnapshot),l.identifier=null,l.unnormalizedIdentifier=null,l.identifierAttribute&&l._initialSnapshot){var u=l._initialSnapshot[l.identifierAttribute];if(u===void 0){var f=l._childNodes[l.identifierAttribute];f&&(u=f.value)}if(typeof u!="string"&&typeof u!="number")throw new Ue("Instance identifier '".concat(l.identifierAttribute,"' for type '").concat(l.type.name,"' must be a string or a number"));l.identifier=Pu(u),l.unnormalizedIdentifier=u}return n?n.root.identifierCache.addNodeToCache(l):l.identifierCache.addNodeToCache(l),l}return Object.defineProperty(t.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(t.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===Ai.UNINITIALIZED&&this.createObservableInstance(r)}}),Object.defineProperty(t.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n,i,a,o;r===void 0&&(r=!0),this._observableInstanceState=Ai.CREATING;for(var l=[],u=this.parent;u&&u._observableInstanceState===Ai.UNINITIALIZED;)l.unshift(u),u=u.parent;try{for(var f=xc(l),v=f.next();!v.done;v=f.next()){var w=v.value;w.createObservableInstanceIfNeeded(!1)}}catch(y){n={error:y}}finally{try{v&&!v.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}var b=this.type;try{this.storedValue=b.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,b.finalizeNewInstance(this,this.storedValue)}catch(y){throw this.state=Vr.DEAD,y}finally{this._isRunningAction=!1}if(this._observableInstanceState=Ai.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=fu,this.state=Vr.CREATED,r){this.fireHook(Pr.afterCreate),this.finalizeCreation();try{for(var h=xc(l.reverse()),E=h.next();!E.done;E=h.next()){var w=E.value;w.fireHook(Pr.afterCreate),w.finalizeCreation()}}catch(y){a={error:y}}finally{try{E&&!E.done&&(o=h.return)&&o.call(h)}finally{if(a)throw a.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(Pr.beforeDetach);var r=this.state;this.state=Vr.DETACHING;var n=this.root,i=n.environment,a=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=r}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,a=n!==this.subpath;!i&&!a||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(Pr.afterAttach)):a&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(ru?ru(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===Ai.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var r=this.type,n=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=r.processInitialSnapshot(n,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=m7();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw new Ue(i);case"warn":pI(i)}}}}),Object.defineProperty(t.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&ko(r.subpath)||"",a=r.actionContext||S2();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var l=a&&a.context&&S7(a.context)||n;o="".concat(l,".").concat(a.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(n,"', Subpath: '").concat(i,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===Ai.CREATED?this.type.getChildNode(this,r):this._childNodes[r]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(fu),this._autoUnbox=!1;try{return this._observableInstanceState===Ai.CREATED?this.type.getChildren(this):H7(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw new Ue("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(t.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.assertAlive({subpath:r.subpath||r.subpathUponDeath}),this._autoUnbox?r.value:r)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(r).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var a=xc(r.getChildren()),o=a.next();!o.done;o=a.next()){var l=o.value;l.finalizeCreation()}}catch(u){n={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}r.fireInternalHook(Pr.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new Ue("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=Zc(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=hu(i.path),o=U7(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=Zc(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),yl(this.storedValue,"$treenode",this),yl(this.storedValue,"toJSON",nI)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Vr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==Ai.UNINITIALIZED&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(zn.Dispose),this._internalEventsClear(zn.Dispose))}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var r=this.snapshot;this._snapshotUponDeath=r,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister(zn.Snapshot,r)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit(zn.Snapshot,r)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister(zn.Patch,r)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers(zn.Patch)){var i=n.path.substr(this.path.length)+(r.path?"/"+r.path:""),a=fI({},r,{path:i}),o=fa(_I(a),2),l=o[0],u=o[1];this._internalEventsEmit(zn.Patch,l,u)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas(zn.Dispose,r)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister(zn.Dispose,r,!0);return}throw new Ue("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas(zn.Dispose,r))throw new Ue("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(zn.Dispose,r)}}),Object.defineProperty(t.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.middlewares){var n=this.middlewares.indexOf(r);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(t.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={handler:r,includeHooks:n};return this.middlewares?this.middlewares.push(a):this.middlewares=[a],function(){i.removeMiddleware(a)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this.assertWritable({subpath:r}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,r,n)}}),Object.defineProperty(t.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=j8(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},IN);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(t.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new V7),this._internalEvents.register(r,n,i)}}),Object.defineProperty(t.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var n,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];this._internalEvents&&(n=this._internalEvents).emit.apply(n,da([r],fa(i),!1))}}),Object.defineProperty(t.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(t.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t}(C7);kn.prototype.createObservableInstance=wr(kn.prototype.createObservableInstance);kn.prototype.detach=wr(kn.prototype.detach);kn.prototype.die=wr(kn.prototype.die);var T7,ut;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(ut||(ut={}));var A7="cannotDetermine",DN=Symbol("$type"),Ua=function(){function e(t){Object.defineProperty(this,T7,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return Ia(this,t),this.instantiate(null,"",r,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){throw new Ue("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=j7(t);if(n){var i=xf(t);return this.isAssignableFrom(i)?Rn():Ln(r,t)}return this.isValidSnapshot(t,r)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.validate(t,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new Ue("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new Ue("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new Ue("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new Ue("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();T7=DN;Ua.prototype.create=wr(Ua.prototype.create);var uu=function(e){Gt(t,e);function t(r){var n=e.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),e.prototype.create.call(this,r,n)}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===Pu(n[r.identifierAttribute])}}),Object.defineProperty(t.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||Mt(n)&&qe(n)===r?!0:r.type===this&&G7(n)&&!Mt(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.tryToReconcileNode(r,n);if(o)return r.setParent(i,a),r;if(r.die(),Mt(n)&&this.isAssignableFrom(xf(n))){var l=qe(n);return l.setParent(i,a),l}return this.instantiate(i,a,void 0,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(Ua);uu.prototype.create=wr(uu.prototype.create);var Yl=function(e){Gt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this&&r.storedValue===n)return r;var o=this.instantiate(i,a,void 0,n);return r.die(),o}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(Ua);function an(e){return typeof e=="object"&&e&&e.isType===!0}var Ji=new Map;function FN(e){return function(r,n,i){switch(r.type){case"action":if(!e.filter||e.filter(r)===!0){var a=e.onStart(r);e.onResume(r,a),Ji.set(r.id,{call:r,context:a,async:!1});try{var o=n(r);return e.onSuspend(r,a),Ji.get(r.id).async===!1&&(Ji.delete(r.id),e.onSuccess(r,a,o)),o}catch(u){throw Ji.delete(r.id),e.onFail(r,a,u),u}}else return n(r);case"flow_spawn":{var l=Ji.get(r.rootId);return l.async=!0,n(r)}case"flow_resume":case"flow_resume_error":{var l=Ji.get(r.rootId);e.onResume(r,l.context);try{return n(r)}finally{e.onSuspend(r,l.context)}}case"flow_throw":{var l=Ji.get(r.rootId);return Ji.delete(r.rootId),e.onFail(r,l.context,r.args[0]),n(r)}case"flow_return":{var l=Ji.get(r.rootId);return Ji.delete(r.rootId),e.onSuccess(r,l.context,r.args[0]),n(r)}}}}var jN=function(){function e(t,r){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),t&&t.onStart(r)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,t))}}),Object.defineProperty(e.prototype,"incFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(e.prototype,"decFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(e.prototype,"hasFlowsPending",{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),e}();function zN(e){var t=new Map;return function(n,i){var a=n.parentActionEvent?t.get(n.parentActionEvent.id):void 0;if(n.type==="action"){var o=Tr(Tr({},n),{env:a&&a.call.env,parentCall:a&&a.call}),l=!e.filter||e.filter(o),u=l?e:void 0,f=new jN(u,o);t.set(n.id,f);var v=void 0;try{v=i(n)}catch(b){throw t.delete(n.id),f.finish(b),b}return f.hasFlowsPending||(t.delete(n.id),f.finish()),v}else{if(!a)return i(n);switch(n.type){case"flow_spawn":return a.incFlowsPending(),i(n);case"flow_resume":case"flow_resume_error":return i(n);case"flow_throw":{var w=n.args[0];try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish(w))}}case"flow_return":try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish())}}}}}function BN(e,t,r,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(du(n))return n;if(Mt(n))return Hd("[MSTNode: ".concat(xf(n).name,"]"));if(typeof n=="function")return Hd("[function]");if(typeof n=="object"&&!gl(n)&&!P2(n))return Hd("[object ".concat(n&&n.constructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(i){return Hd(""+i)}}function UN(e,t){return t&&typeof t=="object"&&"$MST_DATE"in t?new Date(t.$MST_DATE):t}function Hd(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function k7(e,t){ru(function(){C2(t).forEach(function(r){return HN(e,r)})})}function HN(e,t){var r=O7(e,t.path||"");if(!r)throw new Ue("Invalid action path: ".concat(t.path||""));var n=qe(r);if(t.name==="@APPLY_PATCHES")return su.call(null,r,t.args[0]);if(t.name==="@APPLY_SNAPSHOT")return _7.call(null,r,t.args[0]);if(typeof r[t.name]!="function")throw new Ue("Action '".concat(t.name,"' does not exist in '").concat(n.path,"'"));return r[t.name].apply(r,t.args?t.args.map(function(i){return UN(n,i)}):[])}function GN(e,t){var r=[],n=function(o){var l=t?t(o,E2()):!0;l&&r.push(o)},i,a={actions:r,get recording(){return!!i},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=R7(e,n))},replay:function(o){k7(o,r)}};return a.resume(),a}function R7(e,t,r){return r===void 0&&(r=!1),N7(e,function(i,a){if(i.type==="action"&&i.id===i.rootId){var o=qe(i.context),l={name:i.name,path:z7(qe(e),o),args:i.args.map(function(f,v){return BN(o,i.name,v,f)})};if(r){var u=a(i);return t(l),u}else return t(l),a(i)}else return a(i)})}var $N=1,Pc;function S2(){return Pc}function L7(){return $N++}function Dm(e,t){var r=qe(e.context);e.type==="action"&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=Pc;Pc=e;try{return WN(r,e,t)}finally{Pc=i,r._isRunningAction=n}}function M7(e){if(e)return e.type==="action"?e:e.parentActionEvent}function Zc(e,t,r){var n=function(){var i=L7(),a=Pc,o=M7(a);return Dm({type:"action",name:t,id:i,args:q7(arguments),context:e,tree:w7(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?da(da([],fa(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}function N7(e,t,r){r===void 0&&(r=!0);var n=qe(e);return n.addMiddleWare(t,r)}function VN(e,t,r){r===void 0&&(r=!0);var n={handler:e,includeHooks:r};return t.$mst_middleware=t.$mst_middleware||[],t.$mst_middleware.push(n),t}var qN=function(){function e(t,r){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),r.$mst_middleware&&this.middlewares.push(r.$mst_middleware);for(var n=t;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.middlewares[this.arrayIndex];if(t){var r=t[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function WN(e,t,r){var n=new qN(e,r);if(n.isEmpty)return wr(r).apply(null,t.args);var i=null;function a(o){var l=n.getNextMiddleware(),u=l&&l.handler;if(!u)return wr(r).apply(null,o.args);if(!l.includeHooks&&Pr[o.name])return a(o);function f(w,b){i=a(w),b&&(i=b(i))}function v(w){i=w}return u(o,f,v),i}return a(t)}function E2(){for(var e=S2();e&&e.type!=="action";)e=e.parentActionEvent;return e}function I7(e,t,r){for(var n=typeof t=="number"?t:t.id,i=r?e:e.parentActionEvent;i;){if(i.id===n)return!0;i=i.parentActionEvent}return!1}function YN(e,t){return I7(e,t,!1)}function KN(e,t){return I7(e,t,!0)}function XN(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: ".concat(t,">")}}function D7(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):Mt(e)?"<".concat(e,">"):"`".concat(XN(e),"`")}function ZN(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function QN(e){var t=e.value,r=e.context[e.context.length-1].type,n=e.context.map(function(l){var u=l.path;return u}).filter(function(l){return l.length>0}).join("/"),i=n.length>0?'at path "/'.concat(n,'" '):"",a=Mt(t)?"value of type ".concat(qe(t).type.name,":"):du(t)?"value":"snapshot",o=r&&Mt(t)&&r.is(qe(t).snapshot);return"".concat(i).concat(a," ").concat(D7(t)," is not assignable ").concat(r?"to type: `".concat(r.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(r?aS(r)||du(t)?".":", expected an instance of `".concat(r.name,"` or a snapshot like `").concat(r.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function O2(e,t,r){return e.concat([{path:t,type:r}])}function Rn(){return cu}function Ln(e,t,r){return[{context:e,value:t,message:r}]}function v0(e){return e.reduce(function(t,r){return t.concat(r)},[])}function Ia(e,t){gI()&&F7(e,t)}function F7(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw new Ue(JN(e,t,r))}function JN(e,t,r){if(r.length!==0)return"Error while converting ".concat(ZN(D7(t))," to `").concat(e.name,`\`:
93
+
94
+ `)+r.map(QN).join(`
95
+ `)}var eI=0,tI=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:eI++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Ft.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Ft.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t);this.lastCacheModificationPerId.set(t,r===void 0?1:r+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t)||0;return"".concat(this.cacheId,"-").concat(r)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(r===void 0&&(r=!0),t.identifierAttribute){var n=t.identifier;this.cache.has(n)||this.cache.set(n,Ft.array([],m0));var i=this.cache.get(n);if(i.indexOf(t)!==-1)throw new Ue("Already registered");i.push(t),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;Gy(t.identifierCache.cache).forEach(function(n){return n.forEach(function(i){r.addNodeToCache(i)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.identifierAttribute){var r=t.identifier,n=this.cache.get(r);n&&(n.remove(t),n.length||this.cache.delete(r),this.updateLastCacheModificationPerId(t.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,n=new e,i=t.path+"/";return K8(this.cache).forEach(function(a){for(var o=fa(a,2),l=o[0],u=o[1],f=!1,v=u.length-1;v>=0;v--){var w=u[v];(w===t||w.path.indexOf(i)===0)&&(n.addNodeToCache(w,!1),u.splice(v,1),u.length||r.cache.delete(l),f=!0)}f&&r.updateLastCacheModificationPerId(l)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);return n?n.some(function(i){return t.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(a){return t.isAssignableFrom(a.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw new Ue("Cannot resolve a reference to type '".concat(t.name,"' with id: '").concat(r,"' unambigously, there are multiple candidates: ").concat(i.map(function(a){return a.path}).join(", ")))}}}),e}();function x2(e,t,r,n,i){var a=j7(i);if(a){if(a.parent)throw new Ue("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(t?t.path:"","/").concat(r,"', but it lives already at '").concat(a.path,"'"));return t&&a.setParent(t,r),a}return new kn(e,t,r,n,i)}function Ko(e,t,r,n,i){return new Xc(e,t,r,n,i)}function rI(e){return e instanceof Xc||e instanceof kn}var Vr;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(Vr||(Vr={}));function Mt(e){return!!(e&&e.$treenode)}function qe(e){if(!Mt(e))throw new Ue("Value ".concat(e," is no MST Node"));return e.$treenode}function j7(e){return e&&e.$treenode||null}function nI(){return qe(this).snapshot}var iI=function(e){return".."};function z7(e,t){if(e.root!==t.root)throw new Ue("Cannot calculate relative path: objects '".concat(e,"' and '").concat(t,"' are not part of the same object tree"));for(var r=hu(e.path),n=hu(t.path),i=0;i<r.length&&r[i]===n[i];i++);return r.slice(i).map(iI).join("/")+qh(n.slice(i))}function B7(e,t,r){return r===void 0&&(r=!0),U7(e,hu(t),r)}function U7(e,t,r){r===void 0&&(r=!0);var n=e;try{for(var i=0;i<t.length;i++){var a=t[i];if(a===".."){if(n=n.parent,n)continue}else{if(a===".")continue;if(n){if(n instanceof Xc){var o=n.value;Mt(o)&&(n=qe(o))}if(n instanceof kn){var l=n.getChildType(a);if(l&&(n=n.getChildNode(a),n))continue}}}throw new Ue("Could not resolve '".concat(a,"' in path '").concat(qh(t.slice(0,i))||"/","' while resolving '").concat(qh(t),"'"))}}catch(u){if(!r)return;throw u}return n}function H7(e){if(!e)return cu;var t=Object.keys(e);if(!t.length)return cu;var r=new Array(t.length);return t.forEach(function(n,i){r[i]=e[n]}),r}function aI(e){return W7(),Y7(e)}var oI=Object.toString(),cu=Object.freeze([]),fu=Object.freeze({}),m0=P8().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(m0);var Ue=function(e){Gt(t,e);function t(r){return r===void 0&&(r="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(r))||this}return t}(Error);function lI(e){return e}var sI=Number.isInteger;function uI(e){return Number(e)===e&&e%1!==0}function cI(e){return Number.isFinite(e)}function P2(e){return Array.isArray(e)||vn(e)}function C2(e){return e?P2(e)?e:[e]:cu}function fI(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n];for(var a in i)e[a]=i[a]}return e}function gl(e){var t;if(e===null||typeof e!="object")return!1;var r=Object.getPrototypeOf(e);return r==null?!0:((t=r.constructor)===null||t===void 0?void 0:t.toString())===oI}function G7(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function du(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function $7(e){return typeof e!="function"}function dI(e,t,r){zr(e)?Vy(e,t,r):Object.defineProperty(e,t,r)}function yl(e,t,r){dI(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}var hI=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this;return r===void 0&&(r=!1),r?this.handlers.unshift(t):this.handlers.push(t),function(){n.unregister(t)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.handlers.indexOf(t)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.handlers.indexOf(t);r>=0&&this.handlers.splice(r,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this.handlers.slice();n.forEach(function(i){return i.apply(void 0,da([],fa(t),!1))})}}),e}(),V7=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.eventHandlers&&this.eventHandlers[t];return!!r&&r.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[t];return i||(i=this.eventHandlers[t]=new hI),i.register(r,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];return!!n&&n.has(r)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];n&&n.unregister(r)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.eventHandlers&&delete this.eventHandlers[t]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this.eventHandlers&&this.eventHandlers[t];a&&(r=a).emit.apply(r,da([],fa(n),!1))}}),e}();function q7(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}function bg(e,t){return e.indexOf(t)===0}var W7=function(e,t){};W7.ids={};function pI(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function gI(){return typeof process<"u"&&N4&&N4.ENABLE_TYPE_CHECK==="true"}function _g(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function Y7(e){return bI(e.name,e)}function vI(e){return e}function mI(e){return function(){var t,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];return y7(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,da([],fa(r),!1))];case 1:return[2,n.sent()]}})}}function yI(e){return y7(this,function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent()]}})}function bI(e,t){var r=function(){var i=L7(),a=S2();if(!a)throw new Ue("a mst flow must always have a parent context");var o=M7(a);if(!o)throw new Ue("a mst flow must always have a parent action context");var l={name:e,id:i,tree:a.tree,context:a.context,parentId:a.id,allParentIds:da(da([],fa(a.allParentIds),!1),[a.id],!1),rootId:a.rootId,parentEvent:a,parentActionEvent:o},u=arguments;function f(v,w,b){return v.$mst_middleware=r.$mst_middleware,Dm(Tr(Tr({},l),{type:w,args:[b]}),v)}return new Promise(function(v,w){var b,h=function(){b=t.apply(null,arguments),E(void 0)};h.$mst_middleware=r.$mst_middleware,Dm(Tr(Tr({},l),{type:"flow_spawn",args:q7(u)}),h);function E(p){var g;try{var d=f(function(_){g=b.next(_)},"flow_resume",p);d instanceof Error&&(g=b.throw(d))}catch(_){_g(function(){f(function(O){w(_)},"flow_throw",_)});return}m(g)}function y(p){var g;try{f(function(d){g=b.throw(d)},"flow_resume_error",p)}catch(d){_g(function(){f(function(_){w(d)},"flow_throw",d)});return}m(g)}function m(p){if(p.done){_g(function(){f(function(g){v(g)},"flow_return",p.value)});return}if(!p.value||typeof p.value.then!="function")throw new Ue("Only promises can be yielded to `async`, got: "+p);return p.value.then(E,y)}})};return r._isFlowAction=!0,r}function _I(e){if(!("oldValue"in e))throw new Ue("Patches without `oldValue` field cannot be inversed");return[wI(e),SI(e)]}function wI(e){switch(e.op){case"add":return{op:"add",path:e.path,value:e.value};case"remove":return{op:"remove",path:e.path};case"replace":return{op:"replace",path:e.path,value:e.value}}}function SI(e){switch(e.op){case"add":return{op:"remove",path:e.path};case"remove":return{op:"add",path:e.path,value:e.oldValue};case"replace":return{op:"replace",path:e.path,value:e.oldValue}}}function EI(e){return typeof e=="number"}function ko(e){return EI(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function K7(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function qh(e){if(e.length===0)return"";var t=function(r){return r.map(ko).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function hu(e){var t=e.split("/").map(K7),r=e===""||e==="."||e===".."||bg(e,"/")||bg(e,"./")||bg(e,"../");if(!r)throw new Ue("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return t[0]===""&&t.shift(),t}var wg=Symbol("$preProcessorFailed"),OI=function(e){Gt(t,e);function t(r,n,i){var a=e.call(this,i||r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ut.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(t.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.preProcessor?this._processors.preProcessor.call(null,r):r}}),Object.defineProperty(t.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(r){try{return this.preProcessSnapshot(r)}catch{return wg}}}),Object.defineProperty(t.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,r,n.storedValue):r}}),Object.defineProperty(t.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;xI(r.type,this,"create"),r instanceof kn&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},lS(this._subtype)||(r.getReconciliationType=function(){return n})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Mt(a)?a:this.preProcessSnapshot(a),l=this._subtype.instantiate(r,n,i,o);return this._fixNode(l),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this._subtype.reconcile(r,Mt(n)?n:this.preProcessSnapshot(n),i,a);return o!==r&&this._fixNode(o),o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=!0);var i=this._subtype.getSnapshot(r);return n?this.postProcessSnapshot(i,r):i}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.preProcessSnapshotSafe(r);return i===wg?Ln(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=an(r)?this._subtype:Mt(r)?_2(r,!1):this.preProcessSnapshotSafe(r);return n===wg?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!(this._subtype instanceof uu))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(Ua);function xI(e,t){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=xc(i),l=o.next();!l.done;l=o.next()){var u=l.value;e[u]=t[u].bind(t)}}catch(f){r={error:f}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}function PI(e,t,r){return new OI(e,t,r)}var I4="Map.put can only be used to store complex values that have an identifier type attribute";function X7(e,t){var r,n,i=e.getSubTypes();if(i===A7)return!1;if(i){var a=C2(i);try{for(var o=xc(a),l=o.next();!l.done;l=o.next()){var u=l.value;if(!X7(u,t))return!1}}catch(f){r={error:f}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}return e instanceof Qc&&t.push(e),!0}var mo;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(mo||(mo={}));var CI=function(e){Gt(t,e);function t(r,n){return e.call(this,r,Ft.ref.enhancer,n)||this}return Object.defineProperty(t.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.get.call(this,""+r)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.has.call(this,""+r)}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.delete.call(this,""+r)}}),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return e.prototype.set.call(this,""+r,n)}}),Object.defineProperty(t.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!r)throw new Ue("Map.put cannot be used to set empty values");if(Mt(r)){var n=qe(r);if(n.identifier===null)throw new Ue(I4);return this.set(n.identifier,r),r}else if(G7(r)){var i=qe(this),a=i.type;if(a.identifierMode!==mo.YES)throw new Ue(I4);var o=a.mapIdentifierAttribute,l=r[o];if(!A2(l)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(_2(u))}var f=Pu(l);return this.set(f,r),this.get(f)}else throw new Ue("Map.put can only be used to store complex values")}}),t}(wp),Wh=function(e){Gt(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:mo.UNKNOWN}),Object.defineProperty(a,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ut.Map}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a._determineIdentifierMode(),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._determineIdentifierMode(),x2(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===mo.UNKNOWN){var r=[];if(X7(this._subType,r)){var n=r.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw new Ue("The objects in a map should all have the same identifier attribute, expected '".concat(i,"', but child of type '").concat(a.name,"' declared attribute '").concat(a.identifierAttribute,"' as identifier"));return a.identifierAttribute},void 0);n?(this.identifierMode=mo.YES,this.mapIdentifierAttribute=n):this.identifierMode=mo.NO}}}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type._subType,a={};return Object.keys(n).forEach(function(o){a[o]=i.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new CI(r,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Hy(n,r.unbox);var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(l){var u=o[l],f=Zc(n,l,u);yl(n,l,f)})}),yp(n,this.willChange),_p(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return Gy(r.storedValue)}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r.storedValue.get(""+n);if(!i)throw new Ue("Not a child "+n);return i}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=qe(r.object),i=r.name;n.assertWritable({subpath:i});var a=n.type,o=a._subType;switch(r.type){case"update":{var l=r.newValue,u=r.object.get(i);if(l===u)return null;Ia(o,l),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":Ia(o,r.newValue),r.newValue=o.instantiate(n,i,void 0,r.newValue),a.processIdentifier(i,r.newValue);break}return r}}),Object.defineProperty(t.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.identifierMode===mo.YES&&n instanceof kn){var i=n.identifier;if(i!==r)throw new Ue("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(i,"', but expected: '").concat(r,"'"))}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return r.getChildren().forEach(function(i){n[i.subpath]=i.snapshot}),n}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=qe(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:ko(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:ko(r.name),value:r.newValue.snapshot,oldValue:void 0},n);case"delete":var i=r.oldValue.snapshot;return r.oldValue.die(),void n.emitPatch({op:"remove",path:ko(r.name),oldValue:i},n)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue;switch(i.op){case"add":case"replace":a.set(n,i.value);break;case"remove":a.delete(n);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Ia(this,n);var i=r.storedValue,a={};if(Array.from(i.keys()).forEach(function(l){a[l]=!1}),n)for(var o in n)i.set(o,n[o]),a[""+o]=!0;Object.keys(a).forEach(function(l){a[l]===!1&&i.delete(l)})}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return gl(r)?v0(Object.keys(r).map(function(a){return i._subType.validate(r[a],O2(n,a,i._subType))})):Ln(n,r,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return fu}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(uu);Wh.prototype.applySnapshot=wr(Wh.prototype.applySnapshot);function TI(e){return new Wh("Map<string, ".concat(e.name,">"),e)}function AI(e){return an(e)&&(e.flags&ut.Map)>0}var Yh=function(e){Gt(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ut.Array}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return x2(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=[]);var i=r.type._subType,a={};return n.forEach(function(o,l){var u=""+l;a[u]=i.instantiate(r,u,void 0,o)}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Tr(Tr({},m0),{name:this.name});return Ft.array(H7(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Bi(n).dehancer=r.unbox;var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(l){var u=o[l],f=Zc(n,l,u);yl(n,l,f)})}),yp(n,this.willChange),_p(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue.slice()}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=Number(n);if(i<r.storedValue.length)return r.storedValue[i];throw new Ue("Not a child: "+n)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=qe(r.object);n.assertWritable({subpath:""+r.index});var i=n.type._subType,a=n.getChildren();switch(r.type){case"update":{if(r.newValue===r.object[r.index])return null;var o=D4(n,i,[a[r.index]],[r.newValue],[r.index]);if(!o)return null;r.newValue=o[0]}break;case"splice":{var l=r.index,u=r.removedCount,f=r.added,v=D4(n,i,a.slice(l,l+u),f,f.map(function(b,h){return l+h}));if(!v)return null;r.added=v;for(var w=l+u;w<a.length;w++)a[w].setParent(n,""+(w+f.length-u))}break}return r}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=[];return Object.keys(r).forEach(function(i){n.push(r[i].getSnapshot())}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=qe(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:""+r.index,value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"splice":if(r.removedCount&&r.addedCount===r.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:r.removed.map(function(a){return a.snapshot})},n);for(var i=r.removedCount-1;i>=0;i--)n.emitPatch({op:"remove",path:""+(r.index+i),oldValue:r.removed[i].snapshot},n);for(var i=0;i<r.addedCount;i++)n.emitPatch({op:"add",path:""+(r.index+i),value:r.added[i].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue,o=n==="-"?a.length:Number(n);switch(i.op){case"replace":a[o]=i.value;break;case"add":a.splice(o,0,i.value);break;case"remove":a.splice(o,1);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Ia(this,n);var i=r.storedValue;i.replace(n)}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return P2(r)?v0(r.map(function(a,o){return i._subType.validate(a,O2(n,""+o,i._subType))})):Ln(n,r,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return cu}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(uu);Yh.prototype.applySnapshot=wr(Yh.prototype.applySnapshot);function kI(e){return new Yh("".concat(e.name,"[]"),e)}function D4(e,t,r,n,i){for(var a=!0,o=0;;o++){var l=o<=n.length-1,u=r[o],f=l?n[o]:void 0,v=""+i[o];if(rI(f)&&(f=f.storedValue),!u&&!l)break;if(!l)a=!1,r.splice(o,1),u instanceof kn&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(F4(u,f))r[o]=Sg(t,e,v,f,u);else{for(var b=void 0,h=o;h<r.length;h++)if(F4(r[h],f)){b=r.splice(h,1)[0];break}a=!1;var w=Sg(t,e,v,f,b);r.splice(o,0,w)}else{if(Mt(f)&&qe(f).parent===e)throw new Ue("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(v,"', but it lives already at '").concat(qe(f).path,"'"));a=!1;var w=Sg(t,e,v,f);r.splice(o,0,w)}}return a?null:r}function Sg(e,t,r,n,i){Ia(e,n);function a(){if(Mt(n)){var l=qe(n);if(l.assertAlive(fu),l.parent!==null&&l.parent===t)return l.setParent(t,r),l}return i?e.reconcile(i,n,t,r):e.instantiate(t,r,void 0,n)}var o=a();return i&&i!==o&&(i instanceof kn&&i.createObservableInstanceIfNeeded(),i.die()),o}function F4(e,t){if(!e.isAlive)return!1;if(Mt(t)){var r=qe(t);return r.isAlive&&r===e}if(e.snapshot===t)return!0;if(!(e instanceof kn))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&gl(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}function RI(e){return an(e)&&(e.flags&ut.Array)>0}var j4="preProcessSnapshot",z4="postProcessSnapshot";function LI(){return qe(this).toString()}var B4={name:"AnonymousModel",properties:{},initializers:cu};function MI(e){var t=Object.keys(e),r=new Set;return t.forEach(function(n){if(r.has(n))throw new Ue("".concat(n," is declared twice in the model. Model should not contain the same keys"));r.add(n)}),t.reduce(function(n,i){if(i in Pr)throw new Ue("Hook '".concat(i,"' was defined as property. Hooks should be defined as part of the actions"));var a=Object.getOwnPropertyDescriptor(e,i);if("get"in a)throw new Ue("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw new Ue("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(du(o))n[i]=bl(zI(o),o);else if(o instanceof Wh)n[i]=bl(o,{});else if(o instanceof Yh)n[i]=bl(o,[]);else if(!an(o))throw new Ue("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return n},Tr({},e))}var Qc=function(e){Gt(t,e);function t(r){var n=e.call(this,r.name||B4.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ut.Object}),Object.defineProperty(n,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({name:i})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({properties:i})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=n.preProcessor;return a?n.cloneAndEnhance({preProcessor:function(o){return a(i(o))}}):n.cloneAndEnhance({preProcessor:i})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=n.postProcessor;return a?n.cloneAndEnhance({postProcessor:function(o){return i(a(o))}}):n.cloneAndEnhance({postProcessor:i})}}),Object.assign(n,B4,r),n.properties=MI(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(t.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=void 0;return this.forAllProps(function(n,i){if(i.flags&ut.Identifier){if(r)throw new Ue("Cannot define property '".concat(n,"' as object identifier, property '").concat(r,"' is already defined as identifier property"));r=n}}),r}}),Object.defineProperty(t.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new t({name:r.name||this.name,properties:Object.assign({},this.properties,r.properties),initializers:this.initializers.concat(r.initializers||[]),preProcessor:r.preProcessor||this.preProcessor,postProcessor:r.postProcessor||this.postProcessor})}}),Object.defineProperty(t.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateActions(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!gl(n))throw new Ue("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===j4)throw new Ue("Cannot define action '".concat(j4,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===z4)throw new Ue("Cannot define action '".concat(z4,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var a=n[i],o=r[i];if(i in Pr&&o){var l=a;a=function(){o.apply(null,arguments),l.apply(null,arguments)}}var u=a.$mst_middleware,f=a.bind(n);f._isFlowAction=a._isFlowAction||!1,f.$mst_middleware=u;var v=Zc(r,i,f);n[i]=v,yl(r,i,v)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw new Ue("You passed an ".concat(typeof r," to volatile state as an argument, when function is expected"));var i=function(a){return n.instantiateVolatileState(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!gl(n))throw new Ue("volatile state initializer should return a plain object containing state");$y(r,n)}}),Object.defineProperty(t.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){var o=r(a),l=o.actions,u=o.views,f=o.state,v=aN(o,["actions","views","state"]);for(var w in v)throw new Ue("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(w,"'"));return f&&n.instantiateVolatileState(a,f),u&&n.instantiateViews(a,u),l&&n.instantiateActions(a,l),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateViews(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!gl(n))throw new Ue("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(i){var a,o=Object.getOwnPropertyDescriptor(n,i);if("get"in o)Vy(r,i,o),qy(r,(a={},a[i]=Ml,a));else if(typeof o.value=="function")yl(r,i,o.value);else throw new Ue("A view member should either be a function or getter based property")})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Mt(a)?a:this.applySnapshotPreProcessor(a);return x2(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type,a={};return i.forAllProps(function(o,l){a[o]=l.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Tr(Tr({},m0),{name:this.name});return Ft.object(r,fu,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){yl(n,"toString",LI),this.forAllProps(function(i){Hy(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),yp(n,this.willChange),_p(n,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=qe(n.object),a=n.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(Ia(o,n.newValue),n.newValue=o.reconcile(i.getChildNode(a),n.newValue,i,a)),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=qe(n.object),a=i.type.properties[n.name];if(a){var o=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:ko(n.name),value:n.newValue.snapshot,oldValue:o},i)}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=[];return this.forAllProps(function(a){i.push(n.getChildNode(r,a))}),i}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i;if(!(n in this.properties))throw new Ue("Not a value property: "+n);var a=Bi(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw new Ue("Node not available for property "+n);return o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={};return this.forAllProps(function(o,l){try{var u=ca(r.storedValue,o);u.reportObserved()}catch{throw new Ue("".concat(o," property is declared twice"))}a[o]=i.getChildNode(r,o).snapshot}),n?this.applySnapshotPostProcessor(a):a}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){if(!(i.op==="replace"||i.op==="add"))throw new Ue("object does not support operation ".concat(i.op));r.storedValue[n]=i.value}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Ia(this,n);var i=this.applySnapshotPreProcessor(n);this.forAllProps(function(a){r.storedValue[a]=i[a]})}}),Object.defineProperty(t.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.preProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.postProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.properties[r]}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.applySnapshotPreProcessor(r);return gl(a)?v0(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],O2(n,o,i.properties[o]))})):Ln(n,a,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.propertyNames.forEach(function(i){return r(i,n.properties[i])})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return"{ "+this.propertyNames.map(function(n){return n+": "+r.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return fu}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(uu);Qc.prototype.applySnapshot=wr(Qc.prototype.applySnapshot);function NI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new Qc({name:r,properties:n})}function II(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string",n=r?e[0]:"AnonymousModel";return r&&e.shift(),e.reduce(function(i,a){return i.cloneAndEnhance({name:i.name+"_"+a.name,properties:a.properties,initializers:a.initializers,preProcessor:function(o){return a.applySnapshotPreProcessor(i.applySnapshotPreProcessor(o))},postProcessor:function(o){return a.applySnapshotPostProcessor(i.applySnapshotPostProcessor(o))}})}).named(n)}function Z7(e){return an(e)&&(e.flags&ut.Object)>0}var Ya=function(e){Gt(t,e);function t(r,n,i,a){a===void 0&&(a=lI);var o=e.call(this,r)||this;return Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:a}),o.flags=n,o}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Ko(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.initializer(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(du(r)&&this.checker(r))return Rn();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return Ln(n,r,"Value is not a ".concat(i))}}),t}(Yl),Q7=new Ya("string",ut.String,function(e){return typeof e=="string"}),J7=new Ya("number",ut.Number,function(e){return typeof e=="number"}),DI=new Ya("integer",ut.Integer,function(e){return sI(e)}),FI=new Ya("float",ut.Float,function(e){return uI(e)}),jI=new Ya("finite",ut.Finite,function(e){return cI(e)}),eS=new Ya("boolean",ut.Boolean,function(e){return typeof e=="boolean"}),tS=new Ya("null",ut.Null,function(e){return e===null}),rS=new Ya("undefined",ut.Undefined,function(e){return e===void 0}),nS=new Ya("Date",ut.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});nS.getSnapshot=function(e){return e.storedValue.getTime()};var iS=nS;function zI(e){switch(typeof e){case"string":return Q7;case"number":return J7;case"boolean":return eS;case"object":if(e instanceof Date)return iS}throw new Ue("Cannot determine primitive type from value "+e)}function aS(e){return an(e)&&(e.flags&(ut.String|ut.Number|ut.Integer|ut.Boolean|ut.Date))>0}var BI=function(e){Gt(t,e);function t(r){var n=e.call(this,JSON.stringify(r))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ut.Literal}),n.value=r,n}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Ko(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return du(r)&&r===this.value?Rn():Ln(n,r,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),t}(Yl);function oS(e){return new BI(e)}function UI(e){return an(e)&&(e.flags&ut.Literal)>0}var HI=function(e){Gt(t,e);function t(r,n,i,a){var o=e.call(this,r)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_message",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ut.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this._subtype.validate(r,n);if(i.length>0)return i;var a=Mt(r)?qe(r).snapshot:r;return this._predicate(a)?Rn():Ln(n,r,this._message(r))}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(Ua);function GI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():an(e[0])?e[0].name:null,n=e[0],i=e[1],a=e[2]?e[2]:function(o){return"Value does not respect the refinement predicate"};return new HI(r,n,i,a)}function $I(e){return(e.flags&ut.Refinement)>0}function VI(e,t){var r=typeof e=="string"?t:e,n=y0.apply(void 0,da([],fa(r.map(function(i){return oS(""+i)})),!1));return typeof e=="string"&&(n.name=e),n}var qI=function(e){Gt(t,e);function t(r,n,i){var a=e.call(this,r)||this;return Object.defineProperty(a,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=Tr({eager:!0,dispatcher:void 0},i),a._dispatcher=i.dispatcher,i.eager||(a._eager=!1),a}return Object.defineProperty(t.prototype,"flags",{get:function(){var r=ut.Union;return this._types.forEach(function(n){r|=n.flags}),r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._types.some(function(n){return n.isAssignableFrom(r)})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(r){return r.describe()}).join(" | ")+")"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(a,void 0);if(!o)throw new Ue("No matching type for union "+this.describe());return o.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(n,r.getReconciliationType());if(!o)throw new Ue("No matching type for union "+this.describe());return o.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._dispatcher?this._dispatcher(r):n?n.is(r)?n:this._types.filter(function(i){return i!==n}).find(function(i){return i.is(r)}):this._types.find(function(i){return i.is(r)})}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._dispatcher)return this._dispatcher(r).validate(r,n);for(var i=[],a=0,o=0;o<this._types.length;o++){var l=this._types[o],u=l.validate(r,n);if(u.length===0){if(this._eager)return Rn();a++}else i.push(u)}return a===1?Rn():Ln(n,r,"No type is applicable for the union").concat(v0(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(Ua);function y0(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=an(e)?void 0:e,i=an(e)?da([e],fa(t),!1):t,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new qI(a,i,n)}function lS(e){return(e.flags&ut.Union)>0}var WI=function(e){Gt(t,e);function t(r,n,i){var a=e.call(this,r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ut.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(this.optionalValues.indexOf(a)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(r,n,i,o)}return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),i,a)}}),Object.defineProperty(t.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&Ia(this,r),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?Rn():this._subtype.validate(r,n)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(Ua);function YI(e,t){if(typeof t!="function"&&Mt(t))throw new Ue("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function bl(e,t,r){return YI(e,t),new WI(e,t,r||KI)}var KI=[void 0];function XI(e){return an(e)&&(e.flags&ut.Optional)>0}var ZI=bl(rS,void 0),QI=bl(tS,null);function sS(e){return y0(e,ZI)}function JI(e){return y0(e,QI)}var eD=function(e){Gt(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|ut.Late},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._subType){var n=void 0;try{n=this._definition()}catch(i){if(i instanceof ReferenceError)n=void 0;else throw i}if(r&&n===void 0)throw new Ue("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):Rn()}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||A7}}),t}(Ua);function tD(e,t){var r=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?t:e;return new eD(r,n)}function rD(e){return an(e)&&(e.flags&ut.Late)>0}function nD(e,t){return new iD(e,t)}var iD=function(e){Gt(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ut.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Ft.array()}),wm(function(){return i.pendingNodeList.length>0&&i.pendingNodeList.some(function(a){return a.isAlive&&i.options.shouldLoadPredicate(a.parent?a.parent.value:null)})},function(){i.options.loadType().then(wr(function(a){i.loadedType=a,i.pendingNodeList.forEach(function(o){o.parent&&i.loadedType&&o.parent.applyPatches([{op:"replace",path:"/".concat(o.subpath),value:o.snapshot}])})}))}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this;if(this.loadedType)return this.loadedType.instantiate(r,n,i,a);var l=Ko(this,r,n,i,a);return this.pendingNodeList.push(l),wm(function(){return!l.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(l),1)}),l}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.loadedType?this.loadedType.validate(r,n):$7(r)?Rn():Ln(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.loadedType?(r.die(),this.loadedType.instantiate(i,a,i.environment,n)):e.prototype.reconcile.call(this,r,n,i,a)}}),t}(Yl),uS=function(e){Gt(t,e);function t(r){var n=e.call(this,r?"frozen(".concat(r.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ut.Frozen}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Ko(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return $7(r)?this.subType?this.subType.validate(r,n):Rn():Ln(n,r,"Value is not serializable and cannot be frozen")}}),t}(Yl),U4=new uS;function aD(e){return arguments.length===0?U4:an(e)?new uS(e):bl(U4,e)}function oD(e){return an(e)&&(e.flags&ut.Frozen)>0}function lD(e){switch(e){case Pr.beforeDestroy:return"destroy";case Pr.beforeDetach:return"detach";default:return}}var sD=function(){function e(t,r){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),A2(t))this.identifier=t;else if(Mt(t)){var n=qe(t);if(!n.identifierAttribute)throw new Ue("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw new Ue("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new Ue("Can only store references to tree nodes or identifiers, got: '".concat(t,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=Pu(this.identifier),n=t.root,i=n.identifierCache.getLastCacheModificationPerId(r);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var a=this.targetType,o=n.identifierCache.resolve(a,r);if(!o)throw new T2("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(t.path,")"));this.resolvedReference={node:o,lastCacheModification:i}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),T2=function(e){Gt(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return t}(Error),cS=function(e){Gt(t,e);function t(r,n){var i=e.call(this,"reference(".concat(r.name,")"))||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ut.Reference}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.targetType.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return A2(r)?Rn():Ln(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(t.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=n.parent;if(!(!o||!o.isAlive)){var l=o.storedValue;l&&this.onInvalidated({cause:r,parent:l,invalidTarget:a?a.storedValue:void 0,invalidId:i,replaceRef:function(u){su(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){Z7(o.type)?this.replaceRef(void 0):su(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(t.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.getValue(r);if(a){var o=qe(a),l=function(v,w){var b=lD(w);b&&i.fireInvalidated(b,r,n,o)},u=o.registerHook(Pr.beforeDetach,l),f=o.registerHook(Pr.beforeDestroy,l);return function(){u(),f()}}}}),Object.defineProperty(t.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=this;if(this.onInvalidated){var o;r.registerHook(Pr.beforeDestroy,function(){o&&o()});var l=function(u){o&&o();var f=r.parent,v=f&&f.storedValue;if(f&&f.isAlive&&v){var w=void 0;i?w=!!i.get(n,v):w=r.root.identifierCache.has(a.targetType,Pu(n)),w?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===Vr.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(Pr.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(Pr.afterAttach,function(){l(!1)}))}}}),t}(Yl),uD=function(e){Gt(t,e);function t(r,n){return e.call(this,r,n)||this}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=r.storedValue;return n.resolvedValue}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r.storedValue;return n.identifier}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Mt(a)?E7(a):a,l=new sD(a,this.targetType),u=Ko(this,r,n,i,l);return l.node=u,this.watchTargetNodeForInvalidations(u,o,void 0),u}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this){var o=Mt(n),l=r.storedValue;if(!o&&l.identifier===n||o&&l.resolvedValue===n)return r.setParent(i,a),r}var u=this.instantiate(i,a,void 0,n);return r.die(),u}}),t}(cS),cD=function(e){Gt(t,e);function t(r,n,i){var a=e.call(this,r,i)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=this.options.get(r.storedValue,r.parent?r.parent.storedValue:null);return n}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Mt(a)?this.options.set(a,r?r.storedValue:null):a,l=Ko(this,r,n,i,o);return this.watchTargetNodeForInvalidations(l,o,this.options),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Mt(n)?this.options.set(n,r?r.storedValue:null):n;if(!r.isDetaching&&r.type===this&&r.storedValue===o)return r.setParent(i,a),r;var l=this.instantiate(i,a,void 0,o);return r.die(),l}}),t}(cS);function fS(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new cD(e,{get:r.get,set:r.set},n):new uD(e,n)}function fD(e){return(e.flags&ut.Reference)>0}function dD(e,t){var r=fS(e,Tr(Tr({},t),{onInvalidated:function(n){t&&t.onInvalidated&&t.onInvalidated(n),n.removeRef()}}));return t&&t.acceptsUndefined===!1?r:sS(r)}var dS=function(e){Gt(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ut.Identifier}),i}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r||!(r.type instanceof Qc))throw new Ue("Identifier types can only be instantiated as direct child of a model type");return Ko(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(r.storedValue!==n)throw new Ue("Tried to change identifier from '".concat(r.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return r.setParent(i,a),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?Ln(n,r,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):Rn()}}),t}(Yl),hD=function(e){Gt(t,e);function t(){var r=e.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ut.Identifier}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(dS),pD=function(e){Gt(t,e);function t(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),t}(dS),gD=new hD,vD=new pD;function mD(e){return an(e)&&(e.flags&ut.Identifier)>0}function Pu(e){return""+e}function A2(e){return typeof e=="string"||typeof e=="number"}function yD(e){return new bD(e)}var bD=function(e){Gt(t,e);function t(r){var n=e.call(this,r.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ut.Custom}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return Rn();var i=this.options.getValidationMessage(r);return i?Ln(n,r,"Invalid value for type '".concat(this.name,"': ").concat(i)):Rn()}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.options.isTargetType(a)?a:this.options.fromSnapshot(a,r&&r.root.environment);return Ko(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=!this.options.isTargetType(n);if(!r.isDetaching){var l=r.type===this&&(o?n===r.snapshot:n===r.storedValue);if(l)return r.setParent(i,a),r}var u=o?this.options.fromSnapshot(n,i.root.environment):n,f=this.instantiate(i,a,void 0,u);return r.die(),f}}),t}(Yl),H4={enumeration:VI,model:NI,compose:II,custom:yD,reference:fS,safeReference:dD,union:y0,optional:bl,literal:oS,maybe:sS,maybeNull:JI,refinement:GI,string:Q7,boolean:eS,number:J7,integer:DI,float:FI,finite:jI,Date:iS,map:TI,array:kI,frozen:aD,identifier:gD,identifierNumber:vD,late:tD,lazy:nD,undefined:rS,null:tS,snapshotProcessor:PI};const _D=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:PN,addMiddleware:N7,applyAction:k7,applyPatch:su,applySnapshot:_7,cast:kN,castFlowReturn:vI,castToReferenceSnapshot:LN,castToSnapshot:RN,clone:EN,createActionTrackingMiddleware:FN,createActionTrackingMiddleware2:zN,decorate:VN,destroy:xN,detach:ON,escapeJsonPath:ko,flow:Y7,getChildType:oN,getEnv:CN,getIdentifier:E7,getLivelinessChecking:m7,getMembers:AN,getNodeId:MN,getParent:hN,getParentOfType:gN,getPath:S7,getPathParts:vN,getPropertyMembers:P7,getRelativePath:SN,getRoot:w7,getRunningActionContext:E2,getSnapshot:_2,getType:xf,hasEnv:TN,hasParent:dN,hasParentOfType:pN,isActionContextChildOf:YN,isActionContextThisOrChildOf:KN,isAlive:w2,isArrayType:RI,isFrozenType:oD,isIdentifierType:mD,isLateType:rD,isLiteralType:UI,isMapType:AI,isModelType:Z7,isOptionalType:XI,isPrimitiveType:aS,isProtected:fN,isReferenceType:fD,isRefinementType:$I,isRoot:mN,isStateTreeNode:Mt,isType:an,isUnionType:lS,isValidReference:wN,joinJsonPath:qh,onAction:R7,onPatch:b7,onSnapshot:lN,process:aI,protect:uN,recordActions:GN,recordPatches:sN,resolveIdentifier:bN,resolvePath:yN,setLivelinessChecking:v7,setLivelynessChecking:iN,splitJsonPath:hu,t:H4,toGenerator:yI,toGeneratorFunction:mI,tryReference:_N,tryResolve:O7,typecheck:F7,types:H4,unescapeJsonPath:K7,unprotect:cN,walk:x7},Symbol.toStringTag,{value:"Module"})),$i=Do(_D);(function(e){var t=we&&we.__importDefault||function(N){return N&&N.__esModule?N:{default:N}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.usePrevious=e.getLineHeight=e.useFontLoader=e.getDir=e.isRTLText=void 0;const r=t(at),n=Hi,i=Wa,a=Sf,o=ha,l=t(vi),u=nN,f=Ef,v=ua,w=xu,b=hi,h=b2,E=Of,y=ql,m=Wl,p=Yo,g=$i;l.default._fixTextRendering=!0;const d=document.createElement("style");d.type="text/css",document.head.appendChild(d);const _={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function O(N){var H="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+H+"]*?["+H+"]").test(N)}function k(N){N=N.replace(/\s/g,"");let H=0;for(var R=0;R<N.length;R++)O(N[R])&&(H+=1);return H>N.length/2}function C(N){return k(N)?"rtl":"ltr"}e.isRTLText=k,e.getDir=C;const S=(0,n.observer)(({textNodeRef:N,element:H,onBlur:R,selectAll:F,cursorPosition:B})=>{const[D,V]=r.default.useState(_),Y=N.current;r.default.useLayoutEffect(()=>{const Q={};Q.width=Y.width()-2*Y.padding()+"px",Q.height=Y.height()-2*Y.padding()+Y.fontSize()*Y.lineHeight()+"px",Q.fontSize=Y.fontSize()+"px",Q.lineHeight=Y.lineHeight()+.01,Q.fontFamily=Y.fontFamily(),Q.textAlign=Y.align(),Q.color=Y.fill(),Q.fontWeight=H.fontWeight,Q.fontStyle=H.fontStyle,Q.letterSpacing=H.letterSpacing+"em";const ee=`
96
+ .polotno-input::placeholder {
97
+ color: ${D.color};
98
+ opacity: 0.6;
99
+ }
100
+ `;d.innerHTML="",d.appendChild(document.createTextNode(ee)),JSON.stringify(Q)!==JSON.stringify(D)&&V(Q)});const q=r.default.useRef(null);r.default.useEffect(()=>{const Q=setTimeout(()=>{var ee;const te=q.current;if(!te)return;(ee=q.current)===null||ee===void 0||ee.focus();const ae=B||te.value.length;te.selectionStart=te.selectionEnd=ae,F&&(te==null||te.select(),document.execCommand("selectAll",!1,null))});return()=>{clearTimeout(Q)}},[]),r.default.useEffect(()=>{window.addEventListener("blur",R);const Q=ee=>{var te;!((te=q.current)===null||te===void 0)&&te.contains(ee.target)||R()};return window.addEventListener("touchstart",Q),()=>{window.removeEventListener("blur",R),window.removeEventListener("touchstart",Q)}},[]);let G=0;const K=Y.textArr.length*Y.lineHeight()*Y.fontSize();H.verticalAlign==="middle"&&(G=(H.a.height-K)/2),H.verticalAlign==="bottom"&&(G=H.a.height-K);const X=(0,h.removeTags)(H.text);return r.default.createElement(a.Html,null,r.default.createElement("textarea",{className:"polotno-input",ref:q,dir:C(X),style:Object.assign(Object.assign(Object.assign({},_),D),{paddingTop:G+"px"}),value:X,onChange:Q=>{H.set({text:Q.target.value})},placeholder:H.placeholder,onBlur:R}))}),x=N=>{const[H,R]=r.default.useState(!1),F=r.default.useRef(!1);return r.default.useEffect(()=>{var B=!0;return setTimeout(()=>{B&&(N._editModeEnabled&&(F.current=!0),R(!0),setTimeout(()=>{F.current=!1},50))},50),()=>{B=!1}},[]),{editorEnabled:H&&N._editModeEnabled,selectAll:F.current}},P=(N,H)=>{const[R,F]=r.default.useReducer(D=>D+1,0),B=r.default.useRef((0,w.isFontLoaded)(H));return r.default.useLayoutEffect(()=>{if(B.current=(0,w.isFontLoaded)(H),B.current)return;let D=!0;return(async()=>{B.current=!1,F();const V=(0,v.incrementLoader)(`text ${H}`);await N.loadFont(H),setTimeout(V,100),D&&(B.current=!0,F())})(),()=>{D=!1}},[H]),[B.current]};e.useFontLoader=P;const T=({fontLoaded:N,fontFamily:H,fontSize:R,lineHeight:F})=>r.default.useMemo(()=>{if(typeof F=="number")return F;const B=document.createElement("div");B.style.fontFamily=H,B.style.fontSize=R+"px",B.style.lineHeight=F,B.innerText="Test text",document.body.appendChild(B);const D=B.offsetHeight;return document.body.removeChild(B),D/R},[N,H,R,F]);function L(N){var H=N.getAbsoluteTransform().copy();H.invert();var R=N.getStage().getPointerPosition();return H.point(R)}function M(N){var H;const R=N.target,F=L(R),B=R.textArr,D=Math.floor(F.y/(R.fontSize()*R.lineHeight())),V=B.slice(0,D).reduce((G,K)=>G+K.text.length,D),Y=(H=B[D])!==null&&H!==void 0?H:B[0];let q=0;return R.align()==="right"?q=R.width()-Y.width:R.align()==="center"&&(q=R.width()/2-Y.width/2),V+Math.round((F.x-q)/Y.width*Y.text.length)}function U(N){const H=r.default.useRef(N),R=r.default.useRef(N);return r.default.useMemo(()=>{R.current=H.current,H.current=N},[N]),R.current}function $(N){return/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(N)}function Z(N,H){const R=N.fontSize(),F=N.height(),B=(0,h.removeTags)(H.text);let D=H.a.fontSize;N.height(void 0);const V=Math.round(2*H.a.fontSize)-1;for(let Y=1;Y<V;Y++){const q=H.a.height&&N.height()>H.a.height;let G=B.split(`
101
+ `).join(" ").split(/[\s-]+/).reduce((Q,ee)=>$(ee)?Q.concat(ee.split("")):Q.concat(ee),[]),K=N.textArr.map(Q=>Q.text).join(";");const X=G.find(Q=>!K.includes(Q)||(K=K.replace(Q,""),!1));if(!(q||X))break;D-=.5,N.fontSize(D)}return N.fontSize(R),N.height(F),D}function z({lines:N,lineHeight:H,width:R,align:F="left",padding:B=0,cornerRadius:D=0}){var V;N.forEach((K,X)=>{K.cx=R/2,F==="right"?K.cx=R-K.width/2:F==="left"&&(K.cx=K.width/2),F!=="justify"||K.lastInParagraph||(K.width=R),F==="justify"&&(K.cx=K.width/2)});let Y=`M ${(V=N[0])===null||V===void 0?void 0:V.cx} ${-B}`;N.forEach((K,X)=>{const{cx:Q}=K,ee=N[X-1];ee&&ee.width>K.width?Y+=` L ${Q+K.width/2+B} ${X*H+B}`:Y+=` L ${Q+K.width/2+B} ${X*H-B}`;const te=N[X+1];te&&te.width>K.width?Y+=` L ${Q+K.width/2+B} ${(X+1)*H-B}`:Y+=` L ${Q+K.width/2+B} ${(X+1)*H+B}`});for(var q=N.length-1;q>=0;q--){const K=N[q],{cx:X}=K,Q=N[q+1];Q&&Q.width>K.width?Y+=` L ${X-K.width/2-B} ${(q+1)*H-B}`:Y+=` L ${X-K.width/2-B} ${(q+1)*H+B}`;const ee=N[q-1];ee&&ee.width>K.width?Y+=` L ${X-K.width/2-B} ${q*H+B}`:Y+=` L ${X-K.width/2-B} ${q*H-B}`}Y+=" Z";const G=(0,u.parsePath)(Y);return(0,u.roundCommands)(G,D).path}e.getLineHeight=T,e.usePrevious=U,e.TextElement=(0,n.observer)(({element:N,store:H})=>{const R=r.default.useRef(null),F=r.default.useRef(null),{editorEnabled:B,selectAll:D}=x(N),[V,Y]=r.default.useState(!1),[q,G]=r.default.useState(!1),K=r.default.useRef(N.a.height),X=H.selectedElements.indexOf(N)>=0,{textVerticalResizeEnabled:Q}=b.flags,ee=U(N.fontFamily),[te,ae]=r.default.useState([]);r.default.useEffect(()=>{var Ee,Ae;const Ze=(Ae=(Ee=R.current)===null||Ee===void 0?void 0:Ee.textArr)!==null&&Ae!==void 0?Ae:[];JSON.stringify(Ze)!==JSON.stringify(te)&&ae(Ze)}),r.default.useEffect(()=>{if(N.a.width)return;const Ee=R.current;Ee.width(600),N.set({width:1.4*Ee.getTextWidth()})},[]),r.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const Ee=R.current;(0,E.applyFilter)(Ee,N)}));const[oe]=(0,e.useFontLoader)(H,N.fontFamily),se=(0,h.removeTags)(N.text),ke=()=>{const Ee=R.current.clone({height:void 0}),Ae=Math.ceil(Ee.fontSize()*Ee.lineHeight()*Ee.textArr.length+1);return Ee.destroy(),Ae};r.default.useLayoutEffect(()=>{if(!oe)return;const{textOverflow:Ee}=b.flags;if(N.a.height)if(Ee!=="change-font-size"||q||H.isPlaying){if(Ee==="resize"){const Ae=ke();Q&&N.a.height<Ae&&H.history.ignore(()=>{var Ze;(0,g.isAlive)(N)&&N.set({height:Ae}),(Ze=R.current)===null||Ze===void 0||Ze.height(Ae)},!1,!0),Q||N.a.height===Ae||H.history.ignore(()=>{var Ze;(0,g.isAlive)(N)&&N.set({height:Ae}),(Ze=R.current)===null||Ze===void 0||Ze.height(Ae)},!1,!0)}}else{const Ae=Z(R.current,N);if(Ae!==N.a.fontSize)return void H.history.ignore(()=>{N.set({fontSize:Ae})},!1,!0);const Ze=ke();N.a.height===Ze||Q||H.history.ignore(()=>{N.set({height:Ze})},!1,!0)}else{const Ae=ke();H.history.ignore(()=>{N.set({height:Ae})},!1,!0)}}),r.default.useLayoutEffect(()=>{const Ee=R.current;Ee&&(Ee.width(Ee.width()+1e-8),Ee._setTextData(),(0,E.applyFilter)(Ee,N))},[oe]);const Fe=r.default.useRef(null),fe=r.default.useRef(0),ie=Ee=>{Ee.evt.preventDefault(),H.selectedShapes.find(Ze=>Ze===N)&&N.contentEditable&&(fe.current=M(Ee),N.toggleEditMode())},ge=!se&&N.placeholder?.6:N.a.opacity;(0,y.useFadeIn)(R,ge);const pe=(0,e.getLineHeight)({fontLoaded:oe,fontFamily:N.fontFamily,fontSize:N.a.fontSize,lineHeight:N.lineHeight}),re=N.selectable||H.role==="admin",de=(0,f.useColor)(N),be=r.default.useMemo(()=>N.backgroundEnabled?z({lines:JSON.parse(JSON.stringify(te)),cornerRadius:N.backgroundCornerRadius*(N.a.fontSize*pe*.5),lineHeight:pe*N.a.fontSize,padding:N.backgroundPadding*(N.a.fontSize*pe*.5),width:N.a.width,align:N.align}):"",[N.backgroundEnabled,N.backgroundCornerRadius,N.a.fontSize,pe,N.backgroundPadding,N.a.width,N.align,te]),ye=(0,p.useMobile)();let Ie=0;return N.verticalAlign==="middle"?Ie=(N.a.height-te.length*pe*N.a.fontSize)/2:N.verticalAlign==="bottom"&&(Ie=N.a.height-te.length*pe*N.a.fontSize),r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Path,{ref:F,x:N.a.x,y:N.a.y,rotation:N.a.rotation,hideInExport:!N.showInExport,listening:!1,visible:N.backgroundEnabled,opacity:N.backgroundOpacity,data:be,fill:N.backgroundColor,offsetY:-Ie}),r.default.createElement(i.Text,Object.assign({ref:R,id:N.id,name:"element",hideInExport:!N.showInExport,editModeEnabled:N._editModeEnabled,x:N.a.x,y:N.a.y,rotation:N.a.rotation,width:N.a.width,height:N.a.height,text:se||N.placeholder},de,{stroke:N.stroke,lineJoin:"round",strokeWidth:N.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:N.a.fontSize,fontFamily:`"${N.fontFamily}", "${ee}"`,fontStyle:N.fontStyle+" "+N.fontWeight,textDecoration:N.textDecoration,align:N.align,verticalAlign:N.verticalAlign,draggable:ye?N.draggable&&X:N.draggable,preventDefault:!ye||X,opacity:ge,visible:!N._editModeEnabled,ellipsis:b.flags.textOverflow==="ellipsis",shadowEnabled:N.shadowEnabled,shadowBlur:N.shadowBlur,shadowOffsetX:N.shadowOffsetX,shadowOffsetY:N.shadowOffsetY,shadowColor:N.shadowColor,shadowOpacity:N.shadowOpacity,lineHeight:pe,letterSpacing:N.letterSpacing*N.a.fontSize,listening:re,onDragMove:Ee=>{N.set({x:Ee.target.x(),y:Ee.target.y()})},onDragEnd:Ee=>{N.set({x:Ee.target.x(),y:Ee.target.y()})},onMouseEnter:()=>{Y(!0)},onMouseLeave:()=>{Y(!1)},onClick:ie,onTap:ie,onTransformStart:()=>{G(!0),K.current=R.current.height()},onTransform:Ee=>{var Ae,Ze;const We=Ee.target;(Ae=F.current)===null||Ae===void 0||Ae.setAttrs({x:We.x(),y:We.y(),rotation:We.rotation(),scale:We.scale()});const dt=((Ze=We.getStage())===null||Ze===void 0?void 0:Ze.findOne("Transformer")).getActiveAnchor();if(dt==="middle-left"||dt==="middle-right"){const Bt=We.scaleX(),ue=We.width()*Bt,he=N.a.fontSize;let nt=ue;ue<he&&(nt=he,Fe.current&&We.position(Fe.current)),We.width(nt),We.scaleX(1),We.scaleY(1);const Oe=ke();if(b.flags.textOverflow!=="ellipsis"){const je=Math.max(Oe,K.current);We.height(je),N.set({height:We.height()})}N.set({x:We.x(),y:We.y(),width:We.width(),rotation:We.rotation()}),(0,E.applyFilter)(We,N)}if(dt==="top-center"||dt==="bottom-center"){let Bt=b.flags.textOverflow==="resize"?ke():pe*N.a.fontSize;Ee.target.height(Math.max(Bt,Ee.target.height()*Ee.target.scaleY())),Ee.target.scaleY(1)}Fe.current=Ee.target.position()},onTransformEnd:Ee=>{var Ae;const Ze=Ee.target.scaleX();Ee.target.scaleX(1),Ee.target.scaleY(1),N.set({fontSize:Math.round(N.a.fontSize*Ze),width:Math.ceil(Ee.target.width()*Ze),x:Ee.target.x(),y:Ee.target.y(),rotation:Ee.target.rotation(),height:Ee.target.height()*Ze,shadowBlur:N.shadowBlur*Ze,shadowOffsetX:N.shadowOffsetX*Ze,shadowOffsetY:N.shadowOffsetY*Ze,strokeWidth:N.strokeWidth*Ze}),(Ae=F.current)===null||Ae===void 0||Ae.setAttrs({scaleX:1,scaleY:1}),G(!1)}})),B&&r.default.createElement(i.Group,{x:N.a.x,y:N.a.y,rotation:N.a.rotation},r.default.createElement(S,{textNodeRef:R,element:N,selectAll:D,cursorPosition:fe.current,onBlur:()=>{N.toggleEditMode(!1)}})),!q&&(V||X)&&r.default.createElement(m.Highlighter,{element:N}))})})(v2);var k2={},Cu={};(function(e){var t=we&&we.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSvgColors=e.replaceColors=e.sameColors=e.fixSize=e.getSvgSize=e.svgToURL=e.getColors=e.urlToString=e.urlToBase64=void 0;const r=t(vi),n=t(at),i=m2;function a(d){for(;d.parentNode;){if(d.nodeName==="defs")return!0;d=d.parentNode}return!1}function o(d){const _={fill:"",stroke:""};if(d.getAttribute("fill")&&d.getAttribute("fill")!=="none"&&(_.fill=d.getAttribute("fill")),!_.fill&&d.style.fill&&d.style.fill!=="none"&&(_.fill=d.style.fill),d.getAttribute("stroke")&&(_.stroke=d.getAttribute("stroke")),!_.stroke&&d.style.stroke&&(_.stroke=d.style.stroke),!_.stroke&&!_.fill){const O=d.ownerSVGElement,k=O&&O!==d&&o(O);(k==null?void 0:k.fill)==="currentColor"||(k==null?void 0:k.stroke)==="currentColor"||(_.fill="black")}return _}const l=["path","rect","circle"];function u(d){for(var _=[],O=d.getElementsByTagName("*"),k=0,C=O.length;k<C;k++){const S=O[k];a(S)||(S.getAttribute("fill")!==null&&_.push(S),(S.getAttribute("stroke")!==null||S.style&&S.style.fill||l.indexOf(S.nodeName)>=0)&&_.push(S))}return _}async function f(d){const _=await fetch(d);return b(await _.text())}async function v(d){return await(await fetch(d,{mode:"cors"})).text()}function w(d){const _=u(new DOMParser().parseFromString(d,"image/svg+xml")),O=[];return _.forEach(k=>{const{fill:C,stroke:S}=o(k);[C,S].forEach(x=>{x&&(x==="currentColor"&&(x="black"),r.default.Util.colorToRGBA(x)&&O.indexOf(x)===-1&&O.push(x))})}),O}function b(d){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(d)))}async function h(d){const _=await v(d),O=new DOMParser().parseFromString(_,"image/svg+xml").documentElement.getAttribute("viewBox"),[k,C,S,x]=(O==null?void 0:O.split(" "))||[];return{width:parseFloat(S),height:parseFloat(x)}}function E(d){var _=new DOMParser().parseFromString(d,"image/svg+xml");const O=_.documentElement.getAttribute("viewBox"),[k,C,S,x]=(O==null?void 0:O.split(" "))||[],P=_.documentElement.getAttribute("width");!P&&_.documentElement.setAttribute("width",S+"px");const T=_.documentElement.getAttribute("height");if((!T||T.indexOf("%")>=0)&&_.documentElement.setAttribute("height",x+"px"),P&&P.indexOf("%")>=0&&T&&T.indexOf("%")===-1){const L=parseFloat(T)/parseFloat(x);_.documentElement.setAttribute("width",L*parseFloat(S)+"px")}if(T&&T.indexOf("%")>=0&&P&&P.indexOf("%")===-1){const L=parseFloat(P)/parseFloat(S);_.documentElement.setAttribute("height",L*parseFloat(x)+"px")}return P==="100%"&&T==="100%"&&(_.documentElement.setAttribute("width",S+"px"),_.documentElement.setAttribute("height",x+"px")),new XMLSerializer().serializeToString(_)}e.urlToBase64=f,e.urlToString=v,e.getColors=w,e.svgToURL=b,e.getSvgSize=h,e.fixSize=E;const y=(d,_)=>{if(!d||!_)return!1;if(_==="currentColor"&&d==="black")return!0;const O=r.default.Util.colorToRGBA(d),k=r.default.Util.colorToRGBA(_);return O&&k?O.r===k.r&&O.g===k.g&&O.b===k.b&&O.a===k.a:void 0};function m(d,_,O,k){var C=d.namespaceURI,S=document.createElementNS(C,"linearGradient");const x=r.default.Util.degToRad(O+90),P=(Math.cos(x)+1)/2,T=(Math.sin(x)+1)/2,L=(Math.cos(x+Math.PI)+1)/2,M=(Math.sin(x+Math.PI)+1)/2;S.setAttribute("x1",100*P+"%"),S.setAttribute("y1",100*T+"%"),S.setAttribute("x2",100*L+"%"),S.setAttribute("y2",100*M+"%"),S.setAttribute("gradientUnits","userSpaceOnUse"),S.setAttribute("id",_);for(var U=0;U<k.length;U++){var $=k[U],Z=document.createElementNS(C,"stop");for(var z in $)$.hasOwnProperty(z)&&Z.setAttribute(z,$[z]);S.appendChild(Z)}return(d.querySelector("defs")||d.insertBefore(document.createElementNS(C,"defs"),d.firstChild)).appendChild(S)}function p(d,_){var O=new DOMParser().parseFromString(d,"image/svg+xml");const k=u(O),C=Array.from(_.keys());return k.forEach(S=>{const{fill:x,stroke:P}=o(S);[{prop:"fill",color:x},{prop:"stroke",color:P}].forEach(({prop:T,color:L})=>{const M=C.find(U=>(0,e.sameColors)(U,L));if(M){const U=_.get(M);if((0,i.isGradient)(U)){const{rotation:$,stops:Z}=(0,i.parseColor)(U),z=Z.map(H=>({offset:100*H.offset+"%","stop-color":H.color})),N="color"+Math.round(1e8*Math.random());m(O.children[0],N,$,z),S.style[T]=null,S.setAttribute(T,`url('#${N}')`)}else S.style[T]=_.get(M)}})}),b(new XMLSerializer().serializeToString(O))}e.sameColors=y,e.replaceColors=p;const g=d=>{const[_,O]=n.default.useState([]);return n.default.useEffect(()=>{let k=!1;return(async()=>{O([]);const C=w(await v(d));k||O(C)})(),()=>{k=!0}},[d]),_};e.useSvgColors=g})(Cu);(function(e){var t=we&&we.__createBinding||(Object.create?function(D,V,Y,q){q===void 0&&(q=Y);var G=Object.getOwnPropertyDescriptor(V,Y);G&&!("get"in G?!V.__esModule:G.writable||G.configurable)||(G={enumerable:!0,get:function(){return V[Y]}}),Object.defineProperty(D,q,G)}:function(D,V,Y,q){q===void 0&&(q=Y),D[q]=V[Y]}),r=we&&we.__setModuleDefault||(Object.create?function(D,V){Object.defineProperty(D,"default",{enumerable:!0,value:V})}:function(D,V){D.default=V}),n=we&&we.__importStar||function(D){if(D&&D.__esModule)return D;var V={};if(D!=null)for(var Y in D)Y!=="default"&&Object.prototype.hasOwnProperty.call(D,Y)&&t(V,D,Y);return r(V,D),V},i=we&&we.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(at),o=Hi,l=ha,u=Wa,f=i(g0),v=i(vi),w=Sf,b=Wl,h=ua,E=n(Cu),y=hi,m=Of,p=ql,g=Yo;function d(){return document.createElement("canvas")}async function _(D){if(!(D.indexOf("data:image/svg+xml")>=0||D.indexOf(".svg")>=0))return D;const V=await E.urlToString(D),Y=E.fixSize(V);return E.svgToURL(Y)}const O=D=>{const[V,Y]=a.default.useState(D);return a.default.useEffect(()=>{(async()=>{const q=await _(D);q!==V&&Y(q)})()},[D]),V};function k(D,V){return Math.sqrt(Math.pow(V.x-D.x,2)+Math.pow(V.y-D.y,2))}function C(D,V){return{x:(D.x+V.x)/2,y:(D.y+V.y)/2}}const S=(D,V,Y)=>{const q=a.default.useMemo(()=>{var G,K;const{flipX:X,flipY:Q}=D,ee=D.type==="svg"||D.src.indexOf("data:image/svg+xml")>=0||D.src.indexOf(".svg")>=0,te=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&ee||D.maskSrc;if(!X&&!Q&&!te)return V;if(!V||!V.width||!V.height)return null;const ae=d();let oe=1;D.type==="svg"&&(oe=Math.max(D.a.width/V.width*Y,D.a.height/V.height*Y)),ae.width=Math.max(V.width*oe,1),ae.height=Math.max(V.height*oe,1);let se=X?-ae.width:0,ke=Q?-ae.height:0;return(G=ae.getContext("2d"))===null||G===void 0||G.scale(X?-1:1,Q?-1:1),(K=ae.getContext("2d"))===null||K===void 0||K.drawImage(V,se,ke,ae.width,ae.height),ae},[D.maskSrc,D.flipX,D.flipY,V,D.a.width,D.a.height,Y]);return a.default.useEffect(()=>()=>{q&&q.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(q)},[q]),q};function x(D,V){const Y=V.width/V.height;let q,G;return Y>=D.width/D.height?(q=D.width,G=D.width/Y):(q=D.height*Y,G=D.height),{x:(D.width-q)/2,y:(D.height-G)/2,width:q,height:G}}function P(D,V,Y,q,G,K,X){for(var Q=new ImageData(V,Y),ee=new Int32Array(D.data.buffer),te=D.width,ae=new Int32Array(Q.data.buffer),oe=Q.width,se=V/K,ke=Y/X,Fe=Math.round(1/se),fe=Math.round(1/ke),ie=Fe*fe,ge=0;ge<Q.height;ge++)for(var pe=0;pe<oe;pe++){for(var re=q+Math.round(pe/se)+(G+Math.round(ge/ke))*te,de=0,be=0,ye=0,Ie=0,Ee=0;Ee<fe;Ee++)for(var Ae=0;Ae<Fe;Ae++){var Ze=ee[re+Ae+Ee*te];de+=Ze<<24>>>24,be+=Ze<<16>>>24,ye+=Ze<<8>>>24,Ie+=Ze>>>24}de=Math.round(de/ie),be=Math.round(be/ie),ye=Math.round(ye/ie),Ie=Math.round(Ie/ie),ae[pe+ge*oe]=Ie<<24|ye<<16|be<<8|de}return Q}function T(D,V){var Y,q;const G=d();G.width=D.width,G.height=D.height;const K=Math.max(1,Math.floor(G.width*V)),X=Math.max(1,Math.floor(G.height*V));(Y=G.getContext("2d"))===null||Y===void 0||Y.drawImage(D,0,0,G.width,G.height);const Q=P(G.getContext("2d").getImageData(0,0,G.width,G.height),K,X,0,0,G.width,G.height);return G.width=K,G.height=X,(q=G.getContext("2d"))===null||q===void 0||q.putImageData(Q,0,0),G}const L=(D,V)=>{const[Y,q]=N(D.maskSrc,"anonymous"),G=D.maskSrc?q:"loaded";return(0,e.useImageLoader)(G,D.id+"-mask"),a.default.useMemo(()=>{if(!Y||!V||!V.width||!V.height)return V;const K=d();K.width=Math.max(V.width,1),K.height=Math.max(V.height,1);const X=K.getContext("2d");if(!X)return V;X.drawImage(V,0,0),X.globalCompositeOperation="source-in";const Q=x(Y,D);return X.drawImage(Y,Q.x,Q.y,Q.width,Q.height,0,0,V.width,V.height),K},[V,Y,D.a.width,D.a.height])},M=(D,V,Y,q,G=0,K=!1)=>{const X=Math.floor(Math.max(D.a.width*q,1)),Q=Math.floor(Math.max(D.a.height*q,1)),ee=Math.min(G*q,X/2,Q/2),te=Math.max(D.a.width/Y.width,D.a.height/Y.height)*q,ae=D.page._exportingOrRendering&&y.flags.imageDownScalingEnabled&&te<1&&!K,oe=Y.x===0&&Y.y===0&&Y.width===(V==null?void 0:V.width)&&Y.height===(V==null?void 0:V.height),se=a.default.useMemo(()=>{if(!(!V||!V.width||!V.height))return oe&&ee===0&&!ae?void 0:d()},[V,ee,ae,oe]);return a.default.useLayoutEffect(()=>{if(!se||!V)return;se.width=X,se.height=Q;const ke=se.getContext("2d");if(!ke)return;ee&&(ke.beginPath(),ke.moveTo(ee,0),ke.lineTo(X-ee,0),ke.arc(X-ee,ee,ee,3*Math.PI/2,0,!1),ke.lineTo(X,Q-ee),ke.arc(X-ee,Q-ee,ee,0,Math.PI/2,!1),ke.lineTo(ee,Q),ke.arc(ee,Q-ee,ee,Math.PI/2,Math.PI,!1),ke.lineTo(0,ee),ke.arc(ee,ee,ee,Math.PI,3*Math.PI/2,!1),ke.clip());const Fe=ae?T(V,te):V,fe=ae?{x:Math.floor(Y.x*te),y:Math.floor(Y.y*te),width:Math.floor(Y.width*te),height:Math.floor(Y.height*te)}:Y;ke.drawImage(Fe,fe.x,fe.y,fe.width,fe.height,0,0,se.width,se.height)},[se,D.a.width,D.a.height,Y.x,Y.y,Y.width,Y.height,G,q,K,D.page._exportingOrRendering,ae]),a.default.useEffect(()=>()=>{se&&se.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(se)},[se]),se||V},U=(D,V,Y,q)=>{const G=O(D.clipSrc||""),[K,X]=N(G,"anonymous"),Q=D.clipSrc?X:"loaded";(0,e.useImageLoader)(Q,D.id+"-clip");const ee=a.default.useMemo(()=>{if(V&&K)return d()},[V,K]);return a.default.useLayoutEffect(()=>{var te;if(!K||!V||!V.width||!V.height||!K||!K.width||!K.height||!ee)return;const ae=d(),oe=Math.max(D.a.width/K.width*Y,D.a.height/K.height*Y);ae.width=K.width*oe,ae.height=K.height*oe,(te=ae.getContext("2d"))===null||te===void 0||te.drawImage(K,0,0,ae.width,ae.height),ee.width=Math.max(V.width,1),ee.height=Math.max(V.height,1);const se=ee.getContext("2d");se&&(se.save(),se.drawImage(ae,0,0,V.width,V.height),v.default.Util.releaseCanvas(ae),se.globalCompositeOperation="source-in",se.drawImage(V,0,0,ee.width,ee.height),se.restore())},[ee,V,K,D.a.width,D.a.height,Y,...q]),D.clipSrc&&K?ee:V},$=d(),Z=(0,o.observer)(({element:D})=>{const V=Math.min(30,D.a.width/4,D.a.height/4),Y=a.default.useRef(null);return a.default.useEffect(()=>{const q=Y.current;if(!q)return;const G=new v.default.Animation(K=>{q.rotate(((K==null?void 0:K.timeDiff)||0)/2)},q.getLayer());return G.start(),()=>{G.stop()}}),a.default.createElement(u.Group,{x:D.x,y:D.y,rotation:D.rotation,listening:!1,opacity:D.a.opacity,hideInExport:!D.showInExport},a.default.createElement(u.Rect,{width:D.a.width,height:D.a.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:Y,x:D.a.width/2,y:D.a.height/2,fill:"white",outerRadius:Math.abs(V),innerRadius:Math.max(1,V-5),angle:270}))}),z=(0,o.observer)(({element:D})=>{const V="Can not load the image...",Y=Math.max(10,Math.min(30,D.a.width/25));return a.default.createElement(u.Group,{x:D.x,y:D.y,rotation:D.rotation,listening:!1,opacity:D.a.opacity,hideInExport:!D.showInExport},a.default.createElement(u.Rect,{width:D.a.width,height:D.a.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:V,fontSize:Y,width:D.a.width,height:D.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let N=f.default;const H=D=>{N=D};e.setImageLoaderHook=H;const R=(D,V)=>{const Y=a.default.useRef(),q=()=>{var G;(G=Y.current)===null||G===void 0||G.call(Y),Y.current=void 0};a.default.useEffect(()=>q,[]),a.default.useLayoutEffect(()=>{D!=="loading"||Y.current||(Y.current=(0,h.incrementLoader)(`image ${V}`)),D!=="loading"&&q(),D==="failed"&&(0,h.triggerLoadError)(`image ${V}`)},[D])};e.useImageLoader=R;const F=({image:D,status:V,type:Y})=>{const q=a.default.useRef();return a.default.useEffect(()=>{q.current=D||q.current},[D]),V!=="failed"||V!=="failed"&&Y==="svg"?q.current:void 0},B=D=>{const[V,Y]=a.default.useReducer(X=>X+1,0),q=a.default.useRef("loading"),G=a.default.useRef(D.src),K=a.default.useRef(D.src);return K.current!==D.src&&(K.current=D.src,q.current="loading"),a.default.useEffect(()=>{if(D.type!=="svg"||!D.src)return;let X=!1;return(async()=>{q.current="loading",Y();const Q=await E.urlToString(D.src),ee=E.fixSize(Q),te=E.replaceColors(ee,D.colorsReplace);X||(G.current=te,q.current="loaded",Y())})(),()=>{X=!0}},[D.src,JSON.stringify(D.colorsReplace)]),D.type!=="svg"?[D.src,"loaded"]:[G.current,q.current]};e.ImageElement=(0,o.observer)(({element:D,store:V})=>{var Y;const[q,G]=a.default.useState(!1),K=a.default.useRef(null),X=a.default.useRef(null),[Q,ee]=a.default.useState(!1),te=V.selectedElements.indexOf(D)>=0,[ae,oe]=B(D),[se,ke]=N(ae,"anonymous"),Fe=D.type!=="svg"||oe==="loaded"?ke:"loading";(0,e.useImageLoader)(Fe,D.id);const fe=F({image:se,status:ke,type:D.type}),ie=L(D,S(D,se||fe,V._elementsPixelRatio))||$;let{cropX:ge,cropY:pe,cropWidth:re,cropHeight:de}=D;ke!=="loaded"&&(ge=pe=0,re=de=1);const be=ie.width*re,ye=ie.height*de,Ie=D.a.width/D.a.height;let Ee,Ae;const Ze=be/ye,We=D.type==="svg";We?(Ee=be,Ae=ye):Ie>=Ze?(Ee=be,Ae=be/Ie):(Ee=ye*Ie,Ae=ye);const dt={x:ie.width*ge,y:ie.height*pe,width:Ee,height:Ae},Bt=(Y=D.cornerRadius)!==null&&Y!==void 0?Y:0,ue=D.page._exportingOrRendering?1:Math.min(2,V.scale),he=V._elementsPixelRatio*ue;let nt=U(D,M(D,ie,dt,he,Bt,q||D._cropModeEnabled||D.type==="svg"),he,[dt,Bt,he]);const Oe=Math.max(D.a.width/Ee,D.a.height/Ae);a.default.useEffect(()=>{var De;if(!D._cropModeEnabled)return;const it=(De=K.current)===null||De===void 0?void 0:De.getStage();function Qe(tt){D._cropModeEnabled&&tt.target!==X.current&&D.toggleCropMode(!1)}function kt(tt){D._cropModeEnabled&&tt.target.parentNode!==it.content&&D.toggleCropMode(!1)}return document.body.addEventListener("click",kt),it==null||it.on("click",Qe),it==null||it.on("tap",Qe),()=>{document.body.removeEventListener("click",kt),document.body.removeEventListener("touchstart",kt),it==null||it.off("click",Qe),it==null||it.off("click",Qe)}},[D._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(q||D._cropModeEnabled))return(0,m.applyFilter)(K.current,D),(0,l.autorun)(()=>{(0,m.applyFilter)(K.current,D)},{delay:100})},[nt,D.page._exportingOrRendering,q,re,de,D._cropModeEnabled]),a.default.useLayoutEffect(()=>{var De;q||D._cropModeEnabled?(De=K.current)===null||De===void 0||De.clearCache():(0,m.applyFilter)(K.current,D)},[q,D.a.width,D.a.height,D._cropModeEnabled]),a.default.useEffect(()=>{(0,m.applyFilter)(K.current,D)},[D.shadowEnabled,D.shadowBlur,D.cornerRadius,D.shadowColor,D.shadowOffsetX,D.shadowOffsetY,D.shadowOpacity]);const je=a.default.useRef(null),Le=a.default.useRef(null),Se=a.default.useRef(null);a.default.useLayoutEffect(()=>{D._cropModeEnabled&&(Le.current.nodes([je.current]),Se.current.nodes([X.current]))},[D._cropModeEnabled]);var Je=a.default.useRef(null),xe=a.default.useRef(0),Ke=a.default.useRef(!1);const Sr=De=>{var it;((it=De.evt.touches)===null||it===void 0?void 0:it.length)>2&&De.target.stopDrag(),Math.round(De.target.x())>0&&(De.target.x(0),De.target.scaleX(1)),Math.round(De.target.y())>0&&(De.target.y(0),De.target.scaleY(1));const Qe=De.target.width()*De.target.scaleX(),kt=De.target.height()*De.target.scaleY(),tt=Math.min(1,Ee/Qe),fr=Math.min(1,Ae/kt),ht=1-tt,$t=Math.min(ht,Math.max(0,Math.round(-De.target.x())/Qe)),Br=1-fr,vr=Math.min(Br,Math.max(0,Math.round(-De.target.y())/kt));De.target.setAttrs({x:-$t*ie.width,y:-vr*ie.height,scaleX:1,scaleY:1}),D.set({cropX:$t,cropY:vr,cropWidth:tt,cropHeight:fr})},Pe=()=>{D.type!=="svg"&&D.contentEditable&&setTimeout(()=>{D.toggleCropMode(!0)})},He=D.type==="svg"&&fe,et=ke==="loading"&&!He,Et=ke==="failed",xt=!et&&!Et,ar=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Rr=xt?D.a.opacity:0;(0,p.useFadeIn)(K,Rr);const Lr=D.selectable||V.role==="admin",ln=(0,g.useMobile)();return a.default.createElement(a.default.Fragment,null,et&&a.default.createElement(Z,{element:D}),Et&&a.default.createElement(z,{element:D}),a.default.createElement(u.Image,{ref:K,name:"element",id:D.id,image:nt,x:D.a.x,y:D.a.y,width:D.a.width||1,height:D.a.height||1,rotation:D.rotation,opacity:Rr,shadowEnabled:D.shadowEnabled,shadowBlur:D.shadowBlur,shadowOffsetX:D.shadowOffsetX,shadowOffsetY:D.shadowOffsetY,shadowColor:D.shadowColor,shadowOpacity:D.shadowOpacity,customCrop:dt,listening:Lr,draggable:ln?D.draggable&&te:D.draggable,preventDefault:!ln||te,hideInExport:!D.showInExport,onMouseEnter:()=>{ee(!0)},onMouseLeave:()=>{ee(!1)},onDragMove:De=>{D.set({x:De.target.x(),y:De.target.y()})},onDragEnd:De=>{D.set({x:De.target.x(),y:De.target.y()})},onDblClick:Pe,onDblTap:Pe,onTransformStart:()=>{G(!0),ar.current={cropX:D.cropX,cropY:D.cropY,cropWidth:D.cropWidth,cropHeight:D.cropHeight}},onTransform:De=>{var it;const Qe=De.currentTarget,kt=Math.abs(Qe.scaleX()-1)<1e-7?1:Qe.scaleX(),tt=Math.abs(Qe.scaleY()-1)<1e-7?1:Qe.scaleY();Qe.scaleX(1),Qe.scaleY(1);const fr=(it=De.target.getStage())===null||it===void 0?void 0:it.findOne("Transformer"),ht=1-Ee/ie.width,$t=Math.min(ht,Math.max(0,D.cropX)),Br=1-Ae/ie.height,vr=Math.min(Br,Math.max(0,D.cropY)),Mr=fr.getActiveAnchor(),Mn=!(Mr.indexOf("middle")>=0||Mr.indexOf("center")>=0),mi=!Mn&&kt<1&&ar.current.cropHeight>Ae/ie.height;let mn=Mn?D.cropWidth:D.cropWidth*kt;mi&&(mn=D.cropWidth);const sn=!Mn&&tt<1&&ar.current.cropWidth>Ee/ie.width;let Kn=Mn?D.cropHeight:D.cropHeight*tt;sn&&(Kn=D.cropHeight),We&&(mn=D.cropWidth,Kn=D.cropHeight),D.set({cropX:$t,cropY:vr,x:Qe.x(),y:Qe.y(),width:Qe.width()*kt,height:Qe.height()*tt,rotation:De.target.rotation(),cropWidth:Math.min(mn,1-$t),cropHeight:Math.min(Kn,1-vr)})},onTransformEnd:De=>{const it=De.currentTarget;D.set({width:it.width(),height:it.height(),x:it.x(),y:it.y(),rotation:De.target.rotation(),cropWidth:Ee/ie.width,cropHeight:Ae/ie.height}),G(!1)}}),a.default.createElement(u.Rect,{x:D.x,y:D.y,width:Math.max(D.a.width-D.borderSize,0),height:Math.max(D.a.height-D.borderSize,0),opacity:Rr,offsetX:-D.borderSize/2,offsetY:-D.borderSize/2,stroke:D.borderColor,strokeWidth:D.borderSize,listening:!1,visible:!!D.borderSize,rotation:D.rotation,cornerRadius:Math.max(0,Bt-D.borderSize),hideInExport:!D.showInExport}),D._cropModeEnabled&&a.default.createElement(w.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/V.scale,y:-window.innerWidth/V.scale,width:window.innerWidth/V.scale*3,height:window.innerWidth/V.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:nt,x:D.x,y:D.y,width:D.a.width,height:D.a.height,rotation:D.rotation,shadowEnabled:D.shadowEnabled,shadowBlur:D.shadowBlur}),a.default.createElement(u.Group,{x:D.x,y:D.y,rotation:D.rotation,scaleX:Oe,scaleY:Oe},a.default.createElement(u.Image,{image:ie,ref:X,opacity:.4,draggable:!0,x:-D.cropX*ie.width,y:-D.cropY*ie.height,onDragMove:Sr,onTransform:Sr,onTouchMove:De=>{De.evt.preventDefault();const it=De.target.getStage().getPointersPositions();var Qe=it[0],kt=it[1];const tt=De.target;if(Qe&&!kt&&!tt.isDragging()&&Ke.current&&(tt.startDrag(),Ke.current=!1),Qe&&kt){v.default.hitOnDragEnabled=!0,tt.isDragging()&&(Ke.current=!0,tt.stopDrag());const sn=De.target.getAbsoluteTransform().copy();sn.invert();var fr={x:Qe.x,y:Qe.y},ht={x:kt.x,y:kt.y};if(!Je.current)return void(Je.current=C(fr,ht));var $t=C(fr,ht),Br=k(fr,ht);xe.current||(xe.current=Br);const Kn=tt.position();var vr={x:$t.x-Kn.x,y:$t.y-Kn.y},Mr=Br/xe.current;tt.scaleX(Mr),tt.scaleY(Mr);const Ka=sn.point($t),yi=sn.point(Je.current);var Mn=Ka.x-yi.x,mi=Ka.y-yi.y,mn={x:Math.min(0,$t.x-vr.x*Mr+Mn),y:Math.min(0,$t.y-vr.y*Mr+mi)};tt.position(mn),xe.current=Br,Je.current=$t,Sr(De)}},onTouchEnd:De=>{xe.current=0,Je.current=null,v.default.hitOnDragEnabled=!1}}),a.default.createElement(u.Transformer,{ref:Se,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(De,it)=>it.width<5||it.height<5?De:it,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:Ee,height:Ae,ref:je,listening:!1,onTransform:De=>{De.target.x()<-D.cropX*ie.width-1e-9&&(De.target.x(-D.cropX*ie.width),De.target.scaleX(1)),De.target.y()<-D.cropY*ie.height-1e-9&&(De.target.y(-D.cropY*ie.height),De.target.scaleY(1));const it=Math.min(1,Math.max(0,D.cropX+De.target.x()/ie.width)),Qe=Math.min(1,Math.max(0,De.target.y()/ie.height+D.cropY)),kt=De.target.width()*De.target.scaleX(),tt=De.target.height()*De.target.scaleY(),fr=Math.min(1-it,kt/ie.width),ht=Math.min(1-Qe,tt/ie.height),$t=De.target.getAbsolutePosition(De.target.getParent().getParent());De.target.scale({x:1,y:1}),De.target.position({x:0,y:0}),D.set({x:$t.x,y:$t.y,cropX:it,cropY:Qe,cropWidth:fr,cropHeight:ht,width:Math.min(kt*Oe,ie.width*(1-it)*Oe),height:Math.min(tt*Oe,ie.height*(1-Qe)*Oe)})}}),a.default.createElement(u.Transformer,{ref:Le,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(De,it)=>it.width<5||it.height<5?De:it,visible:D.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(Q||te)&&a.default.createElement(b.Highlighter,{element:D}))})})(k2);var hS={},pS={exports:{}};/*!
102
+ * Quill Editor v1.3.7
103
+ * https://quilljs.com/
104
+ * Copyright (c) 2014, Jason Chen
105
+ * Copyright (c) 2013, salesforce.com
106
+ */(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:we,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,l){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:l})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(18),l=i(19),u=i(45),f=i(46),v=i(47),w=i(48),b=i(49),h=i(12),E=i(32),y=i(33),m=i(31),p=i(1),g={Scope:p.Scope,create:p.create,find:p.find,query:p.query,register:p.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:w.default,Scroll:u.default,Block:v.default,Inline:f.default,Text:b.default,Attributor:{Attribute:h.default,Class:E.default,Style:y.default,Store:m.default}};n.default=g},function(r,n,i){var a=this&&this.__extends||function(){var m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,g){p.__proto__=g}||function(p,g){for(var d in g)g.hasOwnProperty(d)&&(p[d]=g[d])};return function(p,g){m(p,g);function d(){this.constructor=p}p.prototype=g===null?Object.create(g):(d.prototype=g.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(m){a(p,m);function p(g){var d=this;return g="[Parchment] "+g,d=m.call(this,g)||this,d.message=g,d.name=d.constructor.name,d}return p}(Error);n.ParchmentError=o;var l={},u={},f={},v={};n.DATA_KEY="__blot";var w;(function(m){m[m.TYPE=3]="TYPE",m[m.LEVEL=12]="LEVEL",m[m.ATTRIBUTE=13]="ATTRIBUTE",m[m.BLOT=14]="BLOT",m[m.INLINE=7]="INLINE",m[m.BLOCK=11]="BLOCK",m[m.BLOCK_BLOT=10]="BLOCK_BLOT",m[m.INLINE_BLOT=6]="INLINE_BLOT",m[m.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",m[m.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",m[m.ANY=15]="ANY"})(w=n.Scope||(n.Scope={}));function b(m,p){var g=E(m);if(g==null)throw new o("Unable to create "+m+" blot");var d=g,_=m instanceof Node||m.nodeType===Node.TEXT_NODE?m:d.create(p);return new d(_,p)}n.create=b;function h(m,p){return p===void 0&&(p=!1),m==null?null:m[n.DATA_KEY]!=null?m[n.DATA_KEY].blot:p?h(m.parentNode,p):null}n.find=h;function E(m,p){p===void 0&&(p=w.ANY);var g;if(typeof m=="string")g=v[m]||l[m];else if(m instanceof Text||m.nodeType===Node.TEXT_NODE)g=v.text;else if(typeof m=="number")m&w.LEVEL&w.BLOCK?g=v.block:m&w.LEVEL&w.INLINE&&(g=v.inline);else if(m instanceof HTMLElement){var d=(m.getAttribute("class")||"").split(/\s+/);for(var _ in d)if(g=u[d[_]],g)break;g=g||f[m.tagName]}return g==null?null:p&w.LEVEL&g.scope&&p&w.TYPE&g.scope?g:null}n.query=E;function y(){for(var m=[],p=0;p<arguments.length;p++)m[p]=arguments[p];if(m.length>1)return m.map(function(_){return y(_)});var g=m[0];if(typeof g.blotName!="string"&&typeof g.attrName!="string")throw new o("Invalid definition");if(g.blotName==="abstract")throw new o("Cannot register abstract class");if(v[g.blotName||g.attrName]=g,typeof g.keyName=="string")l[g.keyName]=g;else if(g.className!=null&&(u[g.className]=g),g.tagName!=null){Array.isArray(g.tagName)?g.tagName=g.tagName.map(function(_){return _.toUpperCase()}):g.tagName=g.tagName.toUpperCase();var d=Array.isArray(g.tagName)?g.tagName:[g.tagName];d.forEach(function(_){(f[_]==null||g.className==null)&&(f[_]=g)})}return g}n.register=y},function(r,n,i){var a=i(51),o=i(11),l=i(3),u=i(20),f="\0",v=function(w){Array.isArray(w)?this.ops=w:w!=null&&Array.isArray(w.ops)?this.ops=w.ops:this.ops=[]};v.prototype.insert=function(w,b){var h={};return w.length===0?this:(h.insert=w,b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(h.attributes=b),this.push(h))},v.prototype.delete=function(w){return w<=0?this:this.push({delete:w})},v.prototype.retain=function(w,b){if(w<=0)return this;var h={retain:w};return b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(h.attributes=b),this.push(h)},v.prototype.push=function(w){var b=this.ops.length,h=this.ops[b-1];if(w=l(!0,{},w),typeof h=="object"){if(typeof w.delete=="number"&&typeof h.delete=="number")return this.ops[b-1]={delete:h.delete+w.delete},this;if(typeof h.delete=="number"&&w.insert!=null&&(b-=1,h=this.ops[b-1],typeof h!="object"))return this.ops.unshift(w),this;if(o(w.attributes,h.attributes)){if(typeof w.insert=="string"&&typeof h.insert=="string")return this.ops[b-1]={insert:h.insert+w.insert},typeof w.attributes=="object"&&(this.ops[b-1].attributes=w.attributes),this;if(typeof w.retain=="number"&&typeof h.retain=="number")return this.ops[b-1]={retain:h.retain+w.retain},typeof w.attributes=="object"&&(this.ops[b-1].attributes=w.attributes),this}}return b===this.ops.length?this.ops.push(w):this.ops.splice(b,0,w),this},v.prototype.chop=function(){var w=this.ops[this.ops.length-1];return w&&w.retain&&!w.attributes&&this.ops.pop(),this},v.prototype.filter=function(w){return this.ops.filter(w)},v.prototype.forEach=function(w){this.ops.forEach(w)},v.prototype.map=function(w){return this.ops.map(w)},v.prototype.partition=function(w){var b=[],h=[];return this.forEach(function(E){var y=w(E)?b:h;y.push(E)}),[b,h]},v.prototype.reduce=function(w,b){return this.ops.reduce(w,b)},v.prototype.changeLength=function(){return this.reduce(function(w,b){return b.insert?w+u.length(b):b.delete?w-b.delete:w},0)},v.prototype.length=function(){return this.reduce(function(w,b){return w+u.length(b)},0)},v.prototype.slice=function(w,b){w=w||0,typeof b!="number"&&(b=1/0);for(var h=[],E=u.iterator(this.ops),y=0;y<b&&E.hasNext();){var m;y<w?m=E.next(w-y):(m=E.next(b-y),h.push(m)),y+=u.length(m)}return new v(h)},v.prototype.compose=function(w){var b=u.iterator(this.ops),h=u.iterator(w.ops),E=[],y=h.peek();if(y!=null&&typeof y.retain=="number"&&y.attributes==null){for(var m=y.retain;b.peekType()==="insert"&&b.peekLength()<=m;)m-=b.peekLength(),E.push(b.next());y.retain-m>0&&h.next(y.retain-m)}for(var p=new v(E);b.hasNext()||h.hasNext();)if(h.peekType()==="insert")p.push(h.next());else if(b.peekType()==="delete")p.push(b.next());else{var g=Math.min(b.peekLength(),h.peekLength()),d=b.next(g),_=h.next(g);if(typeof _.retain=="number"){var O={};typeof d.retain=="number"?O.retain=g:O.insert=d.insert;var k=u.attributes.compose(d.attributes,_.attributes,typeof d.retain=="number");if(k&&(O.attributes=k),p.push(O),!h.hasNext()&&o(p.ops[p.ops.length-1],O)){var C=new v(b.rest());return p.concat(C).chop()}}else typeof _.delete=="number"&&typeof d.retain=="number"&&p.push(_)}return p.chop()},v.prototype.concat=function(w){var b=new v(this.ops.slice());return w.ops.length>0&&(b.push(w.ops[0]),b.ops=b.ops.concat(w.ops.slice(1))),b},v.prototype.diff=function(w,b){if(this.ops===w.ops)return new v;var h=[this,w].map(function(g){return g.map(function(d){if(d.insert!=null)return typeof d.insert=="string"?d.insert:f;var _=g===w?"on":"with";throw new Error("diff() called "+_+" non-document")}).join("")}),E=new v,y=a(h[0],h[1],b),m=u.iterator(this.ops),p=u.iterator(w.ops);return y.forEach(function(g){for(var d=g[1].length;d>0;){var _=0;switch(g[0]){case a.INSERT:_=Math.min(p.peekLength(),d),E.push(p.next(_));break;case a.DELETE:_=Math.min(d,m.peekLength()),m.next(_),E.delete(_);break;case a.EQUAL:_=Math.min(m.peekLength(),p.peekLength(),d);var O=m.next(_),k=p.next(_);o(O.insert,k.insert)?E.retain(_,u.attributes.diff(O.attributes,k.attributes)):E.push(k).delete(_);break}d-=_}}),E.chop()},v.prototype.eachLine=function(w,b){b=b||`
107
+ `;for(var h=u.iterator(this.ops),E=new v,y=0;h.hasNext();){if(h.peekType()!=="insert")return;var m=h.peek(),p=u.length(m)-h.peekLength(),g=typeof m.insert=="string"?m.insert.indexOf(b,p)-p:-1;if(g<0)E.push(h.next());else if(g>0)E.push(h.next(g));else{if(w(E,h.next(1).attributes||{},y)===!1)return;y+=1,E=new v}}E.length()>0&&w(E,{},y)},v.prototype.transform=function(w,b){if(b=!!b,typeof w=="number")return this.transformPosition(w,b);for(var h=u.iterator(this.ops),E=u.iterator(w.ops),y=new v;h.hasNext()||E.hasNext();)if(h.peekType()==="insert"&&(b||E.peekType()!=="insert"))y.retain(u.length(h.next()));else if(E.peekType()==="insert")y.push(E.next());else{var m=Math.min(h.peekLength(),E.peekLength()),p=h.next(m),g=E.next(m);if(p.delete)continue;g.delete?y.push(g):y.retain(m,u.attributes.transform(p.attributes,g.attributes,b))}return y.chop()},v.prototype.transformPosition=function(w,b){b=!!b;for(var h=u.iterator(this.ops),E=0;h.hasNext()&&E<=w;){var y=h.peekLength(),m=h.peekType();if(h.next(),m==="delete"){w-=Math.min(y,w-E);continue}else m==="insert"&&(E<w||!b)&&(w+=y);E+=y}return w},r.exports=v},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(h){return typeof Array.isArray=="function"?Array.isArray(h):a.call(h)==="[object Array]"},f=function(h){if(!h||a.call(h)!=="[object Object]")return!1;var E=i.call(h,"constructor"),y=h.constructor&&h.constructor.prototype&&i.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!E&&!y)return!1;var m;for(m in h);return typeof m>"u"||i.call(h,m)},v=function(h,E){o&&E.name==="__proto__"?o(h,E.name,{enumerable:!0,configurable:!0,value:E.newValue,writable:!0}):h[E.name]=E.newValue},w=function(h,E){if(E==="__proto__")if(i.call(h,E)){if(l)return l(h,E).value}else return;return h[E]};r.exports=function b(){var h,E,y,m,p,g,d=arguments[0],_=1,O=arguments.length,k=!1;for(typeof d=="boolean"&&(k=d,d=arguments[1]||{},_=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});_<O;++_)if(h=arguments[_],h!=null)for(E in h)y=w(d,E),m=w(h,E),d!==m&&(k&&m&&(f(m)||(p=u(m)))?(p?(p=!1,g=y&&u(y)?y:[]):g=y&&f(y)?y:{},v(d,{name:E,newValue:b(k,g,m)})):typeof m<"u"&&v(d,{name:E,newValue:m}));return d}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=function(){function T(L,M){for(var U=0;U<M.length;U++){var $=M[U];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(L,$.key,$)}}return function(L,M,U){return M&&T(L.prototype,M),U&&T(L,U),L}}(),o=function T(L,M,U){L===null&&(L=Function.prototype);var $=Object.getOwnPropertyDescriptor(L,M);if($===void 0){var Z=Object.getPrototypeOf(L);return Z===null?void 0:T(Z,M,U)}else{if("value"in $)return $.value;var z=$.get;return z===void 0?void 0:z.call(U)}},l=i(3),u=d(l),f=i(2),v=d(f),w=i(0),b=d(w),h=i(16),E=d(h),y=i(6),m=d(y),p=i(7),g=d(p);function d(T){return T&&T.__esModule?T:{default:T}}function _(T,L){if(!(T instanceof L))throw new TypeError("Cannot call a class as a function")}function O(T,L){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:T}function k(T,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);T.prototype=Object.create(L&&L.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(T,L):T.__proto__=L)}var C=1,S=function(T){k(L,T);function L(){return _(this,L),O(this,(L.__proto__||Object.getPrototypeOf(L)).apply(this,arguments))}return a(L,[{key:"attach",value:function(){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"attach",this).call(this),this.attributes=new b.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new v.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(U,$){var Z=b.default.query(U,b.default.Scope.BLOCK_ATTRIBUTE);Z!=null&&this.attributes.attribute(Z,$)}},{key:"formatAt",value:function(U,$,Z,z){this.format(Z,z)}},{key:"insertAt",value:function(U,$,Z){if(typeof $=="string"&&$.endsWith(`
108
+ `)){var z=b.default.create(x.blotName);this.parent.insertBefore(z,U===0?this:this.next),z.insertAt(0,$.slice(0,-1))}else o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,U,$,Z)}}]),L}(b.default.Embed);S.scope=b.default.Scope.BLOCK_BLOT;var x=function(T){k(L,T);function L(M){_(this,L);var U=O(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,M));return U.cache={},U}return a(L,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(b.default.Leaf).reduce(function(U,$){return $.length()===0?U:U.insert($.value(),P($))},new v.default).insert(`
109
+ `,P(this))),this.cache.delta}},{key:"deleteAt",value:function(U,$){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"deleteAt",this).call(this,U,$),this.cache={}}},{key:"formatAt",value:function(U,$,Z,z){$<=0||(b.default.query(Z,b.default.Scope.BLOCK)?U+$===this.length()&&this.format(Z,z):o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"formatAt",this).call(this,U,Math.min($,this.length()-U-1),Z,z),this.cache={})}},{key:"insertAt",value:function(U,$,Z){if(Z!=null)return o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,U,$,Z);if($.length!==0){var z=$.split(`
110
+ `),N=z.shift();N.length>0&&(U<this.length()-1||this.children.tail==null?o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,Math.min(U,this.length()-1),N):this.children.tail.insertAt(this.children.tail.length(),N),this.cache={});var H=this;z.reduce(function(R,F){return H=H.split(R,!0),H.insertAt(0,F),F.length},U+N.length)}}},{key:"insertBefore",value:function(U,$){var Z=this.children.head;o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertBefore",this).call(this,U,$),Z instanceof E.default&&Z.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"length",this).call(this)+C),this.cache.length}},{key:"moveChildren",value:function(U,$){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"moveChildren",this).call(this,U,$),this.cache={}}},{key:"optimize",value:function(U){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"optimize",this).call(this,U),this.cache={}}},{key:"path",value:function(U){return o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"path",this).call(this,U,!0)}},{key:"removeChild",value:function(U){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"removeChild",this).call(this,U),this.cache={}}},{key:"split",value:function(U){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if($&&(U===0||U>=this.length()-C)){var Z=this.clone();return U===0?(this.parent.insertBefore(Z,this),this):(this.parent.insertBefore(Z,this.next),Z)}else{var z=o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"split",this).call(this,U,$);return this.cache={},z}}}]),L}(b.default.Block);x.blotName="block",x.tagName="P",x.defaultChild="break",x.allowedChildren=[m.default,b.default.Embed,g.default];function P(T){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T==null||(typeof T.formats=="function"&&(L=(0,u.default)(L,T.formats())),T.parent==null||T.parent.blotName=="scroll"||T.parent.statics.scope!==T.statics.scope)?L:P(T.parent,L)}n.bubbleFormats=P,n.BlockEmbed=S,n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},o=function(){function H(R,F){var B=[],D=!0,V=!1,Y=void 0;try{for(var q=R[Symbol.iterator](),G;!(D=(G=q.next()).done)&&(B.push(G.value),!(F&&B.length===F));D=!0);}catch(K){V=!0,Y=K}finally{try{!D&&q.return&&q.return()}finally{if(V)throw Y}}return B}return function(R,F){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return H(R,F);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function H(R,F){for(var B=0;B<F.length;B++){var D=F[B];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(R,D.key,D)}}return function(R,F,B){return F&&H(R.prototype,F),B&&H(R,B),R}}();i(50);var u=i(2),f=P(u),v=i(14),w=P(v),b=i(8),h=P(b),E=i(9),y=P(E),m=i(0),p=P(m),g=i(15),d=P(g),_=i(3),O=P(_),k=i(10),C=P(k),S=i(34),x=P(S);function P(H){return H&&H.__esModule?H:{default:H}}function T(H,R,F){return R in H?Object.defineProperty(H,R,{value:F,enumerable:!0,configurable:!0,writable:!0}):H[R]=F,H}function L(H,R){if(!(H instanceof R))throw new TypeError("Cannot call a class as a function")}var M=(0,C.default)("quill"),U=function(){l(H,null,[{key:"debug",value:function(F){F===!0&&(F="log"),C.default.level(F)}},{key:"find",value:function(F){return F.__quill||p.default.find(F)}},{key:"import",value:function(F){return this.imports[F]==null&&M.error("Cannot import "+F+". Are you sure it was registered?"),this.imports[F]}},{key:"register",value:function(F,B){var D=this,V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof F!="string"){var Y=F.attrName||F.blotName;typeof Y=="string"?this.register("formats/"+Y,F,B):Object.keys(F).forEach(function(q){D.register(q,F[q],B)})}else this.imports[F]!=null&&!V&&M.warn("Overwriting "+F+" with",B),this.imports[F]=B,(F.startsWith("blots/")||F.startsWith("formats/"))&&B.blotName!=="abstract"?p.default.register(B):F.startsWith("modules")&&typeof B.register=="function"&&B.register()}}]);function H(R){var F=this,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(L(this,H),this.options=$(R,B),this.container=this.options.container,this.container==null)return M.error("Invalid Quill container",R);this.options.debug&&H.debug(this.options.debug);var D=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new h.default,this.scroll=p.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new w.default(this.scroll),this.selection=new d.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(h.default.events.EDITOR_CHANGE,function(Y){Y===h.default.events.TEXT_CHANGE&&F.root.classList.toggle("ql-blank",F.editor.isBlank())}),this.emitter.on(h.default.events.SCROLL_UPDATE,function(Y,q){var G=F.selection.lastRange,K=G&&G.length===0?G.index:void 0;Z.call(F,function(){return F.editor.update(null,q,K)},Y)});var V=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+D+"<p><br></p></div>");this.setContents(V),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(H,[{key:"addContainer",value:function(F){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof F=="string"){var D=F;F=document.createElement("div"),F.classList.add(D)}return this.container.insertBefore(F,B),F}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(F,B,D){var V=this,Y=z(F,B,D),q=o(Y,4);return F=q[0],B=q[1],D=q[3],Z.call(this,function(){return V.editor.deleteText(F,B)},D,F,-1*B)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(F),this.container.classList.toggle("ql-disabled",!F)}},{key:"focus",value:function(){var F=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=F,this.scrollIntoView()}},{key:"format",value:function(F,B){var D=this,V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h.default.sources.API;return Z.call(this,function(){var Y=D.getSelection(!0),q=new f.default;if(Y==null)return q;if(p.default.query(F,p.default.Scope.BLOCK))q=D.editor.formatLine(Y.index,Y.length,T({},F,B));else{if(Y.length===0)return D.selection.format(F,B),q;q=D.editor.formatText(Y.index,Y.length,T({},F,B))}return D.setSelection(Y,h.default.sources.SILENT),q},V)}},{key:"formatLine",value:function(F,B,D,V,Y){var q=this,G=void 0,K=z(F,B,D,V,Y),X=o(K,4);return F=X[0],B=X[1],G=X[2],Y=X[3],Z.call(this,function(){return q.editor.formatLine(F,B,G)},Y,F,0)}},{key:"formatText",value:function(F,B,D,V,Y){var q=this,G=void 0,K=z(F,B,D,V,Y),X=o(K,4);return F=X[0],B=X[1],G=X[2],Y=X[3],Z.call(this,function(){return q.editor.formatText(F,B,G)},Y,F,0)}},{key:"getBounds",value:function(F){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=void 0;typeof F=="number"?D=this.selection.getBounds(F,B):D=this.selection.getBounds(F.index,F.length);var V=this.container.getBoundingClientRect();return{bottom:D.bottom-V.top,height:D.height,left:D.left-V.left,right:D.right-V.left,top:D.top-V.top,width:D.width}}},{key:"getContents",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-F,D=z(F,B),V=o(D,2);return F=V[0],B=V[1],this.editor.getContents(F,B)}},{key:"getFormat",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof F=="number"?this.editor.getFormat(F,B):this.editor.getFormat(F.index,F.length)}},{key:"getIndex",value:function(F){return F.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(F){return this.scroll.leaf(F)}},{key:"getLine",value:function(F){return this.scroll.line(F)}},{key:"getLines",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof F!="number"?this.scroll.lines(F.index,F.length):this.scroll.lines(F,B)}},{key:"getModule",value:function(F){return this.theme.modules[F]}},{key:"getSelection",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return F&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-F,D=z(F,B),V=o(D,2);return F=V[0],B=V[1],this.editor.getText(F,B)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(F,B,D){var V=this,Y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:H.sources.API;return Z.call(this,function(){return V.editor.insertEmbed(F,B,D)},Y,F)}},{key:"insertText",value:function(F,B,D,V,Y){var q=this,G=void 0,K=z(F,0,D,V,Y),X=o(K,4);return F=X[0],G=X[2],Y=X[3],Z.call(this,function(){return q.editor.insertText(F,B,G)},Y,F,B.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(F,B,D){this.clipboard.dangerouslyPasteHTML(F,B,D)}},{key:"removeFormat",value:function(F,B,D){var V=this,Y=z(F,B,D),q=o(Y,4);return F=q[0],B=q[1],D=q[3],Z.call(this,function(){return V.editor.removeFormat(F,B)},D,F)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(F){var B=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API;return Z.call(this,function(){F=new f.default(F);var V=B.getLength(),Y=B.editor.deleteText(0,V),q=B.editor.applyDelta(F),G=q.ops[q.ops.length-1];G!=null&&typeof G.insert=="string"&&G.insert[G.insert.length-1]===`
111
+ `&&(B.editor.deleteText(B.getLength()-1,1),q.delete(1));var K=Y.compose(q);return K},D)}},{key:"setSelection",value:function(F,B,D){if(F==null)this.selection.setRange(null,B||H.sources.API);else{var V=z(F,B,D),Y=o(V,4);F=Y[0],B=Y[1],D=Y[3],this.selection.setRange(new g.Range(F,B),D),D!==h.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(F){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API,D=new f.default().insert(F);return this.setContents(D,B)}},{key:"update",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h.default.sources.USER,B=this.scroll.update(F);return this.selection.update(F),B}},{key:"updateContents",value:function(F){var B=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API;return Z.call(this,function(){return F=new f.default(F),B.editor.applyDelta(F,D)},D,!0)}}]),H}();U.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},U.events=h.default.events,U.sources=h.default.sources,U.version="1.3.7",U.imports={delta:f.default,parchment:p.default,"core/module":y.default,"core/theme":x.default};function $(H,R){if(R=(0,O.default)(!0,{container:H,modules:{clipboard:!0,keyboard:!0,history:!0}},R),!R.theme||R.theme===U.DEFAULTS.theme)R.theme=x.default;else if(R.theme=U.import("themes/"+R.theme),R.theme==null)throw new Error("Invalid theme "+R.theme+". Did you register it?");var F=(0,O.default)(!0,{},R.theme.DEFAULTS);[F,R].forEach(function(V){V.modules=V.modules||{},Object.keys(V.modules).forEach(function(Y){V.modules[Y]===!0&&(V.modules[Y]={})})});var B=Object.keys(F.modules).concat(Object.keys(R.modules)),D=B.reduce(function(V,Y){var q=U.import("modules/"+Y);return q==null?M.error("Cannot load "+Y+" module. Are you sure you registered it?"):V[Y]=q.DEFAULTS||{},V},{});return R.modules!=null&&R.modules.toolbar&&R.modules.toolbar.constructor!==Object&&(R.modules.toolbar={container:R.modules.toolbar}),R=(0,O.default)(!0,{},U.DEFAULTS,{modules:D},F,R),["bounds","container","scrollingContainer"].forEach(function(V){typeof R[V]=="string"&&(R[V]=document.querySelector(R[V]))}),R.modules=Object.keys(R.modules).reduce(function(V,Y){return R.modules[Y]&&(V[Y]=R.modules[Y]),V},{}),R}function Z(H,R,F,B){if(this.options.strict&&!this.isEnabled()&&R===h.default.sources.USER)return new f.default;var D=F==null?null:this.getSelection(),V=this.editor.delta,Y=H();if(D!=null&&(F===!0&&(F=D.index),B==null?D=N(D,Y,R):B!==0&&(D=N(D,F,B,R)),this.setSelection(D,h.default.sources.SILENT)),Y.length()>0){var q,G=[h.default.events.TEXT_CHANGE,Y,V,R];if((q=this.emitter).emit.apply(q,[h.default.events.EDITOR_CHANGE].concat(G)),R!==h.default.sources.SILENT){var K;(K=this.emitter).emit.apply(K,G)}}return Y}function z(H,R,F,B,D){var V={};return typeof H.index=="number"&&typeof H.length=="number"?typeof R!="number"?(D=B,B=F,F=R,R=H.length,H=H.index):(R=H.length,H=H.index):typeof R!="number"&&(D=B,B=F,F=R,R=0),(typeof F>"u"?"undefined":a(F))==="object"?(V=F,D=B):typeof F=="string"&&(B!=null?V[F]=B:D=F),D=D||h.default.sources.API,[H,R,V,D]}function N(H,R,F,B){if(H==null)return null;var D=void 0,V=void 0;if(R instanceof f.default){var Y=[H.index,H.index+H.length].map(function(X){return R.transformPosition(X,B!==h.default.sources.USER)}),q=o(Y,2);D=q[0],V=q[1]}else{var G=[H.index,H.index+H.length].map(function(X){return X<R||X===R&&B===h.default.sources.USER?X:F>=0?X+F:Math.max(R,X+F)}),K=o(G,2);D=K[0],V=K[1]}return new g.Range(D,V-D)}n.expandConfig=$,n.overload=z,n.default=U},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function m(p,g){for(var d=0;d<g.length;d++){var _=g[d];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(p,_.key,_)}}return function(p,g,d){return g&&m(p.prototype,g),d&&m(p,d),p}}(),o=function m(p,g,d){p===null&&(p=Function.prototype);var _=Object.getOwnPropertyDescriptor(p,g);if(_===void 0){var O=Object.getPrototypeOf(p);return O===null?void 0:m(O,g,d)}else{if("value"in _)return _.value;var k=_.get;return k===void 0?void 0:k.call(d)}},l=i(7),u=w(l),f=i(0),v=w(f);function w(m){return m&&m.__esModule?m:{default:m}}function b(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function h(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function E(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var y=function(m){E(p,m);function p(){return b(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"formatAt",value:function(d,_,O,k){if(p.compare(this.statics.blotName,O)<0&&v.default.query(O,v.default.Scope.BLOT)){var C=this.isolate(d,_);k&&C.wrap(O,k)}else o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"formatAt",this).call(this,d,_,O,k)}},{key:"optimize",value:function(d){if(o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"optimize",this).call(this,d),this.parent instanceof p&&p.compare(this.statics.blotName,this.parent.statics.blotName)>0){var _=this.parent.isolate(this.offset(),this.length());this.moveChildren(_),_.wrap(this)}}}],[{key:"compare",value:function(d,_){var O=p.order.indexOf(d),k=p.order.indexOf(_);return O>=0||k>=0?O-k:d===_?0:d<_?-1:1}}]),p}(v.default.Inline);y.allowedChildren=[y,v.default.Embed,u.default],y.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=l(a);function l(b){return b&&b.__esModule?b:{default:b}}function u(b,h){if(!(b instanceof h))throw new TypeError("Cannot call a class as a function")}function f(b,h){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:b}function v(b,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);b.prototype=Object.create(h&&h.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(b,h):b.__proto__=h)}var w=function(b){v(h,b);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default.Text);n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function g(d,_){for(var O=0;O<_.length;O++){var k=_[O];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(d,k.key,k)}}return function(d,_,O){return _&&g(d.prototype,_),O&&g(d,O),d}}(),o=function g(d,_,O){d===null&&(d=Function.prototype);var k=Object.getOwnPropertyDescriptor(d,_);if(k===void 0){var C=Object.getPrototypeOf(d);return C===null?void 0:g(C,_,O)}else{if("value"in k)return k.value;var S=k.get;return S===void 0?void 0:S.call(O)}},l=i(54),u=w(l),f=i(10),v=w(f);function w(g){return g&&g.__esModule?g:{default:g}}function b(g,d){if(!(g instanceof d))throw new TypeError("Cannot call a class as a function")}function h(g,d){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:g}function E(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);g.prototype=Object.create(d&&d.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(g,d):g.__proto__=d)}var y=(0,v.default)("quill:events"),m=["selectionchange","mousedown","mouseup","click"];m.forEach(function(g){document.addEventListener(g,function(){for(var d=arguments.length,_=Array(d),O=0;O<d;O++)_[O]=arguments[O];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(k){if(k.__quill&&k.__quill.emitter){var C;(C=k.__quill.emitter).handleDOM.apply(C,_)}})})});var p=function(g){E(d,g);function d(){b(this,d);var _=h(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return _.listeners={},_.on("error",y.error),_}return a(d,[{key:"emit",value:function(){y.log.apply(y,arguments),o(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(O){for(var k=arguments.length,C=Array(k>1?k-1:0),S=1;S<k;S++)C[S-1]=arguments[S];(this.listeners[O.type]||[]).forEach(function(x){var P=x.node,T=x.handler;(O.target===P||P.contains(O.target))&&T.apply(void 0,[O].concat(C))})}},{key:"listenDOM",value:function(O,k,C){this.listeners[O]||(this.listeners[O]=[]),this.listeners[O].push({node:k,handler:C})}}]),d}(u.default);p.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},p.sources={API:"api",SILENT:"silent",USER:"user"},n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function a(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function l(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,l),this.quill=u,this.options=f};o.DEFAULTS={},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=["error","warn","log","info"],o="warn";function l(f){if(a.indexOf(f)<=a.indexOf(o)){for(var v,w=arguments.length,b=Array(w>1?w-1:0),h=1;h<w;h++)b[h-1]=arguments[h];(v=console)[f].apply(v,b)}}function u(f){return a.reduce(function(v,w){return v[w]=l.bind(console,w,f),v},{})}l.level=u.level=function(f){o=f},n.default=u},function(r,n,i){var a=Array.prototype.slice,o=i(52),l=i(53),u=r.exports=function(b,h,E){return E||(E={}),b===h?!0:b instanceof Date&&h instanceof Date?b.getTime()===h.getTime():!b||!h||typeof b!="object"&&typeof h!="object"?E.strict?b===h:b==h:w(b,h,E)};function f(b){return b==null}function v(b){return!(!b||typeof b!="object"||typeof b.length!="number"||typeof b.copy!="function"||typeof b.slice!="function"||b.length>0&&typeof b[0]!="number")}function w(b,h,E){var y,m;if(f(b)||f(h)||b.prototype!==h.prototype)return!1;if(l(b))return l(h)?(b=a.call(b),h=a.call(h),u(b,h,E)):!1;if(v(b)){if(!v(h)||b.length!==h.length)return!1;for(y=0;y<b.length;y++)if(b[y]!==h[y])return!1;return!0}try{var p=o(b),g=o(h)}catch{return!1}if(p.length!=g.length)return!1;for(p.sort(),g.sort(),y=p.length-1;y>=0;y--)if(p[y]!=g[y])return!1;for(y=p.length-1;y>=0;y--)if(m=p[y],!u(b[m],h[m],E))return!1;return typeof b==typeof h}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u,f,v){v===void 0&&(v={}),this.attrName=u,this.keyName=f;var w=a.Scope.TYPE&a.Scope.ATTRIBUTE;v.scope!=null?this.scope=v.scope&a.Scope.LEVEL|w:this.scope=a.Scope.ATTRIBUTE,v.whitelist!=null&&(this.whitelist=v.whitelist)}return l.keys=function(u){return[].map.call(u.attributes,function(f){return f.name})},l.prototype.add=function(u,f){return this.canAdd(u,f)?(u.setAttribute(this.keyName,f),!0):!1},l.prototype.canAdd=function(u,f){var v=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return v==null?!1:this.whitelist==null?!0:typeof f=="string"?this.whitelist.indexOf(f.replace(/["']/g,""))>-1:this.whitelist.indexOf(f)>-1},l.prototype.remove=function(u){u.removeAttribute(this.keyName)},l.prototype.value=function(u){var f=u.getAttribute(this.keyName);return this.canAdd(u,f)&&f?f:""},l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var a=function(){function S(x,P){var T=[],L=!0,M=!1,U=void 0;try{for(var $=x[Symbol.iterator](),Z;!(L=(Z=$.next()).done)&&(T.push(Z.value),!(P&&T.length===P));L=!0);}catch(z){M=!0,U=z}finally{try{!L&&$.return&&$.return()}finally{if(M)throw U}}return T}return function(x,P){if(Array.isArray(x))return x;if(Symbol.iterator in Object(x))return S(x,P);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function S(x,P){for(var T=0;T<P.length;T++){var L=P[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(x,L.key,L)}}return function(x,P,T){return P&&S(x.prototype,P),T&&S(x,T),x}}(),l=function S(x,P,T){x===null&&(x=Function.prototype);var L=Object.getOwnPropertyDescriptor(x,P);if(L===void 0){var M=Object.getPrototypeOf(x);return M===null?void 0:S(M,P,T)}else{if("value"in L)return L.value;var U=L.get;return U===void 0?void 0:U.call(T)}},u=i(2),f=g(u),v=i(0),w=g(v),b=i(4),h=g(b),E=i(6),y=g(E),m=i(7),p=g(m);function g(S){return S&&S.__esModule?S:{default:S}}function d(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function _(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function O(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var k=function(S){O(x,S);function x(){return d(this,x),_(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return x}(y.default);k.blotName="code",k.tagName="CODE";var C=function(S){O(x,S);function x(){return d(this,x),_(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return o(x,[{key:"delta",value:function(){var T=this,L=this.domNode.textContent;return L.endsWith(`
112
+ `)&&(L=L.slice(0,-1)),L.split(`
113
+ `).reduce(function(M,U){return M.insert(U).insert(`
114
+ `,T.formats())},new f.default)}},{key:"format",value:function(T,L){if(!(T===this.statics.blotName&&L)){var M=this.descendant(p.default,this.length()-1),U=a(M,1),$=U[0];$!=null&&$.deleteAt($.length()-1,1),l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,T,L)}}},{key:"formatAt",value:function(T,L,M,U){if(L!==0&&!(w.default.query(M,w.default.Scope.BLOCK)==null||M===this.statics.blotName&&U===this.statics.formats(this.domNode))){var $=this.newlineIndex(T);if(!($<0||$>=T+L)){var Z=this.newlineIndex(T,!0)+1,z=$-Z+1,N=this.isolate(Z,z),H=N.next;N.format(M,U),H instanceof x&&H.formatAt(0,T-Z+L-z,M,U)}}}},{key:"insertAt",value:function(T,L,M){if(M==null){var U=this.descendant(p.default,T),$=a(U,2),Z=$[0],z=$[1];Z.insertAt(z,L)}}},{key:"length",value:function(){var T=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
115
+ `)?T:T+1}},{key:"newlineIndex",value:function(T){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(L)return this.domNode.textContent.slice(0,T).lastIndexOf(`
116
+ `);var M=this.domNode.textContent.slice(T).indexOf(`
117
+ `);return M>-1?T+M:-1}},{key:"optimize",value:function(T){this.domNode.textContent.endsWith(`
118
+ `)||this.appendChild(w.default.create("text",`
119
+ `)),l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,T);var L=this.next;L!=null&&L.prev===this&&L.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===L.statics.formats(L.domNode)&&(L.optimize(T),L.moveChildren(this),L.remove())}},{key:"replace",value:function(T){l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replace",this).call(this,T),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(L){var M=w.default.find(L);M==null?L.parentNode.removeChild(L):M instanceof w.default.Embed?M.remove():M.unwrap()})}}],[{key:"create",value:function(T){var L=l(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,T);return L.setAttribute("spellcheck",!1),L}},{key:"formats",value:function(){return!0}}]),x}(h.default);C.blotName="code-block",C.tagName="PRE",C.TAB=" ",n.Code=k,n.default=C},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},o=function(){function H(R,F){var B=[],D=!0,V=!1,Y=void 0;try{for(var q=R[Symbol.iterator](),G;!(D=(G=q.next()).done)&&(B.push(G.value),!(F&&B.length===F));D=!0);}catch(K){V=!0,Y=K}finally{try{!D&&q.return&&q.return()}finally{if(V)throw Y}}return B}return function(R,F){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return H(R,F);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function H(R,F){for(var B=0;B<F.length;B++){var D=F[B];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(R,D.key,D)}}return function(R,F,B){return F&&H(R.prototype,F),B&&H(R,B),R}}(),u=i(2),f=L(u),v=i(20),w=L(v),b=i(0),h=L(b),E=i(13),y=L(E),m=i(24),p=L(m),g=i(4),d=L(g),_=i(16),O=L(_),k=i(21),C=L(k),S=i(11),x=L(S),P=i(3),T=L(P);function L(H){return H&&H.__esModule?H:{default:H}}function M(H,R,F){return R in H?Object.defineProperty(H,R,{value:F,enumerable:!0,configurable:!0,writable:!0}):H[R]=F,H}function U(H,R){if(!(H instanceof R))throw new TypeError("Cannot call a class as a function")}var $=/^[ -~]*$/,Z=function(){function H(R){U(this,H),this.scroll=R,this.delta=this.getDelta()}return l(H,[{key:"applyDelta",value:function(F){var B=this,D=!1;this.scroll.update();var V=this.scroll.length();return this.scroll.batchStart(),F=N(F),F.reduce(function(Y,q){var G=q.retain||q.delete||q.insert.length||1,K=q.attributes||{};if(q.insert!=null){if(typeof q.insert=="string"){var X=q.insert;X.endsWith(`
120
+ `)&&D&&(D=!1,X=X.slice(0,-1)),Y>=V&&!X.endsWith(`
121
+ `)&&(D=!0),B.scroll.insertAt(Y,X);var Q=B.scroll.line(Y),ee=o(Q,2),te=ee[0],ae=ee[1],oe=(0,T.default)({},(0,g.bubbleFormats)(te));if(te instanceof d.default){var se=te.descendant(h.default.Leaf,ae),ke=o(se,1),Fe=ke[0];oe=(0,T.default)(oe,(0,g.bubbleFormats)(Fe))}K=w.default.attributes.diff(oe,K)||{}}else if(a(q.insert)==="object"){var fe=Object.keys(q.insert)[0];if(fe==null)return Y;B.scroll.insertAt(Y,fe,q.insert[fe])}V+=G}return Object.keys(K).forEach(function(ie){B.scroll.formatAt(Y,G,ie,K[ie])}),Y+G},0),F.reduce(function(Y,q){return typeof q.delete=="number"?(B.scroll.deleteAt(Y,q.delete),Y):Y+(q.retain||q.insert.length||1)},0),this.scroll.batchEnd(),this.update(F)}},{key:"deleteText",value:function(F,B){return this.scroll.deleteAt(F,B),this.update(new f.default().retain(F).delete(B))}},{key:"formatLine",value:function(F,B){var D=this,V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(V).forEach(function(Y){if(!(D.scroll.whitelist!=null&&!D.scroll.whitelist[Y])){var q=D.scroll.lines(F,Math.max(B,1)),G=B;q.forEach(function(K){var X=K.length();if(!(K instanceof y.default))K.format(Y,V[Y]);else{var Q=F-K.offset(D.scroll),ee=K.newlineIndex(Q+G)-Q+1;K.formatAt(Q,ee,Y,V[Y])}G-=X})}}),this.scroll.optimize(),this.update(new f.default().retain(F).retain(B,(0,C.default)(V)))}},{key:"formatText",value:function(F,B){var D=this,V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(V).forEach(function(Y){D.scroll.formatAt(F,B,Y,V[Y])}),this.update(new f.default().retain(F).retain(B,(0,C.default)(V)))}},{key:"getContents",value:function(F,B){return this.delta.slice(F,F+B)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(F,B){return F.concat(B.delta())},new f.default)}},{key:"getFormat",value:function(F){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=[],V=[];B===0?this.scroll.path(F).forEach(function(q){var G=o(q,1),K=G[0];K instanceof d.default?D.push(K):K instanceof h.default.Leaf&&V.push(K)}):(D=this.scroll.lines(F,B),V=this.scroll.descendants(h.default.Leaf,F,B));var Y=[D,V].map(function(q){if(q.length===0)return{};for(var G=(0,g.bubbleFormats)(q.shift());Object.keys(G).length>0;){var K=q.shift();if(K==null)return G;G=z((0,g.bubbleFormats)(K),G)}return G});return T.default.apply(T.default,Y)}},{key:"getText",value:function(F,B){return this.getContents(F,B).filter(function(D){return typeof D.insert=="string"}).map(function(D){return D.insert}).join("")}},{key:"insertEmbed",value:function(F,B,D){return this.scroll.insertAt(F,B,D),this.update(new f.default().retain(F).insert(M({},B,D)))}},{key:"insertText",value:function(F,B){var D=this,V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return B=B.replace(/\r\n/g,`
122
+ `).replace(/\r/g,`
123
+ `),this.scroll.insertAt(F,B),Object.keys(V).forEach(function(Y){D.scroll.formatAt(F,B.length,Y,V[Y])}),this.update(new f.default().retain(F).insert(B,(0,C.default)(V)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var F=this.scroll.children.head;return F.statics.blotName!==d.default.blotName||F.children.length>1?!1:F.children.head instanceof O.default}},{key:"removeFormat",value:function(F,B){var D=this.getText(F,B),V=this.scroll.line(F+B),Y=o(V,2),q=Y[0],G=Y[1],K=0,X=new f.default;q!=null&&(q instanceof y.default?K=q.newlineIndex(G)-G+1:K=q.length()-G,X=q.delta().slice(G,G+K-1).insert(`
124
+ `));var Q=this.getContents(F,B+K),ee=Q.diff(new f.default().insert(D).concat(X)),te=new f.default().retain(F).concat(ee);return this.applyDelta(te)}},{key:"update",value:function(F){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,V=this.delta;if(B.length===1&&B[0].type==="characterData"&&B[0].target.data.match($)&&h.default.find(B[0].target)){var Y=h.default.find(B[0].target),q=(0,g.bubbleFormats)(Y),G=Y.offset(this.scroll),K=B[0].oldValue.replace(p.default.CONTENTS,""),X=new f.default().insert(K),Q=new f.default().insert(Y.value()),ee=new f.default().retain(G).concat(X.diff(Q,D));F=ee.reduce(function(te,ae){return ae.insert?te.insert(ae.insert,q):te.push(ae)},new f.default),this.delta=V.compose(F)}else this.delta=this.getDelta(),(!F||!(0,x.default)(V.compose(F),this.delta))&&(F=V.diff(this.delta,D));return F}}]),H}();function z(H,R){return Object.keys(R).reduce(function(F,B){return H[B]==null||(R[B]===H[B]?F[B]=R[B]:Array.isArray(R[B])?R[B].indexOf(H[B])<0&&(F[B]=R[B].concat([H[B]])):F[B]=[R[B],H[B]]),F},{})}function N(H){return H.reduce(function(R,F){if(F.insert===1){var B=(0,C.default)(F.attributes);return delete B.image,R.insert({image:F.attributes.image},B)}if(F.attributes!=null&&(F.attributes.list===!0||F.attributes.bullet===!0)&&(F=(0,C.default)(F),F.attributes.list?F.attributes.list="ordered":(F.attributes.list="bullet",delete F.attributes.bullet)),typeof F.insert=="string"){var D=F.insert.replace(/\r\n/g,`
125
+ `).replace(/\r/g,`
126
+ `);return R.insert(D,F.attributes)}return R.push(F)},new f.default)}n.default=Z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function S(x,P){var T=[],L=!0,M=!1,U=void 0;try{for(var $=x[Symbol.iterator](),Z;!(L=(Z=$.next()).done)&&(T.push(Z.value),!(P&&T.length===P));L=!0);}catch(z){M=!0,U=z}finally{try{!L&&$.return&&$.return()}finally{if(M)throw U}}return T}return function(x,P){if(Array.isArray(x))return x;if(Symbol.iterator in Object(x))return S(x,P);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function S(x,P){for(var T=0;T<P.length;T++){var L=P[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(x,L.key,L)}}return function(x,P,T){return P&&S(x.prototype,P),T&&S(x,T),x}}(),l=i(0),u=p(l),f=i(21),v=p(f),w=i(11),b=p(w),h=i(8),E=p(h),y=i(10),m=p(y);function p(S){return S&&S.__esModule?S:{default:S}}function g(S){if(Array.isArray(S)){for(var x=0,P=Array(S.length);x<S.length;x++)P[x]=S[x];return P}else return Array.from(S)}function d(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}var _=(0,m.default)("quill:selection"),O=function S(x){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,S),this.index=x,this.length=P},k=function(){function S(x,P){var T=this;d(this,S),this.emitter=P,this.scroll=x,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new O(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){T.mouseDown||setTimeout(T.update.bind(T,E.default.sources.USER),1)}),this.emitter.on(E.default.events.EDITOR_CHANGE,function(L,M){L===E.default.events.TEXT_CHANGE&&M.length()>0&&T.update(E.default.sources.SILENT)}),this.emitter.on(E.default.events.SCROLL_BEFORE_UPDATE,function(){if(T.hasFocus()){var L=T.getNativeRange();L!=null&&L.start.node!==T.cursor.textNode&&T.emitter.once(E.default.events.SCROLL_UPDATE,function(){try{T.setNativeRange(L.start.node,L.start.offset,L.end.node,L.end.offset)}catch{}})}}),this.emitter.on(E.default.events.SCROLL_OPTIMIZE,function(L,M){if(M.range){var U=M.range,$=U.startNode,Z=U.startOffset,z=U.endNode,N=U.endOffset;T.setNativeRange($,Z,z,N)}}),this.update(E.default.sources.SILENT)}return o(S,[{key:"handleComposition",value:function(){var P=this;this.root.addEventListener("compositionstart",function(){P.composing=!0}),this.root.addEventListener("compositionend",function(){if(P.composing=!1,P.cursor.parent){var T=P.cursor.restore();if(!T)return;setTimeout(function(){P.setNativeRange(T.startNode,T.startOffset,T.endNode,T.endOffset)},1)}})}},{key:"handleDragging",value:function(){var P=this;this.emitter.listenDOM("mousedown",document.body,function(){P.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){P.mouseDown=!1,P.update(E.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(P,T){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[P])){this.scroll.update();var L=this.getNativeRange();if(!(L==null||!L.native.collapsed||u.default.query(P,u.default.Scope.BLOCK))){if(L.start.node!==this.cursor.textNode){var M=u.default.find(L.start.node,!1);if(M==null)return;if(M instanceof u.default.Leaf){var U=M.split(L.start.offset);M.parent.insertBefore(this.cursor,U)}else M.insertBefore(this.cursor,L.start.node);this.cursor.attach()}this.cursor.format(P,T),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(P){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=this.scroll.length();P=Math.min(P,L-1),T=Math.min(P+T,L-1)-P;var M=void 0,U=this.scroll.leaf(P),$=a(U,2),Z=$[0],z=$[1];if(Z==null)return null;var N=Z.position(z,!0),H=a(N,2);M=H[0],z=H[1];var R=document.createRange();if(T>0){R.setStart(M,z);var F=this.scroll.leaf(P+T),B=a(F,2);if(Z=B[0],z=B[1],Z==null)return null;var D=Z.position(z,!0),V=a(D,2);return M=V[0],z=V[1],R.setEnd(M,z),R.getBoundingClientRect()}else{var Y="left",q=void 0;return M instanceof Text?(z<M.data.length?(R.setStart(M,z),R.setEnd(M,z+1)):(R.setStart(M,z-1),R.setEnd(M,z),Y="right"),q=R.getBoundingClientRect()):(q=Z.domNode.getBoundingClientRect(),z>0&&(Y="right")),{bottom:q.top+q.height,height:q.height,left:q[Y],right:q[Y],top:q.top,width:0}}}},{key:"getNativeRange",value:function(){var P=document.getSelection();if(P==null||P.rangeCount<=0)return null;var T=P.getRangeAt(0);if(T==null)return null;var L=this.normalizeNative(T);return _.info("getNativeRange",L),L}},{key:"getRange",value:function(){var P=this.getNativeRange();if(P==null)return[null,null];var T=this.normalizedToRange(P);return[T,P]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(P){var T=this,L=[[P.start.node,P.start.offset]];P.native.collapsed||L.push([P.end.node,P.end.offset]);var M=L.map(function(Z){var z=a(Z,2),N=z[0],H=z[1],R=u.default.find(N,!0),F=R.offset(T.scroll);return H===0?F:R instanceof u.default.Container?F+R.length():F+R.index(N,H)}),U=Math.min(Math.max.apply(Math,g(M)),this.scroll.length()-1),$=Math.min.apply(Math,[U].concat(g(M)));return new O($,U-$)}},{key:"normalizeNative",value:function(P){if(!C(this.root,P.startContainer)||!P.collapsed&&!C(this.root,P.endContainer))return null;var T={start:{node:P.startContainer,offset:P.startOffset},end:{node:P.endContainer,offset:P.endOffset},native:P};return[T.start,T.end].forEach(function(L){for(var M=L.node,U=L.offset;!(M instanceof Text)&&M.childNodes.length>0;)if(M.childNodes.length>U)M=M.childNodes[U],U=0;else if(M.childNodes.length===U)M=M.lastChild,U=M instanceof Text?M.data.length:M.childNodes.length+1;else break;L.node=M,L.offset=U}),T}},{key:"rangeToNative",value:function(P){var T=this,L=P.collapsed?[P.index]:[P.index,P.index+P.length],M=[],U=this.scroll.length();return L.forEach(function($,Z){$=Math.min(U-1,$);var z=void 0,N=T.scroll.leaf($),H=a(N,2),R=H[0],F=H[1],B=R.position(F,Z!==0),D=a(B,2);z=D[0],F=D[1],M.push(z,F)}),M.length<2&&(M=M.concat(M)),M}},{key:"scrollIntoView",value:function(P){var T=this.lastRange;if(T!=null){var L=this.getBounds(T.index,T.length);if(L!=null){var M=this.scroll.length()-1,U=this.scroll.line(Math.min(T.index,M)),$=a(U,1),Z=$[0],z=Z;if(T.length>0){var N=this.scroll.line(Math.min(T.index+T.length,M)),H=a(N,1);z=H[0]}if(!(Z==null||z==null)){var R=P.getBoundingClientRect();L.top<R.top?P.scrollTop-=R.top-L.top:L.bottom>R.bottom&&(P.scrollTop+=L.bottom-R.bottom)}}}}},{key:"setNativeRange",value:function(P,T){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:P,M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:T,U=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(_.info("setNativeRange",P,T,L,M),!(P!=null&&(this.root.parentNode==null||P.parentNode==null||L.parentNode==null))){var $=document.getSelection();if($!=null)if(P!=null){this.hasFocus()||this.root.focus();var Z=(this.getNativeRange()||{}).native;if(Z==null||U||P!==Z.startContainer||T!==Z.startOffset||L!==Z.endContainer||M!==Z.endOffset){P.tagName=="BR"&&(T=[].indexOf.call(P.parentNode.childNodes,P),P=P.parentNode),L.tagName=="BR"&&(M=[].indexOf.call(L.parentNode.childNodes,L),L=L.parentNode);var z=document.createRange();z.setStart(P,T),z.setEnd(L,M),$.removeAllRanges(),$.addRange(z)}}else $.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(P){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E.default.sources.API;if(typeof T=="string"&&(L=T,T=!1),_.info("setRange",P),P!=null){var M=this.rangeToNative(P);this.setNativeRange.apply(this,g(M).concat([T]))}else this.setNativeRange(null);this.update(L)}},{key:"update",value:function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E.default.sources.USER,T=this.lastRange,L=this.getRange(),M=a(L,2),U=M[0],$=M[1];if(this.lastRange=U,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,b.default)(T,this.lastRange)){var Z;!this.composing&&$!=null&&$.native.collapsed&&$.start.node!==this.cursor.textNode&&this.cursor.restore();var z=[E.default.events.SELECTION_CHANGE,(0,v.default)(this.lastRange),(0,v.default)(T),P];if((Z=this.emitter).emit.apply(Z,[E.default.events.EDITOR_CHANGE].concat(z)),P!==E.default.sources.SILENT){var N;(N=this.emitter).emit.apply(N,z)}}}}]),S}();function C(S,x){try{x.parentNode}catch{return!1}return x instanceof Text&&(x=x.parentNode),S.contains(x)}n.Range=O,n.default=k},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(y,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(y,g.key,g)}}return function(y,m,p){return m&&E(y.prototype,m),p&&E(y,p),y}}(),o=function E(y,m,p){y===null&&(y=Function.prototype);var g=Object.getOwnPropertyDescriptor(y,m);if(g===void 0){var d=Object.getPrototypeOf(y);return d===null?void 0:E(d,m,p)}else{if("value"in g)return g.value;var _=g.get;return _===void 0?void 0:_.call(p)}},l=i(0),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,y){if(!(E instanceof y))throw new TypeError("Cannot call a class as a function")}function w(E,y){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:E}function b(E,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);E.prototype=Object.create(y&&y.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(E,y):E.__proto__=y)}var h=function(E){b(y,E);function y(){return v(this,y),w(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"insertInto",value:function(p,g){p.children.length===0?o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"insertInto",this).call(this,p,g):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),y}(u.default.Embed);h.blotName="break",h.tagName="BR",n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,h){b.__proto__=h}||function(b,h){for(var E in h)h.hasOwnProperty(E)&&(b[E]=h[E])};return function(b,h){w(b,h);function E(){this.constructor=b}b.prototype=h===null?Object.create(h):(E.prototype=h.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(44),l=i(30),u=i(1),f=function(w){a(b,w);function b(h){var E=w.call(this,h)||this;return E.build(),E}return b.prototype.appendChild=function(h){this.insertBefore(h)},b.prototype.attach=function(){w.prototype.attach.call(this),this.children.forEach(function(h){h.attach()})},b.prototype.build=function(){var h=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(E){try{var y=v(E);h.insertBefore(y,h.children.head||void 0)}catch(m){if(m instanceof u.ParchmentError)return;throw m}})},b.prototype.deleteAt=function(h,E){if(h===0&&E===this.length())return this.remove();this.children.forEachAt(h,E,function(y,m,p){y.deleteAt(m,p)})},b.prototype.descendant=function(h,E){var y=this.children.find(E),m=y[0],p=y[1];return h.blotName==null&&h(m)||h.blotName!=null&&m instanceof h?[m,p]:m instanceof b?m.descendant(h,p):[null,-1]},b.prototype.descendants=function(h,E,y){E===void 0&&(E=0),y===void 0&&(y=Number.MAX_VALUE);var m=[],p=y;return this.children.forEachAt(E,y,function(g,d,_){(h.blotName==null&&h(g)||h.blotName!=null&&g instanceof h)&&m.push(g),g instanceof b&&(m=m.concat(g.descendants(h,d,p))),p-=_}),m},b.prototype.detach=function(){this.children.forEach(function(h){h.detach()}),w.prototype.detach.call(this)},b.prototype.formatAt=function(h,E,y,m){this.children.forEachAt(h,E,function(p,g,d){p.formatAt(g,d,y,m)})},b.prototype.insertAt=function(h,E,y){var m=this.children.find(h),p=m[0],g=m[1];if(p)p.insertAt(g,E,y);else{var d=y==null?u.create("text",E):u.create(E,y);this.appendChild(d)}},b.prototype.insertBefore=function(h,E){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(y){return h instanceof y}))throw new u.ParchmentError("Cannot insert "+h.statics.blotName+" into "+this.statics.blotName);h.insertInto(this,E)},b.prototype.length=function(){return this.children.reduce(function(h,E){return h+E.length()},0)},b.prototype.moveChildren=function(h,E){this.children.forEach(function(y){h.insertBefore(y,E)})},b.prototype.optimize=function(h){if(w.prototype.optimize.call(this,h),this.children.length===0)if(this.statics.defaultChild!=null){var E=u.create(this.statics.defaultChild);this.appendChild(E),E.optimize(h)}else this.remove()},b.prototype.path=function(h,E){E===void 0&&(E=!1);var y=this.children.find(h,E),m=y[0],p=y[1],g=[[this,h]];return m instanceof b?g.concat(m.path(p,E)):(m!=null&&g.push([m,p]),g)},b.prototype.removeChild=function(h){this.children.remove(h)},b.prototype.replace=function(h){h instanceof b&&h.moveChildren(this),w.prototype.replace.call(this,h)},b.prototype.split=function(h,E){if(E===void 0&&(E=!1),!E){if(h===0)return this;if(h===this.length())return this.next}var y=this.clone();return this.parent.insertBefore(y,this.next),this.children.forEachAt(h,this.length(),function(m,p,g){m=m.split(p,E),y.appendChild(m)}),y},b.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},b.prototype.update=function(h,E){var y=this,m=[],p=[];h.forEach(function(g){g.target===y.domNode&&g.type==="childList"&&(m.push.apply(m,g.addedNodes),p.push.apply(p,g.removedNodes))}),p.forEach(function(g){if(!(g.parentNode!=null&&g.tagName!=="IFRAME"&&document.body.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var d=u.find(g);d!=null&&(d.domNode.parentNode==null||d.domNode.parentNode===y.domNode)&&d.detach()}}),m.filter(function(g){return g.parentNode==y.domNode}).sort(function(g,d){return g===d?0:g.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(g){var d=null;g.nextSibling!=null&&(d=u.find(g.nextSibling));var _=v(g);(_.next!=d||_.next==null)&&(_.parent!=null&&_.parent.removeChild(y),y.insertBefore(_,d||void 0))})},b}(l.default);function v(w){var b=u.find(w);if(b==null)try{b=u.create(w)}catch{b=u.create(u.Scope.INLINE),[].slice.call(w.childNodes).forEach(function(E){b.domNode.appendChild(E)}),w.parentNode&&w.parentNode.replaceChild(b.domNode,w),b.attach()}return b}n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,h){b.__proto__=h}||function(b,h){for(var E in h)h.hasOwnProperty(E)&&(b[E]=h[E])};return function(b,h){w(b,h);function E(){this.constructor=b}b.prototype=h===null?Object.create(h):(E.prototype=h.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),l=i(31),u=i(17),f=i(1),v=function(w){a(b,w);function b(h){var E=w.call(this,h)||this;return E.attributes=new l.default(E.domNode),E}return b.formats=function(h){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return h.tagName.toLowerCase()},b.prototype.format=function(h,E){var y=f.query(h);y instanceof o.default?this.attributes.attribute(y,E):E&&y!=null&&(h!==this.statics.blotName||this.formats()[h]!==E)&&this.replaceWith(h,E)},b.prototype.formats=function(){var h=this.attributes.values(),E=this.statics.formats(this.domNode);return E!=null&&(h[this.statics.blotName]=E),h},b.prototype.replaceWith=function(h,E){var y=w.prototype.replaceWith.call(this,h,E);return this.attributes.copy(y),y},b.prototype.update=function(h,E){var y=this;w.prototype.update.call(this,h,E),h.some(function(m){return m.target===y.domNode&&m.type==="attributes"})&&this.attributes.build()},b.prototype.wrap=function(h,E){var y=w.prototype.wrap.call(this,h,E);return y instanceof b&&y.statics.scope===this.statics.scope&&this.attributes.move(y),y},b}(u.default);n.default=v},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var b in w)w.hasOwnProperty(b)&&(v[b]=w[b])};return function(v,w){f(v,w);function b(){this.constructor=v}v.prototype=w===null?Object.create(w):(b.prototype=w.prototype,new b)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),l=i(1),u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.value=function(w){return!0},v.prototype.index=function(w,b){return this.domNode===w||this.domNode.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(b,1):-1},v.prototype.position=function(w,b){var h=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return w>0&&(h+=1),[this.parent.domNode,h]},v.prototype.value=function(){var w;return w={},w[this.statics.blotName]=this.statics.value(this.domNode)||!0,w},v.scope=l.Scope.INLINE_BLOT,v}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),l={attributes:{compose:function(f,v,w){typeof f!="object"&&(f={}),typeof v!="object"&&(v={});var b=o(!0,{},v);w||(b=Object.keys(b).reduce(function(E,y){return b[y]!=null&&(E[y]=b[y]),E},{}));for(var h in f)f[h]!==void 0&&v[h]===void 0&&(b[h]=f[h]);return Object.keys(b).length>0?b:void 0},diff:function(f,v){typeof f!="object"&&(f={}),typeof v!="object"&&(v={});var w=Object.keys(f).concat(Object.keys(v)).reduce(function(b,h){return a(f[h],v[h])||(b[h]=v[h]===void 0?null:v[h]),b},{});return Object.keys(w).length>0?w:void 0},transform:function(f,v,w){if(typeof f!="object")return v;if(typeof v=="object"){if(!w)return v;var b=Object.keys(v).reduce(function(h,E){return f[E]===void 0&&(h[E]=v[E]),h},{});return Object.keys(b).length>0?b:void 0}}},iterator:function(f){return new u(f)},length:function(f){return typeof f.delete=="number"?f.delete:typeof f.retain=="number"?f.retain:typeof f.insert=="string"?f.insert.length:1}};function u(f){this.ops=f,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(f){f||(f=1/0);var v=this.ops[this.index];if(v){var w=this.offset,b=l.length(v);if(f>=b-w?(f=b-w,this.index+=1,this.offset=0):this.offset+=f,typeof v.delete=="number")return{delete:f};var h={};return v.attributes&&(h.attributes=v.attributes),typeof v.retain=="number"?h.retain=f:typeof v.insert=="string"?h.insert=v.insert.substr(w,f):h.insert=v.insert,h}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var f=this.offset,v=this.index,w=this.next(),b=this.ops.slice(this.index);return this.offset=f,this.index=v,[w].concat(b)}else return[]},r.exports=l},function(r,n){var i=function(){function a(y,m){return m!=null&&y instanceof m}var o;try{o=Map}catch{o=function(){}}var l;try{l=Set}catch{l=function(){}}var u;try{u=Promise}catch{u=function(){}}function f(y,m,p,g,d){typeof m=="object"&&(p=m.depth,g=m.prototype,d=m.includeNonEnumerable,m=m.circular);var _=[],O=[],k=typeof Buffer<"u";typeof m>"u"&&(m=!0),typeof p>"u"&&(p=1/0);function C(S,x){if(S===null)return null;if(x===0)return S;var P,T;if(typeof S!="object")return S;if(a(S,o))P=new o;else if(a(S,l))P=new l;else if(a(S,u))P=new u(function(R,F){S.then(function(B){R(C(B,x-1))},function(B){F(C(B,x-1))})});else if(f.__isArray(S))P=[];else if(f.__isRegExp(S))P=new RegExp(S.source,E(S)),S.lastIndex&&(P.lastIndex=S.lastIndex);else if(f.__isDate(S))P=new Date(S.getTime());else{if(k&&Buffer.isBuffer(S))return Buffer.allocUnsafe?P=Buffer.allocUnsafe(S.length):P=new Buffer(S.length),S.copy(P),P;a(S,Error)?P=Object.create(S):typeof g>"u"?(T=Object.getPrototypeOf(S),P=Object.create(T)):(P=Object.create(g),T=g)}if(m){var L=_.indexOf(S);if(L!=-1)return O[L];_.push(S),O.push(P)}a(S,o)&&S.forEach(function(R,F){var B=C(F,x-1),D=C(R,x-1);P.set(B,D)}),a(S,l)&&S.forEach(function(R){var F=C(R,x-1);P.add(F)});for(var M in S){var U;T&&(U=Object.getOwnPropertyDescriptor(T,M)),!(U&&U.set==null)&&(P[M]=C(S[M],x-1))}if(Object.getOwnPropertySymbols)for(var $=Object.getOwnPropertySymbols(S),M=0;M<$.length;M++){var Z=$[M],z=Object.getOwnPropertyDescriptor(S,Z);z&&!z.enumerable&&!d||(P[Z]=C(S[Z],x-1),z.enumerable||Object.defineProperty(P,Z,{enumerable:!1}))}if(d)for(var N=Object.getOwnPropertyNames(S),M=0;M<N.length;M++){var H=N[M],z=Object.getOwnPropertyDescriptor(S,H);z&&z.enumerable||(P[H]=C(S[H],x-1),Object.defineProperty(P,H,{enumerable:!1}))}return P}return C(y,p)}f.clonePrototype=function(m){if(m===null)return null;var p=function(){};return p.prototype=m,new p};function v(y){return Object.prototype.toString.call(y)}f.__objToStr=v;function w(y){return typeof y=="object"&&v(y)==="[object Date]"}f.__isDate=w;function b(y){return typeof y=="object"&&v(y)==="[object Array]"}f.__isArray=b;function h(y){return typeof y=="object"&&v(y)==="[object RegExp]"}f.__isRegExp=h;function E(y){var m="";return y.global&&(m+="g"),y.ignoreCase&&(m+="i"),y.multiline&&(m+="m"),m}return f.__getRegExpFlags=E,f}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function P(T,L){var M=[],U=!0,$=!1,Z=void 0;try{for(var z=T[Symbol.iterator](),N;!(U=(N=z.next()).done)&&(M.push(N.value),!(L&&M.length===L));U=!0);}catch(H){$=!0,Z=H}finally{try{!U&&z.return&&z.return()}finally{if($)throw Z}}return M}return function(T,L){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return P(T,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function P(T,L){for(var M=0;M<L.length;M++){var U=L[M];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(T,U.key,U)}}return function(T,L,M){return L&&P(T.prototype,L),M&&P(T,M),T}}(),l=function P(T,L,M){T===null&&(T=Function.prototype);var U=Object.getOwnPropertyDescriptor(T,L);if(U===void 0){var $=Object.getPrototypeOf(T);return $===null?void 0:P($,L,M)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(M)}},u=i(0),f=_(u),v=i(8),w=_(v),b=i(4),h=_(b),E=i(16),y=_(E),m=i(13),p=_(m),g=i(25),d=_(g);function _(P){return P&&P.__esModule?P:{default:P}}function O(P,T){if(!(P instanceof T))throw new TypeError("Cannot call a class as a function")}function k(P,T){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:P}function C(P,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);P.prototype=Object.create(T&&T.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(P,T):P.__proto__=T)}function S(P){return P instanceof h.default||P instanceof b.BlockEmbed}var x=function(P){C(T,P);function T(L,M){O(this,T);var U=k(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,L));return U.emitter=M.emitter,Array.isArray(M.whitelist)&&(U.whitelist=M.whitelist.reduce(function($,Z){return $[Z]=!0,$},{})),U.domNode.addEventListener("DOMNodeInserted",function(){}),U.optimize(),U.enable(),U}return o(T,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(M,U){var $=this.line(M),Z=a($,2),z=Z[0],N=Z[1],H=this.line(M+U),R=a(H,1),F=R[0];if(l(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"deleteAt",this).call(this,M,U),F!=null&&z!==F&&N>0){if(z instanceof b.BlockEmbed||F instanceof b.BlockEmbed){this.optimize();return}if(z instanceof p.default){var B=z.newlineIndex(z.length(),!0);if(B>-1&&(z=z.split(B+1),z===F)){this.optimize();return}}else if(F instanceof p.default){var D=F.newlineIndex(0);D>-1&&F.split(D+1)}var V=F.children.head instanceof y.default?null:F.children.head;z.moveChildren(F,V),z.remove()}this.optimize()}},{key:"enable",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",M)}},{key:"formatAt",value:function(M,U,$,Z){this.whitelist!=null&&!this.whitelist[$]||(l(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"formatAt",this).call(this,M,U,$,Z),this.optimize())}},{key:"insertAt",value:function(M,U,$){if(!($!=null&&this.whitelist!=null&&!this.whitelist[U])){if(M>=this.length())if($==null||f.default.query(U,f.default.Scope.BLOCK)==null){var Z=f.default.create(this.statics.defaultChild);this.appendChild(Z),$==null&&U.endsWith(`
127
+ `)&&(U=U.slice(0,-1)),Z.insertAt(0,U,$)}else{var z=f.default.create(U,$);this.appendChild(z)}else l(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertAt",this).call(this,M,U,$);this.optimize()}}},{key:"insertBefore",value:function(M,U){if(M.statics.scope===f.default.Scope.INLINE_BLOT){var $=f.default.create(this.statics.defaultChild);$.appendChild(M),M=$}l(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertBefore",this).call(this,M,U)}},{key:"leaf",value:function(M){return this.path(M).pop()||[null,-1]}},{key:"line",value:function(M){return M===this.length()?this.line(M-1):this.descendant(S,M)}},{key:"lines",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,$=function Z(z,N,H){var R=[],F=H;return z.children.forEachAt(N,H,function(B,D,V){S(B)?R.push(B):B instanceof f.default.Container&&(R=R.concat(Z(B,D,F))),F-=V}),R};return $(this,M,U)}},{key:"optimize",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"optimize",this).call(this,M,U),M.length>0&&this.emitter.emit(w.default.events.SCROLL_OPTIMIZE,M,U))}},{key:"path",value:function(M){return l(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"path",this).call(this,M).slice(1)}},{key:"update",value:function(M){if(this.batch!==!0){var U=w.default.sources.USER;typeof M=="string"&&(U=M),Array.isArray(M)||(M=this.observer.takeRecords()),M.length>0&&this.emitter.emit(w.default.events.SCROLL_BEFORE_UPDATE,U,M),l(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"update",this).call(this,M.concat([])),M.length>0&&this.emitter.emit(w.default.events.SCROLL_UPDATE,U,M)}}}]),T}(f.default.Scroll);x.blotName="scroll",x.className="ql-editor",x.tagName="DIV",x.defaultChild="block",x.allowedChildren=[h.default,b.BlockEmbed,d.default],n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},o=function(){function q(G,K){var X=[],Q=!0,ee=!1,te=void 0;try{for(var ae=G[Symbol.iterator](),oe;!(Q=(oe=ae.next()).done)&&(X.push(oe.value),!(K&&X.length===K));Q=!0);}catch(se){ee=!0,te=se}finally{try{!Q&&ae.return&&ae.return()}finally{if(ee)throw te}}return X}return function(G,K){if(Array.isArray(G))return G;if(Symbol.iterator in Object(G))return q(G,K);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function q(G,K){for(var X=0;X<K.length;X++){var Q=K[X];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(G,Q.key,Q)}}return function(G,K,X){return K&&q(G.prototype,K),X&&q(G,X),G}}(),u=i(21),f=P(u),v=i(11),w=P(v),b=i(3),h=P(b),E=i(2),y=P(E),m=i(20),p=P(m),g=i(0),d=P(g),_=i(5),O=P(_),k=i(10),C=P(k),S=i(9),x=P(S);function P(q){return q&&q.__esModule?q:{default:q}}function T(q,G,K){return G in q?Object.defineProperty(q,G,{value:K,enumerable:!0,configurable:!0,writable:!0}):q[G]=K,q}function L(q,G){if(!(q instanceof G))throw new TypeError("Cannot call a class as a function")}function M(q,G){if(!q)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return G&&(typeof G=="object"||typeof G=="function")?G:q}function U(q,G){if(typeof G!="function"&&G!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof G);q.prototype=Object.create(G&&G.prototype,{constructor:{value:q,enumerable:!1,writable:!0,configurable:!0}}),G&&(Object.setPrototypeOf?Object.setPrototypeOf(q,G):q.__proto__=G)}var $=(0,C.default)("quill:keyboard"),Z=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",z=function(q){U(G,q),l(G,null,[{key:"match",value:function(X,Q){return Q=Y(Q),["altKey","ctrlKey","metaKey","shiftKey"].some(function(ee){return!!Q[ee]!==X[ee]&&Q[ee]!==null})?!1:Q.key===(X.which||X.keyCode)}}]);function G(K,X){L(this,G);var Q=M(this,(G.__proto__||Object.getPrototypeOf(G)).call(this,K,X));return Q.bindings={},Object.keys(Q.options.bindings).forEach(function(ee){ee==="list autofill"&&K.scroll.whitelist!=null&&!K.scroll.whitelist.list||Q.options.bindings[ee]&&Q.addBinding(Q.options.bindings[ee])}),Q.addBinding({key:G.keys.ENTER,shiftKey:null},B),Q.addBinding({key:G.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(Q.addBinding({key:G.keys.BACKSPACE},{collapsed:!0},H),Q.addBinding({key:G.keys.DELETE},{collapsed:!0},R)):(Q.addBinding({key:G.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},H),Q.addBinding({key:G.keys.DELETE},{collapsed:!0,suffix:/^.?$/},R)),Q.addBinding({key:G.keys.BACKSPACE},{collapsed:!1},F),Q.addBinding({key:G.keys.DELETE},{collapsed:!1},F),Q.addBinding({key:G.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},H),Q.listen(),Q}return l(G,[{key:"addBinding",value:function(X){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},te=Y(X);if(te==null||te.key==null)return $.warn("Attempted to add invalid keyboard binding",te);typeof Q=="function"&&(Q={handler:Q}),typeof ee=="function"&&(ee={handler:ee}),te=(0,h.default)(te,Q,ee),this.bindings[te.key]=this.bindings[te.key]||[],this.bindings[te.key].push(te)}},{key:"listen",value:function(){var X=this;this.quill.root.addEventListener("keydown",function(Q){if(!Q.defaultPrevented){var ee=Q.which||Q.keyCode,te=(X.bindings[ee]||[]).filter(function(We){return G.match(Q,We)});if(te.length!==0){var ae=X.quill.getSelection();if(!(ae==null||!X.quill.hasFocus())){var oe=X.quill.getLine(ae.index),se=o(oe,2),ke=se[0],Fe=se[1],fe=X.quill.getLeaf(ae.index),ie=o(fe,2),ge=ie[0],pe=ie[1],re=ae.length===0?[ge,pe]:X.quill.getLeaf(ae.index+ae.length),de=o(re,2),be=de[0],ye=de[1],Ie=ge instanceof d.default.Text?ge.value().slice(0,pe):"",Ee=be instanceof d.default.Text?be.value().slice(ye):"",Ae={collapsed:ae.length===0,empty:ae.length===0&&ke.length()<=1,format:X.quill.getFormat(ae),offset:Fe,prefix:Ie,suffix:Ee},Ze=te.some(function(We){if(We.collapsed!=null&&We.collapsed!==Ae.collapsed||We.empty!=null&&We.empty!==Ae.empty||We.offset!=null&&We.offset!==Ae.offset)return!1;if(Array.isArray(We.format)){if(We.format.every(function(dt){return Ae.format[dt]==null}))return!1}else if(a(We.format)==="object"&&!Object.keys(We.format).every(function(dt){return We.format[dt]===!0?Ae.format[dt]!=null:We.format[dt]===!1?Ae.format[dt]==null:(0,w.default)(We.format[dt],Ae.format[dt])}))return!1;return We.prefix!=null&&!We.prefix.test(Ae.prefix)||We.suffix!=null&&!We.suffix.test(Ae.suffix)?!1:We.handler.call(X,ae,Ae)!==!0});Ze&&Q.preventDefault()}}}})}}]),G}(x.default);z.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},z.DEFAULTS={bindings:{bold:V("bold"),italic:V("italic"),underline:V("underline"),indent:{key:z.keys.TAB,format:["blockquote","indent","list"],handler:function(G,K){if(K.collapsed&&K.offset!==0)return!0;this.quill.format("indent","+1",O.default.sources.USER)}},outdent:{key:z.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(G,K){if(K.collapsed&&K.offset!==0)return!0;this.quill.format("indent","-1",O.default.sources.USER)}},"outdent backspace":{key:z.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(G,K){K.format.indent!=null?this.quill.format("indent","-1",O.default.sources.USER):K.format.list!=null&&this.quill.format("list",!1,O.default.sources.USER)}},"indent code-block":D(!0),"outdent code-block":D(!1),"remove tab":{key:z.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(G){this.quill.deleteText(G.index-1,1,O.default.sources.USER)}},tab:{key:z.keys.TAB,handler:function(G){this.quill.history.cutoff();var K=new y.default().retain(G.index).delete(G.length).insert(" ");this.quill.updateContents(K,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(G.index+1,O.default.sources.SILENT)}},"list empty enter":{key:z.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(G,K){this.quill.format("list",!1,O.default.sources.USER),K.format.indent&&this.quill.format("indent",!1,O.default.sources.USER)}},"checklist enter":{key:z.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(G){var K=this.quill.getLine(G.index),X=o(K,2),Q=X[0],ee=X[1],te=(0,h.default)({},Q.formats(),{list:"checked"}),ae=new y.default().retain(G.index).insert(`
128
+ `,te).retain(Q.length()-ee-1).retain(1,{list:"unchecked"});this.quill.updateContents(ae,O.default.sources.USER),this.quill.setSelection(G.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:z.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(G,K){var X=this.quill.getLine(G.index),Q=o(X,2),ee=Q[0],te=Q[1],ae=new y.default().retain(G.index).insert(`
129
+ `,K.format).retain(ee.length()-te-1).retain(1,{header:null});this.quill.updateContents(ae,O.default.sources.USER),this.quill.setSelection(G.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(G,K){var X=K.prefix.length,Q=this.quill.getLine(G.index),ee=o(Q,2),te=ee[0],ae=ee[1];if(ae>X)return!0;var oe=void 0;switch(K.prefix.trim()){case"[]":case"[ ]":oe="unchecked";break;case"[x]":oe="checked";break;case"-":case"*":oe="bullet";break;default:oe="ordered"}this.quill.insertText(G.index," ",O.default.sources.USER),this.quill.history.cutoff();var se=new y.default().retain(G.index-ae).delete(X+1).retain(te.length()-2-ae).retain(1,{list:oe});this.quill.updateContents(se,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(G.index-X,O.default.sources.SILENT)}},"code exit":{key:z.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(G){var K=this.quill.getLine(G.index),X=o(K,2),Q=X[0],ee=X[1],te=new y.default().retain(G.index+Q.length()-ee-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(te,O.default.sources.USER)}},"embed left":N(z.keys.LEFT,!1),"embed left shift":N(z.keys.LEFT,!0),"embed right":N(z.keys.RIGHT,!1),"embed right shift":N(z.keys.RIGHT,!0)}};function N(q,G){var K,X=q===z.keys.LEFT?"prefix":"suffix";return K={key:q,shiftKey:G,altKey:null},T(K,X,/^$/),T(K,"handler",function(ee){var te=ee.index;q===z.keys.RIGHT&&(te+=ee.length+1);var ae=this.quill.getLeaf(te),oe=o(ae,1),se=oe[0];return se instanceof d.default.Embed?(q===z.keys.LEFT?G?this.quill.setSelection(ee.index-1,ee.length+1,O.default.sources.USER):this.quill.setSelection(ee.index-1,O.default.sources.USER):G?this.quill.setSelection(ee.index,ee.length+1,O.default.sources.USER):this.quill.setSelection(ee.index+ee.length+1,O.default.sources.USER),!1):!0}),K}function H(q,G){if(!(q.index===0||this.quill.getLength()<=1)){var K=this.quill.getLine(q.index),X=o(K,1),Q=X[0],ee={};if(G.offset===0){var te=this.quill.getLine(q.index-1),ae=o(te,1),oe=ae[0];if(oe!=null&&oe.length()>1){var se=Q.formats(),ke=this.quill.getFormat(q.index-1,1);ee=p.default.attributes.diff(se,ke)||{}}}var Fe=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(G.prefix)?2:1;this.quill.deleteText(q.index-Fe,Fe,O.default.sources.USER),Object.keys(ee).length>0&&this.quill.formatLine(q.index-Fe,Fe,ee,O.default.sources.USER),this.quill.focus()}}function R(q,G){var K=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(G.suffix)?2:1;if(!(q.index>=this.quill.getLength()-K)){var X={},Q=0,ee=this.quill.getLine(q.index),te=o(ee,1),ae=te[0];if(G.offset>=ae.length()-1){var oe=this.quill.getLine(q.index+1),se=o(oe,1),ke=se[0];if(ke){var Fe=ae.formats(),fe=this.quill.getFormat(q.index,1);X=p.default.attributes.diff(Fe,fe)||{},Q=ke.length()}}this.quill.deleteText(q.index,K,O.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine(q.index+Q-1,K,X,O.default.sources.USER)}}function F(q){var G=this.quill.getLines(q),K={};if(G.length>1){var X=G[0].formats(),Q=G[G.length-1].formats();K=p.default.attributes.diff(Q,X)||{}}this.quill.deleteText(q,O.default.sources.USER),Object.keys(K).length>0&&this.quill.formatLine(q.index,1,K,O.default.sources.USER),this.quill.setSelection(q.index,O.default.sources.SILENT),this.quill.focus()}function B(q,G){var K=this;q.length>0&&this.quill.scroll.deleteAt(q.index,q.length);var X=Object.keys(G.format).reduce(function(Q,ee){return d.default.query(ee,d.default.Scope.BLOCK)&&!Array.isArray(G.format[ee])&&(Q[ee]=G.format[ee]),Q},{});this.quill.insertText(q.index,`
130
+ `,X,O.default.sources.USER),this.quill.setSelection(q.index+1,O.default.sources.SILENT),this.quill.focus(),Object.keys(G.format).forEach(function(Q){X[Q]==null&&(Array.isArray(G.format[Q])||Q!=="link"&&K.quill.format(Q,G.format[Q],O.default.sources.USER))})}function D(q){return{key:z.keys.TAB,shiftKey:!q,format:{"code-block":!0},handler:function(K){var X=d.default.query("code-block"),Q=K.index,ee=K.length,te=this.quill.scroll.descendant(X,Q),ae=o(te,2),oe=ae[0],se=ae[1];if(oe!=null){var ke=this.quill.getIndex(oe),Fe=oe.newlineIndex(se,!0)+1,fe=oe.newlineIndex(ke+se+ee),ie=oe.domNode.textContent.slice(Fe,fe).split(`
131
+ `);se=0,ie.forEach(function(ge,pe){q?(oe.insertAt(Fe+se,X.TAB),se+=X.TAB.length,pe===0?Q+=X.TAB.length:ee+=X.TAB.length):ge.startsWith(X.TAB)&&(oe.deleteAt(Fe+se,X.TAB.length),se-=X.TAB.length,pe===0?Q-=X.TAB.length:ee-=X.TAB.length),se+=ge.length+1}),this.quill.update(O.default.sources.USER),this.quill.setSelection(Q,ee,O.default.sources.SILENT)}}}}function V(q){return{key:q[0].toUpperCase(),shortKey:!0,handler:function(K,X){this.quill.format(q,!X.format[q],O.default.sources.USER)}}}function Y(q){if(typeof q=="string"||typeof q=="number")return Y({key:q});if((typeof q>"u"?"undefined":a(q))==="object"&&(q=(0,f.default)(q,!1)),typeof q.key=="string")if(z.keys[q.key.toUpperCase()]!=null)q.key=z.keys[q.key.toUpperCase()];else if(q.key.length===1)q.key=q.key.toUpperCase().charCodeAt(0);else return null;return q.shortKey&&(q[Z]=q.shortKey,delete q.shortKey),q}n.default=z,n.SHORTKEY=Z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(g,d){var _=[],O=!0,k=!1,C=void 0;try{for(var S=g[Symbol.iterator](),x;!(O=(x=S.next()).done)&&(_.push(x.value),!(d&&_.length===d));O=!0);}catch(P){k=!0,C=P}finally{try{!O&&S.return&&S.return()}finally{if(k)throw C}}return _}return function(g,d){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function p(g,d,_){g===null&&(g=Function.prototype);var O=Object.getOwnPropertyDescriptor(g,d);if(O===void 0){var k=Object.getPrototypeOf(g);return k===null?void 0:p(k,d,_)}else{if("value"in O)return O.value;var C=O.get;return C===void 0?void 0:C.call(_)}},l=function(){function p(g,d){for(var _=0;_<d.length;_++){var O=d[_];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(g,O.key,O)}}return function(g,d,_){return d&&p(g.prototype,d),_&&p(g,_),g}}(),u=i(0),f=b(u),v=i(7),w=b(v);function b(p){return p&&p.__esModule?p:{default:p}}function h(p,g){if(!(p instanceof g))throw new TypeError("Cannot call a class as a function")}function E(p,g){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:p}function y(p,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);p.prototype=Object.create(g&&g.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(p,g):p.__proto__=g)}var m=function(p){y(g,p),l(g,null,[{key:"value",value:function(){}}]);function g(d,_){h(this,g);var O=E(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,d));return O.selection=_,O.textNode=document.createTextNode(g.CONTENTS),O.domNode.appendChild(O.textNode),O._length=0,O}return l(g,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(_,O){if(this._length!==0)return o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,_,O);for(var k=this,C=0;k!=null&&k.statics.scope!==f.default.Scope.BLOCK_BLOT;)C+=k.offset(k.parent),k=k.parent;k!=null&&(this._length=g.CONTENTS.length,k.optimize(),k.formatAt(C,g.CONTENTS.length,_,O),this._length=0)}},{key:"index",value:function(_,O){return _===this.textNode?0:o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"index",this).call(this,_,O)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var _=this.textNode,O=this.selection.getNativeRange(),k=void 0,C=void 0,S=void 0;if(O!=null&&O.start.node===_&&O.end.node===_){var x=[_,O.start.offset,O.end.offset];k=x[0],C=x[1],S=x[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==g.CONTENTS){var P=this.textNode.data.split(g.CONTENTS).join("");this.next instanceof w.default?(k=this.next.domNode,this.next.insertAt(0,P),this.textNode.data=g.CONTENTS):(this.textNode.data=P,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(g.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),C!=null){var T=[C,S].map(function(M){return Math.max(0,Math.min(k.data.length,M-1))}),L=a(T,2);return C=L[0],S=L[1],{startNode:k,startOffset:C,endNode:k,endOffset:S}}}}},{key:"update",value:function(_,O){var k=this;if(_.some(function(S){return S.type==="characterData"&&S.target===k.textNode})){var C=this.restore();C&&(O.range=C)}}},{key:"value",value:function(){return""}}]),g}(f.default.Embed);m.blotName="cursor",m.className="ql-cursor",m.tagName="span",m.CONTENTS="\uFEFF",n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=f(a),l=i(4),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,y){if(!(E instanceof y))throw new TypeError("Cannot call a class as a function")}function w(E,y){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:E}function b(E,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);E.prototype=Object.create(y&&y.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(E,y):E.__proto__=y)}var h=function(E){b(y,E);function y(){return v(this,y),w(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return y}(o.default.Container);h.allowedChildren=[u.default,l.BlockEmbed,h],n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function m(p,g){for(var d=0;d<g.length;d++){var _=g[d];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(p,_.key,_)}}return function(p,g,d){return g&&m(p.prototype,g),d&&m(p,d),p}}(),o=function m(p,g,d){p===null&&(p=Function.prototype);var _=Object.getOwnPropertyDescriptor(p,g);if(_===void 0){var O=Object.getPrototypeOf(p);return O===null?void 0:m(O,g,d)}else{if("value"in _)return _.value;var k=_.get;return k===void 0?void 0:k.call(d)}},l=i(0),u=f(l);function f(m){return m&&m.__esModule?m:{default:m}}function v(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function w(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function b(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var h=function(m){b(p,m);function p(){return v(this,p),w(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"value",value:function(d){var _=o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"value",this).call(this,d);return _.startsWith("rgb(")?(_=_.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+_.split(",").map(function(O){return("00"+parseInt(O).toString(16)).slice(-2)}).join("")):_}}]),p}(u.default.Attributor.Style),E=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),y=new h("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=h,n.ColorClass=E,n.ColorStyle=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function y(m,p){for(var g=0;g<p.length;g++){var d=p[g];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(m,d.key,d)}}return function(m,p,g){return p&&y(m.prototype,p),g&&y(m,g),m}}(),o=function y(m,p,g){m===null&&(m=Function.prototype);var d=Object.getOwnPropertyDescriptor(m,p);if(d===void 0){var _=Object.getPrototypeOf(m);return _===null?void 0:y(_,p,g)}else{if("value"in d)return d.value;var O=d.get;return O===void 0?void 0:O.call(g)}},l=i(6),u=f(l);function f(y){return y&&y.__esModule?y:{default:y}}function v(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")}function w(y,m){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:y}function b(y,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);y.prototype=Object.create(m&&m.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(y,m):y.__proto__=m)}var h=function(y){b(m,y);function m(){return v(this,m),w(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"format",value:function(g,d){if(g!==this.statics.blotName||!d)return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"format",this).call(this,g,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(g){var d=o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,g);return g=this.sanitize(g),d.setAttribute("href",g),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("target","_blank"),d}},{key:"formats",value:function(g){return g.getAttribute("href")}},{key:"sanitize",value:function(g){return E(g,this.PROTOCOL_WHITELIST)?g:this.SANITIZED_URL}}]),m}(u.default);h.blotName="link",h.tagName="A",h.SANITIZED_URL="about:blank",h.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function E(y,m){var p=document.createElement("a");p.href=y;var g=p.href.slice(0,p.href.indexOf(":"));return m.indexOf(g)>-1}n.default=h,n.sanitize=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},o=function(){function m(p,g){for(var d=0;d<g.length;d++){var _=g[d];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(p,_.key,_)}}return function(p,g,d){return g&&m(p.prototype,g),d&&m(p,d),p}}(),l=i(23),u=w(l),f=i(107),v=w(f);function w(m){return m&&m.__esModule?m:{default:m}}function b(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}var h=0;function E(m,p){m.setAttribute(p,m.getAttribute(p)!=="true")}var y=function(){function m(p){var g=this;b(this,m),this.select=p,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){g.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case u.default.keys.ENTER:g.togglePicker();break;case u.default.keys.ESCAPE:g.escape(),d.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(m,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),E(this.label,"aria-expanded"),E(this.options,"aria-hidden")}},{key:"buildItem",value:function(g){var d=this,_=document.createElement("span");return _.tabIndex="0",_.setAttribute("role","button"),_.classList.add("ql-picker-item"),g.hasAttribute("value")&&_.setAttribute("data-value",g.getAttribute("value")),g.textContent&&_.setAttribute("data-label",g.textContent),_.addEventListener("click",function(){d.selectItem(_,!0)}),_.addEventListener("keydown",function(O){switch(O.keyCode){case u.default.keys.ENTER:d.selectItem(_,!0),O.preventDefault();break;case u.default.keys.ESCAPE:d.escape(),O.preventDefault();break}}),_}},{key:"buildLabel",value:function(){var g=document.createElement("span");return g.classList.add("ql-picker-label"),g.innerHTML=v.default,g.tabIndex="0",g.setAttribute("role","button"),g.setAttribute("aria-expanded","false"),this.container.appendChild(g),g}},{key:"buildOptions",value:function(){var g=this,d=document.createElement("span");d.classList.add("ql-picker-options"),d.setAttribute("aria-hidden","true"),d.tabIndex="-1",d.id="ql-picker-options-"+h,h+=1,this.label.setAttribute("aria-controls",d.id),this.options=d,[].slice.call(this.select.options).forEach(function(_){var O=g.buildItem(_);d.appendChild(O),_.selected===!0&&g.selectItem(O)}),this.container.appendChild(d)}},{key:"buildPicker",value:function(){var g=this;[].slice.call(this.select.attributes).forEach(function(d){g.container.setAttribute(d.name,d.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var g=this;this.close(),setTimeout(function(){return g.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(g){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_=this.container.querySelector(".ql-selected");if(g!==_&&(_!=null&&_.classList.remove("ql-selected"),g!=null&&(g.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(g.parentNode.children,g),g.hasAttribute("data-value")?this.label.setAttribute("data-value",g.getAttribute("data-value")):this.label.removeAttribute("data-value"),g.hasAttribute("data-label")?this.label.setAttribute("data-label",g.getAttribute("data-label")):this.label.removeAttribute("data-label"),d))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":a(Event))==="object"){var O=document.createEvent("Event");O.initEvent("change",!0,!0),this.select.dispatchEvent(O)}this.close()}}},{key:"update",value:function(){var g=void 0;if(this.select.selectedIndex>-1){var d=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];g=this.select.options[this.select.selectedIndex],this.selectItem(d)}else this.selectItem(null);var _=g!=null&&g!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",_)}}]),m}();n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=$(a),l=i(5),u=$(l),f=i(4),v=$(f),w=i(16),b=$(w),h=i(25),E=$(h),y=i(24),m=$(y),p=i(35),g=$(p),d=i(6),_=$(d),O=i(22),k=$(O),C=i(7),S=$(C),x=i(55),P=$(x),T=i(42),L=$(T),M=i(23),U=$(M);function $(Z){return Z&&Z.__esModule?Z:{default:Z}}u.default.register({"blots/block":v.default,"blots/block/embed":f.BlockEmbed,"blots/break":b.default,"blots/container":E.default,"blots/cursor":m.default,"blots/embed":g.default,"blots/inline":_.default,"blots/scroll":k.default,"blots/text":S.default,"modules/clipboard":P.default,"modules/history":L.default,"modules/keyboard":U.default}),o.default.register(v.default,b.default,m.default,_.default,k.default,S.default),n.default=u.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u){this.domNode=u,this.domNode[a.DATA_KEY]={blot:this}}return Object.defineProperty(l.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),l.create=function(u){if(this.tagName==null)throw new a.ParchmentError("Blot definition missing tagName");var f;return Array.isArray(this.tagName)?(typeof u=="string"&&(u=u.toUpperCase(),parseInt(u).toString()===u&&(u=parseInt(u))),typeof u=="number"?f=document.createElement(this.tagName[u-1]):this.tagName.indexOf(u)>-1?f=document.createElement(u):f=document.createElement(this.tagName[0])):f=document.createElement(this.tagName),this.className&&f.classList.add(this.className),f},l.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},l.prototype.clone=function(){var u=this.domNode.cloneNode(!1);return a.create(u)},l.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[a.DATA_KEY]},l.prototype.deleteAt=function(u,f){var v=this.isolate(u,f);v.remove()},l.prototype.formatAt=function(u,f,v,w){var b=this.isolate(u,f);if(a.query(v,a.Scope.BLOT)!=null&&w)b.wrap(v,w);else if(a.query(v,a.Scope.ATTRIBUTE)!=null){var h=a.create(this.statics.scope);b.wrap(h),h.format(v,w)}},l.prototype.insertAt=function(u,f,v){var w=v==null?a.create("text",f):a.create(f,v),b=this.split(u);this.parent.insertBefore(w,b)},l.prototype.insertInto=function(u,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var v=null;u.children.insertBefore(this,f),f!=null&&(v=f.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=v)&&u.domNode.insertBefore(this.domNode,v),this.parent=u,this.attach()},l.prototype.isolate=function(u,f){var v=this.split(u);return v.split(f),v},l.prototype.length=function(){return 1},l.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},l.prototype.optimize=function(u){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},l.prototype.replaceWith=function(u,f){var v=typeof u=="string"?a.create(u,f):u;return v.replace(this),v},l.prototype.split=function(u,f){return u===0?this:this.next},l.prototype.update=function(u,f){},l.prototype.wrap=function(u,f){var v=typeof u=="string"?a.create(u,f):u;return this.parent!=null&&this.parent.insertBefore(v,this.next),v.appendChild(this),v},l.blotName="abstract",l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(12),o=i(32),l=i(33),u=i(1),f=function(){function v(w){this.attributes={},this.domNode=w,this.build()}return v.prototype.attribute=function(w,b){b?w.add(this.domNode,b)&&(w.value(this.domNode)!=null?this.attributes[w.attrName]=w:delete this.attributes[w.attrName]):(w.remove(this.domNode),delete this.attributes[w.attrName])},v.prototype.build=function(){var w=this;this.attributes={};var b=a.default.keys(this.domNode),h=o.default.keys(this.domNode),E=l.default.keys(this.domNode);b.concat(h).concat(E).forEach(function(y){var m=u.query(y,u.Scope.ATTRIBUTE);m instanceof a.default&&(w.attributes[m.attrName]=m)})},v.prototype.copy=function(w){var b=this;Object.keys(this.attributes).forEach(function(h){var E=b.attributes[h].value(b.domNode);w.format(h,E)})},v.prototype.move=function(w){var b=this;this.copy(w),Object.keys(this.attributes).forEach(function(h){b.attributes[h].remove(b.domNode)}),this.attributes={}},v.prototype.values=function(){var w=this;return Object.keys(this.attributes).reduce(function(b,h){return b[h]=w.attributes[h].value(w.domNode),b},{})},v}();n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var b in w)w.hasOwnProperty(b)&&(v[b]=w[b])};return function(v,w){f(v,w);function b(){this.constructor=v}v.prototype=w===null?Object.create(w):(b.prototype=w.prototype,new b)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f,v){var w=f.getAttribute("class")||"";return w.split(/\s+/).filter(function(b){return b.indexOf(v+"-")===0})}var u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.keys=function(w){return(w.getAttribute("class")||"").split(/\s+/).map(function(b){return b.split("-").slice(0,-1).join("-")})},v.prototype.add=function(w,b){return this.canAdd(w,b)?(this.remove(w),w.classList.add(this.keyName+"-"+b),!0):!1},v.prototype.remove=function(w){var b=l(w,this.keyName);b.forEach(function(h){w.classList.remove(h)}),w.classList.length===0&&w.removeAttribute("class")},v.prototype.value=function(w){var b=l(w,this.keyName)[0]||"",h=b.slice(this.keyName.length+1);return this.canAdd(w,h)?h:""},v}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var b in w)w.hasOwnProperty(b)&&(v[b]=w[b])};return function(v,w){f(v,w);function b(){this.constructor=v}v.prototype=w===null?Object.create(w):(b.prototype=w.prototype,new b)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f){var v=f.split("-"),w=v.slice(1).map(function(b){return b[0].toUpperCase()+b.slice(1)}).join("");return v[0]+w}var u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.keys=function(w){return(w.getAttribute("style")||"").split(";").map(function(b){var h=b.split(":");return h[0].trim()})},v.prototype.add=function(w,b){return this.canAdd(w,b)?(w.style[l(this.keyName)]=b,!0):!1},v.prototype.remove=function(w){w.style[l(this.keyName)]="",w.getAttribute("style")||w.removeAttribute("style")},v.prototype.value=function(w){var b=w.style[l(this.keyName)];return this.canAdd(w,b)?b:""},v}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,v){for(var w=0;w<v.length;w++){var b=v[w];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(f,b.key,b)}}return function(f,v,w){return v&&u(f.prototype,v),w&&u(f,w),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,v){o(this,u),this.quill=f,this.options=v,this.modules={}}return a(u,[{key:"init",value:function(){var v=this;Object.keys(this.options.modules).forEach(function(w){v.modules[w]==null&&v.addModule(w)})}},{key:"addModule",value:function(v){var w=this.quill.constructor.import("modules/"+v);return this.modules[v]=new w(this.quill,this.options.modules[v]||{}),this.modules[v]}}]),u}();l.DEFAULTS={modules:{}},l.themes={default:l},n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(g,d){for(var _=0;_<d.length;_++){var O=d[_];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(g,O.key,O)}}return function(g,d,_){return d&&p(g.prototype,d),_&&p(g,_),g}}(),o=function p(g,d,_){g===null&&(g=Function.prototype);var O=Object.getOwnPropertyDescriptor(g,d);if(O===void 0){var k=Object.getPrototypeOf(g);return k===null?void 0:p(k,d,_)}else{if("value"in O)return O.value;var C=O.get;return C===void 0?void 0:C.call(_)}},l=i(0),u=w(l),f=i(7),v=w(f);function w(p){return p&&p.__esModule?p:{default:p}}function b(p,g){if(!(p instanceof g))throw new TypeError("Cannot call a class as a function")}function h(p,g){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:p}function E(p,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);p.prototype=Object.create(g&&g.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(p,g):p.__proto__=g)}var y="\uFEFF",m=function(p){E(g,p);function g(d){b(this,g);var _=h(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,d));return _.contentNode=document.createElement("span"),_.contentNode.setAttribute("contenteditable",!1),[].slice.call(_.domNode.childNodes).forEach(function(O){_.contentNode.appendChild(O)}),_.leftGuard=document.createTextNode(y),_.rightGuard=document.createTextNode(y),_.domNode.appendChild(_.leftGuard),_.domNode.appendChild(_.contentNode),_.domNode.appendChild(_.rightGuard),_}return a(g,[{key:"index",value:function(_,O){return _===this.leftGuard?0:_===this.rightGuard?1:o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"index",this).call(this,_,O)}},{key:"restore",value:function(_){var O=void 0,k=void 0,C=_.data.split(y).join("");if(_===this.leftGuard)if(this.prev instanceof v.default){var S=this.prev.length();this.prev.insertAt(S,C),O={startNode:this.prev.domNode,startOffset:S+C.length}}else k=document.createTextNode(C),this.parent.insertBefore(u.default.create(k),this),O={startNode:k,startOffset:C.length};else _===this.rightGuard&&(this.next instanceof v.default?(this.next.insertAt(0,C),O={startNode:this.next.domNode,startOffset:C.length}):(k=document.createTextNode(C),this.parent.insertBefore(u.default.create(k),this.next),O={startNode:k,startOffset:C.length}));return _.data=y,O}},{key:"update",value:function(_,O){var k=this;_.forEach(function(C){if(C.type==="characterData"&&(C.target===k.leftGuard||C.target===k.rightGuard)){var S=k.restore(C.target);S&&(O.range=S)}})}}]),g}(u.default.Embed);n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var a=i(0),o=l(a);function l(b){return b&&b.__esModule?b:{default:b}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new o.default.Attributor.Attribute("align","align",u),v=new o.default.Attributor.Class("align","ql-align",u),w=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=f,n.AlignClass=v,n.AlignStyle=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var a=i(0),o=u(a),l=i(26);function u(w){return w&&w.__esModule?w:{default:w}}var f=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),v=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var a=i(0),o=l(a);function l(b){return b&&b.__esModule?b:{default:b}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},f=new o.default.Attributor.Attribute("direction","dir",u),v=new o.default.Attributor.Class("direction","ql-direction",u),w=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=f,n.DirectionClass=v,n.DirectionStyle=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function p(g,d){for(var _=0;_<d.length;_++){var O=d[_];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(g,O.key,O)}}return function(g,d,_){return d&&p(g.prototype,d),_&&p(g,_),g}}(),o=function p(g,d,_){g===null&&(g=Function.prototype);var O=Object.getOwnPropertyDescriptor(g,d);if(O===void 0){var k=Object.getPrototypeOf(g);return k===null?void 0:p(k,d,_)}else{if("value"in O)return O.value;var C=O.get;return C===void 0?void 0:C.call(_)}},l=i(0),u=f(l);function f(p){return p&&p.__esModule?p:{default:p}}function v(p,g){if(!(p instanceof g))throw new TypeError("Cannot call a class as a function")}function w(p,g){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:p}function b(p,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);p.prototype=Object.create(g&&g.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(p,g):p.__proto__=g)}var h={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},E=new u.default.Attributor.Class("font","ql-font",h),y=function(p){b(g,p);function g(){return v(this,g),w(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,[{key:"value",value:function(_){return o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"value",this).call(this,_).replace(/["']/g,"")}}]),g}(u.default.Attributor.Style),m=new y("font","font-family",h);n.FontStyle=m,n.FontClass=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var a=i(0),o=l(a);function l(v){return v&&v.__esModule?v:{default:v}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=f},function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var a=function(){function d(_,O){for(var k=0;k<O.length;k++){var C=O[k];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(_,C.key,C)}}return function(_,O,k){return O&&d(_.prototype,O),k&&d(_,k),_}}(),o=i(0),l=b(o),u=i(5),f=b(u),v=i(9),w=b(v);function b(d){return d&&d.__esModule?d:{default:d}}function h(d,_){if(!(d instanceof _))throw new TypeError("Cannot call a class as a function")}function E(d,_){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:d}function y(d,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);d.prototype=Object.create(_&&_.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(d,_):d.__proto__=_)}var m=function(d){y(_,d);function _(O,k){h(this,_);var C=E(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,O,k));return C.lastRecorded=0,C.ignoreChange=!1,C.clear(),C.quill.on(f.default.events.EDITOR_CHANGE,function(S,x,P,T){S!==f.default.events.TEXT_CHANGE||C.ignoreChange||(!C.options.userOnly||T===f.default.sources.USER?C.record(x,P):C.transform(x))}),C.quill.keyboard.addBinding({key:"Z",shortKey:!0},C.undo.bind(C)),C.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},C.redo.bind(C)),/Win/i.test(navigator.platform)&&C.quill.keyboard.addBinding({key:"Y",shortKey:!0},C.redo.bind(C)),C}return a(_,[{key:"change",value:function(k,C){if(this.stack[k].length!==0){var S=this.stack[k].pop();this.stack[C].push(S),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(S[k],f.default.sources.USER),this.ignoreChange=!1;var x=g(S[k]);this.quill.setSelection(x)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(k,C){if(k.ops.length!==0){this.stack.redo=[];var S=this.quill.getContents().diff(C),x=Date.now();if(this.lastRecorded+this.options.delay>x&&this.stack.undo.length>0){var P=this.stack.undo.pop();S=S.compose(P.undo),k=P.redo.compose(k)}else this.lastRecorded=x;this.stack.undo.push({redo:k,undo:S}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(k){this.stack.undo.forEach(function(C){C.undo=k.transform(C.undo,!0),C.redo=k.transform(C.redo,!0)}),this.stack.redo.forEach(function(C){C.undo=k.transform(C.undo,!0),C.redo=k.transform(C.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),_}(w.default);m.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function p(d){var _=d.ops[d.ops.length-1];return _==null?!1:_.insert!=null?typeof _.insert=="string"&&_.insert.endsWith(`
132
+ `):_.attributes!=null?Object.keys(_.attributes).some(function(O){return l.default.query(O,l.default.Scope.BLOCK)!=null}):!1}function g(d){var _=d.reduce(function(k,C){return k+=C.delete||0,k},0),O=d.length()-_;return p(d)&&(O-=1),O}n.default=m,n.getLastChangeIndex=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function B(D,V){for(var Y=0;Y<V.length;Y++){var q=V[Y];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(D,q.key,q)}}return function(D,V,Y){return V&&B(D.prototype,V),Y&&B(D,Y),D}}(),o=function B(D,V,Y){D===null&&(D=Function.prototype);var q=Object.getOwnPropertyDescriptor(D,V);if(q===void 0){var G=Object.getPrototypeOf(D);return G===null?void 0:B(G,V,Y)}else{if("value"in q)return q.value;var K=q.get;return K===void 0?void 0:K.call(Y)}},l=i(3),u=x(l),f=i(2),v=x(f),w=i(8),b=x(w),h=i(23),E=x(h),y=i(34),m=x(y),p=i(59),g=x(p),d=i(60),_=x(d),O=i(28),k=x(O),C=i(61),S=x(C);function x(B){return B&&B.__esModule?B:{default:B}}function P(B,D){if(!(B instanceof D))throw new TypeError("Cannot call a class as a function")}function T(B,D){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D&&(typeof D=="object"||typeof D=="function")?D:B}function L(B,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof D);B.prototype=Object.create(D&&D.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),D&&(Object.setPrototypeOf?Object.setPrototypeOf(B,D):B.__proto__=D)}var M=[!1,"center","right","justify"],U=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],$=[!1,"serif","monospace"],Z=["1","2","3",!1],z=["small",!1,"large","huge"],N=function(B){L(D,B);function D(V,Y){P(this,D);var q=T(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,V,Y)),G=function K(X){if(!document.body.contains(V.root))return document.body.removeEventListener("click",K);q.tooltip!=null&&!q.tooltip.root.contains(X.target)&&document.activeElement!==q.tooltip.textbox&&!q.quill.hasFocus()&&q.tooltip.hide(),q.pickers!=null&&q.pickers.forEach(function(Q){Q.container.contains(X.target)||Q.close()})};return V.emitter.listenDOM("click",document.body,G),q}return a(D,[{key:"addModule",value:function(Y){var q=o(D.prototype.__proto__||Object.getPrototypeOf(D.prototype),"addModule",this).call(this,Y);return Y==="toolbar"&&this.extendToolbar(q),q}},{key:"buildButtons",value:function(Y,q){Y.forEach(function(G){var K=G.getAttribute("class")||"";K.split(/\s+/).forEach(function(X){if(X.startsWith("ql-")&&(X=X.slice(3),q[X]!=null))if(X==="direction")G.innerHTML=q[X][""]+q[X].rtl;else if(typeof q[X]=="string")G.innerHTML=q[X];else{var Q=G.value||"";Q!=null&&q[X][Q]&&(G.innerHTML=q[X][Q])}})})}},{key:"buildPickers",value:function(Y,q){var G=this;this.pickers=Y.map(function(X){if(X.classList.contains("ql-align"))return X.querySelector("option")==null&&F(X,M),new _.default(X,q.align);if(X.classList.contains("ql-background")||X.classList.contains("ql-color")){var Q=X.classList.contains("ql-background")?"background":"color";return X.querySelector("option")==null&&F(X,U,Q==="background"?"#ffffff":"#000000"),new g.default(X,q[Q])}else return X.querySelector("option")==null&&(X.classList.contains("ql-font")?F(X,$):X.classList.contains("ql-header")?F(X,Z):X.classList.contains("ql-size")&&F(X,z)),new k.default(X)});var K=function(){G.pickers.forEach(function(Q){Q.update()})};this.quill.on(b.default.events.EDITOR_CHANGE,K)}}]),D}(m.default);N.DEFAULTS=(0,u.default)(!0,{},m.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var D=this,V=this.container.querySelector("input.ql-image[type=file]");V==null&&(V=document.createElement("input"),V.setAttribute("type","file"),V.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),V.classList.add("ql-image"),V.addEventListener("change",function(){if(V.files!=null&&V.files[0]!=null){var Y=new FileReader;Y.onload=function(q){var G=D.quill.getSelection(!0);D.quill.updateContents(new v.default().retain(G.index).delete(G.length).insert({image:q.target.result}),b.default.sources.USER),D.quill.setSelection(G.index+1,b.default.sources.SILENT),V.value=""},Y.readAsDataURL(V.files[0])}}),this.container.appendChild(V)),V.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var H=function(B){L(D,B);function D(V,Y){P(this,D);var q=T(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,V,Y));return q.textbox=q.root.querySelector('input[type="text"]'),q.listen(),q}return a(D,[{key:"listen",value:function(){var Y=this;this.textbox.addEventListener("keydown",function(q){E.default.match(q,"enter")?(Y.save(),q.preventDefault()):E.default.match(q,"escape")&&(Y.cancel(),q.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),q!=null?this.textbox.value=q:Y!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+Y)||""),this.root.setAttribute("data-mode",Y)}},{key:"restoreFocus",value:function(){var Y=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=Y}},{key:"save",value:function(){var Y=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var q=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",Y,b.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",Y,b.default.sources.USER)),this.quill.root.scrollTop=q;break}case"video":Y=R(Y);case"formula":{if(!Y)break;var G=this.quill.getSelection(!0);if(G!=null){var K=G.index+G.length;this.quill.insertEmbed(K,this.root.getAttribute("data-mode"),Y,b.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(K+1," ",b.default.sources.USER),this.quill.setSelection(K+2,b.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),D}(S.default);function R(B){var D=B.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||B.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return D?(D[1]||"https")+"://www.youtube.com/embed/"+D[2]+"?showinfo=0":(D=B.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(D[1]||"https")+"://player.vimeo.com/video/"+D[2]+"/":B}function F(B,D){var V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;D.forEach(function(Y){var q=document.createElement("option");Y===V?q.setAttribute("selected","selected"):q.setAttribute("value",Y),B.appendChild(q)})}n.BaseTooltip=H,n.default=N},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},o.prototype.contains=function(l){for(var u,f=this.iterator();u=f();)if(u===l)return!0;return!1},o.prototype.insertBefore=function(l,u){l&&(l.next=u,u!=null?(l.prev=u.prev,u.prev!=null&&(u.prev.next=l),u.prev=l,u===this.head&&(this.head=l)):this.tail!=null?(this.tail.next=l,l.prev=this.tail,this.tail=l):(l.prev=null,this.head=this.tail=l),this.length+=1)},o.prototype.offset=function(l){for(var u=0,f=this.head;f!=null;){if(f===l)return u;u+=f.length(),f=f.next}return-1},o.prototype.remove=function(l){this.contains(l)&&(l.prev!=null&&(l.prev.next=l.next),l.next!=null&&(l.next.prev=l.prev),l===this.head&&(this.head=l.next),l===this.tail&&(this.tail=l.prev),this.length-=1)},o.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var u=l;return l!=null&&(l=l.next),u}},o.prototype.find=function(l,u){u===void 0&&(u=!1);for(var f,v=this.iterator();f=v();){var w=f.length();if(l<w||u&&l===w&&(f.next==null||f.next.length()!==0))return[f,l];l-=w}return[null,0]},o.prototype.forEach=function(l){for(var u,f=this.iterator();u=f();)l(u)},o.prototype.forEachAt=function(l,u,f){if(!(u<=0))for(var v=this.find(l),w=v[0],b=v[1],h,E=l-b,y=this.iterator(w);(h=y())&&E<l+u;){var m=h.length();l>E?f(h,l-E,Math.min(u,E+m-l)):f(h,0,Math.min(m,l+u-E)),E+=m}},o.prototype.map=function(l){return this.reduce(function(u,f){return u.push(l(f)),u},[])},o.prototype.reduce=function(l,u){for(var f,v=this.iterator();f=v();)u=l(u,f);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,h){b.__proto__=h}||function(b,h){for(var E in h)h.hasOwnProperty(E)&&(b[E]=h[E])};return function(b,h){w(b,h);function E(){this.constructor=b}b.prototype=h===null?Object.create(h):(E.prototype=h.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(17),l=i(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},f=100,v=function(w){a(b,w);function b(h){var E=w.call(this,h)||this;return E.scroll=E,E.observer=new MutationObserver(function(y){E.update(y)}),E.observer.observe(E.domNode,u),E.attach(),E}return b.prototype.detach=function(){w.prototype.detach.call(this),this.observer.disconnect()},b.prototype.deleteAt=function(h,E){this.update(),h===0&&E===this.length()?this.children.forEach(function(y){y.remove()}):w.prototype.deleteAt.call(this,h,E)},b.prototype.formatAt=function(h,E,y,m){this.update(),w.prototype.formatAt.call(this,h,E,y,m)},b.prototype.insertAt=function(h,E,y){this.update(),w.prototype.insertAt.call(this,h,E,y)},b.prototype.optimize=function(h,E){var y=this;h===void 0&&(h=[]),E===void 0&&(E={}),w.prototype.optimize.call(this,E);for(var m=[].slice.call(this.observer.takeRecords());m.length>0;)h.push(m.pop());for(var p=function(O,k){k===void 0&&(k=!0),!(O==null||O===y)&&O.domNode.parentNode!=null&&(O.domNode[l.DATA_KEY].mutations==null&&(O.domNode[l.DATA_KEY].mutations=[]),k&&p(O.parent))},g=function(O){O.domNode[l.DATA_KEY]==null||O.domNode[l.DATA_KEY].mutations==null||(O instanceof o.default&&O.children.forEach(g),O.optimize(E))},d=h,_=0;d.length>0;_+=1){if(_>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(O){var k=l.find(O.target,!0);k!=null&&(k.domNode===O.target&&(O.type==="childList"?(p(l.find(O.previousSibling,!1)),[].forEach.call(O.addedNodes,function(C){var S=l.find(C,!1);p(S,!1),S instanceof o.default&&S.children.forEach(function(x){p(x,!1)})})):O.type==="attributes"&&p(k.prev)),p(k))}),this.children.forEach(g),d=[].slice.call(this.observer.takeRecords()),m=d.slice();m.length>0;)h.push(m.pop())}},b.prototype.update=function(h,E){var y=this;E===void 0&&(E={}),h=h||this.observer.takeRecords(),h.map(function(m){var p=l.find(m.target,!0);return p==null?null:p.domNode[l.DATA_KEY].mutations==null?(p.domNode[l.DATA_KEY].mutations=[m],p):(p.domNode[l.DATA_KEY].mutations.push(m),null)}).forEach(function(m){m==null||m===y||m.domNode[l.DATA_KEY]==null||m.update(m.domNode[l.DATA_KEY].mutations||[],E)}),this.domNode[l.DATA_KEY].mutations!=null&&w.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,E),this.optimize(h,E)},b.blotName="scroll",b.defaultChild="block",b.scope=l.Scope.BLOCK_BLOT,b.tagName="DIV",b}(o.default);n.default=v},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,b){w.__proto__=b}||function(w,b){for(var h in b)b.hasOwnProperty(h)&&(w[h]=b[h])};return function(w,b){v(w,b);function h(){this.constructor=w}w.prototype=b===null?Object.create(b):(h.prototype=b.prototype,new h)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function u(v,w){if(Object.keys(v).length!==Object.keys(w).length)return!1;for(var b in v)if(v[b]!==w[b])return!1;return!0}var f=function(v){a(w,v);function w(){return v!==null&&v.apply(this,arguments)||this}return w.formats=function(b){if(b.tagName!==w.tagName)return v.formats.call(this,b)},w.prototype.format=function(b,h){var E=this;b===this.statics.blotName&&!h?(this.children.forEach(function(y){y instanceof o.default||(y=y.wrap(w.blotName,!0)),E.attributes.copy(y)}),this.unwrap()):v.prototype.format.call(this,b,h)},w.prototype.formatAt=function(b,h,E,y){if(this.formats()[E]!=null||l.query(E,l.Scope.ATTRIBUTE)){var m=this.isolate(b,h);m.format(E,y)}else v.prototype.formatAt.call(this,b,h,E,y)},w.prototype.optimize=function(b){v.prototype.optimize.call(this,b);var h=this.formats();if(Object.keys(h).length===0)return this.unwrap();var E=this.next;E instanceof w&&E.prev===this&&u(h,E.formats())&&(E.moveChildren(this),E.remove())},w.blotName="inline",w.scope=l.Scope.INLINE_BLOT,w.tagName="SPAN",w}(o.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var b in w)w.hasOwnProperty(b)&&(v[b]=w[b])};return function(v,w){f(v,w);function b(){this.constructor=v}v.prototype=w===null?Object.create(w):(b.prototype=w.prototype,new b)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1),u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.formats=function(w){var b=l.query(v.blotName).tagName;if(w.tagName!==b)return f.formats.call(this,w)},v.prototype.format=function(w,b){l.query(w,l.Scope.BLOCK)!=null&&(w===this.statics.blotName&&!b?this.replaceWith(v.blotName):f.prototype.format.call(this,w,b))},v.prototype.formatAt=function(w,b,h,E){l.query(h,l.Scope.BLOCK)!=null?this.format(h,E):f.prototype.formatAt.call(this,w,b,h,E)},v.prototype.insertAt=function(w,b,h){if(h==null||l.query(b,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,w,b,h);else{var E=this.split(w),y=l.create(b,h);E.parent.insertBefore(y,E)}},v.prototype.update=function(w,b){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,w,b)},v.blotName="block",v.scope=l.Scope.BLOCK_BLOT,v.tagName="P",v}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var w in v)v.hasOwnProperty(w)&&(f[w]=v[w])};return function(f,v){u(f,v);function w(){this.constructor=f}f.prototype=v===null?Object.create(v):(w.prototype=v.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=function(u){a(f,u);function f(){return u!==null&&u.apply(this,arguments)||this}return f.formats=function(v){},f.prototype.format=function(v,w){u.prototype.formatAt.call(this,0,this.length(),v,w)},f.prototype.formatAt=function(v,w,b,h){v===0&&w===this.length()?this.format(b,h):u.prototype.formatAt.call(this,v,w,b,h)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f}(o.default);n.default=l},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var b in w)w.hasOwnProperty(b)&&(v[b]=w[b])};return function(v,w){f(v,w);function b(){this.constructor=v}v.prototype=w===null?Object.create(w):(b.prototype=w.prototype,new b)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=i(1),u=function(f){a(v,f);function v(w){var b=f.call(this,w)||this;return b.text=b.statics.value(b.domNode),b}return v.create=function(w){return document.createTextNode(w)},v.value=function(w){var b=w.data;return b.normalize&&(b=b.normalize()),b},v.prototype.deleteAt=function(w,b){this.domNode.data=this.text=this.text.slice(0,w)+this.text.slice(w+b)},v.prototype.index=function(w,b){return this.domNode===w?b:-1},v.prototype.insertAt=function(w,b,h){h==null?(this.text=this.text.slice(0,w)+b+this.text.slice(w),this.domNode.data=this.text):f.prototype.insertAt.call(this,w,b,h)},v.prototype.length=function(){return this.text.length},v.prototype.optimize=function(w){f.prototype.optimize.call(this,w),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof v&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},v.prototype.position=function(w,b){return[this.domNode,w]},v.prototype.split=function(w,b){if(b===void 0&&(b=!1),!b){if(w===0)return this;if(w===this.length())return this.next}var h=l.create(this.domNode.splitText(w));return this.parent.insertBefore(h,this.next),this.text=this.statics.value(this.domNode),h},v.prototype.update=function(w,b){var h=this;w.some(function(E){return E.type==="characterData"&&E.target===h.domNode})&&(this.text=this.statics.value(this.domNode))},v.prototype.value=function(){return this.text},v.blotName="text",v.scope=l.Scope.INLINE_BLOT,v}(o.default);n.default=u},function(r,n,i){var a=document.createElement("div");if(a.classList.toggle("test-class",!1),a.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(l,u){return arguments.length>1&&!this.contains(l)==!u?u:o.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,u){return u=u||0,this.substr(u,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,u){var f=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>f.length)&&(u=f.length),u-=l.length;var v=f.indexOf(l,u);return v!==-1&&v===u}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(u){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof u!="function")throw new TypeError("predicate must be a function");for(var f=Object(this),v=f.length>>>0,w=arguments[1],b,h=0;h<v;h++)if(b=f[h],u.call(w,b,h,f))return b}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,a=1,o=0;function l(_,O,k){if(_==O)return _?[[o,_]]:[];(k<0||_.length<k)&&(k=null);var C=w(_,O),S=_.substring(0,C);_=_.substring(C),O=O.substring(C),C=b(_,O);var x=_.substring(_.length-C);_=_.substring(0,_.length-C),O=O.substring(0,O.length-C);var P=u(_,O);return S&&P.unshift([o,S]),x&&P.push([o,x]),E(P),k!=null&&(P=p(P,k)),P=g(P),P}function u(_,O){var k;if(!_)return[[a,O]];if(!O)return[[i,_]];var C=_.length>O.length?_:O,S=_.length>O.length?O:_,x=C.indexOf(S);if(x!=-1)return k=[[a,C.substring(0,x)],[o,S],[a,C.substring(x+S.length)]],_.length>O.length&&(k[0][0]=k[2][0]=i),k;if(S.length==1)return[[i,_],[a,O]];var P=h(_,O);if(P){var T=P[0],L=P[1],M=P[2],U=P[3],$=P[4],Z=l(T,M),z=l(L,U);return Z.concat([[o,$]],z)}return f(_,O)}function f(_,O){for(var k=_.length,C=O.length,S=Math.ceil((k+C)/2),x=S,P=2*S,T=new Array(P),L=new Array(P),M=0;M<P;M++)T[M]=-1,L[M]=-1;T[x+1]=0,L[x+1]=0;for(var U=k-C,$=U%2!=0,Z=0,z=0,N=0,H=0,R=0;R<S;R++){for(var F=-R+Z;F<=R-z;F+=2){var B=x+F,D;F==-R||F!=R&&T[B-1]<T[B+1]?D=T[B+1]:D=T[B-1]+1;for(var V=D-F;D<k&&V<C&&_.charAt(D)==O.charAt(V);)D++,V++;if(T[B]=D,D>k)z+=2;else if(V>C)Z+=2;else if($){var Y=x+U-F;if(Y>=0&&Y<P&&L[Y]!=-1){var q=k-L[Y];if(D>=q)return v(_,O,D,V)}}}for(var G=-R+N;G<=R-H;G+=2){var Y=x+G,q;G==-R||G!=R&&L[Y-1]<L[Y+1]?q=L[Y+1]:q=L[Y-1]+1;for(var K=q-G;q<k&&K<C&&_.charAt(k-q-1)==O.charAt(C-K-1);)q++,K++;if(L[Y]=q,q>k)H+=2;else if(K>C)N+=2;else if(!$){var B=x+U-G;if(B>=0&&B<P&&T[B]!=-1){var D=T[B],V=x+D-B;if(q=k-q,D>=q)return v(_,O,D,V)}}}}return[[i,_],[a,O]]}function v(_,O,k,C){var S=_.substring(0,k),x=O.substring(0,C),P=_.substring(k),T=O.substring(C),L=l(S,x),M=l(P,T);return L.concat(M)}function w(_,O){if(!_||!O||_.charAt(0)!=O.charAt(0))return 0;for(var k=0,C=Math.min(_.length,O.length),S=C,x=0;k<S;)_.substring(x,S)==O.substring(x,S)?(k=S,x=k):C=S,S=Math.floor((C-k)/2+k);return S}function b(_,O){if(!_||!O||_.charAt(_.length-1)!=O.charAt(O.length-1))return 0;for(var k=0,C=Math.min(_.length,O.length),S=C,x=0;k<S;)_.substring(_.length-S,_.length-x)==O.substring(O.length-S,O.length-x)?(k=S,x=k):C=S,S=Math.floor((C-k)/2+k);return S}function h(_,O){var k=_.length>O.length?_:O,C=_.length>O.length?O:_;if(k.length<4||C.length*2<k.length)return null;function S(z,N,H){for(var R=z.substring(H,H+Math.floor(z.length/4)),F=-1,B="",D,V,Y,q;(F=N.indexOf(R,F+1))!=-1;){var G=w(z.substring(H),N.substring(F)),K=b(z.substring(0,H),N.substring(0,F));B.length<K+G&&(B=N.substring(F-K,F)+N.substring(F,F+G),D=z.substring(0,H-K),V=z.substring(H+G),Y=N.substring(0,F-K),q=N.substring(F+G))}return B.length*2>=z.length?[D,V,Y,q,B]:null}var x=S(k,C,Math.ceil(k.length/4)),P=S(k,C,Math.ceil(k.length/2)),T;if(!x&&!P)return null;P?x?T=x[4].length>P[4].length?x:P:T=P:T=x;var L,M,U,$;_.length>O.length?(L=T[0],M=T[1],U=T[2],$=T[3]):(U=T[0],$=T[1],L=T[2],M=T[3]);var Z=T[4];return[L,M,U,$,Z]}function E(_){_.push([o,""]);for(var O=0,k=0,C=0,S="",x="",P;O<_.length;)switch(_[O][0]){case a:C++,x+=_[O][1],O++;break;case i:k++,S+=_[O][1],O++;break;case o:k+C>1?(k!==0&&C!==0&&(P=w(x,S),P!==0&&(O-k-C>0&&_[O-k-C-1][0]==o?_[O-k-C-1][1]+=x.substring(0,P):(_.splice(0,0,[o,x.substring(0,P)]),O++),x=x.substring(P),S=S.substring(P)),P=b(x,S),P!==0&&(_[O][1]=x.substring(x.length-P)+_[O][1],x=x.substring(0,x.length-P),S=S.substring(0,S.length-P))),k===0?_.splice(O-C,k+C,[a,x]):C===0?_.splice(O-k,k+C,[i,S]):_.splice(O-k-C,k+C,[i,S],[a,x]),O=O-k-C+(k?1:0)+(C?1:0)+1):O!==0&&_[O-1][0]==o?(_[O-1][1]+=_[O][1],_.splice(O,1)):O++,C=0,k=0,S="",x="";break}_[_.length-1][1]===""&&_.pop();var T=!1;for(O=1;O<_.length-1;)_[O-1][0]==o&&_[O+1][0]==o&&(_[O][1].substring(_[O][1].length-_[O-1][1].length)==_[O-1][1]?(_[O][1]=_[O-1][1]+_[O][1].substring(0,_[O][1].length-_[O-1][1].length),_[O+1][1]=_[O-1][1]+_[O+1][1],_.splice(O-1,1),T=!0):_[O][1].substring(0,_[O+1][1].length)==_[O+1][1]&&(_[O-1][1]+=_[O+1][1],_[O][1]=_[O][1].substring(_[O+1][1].length)+_[O+1][1],_.splice(O+1,1),T=!0)),O++;T&&E(_)}var y=l;y.INSERT=a,y.DELETE=i,y.EQUAL=o,r.exports=y;function m(_,O){if(O===0)return[o,_];for(var k=0,C=0;C<_.length;C++){var S=_[C];if(S[0]===i||S[0]===o){var x=k+S[1].length;if(O===x)return[C+1,_];if(O<x){_=_.slice();var P=O-k,T=[S[0],S[1].slice(0,P)],L=[S[0],S[1].slice(P)];return _.splice(C,1,T,L),[C+1,_]}else k=x}}throw new Error("cursor_pos is out of bounds!")}function p(_,O){var k=m(_,O),C=k[1],S=k[0],x=C[S],P=C[S+1];if(x==null)return _;if(x[0]!==o)return _;if(P!=null&&x[1]+P[1]===P[1]+x[1])return C.splice(S,2,P,x),d(C,S,2);if(P!=null&&P[1].indexOf(x[1])===0){C.splice(S,2,[P[0],x[1]],[0,x[1]]);var T=P[1].slice(x[1].length);return T.length>0&&C.splice(S+2,0,[P[0],T]),d(C,S,3)}else return _}function g(_){for(var O=!1,k=function(P){return P.charCodeAt(0)>=56320&&P.charCodeAt(0)<=57343},C=function(P){return P.charCodeAt(P.length-1)>=55296&&P.charCodeAt(P.length-1)<=56319},S=2;S<_.length;S+=1)_[S-2][0]===o&&C(_[S-2][1])&&_[S-1][0]===i&&k(_[S-1][1])&&_[S][0]===a&&k(_[S][1])&&(O=!0,_[S-1][1]=_[S-2][1].slice(-1)+_[S-1][1],_[S][1]=_[S-2][1].slice(-1)+_[S][1],_[S-2][1]=_[S-2][1].slice(0,-1));if(!O)return _;for(var x=[],S=0;S<_.length;S+=1)_[S][1].length>0&&x.push(_[S]);return x}function d(_,O,k){for(var C=O+k-1;C>=0&&C>=O-1;C--)if(C+1<_.length){var S=_[C],x=_[C+1];S[0]===x[1]&&_.splice(C,2,[S[0],S[1]+x[1]])}return _}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(a){var o=[];for(var l in a)o.push(l);return o}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?a:o,n.supported=a;function a(l){return Object.prototype.toString.call(l)=="[object Arguments]"}n.unsupported=o;function o(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function l(f,v,w){this.fn=f,this.context=v,this.once=w||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var v=[],w,b;if(this._eventsCount===0)return v;for(b in w=this._events)i.call(w,b)&&v.push(a?b.slice(1):b);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(w)):v},u.prototype.listeners=function(v,w){var b=a?a+v:v,h=this._events[b];if(w)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var E=0,y=h.length,m=new Array(y);E<y;E++)m[E]=h[E].fn;return m},u.prototype.emit=function(v,w,b,h,E,y){var m=a?a+v:v;if(!this._events[m])return!1;var p=this._events[m],g=arguments.length,d,_;if(p.fn){switch(p.once&&this.removeListener(v,p.fn,void 0,!0),g){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,w),!0;case 3:return p.fn.call(p.context,w,b),!0;case 4:return p.fn.call(p.context,w,b,h),!0;case 5:return p.fn.call(p.context,w,b,h,E),!0;case 6:return p.fn.call(p.context,w,b,h,E,y),!0}for(_=1,d=new Array(g-1);_<g;_++)d[_-1]=arguments[_];p.fn.apply(p.context,d)}else{var O=p.length,k;for(_=0;_<O;_++)switch(p[_].once&&this.removeListener(v,p[_].fn,void 0,!0),g){case 1:p[_].fn.call(p[_].context);break;case 2:p[_].fn.call(p[_].context,w);break;case 3:p[_].fn.call(p[_].context,w,b);break;case 4:p[_].fn.call(p[_].context,w,b,h);break;default:if(!d)for(k=1,d=new Array(g-1);k<g;k++)d[k-1]=arguments[k];p[_].fn.apply(p[_].context,d)}}return!0},u.prototype.on=function(v,w,b){var h=new l(w,b||this),E=a?a+v:v;return this._events[E]?this._events[E].fn?this._events[E]=[this._events[E],h]:this._events[E].push(h):(this._events[E]=h,this._eventsCount++),this},u.prototype.once=function(v,w,b){var h=new l(w,b||this,!0),E=a?a+v:v;return this._events[E]?this._events[E].fn?this._events[E]=[this._events[E],h]:this._events[E].push(h):(this._events[E]=h,this._eventsCount++),this},u.prototype.removeListener=function(v,w,b,h){var E=a?a+v:v;if(!this._events[E])return this;if(!w)return--this._eventsCount===0?this._events=new o:delete this._events[E],this;var y=this._events[E];if(y.fn)y.fn===w&&(!h||y.once)&&(!b||y.context===b)&&(--this._eventsCount===0?this._events=new o:delete this._events[E]);else{for(var m=0,p=[],g=y.length;m<g;m++)(y[m].fn!==w||h&&!y[m].once||b&&y[m].context!==b)&&p.push(y[m]);p.length?this._events[E]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new o:delete this._events[E]}return this},u.prototype.removeAllListeners=function(v){var w;return v?(w=a?a+v:v,this._events[w]&&(--this._eventsCount===0?this._events=new o:delete this._events[w])):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prototype.setMaxListeners=function(){return this},u.prefixed=a,u.EventEmitter=u,typeof r<"u"&&(r.exports=u)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(fe){return typeof fe}:function(fe){return fe&&typeof Symbol=="function"&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe},o=function(){function fe(ie,ge){var pe=[],re=!0,de=!1,be=void 0;try{for(var ye=ie[Symbol.iterator](),Ie;!(re=(Ie=ye.next()).done)&&(pe.push(Ie.value),!(ge&&pe.length===ge));re=!0);}catch(Ee){de=!0,be=Ee}finally{try{!re&&ye.return&&ye.return()}finally{if(de)throw be}}return pe}return function(ie,ge){if(Array.isArray(ie))return ie;if(Symbol.iterator in Object(ie))return fe(ie,ge);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function fe(ie,ge){for(var pe=0;pe<ge.length;pe++){var re=ge[pe];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(ie,re.key,re)}}return function(ie,ge,pe){return ge&&fe(ie.prototype,ge),pe&&fe(ie,pe),ie}}(),u=i(3),f=L(u),v=i(2),w=L(v),b=i(0),h=L(b),E=i(5),y=L(E),m=i(10),p=L(m),g=i(9),d=L(g),_=i(36),O=i(37),k=i(13),C=L(k),S=i(26),x=i(38),P=i(39),T=i(40);function L(fe){return fe&&fe.__esModule?fe:{default:fe}}function M(fe,ie,ge){return ie in fe?Object.defineProperty(fe,ie,{value:ge,enumerable:!0,configurable:!0,writable:!0}):fe[ie]=ge,fe}function U(fe,ie){if(!(fe instanceof ie))throw new TypeError("Cannot call a class as a function")}function $(fe,ie){if(!fe)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ie&&(typeof ie=="object"||typeof ie=="function")?ie:fe}function Z(fe,ie){if(typeof ie!="function"&&ie!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ie);fe.prototype=Object.create(ie&&ie.prototype,{constructor:{value:fe,enumerable:!1,writable:!0,configurable:!0}}),ie&&(Object.setPrototypeOf?Object.setPrototypeOf(fe,ie):fe.__proto__=ie)}var z=(0,p.default)("quill:clipboard"),N="__ql-matcher",H=[[Node.TEXT_NODE,Fe],[Node.TEXT_NODE,oe],["br",ee],[Node.ELEMENT_NODE,oe],[Node.ELEMENT_NODE,Q],[Node.ELEMENT_NODE,se],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,ke],["li",ae],["b",K.bind(K,"bold")],["i",K.bind(K,"italic")],["style",te]],R=[_.AlignAttribute,x.DirectionAttribute].reduce(function(fe,ie){return fe[ie.keyName]=ie,fe},{}),F=[_.AlignStyle,O.BackgroundStyle,S.ColorStyle,x.DirectionStyle,P.FontStyle,T.SizeStyle].reduce(function(fe,ie){return fe[ie.keyName]=ie,fe},{}),B=function(fe){Z(ie,fe);function ie(ge,pe){U(this,ie);var re=$(this,(ie.__proto__||Object.getPrototypeOf(ie)).call(this,ge,pe));return re.quill.root.addEventListener("paste",re.onPaste.bind(re)),re.container=re.quill.addContainer("ql-clipboard"),re.container.setAttribute("contenteditable",!0),re.container.setAttribute("tabindex",-1),re.matchers=[],H.concat(re.options.matchers).forEach(function(de){var be=o(de,2),ye=be[0],Ie=be[1];!pe.matchVisual&&Ie===se||re.addMatcher(ye,Ie)}),re}return l(ie,[{key:"addMatcher",value:function(pe,re){this.matchers.push([pe,re])}},{key:"convert",value:function(pe){if(typeof pe=="string")return this.container.innerHTML=pe.replace(/\>\r?\n +\</g,"><"),this.convert();var re=this.quill.getFormat(this.quill.selection.savedRange.index);if(re[C.default.blotName]){var de=this.container.innerText;return this.container.innerHTML="",new w.default().insert(de,M({},C.default.blotName,re[C.default.blotName]))}var be=this.prepareMatching(),ye=o(be,2),Ie=ye[0],Ee=ye[1],Ae=G(this.container,Ie,Ee);return Y(Ae,`
133
+ `)&&Ae.ops[Ae.ops.length-1].attributes==null&&(Ae=Ae.compose(new w.default().retain(Ae.length()-1).delete(1))),z.log("convert",this.container.innerHTML,Ae),this.container.innerHTML="",Ae}},{key:"dangerouslyPasteHTML",value:function(pe,re){var de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.default.sources.API;if(typeof pe=="string")this.quill.setContents(this.convert(pe),re),this.quill.setSelection(0,y.default.sources.SILENT);else{var be=this.convert(re);this.quill.updateContents(new w.default().retain(pe).concat(be),de),this.quill.setSelection(pe+be.length(),y.default.sources.SILENT)}}},{key:"onPaste",value:function(pe){var re=this;if(!(pe.defaultPrevented||!this.quill.isEnabled())){var de=this.quill.getSelection(),be=new w.default().retain(de.index),ye=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(y.default.sources.SILENT),setTimeout(function(){be=be.concat(re.convert()).delete(de.length),re.quill.updateContents(be,y.default.sources.USER),re.quill.setSelection(be.length()-de.length,y.default.sources.SILENT),re.quill.scrollingContainer.scrollTop=ye,re.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var pe=this,re=[],de=[];return this.matchers.forEach(function(be){var ye=o(be,2),Ie=ye[0],Ee=ye[1];switch(Ie){case Node.TEXT_NODE:de.push(Ee);break;case Node.ELEMENT_NODE:re.push(Ee);break;default:[].forEach.call(pe.container.querySelectorAll(Ie),function(Ae){Ae[N]=Ae[N]||[],Ae[N].push(Ee)});break}}),[re,de]}}]),ie}(d.default);B.DEFAULTS={matchers:[],matchVisual:!0};function D(fe,ie,ge){return(typeof ie>"u"?"undefined":a(ie))==="object"?Object.keys(ie).reduce(function(pe,re){return D(pe,re,ie[re])},fe):fe.reduce(function(pe,re){return re.attributes&&re.attributes[ie]?pe.push(re):pe.insert(re.insert,(0,f.default)({},M({},ie,ge),re.attributes))},new w.default)}function V(fe){if(fe.nodeType!==Node.ELEMENT_NODE)return{};var ie="__ql-computed-style";return fe[ie]||(fe[ie]=window.getComputedStyle(fe))}function Y(fe,ie){for(var ge="",pe=fe.ops.length-1;pe>=0&&ge.length<ie.length;--pe){var re=fe.ops[pe];if(typeof re.insert!="string")break;ge=re.insert+ge}return ge.slice(-1*ie.length)===ie}function q(fe){if(fe.childNodes.length===0)return!1;var ie=V(fe);return["block","list-item"].indexOf(ie.display)>-1}function G(fe,ie,ge){return fe.nodeType===fe.TEXT_NODE?ge.reduce(function(pe,re){return re(fe,pe)},new w.default):fe.nodeType===fe.ELEMENT_NODE?[].reduce.call(fe.childNodes||[],function(pe,re){var de=G(re,ie,ge);return re.nodeType===fe.ELEMENT_NODE&&(de=ie.reduce(function(be,ye){return ye(re,be)},de),de=(re[N]||[]).reduce(function(be,ye){return ye(re,be)},de)),pe.concat(de)},new w.default):new w.default}function K(fe,ie,ge){return D(ge,fe,!0)}function X(fe,ie){var ge=h.default.Attributor.Attribute.keys(fe),pe=h.default.Attributor.Class.keys(fe),re=h.default.Attributor.Style.keys(fe),de={};return ge.concat(pe).concat(re).forEach(function(be){var ye=h.default.query(be,h.default.Scope.ATTRIBUTE);ye!=null&&(de[ye.attrName]=ye.value(fe),de[ye.attrName])||(ye=R[be],ye!=null&&(ye.attrName===be||ye.keyName===be)&&(de[ye.attrName]=ye.value(fe)||void 0),ye=F[be],ye!=null&&(ye.attrName===be||ye.keyName===be)&&(ye=F[be],de[ye.attrName]=ye.value(fe)||void 0))}),Object.keys(de).length>0&&(ie=D(ie,de)),ie}function Q(fe,ie){var ge=h.default.query(fe);if(ge==null)return ie;if(ge.prototype instanceof h.default.Embed){var pe={},re=ge.value(fe);re!=null&&(pe[ge.blotName]=re,ie=new w.default().insert(pe,ge.formats(fe)))}else typeof ge.formats=="function"&&(ie=D(ie,ge.blotName,ge.formats(fe)));return ie}function ee(fe,ie){return Y(ie,`
134
+ `)||ie.insert(`
135
+ `),ie}function te(){return new w.default}function ae(fe,ie){var ge=h.default.query(fe);if(ge==null||ge.blotName!=="list-item"||!Y(ie,`
136
+ `))return ie;for(var pe=-1,re=fe.parentNode;!re.classList.contains("ql-clipboard");)(h.default.query(re)||{}).blotName==="list"&&(pe+=1),re=re.parentNode;return pe<=0?ie:ie.compose(new w.default().retain(ie.length()-1).retain(1,{indent:pe}))}function oe(fe,ie){return Y(ie,`
137
+ `)||(q(fe)||ie.length()>0&&fe.nextSibling&&q(fe.nextSibling))&&ie.insert(`
138
+ `),ie}function se(fe,ie){if(q(fe)&&fe.nextElementSibling!=null&&!Y(ie,`
139
+
140
+ `)){var ge=fe.offsetHeight+parseFloat(V(fe).marginTop)+parseFloat(V(fe).marginBottom);fe.nextElementSibling.offsetTop>fe.offsetTop+ge*1.5&&ie.insert(`
141
+ `)}return ie}function ke(fe,ie){var ge={},pe=fe.style||{};return pe.fontStyle&&V(fe).fontStyle==="italic"&&(ge.italic=!0),pe.fontWeight&&(V(fe).fontWeight.startsWith("bold")||parseInt(V(fe).fontWeight)>=700)&&(ge.bold=!0),Object.keys(ge).length>0&&(ie=D(ie,ge)),parseFloat(pe.textIndent||0)>0&&(ie=new w.default().insert(" ").concat(ie)),ie}function Fe(fe,ie){var ge=fe.data;if(fe.parentNode.tagName==="O:P")return ie.insert(ge.trim());if(ge.trim().length===0&&fe.parentNode.classList.contains("ql-clipboard"))return ie;if(!V(fe.parentNode).whiteSpace.startsWith("pre")){var pe=function(de,be){return be=be.replace(/[^\u00a0]/g,""),be.length<1&&de?" ":be};ge=ge.replace(/\r\n/g," ").replace(/\n/g," "),ge=ge.replace(/\s\s+/g,pe.bind(pe,!0)),(fe.previousSibling==null&&q(fe.parentNode)||fe.previousSibling!=null&&q(fe.previousSibling))&&(ge=ge.replace(/^\s+/,pe.bind(pe,!1))),(fe.nextSibling==null&&q(fe.parentNode)||fe.nextSibling!=null&&q(fe.nextSibling))&&(ge=ge.replace(/\s+$/,pe.bind(pe,!1)))}return ie.insert(ge)}n.default=B,n.matchAttributor=X,n.matchBlot=Q,n.matchNewline=oe,n.matchSpacing=se,n.matchText=Fe},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(y,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(y,g.key,g)}}return function(y,m,p){return m&&E(y.prototype,m),p&&E(y,p),y}}(),o=function E(y,m,p){y===null&&(y=Function.prototype);var g=Object.getOwnPropertyDescriptor(y,m);if(g===void 0){var d=Object.getPrototypeOf(y);return d===null?void 0:E(d,m,p)}else{if("value"in g)return g.value;var _=g.get;return _===void 0?void 0:_.call(p)}},l=i(6),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,y){if(!(E instanceof y))throw new TypeError("Cannot call a class as a function")}function w(E,y){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:E}function b(E,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);E.prototype=Object.create(y&&y.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(E,y):E.__proto__=y)}var h=function(E){b(y,E);function y(){return v(this,y),w(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"optimize",value:function(p){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"optimize",this).call(this,p),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),y}(u.default);h.blotName="bold",h.tagName=["STRONG","B"],n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=function(){function T(L,M){var U=[],$=!0,Z=!1,z=void 0;try{for(var N=L[Symbol.iterator](),H;!($=(H=N.next()).done)&&(U.push(H.value),!(M&&U.length===M));$=!0);}catch(R){Z=!0,z=R}finally{try{!$&&N.return&&N.return()}finally{if(Z)throw z}}return U}return function(L,M){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return T(L,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function T(L,M){for(var U=0;U<M.length;U++){var $=M[U];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(L,$.key,$)}}return function(L,M,U){return M&&T(L.prototype,M),U&&T(L,U),L}}(),l=i(2),u=p(l),f=i(0),v=p(f),w=i(5),b=p(w),h=i(10),E=p(h),y=i(9),m=p(y);function p(T){return T&&T.__esModule?T:{default:T}}function g(T,L,M){return L in T?Object.defineProperty(T,L,{value:M,enumerable:!0,configurable:!0,writable:!0}):T[L]=M,T}function d(T,L){if(!(T instanceof L))throw new TypeError("Cannot call a class as a function")}function _(T,L){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:T}function O(T,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);T.prototype=Object.create(L&&L.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(T,L):T.__proto__=L)}var k=(0,E.default)("quill:toolbar"),C=function(T){O(L,T);function L(M,U){d(this,L);var $=_(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,M,U));if(Array.isArray($.options.container)){var Z=document.createElement("div");x(Z,$.options.container),M.container.parentNode.insertBefore(Z,M.container),$.container=Z}else typeof $.options.container=="string"?$.container=document.querySelector($.options.container):$.container=$.options.container;if(!($.container instanceof HTMLElement)){var z;return z=k.error("Container required for toolbar",$.options),_($,z)}return $.container.classList.add("ql-toolbar"),$.controls=[],$.handlers={},Object.keys($.options.handlers).forEach(function(N){$.addHandler(N,$.options.handlers[N])}),[].forEach.call($.container.querySelectorAll("button, select"),function(N){$.attach(N)}),$.quill.on(b.default.events.EDITOR_CHANGE,function(N,H){N===b.default.events.SELECTION_CHANGE&&$.update(H)}),$.quill.on(b.default.events.SCROLL_OPTIMIZE,function(){var N=$.quill.selection.getRange(),H=a(N,1),R=H[0];$.update(R)}),$}return o(L,[{key:"addHandler",value:function(U,$){this.handlers[U]=$}},{key:"attach",value:function(U){var $=this,Z=[].find.call(U.classList,function(N){return N.indexOf("ql-")===0});if(Z){if(Z=Z.slice(3),U.tagName==="BUTTON"&&U.setAttribute("type","button"),this.handlers[Z]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[Z]==null){k.warn("ignoring attaching to disabled format",Z,U);return}if(v.default.query(Z)==null){k.warn("ignoring attaching to nonexistent format",Z,U);return}}var z=U.tagName==="SELECT"?"change":"click";U.addEventListener(z,function(N){var H=void 0;if(U.tagName==="SELECT"){if(U.selectedIndex<0)return;var R=U.options[U.selectedIndex];R.hasAttribute("selected")?H=!1:H=R.value||!1}else U.classList.contains("ql-active")?H=!1:H=U.value||!U.hasAttribute("value"),N.preventDefault();$.quill.focus();var F=$.quill.selection.getRange(),B=a(F,1),D=B[0];if($.handlers[Z]!=null)$.handlers[Z].call($,H);else if(v.default.query(Z).prototype instanceof v.default.Embed){if(H=prompt("Enter "+Z),!H)return;$.quill.updateContents(new u.default().retain(D.index).delete(D.length).insert(g({},Z,H)),b.default.sources.USER)}else $.quill.format(Z,H,b.default.sources.USER);$.update(D)}),this.controls.push([Z,U])}}},{key:"update",value:function(U){var $=U==null?{}:this.quill.getFormat(U);this.controls.forEach(function(Z){var z=a(Z,2),N=z[0],H=z[1];if(H.tagName==="SELECT"){var R=void 0;if(U==null)R=null;else if($[N]==null)R=H.querySelector("option[selected]");else if(!Array.isArray($[N])){var F=$[N];typeof F=="string"&&(F=F.replace(/\"/g,'\\"')),R=H.querySelector('option[value="'+F+'"]')}R==null?(H.value="",H.selectedIndex=-1):R.selected=!0}else if(U==null)H.classList.remove("ql-active");else if(H.hasAttribute("value")){var B=$[N]===H.getAttribute("value")||$[N]!=null&&$[N].toString()===H.getAttribute("value")||$[N]==null&&!H.getAttribute("value");H.classList.toggle("ql-active",B)}else H.classList.toggle("ql-active",$[N]!=null)})}}]),L}(m.default);C.DEFAULTS={};function S(T,L,M){var U=document.createElement("button");U.setAttribute("type","button"),U.classList.add("ql-"+L),M!=null&&(U.value=M),T.appendChild(U)}function x(T,L){Array.isArray(L[0])||(L=[L]),L.forEach(function(M){var U=document.createElement("span");U.classList.add("ql-formats"),M.forEach(function($){if(typeof $=="string")S(U,$);else{var Z=Object.keys($)[0],z=$[Z];Array.isArray(z)?P(U,Z,z):S(U,Z,z)}}),T.appendChild(U)})}function P(T,L,M){var U=document.createElement("select");U.classList.add("ql-"+L),M.forEach(function($){var Z=document.createElement("option");$!==!1?Z.setAttribute("value",$):Z.setAttribute("selected","selected"),U.appendChild(Z)}),T.appendChild(U)}C.DEFAULTS={container:null,handlers:{clean:function(){var L=this,M=this.quill.getSelection();if(M!=null)if(M.length==0){var U=this.quill.getFormat();Object.keys(U).forEach(function($){v.default.query($,v.default.Scope.INLINE)!=null&&L.quill.format($,!1)})}else this.quill.removeFormat(M,b.default.sources.USER)},direction:function(L){var M=this.quill.getFormat().align;L==="rtl"&&M==null?this.quill.format("align","right",b.default.sources.USER):!L&&M==="right"&&this.quill.format("align",!1,b.default.sources.USER),this.quill.format("direction",L,b.default.sources.USER)},indent:function(L){var M=this.quill.getSelection(),U=this.quill.getFormat(M),$=parseInt(U.indent||0);if(L==="+1"||L==="-1"){var Z=L==="+1"?1:-1;U.direction==="rtl"&&(Z*=-1),this.quill.format("indent",$+Z,b.default.sources.USER)}},link:function(L){L===!0&&(L=prompt("Enter link URL:")),this.quill.format("link",L,b.default.sources.USER)},list:function(L){var M=this.quill.getSelection(),U=this.quill.getFormat(M);L==="check"?U.list==="checked"||U.list==="unchecked"?this.quill.format("list",!1,b.default.sources.USER):this.quill.format("list","unchecked",b.default.sources.USER):this.quill.format("list",L,b.default.sources.USER)}}},n.default=C,n.addControls=x},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(y,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(y,g.key,g)}}return function(y,m,p){return m&&E(y.prototype,m),p&&E(y,p),y}}(),o=function E(y,m,p){y===null&&(y=Function.prototype);var g=Object.getOwnPropertyDescriptor(y,m);if(g===void 0){var d=Object.getPrototypeOf(y);return d===null?void 0:E(d,m,p)}else{if("value"in g)return g.value;var _=g.get;return _===void 0?void 0:_.call(p)}},l=i(28),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,y){if(!(E instanceof y))throw new TypeError("Cannot call a class as a function")}function w(E,y){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:E}function b(E,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);E.prototype=Object.create(y&&y.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(E,y):E.__proto__=y)}var h=function(E){b(y,E);function y(m,p){v(this,y);var g=w(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,m));return g.label.innerHTML=p,g.container.classList.add("ql-color-picker"),[].slice.call(g.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(d){d.classList.add("ql-primary")}),g}return a(y,[{key:"buildItem",value:function(p){var g=o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"buildItem",this).call(this,p);return g.style.backgroundColor=p.getAttribute("value")||"",g}},{key:"selectItem",value:function(p,g){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"selectItem",this).call(this,p,g);var d=this.label.querySelector(".ql-color-label"),_=p&&p.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=_:d.style.fill=_)}}]),y}(u.default);n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(y,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(y,g.key,g)}}return function(y,m,p){return m&&E(y.prototype,m),p&&E(y,p),y}}(),o=function E(y,m,p){y===null&&(y=Function.prototype);var g=Object.getOwnPropertyDescriptor(y,m);if(g===void 0){var d=Object.getPrototypeOf(y);return d===null?void 0:E(d,m,p)}else{if("value"in g)return g.value;var _=g.get;return _===void 0?void 0:_.call(p)}},l=i(28),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,y){if(!(E instanceof y))throw new TypeError("Cannot call a class as a function")}function w(E,y){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:E}function b(E,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);E.prototype=Object.create(y&&y.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(E,y):E.__proto__=y)}var h=function(E){b(y,E);function y(m,p){v(this,y);var g=w(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,m));return g.container.classList.add("ql-icon-picker"),[].forEach.call(g.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=p[d.getAttribute("data-value")||""]}),g.defaultItem=g.container.querySelector(".ql-selected"),g.selectItem(g.defaultItem),g}return a(y,[{key:"selectItem",value:function(p,g){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"selectItem",this).call(this,p,g),p=p||this.defaultItem,this.label.innerHTML=p.innerHTML}}]),y}(u.default);n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,v){for(var w=0;w<v.length;w++){var b=v[w];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(f,b.key,b)}}return function(f,v,w){return v&&u(f.prototype,v),w&&u(f,w),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,v){var w=this;o(this,u),this.quill=f,this.boundsContainer=v||document.body,this.root=f.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){w.root.style.marginTop=-1*w.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(v){var w=v.left+v.width/2-this.root.offsetWidth/2,b=v.bottom+this.quill.root.scrollTop;this.root.style.left=w+"px",this.root.style.top=b+"px",this.root.classList.remove("ql-flip");var h=this.boundsContainer.getBoundingClientRect(),E=this.root.getBoundingClientRect(),y=0;if(E.right>h.right&&(y=h.right-E.right,this.root.style.left=w+y+"px"),E.left<h.left&&(y=h.left-E.left,this.root.style.left=w+y+"px"),E.bottom>h.bottom){var m=E.bottom-E.top,p=v.bottom-v.top+m;this.root.style.top=b-p+"px",this.root.classList.add("ql-flip")}return y}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function P(T,L){var M=[],U=!0,$=!1,Z=void 0;try{for(var z=T[Symbol.iterator](),N;!(U=(N=z.next()).done)&&(M.push(N.value),!(L&&M.length===L));U=!0);}catch(H){$=!0,Z=H}finally{try{!U&&z.return&&z.return()}finally{if($)throw Z}}return M}return function(T,L){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return P(T,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function P(T,L,M){T===null&&(T=Function.prototype);var U=Object.getOwnPropertyDescriptor(T,L);if(U===void 0){var $=Object.getPrototypeOf(T);return $===null?void 0:P($,L,M)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(M)}},l=function(){function P(T,L){for(var M=0;M<L.length;M++){var U=L[M];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(T,U.key,U)}}return function(T,L,M){return L&&P(T.prototype,L),M&&P(T,M),T}}(),u=i(3),f=d(u),v=i(8),w=d(v),b=i(43),h=d(b),E=i(27),y=d(E),m=i(15),p=i(41),g=d(p);function d(P){return P&&P.__esModule?P:{default:P}}function _(P,T){if(!(P instanceof T))throw new TypeError("Cannot call a class as a function")}function O(P,T){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:P}function k(P,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);P.prototype=Object.create(T&&T.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(P,T):P.__proto__=T)}var C=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],S=function(P){k(T,P);function T(L,M){_(this,T),M.modules.toolbar!=null&&M.modules.toolbar.container==null&&(M.modules.toolbar.container=C);var U=O(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,L,M));return U.quill.container.classList.add("ql-snow"),U}return l(T,[{key:"extendToolbar",value:function(M){M.container.classList.add("ql-snow"),this.buildButtons([].slice.call(M.container.querySelectorAll("button")),g.default),this.buildPickers([].slice.call(M.container.querySelectorAll("select")),g.default),this.tooltip=new x(this.quill,this.options.bounds),M.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(U,$){M.handlers.link.call(M,!$.format.link)})}}]),T}(h.default);S.DEFAULTS=(0,f.default)(!0,{},h.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(T){if(T){var L=this.quill.getSelection();if(L==null||L.length==0)return;var M=this.quill.getText(L);/^\S+@\S+\.\S+$/.test(M)&&M.indexOf("mailto:")!==0&&(M="mailto:"+M);var U=this.quill.theme.tooltip;U.edit("link",M)}else this.quill.format("link",!1)}}}}});var x=function(P){k(T,P);function T(L,M){_(this,T);var U=O(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,L,M));return U.preview=U.root.querySelector("a.ql-preview"),U}return l(T,[{key:"listen",value:function(){var M=this;o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(U){M.root.classList.contains("ql-editing")?M.save():M.edit("link",M.preview.textContent),U.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(U){if(M.linkRange!=null){var $=M.linkRange;M.restoreFocus(),M.quill.formatText($,"link",!1,w.default.sources.USER),delete M.linkRange}U.preventDefault(),M.hide()}),this.quill.on(w.default.events.SELECTION_CHANGE,function(U,$,Z){if(U!=null){if(U.length===0&&Z===w.default.sources.USER){var z=M.quill.scroll.descendant(y.default,U.index),N=a(z,2),H=N[0],R=N[1];if(H!=null){M.linkRange=new m.Range(U.index-R,H.length());var F=y.default.formats(H.domNode);M.preview.textContent=F,M.preview.setAttribute("href",F),M.show(),M.position(M.quill.getBounds(M.linkRange));return}}else delete M.linkRange;M.hide()}})}},{key:"show",value:function(){o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),T}(b.BaseTooltip);x.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(29),o=re(a),l=i(36),u=i(38),f=i(64),v=i(65),w=re(v),b=i(66),h=re(b),E=i(67),y=re(E),m=i(37),p=i(26),g=i(39),d=i(40),_=i(56),O=re(_),k=i(68),C=re(k),S=i(27),x=re(S),P=i(69),T=re(P),L=i(70),M=re(L),U=i(71),$=re(U),Z=i(72),z=re(Z),N=i(73),H=re(N),R=i(13),F=re(R),B=i(74),D=re(B),V=i(75),Y=re(V),q=i(57),G=re(q),K=i(41),X=re(K),Q=i(28),ee=re(Q),te=i(59),ae=re(te),oe=i(60),se=re(oe),ke=i(61),Fe=re(ke),fe=i(108),ie=re(fe),ge=i(62),pe=re(ge);function re(de){return de&&de.__esModule?de:{default:de}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":m.BackgroundClass,"attributors/class/color":p.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":g.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":m.BackgroundStyle,"attributors/style/color":p.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":g.FontStyle,"attributors/style/size":d.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":f.IndentClass,"formats/background":m.BackgroundStyle,"formats/color":p.ColorStyle,"formats/font":g.FontClass,"formats/size":d.SizeClass,"formats/blockquote":w.default,"formats/code-block":F.default,"formats/header":h.default,"formats/list":y.default,"formats/bold":O.default,"formats/code":R.Code,"formats/italic":C.default,"formats/link":x.default,"formats/script":T.default,"formats/strike":M.default,"formats/underline":$.default,"formats/image":z.default,"formats/video":H.default,"formats/list/item":E.ListItem,"modules/formula":D.default,"modules/syntax":Y.default,"modules/toolbar":G.default,"themes/bubble":ie.default,"themes/snow":pe.default,"ui/icons":X.default,"ui/picker":ee.default,"ui/icon-picker":se.default,"ui/color-picker":ae.default,"ui/tooltip":Fe.default},!0),n.default=o.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=function(){function y(m,p){for(var g=0;g<p.length;g++){var d=p[g];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(m,d.key,d)}}return function(m,p,g){return p&&y(m.prototype,p),g&&y(m,g),m}}(),o=function y(m,p,g){m===null&&(m=Function.prototype);var d=Object.getOwnPropertyDescriptor(m,p);if(d===void 0){var _=Object.getPrototypeOf(m);return _===null?void 0:y(_,p,g)}else{if("value"in d)return d.value;var O=d.get;return O===void 0?void 0:O.call(g)}},l=i(0),u=f(l);function f(y){return y&&y.__esModule?y:{default:y}}function v(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")}function w(y,m){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:y}function b(y,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);y.prototype=Object.create(m&&m.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(y,m):y.__proto__=m)}var h=function(y){b(m,y);function m(){return v(this,m),w(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"add",value:function(g,d){if(d==="+1"||d==="-1"){var _=this.value(g)||0;d=d==="+1"?_+1:_-1}return d===0?(this.remove(g),!0):o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"add",this).call(this,g,d)}},{key:"canAdd",value:function(g,d){return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"canAdd",this).call(this,g,d)||o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"canAdd",this).call(this,g,parseInt(d))}},{key:"value",value:function(g){return parseInt(o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"value",this).call(this,g))||void 0}}]),m}(u.default.Attributor.Class),E=new h("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(4),o=l(a);function l(b){return b&&b.__esModule?b:{default:b}}function u(b,h){if(!(b instanceof h))throw new TypeError("Cannot call a class as a function")}function f(b,h){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:b}function v(b,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);b.prototype=Object.create(h&&h.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(b,h):b.__proto__=h)}var w=function(b){v(h,b);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);w.blotName="blockquote",w.tagName="blockquote",n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function h(E,y){for(var m=0;m<y.length;m++){var p=y[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,p.key,p)}}return function(E,y,m){return y&&h(E.prototype,y),m&&h(E,m),E}}(),o=i(4),l=u(o);function u(h){return h&&h.__esModule?h:{default:h}}function f(h,E){if(!(h instanceof E))throw new TypeError("Cannot call a class as a function")}function v(h,E){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:h}function w(h,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);h.prototype=Object.create(E&&E.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(h,E):h.__proto__=E)}var b=function(h){w(E,h);function E(){return f(this,E),v(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,null,[{key:"formats",value:function(m){return this.tagName.indexOf(m.tagName)+1}}]),E}(l.default);b.blotName="header",b.tagName=["H1","H2","H3","H4","H5","H6"],n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function _(O,k){for(var C=0;C<k.length;C++){var S=k[C];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(O,S.key,S)}}return function(O,k,C){return k&&_(O.prototype,k),C&&_(O,C),O}}(),o=function _(O,k,C){O===null&&(O=Function.prototype);var S=Object.getOwnPropertyDescriptor(O,k);if(S===void 0){var x=Object.getPrototypeOf(O);return x===null?void 0:_(x,k,C)}else{if("value"in S)return S.value;var P=S.get;return P===void 0?void 0:P.call(C)}},l=i(0),u=h(l),f=i(4),v=h(f),w=i(25),b=h(w);function h(_){return _&&_.__esModule?_:{default:_}}function E(_,O,k){return O in _?Object.defineProperty(_,O,{value:k,enumerable:!0,configurable:!0,writable:!0}):_[O]=k,_}function y(_,O){if(!(_ instanceof O))throw new TypeError("Cannot call a class as a function")}function m(_,O){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:_}function p(_,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);_.prototype=Object.create(O&&O.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(_,O):_.__proto__=O)}var g=function(_){p(O,_);function O(){return y(this,O),m(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return a(O,[{key:"format",value:function(C,S){C===d.blotName&&!S?this.replaceWith(u.default.create(this.statics.scope)):o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"format",this).call(this,C,S)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(C,S){return this.parent.isolate(this.offset(this.parent),this.length()),C===this.parent.statics.blotName?(this.parent.replaceWith(C,S),this):(this.parent.unwrap(),o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,C,S))}}],[{key:"formats",value:function(C){return C.tagName===this.tagName?void 0:o(O.__proto__||Object.getPrototypeOf(O),"formats",this).call(this,C)}}]),O}(v.default);g.blotName="list-item",g.tagName="LI";var d=function(_){p(O,_),a(O,null,[{key:"create",value:function(C){var S=C==="ordered"?"OL":"UL",x=o(O.__proto__||Object.getPrototypeOf(O),"create",this).call(this,S);return(C==="checked"||C==="unchecked")&&x.setAttribute("data-checked",C==="checked"),x}},{key:"formats",value:function(C){if(C.tagName==="OL")return"ordered";if(C.tagName==="UL")return C.hasAttribute("data-checked")?C.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function O(k){y(this,O);var C=m(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,k)),S=function(P){if(P.target.parentNode===k){var T=C.statics.formats(k),L=u.default.find(P.target);T==="checked"?L.format("list","unchecked"):T==="unchecked"&&L.format("list","checked")}};return k.addEventListener("touchstart",S),k.addEventListener("mousedown",S),C}return a(O,[{key:"format",value:function(C,S){this.children.length>0&&this.children.tail.format(C,S)}},{key:"formats",value:function(){return E({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(C,S){if(C instanceof g)o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,C,S);else{var x=S==null?this.length():S.offset(this),P=this.split(x);P.parent.insertBefore(C,P)}}},{key:"optimize",value:function(C){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,C);var S=this.next;S!=null&&S.prev===this&&S.statics.blotName===this.statics.blotName&&S.domNode.tagName===this.domNode.tagName&&S.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(S.moveChildren(this),S.remove())}},{key:"replace",value:function(C){if(C.statics.blotName!==this.statics.blotName){var S=u.default.create(this.statics.defaultChild);C.moveChildren(S),this.appendChild(S)}o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replace",this).call(this,C)}}]),O}(b.default);d.blotName="list",d.scope=u.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[g],n.ListItem=g,n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),o=l(a);function l(b){return b&&b.__esModule?b:{default:b}}function u(b,h){if(!(b instanceof h))throw new TypeError("Cannot call a class as a function")}function f(b,h){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:b}function v(b,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);b.prototype=Object.create(h&&h.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(b,h):b.__proto__=h)}var w=function(b){v(h,b);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);w.blotName="italic",w.tagName=["EM","I"],n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(y,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(y,g.key,g)}}return function(y,m,p){return m&&E(y.prototype,m),p&&E(y,p),y}}(),o=function E(y,m,p){y===null&&(y=Function.prototype);var g=Object.getOwnPropertyDescriptor(y,m);if(g===void 0){var d=Object.getPrototypeOf(y);return d===null?void 0:E(d,m,p)}else{if("value"in g)return g.value;var _=g.get;return _===void 0?void 0:_.call(p)}},l=i(6),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,y){if(!(E instanceof y))throw new TypeError("Cannot call a class as a function")}function w(E,y){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:E}function b(E,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);E.prototype=Object.create(y&&y.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(E,y):E.__proto__=y)}var h=function(E){b(y,E);function y(){return v(this,y),w(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,null,[{key:"create",value:function(p){return p==="super"?document.createElement("sup"):p==="sub"?document.createElement("sub"):o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,p)}},{key:"formats",value:function(p){if(p.tagName==="SUB")return"sub";if(p.tagName==="SUP")return"super"}}]),y}(u.default);h.blotName="script",h.tagName=["SUB","SUP"],n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(b){return b&&b.__esModule?b:{default:b}}function u(b,h){if(!(b instanceof h))throw new TypeError("Cannot call a class as a function")}function f(b,h){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:b}function v(b,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);b.prototype=Object.create(h&&h.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(b,h):b.__proto__=h)}var w=function(b){v(h,b);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);w.blotName="strike",w.tagName="S",n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(b){return b&&b.__esModule?b:{default:b}}function u(b,h){if(!(b instanceof h))throw new TypeError("Cannot call a class as a function")}function f(b,h){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:b}function v(b,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);b.prototype=Object.create(h&&h.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(b,h):b.__proto__=h)}var w=function(b){v(h,b);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);w.blotName="underline",w.tagName="U",n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function m(p,g){for(var d=0;d<g.length;d++){var _=g[d];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(p,_.key,_)}}return function(p,g,d){return g&&m(p.prototype,g),d&&m(p,d),p}}(),o=function m(p,g,d){p===null&&(p=Function.prototype);var _=Object.getOwnPropertyDescriptor(p,g);if(_===void 0){var O=Object.getPrototypeOf(p);return O===null?void 0:m(O,g,d)}else{if("value"in _)return _.value;var k=_.get;return k===void 0?void 0:k.call(d)}},l=i(0),u=v(l),f=i(27);function v(m){return m&&m.__esModule?m:{default:m}}function w(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function b(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function h(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var E=["alt","height","width"],y=function(m){h(p,m);function p(){return w(this,p),b(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"format",value:function(d,_){E.indexOf(d)>-1?_?this.domNode.setAttribute(d,_):this.domNode.removeAttribute(d):o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,d,_)}}],[{key:"create",value:function(d){var _=o(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,d);return typeof d=="string"&&_.setAttribute("src",this.sanitize(d)),_}},{key:"formats",value:function(d){return E.reduce(function(_,O){return d.hasAttribute(O)&&(_[O]=d.getAttribute(O)),_},{})}},{key:"match",value:function(d){return/\.(jpe?g|gif|png)$/.test(d)||/^data:image\/.+;base64/.test(d)}},{key:"sanitize",value:function(d){return(0,f.sanitize)(d,["http","https","data"])?d:"//:0"}},{key:"value",value:function(d){return d.getAttribute("src")}}]),p}(u.default.Embed);y.blotName="image",y.tagName="IMG",n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function m(p,g){for(var d=0;d<g.length;d++){var _=g[d];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(p,_.key,_)}}return function(p,g,d){return g&&m(p.prototype,g),d&&m(p,d),p}}(),o=function m(p,g,d){p===null&&(p=Function.prototype);var _=Object.getOwnPropertyDescriptor(p,g);if(_===void 0){var O=Object.getPrototypeOf(p);return O===null?void 0:m(O,g,d)}else{if("value"in _)return _.value;var k=_.get;return k===void 0?void 0:k.call(d)}},l=i(4),u=i(27),f=v(u);function v(m){return m&&m.__esModule?m:{default:m}}function w(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function b(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function h(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var E=["height","width"],y=function(m){h(p,m);function p(){return w(this,p),b(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"format",value:function(d,_){E.indexOf(d)>-1?_?this.domNode.setAttribute(d,_):this.domNode.removeAttribute(d):o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,d,_)}}],[{key:"create",value:function(d){var _=o(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,d);return _.setAttribute("frameborder","0"),_.setAttribute("allowfullscreen",!0),_.setAttribute("src",this.sanitize(d)),_}},{key:"formats",value:function(d){return E.reduce(function(_,O){return d.hasAttribute(O)&&(_[O]=d.getAttribute(O)),_},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),p}(l.BlockEmbed);y.blotName="video",y.className="ql-video",y.tagName="IFRAME",n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var a=function(){function d(_,O){for(var k=0;k<O.length;k++){var C=O[k];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(_,C.key,C)}}return function(_,O,k){return O&&d(_.prototype,O),k&&d(_,k),_}}(),o=function d(_,O,k){_===null&&(_=Function.prototype);var C=Object.getOwnPropertyDescriptor(_,O);if(C===void 0){var S=Object.getPrototypeOf(_);return S===null?void 0:d(S,O,k)}else{if("value"in C)return C.value;var x=C.get;return x===void 0?void 0:x.call(k)}},l=i(35),u=h(l),f=i(5),v=h(f),w=i(9),b=h(w);function h(d){return d&&d.__esModule?d:{default:d}}function E(d,_){if(!(d instanceof _))throw new TypeError("Cannot call a class as a function")}function y(d,_){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:d}function m(d,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);d.prototype=Object.create(_&&_.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(d,_):d.__proto__=_)}var p=function(d){m(_,d);function _(){return E(this,_),y(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,null,[{key:"create",value:function(k){var C=o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,k);return typeof k=="string"&&(window.katex.render(k,C,{throwOnError:!1,errorColor:"#f00"}),C.setAttribute("data-value",k)),C}},{key:"value",value:function(k){return k.getAttribute("data-value")}}]),_}(u.default);p.blotName="formula",p.className="ql-formula",p.tagName="SPAN";var g=function(d){m(_,d),a(_,null,[{key:"register",value:function(){v.default.register(p,!0)}}]);function _(){E(this,_);var O=y(this,(_.__proto__||Object.getPrototypeOf(_)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return O}return _}(b.default);n.FormulaBlot=p,n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function k(C,S){for(var x=0;x<S.length;x++){var P=S[x];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(C,P.key,P)}}return function(C,S,x){return S&&k(C.prototype,S),x&&k(C,x),C}}(),o=function k(C,S,x){C===null&&(C=Function.prototype);var P=Object.getOwnPropertyDescriptor(C,S);if(P===void 0){var T=Object.getPrototypeOf(C);return T===null?void 0:k(T,S,x)}else{if("value"in P)return P.value;var L=P.get;return L===void 0?void 0:L.call(x)}},l=i(0),u=y(l),f=i(5),v=y(f),w=i(9),b=y(w),h=i(13),E=y(h);function y(k){return k&&k.__esModule?k:{default:k}}function m(k,C){if(!(k instanceof C))throw new TypeError("Cannot call a class as a function")}function p(k,C){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:k}function g(k,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);k.prototype=Object.create(C&&C.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(k,C):k.__proto__=C)}var d=function(k){g(C,k);function C(){return m(this,C),p(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return a(C,[{key:"replaceWith",value:function(x){this.domNode.textContent=this.domNode.textContent,this.attach(),o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"replaceWith",this).call(this,x)}},{key:"highlight",value:function(x){var P=this.domNode.textContent;this.cachedText!==P&&((P.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=x(P),this.domNode.normalize(),this.attach()),this.cachedText=P)}}]),C}(E.default);d.className="ql-syntax";var _=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),O=function(k){g(C,k),a(C,null,[{key:"register",value:function(){v.default.register(_,!0),v.default.register(d,!0)}}]);function C(S,x){m(this,C);var P=p(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,S,x));if(typeof P.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var T=null;return P.quill.on(v.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(T),T=setTimeout(function(){P.highlight(),T=null},P.options.interval)}),P.highlight(),P}return a(C,[{key:"highlight",value:function(){var x=this;if(!this.quill.selection.composing){this.quill.update(v.default.sources.USER);var P=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(T){T.highlight(x.options.highlight)}),this.quill.update(v.default.sources.SILENT),P!=null&&this.quill.setSelection(P,v.default.sources.SILENT)}}}]),C}(b.default);O.DEFAULTS={highlight:function(){return window.hljs==null?null:function(k){var C=window.hljs.highlightAuto(k);return C.value}}(),interval:1e3},n.CodeBlock=d,n.CodeToken=_,n.default=O},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var a=function C(S,x,P){S===null&&(S=Function.prototype);var T=Object.getOwnPropertyDescriptor(S,x);if(T===void 0){var L=Object.getPrototypeOf(S);return L===null?void 0:C(L,x,P)}else{if("value"in T)return T.value;var M=T.get;return M===void 0?void 0:M.call(P)}},o=function(){function C(S,x){for(var P=0;P<x.length;P++){var T=x[P];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(S,T.key,T)}}return function(S,x,P){return x&&C(S.prototype,x),P&&C(S,P),S}}(),l=i(3),u=m(l),f=i(8),v=m(f),w=i(43),b=m(w),h=i(15),E=i(41),y=m(E);function m(C){return C&&C.__esModule?C:{default:C}}function p(C,S){if(!(C instanceof S))throw new TypeError("Cannot call a class as a function")}function g(C,S){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:C}function d(C,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);C.prototype=Object.create(S&&S.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(C,S):C.__proto__=S)}var _=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],O=function(C){d(S,C);function S(x,P){p(this,S),P.modules.toolbar!=null&&P.modules.toolbar.container==null&&(P.modules.toolbar.container=_);var T=g(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,x,P));return T.quill.container.classList.add("ql-bubble"),T}return o(S,[{key:"extendToolbar",value:function(P){this.tooltip=new k(this.quill,this.options.bounds),this.tooltip.root.appendChild(P.container),this.buildButtons([].slice.call(P.container.querySelectorAll("button")),y.default),this.buildPickers([].slice.call(P.container.querySelectorAll("select")),y.default)}}]),S}(b.default);O.DEFAULTS=(0,u.default)(!0,{},b.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(S){S?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var k=function(C){d(S,C);function S(x,P){p(this,S);var T=g(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,x,P));return T.quill.on(v.default.events.EDITOR_CHANGE,function(L,M,U,$){if(L===v.default.events.SELECTION_CHANGE)if(M!=null&&M.length>0&&$===v.default.sources.USER){T.show(),T.root.style.left="0px",T.root.style.width="",T.root.style.width=T.root.offsetWidth+"px";var Z=T.quill.getLines(M.index,M.length);if(Z.length===1)T.position(T.quill.getBounds(M));else{var z=Z[Z.length-1],N=T.quill.getIndex(z),H=Math.min(z.length()-1,M.index+M.length-N),R=T.quill.getBounds(new h.Range(N,H));T.position(R)}}else document.activeElement!==T.textbox&&T.quill.hasFocus()&&T.hide()}),T}return o(S,[{key:"listen",value:function(){var P=this;a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){P.root.classList.remove("ql-editing")}),this.quill.on(v.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!P.root.classList.contains("ql-hidden")){var T=P.quill.getSelection();T!=null&&P.position(P.quill.getBounds(T))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(P){var T=a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"position",this).call(this,P),L=this.root.querySelector(".ql-tooltip-arrow");if(L.style.marginLeft="",T===0)return T;L.style.marginLeft=-1*T-L.offsetWidth/2+"px"}}]),S}(w.BaseTooltip);k.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=k,n.default=O},function(r,n,i){r.exports=i(63)}]).default})})(pS);var gS=pS.exports,wD={exports:{}};(function(e,t){(function(r,n){e.exports=n(gS)})(window,function(r){return function(n){var i={};function a(o){if(i[o])return i[o].exports;var l=i[o]={i:o,l:!1,exports:{}};return n[o].call(l.exports,l,l.exports,a),l.l=!0,l.exports}return a.m=n,a.c=i,a.d=function(o,l,u){a.o(o,l)||Object.defineProperty(o,l,{enumerable:!0,get:u})},a.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},a.t=function(o,l){if(1&l&&(o=a(o)),8&l||4&l&&typeof o=="object"&&o&&o.__esModule)return o;var u=Object.create(null);if(a.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:o}),2&l&&typeof o!="string")for(var f in o)a.d(u,f,(function(v){return o[v]}).bind(null,f));return u},a.n=function(o){var l=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(l,"a",l),l},a.o=function(o,l){return Object.prototype.hasOwnProperty.call(o,l)},a.p="",a(a.s=2)}([function(n,i,a){/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */n.exports=function(){const{entries:o,setPrototypeOf:l,isFrozen:u,getPrototypeOf:f,getOwnPropertyDescriptor:v}=Object;let{freeze:w,seal:b,create:h}=Object,{apply:E,construct:y}=typeof Reflect<"u"&&Reflect;E||(E=function(ie,ge,pe){return ie.apply(ge,pe)}),w||(w=function(ie){return ie}),b||(b=function(ie){return ie}),y||(y=function(ie,ge){return new ie(...ge)});const m=L(Array.prototype.forEach),p=L(Array.prototype.pop),g=L(Array.prototype.push),d=L(String.prototype.toLowerCase),_=L(String.prototype.toString),O=L(String.prototype.match),k=L(String.prototype.replace),C=L(String.prototype.indexOf),S=L(String.prototype.trim),x=L(RegExp.prototype.test),P=(T=TypeError,function(){for(var ie=arguments.length,ge=new Array(ie),pe=0;pe<ie;pe++)ge[pe]=arguments[pe];return y(T,ge)});var T;function L(ie){return function(ge){for(var pe=arguments.length,re=new Array(pe>1?pe-1:0),de=1;de<pe;de++)re[de-1]=arguments[de];return E(ie,ge,re)}}function M(ie,ge,pe){var re;pe=(re=pe)!==null&&re!==void 0?re:d,l&&l(ie,null);let de=ge.length;for(;de--;){let be=ge[de];if(typeof be=="string"){const ye=pe(be);ye!==be&&(u(ge)||(ge[de]=ye),be=ye)}ie[be]=!0}return ie}function U(ie){const ge=h(null);for(const[pe,re]of o(ie))ge[pe]=re;return ge}function $(ie,ge){for(;ie!==null;){const pe=v(ie,ge);if(pe){if(pe.get)return L(pe.get);if(typeof pe.value=="function")return L(pe.value)}ie=f(ie)}return function(pe){return console.warn("fallback value for",pe),null}}const Z=w(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),z=w(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),N=w(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),H=w(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),R=w(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),F=w(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),B=w(["#text"]),D=w(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),V=w(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Y=w(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),q=w(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),G=b(/\{\{[\w\W]*|[\w\W]*\}\}/gm),K=b(/<%[\w\W]*|[\w\W]*%>/gm),X=b(/\${[\w\W]*}/gm),Q=b(/^data-[\-\w.\u00B7-\uFFFF]/),ee=b(/^aria-[\-\w]+$/),te=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ae=b(/^(?:\w+script|data):/i),oe=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),se=b(/^html$/i);var ke=Object.freeze({__proto__:null,MUSTACHE_EXPR:G,ERB_EXPR:K,TMPLIT_EXPR:X,DATA_ATTR:Q,ARIA_ATTR:ee,IS_ALLOWED_URI:te,IS_SCRIPT_OR_DATA:ae,ATTR_WHITESPACE:oe,DOCTYPE_NAME:se});const Fe=()=>typeof window>"u"?null:window,fe=function(ie,ge){if(typeof ie!="object"||typeof ie.createPolicy!="function")return null;let pe=null;ge&&ge.hasAttribute("data-tt-policy-suffix")&&(pe=ge.getAttribute("data-tt-policy-suffix"));const re="dompurify"+(pe?"#"+pe:"");try{return ie.createPolicy(re,{createHTML:de=>de,createScriptURL:de=>de})}catch{return console.warn("TrustedTypes policy "+re+" could not be created."),null}};return function ie(){let ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Fe();const pe=ne=>ie(ne);if(pe.version="3.0.5",pe.removed=[],!ge||!ge.document||ge.document.nodeType!==9)return pe.isSupported=!1,pe;const re=ge.document,de=re.currentScript;let{document:be}=ge;const{DocumentFragment:ye,HTMLTemplateElement:Ie,Node:Ee,Element:Ae,NodeFilter:Ze,NamedNodeMap:We=ge.NamedNodeMap||ge.MozNamedAttrMap,HTMLFormElement:dt,DOMParser:Bt,trustedTypes:ue}=ge,he=Ae.prototype,nt=$(he,"cloneNode"),Oe=$(he,"nextSibling"),je=$(he,"childNodes"),Le=$(he,"parentNode");if(typeof Ie=="function"){const ne=be.createElement("template");ne.content&&ne.content.ownerDocument&&(be=ne.content.ownerDocument)}let Se,Je="";const{implementation:xe,createNodeIterator:Ke,createDocumentFragment:Sr,getElementsByTagName:Pe}=be,{importNode:He}=re;let et={};pe.isSupported=typeof o=="function"&&typeof Le=="function"&&xe&&xe.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Et,ERB_EXPR:xt,TMPLIT_EXPR:ar,DATA_ATTR:Rr,ARIA_ATTR:Lr,IS_SCRIPT_OR_DATA:ln,ATTR_WHITESPACE:De}=ke;let{IS_ALLOWED_URI:it}=ke,Qe=null;const kt=M({},[...Z,...z,...N,...R,...B]);let tt=null;const fr=M({},[...D,...V,...Y,...q]);let ht=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$t=null,Br=null,vr=!0,Mr=!0,Mn=!1,mi=!0,mn=!1,sn=!1,Kn=!1,Ka=!1,yi=!1,Kl=!1,Xa=!1,Za=!0,Xl=!1;const ku="user-content-";let Ru=!0,va=!1,Nn={},un=null;const Nt=M({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Rt=null;const bi=M({},["audio","video","img","source","image","track"]);let mr=null;const Ur=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xn="http://www.w3.org/1998/Math/MathML",_i="http://www.w3.org/2000/svg",Yt="http://www.w3.org/1999/xhtml";let wi=Yt,Zl=!1,Ql=null;const Jl=M({},[Xn,_i,Yt],_);let ma;const In=["application/xhtml+xml","text/html"],E0="text/html";let yr,Qa=null;const es=be.createElement("form"),Xo=function(ne){return ne instanceof RegExp||ne instanceof Function},ya=function(ne){if(!Qa||Qa!==ne){if(ne&&typeof ne=="object"||(ne={}),ne=U(ne),ma=ma=In.indexOf(ne.PARSER_MEDIA_TYPE)===-1?E0:ne.PARSER_MEDIA_TYPE,yr=ma==="application/xhtml+xml"?_:d,Qe="ALLOWED_TAGS"in ne?M({},ne.ALLOWED_TAGS,yr):kt,tt="ALLOWED_ATTR"in ne?M({},ne.ALLOWED_ATTR,yr):fr,Ql="ALLOWED_NAMESPACES"in ne?M({},ne.ALLOWED_NAMESPACES,_):Jl,mr="ADD_URI_SAFE_ATTR"in ne?M(U(Ur),ne.ADD_URI_SAFE_ATTR,yr):Ur,Rt="ADD_DATA_URI_TAGS"in ne?M(U(bi),ne.ADD_DATA_URI_TAGS,yr):bi,un="FORBID_CONTENTS"in ne?M({},ne.FORBID_CONTENTS,yr):Nt,$t="FORBID_TAGS"in ne?M({},ne.FORBID_TAGS,yr):{},Br="FORBID_ATTR"in ne?M({},ne.FORBID_ATTR,yr):{},Nn="USE_PROFILES"in ne&&ne.USE_PROFILES,vr=ne.ALLOW_ARIA_ATTR!==!1,Mr=ne.ALLOW_DATA_ATTR!==!1,Mn=ne.ALLOW_UNKNOWN_PROTOCOLS||!1,mi=ne.ALLOW_SELF_CLOSE_IN_ATTR!==!1,mn=ne.SAFE_FOR_TEMPLATES||!1,sn=ne.WHOLE_DOCUMENT||!1,yi=ne.RETURN_DOM||!1,Kl=ne.RETURN_DOM_FRAGMENT||!1,Xa=ne.RETURN_TRUSTED_TYPE||!1,Ka=ne.FORCE_BODY||!1,Za=ne.SANITIZE_DOM!==!1,Xl=ne.SANITIZE_NAMED_PROPS||!1,Ru=ne.KEEP_CONTENT!==!1,va=ne.IN_PLACE||!1,it=ne.ALLOWED_URI_REGEXP||te,wi=ne.NAMESPACE||Yt,ht=ne.CUSTOM_ELEMENT_HANDLING||{},ne.CUSTOM_ELEMENT_HANDLING&&Xo(ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ht.tagNameCheck=ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ne.CUSTOM_ELEMENT_HANDLING&&Xo(ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ht.attributeNameCheck=ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ne.CUSTOM_ELEMENT_HANDLING&&typeof ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ht.allowCustomizedBuiltInElements=ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),mn&&(Mr=!1),Kl&&(yi=!0),Nn&&(Qe=M({},[...B]),tt=[],Nn.html===!0&&(M(Qe,Z),M(tt,D)),Nn.svg===!0&&(M(Qe,z),M(tt,V),M(tt,q)),Nn.svgFilters===!0&&(M(Qe,N),M(tt,V),M(tt,q)),Nn.mathMl===!0&&(M(Qe,R),M(tt,Y),M(tt,q))),ne.ADD_TAGS&&(Qe===kt&&(Qe=U(Qe)),M(Qe,ne.ADD_TAGS,yr)),ne.ADD_ATTR&&(tt===fr&&(tt=U(tt)),M(tt,ne.ADD_ATTR,yr)),ne.ADD_URI_SAFE_ATTR&&M(mr,ne.ADD_URI_SAFE_ATTR,yr),ne.FORBID_CONTENTS&&(un===Nt&&(un=U(un)),M(un,ne.FORBID_CONTENTS,yr)),Ru&&(Qe["#text"]=!0),sn&&M(Qe,["html","head","body"]),Qe.table&&(M(Qe,["tbody"]),delete $t.tbody),ne.TRUSTED_TYPES_POLICY){if(typeof ne.TRUSTED_TYPES_POLICY.createHTML!="function")throw P('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ne.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw P('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Se=ne.TRUSTED_TYPES_POLICY,Je=Se.createHTML("")}else Se===void 0&&(Se=fe(ue,de)),Se!==null&&typeof Je=="string"&&(Je=Se.createHTML(""));w&&w(ne),Qa=ne}},Zo=M({},["mi","mo","mn","ms","mtext"]),Tf=M({},["foreignobject","desc","title","annotation-xml"]),O0=M({},["title","style","font","a","script"]),Ja=M({},z);M(Ja,N),M(Ja,H);const ts=M({},R);M(ts,F);const Lu=function(ne){let Te=Le(ne);Te&&Te.tagName||(Te={namespaceURI:wi,tagName:"template"});const Ne=d(ne.tagName),ft=d(Te.tagName);return!!Ql[ne.namespaceURI]&&(ne.namespaceURI===_i?Te.namespaceURI===Yt?Ne==="svg":Te.namespaceURI===Xn?Ne==="svg"&&(ft==="annotation-xml"||Zo[ft]):!!Ja[Ne]:ne.namespaceURI===Xn?Te.namespaceURI===Yt?Ne==="math":Te.namespaceURI===_i?Ne==="math"&&Tf[ft]:!!ts[Ne]:ne.namespaceURI===Yt?!(Te.namespaceURI===_i&&!Tf[ft])&&!(Te.namespaceURI===Xn&&!Zo[ft])&&!ts[Ne]&&(O0[Ne]||!Ja[Ne]):!(ma!=="application/xhtml+xml"||!Ql[ne.namespaceURI]))},Dn=function(ne){g(pe.removed,{element:ne});try{ne.parentNode.removeChild(ne)}catch{ne.remove()}},Mu=function(ne,Te){try{g(pe.removed,{attribute:Te.getAttributeNode(ne),from:Te})}catch{g(pe.removed,{attribute:null,from:Te})}if(Te.removeAttribute(ne),ne==="is"&&!tt[ne])if(yi||Kl)try{Dn(Te)}catch{}else try{Te.setAttribute(ne,"")}catch{}},rs=function(ne){let Te,Ne;if(Ka)ne="<remove></remove>"+ne;else{const Kr=O(ne,/^[\r\n\t ]+/);Ne=Kr&&Kr[0]}ma==="application/xhtml+xml"&&wi===Yt&&(ne='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ne+"</body></html>");const ft=Se?Se.createHTML(ne):ne;if(wi===Yt)try{Te=new Bt().parseFromString(ft,ma)}catch{}if(!Te||!Te.documentElement){Te=xe.createDocument(wi,"template",null);try{Te.documentElement.innerHTML=Zl?Je:ft}catch{}}const or=Te.body||Te.documentElement;return ne&&Ne&&or.insertBefore(be.createTextNode(Ne),or.childNodes[0]||null),wi===Yt?Pe.call(Te,sn?"html":"body")[0]:sn?Te.documentElement:or},wt=function(ne){return Ke.call(ne.ownerDocument||ne,ne,Ze.SHOW_ELEMENT|Ze.SHOW_COMMENT|Ze.SHOW_TEXT,null,!1)},Af=function(ne){return ne instanceof dt&&(typeof ne.nodeName!="string"||typeof ne.textContent!="string"||typeof ne.removeChild!="function"||!(ne.attributes instanceof We)||typeof ne.removeAttribute!="function"||typeof ne.setAttribute!="function"||typeof ne.namespaceURI!="string"||typeof ne.insertBefore!="function"||typeof ne.hasChildNodes!="function")},eo=function(ne){return typeof Ee=="object"?ne instanceof Ee:ne&&typeof ne=="object"&&typeof ne.nodeType=="number"&&typeof ne.nodeName=="string"},Zn=function(ne,Te,Ne){et[ne]&&m(et[ne],ft=>{ft.call(pe,Te,Ne,Qa)})},kf=function(ne){let Te;if(Zn("beforeSanitizeElements",ne,null),Af(ne))return Dn(ne),!0;const Ne=yr(ne.nodeName);if(Zn("uponSanitizeElement",ne,{tagName:Ne,allowedTags:Qe}),ne.hasChildNodes()&&!eo(ne.firstElementChild)&&(!eo(ne.content)||!eo(ne.content.firstElementChild))&&x(/<[/\w]/g,ne.innerHTML)&&x(/<[/\w]/g,ne.textContent))return Dn(ne),!0;if(!Qe[Ne]||$t[Ne]){if(!$t[Ne]&&dr(Ne)&&(ht.tagNameCheck instanceof RegExp&&x(ht.tagNameCheck,Ne)||ht.tagNameCheck instanceof Function&&ht.tagNameCheck(Ne)))return!1;if(Ru&&!un[Ne]){const ft=Le(ne)||ne.parentNode,or=je(ne)||ne.childNodes;if(or&&ft)for(let Kr=or.length-1;Kr>=0;--Kr)ft.insertBefore(nt(or[Kr],!0),Oe(ne))}return Dn(ne),!0}return ne instanceof Ae&&!Lu(ne)?(Dn(ne),!0):Ne!=="noscript"&&Ne!=="noembed"&&Ne!=="noframes"||!x(/<\/no(script|embed|frames)/i,ne.innerHTML)?(mn&&ne.nodeType===3&&(Te=ne.textContent,Te=k(Te,Et," "),Te=k(Te,xt," "),Te=k(Te,ar," "),ne.textContent!==Te&&(g(pe.removed,{element:ne.cloneNode()}),ne.textContent=Te)),Zn("afterSanitizeElements",ne,null),!1):(Dn(ne),!0)},Rf=function(ne,Te,Ne){if(Za&&(Te==="id"||Te==="name")&&(Ne in be||Ne in es))return!1;if(!(Mr&&!Br[Te]&&x(Rr,Te))){if(!(vr&&x(Lr,Te))){if(!tt[Te]||Br[Te]){if(!(dr(ne)&&(ht.tagNameCheck instanceof RegExp&&x(ht.tagNameCheck,ne)||ht.tagNameCheck instanceof Function&&ht.tagNameCheck(ne))&&(ht.attributeNameCheck instanceof RegExp&&x(ht.attributeNameCheck,Te)||ht.attributeNameCheck instanceof Function&&ht.attributeNameCheck(Te))||Te==="is"&&ht.allowCustomizedBuiltInElements&&(ht.tagNameCheck instanceof RegExp&&x(ht.tagNameCheck,Ne)||ht.tagNameCheck instanceof Function&&ht.tagNameCheck(Ne))))return!1}else if(!mr[Te]){if(!x(it,k(Ne,De,""))){if((Te!=="src"&&Te!=="xlink:href"&&Te!=="href"||ne==="script"||C(Ne,"data:")!==0||!Rt[ne])&&!(Mn&&!x(ln,k(Ne,De,"")))){if(Ne)return!1}}}}}return!0},dr=function(ne){return ne.indexOf("-")>0},ns=function(ne){let Te,Ne,ft,or;Zn("beforeSanitizeAttributes",ne,null);const{attributes:Kr}=ne;if(!Kr)return;const lr={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:tt};for(or=Kr.length;or--;){Te=Kr[or];const{name:It,namespaceURI:Si}=Te;if(Ne=It==="value"?Te.value:S(Te.value),ft=yr(It),lr.attrName=ft,lr.attrValue=Ne,lr.keepAttr=!0,lr.forceKeepAttr=void 0,Zn("uponSanitizeAttribute",ne,lr),Ne=lr.attrValue,lr.forceKeepAttr||(Mu(It,ne),!lr.keepAttr))continue;if(!mi&&x(/\/>/i,Ne)){Mu(It,ne);continue}mn&&(Ne=k(Ne,Et," "),Ne=k(Ne,xt," "),Ne=k(Ne,ar," "));const is=yr(ne.nodeName);if(Rf(is,ft,Ne)){if(!Xl||ft!=="id"&&ft!=="name"||(Mu(It,ne),Ne=ku+Ne),Se&&typeof ue=="object"&&typeof ue.getAttributeType=="function"&&!Si)switch(ue.getAttributeType(is,ft)){case"TrustedHTML":Ne=Se.createHTML(Ne);break;case"TrustedScriptURL":Ne=Se.createScriptURL(Ne)}try{Si?ne.setAttributeNS(Si,It,Ne):ne.setAttribute(It,Ne),p(pe.removed)}catch{}}}Zn("afterSanitizeAttributes",ne,null)},x0=function ne(Te){let Ne;const ft=wt(Te);for(Zn("beforeSanitizeShadowDOM",Te,null);Ne=ft.nextNode();)Zn("uponSanitizeShadowNode",Ne,null),kf(Ne)||(Ne.content instanceof ye&&ne(Ne.content),ns(Ne));Zn("afterSanitizeShadowDOM",Te,null)};return pe.sanitize=function(ne){let Te,Ne,ft,or,Kr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Zl=!ne,Zl&&(ne="<!-->"),typeof ne!="string"&&!eo(ne)){if(typeof ne.toString!="function")throw P("toString is not a function");if(typeof(ne=ne.toString())!="string")throw P("dirty is not a string, aborting")}if(!pe.isSupported)return ne;if(Kn||ya(Kr),pe.removed=[],typeof ne=="string"&&(va=!1),va){if(ne.nodeName){const Si=yr(ne.nodeName);if(!Qe[Si]||$t[Si])throw P("root node is forbidden and cannot be sanitized in-place")}}else if(ne instanceof Ee)Te=rs("<!---->"),Ne=Te.ownerDocument.importNode(ne,!0),Ne.nodeType===1&&Ne.nodeName==="BODY"||Ne.nodeName==="HTML"?Te=Ne:Te.appendChild(Ne);else{if(!yi&&!mn&&!sn&&ne.indexOf("<")===-1)return Se&&Xa?Se.createHTML(ne):ne;if(Te=rs(ne),!Te)return yi?null:Xa?Je:""}Te&&Ka&&Dn(Te.firstChild);const lr=wt(va?ne:Te);for(;ft=lr.nextNode();)kf(ft)||(ft.content instanceof ye&&x0(ft.content),ns(ft));if(va)return ne;if(yi){if(Kl)for(or=Sr.call(Te.ownerDocument);Te.firstChild;)or.appendChild(Te.firstChild);else or=Te;return(tt.shadowroot||tt.shadowrootmode)&&(or=He.call(re,or,!0)),or}let It=sn?Te.outerHTML:Te.innerHTML;return sn&&Qe["!doctype"]&&Te.ownerDocument&&Te.ownerDocument.doctype&&Te.ownerDocument.doctype.name&&x(se,Te.ownerDocument.doctype.name)&&(It="<!DOCTYPE "+Te.ownerDocument.doctype.name+`>
142
+ `+It),mn&&(It=k(It,Et," "),It=k(It,xt," "),It=k(It,ar," ")),Se&&Xa?Se.createHTML(It):It},pe.setConfig=function(ne){ya(ne),Kn=!0},pe.clearConfig=function(){Qa=null,Kn=!1},pe.isValidAttribute=function(ne,Te,Ne){Qa||ya({});const ft=yr(ne),or=yr(Te);return Rf(ft,or,Ne)},pe.addHook=function(ne,Te){typeof Te=="function"&&(et[ne]=et[ne]||[],g(et[ne],Te))},pe.removeHook=function(ne){if(et[ne])return p(et[ne])},pe.removeHooks=function(ne){et[ne]&&(et[ne]=[])},pe.removeAllHooks=function(){et={}},pe}()}()},function(n,i){n.exports=r},function(n,i,a){a.r(i);var o=a(1),l=a.n(o),u=a(0),f=a.n(u);function v(k){return(v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C})(k)}function w(k,C){var S=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);C&&(x=x.filter(function(P){return Object.getOwnPropertyDescriptor(k,P).enumerable})),S.push.apply(S,x)}return S}function b(k){for(var C=1;C<arguments.length;C++){var S=arguments[C]!=null?arguments[C]:{};C%2?w(Object(S),!0).forEach(function(x){h(k,x,S[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(S)):w(Object(S)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(S,x))})}return k}function h(k,C,S){return C in k?Object.defineProperty(k,C,{value:S,enumerable:!0,configurable:!0,writable:!0}):k[C]=S,k}function E(k,C){for(var S=0;S<C.length;S++){var x=C[S];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(k,x.key,x)}}function y(k,C){return(y=Object.setPrototypeOf||function(S,x){return S.__proto__=x,S})(k,C)}function m(k){var C=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var S,x=g(k);if(C){var P=g(this).constructor;S=Reflect.construct(x,arguments,P)}else S=x.apply(this,arguments);return p(this,S)}}function p(k,C){return!C||v(C)!=="object"&&typeof C!="function"?function(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}(k):C}function g(k){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)})(k)}var d=l.a.import("modules/clipboard"),_=l.a.import("delta"),O=function(k){(function(T,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(L&&L.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),L&&y(T,L)})(P,k);var C,S,x=m(P);function P(T,L){var M;return function(U,$){if(!(U instanceof $))throw new TypeError("Cannot call a class as a function")}(this,P),(M=x.call(this,T,L)).allowed=L.allowed,M.keepSelection=L.keepSelection,M.substituteBlockElements=L.substituteBlockElements,M.magicPasteLinks=L.magicPasteLinks,M.hooks=L.hooks,M}return C=P,(S=[{key:"onPaste",value:function(T){var L=this;T.preventDefault();var M,U,$,Z,z,N=this.quill.getSelection();T.clipboardData&&T.clipboardData.getData||!window.clipboardData||!window.clipboardData.getData?(M=T.clipboardData.getData("text/plain"),U=T.clipboardData.getData("text/html"),$=(Z=T.clipboardData)===null||Z===void 0||(z=Z.items)===null||z===void 0?void 0:z[0]):M=window.clipboardData.getData("Text");var H=new _().retain(N.index).delete(N.length),R=this.getDOMPurifyOptions(),F=!1,B=M;if(!U&&R.ALLOWED_TAGS.includes("a")&&this.isURL(M)&&N.length>0&&this.magicPasteLinks)B=this.quill.getText(N.index,N.length),H=H.insert(B,{link:M});else if(!U&&R.ALLOWED_TAGS.includes("img")&&$&&$.kind==="file"&&$.type.match(/^image\//i)){var D=$.getAsFile(),V=new FileReader;V.onload=function(oe){L.quill.insertEmbed(N.index,"image",oe.target.result),L.keepSelection||L.quill.setSelection(N.index+1)},V.readAsDataURL(D)}else{var Y,q,G,K,X,Q,ee,te,ae;U||(F=!0,U=B),typeof((Y=this.hooks)===null||Y===void 0?void 0:Y.beforeSanitizeElements)=="function"&&f.a.addHook("beforeSanitizeElements",this.hooks.beforeSanitizeElements),typeof((q=this.hooks)===null||q===void 0?void 0:q.uponSanitizeElement)=="function"&&f.a.addHook("uponSanitizeElement",this.hooks.uponSanitizeElement),typeof((G=this.hooks)===null||G===void 0?void 0:G.afterSanitizeElements)=="function"&&f.a.addHook("afterSanitizeElements",this.hooks.afterSanitizeElements),typeof((K=this.hooks)===null||K===void 0?void 0:K.beforeSanitizeAttributes)=="function"&&f.a.addHook("beforeSanitizeAttributes",this.hooks.beforeSanitizeAttributes),typeof((X=this.hooks)===null||X===void 0?void 0:X.uponSanitizeAttribute)=="function"&&f.a.addHook("uponSanitizeAttribute",this.hooks.uponSanitizeAttribute),typeof((Q=this.hooks)===null||Q===void 0?void 0:Q.afterSanitizeAttributes)=="function"&&f.a.addHook("afterSanitizeAttributes",this.hooks.afterSanitizeAttributes),typeof((ee=this.hooks)===null||ee===void 0?void 0:ee.beforeSanitizeShadowDOM)=="function"&&f.a.addHook("beforeSanitizeShadowDOM",this.hooks.beforeSanitizeShadowDOM),typeof((te=this.hooks)===null||te===void 0?void 0:te.uponSanitizeShadowNode)=="function"&&f.a.addHook("uponSanitizeShadowNode",this.hooks.uponSanitizeShadowNode),typeof((ae=this.hooks)===null||ae===void 0?void 0:ae.afterSanitizeShadowDOM)=="function"&&f.a.addHook("afterSanitizeShadowDOM",this.hooks.afterSanitizeShadowDOM),F?(B=f.a.sanitize(U,R),H=H.insert(B)):(B=this.substituteBlockElements!==!1?(U=this.substitute(U,R)).innerHTML:f.a.sanitize(U,R),H=H.concat(this.convert(B)))}this.quill.updateContents(H,l.a.sources.USER),F||(H=this.convert(B)),this.keepSelection?this.quill.setSelection(N.index,H.length(),l.a.sources.SILENT):this.quill.setSelection(N.index+H.length(),l.a.sources.SILENT),this.quill.scrollIntoView(),f.a.removeAllHooks()}},{key:"getDOMPurifyOptions",value:function(){var T,L,M={};if((T=this.allowed)!==null&&T!==void 0&&T.tags&&(M.ALLOWED_TAGS=this.allowed.tags),(L=this.allowed)!==null&&L!==void 0&&L.attributes&&(M.ALLOWED_ATTR=this.allowed.attributes),M.ALLOWED_TAGS===void 0||M.ALLOWED_ATTR===void 0){var U,$=!1;M.ALLOWED_TAGS===void 0&&($=!0,M.ALLOWED_TAGS=["p","br","span"]);var Z=!1;M.ALLOWED_ATTR===void 0&&(Z=!0,M.ALLOWED_ATTR=["class"]);var z=this.quill.getModule("toolbar");z==null||(U=z.controls)===null||U===void 0||U.forEach(function(N){switch(N[0]){case"bold":$&&(M.ALLOWED_TAGS.push("b"),M.ALLOWED_TAGS.push("strong"));break;case"italic":$&&(M.ALLOWED_TAGS.push("i"),M.ALLOWED_TAGS.push("em"));break;case"underline":$&&M.ALLOWED_TAGS.push("u");break;case"strike":$&&M.ALLOWED_TAGS.push("s");break;case"color":case"background":Z&&M.ALLOWED_ATTR.push("style");break;case"script":$&&(N[1].value==="super"?M.ALLOWED_TAGS.push("sup"):N[1].value==="sub"&&M.ALLOWED_TAGS.push("sub"));break;case"header":if($){var H=function(R){R==="1"?M.ALLOWED_TAGS.push("h1"):R==="2"?M.ALLOWED_TAGS.push("h2"):R==="3"?M.ALLOWED_TAGS.push("h3"):R==="4"?M.ALLOWED_TAGS.push("h4"):R==="5"?M.ALLOWED_TAGS.push("h5"):R==="6"&&M.ALLOWED_TAGS.push("h6")};N[1].value?H(N[1].value):N[1].options&&N[1].options.length&&[].forEach.call(N[1].options,function(R){R.value&&H(R.value)})}break;case"code-block":$&&M.ALLOWED_TAGS.push("pre"),Z&&M.ALLOWED_ATTR.push("spellcheck");break;case"list":$&&(N[1].value==="ordered"?M.ALLOWED_TAGS.push("ol"):N[1].value==="bullet"&&M.ALLOWED_TAGS.push("ul"),M.ALLOWED_TAGS.push("li"));break;case"link":$&&M.ALLOWED_TAGS.push("a"),Z&&(M.ALLOWED_ATTR.push("href"),M.ALLOWED_ATTR.push("target"),M.ALLOWED_ATTR.push("rel"));break;case"image":$&&M.ALLOWED_TAGS.push("img"),Z&&(M.ALLOWED_ATTR.push("src"),M.ALLOWED_ATTR.push("title"),M.ALLOWED_ATTR.push("alt"));break;case"video":$&&M.ALLOWED_TAGS.push("iframe"),Z&&(M.ALLOWED_ATTR.push("frameborder"),M.ALLOWED_ATTR.push("allowfullscreen"),M.ALLOWED_ATTR.push("src"));break;case"blockquote":$&&M.ALLOWED_TAGS.push(N[0])}})}return M}},{key:"substitute",value:function(T,L){var M,U=["h1","h2","h3","h4","h5","h6"],$=["p","div","section","article","fieldset","address","aside","blockquote","canvas","dl","figcaption","figure","footer","form","header","main","nav","noscript","ol","pre","table","tfoot","ul","video"],Z=["li","dt","dd","hr"];f.a.addHook("uponSanitizeElement",function(F,B,D){for(var V=0;!M&&V<3;)L.ALLOWED_TAGS.includes($[V])&&(M=$[V]),++V;if(M&&F.tagName&&!L.ALLOWED_TAGS.includes(F.tagName.toLowerCase())){var Y=F.tagName.toLowerCase();U.includes(Y)?F.innerHTML="<".concat(M,"><b>").concat(F.innerHTML,"</b></").concat(M,">"):$.includes(Y)?F.innerHTML="<".concat(M,">").concat(F.innerHTML,"</").concat(M,">"):Z.includes(Y)&&(F.innerHTML="".concat(F.innerHTML,"<br>"))}}),T=f.a.sanitize(T,b(b({},L),{RETURN_DOM:!0,WHOLE_DOCUMENT:!1})),f.a.removeAllHooks();var z,N=function(F){var B=document.createElement(F.tagName.toLowerCase()),D=F.attributes;return D.length&&Array.from(D).forEach(function(V){return B.setAttribute(V.nodeName,V.value)}),B},H=0,R=document.createElement("body");return function F(B,D){for(D(B,H),B=H<=1?B.firstChild:void 0;B;)++H,F(B,D),B=B.nextSibling;--H}(T,function(F,B){if(B===1)if(F.tagName&&$.includes(F.tagName.toLowerCase())){z&&(z=void 0);var D=N(F);D.innerHTML=F.innerHTML,R.appendChild(D)}else if(z===void 0&&(z=document.createElement(M),R.appendChild(z)),F.tagName){var V=N(F);F.innerHTML&&(V.innerHTML=F.innerHTML),z.appendChild(V)}else{var Y=document.createTextNode(F.textContent);z.appendChild(Y)}}),R}},{key:"isURL",value:function(T){return!!/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+\x2D?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+\x2D?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:(?![\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])[\s\S])*)?$/i.test(T)}}])&&E(C.prototype,S),P}(d);l.a.register("modules/clipboard",O,!0),i.default=O}])})})(wD);var vS={},mS={exports:{}},ul={},dc={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */dc.exports;var G4;function SD(){return G4||(G4=1,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof we=="object"&&we;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,l=2147483647,u=36,f=1,v=26,w=38,b=700,h=72,E=128,y="-",m=/^xn--/,p=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=u-f,O=Math.floor,k=String.fromCharCode,C;function S(R){throw new RangeError(d[R])}function x(R,F){for(var B=R.length,D=[];B--;)D[B]=F(R[B]);return D}function P(R,F){var B=R.split("@"),D="";B.length>1&&(D=B[0]+"@",R=B[1]),R=R.replace(g,".");var V=R.split("."),Y=x(V,F).join(".");return D+Y}function T(R){for(var F=[],B=0,D=R.length,V,Y;B<D;)V=R.charCodeAt(B++),V>=55296&&V<=56319&&B<D?(Y=R.charCodeAt(B++),(Y&64512)==56320?F.push(((V&1023)<<10)+(Y&1023)+65536):(F.push(V),B--)):F.push(V);return F}function L(R){return x(R,function(F){var B="";return F>65535&&(F-=65536,B+=k(F>>>10&1023|55296),F=56320|F&1023),B+=k(F),B}).join("")}function M(R){return R-48<10?R-22:R-65<26?R-65:R-97<26?R-97:u}function U(R,F){return R+22+75*(R<26)-((F!=0)<<5)}function $(R,F,B){var D=0;for(R=B?O(R/b):R>>1,R+=O(R/F);R>_*v>>1;D+=u)R=O(R/_);return O(D+(_+1)*R/(R+w))}function Z(R){var F=[],B=R.length,D,V=0,Y=E,q=h,G,K,X,Q,ee,te,ae,oe,se;for(G=R.lastIndexOf(y),G<0&&(G=0),K=0;K<G;++K)R.charCodeAt(K)>=128&&S("not-basic"),F.push(R.charCodeAt(K));for(X=G>0?G+1:0;X<B;){for(Q=V,ee=1,te=u;X>=B&&S("invalid-input"),ae=M(R.charCodeAt(X++)),(ae>=u||ae>O((l-V)/ee))&&S("overflow"),V+=ae*ee,oe=te<=q?f:te>=q+v?v:te-q,!(ae<oe);te+=u)se=u-oe,ee>O(l/se)&&S("overflow"),ee*=se;D=F.length+1,q=$(V-Q,D,Q==0),O(V/D)>l-Y&&S("overflow"),Y+=O(V/D),V%=D,F.splice(V++,0,Y)}return L(F)}function z(R){var F,B,D,V,Y,q,G,K,X,Q,ee,te=[],ae,oe,se,ke;for(R=T(R),ae=R.length,F=E,B=0,Y=h,q=0;q<ae;++q)ee=R[q],ee<128&&te.push(k(ee));for(D=V=te.length,V&&te.push(y);D<ae;){for(G=l,q=0;q<ae;++q)ee=R[q],ee>=F&&ee<G&&(G=ee);for(oe=D+1,G-F>O((l-B)/oe)&&S("overflow"),B+=(G-F)*oe,F=G,q=0;q<ae;++q)if(ee=R[q],ee<F&&++B>l&&S("overflow"),ee==F){for(K=B,X=u;Q=X<=Y?f:X>=Y+v?v:X-Y,!(K<Q);X+=u)ke=K-Q,se=u-Q,te.push(k(U(Q+ke%se,0))),K=O(ke/se);te.push(k(U(K,0))),Y=$(B,oe,D==V),B=0,++D}++B,++F}return te.join("")}function N(R){return P(R,function(F){return m.test(F)?Z(F.slice(4).toLowerCase()):F})}function H(R){return P(R,function(F){return p.test(F)?"xn--"+z(F):F})}if(o={version:"1.4.1",ucs2:{decode:T,encode:L},decode:Z,encode:z,toASCII:H,toUnicode:N},n&&i)if(e.exports==n)i.exports=o;else for(C in o)o.hasOwnProperty(C)&&(n[C]=o[C]);else r.punycode=o})(we)}(dc,dc.exports)),dc.exports}var Eg,$4;function ED(){return $4||($4=1,Eg=Error),Eg}var Og,V4;function OD(){return V4||(V4=1,Og=EvalError),Og}var xg,q4;function xD(){return q4||(q4=1,xg=RangeError),xg}var Pg,W4;function PD(){return W4||(W4=1,Pg=ReferenceError),Pg}var Cg,Y4;function yS(){return Y4||(Y4=1,Cg=SyntaxError),Cg}var Tg,K4;function Pf(){return K4||(K4=1,Tg=TypeError),Tg}var Ag,X4;function CD(){return X4||(X4=1,Ag=URIError),Ag}var kg,Z4;function TD(){return Z4||(Z4=1,kg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0}),kg}var Rg,Q4;function AD(){if(Q4)return Rg;Q4=1;var e=typeof Symbol<"u"&&Symbol,t=TD();return Rg=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Rg}var Lg,J4;function kD(){if(J4)return Lg;J4=1;var e={__proto__:null,foo:{}},t=Object;return Lg=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)},Lg}var Mg,e_;function RD(){if(e_)return Mg;e_=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(u,f){for(var v=[],w=0;w<u.length;w+=1)v[w]=u[w];for(var b=0;b<f.length;b+=1)v[b+u.length]=f[b];return v},a=function(u,f){for(var v=[],w=f,b=0;w<u.length;w+=1,b+=1)v[b]=u[w];return v},o=function(l,u){for(var f="",v=0;v<l.length;v+=1)f+=l[v],v+1<l.length&&(f+=u);return f};return Mg=function(u){var f=this;if(typeof f!="function"||t.apply(f)!==n)throw new TypeError(e+f);for(var v=a(arguments,1),w,b=function(){if(this instanceof w){var p=f.apply(this,i(v,arguments));return Object(p)===p?p:this}return f.apply(u,i(v,arguments))},h=r(0,f.length-v.length),E=[],y=0;y<h;y++)E[y]="$"+y;if(w=Function("binder","return function ("+o(E,",")+"){ return binder.apply(this,arguments); }")(b),f.prototype){var m=function(){};m.prototype=f.prototype,w.prototype=new m,m.prototype=null}return w},Mg}var Ng,t_;function R2(){if(t_)return Ng;t_=1;var e=RD();return Ng=Function.prototype.bind||e,Ng}var Ig,r_;function LD(){if(r_)return Ig;r_=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=R2();return Ig=r.call(e,t),Ig}var Dg,n_;function Tu(){if(n_)return Dg;n_=1;var e,t=ED(),r=OD(),n=xD(),i=PD(),a=yS(),o=Pf(),l=CD(),u=Function,f=function(z){try{return u('"use strict"; return ('+z+").constructor;")()}catch{}},v=Object.getOwnPropertyDescriptor;if(v)try{v({},"")}catch{v=null}var w=function(){throw new o},b=v?function(){try{return arguments.callee,w}catch{try{return v(arguments,"callee").get}catch{return w}}}():w,h=AD()(),E=kD()(),y=Object.getPrototypeOf||(E?function(z){return z.__proto__}:null),m={},p=typeof Uint8Array>"u"||!y?e:y(Uint8Array),g={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":h&&y?y([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":m,"%AsyncGenerator%":m,"%AsyncGeneratorFunction%":m,"%AsyncIteratorPrototype%":m,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":m,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&y?y(y([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!h||!y?e:y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!h||!y?e:y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&y?y(""[Symbol.iterator]()):e,"%Symbol%":h?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":b,"%TypedArray%":p,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(y)try{null.error}catch(z){var d=y(y(z));g["%Error.prototype%"]=d}var _=function z(N){var H;if(N==="%AsyncFunction%")H=f("async function () {}");else if(N==="%GeneratorFunction%")H=f("function* () {}");else if(N==="%AsyncGeneratorFunction%")H=f("async function* () {}");else if(N==="%AsyncGenerator%"){var R=z("%AsyncGeneratorFunction%");R&&(H=R.prototype)}else if(N==="%AsyncIteratorPrototype%"){var F=z("%AsyncGenerator%");F&&y&&(H=y(F.prototype))}return g[N]=H,H},O={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},k=R2(),C=LD(),S=k.call(Function.call,Array.prototype.concat),x=k.call(Function.apply,Array.prototype.splice),P=k.call(Function.call,String.prototype.replace),T=k.call(Function.call,String.prototype.slice),L=k.call(Function.call,RegExp.prototype.exec),M=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,U=/\\(\\)?/g,$=function(N){var H=T(N,0,1),R=T(N,-1);if(H==="%"&&R!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(R==="%"&&H!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var F=[];return P(N,M,function(B,D,V,Y){F[F.length]=V?P(Y,U,"$1"):D||B}),F},Z=function(N,H){var R=N,F;if(C(O,R)&&(F=O[R],R="%"+F[0]+"%"),C(g,R)){var B=g[R];if(B===m&&(B=_(R)),typeof B>"u"&&!H)throw new o("intrinsic "+N+" exists, but is not available. Please file an issue!");return{alias:F,name:R,value:B}}throw new a("intrinsic "+N+" does not exist!")};return Dg=function(N,H){if(typeof N!="string"||N.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof H!="boolean")throw new o('"allowMissing" argument must be a boolean');if(L(/^%?[^%]*%?$/,N)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var R=$(N),F=R.length>0?R[0]:"",B=Z("%"+F+"%",H),D=B.name,V=B.value,Y=!1,q=B.alias;q&&(F=q[0],x(R,S([0,1],q)));for(var G=1,K=!0;G<R.length;G+=1){var X=R[G],Q=T(X,0,1),ee=T(X,-1);if((Q==='"'||Q==="'"||Q==="`"||ee==='"'||ee==="'"||ee==="`")&&Q!==ee)throw new a("property names with quotes must have matching quotes");if((X==="constructor"||!K)&&(Y=!0),F+="."+X,D="%"+F+"%",C(g,D))V=g[D];else if(V!=null){if(!(X in V)){if(!H)throw new o("base intrinsic for "+N+" exists, but the property is not available.");return}if(v&&G+1>=R.length){var te=v(V,X);K=!!te,K&&"get"in te&&!("originalValue"in te.get)?V=te.get:V=V[X]}else K=C(V,X),V=V[X];K&&!Y&&(g[D]=V)}}return V},Dg}var Fg={exports:{}},jg,i_;function L2(){if(i_)return jg;i_=1;var e=Tu(),t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return jg=t,jg}var zg,a_;function bS(){if(a_)return zg;a_=1;var e=Tu(),t=e("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return zg=t,zg}var Bg,o_;function MD(){if(o_)return Bg;o_=1;var e=L2(),t=yS(),r=Pf(),n=bS();return Bg=function(a,o,l){if(!a||typeof a!="object"&&typeof a!="function")throw new r("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,v=arguments.length>5?arguments[5]:null,w=arguments.length>6?arguments[6]:!1,b=!!n&&n(a,o);if(e)e(a,o,{configurable:v===null&&b?b.configurable:!v,enumerable:u===null&&b?b.enumerable:!u,value:l,writable:f===null&&b?b.writable:!f});else if(w||!u&&!f&&!v)a[o]=l;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Bg}var Ug,l_;function ND(){if(l_)return Ug;l_=1;var e=L2(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Ug=t,Ug}var Hg,s_;function ID(){if(s_)return Hg;s_=1;var e=Tu(),t=MD(),r=ND()(),n=bS(),i=Pf(),a=e("%Math.floor%");return Hg=function(l,u){if(typeof l!="function")throw new i("`fn` is not a function");if(typeof u!="number"||u<0||u>4294967295||a(u)!==u)throw new i("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],v=!0,w=!0;if("length"in l&&n){var b=n(l,"length");b&&!b.configurable&&(v=!1),b&&!b.writable&&(w=!1)}return(v||w||!f)&&(r?t(l,"length",u,!0,!0):t(l,"length",u)),l},Hg}var u_;function DD(){return u_||(u_=1,function(e){var t=R2(),r=Tu(),n=ID(),i=Pf(),a=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),l=r("%Reflect.apply%",!0)||t.call(o,a),u=L2(),f=r("%Math.max%");e.exports=function(b){if(typeof b!="function")throw new i("a function is required");var h=l(t,o,arguments);return n(h,1+f(0,b.length-(arguments.length-1)),!0)};var v=function(){return l(t,a,arguments)};u?u(e.exports,"apply",{value:v}):e.exports.apply=v}(Fg)),Fg.exports}var Gg,c_;function FD(){if(c_)return Gg;c_=1;var e=Tu(),t=DD(),r=t(e("String.prototype.indexOf"));return Gg=function(i,a){var o=e(i,!!a);return typeof o=="function"&&r(i,".prototype.")>-1?t(o):o},Gg}const jD={},zD=Object.freeze(Object.defineProperty({__proto__:null,default:jD},Symbol.toStringTag,{value:"Module"})),BD=Do(zD);var $g,f_;function UD(){if(f_)return $g;f_=1;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,n=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&a&&typeof a.get=="function"?a.get:null,l=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,f=u?WeakMap.prototype.has:null,v=typeof WeakSet=="function"&&WeakSet.prototype,w=v?WeakSet.prototype.has:null,b=typeof WeakRef=="function"&&WeakRef.prototype,h=b?WeakRef.prototype.deref:null,E=Boolean.prototype.valueOf,y=Object.prototype.toString,m=Function.prototype.toString,p=String.prototype.match,g=String.prototype.slice,d=String.prototype.replace,_=String.prototype.toUpperCase,O=String.prototype.toLowerCase,k=RegExp.prototype.test,C=Array.prototype.concat,S=Array.prototype.join,x=Array.prototype.slice,P=Math.floor,T=typeof BigInt=="function"?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,U=typeof Symbol=="function"&&typeof Symbol.iterator=="object",$=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===U||!0)?Symbol.toStringTag:null,Z=Object.prototype.propertyIsEnumerable,z=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(ue){return ue.__proto__}:null);function N(ue,he){if(ue===1/0||ue===-1/0||ue!==ue||ue&&ue>-1e3&&ue<1e3||k.call(/e/,he))return he;var nt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ue=="number"){var Oe=ue<0?-P(-ue):P(ue);if(Oe!==ue){var je=String(Oe),Le=g.call(he,je.length+1);return d.call(je,nt,"$&_")+"."+d.call(d.call(Le,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(he,nt,"$&_")}var H=BD,R=H.custom,F=ee(R)?R:null;$g=function ue(he,nt,Oe,je){var Le=nt||{};if(oe(Le,"quoteStyle")&&Le.quoteStyle!=="single"&&Le.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(oe(Le,"maxStringLength")&&(typeof Le.maxStringLength=="number"?Le.maxStringLength<0&&Le.maxStringLength!==1/0:Le.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Se=oe(Le,"customInspect")?Le.customInspect:!0;if(typeof Se!="boolean"&&Se!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(oe(Le,"indent")&&Le.indent!==null&&Le.indent!==" "&&!(parseInt(Le.indent,10)===Le.indent&&Le.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(oe(Le,"numericSeparator")&&typeof Le.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Je=Le.numericSeparator;if(typeof he>"u")return"undefined";if(he===null)return"null";if(typeof he=="boolean")return he?"true":"false";if(typeof he=="string")return be(he,Le);if(typeof he=="number"){if(he===0)return 1/0/he>0?"0":"-0";var xe=String(he);return Je?N(he,xe):xe}if(typeof he=="bigint"){var Ke=String(he)+"n";return Je?N(he,Ke):Ke}var Sr=typeof Le.depth>"u"?5:Le.depth;if(typeof Oe>"u"&&(Oe=0),Oe>=Sr&&Sr>0&&typeof he=="object")return V(he)?"[Array]":"[Object]";var Pe=We(Le,Oe);if(typeof je>"u")je=[];else if(Fe(je,he)>=0)return"[Circular]";function He(vr,Mr,Mn){if(Mr&&(je=x.call(je),je.push(Mr)),Mn){var mi={depth:Le.depth};return oe(Le,"quoteStyle")&&(mi.quoteStyle=Le.quoteStyle),ue(vr,mi,Oe+1,je)}return ue(vr,Le,Oe+1,je)}if(typeof he=="function"&&!q(he)){var et=ke(he),Et=Bt(he,He);return"[Function"+(et?": "+et:" (anonymous)")+"]"+(Et.length>0?" { "+S.call(Et,", ")+" }":"")}if(ee(he)){var xt=U?d.call(String(he),/^(Symbol\(.*\))_[^)]*$/,"$1"):M.call(he);return typeof he=="object"&&!U?Ie(xt):xt}if(de(he)){for(var ar="<"+O.call(String(he.nodeName)),Rr=he.attributes||[],Lr=0;Lr<Rr.length;Lr++)ar+=" "+Rr[Lr].name+"="+B(D(Rr[Lr].value),"double",Le);return ar+=">",he.childNodes&&he.childNodes.length&&(ar+="..."),ar+="</"+O.call(String(he.nodeName))+">",ar}if(V(he)){if(he.length===0)return"[]";var ln=Bt(he,He);return Pe&&!Ze(ln)?"["+dt(ln,Pe)+"]":"[ "+S.call(ln,", ")+" ]"}if(G(he)){var De=Bt(he,He);return!("cause"in Error.prototype)&&"cause"in he&&!Z.call(he,"cause")?"{ ["+String(he)+"] "+S.call(C.call("[cause]: "+He(he.cause),De),", ")+" }":De.length===0?"["+String(he)+"]":"{ ["+String(he)+"] "+S.call(De,", ")+" }"}if(typeof he=="object"&&Se){if(F&&typeof he[F]=="function"&&H)return H(he,{depth:Sr-Oe});if(Se!=="symbol"&&typeof he.inspect=="function")return he.inspect()}if(fe(he)){var it=[];return n&&n.call(he,function(vr,Mr){it.push(He(Mr,he,!0)+" => "+He(vr,he))}),Ae("Map",r.call(he),it,Pe)}if(pe(he)){var Qe=[];return l&&l.call(he,function(vr){Qe.push(He(vr,he))}),Ae("Set",o.call(he),Qe,Pe)}if(ie(he))return Ee("WeakMap");if(re(he))return Ee("WeakSet");if(ge(he))return Ee("WeakRef");if(X(he))return Ie(He(Number(he)));if(te(he))return Ie(He(T.call(he)));if(Q(he))return Ie(E.call(he));if(K(he))return Ie(He(String(he)));if(typeof window<"u"&&he===window)return"{ [object Window] }";if(he===we)return"{ [object globalThis] }";if(!Y(he)&&!q(he)){var kt=Bt(he,He),tt=z?z(he)===Object.prototype:he instanceof Object||he.constructor===Object,fr=he instanceof Object?"":"null prototype",ht=!tt&&$&&Object(he)===he&&$ in he?g.call(se(he),8,-1):fr?"Object":"",$t=tt||typeof he.constructor!="function"?"":he.constructor.name?he.constructor.name+" ":"",Br=$t+(ht||fr?"["+S.call(C.call([],ht||[],fr||[]),": ")+"] ":"");return kt.length===0?Br+"{}":Pe?Br+"{"+dt(kt,Pe)+"}":Br+"{ "+S.call(kt,", ")+" }"}return String(he)};function B(ue,he,nt){var Oe=(nt.quoteStyle||he)==="double"?'"':"'";return Oe+ue+Oe}function D(ue){return d.call(String(ue),/"/g,"&quot;")}function V(ue){return se(ue)==="[object Array]"&&(!$||!(typeof ue=="object"&&$ in ue))}function Y(ue){return se(ue)==="[object Date]"&&(!$||!(typeof ue=="object"&&$ in ue))}function q(ue){return se(ue)==="[object RegExp]"&&(!$||!(typeof ue=="object"&&$ in ue))}function G(ue){return se(ue)==="[object Error]"&&(!$||!(typeof ue=="object"&&$ in ue))}function K(ue){return se(ue)==="[object String]"&&(!$||!(typeof ue=="object"&&$ in ue))}function X(ue){return se(ue)==="[object Number]"&&(!$||!(typeof ue=="object"&&$ in ue))}function Q(ue){return se(ue)==="[object Boolean]"&&(!$||!(typeof ue=="object"&&$ in ue))}function ee(ue){if(U)return ue&&typeof ue=="object"&&ue instanceof Symbol;if(typeof ue=="symbol")return!0;if(!ue||typeof ue!="object"||!M)return!1;try{return M.call(ue),!0}catch{}return!1}function te(ue){if(!ue||typeof ue!="object"||!T)return!1;try{return T.call(ue),!0}catch{}return!1}var ae=Object.prototype.hasOwnProperty||function(ue){return ue in this};function oe(ue,he){return ae.call(ue,he)}function se(ue){return y.call(ue)}function ke(ue){if(ue.name)return ue.name;var he=p.call(m.call(ue),/^function\s*([\w$]+)/);return he?he[1]:null}function Fe(ue,he){if(ue.indexOf)return ue.indexOf(he);for(var nt=0,Oe=ue.length;nt<Oe;nt++)if(ue[nt]===he)return nt;return-1}function fe(ue){if(!r||!ue||typeof ue!="object")return!1;try{r.call(ue);try{o.call(ue)}catch{return!0}return ue instanceof Map}catch{}return!1}function ie(ue){if(!f||!ue||typeof ue!="object")return!1;try{f.call(ue,f);try{w.call(ue,w)}catch{return!0}return ue instanceof WeakMap}catch{}return!1}function ge(ue){if(!h||!ue||typeof ue!="object")return!1;try{return h.call(ue),!0}catch{}return!1}function pe(ue){if(!o||!ue||typeof ue!="object")return!1;try{o.call(ue);try{r.call(ue)}catch{return!0}return ue instanceof Set}catch{}return!1}function re(ue){if(!w||!ue||typeof ue!="object")return!1;try{w.call(ue,w);try{f.call(ue,f)}catch{return!0}return ue instanceof WeakSet}catch{}return!1}function de(ue){return!ue||typeof ue!="object"?!1:typeof HTMLElement<"u"&&ue instanceof HTMLElement?!0:typeof ue.nodeName=="string"&&typeof ue.getAttribute=="function"}function be(ue,he){if(ue.length>he.maxStringLength){var nt=ue.length-he.maxStringLength,Oe="... "+nt+" more character"+(nt>1?"s":"");return be(g.call(ue,0,he.maxStringLength),he)+Oe}var je=d.call(d.call(ue,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ye);return B(je,"single",he)}function ye(ue){var he=ue.charCodeAt(0),nt={8:"b",9:"t",10:"n",12:"f",13:"r"}[he];return nt?"\\"+nt:"\\x"+(he<16?"0":"")+_.call(he.toString(16))}function Ie(ue){return"Object("+ue+")"}function Ee(ue){return ue+" { ? }"}function Ae(ue,he,nt,Oe){var je=Oe?dt(nt,Oe):S.call(nt,", ");return ue+" ("+he+") {"+je+"}"}function Ze(ue){for(var he=0;he<ue.length;he++)if(Fe(ue[he],`
143
+ `)>=0)return!1;return!0}function We(ue,he){var nt;if(ue.indent===" ")nt=" ";else if(typeof ue.indent=="number"&&ue.indent>0)nt=S.call(Array(ue.indent+1)," ");else return null;return{base:nt,prev:S.call(Array(he+1),nt)}}function dt(ue,he){if(ue.length===0)return"";var nt=`
144
+ `+he.prev+he.base;return nt+S.call(ue,","+nt)+`
145
+ `+he.prev}function Bt(ue,he){var nt=V(ue),Oe=[];if(nt){Oe.length=ue.length;for(var je=0;je<ue.length;je++)Oe[je]=oe(ue,je)?he(ue[je],ue):""}var Le=typeof L=="function"?L(ue):[],Se;if(U){Se={};for(var Je=0;Je<Le.length;Je++)Se["$"+Le[Je]]=Le[Je]}for(var xe in ue)oe(ue,xe)&&(nt&&String(Number(xe))===xe&&xe<ue.length||U&&Se["$"+xe]instanceof Symbol||(k.call(/[^\w$]/,xe)?Oe.push(he(xe,ue)+": "+he(ue[xe],ue)):Oe.push(xe+": "+he(ue[xe],ue))));if(typeof L=="function")for(var Ke=0;Ke<Le.length;Ke++)Z.call(ue,Le[Ke])&&Oe.push("["+he(Le[Ke])+"]: "+he(ue[Le[Ke]],ue));return Oe}return $g}var Vg,d_;function HD(){if(d_)return Vg;d_=1;var e=Tu(),t=FD(),r=UD(),n=Pf(),i=e("%WeakMap%",!0),a=e("%Map%",!0),o=t("WeakMap.prototype.get",!0),l=t("WeakMap.prototype.set",!0),u=t("WeakMap.prototype.has",!0),f=t("Map.prototype.get",!0),v=t("Map.prototype.set",!0),w=t("Map.prototype.has",!0),b=function(m,p){for(var g=m,d;(d=g.next)!==null;g=d)if(d.key===p)return g.next=d.next,d.next=m.next,m.next=d,d},h=function(m,p){var g=b(m,p);return g&&g.value},E=function(m,p,g){var d=b(m,p);d?d.value=g:m.next={key:p,next:m.next,value:g}},y=function(m,p){return!!b(m,p)};return Vg=function(){var p,g,d,_={assert:function(O){if(!_.has(O))throw new n("Side channel does not contain "+r(O))},get:function(O){if(i&&O&&(typeof O=="object"||typeof O=="function")){if(p)return o(p,O)}else if(a){if(g)return f(g,O)}else if(d)return h(d,O)},has:function(O){if(i&&O&&(typeof O=="object"||typeof O=="function")){if(p)return u(p,O)}else if(a){if(g)return w(g,O)}else if(d)return y(d,O);return!1},set:function(O,k){i&&O&&(typeof O=="object"||typeof O=="function")?(p||(p=new i),l(p,O,k)):a?(g||(g=new a),v(g,O,k)):(d||(d={key:{},next:null}),E(d,O,k))}};return _},Vg}var qg,h_;function M2(){if(h_)return qg;h_=1;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return qg={default:r.RFC3986,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},qg}var Wg,p_;function _S(){if(p_)return Wg;p_=1;var e=M2(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var m=[],p=0;p<256;++p)m.push("%"+((p<16?"0":"")+p.toString(16)).toUpperCase());return m}(),i=function(p){for(;p.length>1;){var g=p.pop(),d=g.obj[g.prop];if(r(d)){for(var _=[],O=0;O<d.length;++O)typeof d[O]<"u"&&_.push(d[O]);g.obj[g.prop]=_}}},a=function(p,g){for(var d=g&&g.plainObjects?Object.create(null):{},_=0;_<p.length;++_)typeof p[_]<"u"&&(d[_]=p[_]);return d},o=function m(p,g,d){if(!g)return p;if(typeof g!="object"){if(r(p))p.push(g);else if(p&&typeof p=="object")(d&&(d.plainObjects||d.allowPrototypes)||!t.call(Object.prototype,g))&&(p[g]=!0);else return[p,g];return p}if(!p||typeof p!="object")return[p].concat(g);var _=p;return r(p)&&!r(g)&&(_=a(p,d)),r(p)&&r(g)?(g.forEach(function(O,k){if(t.call(p,k)){var C=p[k];C&&typeof C=="object"&&O&&typeof O=="object"?p[k]=m(C,O,d):p.push(O)}else p[k]=O}),p):Object.keys(g).reduce(function(O,k){var C=g[k];return t.call(O,k)?O[k]=m(O[k],C,d):O[k]=C,O},_)},l=function(p,g){return Object.keys(g).reduce(function(d,_){return d[_]=g[_],d},p)},u=function(m,p,g){var d=m.replace(/\+/g," ");if(g==="iso-8859-1")return d.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(d)}catch{return d}},f=1024,v=function(p,g,d,_,O){if(p.length===0)return p;var k=p;if(typeof p=="symbol"?k=Symbol.prototype.toString.call(p):typeof p!="string"&&(k=String(p)),d==="iso-8859-1")return escape(k).replace(/%u[0-9a-f]{4}/gi,function(M){return"%26%23"+parseInt(M.slice(2),16)+"%3B"});for(var C="",S=0;S<k.length;S+=f){for(var x=k.length>=f?k.slice(S,S+f):k,P=[],T=0;T<x.length;++T){var L=x.charCodeAt(T);if(L===45||L===46||L===95||L===126||L>=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||O===e.RFC1738&&(L===40||L===41)){P[P.length]=x.charAt(T);continue}if(L<128){P[P.length]=n[L];continue}if(L<2048){P[P.length]=n[192|L>>6]+n[128|L&63];continue}if(L<55296||L>=57344){P[P.length]=n[224|L>>12]+n[128|L>>6&63]+n[128|L&63];continue}T+=1,L=65536+((L&1023)<<10|x.charCodeAt(T)&1023),P[P.length]=n[240|L>>18]+n[128|L>>12&63]+n[128|L>>6&63]+n[128|L&63]}C+=P.join("")}return C},w=function(p){for(var g=[{obj:{o:p},prop:"o"}],d=[],_=0;_<g.length;++_)for(var O=g[_],k=O.obj[O.prop],C=Object.keys(k),S=0;S<C.length;++S){var x=C[S],P=k[x];typeof P=="object"&&P!==null&&d.indexOf(P)===-1&&(g.push({obj:k,prop:x}),d.push(P))}return i(g),p},b=function(p){return Object.prototype.toString.call(p)==="[object RegExp]"},h=function(p){return!p||typeof p!="object"?!1:!!(p.constructor&&p.constructor.isBuffer&&p.constructor.isBuffer(p))},E=function(p,g){return[].concat(p,g)},y=function(p,g){if(r(p)){for(var d=[],_=0;_<p.length;_+=1)d.push(g(p[_]));return d}return g(p)};return Wg={arrayToObject:a,assign:l,combine:E,compact:w,decode:u,encode:v,isBuffer:h,isRegExp:b,maybeMap:y,merge:o},Wg}var Yg,g_;function GD(){if(g_)return Yg;g_=1;var e=HD(),t=_S(),r=M2(),n=Object.prototype.hasOwnProperty,i={brackets:function(m){return m+"[]"},comma:"comma",indices:function(m,p){return m+"["+p+"]"},repeat:function(m){return m}},a=Array.isArray,o=Array.prototype.push,l=function(y,m){o.apply(y,a(m)?m:[m])},u=Date.prototype.toISOString,f=r.default,v={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:f,formatter:r.formatters[f],indices:!1,serializeDate:function(m){return u.call(m)},skipNulls:!1,strictNullHandling:!1},w=function(m){return typeof m=="string"||typeof m=="number"||typeof m=="boolean"||typeof m=="symbol"||typeof m=="bigint"},b={},h=function y(m,p,g,d,_,O,k,C,S,x,P,T,L,M,U,$,Z,z){for(var N=m,H=z,R=0,F=!1;(H=H.get(b))!==void 0&&!F;){var B=H.get(m);if(R+=1,typeof B<"u"){if(B===R)throw new RangeError("Cyclic object value");F=!0}typeof H.get(b)>"u"&&(R=0)}if(typeof x=="function"?N=x(p,N):N instanceof Date?N=L(N):g==="comma"&&a(N)&&(N=t.maybeMap(N,function(se){return se instanceof Date?L(se):se})),N===null){if(O)return S&&!$?S(p,v.encoder,Z,"key",M):p;N=""}if(w(N)||t.isBuffer(N)){if(S){var D=$?p:S(p,v.encoder,Z,"key",M);return[U(D)+"="+U(S(N,v.encoder,Z,"value",M))]}return[U(p)+"="+U(String(N))]}var V=[];if(typeof N>"u")return V;var Y;if(g==="comma"&&a(N))$&&S&&(N=t.maybeMap(N,S)),Y=[{value:N.length>0?N.join(",")||null:void 0}];else if(a(x))Y=x;else{var q=Object.keys(N);Y=P?q.sort(P):q}var G=C?p.replace(/\./g,"%2E"):p,K=d&&a(N)&&N.length===1?G+"[]":G;if(_&&a(N)&&N.length===0)return K+"[]";for(var X=0;X<Y.length;++X){var Q=Y[X],ee=typeof Q=="object"&&typeof Q.value<"u"?Q.value:N[Q];if(!(k&&ee===null)){var te=T&&C?Q.replace(/\./g,"%2E"):Q,ae=a(N)?typeof g=="function"?g(K,te):K:K+(T?"."+te:"["+te+"]");z.set(m,R);var oe=e();oe.set(b,z),l(V,y(ee,ae,g,d,_,O,k,C,g==="comma"&&$&&a(N)?null:S,x,P,T,L,M,U,$,Z,oe))}}return V},E=function(m){if(!m)return v;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.encodeDotInKeys<"u"&&typeof m.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(m.encoder!==null&&typeof m.encoder<"u"&&typeof m.encoder!="function")throw new TypeError("Encoder has to be a function.");var p=m.charset||v.charset;if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var g=r.default;if(typeof m.format<"u"){if(!n.call(r.formatters,m.format))throw new TypeError("Unknown format option provided.");g=m.format}var d=r.formatters[g],_=v.filter;(typeof m.filter=="function"||a(m.filter))&&(_=m.filter);var O;if(m.arrayFormat in i?O=m.arrayFormat:"indices"in m?O=m.indices?"indices":"repeat":O=v.arrayFormat,"commaRoundTrip"in m&&typeof m.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var k=typeof m.allowDots>"u"?m.encodeDotInKeys===!0?!0:v.allowDots:!!m.allowDots;return{addQueryPrefix:typeof m.addQueryPrefix=="boolean"?m.addQueryPrefix:v.addQueryPrefix,allowDots:k,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:v.allowEmptyArrays,arrayFormat:O,charset:p,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:v.charsetSentinel,commaRoundTrip:m.commaRoundTrip,delimiter:typeof m.delimiter>"u"?v.delimiter:m.delimiter,encode:typeof m.encode=="boolean"?m.encode:v.encode,encodeDotInKeys:typeof m.encodeDotInKeys=="boolean"?m.encodeDotInKeys:v.encodeDotInKeys,encoder:typeof m.encoder=="function"?m.encoder:v.encoder,encodeValuesOnly:typeof m.encodeValuesOnly=="boolean"?m.encodeValuesOnly:v.encodeValuesOnly,filter:_,format:g,formatter:d,serializeDate:typeof m.serializeDate=="function"?m.serializeDate:v.serializeDate,skipNulls:typeof m.skipNulls=="boolean"?m.skipNulls:v.skipNulls,sort:typeof m.sort=="function"?m.sort:null,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:v.strictNullHandling}};return Yg=function(y,m){var p=y,g=E(m),d,_;typeof g.filter=="function"?(_=g.filter,p=_("",p)):a(g.filter)&&(_=g.filter,d=_);var O=[];if(typeof p!="object"||p===null)return"";var k=i[g.arrayFormat],C=k==="comma"&&g.commaRoundTrip;d||(d=Object.keys(p)),g.sort&&d.sort(g.sort);for(var S=e(),x=0;x<d.length;++x){var P=d[x];g.skipNulls&&p[P]===null||l(O,h(p[P],P,k,C,g.allowEmptyArrays,g.strictNullHandling,g.skipNulls,g.encodeDotInKeys,g.encode?g.encoder:null,g.filter,g.sort,g.allowDots,g.serializeDate,g.format,g.formatter,g.encodeValuesOnly,g.charset,S))}var T=O.join(g.delimiter),L=g.addQueryPrefix===!0?"?":"";return g.charsetSentinel&&(g.charset==="iso-8859-1"?L+="utf8=%26%2310003%3B&":L+="utf8=%E2%9C%93&"),T.length>0?L+T:""},Yg}var Kg,v_;function $D(){if(v_)return Kg;v_=1;var e=_S(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(b){return b.replace(/&#(\d+);/g,function(h,E){return String.fromCharCode(parseInt(E,10))})},a=function(b,h){return b&&typeof b=="string"&&h.comma&&b.indexOf(",")>-1?b.split(","):b},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(h,E){var y={__proto__:null},m=E.ignoreQueryPrefix?h.replace(/^\?/,""):h,p=E.parameterLimit===1/0?void 0:E.parameterLimit,g=m.split(E.delimiter,p),d=-1,_,O=E.charset;if(E.charsetSentinel)for(_=0;_<g.length;++_)g[_].indexOf("utf8=")===0&&(g[_]===l?O="utf-8":g[_]===o&&(O="iso-8859-1"),d=_,_=g.length);for(_=0;_<g.length;++_)if(_!==d){var k=g[_],C=k.indexOf("]="),S=C===-1?k.indexOf("="):C+1,x,P;S===-1?(x=E.decoder(k,n.decoder,O,"key"),P=E.strictNullHandling?null:""):(x=E.decoder(k.slice(0,S),n.decoder,O,"key"),P=e.maybeMap(a(k.slice(S+1),E),function(L){return E.decoder(L,n.decoder,O,"value")})),P&&E.interpretNumericEntities&&O==="iso-8859-1"&&(P=i(P)),k.indexOf("[]=")>-1&&(P=r(P)?[P]:P);var T=t.call(y,x);T&&E.duplicates==="combine"?y[x]=e.combine(y[x],P):(!T||E.duplicates==="last")&&(y[x]=P)}return y},f=function(b,h,E,y){for(var m=y?h:a(h,E),p=b.length-1;p>=0;--p){var g,d=b[p];if(d==="[]"&&E.parseArrays)g=E.allowEmptyArrays&&m===""?[]:[].concat(m);else{g=E.plainObjects?Object.create(null):{};var _=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,O=E.decodeDotInKeys?_.replace(/%2E/g,"."):_,k=parseInt(O,10);!E.parseArrays&&O===""?g={0:m}:!isNaN(k)&&d!==O&&String(k)===O&&k>=0&&E.parseArrays&&k<=E.arrayLimit?(g=[],g[k]=m):O!=="__proto__"&&(g[O]=m)}m=g}return m},v=function(h,E,y,m){if(h){var p=y.allowDots?h.replace(/\.([^.[]+)/g,"[$1]"):h,g=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,_=y.depth>0&&g.exec(p),O=_?p.slice(0,_.index):p,k=[];if(O){if(!y.plainObjects&&t.call(Object.prototype,O)&&!y.allowPrototypes)return;k.push(O)}for(var C=0;y.depth>0&&(_=d.exec(p))!==null&&C<y.depth;){if(C+=1,!y.plainObjects&&t.call(Object.prototype,_[1].slice(1,-1))&&!y.allowPrototypes)return;k.push(_[1])}return _&&k.push("["+p.slice(_.index)+"]"),f(k,E,y,m)}},w=function(h){if(!h)return n;if(typeof h.allowEmptyArrays<"u"&&typeof h.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof h.decodeDotInKeys<"u"&&typeof h.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(h.decoder!==null&&typeof h.decoder<"u"&&typeof h.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof h.charset<"u"&&h.charset!=="utf-8"&&h.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var E=typeof h.charset>"u"?n.charset:h.charset,y=typeof h.duplicates>"u"?n.duplicates:h.duplicates;if(y!=="combine"&&y!=="first"&&y!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var m=typeof h.allowDots>"u"?h.decodeDotInKeys===!0?!0:n.allowDots:!!h.allowDots;return{allowDots:m,allowEmptyArrays:typeof h.allowEmptyArrays=="boolean"?!!h.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof h.allowPrototypes=="boolean"?h.allowPrototypes:n.allowPrototypes,allowSparse:typeof h.allowSparse=="boolean"?h.allowSparse:n.allowSparse,arrayLimit:typeof h.arrayLimit=="number"?h.arrayLimit:n.arrayLimit,charset:E,charsetSentinel:typeof h.charsetSentinel=="boolean"?h.charsetSentinel:n.charsetSentinel,comma:typeof h.comma=="boolean"?h.comma:n.comma,decodeDotInKeys:typeof h.decodeDotInKeys=="boolean"?h.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof h.decoder=="function"?h.decoder:n.decoder,delimiter:typeof h.delimiter=="string"||e.isRegExp(h.delimiter)?h.delimiter:n.delimiter,depth:typeof h.depth=="number"||h.depth===!1?+h.depth:n.depth,duplicates:y,ignoreQueryPrefix:h.ignoreQueryPrefix===!0,interpretNumericEntities:typeof h.interpretNumericEntities=="boolean"?h.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof h.parameterLimit=="number"?h.parameterLimit:n.parameterLimit,parseArrays:h.parseArrays!==!1,plainObjects:typeof h.plainObjects=="boolean"?h.plainObjects:n.plainObjects,strictNullHandling:typeof h.strictNullHandling=="boolean"?h.strictNullHandling:n.strictNullHandling}};return Kg=function(b,h){var E=w(h);if(b===""||b===null||typeof b>"u")return E.plainObjects?Object.create(null):{};for(var y=typeof b=="string"?u(b,E):b,m=E.plainObjects?Object.create(null):{},p=Object.keys(y),g=0;g<p.length;++g){var d=p[g],_=v(d,y[d],E,typeof b=="string");m=e.merge(m,_,E)}return E.allowSparse===!0?m:e.compact(m)},Kg}var Xg,m_;function VD(){if(m_)return Xg;m_=1;var e=GD(),t=$D(),r=M2();return Xg={formats:r,parse:t,stringify:e},Xg}var y_;function wS(){if(y_)return ul;y_=1;var e=SD();function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
146
+ `," "],o=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(o),u=["%","/","?",";","#"].concat(l),f=["/","?","#"],v=255,w=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=VD();function p(O,k,C){if(O&&typeof O=="object"&&O instanceof t)return O;var S=new t;return S.parse(O,k,C),S}t.prototype.parse=function(O,k,C){if(typeof O!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof O);var S=O.indexOf("?"),x=S!==-1&&S<O.indexOf("#")?"?":"#",P=O.split(x),T=/\\/g;P[0]=P[0].replace(T,"/"),O=P.join(x);var L=O;if(L=L.trim(),!C&&O.split("#").length===1){var M=i.exec(L);if(M)return this.path=L,this.href=L,this.pathname=M[1],M[2]?(this.search=M[2],k?this.query=m.parse(this.search.substr(1)):this.query=this.search.substr(1)):k&&(this.search="",this.query={}),this}var U=r.exec(L);if(U){U=U[0];var $=U.toLowerCase();this.protocol=$,L=L.substr(U.length)}if(C||U||L.match(/^\/\/[^@/]+@[^@/]+/)){var Z=L.substr(0,2)==="//";Z&&!(U&&E[U])&&(L=L.substr(2),this.slashes=!0)}if(!E[U]&&(Z||U&&!y[U])){for(var z=-1,N=0;N<f.length;N++){var H=L.indexOf(f[N]);H!==-1&&(z===-1||H<z)&&(z=H)}var R,F;z===-1?F=L.lastIndexOf("@"):F=L.lastIndexOf("@",z),F!==-1&&(R=L.slice(0,F),L=L.slice(F+1),this.auth=decodeURIComponent(R)),z=-1;for(var N=0;N<u.length;N++){var H=L.indexOf(u[N]);H!==-1&&(z===-1||H<z)&&(z=H)}z===-1&&(z=L.length),this.host=L.slice(0,z),L=L.slice(z),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var D=this.hostname.split(/\./),N=0,V=D.length;N<V;N++){var Y=D[N];if(Y&&!Y.match(w)){for(var q="",G=0,K=Y.length;G<K;G++)Y.charCodeAt(G)>127?q+="x":q+=Y[G];if(!q.match(w)){var X=D.slice(0,N),Q=D.slice(N+1),ee=Y.match(b);ee&&(X.push(ee[1]),Q.unshift(ee[2])),Q.length&&(L="/"+Q.join(".")+L),this.hostname=X.join(".");break}}}this.hostname.length>v?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=e.toASCII(this.hostname));var te=this.port?":"+this.port:"",ae=this.hostname||"";this.host=ae+te,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),L[0]!=="/"&&(L="/"+L))}if(!h[$])for(var N=0,V=l.length;N<V;N++){var oe=l[N];if(L.indexOf(oe)!==-1){var se=encodeURIComponent(oe);se===oe&&(se=escape(oe)),L=L.split(oe).join(se)}}var ke=L.indexOf("#");ke!==-1&&(this.hash=L.substr(ke),L=L.slice(0,ke));var Fe=L.indexOf("?");if(Fe!==-1?(this.search=L.substr(Fe),this.query=L.substr(Fe+1),k&&(this.query=m.parse(this.query)),L=L.slice(0,Fe)):k&&(this.search="",this.query={}),L&&(this.pathname=L),y[$]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var te=this.pathname||"",fe=this.search||"";this.path=te+fe}return this.href=this.format(),this};function g(O){return typeof O=="string"&&(O=p(O)),O instanceof t?O.format():t.prototype.format.call(O)}t.prototype.format=function(){var O=this.auth||"";O&&(O=encodeURIComponent(O),O=O.replace(/%3A/i,":"),O+="@");var k=this.protocol||"",C=this.pathname||"",S=this.hash||"",x=!1,P="";this.host?x=O+this.host:this.hostname&&(x=O+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(x+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(P=m.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var T=this.search||P&&"?"+P||"";return k&&k.substr(-1)!==":"&&(k+=":"),this.slashes||(!k||y[k])&&x!==!1?(x="//"+(x||""),C&&C.charAt(0)!=="/"&&(C="/"+C)):x||(x=""),S&&S.charAt(0)!=="#"&&(S="#"+S),T&&T.charAt(0)!=="?"&&(T="?"+T),C=C.replace(/[?#]/g,function(L){return encodeURIComponent(L)}),T=T.replace("#","%23"),k+x+C+T+S};function d(O,k){return p(O,!1,!0).resolve(k)}t.prototype.resolve=function(O){return this.resolveObject(p(O,!1,!0)).format()};function _(O,k){return O?p(O,!1,!0).resolveObject(k):k}return t.prototype.resolveObject=function(O){if(typeof O=="string"){var k=new t;k.parse(O,!1,!0),O=k}for(var C=new t,S=Object.keys(this),x=0;x<S.length;x++){var P=S[x];C[P]=this[P]}if(C.hash=O.hash,O.href==="")return C.href=C.format(),C;if(O.slashes&&!O.protocol){for(var T=Object.keys(O),L=0;L<T.length;L++){var M=T[L];M!=="protocol"&&(C[M]=O[M])}return y[C.protocol]&&C.hostname&&!C.pathname&&(C.pathname="/",C.path=C.pathname),C.href=C.format(),C}if(O.protocol&&O.protocol!==C.protocol){if(!y[O.protocol]){for(var U=Object.keys(O),$=0;$<U.length;$++){var Z=U[$];C[Z]=O[Z]}return C.href=C.format(),C}if(C.protocol=O.protocol,!O.host&&!E[O.protocol]){for(var V=(O.pathname||"").split("/");V.length&&!(O.host=V.shift()););O.host||(O.host=""),O.hostname||(O.hostname=""),V[0]!==""&&V.unshift(""),V.length<2&&V.unshift(""),C.pathname=V.join("/")}else C.pathname=O.pathname;if(C.search=O.search,C.query=O.query,C.host=O.host||"",C.auth=O.auth,C.hostname=O.hostname||O.host,C.port=O.port,C.pathname||C.search){var z=C.pathname||"",N=C.search||"";C.path=z+N}return C.slashes=C.slashes||O.slashes,C.href=C.format(),C}var H=C.pathname&&C.pathname.charAt(0)==="/",R=O.host||O.pathname&&O.pathname.charAt(0)==="/",F=R||H||C.host&&O.pathname,B=F,D=C.pathname&&C.pathname.split("/")||[],V=O.pathname&&O.pathname.split("/")||[],Y=C.protocol&&!y[C.protocol];if(Y&&(C.hostname="",C.port=null,C.host&&(D[0]===""?D[0]=C.host:D.unshift(C.host)),C.host="",O.protocol&&(O.hostname=null,O.port=null,O.host&&(V[0]===""?V[0]=O.host:V.unshift(O.host)),O.host=null),F=F&&(V[0]===""||D[0]==="")),R)C.host=O.host||O.host===""?O.host:C.host,C.hostname=O.hostname||O.hostname===""?O.hostname:C.hostname,C.search=O.search,C.query=O.query,D=V;else if(V.length)D||(D=[]),D.pop(),D=D.concat(V),C.search=O.search,C.query=O.query;else if(O.search!=null){if(Y){C.host=D.shift(),C.hostname=C.host;var q=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;q&&(C.auth=q.shift(),C.hostname=q.shift(),C.host=C.hostname)}return C.search=O.search,C.query=O.query,(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.href=C.format(),C}if(!D.length)return C.pathname=null,C.search?C.path="/"+C.search:C.path=null,C.href=C.format(),C;for(var G=D.slice(-1)[0],K=(C.host||O.host||D.length>1)&&(G==="."||G==="..")||G==="",X=0,Q=D.length;Q>=0;Q--)G=D[Q],G==="."?D.splice(Q,1):G===".."?(D.splice(Q,1),X++):X&&(D.splice(Q,1),X--);if(!F&&!B)for(;X--;X)D.unshift("..");F&&D[0]!==""&&(!D[0]||D[0].charAt(0)!=="/")&&D.unshift(""),K&&D.join("/").substr(-1)!=="/"&&D.push("");var ee=D[0]===""||D[0]&&D[0].charAt(0)==="/";if(Y){C.hostname=ee?"":D.length?D.shift():"",C.host=C.hostname;var q=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;q&&(C.auth=q.shift(),C.hostname=q.shift(),C.host=C.hostname)}return F=F||C.host&&D.length,F&&!ee&&D.unshift(""),D.length>0?C.pathname=D.join("/"):(C.pathname=null,C.path=null),(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.auth=O.auth||C.auth,C.slashes=C.slashes||O.slashes,C.href=C.format(),C},t.prototype.parseHost=function(){var O=this.host,k=n.exec(O);k&&(k=k[0],k!==":"&&(this.port=k.substr(1)),O=O.substr(0,O.length-k.length)),O&&(this.hostname=O)},ul.parse=p,ul.resolve=d,ul.resolveObject=_,ul.format=g,ul.Url=t,ul}var Zg={exports:{}},b_;function qD(){return b_||(b_=1,function(e){(function(t,r){e.exports?e.exports=r():t.xmlserializer=r()})(we,function(){var t=function(h){return h.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(h){return h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},n=function(h){return h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},i=function(h){var E=h.value;return" "+h.name+'="'+r(E)+'"'},a=function(h){var E=h.tagName;return h.namespaceURI==="http://www.w3.org/1999/xhtml"&&(E=E.toLowerCase()),E},o=function(h,E){var y=Array.prototype.map.call(h.attributes||h.attrs,function(m){return m.name}).indexOf("xmlns")>=0;return!y&&(E||h.namespaceURI!==h.parentNode.namespaceURI)?' xmlns="'+h.namespaceURI+'"':""},l=function(h){return Array.prototype.map.call(h.childNodes,function(E){return b(E)}).join("")},u=function(h,E){var y="<"+a(h);return y+=o(h,E),Array.prototype.forEach.call(h.attributes||h.attrs,function(m){y+=i(m)}),h.childNodes.length>0?(y+=">",y+=l(h),y+="</"+a(h)+">"):y+="/>",y},f=function(h){var E=h.nodeValue||h.value||"";return n(E)},v=function(h){return"<!--"+h.data.replace(/-/g,"&#45;")+"-->"},w=function(h){return"<![CDATA["+h.nodeValue+"]]>"},b=function(h,E){var y=E&&E.rootNode;if(h.nodeName==="#document"||h.nodeName==="#document-fragment")return l(h);if(h.tagName)return u(h,y);if(h.nodeName==="#text")return f(h);if(h.nodeName==="#comment")return v(h);if(h.nodeName==="#cdata-section")return w(h)};return{serializeToString:function(h){return t(b(h,{rootNode:!0}))}}})}(Zg)),Zg.exports}var Qg={},__;function WD(){if(__)return Qg;__=1;var e=function(a){var o=new XMLSerializer;return Array.prototype.map.call(a.childNodes,function(l){return o.serializeToString(l)}).join("")},t=function(a){if(a.documentElement.tagName==="parsererror"&&a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return a.documentElement;if((a.documentElement.tagName==="xml"||a.documentElement.tagName==="html")&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0];if(a.documentElement.tagName==="html"&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="body"&&a.documentElement.childNodes[0].childNodes&&a.documentElement.childNodes[0].childNodes.length&&a.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0].childNodes[0]},r=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
147
+ ?</div>`),new RegExp(`^(.+)
148
+ `)],n=function(a){var o=e(a),l,u;for(l=0;l<r.length;l++)if(u=r[l].exec(o),u)return u[1]},i=function(a){var o;if(a===null)throw new Error("Parse error");var l=t(a);if(l!==void 0)throw o=n(l)||"Parse error",new Error(o)};return Qg.failOnParseError=function(a){return i(a),a},Qg}var Jg={},ev={},w_;function b0(){return w_||(w_=1,function(e){var t=wS();e.getDocumentBaseUrl=function(l){return l.baseURI!=="about:blank"?l.baseURI:null},e.clone=function(l){var u={},f;for(f in l)l.hasOwnProperty(f)&&(u[f]=l[f]);return u},e.cloneArray=function(l){return Array.prototype.slice.apply(l,[0])},e.joinUrl=function(l,u){return l?t.resolve(l,u):u},e.isDataUri=function(l){return/^data:/.test(l)},e.collectAndReportErrors=function(l){var u=[];return Promise.all(l.map(function(f){return f.catch(function(v){u.push(v)})})).then(function(){return u})};var r=null,n=function(l,u){return u===!1||u==="none"||u==="repeated"?((r===null||u!=="repeated")&&(r=Date.now()),l+"?_="+r):l};e.ajax=function(l,u){return new Promise(function(f,v){var w=new window.XMLHttpRequest,b=e.joinUrl(u.baseUrl,l),h,E=function(){v({msg:"Unable to load url",url:b})};h=n(b,u.cache),w.addEventListener("load",function(){w.status===200||w.status===0?f(w.response):E()},!1),w.addEventListener("error",E,!1);try{w.open("GET",h,!0),w.overrideMimeType(u.mimeType),w.send(null)}catch{E()}})},e.binaryAjax=function(l,u){var f=e.clone(u);return f.mimeType="text/plain; charset=x-user-defined",e.ajax(l,f).then(function(v){for(var w="",b=0;b<v.length;b++)w+=String.fromCharCode(v.charCodeAt(b)&255);return w})};var i=function(l){var u=function(f,v){return f.substring(0,v.length)===v};return u(l,"<?xml")||u(l,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(l,u){return e.binaryAjax(l,u).then(function(f){var v=btoa(f),w=i(f);return"data:"+w+";base64,"+v})};var a=[],o=function(l){return a.indexOf(l)<0&&a.push(l),a.indexOf(l)};e.memoize=function(l,u,f){if(typeof f!="object")throw new Error("cacheBucket is not an object");return function(){var v=Array.prototype.slice.call(arguments),w=u(v),b=o(l),h;return f[b]&&f[b][w]?f[b][w]:(h=l.apply(null,v),f[b]=f[b]||{},f[b][w]=h,h)}}}(ev)),ev}var tv={},S_;function YD(){if(S_)return tv;S_=1;var e=b0(),t=function(a,o){var l=null;a.hasAttribute("src")?l=a.getAttribute("src"):a.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=a.getAttributeNS("http://www.w3.org/1999/xlink","href"):a.hasAttribute("href")&&(l=a.getAttribute("href"));var u=e.getDocumentBaseUrl(a.ownerDocument),f=e.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),e.getDataURIForImageURL(l,f).then(function(v){return v},function(v){throw{resourceType:"image",url:v.url,msg:"Unable to load image "+v.url}})},r=function(a){return a.filter(function(o){var l=null;return o.hasAttribute("src")?l=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(l=o.getAttribute("href")),l!==null&&!e.isDataUri(l)})},n=function(a){return Array.prototype.filter.call(a,function(o){return o.type==="image"})},i=function(a){return Array.prototype.slice.call(a)};return tv.inline=function(a,o){var l=i(a.getElementsByTagName("img")),u=i(a.getElementsByTagName("image")),f=n(a.getElementsByTagName("input"));l=l.concat(u),l=l.concat(f);var v=r(l);return e.collectAndReportErrors(v.map(function(w){return t(w,o).then(function(b){w.attributes.src?w.attributes.src.value=b:w.attributes["xlink:href"]?w.attributes["xlink:href"].value=b:w.attributes.href&&(w.attributes.href.value=b)})}))},tv}var rv={},E_;function KD(){if(E_)return rv;E_=1;var e=b0(),t=function(a,o){var l=a.attributes.src.value,u=e.getDocumentBaseUrl(a.ownerDocument),f=e.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),e.ajax(l,f).catch(function(v){throw{resourceType:"script",url:v.url,msg:"Unable to load script "+v.url}})},r=function(a){return a.replace(/<\//g,"<\\/")},n=function(a,o){a.attributes.removeNamedItem("src"),a.textContent=r(o)},i=function(a){var o=a.getElementsByTagName("script");return Array.prototype.filter.call(o,function(l){return!!l.attributes.src})};return rv.inline=function(a,o){var l=i(a);return e.collectAndReportErrors(l.map(function(u){return t(u,o).then(function(f){n(u,f)})}))},rv}var nv={},iv={},O_;function N2(){return O_||(O_=1,function(e){e.unquoteString=function(t){var r=/^"(.*)"$/,n=/^'(.*)'$/;return r.test(t)?t.replace(r,"$1"):n.test(t)?t.replace(n,"$1"):t},e.rulesForCssText=function(t){var r=document.implementation.createHTMLDocument(""),n=document.createElement("style"),i;return n.textContent=t,r.body.appendChild(n),i=n.sheet.cssRules,Array.prototype.slice.call(i)},e.cssRulesToText=function(t){return t.reduce(function(r,n){return r+n.cssText},"")},e.exchangeRule=function(t,r,n){var i=t.indexOf(r);t[i]=e.rulesForCssText(n)[0]},e.changeFontFaceRuleSrc=function(t,r,n){var i="@font-face { font-family: "+r.style.getPropertyValue("font-family")+"; ";r.style.getPropertyValue("font-style")&&(i+="font-style: "+r.style.getPropertyValue("font-style")+"; "),r.style.getPropertyValue("font-weight")&&(i+="font-weight: "+r.style.getPropertyValue("font-weight")+"; "),r.style.getPropertyValue("unicode-range")&&(i+="unicode-range: "+r.style.getPropertyValue("unicode-range")+"; "),i+="src: "+n+"}",e.exchangeRule(t,r,i)}}(iv)),iv}var av={},x_;function XD(){return x_||(x_=1,function(e){var t=N2(),r=function(a){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return a.replace(o,"$1")};e.extractCssUrl=function(a){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,l;if(!o.test(a))throw new Error("Invalid url");return l=o.exec(a)[1],t.unquoteString(r(l))};var n=function(a){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,l="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+l+")+",f="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",v=new RegExp(u,"g"),w,b=[],h=function(E){var y=new RegExp(l,"g"),m=[],p;for(p=y.exec(E);p;)m.push(p[1]),p=y.exec(E);return m};if(a.match(new RegExp(f))){for(w=v.exec(a);w;)b.push(h(w[0])),w=v.exec(a);return b}return[]},i=function(a){var o,l;for(o=0;o<a.length;o++)try{return l=e.extractCssUrl(a[o]),{url:l,idx:o}}catch{}};e.parse=function(a){var o=n(a);return o.map(function(l){var u=i(l);return u?{preUrl:l.slice(0,u.idx),url:u.url,postUrl:l.slice(u.idx+1)}:{preUrl:l}})},e.serialize=function(a){var o=a.map(function(l){var u=[].concat(l.preUrl);return l.url&&u.push('url("'+l.url+'")'),l.postUrl&&(u=u.concat(l.postUrl)),u.join(" ")});return o.join(", ")}}(av)),av}function Gd(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ov={exports:{}},P_;function ZD(){return P_||(P_=1,function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,a){function o(f,v){if(!i[f]){if(!n[f]){var w=typeof Gd=="function"&&Gd;if(!v&&w)return w(f,!0);if(l)return l(f,!0);var b=new Error("Cannot find module '"+f+"'");throw b.code="MODULE_NOT_FOUND",b}var h=i[f]={exports:{}};n[f][0].call(h.exports,function(E){var y=n[f][1][E];return o(y||E)},h,h.exports,r,n,i,a)}return i[f].exports}for(var l=typeof Gd=="function"&&Gd,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,f){function v(){this.constructor=u}v.prototype=f.prototype,u.prototype=new v}function o(u,f,v,w){this.message=u,this.expected=f,this.found=v,this.location=w,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,f){var v={literal:function(p){return'"'+b(p.text)+'"'},class:function(p){var g="",d;for(d=0;d<p.parts.length;d++)g+=p.parts[d]instanceof Array?h(p.parts[d][0])+"-"+h(p.parts[d][1]):h(p.parts[d]);return"["+(p.inverted?"^":"")+g+"]"},any:function(p){return"any character"},end:function(p){return"end of input"},other:function(p){return p.description}};function w(p){return p.charCodeAt(0).toString(16).toUpperCase()}function b(p){return p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+w(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+w(g)})}function h(p){return p.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+w(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+w(g)})}function E(p){return v[p.type](p)}function y(p){var g=new Array(p.length),d,_;for(d=0;d<p.length;d++)g[d]=E(p[d]);if(g.sort(),g.length>0){for(d=1,_=1;d<g.length;d++)g[d-1]!==g[d]&&(g[_]=g[d],_++);g.length=_}switch(g.length){case 1:return g[0];case 2:return g[0]+" or "+g[1];default:return g.slice(0,-1).join(", ")+", or "+g[g.length-1]}}function m(p){return p?'"'+b(p)+'"':"end of input"}return"Expected "+y(u)+" but "+m(f)+" found."};function l(u,f){f=f!==void 0?f:{};var v={},w={start:te},b=te,h="",E=function(){return[]},y=",",m=Y(",",!1),p=function(re,de){return[re].concat(de)},g=function(re){return[re]},d=function(re,de){return{url:re,format:de}},_=function(re){return{url:re}},O="url(",k=Y("url(",!1),C=")",S=Y(")",!1),x=function(re){return re},P="format(",T=Y("format(",!1),L="local(",M=Y("local(",!1),U=function(re){return{local:re}},$=/^[^)]/,Z=q([")"],!0,!1),z=function(re){return pe.extractValue(re.join(""))},N=/^[ \t\r\n\f]/,H=q([" "," ","\r",`
149
+ `,"\f"],!1,!1),R=0,F=[{line:1,column:1}],B=0,D=[],V;if("startRule"in f){if(!(f.startRule in w))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');b=w[f.startRule]}function Y(re,de){return{type:"literal",text:re,ignoreCase:de}}function q(re,de,be){return{type:"class",parts:re,inverted:de,ignoreCase:be}}function G(){return{type:"end"}}function K(re){var de=F[re],be;if(de)return de;for(be=re-1;!F[be];)be--;for(de=F[be],de={line:de.line,column:de.column};be<re;)u.charCodeAt(be)===10?(de.line++,de.column=1):de.column++,be++;return F[re]=de,de}function X(re,de){var be=K(re),ye=K(de);return{start:{offset:re,line:be.line,column:be.column},end:{offset:de,line:ye.line,column:ye.column}}}function Q(re){R<B||(R>B&&(B=R,D=[]),D.push(re))}function ee(re,de,be){return new o(o.buildMessage(re,de),re,de,be)}function te(){var re,de;return re=ae(),re===v&&(re=R,de=h,de!==v&&(de=E()),re=de),re}function ae(){var re,de,be,ye,Ie,Ee;if(re=R,de=oe(),de!==v){for(be=[],ye=ge();ye!==v;)be.push(ye),ye=ge();if(be!==v)if(u.charCodeAt(R)===44?(ye=y,R++):(ye=v,Q(m)),ye!==v){for(Ie=[],Ee=ge();Ee!==v;)Ie.push(Ee),Ee=ge();Ie!==v?(Ee=ae(),Ee!==v?(de=p(de,Ee),re=de):(R=re,re=v)):(R=re,re=v)}else R=re,re=v;else R=re,re=v}else R=re,re=v;return re===v&&(re=R,de=oe(),de!==v&&(de=g(de)),re=de),re}function oe(){var re;return re=se(),re===v&&(re=fe()),re}function se(){var re,de,be,ye;if(re=R,de=ke(),de!==v){if(be=[],ye=ge(),ye!==v)for(;ye!==v;)be.push(ye),ye=ge();else be=v;be!==v?(ye=Fe(),ye!==v?(de=d(de,ye),re=de):(R=re,re=v)):(R=re,re=v)}else R=re,re=v;return re===v&&(re=R,de=ke(),de!==v&&(de=_(de)),re=de),re}function ke(){var re,de,be,ye;return re=R,u.substr(R,4)===O?(de=O,R+=4):(de=v,Q(k)),de!==v?(be=ie(),be!==v?(u.charCodeAt(R)===41?(ye=C,R++):(ye=v,Q(S)),ye!==v?(de=x(be),re=de):(R=re,re=v)):(R=re,re=v)):(R=re,re=v),re}function Fe(){var re,de,be,ye;return re=R,u.substr(R,7)===P?(de=P,R+=7):(de=v,Q(T)),de!==v?(be=ie(),be!==v?(u.charCodeAt(R)===41?(ye=C,R++):(ye=v,Q(S)),ye!==v?(de=x(be),re=de):(R=re,re=v)):(R=re,re=v)):(R=re,re=v),re}function fe(){var re,de,be,ye;return re=R,u.substr(R,6)===L?(de=L,R+=6):(de=v,Q(M)),de!==v?(be=ie(),be!==v?(u.charCodeAt(R)===41?(ye=C,R++):(ye=v,Q(S)),ye!==v?(de=U(be),re=de):(R=re,re=v)):(R=re,re=v)):(R=re,re=v),re}function ie(){var re,de,be;if(re=R,de=[],$.test(u.charAt(R))?(be=u.charAt(R),R++):(be=v,Q(Z)),be!==v)for(;be!==v;)de.push(be),$.test(u.charAt(R))?(be=u.charAt(R),R++):(be=v,Q(Z));else de=v;return de!==v&&(de=z(de)),re=de,re}function ge(){var re;return N.test(u.charAt(R))?(re=u.charAt(R),R++):(re=v,Q(H)),re}var pe=r("../util");if(V=b(),V!==v&&R===u.length)return V;throw V!==v&&R<u.length&&Q(G()),ee(D,B<u.length?u.charAt(B):null,B<u.length?X(B,B+1):X(B,B))}n.exports={SyntaxError:o,parse:l}},{"../util":3}],2:[function(r,n,i){var a=r("./grammar");i.SyntaxError=function(o,l){this.message=o,this.offset=l},i.parse=function(o){try{return a.parse(o)}catch(l){throw new i.SyntaxError(l.message,l.offset)}},i.serialize=function(o){return o.map(function(l){var u;return l.url?(u='url("'+l.url+'")',l.format&&(u+=' format("'+l.format+'")')):u='local("'+l.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(r,n,i){var a=function(l){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return l.replace(u,"$1")},o=function(l){var u=/^"(.*)"$/,f=/^'(.*)'$/;return u.test(l)?l.replace(u,"$1"):f.test(l)?l.replace(f,"$1"):l};i.extractValue=function(l){return o(a(l))}},{}]},{},[2])(2)})}(ov)),ov.exports}var C_;function QD(){return C_||(C_=1,function(e){var t=b0(),r=N2(),n=XD(),i=ZD(),a=function(g,d,_){g.style.setProperty(d,_,g.style.getPropertyPriority(d))},o=function(g){return g.filter(function(d){return d.type===window.CSSRule.STYLE_RULE&&(d.style.getPropertyValue("background-image")||d.style.getPropertyValue("background"))})},l=function(g){var d=[];return g.forEach(function(_){_.style.getPropertyValue("background-image")?d.push({property:"background-image",value:_.style.getPropertyValue("background-image"),rule:_}):_.style.getPropertyValue("background")&&d.push({property:"background",value:_.style.getPropertyValue("background"),rule:_})}),d},u=function(g){return g.filter(function(d){return d.type===window.CSSRule.FONT_FACE_RULE&&d.style.getPropertyValue("src")})},f=function(g){return g.filter(function(d){return d.type===window.CSSRule.IMPORT_RULE&&d.href})},v=function(g){var d=[];return g.forEach(function(_,O){_.url&&!t.isDataUri(_.url)&&d.push(O)}),d},w=function(g){var d=[];return g.forEach(function(_,O){_.url&&!t.isDataUri(_.url)&&d.push(O)}),d};e.adjustPathsOfCssResources=function(g,d){var _=o(d),O=l(_),k=!1;return O.forEach(function(C){var S=n.parse(C.value),x=v(S),P;x.length>0&&(x.forEach(function(T){var L=S[T].url,M=t.joinUrl(g,L);S[T].url=M}),P=n.serialize(S),a(C.rule,C.property,P),k=!0)}),u(d).forEach(function(C){var S=C.style.getPropertyValue("src"),x,P;try{x=i.parse(S)}catch{return}P=w(x),P.length>0&&(P.forEach(function(T){var L=x[T].url,M=t.joinUrl(g,L);x[T].url=M}),r.changeFontFaceRuleSrc(d,C,i.serialize(x)),k=!0)}),f(d).forEach(function(C){var S=C.href,x=t.joinUrl(g,S);r.exchangeRule(d,C,"@import url("+x+");"),k=!0}),k};var b=function(g,d,_){var O=g.indexOf(d);g.splice(O,1),_.forEach(function(k,C){g.splice(O+C,0,k)})},h=function(g,d,_,O){var k=d.href,C;return k=r.unquoteString(k),C=t.joinUrl(O.baseUrl,k),_.indexOf(C)>=0?(b(g,d,[]),Promise.resolve([])):(_.push(C),t.ajax(k,O).then(function(S){var x=r.rulesForCssText(S);return e.loadCSSImportsForRules(x,_,O).then(function(P){return e.adjustPathsOfCssResources(k,x),b(g,d,x),P.errors})},function(S){throw{resourceType:"stylesheet",url:S.url,msg:"Unable to load stylesheet "+S.url}}))};e.loadCSSImportsForRules=function(g,d,_){var O=f(g),k=[],C=!1;return Promise.all(O.map(function(S){return h(g,S,d,_).then(function(x){k=k.concat(x),C=!0},function(x){k.push(x)})})).then(function(){return{hasChanges:C,errors:k}})};var E=function(g,d){var _=n.parse(g),O=v(_),k=!1;return t.collectAndReportErrors(O.map(function(C){var S=_[C].url;return t.getDataURIForImageURL(S,d).then(function(x){_[C].url=x,k=!0},function(x){throw{resourceType:"backgroundImage",url:x.url,msg:"Unable to load background-image "+x.url}})})).then(function(C){return{backgroundValue:n.serialize(_),hasChanges:k,errors:C}})},y=function(g,d){var _=o(g),O=l(_),k=[],C=!1;return Promise.all(O.map(function(S){return E(S.value,d).then(function(x){x.hasChanges&&(a(S.rule,S.property,x.backgroundValue),C=!0),k=k.concat(x.errors)})})).then(function(){return{hasChanges:C,errors:k}})},m=function(g,d){var _=!1,O,k;try{O=i.parse(g)}catch{O=[]}return k=w(O),t.collectAndReportErrors(k.map(function(C){var S=O[C],x=S.format||"woff";return t.binaryAjax(S.url,d).then(function(P){var T=btoa(P);S.url="data:font/"+x+";base64,"+T,_=!0},function(P){throw{resourceType:"fontFace",url:P.url,msg:"Unable to load font-face "+P.url}})})).then(function(C){return{srcDeclarationValue:i.serialize(O),hasChanges:_,errors:C}})},p=function(g,d){var _=u(g),O=[],k=!1;return Promise.all(_.map(function(C){var S=C.style.getPropertyValue("src");return m(S,d).then(function(x){x.hasChanges&&(r.changeFontFaceRuleSrc(g,C,x.srcDeclarationValue),k=!0),O=O.concat(x.errors)})})).then(function(){return{hasChanges:k,errors:O}})};e.loadAndInlineCSSResourcesForRules=function(g,d){var _=!1,O=[];return Promise.all([y,p].map(function(k){return k(g,d).then(function(C){_=_||C.hasChanges,O=O.concat(C.errors)})})).then(function(){return{hasChanges:_,errors:O}})}}(nv)),nv}var T_;function JD(){return T_||(T_=1,function(e){var t=b0(),r=YD(),n=KD(),i=QD(),a=N2(),o=function(m){return t.joinUrl(m,".")},l=function(m){var p=m.map(function(g,d){return d===m.length-1&&(g={baseUrl:o(g.baseUrl)}),JSON.stringify(g)});return p},u=function(m,p){return p.cache!==!1&&p.cache!=="none"&&p.cacheBucket?t.memoize(m,l,p.cacheBucket):m},f=function(m,p,g){var d=a.rulesForCssText(m);return i.loadCSSImportsForRules(d,p,g).then(function(_){return i.loadAndInlineCSSResourcesForRules(d,g).then(function(O){var k=_.errors.concat(O.errors),C=_.hasChanges||O.hasChanges;return C&&(m=a.cssRulesToText(d)),{hasChanges:C,content:m,errors:k}})})},v=function(m,p,g){var d=m.textContent,_=u(f,p);return _(d,g,p).then(function(O){return O.hasChanges&&(m.childNodes[0].nodeValue=O.content),t.cloneArray(O.errors)})},w=function(m){var p=m.getElementsByTagName("style");return Array.prototype.filter.call(p,function(g){return!g.attributes.type||g.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(m,p){var g=w(m),d=[],_=[],O;return O=t.clone(p),O.baseUrl=O.baseUrl||t.getDocumentBaseUrl(m),Promise.all(g.map(function(k){return v(k,O,_).then(function(C){d=d.concat(C)})})).then(function(){return d})};var b=function(m,p){var g=m.parentNode,d;p=p.trim(),p&&(d=m.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(m.ownerDocument.createTextNode(p)),g.insertBefore(d,m)),g.removeChild(m)},h=function(m,p){return t.ajax(m,p).then(function(g){var d=a.rulesForCssText(g);return{content:g,cssRules:d}}).then(function(g){var d=i.adjustPathsOfCssResources(m,g.cssRules);return{content:g.content,cssRules:g.cssRules,hasChanges:d}}).then(function(g){return i.loadCSSImportsForRules(g.cssRules,[],p).then(function(d){return{content:g.content,cssRules:g.cssRules,hasChanges:g.hasChanges||d.hasChanges,errors:d.errors}})}).then(function(g){return i.loadAndInlineCSSResourcesForRules(g.cssRules,p).then(function(d){return{content:g.content,cssRules:g.cssRules,hasChanges:g.hasChanges||d.hasChanges,errors:g.errors.concat(d.errors)}})}).then(function(g){var d=g.content;return g.hasChanges&&(d=a.cssRulesToText(g.cssRules)),{content:d,errors:g.errors}})},E=function(m,p){var g=m.attributes.href.value,d=t.getDocumentBaseUrl(m.ownerDocument),_=t.clone(p);!_.baseUrl&&d&&(_.baseUrl=d);var O=u(h,p);return O(g,_).then(function(k){return{content:k.content,errors:t.cloneArray(k.errors)}})},y=function(m){var p=m.getElementsByTagName("link");return Array.prototype.filter.call(p,function(g){return g.attributes.rel&&g.attributes.rel.value==="stylesheet"&&(!g.attributes.type||g.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(m,p){var g=y(m),d=[];return Promise.all(g.map(function(_){return E(_,p).then(function(O){b(_,O.content+`
150
+ `),d=d.concat(O.errors)},function(O){d.push({resourceType:"stylesheet",url:O.url,msg:"Unable to load stylesheet "+O.url})})})).then(function(){return d})},e.loadAndInlineImages=r.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(m,p){var g=[],d=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return p.inlineScripts!==!1&&d.push(e.loadAndInlineScript),Promise.all(d.map(function(_){return _(m,p).then(function(O){g=g.concat(O)})})).then(function(){return g})}}(Jg)),Jg}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
151
+ * http://www.github.com/cburgmer/rasterizeHTML.js
152
+ * Copyright (c) 2022 Christoph Burgmer; Licensed MIT */(function(e){(function(t,r){t===void 0&&window!==void 0&&(t=window),e.exports?e.exports=r(wS(),qD(),WD(),JD()):t.rasterizeHTML=r(t.url,t.xmlserializer,t.sanedomparsererror,t.inlineresources)})(we,function(t,r,n,i){var a=function(E){var y={},m=[];y.joinUrl=function(d,_){return d?E.resolve(d,_):_},y.getConstantUniqueIdFor=function(d){return m.indexOf(d)<0&&m.push(d),m.indexOf(d)},y.clone=function(d){var _={},O;for(O in d)d.hasOwnProperty(O)&&(_[O]=d[O]);return _};var p=function(d){return typeof d=="object"&&d!==null},g=function(d){return p(d)&&Object.prototype.toString.apply(d).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return y.parseOptionalParameters=function(d){var _={canvas:null,options:{}};return d[0]==null||g(d[0])?(_.canvas=d[0]||null,_.options=y.clone(d[1])):_.options=y.clone(d[0]),_},y}(t),o=function(E){var y={},m=function(p,g,d){var _=p[g];return p[g]=function(){var O=Array.prototype.slice.call(arguments);return d.apply(this,[O,_])},_};return y.baseUrlRespectingXhr=function(p,g){var d=function(){var _=new p;return m(_,"open",function(O,k){var C=O.shift(),S=O.shift(),x=E.joinUrl(g,S);return k.apply(this,[C,x].concat(O))}),_};return d},y.finishNotifyingXhr=function(p){var g=0,d=0,_=!1,O,k=new Promise(function(S){O=function(){var x=g-d;x<=0&&_&&S({totalCount:g})}}),C=function(){var S=new p;return m(S,"send",function(x,P){return g+=1,P.apply(this,arguments)}),S.addEventListener("load",function(){d+=1,O()}),S};return C.waitForRequestsToFinish=function(){return _=!0,O(),k},C},y}(a),l=function(){var E={},y=function(C){return Array.prototype.slice.call(C)};E.addClassName=function(C,S){C.className+=" "+S},E.addClassNameRecursively=function(C,S){E.addClassName(C,S),C.parentNode!==C.ownerDocument&&E.addClassNameRecursively(C.parentNode,S)};var m=function(C,S){var x=C.parentStyleSheet,P=y(x.cssRules).indexOf(C);x.insertRule(S,P+1),x.deleteRule(P)},p=function(C,S){var x=C.cssText.replace(/^[^\{]+/,""),P=S+" "+x;m(C,P)},g=function(C){return y(C).reduce(function(S,x){return S+x.cssText},"")},d=function(C){C.textContent=g(C.sheet.cssRules)},_=function(C){var S=document.implementation.createHTMLDocument(""),x=document.createElement("style");x.textContent=C.textContent,S.body.appendChild(x),C.sheet=x.sheet},O=function(C){return"((?:^|[^.#:\\w])|(?=\\W))("+C.join("|")+")(?=\\W|$)"},k=function(C,S,x){var P=O(S);y(C.querySelectorAll("style")).forEach(function(T){typeof T.sheet>"u"&&_(T);var L=y(T.sheet.cssRules).filter(function(M){return M.selectorText&&new RegExp(P,"i").test(M.selectorText)});L.length&&(L.forEach(function(M){var U=M.selectorText.replace(new RegExp(P,"gi"),function($,Z,z){return Z+x(z)});U!==M.selectorText&&p(M,U)}),d(T))})};return E.rewriteCssSelectorWith=function(C,S,x){k(C,[S],function(){return x})},E.lowercaseCssTypeSelectors=function(C,S){k(C,S,function(x){return x.toLowerCase()})},E.findHtmlOnlyNodeNames=function(C){var S=C.ownerDocument.createTreeWalker(C,NodeFilter.SHOW_ELEMENT),x={},P={},T;do T=S.currentNode.tagName.toLowerCase(),S.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?x[T]=!0:P[T]=!0;while(S.nextNode());return Object.keys(x).filter(function(L){return!P[L]})},E}(),u=function(E){var y={},m=function(g){return Array.prototype.slice.call(g)},p={active:!0,hover:!0,focus:!1,target:!1};return y.fakeUserAction=function(g,d,_){var O=g.querySelector(d),k=":"+_,C="rasterizehtml"+_;O&&(p[_]?E.addClassNameRecursively(O,C):E.addClassName(O,C),E.rewriteCssSelectorWith(g,k,"."+C))},y.persistInputValues=function(g){var d=g.querySelectorAll("input"),_=g.querySelectorAll("textarea"),O=function(k){return k.type==="checkbox"||k.type==="radio"};m(d).filter(O).forEach(function(k){k.checked?k.setAttribute("checked",""):k.removeAttribute("checked")}),m(d).filter(function(k){return!O(k)}).forEach(function(k){k.setAttribute("value",k.value)}),m(_).forEach(function(k){k.textContent=k.value})},y.rewriteTagNameSelectorsToLowerCase=function(g){E.lowercaseCssTypeSelectors(g,E.findHtmlOnlyNodeNames(g))},y}(l),f=function(E,y,m,p){var g={},d=function(z,N,H,R){var F=z.createElement(N);return F.style.visibility="hidden",F.style.width=H+"px",F.style.height=R+"px",F.style.position="absolute",F.style.top=-1e4-R+"px",F.style.left=-1e4-H+"px",z.getElementsByTagName("body")[0].appendChild(F),F},_=function(z){return z>0?new Promise(function(N){setTimeout(N,z)}):Promise.resolve()};g.executeJavascript=function(z,N){return new Promise(function(H){var R=d(p.document,"iframe",N.width,N.height),F=z.outerHTML,B=[],D=N.executeJsTimeout||0,V=function(){p.document.getElementsByTagName("body")[0].removeChild(R)},Y=function(){var X=R.contentDocument;H({document:X,errors:B,cleanUp:V})},q=R.contentWindow.XMLHttpRequest,G=y.finishNotifyingXhr(q),K=y.baseUrlRespectingXhr(G,N.baseUrl);R.onload=function(){_(D).then(G.waitForRequestsToFinish).then(Y)},R.contentDocument.open(),R.contentWindow.XMLHttpRequest=K,R.contentWindow.onerror=function(X){B.push({resourceType:"scriptExecution",msg:X})},R.contentDocument.write("<!DOCTYPE html>"),R.contentDocument.write(F),R.contentDocument.close()})};var O=function(z,N,H){var R=z.createElement("iframe");return R.style.width=N+"px",R.style.height=H+"px",R.style.visibility="hidden",R.style.position="absolute",R.style.top=-1e4-H+"px",R.style.left=-1e4-N+"px",R.style.borderWidth=0,R.sandbox="allow-same-origin",R.scrolling="no",R},k=function(z,N,H){var R=Math.floor(z/H),F=Math.floor(N/H);return O(p.document,R,F)},C=function(z,N,H,R){return{width:Math.max(z.width*R,N),height:Math.max(z.height*R,H)}},S=function(z,N){var H=z.querySelector(N);if(H)return H;if(z.ownerDocument.querySelector(N)===z)return z;throw{message:"Clipping selector not found"}},x=function(z,N,H,R,F){var B=Math.max(z.scrollWidth,z.clientWidth),D=Math.max(z.scrollHeight,z.clientHeight),V,Y,q,G,K,X,Q,ee;return N?(X=S(z,N),Q=X.getBoundingClientRect(),V=Q.top,Y=Q.left,q=Q.width,G=Q.height):(V=0,Y=0,q=B,G=D),ee=C({width:q,height:G},H,R,F),K=p.getComputedStyle(z.ownerDocument.documentElement).fontSize,{left:Y,top:V,width:ee.width,height:ee.height,viewportWidth:B,viewportHeight:D,rootFontSize:K}},P=function(z,N){var H=z.tagName;return N.querySelector(H)},T=function(z){var N=z.tagName.toLowerCase();return N==="html"||N==="body"?z.outerHTML:'<body style="margin: 0;">'+z.outerHTML+"</body>"};g.calculateDocumentContentSize=function(z,N){return new Promise(function(H,R){var F=N.zoom||1,B;B=k(N.width,N.height,F),p.document.getElementsByTagName("body")[0].appendChild(B),B.onload=function(){var D=B.contentDocument,V;try{V=x(P(z,D),N.clip,N.width,N.height,F),H(V)}catch(Y){R(Y)}finally{p.document.getElementsByTagName("body")[0].removeChild(B)}},B.contentDocument.open(),B.contentDocument.write("<!DOCTYPE html>"),B.contentDocument.write(T(z)),B.contentDocument.close()})},g.parseHtmlFragment=function(z){var N=p.document.implementation.createHTMLDocument("");N.documentElement.innerHTML=z;var H=N.querySelector("body").firstChild;if(!H)throw"Invalid source";return H};var L=function(z,N){var H=/<html((?:\s+[^>]*)?)>/im.exec(N),R=p.document.implementation.createHTMLDocument(""),F,B,D,V;if(H)for(F="<div"+H[1]+"></div>",R.documentElement.innerHTML=F,D=R.querySelector("div"),B=0;B<D.attributes.length;B++)V=D.attributes[B],z.documentElement.setAttribute(V.name,V.value)};g.parseHTML=function(z){var N=p.document.implementation.createHTMLDocument("");return N.documentElement.innerHTML=z,L(N,z),N};var M=function(z){try{return m.failOnParseError(z)}catch(N){throw{message:"Invalid source",originalError:N}}};g.validateXHTML=function(z){var N=new DOMParser,H=N.parseFromString(z,"application/xml");M(H)};var U=null,$=function(z,N){return N==="none"||N==="repeated"?((U===null||N!=="repeated")&&(U=Date.now()),z+"?_="+U):z},Z=function(z,N){return new Promise(function(H,R){var F=new window.XMLHttpRequest,B=E.joinUrl(N.baseUrl,z),D=$(B,N.cache),V=function(Y){R({message:"Unable to load page",originalError:Y})};F.addEventListener("load",function(){F.status===200||F.status===0?H(F.responseXML):V(F.statusText)},!1),F.addEventListener("error",function(Y){V(Y)},!1);try{F.open("GET",D,!0),F.responseType="document",F.send(null)}catch(Y){V(Y)}})};return g.loadDocument=function(z,N){return Z(z,N).then(function(H){return M(H)})},g}(a,o,n,window),v=function(E){var y={},m=function(P,T){return T?URL.createObjectURL(new Blob([P],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(P)},p=function(P){P instanceof Blob&&URL.revokeObjectURL(P)},g='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',d=function(P){return new Promise(function(T,L){var M=document.createElement("canvas"),U=new Image;U.onload=function(){var $=M.getContext("2d");try{$.drawImage(U,0,0),M.toDataURL("image/png"),T(!0)}catch{T(!1)}},U.onerror=L,U.src=P})},_=function(){var P=m(g,!0);return d(P).then(function(T){return p(P),T?!1:d(m(g,!1)).then(function(L){return L})},function(){return!1})},O=function(){if(E.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},k=function(){return new Promise(function(P,T){O()&&E.URL?_().then(function(L){P(!L)},function(){T()}):P(!1)})},C,S=function(){return C===void 0&&(C=k()),C},x=function(P){return S().then(function(T){return m(P,T)})};return y.renderSvg=function(P){return new Promise(function(T,L){var M,U,$=function(){U.onload=null,U.onerror=null},Z=function(){M&&p(M)};U=new Image,U.onload=function(){$(),Z(),T(U)},U.onerror=function(){Z(),L()},x(P).then(function(z){M=z,U.src=M},L)})},y}(window),w=function(E,y,m,p){var g={},d=function(P,T){var L=T||1,M={width:P.width,height:P.height,"font-size":P.rootFontSize};return L!==1&&(M.style="transform:scale("+L+"); transform-origin: 0 0;"),M},_=function(P){var T,L,M,U;T=Math.round(P.viewportWidth),L=Math.round(P.viewportHeight),M=-P.left,U=-P.top;var $={x:M,y:U,width:T,height:L};return $},O=function(P){var T=P.style||"";P.style=T+"float: left;"},k=function(P){P.externalResourcesRequired=!0},C=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},S=function(P){var T=Object.keys(P);return T.length?" "+T.map(function(L){return L+'="'+P[L]+'"'}).join(" "):""},x=function(P,T,L){var M=p.serializeToString(P);y.validateXHTML(M);var U=_(T);return O(U),k(U),'<svg xmlns="http://www.w3.org/2000/svg"'+S(d(T,L))+">"+C()+"<foreignObject"+S(U)+">"+M+"</foreignObject></svg>"};return g.getSvgForDocument=function(P,T,L){return m.rewriteTagNameSelectorsToLowerCase(P),x(P,T,L)},g.drawDocumentAsSvg=function(P,T){return["hover","active","focus","target"].forEach(function(L){T[L]&&m.fakeUserAction(P,T[L],L)}),y.calculateDocumentContentSize(P,T).then(function(L){return g.getSvgForDocument(P,L,T.zoom)})},g}(a,f,u,r),b=function(E,y,m,p,g,d){var _={},O=function(P){return{message:"Error rendering page",originalError:P}},k=function(P){return g.renderSvg(P).then(function(T){return{image:T,svg:P}},function(T){throw O(T)})},C=function(P,T){try{T.getContext("2d").drawImage(P,0,0)}catch(L){throw O(L)}},S=function(P,T,L){return p.drawDocumentAsSvg(P,L).then(k).then(function(M){return T&&C(M.image,T),M})},x=function(P,T){return y.executeJavascript(P,T).then(function(L){var M=L.document;return m.persistInputValues(M),{document:M,errors:L.errors,cleanUp:L.cleanUp}})};return _.rasterize=function(P,T,L){var M;return M=E.clone(L),M.inlineScripts=L.executeJs===!0,d.inlineReferences(P,M).then(function(U){return L.executeJs?x(P,L).then(function($){return{element:$.document.documentElement,errors:U.concat($.errors),cleanUp:$.cleanUp}}):{element:P,errors:U,cleanUp:function(){}}}).then(function(U){return S(U.element,T,L).then(function($){return U.cleanUp(),{image:$.image,svg:$.svg,errors:U.errors}})})},_}(a,f,u,w,v,i),h=function(E,y,m){var p={},g=function(C,S){var x=300,P=200,T=C?C.width:x,L=C?C.height:P,M=S.width!==void 0?S.width:T,U=S.height!==void 0?S.height:L;return{width:M,height:U}},d=function(C){var S=g(C.canvas,C.options),x;return x=E.clone(C.options),x.width=S.width,x.height=S.height,x};p.drawDocument=function(){var C=arguments[0],S=Array.prototype.slice.call(arguments,1),x=E.parseOptionalParameters(S),P=C.documentElement?C.documentElement:C;return m.rasterize(P,x.canvas,d(x))};var _=function(C,S,x){var P=y.parseHTML(C);return p.drawDocument(P,S,x)};p.drawHTML=function(){var C=arguments[0],S=Array.prototype.slice.call(arguments,1),x=E.parseOptionalParameters(S);return _(C,x.canvas,x.options)};var O=function(C,S,x){var P=document.implementation.createHTMLDocument("");P.replaceChild(C.documentElement,P.documentElement);var T=x?E.clone(x):{};return x.baseUrl||(T.baseUrl=S),{document:P,options:T}},k=function(C,S,x){return y.loadDocument(C,x).then(function(P){var T=O(P,C,x);return p.drawDocument(T.document,S,T.options)})};return p.drawURL=function(){var C=arguments[0],S=Array.prototype.slice.call(arguments,1),x=E.parseOptionalParameters(S);return k(C,x.canvas,x.options)},p}(a,f,b);return h})})(mS);var eF=mS.exports;(function(e){var t=we&&we.__createBinding||(Object.create?function(w,b,h,E){E===void 0&&(E=h);var y=Object.getOwnPropertyDescriptor(b,h);y&&!("get"in y?!b.__esModule:y.writable||y.configurable)||(y={enumerable:!0,get:function(){return b[h]}}),Object.defineProperty(w,E,y)}:function(w,b,h,E){E===void 0&&(E=h),w[E]=b[h]}),r=we&&we.__setModuleDefault||(Object.create?function(w,b){Object.defineProperty(w,"default",{enumerable:!0,value:b})}:function(w,b){w.default=b}),n=we&&we.__importStar||function(w){if(w&&w.__esModule)return w;var b={};if(w!=null)for(var h in w)h!=="default"&&Object.prototype.hasOwnProperty.call(w,h)&&t(b,w,h);return r(b,w),b};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToCanvas=e.detectSize=e.resetStyleContent=void 0;const i=n(eF),a=xu;e.resetStyleContent=`
153
+ p {
154
+ margin: 0;
155
+ padding: 0;
156
+ word-wrap: break-word; /* Required for Firefox */
157
+ }
158
+ ul, ol {
159
+ list-style-position: outside;
160
+ margin: 0;
161
+ padding: 0;
162
+ display: inline-block;
163
+ text-align: left;
164
+ }
165
+ li {
166
+ margin-left: 1.7em;
167
+ padding-left: 0.5em; /* This should match the margin-left value */
168
+ }
169
+ `;const o=`
170
+ <style>
171
+ html, body {
172
+ padding: 0;
173
+ margin: 0;
174
+ }
175
+ ${e.resetStyleContent}
176
+ </style>
177
+ `;let l;const u=()=>(l||(l=document.createElement("div"),l.id="polotno-hidden-do-not-touch",l.style.overflow="hidden",l.style.position="relative",document.body.appendChild(l),l.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),l);function f(w){const b=document.createElement("div");b.innerHTML=w,b.style.display="inline-block",b.style.position="fixed",b.style.top="0px",b.style.left="0px",b.style.zIndex="1000";const h=u();h.appendChild(b);const E=b.getBoundingClientRect();return h.removeChild(b),{width:E.width,height:E.height}}async function v({html:w,width:b,height:h,fontFamily:E,padding:y,font:m,pixelRatio:p}){const g=document.createElement("canvas");if(E!=="Arial"&&!m){const O=(0,a.getGoogleFontsVariants)();w+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${E}:${O}" rel="stylesheet">`}if(m){const O=m.styles||(m.url?[{src:`url("${m.url}")`}]:[]);w+="<style>",O.forEach(k=>{w+=`
178
+ @font-face {
179
+ font-family: '${E}';
180
+ src: ${k.src};
181
+ font-style: ${k.fontStyle||"normal"};
182
+ font-weight: ${k.fontWeight||"normal"};
183
+ }
184
+ `}),w+="</style>"}w+=o;const d=await i.drawHTML(`<div style="padding: ${y}px;">${w}</div>`,g,{width:b+2*y,height:h+2*y});g.width=(b+2*y)*p,g.height=(h+2*y)*p;const _=g.getContext("2d");return _==null||_.drawImage(d.image,0,0,d.image.width*p,d.image.height*p),g}e.detectSize=f,e.htmlToCanvas=v})(vS);var I2={},D2={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.styled=e.setup=e.keyframes=e.glob=e.extractCss=e.css=void 0;let t={data:""},r=d=>typeof window=="object"?((d?d.querySelector("#_goober"):window._goober)||Object.assign((d||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:d||t,n=d=>{let _=r(d),O=_.data;return _.data="",O},i=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(d,_)=>{let O="",k="",C="";for(let S in d){let x=d[S];S[0]=="@"?S[1]=="i"?O=S+" "+x+";":k+=S[1]=="f"?o(x,S):S+"{"+o(x,S[1]=="k"?"":_)+"}":typeof x=="object"?k+=o(x,_?_.replace(/([^,])+/g,P=>S.replace(/(^:.*)|([^,])+/g,T=>/&/.test(T)?T.replace(/&/g,P):P?P+" "+T:T)):S):x!=null&&(S=S.replace(/[A-Z]/g,"-$&").toLowerCase(),C+=o.p?o.p(S,x):S+":"+x+";")}return O+(_&&C?_+"{"+C+"}":C)+k},l={},u=d=>{if(typeof d=="object"){let _="";for(let O in d)_+=O+u(d[O]);return _}return d},f=(d,_,O,k,C)=>{let S=u(d),x=l[S]||(l[S]=(P=>{let T=0,L=11;for(;T<P.length;)L=101*L+P.charCodeAt(T++)>>>0;return"go"+L})(S));if(!l[x]){let P=S!==d?d:(T=>{let L,M=[{}];for(;L=i.exec(T.replace(a,""));)L[4]?M.shift():L[3]?M.unshift(M[0][L[3]]=M[0][L[3]]||{}):M[0][L[1]]=L[2];return M[0]})(d);l[x]=o(C?{["@keyframes "+x]:P}:P,O?"":"."+x)}return((P,T,L)=>{T.data.indexOf(P)==-1&&(T.data=L?P+T.data:T.data+P)})(l[x],_,k),x},v=(d,_,O)=>d.reduce((k,C,S)=>{let x=_[S];if(x&&x.call){let P=x(O),T=P&&P.props&&P.props.className||/^go/.test(P)&&P;x=T?"."+T:P&&typeof P=="object"?P.props?"":o(P,""):P===!1?"":P}return k+C+(x??"")},"");function w(d){let _=this||{},O=d.call?d(_.p):d;return f(O.unshift?O.raw?v(O,[].slice.call(arguments,1),_.p):O.reduce((k,C)=>Object.assign(k,C&&C.call?C(_.p):C),{}):O,r(_.target),_.g,_.o,_.k)}e.extractCss=n,e.css=w;let b,h,E,y=w.bind({g:1}),m=w.bind({k:1});function p(d,_,O,k){o.p=_,b=d,h=O,E=k}function g(d,_){let O=this||{};return function(){let k=arguments;function C(S,x){let P=Object.assign({},S),T=P.className||C.className;O.p=Object.assign({theme:h&&h()},P),O.o=/ *go\d+/.test(T),P.className=w.apply(O,k)+(T?" "+T:""),_&&(P.ref=x);let L=d;return d[0]&&(L=P.as||d,delete P.as),E&&L[0]&&E(P),b(L,P)}return _?_(C):C}}e.glob=y,e.keyframes=m,e.setup=p,e.styled=g})(D2);var tF=we&&we.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(I2,"__esModule",{value:!0});const rF=tF(at),A_=D2;(0,A_.setup)(rF.default.createElement),I2.default=A_.styled;(function(e){var t=we&&we.__createBinding||(Object.create?function(z,N,H,R){R===void 0&&(R=H);var F=Object.getOwnPropertyDescriptor(N,H);F&&!("get"in F?!N.__esModule:F.writable||F.configurable)||(F={enumerable:!0,get:function(){return N[H]}}),Object.defineProperty(z,R,F)}:function(z,N,H,R){R===void 0&&(R=H),z[R]=N[H]}),r=we&&we.__setModuleDefault||(Object.create?function(z,N){Object.defineProperty(z,"default",{enumerable:!0,value:N})}:function(z,N){z.default=N}),n=we&&we.__importStar||function(z){if(z&&z.__esModule)return z;var N={};if(z!=null)for(var H in z)H!=="default"&&Object.prototype.hasOwnProperty.call(z,H)&&t(N,z,H);return r(N,z),N},i=we&&we.__importDefault||function(z){return z&&z.__esModule?z:{default:z}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.createQuill=e.quillRef=void 0;const a=i(at),o=Hi,l=Wa,u=i(gS),f=i(vi),v=n(ha),w=hi,b=Of,h=v2,E=Ef,y=vS,m=ql,p=Wl,g=Sf,d=i(I2),_=ua,O=b2,k=n(xu),C=Yo;e.quillRef=v.observable({enabled:!1,currentFormat:{},editor:v.observable.object({instance:null},{},{deep:!1})});const S=(0,d.default)("div",a.default.forwardRef)`
185
+ .ql-editor {
186
+ outline: none;
187
+ }
188
+ ${y.resetStyleContent}
189
+ strong {
190
+ font-weight: 700;
191
+ }
192
+ .ql-direction-rtl {
193
+ direction: rtl;
194
+ }
195
+ `,x=z=>new u.default(z,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:["background","bold","color","font","italic","size","strike","underline","indent","list","align","direction"]});e.createQuill=x;const P=({html:z,onBlur:N,onChange:H,element:R})=>{const F=a.default.useRef(null);a.default.useEffect(()=>{if(!F.current)return;const D=(0,e.createQuill)(F.current);return e.quillRef.editor.instance=D,window.__polotnoQuill=D,D.on("text-change",()=>{D.getSelection()&&(e.quillRef.currentFormat=D.getFormat()),setTimeout(()=>{var V;H((V=F.current)===null||V===void 0?void 0:V.childNodes[0].innerHTML)},10)}),D.setSelection(0,0,"api"),D.on("selection-change",V=>{V||N(),V&&(e.quillRef.currentFormat=D.getFormat())}),F.current.childNodes[0].addEventListener("blur",V=>{var Y;!((Y=V.relatedTarget)===null||Y===void 0)&&Y.classList.contains("ql-clipboard")||N()}),()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={},delete window.__polotnoQuill}},[]),a.default.useEffect(()=>{var D;const V=e.quillRef.editor.instance;if(!V)return;const Y=V.getSelection();if(((D=F.current)===null||D===void 0?void 0:D.childNodes[0].innerHTML)!==R.text){var q=V.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+z+"<p><br></p></div>");V.setContents(q),V.history.clear(),Y&&(V.setSelection(Y.index,Y.length),e.quillRef.currentFormat=V.getFormat())}},[R.text]);const B={color:R.fill};return R.fill.indexOf("gradient")>=0&&(B["background-color"]=R.fill,B["background-image"]=R.fill,B["background-size"]="100% 100%",B["background-repeat"]="repeat",B["-webkit-background-clip"]="text",B["-moz-background-clip"]="text",B["-webkit-text-fill-color"]="transparent",B["-moz-text-fill-color"]="transparent"),a.default.createElement(S,{ref:F,style:Object.assign(Object.assign({},B),{fontSize:R.fontSize,width:R.a.width,fontFamily:R.fontFamily,lineHeight:R.lineHeight,letterSpacing:R.letterSpacing+"rem",textAlign:R.align}),dir:(0,h.getDir)((0,O.removeTags)(R.text))})};function T(z,N,H){return a.default.useMemo(()=>(0,y.detectSize)(z),[z,N.width,H])}function L(z){const N=z.getContext("2d").getImageData(0,0,z.width,z.height).data;for(let H=0;H<N.length;H+=4)if(N[H+3]!==0)return!0;return!1}function M(z){return!L(z)}function U(z,{fontFamily:N="",color:H="black"}={}){let R=`color: ${H||z.fill}`;return z.fill.indexOf("gradient")>=0&&(R=`
196
+ background-color: ${H};
197
+ background-image: ${z.fill};
198
+ background-size: 100% 100%;
199
+ background-repeat: repeat;
200
+ -webkit-background-clip: text;
201
+ -moz-background-clip: text;
202
+ -webkit-text-fill-color: transparent;
203
+ -moz-text-fill-color: transparent;
204
+ `),`<div style="white-space: unset; width: ${Math.round(z.width||100)}px; ${R}; font-size: ${z.fontSize}px; font-family: '${N}'; text-decoration: ${z.textDecoration}; text-align: ${z.align}; line-height: ${z.lineHeight}; letter-spacing: ${z.letterSpacing}rem; font-style: ${z.fontStyle}; font-weight: ${z.fontWeight}; -webkit-text-stroke: ${z.strokeWidth}px ${z.stroke};" contentEditable dir="${(0,h.getDir)((0,O.removeTags)(z.text))}">${z.text.replaceAll(`
205
+ `,"</br>")}</div>`}const $=z=>{let N=z.fontSize;for(let H=1;H<50;H++){const R=U(Object.assign(Object.assign({},z.toJSON()),{fontSize:N}),{fontFamily:z.fontFamily}),{height:F}=(0,y.detectSize)(R);if(!(z.height&&F>z.height))break;N-=.5}return N},Z=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,o.observer)(({element:z,store:N})=>{const H=a.default.useRef(null),[R,F]=a.default.useState(),[B,D]=a.default.useState(!1),[V,Y]=a.default.useState(!0),[q,G]=a.default.useState(!1),K=a.default.useRef(z.height),X=N.selectedElements.indexOf(z)>=0,Q=z.fontSize/3,{textVerticalResizeEnabled:ee}=w.flags,te=(0,h.usePrevious)(z.fontFamily),[ae]=(0,h.useFontLoader)(N,z.fontFamily),oe=z._editModeEnabled;(0,m.useFadeIn)(H);const se=ae?z.fontFamily:te!==z.fontFamily?te:"Arial",ke=(0,E.useColor)(z).fill,Fe=U(z,{fontFamily:se,color:ke}),{width:fe,height:ie}=T(Fe,z,ae);a.default.useEffect(()=>{if(!ae)return;if(!z.height)return void z.set({height:ie});const{textOverflow:ye}=w.flags;if(ye!=="change-font-size"||B)ye==="resize"&&(ee&&z.height<ie&&N.history.ignore(()=>{z.set({height:ie})}),ee||z.height===ie||N.history.ignore(()=>{z.set({height:ie})}));else{const Ie=$(z);Ie!==z.fontSize?N.history.ignore(()=>{z.set({fontSize:Ie})}):z.height!==ie&&(ee&&z.height<ie?N.history.ignore(()=>{z.set({height:ie})}):ee||N.history.ignore(()=>{z.set({height:ie})}))}});const ge=a.default.useRef(0);a.default.useEffect(()=>{B||oe||(async()=>{ge.current++;const ye=ge.current,Ie=(0,_.incrementLoader)(`text ${z.id}`);Y(!0);let Ee=null;const Ae=Z?5:1;for(let Ze=0;Ze<Ae;Ze++){if(Ee=await(0,y.htmlToCanvas)({html:Fe,width:z.width||1,height:z.height||ie||1,fontFamily:se,padding:Q,pixelRatio:N._elementsPixelRatio,font:N.fonts.find(We=>We.fontFamily===se)||k.globalFonts.find(We=>We.fontFamily===se)}),ye!==ge.current)return void Ie();M(Ee)&&Z&&await new Promise(We=>setTimeout(We,50*(Ze+1)))}Ee?(F(Ee),Y(!1),f.default.Util.requestAnimFrame(Ie)):Ie()})()},[Fe,B,ie,oe,se,z.height,N._elementsPixelRatio]);const pe=B||V;a.default.useEffect(()=>v.autorun(()=>{const ye=H.current;(0,b.applyFilter)(ye,z)}),[R,pe,z.shadowColor,z.shadowOffsetX,z.shadowOffsetY,z.shadowOpacity]);let re=0;z.verticalAlign==="middle"&&(re=(z.height-ie)/2),z.verticalAlign==="bottom"&&(re=z.height-ie);const de=(0,h.getLineHeight)({fontLoaded:ae,fontFamily:z.fontFamily,fontSize:z.fontSize,lineHeight:z.lineHeight}),be=(0,C.useMobile)();return a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Rect,{x:z.a.x,y:z.a.y,offsetX:z.backgroundPadding*(z.fontSize*de*.5),offsetY:z.backgroundPadding*(z.fontSize*de*.5),rotation:z.rotation,hideInExport:!z.showInExport,listening:!1,visible:z.backgroundEnabled,opacity:z.backgroundOpacity,fill:z.backgroundColor,width:z.a.width+z.backgroundPadding*(z.fontSize*de),height:z.a.height+z.backgroundPadding*(z.fontSize*de),cornerRadius:z.backgroundCornerRadius*(z.fontSize*de*.5)}),a.default.createElement(l.Rect,{ref:H,name:"element",x:z.a.x,y:z.a.y,listening:z.selectable,rotation:z.rotation,width:z.a.width,height:z.a.height,visible:!pe,draggable:be?z.draggable&&X:z.draggable,preventDefault:!be||X,opacity:oe?0:z.a.opacity,hideInExport:!z.showInExport,onMouseEnter:()=>{G(!0)},onMouseLeave:()=>{G(!1)},onDragMove:ye=>{z.set({x:ye.target.x(),y:ye.target.y()})},onDragEnd:ye=>{z.set({x:ye.target.x(),y:ye.target.y()})},id:z.id,onDblClick:()=>{z.contentEditable&&z.toggleEditMode(!0)},onDblTap:()=>{z.contentEditable&&z.toggleEditMode(!0)},onTransformStart:ye=>{D(!0),K.current=z.height},onTransform:ye=>{var Ie;const Ee=ye.target,Ae=((Ie=Ee.getStage())===null||Ie===void 0?void 0:Ie.findOne("Transformer")).getActiveAnchor(),Ze=Ae==="middle-left"||Ae==="middle-right",We=Ae==="top-center"||Ae==="bottom-center",dt=Ee.scaleX();if(Ze){const Bt=Ee.scaleX(),ue=Math.max(Ee.width()*Bt,z.fontSize);if(Ee.width(ue),Ee.scaleX(1),w.flags.textVerticalResizeEnabled){const he=Math.max(ie,K.current);z.set({height:he})}z.set({width:ue,x:Ee.x(),y:Ee.y()})}else if(We){let Bt=w.flags.textOverflow==="resize"?ie:z.lineHeight*z.fontSize;const ue=Math.max(Bt,ye.target.height()*ye.target.scaleY());Ee.scaleY(1),z.set({x:Ee.x(),y:Ee.y(),height:ue,rotation:Ee.rotation()})}else Ee.scaleX(1),Ee.scaleY(1),z.set({fontSize:z.fontSize*dt,width:Ee.width()*dt,x:Ee.x(),y:Ee.y(),rotation:Ee.rotation(),height:Ee.height()*dt})},onTransformEnd:ye=>{D(!1),Y(!0);const Ie=ye.target.scaleX();ye.target.scaleX(1),ye.target.scaleY(1),z.set({fontSize:z.fontSize*Ie,width:ye.target.width()*Ie,x:ye.target.x(),y:ye.target.y(),rotation:ye.target.rotation(),shadowBlur:z.shadowBlur*Ie,shadowOffsetX:z.shadowOffsetX*Ie,shadowOffsetY:z.shadowOffsetY*Ie,strokeWidth:z.strokeWidth*Ie})}}),a.default.createElement(l.Image,{ref:H,image:R,x:z.a.x,y:z.a.y,offsetX:Q,offsetY:Q-re,listening:!1,rotation:z.rotation,width:z.a.width+2*Q,height:z.a.height+2*Q,visible:!pe,opacity:oe?0:z.a.opacity,shadowEnabled:z.shadowEnabled,shadowBlur:z.shadowBlur,shadowOffsetX:z.shadowOffsetX,shadowOffsetY:z.shadowOffsetY,shadowColor:z.shadowColor,shadowOpacity:z.shadowOpacity,hideInExport:!z.showInExport}),pe&&a.default.createElement(l.Group,{x:z.a.x,y:z.a.y,rotation:z.rotation,offsetY:-re},a.default.createElement(g.Html,{divProps:{style:{pointerEvents:"none"}}},a.default.createElement(S,{dangerouslySetInnerHTML:{__html:Fe},style:{pointerEvents:"none",display:"inline-block"}}))),oe&&a.default.createElement(l.Group,{x:z.a.x,y:z.a.y,rotation:z.rotation,offsetY:-re},a.default.createElement(g.Html,null,a.default.createElement(P,{html:Fe,element:z,onChange:ye=>{z.set({text:ye})},onBlur:ye=>{z.toggleEditMode(!1)}}))),(X||q)&&a.default.createElement(p.Highlighter,{element:z}))})})(hS);var SS={},F2={},Cf={};(function(e){var t=we&&we.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalClientRect=e.getClientRect=void 0;const r=t(vi);function n(o,l,u,f,v){const w=Math.sqrt(u*u+f*f);return v+=Math.atan2(f,u),{x:o+w*Math.cos(v),y:l+w*Math.sin(v)}}function i(o){const{x:l,y:u,width:f,height:v}=o,w=r.default.Util.degToRad(o.rotation),b=n(l,u,0,0,w),h=n(l,u,f,0,w),E=n(l,u,f,v,w),y=n(l,u,0,v,w),m=Math.min(b.x,h.x,E.x,y.x),p=Math.min(b.y,h.y,E.y,y.y),g=Math.max(b.x,h.x,E.x,y.x),d=Math.max(b.y,h.y,E.y,y.y);return{x:m,y:p,width:g-m,height:d-p,minX:m,minY:p,maxX:g,maxY:d}}function a(o){const l=o.map(b=>i(b)),u=Math.min(...l.map(b=>b.minX)),f=Math.min(...l.map(b=>b.minY)),v=Math.max(...l.map(b=>b.maxX)),w=Math.max(...l.map(b=>b.maxY));return{x:u,y:f,width:v-u,height:w-f,minX:u,minY:f,maxX:v,maxY:w}}e.getClientRect=i,e.getTotalClientRect=a})(Cf);(function(e){var t=we&&we.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.useAnchorSnap=e.useSnap=void 0;const r=t(at),n=t(vi),i=Cf;var a=5;function o(w){const b=w.__getNodeRect(),h=(0,i.getClientRect)(Object.assign(Object.assign({},b),{rotation:n.default.Util.radToDeg(b.rotation)})),E=w.getAbsolutePosition();return{vertical:[{guide:h.x,offset:E.x-h.x,snap:"start"},{guide:h.x+h.width/2,offset:E.x-h.x-h.width/2,snap:"center"},{guide:h.x+h.width,offset:E.x-h.x-h.width,snap:"end"}],horizontal:[{guide:h.y,offset:E.y-h.y,snap:"start"},{guide:h.y+h.height/2,offset:E.y-h.y-h.height/2,snap:"center"},{guide:h.y+h.height,offset:E.y-h.y-h.height,snap:"end"}]}}function l(w,b){var h=[],E=[];w.vertical.forEach(_=>{b.vertical.forEach(O=>{var k=Math.abs(_-O.guide);k<a&&h.push({lineGuide:_,diff:k,snap:O.snap,offset:O.offset})})}),w.horizontal.forEach(_=>{b.horizontal.forEach(O=>{var k=Math.abs(_-O.guide);k<a&&E.push({lineGuide:_,diff:k,snap:O.snap,offset:O.offset})})});var y=[];const m=h.sort((_,O)=>_.diff-O.diff),p=E.sort((_,O)=>_.diff-O.diff);var g=m[0],d=p[0];return g&&m.filter(_=>Math.abs(_.diff-g.diff)<.1).forEach(_=>{y.push(Object.assign({orientation:"V"},_))}),d&&p.filter(_=>Math.abs(_.diff-d.diff)<.1).forEach(_=>{y.push(Object.assign({orientation:"H"},_))}),y}function u(w,b){const h=r.default.useRef(),E=O=>O.hasName("element")||O.hasName("page-background")||!h.current&&O.hasName("elements-area");function y(O){var k;const C=(k=w.current)===null||k===void 0?void 0:k.getStage();var S=[],x=[];return C.find(E).forEach(P=>{if(!(O.indexOf(P)>=0)){var T=P.getClientRect({skipShadow:!0,skipStroke:!0});S.push(T.x,T.x+T.width,T.x+T.width/2),x.push(T.y,T.y+T.height,T.y+T.height/2)}}),{vertical:S,horizontal:x}}function m(O){var k;const C=(k=w.current)===null||k===void 0?void 0:k.getLayer(),S=C==null?void 0:C.children.find(x=>x.name()==="line-guides");O.forEach(x=>{if(x.orientation==="H"){var P=new n.default.Line({points:[-6e3,x.lineGuide,6e3,x.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});S==null||S.add(P),C.batchDraw()}else x.orientation==="V"&&(P=new n.default.Line({points:[x.lineGuide,-6e3,x.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),S==null||S.add(P))})}const p=O=>{O.target.getLayer().children.find(T=>T.name()==="line-guides").destroyChildren();var k=l(y(O.target.nodes()),o(O.target));if(!k.length)return;m(k);const C=O.target.getAbsolutePosition(),S=Object.assign({},C);k.forEach(T=>{switch(T.snap){case"start":case"center":case"end":switch(T.orientation){case"V":S.x=T.lineGuide+T.offset;break;case"H":S.y=T.lineGuide+T.offset}}});const x=S.x-C.x,P=S.y-C.y;O.evt.ctrlKey||O.evt.metaKey||O.target.nodes().forEach(T=>{const L=T.getAbsolutePosition();T.setAbsolutePosition({x:L.x+x,y:L.y+P})})},g=(O,k,C)=>{const S=w.current,x=S.getLayer();if(x.children.find($=>$.name()==="line-guides").destroyChildren(),S.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(k.x-O.x,2)+Math.pow(k.y-O.y,2))>50||!x)return k;var P=l(y(S.nodes()),{vertical:[{guide:k.x,offset:0,snap:"start"}],horizontal:[{guide:k.y,offset:0,snap:"start"}]});if(!P.length||(m(P),C.ctrlKey||C.metaKey))return k;let T=k.x,L=k.x;P.forEach($=>{switch($.orientation){case"V":T=$.lineGuide;break;case"H":L=$.lineGuide}});const M=Math.abs(k.x-T)<10,U=Math.abs(k.y-L)<10;return M&&!U?{x:T,y:O.y}:U&&!M?{x:O.x,y:L}:M&&U?{x:T,y:L}:k},d=O=>{if(h.current=!1,!O.target)return;const k=O.target.getLayer();k.children.find(C=>C.name()==="line-guides").destroyChildren(),k.batchDraw()},_=()=>{const O=w.current.nodes().map(C=>C.id()),k=b.getElementById(O[0]);h.current=(k==null?void 0:k.type)==="image"};r.default.useEffect(()=>{w.current&&(w.current.anchorDragBoundFunc(g),w.current.on("dragstart",()=>{setTimeout(()=>{const O=[...n.default.DD._dragElements.entries()];O.reverse(),n.default.DD._dragElements.clear(),O.forEach(([k,C])=>{n.default.DD._dragElements.set(k,C)})}),_()}),w.current.on("dragmove",p),w.current.on("dragend",d),w.current.on("transformstart",()=>{_()}),w.current.on("transformend",d),w.current.on("transform",O=>{var k,C;O.evt.ctrlKey||O.evt.metaKey?(k=w.current)===null||k===void 0||k.rotationSnapTolerance(0):(C=w.current)===null||C===void 0||C.rotationSnapTolerance(5)}))},[])}function f(w){return{vertical:[{guide:w.absolutePosition().x,offset:0,snap:"center"}],horizontal:[{guide:w.absolutePosition().y,offset:0,snap:"center"}]}}function v(w,b,h){const E=p=>p.hasName("element")||p.hasName("line-anchor")||p.hasName("page-background")||p.hasName("elements-area"),y=p=>{p.target.getLayer().children.find(C=>C.name()==="line-guides").destroyChildren();var g=l(function(C){var S;const x=(S=w.current)===null||S===void 0?void 0:S.getStage();var P=[],T=[];return x.find(E).forEach(L=>{if(!(C.indexOf(L)>=0)){var M=L.getClientRect({skipShadow:!0,skipStroke:!0});L.hasName("line-anchor")&&(M={x:L.absolutePosition().x,y:L.absolutePosition().y,width:0,height:0}),P.push(M.x,M.x+M.width,M.x+M.width/2),T.push(M.y,M.y+M.height,M.y+M.height/2)}}),{vertical:P,horizontal:T}}([p.target,...b.map(C=>C.current)]),f(p.target));if(!g.length)return;(function(C){var S;const x=(S=w.current)===null||S===void 0?void 0:S.getLayer(),P=x==null?void 0:x.children.find(T=>T.name()==="line-guides");C.forEach(T=>{if(T.orientation==="H"){var L=new n.default.Line({points:[-6e3,T.lineGuide,6e3,T.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});P==null||P.add(L),x.batchDraw()}else T.orientation==="V"&&(L=new n.default.Line({points:[T.lineGuide,-6e3,T.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),P==null||P.add(L))})})(g);const d=p.target.getAbsolutePosition(),_=Object.assign({},d);g.forEach(C=>{switch(C.snap){case"start":case"center":case"end":switch(C.orientation){case"V":_.x=C.lineGuide+C.offset;break;case"H":_.y=C.lineGuide+C.offset}}});const O=_.x-d.x,k=_.y-d.y;if(!(p.evt.ctrlKey||p.evt.metaKey)){const C=p.target.getAbsolutePosition();p.target.absolutePosition({x:C.x+O,y:C.y+k})}},m=p=>{if(!p.target)return;const g=p.target.getLayer();g.children.find(d=>d.name()==="line-guides").destroyChildren(),g.batchDraw()};r.default.useEffect(()=>{w.current&&(w.current.on("dragmove",y),w.current.on("dragend",m))},h)}e.useSnap=u,e.useAnchorSnap=v})(F2);(function(e){var t=we&&we.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=e.getLinePositionFromMiddlePoints=e.getMiddlePoints=void 0;const r=t(at),n=Hi,i=Wa,a=Ef,o=Sf,l=Wl,u=F2,f=Yo;function v(E){const{x:y,y:m,width:p,height:g,rotation:d}=E.a,_=d*Math.PI/180,O={x:y+g/2*Math.cos(_+Math.PI/2),y:m+g/2*Math.sin(_+Math.PI/2)};return{middleLeft:O,middleRight:{x:O.x+p*Math.cos(_),y:O.y+p*Math.sin(_)}}}function w(E,y,m){const p=Math.sqrt(Math.pow(y.x-E.x,2)+Math.pow(y.y-E.y,2)),g=Math.atan2(y.y-E.y,y.x-E.x),d=180*g/Math.PI;return{x:E.x+Math.cos(g-Math.PI/2)*m/2,y:E.y+Math.sin(g-Math.PI/2)*m/2,width:p,height:m,rotation:d}}e.getMiddlePoints=v,e.getLinePositionFromMiddlePoints=w;const b=(E,y)=>({offsetX:5/E,offsetY:5/E,width:10/E,height:10/E,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:m=>{m.target.getStage().container().style.cursor="crosshair"},onMouseLeave:m=>{m.target.getStage().container().style.cursor=""},onDragStart:m=>{y.history.startTransaction()},onDragEnd:m=>{y.history.endTransaction()}}),h=(0,n.observer)(({element:E,type:y})=>{const m=(0,a.useColor)(E,E.a.color,"fill"),p=(0,a.useColor)(E,E.a.color,"stroke"),g=Object.assign(Object.assign(Object.assign({strokeWidth:E.height,lineCap:"round",lineJoin:"round"},p),m),{opacity:E.a.opacity,hideInExport:!E.showInExport});return r.default.createElement(r.default.Fragment,null,y==="arrow"&&r.default.createElement(i.Line,Object.assign({points:[3*E.height,2*-E.height,0,0,3*E.height,2*E.height]},g)),y==="triangle"&&r.default.createElement(i.Line,Object.assign({points:[3*E.height,2*-E.height,0,0,3*E.height,2*E.height],closed:!0},g)),y==="bar"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-E.height,0,2*E.height],closed:!0},g)),y==="square"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-E.height,4*E.height,2*-E.height,4*E.height,2*E.height,0,2*E.height],closed:!0},g)),y==="circle"&&r.default.createElement(i.Circle,Object.assign({x:2*E.height,y:0,radius:2*E.height},g)))});e.LineElement=(0,n.observer)(({element:E,store:y})=>{const m=r.default.useRef(null),p=r.default.useRef(null),g=r.default.useRef(null),d=E.selectable||y.role==="admin",_=(0,f.useMobile)(),[O,k]=r.default.useState(!1),C=y.selectedElements.indexOf(E)>=0&&y.selectedElements.length===1,{middleLeft:S,middleRight:x}=v(E);(0,u.useAnchorSnap)(p,[m],[C]),(0,u.useAnchorSnap)(g,[m],[C]);const P=(0,a.useColor)(E,E.a.color,"stroke");return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Line,Object.assign({ref:m,name:"element",id:E.id,x:E.a.x,y:E.a.y,points:[0,0,E.a.width,0],offsetY:-E.a.height/2,strokeWidth:E.a.height,hitStrokeWidth:Math.max(E.a.height,20),dash:E.dash.map(T=>T*E.a.height)},P,{rotation:E.a.rotation,opacity:E.animated("opacity"),shadowEnabled:E.shadowEnabled,shadowBlur:E.shadowBlur,shadowOffsetX:E.shadowOffsetX,shadowOffsetY:E.shadowOffsetY,shadowColor:E.shadowColor,shadowOpacity:E.shadowOpacity,listening:d,draggable:_?E.draggable&&C:E.draggable,preventDefault:!_||C,hideInExport:!E.showInExport,onMouseEnter:()=>{k(!0)},onMouseLeave:()=>{k(!1)},onDragMove:T=>{E.set({x:T.target.x(),y:T.target.y()})},onDragEnd:T=>{E.set({x:T.target.x(),y:T.target.y()})},onTransform:T=>{const L=T.target.scaleX();T.target.scaleX(1),T.target.scaleY(1),E.set({height:E.height*L,width:E.width*L,x:T.target.x(),y:T.target.y(),rotation:T.target.rotation()})}})),r.default.createElement(i.Group,{x:S.x,y:S.y,rotation:E.rotation,hideInExport:!E.showInExport},r.default.createElement(h,{element:E,type:E.startHead})),r.default.createElement(i.Group,{x:x.x,y:x.y,rotation:E.rotation+180},r.default.createElement(h,{element:E,type:E.endHead})),O&&!C&&r.default.createElement(l.Highlighter,{element:E}),C&&E.resizable&&r.default.createElement(o.Portal,{selector:".page-abs-container",enabled:!0},r.default.createElement(i.Group,{visible:C},r.default.createElement(i.Rect,Object.assign({x:S.x,y:S.y,ref:p,name:"line-anchor"},b(y.scale,y),{onDragMove:T=>{const L=w(T.target.position(),x,E.height);E.set({x:L.x,y:L.y,width:L.width,rotation:L.rotation})}})),r.default.createElement(i.Rect,Object.assign({x:x.x,y:x.y,ref:g,name:"line-anchor"},b(y.scale,y),{onDragMove:T=>{const L=w(S,T.target.position(),E.height);E.set({x:L.x,y:L.y,width:L.width,rotation:L.rotation})}})))))})})(SS);var ES={};(function(e){var t=we&&we.__createBinding||(Object.create?function(R,F,B,D){D===void 0&&(D=B);var V=Object.getOwnPropertyDescriptor(F,B);V&&!("get"in V?!F.__esModule:V.writable||V.configurable)||(V={enumerable:!0,get:function(){return F[B]}}),Object.defineProperty(R,D,V)}:function(R,F,B,D){D===void 0&&(D=B),R[D]=F[B]}),r=we&&we.__setModuleDefault||(Object.create?function(R,F){Object.defineProperty(R,"default",{enumerable:!0,value:F})}:function(R,F){R.default=F}),n=we&&we.__importStar||function(R){if(R&&R.__esModule)return R;var F={};if(R!=null)for(var B in R)B!=="default"&&Object.prototype.hasOwnProperty.call(R,B)&&t(F,R,B);return r(F,R),F},i=we&&we.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(at),o=Hi,l=ha,u=Wa,f=i(g0),v=i(vi),w=Sf,b=Wl,h=ua,E=n(Cu),y=hi,m=Of,p=ql,g=Yo;function d(){return document.createElement("canvas")}async function _(R){if(!(R.indexOf("data:image/svg+xml")>=0||R.indexOf(".svg")>=0))return R;const F=await E.urlToString(R),B=E.fixSize(F);return E.svgToURL(B)}const O=R=>{const[F,B]=a.default.useState(R);return a.default.useEffect(()=>{(async()=>{const D=await _(R);D!==F&&B(D)})()},[R]),F},k=new window.Image;k.src=E.svgToURL(`
206
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
207
+ <path opacity="0.6" d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" fill="white"/>
208
+ <path d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
209
+ </svg>
210
+ `);const C=new window.Image;C.src=E.svgToURL(`
211
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
212
+ <path opacity="0.6" d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" fill="white"/>
213
+ <path opacity="0.6" d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" fill="white"/>
214
+ <path d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
215
+ <path d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
216
+ </svg>
217
+ `);function S(R,F,B,D,V,Y,q){for(var G=new ImageData(F,B),K=new Int32Array(R.data.buffer),X=R.width,Q=new Int32Array(G.data.buffer),ee=G.width,te=F/Y,ae=B/q,oe=Math.round(1/te),se=Math.round(1/ae),ke=oe*se,Fe=0;Fe<G.height;Fe++)for(var fe=0;fe<ee;fe++){for(var ie=D+Math.round(fe/te)+(V+Math.round(Fe/ae))*X,ge=0,pe=0,re=0,de=0,be=0;be<se;be++)for(var ye=0;ye<oe;ye++){var Ie=K[ie+ye+be*X];ge+=Ie<<24>>>24,pe+=Ie<<16>>>24,re+=Ie<<8>>>24,de+=Ie>>>24}ge=Math.round(ge/ke),pe=Math.round(pe/ke),re=Math.round(re/ke),de=Math.round(de/ke),Q[fe+Fe*ee]=de<<24|re<<16|pe<<8|ge}return G}function x(R,F){var B,D;const V=d();V.width=R.width,V.height=R.height,(B=V.getContext("2d"))===null||B===void 0||B.drawImage(R,0,0,V.width,V.height);const Y=S(V.getContext("2d").getImageData(0,0,V.width,V.height),Math.floor(V.width*F),Math.floor(V.height*F),0,0,V.width,V.height);return V.width=Math.floor(V.width*F),V.height=Math.floor(V.height*F),(D=V.getContext("2d"))===null||D===void 0||D.putImageData(Y,0,0),V}const P=(R,F,B,D,V=0,Y=!1)=>{const q=Math.floor(Math.max(R.width*D,1)),G=Math.floor(Math.max(R.height*D,1)),K=Math.min(V*D,q/2,G/2),X=Math.max(R.width/B.width,R.height/B.height)*D,Q=R.page._exportingOrRendering&&y.flags.imageDownScalingEnabled&&X<1&&!Y,ee=B.x===0&&B.y===0&&B.width===(F==null?void 0:F.width)&&B.height===(F==null?void 0:F.height),te=a.default.useMemo(()=>{if(!(!F||!F.width||!F.height))return ee&&K===0&&!Q?void 0:d()},[F,K,Q,ee]);return a.default.useLayoutEffect(()=>{if(!te||!F)return;te.width=q,te.height=G;const ae=te.getContext("2d");if(!ae)return;K&&(ae.beginPath(),ae.moveTo(K,0),ae.lineTo(q-K,0),ae.arc(q-K,K,K,3*Math.PI/2,0,!1),ae.lineTo(q,G-K),ae.arc(q-K,G-K,K,0,Math.PI/2,!1),ae.lineTo(K,G),ae.arc(K,G-K,K,Math.PI/2,Math.PI,!1),ae.lineTo(0,K),ae.arc(K,K,K,Math.PI,3*Math.PI/2,!1),ae.clip());const oe=Q?x(F,X):F,se=Q?{x:Math.floor(B.x*X),y:Math.floor(B.y*X),width:Math.floor(B.width*X),height:Math.floor(B.height*X)}:B;ae.drawImage(oe,se.x,se.y,se.width,se.height,0,0,te.width,te.height)},[te,R.width,R.height,B.x,B.y,B.width,B.height,V,D,Y,R.page._exportingOrRendering,Q]),a.default.useEffect(()=>()=>{te&&te.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(te)},[te]),te||F},T=(R,F,B,D)=>{const V=O(R.clipSrc||""),[Y,q]=$(V,"anonymous"),G=R.clipSrc?q:"loaded";(0,e.useImageLoader)(G,R.id+"-clip");const K=a.default.useMemo(()=>{if(F&&Y)return d()},[F,Y]);return a.default.useLayoutEffect(()=>{var X;if(!Y||!F||!F.width||!F.height||!Y||!Y.width||!Y.height||!K)return;const Q=d(),ee=Math.max(R.width/Y.width*B,R.height/Y.height*B);Q.width=Y.width*ee,Q.height=Y.height*ee,(X=Q.getContext("2d"))===null||X===void 0||X.drawImage(Y,0,0,Q.width,Q.height),K.width=Math.max(F.width,1),K.height=Math.max(F.height,1);const te=K.getContext("2d");te&&(te.save(),te.drawImage(Q,0,0,F.width,F.height),v.default.Util.releaseCanvas(Q),te.globalCompositeOperation="source-in",te.drawImage(F,0,0,K.width,K.height),te.restore())},[K,F,Y,R.width,R.height,B,...D]),R.clipSrc&&Y?K:F},L=d(),M=(0,o.observer)(({element:R})=>{const F=Math.min(30,R.width/4,R.height/4),B=a.default.useRef(null);return a.default.useEffect(()=>{const D=B.current;if(!D)return;const V=new v.default.Animation(Y=>{D.rotate(((Y==null?void 0:Y.timeDiff)||0)/2)},D.getLayer());return V.start(),()=>{V.stop()}}),a.default.createElement(u.Group,{x:R.x,y:R.y,rotation:R.rotation,listening:!1,opacity:R.a.opacity,hideInExport:!R.showInExport},a.default.createElement(u.Rect,{width:R.width,height:R.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:B,x:R.width/2,y:R.height/2,fill:"white",outerRadius:Math.abs(F),innerRadius:Math.max(1,F-5),angle:270}))}),U=(0,o.observer)(({element:R})=>{const F="Can not load the video...",B=Math.max(10,Math.min(30,R.width/25));return a.default.createElement(u.Group,{x:R.x,y:R.y,rotation:R.rotation,listening:!1,opacity:R.a.opacity,hideInExport:!R.showInExport},a.default.createElement(u.Rect,{width:R.width,height:R.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:F,fontSize:B,width:R.width,height:R.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let $=f.default;const Z=R=>{$=R};e.setImageLoaderHook=Z;const z=(R,F)=>{const B=a.default.useRef(),D=()=>{var V;(V=B.current)===null||V===void 0||V.call(B),B.current=void 0};a.default.useEffect(()=>D,[]),a.default.useLayoutEffect(()=>{R!=="loading"||B.current||(B.current=(0,h.incrementLoader)(`video ${F}`)),R!=="loading"&&D(),R==="failed"&&(0,h.triggerLoadError)(`video ${F}`)},[R])};e.useImageLoader=z;function N(R,F){for(var B=R.buffered,D=0;D<B.length;D++)if(F>=B.start(D)&&F<=B.end(D))return!0;return!1}function H(R,F,B){const D=a.default.useRef("loading"),V=a.default.useRef(),[Y,q]=a.default.useState(0),G=a.default.useRef(),K=a.default.useRef(),X=a.default.useRef();return G.current===R&&K.current===F&&X.current===B||(D.current="loading",V.current=void 0,G.current=R,K.current=F,X.current=B),a.default.useLayoutEffect(function(){if(R){var Q=document.createElement("video");return Q.addEventListener("canplay",ee),Q.addEventListener("error",te),Q.crossOrigin=F,Q.src=R,function(){Q.removeEventListener("canplay",ee),Q.removeEventListener("error",te)}}function ee(){D.current="loaded",V.current=Q,V.current.currentTime=0,q(Math.random()),V.current.removeEventListener("canplay",ee)}function te(ae){D.current="failed",V.current=void 0,q(Math.random())}},[R,F,B]),[V.current,D.current]}e.VideoElement=(0,o.observer)(({element:R,store:F})=>{var B;const[D,V]=a.default.useState(!1),Y=a.default.useRef(null),q=a.default.useRef(null),[G,K]=a.default.useState(!1),X=F.selectedElements.indexOf(R)>=0,[Q,ee]=a.default.useState(!1),[te,ae]=H(R.src,"anonymous"),oe=F.activePage===R.page;(0,e.useImageLoader)(ae,R.id+"-video"),te&&(te.width=te.videoWidth,te.height=te.videoHeight);const se=te||L;a.default.useEffect(()=>{te&&F.history.ignore(()=>{R.set({duration:1e3*te.duration})})},[te]),a.default.useEffect(()=>{var Pe;if(!te)return;const He=oe&&(F.isPlaying||Q);if(!He)return void te.pause();He&&(te.currentTime=R.startTime*te.duration,te.play());const et=new v.default.Animation(()=>{},(Pe=Y.current)===null||Pe===void 0?void 0:Pe.getLayer());et.start();const Et=()=>{ee(!1),te.currentTime=R.startTime*te.duration},xt=()=>{te.currentTime>=R.endTime*te.duration&&(te.pause(),te.currentTime=R.startTime*te.duration,ee(!1))};return te.addEventListener("ended",Et),te.addEventListener("timeupdate",xt),()=>{et.stop(),te.removeEventListener("ended",Et),te.removeEventListener("timeupdate",xt)}},[te,Q,F.isPlaying,oe]);const ke=a.default.useRef();a.default.useEffect(()=>(0,l.autorun)(()=>{var Pe,He;if(te){const et=(F.currentTime-R.page.startTime)%R.duration;(Math.abs(1e3*te.currentTime-et)>500||!F.isPlaying)&&(te.currentTime=et/1e3,F.isPlaying||te.currentTime===0||(ke.current=(0,h.incrementLoader)(`video ${R.id}`))),(He=(Pe=Y.current)===null||Pe===void 0?void 0:Pe.getLayer())===null||He===void 0||He.batchDraw()}}),[F,te]),a.default.useEffect(()=>{if(!te)return;let Pe=null;const He=()=>{var Et,xt;ke.current&&((xt=(Et=Y.current)===null||Et===void 0?void 0:Et.getLayer())===null||xt===void 0||xt.batchDraw(),ke.current(),ke.current=null),N(te,te.currentTime)||(Pe&&console.error("finish already exists"),Pe=(0,h.incrementLoader)(`video ${R.id}`))},et=()=>{Pe&&(Pe(),Pe=null)};return te.addEventListener("timeupdate",He),te.addEventListener("canplay",et),()=>{te.removeEventListener("timeupdate",He),te.removeEventListener("canplay",et)}},[te,R.id,h.incrementLoader]);let{cropX:Fe,cropY:fe,cropWidth:ie,cropHeight:ge}=R;ae!=="loaded"&&(Fe=fe=0,ie=ge=1);const pe=se.width*ie,re=se.height*ge,de=R.width/R.height;let be,ye;const Ie=pe/re,Ee=R.type==="svg";Ee?(be=pe,ye=re):de>=Ie?(be=pe,ye=pe/de):(be=re*de,ye=re);const Ae={x:se.width*Fe,y:se.height*fe,width:be,height:ye},Ze=(B=R.cornerRadius)!==null&&B!==void 0?B:0;let We=T(R,P(R,se,Ae,F._elementsPixelRatio,Ze,D||R._cropModeEnabled||R.type==="svg"),F._elementsPixelRatio,[Ae,Ze,F._elementsPixelRatio]);const dt=Math.max(R.width/be,R.height/ye);a.default.useEffect(()=>{var Pe;if(!R._cropModeEnabled)return;const He=(Pe=Y.current)===null||Pe===void 0?void 0:Pe.getStage();function et(xt){R._cropModeEnabled&&xt.target!==q.current&&R.toggleCropMode(!1)}function Et(xt){R._cropModeEnabled&&xt.target.parentNode!==He.content&&R.toggleCropMode(!1)}return document.body.addEventListener("click",Et),He==null||He.on("click",et),He==null||He.on("tap",et),()=>{document.body.removeEventListener("click",Et),document.body.removeEventListener("touchstart",Et),He==null||He.off("click",et),He==null||He.off("click",et)}},[R._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(D||R._cropModeEnabled))return(0,m.applyFilter)(Y.current,R),(0,l.autorun)(()=>{(0,m.applyFilter)(Y.current,R)},{delay:100})},[se,D,ie,ge,R._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Pe;D||R._cropModeEnabled?(Pe=Y.current)===null||Pe===void 0||Pe.clearCache():(0,m.applyFilter)(Y.current,R)},[D,R.width,R.height,R._cropModeEnabled]),a.default.useEffect(()=>{(0,m.applyFilter)(Y.current,R)},[R.shadowEnabled,R.shadowBlur,R.cornerRadius,R.shadowColor,R.shadowOffsetX,R.shadowOffsetY,R.shadowOpacity]);const Bt=a.default.useRef(null),ue=a.default.useRef(null),he=a.default.useRef(null);a.default.useLayoutEffect(()=>{R._cropModeEnabled&&(ue.current.nodes([Bt.current]),he.current.nodes([q.current]))},[R._cropModeEnabled]);const nt=Pe=>{Math.round(Pe.target.x())>0&&(Pe.target.x(0),Pe.target.scaleX(1)),Math.round(Pe.target.y())>0&&(Pe.target.y(0),Pe.target.scaleY(1));const He=Pe.target.width()*Pe.target.scaleX(),et=Pe.target.height()*Pe.target.scaleY(),Et=Math.min(1,be/He),xt=Math.min(1,ye/et),ar=1-Et,Rr=Math.min(ar,Math.max(0,Math.round(-Pe.target.x())/He)),Lr=1-xt,ln=Math.min(Lr,Math.max(0,Math.round(-Pe.target.y())/et));Pe.target.setAttrs({x:-Rr*se.width,y:-ln*se.height,scaleX:1,scaleY:1}),R.set({cropX:Rr,cropY:ln,cropWidth:Et,cropHeight:xt})},Oe=()=>{R.type!=="svg"&&R.contentEditable&&setTimeout(()=>{R.toggleCropMode(!0)})},je=ae==="loading",Le=ae==="failed",Se=!je&&!Le,Je=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),xe=Se?R.a.opacity:0;(0,p.useFadeIn)(Y,xe);const Ke=R.selectable||F.role==="admin",Sr=(0,g.useMobile)();return a.default.createElement(a.default.Fragment,null,je&&a.default.createElement(M,{element:R}),Le&&a.default.createElement(U,{element:R}),a.default.createElement(u.Image,{ref:Y,name:"element",id:R.id,image:se,x:R.x,y:R.y,width:R.width||1,height:R.height||1,rotation:R.rotation,opacity:xe,shadowEnabled:R.shadowEnabled,shadowBlur:R.shadowBlur,shadowOffsetX:R.shadowOffsetX,shadowOffsetY:R.shadowOffsetY,shadowColor:R.shadowColor,shadowOpacity:R.shadowOpacity,customCrop:Ae,listening:Ke,cropX:Ae.x,cropY:Ae.y,cropWidth:Ae.width,cropHeight:Ae.height,draggable:Sr?R.draggable&&X:R.draggable,preventDefault:!Sr||X,hideInExport:!R.showInExport,onMouseEnter:()=>{K(!0)},onMouseLeave:()=>{K(!1)},onDragMove:Pe=>{R.set({x:Pe.target.x(),y:Pe.target.y()})},onDragEnd:Pe=>{R.set({x:Pe.target.x(),y:Pe.target.y()})},onDblClick:Oe,onDblTap:Oe,onTransformStart:()=>{V(!0),Je.current={cropX:R.cropX,cropY:R.cropY,cropWidth:R.cropWidth,cropHeight:R.cropHeight}},onTransform:Pe=>{var He;const et=Pe.currentTarget,Et=Math.abs(et.scaleX()-1)<1e-7?1:et.scaleX(),xt=Math.abs(et.scaleY()-1)<1e-7?1:et.scaleY();et.scaleX(1),et.scaleY(1);const ar=(He=Pe.target.getStage())===null||He===void 0?void 0:He.findOne("Transformer"),Rr=1-be/se.width,Lr=Math.min(Rr,Math.max(0,R.cropX)),ln=1-ye/se.height,De=Math.min(ln,Math.max(0,R.cropY)),it=ar.getActiveAnchor(),Qe=!(it.indexOf("middle")>=0||it.indexOf("center")>=0),kt=!Qe&&Et<1&&Je.current.cropHeight>ye/se.height;let tt=Qe?R.cropWidth:R.cropWidth*Et;kt&&(tt=R.cropWidth);const fr=!Qe&&xt<1&&Je.current.cropWidth>be/se.width;let ht=Qe?R.cropHeight:R.cropHeight*xt;fr&&(ht=R.cropHeight),Ee&&(tt=R.cropWidth,ht=R.cropHeight),R.set({cropX:Lr,cropY:De,x:et.x(),y:et.y(),width:et.width()*Et,height:et.height()*xt,rotation:Pe.target.rotation(),cropWidth:Math.min(tt,1-Lr),cropHeight:Math.min(ht,1-De)})},onTransformEnd:Pe=>{const He=Pe.currentTarget;R.set({width:He.width(),height:He.height(),x:He.x(),y:He.y(),rotation:Pe.target.rotation(),cropWidth:be/se.width,cropHeight:ye/se.height}),V(!1)}}),a.default.createElement(u.Rect,{x:R.x,y:R.y,width:Math.max(R.width-R.borderSize,0),height:Math.max(R.height-R.borderSize,0),opacity:xe,offsetX:-R.borderSize/2,offsetY:-R.borderSize/2,stroke:R.borderColor,strokeWidth:R.borderSize,listening:!1,visible:!!R.borderSize,rotation:R.rotation,cornerRadius:Math.max(0,Ze-R.borderSize),hideInExport:!R.showInExport}),!Q&&!F.isPlaying&&a.default.createElement(u.Image,{image:k,x:R.x+R.width/2-15/F.scale,y:R.y+R.height/2-15/F.scale,width:30/F.scale,height:30/F.scale,hideInExport:!0,onClick:()=>{ee(!0)}}),Q&&!F.isPlaying&&a.default.createElement(u.Image,{image:C,x:R.x+R.width/2-15/F.scale,y:R.y+R.height/2-15/F.scale,width:30/F.scale,height:30/F.scale,hideInExport:!0,onClick:()=>{ee(!1)}}),R._cropModeEnabled&&a.default.createElement(w.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/F.scale,y:-window.innerWidth/F.scale,width:window.innerWidth/F.scale*3,height:window.innerWidth/F.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:We,x:R.x,y:R.y,width:R.width,height:R.height,rotation:R.rotation,shadowEnabled:R.shadowEnabled,shadowBlur:R.shadowBlur}),a.default.createElement(u.Group,{x:R.x,y:R.y,rotation:R.rotation,scaleX:dt,scaleY:dt},a.default.createElement(u.Image,{image:se,ref:q,opacity:.4,draggable:!0,x:-R.cropX*se.width,y:-R.cropY*se.height,onDragMove:nt,onTransform:nt}),a.default.createElement(u.Transformer,{ref:he,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Pe,He)=>He.width<5||He.height<5?Pe:He,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:be,height:ye,ref:Bt,listening:!1,onTransform:Pe=>{Pe.target.x()<-R.cropX*se.width-1e-9&&(Pe.target.x(-R.cropX*se.width),Pe.target.scaleX(1)),Pe.target.y()<-R.cropY*se.height-1e-9&&(Pe.target.y(-R.cropY*se.height),Pe.target.scaleY(1));const He=Math.min(1,Math.max(0,R.cropX+Pe.target.x()/se.width)),et=Math.min(1,Math.max(0,Pe.target.y()/se.height+R.cropY)),Et=Pe.target.width()*Pe.target.scaleX(),xt=Pe.target.height()*Pe.target.scaleY(),ar=Math.min(1-He,Et/se.width),Rr=Math.min(1-et,xt/se.height),Lr=Pe.target.getAbsolutePosition(Pe.target.getParent().getParent());Pe.target.scale({x:1,y:1}),Pe.target.position({x:0,y:0}),R.set({x:Lr.x,y:Lr.y,cropX:He,cropY:et,cropWidth:ar,cropHeight:Rr,width:Math.min(Et*dt,se.width*(1-He)*dt),height:Math.min(xt*dt,se.height*(1-et)*dt)})}}),a.default.createElement(u.Transformer,{ref:ue,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Pe,He)=>He.width<5||He.height<5?Pe:He,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(G||X)&&a.default.createElement(b.Highlighter,{element:R}))})})(ES);var OS={},_0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.figureToSvg=e.subTypeToPathDataFunc=e.TYPES=e.crossPath=e.speechBubblePath=e.hexagonPath=e.pentagonPath=e.diamondPath=e.starPath=e.circleData=e.rightTriangleData=e.triangleData=e.rectData=void 0;const t=({width:y,height:m,cornerRadius:p})=>{if(p>0){const g=Math.min(p,y/2,m/2);return`M 0 ${g} A ${g} ${g} 0 0 1 ${g} 0 L ${y-g} 0 A ${g} ${g} 0 0 1 ${y} ${g} L ${y} ${m-g} A ${g} ${g} 0 0 1 ${y-g} ${m} L ${g} ${m} A ${g} ${g} 0 0 1 0 ${m-g} Z`}return`M 0 0 L ${y} 0 L ${y} ${m} L 0 ${m} Z`};e.rectData=t;const r=({width:y,height:m})=>`M ${y/2} 0 L ${y} ${m} L 0 ${m} Z`;e.triangleData=r;const n=({width:y,height:m})=>`M 0 0 L ${y} 0 L 0 ${m} Z`;e.rightTriangleData=n;const i=({width:y,height:m})=>`M ${y/2} ${m/2} m -${y/2}, 0 a ${y/2},${m/2} 0 1,0 ${y},0 a ${y/2},${m/2} 0 1,0 -${y},0`;function a({width:y,height:m}){const p=y/2,g=m/2,d=y/2,_=m/2,O=d/2,k=_/2;let C="",S=Math.PI/5;for(let x=0;x<10;x++){const P=x%2==0?_:k,T=p+(x%2==0?d:O)*Math.sin(x*S),L=g-P*Math.cos(x*S);x===0?C=`M ${T} ${L}`:C+=` L ${T} ${L}`}return C+" Z"}function o({width:y,height:m}){const p=y/2,g=m/2;return`M ${p} 0 L ${y} ${g} L ${p} ${m} L 0 ${g} Z`}function l({width:y,height:m}){const p=y/2,g=m/2,d=y/2,_=m/2;let O="",k=2*Math.PI/5;for(let C=0;C<5;C++){const S=_,x=p+d*Math.sin(C*k),P=g-S*Math.cos(C*k);C===0?O=`M ${x} ${P}`:O+=` L ${x} ${P}`}return O+" Z"}function u({width:y,height:m}){const p=y/2,g=m/2,d=y/2,_=m/2;let O="",k=2*Math.PI/6;for(let C=0;C<6;C++){const S=_,x=p+d*Math.sin(C*k),P=g-S*Math.cos(C*k);C===0?O=`M ${x} ${P}`:O+=` L ${x} ${P}`}return O+" Z"}function f({path:y,aspectRatio:m,width:p,height:g}){return{path:y,scaleX:p/m.width,scaleY:g/m.height}}function v({width:y,height:m}){const p=.1*Math.min(y,m),g=.2*y,d=.2*m,_=.5*y;let O=`M ${p},0`;return O+=" H "+(y-p),O+=` A ${p},${p} 0 0 1 ${y},${p}`,O+=" V "+(m-p-d),O+=` A ${p},${p} 0 0 1 ${y-p},${m-d}`,O+=` H ${_+g/2}`,O+=` L ${_},${m}`,O+=` L ${_-g/2},${m-d}`,O+=` H ${p}`,O+=` A ${p},${p} 0 0 1 0,${m-p-d}`,O+=` V ${p}`,O+=` A ${p},${p} 0 0 1 ${p},0`,O+=" Z",O}function w({width:y,height:m}){const p=.3*y,g=.3*m,d=y/2,_=m/2,O=d-p/2,k=d+p/2,C=_-g/2,S=_+g/2;let x=`M ${O},0 `;return x+=`H ${k} `,x+=`V ${C} `,x+=`H ${y} `,x+=`V ${S} `,x+=`H ${k} `,x+=`V ${m} `,x+=`H ${O} `,x+=`V ${S} `,x+="H 0 ",x+=`V ${C} `,x+=`H ${O} `,x+="V 0 ",x+="Z",x}function b(y){return e.TYPES[y]||e.rectData}function h(y,m){const{width:p,height:g,fill:d,stroke:_,strokeWidth:O,dash:k}=y,C=(k||[]).map(L=>L*O);let S=m(y),x=1,P=1;typeof S!="string"&&(x=S.scaleX,P=S.scaleY,S=S.path);const T=`clip-${y.id||Math.random()}`;return`
218
+ <svg xmlns="http://www.w3.org/2000/svg" width="${p}" height="${g}">
219
+ <defs>
220
+ <clipPath id="${T}">
221
+ <path d="${S}" />
222
+ </clipPath>
223
+ </defs>
224
+
225
+ <!-- Path for the fill -->
226
+ <path d="${S}" fill="${d}" transform="scale(${x}, ${P})"/>
227
+
228
+ <!-- Path for the stroke, clipped by the star path -->
229
+ <path d="${S}" fill="none" stroke="${_}" stroke-width="${2*O}" clip-path="url(#${T})" transform="scale(${x}, ${P})" stroke-dasharray="${C.join(" ")}"/>
230
+ </svg>
231
+ `}function E(y){const{subType:m}=y,p=b(m);return p?h(y,p):(console.error(`Polotno error: Can not convert ${y.subType} figure to svg.`),(0,e.rectData)(y))}e.circleData=i,e.starPath=a,e.diamondPath=o,e.pentagonPath=l,e.hexagonPath=u,e.speechBubblePath=v,e.crossPath=w,e.TYPES={rect:e.rectData,circle:e.circleData,star:a,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:o,pentagon:l,hexagon:u,speechBubble:v,cross:w,arc:({width:y,height:m})=>f({path:"M234 117C234 85.97 221.673 56.21 199.731 34.269C177.79 12.327 148.03 0 117 0C85.97 0 56.2103 12.327 34.2685 34.268C12.3268 56.21 0 85.97 0 117H117H234Z",aspectRatio:{width:234,height:117},width:y,height:m}),cloud:({width:y,height:m})=>f({path:"M216.41 57.006C216.961 54.084 217.249 51.069 217.249 47.986C217.249 21.4841 195.972 0 169.725 0C153.666 0 139.467 8.043 130.865 20.3575C122.606 13.3566 111.954 9.1402 100.327 9.1402C74.3322 9.1402 53.2123 30.2136 52.8094 56.364H52.8035C23.6407 56.364 0 80.235 0 109.682C0 139.129 23.6407 163 52.8035 163H208.197C237.359 163 261 139.129 261 109.682C261 83.056 241.672 60.99 216.41 57.006Z",aspectRatio:{width:261,height:163},width:y,height:m}),rightArrow:({width:y,height:m})=>{const p=.6*y;return`M 0 ${m/4} L ${p} ${m/4} L ${p} 0 L ${y} ${m/2} L ${p} ${m} L ${p} ${.75*m} L 0 ${.75*m} Z`},leftArrow:({width:y,height:m})=>{const p=.4*y;return`M ${y} ${m/4} L ${p} ${m/4} L ${p} 0 L 0 ${m/2} L ${p} ${m} L ${p} ${.75*m} L ${y} ${.75*m} Z`},downArrow:({width:y,height:m})=>{const p=.6*m;return`M ${y/4} 0 L ${y/4} ${p} L 0 ${p} L ${y/2} ${m} L ${y} ${p} L ${.75*y} ${p} L ${.75*y} 0 Z`},upArrow:({width:y,height:m})=>{const p=.4*m;return`M ${y/4} ${m} L ${y/4} ${p} L 0 ${p} L ${y/2} 0 L ${y} ${p} L ${.75*y} ${p} L ${.75*y} ${m} Z`},asterisk1:({width:y,height:m})=>f({path:"M45.5265 218.498C51.5466 222.87 58.5359 224.98 65.4742 224.98C75.916 224.98 86.221 220.2 92.853 211.217C92.872 211.198 92.89 211.178 92.907 211.157C92.923 211.136 92.939 211.115 92.954 211.094L92.977 211.061C92.993 211.039 93.008 211.017 93.023 210.996L116.491 178.725L139.959 210.996C139.982 211.031 140.006 211.058 140.029 211.088C140.04 211.102 140.05 211.116 140.061 211.132C151.115 226.188 172.355 229.505 187.473 218.515C202.608 207.526 205.992 186.278 195.074 171.104L195.05 171.066C195.03 171.034 195.014 171.01 194.989 170.985L171.572 138.696L209.512 126.346C227.334 120.545 237.129 101.305 231.33 83.476C225.532 65.648 206.315 55.8493 188.476 61.6334L150.537 73.933L150.52 34.0064C150.502 15.2594 135.248 0 116.508 0C97.768 0 82.514 15.2594 82.497 34.0234L82.463 73.916L44.5233 61.6163C44.5083 61.6163 44.49 61.613 44.4716 61.6078C44.4477 61.6014 44.4232 61.5918 44.4041 61.5823C26.5992 55.8664 7.45076 65.665 1.66886 83.46C-4.11314 101.254 5.61427 120.426 23.3511 126.278C23.3675 126.283 23.3822 126.289 23.3963 126.295L23.4588 126.319L23.4873 126.329L61.4098 138.679L37.9929 170.968C37.9844 170.985 37.9718 171.002 37.9591 171.019C37.9462 171.036 37.9336 171.053 37.9251 171.07C26.9903 186.244 30.3915 207.509 45.5265 218.498Z",aspectRatio:{width:233,height:225},width:y,height:m}),asterisk2:({width:y,height:m})=>f({path:"M46.0556 112L0 85.388L33.9456 26.6121L80.028 53.1781L80.054 0H147.946L147.972 53.1781L194.054 26.6121L228 85.388L181.944 112L228 138.612L194.054 197.388L147.972 170.822L147.946 224H80.054L80.028 170.822L33.9456 197.388L0 138.612L46.0556 112Z",aspectRatio:{width:228,height:224},width:y,height:m}),bookmark:({width:y,height:m})=>f({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:y,height:m}),butterfly:({width:y,height:m})=>f({path:"M94.5 100.713C91.935 150.916 50.703 190.909 0 191.493V0C50.703 0.5845 91.935 40.5767 94.5 90.78C97.031 41.2385 137.217 1.6407 187 0.0438004V191.45C137.217 189.853 97.031 150.255 94.5 100.713Z",aspectRatio:{width:187,height:192},width:y,height:m}),cylinder:({width:y,height:m})=>f({path:"M169 36.8497V218.15C169 238.502 131.168 255 84.5 255C37.832 255 0 238.502 0 218.15V36.8497C0 16.4982 37.832 0 84.5 0C131.168 0 169 16.4982 169 36.8497Z",aspectRatio:{width:169,height:255},width:y,height:m}),diamond2:({width:y,height:m})=>f({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:y,height:m}),door:({width:y,height:m})=>f({path:"M140 69.697C140 31.2044 108.66 0 70 0C31.34 0 0 31.2044 0 69.697V207H140V69.697Z",aspectRatio:{width:140,height:207},width:y,height:m}),drop1:({width:y,height:m})=>f({path:"M167 150.687C167 196.328 129.407 234 83.139 234C37.593 234 0 196.328 0 150.687C0 100.7 51.329 36.9474 83.139 0C114.948 39.1207 167 98.526 167 150.687Z",aspectRatio:{width:167,height:234},width:y,height:m}),drop2:({width:y,height:m})=>f({path:"M73 239C53.64 239 35.071 231.315 21.3812 217.634C7.691 203.954 0 185.4 0 166.054C0 136.091 13.8696 113.633 30.768 86.27C43.912 64.9877 58.888 40.7377 70.597 7.6816C71.281 5.7496 72.989 0 72.989 0C72.989 0 72.993 0.0124998 73 0.0363998C73.007 0.0124998 73.011 0 73.011 0C73.011 0 74.719 5.7496 75.403 7.6816C87.112 40.7377 102.088 64.9877 115.232 86.27C132.13 113.633 146 136.091 146 166.054C146 185.4 138.309 203.954 124.619 217.634C111.025 231.218 92.225 239 73 239Z",aspectRatio:{width:146,height:239},width:y,height:m}),explosion:({width:y,height:m})=>f({path:"M165.802 184.465L118.997 260L125.343 182.079L34.9058 219.45L99.164 159.817L0 163.792L78.538 134.373L0 74.7401L86.471 89.052V0L118.997 89.052L165.802 10.3364L149.143 97.798L217.368 29.419L165.802 112.905L245.927 81.101L165.802 143.914H261L165.802 184.465Z",aspectRatio:{width:261,height:260},width:y,height:m}),flag:({width:y,height:m})=>f({path:"M0 142.161C0 142.161 51.9956 118.626 103 137.469C159.992 158.525 206 141.31 206 141.31V11.1373C206 11.1373 160 28.3218 103.016 7.28273C52 -11.553 0 12.0974 0 12.0974V142.161Z",aspectRatio:{width:206,height:148},width:y,height:m}),flower:({width:y,height:m})=>f({path:"M135.351 66.1893C196.683 -5.00591 256.536 100.304 164.908 117.361C256.536 135.16 195.944 239.728 135.351 168.532C166.386 257.526 45.9394 256.785 76.975 168.532C15.643 239.728 -44.2109 135.16 47.4173 117.361C-44.9498 100.304 15.643 -4.26431 76.975 66.1893C45.2005 -22.0631 166.386 -22.0631 135.351 66.1893ZM105.793 104.012C113.183 104.012 119.833 109.945 119.833 117.361C119.833 124.777 113.183 131.452 105.793 131.452C98.404 131.452 92.492 124.777 92.492 117.361C92.492 109.945 98.404 104.012 105.793 104.012Z",aspectRatio:{width:212,height:235},width:y,height:m}),frame:({width:y,height:m})=>f({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:y,height:m}),heart1:({width:y,height:m})=>f({path:"M215.886 56.157C215.886 24.729 191.112 0 160.584 0C135.933 0 115.08 16.983 107.937 39.93C100.788 16.986 79.935 0.591 55.284 0.591C24.75 0.591 0 24.615 0 56.055C0 71.919 6.321 83.127 16.494 95.121L107.988 189.447L199.377 95.121C209.559 83.127 215.886 72.009 215.886 56.157Z",aspectRatio:{width:216,height:190},width:y,height:m}),home:({width:y,height:m})=>f({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:y,height:m}),home2:({width:y,height:m})=>f({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:y,height:m}),hourglass:({width:y,height:m})=>f({path:"M0.392782 0H187.607C193.014 43.3688 140.804 53.797 140.804 97.5C140.804 141.203 193.014 151.631 187.607 195H0.392782C-5.01452 151.631 47.196 141.203 47.196 97.5C47.196 53.797 -5.01452 43.3688 0.392782 0Z",aspectRatio:{width:188,height:195},width:y,height:m}),house:({width:y,height:m})=>f({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:y,height:m}),keyhole:({width:y,height:m})=>f({path:"M115 57.0494C115 25.5387 89.416 0 57.863 0C26.311 0 0.726898 25.5414 0.726898 57.0494C0.726898 78.652 12.759 97.451 30.505 107.136L0 219H114.845L84.448 107.524C102.608 97.962 115 78.959 115 57.0494Z",aspectRatio:{width:115,height:219},width:y,height:m}),kiss:({width:y,height:m})=>f({path:"M124.5 17.1468C80.036 -36.5162 0 52.9218 0 52.9218C0 52.9218 44.4643 120 124.5 120C204.536 120 249 52.9218 249 52.9218C249 52.9218 168.964 -36.5162 124.5 17.1468Z",aspectRatio:{width:249,height:120},width:y,height:m}),leaf:({width:y,height:m})=>f({path:"M204.414 0.0151567C204.414 0.0151567 206.837 93.9509 150.394 150.394C93.9507 206.837 0.0151569 204.413 0.0151569 204.413C0.0151569 204.413 -2.40835 110.478 54.0347 54.0349C110.478 -2.40834 204.414 0.0151567 204.414 0.0151567Z",aspectRatio:{width:205,height:205},width:y,height:m}),lightning1:({width:y,height:m})=>f({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:y,height:m}),lightning2:({width:y,height:m})=>f({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:y,height:m}),magnet:({width:y,height:m})=>f({path:"M88.402 0H0V67.669H88.402C105.271 67.669 118.957 81.308 118.957 98C118.957 114.689 105.271 128.331 88.402 128.331H0V196H88.402C142.747 196 187 152.072 187 98C187 43.9279 142.747 0 88.402 0Z",aspectRatio:{width:187,height:196},width:y,height:m}),mithosis:({width:y,height:m})=>f({path:"M150.996 136.45C137.141 128.926 117.559 128.7 103.532 135.896C93.843 140.867 82.875 143.67 71.2577 143.67C31.9033 143.67 0 111.508 0 71.835C0 32.161 31.9033 0 71.2577 0C83.467 0 94.959 3.0955 105.004 8.5504C118.859 16.0745 138.441 16.3 152.467 9.1038C162.157 4.1328 173.125 1.3303 184.742 1.3303C224.097 1.3303 256 33.492 256 73.165C256 112.839 224.097 145 184.742 145C172.533 145 161.041 141.905 150.996 136.45Z",aspectRatio:{width:256,height:145},width:y,height:m}),orangeRicky:({width:y,height:m})=>f({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:y,height:m}),party:({width:y,height:m})=>f({path:"M134.622 0L144.682 68.2539L174.415 5.9977L163.91 74.1846L210.671 23.4578L180.535 85.519L240.169 50.8289L193.079 101.25L260.29 85.679L200.43 119.98L269.245 124.911L201.934 140.044L266.237 165.04L197.456 159.661L251.535 202.5L187.396 177.086L226.445 233.962L172.646 190.771L193.197 256.631L154.518 199.501L154.743 268.492L134.622 202.5L114.501 268.492L114.727 199.501L76.0482 256.631L96.5985 190.771L42.7992 233.962L81.8489 177.086L17.7091 202.5L71.7885 159.661L3.0072 165.04L67.3112 140.044L0 124.911L68.8149 119.98L8.9545 85.679L76.1658 101.25L29.0753 50.8289L88.7105 85.519L58.5743 23.4578L105.335 74.1846L94.8305 5.9977L124.562 68.2539L134.622 0Z",aspectRatio:{width:270,height:269},width:y,height:m}),pillow:({width:y,height:m})=>f({path:"M176 0.00169945C157.812 16.9062 125.203 28.174 88.001 28.174C50.798 28.174 18.1881 16.9054 0 0V258.421C18.1882 241.516 50.798 230.248 88 230.248C125.202 230.248 157.812 241.516 176 258.421V0.00169945Z",aspectRatio:{width:176,height:259},width:y,height:m}),polygon:({width:y,height:m})=>f({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:y,height:m}),rainbow:({width:y,height:m})=>f({path:"M186.907 141H282C282 63.128 218.872 0 141 0C63.1278 0 0 63.128 0 141H95.093C95.093 115.646 115.646 95.093 141 95.093C166.354 95.093 186.907 115.646 186.907 141Z",aspectRatio:{width:282,height:141},width:y,height:m}),rhodeIsland:({width:y,height:m})=>f({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:y,height:m}),shell:({width:y,height:m})=>f({path:"M109 0C169.199 0 218 48.743 218 108.87C185.392 108.87 158.958 135.273 158.958 167.842C158.958 179.736 158.958 191 158.958 191H59.042C59.042 191 59.042 179.736 59.042 167.842C59.042 135.273 32.6077 108.87 0 108.87C0 48.743 48.8007 0 109 0Z",aspectRatio:{width:218,height:191},width:y,height:m}),shield1:({width:y,height:m})=>f({path:"M203.184 30.7277C142.457 30.7277 102.853 0 102.853 0C102.853 0 63.249 30.7277 3.05098 30.7277C3.05098 30.7277 -3.81372 128.209 3.05098 162.115C9.38758 193.902 102.853 249 102.853 249C102.853 249 196.319 193.902 203.184 162.115C209.52 128.738 203.184 30.7277 203.184 30.7277Z",aspectRatio:{width:206,height:249},width:y,height:m}),shield2:({width:y,height:m})=>f({path:"M0 12.9585C64.624 -4.3195 136.376 -4.3195 201 12.9585C201 51.0564 201 89.154 201 127.252C201 184.396 100.498 240 100.498 240C100.498 240 0 184.406 0 127.252C0 89.154 0 51.0564 0 12.9585Z",aspectRatio:{width:201,height:240},width:y,height:m}),skewedRectangle:({width:y,height:m})=>f({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:y,height:m}),softFlower:({width:y,height:m})=>f({path:"M109 0C80.073 0 56.6234 23.4498 56.6234 52.3766C56.6234 54.722 54.722 56.6234 52.3766 56.6234C23.4498 56.6234 0 80.073 0 109C0 137.927 23.4498 161.377 52.3766 161.377C54.722 161.377 56.6234 163.278 56.6234 165.623C56.6234 194.55 80.073 218 109 218C137.927 218 161.377 194.55 161.377 165.623C161.377 163.278 163.278 161.377 165.623 161.377C194.55 161.377 218 137.927 218 109C218 80.073 194.55 56.6234 165.623 56.6234C163.278 56.6234 161.377 54.722 161.377 52.3766C161.377 23.4498 137.927 0 109 0Z",aspectRatio:{width:218,height:218},width:y,height:m}),softStar:({width:y,height:m})=>f({path:"M130.424 3.17662C130.927 -1.05888 137.073 -1.05888 137.576 3.17662L141.792 38.7086C147.236 84.59 183.41 120.764 229.291 126.208L264.823 130.424C269.059 130.927 269.059 137.073 264.823 137.576L229.291 141.792C183.41 147.236 147.236 183.41 141.792 229.291L137.576 264.823C137.073 269.059 130.927 269.059 130.424 264.823L126.208 229.291C120.764 183.41 84.59 147.236 38.7086 141.792L3.17662 137.576C-1.05888 137.073 -1.05888 130.927 3.17662 130.424L38.7086 126.208C84.59 120.764 120.764 84.59 126.208 38.7086L130.424 3.17662Z",aspectRatio:{width:268,height:268},width:y,height:m}),stairs1:({width:y,height:m})=>f({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:y,height:m}),stairs2:({width:y,height:m})=>f({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:y,height:m}),teewee:({width:y,height:m})=>f({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:y,height:m}),blob1:({width:y,height:m})=>f({path:"M172.979 19.611C191.285 33.0858 204.505 54.442 210.861 78.5949C217.471 103.002 217.471 130.46 205.776 151.816C194.335 173.427 171.454 189.444 147.047 196.054C122.639 202.919 96.7069 200.631 75.3506 190.715C54.2486 180.546 37.7229 163.003 23.4855 142.155C9.5022 121.307 -2.19289 97.4087 0.349524 74.7813C3.14617 52.1538 19.9261 30.7976 40.2654 17.8313C60.6046 4.61077 84.5033 -0.474048 108.148 0.0344341C131.538 0.542916 154.928 6.13621 172.979 19.611Z",aspectRatio:{width:216,height:200},width:y,height:m}),blob10:({width:y,height:m})=>f({path:"M188.684 8.95173C205.601 24.3309 200.988 63.0866 191.453 99.3816C182.225 135.677 168.076 169.511 146.238 175.355C124.399 181.507 94.871 159.668 66.5733 143.059C37.9679 126.449 10.5929 115.068 2.59569 95.0754C-5.4015 75.0824 5.97912 46.1694 24.4342 30.4826C42.8893 14.7958 68.4188 12.0276 100.715 6.79864C132.704 1.5697 171.767 -6.42749 188.684 8.95173Z",aspectRatio:{width:200,height:177},width:y,height:m}),blob11:({width:y,height:m})=>f({path:"M137.368 29.4923C148.97 46.7605 146.542 72.1231 148.161 99.1046C149.779 126.086 155.715 154.956 144.113 174.383C132.781 193.81 103.911 203.793 80.4369 198.666C56.963 193.27 38.6156 173.034 28.3626 153.607C17.8398 134.181 15.4115 115.833 9.47555 91.5498C3.53961 67.2664 -5.63411 37.3169 4.61887 20.0488C15.1417 2.51078 45.0911 -1.80626 72.8821 0.622074C100.673 2.78059 126.036 12.2241 137.368 29.4923Z",aspectRatio:{width:152,height:200},width:y,height:m}),blob12:({width:y,height:m})=>f({path:"M158.391 17.923C172.491 28.5703 180.261 48.1384 187.743 70.5842C194.937 93.3177 202.419 118.641 194.649 138.785C187.167 158.928 164.146 173.317 138.535 184.54C112.923 196.05 84.4347 204.108 58.8235 197.777C33.2123 191.446 10.191 170.439 2.99688 146.267C-4.48504 121.807 3.57241 94.181 10.4788 68.282C17.0974 42.0953 22.565 17.6352 37.8166 7.27563C53.0682 -3.37171 78.1038 0.081487 100.837 2.67138C123.859 5.26127 144.29 7.27563 158.391 17.923Z",aspectRatio:{width:198,height:200},width:y,height:m}),blob13:({width:y,height:m})=>f({path:"M149.668 1.37595C170.663 5.22017 193.728 17.3442 198.755 34.7911C204.078 52.2379 191.363 75.3032 178.943 93.9329C166.819 112.563 154.99 126.757 140.501 145.386C126.011 164.312 108.86 187.673 92.5957 186.194C76.3317 185.011 60.9549 159.285 45.8737 140.655C30.4968 122.321 15.7114 110.788 7.43151 95.1157C-0.848339 79.4432 -2.32688 59.0392 3.5873 41.5924C9.50148 23.8498 23.1041 8.76868 38.7767 3.44592C54.745 -1.87685 73.3746 2.55879 91.7086 2.26308C110.338 2.26308 128.968 -2.17256 149.668 1.37595Z",aspectRatio:{width:200,height:187},width:y,height:m}),blob14:({width:y,height:m})=>f({path:"M137.838 28.6426C150.711 40.5617 165.014 46.5213 178.363 58.2021C191.474 69.8828 203.87 87.0464 198.864 99.6807C193.858 112.315 171.689 120.42 157.862 135.676C144.275 151.171 139.269 173.579 126.873 182.161C114.477 190.505 94.9294 185.022 76.8123 178.109C58.4568 171.196 41.5316 163.091 28.1822 150.456C14.5943 137.822 4.58225 120.42 1.24488 101.826C-2.09248 83.2322 1.00651 62.9697 13.8792 52.4809C26.7519 41.992 49.1598 41.0385 65.6083 30.788C82.0567 20.5376 92.0688 0.990158 103.034 0.0366268C113.762 -0.916905 125.204 16.9618 137.838 28.6426Z",aspectRatio:{width:200,height:187},width:y,height:m}),blob15:({width:y,height:m})=>f({path:"M185.203 1.52939C197.679 7.62217 200 32.2835 200 51.7223C200 71.1612 197.389 85.3777 197.679 100.175C198.259 114.681 201.741 129.768 198.259 143.114C194.778 156.46 184.623 168.356 171.567 173.868C158.801 179.671 143.134 179.091 130.368 174.739C117.312 170.387 106.867 162.263 86.8482 160.812C66.539 159.362 36.9454 164.294 18.9572 155.3C0.968966 146.306 -5.41395 123.095 5.03083 105.977C15.4756 88.5692 42.4579 77.5442 55.5139 59.5559C68.2798 41.8578 67.1192 17.4867 76.9837 9.6531C86.5581 2.10965 107.158 11.3939 128.627 9.6531C150.097 8.20244 172.728 -4.27327 185.203 1.52939Z",aspectRatio:{width:200,height:179},width:y,height:m}),blob16:({width:y,height:m})=>f({path:"M158.441 55.3221C167.253 80.2399 160.264 105.462 147.501 134.938C134.738 164.717 116.81 199.055 97.0576 199.967C77.3057 201.182 55.7305 168.668 34.4592 133.722C13.1879 99.0802 -7.77953 62.3112 2.85612 36.4818C13.4918 10.6523 56.0344 -3.93369 90.0685 0.928322C123.799 6.09421 149.324 30.7081 158.441 55.3221Z",aspectRatio:{width:163,height:200},width:y,height:m}),blob17:({width:y,height:m})=>f({path:"M168.917 36.7587C178.871 53.2457 175.138 76.5764 172.961 106.129C170.472 135.37 169.85 170.832 150.563 187.63C131.276 204.739 93.3252 203.495 65.0173 187.63C36.7095 172.077 18.0449 142.213 7.77943 107.373C-2.79714 72.2213 -4.35252 32.7147 14.312 14.0502C32.9765 -4.3033 72.1721 -1.50361 103.591 4.7179C135.32 10.6283 158.962 20.2717 168.917 36.7587Z",aspectRatio:{width:176,height:200},width:y,height:m}),blob18:({width:y,height:m})=>f({path:"M178.188 21.1464C193.012 36.3069 196.381 62.9219 198.739 88.1893C200.76 113.12 201.771 136.366 190.316 149.168C178.862 162.307 155.279 164.665 135.065 167.697C115.188 170.73 99.0168 174.098 72.4018 177.131C46.1237 180.163 9.40176 182.521 1.65309 168.371C-6.09559 154.221 15.4659 123.564 23.5515 92.9059C31.6371 62.2481 26.2467 31.2534 38.3751 15.4192C50.1665 -0.0781831 79.8136 -1.08888 107.776 0.595609C136.076 1.9432 163.028 5.64909 178.188 21.1464Z",aspectRatio:{width:200,height:180},width:y,height:m}),blob19:({width:y,height:m})=>f({path:"M148.621 13.3857C171.945 24.3818 194.937 41.3756 192.938 60.702C190.605 80.3615 163.282 101.687 149.953 123.346C136.958 145.005 137.958 166.664 128.295 174.661C118.631 182.325 98.3054 175.994 73.6476 181.991C48.9899 187.989 20.0004 205.983 11.0036 197.986C1.67366 189.989 12.6697 156.001 12.3365 131.343C12.0033 106.685 0.340809 91.0243 0.00759636 75.0301C-0.325616 59.0359 10.3372 42.3753 25.3318 28.7135C39.9931 15.0518 58.9863 4.05578 80.3119 1.05687C101.638 -2.27526 124.962 2.38972 148.621 13.3857Z",aspectRatio:{width:194,height:200},width:y,height:m}),blob2:({width:y,height:m})=>f({path:"M140.464 18.6393C156.081 28.3718 169.887 39.9149 178.714 54.853C187.541 69.5649 191.389 87.6717 189.578 104.421C187.768 121.396 180.525 137.239 172.377 153.535C164.455 169.832 155.854 186.58 142.048 194.276C128.241 201.971 109.456 200.613 92.4804 197.671C75.2789 194.502 60.1144 189.749 45.1762 182.733C30.4644 175.716 16.2052 166.21 8.28346 153.083C0.361703 139.729 -1.44898 122.527 1.04072 106.91C3.30408 91.2931 9.64147 76.8076 15.9789 60.5114C22.0899 44.2153 28.201 26.1084 40.6495 14.7916C53.0979 3.24849 71.8838 -1.27823 89.7643 0.306124C107.871 1.66414 124.846 9.13322 140.464 18.6393Z",aspectRatio:{width:191,height:200},width:y,height:m}),blob20:({width:y,height:m})=>f({path:"M150.035 13.2464C157.376 24.9386 153.026 48.323 157.92 65.7254C163.087 83.1277 177.498 94.2761 182.392 108.415C187.287 122.555 182.392 139.957 173.147 156.272C163.63 172.587 149.763 187.814 132.089 195.155C114.414 202.225 93.2053 201.137 73.6276 194.611C54.3219 188.357 36.9196 176.937 25.7712 161.438C14.8947 145.667 10.5441 126.09 5.92163 105.696C1.57105 85.0311 -3.05145 63.5501 2.65869 45.0601C8.64075 26.5701 24.6835 11.0711 43.1735 4.54524C61.6635 -1.98064 82.6007 0.194657 102.722 1.01039C122.844 1.82613 142.421 1.55421 150.035 13.2464Z",aspectRatio:{width:185,height:200},width:y,height:m}),blob21:({width:y,height:m})=>f({path:"M152.611 0.184799C172.596 -0.723643 197.73 1.39606 199.85 13.8114C201.969 26.2268 181.075 48.9379 174.716 68.0151C168.357 87.0924 176.533 102.536 174.11 114.649C171.991 127.064 159.575 136.148 146.252 139.782C132.928 143.719 118.696 141.902 105.977 139.176C93.562 136.451 82.6606 132.212 63.2805 131.909C43.9004 131.606 16.0416 135.24 5.44306 125.853C-5.15543 116.465 1.50648 94.0572 10.2881 76.4939C18.7669 59.2335 29.6682 46.8182 38.7526 35.3112C48.1398 23.5015 56.3158 12.903 66.9143 8.36078C77.5128 4.12138 91.1394 6.24108 104.766 5.63546C118.696 4.72701 132.928 1.09324 152.611 0.184799Z",aspectRatio:{width:200,height:143},width:y,height:m}),blob22:({width:y,height:m})=>f({path:"M195.507 15.5715C206.818 33.1668 193.622 69.3001 190.166 101.663C186.71 134.34 193.308 163.561 181.996 178.014C170.685 192.153 141.464 191.525 114.443 189.326C87.1072 187.44 62.2852 183.67 40.6052 169.531C19.2395 155.077 1.6441 130.255 0.0730908 103.862C-1.18372 77.4694 13.898 49.5054 35.2638 31.91C56.6296 14.0004 84.5936 6.45958 116.328 2.37494C148.063 -1.70969 184.196 -2.3381 195.507 15.5715Z",aspectRatio:{width:200,height:191},width:y,height:m}),blob23:({width:y,height:m})=>f({path:"M135.742 9.14189C157.815 19.2326 179.258 38.4681 176.105 56.7576C172.951 74.7317 145.202 92.0751 127.858 109.734C110.83 127.077 104.523 145.052 87.4953 164.918C70.4672 184.468 42.7177 206.227 27.5816 198.343C12.4455 190.46 9.60747 153.566 6.45411 126.762C2.98542 100.274 -0.798607 84.1917 0.147399 67.1636C0.77807 50.4508 6.76944 32.4767 19.0675 20.8093C31.0503 9.14189 49.6551 3.78119 70.4672 1.2585C90.964 -1.26418 113.668 -0.633508 135.742 9.14189Z",aspectRatio:{width:177,height:200},width:y,height:m}),blob24:({width:y,height:m})=>f({path:"M165.663 24.3715C171.555 44.4059 158.003 76.2254 151.816 96.2598C145.923 116.294 147.691 124.544 148.28 135.445C148.575 146.346 147.396 159.309 140.62 170.8C133.549 181.996 120.88 191.424 104.381 196.432C87.8821 201.441 67.553 202.03 54.8841 192.602C41.9207 183.469 36.6174 164.023 25.1271 143.105C13.3421 122.187 -4.33535 99.7953 0.967891 85.0641C6.27113 70.6275 34.2604 63.8511 56.0626 48.5307C77.5702 33.5048 92.8907 9.93489 113.22 2.56928C133.843 -4.79633 159.77 4.04241 165.663 24.3715Z",aspectRatio:{width:168,height:200},width:y,height:m}),blob25:({width:y,height:m})=>f({path:"M180.115 1.256C192.651 2.1962 189.83 34.163 190.771 58.2947C191.711 82.4265 196.098 98.4099 198.606 117.214C201.113 136.018 201.426 157.642 189.204 165.791C177.294 173.626 153.163 167.671 135.299 163.91C117.749 159.836 106.466 157.956 85.7818 162.97C65.0974 168.298 35.3244 180.521 18.7143 174.253C1.79068 167.985 -1.97012 142.913 0.850478 120.975C3.67107 99.0367 13.0731 79.6059 18.4009 54.8473C23.7287 30.0888 24.9823 -0.310996 40.0254 0.00240332C54.7552 0.00240332 82.9612 31.029 111.167 31.029C139.373 31.029 167.579 0.315802 180.115 1.256Z",aspectRatio:{width:200,height:176},width:y,height:m}),blob26:({width:y,height:m})=>f({path:"M142.571 0.586925C159.976 3.39414 176.258 15.1844 184.96 30.9048C193.662 46.6253 194.224 66.8372 189.171 83.6805C183.837 100.805 172.327 114.56 163.064 129.157C153.8 143.755 146.501 158.914 134.43 173.231C122.359 187.828 105.516 201.303 89.5146 199.899C73.2327 198.776 58.0738 182.775 42.9148 169.862C28.0366 157.23 13.7198 147.685 6.42103 134.491C-0.877729 121.297 -1.15845 103.892 1.64876 88.4528C4.45598 72.7324 10.0704 58.6963 18.4921 47.4674C27.1944 36.2386 38.4233 27.8169 50.4943 22.2025C62.846 16.3073 75.7592 13.5001 91.1989 8.72785C106.919 4.23631 125.166 -1.93957 142.571 0.586925Z",aspectRatio:{width:193,height:200},width:y,height:m}),blob27:({width:y,height:m})=>f({path:"M112.602 54.9337C129.225 71.8646 155.391 78.9448 158.777 89.719C162.471 100.493 143.693 114.654 127.07 135.586C110.447 156.519 96.2866 184.224 71.0442 194.998C46.1096 205.465 10.4008 199.308 2.0893 178.375C-6.22223 157.443 12.5557 121.734 18.4045 92.1817C24.5612 62.6296 17.7889 38.9263 26.4082 21.9954C34.7197 5.06454 58.423 -5.40183 73.5069 2.9097C88.8986 10.9134 95.9788 38.0028 112.602 54.9337Z",aspectRatio:{width:160,height:200},width:y,height:m}),blob28:({width:y,height:m})=>f({path:"M125.281 68.5835C142.15 82.9923 165.344 90.021 181.862 108.998C198.028 127.624 207.516 158.902 192.405 166.634C177.293 174.716 137.581 159.605 112.629 156.442C87.326 152.928 77.1344 161.713 59.9142 165.579C43.0453 169.445 19.1478 168.391 11.7677 157.496C4.73907 146.25 14.2278 124.813 11.4163 94.2382C8.2534 63.6634 -6.85825 23.9514 3.68476 8.48836C14.2278 -7.32615 50.4254 1.10826 73.9715 16.2199C97.5175 31.683 108.412 54.1747 125.281 68.5835Z",aspectRatio:{width:200,height:169},width:y,height:m}),blob29:({width:y,height:m})=>f({path:"M162.987 10.2348C169.16 25.1809 154.864 58.6471 147.066 79.4417C139.268 100.236 138.293 108.359 134.719 114.532C131.47 120.706 125.297 124.93 119.448 143.45C113.6 161.97 107.426 194.461 98.004 199.335C88.5814 204.209 75.5849 181.14 55.7651 167.494C35.6203 153.522 8.65241 148.648 1.8292 135.327C-4.994 122.33 8.65241 100.561 20.0244 82.041C31.3964 63.5208 40.1691 48.2498 53.4906 35.5782C66.8122 22.9065 84.0326 13.159 106.452 6.33584C128.871 -0.812285 156.489 -4.71127 162.987 10.2348Z",aspectRatio:{width:165,height:200},width:y,height:m}),blob3:({width:y,height:m})=>f({path:"M158.095 64.2637C176.543 95.19 192.277 129.1 181.697 155.686C171.117 182.001 133.951 201.533 99.4982 199.905C64.7739 198.549 33.0338 176.032 15.4004 145.377C-2.23296 114.994 -5.75963 76.2002 10.2461 46.6303C26.2518 17.0605 61.5185 -3.557 89.732 0.512241C118.217 4.58149 139.377 33.0662 158.095 64.2637Z",aspectRatio:{width:186,height:200},width:y,height:m}),blob30:({width:y,height:m})=>f({path:"M146.076 34.4585C157.052 54.582 155.833 80.1936 164.675 100.622C173.212 121.355 191.201 136.905 189.372 149.711C187.542 162.212 165.285 171.969 146.99 175.018C129.001 178.372 114.671 174.713 103.39 175.018C92.1083 175.018 83.876 178.982 66.8015 186.299C49.7271 193.617 23.8105 204.288 14.3586 198.19C4.90665 191.787 11.6145 168.615 10.3949 147.882C8.87037 127.148 -0.581561 108.549 0.0282404 89.3407C0.638042 70.1319 11.6145 50.6182 28.384 32.934C44.8487 15.5546 67.4113 0.309578 89.974 0.00467694C112.537 -0.300224 135.099 14.335 146.076 34.4585Z",aspectRatio:{width:190,height:200},width:y,height:m}),blob31:({width:y,height:m})=>f({path:"M134.218 44.0392C153.568 36.4264 184.97 26.9105 195.755 33.2544C206.222 39.9156 195.755 62.1194 181.481 76.3933C166.89 90.35 148.175 96.0596 145.638 116.36C143.1 136.661 156.74 171.235 151.664 183.923C146.589 196.928 123.434 187.413 105.036 178.531C86.6388 169.967 73.3165 161.72 52.0643 158.548C30.812 155.058 1.62986 156.644 0.0438693 145.225C-1.22492 133.806 25.4197 109.382 29.2261 86.8609C32.7152 64.3398 13.6834 44.0392 11.7802 26.9105C9.877 9.46461 24.7853 -4.80928 42.5484 1.53467C59.9942 7.87863 79.9777 34.5232 93.6172 45.308C107.257 56.4099 114.869 51.3347 134.218 44.0392Z",aspectRatio:{width:200,height:191},width:y,height:m}),blob32:({width:y,height:m})=>f({path:"M200 100.339C200 149.831 145.763 197.966 95.5932 197.966C45.7627 197.966 0 149.831 0 100.339C0 50.8475 45.7627 0 95.5932 0C145.763 0 200 50.8475 200 100.339Z",aspectRatio:{width:200,height:198},width:y,height:m}),blob4:({width:y,height:m})=>f({path:"M183.427 38.712C198.21 63.2519 196.141 95.1833 189.341 126.523C182.836 157.863 171.305 188.908 150.609 197.482C130.208 205.76 100.642 192.16 69.8936 177.968C39.4405 164.072 7.80478 150.176 1.30024 128.593C-5.2043 107.01 13.718 77.7393 35.3012 51.7211C56.5888 25.9986 81.1287 3.23272 108.921 0.276112C137.009 -2.38484 168.349 14.4678 183.427 38.712Z",aspectRatio:{width:195,height:200},width:y,height:m}),blob5:({width:y,height:m})=>f({path:"M166.251 30.6913C183.816 48.5185 195.875 71.8512 199.021 98.8542C202.429 125.595 197.186 155.744 179.359 169.115C161.794 182.223 131.645 178.815 103.331 176.979C75.0171 175.144 48.8006 174.882 29.6625 161.512C10.7866 148.141 -0.748681 121.925 0.0378149 96.2326C0.824311 70.8025 14.1947 46.159 33.0706 28.3318C52.2087 10.5045 76.8522 -0.5064 100.971 0.0179307C125.091 0.804426 148.423 12.864 166.251 30.6913Z",aspectRatio:{width:200,height:179},width:y,height:m}),blob6:({width:y,height:m})=>f({path:"M149.146 50.5452C161.911 68.0278 171.901 81.9028 176.619 97.9979C181.336 114.37 180.781 133.241 173.011 149.891C165.519 166.541 151.366 180.693 133.051 189.851C114.736 199.008 92.2586 202.893 71.446 197.621C50.6334 192.348 30.9308 177.918 18.1658 158.216C5.12323 138.791 -0.981801 113.815 0.128204 87.7304C1.51571 61.6453 10.6733 34.1726 29.2658 17.5226C48.1359 1.14999 76.996 -4.40004 98.9186 3.6475C120.841 11.695 136.381 32.7851 149.146 50.5452Z",aspectRatio:{width:180,height:200},width:y,height:m}),blob7:({width:y,height:m})=>f({path:"M158.662 41.8295C178.593 57.8305 204.138 64.5677 213.402 79.7266C222.666 94.6047 215.367 118.466 203.015 135.028C190.383 151.871 172.698 161.977 156.416 168.434C140.134 174.89 124.975 177.697 104.483 185.277C83.9903 192.856 58.1642 205.208 44.9704 197.629C31.4959 190.33 31.2152 163.1 21.9514 138.116C12.9684 112.851 -4.71688 90.1132 1.17822 75.5158C7.35404 61.1991 36.8295 55.5847 58.7256 40.1452C80.9024 24.7056 95.4998 -0.278374 109.816 0.00234533C124.414 0.283064 138.45 25.8285 158.662 41.8295Z",aspectRatio:{width:218,height:200},width:y,height:m}),blob8:({width:y,height:m})=>f({path:"M153.53 11.0108C168.179 18.1858 181.931 29.5461 192.993 44.4939C203.755 59.4417 212.425 78.2759 210.631 96.5122C209.136 114.748 197.477 132.088 182.529 142.252C167.581 152.716 148.747 156.004 128.717 168.262C108.687 180.22 87.1622 201.147 69.8228 199.951C52.7823 198.456 39.6283 174.54 32.4533 153.015C25.2784 131.49 24.0826 112.357 16.6087 91.131C9.13477 70.2041 -4.31825 46.8855 1.36191 31.9377C7.04207 16.691 31.8554 9.51607 52.7823 5.33069C73.4103 0.846349 90.4507 -0.648433 106.594 0.248435C123.037 1.1453 138.882 4.13486 153.53 11.0108Z",aspectRatio:{width:211,height:200},width:y,height:m}),blob9:({width:y,height:m})=>f({path:"M140.289 20.2182C156.96 27.7956 176.661 32.0895 189.29 43.9608C201.667 55.5796 206.718 75.0283 202.424 91.6987C198.131 108.622 184.491 122.766 175.651 140.952C166.81 158.885 162.769 180.607 150.393 191.216C138.016 201.824 117.052 201.572 98.866 197.025C80.6802 192.479 65.2727 183.891 48.3497 175.808C31.4268 167.726 13.2409 160.148 5.1583 146.761C-2.67172 133.122 -0.398493 113.673 4.14797 96.7504C8.69444 80.08 15.5141 65.6828 23.3442 52.296C31.4268 38.6566 40.5197 25.775 52.6436 15.6717C65.0201 5.82101 80.6802 -1.50385 95.3299 0.264221C109.98 1.77971 123.619 12.6407 140.289 20.2182Z",aspectRatio:{width:204,height:200},width:y,height:m})},e.subTypeToPathDataFunc=b,e.figureToSvg=E})(_0);(function(e){var t=we&&we.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=t(at),n=Hi,i=Wa,a=_0,o=Wl,l=Yo,u=Ef,f={};e.FigureElement=(0,n.observer)(({element:v,store:w})=>{const b=v.selectable||w.role==="admin",h=(0,l.useMobile)(),[E,y]=r.default.useState(!1),m=w.selectedElements.indexOf(v)>=0&&w.selectedElements.length===1,p=Math.min(v.strokeWidth,v.width/2,v.height/2),g=Math.max(0,Math.min(v.width/2,v.height/2,v.cornerRadius)),d=(0,u.useColor)(v,v.a.fill,"fill"),_=Object.assign(Object.assign({width:v.a.width,height:v.a.height},d),{cornerRadius:g,opacity:v.animated("opacity"),shadowEnabled:v.shadowEnabled,shadowBlur:v.shadowBlur,shadowOffsetX:v.shadowOffsetX,shadowOffsetY:v.shadowOffsetY,shadowColor:v.shadowColor,shadowOpacity:v.shadowOpacity,listening:b,preventDefault:!h||m,hideInExport:!v.showInExport}),O=(0,u.useColor)(v,v.stroke,"stroke"),k=Object.assign(Object.assign({visible:p>0,x:p/2,y:p/2,width:v.a.width-p,height:v.a.height-p},O),{strokeWidth:p,cornerRadius:Math.max(0,g-p),dash:v.dash.map(P=>P*p),opacity:v.animated("opacity"),hideInExport:!v.showInExport,listening:!1}),C=(S=v.subType,f[S]||(f[S]=(x=(0,a.subTypeToPathDataFunc)(S),(0,n.observer)(({element:P,fillProps:T,strokeProps:L})=>{let M=x({width:P.a.width,height:P.a.height,cornerRadius:P.cornerRadius}),U=1,$=1;typeof M!="string"&&(U=M.scaleX,$=M.scaleY,M=M.path);const Z=r.default.useRef(null);return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Rect,{width:P.width,height:P.height,fill:"transparent"}),r.default.createElement(i.Path,Object.assign({},T,{ref:Z,data:M,scaleX:U,scaleY:$})),r.default.createElement(i.Group,{clipFunc:z=>{const N=Z.current;if(N){var H=N.dataArray;z.beginPath();for(var R=0;R<H.length;R++){var F=H[R].command,B=H[R].points;switch(F){case"L":z.lineTo(B[0],B[1]);break;case"M":z.moveTo(B[0],B[1]);break;case"C":z.bezierCurveTo(B[0],B[1],B[2],B[3],B[4],B[5]);break;case"Q":z.quadraticCurveTo(B[0],B[1],B[2],B[3]);break;case"A":var D=B[0],V=B[1],Y=B[2],q=B[3],G=B[4],K=B[5],X=B[6],Q=B[7],ee=Y>q?Y:q,te=Y>q?1:Y/q,ae=Y>q?q/Y:1;z.translate(D,V),z.rotate(X),z.scale(te,ae),z.arc(0,0,ee,G,G+K,1-Q),z.scale(1/te,1/ae),z.rotate(-X),z.translate(-D,-V);break;case"z":z.closePath()}}}},scaleX:U,scaleY:$},r.default.createElement(i.Path,Object.assign({},L,{x:0,y:0,data:M,strokeWidth:2*L.strokeWidth,dash:L.dash.map(z=>z)}))))}))),f[S]||i.Group);var S,x;return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Group,{id:v.id,x:v.a.x,y:v.a.y,rotation:v.a.rotation,opacity:v.a.opacity,draggable:h?v.draggable&&m:v.draggable,name:"element",onMouseEnter:()=>{y(!0)},onMouseLeave:()=>{y(!1)},onDragMove:P=>{v.set({x:P.target.x(),y:P.target.y()})},onDragEnd:P=>{v.set({x:P.target.x(),y:P.target.y()})},onTransform:P=>{const T=P.target.scale();P.target.scaleX(1),P.target.scaleY(1),v.set({width:v.width*T.x,height:v.height*T.y,x:P.target.x(),y:P.target.y(),rotation:P.target.rotation()})}},r.default.createElement(C,{element:v,fillProps:_,strokeProps:k})),E&&!m&&r.default.createElement(o.Highlighter,{element:v}))})})(OS);(function(e){var t=we&&we.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=void 0;const r=t(at),n=Hi,i=v2,a=k2,o=hS,l=SS,u=ES,f=OS,v=Wa,w=hi,b=(0,n.observer)(m=>{const{element:p,store:g}=m,{children:d}=p,_=p.selectable||g.role==="admin";return r.default.createElement(v.Group,{opacity:p.opacity,listening:_,hideInExport:!p.showInExport},d.map(O=>r.default.createElement(y,Object.assign({},m,{key:O.id,store:g,element:O}))))}),h={text:i.TextElement,image:a.ImageElement,svg:a.ImageElement,line:l.LineElement,video:u.VideoElement,figure:f.FigureElement,group:b};function E(m,p){h[m]=p}e.registerShapeComponent=E;const y=(0,n.observer)(m=>{let p=h[m.element.type];return m.element.type==="text"&&w.flags.htmlRenderEnabled&&(p=o.HTMLElement),m.element.visible?p?r.default.createElement(p,Object.assign({},m)):(console.error("Can not find component for "+m.element.type),null):null});e.default=y})(s7);var xS={};(function(e){function t(r,n,i="scale"){const a=n.width/n.height;let o,l;a>=r.width/r.height?(o=r.width,l=r.width/a):(o=r.height*a,l=r.height);let u=0,f=0;return i==="left-top"?(u=0,f=0):i==="left-middle"?(u=0,f=(r.height-l)/2):i==="left-bottom"?(u=0,f=r.height-l):i==="center-top"?(u=(r.width-o)/2,f=0):i==="center-middle"?(u=(r.width-o)/2,f=(r.height-l)/2):i==="center-bottom"?(u=(r.width-o)/2,f=r.height-l):i==="right-top"?(u=r.width-o,f=0):i==="right-middle"?(u=r.width-o,f=(r.height-l)/2):i==="right-bottom"?(u=r.width-o,f=r.height-l):i==="scale"?(u=0,f=0,o=r.width,l=r.height):console.error(new Error("Unknown clip position property - "+i)),{cropX:u,cropY:f,cropWidth:o,cropHeight:l}}Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=void 0,e.getCrop=t})(xS);var lv={},sv={},k_;function nF(){return k_||(k_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.setAPI=e.iconscoutDownload=e.iconscoutList=e.svgapiDownload=e.svgapiList=e.unsplashDownload=e.unsplashList=e.textTemplateList=e.templateList=e.removeBackground=e.polotnoShapesList=e.getGoogleFontImage=e.getGoogleFontsListAPI=e.URLS=e._dangerous=e.getAPI=e.getDomain=e.API=e.URL=void 0;const t=j2();e.URL="https://api.polotno.com",e.API="https://api.polotno.com/api";let r=e.URL;const n=()=>r;e.getDomain=n;const i=()=>r+"/api";e.getAPI=i;const a=k=>{r=k};e._dangerous=a;const o={},l=(k,C)=>{o[k]||(o[k]=!0,console.error(C))},u=`API for iconscout is provided as a demonstration.
232
+ For production usage you have to use your own API endpoint.
233
+ https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
234
+ https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:k,page:C=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${k}&per_page=20&page=${C}&KEY=${(0,t.getKey)()}`,unsplashDownload:k=>`${(0,e.getAPI)()}/download-unsplash?id=${k}&KEY=${(0,t.getKey)()}`,svgapiList:({query:k,page:C=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${k}&page=${C}&per_page=20&KEY=${(0,t.getKey)()}`,svgapiDownload:k=>`${(0,e.getAPI)()}/download-svgapi?path=${k}&KEY=${(0,t.getKey)()}`,iconscoutList:({query:k,page:C=1})=>(l("iconscout",u),`${(0,e.getAPI)()}/get-iconscout?query=${k}&page=${C}&KEY=${(0,t.getKey)()}`),iconscoutDownload:k=>(l("iconscout",u),`${(0,e.getAPI)()}/download-iconscout?uuid=${k}&KEY=${(0,t.getKey)()}`),templateList:({query:k,page:C=1,sizeQuery:S})=>`${(0,e.getAPI)()}/get-templates?${S}&query=${k}&per_page=30&page=${C}&KEY=${(0,t.getKey)()}`};const f=()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,t.getKey)()}`;e.getGoogleFontsListAPI=f;const v=k=>{return`${(0,e.getDomain)()}/google-fonts-previews/black/${C=k,S=" ",x="-",C.replace(new RegExp(S,"g"),x)}.png`;var C,S,x};e.getGoogleFontImage=v;const w=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,t.getKey)()}`;e.polotnoShapesList=w;const b=()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,t.getKey)()}`;e.removeBackground=b;const h=k=>e.URLS.templateList(k);e.templateList=h;const E=()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,t.getKey)()}`;e.textTemplateList=E;const y=k=>e.URLS.unsplashList(k);e.unsplashList=y;const m=k=>e.URLS.unsplashDownload(k);e.unsplashDownload=m;const p=k=>e.URLS.svgapiList(k);e.svgapiList=p;const g=k=>e.URLS.svgapiDownload(k);e.svgapiDownload=g;const d=k=>e.URLS.iconscoutList(k);e.iconscoutList=d;const _=k=>e.URLS.iconscoutDownload(k);e.iconscoutDownload=_;const O=(k,C)=>{e.URLS[k]=C};e.setAPI=O}(sv)),sv}var R_;function j2(){return R_||(R_=1,function(e){var t=we&&we.__createBinding||(Object.create?function(k,C,S,x){x===void 0&&(x=S);var P=Object.getOwnPropertyDescriptor(C,S);P&&!("get"in P?!C.__esModule:P.writable||P.configurable)||(P={enumerable:!0,get:function(){return C[S]}}),Object.defineProperty(k,x,P)}:function(k,C,S,x){x===void 0&&(x=S),k[x]=C[S]}),r=we&&we.__setModuleDefault||(Object.create?function(k,C){Object.defineProperty(k,"default",{enumerable:!0,value:C})}:function(k,C){k.default=C}),n=we&&we.__importStar||function(k){if(k&&k.__esModule)return k;var C={};if(k!=null)for(var S in k)S!=="default"&&Object.prototype.hasOwnProperty.call(k,S)&&t(C,k,S);return r(C,k),C};Object.defineProperty(e,"__esModule",{value:!0}),e.validateKey=e.isKeyPaid=e.getKey=e.shouldShowCredit=void 0;const i=n(ha),a=nF(),o=hi;e.shouldShowCredit=i.observable({value:!1});const l=i.action(()=>{e.shouldShowCredit.value=!0});let u="";const f=()=>u||"";e.getKey=f;const v=5,w=3e3,b="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",h="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",E="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",y="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let m=window.location.origin;const p=navigator.userAgent.indexOf("Headless")>-1,g=navigator.userAgent.indexOf("Electron")>-1;m==="file://"&&p&&(m="headless"),m==="file://"&&g&&(m="electron");const d=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${m}" here: https://polotno.com/cabinet`;async function _(k){for(let C=0;C<v;C++)try{const S=await fetch((0,a.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:k,site:location.host})});if(!k)return console.warn(b),!1;if(S.status!==200){await new Promise(P=>setTimeout(P,w));continue}const x=await S.json();return x.is_valid||console.warn(h),x.is_paid||console.log(y,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),x.is_domain_valid||console.log(d,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,o.useRemoveBackground)(x.remove_background_enabled),x.is_paid||!1}catch{await new Promise(x=>setTimeout(x,w))}return console.error(E),!0}async function O(k,C){u=k,await _(k)&&!C||l()}e.isKeyPaid=_,e.validateKey=O}(lv)),lv}var w0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pxToUnitString=e.unitToPx=e.pxToUnitRounded=e.pxToUnit=void 0;const t=({px:a,unit:o="px",dpi:l})=>{switch(o){case"pt":default:return a;case"mm":return a/(l/25.4);case"cm":return a/(l/2.54);case"in":return a/l}};e.pxToUnit=t;const r=({px:a,precious:o=2,dpi:l=72,unit:u="px"})=>parseFloat((0,e.pxToUnit)({px:a,dpi:l,unit:u}).toFixed(o));e.pxToUnitRounded=r;const n=({unitVal:a,dpi:o,unit:l})=>a/(0,e.pxToUnit)({px:1,unit:l,dpi:o});e.unitToPx=n;const i=a=>{const o=parseFloat((0,e.pxToUnit)(a).toFixed(1));switch(a.unit){case"pt":return`${Math.round(o)}pt`;case"mm":return`${o}mm`;case"cm":return`${o}cm`;case"in":return`${o}in`;default:return`${Math.round(o)}px`}};e.pxToUnitString=i})(w0);(function(e){var t=we&&we.__rest||function(N,H){var R={};for(var F in N)Object.prototype.hasOwnProperty.call(N,F)&&H.indexOf(F)<0&&(R[F]=N[F]);if(N!=null&&typeof Object.getOwnPropertySymbols=="function"){var B=0;for(F=Object.getOwnPropertySymbols(N);B<F.length;B++)H.indexOf(F[B])<0&&Object.prototype.propertyIsEnumerable.call(N,F[B])&&(R[F[B]]=N[F[B]])}return R},r=we&&we.__importDefault||function(N){return N&&N.__esModule?N:{default:N}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.registerTransformerAttrs=e.setTransformerStyle=void 0;const n=r(at),i=Hi,a=ha,o=Wa,l=r(g0),u=r(vi),f=r(s7),v=F2,w=k2,b=xS,h=j2(),E=Cf,y=w0,m=hi,p=Yo,g=u.default.DD._drag;window.removeEventListener("mousemove",g),u.default.DD._drag=function(N){(0,a.runInAction)(()=>{g.call(this,N)})},window.addEventListener("mousemove",u.default.DD._drag);const d=new u.default.Group;d.add(new u.default.Rect({width:20,height:20,fill:"white"})),d.add(new u.default.Path({scaleX:20/24,scaleY:20/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));const _=d.toCanvas({pixelRatio:2,width:20,height:20}),O={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:N=>{N.hasName("rotater")&&N.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:_,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},k=N=>{Object.assign(O,N)};e.setTransformerStyle=k;const C={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},line:{enabledAnchors:[],borderEnabled:!1,rotateEnabled:!1},image:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},many:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},group:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]}};function S(N,H){C[N]=C[N]||H,Object.assign(C[N],H)}e.registerTransformerAttrs=S;const x=N=>n.default.createElement(o.Rect,Object.assign({},N,{preventDefault:!1})),P=N=>{var{url:H}=N,R=t(N,["url"]);const[F,B]=(0,l.default)(H,"anonymous"),D=F?(0,b.getCrop)(F,{width:R.width,height:R.height},"center-middle"):{};return(0,w.useImageLoader)(B,"background"),n.default.createElement(o.Image,Object.assign({image:F},R,D))},T=N=>n.default.createElement(o.Rect,Object.assign({},N)),L=N=>{const{background:H,scale:R,borderColor:F}=N,B=t(N,["background","scale","borderColor"]),D=n.default.useMemo(()=>!!u.default.Util.colorToRGBA(H),[H]),V=n.default.useMemo(()=>{const Y=document.createElement("canvas"),q=30;Y.width=60,Y.height=60;const G=Y.getContext("2d");return G&&(G.fillStyle="black",G.fillRect(q,0,q,q),G.fillRect(0,q,q,q)),Y},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:V},B,{opacity:.1,hideInExport:!0})),D?n.default.createElement(T,Object.assign({fill:H},B)):n.default.createElement(P,Object.assign({url:H},B)))},M=(0,i.observer)(({selection:N})=>N.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(N.x1,N.x2),y:Math.min(N.y1,N.y2),width:Math.abs(N.x1-N.x2),height:Math.abs(N.y1-N.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),U=(0,i.observer)(({x:N,y:H,width:R,height:F,rotation:B,anchor:D,store:V})=>{const Y=(0,E.getClientRect)({x:N,y:H,width:R,height:F,rotation:u.default.Util.radToDeg(B)});if(D===void 0)return null;const q=(F/2+70)*Math.cos(B-Math.PI/2),G=(F/2+70)*Math.sin(B-Math.PI/2),K=(0,y.pxToUnitRounded)({unit:V.unit,dpi:V.dpi,px:R/V.scale,precious:V.unit==="px"?0:1})+" x "+(0,y.pxToUnitRounded)({unit:V.unit,dpi:V.dpi,px:F/V.scale,precious:V.unit==="px"?0:1})+(V.unit==="px"?"":" "+V.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(Y.minX+Y.maxX)/2+q,y:(Y.minY+Y.maxY)/2+G,offsetX:14,offsetY:14,visible:D==="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(u.default.Util.radToDeg(B)).toString()+"°"})),n.default.createElement(o.Label,{x:(Y.minX+Y.maxX)/2,y:Y.maxY+20,visible:D!=="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:K})))}),$=(0,i.observer)(({elements:N,store:H})=>{const R=N.filter(B=>B.alwaysOnTop),F=N.filter(B=>!B.alwaysOnTop).concat(R);return n.default.createElement(n.default.Fragment,null,F.map(B=>n.default.createElement(f.default,{key:B.id,store:H,element:B,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let Z=null;const z=N=>{Z=N};e.registerNextDomDrop=z,e.default=(0,i.observer)(({store:N,page:H,width:R,height:F,pageControlsEnabled:B,backColor:D,pageBorderColor:V,activePageBorderColor:Y,components:q,bleedColor:G,altCloneEnabled:K})=>{const X=N.bleedVisible?H.bleed:0,Q=H.computedWidth+2*X,ee=H.computedHeight+2*X,te=(R-Q*N.scale)/2,ae=(F-ee*N.scale)/2,oe=n.default.useRef(null),se=n.default.useRef(null),ke=n.default.useRef(null),Fe=B==null||B,[fe,ie]=n.default.useState(null),[ge,pe]=n.default.useState({}),re=N.selectedElements.find(Oe=>Oe._cropModeEnabled),de=N.selectedShapes.filter(Oe=>!Oe.resizable).length>0,be=N.selectedShapes.filter(Oe=>!Oe.draggable).length>0,ye=N.selectedElements.filter(Oe=>!Oe.visible).length>0;n.default.useLayoutEffect(()=>{var Oe,je,Le;if(!oe.current)return;const Se=oe.current.getStage(),Je=N.selectedShapes.map(Ke=>Ke._cropModeEnabled?null:Se.findOne("#"+Ke.id)).filter(Ke=>Ke),xe=N.selectedElements.length===1&&((Oe=N.selectedElements[0])===null||Oe===void 0?void 0:Oe.type)||"many";C[xe]?(oe.current.setAttrs(Object.assign(Object.assign({},O),C[xe])),xe!=="svg"&&xe!=="image"||N.selectedElements[0].keepRatio||oe.current.setAttrs({enabledAnchors:O.enabledAnchors}),xe==="text"&&m.flags.textVerticalResizeEnabled&&oe.current.setAttrs({enabledAnchors:(je=C.text.enabledAnchors)===null||je===void 0?void 0:je.concat(["bottom-center"])})):oe.current.setAttrs(O),de&&oe.current.enabledAnchors([]),be&&oe.current.rotateEnabled(!1),Je.find(Ke=>Ke==null?void 0:Ke.isDragging())&&Je.forEach(Ke=>{Ke.isDragging()||Ke==null||Ke.startDrag()}),oe.current.nodes(Je),(Le=oe.current.getLayer())===null||Le===void 0||Le.batchDraw()},[N.selectedElements,re,de,ye,be]);const Ie=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),Ee=n.default.useRef(!1),Ae=(0,p.useMobile)(),Ze=(0,a.action)(Oe=>{var je,Le;if(Ae)return;Ee.current=!1;const Se=Oe.target.findAncestor(".elements-container"),Je=Oe.target.findAncestor("Transformer"),xe=Oe.target.findAncestor(".page-abs-container");if(Se||Je||xe)return;const Ke=(je=Oe.target.getStage())===null||je===void 0?void 0:je.getPointerPosition();Ke&&(Ie.visible=!0,Ie.x1=Ke.x,Ie.y1=Ke.y,Ie.x2=Ke.x,Ie.y2=Ke.y,((Le=Oe.target.getStage())===null||Le===void 0?void 0:Le.getPointersPositions().length)>=2&&(Ie.visible=!1))});n.default.useEffect(()=>{const Oe=(0,a.action)(Le=>{var Se,Je;if(!Ie.visible)return;(Se=se.current)===null||Se===void 0||Se.setPointersPositions(Le);let xe=((Je=se.current)===null||Je===void 0?void 0:Je.getPointerPosition())||{x:Ie.x2,y:Ie.y2};Ie.x2=xe.x,Ie.y2=xe.y}),je=(0,a.action)(()=>{if(!Ie.visible||!se.current)return;const Le=se.current.findOne(".selection"),Se=Le?Le.getClientRect():{width:0,height:0,x:0,y:0};if(Se.width&&Se.height){const Je=[];se.current.find(".element").forEach(Ke=>{const Sr=Ke.getClientRect(),Pe=N.getElementById(Ke.id()),He=Pe==null?void 0:Pe.draggable,et=Pe==null?void 0:Pe.selectable;u.default.Util.haveIntersection(Se,Sr)&&He&&et&&Je.push(Pe.top.id)});const xe=[...new Set(Je)];N.selectElements(xe)}Ie.visible=!1,Ee.current=!0});return window.addEventListener("mousemove",Oe),window.addEventListener("touchmove",Oe),window.addEventListener("mouseup",je),window.addEventListener("touchend",je),()=>{window.removeEventListener("mousemove",Oe),window.removeEventListener("touchmove",Oe),window.removeEventListener("mouseup",je),window.removeEventListener("touchend",je)}},[]);const We=Oe=>{if(N.activePage!==H&&H.select(),Ee.current)return;const je=Oe.evt.ctrlKey||Oe.evt.metaKey||Oe.evt.shiftKey,Le=Oe.target.findAncestor(".elements-container"),Se=Oe.target.findAncestor(".page-abs-container"),Je=Oe.target.findAncestor("Transformer");if(!(je||Le||Je||Se))return void N.selectElements([]);const xe=Oe.target.findAncestor(".element",!0),Ke=N.getElementById(xe==null?void 0:xe.id()),Sr=Ke==null?void 0:Ke.top,Pe=Sr==null?void 0:Sr.id,He=N.selectedElementsIds.indexOf(Pe)>=0;Pe&&je&&!He?N.selectElements(N.selectedElementsIds.concat([Pe])):Pe&&je&&He?N.selectElements(N.selectedElementsIds.filter(et=>et!==Pe)):!Pe||je||He||N.selectElements([Pe])};(0,v.useSnap)(oe,N);const dt=N.activePage===H,Bt=q==null?void 0:q.PageControls,ue=q==null?void 0:q.Tooltip,he=1/N.scale,nt=0/N.scale;return n.default.createElement("div",{ref:ke,onDragOver:Oe=>Oe.preventDefault(),onDrop:Oe=>{if(Oe.preventDefault(),!se.current)return;se.current.setPointersPositions(Oe);const je=se.current.findOne(".elements-container").getRelativePointerPosition(),Le=se.current.getPointerPosition(),Se=se.current.getAllIntersections(Le).map(Ke=>Ke.findAncestor(".element",!0)).filter(Boolean),Je=[...new Set(Se.reverse())].map(Ke=>N.getElementById(Ke.id())),xe=Je[0];Z&&(Z(je,xe,{elements:Je,page:H}),Z=null)},style:{position:"relative",width:R+"px"},className:"polotno-page-container"+(dt?" active-page":"")},n.default.createElement(o.Stage,{ref:se,width:Math.min(R,4*window.innerWidth),height:Math.min(F,4*window.innerHeight),onClick:We,onTap:We,onMouseDown:Ze,onMouseMove:Oe=>{if(!Oe.evt.altKey&&fe)return void ie(null);if(!Oe.evt.altKey)return;const je=Oe.target.findAncestor(".element",!0),Le=je==null?void 0:je.id();if(!N.selectedElements[0]||N.selectedElementsIds.includes(Le))return;const Se=(0,E.getTotalClientRect)(N.selectedShapes),Je=Le?N.getElementById(Le):{x:0,y:0,width:H.computedWidth,height:H.computedHeight,rotation:0},xe=(0,E.getClientRect)(Je),Ke=[];Se.minX>xe.maxX&&Ke.push({distance:Se.minX-xe.maxX,box1:Se,box2:xe,points:[{x:Se.minX,y:Se.minY+Se.height/2},{x:xe.maxX,y:Se.minY+Se.height/2},{x:xe.maxX,y:xe.minY+xe.height/2}]}),Se.maxX<xe.minX&&Ke.push({distance:xe.minX-Se.maxX,box1:Se,box2:xe,points:[{x:Se.maxX,y:Se.minY+Se.height/2},{x:xe.minX,y:Se.minY+Se.height/2},{x:xe.minX,y:xe.minY+xe.height/2}]}),Se.minY>xe.maxY&&Ke.push({box1:Se,box2:xe,distance:Se.minY-xe.maxY,points:[{x:Se.minX+Se.width/2,y:Se.minY},{x:Se.minX+Se.width/2,y:xe.maxY},{x:xe.minX+xe.width/2,y:xe.maxY}]}),Se.maxY<xe.minY&&Ke.push({box1:Se,box2:xe,distance:xe.minY-Se.maxY,points:[{x:Se.minX+Se.width/2,y:Se.maxY},{x:Se.minX+Se.width/2,y:xe.minY},{x:xe.minX+xe.width/2,y:xe.minY}]}),Se.minX>=xe.minX&&Se.maxX<=xe.maxX&&Se.minY>=xe.minY&&Se.maxY<=xe.maxY&&(Ke.push({distance:Se.minX-xe.minX,box1:Se,box2:xe,points:[{x:Se.minX,y:Se.minY+Se.height/2},{x:xe.minX,y:Se.minY+Se.height/2},{x:xe.minX,y:xe.minY+xe.height/2}]}),Ke.push({distance:xe.maxX-Se.maxX,box1:Se,box2:xe,points:[{x:Se.maxX,y:Se.minY+Se.height/2},{x:xe.maxX,y:Se.minY+Se.height/2},{x:xe.maxX,y:xe.minY+xe.height/2}]}),Ke.push({box1:Se,box2:xe,distance:Se.minY-xe.minY,points:[{x:Se.minX+Se.width/2,y:Se.minY},{x:Se.minX+Se.width/2,y:xe.minY},{x:xe.minX+xe.width/2,y:xe.minY}]}),Ke.push({box1:Se,box2:xe,distance:xe.maxY-Se.maxY,points:[{x:Se.minX+Se.width/2,y:Se.maxY},{x:Se.minX+Se.width/2,y:xe.maxY},{x:xe.minX+xe.width/2,y:xe.maxY}]})),JSON.stringify(fe)!==JSON.stringify(Ke)&&ie(Ke)},onTouchStart:Ze,onDragStart:Oe=>{var je;const Le=Oe.target.findAncestor(".element",!0);if(Le){const Se=N.getElementById(Le==null?void 0:Le.id()),Je=Se==null?void 0:Se.top,xe=Je==null?void 0:Je.id;!(N.selectedElementsIds.indexOf(xe)>=0)&&xe&&(N.selectElements([xe]),Oe.target.stopDrag(),Oe.target.startDrag(Oe),(je=oe.current)===null||je===void 0||je.startDrag(Oe))}fe&&ie(null)},pageId:H.id,style:{position:"relative"}},n.default.createElement(o.Layer,null,n.default.createElement(x,{width:R,height:F,fill:D}),n.default.createElement(o.Group,{x:te,y:ae,scaleX:N.scale,scaleY:N.scale,name:"page-container"},n.default.createElement(o.Group,{name:"page-container-2"},n.default.createElement(o.Group,{name:"page-background-group",x:X,y:X},n.default.createElement(L,{x:-H.bleed,y:-H.bleed,width:H.computedWidth+2*H.bleed,height:H.computedHeight+2*H.bleed,background:H.background,name:"page-background",preventDefault:!1,scale:N.scale})),n.default.createElement(o.Group,{x:X,y:X,name:"elements-container",listening:!N.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:H.computedWidth,height:H.computedHeight,listening:!1}),n.default.createElement($,{elements:H.children,store:N})),n.default.createElement(o.Rect,{stroke:G,name:"bleed",strokeWidth:H.bleed,x:H.bleed/2,y:H.bleed/2,width:H.computedWidth+H.bleed,height:H.computedHeight+H.bleed,listening:!1,visible:H.bleed>0&&N.bleedVisible,hideInExport:!0}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,R,0,R,F,0,F,0,0,te,ae,te,F-ae,R-te,F-ae,R-te,ae,te,ae],listening:!1,closed:!0,fill:D}),n.default.createElement(o.Group,{x:te,y:ae,scaleX:N.scale,scaleY:N.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-he/2-nt,y:-he/2-nt,width:Q+he+2*nt,height:ee+he+2*nt,stroke:dt&&N.pages.length>1?Y:V,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:te+X*N.scale,y:ae+X*N.scale,scaleX:N.scale,scaleY:N.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:oe,onDragStart:Oe=>{var je;!((je=Oe.evt)===null||je===void 0)&&je.altKey&&K&&N.selectedElements.forEach(Le=>{const Se=Le.clone({},{skipSelect:!0}),Je=H.children.indexOf(Le);H.setElementZIndex(Se.id,Je)}),N.history.startTransaction()},onDragEnd:()=>{N.history.endTransaction()},onTransformStart:()=>{N.history.startTransaction()},boundBoxFunc:(Oe,je)=>{const Le=Math.abs(je.width)<1||Math.abs(je.height)<1,Se=Math.abs(Oe.width)<1||Math.abs(Oe.height)<1;return Le&&!Se?Oe:je},onTransform:Oe=>{var je,Le;const Se=oe.current.nodes(),Je=Se[Se.length-1];if(Oe.target!==Je)return;const xe=(je=oe.current)===null||je===void 0?void 0:je.__getNodeRect(),Ke=(Le=oe.current)===null||Le===void 0?void 0:Le.getActiveAnchor();pe({anchor:Ke,x:xe.x,y:xe.y,rotation:xe.rotation,width:xe.width,height:xe.height})},onTransformEnd:Oe=>{pe({}),N.history.endTransaction()},visible:!N.isPlaying}),fe&&fe.map(({points:Oe,distance:je,box1:Le,box2:Se},Je)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:Je,listening:!1},n.default.createElement(o.Rect,Object.assign({},Le,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Rect,Object.assign({},Se,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[Oe[0].x,Oe[0].y,Oe[1].x,Oe[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[Oe[1].x,Oe[1].y,Oe[2].x,Oe[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(Oe[0].x+Oe[1].x)/2,y:(Oe[0].y+Oe[1].y)/2,offsetY:-10,scaleX:1/N.scale,scaleY:1/N.scale},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,y.pxToUnitString)({unit:N.unit,dpi:N.dpi,px:je})})))),H._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:Q,height:ee,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:Q,height:ee,align:"center",verticalAlign:"middle"})),ue&&n.default.createElement(ue,{components:q,store:N,page:H,stageRef:se})),n.default.createElement(U,Object.assign({},ge,{store:N})),n.default.createElement(M,{selection:Ie}),h.shouldShowCredit.value&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:R-170,y:F-18,onMouseEnter:Oe=>{Oe.target.getStage().container().style.cursor="pointer"},onMouseLeave:Oe=>{Oe.target.getStage().container().style.cursor=""},onTouchStart:Oe=>{Oe.cancelBubble=!0},onMouseDown:Oe=>{Oe.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),Fe&&dt&&Bt&&n.default.createElement(Bt,{store:N,page:H,xPadding:te,yPadding:ae}))})})(v9);var PS={};(function(e){var t=we&&we.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(e,"__esModule",{value:!0}),e.LeftRules=e.TopRules=void 0;const r=t(at),n=Cf,i=w0,a=Hi,o=D2,l=(0,o.styled)("div",r.default.forwardRef)`
235
+ position: absolute;
236
+ top: 0;
237
+ left: 0;
238
+ pointer-events: none;
239
+ `,u=(0,o.styled)("div",r.default.forwardRef)`
240
+ height: 14px;
241
+ position: sticky;
242
+ font-size: 8px;
243
+ line-height: 14px;
244
+ top: 0;
245
+ left: 0;
246
+ color: grey;
247
+ border-bottom: 1px solid grey;
248
+ background-color: #e8e8e8;
249
+ overflow: hidden;
250
+ `,f=(0,o.styled)("div",r.default.forwardRef)`
251
+ left: 0;
252
+ width: 14px;
253
+ position: sticky;
254
+ font-size: 8px;
255
+ line-height: 14px;
256
+ color: grey;
257
+ border-right: 1px solid grey;
258
+ background-color: #e8e8e8;
259
+ overflow: hidden;
260
+ `,v=(0,o.styled)("div",r.default.forwardRef)`
261
+ position: absolute;
262
+ border-left: 1px solid grey;
263
+ padding-left: 2px;
264
+ `,w=(0,o.styled)("div",r.default.forwardRef)`
265
+ position: absolute;
266
+ left: 14px;
267
+ border-left: 1px solid grey;
268
+ padding-left: 2px;
269
+ transform: rotate(90deg);
270
+ transform-origin: left top;
271
+ overflow: hidden;
272
+ `,b=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];function h(){return r.default.createElement("div",null,r.default.createElement("h1",null,"Top rules"))}e.TopRules=(0,a.observer)(({store:E,width:y,height:m})=>{const p=r.default.useRef(null);if(!E.activePage)return null;const g=E.activePage,d=(E.bleedVisible&&g.bleed,g.computedWidth*E.scale),_=g.computedHeight*E.scale,O=(y-d)/2,k=(C=L=>(0,i.unitToPx)({unitVal:L,dpi:E.dpi,unit:E.unit})*E.scale,b.find(L=>C(L)>30)||1e4);var C;const S=(0,i.unitToPx)({unitVal:k,dpi:E.dpi,unit:E.unit})*E.scale,x=Math.round(d/S)+1,P=Math.round(_/S)+1,T=(0,n.getTotalClientRect)(E.selectedShapes);return r.default.createElement(l,{ref:p,className:"polotno-rulers"},r.default.createElement(u,{style:{width:y+"px"},className:"polotno-x-ruler"},[...Array(x)].map((L,M)=>r.default.createElement(v,{key:M,style:{left:O+M*S+"px",width:S+"px"}},E.unit==="px"||k>=1?Math.round(k*M):(k*M).toFixed(1))),!!E.selectedShapes.length&&r.default.createElement("div",{style:{position:"absolute",left:O+T.x*E.scale+"px",height:"14px",width:T.width*E.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),E.pages.map((L,M)=>{var U;const $=L.computedHeight*E.scale,Z=(m-$)/2;return r.default.createElement(f,{key:L.id,style:{height:m+"px"},className:"polotno-y-ruler"},[...Array(P)].map((z,N)=>r.default.createElement(w,{key:N,style:{top:Z+N*S-14+"px",width:S+"px"}},E.unit==="px"||k>=1?Math.round(k*N):(k*N).toFixed(1))),((U=E.selectedShapes[0])===null||U===void 0?void 0:U.page)===L&&r.default.createElement("div",{style:{position:"absolute",top:Z+T.y*E.scale-14+"px",width:"14px",height:T.height*E.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),e.LeftRules=h})(PS);var CS={},uv={};let iF="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",TS=e=>crypto.getRandomValues(new Uint8Array(e)),AS=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return(a=t)=>{let o="";for(;;){let l=r(i),u=i;for(;u--;)if(o+=e[l[u]&n]||"",o.length===a)return o}}},aF=(e,t=21)=>AS(e,t,TS),oF=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");const lF=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:aF,customRandom:AS,nanoid:oF,random:TS,urlAlphabet:iF},Symbol.toStringTag,{value:"Module"})),S0=Do(lF);var cv={},fv={},kS={},z2={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deepEqual=void 0;const t=function(r,n){if(r===n)return!0;if(typeof r=="object"&&r!=null&&typeof n=="object"&&n!=null){if(Object.keys(r).length!=Object.keys(n).length)return!1;for(var i in r)if(!n.hasOwnProperty(i)||!(0,e.deepEqual)(r[i],n[i]))return!1;return!0}return!1};e.deepEqual=t})(z2);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const t=$i,r=z2;Object.assign(t.types),e.UndoManager=t.types.model("UndoManager",{history:t.types.array(t.types.frozen()),undoIdx:-1,targetPath:""}).views(n=>({get canUndo(){return n.undoIdx>0},get canRedo(){return n.undoIdx<n.history.length-1}})).actions(n=>{let i,a,o=!1,l=null,u=0,f=0;const v=()=>f>0;function w(){const h=(0,t.getSnapshot)(i);return{pages:h.pages,width:h.width,height:h.height,custom:h.custom}}function b(h){const E=i.pages.map(m=>m.id),y=h.pages.map(m=>m.id);(0,r.deepEqual)(E,y)?i.pages.forEach((m,p)=>{(0,t.applySnapshot)(m,h.pages[p])}):(0,t.applySnapshot)(i.pages,h.pages),i.setSize(h.width,h.height)}return{startTransaction(){f++},endTransaction(h){f--,h||this.requestAddState(w())},async ignore(h,E=!1,y=!1){y&&await new Promise(_=>setTimeout(_,10)),u&&n.addUndoState();let m=v();n.startTransaction();let p=f;try{await h()}catch(_){setTimeout(()=>{throw _})}const g=p!==f,d=!g;n.endTransaction(d),E||m||n.replaceState(),g||(clearTimeout(u),u=0)},async transaction(h){await n.ignore(h,!0),this.addUndoState()},requestAddState(h){l=h,u||v()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),v()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const h=n.history[n.undoIdx];!(0,r.deepEqual)(l,h)&&(clearTimeout(u),u=0,n.history.splice(n.undoIdx+1),n.history.push(l),n.undoIdx=n.history.length-1)},afterCreate(){if(i=(0,t.resolvePath)(n,".."),!i)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");a=(0,t.onSnapshot)(i,()=>{this.requestAddState(w())}),n.history.length===0&&this.requestAddState(w())},clear(){clearTimeout(u),u=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(w())},beforeDestroy(){a()},undo(){u&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,b(n.history[n.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){u&&this.addUndoState(),n.canRedo?(n.undoIdx++,o=!0,b(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=w()}}}),e.default=e.UndoManager})(kS);var RS={};(function(e){async function t(r,n){const i=await(await fetch(r)).blob(),a=document.createElement("a"),o=URL.createObjectURL(i);a.href=o,a.download=n,document.body.appendChild(a),a.click(),setTimeout(function(){document.body.removeChild(a),window.URL.revokeObjectURL(o)},0)}Object.defineProperty(e,"__esModule",{value:!0}),e.downloadFile=void 0,e.downloadFile=t})(RS);var LS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsPDF=void 0;const t="https://unpkg.com/jspdf@2.2.0/dist/jspdf.umd.min.js";let r;function n(){return r?Promise.resolve(r):new Promise(i=>{var a=document.createElement("script");a.onload=function(){r=window.jspdf.jsPDF,i(r)},a.src=t,document.head.appendChild(a)})}e.getJsPDF=n})(LS);var MS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createGIF=e.getGIF=void 0;const t="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js";function r(){return window.GIF?Promise.resolve(window.GIF):new Promise(i=>{var a=document.createElement("script");a.onload=function(){i(window.GIF)},a.src=t,document.head.appendChild(a)})}async function n({width:i,height:a}){return new(await r())({workers:4,width:i,height:a,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
273
+ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
274
+ `],{type:"application/javascript"}))})}e.getGIF=r,e.createGIF=n})(MS);var NS={};(function(e){async function t(r){for(let n=0;n<30;n++){const i=await r();if(i)return i;await new Promise(a=>setTimeout(a,50))}}Object.defineProperty(e,"__esModule",{value:!0}),e.waitTillAvailable=void 0,e.waitTillAvailable=t})(NS);var IS={},Jc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=e.cropImage=e.loadImage=e.getImageSize=void 0;const t=Cu;function r(o){return new Promise(l=>{const u=document.createElement("img");u.onload=async()=>{u.width===0||u.height===0?l(await(0,t.getSvgSize)(o)):l({width:u.width,height:u.height})},u.crossOrigin="anonymous",u.src=o})}function n(o){return new Promise((l,u)=>{const f=document.createElement("img");f.onload=()=>{l(f)},f.onerror=v=>{u(v)},f.crossOrigin="anonymous",f.src=o})}async function i(o,l){const u=await n(o),f=document.createElement("canvas");f.width=2*u.width,f.height=2*u.height,f.getContext("2d").drawImage(u,0,0,f.width,f.height);const v=document.createElement("canvas");v.width=l.width,v.height=l.height;const w=v.getContext("2d");let{cropX:b,cropY:h}=l;const E=f.width*l.cropWidth,y=f.height*l.cropHeight,m=l.width/l.height;let p,g;const d=E/y;return l.type==="svg"?(p=E,g=y):m>=d?(p=E,g=E/m):(p=y*m,g=y),w.drawImage(f,b*f.width,h*f.height,p,g,0,0,v.width,v.height),v.toDataURL("image/png")}function a(o,l){const{width:u,height:f}=o,v=u/f;let w,b;v>=l.width/l.height?(w=l.width,b=l.width/v):(w=l.height*v,b=l.height);const h=(l.width-w)/2,E=(l.height-b)/2;return{cropX:h/l.width,cropY:E/l.height,cropWidth:w/l.width,cropHeight:b/l.height}}e.getImageSize=r,e.loadImage=n,e.cropImage=i,e.getCrop=a})(Jc);(function(e){var t=we&&we.__createBinding||(Object.create?function(S,x,P,T){T===void 0&&(T=P);var L=Object.getOwnPropertyDescriptor(x,P);L&&!("get"in L?!x.__esModule:L.writable||L.configurable)||(L={enumerable:!0,get:function(){return x[P]}}),Object.defineProperty(S,T,L)}:function(S,x,P,T){T===void 0&&(T=P),S[T]=x[P]}),r=we&&we.__setModuleDefault||(Object.create?function(S,x){Object.defineProperty(S,"default",{enumerable:!0,value:x})}:function(S,x){S.default=x}),n=we&&we.__importStar||function(S){if(S&&S.__esModule)return S;var x={};if(S!=null)for(var P in S)P!=="default"&&Object.prototype.hasOwnProperty.call(S,P)&&t(x,S,P);return r(x,S),x},i=we&&we.__rest||function(S,x){var P={};for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&x.indexOf(T)<0&&(P[T]=S[T]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var L=0;for(T=Object.getOwnPropertySymbols(S);L<T.length;L++)x.indexOf(T[L])<0&&Object.prototype.propertyIsEnumerable.call(S,T[L])&&(P[T[L]]=S[T[L]])}return P};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToHTML=e.jsonToDOM=e.fixRatio=void 0;const a=Jc,o=n(Cu),l=Jc,u=_0,f=(S,x,...P)=>({type:S,props:x,children:P||[]});function v(S){var x=new DOMParser().parseFromString(S,"image/svg+xml");return x.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(x)}e.fixRatio=v;const w=async({element:S,page:x,store:P})=>{let{src:T}=S;if(S.type==="svg"&&Object.keys(S.colorsReplace).length){const K=await o.urlToString(T);T=o.replaceColors(K,new Map(Object.entries(S.colorsReplace)))}let L="";S.flipX&&(L+="scaleX(-1)"),S.flipY&&(L+="scaleY(-1)"),L||(L="none");const M={};if(S.clipSrc){const K=await o.urlToBase64(S.clipSrc);M["clip-path"]=`url(${K})`}const U=await(0,l.loadImage)(T),$=U.width*S.cropWidth,Z=U.height*S.cropHeight,z=S.width/S.height;let N,H;const R=$/Z;S.type==="svg"?(N=$,H=Z):z>=R?(N=$,H=$/z):(N=Z*z,H=Z);const F=N/U.width,B=H/U.height,D=N/H>S.width/S.height?S.height/H:S.width/N,V=N*D/F,Y=H*D/B,q=S.cropX*D*U.width,G=S.cropY*D*U.height;return f("div",{style:Object.assign(Object.assign({},M),{width:"100%",height:"100%","border-radius":S.cornerRadius+"px",border:S.borderSize?`${S.borderSize}px solid ${S.borderColor}`:"none",background:`url(${T})`,transform:L,"background-size":`${Math.round(V)}px ${Math.round(Y)}px`,"background-position-x":-Math.round(q)+"px","background-position-y":-Math.round(G)+"px"})})},b=async({element:S,page:x,store:P})=>{let T={};S.fill.indexOf("gradient")>=0&&(T=Object.assign(Object.assign({},T),{"background-color":S.fill,"background-image":S.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const L=S.backgroundPadding*(S.fontSize*S.lineHeight),M=f("div",{style:{position:"absolute",top:-L/2+"px",left:-L/2+"px",display:S.backgroundEnabled?"block":"none",width:S.width+L+"px",height:S.height+L+"px","background-color":S.backgroundColor,"border-radius":S.backgroundCornerRadius*(S.fontSize*S.lineHeight*.5)+"px"}}),U=f("div",{style:Object.assign(Object.assign({},T),{position:"absolute",top:0,left:0,width:S.width+"px",color:S.fill,"white-space":"pre-wrap","font-size":S.fontSize+"px","text-align":S.align,"font-family":S.fontFamily,"text-decoration":S.textDecoration||"none","line-height":S.lineHeight,"letter-spacing":S.letterSpacing+"em","font-style":S.fontStyle,"font-weight":S.fontWeight,"-webkit-text-stroke":`${S.strokeWidth}px ${S.stroke}`,"text-stroke":`${S.strokeWidth}px ${S.stroke}`})},S.text.split(`
275
+ `).join("<br />"));return f("div",{style:{position:"relative"}},M,U)},h=({element:S,type:x})=>{const P={"stroke-width":S.height,stroke:S.color,"line-cap":"round","stroke-linejoin":"round",opacity:S.opacity};return x==="arrow"||x==="triangle"?f("polyline",Object.assign({points:`${3*S.height},${2*-S.height} 0,0 ${3*S.height},${2*S.height}`},P)):x==="bar"?f("polyline",Object.assign({points:`0,${2*-S.height} 0,${2*S.height}`},P)):x==="circle"?f("circle",Object.assign({r:S.height},P)):x==="square"?f("polyline",Object.assign({points:`${-S.height},${-S.height} ${-S.height},${S.height} ${S.height},${S.height} ${S.height},${-S.height}`},P)):null},E=async({element:S,page:x,store:P})=>f("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},f("rect",{x:0,y:0,width:S.width,height:S.height,fill:S.color}),f("g",{transform:`translate(0 ${S.height/2})`},h({element:S,type:S.startHead})),f("g",{transform:`translate(${S.width} ${S.height/2}) rotate(180)`},h({element:S,type:S.endHead}))),y=async({element:S,page:x,store:P,elementHook:T})=>{const L=await Promise.all(S.children.map(U=>g({element:U,page:x,store:P,elementHook:T}))),M=f("div",{style:{"transform-origin":"top left",opacity:S.opacity}},...L);return T&&T({dom:M,element:S})||M},m=async({element:S,page:x,store:P,elementHook:T})=>{const L=(0,u.figureToSvg)(S),M=f("div",{innerHTML:L});return T&&T({dom:M,element:S})||M},p={image:w,svg:w,text:b,line:E,figure:m,group:y};async function g({element:S,page:x,store:P,elementHook:T}){let L=await p[S.type];L||(L=()=>f("div",{}),console.error(`HTML export does not support ${S.type} type...`));const M=await L({element:S,page:x,store:P}),U=[];S.blurEnabled&&U.push(`blur(${S.blurRadius/2}px)`),S.brightnessEnabled&&U.push(`brightness(${100*S.brightness+100}%)`),S.sepiaEnabled&&U.push("sepia()"),S.grayscaleEnabled&&U.push("grayscale()"),S.shadowEnabled&&U.push(`drop-shadow(${S.shadowOffsetX}px ${S.shadowOffsetY}px ${S.shadowBlur}px ${S.shadowColor})`);const $=f("div",{style:{position:"absolute",left:S.x+"px",top:S.y+"px",width:S.width+"px",height:S.height+"px",transform:`rotate(${S.rotation}deg)`,"transform-origin":"top left",opacity:S.opacity,filter:U.join(" ")||"none"}},M);return T&&T({dom:$,element:S})||$}async function d({page:S,store:x,elementHook:P}){const T=await Promise.all(S.children.map($=>g({element:$,page:S,store:x,elementHook:P}))),L=S.width==="auto"?x.width:S.width,M=S.height==="auto"?x.height:S.height;let U={};if(S.background.indexOf("url")>=0||S.background.indexOf("http")>=0||S.background.indexOf(".jpg")>=0||S.background.indexOf(".png")>=0||S.background.indexOf(".jpeg")>=0){const{width:$,height:Z}=await(0,l.loadImage)(S.background),z=await w({element:Object.assign({x:0,y:0,width:$,height:Z,src:S.background,cornerRadius:0},(0,a.getCrop)({width:$,height:Z},{width:$,height:Z})),page:S,store:x});T.unshift(z)}else U=Object.assign(Object.assign({},U),{"background-color":S.background});return f("div",{className:"page",style:Object.assign(Object.assign({},U),{width:L+"px",height:M+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...T)}async function _({json:S,elementHook:x}){const P=await Promise.all(S.pages.map(M=>d({page:M,store:S,elementHook:x}))),T=[];S.pages.forEach(M=>{M.children.forEach(U=>{U.type==="text"&&T.indexOf(U.fontFamily)===-1&&T.push(U.fontFamily)})});const L=T.map(M=>S.fonts.find(U=>U.fontFamily===M)?f("style",{},""):f("link",{href:`https://fonts.googleapis.com/css?family=${M}`,rel:"stylesheet"}));return f("div",{className:"design"},...L,...P)}e.jsonToDOM=_;const O=(S,x)=>typeof x=="object"?`${S}="${Object.keys(x).map(P=>`${P}:${x[P]};`).join(" ")}"`:`${S}="${x}"`,k=({dom:S})=>{if(typeof S=="string")return S;if(!S)return"";const x=S.props,{innerHTML:P}=x,T=i(x,["innerHTML"]);return`<${S.type} ${Object.keys(T).map(L=>O(L,S.props[L])).join(" ")}>${P||S.children.map(L=>k({dom:L})).join("")}</${S.type}>`};async function C({json:S,elementHook:x}){const P=await _({json:S,elementHook:x});return k({dom:P})}e.jsonToHTML=C})(IS);var DS={};(function(e){var t=we&&we.__createBinding||(Object.create?function(x,P,T,L){L===void 0&&(L=T);var M=Object.getOwnPropertyDescriptor(P,T);M&&!("get"in M?!P.__esModule:M.writable||M.configurable)||(M={enumerable:!0,get:function(){return P[T]}}),Object.defineProperty(x,L,M)}:function(x,P,T,L){L===void 0&&(L=T),x[L]=P[T]}),r=we&&we.__setModuleDefault||(Object.create?function(x,P){Object.defineProperty(x,"default",{enumerable:!0,value:P})}:function(x,P){x.default=P}),n=we&&we.__importStar||function(x){if(x&&x.__esModule)return x;var P={};if(x!=null)for(var T in x)T!=="default"&&Object.prototype.hasOwnProperty.call(x,T)&&t(P,x,T);return r(P,x),P},i=we&&we.__rest||function(x,P){var T={};for(var L in x)Object.prototype.hasOwnProperty.call(x,L)&&P.indexOf(L)<0&&(T[L]=x[L]);if(x!=null&&typeof Object.getOwnPropertySymbols=="function"){var M=0;for(L=Object.getOwnPropertySymbols(x);M<L.length;M++)P.indexOf(L[M])<0&&Object.prototype.propertyIsEnumerable.call(x,L[M])&&(T[L[M]]=x[L[M]])}return T};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToSVG=e.jsonToDOM=e.fixRatio=void 0;const a=Jc,o=n(Cu),l=Jc,u=_0,f=(x,P,...T)=>({type:x,props:P,children:T||[]});function v(x){var P=new DOMParser().parseFromString(x,"image/svg+xml");return P.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(P)}e.fixRatio=v;const w=async({element:x,page:P,store:T})=>{let{src:L}=x;if(x.type==="svg"){const Q=await o.urlToString(L);L=o.replaceColors(Q,new Map(Object.entries(x.colorsReplace)))}let M="";x.flipX&&(M+="scaleX(-1)"),x.flipY&&(M+="scaleY(-1)"),x.clipSrc&&await o.urlToBase64(x.clipSrc);const U=await(0,l.loadImage)(L),$=U.width*x.cropWidth,Z=U.height*x.cropHeight,z=x.width/x.height;let N,H;const R=$/Z;x.type==="svg"?(N=$,H=Z):z>=R?(N=$,H=$/z):(N=Z*z,H=Z);const F=N/U.width,B=H/U.height,D=N/H>x.width/x.height?x.height/H:x.width/N,V=N*D/F,Y=H*D/B,q=x.cropX*U.width*D,G=x.cropY*U.height*D,K=`clip-${x.id}`,X=L.replace(/&/g,"&amp;");return f("g",{style:{transform:M}},f("defs",{},f("clipPath",{id:K},f("rect",{x:0,y:0,width:x.width,height:x.height}))),f("image",{"xlink:href":X,x:-q,y:-G,width:V,height:Y,preserveAspectRatio:"none","clip-path":`url(#${K})`}))},b=async({element:x,page:P,store:T})=>{const L=(z,N,H,R,F)=>{const B=document.createElement("canvas").getContext("2d");return B.font=`${F} ${R} ${N}px ${H}`,B.measureText(z).width},M=((z,N,H,R,F,B)=>{const D=[];return z.split(`
276
+ `).forEach(V=>{const Y=V.split(" ");let q="";for(let G=0;G<Y.length;G++){const K=q+Y[G]+" ";L(K,H,R,F,B)>N&&G>0?(D.push(q.trim()),q=Y[G]+" "):q=K}D.push(q.trim())}),D})(x.text,x.width,x.fontSize,x.fontFamily,x.fontWeight,x.fontStyle),U=x.fontSize*x.lineHeight,$=x.align==="center"?"middle":x.align==="right"?"end":"start",Z=M.map((z,N)=>f("tspan",{x:x.align==="center"?x.width/2:x.align==="right"?x.width:0,dy:N===0?0:U,innerHTML:z}));return f("g",{},f("text",{fill:x.fill,y:x.fontSize,"font-size":x.fontSize+"px","text-anchor":$,"font-family":x.fontFamily,"font-style":x.fontStyle,"font-weight":x.fontWeight,"text-decoration":x.textDecoration,"line-height":x.lineHeight,"letter-spacing":x.letterSpacing+"em","stroke-width":x.strokeWidth,stroke:x.stroke},...Z))},h=({element:x,type:P})=>{const T={"stroke-width":x.height,stroke:x.color,"line-cap":"round","stroke-linejoin":"round",opacity:x.opacity};return P==="arrow"||P==="triangle"?f("polyline",Object.assign({points:`${3*x.height},${2*-x.height} 0,0 ${3*x.height},${2*x.height}`},T)):P==="bar"?f("polyline",Object.assign({points:`0,${2*-x.height} 0,${2*x.height}`},T)):P==="circle"?f("circle",Object.assign({r:x.height},T)):P==="square"?f("polyline",Object.assign({points:`${-x.height},${-x.height} ${-x.height},${x.height} ${x.height},${x.height} ${x.height},${-x.height}`},T)):null},E=async({element:x,page:P,store:T})=>f("g",{},f("line",{x1:0,y1:x.height/2,x2:x.width,y2:x.height/2,stroke:x.color,"stroke-width":x.height}),f("g",{transform:`translate(0 ${x.height/2})`},h({element:x,type:x.startHead})),f("g",{transform:`translate(${x.width} ${x.height/2}) rotate(180)`},h({element:x,type:x.endHead}))),y=async({element:x,page:P,store:T,elementHook:L})=>{const M=await Promise.all(x.children.map($=>d({element:$,page:P,store:T,elementHook:L}))),U=f("g",{opacity:x.opacity,transform:`translate(${x.x}, ${x.y}) rotate(${x.rotation})`,style:{"transform-origin":"top left"}},...M);return L&&L({dom:U,element:x})||U};function m(x){let P=x.replace(/<svg[^>]*>/,"");return P=P.replace(/<\/svg>/,""),P}const p=async({element:x,page:P,store:T,elementHook:L})=>{const M=m((0,u.figureToSvg)(x)),U=f("g",{innerHTML:M});return L&&L({dom:U,element:x})||U},g={image:w,svg:w,text:b,line:E,figure:p,group:y};async function d({element:x,page:P,store:T,elementHook:L}){let M=await g[x.type];M||(M=()=>f("g",{}),console.error(`SVG export does not support ${x.type} type...`));const U=await M({element:x,page:P,store:T}),$=[];x.blurEnabled&&$.push(`blur(${x.blurRadius/2}px)`),x.brightnessEnabled&&$.push(`brightness(${100*x.brightness+100}%)`),x.sepiaEnabled&&$.push("sepia()"),x.grayscaleEnabled&&$.push("grayscale()"),x.shadowEnabled&&$.push(`drop-shadow(${x.shadowOffsetX}px ${x.shadowOffsetY}px ${x.shadowBlur}px ${x.shadowColor})`);const Z=f("g",{className:"element",id:x.id,transform:`translate(${x.x}, ${x.y}) rotate(${x.rotation})`,display:x.visible?void 0:"none",style:{"transform-origin":"top left",filter:$.join(" ")}},U);return L&&L({dom:Z,element:x})||Z}async function _({page:x,store:P,elementHook:T}){const L=await Promise.all(x.children.map(U=>d({element:U,page:x,store:P,elementHook:T})));let M={};if(x.background.indexOf("url")>=0||x.background.indexOf("http")>=0||x.background.indexOf(".jpg")>=0||x.background.indexOf(".png")>=0||x.background.indexOf(".jpeg")>=0){const U=await(0,l.loadImage)(x.background),$=await(0,l.cropImage)(x.background,Object.assign({width:P.width,height:P.height,x:0,y:0},(0,a.getCrop)({width:P.width,height:P.height},{width:U.width,height:U.height})));M=Object.assign(Object.assign({},M),{"background-image":`url(${$})`})}return f("g",{className:"page",style:Object.assign(Object.assign({},M),{background:x.background})},f("rect",{x:0,y:0,width:P.width,height:P.height,fill:x.background}),...L)}async function O({json:x,elementHook:P}){const T=await Promise.all(x.pages.map(U=>_({page:U,store:x,elementHook:P}))),L=[];x.pages.forEach(U=>{U.children.forEach($=>{$.type==="text"&&L.indexOf($.fontFamily)===-1&&L.push($.fontFamily)})});const M=L.map(U=>x.fonts.find($=>$.fontFamily===U)?f("style",{},""):f("defs",{},f("style",{type:"text/css",innerHTML:`@import url('https://fonts.googleapis.com/css?family=${U}:bi,normal,i,b');`.replace(/&/g,"&amp;")})));return f("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${x.width} ${x.height}`},...M,...T)}e.jsonToDOM=O;const k=(x,P)=>typeof P=="object"?`${x}="${Object.keys(P).map(T=>`${T}:${P[T]};`).join(" ")}"`:P==null||P===""?"":`${x}="${P}"`,C=({dom:x,nestLevel:P=0})=>{if(typeof x=="string")return x;if(!x)return"";const T=x.props,{innerHTML:L}=T,M=i(T,["innerHTML"]),U=" ".repeat(P);return`${U}<${x.type} ${Object.keys(M).map($=>k($,M[$])).join(" ")}>${L||`
277
+ `+x.children.map($=>C({dom:$,nestLevel:P+1})).join("")}${U}</${x.type}>
278
+ `};async function S({json:x,elementHook:P}){const T=await O({json:x,elementHook:P});return C({dom:T})}e.jsonToSVG=S})(DS);var dv={},L_;function FS(){return L_||(L_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const t=$i,r=S0,n=ef(),i=B2(),a=ef(),o=Cf;e.Page=t.types.model("Page",{id:t.types.identifier,children:t.types.array(t.types.late(()=>n.ElementTypes)),width:t.types.optional(t.types.union(t.types.number,t.types.literal("auto")),"auto"),height:t.types.optional(t.types.union(t.types.number,t.types.literal("auto")),"auto"),background:"white",bleed:0,custom:t.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1}).postProcessSnapshot(l=>{const u=Object.assign({},l),f={};for(var v in u)v[0]!=="_"&&(f[v]=l[v]);return f}).views(l=>({get store(){return(0,t.getParentOfType)(l,i.Store)},get startTime(){let u=0;for(const f of l.store.pages){if(f.id===l.id)return u;u+=f.duration}return u},get _exportingOrRendering(){return l._exporting||l._rendering}})).views(l=>({get computedWidth(){return l.width==="auto"?l.store.width:l.width},get computedHeight(){return l.height==="auto"?l.store.height:l.height}})).actions(l=>({toJSON:()=>JSON.parse(JSON.stringify((0,t.getSnapshot)(l))),_forEachElementUp(u,f){const v=u.map(w=>({id:w,index:l.children.findIndex(b=>b.id===w)}));v.sort((w,b)=>b.index-w.index);for(const{index:w}of v){if(w==-1)continue;const b=w<l.children.length-1&&l.children[w+1],h=u.indexOf(b==null?void 0:b.id)>=0;w===l.children.length-1||h||f(w)}},_forEachElementDown(u,f){const v=u.map(w=>({id:w,index:l.children.findIndex(b=>b.id===w)}));v.sort((w,b)=>w.index-b.index);for(const{index:w}of v){if(w==-1)continue;const b=w>0&&l.children[w-1],h=u.indexOf(b==null?void 0:b.id)>=0;w===0||h||f(w)}return!1}})).actions(l=>({clone(u={}){const f=l.toJSON();f.children.forEach(h=>{h.id=(0,r.nanoid)(10),(0,a.forEveryChild)(h,E=>{E.id=(0,r.nanoid)(10)})});const v=Object.assign(Object.assign(Object.assign({},f),{id:(0,r.nanoid)(10)}),u),w=l.store.addPage(v),b=l.store.pages.indexOf(l);w.setZIndex(b+1),w.select()},setZIndex(u){l.store.setPageZIndex(l.id,u)},set(u){Object.assign(l,u)},select(){l.store.selectPage(l.id)},addElement(u,{skipSelect:f=!1}={}){const v=a.TYPES_MAP[u.type];if(!v)return void console.error("Can not find model with type "+u.type);u.children&&u.children.forEach(b=>{b.id=(0,r.nanoid)(10)});const w=v.create(Object.assign({id:(0,r.nanoid)(10)},u));return l.children.push(w),w.selectable&&!f&&l.store.selectElements([w.id]),w},canMoveElementsUp(u){let f=!1;return l._forEachElementUp(u,()=>{f=f||!0}),f},moveElementsUp(u){l._forEachElementUp(u,f=>{const v=l.children[f];(0,t.detach)(v),l.children.splice(f+1,0,v)})},canMoveElementsTop(u){return this.canMoveElementsUp(u)},moveElementsTop(u){const f=[],v=[];l.children.forEach(w=>{u.indexOf(w.id)>=0?f.push(w):v.push(w)}),l.children.replace(v.concat(f))},canMoveElementsDown(u){let f=!1;return l._forEachElementDown(u,()=>{f=f||!0}),f},moveElementsDown(u){l._forEachElementDown(u,f=>{const v=l.children[f];(0,t.detach)(v),l.children.splice(f-1,0,v)})},canMoveElementsBottom(u){return this.canMoveElementsDown(u)},moveElementsBottom(u){const f=[],v=[];l.children.forEach(w=>{u.indexOf(w.id)>=0?f.push(w):v.push(w)}),l.children.replace(f.concat(v))},setElementZIndex(u,f){const v=l.children.find(w=>w.id===u);v&&((0,t.detach)(v),l.children.remove(v),l.children.splice(f,0,v))},setSize({width:u,height:f,useMagic:v,softChange:w}){if(v){const b=[],h=M=>M.type==="image"&&M.x<1&&M.y<1&&M.width>=l.computedWidth-2&&M.height>=l.computedHeight-2;(0,a.forEveryChild)(l,M=>{M.type!=="group"&&(h(M)||b.push(M))});const E=(0,o.getTotalClientRect)(b),y=0,m=Math.max(0,Math.min(E.x,l.computedWidth-E.x-E.width)),p=l.computedWidth*y,g=Math.max(0,m-p),d=Math.max(0,Math.min(E.y,l.computedHeight-E.y-E.height)),_=l.computedHeight*y,O=Math.max(0,d-_),k=l.computedWidth-2*g,C=l.computedHeight-2*O,S=u/k,x=f/C,P=Math.min(S,x),T=(u-k*P)/2-g*P,L=(f-C*P)/2-O*P;(0,a.forEveryChild)(l,M=>{M.type!=="group"&&(h(M)?M.set({x:M.x*P,y:M.y*P,width:M.width*S,height:M.height*x,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(M.set({x:T+M.x*P,y:L+M.y*P,width:M.width*P,height:M.height*P}),M.type==="text"?M.set({fontSize:M.fontSize*P}):M.type==="figure"&&M.set({strokeWidth:M.strokeWidth*P})))})}w||(l.width=u),w||(l.height=f)}})).actions(l=>({moveElementUp(u){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),l.moveElementsUp([u])},moveElementDown(u){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),l.moveElementsDown([u])},moveElementTop(u){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),l.moveElementsTop([u])},moveElementBottom(u){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),l.moveElementsBottom([u])},play(){l.store.play({startTime:l.startTime,endTime:l.startTime+l.duration})}}))}(dv)),dv}var M_;function B2(){return M_||(M_=1,function(e){var t=we&&we.__createBinding||(Object.create?function(S,x,P,T){T===void 0&&(T=P);var L=Object.getOwnPropertyDescriptor(x,P);L&&!("get"in L?!x.__esModule:L.writable||L.configurable)||(L={enumerable:!0,get:function(){return x[P]}}),Object.defineProperty(S,T,L)}:function(S,x,P,T){T===void 0&&(T=P),S[T]=x[P]}),r=we&&we.__setModuleDefault||(Object.create?function(S,x){Object.defineProperty(S,"default",{enumerable:!0,value:x})}:function(S,x){S.default=x}),n=we&&we.__importStar||function(S){if(S&&S.__esModule)return S;var x={};if(S!=null)for(var P in S)P!=="default"&&Object.prototype.hasOwnProperty.call(S,P)&&t(x,S,P);return r(x,S),x},i=we&&we.__rest||function(S,x){var P={};for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&x.indexOf(T)<0&&(P[T]=S[T]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var L=0;for(T=Object.getOwnPropertySymbols(S);L<T.length;L++)x.indexOf(T[L])<0&&Object.prototype.propertyIsEnumerable.call(S,T[L])&&(P[T[L]]=S[T[L]])}return P},a=we&&we.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.createStore=e.Store=e.Font=void 0;const o=$i,l=kS,u=S0,f=a(vi),v=RS,w=LS,b=MS,h=j2(),E=n(xu),y=ua,m=w0,p=z2,g=NS,d=IS,_=DS,O=FS(),k=ef();function C({key:S,showCredit:x}={key:"",showCredit:!1}){const P=e.Store.create();return(0,h.validateKey)(S,x),P}(0,o.setLivelinessChecking)("ignore"),e.Font=o.types.model("Font",{fontFamily:o.types.string,url:o.types.optional(o.types.string,""),styles:o.types.frozen()}).preProcessSnapshot(S=>Object.assign(Object.assign({},S),{fontFamily:S.fontFamily||S.name})),e.Store=o.types.model("Store",{role:"",pages:o.types.array(O.Page),fonts:o.types.array(e.Font),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:o.types.frozen(),selectedElementsIds:o.types.array(o.types.string),animatedElementsIds:o.types.array(o.types.string),history:o.types.optional(l.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:2,_activePageId:""}).views(S=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),S.bleedVisible},get selectedElements(){return S.selectedElementsIds.map(x=>{for(const P of S.pages)for(const T of P.children)if(T.id===x)return T}).filter(x=>!!x)},get children(){return S.pages},get selectedShapes(){const x=[];return(0,k.forEveryChild)({children:S.selectedElements},P=>{P.type!=="group"&&x.push(P)}),x},get activePage(){return S.pages.slice().find(x=>x.id===S._activePageId)||(S.pages.length?S.pages[0]:null)},get duration(){let x=0;return S.pages.forEach(P=>{x+=P.duration}),x},get _hasCroppedImages(){return S.find(x=>x.type==="image"&&x._cropModeEnabled)},find(x){let P;return(0,k.forEveryChild)({children:S.pages},T=>{if(!P&&x(T))return P=T,!0}),P},getElementById:x=>S.find(P=>P.id===x)})).actions(S=>{let x=0,P=null,T=!1;return{afterCreate(){S.history.canUndo},setCurrentTime(L){S.currentTime=L},play({animatedElementsIds:L=[],startTime:M=0,currentTime:U=0,endTime:$=S.duration,repeat:Z=!1}={}){U&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),M=U),S.animatedElementsIds=(0,o.cast)(L),S.currentTime=M,S.isPlaying=!0,x=Date.now(),P=$,T=Z,requestAnimationFrame(S.seek)},checkActivePage(){let L=0;for(const M of S.pages){if(S.currentTime>=M.startTime&&S.currentTime<M.startTime+M.duration){S.selectPage(M.id);break}L+=M.duration}},seek(){if(!S.isPlaying)return;const L=Date.now(),M=L-x;x=L,S.currentTime+=M,S.checkActivePage();const U=P||S.duration;S.isPlaying&&S.currentTime<U?requestAnimationFrame(S.seek):S.isPlaying&&T?(S.currentTime=0,requestAnimationFrame(S.seek)):S.stop()},stop(){S.isPlaying=!1,S.currentTime=0,S.animatedElementsIds=(0,o.cast)([]),S.checkActivePage()}}}).actions(S=>({set(x){Object.assign(S,x)},setUnit({unit:x,dpi:P}){S.unit=x||S.unit,S.dpi=P||S.dpi},setRole(x){S.role=x},addPage(x){const P=O.Page.create(Object.assign({id:(0,u.nanoid)(10)},x));return S.pages.push(P),S._activePageId=P.id,P},selectPage(x){S._activePageId=x},selectElements(x){const P=x.map(T=>S.getElementById(T)).sort((T,L)=>T.page.children.indexOf(T)-T.page.children.indexOf(L)).filter(T=>!!T).map(T=>T.id);S.selectedElementsIds=(0,o.cast)(P)},toggleBleed(x){S.bleedVisible=x??!S.bleedVisible},toggleRulers(x){S.rulesVisible=x??!S.rulesVisible},openSidePanel(x){S.openedSidePanel!==x&&(S.previousOpenedSidePanel=S.openedSidePanel,S.openedSidePanel=x)},setScale(x){S.scale=x},_setScaleToFit(x){S.scaleToFit=x},setElementsPixelRatio(x){S._elementsPixelRatio=x},setSize(x,P,T){S.pages.forEach(L=>{L.setSize({width:x,height:P,useMagic:T,softChange:!0})}),S.width=x,S.height=P},setPageZIndex(x,P){const T=S.pages.find(L=>L.id===x);T&&((0,o.detach)(T),S.pages.remove(T),S.pages.splice(P,0,T))},deletePages(x){const P=S.pages.indexOf(S.activePage);x.forEach(M=>{const U=S.pages.find($=>$.id===M);(0,o.destroy)(U)});const T=Math.min(S.pages.length-1,P),L=S.pages[T];L&&(S._activePageId=L.id),S.selectedElementsIds=(0,o.cast)(S.selectedElementsIds.filter(M=>S.getElementById(M)))},groupElements(x){const P=x.map(M=>S.getElementById(M));P.forEach(M=>{M&&(0,o.detach)(M)});const T=S.activePage,L={id:(0,u.nanoid)(10),children:P,type:"group"};return T.children.push(L),S.selectedElementsIds=(0,o.cast)([L.id]),L},ungroupElements(x){const P=x.map(L=>S.getElementById(L)),T=[];P.forEach(L=>{if(L&&L.type==="group"){const M=L.page,U=M.children.indexOf(L);L.children.forEach($=>{T.push($.id)}),L.children.forEach($=>{(0,o.detach)($),M.children.push($)}),M.children.splice(U,1)}}),S.selectedElementsIds=(0,o.cast)(T)},deleteElements(x){const P=[];S.find(T=>(x.includes(T.id)&&P.push(T),!1)),P.forEach(T=>{(0,o.destroy)(T)}),S.selectedElementsIds=(0,o.cast)(S.selectedElementsIds.filter(T=>S.getElementById(T)))},on(x,P){if(x==="change"){let T=S.toJSON();return(0,o.onSnapshot)(S,L=>{const M=S.toJSON();!(0,p.deepEqual)(T,M)&&(T=M,P(M))})}},async _toCanvas({pixelRatio:x,ignoreBackground:P,pageId:T,mimeType:L,includeBleed:M,_skipTimeout:U}={}){var $;const Z=x||1;T=T||(($=S.pages[0])===null||$===void 0?void 0:$.id);const z=S.pages.find(oe=>oe.id===T);if(!z)throw new Error(`No page for export with id ${T}`);z==null||z.set({_exporting:!0});const N=await(0,g.waitTillAvailable)(()=>f.default.stages.find(oe=>oe.getAttr("pageId")===T));if(!N)throw new Error(`Export is failed. Can not find stage for page ${T}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const H=!!N.findOne(".page-container"),R=S._elementsPixelRatio;Z>S._elementsPixelRatio&&S.setElementsPixelRatio(Z),await S.waitLoading({_skipTimeout:U});const F=N.findOne(".page-container");if(!F)throw S.setElementsPixelRatio(R),new Error(`Export is failed. Can't find page container. ${H}`);N.find("Transformer").forEach(oe=>oe.visible(!1)),F.find(".page-background").forEach(oe=>oe.shadowEnabled(!1)),F.find(".page-background").forEach(oe=>oe.strokeEnabled(!1)),F.find(".highlighter").forEach(oe=>oe.visible(!1));const B=F.findOne(".page-background-group"),D=B.clip();B.clip({x:null,y:null,width:null,height:null});const V=F.findOne(".elements-container"),Y=V.clip();V.clip({x:null,y:null,width:null,height:null});const q=F.find(oe=>oe.getAttr("hideInExport"));q.forEach(oe=>{oe.setAttr("oldVisible",oe.visible()),oe.hide()});const G=F.find(oe=>!oe.visible()&&oe.getAttr("editModeEnabled"));G.forEach(oe=>{oe.setAttr("oldVisible",oe.visible()),oe.show()}),P&&F.find(".page-background").forEach(oe=>oe.hide());const K=M?z.bleed:0;let X=K;!S.bleedVisible&&M||(S.bleedVisible||M?S.bleedVisible&&M?X=0:S.bleedVisible&&!M&&(X=-z.bleed):X=0);const Q=document.createElement("canvas");Q.width=Math.round((z.computedWidth+2*K)*Z),Q.height=Math.round((z.computedHeight+2*K)*Z);const ee=Q.getContext("2d");L==="image/jpeg"&&(ee.fillStyle="white",ee.fillRect(0,0,Q.width,Q.height));const te=F.scale();F.scale({x:1,y:1});const ae=F.toCanvas({x:F.x()-X,y:F.y()-X,width:z.computedWidth+2*K,height:z.computedHeight+2*K,pixelRatio:Z});return F.scale(te),ee.drawImage(ae,0,0,Q.width,Q.height),f.default.Util.releaseCanvas(ae),P&&F.find(".page-background").forEach(oe=>oe.show()),q.forEach(oe=>{oe.visible(oe.getAttr("oldVisible"))}),G.forEach(oe=>{oe.visible(oe.getAttr("oldVisible"))}),F.find(".page-background").forEach(oe=>oe.shadowEnabled(!0)),F.find(".page-background").forEach(oe=>oe.strokeEnabled(!0)),N.find("Transformer").forEach(oe=>oe.visible(!0)),F.find(".highlighter").forEach(oe=>oe.visible(!0)),B.clip(D),V.clip(Y),S.setElementsPixelRatio(R),z==null||z.set({_exporting:!1}),Q},async toDataURL(x={}){var{mimeType:P,quality:T}=x,L=i(x,["mimeType","quality"]);const M=await S._toCanvas(Object.assign({mimeType:P},L)),U=M.toDataURL(P,T);return f.default.Util.releaseCanvas(M),U},async toBlob(x={}){var{mimeType:P,quality:T}=x,L=i(x,["mimeType","quality"]);const M=await S._toCanvas(Object.assign({mimeType:P},L)),U=new Promise($=>{M.toBlob($,P,T)});return f.default.Util.releaseCanvas(M),U},async saveAsImage(x={}){var{fileName:P}=x,T=i(x,["fileName"]);const L=T.mimeType||"image/png",M=L.split("/")[1];(0,v.downloadFile)(await S.toDataURL(T),P||"polotno."+M,L)},async _toPDF(x){const P=x.dpi||S.dpi,T=x.parallel||1,L=x.unit||(S.unit==="px"?"mm":S.unit),M=x.pixelRatio||1,U=x.pageIds||S.pages.map(Y=>Y.id),$=S.pages.filter(Y=>U.includes(Y.id)),Z=await(0,w.getJsPDF)(),z=Y=>(0,m.pxToUnit)({px:Y,unit:L,dpi:P}),N=z(x.cropMarkSize||0),H=$[0]||{},R=x.includeBleed?H.bleed:0,F=z(H.computedWidth+2*R)+2*N,B=z(H.computedHeight+2*R)+2*N;var D=new Z({unit:L,orientation:F>B?"landscape":"portrait",format:[F,B],compress:!0,putOnlyUsedFonts:!0});D.deletePage(1);const V=((Y,q)=>{for(var G=[],K=0;K<Y.length;K+=q)G.push(Y.slice(K,K+q));return G})($,T);for(const Y of V){const q=Y.map(async G=>{const K=x.includeBleed?G.bleed:0,X=z(G.computedWidth+2*K)+2*N,Q=z(G.computedHeight+2*K)+2*N;let ee=0,te=M;for(;ee<10;){ee+=1,ee===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const ae=await S.toDataURL(Object.assign(Object.assign({},x),{pageId:G.id,pixelRatio:te}));if(ae.length>20)return{url:ae,width:X,height:Q};te*=.8}});(await Promise.all(q)).forEach(({url:G,width:K,height:X})=>{D.addPage([K,X],K>X?"landscape":"portrait"),N&&(D.setLineWidth(z(1)),D.line(2*N,0,2*N,N),D.line(0,2*N,N,2*N),D.line(K-2*N,0,K-2*N,N),D.line(K,2*N,K-N,2*N),D.line(0,X-2*N,N,X-2*N),D.line(2*N,X,2*N,X-N),D.line(K,X-2*N,K-N,X-2*N),D.line(K-2*N,X,K-2*N,X-N)),D.addImage(G,N,N,K-2*N,X-2*N,void 0,"FAST")})}return D},toPDFDataURL:async x=>(await S._toPDF(Object.assign({mimeType:"image/jpeg"},x))).output("datauristring"),async toGIFDataURL(x={}){const P=x.pixelRatio||1,T=await(0,b.createGIF)({width:S.width*P,height:S.height*P}),L=1e3/(x.fps||10),M=S.duration/L;for(let U=0;U<M-1;U++){const $=U*L||1;S.setCurrentTime($);let Z=0,z="";for(const H of S.pages)if(Z+=H.duration,H.set({_rendering:Z>$}),Z>$){z=H.id;break}const N=await S._toCanvas({pixelRatio:P,pageId:z,_skipTimeout:!0});T.addFrame(N.getContext("2d"),{delay:L,copy:!0})}for(const U of S.pages)U.set({_rendering:!1});return S.stop(),T.render(),new Promise(U=>{T.on("finished",function($){(function(Z,z){var N=new FileReader;N.onload=function(H){z(H.target.result)},N.readAsDataURL(Z)})($,U)})})},async saveAsGIF(x={}){var{fileName:P}=x,T=i(x,["fileName"]);const L=await S.toGIFDataURL(T);(0,v.downloadFile)(L,P||"polotno.gif")},async toHTML({elementHook:x}={elementHook:void 0}){const P=S.toJSON();return(0,d.jsonToHTML)({json:P,elementHook:x})},async saveAsHTML({fileName:x}={}){const P=await S.toHTML(),T="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(P)));(0,v.downloadFile)(T,x||"polotno.html")},async toSVG({elementHook:x}={elementHook:void 0}){const P=S.toJSON();return(0,_.jsonToSVG)({json:P,elementHook:x})},async saveAsSVG({fileName:x,elementHook:P}={}){const T=await S.toSVG({elementHook:P}),L="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(T)));(0,v.downloadFile)(L,x||"polotno.svg")},async saveAsPDF(x={}){var{fileName:P}=x,T=i(x,["fileName"]);(await S._toPDF(Object.assign({mimeType:"image/jpeg"},T))).save(P||"polotno.pdf")},async waitLoading({_skipTimeout:x=!1}={}){x||await new Promise(P=>setTimeout(P,50)),await(0,y.whenLoaded)()},toJSON:()=>({width:S.width,height:S.height,fonts:(0,o.getSnapshot)(S.fonts),pages:(0,o.getSnapshot)(S.pages),unit:S.unit,dpi:S.dpi,custom:S.custom}),loadJSON(x,P=!1){var T;const L=Object.assign({},x),M=S.pages.indexOf(S.activePage);let U=(T=L.pages[M]||L.pages[0])===null||T===void 0?void 0:T.id;L._activePageId=U;const $=Object.assign({},(0,o.getSnapshot)(S));Object.assign($,L),$.history=P?S.history.toJSON():{history:[],undoIdx:-1},(0,o.applySnapshot)(S,$)},clear({keepHistory:x=!1}={}){const P=S.pages.map(T=>T.id);S.deletePages(P),x||S.history.clear()},addFont(x){S.removeFont(x.fontFamily),S.fonts.push(x),S.loadFont(x.fontFamily)},removeFont(x){S.fonts.filter(P=>P.fontFamily===x).forEach(P=>(0,o.destroy)(P))},async loadFont(x){const P=S.fonts.find(T=>T.fontFamily===x)||E.globalFonts.find(T=>T.fontFamily===x);P?E.injectCustomFont(P):E.injectGoogleFont(x),await E.loadFont(x)},validate:x=>e.Store.validate(x,[{path:"",type:e.Store}]).map(P=>({path:"store"+P.context.map(T=>T.path).join("."),message:P.message}))})),e.createStore=C,e.default=C}(fv)),fv}var N_;function jS(){return N_||(N_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const t=$i,r=S0,n=B2(),i=FS(),a=ef();e.Node=t.types.model("Node",{id:t.types.identifier,type:"none",name:"",opacity:1,custom:t.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(o=>{for(var l in o)o[l]===null&&(o[l]=void 0);return o}).postProcessSnapshot(o=>{const l=Object.assign({},o),u={};for(var f in l)f[0]!=="_"&&(u[f]=o[f]);return u}).views(o=>({get locked(){return!(o.draggable||o.contentEditable||o.styleEditable||o.resizable)},get page(){return(0,t.getParentOfType)(o,i.Page)},get store(){return(0,t.getParentOfType)(o,n.Store)},get top(){let l=o;for(;;){if(!(0,t.hasParentOfType)(l,a.GroupElement))return l;l=(0,t.getParentOfType)(l,a.GroupElement)}},get parent(){return(0,t.hasParentOfType)(o,a.GroupElement)?(0,t.getParentOfType)(o,a.GroupElement):(0,t.hasParentOfType)(o,i.Page)?(0,t.getParentOfType)(o,i.Page):(0,t.hasParentOfType)(o,n.Store)?(0,t.getParentOfType)(o,n.Store):null},get zIndex(){return o.parent.children.indexOf(o)}})).actions(o=>({toJSON:()=>Object.assign({},(0,t.getSnapshot)(o))})).actions(o=>({clone(l={},{skipSelect:u=!1}={}){const f=JSON.parse(JSON.stringify(o.toJSON()));return l.id=l.id||(0,r.nanoid)(10),(0,a.forEveryChild)(f,v=>{v.id=(0,r.nanoid)(10)}),Object.assign(f,l),o.page.addElement(f,{skipSelect:u})},set(l){Object.assign(o,l)},moveUp(){o.page.moveElementsUp([o.id])},moveTop(){o.page.moveElementsTop([o.id])},moveDown(){o.page.moveElementsDown([o.id])},moveBottom(){o.page.moveElementsBottom([o.id])},setZIndex(l){o.parent.setElementZIndex(o.id,l)},beforeDestroy(){}}))}(cv)),cv}var hv={},zS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const t={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}};e.animations={fade:({dTime:i,element:a,animation:o})=>{const l=i/o.duration;return o.type==="enter"?{opacity:l*a.opacity}:{opacity:(1-l)*a.opacity}},move:({dTime:i,element:a,animation:o})=>{const l=t[o.data.direction]||t.right,u={};for(var f in l.from){let v=l.from[f],w=l.to[f];o.type==="exit"&&(v=l.to[f],w=-l.from[f]);const b=a[f]+v,h=a[f]+w-b;u[f]=b+i/o.duration*h}return u},zoom:({dTime:i,element:a,animation:o})=>{const l={},u={x:a.x+a.width/3,y:a.y+a.height/3,width:a.width/3,height:a.height/3,fontSize:a.fontSize/3},f={x:a.x,y:a.y,width:a.width,height:a.height,fontSize:a.fontSize};for(var v in u){let w=u[v],b=f[v];if(o.type==="exit"){const E=w;w=b,b=E}const h=b-w;l[v]=w+i/o.duration*h}return l}};const r=({element:i,dTime:a,animation:o})=>{const l=e.animations[o.name];return l?l({element:i,dTime:a,animation:o}):(console.error("Can not find animation type: "+o.name),{})};e.animate=r;const n=(i,a)=>{};e.registerAnimation=n})(zS);var I_;function Au(){return I_||(I_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.Animation=void 0;const t=$i,r=zS,n=ha,i=jS();e.Animation=t.types.model("Animation",{delay:0,duration:500,enabled:!0,type:t.types.enumeration("Type",["enter","exit"]),name:"none",data:t.types.frozen({})}),e.Shape=i.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:t.types.array(e.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(a=>{const o=Object.assign(Object.assign({},a),{x:a.x||0,y:a.y||0});return"width"in a&&(o.width=o.width||1),"height"in a&&(o.height=o.height||1),a.locked&&(o.draggable=!1,o.contentEditable=!1,o.styleEditable=!1,o.resizable=!1),o}).views(a=>{const o=(0,n.observable)({x:a.x,y:a.y,width:a.width,height:a.height,rotation:a.rotation,opacity:a.opacity,color:a.color,fontSize:a.fontSize}),l=(0,n.action)(u=>{Object.assign(o,u)});return{get a(){const{currentTime:u}=a.store;if(l({x:a.x,y:a.y,width:a.width,height:a.height,rotation:a.rotation,opacity:a.opacity,color:a.color,fontSize:a.fontSize}),u===0)return o;const f=u-a.page.startTime;if(f>a.page.duration||f<0)return o;const v=a.store.animatedElementsIds;if(v.length&&!v.includes(a.id))return o;const w=a.animations.find(h=>h.type==="enter");if(w!=null&&w.enabled&&f<w.delay&&l({opacity:0}),w!=null&&w.enabled&&f>=w.delay&&f<=w.delay+w.duration){const h=f-w.delay,E=(0,r.animate)({element:a,animation:w,dTime:h});l(E)}const b=a.animations.find(h=>h.type==="exit");if(b!=null&&b.enabled&&f>=a.page.duration-b.duration){const h=f-(a.page.duration-b.duration),E=(0,r.animate)({element:a,animation:b,dTime:h});l(E)}return o},animated:u=>a.a[u]}}).actions(a=>({setAnimation(o,l){const u=a.animations.find(f=>f.type===o);u?Object.assign(u,l):a.animations.push(Object.assign({type:o},l))}}))}(hv)),hv}var pv={},D_;function sF(){return D_||(D_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const t=$i,r=Au();e.TextElement=r.Shape.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:t.types.optional(t.types.union(t.types.number,t.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(n=>Object.assign({},n)).actions(n=>({toggleEditMode(i){n._editModeEnabled=i??!n._editModeEnabled,n._editModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()}}))}(pv)),pv}var gv={},F_;function BS(){return F_||(F_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const t=Au();e.ImageElement=t.Shape.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,_cropModeEnabled:!1}).actions(r=>({toggleCropMode(n){r._cropModeEnabled=n??!r._cropModeEnabled,r._cropModeEnabled?r.store.history.startTransaction():r.store.history.endTransaction()},beforeDestroy(){r._cropModeEnabled&&r.store.history.endTransaction()}}))}(gv)),gv}var vv={},j_;function uF(){return j_||(j_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const t=BS();e.VideoElement=t.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1})}(vv)),vv}var mv={},z_;function cF(){return z_||(z_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const t=$i,r=Au();e.LineElement=r.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:t.types.array(t.types.number),startHead:"",endHead:""}).actions(n=>({}))}(mv)),mv}var yv={},B_;function fF(){return B_||(B_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const t=$i,r=Au();e.SVGElement=r.Shape.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:t.types.map(t.types.string)}).preProcessSnapshot(n=>Object.assign(Object.assign({},n),{src:n.src||n.svgSource})).actions(n=>({replaceColor(i,a){n.colorsReplace.set(i,a)}}))}(yv)),yv}var bv={},U_;function dF(){return U_||(U_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=$i,r=Au();e.FigureElement=r.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:t.types.array(t.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(bv)),bv}var H_;function ef(){return H_||(H_=1,function(e){var t=we&&we.__rest||function(m,p){var g={};for(var d in m)Object.prototype.hasOwnProperty.call(m,d)&&p.indexOf(d)<0&&(g[d]=m[d]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var _=0;for(d=Object.getOwnPropertySymbols(m);_<d.length;_++)p.indexOf(d[_])<0&&Object.prototype.propertyIsEnumerable.call(m,d[_])&&(g[d[_]]=m[d[_]])}return g};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeModel=e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0;const r=$i,n=S0,i=jS(),a=Au(),o=sF(),l=BS(),u=uF(),f=cF(),v=fF(),w=dF(),b=(m,p)=>{if(m.children)for(const g of m.children){if(p(g)===!0)break;(0,e.forEveryChild)(g,p)}};e.forEveryChild=b;const h=[...new Array(20)].map((m,p)=>r.types.late(()=>E[p]));e.ElementTypes=r.types.union({dispatcher:m=>{const p=e.TYPES_MAP[m.type];if(!p)throw new Error(`Unknown element type: "${m.type}"`);return p}},v.SVGElement,o.TextElement,l.ImageElement,f.LineElement,u.VideoElement,w.FigureElement,r.types.late(()=>e.GroupElement),...h),e.GroupElement=i.Node.named("Group").props({type:"group",children:r.types.array(e.ElementTypes)}).views(m=>({get draggable(){let p=!0;return(0,e.forEveryChild)(m,g=>{g.draggable||(p=!1)}),p},get resizable(){let p=!0;return(0,e.forEveryChild)(m,g=>{g.resizable||(p=!1)}),p},get contentEditable(){let p=!0;return(0,e.forEveryChild)(m,g=>{g.contentEditable||(p=!1)}),p},get styleEditable(){let p=!0;return(0,e.forEveryChild)(m,g=>{g.styleEditable||(p=!1)}),p},get locked(){let p=!0;return(0,e.forEveryChild)(m,g=>{g.locked||(p=!1)}),p}})).actions(m=>({set(p){var{draggable:g,contentEditable:d,styleEditable:_,resizable:O}=p,k=t(p,["draggable","contentEditable","styleEditable","resizable"]);g!==void 0&&(0,e.forEveryChild)(m,C=>{C.set({draggable:g})}),d!==void 0&&(0,e.forEveryChild)(m,C=>{C.set({contentEditable:d})}),_!==void 0&&(0,e.forEveryChild)(m,C=>{C.set({styleEditable:_})}),O!==void 0&&(0,e.forEveryChild)(m,C=>{C.set({resizable:O})}),Object.assign(m,k)},addElement(p,{skipSelect:g=!1}={}){const d=e.TYPES_MAP[p.type];if(!d)return void console.error("Can not find model with type "+p.type);p.children&&p.children.forEach(O=>{O.id=(0,n.nanoid)(10)});const _=d.create(Object.assign({id:(0,n.nanoid)(10)},p));return m.children.push(_),_.selectable&&!g&&m.store.selectElements([_.id]),_},setElementZIndex(p,g){const d=m.children.find(_=>_.id===p);d&&((0,r.detach)(d),m.children.remove(d),m.children.splice(g,0,d))}}));const E=[];function y(m,p){const g=m.type;if(!g)throw new Error('You must pass "type" attribute to custom model.');let d=a.Shape.named(g).props(m);p&&(d=p(d)),e.TYPES_MAP[g]=d,E.push(d)}e.TYPES_MAP={svg:v.SVGElement,text:o.TextElement,image:l.ImageElement,group:e.GroupElement,line:f.LineElement,video:u.VideoElement,figure:w.FigureElement},e.registerShapeModel=y}(uv)),uv}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=void 0;const t=ef();let r=[],n="";const i="polotno_clipboard",a=u=>{r=JSON.parse(JSON.stringify(u));try{localStorage.setItem(i,JSON.stringify(u))}catch{}},o=()=>{try{const u=localStorage.getItem(i);if(u)return JSON.parse(u)}catch{}return r};function l(u,f){var v,w,b,h,E,y,m,p;if(((v=document.activeElement)===null||v===void 0?void 0:v.tagName)==="INPUT"||((w=document.activeElement)===null||w===void 0?void 0:w.tagName)==="TEXTAREA"||((b=document.activeElement)===null||b===void 0?void 0:b.contentEditable)==="true")return;const g=f.selectedElements.filter(k=>k.removable),d=g.map(k=>k.id);u.keyCode!==46&&u.keyCode!==8||f.deleteElements(d);const _=u.ctrlKey||u.metaKey,O=u.shiftKey;if(_&&!O&&u.code==="KeyZ"&&(u.preventDefault(),f.history.undo()),_&&O&&u.code==="KeyZ"&&(u.preventDefault(),f.history.redo()),_&&u.code==="KeyA"){u.preventDefault();const k=(h=f.activePage)===null||h===void 0?void 0:h.children.filter(S=>S.selectable),C=(k==null?void 0:k.map(S=>S.id))||[];f.selectElements(C)}if(_&&u.code==="KeyC"&&(u.preventDefault(),n=(E=f.activePage)===null||E===void 0?void 0:E.id,a(f.selectedElements.map(k=>k.toJSON()))),_&&u.code==="KeyX"&&(u.preventDefault(),n=(y=f.activePage)===null||y===void 0?void 0:y.id,a(f.selectedElements.map(k=>k.toJSON())),f.deleteElements(g)),_&&u.code==="KeyV"){u.preventDefault();let k=0;n===((m=f.activePage)===null||m===void 0?void 0:m.id)&&(k=f.width/20),n=(p=f.activePage)===null||p===void 0?void 0:p.id,f.history.transaction(()=>{const C=[],S=o();(0,t.forEveryChild)({children:S},x=>{delete x.id,x.type!=="group"&&(x.x+=k,x.y+=k)}),S.forEach(x=>{var P;const T=(P=f.activePage)===null||P===void 0?void 0:P.addElement(x);T&&C.push(T.id)}),a(S),f.selectElements(C)})}u.code==="ArrowDown"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({y:k.y+1})})),u.code==="ArrowUp"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({y:k.y-1})})),u.code==="ArrowLeft"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({x:k.x-1})})),u.code==="ArrowRight"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({x:k.x+1})}))}e.handleHotkey=l})(CS);var US={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const t=ha,r=(0,t.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Upload Image",uploadTip:"Do you want to upload your own images?",background:"Background",resize:"Resize",layers:"Layers",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"}});function n(f,v){var w,b=v.split("."),h=f;for(w=0;w<b.length;++w){if(h[b[w]]==null)return;h=h[b[w]]}return h}const i=f=>f&&typeof f=="object";function a(f,v){Object.keys(v).forEach(w=>{const b=f[w],h=v[w];i(h)&&i(b)?a(b,h):f[w]=h})}e.setTranslations=(0,t.action)(f=>{a(r,f)});const o=()=>(0,t.toJS)(r);e.getTranslations=o;const l={},u=f=>{const v=n(r,f);if(v!==void 0)return v;l[f]||(l[f]=!0,console.warn(`Missing translation '${f}'`));const w=f.split("."),b=w[w.length-1]||" ";return b.charAt(0).toUpperCase()+b.slice(1)};e.t=u})(US);(function(e){var t=we&&we.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const r=t(at),n=Hi,i=t(v9),a=PS,o=CS,l=US,u=`Polotno warning: <Workspace /> component can not automatically detect its size.
279
+ Width or height of parent elements is equal 0.
280
+ Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
281
+ For simpler debugging here is the log of the parent element:`,f=(h,E,y,m,p,g)=>{const d=r.default.useRef({width:E,height:y}),_=r.default.useRef({top:0,left:0}),O=r.default.useRef(!1),k=r.default.useRef(p.pages.length);O.current=k.current!==p.pages.length,k.current=p.pages.length,r.default.useEffect(()=>{const C=h.current,S=x=>{_.current={top:C.scrollTop,left:C.scrollLeft}};return C.addEventListener("scroll",S),()=>{C.removeEventListener("scroll",S)}},[]),r.default.useLayoutEffect(()=>{if(!h.current||O.current)return;const C=h.current,S=(_.current.left+C.offsetWidth/2)/d.current.width,x=(_.current.top+C.offsetHeight/2)/d.current.height;g.current=!0,C.scrollLeft=S*E-C.offsetWidth/2,C.scrollTop=x*y-C.offsetHeight/2,d.current={width:E,height:y}},[m,E,y])},v=(h,E,y,m,p)=>{const g=r.default.useRef(!1),d=r.default.useRef(null);r.default.useEffect(()=>{const O=h.current,k=()=>{p.current};return O.addEventListener("scroll",k),()=>{O.removeEventListener("scroll",k)}},[]);const _=y.pages.indexOf(y.activePage);return r.default.useLayoutEffect(()=>{if(!y.activePage||!h.current||g.current)return;const O=h.current,k=y.pages.indexOf(y.activePage)*E;Math.abs(k-O.scrollTop)>.5*E&&(p.current=!0,O.scrollTop=k)},[y.activePage,_]),{handleScroll:O=>{if(p.current)return void(p.current=!1);g.current=!0,clearTimeout(d.current),d.current=setTimeout(()=>{g.current=!1},300);const k=O.currentTarget.childNodes[0].offsetHeight,C=O.currentTarget.scrollTop,S=Math.floor((C+m.height/3)/k),x=y.pages[S];x&&x.select()}}},w=({store:h})=>r.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},r.default.createElement("p",null,(0,l.t)("workspace.noPages")),r.default.createElement("button",{onClick:()=>{h.addPage()}},(0,l.t)("workspace.addPage"))),b=({width:h,height:E,xPadding:y,yPadding:m,backgroundColor:p})=>r.default.createElement("div",{style:{width:h+"px",height:E+"px",backgroundColor:p,paddingLeft:y+"px",paddingRight:y+"px",paddingTop:m+"px",paddingBottom:m+"px"}},r.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:h,pageControlsEnabled:E,backgroundColor:y,pageBorderColor:m,activePageBorderColor:p,bleedColor:g,components:d,onKeyDown:_,paddingX:O,paddingY:k,altCloneEnabled:C=!0})=>{const S=O??20,x=k??55,[P,T]=r.default.useState({width:100,height:100}),L=r.default.useRef(P),M=r.default.useRef(null),U=r.default.useRef(null),$=h.bleedVisible?Math.max(0,...h.pages.map(ee=>ee.bleed)):0,Z=Math.max(...h.pages.map(ee=>ee.computedWidth)),z=Math.max(...h.pages.map(ee=>ee.computedHeight)),N=Z+2*$,H=z+2*$,R=async({skipTimeout:ee}={skipTimeout:!1})=>{if(ee||await new Promise(fe=>setTimeout(fe,50)),M.current===null)return;const te=M.current.getBoundingClientRect();te.width!==0&&te.height!==0||(console.warn(u),console.log(M.current));const ae=U.current.clientWidth||te.width,oe={width:ae,height:te.height};(L.current.width!==oe.width||L.current.height!==oe.height)&&(T(oe),L.current=oe);const se=(ae-2*S)/N,ke=(te.height-2*x)/H,Fe=Math.max(Math.min(se,ke),.01);h.scaleToFit!==Fe&&(h.setScale(Fe),h._setScaleToFit(Fe))};r.default.useLayoutEffect(()=>{R({skipTimeout:!0})},[]),r.default.useEffect(()=>{R()},[N,H]),r.default.useEffect(()=>{const ee=M.current;if(window.ResizeObserver){const te=new ResizeObserver(()=>{R({skipTimeout:!0})});return te.observe(ee),()=>te.unobserve(ee)}{const te=setInterval(()=>{R({skipTimeout:!0})},100);return()=>clearInterval(te)}},[N,H]);const F=Math.max(S,(P.width-N*h.scale)/2),B=H*h.scale*h.pages.length,D=Math.max(x,(P.height-B)/h.pages.length/2);r.default.useEffect(()=>{const ee=te=>{(_||o.handleHotkey)(te,h)};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[]),r.default.useEffect(()=>{var ee;const te=ae=>{if(ae.ctrlKey||ae.metaKey){ae.preventDefault();const Fe=Math.max(3,h.scaleToFit),fe=Math.min(.1,h.scaleToFit),ie=(oe=ae.deltaY<0?1.05*h.scale:h.scale/1.05,se=fe,ke=Fe,Math.max(se,Math.min(ke,oe)));h.setScale(ie)}else var oe,se,ke};return(ee=U.current)===null||ee===void 0||ee.addEventListener("wheel",te),()=>{var ae;return(ae=U.current)===null||ae===void 0?void 0:ae.removeEventListener("wheel",te)}},[]);const V=r.default.useRef(!1);f(U,N*h.scale+2*F,H*h.scale+2*D,h.scale,h,V);const{handleScroll:Y}=v(U,H*h.scale+2*D,h,P,V),q=P.width>=N*h.scale+2*F,G=y||"rgba(232, 232, 232, 0.9)",K=h.pages.indexOf(h.activePage),X=(d==null?void 0:d.NoPages)||w,Q=Math.min(3,Math.max(1,Math.ceil(P.height/2/(H*h.scale))));return r.default.createElement("div",{ref:M,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:G},tabIndex:0,className:"polotno-workspace-container"},r.default.createElement("div",{ref:U,onScroll:Y,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:q?"hidden":"auto"},className:"polotno-workspace-inner"},h.pages.map((ee,te)=>Math.abs(te-K)<=Q||ee._exporting?r.default.createElement(i.default,{key:ee.id,page:ee,xPadding:F,yPadding:D,width:N*h.scale+2*F,height:H*h.scale+2*D,store:h,pageControlsEnabled:E,backColor:G,pageBorderColor:m||"lightgrey",activePageBorderColor:p||"rgb(0, 161, 255)",altCloneEnabled:C,bleedColor:g||"rgba(255, 0, 0, 0.1)",components:d}):r.default.createElement(b,{key:ee.id,width:N*h.scale+2*F,height:H*h.scale+2*D,backgroundColor:G,xPadding:F,yPadding:D})),h.rulesVisible&&r.default.createElement(a.TopRules,{store:h,xPadding:F,yPadding:D,width:N*h.scale+2*F,height:H*h.scale+2*D}),h.pages.length===0&&r.default.createElement(X,{store:h})))}),e.default=e.WorkspaceCanvas})(e8);var hF=B2();ql.toggleFadeInAnimation(!1);hi.setTextOverflow("change-font-size");const pF=new URLSearchParams(location.search).get("key"),HS=hF.createStore({key:pF});window.store=HS;window.config={addGlobalFont:xu.addGlobalFont,unstable_useHtmlTextRender:hi.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:hi.setTextVerticalResizeEnabled,unstable_setTextOverflow:hi.setTextOverflow,onLoadError:ua.onLoadError,setAssetLoadTimeout:ua.setAssetLoadTimeout,setFontLoadTimeout:ua.setFontLoadTimeout};const gF=oh.createRoot(document.getElementById("root"));gF.render(yt.createElement(e8.WorkspaceCanvas,{store:HS,components:{PageControls:()=>null,Tooltip:()=>null}}));