polotno-node 2.9.3 → 2.9.4

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,244 @@
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 Se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Lo(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 U_={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 Zc=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"),d3=Symbol.iterator;function LE(e){return e===null||typeof e!="object"?null:(e=d3&&e[d3]||e["@@iterator"],typeof e=="function"?e:null)}var H_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G_=Object.assign,$_={};function fu(e,t,r){this.props=e,this.context=t,this.refs=$_,this.updater=r||H_}fu.prototype.isReactComponent={};fu.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")};fu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function V_(){}V_.prototype=fu.prototype;function Rm(e,t,r){this.props=e,this.context=t,this.refs=$_,this.updater=r||H_}var Lm=Rm.prototype=new V_;Lm.constructor=Rm;G_(Lm,fu.prototype);Lm.isPureReactComponent=!0;var h3=Array.isArray,q_=Object.prototype.hasOwnProperty,Mm={current:null},W_={key:!0,ref:!0,__self:!0,__source:!0};function Y_(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)q_.call(t,n)&&!W_.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:Zc,type:e,key:a,ref:o,props:i,_owner:Mm.current}}function ME(e,t){return{$$typeof:Zc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Nm(e){return typeof e=="object"&&e!==null&&e.$$typeof===Zc}function NE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var p3=/\/+/g;function E1(e,t){return typeof e=="object"&&e!==null&&e.key!=null?NE(""+e.key):t.toString(36)}function Bd(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 Zc:case SE:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+E1(o,0):n,h3(i)?(r="",e!=null&&(r=e.replace(p3,"$&/")+"/"),Bd(i,t,r,"",function(f){return f})):i!=null&&(Nm(i)&&(i=ME(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(p3,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",h3(e))for(var l=0;l<e.length;l++){a=e[l];var u=n+E1(a,l);o+=Bd(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+E1(a,l++),o+=Bd(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 dd(e,t,r){if(e==null)return e;var n=[],i=0;return Bd(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 hn={current:null},Ud={transition:null},DE={ReactCurrentDispatcher:hn,ReactCurrentBatchConfig:Ud,ReactCurrentOwner:Mm};bt.Children={map:dd,forEach:function(e,t,r){dd(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return dd(e,function(){t++}),t},toArray:function(e){return dd(e,function(t){return t})||[]},only:function(e){if(!Nm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};bt.Component=fu;bt.Fragment=EE;bt.Profiler=xE;bt.PureComponent=Rm;bt.StrictMode=OE;bt.Suspense=AE;bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=DE;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=G_({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=Mm.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)q_.call(t,u)&&!W_.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:Zc,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=Y_;bt.createFactory=function(e){var t=Y_.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=Nm;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=Ud.transition;Ud.transition={};try{e()}finally{Ud.transition=t}};bt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};bt.useCallback=function(e,t){return hn.current.useCallback(e,t)};bt.useContext=function(e){return hn.current.useContext(e)};bt.useDebugValue=function(){};bt.useDeferredValue=function(e){return hn.current.useDeferredValue(e)};bt.useEffect=function(e,t){return hn.current.useEffect(e,t)};bt.useId=function(){return hn.current.useId()};bt.useImperativeHandle=function(e,t,r){return hn.current.useImperativeHandle(e,t,r)};bt.useInsertionEffect=function(e,t){return hn.current.useInsertionEffect(e,t)};bt.useLayoutEffect=function(e,t){return hn.current.useLayoutEffect(e,t)};bt.useMemo=function(e,t){return hn.current.useMemo(e,t)};bt.useReducer=function(e,t,r){return hn.current.useReducer(e,t,r)};bt.useRef=function(e){return hn.current.useRef(e)};bt.useState=function(e){return hn.current.useState(e)};bt.useSyncExternalStore=function(e,t,r){return hn.current.useSyncExternalStore(e,t,r)};bt.useTransition=function(){return hn.current.useTransition()};bt.version="18.2.0";U_.exports=bt;var it=U_.exports;const vt=Vh(it);var rh={},K_={exports:{}},Vn={},X_={exports:{}},Z_={};/**
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(z,q){var L=z.length;z.push(q);e:for(;0<L;){var I=L-1>>>1,B=z[I];if(0<i(B,q))z[I]=q,z[L]=B,L=I;else break e}}function r(z){return z.length===0?null:z[0]}function n(z){if(z.length===0)return null;var q=z[0],L=z.pop();if(L!==q){z[0]=L;e:for(var I=0,B=z.length,M=B>>>1;I<M;){var $=2*(I+1)-1,K=z[$],V=$+1,H=z[V];if(0>i(K,L))V<B&&0>i(H,K)?(z[I]=H,z[V]=L,I=V):(z[I]=K,z[$]=L,I=$);else if(V<B&&0>i(H,L))z[I]=H,z[V]=L,I=V;else break e}}return q}function i(z,q){var L=z.sortIndex-q.sortIndex;return L!==0?L:z.id-q.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=[],p=1,S=null,w=3,g=!1,E=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,h=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(z){for(var q=r(f);q!==null;){if(q.callback===null)n(f);else if(q.startTime<=z)n(f),q.sortIndex=q.expirationTime,t(u,q);else break;q=r(f)}}function b(z){if(m=!1,d(z),!E)if(r(u)!==null)E=!0,j(O);else{var q=r(f);q!==null&&G(b,q.startTime-z)}}function O(z,q){E=!1,m&&(m=!1,y(_),_=-1),g=!0;var L=w;try{for(d(q),S=r(u);S!==null&&(!(S.expirationTime>q)||z&&!k());){var I=S.callback;if(typeof I=="function"){S.callback=null,w=S.priorityLevel;var B=I(S.expirationTime<=q);q=e.unstable_now(),typeof B=="function"?S.callback=B:S===r(u)&&n(u),d(q)}else n(u);S=r(u)}if(S!==null)var M=!0;else{var $=r(f);$!==null&&G(b,$.startTime-q),M=!1}return M}finally{S=null,w=L,g=!1}}var x=!1,P=null,_=-1,A=5,C=-1;function k(){return!(e.unstable_now()-C<A)}function R(){if(P!==null){var z=e.unstable_now();C=z;var q=!0;try{q=P(!0,z)}finally{q?D():(x=!1,P=null)}}else x=!1}var D;if(typeof h=="function")D=function(){h(R)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,Y=U.port2;U.port1.onmessage=R,D=function(){Y.postMessage(null)}}else D=function(){v(R,0)};function j(z){P=z,x||(x=!0,D())}function G(z,q){_=v(function(){z(e.unstable_now())},q)}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(z){z.callback=null},e.unstable_continueExecution=function(){E||g||(E=!0,j(O))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(z){switch(w){case 1:case 2:case 3:var q=3;break;default:q=w}var L=w;w=q;try{return z()}finally{w=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var L=w;w=z;try{return q()}finally{w=L}},e.unstable_scheduleCallback=function(z,q,L){var I=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?I+L:I):L=I,z){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=L+B,z={id:p++,callback:q,priorityLevel:z,startTime:L,expirationTime:B,sortIndex:-1},L>I?(z.sortIndex=L,t(f,z),r(u)===null&&z===r(f)&&(m?(y(_),_=-1):m=!0,G(b,L-I))):(z.sortIndex=B,t(u,z),E||g||(E=!0,j(O))),z},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(z){var q=w;return function(){var L=w;w=q;try{return z.apply(this,arguments)}finally{w=L}}}})(Z_);X_.exports=Z_;var uc=X_.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 Q_=it,Gn=uc;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 J_=new Set,Ec={};function Al(e,t){Gs(e,t),Gs(e+"Capture",t)}function Gs(e,t){for(Ec[e]=t,e=0;e<t.length;e++)J_.add(t[e])}var ka=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pv=Object.prototype.hasOwnProperty,FE=/^[: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]*$/,g3={},v3={};function jE(e){return pv.call(v3,e)?!0:pv.call(g3,e)?!1:FE.test(e)?v3[e]=!0:(g3[e]=!0,!1)}function zE(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 BE(e,t,r,n){if(t===null||typeof t>"u"||zE(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 pn(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 qr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){qr[e]=new pn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];qr[t]=new pn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qr[e]=new pn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qr[e]=new pn(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){qr[e]=new pn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qr[e]=new pn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qr[e]=new pn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qr[e]=new pn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qr[e]=new pn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Im=/[\-:]([a-z])/g;function Dm(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(Im,Dm);qr[t]=new pn(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(Im,Dm);qr[t]=new pn(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(Im,Dm);qr[t]=new pn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qr[e]=new pn(e,1,!1,e.toLowerCase(),null,!1,!1)});qr.xlinkHref=new pn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qr[e]=new pn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Fm(e,t,r,n){var i=qr.hasOwnProperty(t)?qr[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(BE(t,r,i,n)&&(r=null),n||i===null?jE(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 Fa=Q_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,hd=Symbol.for("react.element"),ws=Symbol.for("react.portal"),Ss=Symbol.for("react.fragment"),jm=Symbol.for("react.strict_mode"),gv=Symbol.for("react.profiler"),e6=Symbol.for("react.provider"),t6=Symbol.for("react.context"),zm=Symbol.for("react.forward_ref"),vv=Symbol.for("react.suspense"),mv=Symbol.for("react.suspense_list"),Bm=Symbol.for("react.memo"),so=Symbol.for("react.lazy"),r6=Symbol.for("react.offscreen"),m3=Symbol.iterator;function qu(e){return e===null||typeof e!="object"?null:(e=m3&&e[m3]||e["@@iterator"],typeof e=="function"?e:null)}var ar=Object.assign,O1;function ic(e){if(O1===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);O1=t&&t[1]||""}return`
26
+ `+O1+e}var x1=!1;function P1(e,t){if(!e||x1)return"";x1=!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{x1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ic(e):""}function UE(e){switch(e.tag){case 5:return ic(e.type);case 16:return ic("Lazy");case 13:return ic("Suspense");case 19:return ic("SuspenseList");case 0:case 2:case 15:return e=P1(e.type,!1),e;case 11:return e=P1(e.type.render,!1),e;case 1:return e=P1(e.type,!0),e;default:return""}}function yv(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 Ss:return"Fragment";case ws:return"Portal";case gv:return"Profiler";case jm:return"StrictMode";case vv:return"Suspense";case mv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case t6:return(e.displayName||"Context")+".Consumer";case e6:return(e._context.displayName||"Context")+".Provider";case zm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Bm:return t=e.displayName||null,t!==null?t:yv(e.type)||"Memo";case so:t=e._payload,e=e._init;try{return yv(e(t))}catch{}}return null}function HE(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 yv(t);case 8:return t===jm?"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 Co(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function n6(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function GE(e){var t=n6(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 pd(e){e._valueTracker||(e._valueTracker=GE(e))}function i6(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=n6(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function nh(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 bv(e,t){var r=t.checked;return ar({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function y3(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Co(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 a6(e,t){t=t.checked,t!=null&&Fm(e,"checked",t,!1)}function _v(e,t){a6(e,t);var r=Co(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")?wv(e,t.type,r):t.hasOwnProperty("defaultValue")&&wv(e,t.type,Co(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function b3(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 wv(e,t,r){(t!=="number"||nh(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ac=Array.isArray;function Ds(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=""+Co(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 Sv(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Ce(91));return ar({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function _3(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(ac(r)){if(1<r.length)throw Error(Ce(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Co(r)}}function o6(e,t){var r=Co(t.value),n=Co(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 w3(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function l6(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 Ev(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?l6(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var gd,s6=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(gd=gd||document.createElement("div"),gd.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=gd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Oc(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var cc={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},$E=["Webkit","ms","Moz","O"];Object.keys(cc).forEach(function(e){$E.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),cc[t]=cc[e]})});function u6(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||cc.hasOwnProperty(e)&&cc[e]?(""+t).trim():t+"px"}function c6(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=u6(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var VE=ar({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 Ov(e,t){if(t){if(VE[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 xv(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 Pv=null;function Um(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cv=null,Fs=null,js=null;function S3(e){if(e=ef(e)){if(typeof Cv!="function")throw Error(Ce(280));var t=e.stateNode;t&&(t=Xh(t),Cv(e.stateNode,e.type,t))}}function f6(e){Fs?js?js.push(e):js=[e]:Fs=e}function d6(){if(Fs){var e=Fs,t=js;if(js=Fs=null,S3(e),t)for(e=0;e<t.length;e++)S3(t[e])}}function h6(e,t){return e(t)}function p6(){}var C1=!1;function g6(e,t,r){if(C1)return e(t,r);C1=!0;try{return h6(e,t,r)}finally{C1=!1,(Fs!==null||js!==null)&&(p6(),d6())}}function xc(e,t){var r=e.stateNode;if(r===null)return null;var n=Xh(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 Tv=!1;if(ka)try{var Wu={};Object.defineProperty(Wu,"passive",{get:function(){Tv=!0}}),window.addEventListener("test",Wu,Wu),window.removeEventListener("test",Wu,Wu)}catch{Tv=!1}function qE(e,t,r,n,i,a,o,l,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(p){this.onError(p)}}var fc=!1,ih=null,ah=!1,Av=null,WE={onError:function(e){fc=!0,ih=e}};function YE(e,t,r,n,i,a,o,l,u){fc=!1,ih=null,qE.apply(WE,arguments)}function KE(e,t,r,n,i,a,o,l,u){if(YE.apply(this,arguments),fc){if(fc){var f=ih;fc=!1,ih=null}else throw Error(Ce(198));ah||(ah=!0,Av=f)}}function kl(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 v6(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 E3(e){if(kl(e)!==e)throw Error(Ce(188))}function XE(e){var t=e.alternate;if(!t){if(t=kl(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 E3(i),e;if(a===n)return E3(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 m6(e){return e=XE(e),e!==null?y6(e):null}function y6(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=y6(e);if(t!==null)return t;e=e.sibling}return null}var b6=Gn.unstable_scheduleCallback,O3=Gn.unstable_cancelCallback,ZE=Gn.unstable_shouldYield,QE=Gn.unstable_requestPaint,pr=Gn.unstable_now,JE=Gn.unstable_getCurrentPriorityLevel,Hm=Gn.unstable_ImmediatePriority,_6=Gn.unstable_UserBlockingPriority,oh=Gn.unstable_NormalPriority,eO=Gn.unstable_LowPriority,w6=Gn.unstable_IdlePriority,qh=null,na=null;function tO(e){if(na&&typeof na.onCommitFiberRoot=="function")try{na.onCommitFiberRoot(qh,e,void 0,(e.current.flags&128)===128)}catch{}}var ki=Math.clz32?Math.clz32:iO,rO=Math.log,nO=Math.LN2;function iO(e){return e>>>=0,e===0?32:31-(rO(e)/nO|0)|0}var vd=64,md=4194304;function oc(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 lh(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=oc(l):(a&=o,a!==0&&(n=oc(a)))}else o=r&~i,o!==0?n=oc(o):a!==0&&(n=oc(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-ki(t),i=1<<r,n|=e[r],t&=~i;return n}function aO(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 oO(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-ki(a),l=1<<o,u=i[o];u===-1?(!(l&r)||l&n)&&(i[o]=aO(l,t)):u<=t&&(e.expiredLanes|=l),a&=~l}}function kv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function S6(){var e=vd;return vd<<=1,!(vd&4194240)&&(vd=64),e}function T1(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Qc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ki(t),e[t]=r}function lO(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-ki(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function Gm(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-ki(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Lt=0;function E6(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var O6,$m,x6,P6,C6,Rv=!1,yd=[],mo=null,yo=null,bo=null,Pc=new Map,Cc=new Map,co=[],sO="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 x3(e,t){switch(e){case"focusin":case"focusout":mo=null;break;case"dragenter":case"dragleave":yo=null;break;case"mouseover":case"mouseout":bo=null;break;case"pointerover":case"pointerout":Pc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cc.delete(t.pointerId)}}function Yu(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=ef(t),t!==null&&$m(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function uO(e,t,r,n,i){switch(t){case"focusin":return mo=Yu(mo,e,t,r,n,i),!0;case"dragenter":return yo=Yu(yo,e,t,r,n,i),!0;case"mouseover":return bo=Yu(bo,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return Pc.set(a,Yu(Pc.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,Cc.set(a,Yu(Cc.get(a)||null,e,t,r,n,i)),!0}return!1}function T6(e){var t=ul(e.target);if(t!==null){var r=kl(t);if(r!==null){if(t=r.tag,t===13){if(t=v6(r),t!==null){e.blockedOn=t,C6(e.priority,function(){x6(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 Hd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Lv(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Pv=n,r.target.dispatchEvent(n),Pv=null}else return t=ef(r),t!==null&&$m(t),e.blockedOn=r,!1;t.shift()}return!0}function P3(e,t,r){Hd(e)&&r.delete(t)}function cO(){Rv=!1,mo!==null&&Hd(mo)&&(mo=null),yo!==null&&Hd(yo)&&(yo=null),bo!==null&&Hd(bo)&&(bo=null),Pc.forEach(P3),Cc.forEach(P3)}function Ku(e,t){e.blockedOn===t&&(e.blockedOn=null,Rv||(Rv=!0,Gn.unstable_scheduleCallback(Gn.unstable_NormalPriority,cO)))}function Tc(e){function t(i){return Ku(i,e)}if(0<yd.length){Ku(yd[0],e);for(var r=1;r<yd.length;r++){var n=yd[r];n.blockedOn===e&&(n.blockedOn=null)}}for(mo!==null&&Ku(mo,e),yo!==null&&Ku(yo,e),bo!==null&&Ku(bo,e),Pc.forEach(t),Cc.forEach(t),r=0;r<co.length;r++)n=co[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<co.length&&(r=co[0],r.blockedOn===null);)T6(r),r.blockedOn===null&&co.shift()}var zs=Fa.ReactCurrentBatchConfig,sh=!0;function fO(e,t,r,n){var i=Lt,a=zs.transition;zs.transition=null;try{Lt=1,Vm(e,t,r,n)}finally{Lt=i,zs.transition=a}}function dO(e,t,r,n){var i=Lt,a=zs.transition;zs.transition=null;try{Lt=4,Vm(e,t,r,n)}finally{Lt=i,zs.transition=a}}function Vm(e,t,r,n){if(sh){var i=Lv(e,t,r,n);if(i===null)j1(e,t,n,uh,r),x3(e,n);else if(uO(i,e,t,r,n))n.stopPropagation();else if(x3(e,n),t&4&&-1<sO.indexOf(e)){for(;i!==null;){var a=ef(i);if(a!==null&&O6(a),a=Lv(e,t,r,n),a===null&&j1(e,t,n,uh,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else j1(e,t,n,null,r)}}var uh=null;function Lv(e,t,r,n){if(uh=null,e=Um(n),e=ul(e),e!==null)if(t=kl(e),t===null)e=null;else if(r=t.tag,r===13){if(e=v6(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 uh=e,null}function A6(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(JE()){case Hm:return 1;case _6:return 4;case oh:case eO:return 16;case w6:return 536870912;default:return 16}default:return 16}}var po=null,qm=null,Gd=null;function k6(){if(Gd)return Gd;var e,t=qm,r=t.length,n,i="value"in po?po.value:po.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 Gd=i.slice(e,1<n?1-n:void 0)}function $d(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 bd(){return!0}function C3(){return!1}function qn(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)?bd:C3,this.isPropagationStopped=C3,this}return ar(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=bd)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=bd)},persist:function(){},isPersistent:bd}),t}var du={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wm=qn(du),Jc=ar({},du,{view:0,detail:0}),hO=qn(Jc),A1,k1,Xu,Wh=ar({},Jc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ym,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!==Xu&&(Xu&&e.type==="mousemove"?(A1=e.screenX-Xu.screenX,k1=e.screenY-Xu.screenY):k1=A1=0,Xu=e),A1)},movementY:function(e){return"movementY"in e?e.movementY:k1}}),T3=qn(Wh),pO=ar({},Wh,{dataTransfer:0}),gO=qn(pO),vO=ar({},Jc,{relatedTarget:0}),R1=qn(vO),mO=ar({},du,{animationName:0,elapsedTime:0,pseudoElement:0}),yO=qn(mO),bO=ar({},du,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_O=qn(bO),wO=ar({},du,{data:0}),A3=qn(wO),SO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},EO={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"},OO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xO(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=OO[e])?!!t[e]:!1}function Ym(){return xO}var PO=ar({},Jc,{key:function(e){if(e.key){var t=SO[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$d(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?EO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ym,charCode:function(e){return e.type==="keypress"?$d(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$d(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),CO=qn(PO),TO=ar({},Wh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),k3=qn(TO),AO=ar({},Jc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ym}),kO=qn(AO),RO=ar({},du,{propertyName:0,elapsedTime:0,pseudoElement:0}),LO=qn(RO),MO=ar({},Wh,{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}),NO=qn(MO),IO=[9,13,27,32],Km=ka&&"CompositionEvent"in window,dc=null;ka&&"documentMode"in document&&(dc=document.documentMode);var DO=ka&&"TextEvent"in window&&!dc,R6=ka&&(!Km||dc&&8<dc&&11>=dc),R3=" ",L3=!1;function L6(e,t){switch(e){case"keyup":return IO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function M6(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Es=!1;function FO(e,t){switch(e){case"compositionend":return M6(t);case"keypress":return t.which!==32?null:(L3=!0,R3);case"textInput":return e=t.data,e===R3&&L3?null:e;default:return null}}function jO(e,t){if(Es)return e==="compositionend"||!Km&&L6(e,t)?(e=k6(),Gd=qm=po=null,Es=!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 R6&&t.locale!=="ko"?null:t.data;default:return null}}var zO={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 M3(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!zO[e.type]:t==="textarea"}function N6(e,t,r,n){f6(n),t=ch(t,"onChange"),0<t.length&&(r=new Wm("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var hc=null,Ac=null;function BO(e){V6(e,0)}function Yh(e){var t=Ps(e);if(i6(t))return e}function UO(e,t){if(e==="change")return t}var I6=!1;if(ka){var L1;if(ka){var M1="oninput"in document;if(!M1){var N3=document.createElement("div");N3.setAttribute("oninput","return;"),M1=typeof N3.oninput=="function"}L1=M1}else L1=!1;I6=L1&&(!document.documentMode||9<document.documentMode)}function I3(){hc&&(hc.detachEvent("onpropertychange",D6),Ac=hc=null)}function D6(e){if(e.propertyName==="value"&&Yh(Ac)){var t=[];N6(t,Ac,e,Um(e)),g6(BO,t)}}function HO(e,t,r){e==="focusin"?(I3(),hc=t,Ac=r,hc.attachEvent("onpropertychange",D6)):e==="focusout"&&I3()}function GO(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yh(Ac)}function $O(e,t){if(e==="click")return Yh(t)}function VO(e,t){if(e==="input"||e==="change")return Yh(t)}function qO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Di=typeof Object.is=="function"?Object.is:qO;function kc(e,t){if(Di(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(!pv.call(t,i)||!Di(e[i],t[i]))return!1}return!0}function D3(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function F3(e,t){var r=D3(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=D3(r)}}function F6(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?F6(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function j6(){for(var e=window,t=nh();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=nh(e.document)}return t}function Xm(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 WO(e){var t=j6(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&F6(r.ownerDocument.documentElement,r)){if(n!==null&&Xm(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=F3(r,a);var o=F3(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 YO=ka&&"documentMode"in document&&11>=document.documentMode,Os=null,Mv=null,pc=null,Nv=!1;function j3(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Nv||Os==null||Os!==nh(n)||(n=Os,"selectionStart"in n&&Xm(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}),pc&&kc(pc,n)||(pc=n,n=ch(Mv,"onSelect"),0<n.length&&(t=new Wm("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Os)))}function _d(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var xs={animationend:_d("Animation","AnimationEnd"),animationiteration:_d("Animation","AnimationIteration"),animationstart:_d("Animation","AnimationStart"),transitionend:_d("Transition","TransitionEnd")},N1={},z6={};ka&&(z6=document.createElement("div").style,"AnimationEvent"in window||(delete xs.animationend.animation,delete xs.animationiteration.animation,delete xs.animationstart.animation),"TransitionEvent"in window||delete xs.transitionend.transition);function Kh(e){if(N1[e])return N1[e];if(!xs[e])return e;var t=xs[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in z6)return N1[e]=t[r];return e}var B6=Kh("animationend"),U6=Kh("animationiteration"),H6=Kh("animationstart"),G6=Kh("transitionend"),$6=new Map,z3="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 Mo(e,t){$6.set(e,t),Al(t,[e])}for(var I1=0;I1<z3.length;I1++){var D1=z3[I1],KO=D1.toLowerCase(),XO=D1[0].toUpperCase()+D1.slice(1);Mo(KO,"on"+XO)}Mo(B6,"onAnimationEnd");Mo(U6,"onAnimationIteration");Mo(H6,"onAnimationStart");Mo("dblclick","onDoubleClick");Mo("focusin","onFocus");Mo("focusout","onBlur");Mo(G6,"onTransitionEnd");Gs("onMouseEnter",["mouseout","mouseover"]);Gs("onMouseLeave",["mouseout","mouseover"]);Gs("onPointerEnter",["pointerout","pointerover"]);Gs("onPointerLeave",["pointerout","pointerover"]);Al("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Al("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Al("onBeforeInput",["compositionend","keypress","textInput","paste"]);Al("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Al("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Al("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lc="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(" "),ZO=new Set("cancel close invalid load scroll toggle".split(" ").concat(lc));function B3(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,KE(n,t,void 0,e),e.currentTarget=null}function V6(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;B3(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;B3(i,l,f),a=u}}}if(ah)throw e=Av,ah=!1,Av=null,e}function Vt(e,t){var r=t[zv];r===void 0&&(r=t[zv]=new Set);var n=e+"__bubble";r.has(n)||(q6(t,e,2,!1),r.add(n))}function F1(e,t,r){var n=0;t&&(n|=4),q6(r,e,n,t)}var wd="_reactListening"+Math.random().toString(36).slice(2);function Rc(e){if(!e[wd]){e[wd]=!0,J_.forEach(function(r){r!=="selectionchange"&&(ZO.has(r)||F1(r,!1,e),F1(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wd]||(t[wd]=!0,F1("selectionchange",!1,t))}}function q6(e,t,r,n){switch(A6(t)){case 1:var i=fO;break;case 4:i=dO;break;default:i=Vm}r=i.bind(null,t,r,e),i=void 0,!Tv||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 j1(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=ul(l),o===null)return;if(u=o.tag,u===5||u===6){n=a=o;continue e}l=l.parentNode}}n=n.return}g6(function(){var f=a,p=Um(r),S=[];e:{var w=$6.get(e);if(w!==void 0){var g=Wm,E=e;switch(e){case"keypress":if($d(r)===0)break e;case"keydown":case"keyup":g=CO;break;case"focusin":E="focus",g=R1;break;case"focusout":E="blur",g=R1;break;case"beforeblur":case"afterblur":g=R1;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":g=T3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=gO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=kO;break;case B6:case U6:case H6:g=yO;break;case G6:g=LO;break;case"scroll":g=hO;break;case"wheel":g=NO;break;case"copy":case"cut":case"paste":g=_O;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=k3}var m=(t&4)!==0,v=!m&&e==="scroll",y=m?w!==null?w+"Capture":null:w;m=[];for(var h=f,d;h!==null;){d=h;var b=d.stateNode;if(d.tag===5&&b!==null&&(d=b,y!==null&&(b=xc(h,y),b!=null&&m.push(Lc(h,b,d)))),v)break;h=h.return}0<m.length&&(w=new g(w,E,null,r,p),S.push({event:w,listeners:m}))}}if(!(t&7)){e:{if(w=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",w&&r!==Pv&&(E=r.relatedTarget||r.fromElement)&&(ul(E)||E[Ra]))break e;if((g||w)&&(w=p.window===p?p:(w=p.ownerDocument)?w.defaultView||w.parentWindow:window,g?(E=r.relatedTarget||r.toElement,g=f,E=E?ul(E):null,E!==null&&(v=kl(E),E!==v||E.tag!==5&&E.tag!==6)&&(E=null)):(g=null,E=f),g!==E)){if(m=T3,b="onMouseLeave",y="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(m=k3,b="onPointerLeave",y="onPointerEnter",h="pointer"),v=g==null?w:Ps(g),d=E==null?w:Ps(E),w=new m(b,h+"leave",g,r,p),w.target=v,w.relatedTarget=d,b=null,ul(p)===f&&(m=new m(y,h+"enter",E,r,p),m.target=d,m.relatedTarget=v,b=m),v=b,g&&E)t:{for(m=g,y=E,h=0,d=m;d;d=gs(d))h++;for(d=0,b=y;b;b=gs(b))d++;for(;0<h-d;)m=gs(m),h--;for(;0<d-h;)y=gs(y),d--;for(;h--;){if(m===y||y!==null&&m===y.alternate)break t;m=gs(m),y=gs(y)}m=null}else m=null;g!==null&&U3(S,w,g,m,!1),E!==null&&v!==null&&U3(S,v,E,m,!0)}}e:{if(w=f?Ps(f):window,g=w.nodeName&&w.nodeName.toLowerCase(),g==="select"||g==="input"&&w.type==="file")var O=UO;else if(M3(w))if(I6)O=VO;else{O=GO;var x=HO}else(g=w.nodeName)&&g.toLowerCase()==="input"&&(w.type==="checkbox"||w.type==="radio")&&(O=$O);if(O&&(O=O(e,f))){N6(S,O,r,p);break e}x&&x(e,w,f),e==="focusout"&&(x=w._wrapperState)&&x.controlled&&w.type==="number"&&wv(w,"number",w.value)}switch(x=f?Ps(f):window,e){case"focusin":(M3(x)||x.contentEditable==="true")&&(Os=x,Mv=f,pc=null);break;case"focusout":pc=Mv=Os=null;break;case"mousedown":Nv=!0;break;case"contextmenu":case"mouseup":case"dragend":Nv=!1,j3(S,r,p);break;case"selectionchange":if(YO)break;case"keydown":case"keyup":j3(S,r,p)}var P;if(Km)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Es?L6(e,r)&&(_="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(_="onCompositionStart");_&&(R6&&r.locale!=="ko"&&(Es||_!=="onCompositionStart"?_==="onCompositionEnd"&&Es&&(P=k6()):(po=p,qm="value"in po?po.value:po.textContent,Es=!0)),x=ch(f,_),0<x.length&&(_=new A3(_,e,null,r,p),S.push({event:_,listeners:x}),P?_.data=P:(P=M6(r),P!==null&&(_.data=P)))),(P=DO?FO(e,r):jO(e,r))&&(f=ch(f,"onBeforeInput"),0<f.length&&(p=new A3("onBeforeInput","beforeinput",null,r,p),S.push({event:p,listeners:f}),p.data=P))}V6(S,t)})}function Lc(e,t,r){return{instance:e,listener:t,currentTarget:r}}function ch(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=xc(e,r),a!=null&&n.unshift(Lc(e,a,i)),a=xc(e,t),a!=null&&n.push(Lc(e,a,i))),e=e.return}return n}function gs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function U3(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=xc(r,a),u!=null&&o.unshift(Lc(r,u,l))):i||(u=xc(r,a),u!=null&&o.push(Lc(r,u,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var QO=/\r\n?/g,JO=/\u0000|\uFFFD/g;function H3(e){return(typeof e=="string"?e:""+e).replace(QO,`
30
+ `).replace(JO,"")}function Sd(e,t,r){if(t=H3(t),H3(e)!==t&&r)throw Error(Ce(425))}function fh(){}var Iv=null,Dv=null;function Fv(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 jv=typeof setTimeout=="function"?setTimeout:void 0,ex=typeof clearTimeout=="function"?clearTimeout:void 0,G3=typeof Promise=="function"?Promise:void 0,tx=typeof queueMicrotask=="function"?queueMicrotask:typeof G3<"u"?function(e){return G3.resolve(null).then(e).catch(rx)}:jv;function rx(e){setTimeout(function(){throw e})}function z1(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),Tc(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);Tc(t)}function _o(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 $3(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 hu=Math.random().toString(36).slice(2),Ji="__reactFiber$"+hu,Mc="__reactProps$"+hu,Ra="__reactContainer$"+hu,zv="__reactEvents$"+hu,nx="__reactListeners$"+hu,ix="__reactHandles$"+hu;function ul(e){var t=e[Ji];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ra]||r[Ji]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=$3(e);e!==null;){if(r=e[Ji])return r;e=$3(e)}return t}e=r,r=e.parentNode}return null}function ef(e){return e=e[Ji]||e[Ra],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ps(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Ce(33))}function Xh(e){return e[Mc]||null}var Bv=[],Cs=-1;function No(e){return{current:e}}function qt(e){0>Cs||(e.current=Bv[Cs],Bv[Cs]=null,Cs--)}function Bt(e,t){Cs++,Bv[Cs]=e.current,e.current=t}var To={},rn=No(To),Pn=No(!1),ml=To;function $s(e,t){var r=e.type.contextTypes;if(!r)return To;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 Cn(e){return e=e.childContextTypes,e!=null}function dh(){qt(Pn),qt(rn)}function V3(e,t,r){if(rn.current!==To)throw Error(Ce(168));Bt(rn,t),Bt(Pn,r)}function W6(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,HE(e)||"Unknown",i));return ar({},r,n)}function hh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||To,ml=rn.current,Bt(rn,e),Bt(Pn,Pn.current),!0}function q3(e,t,r){var n=e.stateNode;if(!n)throw Error(Ce(169));r?(e=W6(e,t,ml),n.__reactInternalMemoizedMergedChildContext=e,qt(Pn),qt(rn),Bt(rn,e)):qt(Pn),Bt(Pn,r)}var Sa=null,Zh=!1,B1=!1;function Y6(e){Sa===null?Sa=[e]:Sa.push(e)}function ax(e){Zh=!0,Y6(e)}function Io(){if(!B1&&Sa!==null){B1=!0;var e=0,t=Lt;try{var r=Sa;for(Lt=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Sa=null,Zh=!1}catch(i){throw Sa!==null&&(Sa=Sa.slice(e+1)),b6(Hm,Io),i}finally{Lt=t,B1=!1}}return null}var Ts=[],As=0,ph=null,gh=0,oi=[],li=0,yl=null,Ea=1,Oa="";function ll(e,t){Ts[As++]=gh,Ts[As++]=ph,ph=e,gh=t}function K6(e,t,r){oi[li++]=Ea,oi[li++]=Oa,oi[li++]=yl,yl=e;var n=Ea;e=Oa;var i=32-ki(n)-1;n&=~(1<<i),r+=1;var a=32-ki(t)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,Ea=1<<32-ki(t)+i|r<<i|n,Oa=a+e}else Ea=1<<a|r<<i|n,Oa=e}function Zm(e){e.return!==null&&(ll(e,1),K6(e,1,0))}function Qm(e){for(;e===ph;)ph=Ts[--As],Ts[As]=null,gh=Ts[--As],Ts[As]=null;for(;e===yl;)yl=oi[--li],oi[li]=null,Oa=oi[--li],oi[li]=null,Ea=oi[--li],oi[li]=null}var Hn=null,Un=null,Zt=!1,Ai=null;function X6(e,t){var r=ci(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 W3(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,Hn=e,Un=_o(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Hn=e,Un=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=yl!==null?{id:Ea,overflow:Oa}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=ci(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Hn=e,Un=null,!0):!1;default:return!1}}function Uv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Hv(e){if(Zt){var t=Un;if(t){var r=t;if(!W3(e,t)){if(Uv(e))throw Error(Ce(418));t=_o(r.nextSibling);var n=Hn;t&&W3(e,t)?X6(n,r):(e.flags=e.flags&-4097|2,Zt=!1,Hn=e)}}else{if(Uv(e))throw Error(Ce(418));e.flags=e.flags&-4097|2,Zt=!1,Hn=e}}}function Y3(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Hn=e}function Ed(e){if(e!==Hn)return!1;if(!Zt)return Y3(e),Zt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fv(e.type,e.memoizedProps)),t&&(t=Un)){if(Uv(e))throw Z6(),Error(Ce(418));for(;t;)X6(e,t),t=_o(t.nextSibling)}if(Y3(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){Un=_o(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Un=null}}else Un=Hn?_o(e.stateNode.nextSibling):null;return!0}function Z6(){for(var e=Un;e;)e=_o(e.nextSibling)}function Vs(){Un=Hn=null,Zt=!1}function Jm(e){Ai===null?Ai=[e]:Ai.push(e)}var ox=Fa.ReactCurrentBatchConfig;function Ci(e,t){if(e&&e.defaultProps){t=ar({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}var vh=No(null),mh=null,ks=null,ey=null;function ty(){ey=ks=mh=null}function ry(e){var t=vh.current;qt(vh),e._currentValue=t}function Gv(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 Bs(e,t){mh=e,ey=ks=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(En=!0),e.firstContext=null)}function hi(e){var t=e._currentValue;if(ey!==e)if(e={context:e,memoizedValue:t,next:null},ks===null){if(mh===null)throw Error(Ce(308));ks=e,mh.dependencies={lanes:0,firstContext:e}}else ks=ks.next=e;return t}var cl=null;function ny(e){cl===null?cl=[e]:cl.push(e)}function Q6(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,ny(t)):(r.next=i.next,i.next=r),t.interleaved=r,La(e,n)}function La(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 uo=!1;function iy(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function J6(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 xa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function wo(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,La(e,r)}return i=n.interleaved,i===null?(t.next=t,ny(n)):(t.next=i.next,i.next=t),n.interleaved=t,La(e,r)}function Vd(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,Gm(e,r)}}function K3(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 yh(e,t,r,n){var i=e.updateQueue;uo=!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 p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==o&&(l===null?p.firstBaseUpdate=f:l.next=f,p.lastBaseUpdate=u))}if(a!==null){var S=i.baseState;o=0,p=f=u=null,l=a;do{var w=l.lane,g=l.eventTime;if((n&w)===w){p!==null&&(p=p.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var E=e,m=l;switch(w=t,g=r,m.tag){case 1:if(E=m.payload,typeof E=="function"){S=E.call(g,S,w);break e}S=E;break e;case 3:E.flags=E.flags&-65537|128;case 0:if(E=m.payload,w=typeof E=="function"?E.call(g,S,w):E,w==null)break e;S=ar({},S,w);break e;case 2:uo=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,w=i.effects,w===null?i.effects=[l]:w.push(l))}else g={eventTime:g,lane:w,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(f=p=g,u=S):p=p.next=g,o|=w;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;w=l,l=w.next,w.next=null,i.lastBaseUpdate=w,i.shared.pending=null}}while(!0);if(p===null&&(u=S),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=p,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);_l|=o,e.lanes=o,e.memoizedState=S}}function X3(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 ew=new Q_.Component().refs;function $v(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:ar({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Qh={isMounted:function(e){return(e=e._reactInternals)?kl(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=fn(),i=Eo(e),a=xa(n,i);a.payload=t,r!=null&&(a.callback=r),t=wo(e,a,i),t!==null&&(Ri(t,e,i,n),Vd(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=fn(),i=Eo(e),a=xa(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=wo(e,a,i),t!==null&&(Ri(t,e,i,n),Vd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=fn(),n=Eo(e),i=xa(r,n);i.tag=2,t!=null&&(i.callback=t),t=wo(e,i,n),t!==null&&(Ri(t,e,n,r),Vd(t,e,n))}};function Z3(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?!kc(r,n)||!kc(i,a):!0}function tw(e,t,r){var n=!1,i=To,a=t.contextType;return typeof a=="object"&&a!==null?a=hi(a):(i=Cn(t)?ml:rn.current,n=t.contextTypes,a=(n=n!=null)?$s(e,i):To),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Qh,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Q3(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&&Qh.enqueueReplaceState(t,t.state,null)}function Vv(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs=ew,iy(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=hi(a):(a=Cn(t)?ml:rn.current,i.context=$s(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&($v(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&&Qh.enqueueReplaceState(i,i.state,null),yh(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Zu(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;l===ew&&(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 Od(e,t){throw e=Object.prototype.toString.call(t),Error(Ce(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function J3(e){var t=e._init;return t(e._payload)}function rw(e){function t(y,h){if(e){var d=y.deletions;d===null?(y.deletions=[h],y.flags|=16):d.push(h)}}function r(y,h){if(!e)return null;for(;h!==null;)t(y,h),h=h.sibling;return null}function n(y,h){for(y=new Map;h!==null;)h.key!==null?y.set(h.key,h):y.set(h.index,h),h=h.sibling;return y}function i(y,h){return y=Oo(y,h),y.index=0,y.sibling=null,y}function a(y,h,d){return y.index=d,e?(d=y.alternate,d!==null?(d=d.index,d<h?(y.flags|=2,h):d):(y.flags|=2,h)):(y.flags|=1048576,h)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,h,d,b){return h===null||h.tag!==6?(h=W1(d,y.mode,b),h.return=y,h):(h=i(h,d),h.return=y,h)}function u(y,h,d,b){var O=d.type;return O===Ss?p(y,h,d.props.children,b,d.key):h!==null&&(h.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===so&&J3(O)===h.type)?(b=i(h,d.props),b.ref=Zu(y,h,d),b.return=y,b):(b=Zd(d.type,d.key,d.props,null,y.mode,b),b.ref=Zu(y,h,d),b.return=y,b)}function f(y,h,d,b){return h===null||h.tag!==4||h.stateNode.containerInfo!==d.containerInfo||h.stateNode.implementation!==d.implementation?(h=Y1(d,y.mode,b),h.return=y,h):(h=i(h,d.children||[]),h.return=y,h)}function p(y,h,d,b,O){return h===null||h.tag!==7?(h=pl(d,y.mode,b,O),h.return=y,h):(h=i(h,d),h.return=y,h)}function S(y,h,d){if(typeof h=="string"&&h!==""||typeof h=="number")return h=W1(""+h,y.mode,d),h.return=y,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case hd:return d=Zd(h.type,h.key,h.props,null,y.mode,d),d.ref=Zu(y,null,h),d.return=y,d;case ws:return h=Y1(h,y.mode,d),h.return=y,h;case so:var b=h._init;return S(y,b(h._payload),d)}if(ac(h)||qu(h))return h=pl(h,y.mode,d,null),h.return=y,h;Od(y,h)}return null}function w(y,h,d,b){var O=h!==null?h.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return O!==null?null:l(y,h,""+d,b);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case hd:return d.key===O?u(y,h,d,b):null;case ws:return d.key===O?f(y,h,d,b):null;case so:return O=d._init,w(y,h,O(d._payload),b)}if(ac(d)||qu(d))return O!==null?null:p(y,h,d,b,null);Od(y,d)}return null}function g(y,h,d,b,O){if(typeof b=="string"&&b!==""||typeof b=="number")return y=y.get(d)||null,l(h,y,""+b,O);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case hd:return y=y.get(b.key===null?d:b.key)||null,u(h,y,b,O);case ws:return y=y.get(b.key===null?d:b.key)||null,f(h,y,b,O);case so:var x=b._init;return g(y,h,d,x(b._payload),O)}if(ac(b)||qu(b))return y=y.get(d)||null,p(h,y,b,O,null);Od(h,b)}return null}function E(y,h,d,b){for(var O=null,x=null,P=h,_=h=0,A=null;P!==null&&_<d.length;_++){P.index>_?(A=P,P=null):A=P.sibling;var C=w(y,P,d[_],b);if(C===null){P===null&&(P=A);break}e&&P&&C.alternate===null&&t(y,P),h=a(C,h,_),x===null?O=C:x.sibling=C,x=C,P=A}if(_===d.length)return r(y,P),Zt&&ll(y,_),O;if(P===null){for(;_<d.length;_++)P=S(y,d[_],b),P!==null&&(h=a(P,h,_),x===null?O=P:x.sibling=P,x=P);return Zt&&ll(y,_),O}for(P=n(y,P);_<d.length;_++)A=g(P,y,_,d[_],b),A!==null&&(e&&A.alternate!==null&&P.delete(A.key===null?_:A.key),h=a(A,h,_),x===null?O=A:x.sibling=A,x=A);return e&&P.forEach(function(k){return t(y,k)}),Zt&&ll(y,_),O}function m(y,h,d,b){var O=qu(d);if(typeof O!="function")throw Error(Ce(150));if(d=O.call(d),d==null)throw Error(Ce(151));for(var x=O=null,P=h,_=h=0,A=null,C=d.next();P!==null&&!C.done;_++,C=d.next()){P.index>_?(A=P,P=null):A=P.sibling;var k=w(y,P,C.value,b);if(k===null){P===null&&(P=A);break}e&&P&&k.alternate===null&&t(y,P),h=a(k,h,_),x===null?O=k:x.sibling=k,x=k,P=A}if(C.done)return r(y,P),Zt&&ll(y,_),O;if(P===null){for(;!C.done;_++,C=d.next())C=S(y,C.value,b),C!==null&&(h=a(C,h,_),x===null?O=C:x.sibling=C,x=C);return Zt&&ll(y,_),O}for(P=n(y,P);!C.done;_++,C=d.next())C=g(P,y,_,C.value,b),C!==null&&(e&&C.alternate!==null&&P.delete(C.key===null?_:C.key),h=a(C,h,_),x===null?O=C:x.sibling=C,x=C);return e&&P.forEach(function(R){return t(y,R)}),Zt&&ll(y,_),O}function v(y,h,d,b){if(typeof d=="object"&&d!==null&&d.type===Ss&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case hd:e:{for(var O=d.key,x=h;x!==null;){if(x.key===O){if(O=d.type,O===Ss){if(x.tag===7){r(y,x.sibling),h=i(x,d.props.children),h.return=y,y=h;break e}}else if(x.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===so&&J3(O)===x.type){r(y,x.sibling),h=i(x,d.props),h.ref=Zu(y,x,d),h.return=y,y=h;break e}r(y,x);break}else t(y,x);x=x.sibling}d.type===Ss?(h=pl(d.props.children,y.mode,b,d.key),h.return=y,y=h):(b=Zd(d.type,d.key,d.props,null,y.mode,b),b.ref=Zu(y,h,d),b.return=y,y=b)}return o(y);case ws:e:{for(x=d.key;h!==null;){if(h.key===x)if(h.tag===4&&h.stateNode.containerInfo===d.containerInfo&&h.stateNode.implementation===d.implementation){r(y,h.sibling),h=i(h,d.children||[]),h.return=y,y=h;break e}else{r(y,h);break}else t(y,h);h=h.sibling}h=Y1(d,y.mode,b),h.return=y,y=h}return o(y);case so:return x=d._init,v(y,h,x(d._payload),b)}if(ac(d))return E(y,h,d,b);if(qu(d))return m(y,h,d,b);Od(y,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,h!==null&&h.tag===6?(r(y,h.sibling),h=i(h,d),h.return=y,y=h):(r(y,h),h=W1(d,y.mode,b),h.return=y,y=h),o(y)):r(y,h)}return v}var qs=rw(!0),nw=rw(!1),tf={},ia=No(tf),Nc=No(tf),Ic=No(tf);function fl(e){if(e===tf)throw Error(Ce(174));return e}function ay(e,t){switch(Bt(Ic,t),Bt(Nc,e),Bt(ia,tf),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ev(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ev(t,e)}qt(ia),Bt(ia,t)}function Ws(){qt(ia),qt(Nc),qt(Ic)}function iw(e){fl(Ic.current);var t=fl(ia.current),r=Ev(t,e.type);t!==r&&(Bt(Nc,e),Bt(ia,r))}function oy(e){Nc.current===e&&(qt(ia),qt(Nc))}var nr=No(0);function bh(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 U1=[];function ly(){for(var e=0;e<U1.length;e++)U1[e]._workInProgressVersionPrimary=null;U1.length=0}var qd=Fa.ReactCurrentDispatcher,H1=Fa.ReactCurrentBatchConfig,bl=0,ir=null,xr=null,Nr=null,_h=!1,gc=!1,Dc=0,lx=0;function Jr(){throw Error(Ce(321))}function sy(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Di(e[r],t[r]))return!1;return!0}function uy(e,t,r,n,i,a){if(bl=a,ir=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,qd.current=e===null||e.memoizedState===null?fx:dx,e=r(n,i),gc){a=0;do{if(gc=!1,Dc=0,25<=a)throw Error(Ce(301));a+=1,Nr=xr=null,t.updateQueue=null,qd.current=hx,e=r(n,i)}while(gc)}if(qd.current=wh,t=xr!==null&&xr.next!==null,bl=0,Nr=xr=ir=null,_h=!1,t)throw Error(Ce(300));return e}function cy(){var e=Dc!==0;return Dc=0,e}function Qi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nr===null?ir.memoizedState=Nr=e:Nr=Nr.next=e,Nr}function pi(){if(xr===null){var e=ir.alternate;e=e!==null?e.memoizedState:null}else e=xr.next;var t=Nr===null?ir.memoizedState:Nr.next;if(t!==null)Nr=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},Nr===null?ir.memoizedState=Nr=e:Nr=Nr.next=e}return Nr}function Fc(e,t){return typeof t=="function"?t(e):t}function G1(e){var t=pi(),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 p=f.lane;if((bl&p)===p)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 S={lane:p,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=S,o=n):u=u.next=S,ir.lanes|=p,_l|=p}f=f.next}while(f!==null&&f!==a);u===null?o=n:u.next=l,Di(n,t.memoizedState)||(En=!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,ir.lanes|=a,_l|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function $1(e){var t=pi(),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);Di(a,t.memoizedState)||(En=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function aw(){}function ow(e,t){var r=ir,n=pi(),i=t(),a=!Di(n.memoizedState,i);if(a&&(n.memoizedState=i,En=!0),n=n.queue,fy(uw.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Nr!==null&&Nr.memoizedState.tag&1){if(r.flags|=2048,jc(9,sw.bind(null,r,n,i,t),void 0,null),Dr===null)throw Error(Ce(349));bl&30||lw(r,t,i)}return i}function lw(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ir.updateQueue,t===null?(t={lastEffect:null,stores:null},ir.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!Di(e,r)}catch{return!0}}function fw(e){var t=La(e,1);t!==null&&Ri(t,e,1,-1)}function e5(e){var t=Qi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fc,lastRenderedState:e},t.queue=e,e=e.dispatch=cx.bind(null,ir,e),[t.memoizedState,e]}function jc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=ir.updateQueue,t===null?(t={lastEffect:null,stores:null},ir.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 pi().memoizedState}function Wd(e,t,r,n){var i=Qi();ir.flags|=e,i.memoizedState=jc(1|t,r,void 0,n===void 0?null:n)}function Jh(e,t,r,n){var i=pi();n=n===void 0?null:n;var a=void 0;if(xr!==null){var o=xr.memoizedState;if(a=o.destroy,n!==null&&sy(n,o.deps)){i.memoizedState=jc(t,r,a,n);return}}ir.flags|=e,i.memoizedState=jc(1|t,r,a,n)}function t5(e,t){return Wd(8390656,8,e,t)}function fy(e,t){return Jh(2048,8,e,t)}function hw(e,t){return Jh(4,2,e,t)}function pw(e,t){return Jh(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,Jh(4,4,gw.bind(null,t,e),r)}function dy(){}function mw(e,t){var r=pi();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&sy(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function yw(e,t){var r=pi();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&sy(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function bw(e,t,r){return bl&21?(Di(r,t)||(r=S6(),ir.lanes|=r,_l|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,En=!0),e.memoizedState=r)}function sx(e,t){var r=Lt;Lt=r!==0&&4>r?r:4,e(!0);var n=H1.transition;H1.transition={};try{e(!1),t()}finally{Lt=r,H1.transition=n}}function _w(){return pi().memoizedState}function ux(e,t,r){var n=Eo(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},ww(e))Sw(t,r);else if(r=Q6(e,t,r,n),r!==null){var i=fn();Ri(r,e,n,i),Ew(r,t,n)}}function cx(e,t,r){var n=Eo(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,Di(l,o)){var u=t.interleaved;u===null?(i.next=i,ny(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}r=Q6(e,t,i,n),r!==null&&(i=fn(),Ri(r,e,n,i),Ew(r,t,n))}}function ww(e){var t=e.alternate;return e===ir||t!==null&&t===ir}function Sw(e,t){gc=_h=!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,Gm(e,r)}}var wh={readContext:hi,useCallback:Jr,useContext:Jr,useEffect:Jr,useImperativeHandle:Jr,useInsertionEffect:Jr,useLayoutEffect:Jr,useMemo:Jr,useReducer:Jr,useRef:Jr,useState:Jr,useDebugValue:Jr,useDeferredValue:Jr,useTransition:Jr,useMutableSource:Jr,useSyncExternalStore:Jr,useId:Jr,unstable_isNewReconciler:!1},fx={readContext:hi,useCallback:function(e,t){return Qi().memoizedState=[e,t===void 0?null:t],e},useContext:hi,useEffect:t5,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Wd(4194308,4,gw.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Wd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Wd(4,2,e,t)},useMemo:function(e,t){var r=Qi();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Qi();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=ux.bind(null,ir,e),[n.memoizedState,e]},useRef:function(e){var t=Qi();return e={current:e},t.memoizedState=e},useState:e5,useDebugValue:dy,useDeferredValue:function(e){return Qi().memoizedState=e},useTransition:function(){var e=e5(!1),t=e[0];return e=sx.bind(null,e[1]),Qi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ir,i=Qi();if(Zt){if(r===void 0)throw Error(Ce(407));r=r()}else{if(r=t(),Dr===null)throw Error(Ce(349));bl&30||lw(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,t5(uw.bind(null,n,a,e),[e]),n.flags|=2048,jc(9,sw.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Qi(),t=Dr.identifierPrefix;if(Zt){var r=Oa,n=Ea;r=(n&~(1<<32-ki(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Dc++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=lx++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},dx={readContext:hi,useCallback:mw,useContext:hi,useEffect:fy,useImperativeHandle:vw,useInsertionEffect:hw,useLayoutEffect:pw,useMemo:yw,useReducer:G1,useRef:dw,useState:function(){return G1(Fc)},useDebugValue:dy,useDeferredValue:function(e){var t=pi();return bw(t,xr.memoizedState,e)},useTransition:function(){var e=G1(Fc)[0],t=pi().memoizedState;return[e,t]},useMutableSource:aw,useSyncExternalStore:ow,useId:_w,unstable_isNewReconciler:!1},hx={readContext:hi,useCallback:mw,useContext:hi,useEffect:fy,useImperativeHandle:vw,useInsertionEffect:hw,useLayoutEffect:pw,useMemo:yw,useReducer:$1,useRef:dw,useState:function(){return $1(Fc)},useDebugValue:dy,useDeferredValue:function(e){var t=pi();return xr===null?t.memoizedState=e:bw(t,xr.memoizedState,e)},useTransition:function(){var e=$1(Fc)[0],t=pi().memoizedState;return[e,t]},useMutableSource:aw,useSyncExternalStore:ow,useId:_w,unstable_isNewReconciler:!1};function Ys(e,t){try{var r="",n=t;do r+=UE(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 V1(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 px=typeof WeakMap=="function"?WeakMap:Map;function Ow(e,t,r){r=xa(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Eh||(Eh=!0,rm=n),qv(e,t)},r}function xw(e,t,r){r=xa(-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"&&(So===null?So=new Set([this]):So.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function r5(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new px;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=Tx.bind(null,e,t,r),t.then(e,e))}function n5(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 i5(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=xa(-1,1),t.tag=2,wo(r,t,1))),r.lanes|=1),e)}var gx=Fa.ReactCurrentOwner,En=!1;function cn(e,t,r,n){t.child=e===null?nw(t,null,r,n):qs(t,e.child,r,n)}function a5(e,t,r,n,i){r=r.render;var a=t.ref;return Bs(t,i),n=uy(e,t,r,n,a,i),r=cy(),e!==null&&!En?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ma(e,t,i)):(Zt&&r&&Zm(t),t.flags|=1,cn(e,t,n,i),t.child)}function o5(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!_y(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,Pw(e,t,a,n,i)):(e=Zd(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:kc,r(o,n)&&e.ref===t.ref)return Ma(e,t,i)}return t.flags|=1,e=Oo(a,n),e.ref=t.ref,e.return=t,t.child=e}function Pw(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(kc(a,n)&&e.ref===t.ref)if(En=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(En=!0);else return t.lanes=e.lanes,Ma(e,t,i)}return Wv(e,t,r,n,i)}function Cw(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},Bt(Ls,zn),zn|=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,Bt(Ls,zn),zn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Bt(Ls,zn),zn|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Bt(Ls,zn),zn|=n;return cn(e,t,i,r),t.child}function Tw(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Wv(e,t,r,n,i){var a=Cn(r)?ml:rn.current;return a=$s(t,a),Bs(t,i),r=uy(e,t,r,n,a,i),n=cy(),e!==null&&!En?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ma(e,t,i)):(Zt&&n&&Zm(t),t.flags|=1,cn(e,t,r,i),t.child)}function l5(e,t,r,n,i){if(Cn(r)){var a=!0;hh(t)}else a=!1;if(Bs(t,i),t.stateNode===null)Yd(e,t),tw(t,r,n),Vv(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=hi(f):(f=Cn(r)?ml:rn.current,f=$s(t,f));var p=r.getDerivedStateFromProps,S=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function";S||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||u!==f)&&Q3(t,o,n,f),uo=!1;var w=t.memoizedState;o.state=w,yh(t,n,o,i),u=t.memoizedState,l!==n||w!==u||Pn.current||uo?(typeof p=="function"&&($v(t,r,p,n),u=t.memoizedState),(l=uo||Z3(t,r,l,n,w,u,f))?(S||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,J6(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:Ci(t.type,l),o.props=f,S=t.pendingProps,w=o.context,u=r.contextType,typeof u=="object"&&u!==null?u=hi(u):(u=Cn(r)?ml:rn.current,u=$s(t,u));var g=r.getDerivedStateFromProps;(p=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==S||w!==u)&&Q3(t,o,n,u),uo=!1,w=t.memoizedState,o.state=w,yh(t,n,o,i);var E=t.memoizedState;l!==S||w!==E||Pn.current||uo?(typeof g=="function"&&($v(t,r,g,n),E=t.memoizedState),(f=uo||Z3(t,r,f,n,w,E,u)||!1)?(p||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&&w===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&w===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&&w===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),n=!1)}return Yv(e,t,r,n,a,i)}function Yv(e,t,r,n,i,a){Tw(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&q3(t,r,!1),Ma(e,t,a);n=t.stateNode,gx.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=qs(t,e.child,null,a),t.child=qs(t,null,l,a)):cn(e,t,l,a),t.memoizedState=n.state,i&&q3(t,r,!0),t.child}function Aw(e){var t=e.stateNode;t.pendingContext?V3(e,t.pendingContext,t.pendingContext!==t.context):t.context&&V3(e,t.context,!1),ay(e,t.containerInfo)}function s5(e,t,r,n,i){return Vs(),Jm(i),t.flags|=256,cn(e,t,r,n),t.child}var Kv={dehydrated:null,treeContext:null,retryLane:0};function Xv(e){return{baseLanes:e,cachePool:null,transitions:null}}function kw(e,t,r){var n=t.pendingProps,i=nr.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),Bt(nr,i&1),e===null)return Hv(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=rp(o,n,0,null),e=pl(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Xv(r),t.memoizedState=Kv,e):hy(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return vx(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=Oo(i,u),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Oo(l,a):(a=pl(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?Xv(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=Kv,n}return a=e.child,e=a.sibling,n=Oo(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 hy(e,t){return t=rp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function xd(e,t,r,n){return n!==null&&Jm(n),qs(t,e.child,null,r),e=hy(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vx(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=V1(Error(Ce(422))),xd(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=rp({mode:"visible",children:n.children},i,0,null),a=pl(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&qs(t,e.child,null,o),t.child.memoizedState=Xv(o),t.memoizedState=Kv,a);if(!(t.mode&1))return xd(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=V1(a,n,void 0),xd(e,t,o,n)}if(l=(o&e.childLanes)!==0,En||l){if(n=Dr,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,La(e,i),Ri(n,e,i,-1))}return by(),n=V1(Error(Ce(421))),xd(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Ax.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Un=_o(i.nextSibling),Hn=t,Zt=!0,Ai=null,e!==null&&(oi[li++]=Ea,oi[li++]=Oa,oi[li++]=yl,Ea=e.id,Oa=e.overflow,yl=t),t=hy(t,n.children),t.flags|=4096,t)}function u5(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Gv(e.return,t,r)}function q1(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 Rw(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(cn(e,t,n.children,r),n=nr.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&&u5(e,r,t);else if(e.tag===19)u5(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(Bt(nr,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&&bh(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),q1(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&&bh(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}q1(t,!0,r,null,a);break;case"together":q1(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Yd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ma(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),_l|=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=Oo(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Oo(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function mx(e,t,r){switch(t.tag){case 3:Aw(t),Vs();break;case 5:iw(t);break;case 1:Cn(t.type)&&hh(t);break;case 4:ay(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Bt(vh,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Bt(nr,nr.current&1),t.flags|=128,null):r&t.child.childLanes?kw(e,t,r):(Bt(nr,nr.current&1),e=Ma(e,t,r),e!==null?e.sibling:null);Bt(nr,nr.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Rw(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Bt(nr,nr.current),n)break;return null;case 22:case 23:return t.lanes=0,Cw(e,t,r)}return Ma(e,t,r)}var Lw,Zv,Mw,Nw;Lw=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}};Zv=function(){};Mw=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,fl(ia.current);var a=null;switch(r){case"input":i=bv(e,i),n=bv(e,n),a=[];break;case"select":i=ar({},i,{value:void 0}),n=ar({},n,{value:void 0}),a=[];break;case"textarea":i=Sv(e,i),n=Sv(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=fh)}Ov(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"&&(Ec.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"&&(Ec.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&Vt("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)}};Nw=function(e,t,r,n){r!==n&&(t.flags|=4)};function Qu(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 en(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 yx(e,t,r){var n=t.pendingProps;switch(Qm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return en(t),null;case 1:return Cn(t.type)&&dh(),en(t),null;case 3:return n=t.stateNode,Ws(),qt(Pn),qt(rn),ly(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ed(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ai!==null&&(am(Ai),Ai=null))),Zv(e,t),en(t),null;case 5:oy(t);var i=fl(Ic.current);if(r=t.type,e!==null&&t.stateNode!=null)Mw(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 en(t),null}if(e=fl(ia.current),Ed(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Ji]=t,n[Mc]=a,e=(t.mode&1)!==0,r){case"dialog":Vt("cancel",n),Vt("close",n);break;case"iframe":case"object":case"embed":Vt("load",n);break;case"video":case"audio":for(i=0;i<lc.length;i++)Vt(lc[i],n);break;case"source":Vt("error",n);break;case"img":case"image":case"link":Vt("error",n),Vt("load",n);break;case"details":Vt("toggle",n);break;case"input":y3(n,a),Vt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},Vt("invalid",n);break;case"textarea":_3(n,a),Vt("invalid",n)}Ov(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&&Sd(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Sd(n.textContent,l,e),i=["children",""+l]):Ec.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Vt("scroll",n)}switch(r){case"input":pd(n),b3(n,a,!0);break;case"textarea":pd(n),w3(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=fh)}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=l6(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[Ji]=t,e[Mc]=n,Lw(e,t,!1,!1),t.stateNode=e;e:{switch(o=xv(r,n),r){case"dialog":Vt("cancel",e),Vt("close",e),i=n;break;case"iframe":case"object":case"embed":Vt("load",e),i=n;break;case"video":case"audio":for(i=0;i<lc.length;i++)Vt(lc[i],e);i=n;break;case"source":Vt("error",e),i=n;break;case"img":case"image":case"link":Vt("error",e),Vt("load",e),i=n;break;case"details":Vt("toggle",e),i=n;break;case"input":y3(e,n),i=bv(e,n),Vt("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=ar({},n,{value:void 0}),Vt("invalid",e);break;case"textarea":_3(e,n),i=Sv(e,n),Vt("invalid",e);break;default:i=n}Ov(r,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var u=l[a];a==="style"?c6(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&s6(e,u)):a==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Oc(e,u):typeof u=="number"&&Oc(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Ec.hasOwnProperty(a)?u!=null&&a==="onScroll"&&Vt("scroll",e):u!=null&&Fm(e,a,u,o))}switch(r){case"input":pd(e),b3(e,n,!1);break;case"textarea":pd(e),w3(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Co(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?Ds(e,!!n.multiple,a,!1):n.defaultValue!=null&&Ds(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=fh)}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 en(t),null;case 6:if(e&&t.stateNode!=null)Nw(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(Ce(166));if(r=fl(Ic.current),fl(ia.current),Ed(t)){if(n=t.stateNode,r=t.memoizedProps,n[Ji]=t,(a=n.nodeValue!==r)&&(e=Hn,e!==null))switch(e.tag){case 3:Sd(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Sd(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Ji]=t,t.stateNode=n}return en(t),null;case 13:if(qt(nr),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Zt&&Un!==null&&t.mode&1&&!(t.flags&128))Z6(),Vs(),t.flags|=98560,a=!1;else if(a=Ed(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[Ji]=t}else Vs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;en(t),a=!1}else Ai!==null&&(am(Ai),Ai=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||nr.current&1?Cr===0&&(Cr=3):by())),t.updateQueue!==null&&(t.flags|=4),en(t),null);case 4:return Ws(),Zv(e,t),e===null&&Rc(t.stateNode.containerInfo),en(t),null;case 10:return ry(t.type._context),en(t),null;case 17:return Cn(t.type)&&dh(),en(t),null;case 19:if(qt(nr),a=t.memoizedState,a===null)return en(t),null;if(n=(t.flags&128)!==0,o=a.rendering,o===null)if(n)Qu(a,!1);else{if(Cr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=bh(e),o!==null){for(t.flags|=128,Qu(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 Bt(nr,nr.current&1|2),t.child}e=e.sibling}a.tail!==null&&pr()>Ks&&(t.flags|=128,n=!0,Qu(a,!1),t.lanes=4194304)}else{if(!n)if(e=bh(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Qu(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Zt)return en(t),null}else 2*pr()-a.renderingStartTime>Ks&&r!==1073741824&&(t.flags|=128,n=!0,Qu(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=nr.current,Bt(nr,n?r&1|2:r&1),t):(en(t),null);case 22:case 23:return yy(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?zn&1073741824&&(en(t),t.subtreeFlags&6&&(t.flags|=8192)):en(t),null;case 24:return null;case 25:return null}throw Error(Ce(156,t.tag))}function bx(e,t){switch(Qm(t),t.tag){case 1:return Cn(t.type)&&dh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ws(),qt(Pn),qt(rn),ly(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return oy(t),null;case 13:if(qt(nr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ce(340));Vs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qt(nr),null;case 4:return Ws(),null;case 10:return ry(t.type._context),null;case 22:case 23:return yy(),null;case 24:return null;default:return null}}var Pd=!1,tn=!1,_x=typeof WeakSet=="function"?WeakSet:Set,$e=null;function Rs(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ur(e,t,n)}else r.current=null}function Qv(e,t,r){try{r()}catch(n){ur(e,t,n)}}var c5=!1;function wx(e,t){if(Iv=sh,e=j6(),Xm(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,p=0,S=e,w=null;t:for(;;){for(var g;S!==r||i!==0&&S.nodeType!==3||(l=o+i),S!==a||n!==0&&S.nodeType!==3||(u=o+n),S.nodeType===3&&(o+=S.nodeValue.length),(g=S.firstChild)!==null;)w=S,S=g;for(;;){if(S===e)break t;if(w===r&&++f===i&&(l=o),w===a&&++p===n&&(u=o),(g=S.nextSibling)!==null)break;S=w,w=S.parentNode}S=g}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Dv={focusedElem:e,selectionRange:r},sh=!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 m=E.memoizedProps,v=E.memoizedState,y=t.stateNode,h=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ci(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=h}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(b){ur(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,$e=e;break}$e=t.return}return E=c5,c5=!1,E}function vc(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&&Qv(t,r,a)}i=i.next}while(i!==n)}}function ep(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 Jv(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 Iw(e){var t=e.alternate;t!==null&&(e.alternate=null,Iw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ji],delete t[Mc],delete t[zv],delete t[nx],delete t[ix])),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 Dw(e){return e.tag===5||e.tag===3||e.tag===4}function f5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dw(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 em(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=fh));else if(n!==4&&(e=e.child,e!==null))for(em(e,t,r),e=e.sibling;e!==null;)em(e,t,r),e=e.sibling}function tm(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(tm(e,t,r),e=e.sibling;e!==null;)tm(e,t,r),e=e.sibling}var Gr=null,Ti=!1;function ao(e,t,r){for(r=r.child;r!==null;)Fw(e,t,r),r=r.sibling}function Fw(e,t,r){if(na&&typeof na.onCommitFiberUnmount=="function")try{na.onCommitFiberUnmount(qh,r)}catch{}switch(r.tag){case 5:tn||Rs(r,t);case 6:var n=Gr,i=Ti;Gr=null,ao(e,t,r),Gr=n,Ti=i,Gr!==null&&(Ti?(e=Gr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Gr.removeChild(r.stateNode));break;case 18:Gr!==null&&(Ti?(e=Gr,r=r.stateNode,e.nodeType===8?z1(e.parentNode,r):e.nodeType===1&&z1(e,r),Tc(e)):z1(Gr,r.stateNode));break;case 4:n=Gr,i=Ti,Gr=r.stateNode.containerInfo,Ti=!0,ao(e,t,r),Gr=n,Ti=i;break;case 0:case 11:case 14:case 15:if(!tn&&(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)&&Qv(r,t,o),i=i.next}while(i!==n)}ao(e,t,r);break;case 1:if(!tn&&(Rs(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){ur(r,t,l)}ao(e,t,r);break;case 21:ao(e,t,r);break;case 22:r.mode&1?(tn=(n=tn)||r.memoizedState!==null,ao(e,t,r),tn=n):ao(e,t,r);break;default:ao(e,t,r)}}function d5(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new _x),t.forEach(function(n){var i=kx.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function xi(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:Gr=l.stateNode,Ti=!1;break e;case 3:Gr=l.stateNode.containerInfo,Ti=!0;break e;case 4:Gr=l.stateNode.containerInfo,Ti=!0;break e}l=l.return}if(Gr===null)throw Error(Ce(160));Fw(a,o,i),Gr=null,Ti=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(f){ur(i,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)jw(t,e),t=t.sibling}function jw(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xi(t,e),Xi(e),n&4){try{vc(3,e,e.return),ep(3,e)}catch(m){ur(e,e.return,m)}try{vc(5,e,e.return)}catch(m){ur(e,e.return,m)}}break;case 1:xi(t,e),Xi(e),n&512&&r!==null&&Rs(r,r.return);break;case 5:if(xi(t,e),Xi(e),n&512&&r!==null&&Rs(r,r.return),e.flags&32){var i=e.stateNode;try{Oc(i,"")}catch(m){ur(e,e.return,m)}}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&&a6(i,a),xv(l,o);var f=xv(l,a);for(o=0;o<u.length;o+=2){var p=u[o],S=u[o+1];p==="style"?c6(i,S):p==="dangerouslySetInnerHTML"?s6(i,S):p==="children"?Oc(i,S):Fm(i,p,S,f)}switch(l){case"input":_v(i,a);break;case"textarea":o6(i,a);break;case"select":var w=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var g=a.value;g!=null?Ds(i,!!a.multiple,g,!1):w!==!!a.multiple&&(a.defaultValue!=null?Ds(i,!!a.multiple,a.defaultValue,!0):Ds(i,!!a.multiple,a.multiple?[]:"",!1))}i[Mc]=a}catch(m){ur(e,e.return,m)}}break;case 6:if(xi(t,e),Xi(e),n&4){if(e.stateNode===null)throw Error(Ce(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(m){ur(e,e.return,m)}}break;case 3:if(xi(t,e),Xi(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Tc(t.containerInfo)}catch(m){ur(e,e.return,m)}break;case 4:xi(t,e),Xi(e);break;case 13:xi(t,e),Xi(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(vy=pr())),n&4&&d5(e);break;case 22:if(p=r!==null&&r.memoizedState!==null,e.mode&1?(tn=(f=tn)||p,xi(t,e),tn=f):xi(t,e),Xi(e),n&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!p&&e.mode&1)for($e=e,p=e.child;p!==null;){for(S=$e=p;$e!==null;){switch(w=$e,g=w.child,w.tag){case 0:case 11:case 14:case 15:vc(4,w,w.return);break;case 1:Rs(w,w.return);var E=w.stateNode;if(typeof E.componentWillUnmount=="function"){n=w,r=w.return;try{t=n,E.props=t.memoizedProps,E.state=t.memoizedState,E.componentWillUnmount()}catch(m){ur(n,r,m)}}break;case 5:Rs(w,w.return);break;case 22:if(w.memoizedState!==null){p5(S);continue}}g!==null?(g.return=w,$e=g):p5(S)}p=p.sibling}e:for(p=null,S=e;;){if(S.tag===5){if(p===null){p=S;try{i=S.stateNode,f?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=S.stateNode,u=S.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=u6("display",o))}catch(m){ur(e,e.return,m)}}}else if(S.tag===6){if(p===null)try{S.stateNode.nodeValue=f?"":S.memoizedProps}catch(m){ur(e,e.return,m)}}else if((S.tag!==22&&S.tag!==23||S.memoizedState===null||S===e)&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===e)break e;for(;S.sibling===null;){if(S.return===null||S.return===e)break e;p===S&&(p=null),S=S.return}p===S&&(p=null),S.sibling.return=S.return,S=S.sibling}}break;case 19:xi(t,e),Xi(e),n&4&&d5(e);break;case 21:break;default:xi(t,e),Xi(e)}}function Xi(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Dw(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&&(Oc(i,""),n.flags&=-33);var a=f5(e);tm(e,a,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=f5(e);em(e,l,o);break;default:throw Error(Ce(161))}}catch(u){ur(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sx(e,t,r){$e=e,zw(e)}function zw(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||Pd;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||tn;l=Pd;var f=tn;if(Pd=o,(tn=u)&&!f)for($e=i;$e!==null;)o=$e,u=o.child,o.tag===22&&o.memoizedState!==null?g5(i):u!==null?(u.return=o,$e=u):g5(i);for(;a!==null;)$e=a,zw(a),a=a.sibling;$e=i,Pd=l,tn=f}h5(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,$e=a):h5(e)}}function h5(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:tn||ep(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!tn)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:Ci(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&X3(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}X3(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 p=f.memoizedState;if(p!==null){var S=p.dehydrated;S!==null&&Tc(S)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Ce(163))}tn||t.flags&512&&Jv(t)}catch(w){ur(t,t.return,w)}}if(t===e){$e=null;break}if(r=t.sibling,r!==null){r.return=t.return,$e=r;break}$e=t.return}}function p5(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 g5(e){for(;$e!==null;){var t=$e;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{ep(4,t)}catch(u){ur(t,r,u)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(u){ur(t,i,u)}}var a=t.return;try{Jv(t)}catch(u){ur(t,a,u)}break;case 5:var o=t.return;try{Jv(t)}catch(u){ur(t,o,u)}}}catch(u){ur(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 Ex=Math.ceil,Sh=Fa.ReactCurrentDispatcher,py=Fa.ReactCurrentOwner,fi=Fa.ReactCurrentBatchConfig,Ot=0,Dr=null,_r=null,Vr=0,zn=0,Ls=No(0),Cr=0,zc=null,_l=0,tp=0,gy=0,mc=null,Sn=null,vy=0,Ks=1/0,wa=null,Eh=!1,rm=null,So=null,Cd=!1,go=null,Oh=0,yc=0,nm=null,Kd=-1,Xd=0;function fn(){return Ot&6?pr():Kd!==-1?Kd:Kd=pr()}function Eo(e){return e.mode&1?Ot&2&&Vr!==0?Vr&-Vr:ox.transition!==null?(Xd===0&&(Xd=S6()),Xd):(e=Lt,e!==0||(e=window.event,e=e===void 0?16:A6(e.type)),e):1}function Ri(e,t,r,n){if(50<yc)throw yc=0,nm=null,Error(Ce(185));Qc(e,r,n),(!(Ot&2)||e!==Dr)&&(e===Dr&&(!(Ot&2)&&(tp|=r),Cr===4&&fo(e,Vr)),Tn(e,n),r===1&&Ot===0&&!(t.mode&1)&&(Ks=pr()+500,Zh&&Io()))}function Tn(e,t){var r=e.callbackNode;oO(e,t);var n=lh(e,e===Dr?Vr:0);if(n===0)r!==null&&O3(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&O3(r),t===1)e.tag===0?ax(v5.bind(null,e)):Y6(v5.bind(null,e)),tx(function(){!(Ot&6)&&Io()}),r=null;else{switch(E6(n)){case 1:r=Hm;break;case 4:r=_6;break;case 16:r=oh;break;case 536870912:r=w6;break;default:r=oh}r=Ww(r,Bw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Bw(e,t){if(Kd=-1,Xd=0,Ot&6)throw Error(Ce(327));var r=e.callbackNode;if(Us()&&e.callbackNode!==r)return null;var n=lh(e,e===Dr?Vr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=xh(e,n);else{t=n;var i=Ot;Ot|=2;var a=Hw();(Dr!==e||Vr!==t)&&(wa=null,Ks=pr()+500,hl(e,t));do try{Px();break}catch(l){Uw(e,l)}while(!0);ty(),Sh.current=a,Ot=i,_r!==null?t=0:(Dr=null,Vr=0,t=Cr)}if(t!==0){if(t===2&&(i=kv(e),i!==0&&(n=i,t=im(e,i))),t===1)throw r=zc,hl(e,0),fo(e,n),Tn(e,pr()),r;if(t===6)fo(e,n);else{if(i=e.current.alternate,!(n&30)&&!Ox(i)&&(t=xh(e,n),t===2&&(a=kv(e),a!==0&&(n=a,t=im(e,a))),t===1))throw r=zc,hl(e,0),fo(e,n),Tn(e,pr()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(Ce(345));case 2:sl(e,Sn,wa);break;case 3:if(fo(e,n),(n&130023424)===n&&(t=vy+500-pr(),10<t)){if(lh(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){fn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=jv(sl.bind(null,e,Sn,wa),t);break}sl(e,Sn,wa);break;case 4:if(fo(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-ki(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*Ex(n/1960))-n,10<n){e.timeoutHandle=jv(sl.bind(null,e,Sn,wa),n);break}sl(e,Sn,wa);break;case 5:sl(e,Sn,wa);break;default:throw Error(Ce(329))}}}return Tn(e,pr()),e.callbackNode===r?Bw.bind(null,e):null}function im(e,t){var r=mc;return e.current.memoizedState.isDehydrated&&(hl(e,t).flags|=256),e=xh(e,t),e!==2&&(t=Sn,Sn=r,t!==null&&am(t)),e}function am(e){Sn===null?Sn=e:Sn.push.apply(Sn,e)}function Ox(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(!Di(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 fo(e,t){for(t&=~gy,t&=~tp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-ki(t),n=1<<r;e[r]=-1,t&=~n}}function v5(e){if(Ot&6)throw Error(Ce(327));Us();var t=lh(e,0);if(!(t&1))return Tn(e,pr()),null;var r=xh(e,t);if(e.tag!==0&&r===2){var n=kv(e);n!==0&&(t=n,r=im(e,n))}if(r===1)throw r=zc,hl(e,0),fo(e,t),Tn(e,pr()),r;if(r===6)throw Error(Ce(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,sl(e,Sn,wa),Tn(e,pr()),null}function my(e,t){var r=Ot;Ot|=1;try{return e(t)}finally{Ot=r,Ot===0&&(Ks=pr()+500,Zh&&Io())}}function wl(e){go!==null&&go.tag===0&&!(Ot&6)&&Us();var t=Ot;Ot|=1;var r=fi.transition,n=Lt;try{if(fi.transition=null,Lt=1,e)return e()}finally{Lt=n,fi.transition=r,Ot=t,!(Ot&6)&&Io()}}function yy(){zn=Ls.current,qt(Ls)}function hl(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,ex(r)),_r!==null)for(r=_r.return;r!==null;){var n=r;switch(Qm(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&dh();break;case 3:Ws(),qt(Pn),qt(rn),ly();break;case 5:oy(n);break;case 4:Ws();break;case 13:qt(nr);break;case 19:qt(nr);break;case 10:ry(n.type._context);break;case 22:case 23:yy()}r=r.return}if(Dr=e,_r=e=Oo(e.current,null),Vr=zn=t,Cr=0,zc=null,gy=tp=_l=0,Sn=mc=null,cl!==null){for(t=0;t<cl.length;t++)if(r=cl[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}cl=null}return e}function Uw(e,t){do{var r=_r;try{if(ty(),qd.current=wh,_h){for(var n=ir.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}_h=!1}if(bl=0,Nr=xr=ir=null,gc=!1,Dc=0,py.current=null,r===null||r.return===null){Cr=1,zc=t,_r=null;break}e:{var a=e,o=r.return,l=r,u=t;if(t=Vr,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,p=l,S=p.tag;if(!(p.mode&1)&&(S===0||S===11||S===15)){var w=p.alternate;w?(p.updateQueue=w.updateQueue,p.memoizedState=w.memoizedState,p.lanes=w.lanes):(p.updateQueue=null,p.memoizedState=null)}var g=n5(o);if(g!==null){g.flags&=-257,i5(g,o,l,a,t),g.mode&1&&r5(a,f,t),t=g,u=f;var E=t.updateQueue;if(E===null){var m=new Set;m.add(u),t.updateQueue=m}else E.add(u);break e}else{if(!(t&1)){r5(a,f,t),by();break e}u=Error(Ce(426))}}else if(Zt&&l.mode&1){var v=n5(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),i5(v,o,l,a,t),Jm(Ys(u,l));break e}}a=u=Ys(u,l),Cr!==4&&(Cr=2),mc===null?mc=[a]:mc.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=Ow(a,u,t);K3(a,y);break e;case 1:l=u;var h=a.type,d=a.stateNode;if(!(a.flags&128)&&(typeof h.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(So===null||!So.has(d)))){a.flags|=65536,t&=-t,a.lanes|=t;var b=xw(a,l,t);K3(a,b);break e}}a=a.return}while(a!==null)}$w(r)}catch(O){t=O,_r===r&&r!==null&&(_r=r=r.return);continue}break}while(!0)}function Hw(){var e=Sh.current;return Sh.current=wh,e===null?wh:e}function by(){(Cr===0||Cr===3||Cr===2)&&(Cr=4),Dr===null||!(_l&268435455)&&!(tp&268435455)||fo(Dr,Vr)}function xh(e,t){var r=Ot;Ot|=2;var n=Hw();(Dr!==e||Vr!==t)&&(wa=null,hl(e,t));do try{xx();break}catch(i){Uw(e,i)}while(!0);if(ty(),Ot=r,Sh.current=n,_r!==null)throw Error(Ce(261));return Dr=null,Vr=0,Cr}function xx(){for(;_r!==null;)Gw(_r)}function Px(){for(;_r!==null&&!ZE();)Gw(_r)}function Gw(e){var t=qw(e.alternate,e,zn);e.memoizedProps=e.pendingProps,t===null?$w(e):_r=t,py.current=null}function $w(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=bx(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=yx(r,t,zn),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 sl(e,t,r){var n=Lt,i=fi.transition;try{fi.transition=null,Lt=1,Cx(e,t,r,n)}finally{fi.transition=i,Lt=n}return null}function Cx(e,t,r,n){do Us();while(go!==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(lO(e,a),e===Dr&&(_r=Dr=null,Vr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Cd||(Cd=!0,Ww(oh,function(){return Us(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=fi.transition,fi.transition=null;var o=Lt;Lt=1;var l=Ot;Ot|=4,py.current=null,wx(e,r),jw(r,e),WO(Dv),sh=!!Iv,Dv=Iv=null,e.current=r,Sx(r),QE(),Ot=l,Lt=o,fi.transition=a}else e.current=r;if(Cd&&(Cd=!1,go=e,Oh=i),a=e.pendingLanes,a===0&&(So=null),tO(r.stateNode),Tn(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(Eh)throw Eh=!1,e=rm,rm=null,e;return Oh&1&&e.tag!==0&&Us(),a=e.pendingLanes,a&1?e===nm?yc++:(yc=0,nm=e):yc=0,Io(),null}function Us(){if(go!==null){var e=E6(Oh),t=fi.transition,r=Lt;try{if(fi.transition=null,Lt=16>e?16:e,go===null)var n=!1;else{if(e=go,go=null,Oh=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 p=$e;switch(p.tag){case 0:case 11:case 15:vc(8,p,a)}var S=p.child;if(S!==null)S.return=p,$e=S;else for(;$e!==null;){p=$e;var w=p.sibling,g=p.return;if(Iw(p),p===f){$e=null;break}if(w!==null){w.return=g,$e=w;break}$e=g}}}var E=a.alternate;if(E!==null){var m=E.child;if(m!==null){E.child=null;do{var v=m.sibling;m.sibling=null,m=v}while(m!==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:vc(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,$e=y;break e}$e=a.return}}var h=e.current;for($e=h;$e!==null;){o=$e;var d=o.child;if(o.subtreeFlags&2064&&d!==null)d.return=o,$e=d;else e:for(o=h;$e!==null;){if(l=$e,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ep(9,l)}}catch(O){ur(l,l.return,O)}if(l===o){$e=null;break e}var b=l.sibling;if(b!==null){b.return=l.return,$e=b;break e}$e=l.return}}if(Ot=i,Io(),na&&typeof na.onPostCommitFiberRoot=="function")try{na.onPostCommitFiberRoot(qh,e)}catch{}n=!0}return n}finally{Lt=r,fi.transition=t}}return!1}function m5(e,t,r){t=Ys(r,t),t=Ow(e,t,1),e=wo(e,t,1),t=fn(),e!==null&&(Qc(e,1,t),Tn(e,t))}function ur(e,t,r){if(e.tag===3)m5(e,e,r);else for(;t!==null;){if(t.tag===3){m5(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(So===null||!So.has(n))){e=Ys(r,e),e=xw(t,e,1),t=wo(t,e,1),e=fn(),t!==null&&(Qc(t,1,e),Tn(t,e));break}}t=t.return}}function Tx(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=fn(),e.pingedLanes|=e.suspendedLanes&r,Dr===e&&(Vr&r)===r&&(Cr===4||Cr===3&&(Vr&130023424)===Vr&&500>pr()-vy?hl(e,0):gy|=r),Tn(e,t)}function Vw(e,t){t===0&&(e.mode&1?(t=md,md<<=1,!(md&130023424)&&(md=4194304)):t=1);var r=fn();e=La(e,t),e!==null&&(Qc(e,t,r),Tn(e,r))}function Ax(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Vw(e,r)}function kx(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),Vw(e,r)}var qw;qw=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pn.current)En=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return En=!1,mx(e,t,r);En=!!(e.flags&131072)}else En=!1,Zt&&t.flags&1048576&&K6(t,gh,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Yd(e,t),e=t.pendingProps;var i=$s(t,rn.current);Bs(t,r),i=uy(null,t,n,e,i,r);var a=cy();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,Cn(n)?(a=!0,hh(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,iy(t),i.updater=Qh,t.stateNode=i,i._reactInternals=t,Vv(t,n,e,r),t=Yv(null,t,n,!0,a,r)):(t.tag=0,Zt&&a&&Zm(t),cn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Yd(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Lx(n),e=Ci(n,e),i){case 0:t=Wv(null,t,n,e,r);break e;case 1:t=l5(null,t,n,e,r);break e;case 11:t=a5(null,t,n,e,r);break e;case 14:t=o5(null,t,n,Ci(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:Ci(n,i),Wv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ci(n,i),l5(e,t,n,i,r);case 3:e:{if(Aw(t),e===null)throw Error(Ce(387));n=t.pendingProps,a=t.memoizedState,i=a.element,J6(e,t),yh(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=Ys(Error(Ce(423)),t),t=s5(e,t,n,r,i);break e}else if(n!==i){i=Ys(Error(Ce(424)),t),t=s5(e,t,n,r,i);break e}else for(Un=_o(t.stateNode.containerInfo.firstChild),Hn=t,Zt=!0,Ai=null,r=nw(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Vs(),n===i){t=Ma(e,t,r);break e}cn(e,t,n,r)}t=t.child}return t;case 5:return iw(t),e===null&&Hv(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Fv(n,i)?o=null:a!==null&&Fv(n,a)&&(t.flags|=32),Tw(e,t),cn(e,t,o,r),t.child;case 6:return e===null&&Hv(t),null;case 13:return kw(e,t,r);case 4:return ay(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=qs(t,null,n,r):cn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ci(n,i),a5(e,t,n,i,r);case 7:return cn(e,t,t.pendingProps,r),t.child;case 8:return cn(e,t,t.pendingProps.children,r),t.child;case 12:return cn(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,Bt(vh,n._currentValue),n._currentValue=o,a!==null)if(Di(a.value,o)){if(a.children===i.children&&!Pn.current){t=Ma(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=xa(-1,r&-r),u.tag=2;var f=a.updateQueue;if(f!==null){f=f.shared;var p=f.pending;p===null?u.next=u:(u.next=p.next,p.next=u),f.pending=u}}a.lanes|=r,u=a.alternate,u!==null&&(u.lanes|=r),Gv(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),Gv(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}cn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Bs(t,r),i=hi(i),n=n(i),t.flags|=1,cn(e,t,n,r),t.child;case 14:return n=t.type,i=Ci(n,t.pendingProps),i=Ci(n.type,i),o5(e,t,n,i,r);case 15:return Pw(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ci(n,i),Yd(e,t),t.tag=1,Cn(n)?(e=!0,hh(t)):e=!1,Bs(t,r),tw(t,n,i),Vv(t,n,i,r),Yv(null,t,n,!0,e,r);case 19:return Rw(e,t,r);case 22:return Cw(e,t,r)}throw Error(Ce(156,t.tag))};function Ww(e,t){return b6(e,t)}function Rx(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 ci(e,t,r,n){return new Rx(e,t,r,n)}function _y(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Lx(e){if(typeof e=="function")return _y(e)?1:0;if(e!=null){if(e=e.$$typeof,e===zm)return 11;if(e===Bm)return 14}return 2}function Oo(e,t){var r=e.alternate;return r===null?(r=ci(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 Zd(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")_y(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ss:return pl(r.children,i,a,t);case jm:o=8,i|=8;break;case gv:return e=ci(12,r,t,i|2),e.elementType=gv,e.lanes=a,e;case vv:return e=ci(13,r,t,i),e.elementType=vv,e.lanes=a,e;case mv:return e=ci(19,r,t,i),e.elementType=mv,e.lanes=a,e;case r6:return rp(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case e6:o=10;break e;case t6:o=9;break e;case zm:o=11;break e;case Bm:o=14;break e;case so:o=16,n=null;break e}throw Error(Ce(130,e==null?e:typeof e,""))}return t=ci(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function pl(e,t,r,n){return e=ci(7,e,n,t),e.lanes=r,e}function rp(e,t,r,n){return e=ci(22,e,n,t),e.elementType=r6,e.lanes=r,e.stateNode={isHidden:!1},e}function W1(e,t,r){return e=ci(6,e,null,t),e.lanes=r,e}function Y1(e,t,r){return t=ci(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Mx(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=T1(0),this.expirationTimes=T1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=T1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function wy(e,t,r,n,i,a,o,l,u){return e=new Mx(e,t,r,l,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=ci(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},iy(a),e}function Nx(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ws,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Yw(e){if(!e)return To;e=e._reactInternals;e:{if(kl(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(Cn(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(Cn(r))return W6(e,r,t)}return t}function Kw(e,t,r,n,i,a,o,l,u){return e=wy(r,n,!0,e,i,a,o,l,u),e.context=Yw(null),r=e.current,n=fn(),i=Eo(r),a=xa(n,i),a.callback=t??null,wo(r,a,i),e.current.lanes=i,Qc(e,i,n),Tn(e,n),e}function np(e,t,r,n){var i=t.current,a=fn(),o=Eo(i);return r=Yw(r),t.context===null?t.context=r:t.pendingContext=r,t=xa(a,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=wo(i,t,o),e!==null&&(Ri(e,i,o,a),Vd(e,i,o)),o}function Ph(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 y5(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Sy(e,t){y5(e,t),(e=e.alternate)&&y5(e,t)}function Ix(){return null}var Xw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ey(e){this._internalRoot=e}ip.prototype.render=Ey.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Ce(409));np(e,t,null,null)};ip.prototype.unmount=Ey.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wl(function(){np(null,e,null,null)}),t[Ra]=null}};function ip(e){this._internalRoot=e}ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=P6();e={blockedOn:null,target:e,priority:t};for(var r=0;r<co.length&&t!==0&&t<co[r].priority;r++);co.splice(r,0,e),r===0&&T6(e)}};function Oy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ap(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function b5(){}function Dx(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var f=Ph(o);a.call(f)}}var o=Kw(t,n,e,0,null,!1,!1,"",b5);return e._reactRootContainer=o,e[Ra]=o.current,Rc(e.nodeType===8?e.parentNode:e),wl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var f=Ph(u);l.call(f)}}var u=wy(e,0,!1,null,null,!1,!1,"",b5);return e._reactRootContainer=u,e[Ra]=u.current,Rc(e.nodeType===8?e.parentNode:e),wl(function(){np(t,u,r,n)}),u}function op(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=Ph(o);l.call(u)}}np(t,o,e,i)}else o=Dx(r,t,e,i,n);return Ph(o)}O6=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=oc(t.pendingLanes);r!==0&&(Gm(t,r|1),Tn(t,pr()),!(Ot&6)&&(Ks=pr()+500,Io()))}break;case 13:wl(function(){var n=La(e,1);if(n!==null){var i=fn();Ri(n,e,1,i)}}),Sy(e,1)}};$m=function(e){if(e.tag===13){var t=La(e,134217728);if(t!==null){var r=fn();Ri(t,e,134217728,r)}Sy(e,134217728)}};x6=function(e){if(e.tag===13){var t=Eo(e),r=La(e,t);if(r!==null){var n=fn();Ri(r,e,t,n)}Sy(e,t)}};P6=function(){return Lt};C6=function(e,t){var r=Lt;try{return Lt=e,t()}finally{Lt=r}};Cv=function(e,t,r){switch(t){case"input":if(_v(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=Xh(n);if(!i)throw Error(Ce(90));i6(n),_v(n,i)}}}break;case"textarea":o6(e,r);break;case"select":t=r.value,t!=null&&Ds(e,!!r.multiple,t,!1)}};h6=my;p6=wl;var Fx={usingClientEntryPoint:!1,Events:[ef,Ps,Xh,f6,d6,my]},Ju={findFiberByHostInstance:ul,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},jx={bundleType:Ju.bundleType,version:Ju.version,rendererPackageName:Ju.rendererPackageName,rendererConfig:Ju.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Fa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=m6(e),e===null?null:e.stateNode},findFiberByHostInstance:Ju.findFiberByHostInstance||Ix,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Td=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Td.isDisabled&&Td.supportsFiber)try{qh=Td.inject(jx),na=Td}catch{}}Vn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Fx;Vn.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Oy(t))throw Error(Ce(200));return Nx(e,t,null,r)};Vn.createRoot=function(e,t){if(!Oy(e))throw Error(Ce(299));var r=!1,n="",i=Xw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=wy(e,1,!1,null,null,r,!1,n,i),e[Ra]=t.current,Rc(e.nodeType===8?e.parentNode:e),new Ey(t)};Vn.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=m6(t),e=e===null?null:e.stateNode,e};Vn.flushSync=function(e){return wl(e)};Vn.hydrate=function(e,t,r){if(!ap(t))throw Error(Ce(200));return op(null,e,t,!0,r)};Vn.hydrateRoot=function(e,t,r){if(!Oy(e))throw Error(Ce(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",o=Xw;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=Kw(t,null,e,1,r??null,i,!1,a,o),e[Ra]=t.current,Rc(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 ip(t)};Vn.render=function(e,t,r){if(!ap(t))throw Error(Ce(200));return op(null,e,t,!1,r)};Vn.unmountComponentAtNode=function(e){if(!ap(e))throw Error(Ce(40));return e._reactRootContainer?(wl(function(){op(null,null,e,!1,function(){e._reactRootContainer=null,e[Ra]=null})}),!0):!1};Vn.unstable_batchedUpdates=my;Vn.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!ap(r))throw Error(Ce(200));if(e==null||e._reactInternals===void 0)throw Error(Ce(38));return op(e,t,r,!1,n)};Vn.version="18.2.0-next-9e3b772b8-20220608";function Zw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Zw)}catch(e){console.error(e)}}Zw(),K_.exports=Vn;var Qw=K_.exports,_5=Qw;rh.createRoot=_5.createRoot,rh.hydrateRoot=_5.hydrateRoot;var Jw={};function at(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 zx={};function xy(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:zx}var e8=Object.assign,Ch=Object.getOwnPropertyDescriptor,aa=Object.defineProperty,rf=Object.prototype,om=[];Object.freeze(om);var Py={};Object.freeze(Py);var Bx=typeof Proxy<"u",Ux=Object.toString();function t8(){Bx||at("Proxy not available")}function r8(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var Ms=function(){};function $n(e){return typeof e=="function"}function Sl(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function lp(e){return e!==null&&typeof e=="object"}function Na(e){if(!lp(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()===Ux}function n8(e){var t=e==null?void 0:e.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function nf(e,t,r){aa(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function i8(e,t,r){aa(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function Do(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return lp(n)&&n[r]===!0}}function pu(e){return e instanceof Map}function af(e){return e instanceof Set}var a8=typeof Object.getOwnPropertySymbols<"u";function Hx(e){var t=Object.keys(e);if(!a8)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return rf.propertyIsEnumerable.call(e,n)})):t}var Xs=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:a8?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function o8(e){return e===null?null:typeof e=="object"?""+e:e}function Pa(e,t){return rf.hasOwnProperty.call(e,t)}var Gx=Object.getOwnPropertyDescriptors||function(t){var r={};return Xs(t).forEach(function(n){r[n]=Ch(t,n)}),r};function w5(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,qx(n.key),n)}}function Cy(e,t,r){return t&&w5(e.prototype,t),r&&w5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ao(){return Ao=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},Ao.apply(this,arguments)}function l8(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,lm(e,t)}function lm(e,t){return lm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},lm(e,t)}function K1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $x(e,t){if(e){if(typeof e=="string")return S5(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 S5(e,t)}}function S5(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 Ns(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=$x(e))||t&&e&&typeof e.length=="number"){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 Vx(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||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qx(e){var t=Vx(e,"string");return typeof t=="symbol"?t:String(t)}var ra=Symbol("mobx-stored-annotations");function Li(e){function t(r,n){if(of(n))return e.decorate_20223_(r,n);gu(r,n,e)}return Object.assign(t,e)}function gu(e,t,r){Pa(e,ra)||nf(e,ra,Ao({},e[ra])),tP(r)||(e[ra][t]=r)}function Wx(e){return Pa(e,ra)||nf(e,ra,Ao({},e[ra])),e[ra]}function of(e){return typeof e=="object"&&typeof e.kind=="string"}var Ke=Symbol("mobx administration"),lf=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 T8(this)},t.reportChanged=function(){On(),A8(this),xn()},t.toString=function(){return this.name_},e}(),Ty=Do("Atom",lf);function Bc(e,t,r){t===void 0&&(t=Ms),r===void 0&&(r=Ms);var n=new lf(e);return t!==Ms&&j8(n,t),r!==Ms&&Ny(n,r),n}function Yx(e,t){return e===t}function Kx(e,t){return $y(e,t)}function Xx(e,t){return $y(e,t,1)}function Zx(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var El={identity:Yx,structural:Kx,default:Zx,shallow:Xx};function Ol(e,t,r){return gp(e)?e:Array.isArray(e)?Ft.array(e,{name:r}):Na(e)?Ft.object(e,void 0,{name:r}):pu(e)?Ft.map(e,{name:r}):af(e)?Ft.set(e,{name:r}):typeof e=="function"&&!uf(e)&&!tu(e)?n8(e)?Pl(e):Js(r,e):e}function Qx(e,t,r){if(e==null||Fr(e)||gn(e)||Wr(e)||dn(e))return e;if(Array.isArray(e))return Ft.array(e,{name:r,deep:!1});if(Na(e))return Ft.object(e,void 0,{name:r,deep:!1});if(pu(e))return Ft.map(e,{name:r,deep:!1});if(af(e))return Ft.set(e,{name:r,deep:!1})}function sp(e){return e}function Jx(e,t){return $y(e,t)?t:e}var s8="override",eP=Li({annotationType_:s8,make_:rP,extend_:nP,decorate_20223_:iP});function tP(e){return e.annotationType_===s8}function rP(e,t){return 0}function nP(e,t,r,n){at("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function iP(e,t){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function sf(e,t){return{annotationType_:e,options_:t,make_:aP,extend_:oP,decorate_20223_:lP}}function aP(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(uf(r.value))return 1;var a=u8(e,this,t,r,!1);return aa(n,t,a),2}function oP(e,t,r,n){var i=u8(e,this,t,r);return e.defineProperty_(t,i,n)}function lP(e,t){var r=t.kind,n=t.name,i=t.addInitializer,a=this,o=function(f){var p,S,w,g;return ko((p=(S=a.options_)==null?void 0:S.name)!=null?p:n.toString(),f,(w=(g=a.options_)==null?void 0:g.autoAction)!=null?w:!1)};if(r=="field"){i(function(){gu(this,n,a)});return}if(r=="method"){var l;return uf(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}at("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
34
+ '`+a.annotationType_+"' can only be used on properties with a function value."))}function sP(e,t,r,n){t.annotationType_,n.value}function u8(e,t,r,n,i){var a,o,l,u,f,p,S;i===void 0&&(i=Re.safeDescriptors),sP(e,t,r,n);var w=n.value;if((a=t.options_)!=null&&a.bound){var g;w=w.bind((g=e.proxy_)!=null?g:e.target_)}return{value:ko((o=(l=t.options_)==null?void 0:l.name)!=null?o:r.toString(),w,(u=(f=t.options_)==null?void 0:f.autoAction)!=null?u:!1,(p=t.options_)!=null&&p.bound?(S=e.proxy_)!=null?S:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function c8(e,t){return{annotationType_:e,options_:t,make_:uP,extend_:cP,decorate_20223_:fP}}function uP(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&&(!Pa(e.target_,t)||!tu(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(tu(r.value))return 1;var a=f8(e,this,t,r,!1,!1);return aa(n,t,a),2}function cP(e,t,r,n){var i,a=f8(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,n)}function fP(e,t){var r,n=t.name,i=t.addInitializer;return tu(e)||(e=Pl(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 dP(e,t,r,n){t.annotationType_,n.value}function f8(e,t,r,n,i,a){a===void 0&&(a=Re.safeDescriptors),dP(e,t,r,n);var o=n.value;if(tu(o)||(o=Pl(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 Ay(e,t){return{annotationType_:e,options_:t,make_:hP,extend_:pP,decorate_20223_:gP}}function hP(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function pP(e,t,r,n){return vP(e,this,t,r),e.defineComputedProperty_(t,Ao({},this.options_,{get:r.get,set:r.set}),n)}function gP(e,t){var r=this,n=t.name,i=t.addInitializer;return i(function(){var a=Ml(this)[Ke],o=Ao({},r.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new Zs(o))}),function(){return this[Ke].getObservablePropValue_(n)}}function vP(e,t,r,n){t.annotationType_,n.get}function up(e,t){return{annotationType_:e,options_:t,make_:mP,extend_:yP,decorate_20223_:bP}}function mP(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function yP(e,t,r,n){var i,a;return _P(e,this),e.defineObservableProperty_(t,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:Ol,n)}function bP(e,t){var r=this,n=t.kind,i=t.name,a=new WeakSet;function o(l,u){var f,p,S=Ml(l)[Ke],w=new xo(u,(f=(p=r.options_)==null?void 0:p.enhancer)!=null?f:Ol,"ObservableObject."+i.toString(),!1);S.values_.set(i,w),a.add(l)}if(n=="accessor")return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[Ke].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[Ke].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function _P(e,t,r,n){t.annotationType_}var wP="true",SP=d8();function d8(e){return{annotationType_:wP,options_:e,make_:EP,extend_:OP,decorate_20223_:xP}}function EP(e,t,r,n){var i,a;if(r.get)return Rl.make_(e,t,r,n);if(r.set){var o=ko(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:Re.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(aa(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var l;if(n8(r.value)){var u,f=(u=this.options_)!=null&&u.autoBind?Pl.bound:Pl;return f.make_(e,t,r,n)}var p=(l=this.options_)!=null&&l.autoBind?Js.bound:Js;return p.make_(e,t,r,n)}var S=((i=this.options_)==null?void 0:i.deep)===!1?Ft.ref:Ft;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var w;r.value=r.value.bind((w=e.proxy_)!=null?w:e.target_)}return S.make_(e,t,r,n)}function OP(e,t,r,n){var i,a;if(r.get)return Rl.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:Re.safeDescriptors?e.isPlainObject_:!0,set:ko(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 xP(e,t){at("'"+this.annotationType_+"' cannot be used as a decorator")}var PP="observable",CP="observable.ref",TP="observable.shallow",AP="observable.struct",h8={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(h8);function Ad(e){return e||h8}var sm=up(PP),kP=up(CP,{enhancer:sp}),RP=up(TP,{enhancer:Qx}),LP=up(AP,{enhancer:Jx}),p8=Li(sm);function kd(e){return e.deep===!0?Ol:e.deep===!1?sp:NP(e.defaultDecorator)}function MP(e){var t;return e?(t=e.defaultDecorator)!=null?t:d8(e):void 0}function NP(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:Ol}function g8(e,t,r){if(of(t))return sm.decorate_20223_(e,t);if(Sl(t)){gu(e,t,sm);return}return gp(e)?e:Na(e)?Ft.object(e,t,r):Array.isArray(e)?Ft.array(e,t):pu(e)?Ft.map(e,t):af(e)?Ft.set(e,t):typeof e=="object"&&e!==null?e:Ft.box(e,t)}e8(g8,p8);var IP={box:function(t,r){var n=Ad(r);return new xo(t,kd(n),n.name,!0,n.equals)},array:function(t,r){var n=Ad(r);return(Re.useProxies===!1||n.proxy===!1?UC:RC)(t,kd(n),n.name)},map:function(t,r){var n=Ad(r);return new mp(t,kd(n),n.name)},set:function(t,r){var n=Ad(r);return new Hy(t,kd(n),n.name)},object:function(t,r,n){return Fo(function(){return Iy(Re.useProxies===!1||(n==null?void 0:n.proxy)===!1?Ml({},n):CC({},n),t,r)})},ref:Li(kP),shallow:Li(RP),deep:p8,struct:Li(LP)},Ft=e8(g8,IP),v8="computed",DP="computed.struct",um=Ay(v8),FP=Ay(DP,{equals:El.structural}),Rl=function(t,r){if(of(r))return um.decorate_20223_(t,r);if(Sl(r))return gu(t,r,um);if(Na(t))return Li(Ay(v8,t));var n=Na(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new Zs(n)};Object.assign(Rl,um);Rl.struct=Li(FP);var E5,O5,Th=0,jP=1,zP=(E5=(O5=Ch(function(){},"name"))==null?void 0:O5.configurable)!=null?E5:!1,x5={value:"action",configurable:!0,writable:!1,enumerable:!1};function ko(e,t,r,n){r===void 0&&(r=!1);function i(){return m8(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},zP&&(x5.value=e,aa(i,"name",x5)),i}function m8(e,t,r,n,i){var a=y8(e,t);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{b8(a)}}function y8(e,t,r,n){var i=!1,a=0,o=Re.trackingDerivation,l=!t||!o;On();var u=Re.allowStateChanges;l&&(Ll(),u=cp(!0));var f=dp(!0),p={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:f,notifySpy_:i,startTime_:a,actionId_:jP++,parentActionId_:Th};return Th=p.actionId_,p}function b8(e){Th!==e.actionId_&&at(30),Th=e.parentActionId_,e.error_!==void 0&&(Re.suppressReactionErrors=!0),fp(e.prevAllowStateChanges_),Hs(e.prevAllowStateReads_),xn(),e.runAsAction_&&Ca(e.prevDerivation_),Re.suppressReactionErrors=!1}function ky(e,t){var r=cp(e);try{return t()}finally{fp(r)}}function cp(e){var t=Re.allowStateChanges;return Re.allowStateChanges=e,t}function fp(e){Re.allowStateChanges=e}var _8;_8=Symbol.toPrimitive;var xo=function(e){l8(t,e);function t(n,i,a,o,l){var u;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=El.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!==Re.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(si(this)){var a=ui(this,{object:this,type:oa,newValue:i});if(!a)return Re.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Re.UNCHANGED:i},r.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),Mi(this)&&Ni(this,{type:oa,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return cf(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:oa,newValue:this.value_,oldValue:void 0}),ff(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 o8(this.get())},r[_8]=function(){return this.valueOf()},t}(lf),Ry=Do("ObservableValue",xo),w8;w8=Symbol.toPrimitive;var Zs=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 kh(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_=Ah.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||at(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=ko("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?El.structural:El.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){KP(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_&&at(32,this.name_,this.derivation),Re.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)cm(this)&&(this.warnAboutUntrackedRead_(),On(),this.value_=this.computeValue_(!1),xn());else if(T8(this),cm(this)){var n=Re.trackingContext;this.keepAlive_&&!n&&(Re.trackingContext=this),this.trackAndCompute()&&YP(this),Re.trackingContext=n}var i=this.value_;if(Qd(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter_&&at(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter_=!1}}else at(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===Tt.NOT_TRACKING_,a=this.computeValue_(!0),o=i||Qd(n)||Qd(a)||!this.equals_(n,a);return o&&(this.value_=a),o},t.computeValue_=function(n){this.isComputing_=!0;var i=cp(!1),a;if(n)a=S8(this,this.derivation,this.scope_);else if(Re.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new kh(o)}return fp(i),this.isComputing_=!1,a},t.suspend_=function(){this.keepAlive_||(fm(this),this.value_=void 0)},t.observe_=function(n,i){var a=this,o=!0,l=void 0;return My(function(){var u=a.get();if(!o||i){var f=Ll();n({observableKind:"computed",debugObjectName:a.name_,type:oa,object:a,newValue:u,oldValue:l}),Ca(f)}o=!1,l=u})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return o8(this.get())},t[w8]=function(){return this.valueOf()},e}(),xl=Do("ComputedValue",Zs),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 Ah;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(Ah||(Ah={}));var kh=function(t){this.cause=void 0,this.cause=t};function Qd(e){return e instanceof kh}function cm(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=dp(!0),r=Ll(),n=e.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if(xl(o)){if(Re.disableErrorBoundaries)o.get();else try{o.get()}catch{return Ca(r),Hs(t),!0}if(e.dependenciesState_===Tt.STALE_)return Ca(r),Hs(t),!0}}return E8(e),Ca(r),Hs(t),!1}}}function BP(){return Re.trackingDerivation!==null}function S8(e,t,r){var n=dp(!0);E8(e),e.newObserving_=new Array(e.observing_.length+100),e.unboundDepsCount_=0,e.runId_=++Re.runId;var i=Re.trackingDerivation;Re.trackingDerivation=e,Re.inBatch++;var a;if(Re.disableErrorBoundaries===!0)a=t.call(r);else try{a=t.call(r)}catch(o){a=new kh(o)}return Re.inBatch--,Re.trackingDerivation=i,UP(e),Hs(n),a}function UP(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&&P8(u,e),u.diffValue_=0}for(;i--;){var f=r[i];f.diffValue_===1&&(f.diffValue_=0,WP(f,e))}n!==Tt.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function fm(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)P8(t[r],e);e.dependenciesState_=Tt.NOT_TRACKING_}function Ly(e){var t=Ll();try{return e()}finally{Ca(t)}}function Ll(){var e=Re.trackingDerivation;return Re.trackingDerivation=null,e}function Ca(e){Re.trackingDerivation=e}function dp(e){var t=Re.allowStateReads;return Re.allowStateReads=e,t}function Hs(e){Re.allowStateReads=e}function E8(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 HP=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],bc=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},Jd=!0,O8=!1,Re=function(){var e=xy();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Jd=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new bc().version&&(Jd=!1),Jd?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new bc):(setTimeout(function(){O8||at(35)},1),new bc)}();function GP(){if((Re.pendingReactions.length||Re.inBatch||Re.isRunningReactions)&&at(36),O8=!0,Jd){var e=xy();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Re=new bc}}function x8(){return Re}function $P(){var e=new bc;for(var t in e)HP.indexOf(t)===-1&&(Re[t]=e[t]);Re.allowStateChanges=!Re.enforceActions}function VP(e){return e.observers_&&e.observers_.size>0}function qP(e){return e.observers_}function WP(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function P8(e,t){e.observers_.delete(t),e.observers_.size===0&&C8(e)}function C8(e){e.isPendingUnobservation_===!1&&(e.isPendingUnobservation_=!0,Re.pendingUnobservations.push(e))}function On(){Re.inBatch++}function xn(){if(--Re.inBatch===0){k8();for(var e=Re.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 Zs&&r.suspend_())}Re.pendingUnobservations=[]}}function T8(e){var t=Re.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved_&&Re.trackingContext&&(e.isBeingObserved_=!0,e.onBO())),e.isBeingObserved_):(e.observers_.size===0&&Re.inBatch>0&&C8(e),!1)}function A8(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 YP(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 KP(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 Qs=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_=Ah.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,Re.pendingReactions.push(this),k8())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){On(),this.isScheduled_=!1;var n=Re.trackingContext;if(Re.trackingContext=this,cm(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Re.trackingContext=n,xn()}},t.track=function(n){if(!this.isDisposed_){On(),this.isRunning_=!0;var i=Re.trackingContext;Re.trackingContext=this;var a=S8(this,n,void 0);Re.trackingContext=i,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&fm(this),Qd(a)&&this.reportExceptionInDerivation_(a.cause),xn()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Re.disableErrorBoundaries)throw n;var a="[mobx] uncaught error in '"+this+"'";Re.suppressReactionErrors||console.error(a,n),Re.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(On(),fm(this),xn()))},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[Ke]=this,a},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){},e}();function XP(e){return Re.globalReactionErrorHandlers.push(e),function(){var t=Re.globalReactionErrorHandlers.indexOf(e);t>=0&&Re.globalReactionErrorHandlers.splice(t,1)}}var ZP=100,dm=function(t){return t()};function k8(){Re.inBatch>0||Re.isRunningReactions||dm(QP)}function QP(){Re.isRunningReactions=!0;for(var e=Re.pendingReactions,t=0;e.length>0;){++t===ZP&&(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_()}Re.isRunningReactions=!1}var Rh=Do("Reaction",Qs);function JP(e){var t=dm;dm=function(n){return e(function(){return t(n)})}}function _c(){return!1}function R8(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var L8="action",eC="action.bound",M8="autoAction",tC="autoAction.bound",N8="<unnamed action>",hm=sf(L8),rC=sf(eC,{bound:!0}),pm=sf(M8,{autoAction:!0}),nC=sf(tC,{autoAction:!0,bound:!0});function I8(e){var t=function(n,i){if($n(n))return ko(n.name||N8,n,e);if($n(i))return ko(n,i,e);if(of(i))return(e?pm:hm).decorate_20223_(n,i);if(Sl(i))return gu(n,i,e?pm:hm);if(Sl(n))return Li(sf(e?M8:L8,{name:n,autoAction:e}))};return t}var wr=I8(!1);Object.assign(wr,hm);var Js=I8(!0);Object.assign(Js,pm);wr.bound=Li(rC);Js.bound=Li(nC);function eu(e){return m8(e.name||N8,!1,e,this,void 0)}function uf(e){return $n(e)&&e.isMobxAction===!0}function My(e,t){var r,n,i,a,o;t===void 0&&(t=Py);var l=(r=(n=t)==null?void 0:n.name)!=null?r:"Autorun",u=!t.scheduler&&!t.delay,f;if(u)f=new Qs(l,function(){this.track(w)},t.onError,t.requiresObservable);else{var p=D8(t),S=!1;f=new Qs(l,function(){S||(S=!0,p(function(){S=!1,f.isDisposed_||f.track(w)}))},t.onError,t.requiresObservable)}function w(){e(f)}return(i=t)!=null&&(a=i.signal)!=null&&a.aborted||f.schedule_(),f.getDisposer_((o=t)==null?void 0:o.signal)}var iC=function(t){return t()};function D8(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:iC}function F8(e,t,r){var n,i,a,o;r===void 0&&(r=Py);var l=(n=r.name)!=null?n:"Reaction",u=wr(l,r.onError?aC(r.onError,t):t),f=!r.scheduler&&!r.delay,p=D8(r),S=!0,w=!1,g,E,m=r.compareStructural?El.structural:r.equals||El.default,v=new Qs(l,function(){S||f?y():w||(w=!0,p(y))},r.onError,r.requiresObservable);function y(){if(w=!1,!v.isDisposed_){var h=!1;v.track(function(){var d=ky(!1,function(){return e(v)});h=S||!m(g,d),E=g,g=d}),(S&&r.fireImmediately||!S&&h)&&u(g,E,v),S=!1}}return(i=r)!=null&&(a=i.signal)!=null&&a.aborted||v.schedule_(),v.getDisposer_((o=r)==null?void 0:o.signal)}function aC(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var oC="onBO",lC="onBUO";function j8(e,t,r){return z8(oC,e,t,r)}function Ny(e,t,r){return z8(lC,e,t,r)}function z8(e,t,r,n){var i=typeof n=="function"?la(t,r):la(t),a=$n(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 sC="never",Rd="always",uC="observed";function B8(e){e.isolateGlobalState===!0&&GP();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(Re.useProxies=t===Rd?!0:t===sC?!1:typeof Proxy<"u"),t==="ifavailable"&&(Re.verifyProxies=!0),r!==void 0){var n=r===Rd?Rd:r===uC;Re.enforceActions=n,Re.allowStateChanges=!(n===!0||n===Rd)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(Re[i]=!!e[i])}),Re.allowStateReads=!Re.observableRequiresReaction,e.reactionScheduler&&JP(e.reactionScheduler)}function Iy(e,t,r,n){var i=Gx(t);return Fo(function(){var a=Ml(e,n)[Ke];Xs(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function U8(e,t){return H8(la(e,t))}function H8(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=fC(e.observing_).map(H8)),t}function cC(e,t){return G8(la(e,t))}function G8(e){var t={name:e.name_};return VP(e)&&(t.observers=Array.from(qP(e)).map(G8)),t}function fC(e){return Array.from(new Set(e))}var dC=0;function hp(){this.message="FLOW_CANCELLED"}hp.prototype=Object.create(Error.prototype);function hC(e){return e instanceof hp}var X1=c8("flow"),pC=c8("flow.bound",{bound:!0}),Pl=Object.assign(function(t,r){if(of(r))return X1.decorate_20223_(t,r);if(Sl(r))return gu(t,r,X1);var n=t,i=n.name||"<unnamed flow>",a=function(){var l=this,u=arguments,f=++dC,p=wr(i+" - runid: "+f+" - init",n).apply(l,u),S,w=void 0,g=new Promise(function(E,m){var v=0;S=m;function y(b){w=void 0;var O;try{O=wr(i+" - runid: "+f+" - yield "+v++,p.next).call(p,b)}catch(x){return m(x)}d(O)}function h(b){w=void 0;var O;try{O=wr(i+" - runid: "+f+" - yield "+v++,p.throw).call(p,b)}catch(x){return m(x)}d(O)}function d(b){if($n(b==null?void 0:b.then)){b.then(d,m);return}return b.done?E(b.value):(w=Promise.resolve(b.value),w.then(y,h))}y(void 0)});return g.cancel=wr(i+" - runid: "+f+" - cancel",function(){try{w&&P5(w);var E=p.return(void 0),m=Promise.resolve(E.value);m.then(Ms,Ms),P5(m),S(new hp)}catch(v){S(v)}}),g};return a.isMobXFlow=!0,a},X1);Pl.bound=Li(pC);function P5(e){$n(e.cancel)&&e.cancel()}function gC(e){return e}function tu(e){return(e==null?void 0:e.isMobXFlow)===!0}function Dy(e,t,r){var n;return Wr(e)||gn(e)||Ry(e)?n=Fi(e):Fr(e)&&(n=Fi(e,t)),n.dehancer=typeof t=="function"?t:r,function(){n.dehancer=void 0}}function pp(e,t,r){return $n(r)?mC(e,t,r):vC(e,t)}function vC(e,t){return Fi(e).intercept_(t)}function mC(e,t,r){return Fi(e,t).intercept_(r)}function $8(e,t){if(t===void 0)return xl(e);if(Fr(e)===!1||!e[Ke].values_.has(t))return!1;var r=la(e,t);return xl(r)}function yC(e){return $8(e)}function V8(e,t){return $8(e,t)}function q8(e,t){return e?t!==void 0?Fr(e)?e[Ke].values_.has(t):!1:Fr(e)||!!e[Ke]||Ty(e)||Rh(e)||xl(e):!1}function gp(e){return q8(e)}function W8(e,t){return q8(e,t)}function Uc(e){if(Fr(e))return e[Ke].keys_();if(Wr(e)||dn(e))return Array.from(e.keys());if(gn(e))return e.map(function(t,r){return r});at(5)}function Fy(e){if(Fr(e))return Uc(e).map(function(t){return e[t]});if(Wr(e))return Uc(e).map(function(t){return e.get(t)});if(dn(e))return Array.from(e.values());if(gn(e))return e.slice();at(6)}function Y8(e){if(Fr(e))return Uc(e).map(function(t){return[t,e[t]]});if(Wr(e))return Uc(e).map(function(t){return[t,e.get(t)]});if(dn(e))return Array.from(e.entries());if(gn(e))return e.map(function(t,r){return[r,t]});at(7)}function jy(e,t,r){if(arguments.length===2&&!dn(e)){On();var n=t;try{for(var i in n)jy(e,i,n[i])}finally{xn()}return}Fr(e)?e[Ke].set_(t,r):Wr(e)?e.set(t,r):dn(e)?e.add(t):gn(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&at("Invalid index: '"+t+"'"),On(),t>=e.length&&(e.length=t+1),e[t]=r,xn()):at(8)}function bC(e,t){Fr(e)?e[Ke].delete_(t):Wr(e)||dn(e)?e.delete(t):gn(e)?(typeof t!="number"&&(t=parseInt(t,10)),e.splice(t,1)):at(9)}function K8(e,t){if(Fr(e))return e[Ke].has_(t);if(Wr(e))return e.has(t);if(dn(e))return e.has(t);if(gn(e))return t>=0&&t<e.length;at(10)}function _C(e,t){if(K8(e,t)){if(Fr(e))return e[Ke].get_(t);if(Wr(e))return e.get(t);if(gn(e))return e[t];at(11)}}function zy(e,t,r){if(Fr(e))return e[Ke].defineProperty_(t,r);at(39)}function X8(e){if(Fr(e))return e[Ke].ownKeys_();at(38)}function vp(e,t,r,n){return $n(r)?SC(e,t,r,n):wC(e,t,r)}function wC(e,t,r){return Fi(e).observe_(t,r)}function SC(e,t,r,n){return Fi(e,t).observe_(r,n)}function Ld(e,t,r){return e.set(t,r),r}function _s(e,t){if(e==null||typeof e!="object"||e instanceof Date||!gp(e))return e;if(Ry(e)||xl(e))return _s(e.get(),t);if(t.has(e))return t.get(e);if(gn(e)){var r=Ld(t,e,new Array(e.length));return e.forEach(function(o,l){r[l]=_s(o,t)}),r}if(dn(e)){var n=Ld(t,e,new Set);return e.forEach(function(o){n.add(_s(o,t))}),n}if(Wr(e)){var i=Ld(t,e,new Map);return e.forEach(function(o,l){i.set(l,_s(o,t))}),i}else{var a=Ld(t,e,{});return X8(e).forEach(function(o){rf.propertyIsEnumerable.call(e,o)&&(a[o]=_s(e[o],t))}),a}}function EC(e,t){return _s(e,new Map)}function OC(){}function ea(e,t){t===void 0&&(t=void 0),On();try{return e.apply(t)}finally{xn()}}function gm(e,t,r){return arguments.length===1||t&&typeof t=="object"?xC(e,t):Z8(e,t,r||{})}function Z8(e,t,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[Ke].isDisposed_)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=ko("When-effect",t),o=My(function(l){var u=ky(!1,e);u&&(l.dispose(),n&&clearTimeout(n),a())},r);return o}function xC(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=Z8(e,o,Ao({},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 vs(e){return e[Ke]}var PC={has:function(t,r){return vs(t).has_(r)},get:function(t,r){return vs(t).get_(r)},set:function(t,r,n){var i;return Sl(r)?(i=vs(t).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(t,r){var n;return Sl(r)?(n=vs(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return(i=vs(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return vs(t).ownKeys_()},preventExtensions:function(t){at(13)}};function CC(e,t){var r,n;return t8(),e=Ml(e,t),(n=(r=e[Ke]).proxy_)!=null?n:r.proxy_=new Proxy(e,PC)}function si(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function cf(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),r8(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function ui(e,t){var r=Ll();try{for(var n=[].concat(e.interceptors_||[]),i=0,a=n.length;i<a&&(t=n[i](t),t&&!t.type&&at(14),!!t);i++);return t}finally{Ca(r)}}function Mi(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function ff(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),r8(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Ni(e,t){var r=Ll(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](t);Ca(r)}}function By(e,t,r){return Fo(function(){var n,i=Ml(e,r)[Ke];(n=t)!=null||(t=Wx(e)),Xs(t).forEach(function(a){return i.make_(a,t[a])})}),e}var Z1=Symbol("mobx-keys");function TC(e,t,r){return Na(e)?Iy(e,e,t,r):(Fo(function(){var n=Ml(e,r)[Ke];if(!e[Z1]){var i=Object.getPrototypeOf(e),a=new Set([].concat(Xs(e),Xs(i)));a.delete("constructor"),a.delete(Ke),nf(i,Z1,a)}e[Z1].forEach(function(o){return n.make_(o,t&&o in t?t[o]:!0)})}),e)}var C5="splice",oa="update",AC=1e4,kC={get:function(t,r){var n=t[Ke];return r===Ke?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):Pa(Lh,r)?Lh[r]:t[r]},set:function(t,r,n){var i=t[Ke];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){at(15)}},Uy=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 lf(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 cf(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}),ff(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&at("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_&&at(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&o9(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=om),si(this)){var u=ui(this,{object:this.proxy_,type:C5,index:n,removedCount:i,added:a});if(!u)return om;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(S){return o.enhancer_(S,void 0)}),this.legacyMode_){var f=a.length-i;this.updateArrayLength_(l,f)}var p=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,p),this.dehanceValues_(p)},t.spliceItemsIntoValues_=function(n,i,a){if(a.length<AC){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 p=0;p<u.length;p++)this.values_[n+a.length+p]=u[p];return l}},t.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&_c(),l=Mi(this),u=l||o?{observableKind:"array",object:this.proxy_,type:oa,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&Ni(this,u)},t.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&_c(),l=Mi(this),u=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:C5,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&Ni(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&&at(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(si(this)){var l=ui(this,{type:oa,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),p=0;p<f.length-1;p++)f[p]=void 0;f[f.length-1]=i,this.spliceWithArray_(a.length,0,f)}},e}();function RC(e,t,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),t8(),Fo(function(){var i=new Uy(r,t,n,!1);i8(i.values_,Ke,i);var a=new Proxy(i.values_,kC);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var Lh={clear:function(){return this.splice(0)},replace:function(t){var r=this[Ke];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[Ke];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[Ke].spliceWithArray_(t,r,n)},push:function(){for(var t=this[Ke],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[Ke].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[Ke],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 Re.trackingDerivation&&at(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Re.trackingDerivation&&at(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[Ke],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};Ut("at",Wn);Ut("concat",Wn);Ut("flat",Wn);Ut("includes",Wn);Ut("indexOf",Wn);Ut("join",Wn);Ut("lastIndexOf",Wn);Ut("slice",Wn);Ut("toString",Wn);Ut("toLocaleString",Wn);Ut("toSorted",Wn);Ut("toSpliced",Wn);Ut("with",Wn);Ut("every",ji);Ut("filter",ji);Ut("find",ji);Ut("findIndex",ji);Ut("findLast",ji);Ut("findLastIndex",ji);Ut("flatMap",ji);Ut("forEach",ji);Ut("map",ji);Ut("some",ji);Ut("toReversed",ji);Ut("reduce",Q8);Ut("reduceRight",Q8);function Ut(e,t){typeof Array.prototype[e]=="function"&&(Lh[e]=t(e))}function Wn(e){return function(){var t=this[Ke];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function ji(e){return function(t,r){var n=this,i=this[Ke];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[e](function(o,l){return t.call(r,o,l,n)})}}function Q8(e){return function(){var t=this,r=this[Ke];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 LC=Do("ObservableArrayAdministration",Uy);function gn(e){return lp(e)&&LC(e[Ke])}var J8,e9,MC={},vo="add",Mh="delete";J8=Symbol.iterator;e9=Symbol.toStringTag;var mp=function(){function e(r,n,i){var a=this;n===void 0&&(n=Ol),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ke]=MC,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,$n(Map)||at(18),Fo(function(){a.keysAtom_=Bc("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(!Re.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var o=a=new xo(this.has_(n),sp,"ObservableMap.key?",!1);this.hasMap_.set(n,o),Ny(o,function(){return i.hasMap_.delete(n)})}return a.get()},t.set=function(n,i){var a=this.has_(n);if(si(this)){var o=ui(this,{type:a?oa:vo,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_,si(this)){var a=ui(this,{type:Mh,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=_c(),l=Mi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Mh,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return ea(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var p=i.data_.get(n);p.setNewValue_(void 0),i.data_.delete(n)}),l&&Ni(this,u),!0}return!1},t.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==Re.UNCHANGED){var o=_c(),l=Mi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:oa,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&Ni(this,u)}},t.addValue_=function(n,i){var a=this;this.keysAtom_,ea(function(){var f,p=new xo(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,p),i=p.value_,(f=a.hasMap_.get(n))==null||f.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=_c(),l=Mi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:vo,object:this,name:n,newValue:i}:null;l&&Ni(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 Hc({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 Hc({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:[u,n.get(u)]}}})},t[J8]=function(){return this.entries()},t.forEach=function(n,i){for(var a=Ns(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 Wr(n)&&(n=new Map(n)),ea(function(){Na(n)?Hx(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)}):pu(n)?(n.constructor!==Map&&at(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&at(20,n)}),this},t.clear=function(){var n=this;ea(function(){Ly(function(){for(var i=Ns(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.replace=function(n){var i=this;return ea(function(){for(var a=NC(n),o=new Map,l=!1,u=Ns(i.data_.keys()),f;!(f=u()).done;){var p=f.value;if(!a.has(p)){var S=i.delete(p);if(S)l=!0;else{var w=i.data_.get(p);o.set(p,w)}}}for(var g=Ns(a.entries()),E;!(E=g()).done;){var m=E.value,v=m[0],y=m[1],h=i.data_.has(v);if(i.set(v,y),i.data_.has(v)){var d=i.data_.get(v);o.set(v,d),h||(l=!0)}}if(!l)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var b=i.data_.keys(),O=o.keys(),x=b.next(),P=O.next();!x.done;){if(x.value!==P.value){i.keysAtom_.reportChanged();break}x=b.next(),P=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 ff(this,n)},t.intercept_=function(n){return cf(this,n)},Cy(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:e9,get:function(){return"Map"}}]),e}(),Wr=Do("ObservableMap",mp);function NC(e){if(pu(e)||Wr(e))return e;if(Array.isArray(e))return new Map(e);if(Na(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return at(21,e)}var t9,r9,IC={};t9=Symbol.iterator;r9=Symbol.toStringTag;var Hy=function(){function e(r,n,i){var a=this;n===void 0&&(n=Ol),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Ke]=IC,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,$n(Set)||at(22),this.enhancer_=function(o,l){return n(o,l,i)},Fo(function(){a.atom_=Bc(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;ea(function(){Ly(function(){for(var i=Ns(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.forEach=function(n,i){for(var a=Ns(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_,si(this)){var a=ui(this,{type:vo,object:this,newValue:n});if(!a)return this}if(!this.has(n)){ea(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,l=Mi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:vo,object:this,newValue:n}:null;l&&Ni(this,u)}return this},t.delete=function(n){var i=this;if(si(this)){var a=ui(this,{type:Mh,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,l=Mi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:Mh,object:this,oldValue:n}:null;return ea(function(){i.atom_.reportChanged(),i.data_.delete(n)}),l&&Ni(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 Hc({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 Hc({next:function(){return i<a.length?{value:n.dehanceValue_(a[i++]),done:!1}:{done:!0}}})},t.replace=function(n){var i=this;return dn(n)&&(n=new Set(n)),ea(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):af(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&at("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return ff(this,n)},t.intercept_=function(n){return cf(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[t9]=function(){return this.values()},Cy(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:r9,get:function(){return"Set"}}]),e}(),dn=Do("ObservableSet",Hy),T5=Object.create(null),A5="remove",n9=function(){function e(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=SP),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 lf("ObservableObject.keys"),this.isPlainObject_=Na(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 Zs)return a.set(i),!0;if(si(this)){var o=ui(this,{type:oa,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Re.UNCHANGED){var l=Mi(this),u=!1,f=l||u?{type:oa,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&Ni(this,f)}return!0},t.get_=function(n){return Re.trackingDerivation&&!Pa(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,a){return a===void 0&&(a=!1),Pa(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(!Re.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new xo(n in this.target_,sp,"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_[ra])!=null&&a[n])return;at(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==rf;){var l=Ch(o,n);if(l){var u=i.make_(this,n,l,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}R5(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&&R5(this,a,n),l},t.defineProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{On();var o=this.delete_(n);if(!o)return o;if(si(this)){var l=ui(this,{object:this.proxy_||this.target_,name:n,type:vo,newValue:i.value});if(!l)return null;var u=l.newValue;i.value!==u&&(i=Ao({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else aa(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{xn()}return!0},t.defineObservableProperty_=function(n,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{On();var l=this.delete_(n);if(!l)return l;if(si(this)){var u=ui(this,{object:this.proxy_||this.target_,name:n,type:vo,newValue:i});if(!u)return null;i=u.newValue}var f=k5(n),p={configurable:Re.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(o){if(!Reflect.defineProperty(this.target_,n,p))return!1}else aa(this.target_,n,p);var S=new xo(i,a,"ObservableObject.key",!1);this.values_.set(n,S),this.notifyPropertyAddition_(n,S.value_)}finally{xn()}return!0},t.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{On();var o=this.delete_(n);if(!o)return o;if(si(this)){var l=ui(this,{object:this.proxy_||this.target_,name:n,type:vo,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=k5(n),f={configurable:Re.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,n,f))return!1}else aa(this.target_,n,f);this.values_.set(n,new Zs(i)),this.notifyPropertyAddition_(n,void 0)}finally{xn()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!Pa(this.target_,n))return!0;if(si(this)){var a=ui(this,{object:this.proxy_||this.target_,name:n,type:A5});if(!a)return null}try{var o,l;On();var u=Mi(this),f=!1,p=this.values_.get(n),S=void 0;if(!p&&(u||f)){var w;S=(w=Ch(this.target_,n))==null?void 0:w.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(p&&(this.values_.delete(n),p instanceof xo&&(S=p.value_),A8(p)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(l=o.get(n))==null||l.set(n in this.target_),u||f){var g={type:A5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:S,name:n};u&&Ni(this,g)}}finally{xn()}return!0},t.observe_=function(n,i){return ff(this,n)},t.intercept_=function(n){return cf(this,n)},t.notifyPropertyAddition_=function(n,i){var a,o,l=Mi(this),u=!1;if(l||u){var f=l||u?{type:vo,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;l&&Ni(this,f)}(a=this.pendingKeys_)==null||(o=a.get(n))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Xs(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Ml(e,t){var r;if(Pa(e,Ke))return e;var n=(r=t==null?void 0:t.name)!=null?r:"ObservableObject",i=new n9(e,new Map,String(n),MP(t));return nf(e,Ke,i),e}var DC=Do("ObservableObjectAdministration",n9);function k5(e){return T5[e]||(T5[e]={get:function(){return this[Ke].getObservablePropValue_(e)},set:function(r){return this[Ke].setObservablePropValue_(e,r)}})}function Fr(e){return lp(e)?DC(e[Ke]):!1}function R5(e,t,r){var n;(n=e.target_[ra])==null||delete n[r]}var FC=a9(0),jC=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Q1=0,i9=function(){};function zC(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}zC(i9,Array.prototype);var Gy=function(e,t,r){l8(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,Fo(function(){var p=new Uy(l,o,u,!0);p.proxy_=K1(f),i8(K1(f),Ke,p),a&&a.length&&f.spliceWithArray(0,0,a),jC&&Object.defineProperty(K1(f),"0",FC)}),f}var i=n.prototype;return i.concat=function(){this[Ke].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 gn(f)?f.slice():f}))},i[r]=function(){var a=this,o=0;return Hc({next:function(){return o<a.length?{value:a[o++],done:!1}:{done:!0,value:void 0}}})},Cy(n,[{key:"length",get:function(){return this[Ke].getArrayLength_()},set:function(o){this[Ke].setArrayLength_(o)}},{key:t,get:function(){return"Array"}}]),n}(i9,Symbol.toStringTag,Symbol.iterator);Object.entries(Lh).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&nf(Gy.prototype,t,r)});function a9(e){return{enumerable:!1,configurable:!0,get:function(){return this[Ke].get_(e)},set:function(r){this[Ke].set_(e,r)}}}function BC(e){aa(Gy.prototype,""+e,a9(e))}function o9(e){if(e>Q1){for(var t=Q1;t<e+100;t++)BC(t);Q1=e}}o9(1e3);function UC(e,t,r){return new Gy(e,t,r)}function la(e,t){if(typeof e=="object"&&e!==null){if(gn(e))return t!==void 0&&at(23),e[Ke].atom_;if(dn(e))return e.atom_;if(Wr(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||at(25,t,Nh(e)),r}if(Fr(e)){if(!t)return at(26);var n=e[Ke].values_.get(t);return n||at(27,t,Nh(e)),n}if(Ty(e)||xl(e)||Rh(e))return e}else if($n(e)&&Rh(e[Ke]))return e[Ke];at(28)}function Fi(e,t){if(e||at(29),t!==void 0)return Fi(la(e,t));if(Ty(e)||xl(e)||Rh(e)||Wr(e)||dn(e))return e;if(e[Ke])return e[Ke];at(24,e)}function Nh(e,t){var r;if(t!==void 0)r=la(e,t);else{if(uf(e))return e.name;Fr(e)||Wr(e)||dn(e)?r=Fi(e):r=la(e)}return r.name_}function Fo(e){var t=Ll(),r=cp(!0);On();try{return e()}finally{xn(),fp(r),Ca(t)}}var L5=rf.toString;function $y(e,t,r){return r===void 0&&(r=-1),vm(e,t,r)}function vm(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=L5.call(e);if(o!==L5.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=M5(e),t=M5(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&&!($n(u)&&u instanceof u&&$n(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 p=n.length;p--;)if(n[p]===e)return i[p]===t;if(n.push(e),i.push(t),l){if(p=e.length,p!==t.length)return!1;for(;p--;)if(!vm(e[p],t[p],r-1,n,i))return!1}else{var S=Object.keys(e),w;if(p=S.length,Object.keys(t).length!==p)return!1;for(;p--;)if(w=S[p],!(Pa(t,w)&&vm(e[w],t[w],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function M5(e){return gn(e)?e.slice():pu(e)||Wr(e)||af(e)||dn(e)?Array.from(e.entries()):e}function Hc(e){return e[Symbol.iterator]=HC,e}function HC(){return this}["Symbol","Map","Set"].forEach(function(e){var t=xy();typeof t[e]>"u"&&at("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:R8,extras:{getDebugName:Nh},$mobx:Ke});const GC=Object.freeze(Object.defineProperty({__proto__:null,$mobx:Ke,FlowCancellationError:hp,ObservableMap:mp,ObservableSet:Hy,Reaction:Qs,_allowStateChanges:ky,_allowStateChangesInsideComputed:eu,_allowStateReadsEnd:Hs,_allowStateReadsStart:dp,_autoAction:Js,_endAction:b8,_getAdministration:Fi,_getGlobalState:x8,_interceptReads:Dy,_isComputingDerivation:BP,_resetGlobalState:$P,_startAction:y8,action:wr,autorun:My,comparer:El,computed:Rl,configure:B8,createAtom:Bc,defineProperty:zy,entries:Y8,extendObservable:Iy,flow:Pl,flowResult:gC,get:_C,getAtom:la,getDebugName:Nh,getDependencyTree:U8,getObserverTree:cC,has:K8,intercept:pp,isAction:uf,isBoxedObservable:Ry,isComputed:yC,isComputedProp:V8,isFlow:tu,isFlowCancellationError:hC,isObservable:gp,isObservableArray:gn,isObservableMap:Wr,isObservableObject:Fr,isObservableProp:W8,isObservableSet:dn,keys:Uc,makeAutoObservable:TC,makeObservable:By,observable:Ft,observe:vp,onBecomeObserved:j8,onBecomeUnobserved:Ny,onReactionError:XP,override:eP,ownKeys:X8,reaction:F8,remove:bC,runInAction:eu,set:jy,spy:R8,toJS:EC,trace:OC,transaction:ea,untracked:Ly,values:Fy,when:gm},Symbol.toStringTag,{value:"Module"}));if(!it.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!By)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function $C(e){e()}function l9(e){e||(e=$C),B8({reactionScheduler:e})}var VC=function(){return!0};function qC(e){return U8(e)}var s9=!1;function u9(e){s9=e}function Vy(){return s9}var WC=1e4,YC=1e4,KC=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=WC),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,YC))}}),e}(),XC=typeof FinalizationRegistry<"u"?FinalizationRegistry:KC,Ih=new XC(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),c9={exports:{}},f9={};/**
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 ru=it;function ZC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var QC=typeof Object.is=="function"?Object.is:ZC,JC=ru.useState,eT=ru.useEffect,tT=ru.useLayoutEffect,rT=ru.useDebugValue;function nT(e,t){var r=t(),n=JC({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return tT(function(){i.value=r,i.getSnapshot=t,J1(i)&&a({inst:i})},[e,r,t]),eT(function(){return J1(i)&&a({inst:i}),e(function(){J1(i)&&a({inst:i})})},[e]),rT(r),r}function J1(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!QC(e,r)}catch{return!0}}function iT(e,t){return t()}var aT=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?iT:nT;f9.useSyncExternalStore=ru.useSyncExternalStore!==void 0?ru.useSyncExternalStore:aT;c9.exports=f9;var oT=c9.exports;function N5(e){e.reaction=new Qs("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"),Vy())return e();var r=vt.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(l){return Ih.unregister(n),n.onStoreChange=l,n.reaction||(N5(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||(N5(i),Ih.register(r,i,i)),vt.useDebugValue(i.reaction,qC),oT.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 eg,tg,d9=typeof Symbol=="function"&&Symbol.for,lT=(tg=(eg=Object.getOwnPropertyDescriptor(function(){},"name"))===null||eg===void 0?void 0:eg.configurable)!==null&&tg!==void 0?tg:!1,I5=d9?Symbol.for("react.forward_ref"):typeof it.forwardRef=="function"&&it.forwardRef(function(e){return null}).$$typeof,D5=d9?Symbol.for("react.memo"):typeof it.memo=="function"&&it.memo(function(e){return null}).$$typeof;function sT(e,t){var r;if(D5&&e.$$typeof===D5)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(Vy())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(I5&&e.$$typeof===I5&&(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,lT&&Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),n&&(o=it.forwardRef(o)),o=it.memo(o),cT(e,o),o}var uT={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function cT(e,t){Object.keys(e).forEach(function(r){uT[r]||Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}function h9(e){var t=e.children,r=e.render,n=t||r;return typeof n!="function"?null:qy(n)}h9.displayName="Observer";function fT(e,t){return it.useState(function(){return Ft(e(),t,{autoBind:!0})})[0]}function p9(e){var t=it.useState(function(){return Ft(e,{},{deep:!1})})[0];return eu(function(){Object.assign(t,e)}),t}function dT(e,t){var r=t&&p9(t);return it.useState(function(){return Ft(e(r),void 0,{autoBind:!0})})[0]}var rg;l9(Qw.unstable_batchedUpdates);var hT=(rg=Ih.finalizeAllImmediately)!==null&&rg!==void 0?rg:function(){};function pT(e,t){return t===void 0&&(t="observed"),qy(e,t)}function gT(e){u9(e)}const vT=Object.freeze(Object.defineProperty({__proto__:null,Observer:h9,_observerFinalizationRegistry:Ih,clearTimers:hT,enableStaticRendering:u9,isObserverBatched:VC,isUsingStaticRendering:Vy,observer:sT,observerBatching:l9,useAsObservableSource:p9,useLocalObservable:fT,useLocalStore:dT,useObserver:pT,useStaticRendering:gT},Symbol.toStringTag,{value:"Module"})),zi=Lo(vT);var g9={};const ja=Lo(GC);var Wy={exports:{}},yp={},Dh={},ht={};(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 Se<"u"?Se:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.6",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,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)})(ht);var or={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=ht;class r{constructor(b=[1,0,0,1,0,0]){this.dirty=!1,this.m=b&&b.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(b){b.m[0]=this.m[0],b.m[1]=this.m[1],b.m[2]=this.m[2],b.m[3]=this.m[3],b.m[4]=this.m[4],b.m[5]=this.m[5]}point(b){var O=this.m;return{x:O[0]*b.x+O[2]*b.y+O[4],y:O[1]*b.x+O[3]*b.y+O[5]}}translate(b,O){return this.m[4]+=this.m[0]*b+this.m[2]*O,this.m[5]+=this.m[1]*b+this.m[3]*O,this}scale(b,O){return this.m[0]*=b,this.m[1]*=b,this.m[2]*=O,this.m[3]*=O,this}rotate(b){var O=Math.cos(b),x=Math.sin(b),P=this.m[0]*O+this.m[2]*x,_=this.m[1]*O+this.m[3]*x,A=this.m[0]*-x+this.m[2]*O,C=this.m[1]*-x+this.m[3]*O;return this.m[0]=P,this.m[1]=_,this.m[2]=A,this.m[3]=C,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(b,O){var x=this.m[0]+this.m[2]*O,P=this.m[1]+this.m[3]*O,_=this.m[2]+this.m[0]*b,A=this.m[3]+this.m[1]*b;return this.m[0]=x,this.m[1]=P,this.m[2]=_,this.m[3]=A,this}multiply(b){var O=this.m[0]*b.m[0]+this.m[2]*b.m[1],x=this.m[1]*b.m[0]+this.m[3]*b.m[1],P=this.m[0]*b.m[2]+this.m[2]*b.m[3],_=this.m[1]*b.m[2]+this.m[3]*b.m[3],A=this.m[0]*b.m[4]+this.m[2]*b.m[5]+this.m[4],C=this.m[1]*b.m[4]+this.m[3]*b.m[5]+this.m[5];return this.m[0]=O,this.m[1]=x,this.m[2]=P,this.m[3]=_,this.m[4]=A,this.m[5]=C,this}invert(){var b=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),O=this.m[3]*b,x=-this.m[1]*b,P=-this.m[2]*b,_=this.m[0]*b,A=b*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),C=b*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=O,this.m[1]=x,this.m[2]=P,this.m[3]=_,this.m[4]=A,this.m[5]=C,this}getMatrix(){return this.m}decompose(){var b=this.m[0],O=this.m[1],x=this.m[2],P=this.m[3],_=this.m[4],A=this.m[5],C=b*P-O*x;let k={x:_,y:A,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(b!=0||O!=0){var R=Math.sqrt(b*b+O*O);k.rotation=O>0?Math.acos(b/R):-Math.acos(b/R),k.scaleX=R,k.scaleY=C/R,k.skewX=(b*x+O*P)/C,k.skewY=0}else if(x!=0||P!=0){var D=Math.sqrt(x*x+P*P);k.rotation=Math.PI/2-(P>0?Math.acos(-x/D):-Math.acos(x/D)),k.scaleX=C/D,k.scaleY=D,k.skewX=0,k.skewY=(b*x+O*P)/C}return k.rotation=e.Util._getRotation(k.rotation),k}}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="#",p="",S="0",w="Konva warning: ",g="Konva error: ",E="rgb(",m={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]},v=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,y=[];const h=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 b=d[0];return b==="#"||b==="."||b===b.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){y.push(d),y.length===1&&h(function(){const b=y;y=[],b.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,b){var O=e.Util.createImageElement();O.onload=function(){b(O)},O.src=d},_rgbToHex(d,b,O){return((1<<24)+(d<<16)+(b<<8)+O).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,p);var b=parseInt(d,16);return{r:b>>16&255,g:b>>8&255,b:b&255}},getRandomColor(){for(var d=(Math.random()*16777215<<0).toString(16);d.length<6;)d=S+d;return f+d},getRGB(d){var b;return d in m?(b=m[d],{r:b[0],g:b[1],b:b[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===E?(b=v.exec(d.replace(/ /g,"")),{r:parseInt(b[1],10),g:parseInt(b[2],10),b:parseInt(b[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 b=m[d.toLowerCase()];return b?{r:b[0],g:b[1],b:b[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];var b=d.split(/ *, */).map(Number);return{r:b[0],g:b[1],b:b[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];var b=d.split(/ *, */).map((O,x)=>O.slice(-1)==="%"?x===3?parseInt(O)/100:parseInt(O)/100*255:Number(O));return{r:b[0],g:b[1],b:b[2],a:b[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[b,...O]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),x=Number(O[0])/360,P=Number(O[1])/100,_=Number(O[2])/100;let A,C,k;if(P===0)return k=_*255,{r:Math.round(k),g:Math.round(k),b:Math.round(k),a:1};_<.5?A=_*(1+P):A=_+P-_*P;const R=2*_-A,D=[0,0,0];for(let U=0;U<3;U++)C=x+1/3*-(U-1),C<0&&C++,C>1&&C--,6*C<1?k=R+(A-R)*6*C:2*C<1?k=A:3*C<2?k=R+(A-R)*(2/3-C)*6:k=R,D[U]=k*255;return{r:Math.round(D[0]),g:Math.round(D[1]),b:Math.round(D[2]),a:1}}},haveIntersection(d,b){return!(b.x>d.x+d.width||b.x+b.width<d.x||b.y>d.y+d.height||b.y+b.height<d.y)},cloneObject(d){var b={};for(var O in d)this._isPlainObject(d[O])?b[O]=this.cloneObject(d[O]):this._isArray(d[O])?b[O]=this.cloneArray(d[O]):b[O]=d[O];return b},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(g+d)},error(d){console.error(g+d)},warn(d){t.Konva.showWarnings&&console.warn(w+d)},each(d,b){for(var O in d)b(O,d[O])},_inRange(d,b,O){return b<=d&&d<O},_getProjectionToSegment(d,b,O,x,P,_){var A,C,k,R=(d-O)*(d-O)+(b-x)*(b-x);if(R==0)A=d,C=b,k=(P-O)*(P-O)+(_-x)*(_-x);else{var D=((P-d)*(O-d)+(_-b)*(x-b))/R;D<0?(A=d,C=b,k=(d-P)*(d-P)+(b-_)*(b-_)):D>1?(A=O,C=x,k=(O-P)*(O-P)+(x-_)*(x-_)):(A=d+D*(O-d),C=b+D*(x-b),k=(A-P)*(A-P)+(C-_)*(C-_))}return[A,C,k]},_getProjectionToLine(d,b,O){var x=e.Util.cloneObject(d),P=Number.MAX_VALUE;return b.forEach(function(_,A){if(!(!O&&A===b.length-1)){var C=b[(A+1)%b.length],k=e.Util._getProjectionToSegment(_.x,_.y,C.x,C.y,d.x,d.y),R=k[0],D=k[1],U=k[2];U<P&&(x.x=R,x.y=D,P=U)}}),x},_prepareArrayForTween(d,b,O){var x,P=[],_=[];if(d.length>b.length){var A=b;b=d,d=A}for(x=0;x<d.length;x+=2)P.push({x:d[x],y:d[x+1]});for(x=0;x<b.length;x+=2)_.push({x:b[x],y:b[x+1]});var C=[];return _.forEach(function(k){var R=e.Util._getProjectionToLine(k,P,O);C.push(R.x),C.push(R.y)}),C},_prepareToStringify(d){var b;d.visitedByCircularReferenceRemoval=!0;for(var O in d)if(d.hasOwnProperty(O)&&d[O]&&typeof d[O]=="object"){if(b=Object.getOwnPropertyDescriptor(d,O),d[O].visitedByCircularReferenceRemoval||e.Util._isElement(d[O]))if(b.configurable)delete d[O];else return null;else if(e.Util._prepareToStringify(d[O])===null)if(b.configurable)delete d[O];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,b){for(var O in b)d[O]=b[O];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){t.Konva.releaseCanvasOnDestroy&&d.forEach(b=>{b.width=0,b.height=0})},drawRoundedRectPath(d,b,O,x){let P=0,_=0,A=0,C=0;typeof x=="number"?P=_=A=C=Math.min(x,b/2,O/2):(P=Math.min(x[0]||0,b/2,O/2),_=Math.min(x[1]||0,b/2,O/2),C=Math.min(x[2]||0,b/2,O/2),A=Math.min(x[3]||0,b/2,O/2)),d.moveTo(P,0),d.lineTo(b-_,0),d.arc(b-_,_,_,Math.PI*3/2,0,!1),d.lineTo(b,O-C),d.arc(b-C,O-C,C,0,Math.PI/2,!1),d.lineTo(A,O),d.arc(A,O-A,A,Math.PI/2,Math.PI,!1),d.lineTo(0,P),d.arc(P,P,P,Math.PI,Math.PI*3/2,!1)}}})(or);var Qt={},pt={},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 za=ht,cr=or;function Ba(e){return cr.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||cr.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function mT(e){return e>255?255:e<0?0:Math.round(e)}Ye.RGBComponent=mT;function yT(e){return e>1?1:e<1e-4?1e-4:e}Ye.alphaComponent=yT;function bT(){if(za.Konva.isUnminified)return function(e,t){return cr.Util._isNumber(e)||cr.Util.warn(Ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}Ye.getNumberValidator=bT;function _T(e){if(za.Konva.isUnminified)return function(t,r){let n=cr.Util._isNumber(t),i=cr.Util._isArray(t)&&t.length==e;return!n&&!i&&cr.Util.warn(Ba(t)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+e+")"),t}}Ye.getNumberOrArrayOfNumbersValidator=_T;function wT(){if(za.Konva.isUnminified)return function(e,t){var r=cr.Util._isNumber(e),n=e==="auto";return r||n||cr.Util.warn(Ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}Ye.getNumberOrAutoValidator=wT;function ST(){if(za.Konva.isUnminified)return function(e,t){return cr.Util._isString(e)||cr.Util.warn(Ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}Ye.getStringValidator=ST;function ET(){if(za.Konva.isUnminified)return function(e,t){const r=cr.Util._isString(e),n=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return r||n||cr.Util.warn(Ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}Ye.getStringOrGradientValidator=ET;function OT(){if(za.Konva.isUnminified)return function(e,t){return cr.Util._isFunction(e)||cr.Util.warn(Ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}Ye.getFunctionValidator=OT;function xT(){if(za.Konva.isUnminified)return function(e,t){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&e instanceof r||(cr.Util._isArray(e)?e.forEach(function(n){cr.Util._isNumber(n)||cr.Util.warn('"'+t+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):cr.Util.warn(Ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}Ye.getNumberArrayValidator=xT;function PT(){if(za.Konva.isUnminified)return function(e,t){var r=e===!0||e===!1;return r||cr.Util.warn(Ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}Ye.getBooleanValidator=PT;function CT(e){if(za.Konva.isUnminified)return function(t,r){return t==null||cr.Util.isObject(t)||cr.Util.warn(Ba(t)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+e),t}}Ye.getComponentValidator=CT;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=or,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(p){return l&&p!==void 0&&p!==null&&(p=l.call(this,p,o)),this._setAttr(o,p),u&&u.call(this),this}},addComponentsGetterSetter(a,o,l,u,f){var p=l.length,S=t.Util._capitalize,w=n+S(o),g=i+S(o),E,m;a.prototype[w]=function(){var y={};for(E=0;E<p;E++)m=l[E],y[m]=this.getAttr(o+S(m));return y};var v=(0,r.getComponentValidator)(l);a.prototype[g]=function(y){var h=this.attrs[o],d;u&&(y=u.call(this,y)),v&&v.call(this,y,o);for(d in y)y.hasOwnProperty(d)&&this._setAttr(o+S(d),y[d]);return y||l.forEach(b=>{this._setAttr(o+S(b),void 0)}),this._fireChangeEvent(o,h,y),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),p=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[f]=function(){t.Util.error(p);var S=this.attrs[o];return S===void 0?l:S},e.Factory.addSetter(a,o,u,function(){t.Util.error(p)}),e.Factory.addOverloadedGetterSetter(a,o)},backCompat(a,o){t.Util.each(o,function(l,u){var f=a.prototype[u],p=n+t.Util._capitalize(l),S=i+t.Util._capitalize(l);function w(){f.apply(this,arguments),t.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}a.prototype[l]=w,a.prototype[p]=w,a.prototype[S]=w})},afterSetFilter(){this._filterUpToDate=!1}}})(pt);var Ii={},Ta={};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.HitContext=Ta.SceneContext=Ta.Context=void 0;const v9=or,TT=ht;function AT(e){var t=[],r=e.length,n=v9.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 F5=",",kT="(",RT=")",LT="([",MT="])",NT=";",IT="()",DT="=",j5=["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"],FT=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const jT=100;class bp{constructor(t){this.canvas=t,TT.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+=IT:v9.Util._isArray(f[0])?a+=LT+f.join(F5)+MT:(r&&(f=f.map(p=>typeof p=="number"?Math.floor(p):p)),a+=kT+f.join(F5)+RT)):(a+=l.property,t||(a+=DT+l.val)),a+=NT;return a}clearTrace(){this.traceArr=[]}_trace(t){var r=this.traceArr,n;r.push(t),n=r.length,n>=jT&&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 p=arguments,S=this._context;p.length===3?S.drawImage(t,r,n):p.length===5?S.drawImage(t,r,n,i,a):p.length===9&&S.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=j5.length,n=this.setAttr,i,a,o=function(l){var u=t[l],f;t[l]=function(){return a=AT(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(j5[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)}}Ta.Context=bp;FT.forEach(function(e){Object.defineProperty(bp.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class zT extends bp{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(),p=u.x*f,S=u.y*f;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(p),Math.abs(S))),this.setAttr("shadowOffsetX",l.x*p),this.setAttr("shadowOffsetY",l.y*S)}}Ta.SceneContext=zT;class BT extends bp{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()}}}Ta.HitContext=BT;Object.defineProperty(Ii,"__esModule",{value:!0});Ii.HitCanvas=Ii.SceneCanvas=Ii.Canvas=void 0;const Fh=or,m9=Ta,y9=ht,UT=pt,HT=Ye;var Md;function GT(){if(Md)return Md;var e=Fh.Util.createCanvasElement(),t=e.getContext("2d");return Md=function(){var r=y9.Konva._global.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return r/n}(),Fh.Util.releaseCanvas(e),Md}class _p{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var r=t||{},n=r.pixelRatio||y9.Konva.pixelRatio||GT();this.pixelRatio=n,this._canvas=Fh.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 Fh.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}Ii.Canvas=_p;UT.Factory.addGetterSetter(_p,"pixelRatio",void 0,(0,HT.getNumberValidator)());class $T extends _p{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new m9.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}Ii.SceneCanvas=$T;class VT extends _p{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new m9.HitContext(this),this.setSize(t.width,t.height)}}Ii.HitCanvas=VT;var wp={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=ht,r=or;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(w=>w.id===a.pointerId);if(f){if(a.dragStatus!=="dragging"){var p=l.dragDistance(),S=Math.max(Math.abs(f.x-a.startPointerPos.x),Math.abs(f.y-a.startPointerPos.y));if(S<p||(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(p=>p.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))})(wp);Object.defineProperty(Qt,"__esModule",{value:!0});Qt.Node=void 0;const yt=or,df=pt,ec=Ii,oo=ht,ai=wp,gr=Ye;var eh="absoluteOpacity",Nd="allEventListeners",_a="absoluteTransform",z5="absoluteScale",il="canvas",qT="Change",WT="children",YT="konva",mm="listening",B5="mouseenter",U5="mouseleave",H5="set",G5="Shape",th=" ",$5="stage",lo="transform",KT="Stage",ym="visible",XT=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(th);let ZT=1,ct=class bm{constructor(t){this._id=ZT++,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===lo||t===_a)&&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===lo||t===_a,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(th);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get(il)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===_a&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(il)){const{scene:t,filter:r,hit:n}=this._cache.get(il);yt.Util.releaseCanvas(t,r,n),this._cache.delete(il)}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,p=r.drawBorder||!1,S=r.hitCanvasPixelRatio||1;if(!i||!a){yt.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const w=Math.abs(Math.round(n.x)-l)>.5?1:0,g=Math.abs(Math.round(n.y)-u)>.5?1:0;i+=f*2+w,a+=f*2+g,l-=f,u-=f;var E=new ec.SceneCanvas({pixelRatio:o,width:i,height:a}),m=new ec.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),v=new ec.HitCanvas({pixelRatio:S,width:i,height:a}),y=E.getContext(),h=v.getContext();return v.isCache=!0,E.isCache=!0,this._cache.delete(il),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(E.getContext()._context.imageSmoothingEnabled=!1,m.getContext()._context.imageSmoothingEnabled=!1),y.save(),h.save(),y.translate(-l,-u),h.translate(-l,-u),this._isUnderCache=!0,this._clearSelfAndDescendantCache(eh),this._clearSelfAndDescendantCache(z5),this.drawScene(E,this),this.drawHit(v,this),this._isUnderCache=!1,y.restore(),h.restore(),p&&(y.save(),y.beginPath(),y.rect(0,0,i,a),y.closePath(),y.setAttr("strokeStyle","red"),y.setAttr("lineWidth",5),y.stroke(),y.restore()),this._cache.set(il,{scene:E,filter:m,hit:v,x:l,y:u}),this._requestDraw(),this}isCached(){return this._cache.has(il)}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 p=u.point(f);i===void 0&&(i=o=p.x,a=l=p.y),i=Math.min(i,p.x),a=Math.min(a,p.y),o=Math.max(o,p.x),l=Math.max(l,p.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 p=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()/p,n.getHeight()/p),l=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++){if(f=t[u],typeof f!="function"){yt.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(S){yt.Util.error("Unable to apply filter. "+S.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(Nd),arguments.length===3)return this._delegate.apply(this,arguments);var n=t.split(th),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(th),i=n.length,a,o,l,u,f,p;if(this._cache&&this._cache.delete(Nd),!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],p=u[1],f)this.eventListeners[f]&&this._off(f,p,r);else for(o in this.eventListeners)this._off(o,p,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=yt.Util.cloneObject(a),a.currentTarget=o[l],n.call(o[l],a)})}remove(){return this.isDragging()&&this.stopDrag(),ai.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(_a),this._clearSelfAndDescendantCache(eh),this._clearSelfAndDescendantCache(z5),this._clearSelfAndDescendantCache($5),this._clearSelfAndDescendantCache(ym),this._clearSelfAndDescendantCache(mm)}_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"+yt.Util._capitalize(t);return yt.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!==WT&&(n=H5+yt.Util._capitalize(r),yt.Util._isFunction(this[n])?this[n](t[r]):this._setAttr(r,t[r]))}),this}isListening(){return this._getCache(mm,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(ym,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;ai.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(i=!0)});var a=!r&&!oo.Konva.hitOnDragEnabled&&(i||oo.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(p){for(i=[],a=p.length,o=0;o<a;o++)l=p[o],n++,l.nodeType!==G5&&(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!==KT&&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(lo),this._clearSelfAndDescendantCache(_a)),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 yt.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(lo);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(lo),this._clearSelfAndDescendantCache(_a),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 yt.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 yt.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 yt.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 yt.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 yt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&yt.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(eh,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=yt.Util.isObject(n)&&!yt.Util._isPlainObject(n)&&!yt.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 yt.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],yt.Util.isValidSelector(a)||(yt.Util.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),yt.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),yt.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($5,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(_a,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var r;if(t)return r=new yt.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(_a)||new yt.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(lo,this._getTransform)}_getTransform(){var t,r,n=this._cache.get(lo)||new yt.Transform;n.reset();var i=this.x(),a=this.y(),o=oo.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,p=this.attrs.skewY||0,S=this.attrs.offsetX||0,w=this.attrs.offsetY||0;return(i!==0||a!==0)&&n.translate(i,a),o!==0&&n.rotate(o),(f!==0||p!==0)&&n.skew(f,p),(l!==1||u!==1)&&n.scale(l,u),(S!==0||w!==0)&&n.translate(-1*S,-1*w),n.dirty=!1,n}clone(t){var r=yt.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(YT)<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 ec.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 ec.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,yt.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():oo.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+qT,{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[H5+yt.Util._capitalize(t)];return yt.Util._isFunction(n)?n.call(this,r):this._setAttr(t,r),this}_requestDraw(){if(oo.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,r){var n=this.attrs[t];n===r&&!yt.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===G5&&(r.target=this);var i=(t===B5||t===U5)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n);if(!i){this._fire(t,r);var a=(t===B5||t===U5)&&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(Nd))!==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(Nd,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;ai.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){ai.DD._dragElements.has(this._id)||this._createDragElement(t);const n=ai.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:yt.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=ai.DD._dragElements.get(this._id);r&&(r.dragStatus="stopped"),ai.DD._endDragBefore(t),ai.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=ai.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||oo.Konva.dragButtons.indexOf(t.evt.button)>=0;if(n&&!this.isDragging()){var i=!1;ai.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=ai.DD._dragElements.get(this._id),n=r&&r.dragStatus==="dragging",i=r&&r.dragStatus==="ready";n?this.stopDrag():i&&ai.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 yt.Util.haveIntersection(n,this.getClientRect())}static create(t,r){return yt.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,r)}static _createNode(t,r){var n=bm.prototype.getClassName.call(t),i=t.children,a,o,l;r&&(t.attrs.container=r),oo.Konva[n]||(yt.Util.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=oo.Konva[n];if(a=new u(t.attrs),i)for(o=i.length,l=0;l<o;l++)a.add(bm._createNode(i[l]));return a}};Qt.Node=ct;ct.prototype.nodeType="Node";ct.prototype._attrsAffectingSize=[];ct.prototype.eventListeners={};ct.prototype.on.call(ct.prototype,XT,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(lo),this._clearSelfAndDescendantCache(_a)});ct.prototype.on.call(ct.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(ym)});ct.prototype.on.call(ct.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(mm)});ct.prototype.on.call(ct.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(eh)});const zt=df.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)());df.Factory.addComponentsGetterSetter(ct,"scale",["x","y"]);zt(ct,"scaleX",1,(0,gr.getNumberValidator)());zt(ct,"scaleY",1,(0,gr.getNumberValidator)());df.Factory.addComponentsGetterSetter(ct,"skew",["x","y"]);zt(ct,"skewX",0,(0,gr.getNumberValidator)());zt(ct,"skewY",0,(0,gr.getNumberValidator)());df.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)());df.Factory.backCompat(ct,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var Nl={};Object.defineProperty(Nl,"__esModule",{value:!0});Nl.Container=void 0;const vu=pt,ng=Qt,Sp=Ye;class Il extends ng.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=ng.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=ng.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 p=this.getAbsoluteTransform(r).getMatrix();o.transform(p[0],p[1],p[2],p[3],p[4],p[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(),p=typeof l=="number"&&typeof u=="number"||f;const S=n===this;if(p){o.save();var w=this.getAbsoluteTransform(n),g=w.getMatrix();o.transform(g[0],g[1],g[2],g[3],g[4],g[5]),o.beginPath();let y;if(f)y=f.call(this,o,this);else{var E=this.clipX(),m=this.clipY();o.rect(E||0,m||0,l,u)}o.clip.apply(o,y),g=w.copy().invert().getMatrix(),o.transform(g[0],g[1],g[2],g[3],g[4],g[5])}var v=!S&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";v&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(y){y[t](r,n,i)}),v&&o.restore(),p&&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},p=this;(r=this.children)===null||r===void 0||r.forEach(function(m){if(m.visible()){var v=m.getClientRect({relativeTo:p,skipShadow:t.skipShadow,skipStroke:t.skipStroke});v.width===0&&v.height===0||(a===void 0?(a=v.x,o=v.y,l=v.x+v.width,u=v.y+v.height):(a=Math.min(a,v.x),o=Math.min(o,v.y),l=Math.max(l,v.x+v.width),u=Math.max(u,v.y+v.height)))}});for(var S=this.find("Shape"),w=!1,g=0;g<S.length;g++){var E=S[g];if(E._isVisible(this)){w=!0;break}}return w&&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)}}Nl.Container=Il;vu.Factory.addComponentsGetterSetter(Il,"clip",["x","y","width","height"]);vu.Factory.addGetterSetter(Il,"clipX",void 0,(0,Sp.getNumberValidator)());vu.Factory.addGetterSetter(Il,"clipY",void 0,(0,Sp.getNumberValidator)());vu.Factory.addGetterSetter(Il,"clipWidth",void 0,(0,Sp.getNumberValidator)());vu.Factory.addGetterSetter(Il,"clipHeight",void 0,(0,Sp.getNumberValidator)());vu.Factory.addGetterSetter(Il,"clipFunc");var b9={},Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.releaseCapture=Bn.setPointerCapture=Bn.hasPointerCapture=Bn.createEvent=Bn.getCapturedShape=void 0;const QT=ht,Gc=new Map,_9=QT.Konva._global.PointerEvent!==void 0;function JT(e){return Gc.get(e)}Bn.getCapturedShape=JT;function Yy(e){return{evt:e,pointerId:e.pointerId}}Bn.createEvent=Yy;function eA(e,t){return Gc.get(e)===t}Bn.hasPointerCapture=eA;function tA(e,t){w9(e),t.getStage()&&(Gc.set(e,t),_9&&t._fire("gotpointercapture",Yy(new PointerEvent("gotpointercapture"))))}Bn.setPointerCapture=tA;function w9(e,t){const r=Gc.get(e);if(!r)return;const n=r.getStage();n&&n.content,Gc.delete(e),_9&&r._fire("lostpointercapture",Yy(new PointerEvent("lostpointercapture")))}Bn.releaseCapture=w9;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=or,r=pt,n=Nl,i=ht,a=Ii,o=wp,l=ht,u=Bn;var f="Stage",p="string",S="px",w="mouseout",g="mouseleave",E="mouseover",m="mouseenter",v="mousemove",y="mousedown",h="mouseup",d="pointermove",b="pointerdown",O="pointerup",x="pointercancel",P="lostpointercapture",_="pointerout",A="pointerleave",C="pointerover",k="pointerenter",R="contextmenu",D="touchstart",U="touchend",Y="touchmove",j="touchcancel",G="wheel",z=5,q=[[m,"_pointerenter"],[y,"_pointerdown"],[v,"_pointermove"],[h,"_pointerup"],[g,"_pointerleave"],[D,"_pointerdown"],[Y,"_pointermove"],[U,"_pointerup"],[j,"_pointercancel"],[E,"_pointerover"],[G,"_wheel"],[R,"_contextmenu"],[b,"_pointerdown"],[d,"_pointermove"],[O,"_pointerup"],[x,"_pointercancel"],[P,"_lostpointercapture"]];const L={mouse:{[_]:w,[A]:g,[C]:E,[k]:m,[d]:v,[b]:y,[O]:h,[x]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[_]:"touchout",[A]:"touchleave",[C]:"touchover",[k]:"touchenter",[d]:Y,[b]:D,[O]:U,[x]:j,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[_]:_,[A]:A,[C]:C,[k]:k,[d]:d,[b]:b,[O]:O,[x]:x,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},I=V=>V.indexOf("pointer")>=0?"pointer":V.indexOf("touch")>=0?"touch":"mouse",B=V=>{const H=I(V);if(H==="pointer")return i.Konva.pointerEventsEnabled&&L.pointer;if(H==="touch")return L.touch;if(H==="mouse")return L.mouse};function M(V={}){return(V.clipFunc||V.clipWidth||V.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),V}const $="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 K extends n.Container{constructor(H){super(M(H)),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",()=>{M(this.attrs)}),this._checkVisibility()}_validateAdd(H){const X=H.getType()==="Layer",Z=H.getType()==="FastLayer";X||Z||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const H=this.visible()?"":"none";this.content.style.display=H}setContainer(H){if(typeof H===p){if(H.charAt(0)==="."){var X=H.slice(1);H=document.getElementsByClassName(X)[0]}else{var Z;H.charAt(0)!=="#"?Z=H:Z=H.slice(1),H=document.getElementById(Z)}if(!H)throw"Can not find container in document with id "+Z}return this._setAttr("container",H),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),H.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var H=this.children,X=H.length,Z;for(Z=0;Z<X;Z++)H[Z].clear();return this}clone(H){return H||(H={}),H.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,H)}destroy(){super.destroy();var H=this.content;H&&t.Util._isInDocument(H)&&this.container().removeChild(H);var X=e.stages.indexOf(this);return X>-1&&e.stages.splice(X,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const H=this._pointerPositions[0]||this._changedPointerPositions[0];return H?{x:H.x,y:H.y}:(t.Util.warn($),null)}_getPointerById(H){return this._pointerPositions.find(X=>X.id===H)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(H){H=H||{},H.x=H.x||0,H.y=H.y||0,H.width=H.width||this.width(),H.height=H.height||this.height();var X=new a.SceneCanvas({width:H.width,height:H.height,pixelRatio:H.pixelRatio||1}),Z=X.getContext()._context,J=this.children;return(H.x||H.y)&&Z.translate(-1*H.x,-1*H.y),J.forEach(function(ee){if(ee.isVisible()){var re=ee._toKonvaCanvas(H);Z.drawImage(re._canvas,H.x,H.y,re.getWidth()/re.getPixelRatio(),re.getHeight()/re.getPixelRatio())}}),X}getIntersection(H){if(!H)return null;var X=this.children,Z=X.length,J=Z-1,ee;for(ee=J;ee>=0;ee--){const re=X[ee].getIntersection(H);if(re)return re}return null}_resizeDOM(){var H=this.width(),X=this.height();this.content&&(this.content.style.width=H+S,this.content.style.height=X+S),this.bufferCanvas.setSize(H,X),this.bufferHitCanvas.setSize(H,X),this.children.forEach(Z=>{Z.setSize({width:H,height:X}),Z.draw()})}add(H,...X){if(arguments.length>1){for(var Z=0;Z<arguments.length;Z++)this.add(arguments[Z]);return this}super.add(H);var J=this.children.length;return J>z&&t.Util.warn("The stage has "+J+" 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."),H.setSize({width:this.width(),height:this.height()}),H.draw(),i.Konva.isBrowser&&this.content.appendChild(H.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(H){return u.hasPointerCapture(H,this)}setPointerCapture(H){u.setPointerCapture(H,this)}releaseCapture(H){u.releaseCapture(H,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&q.forEach(([H,X])=>{this.content.addEventListener(H,Z=>{this[X](Z)},{passive:!1})})}_pointerenter(H){this.setPointersPositions(H);const X=B(H.type);X&&this._fire(X.pointerenter,{evt:H,target:this,currentTarget:this})}_pointerover(H){this.setPointersPositions(H);const X=B(H.type);X&&this._fire(X.pointerover,{evt:H,target:this,currentTarget:this})}_getTargetShape(H){let X=this[H+"targetShape"];return X&&!X.getStage()&&(X=null),X}_pointerleave(H){const X=B(H.type),Z=I(H.type);if(X){this.setPointersPositions(H);var J=this._getTargetShape(Z),ee=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;J&&ee?(J._fireAndBubble(X.pointerout,{evt:H}),J._fireAndBubble(X.pointerleave,{evt:H}),this._fire(X.pointerleave,{evt:H,target:this,currentTarget:this}),this[Z+"targetShape"]=null):ee&&(this._fire(X.pointerleave,{evt:H,target:this,currentTarget:this}),this._fire(X.pointerout,{evt:H,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(H){const X=B(H.type),Z=I(H.type);if(X){this.setPointersPositions(H);var J=!1;this._changedPointerPositions.forEach(ee=>{var re=this.getIntersection(ee);if(o.DD.justDragged=!1,i.Konva["_"+Z+"ListenClick"]=!0,!re||!re.isListening())return;i.Konva.capturePointerEventsEnabled&&re.setPointerCapture(ee.id),this[Z+"ClickStartShape"]=re,re._fireAndBubble(X.pointerdown,{evt:H,pointerId:ee.id}),J=!0;const ne=H.type.indexOf("touch")>=0;re.preventDefault()&&H.cancelable&&ne&&H.preventDefault()}),J||this._fire(X.pointerdown,{evt:H,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(H){const X=B(H.type),Z=I(H.type);if(!X)return;i.Konva.isDragging()&&o.DD.node.preventDefault()&&H.cancelable&&H.preventDefault(),this.setPointersPositions(H);var J=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;if(!J)return;var ee={};let re=!1;var ne=this._getTargetShape(Z);this._changedPointerPositions.forEach(de=>{const pe=u.getCapturedShape(de.id)||this.getIntersection(de),Me=de.id,Fe={evt:H,pointerId:Me};var fe=ne!==pe;if(fe&&ne&&(ne._fireAndBubble(X.pointerout,{...Fe},pe),ne._fireAndBubble(X.pointerleave,{...Fe},pe)),pe){if(ee[pe._id])return;ee[pe._id]=!0}pe&&pe.isListening()?(re=!0,fe&&(pe._fireAndBubble(X.pointerover,{...Fe},ne),pe._fireAndBubble(X.pointerenter,{...Fe},ne),this[Z+"targetShape"]=pe),pe._fireAndBubble(X.pointermove,{...Fe})):ne&&(this._fire(X.pointerover,{evt:H,target:this,currentTarget:this,pointerId:Me}),this[Z+"targetShape"]=null)}),re||this._fire(X.pointermove,{evt:H,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(H){const X=B(H.type),Z=I(H.type);if(!X)return;this.setPointersPositions(H);const J=this[Z+"ClickStartShape"],ee=this[Z+"ClickEndShape"];var re={};let ne=!1;this._changedPointerPositions.forEach(de=>{const pe=u.getCapturedShape(de.id)||this.getIntersection(de);if(pe){if(pe.releaseCapture(de.id),re[pe._id])return;re[pe._id]=!0}const Me=de.id,Fe={evt:H,pointerId:Me};let fe=!1;i.Konva["_"+Z+"InDblClickWindow"]?(fe=!0,clearTimeout(this[Z+"DblTimeout"])):o.DD.justDragged||(i.Konva["_"+Z+"InDblClickWindow"]=!0,clearTimeout(this[Z+"DblTimeout"])),this[Z+"DblTimeout"]=setTimeout(function(){i.Konva["_"+Z+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),pe&&pe.isListening()?(ne=!0,this[Z+"ClickEndShape"]=pe,pe._fireAndBubble(X.pointerup,{...Fe}),i.Konva["_"+Z+"ListenClick"]&&J&&J===pe&&(pe._fireAndBubble(X.pointerclick,{...Fe}),fe&&ee&&ee===pe&&pe._fireAndBubble(X.pointerdblclick,{...Fe}))):(this[Z+"ClickEndShape"]=null,i.Konva["_"+Z+"ListenClick"]&&this._fire(X.pointerclick,{evt:H,target:this,currentTarget:this,pointerId:Me}),fe&&this._fire(X.pointerdblclick,{evt:H,target:this,currentTarget:this,pointerId:Me}))}),ne||this._fire(X.pointerup,{evt:H,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+Z+"ListenClick"]=!1,H.cancelable&&Z!=="touch"&&H.preventDefault()}_contextmenu(H){this.setPointersPositions(H);var X=this.getIntersection(this.getPointerPosition());X&&X.isListening()?X._fireAndBubble(R,{evt:H}):this._fire(R,{evt:H,target:this,currentTarget:this})}_wheel(H){this.setPointersPositions(H);var X=this.getIntersection(this.getPointerPosition());X&&X.isListening()?X._fireAndBubble(G,{evt:H}):this._fire(G,{evt:H,target:this,currentTarget:this})}_pointercancel(H){this.setPointersPositions(H);const X=u.getCapturedShape(H.pointerId)||this.getIntersection(this.getPointerPosition());X&&X._fireAndBubble(O,u.createEvent(H)),u.releaseCapture(H.pointerId)}_lostpointercapture(H){u.releaseCapture(H.pointerId)}setPointersPositions(H){var X=this._getContentPosition(),Z=null,J=null;H=H||window.event,H.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(H.touches,ee=>{this._pointerPositions.push({id:ee.identifier,x:(ee.clientX-X.left)/X.scaleX,y:(ee.clientY-X.top)/X.scaleY})}),Array.prototype.forEach.call(H.changedTouches||H.touches,ee=>{this._changedPointerPositions.push({id:ee.identifier,x:(ee.clientX-X.left)/X.scaleX,y:(ee.clientY-X.top)/X.scaleY})})):(Z=(H.clientX-X.left)/X.scaleX,J=(H.clientY-X.top)/X.scaleY,this.pointerPos={x:Z,y:J},this._pointerPositions=[{x:Z,y:J,id:t.Util._getFirstPointerId(H)}],this._changedPointerPositions=[{x:Z,y:J,id:t.Util._getFirstPointerId(H)}])}_setPointerPosition(H){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(H)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var H=this.content.getBoundingClientRect();return{top:H.top,left:H.left,scaleX:H.width/this.content.clientWidth||1,scaleY:H.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 H=this.container();if(!H)throw"Stage has no container. A container is required.";H.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"),H.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(H){H.batchDraw()}),this}}e.Stage=K,K.prototype.nodeType=f,(0,l._registerNode)(K),r.Factory.addGetterSetter(K,"container")})(b9);var hf={},Tr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=ht,r=or,n=pt,i=Qt,a=Ye,o=ht,l=Bn;var u="hasShadow",f="shadowRGBA",p="patternImage",S="linearGradient",w="radialGradient";let g;function E(){return g||(g=r.Util.createCanvasElement().getContext("2d"),g)}e.shapes={};function m(A){const C=this.attrs.fillRule;C?A.fill(C):A.fill()}function v(A){A.stroke()}function y(A){A.fill()}function h(A){A.stroke()}function d(){this._clearCache(u)}function b(){this._clearCache(f)}function O(){this._clearCache(p)}function x(){this._clearCache(S)}function P(){this._clearCache(w)}class _ extends i.Node{constructor(C){super(C);let k;for(;k=r.Util.getRandomColor(),!(k&&!(k in e.shapes)););this.colorKey=k,e.shapes[k]=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(p,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var C=E();const k=C.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(k&&k.setTransform){const R=new r.Transform;R.translate(this.fillPatternX(),this.fillPatternY()),R.rotate(t.Konva.getAngle(this.fillPatternRotation())),R.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),R.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const D=R.getMatrix(),U=typeof DOMMatrix>"u"?{a:D[0],b:D[1],c:D[2],d:D[3],e:D[4],f:D[5]}:new DOMMatrix(D);k.setTransform(U)}return k}}_getLinearGradient(){return this._getCache(S,this.__getLinearGradient)}__getLinearGradient(){var C=this.fillLinearGradientColorStops();if(C){for(var k=E(),R=this.fillLinearGradientStartPoint(),D=this.fillLinearGradientEndPoint(),U=k.createLinearGradient(R.x,R.y,D.x,D.y),Y=0;Y<C.length;Y+=2)U.addColorStop(C[Y],C[Y+1]);return U}}_getRadialGradient(){return this._getCache(w,this.__getRadialGradient)}__getRadialGradient(){var C=this.fillRadialGradientColorStops();if(C){for(var k=E(),R=this.fillRadialGradientStartPoint(),D=this.fillRadialGradientEndPoint(),U=k.createRadialGradient(R.x,R.y,this.fillRadialGradientStartRadius(),D.x,D.y,this.fillRadialGradientEndRadius()),Y=0;Y<C.length;Y+=2)U.addColorStop(C[Y],C[Y+1]);return U}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var C=r.Util.colorToRGBA(this.shadowColor());if(C)return"rgba("+C.r+","+C.g+","+C.b+","+C.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 C=this.hitStrokeWidth();return C==="auto"?this.hasStroke():this.strokeEnabled()&&!!C}intersects(C){var k=this.getStage();if(!k)return!1;const R=k.bufferHitCanvas;return R.getContext().clear(),this.drawHit(R,void 0,!0),R.context.getImageData(Math.round(C.x),Math.round(C.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(C){var k;if(!((k=this.attrs.perfectDrawEnabled)!==null&&k!==void 0?k:!0))return!1;const D=C||this.hasFill(),U=this.hasStroke(),Y=this.getAbsoluteOpacity()!==1;if(D&&U&&Y)return!0;const j=this.hasShadow(),G=this.shadowForStrokeEnabled();return!!(D&&U&&j&&G)}setStrokeHitEnabled(C){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),C?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var C=this.size();return{x:this._centroid?-C.width/2:0,y:this._centroid?-C.height/2:0,width:C.width,height:C.height}}getClientRect(C={}){const k=C.skipTransform,R=C.relativeTo,D=this.getSelfRect(),Y=!C.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,j=D.width+Y,G=D.height+Y,z=!C.skipShadow&&this.hasShadow(),q=z?this.shadowOffsetX():0,L=z?this.shadowOffsetY():0,I=j+Math.abs(q),B=G+Math.abs(L),M=z&&this.shadowBlur()||0,$=I+M*2,K=B+M*2,V={width:$,height:K,x:-(Y/2+M)+Math.min(q,0)+D.x,y:-(Y/2+M)+Math.min(L,0)+D.y};return k?V:this._transformedRect(V,R)}drawScene(C,k,R){var D=this.getLayer(),U=C||D.getCanvas(),Y=U.getContext(),j=this._getCanvasCache(),G=this.getSceneFunc(),z=this.hasShadow(),q,L,I=U.isCache,B=k===this;if(!this.isVisible()&&!B)return this;if(j){Y.save();var M=this.getAbsoluteTransform(k).getMatrix();return Y.transform(M[0],M[1],M[2],M[3],M[4],M[5]),this._drawCachedSceneCanvas(Y),Y.restore(),this}if(!G)return this;if(Y.save(),this._useBufferCanvas()&&!I){q=this.getStage();const V=R||q.bufferCanvas;L=V.getContext(),L.clear(),L.save(),L._applyLineJoin(this);var $=this.getAbsoluteTransform(k).getMatrix();L.transform($[0],$[1],$[2],$[3],$[4],$[5]),G.call(this,L,this),L.restore();var K=V.pixelRatio;z&&Y._applyShadow(this),Y._applyOpacity(this),Y._applyGlobalCompositeOperation(this),Y.drawImage(V._canvas,0,0,V.width/K,V.height/K)}else{if(Y._applyLineJoin(this),!B){var $=this.getAbsoluteTransform(k).getMatrix();Y.transform($[0],$[1],$[2],$[3],$[4],$[5]),Y._applyOpacity(this),Y._applyGlobalCompositeOperation(this)}z&&Y._applyShadow(this),G.call(this,Y,this)}return Y.restore(),this}drawHit(C,k,R=!1){if(!this.shouldDrawHit(k,R))return this;var D=this.getLayer(),U=C||D.hitCanvas,Y=U&&U.getContext(),j=this.hitFunc()||this.sceneFunc(),G=this._getCanvasCache(),z=G&&G.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()"),z){Y.save();var q=this.getAbsoluteTransform(k).getMatrix();return Y.transform(q[0],q[1],q[2],q[3],q[4],q[5]),this._drawCachedHitCanvas(Y),Y.restore(),this}if(!j)return this;if(Y.save(),Y._applyLineJoin(this),!(this===k)){var I=this.getAbsoluteTransform(k).getMatrix();Y.transform(I[0],I[1],I[2],I[3],I[4],I[5])}return j.call(this,Y,this),Y.restore(),this}drawHitFromCache(C=0){var k=this._getCanvasCache(),R=this._getCachedSceneCanvas(),D=k.hit,U=D.getContext(),Y=D.getWidth(),j=D.getHeight(),G,z,q,L,I,B;U.clear(),U.drawImage(R._canvas,0,0,Y,j);try{for(G=U.getImageData(0,0,Y,j),z=G.data,q=z.length,L=r.Util._hexToRgb(this.colorKey),I=0;I<q;I+=4)B=z[I+3],B>C?(z[I]=L.r,z[I+1]=L.g,z[I+2]=L.b,z[I+3]=255):z[I+3]=0;U.putImageData(G,0,0)}catch(M){r.Util.error("Unable to draw hit graph from cached scene canvas. "+M.message)}return this}hasPointerCapture(C){return l.hasPointerCapture(C,this)}setPointerCapture(C){l.setPointerCapture(C,this)}releaseCapture(C){l.releaseCapture(C,this)}}e.Shape=_,_.prototype._fillFunc=m,_.prototype._strokeFunc=v,_.prototype._fillFuncHit=y,_.prototype._strokeFuncHit=h,_.prototype._centroid=!1,_.prototype.nodeType="Shape",(0,o._registerNode)(_),_.prototype.eventListeners={},_.prototype.on.call(_.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),_.prototype.on.call(_.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",b),_.prototype.on.call(_.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",O),_.prototype.on.call(_.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",x),_.prototype.on.call(_.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",P),n.Factory.addGetterSetter(_,"stroke",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(_,"strokeWidth",2,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(_,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(_,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(_,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(_,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(_,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(_,"lineJoin"),n.Factory.addGetterSetter(_,"lineCap"),n.Factory.addGetterSetter(_,"sceneFunc"),n.Factory.addGetterSetter(_,"hitFunc"),n.Factory.addGetterSetter(_,"dash"),n.Factory.addGetterSetter(_,"dashOffset",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(_,"shadowColor",void 0,(0,a.getStringValidator)()),n.Factory.addGetterSetter(_,"shadowBlur",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(_,"shadowOpacity",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(_,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(_,"shadowOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(_,"shadowOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(_,"fillPatternImage"),n.Factory.addGetterSetter(_,"fill",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(_,"fillPatternX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(_,"fillPatternY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(_,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(_,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(_,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(_,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(_,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(_,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(_,"fillEnabled",!0),n.Factory.addGetterSetter(_,"strokeEnabled",!0),n.Factory.addGetterSetter(_,"shadowEnabled",!0),n.Factory.addGetterSetter(_,"dashEnabled",!0),n.Factory.addGetterSetter(_,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(_,"fillPriority","color"),n.Factory.addComponentsGetterSetter(_,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(_,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(_,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(_,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(_,"fillPatternScaleX",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(_,"fillPatternScaleY",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(_,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(_,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(_,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(_,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(_,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(_,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(_,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(_,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(_,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(_,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(_,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(_,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(_,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(_,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(_,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(_,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(_,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(_,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(_,"fillPatternRotation",0),n.Factory.addGetterSetter(_,"fillRule",void 0,(0,a.getStringValidator)()),n.Factory.backCompat(_,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(Tr);Object.defineProperty(hf,"__esModule",{value:!0});hf.Layer=void 0;const ba=or,ig=Nl,ms=Qt,Ky=pt,V5=Ii,rA=Ye,nA=Tr,iA=ht;var aA="#",oA="beforeDraw",lA="draw",S9=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],sA=S9.length;let mu=class extends ig.Container{constructor(t){super(t),this.canvas=new V5.SceneCanvas,this.hitCanvas=new V5.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(){ms.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=ms.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(ms.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(ms.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 ms.Node.prototype.remove.call(this),t&&t.parentNode&&ba.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"&&ba.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(),ms.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(){ba.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){ba.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,ba.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<sA;i++){const a=S9[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=ba.Util._rgbToHex(n[0],n[1],n[2]),o=nA.shapes[aA+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(oA,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),ig.Container.prototype.drawScene.call(this,i,r),this._fire(lA,{node:this}),this}drawHit(t,r){var n=this.getLayer(),i=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),ig.Container.prototype.drawHit.call(this,i,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){ba.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return ba.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 ba.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};hf.Layer=mu;mu.prototype.nodeType="Layer";(0,iA._registerNode)(mu);Ky.Factory.addGetterSetter(mu,"imageSmoothingEnabled",!0);Ky.Factory.addGetterSetter(mu,"clearBeforeDraw",!0);Ky.Factory.addGetterSetter(mu,"hitGraphEnabled",!0,(0,rA.getBooleanValidator)());var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.FastLayer=void 0;const uA=or,cA=hf,fA=ht;let Xy=class extends cA.Layer{constructor(t){super(t),this.listening(!1),uA.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};Ep.FastLayer=Xy;Xy.prototype.nodeType="FastLayer";(0,fA._registerNode)(Xy);var yu={};Object.defineProperty(yu,"__esModule",{value:!0});yu.Group=void 0;const dA=or,hA=Nl,pA=ht;let Zy=class extends hA.Container{_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&dA.Util.throw("You may only add groups and shapes to groups.")}};yu.Group=Zy;Zy.prototype.nodeType="Group";(0,pA._registerNode)(Zy);var bu={};Object.defineProperty(bu,"__esModule",{value:!0});bu.Animation=void 0;const ag=ht,q5=or,og=function(){return ag.glob.performance&&ag.glob.performance.now?function(){return ag.glob.performance.now()}:function(){return new Date().getTime()}}();class ta{constructor(t,r){this.id=ta.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:og(),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=ta.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=og(),ta._addAnimation(this),this}stop(){return ta._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(og());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 p=a[f];p._id!==void 0&&(t[p._id]=p)}}for(let n in t)t.hasOwnProperty(n)&&t[n].batchDraw()}static _animationLoop(){const t=ta;t.animations.length?(t._runFrames(),q5.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,q5.Util.requestAnimFrame(this._animationLoop))}}bu.Animation=ta;ta.animations=[];ta.animIdCounter=0;ta.animRunning=!1;var E9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=or,r=bu,n=Qt,i=ht;var a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,f=0,p=["fill","stroke","shadowColor"];class S{constructor(E,m,v,y,h,d,b){this.prop=E,this.propFunc=m,this.begin=y,this._pos=y,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=b,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=v,this._change=h-this.begin,this.pause()}fire(E){var m=this[E];m&&m()}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 w{constructor(E){var m=this,v=E.node,y=v._id,h,d=E.easing||e.Easings.Linear,b=!!E.yoyo,O;typeof E.duration>"u"?h=.3:E.duration===0?h=.001:h=E.duration,this.node=v,this._id=f++;var x=v.getLayer()||(v instanceof i.Konva.Stage?v.getLayers():null);x||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(){m.tween.onEnterFrame()},x),this.tween=new S(O,function(P){m._tweenFunc(P)},d,0,1,h*1e3,b),this._addListeners(),w.attrs[y]||(w.attrs[y]={}),w.attrs[y][this._id]||(w.attrs[y][this._id]={}),w.tweens[y]||(w.tweens[y]={});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,m){var v=this.node,y=v._id,h,d,b,O,x,P,_,A;if(b=w.tweens[y][E],b&&delete w.attrs[y][b][E],h=v.getAttr(E),t.Util._isArray(m))if(d=[],x=Math.max(m.length,h.length),E==="points"&&m.length!==h.length&&(m.length>h.length?(_=h,h=t.Util._prepareArrayForTween(h,m,v.closed())):(P=m,m=t.Util._prepareArrayForTween(m,h,v.closed()))),E.indexOf("fill")===0)for(O=0;O<x;O++)if(O%2===0)d.push(m[O]-h[O]);else{var C=t.Util.colorToRGBA(h[O]);A=t.Util.colorToRGBA(m[O]),h[O]=C,d.push({r:A.r-C.r,g:A.g-C.g,b:A.b-C.b,a:A.a-C.a})}else for(O=0;O<x;O++)d.push(m[O]-h[O]);else p.indexOf(E)!==-1?(h=t.Util.colorToRGBA(h),A=t.Util.colorToRGBA(m),d={r:A.r-h.r,g:A.g-h.g,b:A.b-h.b,a:A.a-h.a}):d=m-h;w.attrs[y][this._id][E]={start:h,diff:d,end:m,trueEnd:P,trueStart:_},w.tweens[y][E]=this._id}_tweenFunc(E){var m=this.node,v=w.attrs[m._id][this._id],y,h,d,b,O,x,P,_;for(y in v){if(h=v[y],d=h.start,b=h.diff,_=h.end,t.Util._isArray(d))if(O=[],P=Math.max(d.length,_.length),y.indexOf("fill")===0)for(x=0;x<P;x++)x%2===0?O.push((d[x]||0)+b[x]*E):O.push("rgba("+Math.round(d[x].r+b[x].r*E)+","+Math.round(d[x].g+b[x].g*E)+","+Math.round(d[x].b+b[x].b*E)+","+(d[x].a+b[x].a*E)+")");else for(x=0;x<P;x++)O.push((d[x]||0)+b[x]*E);else p.indexOf(y)!==-1?O="rgba("+Math.round(d.r+b.r*E)+","+Math.round(d.g+b.g*E)+","+Math.round(d.b+b.b*E)+","+(d.a+b.a*E)+")":O=d+b*E;m.setAttr(y,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,m=w.attrs[E._id][this._id];m.points&&m.points.trueEnd&&E.setAttr("points",m.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var E=this.node,m=w.attrs[E._id][this._id];m.points&&m.points.trueStart&&E.points(m.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,m=this._id,v=w.tweens[E],y;this.pause();for(y in v)delete w.tweens[E][y];delete w.attrs[E][m]}}e.Tween=w,w.attrs={},w.tweens={},n.Node.prototype.to=function(g){var E=g.onFinish;g.node=this,g.onFinish=function(){this.destroy(),E&&E()};var m=new w(g);m.play()},e.Easings={BackEaseIn(g,E,m,v){var y=1.70158;return m*(g/=v)*g*((y+1)*g-y)+E},BackEaseOut(g,E,m,v){var y=1.70158;return m*((g=g/v-1)*g*((y+1)*g+y)+1)+E},BackEaseInOut(g,E,m,v){var y=1.70158;return(g/=v/2)<1?m/2*(g*g*(((y*=1.525)+1)*g-y))+E:m/2*((g-=2)*g*(((y*=1.525)+1)*g+y)+2)+E},ElasticEaseIn(g,E,m,v,y,h){var d=0;return g===0?E:(g/=v)===1?E+m:(h||(h=v*.3),!y||y<Math.abs(m)?(y=m,d=h/4):d=h/(2*Math.PI)*Math.asin(m/y),-(y*Math.pow(2,10*(g-=1))*Math.sin((g*v-d)*(2*Math.PI)/h))+E)},ElasticEaseOut(g,E,m,v,y,h){var d=0;return g===0?E:(g/=v)===1?E+m:(h||(h=v*.3),!y||y<Math.abs(m)?(y=m,d=h/4):d=h/(2*Math.PI)*Math.asin(m/y),y*Math.pow(2,-10*g)*Math.sin((g*v-d)*(2*Math.PI)/h)+m+E)},ElasticEaseInOut(g,E,m,v,y,h){var d=0;return g===0?E:(g/=v/2)===2?E+m:(h||(h=v*(.3*1.5)),!y||y<Math.abs(m)?(y=m,d=h/4):d=h/(2*Math.PI)*Math.asin(m/y),g<1?-.5*(y*Math.pow(2,10*(g-=1))*Math.sin((g*v-d)*(2*Math.PI)/h))+E:y*Math.pow(2,-10*(g-=1))*Math.sin((g*v-d)*(2*Math.PI)/h)*.5+m+E)},BounceEaseOut(g,E,m,v){return(g/=v)<1/2.75?m*(7.5625*g*g)+E:g<2/2.75?m*(7.5625*(g-=1.5/2.75)*g+.75)+E:g<2.5/2.75?m*(7.5625*(g-=2.25/2.75)*g+.9375)+E:m*(7.5625*(g-=2.625/2.75)*g+.984375)+E},BounceEaseIn(g,E,m,v){return m-e.Easings.BounceEaseOut(v-g,0,m,v)+E},BounceEaseInOut(g,E,m,v){return g<v/2?e.Easings.BounceEaseIn(g*2,0,m,v)*.5+E:e.Easings.BounceEaseOut(g*2-v,0,m,v)*.5+m*.5+E},EaseIn(g,E,m,v){return m*(g/=v)*g+E},EaseOut(g,E,m,v){return-m*(g/=v)*(g-2)+E},EaseInOut(g,E,m,v){return(g/=v/2)<1?m/2*g*g+E:-m/2*(--g*(g-2)-1)+E},StrongEaseIn(g,E,m,v){return m*(g/=v)*g*g*g*g+E},StrongEaseOut(g,E,m,v){return m*((g=g/v-1)*g*g*g*g+1)+E},StrongEaseInOut(g,E,m,v){return(g/=v/2)<1?m/2*g*g*g*g*g+E:m/2*((g-=2)*g*g*g*g+2)+E},Linear(g,E,m,v){return m*g/v+E}}})(E9);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=ht,r=or,n=Qt,i=Nl,a=b9,o=hf,l=Ep,u=yu,f=wp,p=Tr,S=bu,w=E9,g=Ta,E=Ii;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:p.Shape,shapes:p.shapes,Animation:S.Animation,Tween:w.Tween,Easings:w.Easings,Context:g.Context,Canvas:E.Canvas}),e.default=e.Konva})(Dh);var Op={};Object.defineProperty(Op,"__esModule",{value:!0});Op.Arc=void 0;const xp=pt,gA=Tr,W5=ht,Pp=Ye,vA=ht;let Ua=class extends gA.Shape{_sceneFunc(t){var r=W5.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=W5.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),p=o*r,S=l*(l>0?t:r),w=u*(u>0?r:t);return{x:f,y:n?-1*w:S,width:p-f,height:w-S}}};Op.Arc=Ua;Ua.prototype._centroid=!0;Ua.prototype.className="Arc";Ua.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,vA._registerNode)(Ua);xp.Factory.addGetterSetter(Ua,"innerRadius",0,(0,Pp.getNumberValidator)());xp.Factory.addGetterSetter(Ua,"outerRadius",0,(0,Pp.getNumberValidator)());xp.Factory.addGetterSetter(Ua,"angle",0,(0,Pp.getNumberValidator)());xp.Factory.addGetterSetter(Ua,"clockwise",!1,(0,Pp.getBooleanValidator)());var Cp={},pf={};Object.defineProperty(pf,"__esModule",{value:!0});pf.Line=void 0;const Tp=pt,mA=Tr,O9=Ye,yA=ht;function _m(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),p=o*u/(l+u),S=r-f*(i-e),w=n-f*(a-t),g=r+p*(i-e),E=n+p*(a-t);return[S,w,g,E]}function Y5(e,t){var r=e.length,n=[],i,a;for(i=2;i<r-2;i+=2)a=_m(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 jo=class extends mA.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():Y5(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),r=t.length,n=this.tension(),i=_m(t[r-2],t[r-1],t[0],t[1],t[2],t[3],n),a=_m(t[r-4],t[r-3],t[r-2],t[r-1],t[0],t[1],n),o=Y5(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}}};pf.Line=jo;jo.prototype.className="Line";jo.prototype._attrsAffectingSize=["points","bezier","tension"];(0,yA._registerNode)(jo);Tp.Factory.addGetterSetter(jo,"closed",!1);Tp.Factory.addGetterSetter(jo,"bezier",!1);Tp.Factory.addGetterSetter(jo,"tension",0,(0,O9.getNumberValidator)());Tp.Factory.addGetterSetter(jo,"points",[],(0,O9.getNumberArrayValidator)());var _u={},x9={};(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,p,S;f=u/2,p=0;for(let g=0;g<20;g++)S=f*e.tValues[20][g]+f,p+=e.cValues[20][g]*n(o,l,S);return f*p};e.getCubicArcLength=t;const r=(o,l,u)=>{u===void 0&&(u=1);const f=o[0]-2*o[1]+o[2],p=l[0]-2*l[1]+l[2],S=2*o[1]-2*o[0],w=2*l[1]-2*l[0],g=4*(f*f+p*p),E=4*(f*S+p*w),m=S*S+w*w;if(g===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(l[2]-l[0],2));const v=E/(2*g),y=m/g,h=u+v,d=y-v*v,b=h*h+d>0?Math.sqrt(h*h+d):0,O=v*v+d>0?Math.sqrt(v*v+d):0,x=v+Math.sqrt(v*v+d)!==0?d*Math.log(Math.abs((h+b)/(v+O))):0;return Math.sqrt(g)/2*(h*b-v*O+x)};e.getQuadraticArcLength=r;function n(o,l,u){const f=i(1,u,o),p=i(1,u,l),S=f*f+p*p;return Math.sqrt(S)}const i=(o,l,u)=>{const f=u.length-1;let p,S;if(f===0)return 0;if(o===0){S=0;for(let w=0;w<=f;w++)S+=e.binomialCoefficients[f][w]*Math.pow(1-l,f-w)*Math.pow(l,w)*u[w];return S}else{p=new Array(f);for(let w=0;w<f;w++)p[w]=f*(u[w+1]-u[w]);return i(o-1,l,p)}},a=(o,l,u)=>{let f=1,p=o/l,S=(o-u(p))/l,w=0;for(;f>.001;){const g=u(p+S),E=Math.abs(o-g)/l;if(E<f)f=E,p+=S;else{const m=u(p-S),v=Math.abs(o-m)/l;v<f?(f=v,p-=S):S/=2}if(w++,w>500)break}return p};e.t2length=a})(x9);Object.defineProperty(_u,"__esModule",{value:!0});_u.Path=void 0;const bA=pt,_A=Tr,wA=ht,ys=x9;let gf=class wn extends _A.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=wn.parsePathData(this.data()),this.pathLength=wn.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],p=o[3],S=o[4],w=o[5],g=o[6],E=o[7],m=f>p?f:p,v=f>p?1:f/p,y=f>p?p/f:1;t.translate(l,u),t.rotate(g),t.scale(v,y),t.arc(0,0,m,S,S+w,1-E),t.scale(1/v,1/y),t.rotate(-g),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 p=f.points[4],S=f.points[5],w=f.points[4]+S,g=Math.PI/180;if(Math.abs(p-w)<g&&(g=Math.abs(p-w)),S<0)for(let E=p-g;E>w;E-=g){const m=wn.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],E,0);t.push(m.x,m.y)}else for(let E=p+g;E<w;E+=g){const m=wn.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],E,0);t.push(m.x,m.y)}}else if(f.command==="C")for(let E=0;E<=1;E+=.01){const m=wn.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(m.x,m.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 wn.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 wn.getPointOnLine(t,o.start.x,o.start.y,l[0],l[1]);case"C":return wn.getPointOnCubicBezier((0,ys.t2length)(t,wn.getPathLength(r),m=>(0,ys.getCubicArcLength)([o.start.x,l[0],l[2],l[4]],[o.start.y,l[1],l[3],l[5]],m)),o.start.x,o.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return wn.getPointOnQuadraticBezier((0,ys.t2length)(t,wn.getPathLength(r),m=>(0,ys.getQuadraticArcLength)([o.start.x,l[0],l[2]],[o.start.y,l[1],l[3]],m)),o.start.x,o.start.y,l[0],l[1],l[2],l[3]);case"A":var u=l[0],f=l[1],p=l[2],S=l[3],w=l[4],g=l[5],E=l[6];return w+=g*t/o.pathLength,wn.getPointOnEllipticalArc(u,f,p,S,w,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 p=u*f,S;if(i===r)S={x:o,y:l+p};else if((l-n)/(o-r+1e-8)===u)S={x:o+f,y:l+p};else{var w,g,E=this.getLineLength(r,n,i,a),m=(o-r)*(i-r)+(l-n)*(a-n);m=m/(E*E),w=r+m*(i-r),g=n+m*(a-n);var v=this.getLineLength(o,l,w,g),y=Math.sqrt(t*t-v*v);f=Math.sqrt(y*y/(1+u*u)),i<r&&(f*=-1),p=u*f,S={x:w+f,y:g+p}}return S}static getPointOnCubicBezier(t,r,n,i,a,o,l,u,f){function p(v){return v*v*v}function S(v){return 3*v*v*(1-v)}function w(v){return 3*v*(1-v)*(1-v)}function g(v){return(1-v)*(1-v)*(1-v)}var E=u*p(t)+o*S(t)+i*w(t)+r*g(t),m=f*p(t)+l*S(t)+a*w(t)+n*g(t);return{x:E,y:m}}static getPointOnQuadraticBezier(t,r,n,i,a,o,l){function u(g){return g*g}function f(g){return 2*g*(1-g)}function p(g){return(1-g)*(1-g)}var S=o*u(t)+i*f(t)+r*p(t),w=l*u(t)+a*f(t)+n*p(t);return{x:S,y:w}}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,p=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,S;for(i=1;i<a.length;i++){var w=a[i],g=w.charAt(0);for(w=w.slice(1),l.length=0;S=p.exec(w);)l.push(S[0]);for(var E=[],m=0,v=l.length;m<v;m++){if(l[m]==="00"){E.push(0,0);continue}var y=parseFloat(l[m]);isNaN(y)?E.push(0):E.push(y)}for(;E.length>0&&!isNaN(E[0]);){var h="",d=[],b=u,O=f,x,P,_,A,C,k,R,D,U,Y;switch(g){case"l":u+=E.shift(),f+=E.shift(),h="L",d.push(u,f);break;case"L":u=E.shift(),f=E.shift(),d.push(u,f);break;case"m":var j=E.shift(),G=E.shift();if(u+=j,f+=G,h="M",o.length>2&&o[o.length-1].command==="z"){for(var z=o.length-2;z>=0;z--)if(o[z].command==="M"){u=o[z].points[0]+j,f=o[z].points[1]+G;break}}d.push(u,f),g="l";break;case"M":u=E.shift(),f=E.shift(),h="M",d.push(u,f),g="L";break;case"h":u+=E.shift(),h="L",d.push(u,f);break;case"H":u=E.shift(),h="L",d.push(u,f);break;case"v":f+=E.shift(),h="L",d.push(u,f);break;case"V":f=E.shift(),h="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(),h="C",d.push(u,f);break;case"S":P=u,_=f,x=o[o.length-1],x.command==="C"&&(P=u+(u-x.points[2]),_=f+(f-x.points[3])),d.push(P,_,E.shift(),E.shift()),u=E.shift(),f=E.shift(),h="C",d.push(u,f);break;case"s":P=u,_=f,x=o[o.length-1],x.command==="C"&&(P=u+(u-x.points[2]),_=f+(f-x.points[3])),d.push(P,_,u+E.shift(),f+E.shift()),u+=E.shift(),f+=E.shift(),h="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(),h="Q",d.push(u,f);break;case"T":P=u,_=f,x=o[o.length-1],x.command==="Q"&&(P=u+(u-x.points[0]),_=f+(f-x.points[1])),u=E.shift(),f=E.shift(),h="Q",d.push(P,_,u,f);break;case"t":P=u,_=f,x=o[o.length-1],x.command==="Q"&&(P=u+(u-x.points[0]),_=f+(f-x.points[1])),u+=E.shift(),f+=E.shift(),h="Q",d.push(P,_,u,f);break;case"A":A=E.shift(),C=E.shift(),k=E.shift(),R=E.shift(),D=E.shift(),U=u,Y=f,u=E.shift(),f=E.shift(),h="A",d=this.convertEndpointToCenterParameterization(U,Y,u,f,R,D,A,C,k);break;case"a":A=E.shift(),C=E.shift(),k=E.shift(),R=E.shift(),D=E.shift(),U=u,Y=f,u+=E.shift(),f+=E.shift(),h="A",d=this.convertEndpointToCenterParameterization(U,Y,u,f,R,D,A,C,k);break}o.push({command:h||g,points:d,start:{x:b,y:O},pathLength:this.calcLength(b,O,h||g,d)})}(g==="z"||g==="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=wn;switch(n){case"L":return f.getLineLength(t,r,i[0],i[1]);case"C":return(0,ys.getCubicArcLength)([t,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return(0,ys.getQuadraticArcLength)([t,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;var p=i[4],S=i[5],w=i[4]+S,g=Math.PI/180;if(Math.abs(p-w)<g&&(g=Math.abs(p-w)),o=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],p,0),S<0)for(u=p-g;u>w;u-=g)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=p+g;u<w;u+=g)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],w,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 p=f*(Math.PI/180),S=Math.cos(p)*(t-n)/2+Math.sin(p)*(r-i)/2,w=-1*Math.sin(p)*(t-n)/2+Math.cos(p)*(r-i)/2,g=S*S/(l*l)+w*w/(u*u);g>1&&(l*=Math.sqrt(g),u*=Math.sqrt(g));var E=Math.sqrt((l*l*(u*u)-l*l*(w*w)-u*u*(S*S))/(l*l*(w*w)+u*u*(S*S)));a===o&&(E*=-1),isNaN(E)&&(E=0);var m=E*l*w/u,v=E*-u*S/l,y=(t+n)/2+Math.cos(p)*m-Math.sin(p)*v,h=(r+i)/2+Math.sin(p)*m+Math.cos(p)*v,d=function(C){return Math.sqrt(C[0]*C[0]+C[1]*C[1])},b=function(C,k){return(C[0]*k[0]+C[1]*k[1])/(d(C)*d(k))},O=function(C,k){return(C[0]*k[1]<C[1]*k[0]?-1:1)*Math.acos(b(C,k))},x=O([1,0],[(S-m)/l,(w-v)/u]),P=[(S-m)/l,(w-v)/u],_=[(-1*S-m)/l,(-1*w-v)/u],A=O(P,_);return b(P,_)<=-1&&(A=Math.PI),b(P,_)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),[y,h,l,u,x,A,p,o]}};_u.Path=gf;gf.prototype.className="Path";gf.prototype._attrsAffectingSize=["data"];(0,wA._registerNode)(gf);bA.Factory.addGetterSetter(gf,"data");Object.defineProperty(Cp,"__esModule",{value:!0});Cp.Arrow=void 0;const Ap=pt,SA=pf,P9=Ye,EA=ht,K5=_u;let Dl=class extends SA.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 w=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],n[l-2],n[l-1]],g=K5.Path.calcLength(i[i.length-4],i[i.length-3],"C",w),E=K5.Path.getPointOnQuadraticBezier(Math.min(1,1-o/g),w[0],w[1],w[2],w[3],w[4],w[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 p=(Math.atan2(f,u)+r)%r,S=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(n[l-2],n[l-1]),t.rotate(p),t.moveTo(0,0),t.lineTo(-o,S/2),t.lineTo(-o,-S/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,S/2),t.lineTo(-o,-S/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}}};Cp.Arrow=Dl;Dl.prototype.className="Arrow";(0,EA._registerNode)(Dl);Ap.Factory.addGetterSetter(Dl,"pointerLength",10,(0,P9.getNumberValidator)());Ap.Factory.addGetterSetter(Dl,"pointerWidth",10,(0,P9.getNumberValidator)());Ap.Factory.addGetterSetter(Dl,"pointerAtBeginning",!1);Ap.Factory.addGetterSetter(Dl,"pointerAtEnding",!0);var kp={};Object.defineProperty(kp,"__esModule",{value:!0});kp.Circle=void 0;const OA=pt,xA=Tr,PA=Ye,CA=ht;let wu=class extends xA.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)}};kp.Circle=wu;wu.prototype._centroid=!0;wu.prototype.className="Circle";wu.prototype._attrsAffectingSize=["radius"];(0,CA._registerNode)(wu);OA.Factory.addGetterSetter(wu,"radius",0,(0,PA.getNumberValidator)());var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.Ellipse=void 0;const Qy=pt,TA=Tr,C9=Ye,AA=ht;let zo=class extends TA.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)}};Rp.Ellipse=zo;zo.prototype.className="Ellipse";zo.prototype._centroid=!0;zo.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,AA._registerNode)(zo);Qy.Factory.addComponentsGetterSetter(zo,"radius",["x","y"]);Qy.Factory.addGetterSetter(zo,"radiusX",0,(0,C9.getNumberValidator)());Qy.Factory.addGetterSetter(zo,"radiusY",0,(0,C9.getNumberValidator)());var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});Lp.Image=void 0;const lg=or,Fl=pt,kA=Tr,RA=ht,vf=Ye;let sa=class T9 extends kA.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?lg.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?lg.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=lg.Util.createImageElement();i.onload=function(){var a=new T9({image:i});r(a)},i.onerror=n,i.crossOrigin="Anonymous",i.src=t}};Lp.Image=sa;sa.prototype.className="Image";(0,RA._registerNode)(sa);Fl.Factory.addGetterSetter(sa,"cornerRadius",0,(0,vf.getNumberOrArrayOfNumbersValidator)(4));Fl.Factory.addGetterSetter(sa,"image");Fl.Factory.addComponentsGetterSetter(sa,"crop",["x","y","width","height"]);Fl.Factory.addGetterSetter(sa,"cropX",0,(0,vf.getNumberValidator)());Fl.Factory.addGetterSetter(sa,"cropY",0,(0,vf.getNumberValidator)());Fl.Factory.addGetterSetter(sa,"cropWidth",0,(0,vf.getNumberValidator)());Fl.Factory.addGetterSetter(sa,"cropHeight",0,(0,vf.getNumberValidator)());var nu={};Object.defineProperty(nu,"__esModule",{value:!0});nu.Tag=nu.Label=void 0;const Mp=pt,LA=Tr,MA=yu,Jy=Ye,A9=ht;var k9=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],NA="Change.konva",IA="none",wm="up",Sm="right",Em="down",Om="left",DA=k9.length;let e2=class extends MA.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<DA;n++)t.on(k9[n]+NA,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 wm:l=n/2,u=-1*f;break;case Sm:l=n+o,u=i/2;break;case Em:l=n/2,u=i+f;break;case Om: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})}}};nu.Label=e2;e2.prototype.className="Label";(0,A9._registerNode)(e2);let jl=class extends LA.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,p=0,S=0;typeof l=="number"?u=f=p=S=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),S=Math.min(l[2]||0,r/2,n/2),p=Math.min(l[3]||0,r/2,n/2)),t.beginPath(),t.moveTo(u,0),i===wm&&(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===Sm&&(t.lineTo(r,(n-o)/2),t.lineTo(r+a,n/2),t.lineTo(r,(n+o)/2)),t.lineTo(r,n-S),t.arc(r-S,n-S,S,0,Math.PI/2,!1),i===Em&&(t.lineTo((r+a)/2,n),t.lineTo(r/2,n+o),t.lineTo((r-a)/2,n)),t.lineTo(p,n),t.arc(p,n-p,p,Math.PI/2,Math.PI,!1),i===Om&&(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===wm?(r-=i,l+=i):a===Em?l+=i:a===Om?(t-=n*1.5,o+=n):a===Sm&&(o+=n*1.5),{x:t,y:r,width:o,height:l}}};nu.Tag=jl;jl.prototype.className="Tag";(0,A9._registerNode)(jl);Mp.Factory.addGetterSetter(jl,"pointerDirection",IA);Mp.Factory.addGetterSetter(jl,"pointerWidth",0,(0,Jy.getNumberValidator)());Mp.Factory.addGetterSetter(jl,"pointerHeight",0,(0,Jy.getNumberValidator)());Mp.Factory.addGetterSetter(jl,"cornerRadius",0,(0,Jy.getNumberOrArrayOfNumbersValidator)(4));var mf={};Object.defineProperty(mf,"__esModule",{value:!0});mf.Rect=void 0;const FA=pt,jA=Tr,zA=ht,BA=or,UA=Ye;let Np=class extends jA.Shape{_sceneFunc(t){var r=this.cornerRadius(),n=this.width(),i=this.height();t.beginPath(),r?BA.Util.drawRoundedRectPath(t,n,i,r):t.rect(0,0,n,i),t.closePath(),t.fillStrokeShape(this)}};mf.Rect=Np;Np.prototype.className="Rect";(0,zA._registerNode)(Np);FA.Factory.addGetterSetter(Np,"cornerRadius",0,(0,UA.getNumberOrArrayOfNumbersValidator)(4));var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.RegularPolygon=void 0;const R9=pt,HA=Tr,L9=Ye,GA=ht;let zl=class extends HA.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)}};Ip.RegularPolygon=zl;zl.prototype.className="RegularPolygon";zl.prototype._centroid=!0;zl.prototype._attrsAffectingSize=["radius"];(0,GA._registerNode)(zl);R9.Factory.addGetterSetter(zl,"radius",0,(0,L9.getNumberValidator)());R9.Factory.addGetterSetter(zl,"sides",0,(0,L9.getNumberValidator)());var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0});Dp.Ring=void 0;const M9=pt,$A=Tr,N9=Ye,VA=ht;var X5=Math.PI*2;let Bl=class extends $A.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,X5,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),X5,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)}};Dp.Ring=Bl;Bl.prototype.className="Ring";Bl.prototype._centroid=!0;Bl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,VA._registerNode)(Bl);M9.Factory.addGetterSetter(Bl,"innerRadius",0,(0,N9.getNumberValidator)());M9.Factory.addGetterSetter(Bl,"outerRadius",0,(0,N9.getNumberValidator)());var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0});Fp.Sprite=void 0;const Ul=pt,qA=Tr,WA=bu,I9=Ye,YA=ht;let ua=class extends qA.Shape{constructor(t){super(t),this._updated=!0,this.anim=new WA.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],p=a[i+3],S=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,f,p),t.closePath(),t.fillStrokeShape(this)),S)if(o){var w=o[r],g=n*2;t.drawImage(S,l,u,f,p,w[g+0],w[g+1],f,p)}else t.drawImage(S,l,u,f,p,0,0,f,p)}_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],p=n*2;t.rect(f[p+0],f[p+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)}};Fp.Sprite=ua;ua.prototype.className="Sprite";(0,YA._registerNode)(ua);Ul.Factory.addGetterSetter(ua,"animation");Ul.Factory.addGetterSetter(ua,"animations");Ul.Factory.addGetterSetter(ua,"frameOffsets");Ul.Factory.addGetterSetter(ua,"image");Ul.Factory.addGetterSetter(ua,"frameIndex",0,(0,I9.getNumberValidator)());Ul.Factory.addGetterSetter(ua,"frameRate",17,(0,I9.getNumberValidator)());Ul.Factory.backCompat(ua,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var jp={};Object.defineProperty(jp,"__esModule",{value:!0});jp.Star=void 0;const t2=pt,KA=Tr,r2=Ye,XA=ht;let Bo=class extends KA.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)}};jp.Star=Bo;Bo.prototype.className="Star";Bo.prototype._centroid=!0;Bo.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,XA._registerNode)(Bo);t2.Factory.addGetterSetter(Bo,"numPoints",5,(0,r2.getNumberValidator)());t2.Factory.addGetterSetter(Bo,"innerRadius",0,(0,r2.getNumberValidator)());t2.Factory.addGetterSetter(Bo,"outerRadius",0,(0,r2.getNumberValidator)());var Cl={};Object.defineProperty(Cl,"__esModule",{value:!0});Cl.Text=Cl.stringToArray=void 0;const xm=or,an=pt,ZA=Tr,Uo=Ye,QA=ht;function D9(e){return Array.from(e)}Cl.stringToArray=D9;var bs="auto",JA="center",F9="inherit",tc="justify",ek="Change.konva",tk="2d",Z5="-",j9="left",rk="text",nk="Text",ik="top",ak="bottom",Q5="middle",z9="normal",ok="px ",Id=" ",lk="right",J5="rtl",sk="word",uk="char",e4="none",sg="…",B9=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],ck=B9.length;function fk(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 Dd;function ug(){return Dd||(Dd=xm.Util.createCanvasElement().getContext(tk),Dd)}function dk(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function hk(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function pk(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let fr=class extends ZA.Shape{constructor(t){super(pk(t)),this._partialTextX=0,this._partialTextY=0;for(var r=0;r<ck;r++)this.on(B9[r]+ek,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,p=this.align(),S=this.getWidth(),w=this.letterSpacing(),g=this.fill(),E=this.textDecoration(),m=E.indexOf("underline")!==-1,v=E.indexOf("line-through")!==-1,y;u=u===F9?t.direction:u;var h=0,h=o/2,d=0,b=0;for(u===J5&&t.setAttr("direction",u),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",Q5),t.setAttr("textAlign",j9),l===Q5?f=(this.getHeight()-n*o-i*2)/2:l===ak&&(f=this.getHeight()-n*o-i*2),t.translate(i,f+i),y=0;y<n;y++){var d=0,b=0,O=r[y],x=O.text,P=O.width,_=O.lastInParagraph,A,C,k;if(t.save(),p===lk?d+=S-P-i*2:p===JA&&(d+=(S-P-i*2)/2),m){t.save(),t.beginPath(),t.moveTo(d,h+b+Math.round(a/2)),A=x.split(" ").length-1,C=A===0,k=p===tc&&!_?S-i*2:P,t.lineTo(d+Math.round(k),h+b+Math.round(a/2)),t.lineWidth=a/15;const G=this._getLinearGradient();t.strokeStyle=G||g,t.stroke(),t.restore()}if(v){t.save(),t.beginPath(),t.moveTo(d,h+b),A=x.split(" ").length-1,C=A===0,k=p===tc&&_&&!C?S-i*2:P,t.lineTo(d+Math.round(k),h+b),t.lineWidth=a/15;const G=this._getLinearGradient();t.strokeStyle=G||g,t.stroke(),t.restore()}if(u!==J5&&(w!==0||p===tc)){A=x.split(" ").length-1;for(var R=D9(x),D=0;D<R.length;D++){var U=R[D];U===" "&&!_&&p===tc&&(d+=(S-i*2-P)/A),this._partialTextX=d,this._partialTextY=h+b,this._partialText=U,t.fillStrokeShape(this),d+=this.measureSize(U).width+w}}else w!==0&&t.setAttr("letterSpacing",`${w}px`),this._partialTextX=d,this._partialTextY=h+b,this._partialText=x,t.fillStrokeShape(this);t.restore(),n>1&&(h+=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=xm.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(rk,r),this}getWidth(){var t=this.attrs.width===bs||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===bs||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 xm.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=ug(),n=this.fontSize(),i;return r.save(),r.font=this._getContextFont(),i=r.measureText(t),r.restore(),{width:i.width,height:n}}_getContextFont(){return this.fontStyle()+Id+this.fontVariant()+Id+(this.fontSize()+ok)+fk(this.fontFamily())}_addTextLine(t){this.align()===tc&&(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 ug().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!==bs&&a!==void 0,u=o!==bs&&o!==void 0,f=this.padding(),p=a-f*2,S=o-f*2,w=0,g=this.wrap(),E=g!==e4,m=g!==uk&&E,v=this.ellipsis();this.textArr=[],ug().font=this._getContextFont();for(var y=v?this._getTextWidth(sg):0,h=0,d=t.length;h<d;++h){var b=t[h],O=this._getTextWidth(b);if(l&&O>p)for(;b.length>0;){for(var x=0,P=b.length,_="",A=0;x<P;){var C=x+P>>>1,k=b.slice(0,C+1),R=this._getTextWidth(k)+y;R<=p?(x=C+1,_=k,A=R):P=C}if(_){if(m){var D,U=b[_.length],Y=U===Id||U===Z5;Y&&A<=p?D=_.length:D=Math.max(_.lastIndexOf(Id),_.lastIndexOf(Z5))+1,D>0&&(x=D,_=_.slice(0,x),A=this._getTextWidth(_))}_=_.trimRight(),this._addTextLine(_),n=Math.max(n,A),w+=i;var j=this._shouldHandleEllipsis(w);if(j){this._tryToAddEllipsisToLastLine();break}if(b=b.slice(x),b=b.trimLeft(),b.length>0&&(O=this._getTextWidth(b),O<=p)){this._addTextLine(b),w+=i,n=Math.max(n,O);break}}else break}else this._addTextLine(b),w+=i,n=Math.max(n,O),this._shouldHandleEllipsis(w)&&h<d-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&w+i>S)break}this.textHeight=r,this.textWidth=n}_shouldHandleEllipsis(t){var r=+this.fontSize(),n=this.lineHeight()*r,i=this.attrs.height,a=i!==bs&&i!==void 0,o=this.padding(),l=i-o*2,u=this.wrap(),f=u!==e4;return!f||a&&t+n>l}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,r=t!==bs&&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+sg)<i;l||(o.text=o.text.slice(0,o.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+sg)}}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()}};Cl.Text=fr;fr.prototype._fillFunc=dk;fr.prototype._strokeFunc=hk;fr.prototype.className=nk;fr.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,QA._registerNode)(fr);an.Factory.overWriteSetter(fr,"width",(0,Uo.getNumberOrAutoValidator)());an.Factory.overWriteSetter(fr,"height",(0,Uo.getNumberOrAutoValidator)());an.Factory.addGetterSetter(fr,"direction",F9);an.Factory.addGetterSetter(fr,"fontFamily","Arial");an.Factory.addGetterSetter(fr,"fontSize",12,(0,Uo.getNumberValidator)());an.Factory.addGetterSetter(fr,"fontStyle",z9);an.Factory.addGetterSetter(fr,"fontVariant",z9);an.Factory.addGetterSetter(fr,"padding",0,(0,Uo.getNumberValidator)());an.Factory.addGetterSetter(fr,"align",j9);an.Factory.addGetterSetter(fr,"verticalAlign",ik);an.Factory.addGetterSetter(fr,"lineHeight",1,(0,Uo.getNumberValidator)());an.Factory.addGetterSetter(fr,"wrap",sk);an.Factory.addGetterSetter(fr,"ellipsis",!1,(0,Uo.getBooleanValidator)());an.Factory.addGetterSetter(fr,"letterSpacing",0,(0,Uo.getNumberValidator)());an.Factory.addGetterSetter(fr,"text","",(0,Uo.getStringValidator)());an.Factory.addGetterSetter(fr,"textDecoration","");var zp={};Object.defineProperty(zp,"__esModule",{value:!0});zp.TextPath=void 0;const cg=or,Bi=pt,gk=Tr,rc=_u,fg=Cl,U9=Ye,vk=ht;var mk="",H9="normal";function G9(e){e.fillText(this.partialText,0,0)}function $9(e){e.strokeText(this.partialText,0,0)}let Ar=class extends gk.Shape{constructor(t){super(t),this.dummyCanvas=cg.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 rc.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const r=this.pathLength;return t-1>r?null:rc.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=rc.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 cg.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 fg.Text.prototype.setText.call(this,t)}_getContextFont(){return fg.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,fg.stringToArray)(this.text());let f=l;for(var p=0;p<u.length;p++){const S=this._getPointAtLength(f);if(!S)return;let w=this._getTextSize(u[p]).width+n;if(u[p]===" "&&i==="justify"){const h=this.text().split(" ").length-1;w+=(this.pathLength-o)/h}const g=this._getPointAtLength(f+w);if(!g)return;const E=rc.Path.getLineLength(S.x,S.y,g.x,g.y);let m=0;if(a)try{m=a(u[p-1],u[p])*this.fontSize()}catch{m=0}S.x+=m,g.x+=m,this.textWidth+=m;const v=rc.Path.getPointOnLine(m+E/2,S.x,S.y,g.x,g.y),y=Math.atan2(g.y-S.y,g.x-S.x);this.glyphInfo.push({transposeX:v.x,transposeY:v.y,text:u[p],rotation:y,p0:S,p1:g}),f+=w}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(p){t.push(p.p0.x),t.push(p.p0.y),t.push(p.p1.x),t.push(p.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 cg.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};zp.TextPath=Ar;Ar.prototype._fillFunc=G9;Ar.prototype._strokeFunc=$9;Ar.prototype._fillFuncHit=G9;Ar.prototype._strokeFuncHit=$9;Ar.prototype.className="TextPath";Ar.prototype._attrsAffectingSize=["text","fontSize","data"];(0,vk._registerNode)(Ar);Bi.Factory.addGetterSetter(Ar,"data");Bi.Factory.addGetterSetter(Ar,"fontFamily","Arial");Bi.Factory.addGetterSetter(Ar,"fontSize",12,(0,U9.getNumberValidator)());Bi.Factory.addGetterSetter(Ar,"fontStyle",H9);Bi.Factory.addGetterSetter(Ar,"align","left");Bi.Factory.addGetterSetter(Ar,"letterSpacing",0,(0,U9.getNumberValidator)());Bi.Factory.addGetterSetter(Ar,"textBaseline","middle");Bi.Factory.addGetterSetter(Ar,"fontVariant",H9);Bi.Factory.addGetterSetter(Ar,"text",mk);Bi.Factory.addGetterSetter(Ar,"textDecoration",null);Bi.Factory.addGetterSetter(Ar,"kerningFunc",null);var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0});Bp.Transformer=void 0;const Dt=or,kt=pt,t4=Qt,yk=Tr,bk=mf,r4=yu,Pi=ht,Ho=Ye,_k=ht;var V9="tr-konva",wk=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${V9}`).join(" "),n4="nodesRect",Sk=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],Ek={"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 Ok="ontouchstart"in Pi.Konva._global;function xk(e,t,r){if(e==="rotater")return r;t+=Dt.Util.degToRad(Ek[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 jh=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],i4=1e8;function Pk(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 q9(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 Ck(e,t){const r=Pk(e);return q9(e,t,r)}function Tk(e,t,r){let n=t;for(let i=0;i<e.length;i++){const a=Pi.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 Pm=0,wt=class extends r4.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(wk,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 V9+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(Sk.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(n4),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(n4,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=(Pi.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),p={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 q9(p,-Pi.Konva.getAngle(r),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-i4,y:-i4,width:0,height:0,rotation:0};const r=[];this.nodes().map(f=>{const p=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var S=[{x:p.x,y:p.y},{x:p.x+p.width,y:p.y},{x:p.x+p.width,y:p.y+p.height},{x:p.x,y:p.y+p.height}],w=f.getAbsoluteTransform();S.forEach(function(g){var E=w.point(g);r.push(E)})});const n=new Dt.Transform;n.rotate(-Pi.Konva.getAngle(this.rotation()));var i=1/0,a=1/0,o=-1/0,l=-1/0;r.forEach(function(f){var p=n.point(f);i===void 0&&(i=o=p.x,a=l=p.y),i=Math.min(i,p.x),a=Math.min(a,p.y),o=Math.max(o,p.x),l=Math.max(l,p.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:Pi.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(),jh.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var r=new bk.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Ok?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=Pi.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=xk(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 yk.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},Pm++,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 p=a.getAbsolutePosition();if(!(f.x===p.x&&f.y===p.y)){if(this._movingAnchorName==="rotater"){var S=this._getNodeRect();r=a.x()-S.width/2,n=-a.y()+S.height/2;let D=Math.atan2(-n,r)+Math.PI/2;S.height<0&&(D-=Math.PI);var w=Pi.Konva.getAngle(this.rotation());const U=w+D,Y=Pi.Konva.getAngle(this.rotationSnapTolerance()),G=Tk(this.rotationSnaps(),U,Y)-S.rotation,z=Ck(S,G);this._fitNodesInto(z,t);return}var g=this.shiftBehavior(),E;g==="inverted"?E=this.keepRatio()&&!t.shiftKey:g==="none"?E=this.keepRatio():E=this.keepRatio()||t.shiftKey;var d=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(E){var m=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(m.x-a.x(),2)+Math.pow(m.y-a.y(),2));var v=this.findOne(".top-left").x()>m.x?-1:1,y=this.findOne(".top-left").y()>m.y?-1:1;r=i*this.cos*v,n=i*this.sin*y,this.findOne(".top-left").x(m.x-r),this.findOne(".top-left").y(m.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(E){var m=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()-m.x,2)+Math.pow(m.y-a.y(),2));var v=this.findOne(".top-right").x()<m.x?-1:1,y=this.findOne(".top-right").y()>m.y?-1:1;r=i*this.cos*v,n=i*this.sin*y,this.findOne(".top-right").x(m.x+r),this.findOne(".top-right").y(m.y-n)}var h=a.position();this.findOne(".top-left").y(h.y),this.findOne(".bottom-right").x(h.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 m=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(m.x-a.x(),2)+Math.pow(a.y()-m.y,2));var v=m.x<a.x()?-1:1,y=a.y()<m.y?-1:1;r=i*this.cos*v,n=i*this.sin*y,a.x(m.x-r),a.y(m.y+n)}h=a.position(),this.findOne(".top-left").x(h.x),this.findOne(".bottom-right").y(h.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(E){var m=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()-m.x,2)+Math.pow(a.y()-m.y,2));var v=this.findOne(".bottom-right").x()<m.x?-1:1,y=this.findOne(".bottom-right").y()<m.y?-1:1;r=i*this.cos*v,n=i*this.sin*y,this.findOne(".bottom-right").x(m.x+r),this.findOne(".bottom-right").y(m.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var d=this.centeredScaling()||t.altKey;if(d){var b=this.findOne(".top-left"),O=this.findOne(".bottom-right"),x=b.x(),P=b.y(),_=this.getWidth()-O.x(),A=this.getHeight()-O.y();O.move({x:-x,y:-P}),b.move({x:_,y:A})}var C=this.findOne(".top-left").getAbsolutePosition();r=C.x,n=C.y;var k=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),R=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:r,y:n,width:k,height:R,rotation:Pi.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();Pm--,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(Pi.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const w=a.point({x:-this.padding()*2,y:0});t.x+=w.x,t.y+=w.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const w=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const w=a.point({x:0,y:-this.padding()*2});t.x+=w.x,t.y+=w.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const w=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const w=this.boundBoxFunc()(n,t);w?t=w: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,p=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(p))):(u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(f,p));const S=u.multiply(l.invert());this._nodes.forEach(w=>{var g;const E=w.getParent().getAbsoluteTransform(),m=w.getTransform().copy();m.translate(w.offsetX(),w.offsetY());const v=new Dt.Transform;v.multiply(E.copy().invert()).multiply(S).multiply(E).multiply(m);const y=v.decompose();w.setAttrs(y),(g=w.getLayer())===null||g===void 0||g.batchDraw()}),this.rotation(Dt.Util._getRotation(t.rotation)),this._nodes.forEach(w=>{this._fire("transform",{evt:r,target:w}),w._fire("transform",{evt:r,target:w})}),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(S=>{S.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 p=this.anchorStyleFunc();p&&f.forEach(S=>{p(S)}),(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=""),r4.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return t4.Node.prototype.toObject.call(this)}clone(t){var r=t4.Node.prototype.clone.call(this,t);return r}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};Bp.Transformer=wt;wt.isTransforming=()=>Pm>0;function Ak(e){return e instanceof Array||Dt.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){jh.indexOf(t)===-1&&Dt.Util.warn("Unknown anchor name: "+t+". Available names are: "+jh.join(", "))}),e||[]}wt.prototype.className="Transformer";(0,_k._registerNode)(wt);kt.Factory.addGetterSetter(wt,"enabledAnchors",jh,Ak);kt.Factory.addGetterSetter(wt,"flipEnabled",!0,(0,Ho.getBooleanValidator)());kt.Factory.addGetterSetter(wt,"resizeEnabled",!0);kt.Factory.addGetterSetter(wt,"anchorSize",10,(0,Ho.getNumberValidator)());kt.Factory.addGetterSetter(wt,"rotateEnabled",!0);kt.Factory.addGetterSetter(wt,"rotateLineVisible",!0);kt.Factory.addGetterSetter(wt,"rotationSnaps",[]);kt.Factory.addGetterSetter(wt,"rotateAnchorOffset",50,(0,Ho.getNumberValidator)());kt.Factory.addGetterSetter(wt,"rotateAnchorCursor","crosshair");kt.Factory.addGetterSetter(wt,"rotationSnapTolerance",5,(0,Ho.getNumberValidator)());kt.Factory.addGetterSetter(wt,"borderEnabled",!0);kt.Factory.addGetterSetter(wt,"anchorStroke","rgb(0, 161, 255)");kt.Factory.addGetterSetter(wt,"anchorStrokeWidth",1,(0,Ho.getNumberValidator)());kt.Factory.addGetterSetter(wt,"anchorFill","white");kt.Factory.addGetterSetter(wt,"anchorCornerRadius",0,(0,Ho.getNumberValidator)());kt.Factory.addGetterSetter(wt,"borderStroke","rgb(0, 161, 255)");kt.Factory.addGetterSetter(wt,"borderStrokeWidth",1,(0,Ho.getNumberValidator)());kt.Factory.addGetterSetter(wt,"borderDash");kt.Factory.addGetterSetter(wt,"keepRatio",!0);kt.Factory.addGetterSetter(wt,"shiftBehavior","default");kt.Factory.addGetterSetter(wt,"centeredScaling",!1);kt.Factory.addGetterSetter(wt,"ignoreStroke",!1);kt.Factory.addGetterSetter(wt,"padding",0,(0,Ho.getNumberValidator)());kt.Factory.addGetterSetter(wt,"node");kt.Factory.addGetterSetter(wt,"nodes");kt.Factory.addGetterSetter(wt,"boundBoxFunc");kt.Factory.addGetterSetter(wt,"anchorDragBoundFunc");kt.Factory.addGetterSetter(wt,"anchorStyleFunc");kt.Factory.addGetterSetter(wt,"shouldOverdrawWholeArea",!1);kt.Factory.addGetterSetter(wt,"useSingleNodeRotation",!0);kt.Factory.backCompat(wt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Up={};Object.defineProperty(Up,"__esModule",{value:!0});Up.Wedge=void 0;const Hp=pt,kk=Tr,Rk=ht,W9=Ye,Lk=ht;let Ha=class extends kk.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,Rk.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)}};Up.Wedge=Ha;Ha.prototype.className="Wedge";Ha.prototype._centroid=!0;Ha.prototype._attrsAffectingSize=["radius"];(0,Lk._registerNode)(Ha);Hp.Factory.addGetterSetter(Ha,"radius",0,(0,W9.getNumberValidator)());Hp.Factory.addGetterSetter(Ha,"angle",0,(0,W9.getNumberValidator)());Hp.Factory.addGetterSetter(Ha,"clockwise",!1);Hp.Factory.backCompat(Ha,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0});Gp.Blur=void 0;const a4=pt,Mk=Qt,Nk=Ye;function o4(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var Ik=[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],Dk=[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 Fk(e,t){var r=e.data,n=e.width,i=e.height,a,o,l,u,f,p,S,w,g,E,m,v,y,h,d,b,O,x,P,_,A,C,k,R,D=t+t+1,U=n-1,Y=i-1,j=t+1,G=j*(j+1)/2,z=new o4,q=null,L=z,I=null,B=null,M=Ik[t],$=Dk[t];for(l=1;l<D;l++)L=L.next=new o4,l===j&&(q=L);for(L.next=z,S=p=0,o=0;o<i;o++){for(b=O=x=P=w=g=E=m=0,v=j*(_=r[p]),y=j*(A=r[p+1]),h=j*(C=r[p+2]),d=j*(k=r[p+3]),w+=G*_,g+=G*A,E+=G*C,m+=G*k,L=z,l=0;l<j;l++)L.r=_,L.g=A,L.b=C,L.a=k,L=L.next;for(l=1;l<j;l++)u=p+((U<l?U:l)<<2),w+=(L.r=_=r[u])*(R=j-l),g+=(L.g=A=r[u+1])*R,E+=(L.b=C=r[u+2])*R,m+=(L.a=k=r[u+3])*R,b+=_,O+=A,x+=C,P+=k,L=L.next;for(I=z,B=q,a=0;a<n;a++)r[p+3]=k=m*M>>$,k!==0?(k=255/k,r[p]=(w*M>>$)*k,r[p+1]=(g*M>>$)*k,r[p+2]=(E*M>>$)*k):r[p]=r[p+1]=r[p+2]=0,w-=v,g-=y,E-=h,m-=d,v-=I.r,y-=I.g,h-=I.b,d-=I.a,u=S+((u=a+t+1)<U?u:U)<<2,b+=I.r=r[u],O+=I.g=r[u+1],x+=I.b=r[u+2],P+=I.a=r[u+3],w+=b,g+=O,E+=x,m+=P,I=I.next,v+=_=B.r,y+=A=B.g,h+=C=B.b,d+=k=B.a,b-=_,O-=A,x-=C,P-=k,B=B.next,p+=4;S+=n}for(a=0;a<n;a++){for(O=x=P=b=g=E=m=w=0,p=a<<2,v=j*(_=r[p]),y=j*(A=r[p+1]),h=j*(C=r[p+2]),d=j*(k=r[p+3]),w+=G*_,g+=G*A,E+=G*C,m+=G*k,L=z,l=0;l<j;l++)L.r=_,L.g=A,L.b=C,L.a=k,L=L.next;for(f=n,l=1;l<=t;l++)p=f+a<<2,w+=(L.r=_=r[p])*(R=j-l),g+=(L.g=A=r[p+1])*R,E+=(L.b=C=r[p+2])*R,m+=(L.a=k=r[p+3])*R,b+=_,O+=A,x+=C,P+=k,L=L.next,l<Y&&(f+=n);for(p=a,I=z,B=q,o=0;o<i;o++)u=p<<2,r[u+3]=k=m*M>>$,k>0?(k=255/k,r[u]=(w*M>>$)*k,r[u+1]=(g*M>>$)*k,r[u+2]=(E*M>>$)*k):r[u]=r[u+1]=r[u+2]=0,w-=v,g-=y,E-=h,m-=d,v-=I.r,y-=I.g,h-=I.b,d-=I.a,u=a+((u=o+j)<Y?u:Y)*n<<2,w+=b+=I.r=r[u],g+=O+=I.g=r[u+1],E+=x+=I.b=r[u+2],m+=P+=I.a=r[u+3],I=I.next,v+=_=B.r,y+=A=B.g,h+=C=B.b,d+=k=B.a,b-=_,O-=A,x-=C,P-=k,B=B.next,p+=n}}const jk=function(t){var r=Math.round(this.blurRadius());r>0&&Fk(t,r)};Gp.Blur=jk;a4.Factory.addGetterSetter(Mk.Node,"blurRadius",0,(0,Nk.getNumberValidator)(),a4.Factory.afterSetFilter);var $p={};Object.defineProperty($p,"__esModule",{value:!0});$p.Brighten=void 0;const l4=pt,zk=Qt,Bk=Ye,Uk=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};$p.Brighten=Uk;l4.Factory.addGetterSetter(zk.Node,"brightness",0,(0,Bk.getNumberValidator)(),l4.Factory.afterSetFilter);var Vp={};Object.defineProperty(Vp,"__esModule",{value:!0});Vp.Contrast=void 0;const s4=pt,Hk=Qt,Gk=Ye,$k=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};Vp.Contrast=$k;s4.Factory.addGetterSetter(Hk.Node,"contrast",0,(0,Gk.getNumberValidator)(),s4.Factory.afterSetFilter);var qp={};Object.defineProperty(qp,"__esModule",{value:!0});qp.Emboss=void 0;const Ro=pt,Wp=Qt,Vk=or,Y9=Ye,qk=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,p=u*4,S=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:Vk.Util.error("Unknown emboss direction: "+n)}do{var w=(S-1)*p,g=a;S+g<1&&(g=0),S+g>f&&(g=0);var E=(S-1+g)*u*4,m=u;do{var v=w+(m-1)*4,y=o;m+y<1&&(y=0),m+y>u&&(y=0);var h=E+(m-1+y)*4,d=l[v]-l[h],b=l[v+1]-l[h+1],O=l[v+2]-l[h+2],x=d,P=x>0?x:-x,_=b>0?b:-b,A=O>0?O:-O;if(_>P&&(x=b),A>P&&(x=O),x*=t,i){var C=l[v]+x,k=l[v+1]+x,R=l[v+2]+x;l[v]=C>255?255:C<0?0:C,l[v+1]=k>255?255:k<0?0:k,l[v+2]=R>255?255:R<0?0:R}else{var D=r-x;D<0?D=0:D>255&&(D=255),l[v]=l[v+1]=l[v+2]=D}}while(--m)}while(--S)};qp.Emboss=qk;Ro.Factory.addGetterSetter(Wp.Node,"embossStrength",.5,(0,Y9.getNumberValidator)(),Ro.Factory.afterSetFilter);Ro.Factory.addGetterSetter(Wp.Node,"embossWhiteLevel",.5,(0,Y9.getNumberValidator)(),Ro.Factory.afterSetFilter);Ro.Factory.addGetterSetter(Wp.Node,"embossDirection","top-left",null,Ro.Factory.afterSetFilter);Ro.Factory.addGetterSetter(Wp.Node,"embossBlend",!1,null,Ro.Factory.afterSetFilter);var Yp={};Object.defineProperty(Yp,"__esModule",{value:!0});Yp.Enhance=void 0;const u4=pt,Wk=Qt,Yk=Ye;function dg(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 Kk=function(e){var t=e.data,r=t.length,n=t[0],i=n,a,o=t[1],l=o,u,f=t[2],p=f,S,w,g=this.enhance();if(g!==0){for(w=0;w<r;w+=4)a=t[w+0],a<n?n=a:a>i&&(i=a),u=t[w+1],u<o?o=u:u>l&&(l=u),S=t[w+2],S<f?f=S:S>p&&(p=S);i===n&&(i=255,n=0),l===o&&(l=255,o=0),p===f&&(p=255,f=0);var E,m,v,y,h,d,b,O,x;for(g>0?(m=i+g*(255-i),v=n-g*(n-0),h=l+g*(255-l),d=o-g*(o-0),O=p+g*(255-p),x=f-g*(f-0)):(E=(i+n)*.5,m=i+g*(i-E),v=n+g*(n-E),y=(l+o)*.5,h=l+g*(l-y),d=o+g*(o-y),b=(p+f)*.5,O=p+g*(p-b),x=f+g*(f-b)),w=0;w<r;w+=4)t[w+0]=dg(t[w+0],n,i,v,m),t[w+1]=dg(t[w+1],o,l,d,h),t[w+2]=dg(t[w+2],f,p,x,O)}};Yp.Enhance=Kk;u4.Factory.addGetterSetter(Wk.Node,"enhance",0,(0,Yk.getNumberValidator)(),u4.Factory.afterSetFilter);var Kp={};Object.defineProperty(Kp,"__esModule",{value:!0});Kp.Grayscale=void 0;const Xk=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};Kp.Grayscale=Xk;var Xp={};Object.defineProperty(Xp,"__esModule",{value:!0});Xp.HSL=void 0;const iu=pt,n2=Qt,i2=Ye;iu.Factory.addGetterSetter(n2.Node,"hue",0,(0,i2.getNumberValidator)(),iu.Factory.afterSetFilter);iu.Factory.addGetterSetter(n2.Node,"saturation",0,(0,i2.getNumberValidator)(),iu.Factory.afterSetFilter);iu.Factory.addGetterSetter(n2.Node,"luminance",0,(0,i2.getNumberValidator)(),iu.Factory.afterSetFilter);const Zk=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),p=.299*n+.701*u+.167*f,S=.587*n-.587*u+.33*f,w=.114*n-.114*u-.497*f,g=.299*n-.299*u-.328*f,E=.587*n+.413*u+.035*f,m=.114*n-.114*u+.293*f,v=.299*n-.3*u+1.25*f,y=.587*n-.586*u-1.05*f,h=.114*n+.886*u-.2*f,d,b,O,x;for(l=0;l<r;l+=4)d=t[l+0],b=t[l+1],O=t[l+2],x=t[l+3],t[l+0]=p*d+S*b+w*O+o,t[l+1]=g*d+E*b+m*O+o,t[l+2]=v*d+y*b+h*O+o,t[l+3]=x};Xp.HSL=Zk;var Zp={};Object.defineProperty(Zp,"__esModule",{value:!0});Zp.HSV=void 0;const au=pt,a2=Qt,o2=Ye,Qk=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,p=.587*n-.587*l+.33*u,S=.114*n-.114*l-.497*u,w=.299*n-.299*l-.328*u,g=.587*n+.413*l+.035*u,E=.114*n-.114*l+.293*u,m=.299*n-.3*l+1.25*u,v=.587*n-.586*l-1.05*u,y=.114*n+.886*l-.2*u,h,d,b,O;for(o=0;o<r;o+=4)h=t[o+0],d=t[o+1],b=t[o+2],O=t[o+3],t[o+0]=f*h+p*d+S*b,t[o+1]=w*h+g*d+E*b,t[o+2]=m*h+v*d+y*b,t[o+3]=O};Zp.HSV=Qk;au.Factory.addGetterSetter(a2.Node,"hue",0,(0,o2.getNumberValidator)(),au.Factory.afterSetFilter);au.Factory.addGetterSetter(a2.Node,"saturation",0,(0,o2.getNumberValidator)(),au.Factory.afterSetFilter);au.Factory.addGetterSetter(a2.Node,"value",0,(0,o2.getNumberValidator)(),au.Factory.afterSetFilter);var Qp={};Object.defineProperty(Qp,"__esModule",{value:!0});Qp.Invert=void 0;const Jk=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]};Qp.Invert=Jk;var Jp={};Object.defineProperty(Jp,"__esModule",{value:!0});Jp.Kaleidoscope=void 0;const zh=pt,K9=Qt,c4=or,X9=Ye;var eR=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,p,S,w=0,g=0,E=0,m=0,v,y=Math.sqrt(l*l+u*u);p=a-l,S=o-u,v=Math.sqrt(p*p+S*S),y=v>y?v:y;var h=o,d=a,b,O,x=360/d*Math.PI/180,P,_;for(O=0;O<d;O+=1)for(P=Math.sin(O*x),_=Math.cos(O*x),b=0;b<h;b+=1)p=Math.floor(l+y*b/h*_),S=Math.floor(u+y*b/h*P),f=(S*a+p)*4,w=n[f+0],g=n[f+1],E=n[f+2],m=n[f+3],f=(O+b*a)*4,i[f+0]=w,i[f+1]=g,i[f+2]=E,i[f+3]=m},tR=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,p,S,w,g,E=0,m=0,v=0,y=0,h,d=Math.sqrt(l*l+u*u);p=a-l,S=o-u,h=Math.sqrt(p*p+S*S),d=h>d?h:d;var b=o,O=a,x,P,_=r.polarRotation||0,A,C;for(p=0;p<a;p+=1)for(S=0;S<o;S+=1)w=p-l,g=S-u,x=Math.sqrt(w*w+g*g)*b/d,P=(Math.atan2(g,w)*180/Math.PI+360+_)%360,P=P*O/360,A=Math.floor(P),C=Math.floor(x),f=(C*a+A)*4,E=n[f+0],m=n[f+1],v=n[f+2],y=n[f+3],f=(S*a+p)*4,i[f+0]=E,i[f+1]=m,i[f+2]=v,i[f+3]=y};const rR=function(e){var t=e.width,r=e.height,n,i,a,o,l,u,f,p,S,w,g=Math.round(this.kaleidoscopePower()),E=Math.round(this.kaleidoscopeAngle()),m=Math.floor(t*(E%360)/360);if(!(g<1)){var v=c4.Util.createCanvasElement();v.width=t,v.height=r;var y=v.getContext("2d").getImageData(0,0,t,r);c4.Util.releaseCanvas(v),eR(e,y,{polarCenterX:t/2,polarCenterY:r/2});for(var h=t/Math.pow(2,g);h<=8;)h=h*2,g-=1;h=Math.ceil(h);var d=h,b=0,O=d,x=1;for(m+h>t&&(b=d,O=0,x=-1),i=0;i<r;i+=1)for(n=b;n!==O;n+=x)a=Math.round(n+m)%t,S=(t*i+a)*4,l=y.data[S+0],u=y.data[S+1],f=y.data[S+2],p=y.data[S+3],w=(t*i+n)*4,y.data[w+0]=l,y.data[w+1]=u,y.data[w+2]=f,y.data[w+3]=p;for(i=0;i<r;i+=1)for(d=Math.floor(h),o=0;o<g;o+=1){for(n=0;n<d+1;n+=1)S=(t*i+n)*4,l=y.data[S+0],u=y.data[S+1],f=y.data[S+2],p=y.data[S+3],w=(t*i+d*2-n-1)*4,y.data[w+0]=l,y.data[w+1]=u,y.data[w+2]=f,y.data[w+3]=p;d*=2}tR(y,e,{polarRotation:0})}};Jp.Kaleidoscope=rR;zh.Factory.addGetterSetter(K9.Node,"kaleidoscopePower",2,(0,X9.getNumberValidator)(),zh.Factory.afterSetFilter);zh.Factory.addGetterSetter(K9.Node,"kaleidoscopeAngle",0,(0,X9.getNumberValidator)(),zh.Factory.afterSetFilter);var e0={};Object.defineProperty(e0,"__esModule",{value:!0});e0.Mask=void 0;const f4=pt,nR=Qt,iR=Ye;function Fd(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 nc(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 aR(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 oR(e,t){var r=Fd(e,0,0),n=Fd(e,e.width-1,0),i=Fd(e,0,e.height-1),a=Fd(e,e.width-1,e.height-1),o=t||10;if(nc(r,n)<o&&nc(n,a)<o&&nc(a,i)<o&&nc(i,r)<o){for(var l=aR([n,r,a,i]),u=[],f=0;f<e.width*e.height;f++){var p=nc(l,[e.data[f*4],e.data[f*4+1],e.data[f*4+2]]);u[f]=p<o?0:255}return u}}function lR(e,t){for(var r=0;r<e.width*e.height;r++)e.data[4*r+3]=t[r]}function sR(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,p=0,S=0;S<i;S++)for(var w=0;w<i;w++){var g=l+S-a,E=u+w-a;if(g>=0&&g<r&&E>=0&&E<t){var m=g*t+E,v=n[S*i+w];p+=e[m]*v}}o[f]=p===255*8?255:0}return o}function uR(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,p=0,S=0;S<i;S++)for(var w=0;w<i;w++){var g=l+S-a,E=u+w-a;if(g>=0&&g<r&&E>=0&&E<t){var m=g*t+E,v=n[S*i+w];p+=e[m]*v}}o[f]=p>=255*4?255:0}return o}function cR(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,p=0,S=0;S<i;S++)for(var w=0;w<i;w++){var g=l+S-a,E=u+w-a;if(g>=0&&g<r&&E>=0&&E<t){var m=g*t+E,v=n[S*i+w];p+=e[m]*v}}o[f]=p}return o}const fR=function(e){var t=this.threshold(),r=oR(e,t);return r&&(r=sR(r,e.width,e.height),r=uR(r,e.width,e.height),r=cR(r,e.width,e.height),lR(e,r)),e};e0.Mask=fR;f4.Factory.addGetterSetter(nR.Node,"threshold",0,(0,iR.getNumberValidator)(),f4.Factory.afterSetFilter);var t0={};Object.defineProperty(t0,"__esModule",{value:!0});t0.Noise=void 0;const d4=pt,dR=Qt,hR=Ye,pR=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()};t0.Noise=pR;d4.Factory.addGetterSetter(dR.Node,"noise",.2,(0,hR.getNumberValidator)(),d4.Factory.afterSetFilter);var r0={};Object.defineProperty(r0,"__esModule",{value:!0});r0.Pixelate=void 0;const h4=pt,gR=or,vR=Qt,mR=Ye,yR=function(e){var t=Math.ceil(this.pixelSize()),r=e.width,n=e.height,i,a,o,l,u,f,p,S=Math.ceil(r/t),w=Math.ceil(n/t),g,E,m,v,y,h,d,b=e.data;if(t<=0){gR.Util.error("pixelSize value can not be <= 0");return}for(y=0;y<S;y+=1)for(h=0;h<w;h+=1){for(l=0,u=0,f=0,p=0,g=y*t,E=g+t,m=h*t,v=m+t,d=0,i=g;i<E;i+=1)if(!(i>=r))for(a=m;a<v;a+=1)a>=n||(o=(r*a+i)*4,l+=b[o+0],u+=b[o+1],f+=b[o+2],p+=b[o+3],d+=1);for(l=l/d,u=u/d,f=f/d,p=p/d,i=g;i<E;i+=1)if(!(i>=r))for(a=m;a<v;a+=1)a>=n||(o=(r*a+i)*4,b[o+0]=l,b[o+1]=u,b[o+2]=f,b[o+3]=p)}};r0.Pixelate=yR;h4.Factory.addGetterSetter(vR.Node,"pixelSize",8,(0,mR.getNumberValidator)(),h4.Factory.afterSetFilter);var n0={};Object.defineProperty(n0,"__esModule",{value:!0});n0.Posterize=void 0;const p4=pt,bR=Qt,_R=Ye,wR=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};n0.Posterize=wR;p4.Factory.addGetterSetter(bR.Node,"levels",.5,(0,_R.getNumberValidator)(),p4.Factory.afterSetFilter);var i0={};Object.defineProperty(i0,"__esModule",{value:!0});i0.RGB=void 0;const Bh=pt,l2=Qt,SR=Ye,ER=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]};i0.RGB=ER;Bh.Factory.addGetterSetter(l2.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Bh.Factory.addGetterSetter(l2.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Bh.Factory.addGetterSetter(l2.Node,"blue",0,SR.RGBComponent,Bh.Factory.afterSetFilter);var a0={};Object.defineProperty(a0,"__esModule",{value:!0});a0.RGBA=void 0;const $c=pt,o0=Qt,OR=Ye,xR=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};a0.RGBA=xR;$c.Factory.addGetterSetter(o0.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});$c.Factory.addGetterSetter(o0.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});$c.Factory.addGetterSetter(o0.Node,"blue",0,OR.RGBComponent,$c.Factory.afterSetFilter);$c.Factory.addGetterSetter(o0.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var l0={};Object.defineProperty(l0,"__esModule",{value:!0});l0.Sepia=void 0;const PR=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)};l0.Sepia=PR;var s0={};Object.defineProperty(s0,"__esModule",{value:!0});s0.Solarize=void 0;const CR=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],p=t[u+1],S=t[u+2];f>127&&(f=255-f),p>127&&(p=255-p),S>127&&(S=255-S),t[u]=f,t[u+1]=p,t[u+2]=S}while(--l)}while(--a)};s0.Solarize=CR;var u0={};Object.defineProperty(u0,"__esModule",{value:!0});u0.Threshold=void 0;const g4=pt,TR=Qt,AR=Ye,kR=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};u0.Threshold=kR;g4.Factory.addGetterSetter(TR.Node,"threshold",.5,(0,AR.getNumberValidator)(),g4.Factory.afterSetFilter);Object.defineProperty(yp,"__esModule",{value:!0});yp.Konva=void 0;const v4=Dh,RR=Op,LR=Cp,MR=kp,NR=Rp,IR=Lp,m4=nu,DR=pf,FR=_u,jR=mf,zR=Ip,BR=Dp,UR=Fp,HR=jp,GR=Cl,$R=zp,VR=Bp,qR=Up,WR=Gp,YR=$p,KR=Vp,XR=qp,ZR=Yp,QR=Kp,JR=Xp,eL=Zp,tL=Qp,rL=Jp,nL=e0,iL=t0,aL=r0,oL=n0,lL=i0,sL=a0,uL=l0,cL=s0,fL=u0;yp.Konva=v4.Konva.Util._assign(v4.Konva,{Arc:RR.Arc,Arrow:LR.Arrow,Circle:MR.Circle,Ellipse:NR.Ellipse,Image:IR.Image,Label:m4.Label,Tag:m4.Tag,Line:DR.Line,Path:FR.Path,Rect:jR.Rect,RegularPolygon:zR.RegularPolygon,Ring:BR.Ring,Sprite:UR.Sprite,Star:HR.Star,Text:GR.Text,TextPath:$R.TextPath,Transformer:VR.Transformer,Wedge:qR.Wedge,Filters:{Blur:WR.Blur,Brighten:YR.Brighten,Contrast:KR.Contrast,Emboss:XR.Emboss,Enhance:ZR.Enhance,Grayscale:QR.Grayscale,HSL:JR.HSL,HSV:eL.HSV,Invert:tL.Invert,Kaleidoscope:rL.Kaleidoscope,Mask:nL.Mask,Noise:iL.Noise,Pixelate:aL.Pixelate,Posterize:oL.Posterize,RGB:lL.RGB,RGBA:sL.RGBA,Sepia:uL.Sepia,Solarize:cL.Solarize,Threshold:fL.Threshold}});var dL=Wy.exports;Object.defineProperty(dL,"__esModule",{value:!0});const hL=yp;Wy.exports=hL.Konva;var Ui=Wy.exports,Cm={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=Dh;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=Dh;e.exports=n.Konva})(Cm,Cm.exports);var pL=Cm.exports;const Vc=Vh(pL);var Z9={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 gL=function(t){var r={},n=it,i=uc,a=Object.assign;function o(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,T=1;T<arguments.length;T++)c+="&args[]="+encodeURIComponent(arguments[T]);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"),p=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),E=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),O=Symbol.iterator;function x(s){return s===null||typeof s!="object"?null:(s=O&&s[O]||s["@@iterator"],typeof s=="function"?s:null)}function P(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 p:return"Fragment";case f:return"Portal";case w:return"Profiler";case S:return"StrictMode";case v:return"Suspense";case y:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case E:return(s.displayName||"Context")+".Consumer";case g:return(s._context.displayName||"Context")+".Provider";case m:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case h:return c=s.displayName||null,c!==null?c:P(s.type)||"Memo";case d:c=s._payload,s=s._init;try{return P(s(c))}catch{}}return null}function _(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 P(c);case 8:return c===S?"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 A(s){var c=s,T=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,c.flags&4098&&(T=c.return),s=c.return;while(s)}return c.tag===3?T:null}function C(s){if(A(s)!==s)throw Error(o(188))}function k(s){var c=s.alternate;if(!c){if(c=A(s),c===null)throw Error(o(188));return c!==s?null:s}for(var T=s,N=c;;){var F=T.return;if(F===null)break;var W=F.alternate;if(W===null){if(N=F.return,N!==null){T=N;continue}break}if(F.child===W.child){for(W=F.child;W;){if(W===T)return C(F),s;if(W===N)return C(F),c;W=W.sibling}throw Error(o(188))}if(T.return!==N.return)T=F,N=W;else{for(var Q=!1,oe=F.child;oe;){if(oe===T){Q=!0,T=F,N=W;break}if(oe===N){Q=!0,N=F,T=W;break}oe=oe.sibling}if(!Q){for(oe=W.child;oe;){if(oe===T){Q=!0,T=W,N=F;break}if(oe===N){Q=!0,N=W,T=F;break}oe=oe.sibling}if(!Q)throw Error(o(189))}}if(T.alternate!==N)throw Error(o(190))}if(T.tag!==3)throw Error(o(188));return T.stateNode.current===T?s:c}function R(s){return s=k(s),s!==null?D(s):null}function D(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=D(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 Y=Array.isArray,j=t.getPublicInstance,G=t.getRootHostContext,z=t.getChildHostContext,q=t.prepareForCommit,L=t.resetAfterCommit,I=t.createInstance,B=t.appendInitialChild,M=t.finalizeInitialChildren,$=t.prepareUpdate,K=t.shouldSetTextContent,V=t.createTextInstance,H=t.scheduleTimeout,X=t.cancelTimeout,Z=t.noTimeout,J=t.isPrimaryRenderer,ee=t.supportsMutation,re=t.supportsPersistence,ne=t.supportsHydration,de=t.getInstanceFromNode,pe=t.preparePortalMount,Me=t.getCurrentEventPriority,Fe=t.detachDeletedInstance,fe=t.supportsMicrotasks,ie=t.scheduleMicrotask,ve=t.supportsTestSelectors,ge=t.findFiberRoot,te=t.getBoundingRect,ue=t.getTextContent,be=t.isHiddenSubtree,se=t.matchAccessibilityRole,Pe=t.setFocusIfFocusable,xe=t.setupIntersectionObserver,Ie=t.appendChild,xt=t.appendChildToContainer,tt=t.commitTextUpdate,St=t.commitMount,Ht=t.commitUpdate,le=t.insertBefore,he=t.insertInContainerBefore,nt=t.removeChild,Ee=t.removeChildFromContainer,je=t.resetTextContent,Le=t.hideInstance,we=t.hideTextInstance,Ze=t.unhideInstance,Oe=t.unhideTextInstance,We=t.clearContainer,ke=t.cloneInstance,ze=t.createContainerChildSet,Xe=t.appendChildToContainerChildSet,ot=t.finalizeContainerChildren,Et=t.replaceContainerChildren,jr=t.cloneHiddenInstance,Jt=t.cloneHiddenTextInstance,Sr=t.canHydrateInstance,on=t.canHydrateTextInstance,Ln=t.canHydrateSuspenseInstance,De=t.isSuspenseInstancePending,Je=t.isSuspenseInstanceFallback,Qe=t.getSuspenseInstanceFallbackErrorDetails,At=t.registerSuspenseInstanceRetry,rt=t.getNextHydratableSibling,er=t.getFirstHydratableChild,mt=t.getFirstHydratableChildWithinContainer,Gt=t.getFirstHydratableChildWithinSuspenseInstance,zr=t.hydrateInstance,vr=t.hydrateTextInstance,kr=t.hydrateSuspenseInstance,Mn=t.getNextHydratableInstanceAfterSuspenseInstance,gi=t.commitHydratedContainer,vn=t.commitHydratedSuspenseInstance,ln=t.clearSuspenseBoundary,Yn=t.clearSuspenseBoundaryFromContainer,Va=t.shouldDeleteUnhydratedTailInstances,vi=t.didNotMatchHydratedContainerTextInstance,Wl=t.didNotMatchHydratedTextInstance,qa;function Wa(s){if(qa===void 0)try{throw Error()}catch(T){var c=T.stack.trim().match(/\n( *(at )?)/);qa=c&&c[1]||""}return`
52
+ `+qa+s}var Yl=!1;function Pu(s,c){if(!s||Yl)return"";Yl=!0;var T=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(Ae){var N=Ae}Reflect.construct(s,[],c)}else{try{c.call()}catch(Ae){N=Ae}s.call(c.prototype)}else{try{throw Error()}catch(Ae){N=Ae}s()}}catch(Ae){if(Ae&&N&&typeof Ae.stack=="string"){for(var F=Ae.stack.split(`
53
+ `),W=N.stack.split(`
54
+ `),Q=F.length-1,oe=W.length-1;1<=Q&&0<=oe&&F[Q]!==W[oe];)oe--;for(;1<=Q&&0<=oe;Q--,oe--)if(F[Q]!==W[oe]){if(Q!==1||oe!==1)do if(Q--,oe--,0>oe||F[Q]!==W[oe]){var ye=`
55
+ `+F[Q].replace(" at new "," at ");return s.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",s.displayName)),ye}while(1<=Q&&0<=oe);break}}}finally{Yl=!1,Error.prepareStackTrace=T}return(s=s?s.displayName||s.name:"")?Wa(s):""}var Cu=Object.prototype.hasOwnProperty,ca=[],Nn=-1;function sn(s){return{current:s}}function Nt(s){0>Nn||(s.current=ca[Nn],ca[Nn]=null,Nn--)}function Rt(s,c){Nn++,ca[Nn]=s.current,s.current=c}var mi={},mr=sn(mi),Br=sn(!1),Kn=mi;function yi(s,c){var T=s.type.contextTypes;if(!T)return mi;var N=s.stateNode;if(N&&N.__reactInternalMemoizedUnmaskedChildContext===c)return N.__reactInternalMemoizedMaskedChildContext;var F={},W;for(W in T)F[W]=c[W];return N&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=F),F}function Yt(s){return s=s.childContextTypes,s!=null}function bi(){Nt(Br),Nt(mr)}function Kl(s,c,T){if(mr.current!==mi)throw Error(o(168));Rt(mr,c),Rt(Br,T)}function Xl(s,c,T){var N=s.stateNode;if(c=c.childContextTypes,typeof N.getChildContext!="function")return T;N=N.getChildContext();for(var F in N)if(!(F in c))throw Error(o(108,_(s)||"Unknown",F));return a({},T,N)}function Zl(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||mi,Kn=mr.current,Rt(mr,s),Rt(Br,Br.current),!0}function fa(s,c,T){var N=s.stateNode;if(!N)throw Error(o(169));T?(s=Xl(s,c,Kn),N.__reactInternalMemoizedMergedChildContext=s,Nt(Br),Nt(mr),Rt(mr,s)):Nt(Br),Rt(Br,T)}var In=Math.clz32?Math.clz32:Ya,y0=Math.log,yr=Math.LN2;function Ya(s){return s>>>=0,s===0?32:31-(y0(s)/yr|0)|0}var Ql=64,Wo=4194304;function da(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 Yo(s,c){var T=s.pendingLanes;if(T===0)return 0;var N=0,F=s.suspendedLanes,W=s.pingedLanes,Q=T&268435455;if(Q!==0){var oe=Q&~F;oe!==0?N=da(oe):(W&=Q,W!==0&&(N=da(W)))}else Q=T&~F,Q!==0?N=da(Q):W!==0&&(N=da(W));if(N===0)return 0;if(c!==0&&c!==N&&!(c&F)&&(F=N&-N,W=c&-c,F>=W||F===16&&(W&4194240)!==0))return c;if(N&4&&(N|=T&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=N;0<c;)T=31-In(c),F=1<<T,N|=s[T],c&=~F;return N}function Of(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 b0(s,c){for(var T=s.suspendedLanes,N=s.pingedLanes,F=s.expirationTimes,W=s.pendingLanes;0<W;){var Q=31-In(W),oe=1<<Q,ye=F[Q];ye===-1?(!(oe&T)||oe&N)&&(F[Q]=Of(oe,c)):ye<=c&&(s.expiredLanes|=oe),W&=~oe}}function Ka(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function Jl(){var s=Ql;return Ql<<=1,!(Ql&4194240)&&(Ql=64),s}function Tu(s){for(var c=[],T=0;31>T;T++)c.push(s);return c}function Dn(s,c,T){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-In(c),s[c]=T}function Au(s,c){var T=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 N=s.eventTimes;for(s=s.expirationTimes;0<T;){var F=31-In(T),W=1<<F;c[F]=0,N[F]=-1,s[F]=-1,T&=~W}}function es(s,c){var T=s.entangledLanes|=c;for(s=s.entanglements;T;){var N=31-In(T),F=1<<N;F&c|s[N]&c&&(s[N]|=c),T&=~F}}var _t=0;function xf(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var Xa=i.unstable_scheduleCallback,Xn=i.unstable_cancelCallback,Pf=i.unstable_shouldYield,Cf=i.unstable_requestPaint,dr=i.unstable_now,ts=i.unstable_ImmediatePriority,_0=i.unstable_UserBlockingPriority,ae=i.unstable_NormalPriority,Te=i.unstable_IdlePriority,Ne=null,ft=null;function lr(s){if(ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Ne,s,void 0,(s.current.flags&128)===128)}catch{}}function Yr(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var sr=typeof Object.is=="function"?Object.is:Yr,It=null,_i=!1,rs=!1;function w0(s){It===null?It=[s]:It.push(s)}function GS(s){_i=!0,w0(s)}function Gi(){if(!rs&&It!==null){rs=!0;var s=0,c=_t;try{var T=It;for(_t=1;s<T.length;s++){var N=T[s];do N=N(!0);while(N!==null)}It=null,_i=!1}catch(F){throw It!==null&&(It=It.slice(s+1)),Xa(ts,Gi),F}finally{_t=c,rs=!1}}return null}var ns=[],is=0,Tf=null,Af=0,Zn=[],Qn=0,Ko=null,ha=1,pa="";function Xo(s,c){ns[is++]=Af,ns[is++]=Tf,Tf=s,Af=c}function F2(s,c,T){Zn[Qn++]=ha,Zn[Qn++]=pa,Zn[Qn++]=Ko,Ko=s;var N=ha;s=pa;var F=32-In(N)-1;N&=~(1<<F),T+=1;var W=32-In(c)+F;if(30<W){var Q=F-F%5;W=(N&(1<<Q)-1).toString(32),N>>=Q,F-=Q,ha=1<<32-In(c)+F|T<<F|N,pa=W+s}else ha=1<<W|T<<F|N,pa=s}function S0(s){s.return!==null&&(Xo(s,1),F2(s,1,0))}function E0(s){for(;s===Tf;)Tf=ns[--is],ns[is]=null,Af=ns[--is],ns[is]=null;for(;s===Ko;)Ko=Zn[--Qn],Zn[Qn]=null,pa=Zn[--Qn],Zn[Qn]=null,ha=Zn[--Qn],Zn[Qn]=null}var Fn=null,Jn=null,Kt=!1,ku=!1,wi=null;function j2(s,c){var T=ii(5,null,null,0);T.elementType="DELETED",T.stateNode=c,T.return=s,c=s.deletions,c===null?(s.deletions=[T],s.flags|=16):c.push(T)}function z2(s,c){switch(s.tag){case 5:return c=Sr(c,s.type,s.pendingProps),c!==null?(s.stateNode=c,Fn=s,Jn=er(c),!0):!1;case 6:return c=on(c,s.pendingProps),c!==null?(s.stateNode=c,Fn=s,Jn=null,!0):!1;case 13:if(c=Ln(c),c!==null){var T=Ko!==null?{id:ha,overflow:pa}:null;return s.memoizedState={dehydrated:c,treeContext:T,retryLane:1073741824},T=ii(18,null,null,0),T.stateNode=c,T.return=s,s.child=T,Fn=s,Jn=null,!0}return!1;default:return!1}}function O0(s){return(s.mode&1)!==0&&(s.flags&128)===0}function x0(s){if(Kt){var c=Jn;if(c){var T=c;if(!z2(s,c)){if(O0(s))throw Error(o(418));c=rt(T);var N=Fn;c&&z2(s,c)?j2(N,T):(s.flags=s.flags&-4097|2,Kt=!1,Fn=s)}}else{if(O0(s))throw Error(o(418));s.flags=s.flags&-4097|2,Kt=!1,Fn=s}}}function B2(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;Fn=s}function kf(s){if(!ne||s!==Fn)return!1;if(!Kt)return B2(s),Kt=!0,!1;if(s.tag!==3&&(s.tag!==5||Va(s.type)&&!K(s.type,s.memoizedProps))){var c=Jn;if(c){if(O0(s))throw U2(),Error(o(418));for(;c;)j2(s,c),c=rt(c)}}if(B2(s),s.tag===13){if(!ne)throw Error(o(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));Jn=Mn(s)}else Jn=Fn?rt(s.stateNode):null;return!0}function U2(){for(var s=Jn;s;)s=rt(s)}function as(){ne&&(Jn=Fn=null,ku=Kt=!1)}function P0(s){wi===null?wi=[s]:wi.push(s)}var $S=l.ReactCurrentBatchConfig;function Rf(s,c){if(sr(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var T=Object.keys(s),N=Object.keys(c);if(T.length!==N.length)return!1;for(N=0;N<T.length;N++){var F=T[N];if(!Cu.call(c,F)||!sr(s[F],c[F]))return!1}return!0}function VS(s){switch(s.tag){case 5:return Wa(s.type);case 16:return Wa("Lazy");case 13:return Wa("Suspense");case 19:return Wa("SuspenseList");case 0:case 2:case 15:return s=Pu(s.type,!1),s;case 11:return s=Pu(s.type.render,!1),s;case 1:return s=Pu(s.type,!0),s;default:return""}}function Si(s,c){if(s&&s.defaultProps){c=a({},c),s=s.defaultProps;for(var T in s)c[T]===void 0&&(c[T]=s[T]);return c}return c}var Lf=sn(null),Mf=null,os=null,C0=null;function T0(){C0=os=Mf=null}function H2(s,c,T){J?(Rt(Lf,c._currentValue),c._currentValue=T):(Rt(Lf,c._currentValue2),c._currentValue2=T)}function A0(s){var c=Lf.current;Nt(Lf),J?s._currentValue=c:s._currentValue2=c}function k0(s,c,T){for(;s!==null;){var N=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,N!==null&&(N.childLanes|=c)):N!==null&&(N.childLanes&c)!==c&&(N.childLanes|=c),s===T)break;s=s.return}}function ls(s,c){Mf=s,C0=os=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&c&&(mn=!0),s.firstContext=null)}function ei(s){var c=J?s._currentValue:s._currentValue2;if(C0!==s)if(s={context:s,memoizedValue:c,next:null},os===null){if(Mf===null)throw Error(o(308));os=s,Mf.dependencies={lanes:0,firstContext:s}}else os=os.next=s;return c}var Zo=null;function R0(s){Zo===null?Zo=[s]:Zo.push(s)}function G2(s,c,T,N){var F=c.interleaved;return F===null?(T.next=T,R0(c)):(T.next=F.next,F.next=T),c.interleaved=T,$i(s,N)}function $i(s,c){s.lanes|=c;var T=s.alternate;for(T!==null&&(T.lanes|=c),T=s,s=s.return;s!==null;)s.childLanes|=c,T=s.alternate,T!==null&&(T.childLanes|=c),T=s,s=s.return;return T.tag===3?T.stateNode:null}var Za=!1;function L0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $2(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 ga(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function Qa(s,c,T){var N=s.updateQueue;if(N===null)return null;if(N=N.shared,gt&2){var F=N.pending;return F===null?c.next=c:(c.next=F.next,F.next=c),N.pending=c,$i(s,T)}return F=N.interleaved,F===null?(c.next=c,R0(N)):(c.next=F.next,F.next=c),N.interleaved=c,$i(s,T)}function Nf(s,c,T){if(c=c.updateQueue,c!==null&&(c=c.shared,(T&4194240)!==0)){var N=c.lanes;N&=s.pendingLanes,T|=N,c.lanes=T,es(s,T)}}function V2(s,c){var T=s.updateQueue,N=s.alternate;if(N!==null&&(N=N.updateQueue,T===N)){var F=null,W=null;if(T=T.firstBaseUpdate,T!==null){do{var Q={eventTime:T.eventTime,lane:T.lane,tag:T.tag,payload:T.payload,callback:T.callback,next:null};W===null?F=W=Q:W=W.next=Q,T=T.next}while(T!==null);W===null?F=W=c:W=W.next=c}else F=W=c;T={baseState:N.baseState,firstBaseUpdate:F,lastBaseUpdate:W,shared:N.shared,effects:N.effects},s.updateQueue=T;return}s=T.lastBaseUpdate,s===null?T.firstBaseUpdate=c:s.next=c,T.lastBaseUpdate=c}function If(s,c,T,N){var F=s.updateQueue;Za=!1;var W=F.firstBaseUpdate,Q=F.lastBaseUpdate,oe=F.shared.pending;if(oe!==null){F.shared.pending=null;var ye=oe,Ae=ye.next;ye.next=null,Q===null?W=Ae:Q.next=Ae,Q=ye;var Ve=s.alternate;Ve!==null&&(Ve=Ve.updateQueue,oe=Ve.lastBaseUpdate,oe!==Q&&(oe===null?Ve.firstBaseUpdate=Ae:oe.next=Ae,Ve.lastBaseUpdate=ye))}if(W!==null){var lt=F.baseState;Q=0,Ve=Ae=ye=null,oe=W;do{var Be=oe.lane,$t=oe.eventTime;if((N&Be)===Be){Ve!==null&&(Ve=Ve.next={eventTime:$t,lane:0,tag:oe.tag,payload:oe.payload,callback:oe.callback,next:null});e:{var jt=s,_n=oe;switch(Be=c,$t=T,_n.tag){case 1:if(jt=_n.payload,typeof jt=="function"){lt=jt.call($t,lt,Be);break e}lt=jt;break e;case 3:jt.flags=jt.flags&-65537|128;case 0:if(jt=_n.payload,Be=typeof jt=="function"?jt.call($t,lt,Be):jt,Be==null)break e;lt=a({},lt,Be);break e;case 2:Za=!0}}oe.callback!==null&&oe.lane!==0&&(s.flags|=64,Be=F.effects,Be===null?F.effects=[oe]:Be.push(oe))}else $t={eventTime:$t,lane:Be,tag:oe.tag,payload:oe.payload,callback:oe.callback,next:null},Ve===null?(Ae=Ve=$t,ye=lt):Ve=Ve.next=$t,Q|=Be;if(oe=oe.next,oe===null){if(oe=F.shared.pending,oe===null)break;Be=oe,oe=Be.next,Be.next=null,F.lastBaseUpdate=Be,F.shared.pending=null}}while(!0);if(Ve===null&&(ye=lt),F.baseState=ye,F.firstBaseUpdate=Ae,F.lastBaseUpdate=Ve,c=F.shared.interleaved,c!==null){F=c;do Q|=F.lane,F=F.next;while(F!==c)}else W===null&&(F.shared.lanes=0);Jo|=Q,s.lanes=Q,s.memoizedState=lt}}function q2(s,c,T){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var N=s[c],F=N.callback;if(F!==null){if(N.callback=null,N=T,typeof F!="function")throw Error(o(191,F));F.call(N)}}}var W2=new n.Component().refs;function M0(s,c,T,N){c=s.memoizedState,T=T(N,c),T=T==null?c:a({},c,T),s.memoizedState=T,s.lanes===0&&(s.updateQueue.baseState=T)}var Df={isMounted:function(s){return(s=s._reactInternals)?A(s)===s:!1},enqueueSetState:function(s,c,T){s=s._reactInternals;var N=Qr(),F=to(s),W=ga(N,F);W.payload=c,T!=null&&(W.callback=T),c=Qa(s,W,F),c!==null&&(ni(c,s,F,N),Nf(c,s,F))},enqueueReplaceState:function(s,c,T){s=s._reactInternals;var N=Qr(),F=to(s),W=ga(N,F);W.tag=1,W.payload=c,T!=null&&(W.callback=T),c=Qa(s,W,F),c!==null&&(ni(c,s,F,N),Nf(c,s,F))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var T=Qr(),N=to(s),F=ga(T,N);F.tag=2,c!=null&&(F.callback=c),c=Qa(s,F,N),c!==null&&(ni(c,s,N,T),Nf(c,s,N))}};function Y2(s,c,T,N,F,W,Q){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(N,W,Q):c.prototype&&c.prototype.isPureReactComponent?!Rf(T,N)||!Rf(F,W):!0}function K2(s,c,T){var N=!1,F=mi,W=c.contextType;return typeof W=="object"&&W!==null?W=ei(W):(F=Yt(c)?Kn:mr.current,N=c.contextTypes,W=(N=N!=null)?yi(s,F):mi),c=new c(T,W),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Df,s.stateNode=c,c._reactInternals=s,N&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=F,s.__reactInternalMemoizedMaskedChildContext=W),c}function X2(s,c,T,N){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(T,N),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(T,N),c.state!==s&&Df.enqueueReplaceState(c,c.state,null)}function N0(s,c,T,N){var F=s.stateNode;F.props=T,F.state=s.memoizedState,F.refs=W2,L0(s);var W=c.contextType;typeof W=="object"&&W!==null?F.context=ei(W):(W=Yt(c)?Kn:mr.current,F.context=yi(s,W)),F.state=s.memoizedState,W=c.getDerivedStateFromProps,typeof W=="function"&&(M0(s,c,W,T),F.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof F.getSnapshotBeforeUpdate=="function"||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(c=F.state,typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount(),c!==F.state&&Df.enqueueReplaceState(F,F.state,null),If(s,T,F,N),F.state=s.memoizedState),typeof F.componentDidMount=="function"&&(s.flags|=4194308)}function Ru(s,c,T){if(s=T.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(T._owner){if(T=T._owner,T){if(T.tag!==1)throw Error(o(309));var N=T.stateNode}if(!N)throw Error(o(147,s));var F=N,W=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===W?c.ref:(c=function(Q){var oe=F.refs;oe===W2&&(oe=F.refs={}),Q===null?delete oe[W]:oe[W]=Q},c._stringRef=W,c)}if(typeof s!="string")throw Error(o(284));if(!T._owner)throw Error(o(290,s))}return s}function Ff(s,c){throw s=Object.prototype.toString.call(c),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function Z2(s){var c=s._init;return c(s._payload)}function Q2(s){function c(me,ce){if(s){var _e=me.deletions;_e===null?(me.deletions=[ce],me.flags|=16):_e.push(ce)}}function T(me,ce){if(!s)return null;for(;ce!==null;)c(me,ce),ce=ce.sibling;return null}function N(me,ce){for(me=new Map;ce!==null;)ce.key!==null?me.set(ce.key,ce):me.set(ce.index,ce),ce=ce.sibling;return me}function F(me,ce){return me=no(me,ce),me.index=0,me.sibling=null,me}function W(me,ce,_e){return me.index=_e,s?(_e=me.alternate,_e!==null?(_e=_e.index,_e<ce?(me.flags|=2,ce):_e):(me.flags|=2,ce)):(me.flags|=1048576,ce)}function Q(me){return s&&me.alternate===null&&(me.flags|=2),me}function oe(me,ce,_e,Ue){return ce===null||ce.tag!==6?(ce=w1(_e,me.mode,Ue),ce.return=me,ce):(ce=F(ce,_e),ce.return=me,ce)}function ye(me,ce,_e,Ue){var et=_e.type;return et===p?Ve(me,ce,_e.props.children,Ue,_e.key):ce!==null&&(ce.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===d&&Z2(et)===ce.type)?(Ue=F(ce,_e.props),Ue.ref=Ru(me,ce,_e),Ue.return=me,Ue):(Ue=ud(_e.type,_e.key,_e.props,null,me.mode,Ue),Ue.ref=Ru(me,ce,_e),Ue.return=me,Ue)}function Ae(me,ce,_e,Ue){return ce===null||ce.tag!==4||ce.stateNode.containerInfo!==_e.containerInfo||ce.stateNode.implementation!==_e.implementation?(ce=S1(_e,me.mode,Ue),ce.return=me,ce):(ce=F(ce,_e.children||[]),ce.return=me,ce)}function Ve(me,ce,_e,Ue,et){return ce===null||ce.tag!==7?(ce=nl(_e,me.mode,Ue,et),ce.return=me,ce):(ce=F(ce,_e),ce.return=me,ce)}function lt(me,ce,_e){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return ce=w1(""+ce,me.mode,_e),ce.return=me,ce;if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case u:return _e=ud(ce.type,ce.key,ce.props,null,me.mode,_e),_e.ref=Ru(me,null,ce),_e.return=me,_e;case f:return ce=S1(ce,me.mode,_e),ce.return=me,ce;case d:var Ue=ce._init;return lt(me,Ue(ce._payload),_e)}if(Y(ce)||x(ce))return ce=nl(ce,me.mode,_e,null),ce.return=me,ce;Ff(me,ce)}return null}function Be(me,ce,_e,Ue){var et=ce!==null?ce.key:null;if(typeof _e=="string"&&_e!==""||typeof _e=="number")return et!==null?null:oe(me,ce,""+_e,Ue);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case u:return _e.key===et?ye(me,ce,_e,Ue):null;case f:return _e.key===et?Ae(me,ce,_e,Ue):null;case d:return et=_e._init,Be(me,ce,et(_e._payload),Ue)}if(Y(_e)||x(_e))return et!==null?null:Ve(me,ce,_e,Ue,null);Ff(me,_e)}return null}function $t(me,ce,_e,Ue,et){if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number")return me=me.get(_e)||null,oe(ce,me,""+Ue,et);if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case u:return me=me.get(Ue.key===null?_e:Ue.key)||null,ye(ce,me,Ue,et);case f:return me=me.get(Ue.key===null?_e:Ue.key)||null,Ae(ce,me,Ue,et);case d:var dt=Ue._init;return $t(me,ce,_e,dt(Ue._payload),et)}if(Y(Ue)||x(Ue))return me=me.get(_e)||null,Ve(ce,me,Ue,et,null);Ff(ce,Ue)}return null}function jt(me,ce,_e,Ue){for(var et=null,dt=null,st=ce,Pt=ce=0,Mr=null;st!==null&&Pt<_e.length;Pt++){st.index>Pt?(Mr=st,st=null):Mr=st.sibling;var Ct=Be(me,st,_e[Pt],Ue);if(Ct===null){st===null&&(st=Mr);break}s&&st&&Ct.alternate===null&&c(me,st),ce=W(Ct,ce,Pt),dt===null?et=Ct:dt.sibling=Ct,dt=Ct,st=Mr}if(Pt===_e.length)return T(me,st),Kt&&Xo(me,Pt),et;if(st===null){for(;Pt<_e.length;Pt++)st=lt(me,_e[Pt],Ue),st!==null&&(ce=W(st,ce,Pt),dt===null?et=st:dt.sibling=st,dt=st);return Kt&&Xo(me,Pt),et}for(st=N(me,st);Pt<_e.length;Pt++)Mr=$t(st,me,Pt,_e[Pt],Ue),Mr!==null&&(s&&Mr.alternate!==null&&st.delete(Mr.key===null?Pt:Mr.key),ce=W(Mr,ce,Pt),dt===null?et=Mr:dt.sibling=Mr,dt=Mr);return s&&st.forEach(function(io){return c(me,io)}),Kt&&Xo(me,Pt),et}function _n(me,ce,_e,Ue){var et=x(_e);if(typeof et!="function")throw Error(o(150));if(_e=et.call(_e),_e==null)throw Error(o(151));for(var dt=et=null,st=ce,Pt=ce=0,Mr=null,Ct=_e.next();st!==null&&!Ct.done;Pt++,Ct=_e.next()){st.index>Pt?(Mr=st,st=null):Mr=st.sibling;var io=Be(me,st,Ct.value,Ue);if(io===null){st===null&&(st=Mr);break}s&&st&&io.alternate===null&&c(me,st),ce=W(io,ce,Pt),dt===null?et=io:dt.sibling=io,dt=io,st=Mr}if(Ct.done)return T(me,st),Kt&&Xo(me,Pt),et;if(st===null){for(;!Ct.done;Pt++,Ct=_e.next())Ct=lt(me,Ct.value,Ue),Ct!==null&&(ce=W(Ct,ce,Pt),dt===null?et=Ct:dt.sibling=Ct,dt=Ct);return Kt&&Xo(me,Pt),et}for(st=N(me,st);!Ct.done;Pt++,Ct=_e.next())Ct=$t(st,me,Pt,Ct.value,Ue),Ct!==null&&(s&&Ct.alternate!==null&&st.delete(Ct.key===null?Pt:Ct.key),ce=W(Ct,ce,Pt),dt===null?et=Ct:dt.sibling=Ct,dt=Ct);return s&&st.forEach(function(wE){return c(me,wE)}),Kt&&Xo(me,Pt),et}function ya(me,ce,_e,Ue){if(typeof _e=="object"&&_e!==null&&_e.type===p&&_e.key===null&&(_e=_e.props.children),typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case u:e:{for(var et=_e.key,dt=ce;dt!==null;){if(dt.key===et){if(et=_e.type,et===p){if(dt.tag===7){T(me,dt.sibling),ce=F(dt,_e.props.children),ce.return=me,me=ce;break e}}else if(dt.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===d&&Z2(et)===dt.type){T(me,dt.sibling),ce=F(dt,_e.props),ce.ref=Ru(me,dt,_e),ce.return=me,me=ce;break e}T(me,dt);break}else c(me,dt);dt=dt.sibling}_e.type===p?(ce=nl(_e.props.children,me.mode,Ue,_e.key),ce.return=me,me=ce):(Ue=ud(_e.type,_e.key,_e.props,null,me.mode,Ue),Ue.ref=Ru(me,ce,_e),Ue.return=me,me=Ue)}return Q(me);case f:e:{for(dt=_e.key;ce!==null;){if(ce.key===dt)if(ce.tag===4&&ce.stateNode.containerInfo===_e.containerInfo&&ce.stateNode.implementation===_e.implementation){T(me,ce.sibling),ce=F(ce,_e.children||[]),ce.return=me,me=ce;break e}else{T(me,ce);break}else c(me,ce);ce=ce.sibling}ce=S1(_e,me.mode,Ue),ce.return=me,me=ce}return Q(me);case d:return dt=_e._init,ya(me,ce,dt(_e._payload),Ue)}if(Y(_e))return jt(me,ce,_e,Ue);if(x(_e))return _n(me,ce,_e,Ue);Ff(me,_e)}return typeof _e=="string"&&_e!==""||typeof _e=="number"?(_e=""+_e,ce!==null&&ce.tag===6?(T(me,ce.sibling),ce=F(ce,_e),ce.return=me,me=ce):(T(me,ce),ce=w1(_e,me.mode,Ue),ce.return=me,me=ce),Q(me)):T(me,ce)}return ya}var ss=Q2(!0),J2=Q2(!1),Lu={},ti=sn(Lu),Mu=sn(Lu),us=sn(Lu);function Vi(s){if(s===Lu)throw Error(o(174));return s}function I0(s,c){Rt(us,c),Rt(Mu,s),Rt(ti,Lu),s=G(c),Nt(ti),Rt(ti,s)}function cs(){Nt(ti),Nt(Mu),Nt(us)}function eb(s){var c=Vi(us.current),T=Vi(ti.current);c=z(T,s.type,c),T!==c&&(Rt(Mu,s),Rt(ti,c))}function D0(s){Mu.current===s&&(Nt(ti),Nt(Mu))}var tr=sn(0);function jf(s){for(var c=s;c!==null;){if(c.tag===13){var T=c.memoizedState;if(T!==null&&(T=T.dehydrated,T===null||De(T)||Je(T)))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 F0=[];function j0(){for(var s=0;s<F0.length;s++){var c=F0[s];J?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}F0.length=0}var zf=l.ReactCurrentDispatcher,z0=l.ReactCurrentBatchConfig,Qo=0,rr=null,Er=null,Rr=null,Bf=!1,Nu=!1,Iu=0,qS=0;function Kr(){throw Error(o(321))}function B0(s,c){if(c===null)return!1;for(var T=0;T<c.length&&T<s.length;T++)if(!sr(s[T],c[T]))return!1;return!0}function U0(s,c,T,N,F,W){if(Qo=W,rr=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,zf.current=s===null||s.memoizedState===null?XS:ZS,s=T(N,F),Nu){W=0;do{if(Nu=!1,Iu=0,25<=W)throw Error(o(301));W+=1,Rr=Er=null,c.updateQueue=null,zf.current=QS,s=T(N,F)}while(Nu)}if(zf.current=Gf,c=Er!==null&&Er.next!==null,Qo=0,Rr=Er=rr=null,Bf=!1,c)throw Error(o(300));return s}function H0(){var s=Iu!==0;return Iu=0,s}function qi(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rr===null?rr.memoizedState=Rr=s:Rr=Rr.next=s,Rr}function ri(){if(Er===null){var s=rr.alternate;s=s!==null?s.memoizedState:null}else s=Er.next;var c=Rr===null?rr.memoizedState:Rr.next;if(c!==null)Rr=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},Rr===null?rr.memoizedState=Rr=s:Rr=Rr.next=s}return Rr}function Du(s,c){return typeof c=="function"?c(s):c}function G0(s){var c=ri(),T=c.queue;if(T===null)throw Error(o(311));T.lastRenderedReducer=s;var N=Er,F=N.baseQueue,W=T.pending;if(W!==null){if(F!==null){var Q=F.next;F.next=W.next,W.next=Q}N.baseQueue=F=W,T.pending=null}if(F!==null){W=F.next,N=N.baseState;var oe=Q=null,ye=null,Ae=W;do{var Ve=Ae.lane;if((Qo&Ve)===Ve)ye!==null&&(ye=ye.next={lane:0,action:Ae.action,hasEagerState:Ae.hasEagerState,eagerState:Ae.eagerState,next:null}),N=Ae.hasEagerState?Ae.eagerState:s(N,Ae.action);else{var lt={lane:Ve,action:Ae.action,hasEagerState:Ae.hasEagerState,eagerState:Ae.eagerState,next:null};ye===null?(oe=ye=lt,Q=N):ye=ye.next=lt,rr.lanes|=Ve,Jo|=Ve}Ae=Ae.next}while(Ae!==null&&Ae!==W);ye===null?Q=N:ye.next=oe,sr(N,c.memoizedState)||(mn=!0),c.memoizedState=N,c.baseState=Q,c.baseQueue=ye,T.lastRenderedState=N}if(s=T.interleaved,s!==null){F=s;do W=F.lane,rr.lanes|=W,Jo|=W,F=F.next;while(F!==s)}else F===null&&(T.lanes=0);return[c.memoizedState,T.dispatch]}function $0(s){var c=ri(),T=c.queue;if(T===null)throw Error(o(311));T.lastRenderedReducer=s;var N=T.dispatch,F=T.pending,W=c.memoizedState;if(F!==null){T.pending=null;var Q=F=F.next;do W=s(W,Q.action),Q=Q.next;while(Q!==F);sr(W,c.memoizedState)||(mn=!0),c.memoizedState=W,c.baseQueue===null&&(c.baseState=W),T.lastRenderedState=W}return[W,N]}function tb(){}function rb(s,c){var T=rr,N=ri(),F=c(),W=!sr(N.memoizedState,F);if(W&&(N.memoizedState=F,mn=!0),N=N.queue,V0(ab.bind(null,T,N,s),[s]),N.getSnapshot!==c||W||Rr!==null&&Rr.memoizedState.tag&1){if(T.flags|=2048,Fu(9,ib.bind(null,T,N,F,c),void 0,null),Lr===null)throw Error(o(349));Qo&30||nb(T,c,F)}return F}function nb(s,c,T){s.flags|=16384,s={getSnapshot:c,value:T},c=rr.updateQueue,c===null?(c={lastEffect:null,stores:null},rr.updateQueue=c,c.stores=[s]):(T=c.stores,T===null?c.stores=[s]:T.push(s))}function ib(s,c,T,N){c.value=T,c.getSnapshot=N,ob(c)&&lb(s)}function ab(s,c,T){return T(function(){ob(c)&&lb(s)})}function ob(s){var c=s.getSnapshot;s=s.value;try{var T=c();return!sr(s,T)}catch{return!0}}function lb(s){var c=$i(s,1);c!==null&&ni(c,s,1,-1)}function sb(s){var c=qi();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Du,lastRenderedState:s},c.queue=s,s=s.dispatch=KS.bind(null,rr,s),[c.memoizedState,s]}function Fu(s,c,T,N){return s={tag:s,create:c,destroy:T,deps:N,next:null},c=rr.updateQueue,c===null?(c={lastEffect:null,stores:null},rr.updateQueue=c,c.lastEffect=s.next=s):(T=c.lastEffect,T===null?c.lastEffect=s.next=s:(N=T.next,T.next=s,s.next=N,c.lastEffect=s)),s}function ub(){return ri().memoizedState}function Uf(s,c,T,N){var F=qi();rr.flags|=s,F.memoizedState=Fu(1|c,T,void 0,N===void 0?null:N)}function Hf(s,c,T,N){var F=ri();N=N===void 0?null:N;var W=void 0;if(Er!==null){var Q=Er.memoizedState;if(W=Q.destroy,N!==null&&B0(N,Q.deps)){F.memoizedState=Fu(c,T,W,N);return}}rr.flags|=s,F.memoizedState=Fu(1|c,T,W,N)}function cb(s,c){return Uf(8390656,8,s,c)}function V0(s,c){return Hf(2048,8,s,c)}function fb(s,c){return Hf(4,2,s,c)}function db(s,c){return Hf(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,T){return T=T!=null?T.concat([s]):null,Hf(4,4,hb.bind(null,c,s),T)}function q0(){}function gb(s,c){var T=ri();c=c===void 0?null:c;var N=T.memoizedState;return N!==null&&c!==null&&B0(c,N[1])?N[0]:(T.memoizedState=[s,c],s)}function vb(s,c){var T=ri();c=c===void 0?null:c;var N=T.memoizedState;return N!==null&&c!==null&&B0(c,N[1])?N[0]:(s=s(),T.memoizedState=[s,c],s)}function mb(s,c,T){return Qo&21?(sr(T,c)||(T=Jl(),rr.lanes|=T,Jo|=T,s.baseState=!0),c):(s.baseState&&(s.baseState=!1,mn=!0),s.memoizedState=T)}function WS(s,c){var T=_t;_t=T!==0&&4>T?T:4,s(!0);var N=z0.transition;z0.transition={};try{s(!1),c()}finally{_t=T,z0.transition=N}}function yb(){return ri().memoizedState}function YS(s,c,T){var N=to(s);if(T={lane:N,action:T,hasEagerState:!1,eagerState:null,next:null},bb(s))_b(c,T);else if(T=G2(s,c,T,N),T!==null){var F=Qr();ni(T,s,N,F),wb(T,c,N)}}function KS(s,c,T){var N=to(s),F={lane:N,action:T,hasEagerState:!1,eagerState:null,next:null};if(bb(s))_b(c,F);else{var W=s.alternate;if(s.lanes===0&&(W===null||W.lanes===0)&&(W=c.lastRenderedReducer,W!==null))try{var Q=c.lastRenderedState,oe=W(Q,T);if(F.hasEagerState=!0,F.eagerState=oe,sr(oe,Q)){var ye=c.interleaved;ye===null?(F.next=F,R0(c)):(F.next=ye.next,ye.next=F),c.interleaved=F;return}}catch{}finally{}T=G2(s,c,F,N),T!==null&&(F=Qr(),ni(T,s,N,F),wb(T,c,N))}}function bb(s){var c=s.alternate;return s===rr||c!==null&&c===rr}function _b(s,c){Nu=Bf=!0;var T=s.pending;T===null?c.next=c:(c.next=T.next,T.next=c),s.pending=c}function wb(s,c,T){if(T&4194240){var N=c.lanes;N&=s.pendingLanes,T|=N,c.lanes=T,es(s,T)}}var Gf={readContext:ei,useCallback:Kr,useContext:Kr,useEffect:Kr,useImperativeHandle:Kr,useInsertionEffect:Kr,useLayoutEffect:Kr,useMemo:Kr,useReducer:Kr,useRef:Kr,useState:Kr,useDebugValue:Kr,useDeferredValue:Kr,useTransition:Kr,useMutableSource:Kr,useSyncExternalStore:Kr,useId:Kr,unstable_isNewReconciler:!1},XS={readContext:ei,useCallback:function(s,c){return qi().memoizedState=[s,c===void 0?null:c],s},useContext:ei,useEffect:cb,useImperativeHandle:function(s,c,T){return T=T!=null?T.concat([s]):null,Uf(4194308,4,hb.bind(null,c,s),T)},useLayoutEffect:function(s,c){return Uf(4194308,4,s,c)},useInsertionEffect:function(s,c){return Uf(4,2,s,c)},useMemo:function(s,c){var T=qi();return c=c===void 0?null:c,s=s(),T.memoizedState=[s,c],s},useReducer:function(s,c,T){var N=qi();return c=T!==void 0?T(c):c,N.memoizedState=N.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},N.queue=s,s=s.dispatch=YS.bind(null,rr,s),[N.memoizedState,s]},useRef:function(s){var c=qi();return s={current:s},c.memoizedState=s},useState:sb,useDebugValue:q0,useDeferredValue:function(s){return qi().memoizedState=s},useTransition:function(){var s=sb(!1),c=s[0];return s=WS.bind(null,s[1]),qi().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,T){var N=rr,F=qi();if(Kt){if(T===void 0)throw Error(o(407));T=T()}else{if(T=c(),Lr===null)throw Error(o(349));Qo&30||nb(N,c,T)}F.memoizedState=T;var W={value:T,getSnapshot:c};return F.queue=W,cb(ab.bind(null,N,W,s),[s]),N.flags|=2048,Fu(9,ib.bind(null,N,W,T,c),void 0,null),T},useId:function(){var s=qi(),c=Lr.identifierPrefix;if(Kt){var T=pa,N=ha;T=(N&~(1<<32-In(N)-1)).toString(32)+T,c=":"+c+"R"+T,T=Iu++,0<T&&(c+="H"+T.toString(32)),c+=":"}else T=qS++,c=":"+c+"r"+T.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},ZS={readContext:ei,useCallback:gb,useContext:ei,useEffect:V0,useImperativeHandle:pb,useInsertionEffect:fb,useLayoutEffect:db,useMemo:vb,useReducer:G0,useRef:ub,useState:function(){return G0(Du)},useDebugValue:q0,useDeferredValue:function(s){var c=ri();return mb(c,Er.memoizedState,s)},useTransition:function(){var s=G0(Du)[0],c=ri().memoizedState;return[s,c]},useMutableSource:tb,useSyncExternalStore:rb,useId:yb,unstable_isNewReconciler:!1},QS={readContext:ei,useCallback:gb,useContext:ei,useEffect:V0,useImperativeHandle:pb,useInsertionEffect:fb,useLayoutEffect:db,useMemo:vb,useReducer:$0,useRef:ub,useState:function(){return $0(Du)},useDebugValue:q0,useDeferredValue:function(s){var c=ri();return Er===null?c.memoizedState=s:mb(c,Er.memoizedState,s)},useTransition:function(){var s=$0(Du)[0],c=ri().memoizedState;return[s,c]},useMutableSource:tb,useSyncExternalStore:rb,useId:yb,unstable_isNewReconciler:!1};function fs(s,c){try{var T="",N=c;do T+=VS(N),N=N.return;while(N);var F=T}catch(W){F=`
56
+ Error generating stack: `+W.message+`
57
+ `+W.stack}return{value:s,source:c,stack:F,digest:null}}function W0(s,c,T){return{value:s,source:null,stack:T??null,digest:c??null}}function Y0(s,c){try{console.error(c.value)}catch(T){setTimeout(function(){throw T})}}var JS=typeof WeakMap=="function"?WeakMap:Map;function Sb(s,c,T){T=ga(-1,T),T.tag=3,T.payload={element:null};var N=c.value;return T.callback=function(){nd||(nd=!0,p1=N),Y0(s,c)},T}function Eb(s,c,T){T=ga(-1,T),T.tag=3;var N=s.type.getDerivedStateFromError;if(typeof N=="function"){var F=c.value;T.payload=function(){return N(F)},T.callback=function(){Y0(s,c)}}var W=s.stateNode;return W!==null&&typeof W.componentDidCatch=="function"&&(T.callback=function(){Y0(s,c),typeof N!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var Q=c.stack;this.componentDidCatch(c.value,{componentStack:Q!==null?Q:""})}),T}function Ob(s,c,T){var N=s.pingCache;if(N===null){N=s.pingCache=new JS;var F=new Set;N.set(c,F)}else F=N.get(c),F===void 0&&(F=new Set,N.set(c,F));F.has(T)||(F.add(T),s=hE.bind(null,s,c,T),c.then(s,s))}function xb(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 Pb(s,c,T,N,F){return s.mode&1?(s.flags|=65536,s.lanes=F,s):(s===c?s.flags|=65536:(s.flags|=128,T.flags|=131072,T.flags&=-52805,T.tag===1&&(T.alternate===null?T.tag=17:(c=ga(-1,1),c.tag=2,Qa(T,c,1))),T.lanes|=1),s)}var eE=l.ReactCurrentOwner,mn=!1;function un(s,c,T,N){c.child=s===null?J2(c,null,T,N):ss(c,s.child,T,N)}function Cb(s,c,T,N,F){T=T.render;var W=c.ref;return ls(c,F),N=U0(s,c,T,N,W,F),T=H0(),s!==null&&!mn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~F,va(s,c,F)):(Kt&&T&&S0(c),c.flags|=1,un(s,c,N,F),c.child)}function Tb(s,c,T,N,F){if(s===null){var W=T.type;return typeof W=="function"&&!_1(W)&&W.defaultProps===void 0&&T.compare===null&&T.defaultProps===void 0?(c.tag=15,c.type=W,Ab(s,c,W,N,F)):(s=ud(T.type,null,N,c,c.mode,F),s.ref=c.ref,s.return=c,c.child=s)}if(W=s.child,!(s.lanes&F)){var Q=W.memoizedProps;if(T=T.compare,T=T!==null?T:Rf,T(Q,N)&&s.ref===c.ref)return va(s,c,F)}return c.flags|=1,s=no(W,N),s.ref=c.ref,s.return=c,c.child=s}function Ab(s,c,T,N,F){if(s!==null){var W=s.memoizedProps;if(Rf(W,N)&&s.ref===c.ref)if(mn=!1,c.pendingProps=N=W,(s.lanes&F)!==0)s.flags&131072&&(mn=!0);else return c.lanes=s.lanes,va(s,c,F)}return K0(s,c,T,N,F)}function kb(s,c,T){var N=c.pendingProps,F=N.children,W=s!==null?s.memoizedState:null;if(N.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Rt(hs,jn),jn|=T;else{if(!(T&1073741824))return s=W!==null?W.baseLanes|T:T,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Rt(hs,jn),jn|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},N=W!==null?W.baseLanes:T,Rt(hs,jn),jn|=N}else W!==null?(N=W.baseLanes|T,c.memoizedState=null):N=T,Rt(hs,jn),jn|=N;return un(s,c,F,T),c.child}function Rb(s,c){var T=c.ref;(s===null&&T!==null||s!==null&&s.ref!==T)&&(c.flags|=512,c.flags|=2097152)}function K0(s,c,T,N,F){var W=Yt(T)?Kn:mr.current;return W=yi(c,W),ls(c,F),T=U0(s,c,T,N,W,F),N=H0(),s!==null&&!mn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~F,va(s,c,F)):(Kt&&N&&S0(c),c.flags|=1,un(s,c,T,F),c.child)}function Lb(s,c,T,N,F){if(Yt(T)){var W=!0;Zl(c)}else W=!1;if(ls(c,F),c.stateNode===null)Vf(s,c),K2(c,T,N),N0(c,T,N,F),N=!0;else if(s===null){var Q=c.stateNode,oe=c.memoizedProps;Q.props=oe;var ye=Q.context,Ae=T.contextType;typeof Ae=="object"&&Ae!==null?Ae=ei(Ae):(Ae=Yt(T)?Kn:mr.current,Ae=yi(c,Ae));var Ve=T.getDerivedStateFromProps,lt=typeof Ve=="function"||typeof Q.getSnapshotBeforeUpdate=="function";lt||typeof Q.UNSAFE_componentWillReceiveProps!="function"&&typeof Q.componentWillReceiveProps!="function"||(oe!==N||ye!==Ae)&&X2(c,Q,N,Ae),Za=!1;var Be=c.memoizedState;Q.state=Be,If(c,N,Q,F),ye=c.memoizedState,oe!==N||Be!==ye||Br.current||Za?(typeof Ve=="function"&&(M0(c,T,Ve,N),ye=c.memoizedState),(oe=Za||Y2(c,T,oe,N,Be,ye,Ae))?(lt||typeof Q.UNSAFE_componentWillMount!="function"&&typeof Q.componentWillMount!="function"||(typeof Q.componentWillMount=="function"&&Q.componentWillMount(),typeof Q.UNSAFE_componentWillMount=="function"&&Q.UNSAFE_componentWillMount()),typeof Q.componentDidMount=="function"&&(c.flags|=4194308)):(typeof Q.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=N,c.memoizedState=ye),Q.props=N,Q.state=ye,Q.context=Ae,N=oe):(typeof Q.componentDidMount=="function"&&(c.flags|=4194308),N=!1)}else{Q=c.stateNode,$2(s,c),oe=c.memoizedProps,Ae=c.type===c.elementType?oe:Si(c.type,oe),Q.props=Ae,lt=c.pendingProps,Be=Q.context,ye=T.contextType,typeof ye=="object"&&ye!==null?ye=ei(ye):(ye=Yt(T)?Kn:mr.current,ye=yi(c,ye));var $t=T.getDerivedStateFromProps;(Ve=typeof $t=="function"||typeof Q.getSnapshotBeforeUpdate=="function")||typeof Q.UNSAFE_componentWillReceiveProps!="function"&&typeof Q.componentWillReceiveProps!="function"||(oe!==lt||Be!==ye)&&X2(c,Q,N,ye),Za=!1,Be=c.memoizedState,Q.state=Be,If(c,N,Q,F);var jt=c.memoizedState;oe!==lt||Be!==jt||Br.current||Za?(typeof $t=="function"&&(M0(c,T,$t,N),jt=c.memoizedState),(Ae=Za||Y2(c,T,Ae,N,Be,jt,ye)||!1)?(Ve||typeof Q.UNSAFE_componentWillUpdate!="function"&&typeof Q.componentWillUpdate!="function"||(typeof Q.componentWillUpdate=="function"&&Q.componentWillUpdate(N,jt,ye),typeof Q.UNSAFE_componentWillUpdate=="function"&&Q.UNSAFE_componentWillUpdate(N,jt,ye)),typeof Q.componentDidUpdate=="function"&&(c.flags|=4),typeof Q.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof Q.componentDidUpdate!="function"||oe===s.memoizedProps&&Be===s.memoizedState||(c.flags|=4),typeof Q.getSnapshotBeforeUpdate!="function"||oe===s.memoizedProps&&Be===s.memoizedState||(c.flags|=1024),c.memoizedProps=N,c.memoizedState=jt),Q.props=N,Q.state=jt,Q.context=ye,N=Ae):(typeof Q.componentDidUpdate!="function"||oe===s.memoizedProps&&Be===s.memoizedState||(c.flags|=4),typeof Q.getSnapshotBeforeUpdate!="function"||oe===s.memoizedProps&&Be===s.memoizedState||(c.flags|=1024),N=!1)}return X0(s,c,T,N,W,F)}function X0(s,c,T,N,F,W){Rb(s,c);var Q=(c.flags&128)!==0;if(!N&&!Q)return F&&fa(c,T,!1),va(s,c,W);N=c.stateNode,eE.current=c;var oe=Q&&typeof T.getDerivedStateFromError!="function"?null:N.render();return c.flags|=1,s!==null&&Q?(c.child=ss(c,s.child,null,W),c.child=ss(c,null,oe,W)):un(s,c,oe,W),c.memoizedState=N.state,F&&fa(c,T,!0),c.child}function Mb(s){var c=s.stateNode;c.pendingContext?Kl(s,c.pendingContext,c.pendingContext!==c.context):c.context&&Kl(s,c.context,!1),I0(s,c.containerInfo)}function Nb(s,c,T,N,F){return as(),P0(F),c.flags|=256,un(s,c,T,N),c.child}var Z0={dehydrated:null,treeContext:null,retryLane:0};function Q0(s){return{baseLanes:s,cachePool:null,transitions:null}}function Ib(s,c,T){var N=c.pendingProps,F=tr.current,W=!1,Q=(c.flags&128)!==0,oe;if((oe=Q)||(oe=s!==null&&s.memoizedState===null?!1:(F&2)!==0),oe?(W=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(F|=1),Rt(tr,F&1),s===null)return x0(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(c.mode&1?Je(s)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(Q=N.children,s=N.fallback,W?(N=c.mode,W=c.child,Q={mode:"hidden",children:Q},!(N&1)&&W!==null?(W.childLanes=0,W.pendingProps=Q):W=cd(Q,N,0,null),s=nl(s,N,T,null),W.return=c,s.return=c,W.sibling=s,c.child=W,c.child.memoizedState=Q0(T),c.memoizedState=Z0,s):J0(c,Q));if(F=s.memoizedState,F!==null&&(oe=F.dehydrated,oe!==null))return tE(s,c,Q,N,oe,F,T);if(W){W=N.fallback,Q=c.mode,F=s.child,oe=F.sibling;var ye={mode:"hidden",children:N.children};return!(Q&1)&&c.child!==F?(N=c.child,N.childLanes=0,N.pendingProps=ye,c.deletions=null):(N=no(F,ye),N.subtreeFlags=F.subtreeFlags&14680064),oe!==null?W=no(oe,W):(W=nl(W,Q,T,null),W.flags|=2),W.return=c,N.return=c,N.sibling=W,c.child=N,N=W,W=c.child,Q=s.child.memoizedState,Q=Q===null?Q0(T):{baseLanes:Q.baseLanes|T,cachePool:null,transitions:Q.transitions},W.memoizedState=Q,W.childLanes=s.childLanes&~T,c.memoizedState=Z0,N}return W=s.child,s=W.sibling,N=no(W,{mode:"visible",children:N.children}),!(c.mode&1)&&(N.lanes=T),N.return=c,N.sibling=null,s!==null&&(T=c.deletions,T===null?(c.deletions=[s],c.flags|=16):T.push(s)),c.child=N,c.memoizedState=null,N}function J0(s,c){return c=cd({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function $f(s,c,T,N){return N!==null&&P0(N),ss(c,s.child,null,T),s=J0(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function tE(s,c,T,N,F,W,Q){if(T)return c.flags&256?(c.flags&=-257,N=W0(Error(o(422))),$f(s,c,Q,N)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(W=N.fallback,F=c.mode,N=cd({mode:"visible",children:N.children},F,0,null),W=nl(W,F,Q,null),W.flags|=2,N.return=c,W.return=c,N.sibling=W,c.child=N,c.mode&1&&ss(c,s.child,null,Q),c.child.memoizedState=Q0(Q),c.memoizedState=Z0,W);if(!(c.mode&1))return $f(s,c,Q,null);if(Je(F))return N=Qe(F).digest,W=Error(o(419)),N=W0(W,N,void 0),$f(s,c,Q,N);if(T=(Q&s.childLanes)!==0,mn||T){if(N=Lr,N!==null){switch(Q&-Q){case 4:F=2;break;case 16:F=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:F=32;break;case 536870912:F=268435456;break;default:F=0}F=F&(N.suspendedLanes|Q)?0:F,F!==0&&F!==W.retryLane&&(W.retryLane=F,$i(s,F),ni(N,s,F,-1))}return b1(),N=W0(Error(o(421))),$f(s,c,Q,N)}return De(F)?(c.flags|=128,c.child=s.child,c=pE.bind(null,s),At(F,c),null):(s=W.treeContext,ne&&(Jn=Gt(F),Fn=c,Kt=!0,wi=null,ku=!1,s!==null&&(Zn[Qn++]=ha,Zn[Qn++]=pa,Zn[Qn++]=Ko,ha=s.id,pa=s.overflow,Ko=c)),c=J0(c,N.children),c.flags|=4096,c)}function Db(s,c,T){s.lanes|=c;var N=s.alternate;N!==null&&(N.lanes|=c),k0(s.return,c,T)}function e1(s,c,T,N,F){var W=s.memoizedState;W===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:N,tail:T,tailMode:F}:(W.isBackwards=c,W.rendering=null,W.renderingStartTime=0,W.last=N,W.tail=T,W.tailMode=F)}function Fb(s,c,T){var N=c.pendingProps,F=N.revealOrder,W=N.tail;if(un(s,c,N.children,T),N=tr.current,N&2)N=N&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&&Db(s,T,c);else if(s.tag===19)Db(s,T,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}N&=1}if(Rt(tr,N),!(c.mode&1))c.memoizedState=null;else switch(F){case"forwards":for(T=c.child,F=null;T!==null;)s=T.alternate,s!==null&&jf(s)===null&&(F=T),T=T.sibling;T=F,T===null?(F=c.child,c.child=null):(F=T.sibling,T.sibling=null),e1(c,!1,F,T,W);break;case"backwards":for(T=null,F=c.child,c.child=null;F!==null;){if(s=F.alternate,s!==null&&jf(s)===null){c.child=F;break}s=F.sibling,F.sibling=T,T=F,F=s}e1(c,!0,T,null,W);break;case"together":e1(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Vf(s,c){!(c.mode&1)&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function va(s,c,T){if(s!==null&&(c.dependencies=s.dependencies),Jo|=c.lanes,!(T&c.childLanes))return null;if(s!==null&&c.child!==s.child)throw Error(o(153));if(c.child!==null){for(s=c.child,T=no(s,s.pendingProps),c.child=T,T.return=c;s.sibling!==null;)s=s.sibling,T=T.sibling=no(s,s.pendingProps),T.return=c;T.sibling=null}return c.child}function rE(s,c,T){switch(c.tag){case 3:Mb(c),as();break;case 5:eb(c);break;case 1:Yt(c.type)&&Zl(c);break;case 4:I0(c,c.stateNode.containerInfo);break;case 10:H2(c,c.type._context,c.memoizedProps.value);break;case 13:var N=c.memoizedState;if(N!==null)return N.dehydrated!==null?(Rt(tr,tr.current&1),c.flags|=128,null):T&c.child.childLanes?Ib(s,c,T):(Rt(tr,tr.current&1),s=va(s,c,T),s!==null?s.sibling:null);Rt(tr,tr.current&1);break;case 19:if(N=(T&c.childLanes)!==0,s.flags&128){if(N)return Fb(s,c,T);c.flags|=128}var F=c.memoizedState;if(F!==null&&(F.rendering=null,F.tail=null,F.lastEffect=null),Rt(tr,tr.current),N)break;return null;case 22:case 23:return c.lanes=0,kb(s,c,T)}return va(s,c,T)}function Wi(s){s.flags|=4}function jb(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 ju,zu,qf,Wf;if(ee)ju=function(s,c){for(var T=c.child;T!==null;){if(T.tag===5||T.tag===6)B(s,T.stateNode);else if(T.tag!==4&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===c)break;for(;T.sibling===null;){if(T.return===null||T.return===c)return;T=T.return}T.sibling.return=T.return,T=T.sibling}},zu=function(){},qf=function(s,c,T,N,F){if(s=s.memoizedProps,s!==N){var W=c.stateNode,Q=Vi(ti.current);T=$(W,T,s,N,F,Q),(c.updateQueue=T)&&Wi(c)}},Wf=function(s,c,T,N){T!==N&&Wi(c)};else if(re){ju=function(s,c,T,N){for(var F=c.child;F!==null;){if(F.tag===5){var W=F.stateNode;T&&N&&(W=jr(W,F.type,F.memoizedProps,F)),B(s,W)}else if(F.tag===6)W=F.stateNode,T&&N&&(W=Jt(W,F.memoizedProps,F)),B(s,W);else if(F.tag!==4){if(F.tag===22&&F.memoizedState!==null)W=F.child,W!==null&&(W.return=F),ju(s,F,!0,!0);else if(F.child!==null){F.child.return=F,F=F.child;continue}}if(F===c)break;for(;F.sibling===null;){if(F.return===null||F.return===c)return;F=F.return}F.sibling.return=F.return,F=F.sibling}};var zb=function(s,c,T,N){for(var F=c.child;F!==null;){if(F.tag===5){var W=F.stateNode;T&&N&&(W=jr(W,F.type,F.memoizedProps,F)),Xe(s,W)}else if(F.tag===6)W=F.stateNode,T&&N&&(W=Jt(W,F.memoizedProps,F)),Xe(s,W);else if(F.tag!==4){if(F.tag===22&&F.memoizedState!==null)W=F.child,W!==null&&(W.return=F),zb(s,F,!0,!0);else if(F.child!==null){F.child.return=F,F=F.child;continue}}if(F===c)break;for(;F.sibling===null;){if(F.return===null||F.return===c)return;F=F.return}F.sibling.return=F.return,F=F.sibling}};zu=function(s,c){var T=c.stateNode;if(!jb(s,c)){s=T.containerInfo;var N=ze(s);zb(N,c,!1,!1),T.pendingChildren=N,Wi(c),ot(s,N)}},qf=function(s,c,T,N,F){var W=s.stateNode,Q=s.memoizedProps;if((s=jb(s,c))&&Q===N)c.stateNode=W;else{var oe=c.stateNode,ye=Vi(ti.current),Ae=null;Q!==N&&(Ae=$(oe,T,Q,N,F,ye)),s&&Ae===null?c.stateNode=W:(W=ke(W,Ae,T,Q,N,c,s,oe),M(W,T,N,F,ye)&&Wi(c),c.stateNode=W,s?Wi(c):ju(W,c,!1,!1))}},Wf=function(s,c,T,N){T!==N?(s=Vi(us.current),T=Vi(ti.current),c.stateNode=V(N,s,T,c),Wi(c)):c.stateNode=s.stateNode}}else zu=function(){},qf=function(){},Wf=function(){};function Bu(s,c){if(!Kt)switch(s.tailMode){case"hidden":c=s.tail;for(var T=null;c!==null;)c.alternate!==null&&(T=c),c=c.sibling;T===null?s.tail=null:T.sibling=null;break;case"collapsed":T=s.tail;for(var N=null;T!==null;)T.alternate!==null&&(N=T),T=T.sibling;N===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:N.sibling=null}}function Xr(s){var c=s.alternate!==null&&s.alternate.child===s.child,T=0,N=0;if(c)for(var F=s.child;F!==null;)T|=F.lanes|F.childLanes,N|=F.subtreeFlags&14680064,N|=F.flags&14680064,F.return=s,F=F.sibling;else for(F=s.child;F!==null;)T|=F.lanes|F.childLanes,N|=F.subtreeFlags,N|=F.flags,F.return=s,F=F.sibling;return s.subtreeFlags|=N,s.childLanes=T,c}function nE(s,c,T){var N=c.pendingProps;switch(E0(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xr(c),null;case 1:return Yt(c.type)&&bi(),Xr(c),null;case 3:return T=c.stateNode,cs(),Nt(Br),Nt(mr),j0(),T.pendingContext&&(T.context=T.pendingContext,T.pendingContext=null),(s===null||s.child===null)&&(kf(c)?Wi(c):s===null||s.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,wi!==null&&(m1(wi),wi=null))),zu(s,c),Xr(c),null;case 5:D0(c),T=Vi(us.current);var F=c.type;if(s!==null&&c.stateNode!=null)qf(s,c,F,N,T),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!N){if(c.stateNode===null)throw Error(o(166));return Xr(c),null}if(s=Vi(ti.current),kf(c)){if(!ne)throw Error(o(175));s=zr(c.stateNode,c.type,c.memoizedProps,T,s,c,!ku),c.updateQueue=s,s!==null&&Wi(c)}else{var W=I(F,N,T,s,c);ju(W,c,!1,!1),c.stateNode=W,M(W,F,N,T,s)&&Wi(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Xr(c),null;case 6:if(s&&c.stateNode!=null)Wf(s,c,s.memoizedProps,N);else{if(typeof N!="string"&&c.stateNode===null)throw Error(o(166));if(s=Vi(us.current),T=Vi(ti.current),kf(c)){if(!ne)throw Error(o(176));if(s=c.stateNode,T=c.memoizedProps,(N=vr(s,T,c,!ku))&&(F=Fn,F!==null))switch(F.tag){case 3:vi(F.stateNode.containerInfo,s,T,(F.mode&1)!==0);break;case 5:Wl(F.type,F.memoizedProps,F.stateNode,s,T,(F.mode&1)!==0)}N&&Wi(c)}else c.stateNode=V(N,s,T,c)}return Xr(c),null;case 13:if(Nt(tr),N=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Kt&&Jn!==null&&c.mode&1&&!(c.flags&128))U2(),as(),c.flags|=98560,F=!1;else if(F=kf(c),N!==null&&N.dehydrated!==null){if(s===null){if(!F)throw Error(o(318));if(!ne)throw Error(o(344));if(F=c.memoizedState,F=F!==null?F.dehydrated:null,!F)throw Error(o(317));kr(F,c)}else as(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Xr(c),F=!1}else wi!==null&&(m1(wi),wi=null),F=!0;if(!F)return c.flags&65536?c:null}return c.flags&128?(c.lanes=T,c):(T=N!==null,T!==(s!==null&&s.memoizedState!==null)&&T&&(c.child.flags|=8192,c.mode&1&&(s===null||tr.current&1?Or===0&&(Or=3):b1())),c.updateQueue!==null&&(c.flags|=4),Xr(c),null);case 4:return cs(),zu(s,c),s===null&&pe(c.stateNode.containerInfo),Xr(c),null;case 10:return A0(c.type._context),Xr(c),null;case 17:return Yt(c.type)&&bi(),Xr(c),null;case 19:if(Nt(tr),F=c.memoizedState,F===null)return Xr(c),null;if(N=(c.flags&128)!==0,W=F.rendering,W===null)if(N)Bu(F,!1);else{if(Or!==0||s!==null&&s.flags&128)for(s=c.child;s!==null;){if(W=jf(s),W!==null){for(c.flags|=128,Bu(F,!1),s=W.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),c.subtreeFlags=0,s=T,T=c.child;T!==null;)N=T,F=s,N.flags&=14680066,W=N.alternate,W===null?(N.childLanes=0,N.lanes=F,N.child=null,N.subtreeFlags=0,N.memoizedProps=null,N.memoizedState=null,N.updateQueue=null,N.dependencies=null,N.stateNode=null):(N.childLanes=W.childLanes,N.lanes=W.lanes,N.child=W.child,N.subtreeFlags=0,N.deletions=null,N.memoizedProps=W.memoizedProps,N.memoizedState=W.memoizedState,N.updateQueue=W.updateQueue,N.type=W.type,F=W.dependencies,N.dependencies=F===null?null:{lanes:F.lanes,firstContext:F.firstContext}),T=T.sibling;return Rt(tr,tr.current&1|2),c.child}s=s.sibling}F.tail!==null&&dr()>h1&&(c.flags|=128,N=!0,Bu(F,!1),c.lanes=4194304)}else{if(!N)if(s=jf(W),s!==null){if(c.flags|=128,N=!0,s=s.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),Bu(F,!0),F.tail===null&&F.tailMode==="hidden"&&!W.alternate&&!Kt)return Xr(c),null}else 2*dr()-F.renderingStartTime>h1&&T!==1073741824&&(c.flags|=128,N=!0,Bu(F,!1),c.lanes=4194304);F.isBackwards?(W.sibling=c.child,c.child=W):(s=F.last,s!==null?s.sibling=W:c.child=W,F.last=W)}return F.tail!==null?(c=F.tail,F.rendering=c,F.tail=c.sibling,F.renderingStartTime=dr(),c.sibling=null,s=tr.current,Rt(tr,N?s&1|2:s&1),c):(Xr(c),null);case 22:case 23:return y1(),T=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==T&&(c.flags|=8192),T&&c.mode&1?jn&1073741824&&(Xr(c),ee&&c.subtreeFlags&6&&(c.flags|=8192)):Xr(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}function iE(s,c){switch(E0(c),c.tag){case 1:return Yt(c.type)&&bi(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return cs(),Nt(Br),Nt(mr),j0(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return D0(c),null;case 13:if(Nt(tr),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(o(340));as()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return Nt(tr),null;case 4:return cs(),null;case 10:return A0(c.type._context),null;case 22:case 23:return y1(),null;case 24:return null;default:return null}}var Yf=!1,Zr=!1,aE=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function ds(s,c){var T=s.ref;if(T!==null)if(typeof T=="function")try{T(null)}catch(N){Xt(s,c,N)}else T.current=null}function t1(s,c,T){try{T()}catch(N){Xt(s,c,N)}}var Bb=!1;function oE(s,c){for(q(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 T=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(T!==null){var N=T.memoizedProps,F=T.memoizedState,W=s.stateNode,Q=W.getSnapshotBeforeUpdate(s.elementType===s.type?N:Si(s.type,N),F);W.__reactInternalSnapshotBeforeUpdate=Q}break;case 3:ee&&We(s.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(oe){Xt(s,s.return,oe)}if(c=s.sibling,c!==null){c.return=s.return,Ge=c;break}Ge=s.return}return T=Bb,Bb=!1,T}function Uu(s,c,T){var N=c.updateQueue;if(N=N!==null?N.lastEffect:null,N!==null){var F=N=N.next;do{if((F.tag&s)===s){var W=F.destroy;F.destroy=void 0,W!==void 0&&t1(c,T,W)}F=F.next}while(F!==N)}}function Kf(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var T=c=c.next;do{if((T.tag&s)===s){var N=T.create;T.destroy=N()}T=T.next}while(T!==c)}}function r1(s){var c=s.ref;if(c!==null){var T=s.stateNode;switch(s.tag){case 5:s=j(T);break;default:s=T}typeof c=="function"?c(s):c.current=s}}function Ub(s){var c=s.alternate;c!==null&&(s.alternate=null,Ub(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 Hb(s){return s.tag===5||s.tag===3||s.tag===4}function Gb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Hb(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 n1(s,c,T){var N=s.tag;if(N===5||N===6)s=s.stateNode,c?he(T,s,c):xt(T,s);else if(N!==4&&(s=s.child,s!==null))for(n1(s,c,T),s=s.sibling;s!==null;)n1(s,c,T),s=s.sibling}function i1(s,c,T){var N=s.tag;if(N===5||N===6)s=s.stateNode,c?le(T,s,c):Ie(T,s);else if(N!==4&&(s=s.child,s!==null))for(i1(s,c,T),s=s.sibling;s!==null;)i1(s,c,T),s=s.sibling}var Ur=null,Ei=!1;function Yi(s,c,T){for(T=T.child;T!==null;)a1(s,c,T),T=T.sibling}function a1(s,c,T){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Ne,T)}catch{}switch(T.tag){case 5:Zr||ds(T,c);case 6:if(ee){var N=Ur,F=Ei;Ur=null,Yi(s,c,T),Ur=N,Ei=F,Ur!==null&&(Ei?Ee(Ur,T.stateNode):nt(Ur,T.stateNode))}else Yi(s,c,T);break;case 18:ee&&Ur!==null&&(Ei?Yn(Ur,T.stateNode):ln(Ur,T.stateNode));break;case 4:ee?(N=Ur,F=Ei,Ur=T.stateNode.containerInfo,Ei=!0,Yi(s,c,T),Ur=N,Ei=F):(re&&(N=T.stateNode.containerInfo,F=ze(N),Et(N,F)),Yi(s,c,T));break;case 0:case 11:case 14:case 15:if(!Zr&&(N=T.updateQueue,N!==null&&(N=N.lastEffect,N!==null))){F=N=N.next;do{var W=F,Q=W.destroy;W=W.tag,Q!==void 0&&(W&2||W&4)&&t1(T,c,Q),F=F.next}while(F!==N)}Yi(s,c,T);break;case 1:if(!Zr&&(ds(T,c),N=T.stateNode,typeof N.componentWillUnmount=="function"))try{N.props=T.memoizedProps,N.state=T.memoizedState,N.componentWillUnmount()}catch(oe){Xt(T,c,oe)}Yi(s,c,T);break;case 21:Yi(s,c,T);break;case 22:T.mode&1?(Zr=(N=Zr)||T.memoizedState!==null,Yi(s,c,T),Zr=N):Yi(s,c,T);break;default:Yi(s,c,T)}}function $b(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var T=s.stateNode;T===null&&(T=s.stateNode=new aE),c.forEach(function(N){var F=gE.bind(null,s,N);T.has(N)||(T.add(N),N.then(F,F))})}}function Oi(s,c){var T=c.deletions;if(T!==null)for(var N=0;N<T.length;N++){var F=T[N];try{var W=s,Q=c;if(ee){var oe=Q;e:for(;oe!==null;){switch(oe.tag){case 5:Ur=oe.stateNode,Ei=!1;break e;case 3:Ur=oe.stateNode.containerInfo,Ei=!0;break e;case 4:Ur=oe.stateNode.containerInfo,Ei=!0;break e}oe=oe.return}if(Ur===null)throw Error(o(160));a1(W,Q,F),Ur=null,Ei=!1}else a1(W,Q,F);var ye=F.alternate;ye!==null&&(ye.return=null),F.return=null}catch(Ae){Xt(F,c,Ae)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Vb(c,s),c=c.sibling}function Vb(s,c){var T=s.alternate,N=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Oi(c,s),Ki(s),N&4){try{Uu(3,s,s.return),Kf(3,s)}catch(Be){Xt(s,s.return,Be)}try{Uu(5,s,s.return)}catch(Be){Xt(s,s.return,Be)}}break;case 1:Oi(c,s),Ki(s),N&512&&T!==null&&ds(T,T.return);break;case 5:if(Oi(c,s),Ki(s),N&512&&T!==null&&ds(T,T.return),ee){if(s.flags&32){var F=s.stateNode;try{je(F)}catch(Be){Xt(s,s.return,Be)}}if(N&4&&(F=s.stateNode,F!=null)){var W=s.memoizedProps;if(T=T!==null?T.memoizedProps:W,N=s.type,c=s.updateQueue,s.updateQueue=null,c!==null)try{Ht(F,c,N,T,W,s)}catch(Be){Xt(s,s.return,Be)}}}break;case 6:if(Oi(c,s),Ki(s),N&4&&ee){if(s.stateNode===null)throw Error(o(162));F=s.stateNode,W=s.memoizedProps,T=T!==null?T.memoizedProps:W;try{tt(F,T,W)}catch(Be){Xt(s,s.return,Be)}}break;case 3:if(Oi(c,s),Ki(s),N&4){if(ee&&ne&&T!==null&&T.memoizedState.isDehydrated)try{gi(c.containerInfo)}catch(Be){Xt(s,s.return,Be)}if(re){F=c.containerInfo,W=c.pendingChildren;try{Et(F,W)}catch(Be){Xt(s,s.return,Be)}}}break;case 4:if(Oi(c,s),Ki(s),N&4&&re){W=s.stateNode,F=W.containerInfo,W=W.pendingChildren;try{Et(F,W)}catch(Be){Xt(s,s.return,Be)}}break;case 13:Oi(c,s),Ki(s),F=s.child,F.flags&8192&&(W=F.memoizedState!==null,F.stateNode.isHidden=W,!W||F.alternate!==null&&F.alternate.memoizedState!==null||(d1=dr())),N&4&&$b(s);break;case 22:var Q=T!==null&&T.memoizedState!==null;if(s.mode&1?(Zr=(T=Zr)||Q,Oi(c,s),Zr=T):Oi(c,s),Ki(s),N&8192){if(T=s.memoizedState!==null,(s.stateNode.isHidden=T)&&!Q&&s.mode&1)for(Ge=s,N=s.child;N!==null;){for(c=Ge=N;Ge!==null;){Q=Ge;var oe=Q.child;switch(Q.tag){case 0:case 11:case 14:case 15:Uu(4,Q,Q.return);break;case 1:ds(Q,Q.return);var ye=Q.stateNode;if(typeof ye.componentWillUnmount=="function"){var Ae=Q,Ve=Q.return;try{var lt=Ae;ye.props=lt.memoizedProps,ye.state=lt.memoizedState,ye.componentWillUnmount()}catch(Be){Xt(Ae,Ve,Be)}}break;case 5:ds(Q,Q.return);break;case 22:if(Q.memoizedState!==null){Yb(c);continue}}oe!==null?(oe.return=Q,Ge=oe):Yb(c)}N=N.sibling}if(ee){e:if(N=null,ee)for(c=s;;){if(c.tag===5){if(N===null){N=c;try{F=c.stateNode,T?Le(F):Ze(c.stateNode,c.memoizedProps)}catch(Be){Xt(s,s.return,Be)}}}else if(c.tag===6){if(N===null)try{W=c.stateNode,T?we(W):Oe(W,c.memoizedProps)}catch(Be){Xt(s,s.return,Be)}}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;N===c&&(N=null),c=c.return}N===c&&(N=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:Oi(c,s),Ki(s),N&4&&$b(s);break;case 21:break;default:Oi(c,s),Ki(s)}}function Ki(s){var c=s.flags;if(c&2){try{if(ee){e:{for(var T=s.return;T!==null;){if(Hb(T)){var N=T;break e}T=T.return}throw Error(o(160))}switch(N.tag){case 5:var F=N.stateNode;N.flags&32&&(je(F),N.flags&=-33);var W=Gb(s);i1(s,W,F);break;case 3:case 4:var Q=N.stateNode.containerInfo,oe=Gb(s);n1(s,oe,Q);break;default:throw Error(o(161))}}}catch(ye){Xt(s,s.return,ye)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function lE(s,c,T){Ge=s,qb(s)}function qb(s,c,T){for(var N=(s.mode&1)!==0;Ge!==null;){var F=Ge,W=F.child;if(F.tag===22&&N){var Q=F.memoizedState!==null||Yf;if(!Q){var oe=F.alternate,ye=oe!==null&&oe.memoizedState!==null||Zr;oe=Yf;var Ae=Zr;if(Yf=Q,(Zr=ye)&&!Ae)for(Ge=F;Ge!==null;)Q=Ge,ye=Q.child,Q.tag===22&&Q.memoizedState!==null?Kb(F):ye!==null?(ye.return=Q,Ge=ye):Kb(F);for(;W!==null;)Ge=W,qb(W),W=W.sibling;Ge=F,Yf=oe,Zr=Ae}Wb(s)}else F.subtreeFlags&8772&&W!==null?(W.return=F,Ge=W):Wb(s)}}function Wb(s){for(;Ge!==null;){var c=Ge;if(c.flags&8772){var T=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:Zr||Kf(5,c);break;case 1:var N=c.stateNode;if(c.flags&4&&!Zr)if(T===null)N.componentDidMount();else{var F=c.elementType===c.type?T.memoizedProps:Si(c.type,T.memoizedProps);N.componentDidUpdate(F,T.memoizedState,N.__reactInternalSnapshotBeforeUpdate)}var W=c.updateQueue;W!==null&&q2(c,W,N);break;case 3:var Q=c.updateQueue;if(Q!==null){if(T=null,c.child!==null)switch(c.child.tag){case 5:T=j(c.child.stateNode);break;case 1:T=c.child.stateNode}q2(c,Q,T)}break;case 5:var oe=c.stateNode;T===null&&c.flags&4&&St(oe,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(ne&&c.memoizedState===null){var ye=c.alternate;if(ye!==null){var Ae=ye.memoizedState;if(Ae!==null){var Ve=Ae.dehydrated;Ve!==null&&vn(Ve)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Zr||c.flags&512&&r1(c)}catch(lt){Xt(c,c.return,lt)}}if(c===s){Ge=null;break}if(T=c.sibling,T!==null){T.return=c.return,Ge=T;break}Ge=c.return}}function Yb(s){for(;Ge!==null;){var c=Ge;if(c===s){Ge=null;break}var T=c.sibling;if(T!==null){T.return=c.return,Ge=T;break}Ge=c.return}}function Kb(s){for(;Ge!==null;){var c=Ge;try{switch(c.tag){case 0:case 11:case 15:var T=c.return;try{Kf(4,c)}catch(ye){Xt(c,T,ye)}break;case 1:var N=c.stateNode;if(typeof N.componentDidMount=="function"){var F=c.return;try{N.componentDidMount()}catch(ye){Xt(c,F,ye)}}var W=c.return;try{r1(c)}catch(ye){Xt(c,W,ye)}break;case 5:var Q=c.return;try{r1(c)}catch(ye){Xt(c,Q,ye)}}}catch(ye){Xt(c,c.return,ye)}if(c===s){Ge=null;break}var oe=c.sibling;if(oe!==null){oe.return=c.return,Ge=oe;break}Ge=c.return}}var Xf=0,Zf=1,Qf=2,Jf=3,ed=4;if(typeof Symbol=="function"&&Symbol.for){var Hu=Symbol.for;Xf=Hu("selector.component"),Zf=Hu("selector.has_pseudo_class"),Qf=Hu("selector.role"),Jf=Hu("selector.test_id"),ed=Hu("selector.text")}function o1(s){var c=de(s);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(o(364));return c}if(s=ge(s),s===null)throw Error(o(362));return s.stateNode.current}function l1(s,c){switch(c.$$typeof){case Xf:if(s.type===c.value)return!0;break;case Zf:e:{c=c.value,s=[s,0];for(var T=0;T<s.length;){var N=s[T++],F=s[T++],W=c[F];if(N.tag!==5||!be(N)){for(;W!=null&&l1(N,W);)F++,W=c[F];if(F===c.length){c=!0;break e}else for(N=N.child;N!==null;)s.push(N,F),N=N.sibling}}c=!1}return c;case Qf:if(s.tag===5&&se(s.stateNode,c.value))return!0;break;case ed:if((s.tag===5||s.tag===6)&&(s=ue(s),s!==null&&0<=s.indexOf(c.value)))return!0;break;case Jf: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 s1(s){switch(s.$$typeof){case Xf:return"<"+(P(s.value)||"Unknown")+">";case Zf:return":has("+(s1(s)||"")+")";case Qf:return'[role="'+s.value+'"]';case ed:return'"'+s.value+'"';case Jf:return'[data-testname="'+s.value+'"]';default:throw Error(o(365))}}function Xb(s,c){var T=[];s=[s,0];for(var N=0;N<s.length;){var F=s[N++],W=s[N++],Q=c[W];if(F.tag!==5||!be(F)){for(;Q!=null&&l1(F,Q);)W++,Q=c[W];if(W===c.length)T.push(F);else for(F=F.child;F!==null;)s.push(F,W),F=F.sibling}}return T}function u1(s,c){if(!ve)throw Error(o(363));s=o1(s),s=Xb(s,c),c=[],s=Array.from(s);for(var T=0;T<s.length;){var N=s[T++];if(N.tag===5)be(N)||c.push(N.stateNode);else for(N=N.child;N!==null;)s.push(N),N=N.sibling}return c}var sE=Math.ceil,td=l.ReactCurrentDispatcher,c1=l.ReactCurrentOwner,hr=l.ReactCurrentBatchConfig,gt=0,Lr=null,br=null,Hr=0,jn=0,hs=sn(0),Or=0,Gu=null,Jo=0,rd=0,f1=0,$u=null,yn=null,d1=0,h1=1/0,ma=null;function ps(){h1=dr()+500}var nd=!1,p1=null,Ja=null,id=!1,eo=null,ad=0,Vu=0,g1=null,od=-1,ld=0;function Qr(){return gt&6?dr():od!==-1?od:od=dr()}function to(s){return s.mode&1?gt&2&&Hr!==0?Hr&-Hr:$S.transition!==null?(ld===0&&(ld=Jl()),ld):(s=_t,s!==0?s:Me()):1}function ni(s,c,T,N){if(50<Vu)throw Vu=0,g1=null,Error(o(185));Dn(s,T,N),(!(gt&2)||s!==Lr)&&(s===Lr&&(!(gt&2)&&(rd|=T),Or===4&&ro(s,Hr)),bn(s,N),T===1&&gt===0&&!(c.mode&1)&&(ps(),_i&&Gi()))}function bn(s,c){var T=s.callbackNode;b0(s,c);var N=Yo(s,s===Lr?Hr:0);if(N===0)T!==null&&Xn(T),s.callbackNode=null,s.callbackPriority=0;else if(c=N&-N,s.callbackPriority!==c){if(T!=null&&Xn(T),c===1)s.tag===0?GS(Qb.bind(null,s)):w0(Qb.bind(null,s)),fe?ie(function(){!(gt&6)&&Gi()}):Xa(ts,Gi),T=null;else{switch(xf(N)){case 1:T=ts;break;case 4:T=_0;break;case 16:T=ae;break;case 536870912:T=Te;break;default:T=ae}T=l3(T,Zb.bind(null,s))}s.callbackPriority=c,s.callbackNode=T}}function Zb(s,c){if(od=-1,ld=0,gt&6)throw Error(o(327));var T=s.callbackNode;if(rl()&&s.callbackNode!==T)return null;var N=Yo(s,s===Lr?Hr:0);if(N===0)return null;if(N&30||N&s.expiredLanes||c)c=sd(s,N);else{c=N;var F=gt;gt|=2;var W=t3();(Lr!==s||Hr!==c)&&(ma=null,ps(),el(s,c));do try{fE();break}catch(oe){e3(s,oe)}while(!0);T0(),td.current=W,gt=F,br!==null?c=0:(Lr=null,Hr=0,c=Or)}if(c!==0){if(c===2&&(F=Ka(s),F!==0&&(N=F,c=v1(s,F))),c===1)throw T=Gu,el(s,0),ro(s,N),bn(s,dr()),T;if(c===6)ro(s,N);else{if(F=s.current.alternate,!(N&30)&&!uE(F)&&(c=sd(s,N),c===2&&(W=Ka(s),W!==0&&(N=W,c=v1(s,W))),c===1))throw T=Gu,el(s,0),ro(s,N),bn(s,dr()),T;switch(s.finishedWork=F,s.finishedLanes=N,c){case 0:case 1:throw Error(o(345));case 2:tl(s,yn,ma);break;case 3:if(ro(s,N),(N&130023424)===N&&(c=d1+500-dr(),10<c)){if(Yo(s,0)!==0)break;if(F=s.suspendedLanes,(F&N)!==N){Qr(),s.pingedLanes|=s.suspendedLanes&F;break}s.timeoutHandle=H(tl.bind(null,s,yn,ma),c);break}tl(s,yn,ma);break;case 4:if(ro(s,N),(N&4194240)===N)break;for(c=s.eventTimes,F=-1;0<N;){var Q=31-In(N);W=1<<Q,Q=c[Q],Q>F&&(F=Q),N&=~W}if(N=F,N=dr()-N,N=(120>N?120:480>N?480:1080>N?1080:1920>N?1920:3e3>N?3e3:4320>N?4320:1960*sE(N/1960))-N,10<N){s.timeoutHandle=H(tl.bind(null,s,yn,ma),N);break}tl(s,yn,ma);break;case 5:tl(s,yn,ma);break;default:throw Error(o(329))}}}return bn(s,dr()),s.callbackNode===T?Zb.bind(null,s):null}function v1(s,c){var T=$u;return s.current.memoizedState.isDehydrated&&(el(s,c).flags|=256),s=sd(s,c),s!==2&&(c=yn,yn=T,c!==null&&m1(c)),s}function m1(s){yn===null?yn=s:yn.push.apply(yn,s)}function uE(s){for(var c=s;;){if(c.flags&16384){var T=c.updateQueue;if(T!==null&&(T=T.stores,T!==null))for(var N=0;N<T.length;N++){var F=T[N],W=F.getSnapshot;F=F.value;try{if(!sr(W(),F))return!1}catch{return!1}}}if(T=c.child,c.subtreeFlags&16384&&T!==null)T.return=c,c=T;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 ro(s,c){for(c&=~f1,c&=~rd,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var T=31-In(c),N=1<<T;s[T]=-1,c&=~N}}function Qb(s){if(gt&6)throw Error(o(327));rl();var c=Yo(s,0);if(!(c&1))return bn(s,dr()),null;var T=sd(s,c);if(s.tag!==0&&T===2){var N=Ka(s);N!==0&&(c=N,T=v1(s,N))}if(T===1)throw T=Gu,el(s,0),ro(s,c),bn(s,dr()),T;if(T===6)throw Error(o(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,tl(s,yn,ma),bn(s,dr()),null}function Jb(s){eo!==null&&eo.tag===0&&!(gt&6)&&rl();var c=gt;gt|=1;var T=hr.transition,N=_t;try{if(hr.transition=null,_t=1,s)return s()}finally{_t=N,hr.transition=T,gt=c,!(gt&6)&&Gi()}}function y1(){jn=hs.current,Nt(hs)}function el(s,c){s.finishedWork=null,s.finishedLanes=0;var T=s.timeoutHandle;if(T!==Z&&(s.timeoutHandle=Z,X(T)),br!==null)for(T=br.return;T!==null;){var N=T;switch(E0(N),N.tag){case 1:N=N.type.childContextTypes,N!=null&&bi();break;case 3:cs(),Nt(Br),Nt(mr),j0();break;case 5:D0(N);break;case 4:cs();break;case 13:Nt(tr);break;case 19:Nt(tr);break;case 10:A0(N.type._context);break;case 22:case 23:y1()}T=T.return}if(Lr=s,br=s=no(s.current,null),Hr=jn=c,Or=0,Gu=null,f1=rd=Jo=0,yn=$u=null,Zo!==null){for(c=0;c<Zo.length;c++)if(T=Zo[c],N=T.interleaved,N!==null){T.interleaved=null;var F=N.next,W=T.pending;if(W!==null){var Q=W.next;W.next=F,N.next=Q}T.pending=N}Zo=null}return s}function e3(s,c){do{var T=br;try{if(T0(),zf.current=Gf,Bf){for(var N=rr.memoizedState;N!==null;){var F=N.queue;F!==null&&(F.pending=null),N=N.next}Bf=!1}if(Qo=0,Rr=Er=rr=null,Nu=!1,Iu=0,c1.current=null,T===null||T.return===null){Or=1,Gu=c,br=null;break}e:{var W=s,Q=T.return,oe=T,ye=c;if(c=Hr,oe.flags|=32768,ye!==null&&typeof ye=="object"&&typeof ye.then=="function"){var Ae=ye,Ve=oe,lt=Ve.tag;if(!(Ve.mode&1)&&(lt===0||lt===11||lt===15)){var Be=Ve.alternate;Be?(Ve.updateQueue=Be.updateQueue,Ve.memoizedState=Be.memoizedState,Ve.lanes=Be.lanes):(Ve.updateQueue=null,Ve.memoizedState=null)}var $t=xb(Q);if($t!==null){$t.flags&=-257,Pb($t,Q,oe,W,c),$t.mode&1&&Ob(W,Ae,c),c=$t,ye=Ae;var jt=c.updateQueue;if(jt===null){var _n=new Set;_n.add(ye),c.updateQueue=_n}else jt.add(ye);break e}else{if(!(c&1)){Ob(W,Ae,c),b1();break e}ye=Error(o(426))}}else if(Kt&&oe.mode&1){var ya=xb(Q);if(ya!==null){!(ya.flags&65536)&&(ya.flags|=256),Pb(ya,Q,oe,W,c),P0(fs(ye,oe));break e}}W=ye=fs(ye,oe),Or!==4&&(Or=2),$u===null?$u=[W]:$u.push(W),W=Q;do{switch(W.tag){case 3:W.flags|=65536,c&=-c,W.lanes|=c;var me=Sb(W,ye,c);V2(W,me);break e;case 1:oe=ye;var ce=W.type,_e=W.stateNode;if(!(W.flags&128)&&(typeof ce.getDerivedStateFromError=="function"||_e!==null&&typeof _e.componentDidCatch=="function"&&(Ja===null||!Ja.has(_e)))){W.flags|=65536,c&=-c,W.lanes|=c;var Ue=Eb(W,oe,c);V2(W,Ue);break e}}W=W.return}while(W!==null)}n3(T)}catch(et){c=et,br===T&&T!==null&&(br=T=T.return);continue}break}while(!0)}function t3(){var s=td.current;return td.current=Gf,s===null?Gf:s}function b1(){(Or===0||Or===3||Or===2)&&(Or=4),Lr===null||!(Jo&268435455)&&!(rd&268435455)||ro(Lr,Hr)}function sd(s,c){var T=gt;gt|=2;var N=t3();(Lr!==s||Hr!==c)&&(ma=null,el(s,c));do try{cE();break}catch(F){e3(s,F)}while(!0);if(T0(),gt=T,td.current=N,br!==null)throw Error(o(261));return Lr=null,Hr=0,Or}function cE(){for(;br!==null;)r3(br)}function fE(){for(;br!==null&&!Pf();)r3(br)}function r3(s){var c=o3(s.alternate,s,jn);s.memoizedProps=s.pendingProps,c===null?n3(s):br=c,c1.current=null}function n3(s){var c=s;do{var T=c.alternate;if(s=c.return,c.flags&32768){if(T=iE(T,c),T!==null){T.flags&=32767,br=T;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{Or=6,br=null;return}}else if(T=nE(T,c,jn),T!==null){br=T;return}if(c=c.sibling,c!==null){br=c;return}br=c=s}while(c!==null);Or===0&&(Or=5)}function tl(s,c,T){var N=_t,F=hr.transition;try{hr.transition=null,_t=1,dE(s,c,T,N)}finally{hr.transition=F,_t=N}return null}function dE(s,c,T,N){do rl();while(eo!==null);if(gt&6)throw Error(o(327));T=s.finishedWork;var F=s.finishedLanes;if(T===null)return null;if(s.finishedWork=null,s.finishedLanes=0,T===s.current)throw Error(o(177));s.callbackNode=null,s.callbackPriority=0;var W=T.lanes|T.childLanes;if(Au(s,W),s===Lr&&(br=Lr=null,Hr=0),!(T.subtreeFlags&2064)&&!(T.flags&2064)||id||(id=!0,l3(ae,function(){return rl(),null})),W=(T.flags&15990)!==0,T.subtreeFlags&15990||W){W=hr.transition,hr.transition=null;var Q=_t;_t=1;var oe=gt;gt|=4,c1.current=null,oE(s,T),Vb(T,s),L(s.containerInfo),s.current=T,lE(T),Cf(),gt=oe,_t=Q,hr.transition=W}else s.current=T;if(id&&(id=!1,eo=s,ad=F),W=s.pendingLanes,W===0&&(Ja=null),lr(T.stateNode),bn(s,dr()),c!==null)for(N=s.onRecoverableError,T=0;T<c.length;T++)F=c[T],N(F.value,{componentStack:F.stack,digest:F.digest});if(nd)throw nd=!1,s=p1,p1=null,s;return ad&1&&s.tag!==0&&rl(),W=s.pendingLanes,W&1?s===g1?Vu++:(Vu=0,g1=s):Vu=0,Gi(),null}function rl(){if(eo!==null){var s=xf(ad),c=hr.transition,T=_t;try{if(hr.transition=null,_t=16>s?16:s,eo===null)var N=!1;else{if(s=eo,eo=null,ad=0,gt&6)throw Error(o(331));var F=gt;for(gt|=4,Ge=s.current;Ge!==null;){var W=Ge,Q=W.child;if(Ge.flags&16){var oe=W.deletions;if(oe!==null){for(var ye=0;ye<oe.length;ye++){var Ae=oe[ye];for(Ge=Ae;Ge!==null;){var Ve=Ge;switch(Ve.tag){case 0:case 11:case 15:Uu(8,Ve,W)}var lt=Ve.child;if(lt!==null)lt.return=Ve,Ge=lt;else for(;Ge!==null;){Ve=Ge;var Be=Ve.sibling,$t=Ve.return;if(Ub(Ve),Ve===Ae){Ge=null;break}if(Be!==null){Be.return=$t,Ge=Be;break}Ge=$t}}}var jt=W.alternate;if(jt!==null){var _n=jt.child;if(_n!==null){jt.child=null;do{var ya=_n.sibling;_n.sibling=null,_n=ya}while(_n!==null)}}Ge=W}}if(W.subtreeFlags&2064&&Q!==null)Q.return=W,Ge=Q;else e:for(;Ge!==null;){if(W=Ge,W.flags&2048)switch(W.tag){case 0:case 11:case 15:Uu(9,W,W.return)}var me=W.sibling;if(me!==null){me.return=W.return,Ge=me;break e}Ge=W.return}}var ce=s.current;for(Ge=ce;Ge!==null;){Q=Ge;var _e=Q.child;if(Q.subtreeFlags&2064&&_e!==null)_e.return=Q,Ge=_e;else e:for(Q=ce;Ge!==null;){if(oe=Ge,oe.flags&2048)try{switch(oe.tag){case 0:case 11:case 15:Kf(9,oe)}}catch(et){Xt(oe,oe.return,et)}if(oe===Q){Ge=null;break e}var Ue=oe.sibling;if(Ue!==null){Ue.return=oe.return,Ge=Ue;break e}Ge=oe.return}}if(gt=F,Gi(),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Ne,s)}catch{}N=!0}return N}finally{_t=T,hr.transition=c}}return!1}function i3(s,c,T){c=fs(T,c),c=Sb(s,c,1),s=Qa(s,c,1),c=Qr(),s!==null&&(Dn(s,1,c),bn(s,c))}function Xt(s,c,T){if(s.tag===3)i3(s,s,T);else for(;c!==null;){if(c.tag===3){i3(c,s,T);break}else if(c.tag===1){var N=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof N.componentDidCatch=="function"&&(Ja===null||!Ja.has(N))){s=fs(T,s),s=Eb(c,s,1),c=Qa(c,s,1),s=Qr(),c!==null&&(Dn(c,1,s),bn(c,s));break}}c=c.return}}function hE(s,c,T){var N=s.pingCache;N!==null&&N.delete(c),c=Qr(),s.pingedLanes|=s.suspendedLanes&T,Lr===s&&(Hr&T)===T&&(Or===4||Or===3&&(Hr&130023424)===Hr&&500>dr()-d1?el(s,0):f1|=T),bn(s,c)}function a3(s,c){c===0&&(s.mode&1?(c=Wo,Wo<<=1,!(Wo&130023424)&&(Wo=4194304)):c=1);var T=Qr();s=$i(s,c),s!==null&&(Dn(s,c,T),bn(s,T))}function pE(s){var c=s.memoizedState,T=0;c!==null&&(T=c.retryLane),a3(s,T)}function gE(s,c){var T=0;switch(s.tag){case 13:var N=s.stateNode,F=s.memoizedState;F!==null&&(T=F.retryLane);break;case 19:N=s.stateNode;break;default:throw Error(o(314))}N!==null&&N.delete(c),a3(s,T)}var o3;o3=function(s,c,T){if(s!==null)if(s.memoizedProps!==c.pendingProps||Br.current)mn=!0;else{if(!(s.lanes&T)&&!(c.flags&128))return mn=!1,rE(s,c,T);mn=!!(s.flags&131072)}else mn=!1,Kt&&c.flags&1048576&&F2(c,Af,c.index);switch(c.lanes=0,c.tag){case 2:var N=c.type;Vf(s,c),s=c.pendingProps;var F=yi(c,mr.current);ls(c,T),F=U0(null,c,N,s,F,T);var W=H0();return c.flags|=1,typeof F=="object"&&F!==null&&typeof F.render=="function"&&F.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Yt(N)?(W=!0,Zl(c)):W=!1,c.memoizedState=F.state!==null&&F.state!==void 0?F.state:null,L0(c),F.updater=Df,c.stateNode=F,F._reactInternals=c,N0(c,N,s,T),c=X0(null,c,N,!0,W,T)):(c.tag=0,Kt&&W&&S0(c),un(null,c,F,T),c=c.child),c;case 16:N=c.elementType;e:{switch(Vf(s,c),s=c.pendingProps,F=N._init,N=F(N._payload),c.type=N,F=c.tag=mE(N),s=Si(N,s),F){case 0:c=K0(null,c,N,s,T);break e;case 1:c=Lb(null,c,N,s,T);break e;case 11:c=Cb(null,c,N,s,T);break e;case 14:c=Tb(null,c,N,Si(N.type,s),T);break e}throw Error(o(306,N,""))}return c;case 0:return N=c.type,F=c.pendingProps,F=c.elementType===N?F:Si(N,F),K0(s,c,N,F,T);case 1:return N=c.type,F=c.pendingProps,F=c.elementType===N?F:Si(N,F),Lb(s,c,N,F,T);case 3:e:{if(Mb(c),s===null)throw Error(o(387));N=c.pendingProps,W=c.memoizedState,F=W.element,$2(s,c),If(c,N,null,T);var Q=c.memoizedState;if(N=Q.element,ne&&W.isDehydrated)if(W={element:N,isDehydrated:!1,cache:Q.cache,pendingSuspenseBoundaries:Q.pendingSuspenseBoundaries,transitions:Q.transitions},c.updateQueue.baseState=W,c.memoizedState=W,c.flags&256){F=fs(Error(o(423)),c),c=Nb(s,c,N,T,F);break e}else if(N!==F){F=fs(Error(o(424)),c),c=Nb(s,c,N,T,F);break e}else for(ne&&(Jn=mt(c.stateNode.containerInfo),Fn=c,Kt=!0,wi=null,ku=!1),T=J2(c,null,N,T),c.child=T;T;)T.flags=T.flags&-3|4096,T=T.sibling;else{if(as(),N===F){c=va(s,c,T);break e}un(s,c,N,T)}c=c.child}return c;case 5:return eb(c),s===null&&x0(c),N=c.type,F=c.pendingProps,W=s!==null?s.memoizedProps:null,Q=F.children,K(N,F)?Q=null:W!==null&&K(N,W)&&(c.flags|=32),Rb(s,c),un(s,c,Q,T),c.child;case 6:return s===null&&x0(c),null;case 13:return Ib(s,c,T);case 4:return I0(c,c.stateNode.containerInfo),N=c.pendingProps,s===null?c.child=ss(c,null,N,T):un(s,c,N,T),c.child;case 11:return N=c.type,F=c.pendingProps,F=c.elementType===N?F:Si(N,F),Cb(s,c,N,F,T);case 7:return un(s,c,c.pendingProps,T),c.child;case 8:return un(s,c,c.pendingProps.children,T),c.child;case 12:return un(s,c,c.pendingProps.children,T),c.child;case 10:e:{if(N=c.type._context,F=c.pendingProps,W=c.memoizedProps,Q=F.value,H2(c,N,Q),W!==null)if(sr(W.value,Q)){if(W.children===F.children&&!Br.current){c=va(s,c,T);break e}}else for(W=c.child,W!==null&&(W.return=c);W!==null;){var oe=W.dependencies;if(oe!==null){Q=W.child;for(var ye=oe.firstContext;ye!==null;){if(ye.context===N){if(W.tag===1){ye=ga(-1,T&-T),ye.tag=2;var Ae=W.updateQueue;if(Ae!==null){Ae=Ae.shared;var Ve=Ae.pending;Ve===null?ye.next=ye:(ye.next=Ve.next,Ve.next=ye),Ae.pending=ye}}W.lanes|=T,ye=W.alternate,ye!==null&&(ye.lanes|=T),k0(W.return,T,c),oe.lanes|=T;break}ye=ye.next}}else if(W.tag===10)Q=W.type===c.type?null:W.child;else if(W.tag===18){if(Q=W.return,Q===null)throw Error(o(341));Q.lanes|=T,oe=Q.alternate,oe!==null&&(oe.lanes|=T),k0(Q,T,c),Q=W.sibling}else Q=W.child;if(Q!==null)Q.return=W;else for(Q=W;Q!==null;){if(Q===c){Q=null;break}if(W=Q.sibling,W!==null){W.return=Q.return,Q=W;break}Q=Q.return}W=Q}un(s,c,F.children,T),c=c.child}return c;case 9:return F=c.type,N=c.pendingProps.children,ls(c,T),F=ei(F),N=N(F),c.flags|=1,un(s,c,N,T),c.child;case 14:return N=c.type,F=Si(N,c.pendingProps),F=Si(N.type,F),Tb(s,c,N,F,T);case 15:return Ab(s,c,c.type,c.pendingProps,T);case 17:return N=c.type,F=c.pendingProps,F=c.elementType===N?F:Si(N,F),Vf(s,c),c.tag=1,Yt(N)?(s=!0,Zl(c)):s=!1,ls(c,T),K2(c,N,F),N0(c,N,F,T),X0(null,c,N,!0,s,T);case 19:return Fb(s,c,T);case 22:return kb(s,c,T)}throw Error(o(156,c.tag))};function l3(s,c){return Xa(s,c)}function vE(s,c,T,N){this.tag=s,this.key=T,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=N,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ii(s,c,T,N){return new vE(s,c,T,N)}function _1(s){return s=s.prototype,!(!s||!s.isReactComponent)}function mE(s){if(typeof s=="function")return _1(s)?1:0;if(s!=null){if(s=s.$$typeof,s===m)return 11;if(s===h)return 14}return 2}function no(s,c){var T=s.alternate;return T===null?(T=ii(s.tag,c,s.key,s.mode),T.elementType=s.elementType,T.type=s.type,T.stateNode=s.stateNode,T.alternate=s,s.alternate=T):(T.pendingProps=c,T.type=s.type,T.flags=0,T.subtreeFlags=0,T.deletions=null),T.flags=s.flags&14680064,T.childLanes=s.childLanes,T.lanes=s.lanes,T.child=s.child,T.memoizedProps=s.memoizedProps,T.memoizedState=s.memoizedState,T.updateQueue=s.updateQueue,c=s.dependencies,T.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},T.sibling=s.sibling,T.index=s.index,T.ref=s.ref,T}function ud(s,c,T,N,F,W){var Q=2;if(N=s,typeof s=="function")_1(s)&&(Q=1);else if(typeof s=="string")Q=5;else e:switch(s){case p:return nl(T.children,F,W,c);case S:Q=8,F|=8;break;case w:return s=ii(12,T,c,F|2),s.elementType=w,s.lanes=W,s;case v:return s=ii(13,T,c,F),s.elementType=v,s.lanes=W,s;case y:return s=ii(19,T,c,F),s.elementType=y,s.lanes=W,s;case b:return cd(T,F,W,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case g:Q=10;break e;case E:Q=9;break e;case m:Q=11;break e;case h:Q=14;break e;case d:Q=16,N=null;break e}throw Error(o(130,s==null?s:typeof s,""))}return c=ii(Q,T,c,F),c.elementType=s,c.type=N,c.lanes=W,c}function nl(s,c,T,N){return s=ii(7,s,N,c),s.lanes=T,s}function cd(s,c,T,N){return s=ii(22,s,N,c),s.elementType=b,s.lanes=T,s.stateNode={isHidden:!1},s}function w1(s,c,T){return s=ii(6,s,null,c),s.lanes=T,s}function S1(s,c,T){return c=ii(4,s.children!==null?s.children:[],s.key,c),c.lanes=T,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function yE(s,c,T,N,F){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Z,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Tu(0),this.expirationTimes=Tu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tu(0),this.identifierPrefix=N,this.onRecoverableError=F,ne&&(this.mutableSourceEagerHydrationData=null)}function s3(s,c,T,N,F,W,Q,oe,ye){return s=new yE(s,c,T,oe,ye),c===1?(c=1,W===!0&&(c|=8)):c=0,W=ii(3,null,null,c),s.current=W,W.stateNode=s,W.memoizedState={element:N,isDehydrated:T,cache:null,transitions:null,pendingSuspenseBoundaries:null},L0(W),s}function u3(s){if(!s)return mi;s=s._reactInternals;e:{if(A(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 T=s.type;if(Yt(T))return Xl(s,T,c)}return c}function c3(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=R(c),s===null?null:s.stateNode}function f3(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var T=s.retryLane;s.retryLane=T!==0&&T<c?T:c}}function fd(s,c){f3(s,c),(s=s.alternate)&&f3(s,c)}function bE(s){return s=R(s),s===null?null:s.stateNode}function _E(){return null}return r.attemptContinuousHydration=function(s){if(s.tag===13){var c=$i(s,134217728);if(c!==null){var T=Qr();ni(c,s,134217728,T)}fd(s,134217728)}},r.attemptDiscreteHydration=function(s){if(s.tag===13){var c=$i(s,1);if(c!==null){var T=Qr();ni(c,s,1,T)}fd(s,1)}},r.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var c=to(s),T=$i(s,c);if(T!==null){var N=Qr();ni(T,s,c,N)}fd(s,c)}},r.attemptSynchronousHydration=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var T=da(c.pendingLanes);T!==0&&(es(c,T|1),bn(c,dr()),!(gt&6)&&(ps(),Gi()))}break;case 13:Jb(function(){var N=$i(s,1);if(N!==null){var F=Qr();ni(N,s,1,F)}}),fd(s,1)}},r.batchedUpdates=function(s,c){var T=gt;gt|=1;try{return s(c)}finally{gt=T,gt===0&&(ps(),_i&&Gi())}},r.createComponentSelector=function(s){return{$$typeof:Xf,value:s}},r.createContainer=function(s,c,T,N,F,W,Q){return s3(s,c,!1,null,T,N,F,W,Q)},r.createHasPseudoClassSelector=function(s){return{$$typeof:Zf,value:s}},r.createHydrationContainer=function(s,c,T,N,F,W,Q,oe,ye){return s=s3(T,N,!0,s,F,W,Q,oe,ye),s.context=u3(null),T=s.current,N=Qr(),F=to(T),W=ga(N,F),W.callback=c??null,Qa(T,W,F),s.current.lanes=F,Dn(s,F,N),bn(s,N),s},r.createPortal=function(s,c,T){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:N==null?null:""+N,children:s,containerInfo:c,implementation:T}},r.createRoleSelector=function(s){return{$$typeof:Qf,value:s}},r.createTestNameSelector=function(s){return{$$typeof:Jf,value:s}},r.createTextSelector=function(s){return{$$typeof:ed,value:s}},r.deferredUpdates=function(s){var c=_t,T=hr.transition;try{return hr.transition=null,_t=16,s()}finally{_t=c,hr.transition=T}},r.discreteUpdates=function(s,c,T,N,F){var W=_t,Q=hr.transition;try{return hr.transition=null,_t=1,s(c,T,N,F)}finally{_t=W,hr.transition=Q,gt===0&&ps()}},r.findAllNodes=u1,r.findBoundingRects=function(s,c){if(!ve)throw Error(o(363));c=u1(s,c),s=[];for(var T=0;T<c.length;T++)s.push(te(c[T]));for(c=s.length-1;0<c;c--){T=s[c];for(var N=T.x,F=N+T.width,W=T.y,Q=W+T.height,oe=c-1;0<=oe;oe--)if(c!==oe){var ye=s[oe],Ae=ye.x,Ve=Ae+ye.width,lt=ye.y,Be=lt+ye.height;if(N>=Ae&&W>=lt&&F<=Ve&&Q<=Be){s.splice(c,1);break}else if(N!==Ae||T.width!==ye.width||Be<W||lt>Q){if(!(W!==lt||T.height!==ye.height||Ve<N||Ae>F)){Ae>N&&(ye.width+=Ae-N,ye.x=N),Ve<F&&(ye.width=F-Ae),s.splice(c,1);break}}else{lt>W&&(ye.height+=lt-W,ye.y=W),Be<Q&&(ye.height=Q-lt),s.splice(c,1);break}}}return s},r.findHostInstance=c3,r.findHostInstanceWithNoPortals=function(s){return s=k(s),s=s!==null?U(s):null,s===null?null:s.stateNode},r.findHostInstanceWithWarning=function(s){return c3(s)},r.flushControlled=function(s){var c=gt;gt|=1;var T=hr.transition,N=_t;try{hr.transition=null,_t=1,s()}finally{_t=N,hr.transition=T,gt=c,gt===0&&(ps(),Gi())}},r.flushPassiveEffects=rl,r.flushSync=Jb,r.focusWithin=function(s,c){if(!ve)throw Error(o(363));for(s=o1(s),c=Xb(s,c),c=Array.from(c),s=0;s<c.length;){var T=c[s++];if(!be(T)){if(T.tag===5&&Pe(T.stateNode))return!0;for(T=T.child;T!==null;)c.push(T),T=T.sibling}}return!1},r.getCurrentUpdatePriority=function(){return _t},r.getFindAllNodesFailureDescription=function(s,c){if(!ve)throw Error(o(363));var T=0,N=[];s=[o1(s),0];for(var F=0;F<s.length;){var W=s[F++],Q=s[F++],oe=c[Q];if((W.tag!==5||!be(W))&&(l1(W,oe)&&(N.push(s1(oe)),Q++,Q>T&&(T=Q)),Q<c.length))for(W=W.child;W!==null;)s.push(W,Q),W=W.sibling}if(T<c.length){for(s=[];T<c.length;T++)s.push(s1(c[T]));return`findAllNodes was able to match part of the selector:
58
+ `+(N.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 j(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.2.0"},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,T,N){if(!ve)throw Error(o(363));s=u1(s,c);var F=xe(s,T,N).disconnect;return{disconnect:function(){F()}}},r.registerMutableSourceForHydration=function(s,c){var T=c._getVersion;T=T(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,T]:s.mutableSourceEagerHydrationData.push(c,T)},r.runWithPriority=function(s,c){var T=_t;try{return _t=s,c()}finally{_t=T}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(s,c,T,N){var F=c.current,W=Qr(),Q=to(F);return T=u3(T),c.context===null?c.context=T:c.pendingContext=T,c=ga(W,Q),c.payload={element:s},N=N===void 0?null:N,N!==null&&(c.callback=N),s=Qa(F,c,Q),s!==null&&(ni(s,F,Q,W),Nf(s,F,Q)),Q},r};Z9.exports=gL;var vL=Z9.exports;const mL=Vh(vL);var Q9={exports:{}},Hl={};/**
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
+ */Hl.ConcurrentRoot=1;Hl.ContinuousEventPriority=4;Hl.DefaultEventPriority=16;Hl.DiscreteEventPriority=1;Hl.IdleEventPriority=536870912;Hl.LegacyRoot=0;Q9.exports=Hl;var J9=Q9.exports;const y4={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let b4=!1,_4=!1;const s2=".react-konva-event";let e7=!1;function yL(e){e7=e}const bL=`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
+ `,_L=`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
+ `,wL={};function c0(e,t,r=wL){if(!b4&&"zIndex"in t&&(console.warn(_L),b4=!0),!_4&&t.draggable){var n=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;n&&!i&&(console.warn(bL),_4=!0)}for(var a in r)if(!y4[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 p=e7||t._useStrictMode,S={},w=!1;const g={};for(var a in t)if(!y4[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]&&(g[u]=t[a])}!o&&(t[a]!==r[a]||p&&t[a]!==e.getAttr(a))&&(w=!0,S[a]=t[a])}w&&(e.setAttrs(S),Go(e));for(var u in g)e.on(u+s2,g[u])}function Go(e){if(!ht.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const t7={},SL={};Vc.Node.prototype._applyProps=c0;function EL(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),Go(e)}function OL(e,t,r){let n=Vc[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=Vc.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 c0(u,a),u}function xL(e,t,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function PL(e,t,r){return!1}function CL(e){return e}function TL(){return null}function AL(){return null}function kL(e,t,r,n){return SL}function RL(){}function LL(e){}function ML(e,t){return!1}function NL(){return t7}function IL(){return t7}const DL=setTimeout,FL=clearTimeout,jL=-1;function zL(e,t){return!1}const BL=!1,UL=!0,HL=!0;function GL(e,t){t.parent===e?t.moveToTop():e.add(t),Go(e)}function $L(e,t){t.parent===e?t.moveToTop():e.add(t),Go(e)}function r7(e,t,r){t._remove(),e.add(t),t.setZIndex(r.getZIndex()),Go(e)}function VL(e,t,r){r7(e,t,r)}function qL(e,t){t.destroy(),t.off(s2),Go(e)}function WL(e,t){t.destroy(),t.off(s2),Go(e)}function YL(e,t,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function KL(e,t,r){}function XL(e,t,r,n,i){c0(e,i,n)}function ZL(e){e.hide(),Go(e)}function QL(e){}function JL(e,t){(t.visible==null||t.visible)&&e.show()}function eM(e,t){}function tM(e){}function rM(){}const nM=()=>J9.DefaultEventPriority,iM=Object.freeze(Object.defineProperty({__proto__:null,appendChild:GL,appendChildToContainer:$L,appendInitialChild:EL,cancelTimeout:FL,clearContainer:tM,commitMount:KL,commitTextUpdate:YL,commitUpdate:XL,createInstance:OL,createTextInstance:xL,detachDeletedInstance:rM,finalizeInitialChildren:PL,getChildHostContext:IL,getCurrentEventPriority:nM,getPublicInstance:CL,getRootHostContext:NL,hideInstance:ZL,hideTextInstance:QL,idlePriority:uc.unstable_IdlePriority,insertBefore:r7,insertInContainerBefore:VL,isPrimaryRenderer:BL,noTimeout:jL,now:uc.unstable_now,prepareForCommit:TL,preparePortalMount:AL,prepareUpdate:kL,removeChild:qL,removeChildFromContainer:WL,resetAfterCommit:RL,resetTextContent:LL,run:uc.unstable_runWithPriority,scheduleTimeout:DL,shouldDeprioritizeSubtree:ML,shouldSetTextContent:zL,supportsMutation:HL,unhideInstance:JL,unhideTextInstance:eM,warnsIfNotActing:UL},Symbol.toStringTag,{value:"Module"}));var aM=Object.defineProperty,oM=Object.defineProperties,lM=Object.getOwnPropertyDescriptors,w4=Object.getOwnPropertySymbols,sM=Object.prototype.hasOwnProperty,uM=Object.prototype.propertyIsEnumerable,S4=(e,t,r)=>t in e?aM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,E4=(e,t)=>{for(var r in t||(t={}))sM.call(t,r)&&S4(e,r,t[r]);if(w4)for(var r of w4(t))uM.call(t,r)&&S4(e,r,t[r]);return e},cM=(e,t)=>oM(e,lM(t)),O4,x4;typeof window<"u"&&((O4=window.document)!=null&&O4.createElement||((x4=window.navigator)==null?void 0:x4.product)==="ReactNative")?it.useLayoutEffect:it.useEffect;function n7(e,t,r){if(!e)return;if(r(e)===!0)return e;let n=t?e.return:e.child;for(;n;){const i=n7(n,t,r);if(i)return i;n=t?null:n.sibling}}function i7(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const P4=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=P4;return}return P4.apply(this,arguments)};const u2=i7(it.createContext(null));class a7 extends it.Component{render(){return it.createElement(u2.Provider,{value:this._reactInternals},this.props.children)}}function fM(){const e=it.useContext(u2);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=it.useId();return it.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const i=n7(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 dM(){const e=fM(),[t]=it.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!==u2&&!t.has(i)&&t.set(i,it.useContext(i7(i)))}r=r.return}return t}function o7(){const e=dM();return it.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>n=>it.createElement(t,null,it.createElement(r.Provider,cM(E4({},n),{value:e.get(r)}))),t=>it.createElement(a7,E4({},t))),[e])}function hM(e){const t=vt.useRef({});return vt.useLayoutEffect(()=>{t.current=e}),vt.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const pM=e=>{const t=vt.useRef(),r=vt.useRef(),n=vt.useRef(),i=hM(e),a=o7(),o=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return vt.useLayoutEffect(()=>(r.current=new Vc.Stage({width:e.width,height:e.height,container:t.current}),o(r.current),n.current=Is.createContainer(r.current,J9.LegacyRoot,!1,null),Is.updateContainer(vt.createElement(a,{},e.children),n.current),()=>{Vc.isBrowser&&(o(null),Is.updateContainer(null,n.current,null),r.current.destroy())}),[]),vt.useLayoutEffect(()=>{o(r.current),c0(r.current,e,i),Is.updateContainer(vt.createElement(a,{},e.children),n.current,null)}),vt.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})},gM="Layer",vM="FastLayer",Uh="Group",mM="Label",yM="Rect",bM="Circle",_M="Ellipse",wM="Wedge",SM="Line",EM="Sprite",OM="Image",xM="Text",PM="TextPath",CM="Star",TM="Ring",AM="Arc",kM="Tag",RM="Path",LM="RegularPolygon",MM="Arrow",NM="Shape",IM="Transformer",Is=mL(iM);Is.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:vt.version,rendererPackageName:"react-konva"});const DM=vt.forwardRef((e,t)=>vt.createElement(a7,{},vt.createElement(pM,{...e,forwardedRef:t}))),FM=yL,jM=Object.freeze(Object.defineProperty({__proto__:null,Arc:AM,Arrow:MM,Circle:bM,Ellipse:_M,FastLayer:vM,Group:Uh,Image:OM,KonvaRenderer:Is,Label:mM,Layer:gM,Line:SM,Path:RM,Rect:yM,RegularPolygon:LM,Ring:TM,Shape:NM,Sprite:EM,Stage:DM,Star:CM,Tag:kM,Text:xM,TextPath:PM,Transformer:IM,Wedge:wM,useStrictMode:FM},Symbol.toStringTag,{value:"Module"})),Ga=Lo(jM);var al=it,f0=function(t,r,n){const i=al.useRef("loading"),a=al.useRef(),[o,l]=al.useState(0),u=al.useRef(),f=al.useRef(),p=al.useRef();return(u.current!==t||f.current!==r||p.current!==n)&&(i.current="loading",a.current=void 0,u.current=t,f.current=r,p.current=n),al.useLayoutEffect(function(){if(!t)return;var S=document.createElement("img");function w(){i.current="loaded",a.current=S,l(Math.random())}function g(){i.current="failed",a.current=void 0,l(Math.random())}return S.addEventListener("load",w),S.addEventListener("error",g),r&&(S.crossOrigin=r),n&&(S.referrerPolicy=n),S.src=t,function(){S.removeEventListener("load",w),S.removeEventListener("error",g)}},[t,r,n]),[a.current,i.current]};const zM=Vh(f0);var l7={},c2={},BM=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 UM=e=>{const t=window.getComputedStyle(e).position;return!(t==="absolute"||t==="relative")};function s7(e=()=>{}){const t=vt.useRef(e);return t.current=e,vt.useCallback((...r)=>t.current.apply(null,r),[])}const HM=({children:e,groupProps:t,divProps:r,transform:n,transformFunc:i})=>{const a=o7(),o=vt.useRef(null);vt.useRef();const[l]=vt.useState(()=>document.createElement("div")),u=vt.useMemo(()=>rh.createRoot(l),[l]),f=n??!0,p=s7(()=>{if(f&&o.current){let m=o.current.getAbsoluteTransform().decompose();i&&(m=i(m)),l.style.position="absolute",l.style.zIndex="10",l.style.top="0px",l.style.left="0px",l.style.transform=`translate(${m.x}px, ${m.y}px) rotate(${m.rotation}deg) scaleX(${m.scaleX}) scaleY(${m.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 S=r||{},{style:w}=S,g=BM(S,["style"]);Object.assign(l.style,w),Object.assign(l,g)});return vt.useLayoutEffect(()=>{var S;const w=o.current;if(!w)return;const g=(S=w.getStage())===null||S===void 0?void 0:S.container();if(g)return g.appendChild(l),f&&UM(g)&&(g.style.position="relative"),w.on("absoluteTransformChange",p),p(),()=>{var E;w.off("absoluteTransformChange",p),(E=l.parentNode)===null||E===void 0||E.removeChild(l)}},[f]),vt.useLayoutEffect(()=>{p()},[r,i]),vt.useLayoutEffect(()=>{u.render(vt.createElement(a,null,e))}),vt.useLayoutEffect(()=>()=>{setTimeout(()=>{u.unmount()})},[]),vt.createElement(Uh,Object.assign({ref:o},t))},GM=({selector:e,enabled:t,children:r})=>{const n=vt.useRef(null),i=vt.useRef(null),a=vt.useRef(),o=t??!0;return vt.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 p=u.getLayer();if(!p)return;p.batchDraw()}},[e,o]),vt.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.destroy()},[]),vt.createElement(Uh,{name:"_outer_portal",ref:n},vt.createElement(Uh,{name:"_inner_portal",ref:i},r))},$M=Object.freeze(Object.defineProperty({__proto__:null,Html:HM,Portal:GM,useEvent:s7,useImage:zM},Symbol.toStringTag,{value:"Module"})),yf=Lo($M);function VM(e,t){return Object.keys(e.values).forEach(r=>e.values[r]=e.values[r]&&parseFloat(e.values[r].toFixed(t))),e}function u7(e,t,r){const n=t-1,i=r[f7(n,r.length)];return i.marker!=="Z"?i:u7(e,n,r)}function c7(e,t,r){const n=t+1,i=r[f7(n,r.length)];return i.marker==="Z"?c7(e,n,r):i}function qM(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 WM(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 f7(e,t){return(e%t+t)%t}function YM(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 Tm(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,Tm(e,t-1)),e[t].marker==="Z"&&Tm(e,t-1)}function KM(e,t,r){const n=T4(e.values,r.values),i=T4(t.values,e.values);return Math.min(i,n)}function C4(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function T4(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 A4(e,t){return Math.sin(e)*t}function k4(e,t){return Math.cos(e)*t}function R4(e,t){const r=t/Math.tan(e);return r===1/0||r===-1/0||isNaN(r)?t:r}function XM(e,t){return t*Math.tan(e)}function ZM(e,t){let r,n=0,i=e*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=R4(e/2,-t):(r=R4(e/2,t),n=1,r===1/0&&(r=t)),{offset:r,sweepFlag:n}}function QM(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 d7(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 WM(n.marker,a)}).map(qM)}function h7(e,t,r){let n=[],i=[];return r&&e.forEach(a=>VM(a,r)),e.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(YM),Tm(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(l=>!l.overlap).map((l,u,f)=>{const S=u7(l,u,f),w=c7(l,u,f),g=C4(l.values,S.values),E=C4(l.values,w.values),m=E-g,v=m*(180/Math.PI),y=KM(l,S,w),h=Math.abs(XM(m/2,y/2)),d=Math.min(t,h),b=ZM(m,d),O=b.offset,x=b.sweepFlag,P=(u==0||u==f.length-1)&&!o;switch(l.marker){case"M":case"L":const _=[l.values.x+A4(g,O),l.values.y+k4(g,O)],A=[l.values.x+A4(E,O),l.values.y+k4(E,O)];P?i.push({marker:l.marker,values:l.values}):i.push({marker:l.marker,values:{x:parseFloat(_[0].toFixed(3)),y:parseFloat(_[1].toFixed(3))}}),!P&&(w.marker==="L"||w.marker==="M")&&i.push({marker:"A",radius:d,values:{radiusX:parseFloat(d.toFixed(3)),radiusY:parseFloat(d.toFixed(3)),rotation:v,largeArc:0,sweep:x,x:parseFloat(A[0].toFixed(3)),y:parseFloat(A[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:QM(i),commands:i}}function JM(e,t,r){return h7([...d7(e)],t,r)}const eN=Object.freeze(Object.defineProperty({__proto__:null,parsePath:d7,roundCommands:h7,roundCorners:JM},Symbol.toStringTag,{value:"Module"})),tN=Lo(eN);var bf={},f2={},d2={},Gl=Gl||{};Gl.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 Gl=Gl||{};Gl.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(G){var z=new Error(t+": "+G);throw z.source=t,z}function n(){var G=i();return t.length>0&&r("Invalid input not EOF"),G}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,S)||o("repeating-radial-gradient",e.repeatingRadialGradient,S)}function o(G,z,q){return l(z,function(L){var I=q();return I&&(Y(e.comma)||r("Missing comma before color stops")),{type:G,orientation:I,colorStops:d(b)}})}function l(G,z){var q=Y(G);if(q){Y(e.startCall)||r("Missing (");var L=z(q);return Y(e.endCall)||r("Missing )"),L}}function u(){return f()||p()}function f(){return U("directional",e.sideOrCorner,1)}function p(){return U("angular",e.angleValue,1)}function S(){var G,z=w(),q;return z&&(G=[],G.push(z),q=t,Y(e.comma)&&(z=w(),z?G.push(z):t=q)),G}function w(){var G=g()||E();if(G)G.at=v();else{var z=m();if(z){G=z;var q=v();q&&(G.at=q)}else{var L=y();L&&(G={type:"default-radial",at:L})}}return G}function g(){var G=U("shape",/^(circle)/i,0);return G&&(G.style=D()||m()),G}function E(){var G=U("shape",/^(ellipse)/i,0);return G&&(G.style=k()||m()),G}function m(){return U("extent-keyword",e.extentKeywords,1)}function v(){if(U("position",/^at/,0)){var G=y();return G||r("Missing positioning value"),G}}function y(){var G=h();if(G.x||G.y)return{type:"position",value:G}}function h(){return{x:k(),y:k()}}function d(G){var z=G(),q=[];if(z)for(q.push(z);Y(e.comma);)z=G(),z?q.push(z):r("One extra comma");return q}function b(){var G=O();return G||r("Expected color definition"),G.length=k(),G}function O(){return P()||A()||_()||x()}function x(){return U("literal",e.literalColor,0)}function P(){return U("hex",e.hexColor,1)}function _(){return l(e.rgbColor,function(){return{type:"rgb",value:d(C)}})}function A(){return l(e.rgbaColor,function(){return{type:"rgba",value:d(C)}})}function C(){return Y(e.number)[1]}function k(){return U("%",e.percentageValue,1)||R()||D()}function R(){return U("position-keyword",e.positionKeywords,1)}function D(){return U("px",e.pixelValue,1)||U("em",e.emValue,1)}function U(G,z,q){var L=Y(z);if(L)return{type:G,value:L[q]}}function Y(G){var z,q;return q=/^[\n\r\t\s]+/.exec(t),q&&j(q[0].length),z=G.exec(t),z&&j(z[0].length),z}function j(G){t=t.substr(G)}return function(G){return t=G.toString(),n()}}();d2.parse=Gl.parse;d2.stringify=Gl.stringify;(function(e){var t=Se&&Se.__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(d2),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})(f2);(function(e){var t=Se&&Se.__createBinding||(Object.create?function(f,p,S,w){w===void 0&&(w=S);var g=Object.getOwnPropertyDescriptor(p,S);g&&!("get"in g?!p.__esModule:g.writable||g.configurable)||(g={enumerable:!0,get:function(){return p[S]}}),Object.defineProperty(f,w,g)}:function(f,p,S,w){w===void 0&&(w=S),f[w]=p[S]}),r=Se&&Se.__setModuleDefault||(Object.create?function(f,p){Object.defineProperty(f,"default",{enumerable:!0,value:p})}:function(f,p){f.default=p}),n=Se&&Se.__importStar||function(f){if(f&&f.__esModule)return f;var p={};if(f!=null)for(var S in f)S!=="default"&&Object.prototype.hasOwnProperty.call(f,S)&&t(p,f,S);return r(p,f),p},i=Se&&Se.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const a=i(it),o=n(f2),l=i(Ui),u=(f,p=f.fill,S="fill")=>a.default.useMemo(()=>{if(!o.isGradient(p))return{[S]:p};const{stops:w,rotation:g}=o.parseColor(p),E={x:f.a.width/2,y:f.a.height/2},m=Math.sqrt(Math.pow(E.x,2)+Math.pow(E.y,2)),v=l.default.Util.degToRad(g)-Math.PI/2,y=[];return w.forEach(({offset:h,color:d})=>{y.push(h,d)}),S==="fill"?{fillLinearGradientStartPointX:E.x-m*Math.cos(v),fillLinearGradientStartPointY:E.y-m*Math.sin(v),fillLinearGradientColorStops:y,fillLinearGradientEndPointX:E.x+m*Math.cos(v),fillLinearGradientEndPointY:E.y+m*Math.sin(v),fill:w[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:E.x-m*Math.cos(v),strokeLinearGradientStartPointY:E.y-m*Math.sin(v),strokeLinearGradientColorStops:y,strokeLinearGradientEndPointX:E.x+m*Math.cos(v),strokeLinearGradientEndPointY:E.y+m*Math.sin(v)}},[p,f.width,f.height]);e.useColor=u})(bf);var Ia={},$l={};(function(e){var t=Se&&Se.__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(it),n=t(Ui);let i=!1;const a=(u=!i)=>{i=u};e.toggleFadeInAnimation=a;const o=()=>i;function l(u,f){const p=r.default.useRef();r.default.useLayoutEffect(()=>{p.current&&p.current.destroy()},[f]),r.default.useLayoutEffect(()=>{if(!i)return;const S=u.current.opacity();return S?(u.current.opacity(0),p.current=new n.default.Tween({node:u.current,opacity:S,onFinish:()=>{var w;(w=p.current)===null||w===void 0||w.destroy()}}),p.current.play(),()=>{var w;(w=p.current)===null||w===void 0||w.destroy()}):void 0},[])}e.isAnimationUsed=o,e.useFadeIn=l})($l);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.triggerLoadError=e.onLoadError=e.whenLoaded=e.decrementLoader=e.incrementLoader=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0;const t=$l;let r=0,n=[],i=3e4;const a=E=>{i=E};e.setAssetLoadTimeout=a;const o=()=>i;function l(E){r+=1;let m=!1;const v=setTimeout(()=>{m||(g(`Timeout loading image ${E}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",E),m=!0,u())},i);return()=>{m||(clearTimeout(v),u())}}function u(){r-=1,r===0&&(n.forEach(E=>E()),n=[])}function f(E){r===0?E():n.push(E)}function p(){return new Promise(E=>f(()=>{(0,t.isAnimationUsed)()?setTimeout(E,300):E(!0)}))}e.getAssetLoadTimeout=o,e.incrementLoader=l,e.decrementLoader=u,e.whenLoaded=p;let S=[];function w(E){S.push(E)}function g(E){S.forEach(m=>m(E))}e.onLoadError=w,e.triggerLoadError=g})(Ia);var _f={};(function(e){var t=Se&&Se.__createBinding||(Object.create?function(R,D,U,Y){Y===void 0&&(Y=U);var j=Object.getOwnPropertyDescriptor(D,U);j&&!("get"in j?!D.__esModule:j.writable||j.configurable)||(j={enumerable:!0,get:function(){return D[U]}}),Object.defineProperty(R,Y,j)}:function(R,D,U,Y){Y===void 0&&(Y=U),R[Y]=D[U]}),r=Se&&Se.__setModuleDefault||(Object.create?function(R,D){Object.defineProperty(R,"default",{enumerable:!0,value:D})}:function(R,D){R.default=D}),n=Se&&Se.__importStar||function(R){if(R&&R.__esModule)return R;var D={};if(R!=null)for(var U in R)U!=="default"&&Object.prototype.hasOwnProperty.call(R,U)&&t(D,R,U);return r(D,R),D};Object.defineProperty(e,"__esModule",{value:!0}),e.injectCustomFont=e.injectGoogleFont=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(ja),a=Ia;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(R){R!=="default"?(l.value=!0,o.splice(0,o.length),o.push(...R)):l.value=!1}function p(){return o}function S(R){e.globalFonts.push(R)}function w(R){const D=e.globalFonts.findIndex(U=>U.fontFamily===R);D!==-1&&e.globalFonts.splice(D,1)}function g(R){e.globalFonts.replace(R)}e.isGoogleFontChanged=u,e.setGoogleFonts=f,e.getFontsList=p,e.globalFonts=i.observable([]),e.addGlobalFont=S,e.removeGlobalFont=w,e.replaceGlobalFonts=g;var E="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",m=document.createElement("canvas");function v(){return h("Arial")}function y(){return h("Times","Times")}function h(R,D="Arial"){var U=m.getContext("2d");return U.font=`normal 40px '${R}', ${D}`,U.measureText(E).width}const d={Arial:!0},b=R=>!!d[R];async function O(R){var D;if(d[R])return;const U=!!(!((D=document.fonts)===null||D===void 0)&&D.load),Y=v();if(U)try{await document.fonts.load(`16px '${R}'`);const q=h(R);if(Y!==q)return void(d[R]=!0)}catch{}const j=y(),G=h(R),z=(0,a.getAssetLoadTimeout)()/60;for(let q=0;q<z;q++){const L=h(R,"Arial"),I=h(R,"Times");if(L!==G||L!==Y||I!==j)return void(d[R]=!0);await new Promise(B=>setTimeout(B,60))}console.warn(`Timeout for loading font "${R}". Looks like polotno can't load it. Is it a correct font family?`),(0,a.triggerLoadError)(`Timeout for loading font "${R}"`)}e.isFontLoaded=b,e.loadFont=O;const x={};let P="400,400italic,700,700italic";function _(R){P=R}function A(R){if(x[R])return;const D=`https://fonts.googleapis.com/css?family=${R.replace(/ /g,"+")}:${P}`,U=document.createElement("link");U.type="text/css",U.href=D,U.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(U),x[R]=!0}e.setGoogleFontsVariants=_,e.injectGoogleFont=A;const C={};function k(R){const D=R.fontFamily;if(C[D]||!R.url&&!R.styles)return;const U=document.createElement("style");U.type="text/css";const Y=R.styles||(R.url?[{src:`url("${R.url}")`}]:[]);let j="";Y.forEach(G=>{j+=`
77
+ @font-face {
78
+ font-family: '${D}';
79
+ src: ${G.src};
80
+ font-style: ${G.fontStyle||"normal"};
81
+ font-weight: ${G.fontWeight||"normal"};
82
+ }
83
+ `}),U.innerHTML=j,document.getElementsByTagName("head")[0].appendChild(U),C[R.fontFamily]=!0}e.injectCustomFont=k})(_f);var di={};(function(e){var t=Se&&Se.__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=Se&&Se.__setModuleDefault||(Object.create?function(a,o){Object.defineProperty(a,"default",{enumerable:!0,value:o})}:function(a,o){a.default=o}),n=Se&&Se.__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(ja);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})})(di);var h2={};(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})(h2);var wf={};(function(e){var t=Se&&Se.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=void 0;const r=t(Ui);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})(wf);var Vl={};(function(e){var t=Se&&Se.__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(it),n=zi,i=Ga,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)))})(Vl);var $o={};(function(e){var t=Se&&Se.__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(it);e.MOBILE_BREAKPOINT=500;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})($o);var L4={},p7="warn";function g7(e){p7=e}function v7(){return p7}function rN(e){g7(e)}var Pr;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(Pr||(Pr={}));/*! *****************************************************************************
93
+ Copyright (c) Microsoft Corporation.
94
+
95
+ Permission to use, copy, modify, and/or distribute this software for any
96
+ purpose with or without fee is hereby granted.
97
+
98
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
99
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
100
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
101
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
102
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
103
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
104
+ PERFORMANCE OF THIS SOFTWARE.
105
+ ***************************************************************************** */var Am=function(e,t){return Am=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])},Am(e,t)};function Wt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Am(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Ir=function(){return Ir=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},Ir.apply(this,arguments)};function nN(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 m7(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(p){return u([f,p])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;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(p){f=[6,p],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function wc(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 p2(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 Vo(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(p2(arguments[t]));return e}function Sf(e){return qe(e).type}function iN(e,t){return qe(e).getChildType(t)}function y7(e,t){return qe(e).onPatch(t)}function aN(e,t){return qe(e).onSnapshot(t)}function ou(e,t){qe(e).applyPatches(S2(t))}function oN(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=y7(e,function(o,l){t&&!t(o,l,y2())||(r.patches.push(o),r.inversePatches.push(l),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){ou(o||e,r.patches)},undo:function(o){ou(o||e,r.inversePatches.slice().reverse())}};return a.resume(),a}function lN(e){var t=qe(e);if(!t.isRoot)throw He("`protect` can only be invoked on root nodes");t.isProtectionEnabled=!0}function sN(e){var t=qe(e);if(!t.isRoot)throw He("`unprotect` can only be invoked on root nodes");t.isProtectionEnabled=!1}function uN(e){return qe(e).isProtected}function b7(e,t){return qe(e).applySnapshot(t)}function g2(e,t){t===void 0&&(t=!0);var r=qe(e);return t?r.snapshot:r.type.getSnapshot(r,!1)}function cN(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 fN(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 He("Failed to find the parent of "+qe(e)+" at depth "+t)}function dN(e,t){for(var r=qe(e).parent;r;){if(t.is(r.storedValue))return!0;r=r.parent}return!1}function hN(e,t){for(var r=qe(e).parent;r;){if(t.is(r.storedValue))return r.storedValue;r=r.parent}throw He("Failed to find the parent of "+qe(e)+" of a given type")}function _7(e){return qe(e).root.storedValue}function w7(e){return qe(e).path}function pN(e){return cu(qe(e).path)}function gN(e){return qe(e).isRoot}function vN(e,t){var r=z7(qe(e),t);return r?r.value:void 0}function mN(e,t,r){var n=qe(t).root.identifierCache.resolve(e,Su(r));return n==null?void 0:n.value}function S7(e){return qe(e).identifier}function yN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return;if(Mt(r))return t?v2(r)?r:void 0:r;throw He("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof E2)return;throw n}}function bN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return!1;if(Mt(r))return t?v2(r):!0;throw He("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof E2)return!1;throw n}}function E7(e,t){var r=z7(qe(e),t,!1);if(r!==void 0)try{return r.value}catch{return}}function _N(e,t){return j7(qe(e),qe(t))}function wN(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 SN(e){return qe(e).detach(),e}function EN(e){var t=qe(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function v2(e){return qe(e).observableIsAlive}function ON(e,t){var r=qe(e);return r.addDisposer(t),t}function xN(e){var t=qe(e),r=t.root.environment;return r||Tl}function O7(e,t){var r=qe(e);r.getChildren().forEach(function(n){Mt(n.storedValue)&&O7(n.storedValue,t)}),t(r.storedValue)}function x7(e){var t;return Mt(e)?t=Sf(e):t=e,{name:t.name,properties:Ir({},t.properties)}}function PN(e){var t=qe(e).type,r=Ir(Ir({},x7(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){V8(e,i)?r.views.push(i):r.volatile.push(i);return}a.value._isMSTAction===!0&&r.actions.push(i),a.value._isFlowAction===!0?r.flowActions.push(i):W8(e,i)?r.volatile.push(i):r.views.push(i)}}),r}function CN(e){return e}function TN(e){return e}function AN(e){return e}function kN(e){return qe(e).nodeId}var P7=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:$r.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 $7),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=Bc("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Po(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!==$r.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===$r.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=Bc("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===$r.CREATED){if(this.parent){if(this.parent.state!==$r.FINALIZED)return;this.fireHook(Pr.afterAttach)}this.state=$r.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=$r.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(Pr.beforeDestroy)}}),e}(),qc=function(e){Wt(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=$r.DEAD,u}return l.state=$r.CREATED,l.finalizeCreation(),l}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw He("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 this.type.name+"@"+r+(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===$r.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}(P7);qc.prototype.die=wr(qc.prototype.die);var RN=1,LN={onError:function(e){throw e}},An=function(e){Wt(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:++RN}),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:0}),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=Rl(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=o,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new QN),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 He("Instance identifier '"+l.identifierAttribute+"' for type '"+l.type.name+"' must be a string or a number");l.identifier=Su(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===0&&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=1;for(var l=[],u=this.parent;u&&u._observableInstanceState===0;)l.unshift(u),u=u.parent;try{for(var f=wc(l),p=f.next();!p.done;p=f.next()){var S=p.value;S.createObservableInstanceIfNeeded(!1)}}catch(m){n={error:m}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}var w=this.type;try{this.storedValue=w.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,w.finalizeNewInstance(this,this.storedValue)}catch(m){throw this.state=$r.DEAD,m}finally{this._isRunningAction=!1}if(this._observableInstanceState=2,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Tl,this.state=$r.CREATED,r){this.fireHook(Pr.afterCreate),this.finalizeCreation();try{for(var g=wc(l.reverse()),E=g.next();!E.done;E=g.next()){var S=E.value;S.fireHook(Pr.afterCreate),S.finalizeCreation()}}catch(m){a={error:m}}finally{try{E&&!E.done&&(o=g.return)&&o.call(g)}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=$r.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"&&(eu?eu(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===2?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=v7();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw He(i);case"warn":fI(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&&Po(r.subpath)||"",a=r.actionContext||m2();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var l=a&&a.context&&w7(a.context)||n;o=l+"."+a.name+"()"}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '"+this.type.name+"', Path upon death: '"+n+"', Subpath: '"+i+"', Action: '"+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===2?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(Tl),this._autoUnbox=!1;try{return this._observableInstanceState===2?this.type.getChildren(this):U7(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 He("Cannot modify '"+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: "+this.identifier+")":"";return this.type.name+"@"+r+n+(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=wc(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 He("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=Wc(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=cu(i.path),o=B7(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=Wc(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),gl(this.storedValue,"$treenode",this),gl(this.storedValue,"toJSON",eI)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===$r.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==0&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit("dispose"),this._internalEventsClear("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("snapshot",r)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit("snapshot",r)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister("patch",r)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers("patch")){var i=sI({},r,{path:n.path.substr(this.path.length)+"/"+r.path}),a=p2(mI(i),2),o=a[0],l=a[1];this._internalEventsEmit("patch",o,l)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas("dispose",r)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister("dispose",r,!0);return}throw He("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("dispose",r))throw He("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister("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=F8(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},LN);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 $7),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,Vo([r],i))}}),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}(P7);An.prototype.createObservableInstance=wr(An.prototype.createObservableInstance);An.prototype.detach=wr(An.prototype.detach);An.prototype.die=wr(An.prototype.die);var C7,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 T7="cannotDetermine",MN=Symbol("$type"),Da=function(){function e(t){Object.defineProperty(this,C7,{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 Aa(this,t),this.instantiate(null,"",r,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){throw He("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=F7(t);if(n){var i=Sf(t);return this.isAssignableFrom(i)?kn():Rn(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 He("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 He("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 He("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 He("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}();C7=MN;Da.prototype.create=wr(Da.prototype.create);var lu=function(e){Wt(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===Su(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&&H7(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(Sf(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}(Da);lu.prototype.create=wr(lu.prototype.create);var ql=function(e){Wt(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}(Da);function nn(e){return typeof e=="object"&&e&&e.isType===!0}var Zi=new Map;function NN(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),Zi.set(r.id,{call:r,context:a,async:!1});try{var o=n(r);return e.onSuspend(r,a),Zi.get(r.id).async===!1&&(Zi.delete(r.id),e.onSuccess(r,a,o)),o}catch(u){throw Zi.delete(r.id),e.onFail(r,a,u),u}}else return n(r);case"flow_spawn":{var l=Zi.get(r.rootId);return l.async=!0,n(r)}case"flow_resume":case"flow_resume_error":{var l=Zi.get(r.rootId);e.onResume(r,l.context);try{return n(r)}finally{e.onSuspend(r,l.context)}}case"flow_throw":{var l=Zi.get(r.rootId);return Zi.delete(r.rootId),e.onFail(r,l.context,r.args[0]),n(r)}case"flow_return":{var l=Zi.get(r.rootId);return Zi.delete(r.rootId),e.onSuccess(r,l.context,r.args[0]),n(r)}}}}var IN=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 DN(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=Ir(Ir({},n),{env:a&&a.call.env,parentCall:a&&a.call}),l=!e.filter||e.filter(o),u=l?e:void 0,f=new IN(u,o);t.set(n.id,f);var p=void 0;try{p=i(n)}catch(w){throw t.delete(n.id),f.finish(w),w}return f.hasFlowsPending||(t.delete(n.id),f.finish()),p}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 S=n.args[0];try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish(S))}}case"flow_return":try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish())}}}}}function FN(e,t,r,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(uu(n))return n;if(Mt(n))return jd("[MSTNode: "+Sf(n).name+"]");if(typeof n=="function")return jd("[function]");if(typeof n=="object"&&!dl(n)&&!w2(n))return jd("[object "+(n&&n.constructor&&n.constructor.name||"Complex Object")+"]");try{return JSON.stringify(n),n}catch(i){return jd(""+i)}}function jN(e,t){return t&&typeof t=="object"&&"$MST_DATE"in t?new Date(t.$MST_DATE):t}function jd(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function A7(e,t){eu(function(){S2(t).forEach(function(r){return zN(e,r)})})}function zN(e,t){var r=E7(e,t.path||"");if(!r)throw He("Invalid action path: "+(t.path||""));var n=qe(r);if(t.name==="@APPLY_PATCHES")return ou.call(null,r,t.args[0]);if(t.name==="@APPLY_SNAPSHOT")return b7.call(null,r,t.args[0]);if(typeof r[t.name]!="function")throw He("Action '"+t.name+"' does not exist in '"+n.path+"'");return r[t.name].apply(r,t.args?t.args.map(function(i){return jN(n,i)}):[])}function BN(e,t){var r=[],n=function(o){var l=t?t(o,y2()):!0;l&&r.push(o)},i,a={actions:r,get recording(){return!!i},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=k7(e,n))},replay:function(o){A7(o,r)}};return a.resume(),a}function k7(e,t,r){return r===void 0&&(r=!1),M7(e,function(i,a){if(i.type==="action"&&i.id===i.rootId){var o=qe(i.context),l={name:i.name,path:j7(qe(e),o),args:i.args.map(function(f,p){return FN(o,i.name,p,f)})};if(r){var u=a(i);return t(l),u}else return t(l),a(i)}else return a(i)})}var UN=1,Sc;function m2(){return Sc}function R7(){return UN++}function km(e,t){var r=qe(e.context);e.type==="action"&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=Sc;Sc=e;try{return $N(r,e,t)}finally{Sc=i,r._isRunningAction=n}}function L7(e){if(e)return e.type==="action"?e:e.parentActionEvent}function Wc(e,t,r){var n=function(){var i=R7(),a=Sc,o=L7(a);return km({type:"action",name:t,id:i,args:V7(arguments),context:e,tree:_7(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?Vo(a.allParentIds,[a.id]):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}function M7(e,t,r){r===void 0&&(r=!0);var n=qe(e);return n.addMiddleWare(t,r)}function HN(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 GN=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 $N(e,t,r){var n=new GN(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(S,w){i=a(S),w&&(i=w(i))}function p(S){i=S}return u(o,f,p),i}return a(t)}function y2(){for(var e=m2();e&&e.type!=="action";)e=e.parentActionEvent;return e}function N7(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 VN(e,t){return N7(e,t,!1)}function qN(e,t){return N7(e,t,!0)}function WN(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: "+t+">"}}function I7(e){return typeof e=="function"?"<function"+(e.name?" "+e.name:"")+">":Mt(e)?"<"+e+">":"`"+WN(e)+"`"}function YN(e){return e.length<280?e:e.substring(0,272)+"......"+e.substring(e.length-8)}function KN(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 "/'+n+'" ':"",a=Mt(t)?"value of type "+qe(t).type.name+":":uu(t)?"value":"snapshot",o=r&&Mt(t)&&r.is(qe(t).snapshot);return""+i+a+" "+I7(t)+" is not assignable "+(r?"to type: `"+r.name+"`":"")+(e.message?" ("+e.message+")":"")+(r?iS(r)||uu(t)?".":", expected an instance of `"+r.name+"` or a snapshot like `"+r.describe()+"` instead."+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function b2(e,t,r){return e.concat([{path:t,type:r}])}function kn(){return su}function Rn(e,t,r){return[{context:e,value:t,message:r}]}function d0(e){return e.reduce(function(t,r){return t.concat(r)},[])}function Aa(e,t){dI()&&D7(e,t)}function D7(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw He(XN(e,t,r))}function XN(e,t,r){if(r.length!==0)return"Error while converting "+YN(I7(t))+" to `"+e.name+`\`:
106
+
107
+ `+r.map(KN).join(`
108
+ `)}var ZN=0,QN=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:ZN++}),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 this.cacheId+"-"+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([],h0));var i=this.cache.get(n);if(i.indexOf(t)!==-1)throw He("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;Fy(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 Y8(this.cache).forEach(function(a){for(var o=p2(a,2),l=o[0],u=o[1],f=!1,p=u.length-1;p>=0;p--){var S=u[p];(S===t||S.path.indexOf(i)===0)&&(n.addNodeToCache(S,!1),u.splice(p,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 He("Cannot resolve a reference to type '"+t.name+"' with id: '"+r+"' unambigously, there are multiple candidates: "+i.map(function(a){return a.path}).join(", "))}}}),e}();function _2(e,t,r,n,i){var a=F7(i);if(a){if(a.parent)throw He("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 '"+(t?t.path:"")+"/"+r+"', but it lives already at '"+a.path+"'");return t&&a.setParent(t,r),a}return new An(e,t,r,n,i)}function qo(e,t,r,n,i){return new qc(e,t,r,n,i)}function JN(e){return e instanceof qc||e instanceof An}var $r;(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"})($r||($r={}));function Mt(e){return!!(e&&e.$treenode)}function qe(e){if(!Mt(e))throw He("Value "+e+" is no MST Node");return e.$treenode}function F7(e){return e&&e.$treenode||null}function eI(){return qe(this).snapshot}var tI=function(e){return".."};function j7(e,t){if(e.root!==t.root)throw He("Cannot calculate relative path: objects '"+e+"' and '"+t+"' are not part of the same object tree");for(var r=cu(e.path),n=cu(t.path),i=0;i<r.length&&r[i]===n[i];i++);return r.slice(i).map(tI).join("/")+Hh(n.slice(i))}function z7(e,t,r){return r===void 0&&(r=!0),B7(e,cu(t),r)}function B7(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 qc){var o=n.value;Mt(o)&&(n=qe(o))}if(n instanceof An){var l=n.getChildType(a);if(l&&(n=n.getChildNode(a),n))continue}}}throw He("Could not resolve '"+a+"' in path '"+(Hh(t.slice(0,i))||"/")+"' while resolving '"+Hh(t)+"'")}}catch(u){if(!r)return;throw u}return n}function U7(e){if(!e)return su;var t=Object.keys(e);if(!t.length)return su;var r=new Array(t.length);return t.forEach(function(n,i){r[i]=e[n]}),r}function rI(e){return q7(),W7(e)}var nI=Object.toString(),su=Object.freeze([]),Tl=Object.freeze({}),h0=x8().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(h0);function He(e){return e===void 0&&(e="Illegal state"),new Error("[mobx-state-tree] "+e)}function iI(e){return e}var aI=Number.isInteger;function oI(e){return Number(e)===e&&e%1!==0}function lI(e){return Number.isFinite(e)}function w2(e){return Array.isArray(e)||gn(e)}function S2(e){return e?w2(e)?e:[e]:su}function sI(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 dl(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())===nI}function H7(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function uu(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function G7(e){return typeof e!="function"}function uI(e,t,r){Fr(e)?zy(e,t,r):Object.defineProperty(e,t,r)}function gl(e,t,r){uI(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}var cI=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,Vo(t))})}}),e}(),$7=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 cI),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,Vo(n))}}),e}();function V7(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}function hg(e,t){return e.indexOf(t)===0}var q7=function(e,t){};q7.ids={};function fI(e){console.warn(new Error("[mobx-state-tree] "+e))}function dI(){return typeof process<"u"&&L4&&L4.ENABLE_TYPE_CHECK==="true"}function pg(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function W7(e){return vI(e.name,e)}function hI(e){return e}function pI(e){return function(){var t,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];return m7(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,Vo(r))];case 1:return[2,n.sent()]}})}}function gI(e){return m7(this,function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent()]}})}function vI(e,t){var r=function(){var i=R7(),a=m2();if(!a)throw He("a mst flow must always have a parent context");var o=L7(a);if(!o)throw He("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:Vo(a.allParentIds,[a.id]),rootId:a.rootId,parentEvent:a,parentActionEvent:o},u=arguments;function f(p,S,w){return p.$mst_middleware=r.$mst_middleware,km(Ir(Ir({},l),{type:S,args:[w]}),p)}return new Promise(function(p,S){var w,g=function(){w=t.apply(null,arguments),E(void 0)};g.$mst_middleware=r.$mst_middleware,km(Ir(Ir({},l),{type:"flow_spawn",args:V7(u)}),g);function E(y){var h;try{var d=f(function(b){h=w.next(b)},"flow_resume",y);d instanceof Error&&(h=w.throw(d))}catch(b){pg(function(){f(function(O){S(b)},"flow_throw",b)});return}v(h)}function m(y){var h;try{f(function(d){h=w.throw(d)},"flow_resume_error",y)}catch(d){pg(function(){f(function(b){S(d)},"flow_throw",d)});return}v(h)}function v(y){if(y.done){pg(function(){f(function(h){p(h)},"flow_return",y.value)});return}if(!y.value||typeof y.value.then!="function")throw He("Only promises can be yielded to `async`, got: "+y);return y.value.then(E,m)}})};return r._isFlowAction=!0,r}function mI(e){if(!("oldValue"in e))throw He("Patches without `oldValue` field cannot be inversed");return[yI(e),bI(e)]}function yI(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 bI(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 _I(e){return typeof e=="number"}function Po(e){return _I(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Y7(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Hh(e){if(e.length===0)return"";var t=function(r){return r.map(Po).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function cu(e){var t=e.split("/").map(Y7),r=e===""||e==="."||e===".."||hg(e,"/")||hg(e,"./")||hg(e,"../");if(!r)throw He("a json path must be either rooted, empty or relative, but got '"+e+"'");return t[0]===""&&t.shift(),t}var gg=Symbol("$preProcessorFailed"),wI=function(e){Wt(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("+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 gg}}}),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;SI(r.type,this,"create"),r instanceof An&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},oS(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===gg?Rn(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=nn(r)?this._subtype:Mt(r)?g2(r,!1):this.preProcessSnapshotSafe(r);return n===gg?!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 lu))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(Da);function SI(e,t){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=wc(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 EI(e,t,r){return new wI(e,t,r)}var M4="Map.put can only be used to store complex values that have an identifier type attribute";function K7(e,t){var r,n,i=e.getSubTypes();if(i===T7)return!1;if(i){var a=S2(i);try{for(var o=wc(a),l=o.next();!l.done;l=o.next()){var u=l.value;if(!K7(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 Yc&&t.push(e),!0}var ho;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(ho||(ho={}));var OI=function(e){Wt(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 He("Map.put cannot be used to set empty values");if(Mt(r)){var n=qe(r);if(n.identifier===null)throw He(M4);return this.set(n.identifier,r),r}else if(H7(r)){var i=qe(this),a=i.type;if(a.identifierMode!==ho.YES)throw He(M4);var o=a.mapIdentifierAttribute,l=r[o];if(!O2(l)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(g2(u))}var f=Su(l);return this.set(f,r),this.get(f)}else throw He("Map.put can only be used to store complex values")}}),t}(mp),Gh=function(e){Wt(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:ho.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(),_2(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===ho.UNKNOWN){var r=[];if(K7(this._subType,r)){var n=r.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw He("The objects in a map should all have the same identifier attribute, expected '"+i+"', but child of type '"+a.name+"' declared attribute '"+a.identifierAttribute+"' as identifier");return a.identifierAttribute},void 0);n?(this.identifierMode=ho.YES,this.mapIdentifierAttribute=n):this.identifierMode=ho.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 OI(r,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Dy(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=Wc(n,l,u);gl(n,l,f)})}),pp(n,this.willChange),vp(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 Fy(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 He("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;Aa(o,l),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":Aa(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===ho.YES&&n instanceof An){var i=n.identifier;if(i!==r)throw He("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '"+i+"', but expected: '"+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:Po(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:Po(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:Po(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){Aa(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 dl(r)?d0(Object.keys(r).map(function(a){return i._subType.validate(r[a],b2(n,a,i._subType))})):Rn(n,r,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Tl}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(lu);Gh.prototype.applySnapshot=wr(Gh.prototype.applySnapshot);function xI(e){return new Gh("Map<string, "+e.name+">",e)}function PI(e){return nn(e)&&(e.flags&ut.Map)>0}var $h=function(e){Wt(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 _2(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=Ir(Ir({},h0),{name:this.name});return Ft.array(U7(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Fi(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=Wc(n,l,u);gl(n,l,f)})}),pp(n,this.willChange),vp(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 He("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=N4(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,p=N4(n,i,a.slice(l,l+u),f,f.map(function(w,g){return l+g}));if(!p)return null;r.added=p;for(var S=l+u;S<a.length;S++)a[S].setParent(n,""+(S+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":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:n.getChildNode(""+(r.index+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){Aa(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 w2(r)?d0(r.map(function(a,o){return i._subType.validate(a,b2(n,""+o,i._subType))})):Rn(n,r,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return su}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(lu);$h.prototype.applySnapshot=wr($h.prototype.applySnapshot);function CI(e){return new $h(e.name+"[]",e)}function N4(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,p=""+i[o];if(JN(f)&&(f=f.storedValue),!u&&!l)break;if(!l)a=!1,r.splice(o,1),u instanceof An&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(I4(u,f))r[o]=vg(t,e,p,f,u);else{for(var w=void 0,g=o;g<r.length;g++)if(I4(r[g],f)){w=r.splice(g,1)[0];break}a=!1;var S=vg(t,e,p,f,w);r.splice(o,0,S)}else{if(Mt(f)&&qe(f).parent===e)throw He("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 '"+e.path+"/"+p+"', but it lives already at '"+qe(f).path+"'");a=!1;var S=vg(t,e,p,f);r.splice(o,0,S)}}return a?null:r}function vg(e,t,r,n,i){Aa(e,n);function a(){if(Mt(n)){var l=qe(n);if(l.assertAlive(Tl),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 An&&i.createObservableInstanceIfNeeded(),i.die()),o}function I4(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 An))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&dl(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}function TI(e){return nn(e)&&(e.flags&ut.Array)>0}var D4="preProcessSnapshot",F4="postProcessSnapshot";function AI(){return qe(this).toString()}var j4={name:"AnonymousModel",properties:{},initializers:su};function kI(e){var t=Object.keys(e),r=new Set;return t.forEach(function(n){if(r.has(n))throw He(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 He("Hook '"+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 He("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw He("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(uu(o))n[i]=vl(DI(o),o);else if(o instanceof Gh)n[i]=vl(o,{});else if(o instanceof $h)n[i]=vl(o,[]);else if(!nn(o))throw He("Invalid type definition for property '"+i+"', cannot infer a type from a value like '"+o+"' ("+typeof o+")");return n},e)}var Yc=function(e){Wt(t,e);function t(r){var n=e.call(this,r.name||j4.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,j4,r),n.properties=kI(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 He("Cannot define property '"+n+"' as object identifier, property '"+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(!dl(n))throw He("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===D4)throw He("Cannot define action '"+D4+"', it should be defined using 'type.preProcessSnapshot(fn)' instead");if(i===F4)throw He("Cannot define action '"+F4+"', 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 p=Wc(r,i,f);n[i]=p,gl(r,i,p)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw He("You passed an "+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(!dl(n))throw He("volatile state initializer should return a plain object containing state");jy(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,p=nN(o,["actions","views","state"]);for(var S in p)throw He("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '"+S+"'");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(!dl(n))throw He("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)zy(r,i,o),By(r,(a={},a[i]=Rl,a));else if(typeof o.value=="function")gl(r,i,o.value);else throw He("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 _2(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=Ir(Ir({},h0),{name:this.name});return Ft.object(r,Tl,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){gl(n,"toString",AI),this.forAllProps(function(i){Dy(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),pp(n,this.willChange),vp(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&&(Aa(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:Po(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 He("Not a value property: "+n);var a=Fi(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw He("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=la(r.storedValue,o);u.reportObserved()}catch{throw He(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 He("object does not support operation "+i.op);r.storedValue[n]=i.value}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Aa(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 dl(a)?d0(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],b2(n,o,i.properties[o]))})):Rn(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 Tl}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(lu);Yc.prototype.applySnapshot=wr(Yc.prototype.applySnapshot);function RI(){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 Yc({name:r,properties:n})}function LI(){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 X7(e){return nn(e)&&(e.flags&ut.Object)>0}var $a=function(e){Wt(t,e);function t(r,n,i,a){a===void 0&&(a=iI);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 qo(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(uu(r)&&this.checker(r))return kn();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return Rn(n,r,"Value is not a "+i)}}),t}(ql),Z7=new $a("string",ut.String,function(e){return typeof e=="string"}),Q7=new $a("number",ut.Number,function(e){return typeof e=="number"}),MI=new $a("integer",ut.Integer,function(e){return aI(e)}),NI=new $a("float",ut.Float,function(e){return oI(e)}),II=new $a("finite",ut.Finite,function(e){return lI(e)}),J7=new $a("boolean",ut.Boolean,function(e){return typeof e=="boolean"}),eS=new $a("null",ut.Null,function(e){return e===null}),tS=new $a("undefined",ut.Undefined,function(e){return e===void 0}),rS=new $a("Date",ut.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});rS.getSnapshot=function(e){return e.storedValue.getTime()};var nS=rS;function DI(e){switch(typeof e){case"string":return Z7;case"number":return Q7;case"boolean":return J7;case"object":if(e instanceof Date)return nS}throw He("Cannot determine primitive type from value "+e)}function iS(e){return nn(e)&&(e.flags&(ut.String|ut.Number|ut.Integer|ut.Boolean|ut.Date))>0}var FI=function(e){Wt(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 qo(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 uu(r)&&r===this.value?kn():Rn(n,r,"Value is not a literal "+JSON.stringify(this.value))}}),t}(ql);function aS(e){return new FI(e)}function jI(e){return nn(e)&&(e.flags&ut.Literal)>0}var zI=function(e){Wt(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)?kn():Rn(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}(Da);function BI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():nn(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 zI(r,n,i,a)}function UI(e){return(e.flags&ut.Refinement)>0}function HI(e,t){var r=typeof e=="string"?t:e,n=p0.apply(void 0,Vo(r.map(function(i){return aS(""+i)})));return typeof e=="string"&&(n.name=e),n}var GI=function(e){Wt(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=Ir({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 He("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 He("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 kn();a++}else i.push(u)}return a===1?kn():Rn(n,r,"No type is applicable for the union").concat(d0(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(Da);function p0(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=nn(e)?void 0:e,i=nn(e)?Vo([e],t):t,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new GI(a,i,n)}function oS(e){return(e.flags&ut.Union)>0}var $I=function(e){Wt(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"&&Aa(this,r),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?kn():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}(Da);function VI(e,t){if(typeof t!="function"&&Mt(t))throw He("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function vl(e,t,r){return VI(e,t),new $I(e,t,r||qI)}var qI=[void 0];function WI(e){return nn(e)&&(e.flags&ut.Optional)>0}var YI=vl(tS,void 0),KI=vl(eS,null);function lS(e){return p0(e,YI)}function XI(e){return p0(e,KI)}var ZI=function(e){Wt(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 He("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):kn()}}),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||T7}}),t}(Da);function QI(e,t){var r=typeof e=="string"?e:"late("+e.toString()+")",n=typeof e=="string"?t:e;return new ZI(r,n)}function JI(e){return nn(e)&&(e.flags&ut.Late)>0}function eD(e,t){return new tD(e,t)}var tD=function(e){Wt(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()}),gm(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:"/"+o.subpath,value:o.snapshot}])})}))}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy "+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=qo(this,r,n,i,a);return this.pendingNodeList.push(l),gm(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):G7(r)?kn():Rn(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}(ql),sS=function(e){Wt(t,e);function t(r){var n=e.call(this,r?"frozen("+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 qo(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return G7(r)?this.subType?this.subType.validate(r,n):kn():Rn(n,r,"Value is not serializable and cannot be frozen")}}),t}(ql),z4=new sS;function rD(e){return arguments.length===0?z4:nn(e)?new sS(e):vl(z4,e)}function nD(e){return nn(e)&&(e.flags&ut.Frozen)>0}function iD(e){switch(e){case Pr.beforeDestroy:return"destroy";case Pr.beforeDetach:return"detach";default:return}}var aD=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}),O2(t))this.identifier=t;else if(Mt(t)){var n=qe(t);if(!n.identifierAttribute)throw He("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw He("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw He("Can only store references to tree nodes or identifiers, got: '"+t+"'")}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=Su(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 E2("[mobx-state-tree] Failed to resolve reference '"+this.identifier+"' to type '"+this.targetType.name+"' (from node: "+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}(),E2=function(e){Wt(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return t}(Error),uS=function(e){Wt(t,e);function t(r,n){var i=e.call(this,"reference("+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 O2(r)?kn():Rn(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){ou(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){X7(o.type)?this.replaceRef(void 0):ou(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(p,S){var w=iD(S);w&&i.fireInvalidated(w,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,p=f&&f.storedValue;if(f&&f.isAlive&&p){var S=void 0;i?S=!!i.get(n,p):S=r.root.identifierCache.has(a.targetType,Su(n)),S?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===$r.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(Pr.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(Pr.afterAttach,function(){l(!1)}))}}}),t}(ql),oD=function(e){Wt(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)?S7(a):a,l=new aD(a,this.targetType),u=qo(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}(uS),lD=function(e){Wt(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=qo(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}(uS);function cS(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new lD(e,{get:r.get,set:r.set},n):new oD(e,n)}function sD(e){return(e.flags&ut.Reference)>0}function uD(e,t){var r=cS(e,Ir(Ir({},t),{onInvalidated:function(n){t&&t.onInvalidated&&t.onInvalidated(n),n.removeRef()}}));return t&&t.acceptsUndefined===!1?r:lS(r)}var fS=function(e){Wt(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 Yc))throw He("Identifier types can only be instantiated as direct child of a model type");return qo(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 He("Tried to change identifier from '"+r.storedValue+"' to '"+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?Rn(n,r,"Value is not a valid "+this.describe()+", expected a "+this.validType):kn()}}),t}(ql),cD=function(e){Wt(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}(fS),fD=function(e){Wt(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}(fS),dD=new cD,hD=new fD;function pD(e){return nn(e)&&(e.flags&ut.Identifier)>0}function Su(e){return""+e}function O2(e){return typeof e=="string"||typeof e=="number"}function gD(e){return new vD(e)}var vD=function(e){Wt(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 kn();var i=this.options.getValidationMessage(r);return i?Rn(n,r,"Invalid value for type '"+this.name+"': "+i):kn()}}),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 qo(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}(ql),B4={enumeration:HI,model:RI,compose:LI,custom:gD,reference:cS,safeReference:uD,union:p0,optional:vl,literal:aS,maybe:lS,maybeNull:XI,refinement:BI,string:Z7,boolean:J7,number:Q7,integer:MI,float:NI,finite:II,Date:nS,map:xI,array:CI,frozen:rD,identifier:dD,identifierNumber:hD,late:QI,lazy:eD,undefined:tS,null:eS,snapshotProcessor:EI};const mD=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:ON,addMiddleware:M7,applyAction:A7,applyPatch:ou,applySnapshot:b7,cast:CN,castFlowReturn:hI,castToReferenceSnapshot:AN,castToSnapshot:TN,clone:wN,createActionTrackingMiddleware:NN,createActionTrackingMiddleware2:DN,decorate:HN,destroy:EN,detach:SN,escapeJsonPath:Po,flow:W7,getChildType:iN,getEnv:xN,getIdentifier:S7,getLivelinessChecking:v7,getMembers:PN,getNodeId:kN,getParent:fN,getParentOfType:hN,getPath:w7,getPathParts:pN,getPropertyMembers:x7,getRelativePath:_N,getRoot:_7,getRunningActionContext:y2,getSnapshot:g2,getType:Sf,hasParent:cN,hasParentOfType:dN,isActionContextChildOf:VN,isActionContextThisOrChildOf:qN,isAlive:v2,isArrayType:TI,isFrozenType:nD,isIdentifierType:pD,isLateType:JI,isLiteralType:jI,isMapType:PI,isModelType:X7,isOptionalType:WI,isPrimitiveType:iS,isProtected:uN,isReferenceType:sD,isRefinementType:UI,isRoot:gN,isStateTreeNode:Mt,isType:nn,isUnionType:oS,isValidReference:bN,joinJsonPath:Hh,onAction:k7,onPatch:y7,onSnapshot:aN,process:rI,protect:lN,recordActions:BN,recordPatches:oN,resolveIdentifier:mN,resolvePath:vN,setLivelinessChecking:g7,setLivelynessChecking:rN,splitJsonPath:cu,t:B4,toGenerator:gI,toGeneratorFunction:pI,tryReference:yN,tryResolve:E7,typecheck:D7,types:B4,unescapeJsonPath:Y7,unprotect:sN,walk:O7},Symbol.toStringTag,{value:"Module"})),Hi=Lo(mD);(function(e){var t=Se&&Se.__importDefault||function(j){return j&&j.__esModule?j:{default:j}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.usePrevious=e.getLineHeight=e.useFontLoader=e.getDir=e.isRTLText=void 0;const r=t(it),n=zi,i=Ga,a=yf,o=ja,l=tN,u=bf,f=Ia,p=_f,S=di,w=h2,g=wf,E=$l,m=Vl,v=$o,y=Hi,h=document.createElement("style");h.type="text/css",document.head.appendChild(h);const d={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function b(j){var G="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+G+"]*?["+G+"]").test(j)}function O(j){j=j.replace(/\s/g,"");let G=0;for(var z=0;z<j.length;z++)b(j[z])&&(G+=1);return G>j.length/2}function x(j){return O(j)?"rtl":"ltr"}e.isRTLText=O,e.getDir=x;const P=(0,n.observer)(({textNodeRef:j,element:G,onBlur:z,selectAll:q,cursorPosition:L})=>{const[I,B]=r.default.useState(d),M=j.current;r.default.useLayoutEffect(()=>{const X={};X.width=M.width()-2*M.padding()+"px",X.height=M.height()-2*M.padding()+M.fontSize()*M.lineHeight()+"px",X.fontSize=M.fontSize()+"px",X.lineHeight=M.lineHeight()+.01,X.fontFamily=M.fontFamily(),X.textAlign=M.align(),X.color=M.fill(),X.fontWeight=G.fontWeight,X.fontStyle=G.fontStyle,X.letterSpacing=G.letterSpacing+"em";const Z=`
109
+ .polotno-input::placeholder {
110
+ color: ${I.color};
111
+ opacity: 0.6;
112
+ }
113
+ `;h.innerHTML="",h.appendChild(document.createTextNode(Z)),JSON.stringify(X)!==JSON.stringify(I)&&B(X)});const $=r.default.useRef(null);r.default.useEffect(()=>{const X=setTimeout(()=>{var Z;const J=$.current;if(!J)return;(Z=$.current)===null||Z===void 0||Z.focus();const ee=L||J.value.length;J.selectionStart=J.selectionEnd=ee,q&&(J==null||J.select(),document.execCommand("selectAll",!1,null))});return()=>{clearTimeout(X)}},[]),r.default.useEffect(()=>{window.addEventListener("blur",z);const X=Z=>{var J;!((J=$.current)===null||J===void 0)&&J.contains(Z.target)||z()};return window.addEventListener("touchstart",X),()=>{window.removeEventListener("blur",z),window.removeEventListener("touchstart",X)}},[]);let K=0;const V=M.textArr.length*M.lineHeight()*M.fontSize();G.verticalAlign==="middle"&&(K=(G.a.height-V)/2),G.verticalAlign==="bottom"&&(K=G.a.height-V);const H=(0,w.removeTags)(G.text);return r.default.createElement(a.Html,null,r.default.createElement("textarea",{className:"polotno-input",ref:$,dir:x(H),style:Object.assign(Object.assign(Object.assign({},d),I),{paddingTop:K+"px"}),value:H,onChange:X=>{G.set({text:X.target.value})},placeholder:G.placeholder,onBlur:z}))}),_=j=>{const[G,z]=r.default.useState(!1),q=r.default.useRef(!1);return r.default.useEffect(()=>{var L=!0;return setTimeout(()=>{L&&(j._editModeEnabled&&(q.current=!0),z(!0),setTimeout(()=>{q.current=!1},50))},50),()=>{L=!1}},[]),{editorEnabled:G&&j._editModeEnabled,selectAll:q.current}},A=(j,G)=>{const[z,q]=r.default.useReducer(I=>I+1,0),L=r.default.useRef((0,p.isFontLoaded)(G));return r.default.useLayoutEffect(()=>{if(L.current=(0,p.isFontLoaded)(G),L.current)return;let I=!0;return(async()=>{L.current=!1,q();const B=(0,f.incrementLoader)(`text ${G}`);await j.loadFont(G),setTimeout(B,100),I&&(L.current=!0,q())})(),()=>{I=!1}},[G]),[L.current]};e.useFontLoader=A;const C=({fontLoaded:j,fontFamily:G,fontSize:z,lineHeight:q})=>r.default.useMemo(()=>{if(typeof q=="number")return q;const L=document.createElement("div");L.style.fontFamily=G,L.style.fontSize=z+"px",L.style.lineHeight=q,L.innerText="Test text",document.body.appendChild(L);const I=L.offsetHeight;return document.body.removeChild(L),I/z},[j,G,z,q]);function k(j){var G=j.getAbsoluteTransform().copy();G.invert();var z=j.getStage().getPointerPosition();return G.point(z)}function R(j){var G;const z=j.target,q=k(z),L=z.textArr,I=Math.floor(q.y/(z.fontSize()*z.lineHeight())),B=L.slice(0,I).reduce((K,V)=>K+V.text.length,I),M=(G=L[I])!==null&&G!==void 0?G:L[0];let $=0;return z.align()==="right"?$=z.width()-M.width:z.align()==="center"&&($=z.width()/2-M.width/2),B+Math.round((q.x-$)/M.width*M.text.length)}function D(j){const G=r.default.useRef(j),z=r.default.useRef(j);return r.default.useMemo(()=>{z.current=G.current,G.current=j},[j]),z.current}function U(j,G){const z=j.fontSize(),q=j.height(),L=(0,w.removeTags)(G.text);let I=G.a.fontSize;j.height(void 0);const B=Math.round(2*G.a.fontSize)-1;for(let M=1;M<B;M++){const $=G.a.height&&j.height()>G.a.height,K=L.split(`
114
+ `).join(" ").split(/[\s-]+/);let V=j.textArr.map(X=>X.text).join(";");const H=K.find(X=>!V.includes(X)||(V=V.replace(X,""),!1));if(!($||H))break;I-=.5,j.fontSize(I)}return j.fontSize(z),j.height(q),I}function Y({lines:j,lineHeight:G,width:z,align:q="left",padding:L=0,cornerRadius:I=0}){var B;j.forEach((V,H)=>{V.cx=z/2,q==="right"?V.cx=z-V.width/2:q==="left"&&(V.cx=V.width/2),q!=="justify"||V.lastInParagraph||(V.width=z),q==="justify"&&(V.cx=V.width/2)});let M=`M ${(B=j[0])===null||B===void 0?void 0:B.cx} ${-L}`;j.forEach((V,H)=>{const{cx:X}=V,Z=j[H-1];Z&&Z.width>V.width?M+=` L ${X+V.width/2+L} ${H*G+L}`:M+=` L ${X+V.width/2+L} ${H*G-L}`;const J=j[H+1];J&&J.width>V.width?M+=` L ${X+V.width/2+L} ${(H+1)*G-L}`:M+=` L ${X+V.width/2+L} ${(H+1)*G+L}`});for(var $=j.length-1;$>=0;$--){const V=j[$],{cx:H}=V,X=j[$+1];X&&X.width>V.width?M+=` L ${H-V.width/2-L} ${($+1)*G-L}`:M+=` L ${H-V.width/2-L} ${($+1)*G+L}`;const Z=j[$-1];Z&&Z.width>V.width?M+=` L ${H-V.width/2-L} ${$*G+L}`:M+=` L ${H-V.width/2-L} ${$*G-L}`}M+=" Z";const K=(0,l.parsePath)(M);return(0,l.roundCommands)(K,I).path}e.getLineHeight=C,e.usePrevious=D,e.TextElement=(0,n.observer)(({element:j,store:G})=>{const z=r.default.useRef(null),q=r.default.useRef(null),{editorEnabled:L,selectAll:I}=_(j),[B,M]=r.default.useState(!1),[$,K]=r.default.useState(!1),V=r.default.useRef(j.a.height),H=G.selectedElements.indexOf(j)>=0,{textVerticalResizeEnabled:X}=S.flags,Z=D(j.fontFamily),[J,ee]=r.default.useState([]);r.default.useEffect(()=>{var se,Pe;const xe=(Pe=(se=z.current)===null||se===void 0?void 0:se.textArr)!==null&&Pe!==void 0?Pe:[];JSON.stringify(xe)!==JSON.stringify(J)&&ee(xe)}),r.default.useEffect(()=>{if(j.a.width)return;const se=z.current;se.width(600),j.set({width:1.4*se.getTextWidth()})},[]),r.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const se=z.current;(0,g.applyFilter)(se,j)}));const[re]=(0,e.useFontLoader)(G,j.fontFamily),ne=(0,w.removeTags)(j.text),de=()=>{const se=z.current.clone({height:void 0}),Pe=Math.ceil(se.fontSize()*se.lineHeight()*se.textArr.length+1);return se.destroy(),Pe};r.default.useLayoutEffect(()=>{if(!re)return;const{textOverflow:se}=S.flags;if(j.a.height)if(se!=="change-font-size"||$||G.isPlaying){if(se==="resize"){const Pe=de();X&&j.a.height<Pe&&G.history.ignore(()=>{var xe;(0,y.isAlive)(j)&&j.set({height:Pe}),(xe=z.current)===null||xe===void 0||xe.height(Pe)},!1,!0),X||j.a.height===Pe||G.history.ignore(()=>{var xe;(0,y.isAlive)(j)&&j.set({height:Pe}),(xe=z.current)===null||xe===void 0||xe.height(Pe)},!1,!0)}}else{const Pe=U(z.current,j);if(Pe!==j.a.fontSize)return void G.history.ignore(()=>{j.set({fontSize:Pe})},!1,!0);const xe=de();j.a.height===xe||X||G.history.ignore(()=>{j.set({height:xe})},!1,!0)}else{const Pe=de();G.history.ignore(()=>{j.set({height:Pe})},!1,!0)}}),r.default.useLayoutEffect(()=>{const se=z.current;se&&(se.width(se.width()+1e-8),se._setTextData(),(0,g.applyFilter)(se,j))},[re]);const pe=r.default.useRef(null),Me=r.default.useRef(0),Fe=se=>{se.evt.preventDefault(),G.selectedShapes.find(xe=>xe===j)&&j.contentEditable&&(Me.current=R(se),j.toggleEditMode())},fe=!ne&&j.placeholder?.6:j.a.opacity;(0,E.useFadeIn)(z,fe);const ie=(0,e.getLineHeight)({fontLoaded:re,fontFamily:j.fontFamily,fontSize:j.a.fontSize,lineHeight:j.lineHeight}),ve=j.selectable||G.role==="admin",ge=(0,u.useColor)(j),te=r.default.useMemo(()=>j.backgroundEnabled?Y({lines:JSON.parse(JSON.stringify(J)),cornerRadius:j.backgroundCornerRadius*(j.a.fontSize*ie*.5),lineHeight:ie*j.a.fontSize,padding:j.backgroundPadding*(j.a.fontSize*ie*.5),width:j.a.width,align:j.align}):"",[j.backgroundEnabled,j.backgroundCornerRadius,j.a.fontSize,ie,j.backgroundPadding,j.a.width,j.align,J]),ue=(0,v.useMobile)();let be=0;return j.verticalAlign==="middle"?be=(j.a.height-J.length*ie*j.a.fontSize)/2:j.verticalAlign==="bottom"&&(be=j.a.height-J.length*ie*j.a.fontSize),r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Path,{ref:q,x:j.a.x,y:j.a.y,rotation:j.a.rotation,hideInExport:!j.showInExport||!ne,listening:!1,visible:j.backgroundEnabled,opacity:j.backgroundOpacity,data:te,fill:j.backgroundColor,offsetY:-be}),r.default.createElement(i.Text,Object.assign({ref:z,id:j.id,name:"element",hideInExport:!j.showInExport||!ne,editModeEnabled:j._editModeEnabled,x:j.a.x,y:j.a.y,rotation:j.a.rotation,width:j.a.width,height:j.a.height,text:ne||j.placeholder},ge,{stroke:j.stroke,lineJoin:"round",strokeWidth:j.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:j.a.fontSize,fontFamily:`"${j.fontFamily}", "${Z}"`,fontStyle:j.fontStyle+" "+j.fontWeight,textDecoration:j.textDecoration,align:j.align,verticalAlign:j.verticalAlign,draggable:ue?j.draggable&&H:j.draggable,preventDefault:!ue||H,opacity:fe,visible:!j._editModeEnabled,ellipsis:S.flags.textOverflow==="ellipsis",shadowEnabled:j.shadowEnabled,shadowBlur:j.shadowBlur,shadowOffsetX:j.shadowOffsetX,shadowOffsetY:j.shadowOffsetY,shadowColor:j.shadowColor,shadowOpacity:j.shadowOpacity,lineHeight:ie,letterSpacing:j.letterSpacing*j.a.fontSize,listening:ve,onDragMove:se=>{j.set({x:se.target.x(),y:se.target.y()})},onDragEnd:se=>{j.set({x:se.target.x(),y:se.target.y()})},onMouseEnter:()=>{M(!0)},onMouseLeave:()=>{M(!1)},onClick:Fe,onTap:Fe,onTransformStart:()=>{K(!0),V.current=z.current.height()},onTransform:se=>{var Pe,xe;const Ie=se.target;(Pe=q.current)===null||Pe===void 0||Pe.setAttrs({x:Ie.x(),y:Ie.y(),rotation:Ie.rotation(),scale:Ie.scale()});const xt=((xe=Ie.getStage())===null||xe===void 0?void 0:xe.findOne("Transformer")).getActiveAnchor();if(xt==="middle-left"||xt==="middle-right"){const tt=Ie.scaleX(),St=Ie.width()*tt,Ht=j.a.fontSize;let le=St;St<Ht&&(le=Ht,pe.current&&Ie.position(pe.current)),Ie.width(le),Ie.scaleX(1),Ie.scaleY(1);const he=de();if(S.flags.textOverflow!=="ellipsis"){const nt=Math.max(he,V.current);Ie.height(nt),j.set({height:Ie.height()})}j.set({x:Ie.x(),y:Ie.y(),width:Ie.width(),rotation:Ie.rotation()}),(0,g.applyFilter)(Ie,j)}if(xt==="top-center"||xt==="bottom-center"){let tt=S.flags.textOverflow==="resize"?de():ie*j.a.fontSize;se.target.height(Math.max(tt,se.target.height()*se.target.scaleY())),se.target.scaleY(1)}pe.current=se.target.position()},onTransformEnd:se=>{var Pe;const xe=se.target.scaleX();se.target.scaleX(1),se.target.scaleY(1),j.set({fontSize:Math.round(j.a.fontSize*xe),width:Math.ceil(se.target.width()*xe),x:se.target.x(),y:se.target.y(),rotation:se.target.rotation(),height:se.target.height()*xe,shadowBlur:j.shadowBlur*xe,shadowOffsetX:j.shadowOffsetX*xe,shadowOffsetY:j.shadowOffsetY*xe,strokeWidth:j.strokeWidth*xe}),(Pe=q.current)===null||Pe===void 0||Pe.setAttrs({scaleX:1,scaleY:1}),K(!1)}})),L&&r.default.createElement(i.Group,{x:j.a.x,y:j.a.y,rotation:j.a.rotation},r.default.createElement(P,{textNodeRef:z,element:j,selectAll:I,cursorPosition:Me.current,onBlur:()=>{j.toggleEditMode(!1)}})),!$&&(B||H)&&r.default.createElement(m.Highlighter,{element:j}))})})(c2);var x2={},Eu={};(function(e){var t=Se&&Se.__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(Ui),n=t(it),i=f2;function a(d){for(;d.parentNode;){if(d.nodeName==="defs")return!0;d=d.parentNode}return!1}function o(d){const b={fill:"",stroke:""};if(d.getAttribute("fill")&&d.getAttribute("fill")!=="none"&&(b.fill=d.getAttribute("fill")),!b.fill&&d.style.fill&&d.style.fill!=="none"&&(b.fill=d.style.fill),d.getAttribute("stroke")&&(b.stroke=d.getAttribute("stroke")),!b.stroke&&d.style.stroke&&(b.stroke=d.style.stroke),!b.stroke&&!b.fill){const O=d.ownerSVGElement,x=O&&O!==d&&o(O);(x==null?void 0:x.fill)==="currentColor"||(x==null?void 0:x.stroke)==="currentColor"||(b.fill="black")}return b}const l=["path","rect","circle"];function u(d){for(var b=[],O=d.getElementsByTagName("*"),x=0,P=O.length;x<P;x++){const _=O[x];a(_)||(_.getAttribute("fill")!==null&&b.push(_),(_.getAttribute("stroke")!==null||_.style&&_.style.fill||l.indexOf(_.nodeName)>=0)&&b.push(_))}return b}async function f(d){const b=await fetch(d);return w(await b.text())}async function p(d){return await(await fetch(d,{mode:"cors"})).text()}function S(d){const b=u(new DOMParser().parseFromString(d,"image/svg+xml")),O=[];return b.forEach(x=>{const{fill:P,stroke:_}=o(x);[P,_].forEach(A=>{A&&(A==="currentColor"&&(A="black"),r.default.Util.colorToRGBA(A)&&O.indexOf(A)===-1&&O.push(A))})}),O}function w(d){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(d)))}async function g(d){const b=await p(d),O=new DOMParser().parseFromString(b,"image/svg+xml").documentElement.getAttribute("viewBox"),[x,P,_,A]=(O==null?void 0:O.split(" "))||[];return{width:parseFloat(_),height:parseFloat(A)}}function E(d){var b=new DOMParser().parseFromString(d,"image/svg+xml");const O=b.documentElement.getAttribute("viewBox"),[x,P,_,A]=(O==null?void 0:O.split(" "))||[],C=b.documentElement.getAttribute("width");!C&&b.documentElement.setAttribute("width",_+"px");const k=b.documentElement.getAttribute("height");if((!k||k.indexOf("%")>=0)&&b.documentElement.setAttribute("height",A+"px"),C&&C.indexOf("%")>=0&&k&&k.indexOf("%")===-1){const R=parseFloat(k)/parseFloat(A);b.documentElement.setAttribute("width",R*parseFloat(_)+"px")}if(k&&k.indexOf("%")>=0&&C&&C.indexOf("%")===-1){const R=parseFloat(C)/parseFloat(_);b.documentElement.setAttribute("height",R*parseFloat(A)+"px")}return C==="100%"&&k==="100%"&&(b.documentElement.setAttribute("width",_+"px"),b.documentElement.setAttribute("height",A+"px")),new XMLSerializer().serializeToString(b)}e.urlToBase64=f,e.urlToString=p,e.getColors=S,e.svgToURL=w,e.getSvgSize=g,e.fixSize=E;const m=(d,b)=>{if(!d||!b)return!1;if(b==="currentColor"&&d==="black")return!0;const O=r.default.Util.colorToRGBA(d),x=r.default.Util.colorToRGBA(b);return O&&x?O.r===x.r&&O.g===x.g&&O.b===x.b&&O.a===x.a:void 0};function v(d,b,O,x){var P=d.namespaceURI,_=document.createElementNS(P,"linearGradient");const A=r.default.Util.degToRad(O+90),C=(Math.cos(A)+1)/2,k=(Math.sin(A)+1)/2,R=(Math.cos(A+Math.PI)+1)/2,D=(Math.sin(A+Math.PI)+1)/2;_.setAttribute("x1",100*C+"%"),_.setAttribute("y1",100*k+"%"),_.setAttribute("x2",100*R+"%"),_.setAttribute("y2",100*D+"%"),_.setAttribute("gradientUnits","userSpaceOnUse"),_.setAttribute("id",b);for(var U=0;U<x.length;U++){var Y=x[U],j=document.createElementNS(P,"stop");for(var G in Y)Y.hasOwnProperty(G)&&j.setAttribute(G,Y[G]);_.appendChild(j)}return(d.querySelector("defs")||d.insertBefore(document.createElementNS(P,"defs"),d.firstChild)).appendChild(_)}function y(d,b){var O=new DOMParser().parseFromString(d,"image/svg+xml");const x=u(O),P=Array.from(b.keys());return x.forEach(_=>{const{fill:A,stroke:C}=o(_);[{prop:"fill",color:A},{prop:"stroke",color:C}].forEach(({prop:k,color:R})=>{const D=P.find(U=>(0,e.sameColors)(U,R));if(D){const U=b.get(D);if((0,i.isGradient)(U)){const{rotation:Y,stops:j}=(0,i.parseColor)(U),G=j.map(q=>({offset:100*q.offset+"%","stop-color":q.color})),z="color"+Math.round(1e8*Math.random());v(O.children[0],z,Y,G),_.style[k]=null,_.setAttribute(k,`url('#${z}')`)}else _.style[k]=b.get(D)}})}),w(new XMLSerializer().serializeToString(O))}e.sameColors=m,e.replaceColors=y;const h=d=>{const[b,O]=n.default.useState([]);return n.default.useEffect(()=>{let x=!1;return(async()=>{O([]);const P=S(await p(d));x||O(P)})(),()=>{x=!0}},[d]),b};e.useSvgColors=h})(Eu);(function(e){var t=Se&&Se.__createBinding||(Object.create?function(M,$,K,V){V===void 0&&(V=K);var H=Object.getOwnPropertyDescriptor($,K);H&&!("get"in H?!$.__esModule:H.writable||H.configurable)||(H={enumerable:!0,get:function(){return $[K]}}),Object.defineProperty(M,V,H)}:function(M,$,K,V){V===void 0&&(V=K),M[V]=$[K]}),r=Se&&Se.__setModuleDefault||(Object.create?function(M,$){Object.defineProperty(M,"default",{enumerable:!0,value:$})}:function(M,$){M.default=$}),n=Se&&Se.__importStar||function(M){if(M&&M.__esModule)return M;var $={};if(M!=null)for(var K in M)K!=="default"&&Object.prototype.hasOwnProperty.call(M,K)&&t($,M,K);return r($,M),$},i=Se&&Se.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(it),o=zi,l=ja,u=Ga,f=i(f0),p=i(Ui),S=yf,w=Vl,g=Ia,E=n(Eu),m=di,v=wf,y=$l,h=$o;function d(){return document.createElement("canvas")}async function b(M){if(!(M.indexOf("data:image/svg+xml")>=0||M.indexOf(".svg")>=0))return M;const $=await E.urlToString(M),K=E.fixSize($);return E.svgToURL(K)}const O=M=>{const[$,K]=a.default.useState(M);return a.default.useEffect(()=>{(async()=>{const V=await b(M);V!==$&&K(V)})()},[M]),$};function x(M,$){return Math.sqrt(Math.pow($.x-M.x,2)+Math.pow($.y-M.y,2))}function P(M,$){return{x:(M.x+$.x)/2,y:(M.y+$.y)/2}}const _=(M,$,K)=>{const V=a.default.useMemo(()=>{var H,X;const{flipX:Z,flipY:J}=M,ee=M.type==="svg"||M.src.indexOf("data:image/svg+xml")>=0||M.src.indexOf(".svg")>=0,re=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&ee||M.maskSrc;if(!Z&&!J&&!re)return $;if(!$||!$.width||!$.height)return null;const ne=d();let de=1;M.type==="svg"&&(de=Math.max(M.a.width/$.width*K,M.a.height/$.height*K)),ne.width=Math.max($.width*de,1),ne.height=Math.max($.height*de,1);let pe=Z?-ne.width:0,Me=J?-ne.height:0;return(H=ne.getContext("2d"))===null||H===void 0||H.scale(Z?-1:1,J?-1:1),(X=ne.getContext("2d"))===null||X===void 0||X.drawImage($,pe,Me,ne.width,ne.height),ne},[M.maskSrc,M.flipX,M.flipY,$,M.a.width,M.a.height,K]);return a.default.useEffect(()=>()=>{V&&V.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(V)},[V]),V};function A(M,$){const K=$.width/$.height;let V,H;return K>=M.width/M.height?(V=M.width,H=M.width/K):(V=M.height*K,H=M.height),{x:(M.width-V)/2,y:(M.height-H)/2,width:V,height:H}}function C(M,$,K,V,H,X,Z){for(var J=new ImageData($,K),ee=new Int32Array(M.data.buffer),re=M.width,ne=new Int32Array(J.data.buffer),de=J.width,pe=$/X,Me=K/Z,Fe=Math.round(1/pe),fe=Math.round(1/Me),ie=Fe*fe,ve=0;ve<J.height;ve++)for(var ge=0;ge<de;ge++){for(var te=V+Math.round(ge/pe)+(H+Math.round(ve/Me))*re,ue=0,be=0,se=0,Pe=0,xe=0;xe<fe;xe++)for(var Ie=0;Ie<Fe;Ie++){var xt=ee[te+Ie+xe*re];ue+=xt<<24>>>24,be+=xt<<16>>>24,se+=xt<<8>>>24,Pe+=xt>>>24}ue=Math.round(ue/ie),be=Math.round(be/ie),se=Math.round(se/ie),Pe=Math.round(Pe/ie),ne[ge+ve*de]=Pe<<24|se<<16|be<<8|ue}return J}function k(M,$){var K,V;const H=d();H.width=M.width,H.height=M.height;const X=Math.max(1,Math.floor(H.width*$)),Z=Math.max(1,Math.floor(H.height*$));(K=H.getContext("2d"))===null||K===void 0||K.drawImage(M,0,0,H.width,H.height);const J=C(H.getContext("2d").getImageData(0,0,H.width,H.height),X,Z,0,0,H.width,H.height);return H.width=X,H.height=Z,(V=H.getContext("2d"))===null||V===void 0||V.putImageData(J,0,0),H}const R=(M,$)=>{const[K,V]=z(M.maskSrc,"anonymous"),H=M.maskSrc?V:"loaded";return(0,e.useImageLoader)(H,M.id+"-mask"),a.default.useMemo(()=>{if(!K||!$||!$.width||!$.height)return $;const X=d();X.width=Math.max($.width,1),X.height=Math.max($.height,1);const Z=X.getContext("2d");if(!Z)return $;Z.drawImage($,0,0),Z.globalCompositeOperation="source-in";const J=A(K,M);return Z.drawImage(K,J.x,J.y,J.width,J.height,0,0,$.width,$.height),X},[$,K,M.a.width,M.a.height])},D=(M,$,K,V,H=0,X=!1)=>{const Z=Math.floor(Math.max(M.a.width*V,1)),J=Math.floor(Math.max(M.a.height*V,1)),ee=Math.min(H*V,Z/2,J/2),re=Math.max(M.a.width/K.width,M.a.height/K.height)*V,ne=M.page._exporting&&m.flags.imageDownScalingEnabled&&re<1&&!X,de=K.x===0&&K.y===0&&K.width===($==null?void 0:$.width)&&K.height===($==null?void 0:$.height),pe=a.default.useMemo(()=>{if(!(!$||!$.width||!$.height))return de&&ee===0&&!ne?void 0:d()},[$,ee,ne,de]);return a.default.useLayoutEffect(()=>{if(!pe||!$)return;pe.width=Z,pe.height=J;const Me=pe.getContext("2d");if(!Me)return;ee&&(Me.beginPath(),Me.moveTo(ee,0),Me.lineTo(Z-ee,0),Me.arc(Z-ee,ee,ee,3*Math.PI/2,0,!1),Me.lineTo(Z,J-ee),Me.arc(Z-ee,J-ee,ee,0,Math.PI/2,!1),Me.lineTo(ee,J),Me.arc(ee,J-ee,ee,Math.PI/2,Math.PI,!1),Me.lineTo(0,ee),Me.arc(ee,ee,ee,Math.PI,3*Math.PI/2,!1),Me.clip());const Fe=ne?k($,re):$,fe=ne?{x:Math.floor(K.x*re),y:Math.floor(K.y*re),width:Math.floor(K.width*re),height:Math.floor(K.height*re)}:K;Me.drawImage(Fe,fe.x,fe.y,fe.width,fe.height,0,0,pe.width,pe.height)},[pe,M.a.width,M.a.height,K.x,K.y,K.width,K.height,H,V,X,M.page._exporting,ne]),a.default.useEffect(()=>()=>{pe&&pe.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(pe)},[pe]),pe||$},U=(M,$,K,V)=>{const H=O(M.clipSrc||""),[X,Z]=z(H,"anonymous"),J=M.clipSrc?Z:"loaded";(0,e.useImageLoader)(J,M.id+"-clip");const ee=a.default.useMemo(()=>{if($&&X)return d()},[$,X]);return a.default.useLayoutEffect(()=>{var re;if(!X||!$||!$.width||!$.height||!X||!X.width||!X.height||!ee)return;const ne=d(),de=Math.max(M.a.width/X.width*K,M.a.height/X.height*K);ne.width=X.width*de,ne.height=X.height*de,(re=ne.getContext("2d"))===null||re===void 0||re.drawImage(X,0,0,ne.width,ne.height),ee.width=Math.max($.width,1),ee.height=Math.max($.height,1);const pe=ee.getContext("2d");pe&&(pe.save(),pe.drawImage(ne,0,0,$.width,$.height),p.default.Util.releaseCanvas(ne),pe.globalCompositeOperation="source-in",pe.drawImage($,0,0,ee.width,ee.height),pe.restore())},[ee,$,X,M.a.width,M.a.height,K,...V]),M.clipSrc&&X?ee:$},Y=d(),j=(0,o.observer)(({element:M})=>{const $=Math.min(30,M.a.width/4,M.a.height/4),K=a.default.useRef(null);return a.default.useEffect(()=>{const V=K.current;if(!V)return;const H=new p.default.Animation(X=>{V.rotate(((X==null?void 0:X.timeDiff)||0)/2)},V.getLayer());return H.start(),()=>{H.stop()}}),a.default.createElement(u.Group,{x:M.x,y:M.y,rotation:M.rotation,listening:!1,opacity:M.a.opacity,hideInExport:!M.showInExport},a.default.createElement(u.Rect,{width:M.a.width,height:M.a.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:K,x:M.a.width/2,y:M.a.height/2,fill:"white",outerRadius:Math.abs($),innerRadius:Math.max(1,$-5),angle:270}))}),G=(0,o.observer)(({element:M})=>{const $="Can not load the image...",K=Math.max(10,Math.min(30,M.a.width/25));return a.default.createElement(u.Group,{x:M.x,y:M.y,rotation:M.rotation,listening:!1,opacity:M.a.opacity,hideInExport:!M.showInExport},a.default.createElement(u.Rect,{width:M.a.width,height:M.a.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:$,fontSize:K,width:M.a.width,height:M.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let z=f.default;const q=M=>{z=M};e.setImageLoaderHook=q;const L=(M,$)=>{const K=a.default.useRef(),V=()=>{var H;(H=K.current)===null||H===void 0||H.call(K),K.current=void 0};a.default.useEffect(()=>V,[]),a.default.useLayoutEffect(()=>{M!=="loading"||K.current||(K.current=(0,g.incrementLoader)(`image ${$}`)),M!=="loading"&&V(),M==="failed"&&(0,g.triggerLoadError)(`image ${$}`)},[M])};e.useImageLoader=L;const I=({image:M,status:$,type:K})=>{const V=a.default.useRef();return a.default.useEffect(()=>{V.current=M||V.current},[M]),$!=="failed"||$!=="failed"&&K==="svg"?V.current:void 0},B=M=>{const[$,K]=a.default.useReducer(Z=>Z+1,0),V=a.default.useRef("loading"),H=a.default.useRef(M.src),X=a.default.useRef(M.src);return X.current!==M.src&&(X.current=M.src,V.current="loading"),a.default.useEffect(()=>{if(M.type!=="svg"||!M.src)return;let Z=!1;return(async()=>{V.current="loading",K();const J=await E.urlToString(M.src),ee=E.fixSize(J),re=E.replaceColors(ee,M.colorsReplace);Z||(H.current=re,V.current="loaded",K())})(),()=>{Z=!0}},[M.src,JSON.stringify(M.colorsReplace)]),M.type!=="svg"?[M.src,"loaded"]:[H.current,V.current]};e.ImageElement=(0,o.observer)(({element:M,store:$})=>{var K;const[V,H]=a.default.useState(!1),X=a.default.useRef(null),Z=a.default.useRef(null),[J,ee]=a.default.useState(!1),re=$.selectedElements.indexOf(M)>=0,[ne,de]=B(M),[pe,Me]=z(ne,"anonymous"),Fe=M.type!=="svg"||de==="loaded"?Me:"loading";(0,e.useImageLoader)(Fe,M.id);const fe=I({image:pe,status:Me,type:M.type}),ie=R(M,_(M,pe||fe,$._elementsPixelRatio))||Y;let{cropX:ve,cropY:ge,cropWidth:te,cropHeight:ue}=M;Me!=="loaded"&&(ve=ge=0,te=ue=1);const be=ie.width*te,se=ie.height*ue,Pe=M.a.width/M.a.height;let xe,Ie;const xt=be/se,tt=M.type==="svg";tt?(xe=be,Ie=se):Pe>=xt?(xe=be,Ie=be/Pe):(xe=se*Pe,Ie=se);const St={x:ie.width*ve,y:ie.height*ge,width:xe,height:Ie},Ht=(K=M.cornerRadius)!==null&&K!==void 0?K:0,le=M.page._exporting?1:Math.min(2,$.scale),he=$._elementsPixelRatio*le;let nt=U(M,D(M,ie,St,he,Ht,V||M._cropModeEnabled||M.type==="svg"),he,[St,Ht,he]);const Ee=Math.max(M.a.width/xe,M.a.height/Ie);a.default.useEffect(()=>{var De;if(!M._cropModeEnabled)return;const Je=(De=X.current)===null||De===void 0?void 0:De.getStage();function Qe(rt){M._cropModeEnabled&&rt.target!==Z.current&&M.toggleCropMode(!1)}function At(rt){M._cropModeEnabled&&rt.target.parentNode!==Je.content&&M.toggleCropMode(!1)}return document.body.addEventListener("click",At),Je==null||Je.on("click",Qe),Je==null||Je.on("tap",Qe),()=>{document.body.removeEventListener("click",At),document.body.removeEventListener("touchstart",At),Je==null||Je.off("click",Qe),Je==null||Je.off("click",Qe)}},[M._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(V||M._cropModeEnabled))return(0,v.applyFilter)(X.current,M),(0,l.autorun)(()=>{(0,v.applyFilter)(X.current,M)},{delay:100})},[ie,V,te,ue,M._cropModeEnabled]),a.default.useLayoutEffect(()=>{var De;V||M._cropModeEnabled?(De=X.current)===null||De===void 0||De.clearCache():(0,v.applyFilter)(X.current,M)},[V,M.a.width,M.a.height,M._cropModeEnabled]),a.default.useEffect(()=>{(0,v.applyFilter)(X.current,M)},[M.shadowEnabled,M.shadowBlur,M.cornerRadius,M.shadowColor,M.shadowOffsetX,M.shadowOffsetY,M.shadowOpacity]);const je=a.default.useRef(null),Le=a.default.useRef(null),we=a.default.useRef(null);a.default.useLayoutEffect(()=>{M._cropModeEnabled&&(Le.current.nodes([je.current]),we.current.nodes([Z.current]))},[M._cropModeEnabled]);var Ze=a.default.useRef(null),Oe=a.default.useRef(0),We=a.default.useRef(!1);const ke=De=>{var Je;((Je=De.evt.touches)===null||Je===void 0?void 0:Je.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(),At=De.target.height()*De.target.scaleY(),rt=Math.min(1,xe/Qe),er=Math.min(1,Ie/At),mt=1-rt,Gt=Math.min(mt,Math.max(0,Math.round(-De.target.x())/Qe)),zr=1-er,vr=Math.min(zr,Math.max(0,Math.round(-De.target.y())/At));De.target.setAttrs({x:-Gt*ie.width,y:-vr*ie.height,scaleX:1,scaleY:1}),M.set({cropX:Gt,cropY:vr,cropWidth:rt,cropHeight:er})},ze=()=>{M.type!=="svg"&&M.contentEditable&&setTimeout(()=>{M.toggleCropMode(!0)})},Xe=M.type==="svg"&&fe,ot=Me==="loading"&&!Xe,Et=Me==="failed",jr=!ot&&!Et,Jt=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Sr=jr?M.a.opacity:0;(0,y.useFadeIn)(X,Sr);const on=M.selectable||$.role==="admin",Ln=(0,h.useMobile)();return a.default.createElement(a.default.Fragment,null,ot&&a.default.createElement(j,{element:M}),Et&&a.default.createElement(G,{element:M}),a.default.createElement(u.Image,{ref:X,name:"element",id:M.id,image:nt,x:M.a.x,y:M.a.y,width:M.a.width||1,height:M.a.height||1,rotation:M.rotation,opacity:Sr,shadowEnabled:M.shadowEnabled,shadowBlur:M.shadowBlur,shadowOffsetX:M.shadowOffsetX,shadowOffsetY:M.shadowOffsetY,shadowColor:M.shadowColor,shadowOpacity:M.shadowOpacity,customCrop:St,listening:on,draggable:Ln?M.draggable&&re:M.draggable,preventDefault:!Ln||re,hideInExport:!M.showInExport,onMouseEnter:()=>{ee(!0)},onMouseLeave:()=>{ee(!1)},onDragMove:De=>{M.set({x:De.target.x(),y:De.target.y()})},onDragEnd:De=>{M.set({x:De.target.x(),y:De.target.y()})},onDblClick:ze,onDblTap:ze,onTransformStart:()=>{H(!0),Jt.current={cropX:M.cropX,cropY:M.cropY,cropWidth:M.cropWidth,cropHeight:M.cropHeight}},onTransform:De=>{var Je;const Qe=De.currentTarget,At=Math.abs(Qe.scaleX()-1)<1e-7?1:Qe.scaleX(),rt=Math.abs(Qe.scaleY()-1)<1e-7?1:Qe.scaleY();Qe.scaleX(1),Qe.scaleY(1);const er=(Je=De.target.getStage())===null||Je===void 0?void 0:Je.findOne("Transformer"),mt=1-xe/ie.width,Gt=Math.min(mt,Math.max(0,M.cropX)),zr=1-Ie/ie.height,vr=Math.min(zr,Math.max(0,M.cropY)),kr=er.getActiveAnchor(),Mn=!(kr.indexOf("middle")>=0||kr.indexOf("center")>=0),gi=!Mn&&At<1&&Jt.current.cropHeight>Ie/ie.height;let vn=Mn?M.cropWidth:M.cropWidth*At;gi&&(vn=M.cropWidth);const ln=!Mn&&rt<1&&Jt.current.cropWidth>xe/ie.width;let Yn=Mn?M.cropHeight:M.cropHeight*rt;ln&&(Yn=M.cropHeight),tt&&(vn=M.cropWidth,Yn=M.cropHeight),M.set({cropX:Gt,cropY:vr,x:Qe.x(),y:Qe.y(),width:Qe.width()*At,height:Qe.height()*rt,rotation:De.target.rotation(),cropWidth:Math.min(vn,1-Gt),cropHeight:Math.min(Yn,1-vr)})},onTransformEnd:De=>{const Je=De.currentTarget;M.set({width:Je.width(),height:Je.height(),x:Je.x(),y:Je.y(),rotation:De.target.rotation(),cropWidth:xe/ie.width,cropHeight:Ie/ie.height}),H(!1)}}),a.default.createElement(u.Rect,{x:M.x,y:M.y,width:Math.max(M.a.width-M.borderSize,0),height:Math.max(M.a.height-M.borderSize,0),opacity:Sr,offsetX:-M.borderSize/2,offsetY:-M.borderSize/2,stroke:M.borderColor,strokeWidth:M.borderSize,listening:!1,visible:!!M.borderSize,rotation:M.rotation,cornerRadius:Math.max(0,Ht-M.borderSize),hideInExport:!M.showInExport}),M._cropModeEnabled&&a.default.createElement(S.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/$.scale,y:-window.innerWidth/$.scale,width:window.innerWidth/$.scale*3,height:window.innerWidth/$.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:nt,x:M.x,y:M.y,width:M.a.width,height:M.a.height,rotation:M.rotation,shadowEnabled:M.shadowEnabled,shadowBlur:M.shadowBlur}),a.default.createElement(u.Group,{x:M.x,y:M.y,rotation:M.rotation,scaleX:Ee,scaleY:Ee},a.default.createElement(u.Image,{image:ie,ref:Z,opacity:.4,draggable:!0,x:-M.cropX*ie.width,y:-M.cropY*ie.height,onDragMove:ke,onTransform:ke,onTouchMove:De=>{De.evt.preventDefault();const Je=De.target.getStage().getPointersPositions();var Qe=Je[0],At=Je[1];const rt=De.target;if(Qe&&!At&&!rt.isDragging()&&We.current&&(rt.startDrag(),We.current=!1),Qe&&At){p.default.hitOnDragEnabled=!0,rt.isDragging()&&(We.current=!0,rt.stopDrag());const ln=De.target.getAbsoluteTransform().copy();ln.invert();var er={x:Qe.x,y:Qe.y},mt={x:At.x,y:At.y};if(!Ze.current)return void(Ze.current=P(er,mt));var Gt=P(er,mt),zr=x(er,mt);Oe.current||(Oe.current=zr);const Yn=rt.position();var vr={x:Gt.x-Yn.x,y:Gt.y-Yn.y},kr=zr/Oe.current;rt.scaleX(kr),rt.scaleY(kr);const Va=ln.point(Gt),vi=ln.point(Ze.current);var Mn=Va.x-vi.x,gi=Va.y-vi.y,vn={x:Math.min(0,Gt.x-vr.x*kr+Mn),y:Math.min(0,Gt.y-vr.y*kr+gi)};rt.position(vn),Oe.current=zr,Ze.current=Gt,ke(De)}},onTouchEnd:De=>{Oe.current=0,Ze.current=null,p.default.hitOnDragEnabled=!1}}),a.default.createElement(u.Transformer,{ref:we,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(De,Je)=>Je.width<5||Je.height<5?De:Je,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:xe,height:Ie,ref:je,listening:!1,onTransform:De=>{De.target.x()<-M.cropX*ie.width-1e-9&&(De.target.x(-M.cropX*ie.width),De.target.scaleX(1)),De.target.y()<-M.cropY*ie.height-1e-9&&(De.target.y(-M.cropY*ie.height),De.target.scaleY(1));const Je=Math.min(1,Math.max(0,M.cropX+De.target.x()/ie.width)),Qe=Math.min(1,Math.max(0,De.target.y()/ie.height+M.cropY)),At=De.target.width()*De.target.scaleX(),rt=De.target.height()*De.target.scaleY(),er=Math.min(1-Je,At/ie.width),mt=Math.min(1-Qe,rt/ie.height),Gt=De.target.getAbsolutePosition(De.target.getParent().getParent());De.target.scale({x:1,y:1}),De.target.position({x:0,y:0}),M.set({x:Gt.x,y:Gt.y,cropX:Je,cropY:Qe,cropWidth:er,cropHeight:mt,width:Math.min(At*Ee,ie.width*(1-Je)*Ee),height:Math.min(rt*Ee,ie.height*(1-Qe)*Ee)})}}),a.default.createElement(u.Transformer,{ref:Le,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(De,Je)=>Je.width<5||Je.height<5?De:Je,visible:M.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(J||re)&&a.default.createElement(w.Highlighter,{element:M}))})})(x2);var dS={},hS={exports:{}};/*!
115
+ * Quill Editor v1.3.7
116
+ * https://quilljs.com/
117
+ * Copyright (c) 2014, Jason Chen
118
+ * Copyright (c) 2013, salesforce.com
119
+ */(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:Se,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),p=i(47),S=i(48),w=i(49),g=i(12),E=i(32),m=i(33),v=i(31),y=i(1),h={Scope:y.Scope,create:y.create,find:y.find,query:y.query,register:y.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:S.default,Scroll:u.default,Block:p.default,Inline:f.default,Text:w.default,Attributor:{Attribute:g.default,Class:E.default,Style:m.default,Store:v.default}};n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,h){y.__proto__=h}||function(y,h){for(var d in h)h.hasOwnProperty(d)&&(y[d]=h[d])};return function(y,h){v(y,h);function d(){this.constructor=y}y.prototype=h===null?Object.create(h):(d.prototype=h.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(v){a(y,v);function y(h){var d=this;return h="[Parchment] "+h,d=v.call(this,h)||this,d.message=h,d.name=d.constructor.name,d}return y}(Error);n.ParchmentError=o;var l={},u={},f={},p={};n.DATA_KEY="__blot";var S;(function(v){v[v.TYPE=3]="TYPE",v[v.LEVEL=12]="LEVEL",v[v.ATTRIBUTE=13]="ATTRIBUTE",v[v.BLOT=14]="BLOT",v[v.INLINE=7]="INLINE",v[v.BLOCK=11]="BLOCK",v[v.BLOCK_BLOT=10]="BLOCK_BLOT",v[v.INLINE_BLOT=6]="INLINE_BLOT",v[v.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",v[v.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",v[v.ANY=15]="ANY"})(S=n.Scope||(n.Scope={}));function w(v,y){var h=E(v);if(h==null)throw new o("Unable to create "+v+" blot");var d=h,b=v instanceof Node||v.nodeType===Node.TEXT_NODE?v:d.create(y);return new d(b,y)}n.create=w;function g(v,y){return y===void 0&&(y=!1),v==null?null:v[n.DATA_KEY]!=null?v[n.DATA_KEY].blot:y?g(v.parentNode,y):null}n.find=g;function E(v,y){y===void 0&&(y=S.ANY);var h;if(typeof v=="string")h=p[v]||l[v];else if(v instanceof Text||v.nodeType===Node.TEXT_NODE)h=p.text;else if(typeof v=="number")v&S.LEVEL&S.BLOCK?h=p.block:v&S.LEVEL&S.INLINE&&(h=p.inline);else if(v instanceof HTMLElement){var d=(v.getAttribute("class")||"").split(/\s+/);for(var b in d)if(h=u[d[b]],h)break;h=h||f[v.tagName]}return h==null?null:y&S.LEVEL&h.scope&&y&S.TYPE&h.scope?h:null}n.query=E;function m(){for(var v=[],y=0;y<arguments.length;y++)v[y]=arguments[y];if(v.length>1)return v.map(function(b){return m(b)});var h=v[0];if(typeof h.blotName!="string"&&typeof h.attrName!="string")throw new o("Invalid definition");if(h.blotName==="abstract")throw new o("Cannot register abstract class");if(p[h.blotName||h.attrName]=h,typeof h.keyName=="string")l[h.keyName]=h;else if(h.className!=null&&(u[h.className]=h),h.tagName!=null){Array.isArray(h.tagName)?h.tagName=h.tagName.map(function(b){return b.toUpperCase()}):h.tagName=h.tagName.toUpperCase();var d=Array.isArray(h.tagName)?h.tagName:[h.tagName];d.forEach(function(b){(f[b]==null||h.className==null)&&(f[b]=h)})}return h}n.register=m},function(r,n,i){var a=i(51),o=i(11),l=i(3),u=i(20),f="\0",p=function(S){Array.isArray(S)?this.ops=S:S!=null&&Array.isArray(S.ops)?this.ops=S.ops:this.ops=[]};p.prototype.insert=function(S,w){var g={};return S.length===0?this:(g.insert=S,w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(g.attributes=w),this.push(g))},p.prototype.delete=function(S){return S<=0?this:this.push({delete:S})},p.prototype.retain=function(S,w){if(S<=0)return this;var g={retain:S};return w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(g.attributes=w),this.push(g)},p.prototype.push=function(S){var w=this.ops.length,g=this.ops[w-1];if(S=l(!0,{},S),typeof g=="object"){if(typeof S.delete=="number"&&typeof g.delete=="number")return this.ops[w-1]={delete:g.delete+S.delete},this;if(typeof g.delete=="number"&&S.insert!=null&&(w-=1,g=this.ops[w-1],typeof g!="object"))return this.ops.unshift(S),this;if(o(S.attributes,g.attributes)){if(typeof S.insert=="string"&&typeof g.insert=="string")return this.ops[w-1]={insert:g.insert+S.insert},typeof S.attributes=="object"&&(this.ops[w-1].attributes=S.attributes),this;if(typeof S.retain=="number"&&typeof g.retain=="number")return this.ops[w-1]={retain:g.retain+S.retain},typeof S.attributes=="object"&&(this.ops[w-1].attributes=S.attributes),this}}return w===this.ops.length?this.ops.push(S):this.ops.splice(w,0,S),this},p.prototype.chop=function(){var S=this.ops[this.ops.length-1];return S&&S.retain&&!S.attributes&&this.ops.pop(),this},p.prototype.filter=function(S){return this.ops.filter(S)},p.prototype.forEach=function(S){this.ops.forEach(S)},p.prototype.map=function(S){return this.ops.map(S)},p.prototype.partition=function(S){var w=[],g=[];return this.forEach(function(E){var m=S(E)?w:g;m.push(E)}),[w,g]},p.prototype.reduce=function(S,w){return this.ops.reduce(S,w)},p.prototype.changeLength=function(){return this.reduce(function(S,w){return w.insert?S+u.length(w):w.delete?S-w.delete:S},0)},p.prototype.length=function(){return this.reduce(function(S,w){return S+u.length(w)},0)},p.prototype.slice=function(S,w){S=S||0,typeof w!="number"&&(w=1/0);for(var g=[],E=u.iterator(this.ops),m=0;m<w&&E.hasNext();){var v;m<S?v=E.next(S-m):(v=E.next(w-m),g.push(v)),m+=u.length(v)}return new p(g)},p.prototype.compose=function(S){var w=u.iterator(this.ops),g=u.iterator(S.ops),E=[],m=g.peek();if(m!=null&&typeof m.retain=="number"&&m.attributes==null){for(var v=m.retain;w.peekType()==="insert"&&w.peekLength()<=v;)v-=w.peekLength(),E.push(w.next());m.retain-v>0&&g.next(m.retain-v)}for(var y=new p(E);w.hasNext()||g.hasNext();)if(g.peekType()==="insert")y.push(g.next());else if(w.peekType()==="delete")y.push(w.next());else{var h=Math.min(w.peekLength(),g.peekLength()),d=w.next(h),b=g.next(h);if(typeof b.retain=="number"){var O={};typeof d.retain=="number"?O.retain=h:O.insert=d.insert;var x=u.attributes.compose(d.attributes,b.attributes,typeof d.retain=="number");if(x&&(O.attributes=x),y.push(O),!g.hasNext()&&o(y.ops[y.ops.length-1],O)){var P=new p(w.rest());return y.concat(P).chop()}}else typeof b.delete=="number"&&typeof d.retain=="number"&&y.push(b)}return y.chop()},p.prototype.concat=function(S){var w=new p(this.ops.slice());return S.ops.length>0&&(w.push(S.ops[0]),w.ops=w.ops.concat(S.ops.slice(1))),w},p.prototype.diff=function(S,w){if(this.ops===S.ops)return new p;var g=[this,S].map(function(h){return h.map(function(d){if(d.insert!=null)return typeof d.insert=="string"?d.insert:f;var b=h===S?"on":"with";throw new Error("diff() called "+b+" non-document")}).join("")}),E=new p,m=a(g[0],g[1],w),v=u.iterator(this.ops),y=u.iterator(S.ops);return m.forEach(function(h){for(var d=h[1].length;d>0;){var b=0;switch(h[0]){case a.INSERT:b=Math.min(y.peekLength(),d),E.push(y.next(b));break;case a.DELETE:b=Math.min(d,v.peekLength()),v.next(b),E.delete(b);break;case a.EQUAL:b=Math.min(v.peekLength(),y.peekLength(),d);var O=v.next(b),x=y.next(b);o(O.insert,x.insert)?E.retain(b,u.attributes.diff(O.attributes,x.attributes)):E.push(x).delete(b);break}d-=b}}),E.chop()},p.prototype.eachLine=function(S,w){w=w||`
120
+ `;for(var g=u.iterator(this.ops),E=new p,m=0;g.hasNext();){if(g.peekType()!=="insert")return;var v=g.peek(),y=u.length(v)-g.peekLength(),h=typeof v.insert=="string"?v.insert.indexOf(w,y)-y:-1;if(h<0)E.push(g.next());else if(h>0)E.push(g.next(h));else{if(S(E,g.next(1).attributes||{},m)===!1)return;m+=1,E=new p}}E.length()>0&&S(E,{},m)},p.prototype.transform=function(S,w){if(w=!!w,typeof S=="number")return this.transformPosition(S,w);for(var g=u.iterator(this.ops),E=u.iterator(S.ops),m=new p;g.hasNext()||E.hasNext();)if(g.peekType()==="insert"&&(w||E.peekType()!=="insert"))m.retain(u.length(g.next()));else if(E.peekType()==="insert")m.push(E.next());else{var v=Math.min(g.peekLength(),E.peekLength()),y=g.next(v),h=E.next(v);if(y.delete)continue;h.delete?m.push(h):m.retain(v,u.attributes.transform(y.attributes,h.attributes,w))}return m.chop()},p.prototype.transformPosition=function(S,w){w=!!w;for(var g=u.iterator(this.ops),E=0;g.hasNext()&&E<=S;){var m=g.peekLength(),v=g.peekType();if(g.next(),v==="delete"){S-=Math.min(m,S-E);continue}else v==="insert"&&(E<S||!w)&&(S+=m);E+=m}return S},r.exports=p},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(g){return typeof Array.isArray=="function"?Array.isArray(g):a.call(g)==="[object Array]"},f=function(g){if(!g||a.call(g)!=="[object Object]")return!1;var E=i.call(g,"constructor"),m=g.constructor&&g.constructor.prototype&&i.call(g.constructor.prototype,"isPrototypeOf");if(g.constructor&&!E&&!m)return!1;var v;for(v in g);return typeof v>"u"||i.call(g,v)},p=function(g,E){o&&E.name==="__proto__"?o(g,E.name,{enumerable:!0,configurable:!0,value:E.newValue,writable:!0}):g[E.name]=E.newValue},S=function(g,E){if(E==="__proto__")if(i.call(g,E)){if(l)return l(g,E).value}else return;return g[E]};r.exports=function w(){var g,E,m,v,y,h,d=arguments[0],b=1,O=arguments.length,x=!1;for(typeof d=="boolean"&&(x=d,d=arguments[1]||{},b=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});b<O;++b)if(g=arguments[b],g!=null)for(E in g)m=S(d,E),v=S(g,E),d!==v&&(x&&v&&(f(v)||(y=u(v)))?(y?(y=!1,h=m&&u(m)?m:[]):h=m&&f(m)?m:{},p(d,{name:E,newValue:w(x,h,v)})):typeof v<"u"&&p(d,{name:E,newValue:v}));return d}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=function(){function k(R,D){for(var U=0;U<D.length;U++){var Y=D[U];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(R,Y.key,Y)}}return function(R,D,U){return D&&k(R.prototype,D),U&&k(R,U),R}}(),o=function k(R,D,U){R===null&&(R=Function.prototype);var Y=Object.getOwnPropertyDescriptor(R,D);if(Y===void 0){var j=Object.getPrototypeOf(R);return j===null?void 0:k(j,D,U)}else{if("value"in Y)return Y.value;var G=Y.get;return G===void 0?void 0:G.call(U)}},l=i(3),u=d(l),f=i(2),p=d(f),S=i(0),w=d(S),g=i(16),E=d(g),m=i(6),v=d(m),y=i(7),h=d(y);function d(k){return k&&k.__esModule?k:{default:k}}function b(k,R){if(!(k instanceof R))throw new TypeError("Cannot call a class as a function")}function O(k,R){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:k}function x(k,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);k.prototype=Object.create(R&&R.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(k,R):k.__proto__=R)}var P=1,_=function(k){x(R,k);function R(){return b(this,R),O(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return a(R,[{key:"attach",value:function(){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"attach",this).call(this),this.attributes=new w.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new p.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(U,Y){var j=w.default.query(U,w.default.Scope.BLOCK_ATTRIBUTE);j!=null&&this.attributes.attribute(j,Y)}},{key:"formatAt",value:function(U,Y,j,G){this.format(j,G)}},{key:"insertAt",value:function(U,Y,j){if(typeof Y=="string"&&Y.endsWith(`
121
+ `)){var G=w.default.create(A.blotName);this.parent.insertBefore(G,U===0?this:this.next),G.insertAt(0,Y.slice(0,-1))}else o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,U,Y,j)}}]),R}(w.default.Embed);_.scope=w.default.Scope.BLOCK_BLOT;var A=function(k){x(R,k);function R(D){b(this,R);var U=O(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,D));return U.cache={},U}return a(R,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(w.default.Leaf).reduce(function(U,Y){return Y.length()===0?U:U.insert(Y.value(),C(Y))},new p.default).insert(`
122
+ `,C(this))),this.cache.delta}},{key:"deleteAt",value:function(U,Y){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"deleteAt",this).call(this,U,Y),this.cache={}}},{key:"formatAt",value:function(U,Y,j,G){Y<=0||(w.default.query(j,w.default.Scope.BLOCK)?U+Y===this.length()&&this.format(j,G):o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"formatAt",this).call(this,U,Math.min(Y,this.length()-U-1),j,G),this.cache={})}},{key:"insertAt",value:function(U,Y,j){if(j!=null)return o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,U,Y,j);if(Y.length!==0){var G=Y.split(`
123
+ `),z=G.shift();z.length>0&&(U<this.length()-1||this.children.tail==null?o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,Math.min(U,this.length()-1),z):this.children.tail.insertAt(this.children.tail.length(),z),this.cache={});var q=this;G.reduce(function(L,I){return q=q.split(L,!0),q.insertAt(0,I),I.length},U+z.length)}}},{key:"insertBefore",value:function(U,Y){var j=this.children.head;o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertBefore",this).call(this,U,Y),j instanceof E.default&&j.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"length",this).call(this)+P),this.cache.length}},{key:"moveChildren",value:function(U,Y){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"moveChildren",this).call(this,U,Y),this.cache={}}},{key:"optimize",value:function(U){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"optimize",this).call(this,U),this.cache={}}},{key:"path",value:function(U){return o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"path",this).call(this,U,!0)}},{key:"removeChild",value:function(U){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"removeChild",this).call(this,U),this.cache={}}},{key:"split",value:function(U){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Y&&(U===0||U>=this.length()-P)){var j=this.clone();return U===0?(this.parent.insertBefore(j,this),this):(this.parent.insertBefore(j,this.next),j)}else{var G=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"split",this).call(this,U,Y);return this.cache={},G}}}]),R}(w.default.Block);A.blotName="block",A.tagName="P",A.defaultChild="break",A.allowedChildren=[v.default,w.default.Embed,h.default];function C(k){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return k==null||(typeof k.formats=="function"&&(R=(0,u.default)(R,k.formats())),k.parent==null||k.parent.blotName=="scroll"||k.parent.statics.scope!==k.statics.scope)?R:C(k.parent,R)}n.bubbleFormats=C,n.BlockEmbed=_,n.default=A},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(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},o=function(){function q(L,I){var B=[],M=!0,$=!1,K=void 0;try{for(var V=L[Symbol.iterator](),H;!(M=(H=V.next()).done)&&(B.push(H.value),!(I&&B.length===I));M=!0);}catch(X){$=!0,K=X}finally{try{!M&&V.return&&V.return()}finally{if($)throw K}}return B}return function(L,I){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return q(L,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function q(L,I){for(var B=0;B<I.length;B++){var M=I[B];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(L,M.key,M)}}return function(L,I,B){return I&&q(L.prototype,I),B&&q(L,B),L}}();i(50);var u=i(2),f=C(u),p=i(14),S=C(p),w=i(8),g=C(w),E=i(9),m=C(E),v=i(0),y=C(v),h=i(15),d=C(h),b=i(3),O=C(b),x=i(10),P=C(x),_=i(34),A=C(_);function C(q){return q&&q.__esModule?q:{default:q}}function k(q,L,I){return L in q?Object.defineProperty(q,L,{value:I,enumerable:!0,configurable:!0,writable:!0}):q[L]=I,q}function R(q,L){if(!(q instanceof L))throw new TypeError("Cannot call a class as a function")}var D=(0,P.default)("quill"),U=function(){l(q,null,[{key:"debug",value:function(I){I===!0&&(I="log"),P.default.level(I)}},{key:"find",value:function(I){return I.__quill||y.default.find(I)}},{key:"import",value:function(I){return this.imports[I]==null&&D.error("Cannot import "+I+". Are you sure it was registered?"),this.imports[I]}},{key:"register",value:function(I,B){var M=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof I!="string"){var K=I.attrName||I.blotName;typeof K=="string"?this.register("formats/"+K,I,B):Object.keys(I).forEach(function(V){M.register(V,I[V],B)})}else this.imports[I]!=null&&!$&&D.warn("Overwriting "+I+" with",B),this.imports[I]=B,(I.startsWith("blots/")||I.startsWith("formats/"))&&B.blotName!=="abstract"?y.default.register(B):I.startsWith("modules")&&typeof B.register=="function"&&B.register()}}]);function q(L){var I=this,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(R(this,q),this.options=Y(L,B),this.container=this.options.container,this.container==null)return D.error("Invalid Quill container",L);this.options.debug&&q.debug(this.options.debug);var M=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 g.default,this.scroll=y.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new S.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(g.default.events.EDITOR_CHANGE,function(K){K===g.default.events.TEXT_CHANGE&&I.root.classList.toggle("ql-blank",I.editor.isBlank())}),this.emitter.on(g.default.events.SCROLL_UPDATE,function(K,V){var H=I.selection.lastRange,X=H&&H.length===0?H.index:void 0;j.call(I,function(){return I.editor.update(null,V,X)},K)});var $=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+M+"<p><br></p></div>");this.setContents($),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(q,[{key:"addContainer",value:function(I){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof I=="string"){var M=I;I=document.createElement("div"),I.classList.add(M)}return this.container.insertBefore(I,B),I}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(I,B,M){var $=this,K=G(I,B,M),V=o(K,4);return I=V[0],B=V[1],M=V[3],j.call(this,function(){return $.editor.deleteText(I,B)},M,I,-1*B)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(I),this.container.classList.toggle("ql-disabled",!I)}},{key:"focus",value:function(){var I=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=I,this.scrollIntoView()}},{key:"format",value:function(I,B){var M=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.default.sources.API;return j.call(this,function(){var K=M.getSelection(!0),V=new f.default;if(K==null)return V;if(y.default.query(I,y.default.Scope.BLOCK))V=M.editor.formatLine(K.index,K.length,k({},I,B));else{if(K.length===0)return M.selection.format(I,B),V;V=M.editor.formatText(K.index,K.length,k({},I,B))}return M.setSelection(K,g.default.sources.SILENT),V},$)}},{key:"formatLine",value:function(I,B,M,$,K){var V=this,H=void 0,X=G(I,B,M,$,K),Z=o(X,4);return I=Z[0],B=Z[1],H=Z[2],K=Z[3],j.call(this,function(){return V.editor.formatLine(I,B,H)},K,I,0)}},{key:"formatText",value:function(I,B,M,$,K){var V=this,H=void 0,X=G(I,B,M,$,K),Z=o(X,4);return I=Z[0],B=Z[1],H=Z[2],K=Z[3],j.call(this,function(){return V.editor.formatText(I,B,H)},K,I,0)}},{key:"getBounds",value:function(I){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,M=void 0;typeof I=="number"?M=this.selection.getBounds(I,B):M=this.selection.getBounds(I.index,I.length);var $=this.container.getBoundingClientRect();return{bottom:M.bottom-$.top,height:M.height,left:M.left-$.left,right:M.right-$.left,top:M.top-$.top,width:M.width}}},{key:"getContents",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-I,M=G(I,B),$=o(M,2);return I=$[0],B=$[1],this.editor.getContents(I,B)}},{key:"getFormat",value:function(){var I=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 I=="number"?this.editor.getFormat(I,B):this.editor.getFormat(I.index,I.length)}},{key:"getIndex",value:function(I){return I.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(I){return this.scroll.leaf(I)}},{key:"getLine",value:function(I){return this.scroll.line(I)}},{key:"getLines",value:function(){var I=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 I!="number"?this.scroll.lines(I.index,I.length):this.scroll.lines(I,B)}},{key:"getModule",value:function(I){return this.theme.modules[I]}},{key:"getSelection",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return I&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-I,M=G(I,B),$=o(M,2);return I=$[0],B=$[1],this.editor.getText(I,B)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(I,B,M){var $=this,K=arguments.length>3&&arguments[3]!==void 0?arguments[3]:q.sources.API;return j.call(this,function(){return $.editor.insertEmbed(I,B,M)},K,I)}},{key:"insertText",value:function(I,B,M,$,K){var V=this,H=void 0,X=G(I,0,M,$,K),Z=o(X,4);return I=Z[0],H=Z[2],K=Z[3],j.call(this,function(){return V.editor.insertText(I,B,H)},K,I,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(I,B,M){this.clipboard.dangerouslyPasteHTML(I,B,M)}},{key:"removeFormat",value:function(I,B,M){var $=this,K=G(I,B,M),V=o(K,4);return I=V[0],B=V[1],M=V[3],j.call(this,function(){return $.editor.removeFormat(I,B)},M,I)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(I){var B=this,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g.default.sources.API;return j.call(this,function(){I=new f.default(I);var $=B.getLength(),K=B.editor.deleteText(0,$),V=B.editor.applyDelta(I),H=V.ops[V.ops.length-1];H!=null&&typeof H.insert=="string"&&H.insert[H.insert.length-1]===`
124
+ `&&(B.editor.deleteText(B.getLength()-1,1),V.delete(1));var X=K.compose(V);return X},M)}},{key:"setSelection",value:function(I,B,M){if(I==null)this.selection.setRange(null,B||q.sources.API);else{var $=G(I,B,M),K=o($,4);I=K[0],B=K[1],M=K[3],this.selection.setRange(new h.Range(I,B),M),M!==g.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(I){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g.default.sources.API,M=new f.default().insert(I);return this.setContents(M,B)}},{key:"update",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g.default.sources.USER,B=this.scroll.update(I);return this.selection.update(I),B}},{key:"updateContents",value:function(I){var B=this,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g.default.sources.API;return j.call(this,function(){return I=new f.default(I),B.editor.applyDelta(I,M)},M,!0)}}]),q}();U.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},U.events=g.default.events,U.sources=g.default.sources,U.version="1.3.7",U.imports={delta:f.default,parchment:y.default,"core/module":m.default,"core/theme":A.default};function Y(q,L){if(L=(0,O.default)(!0,{container:q,modules:{clipboard:!0,keyboard:!0,history:!0}},L),!L.theme||L.theme===U.DEFAULTS.theme)L.theme=A.default;else if(L.theme=U.import("themes/"+L.theme),L.theme==null)throw new Error("Invalid theme "+L.theme+". Did you register it?");var I=(0,O.default)(!0,{},L.theme.DEFAULTS);[I,L].forEach(function($){$.modules=$.modules||{},Object.keys($.modules).forEach(function(K){$.modules[K]===!0&&($.modules[K]={})})});var B=Object.keys(I.modules).concat(Object.keys(L.modules)),M=B.reduce(function($,K){var V=U.import("modules/"+K);return V==null?D.error("Cannot load "+K+" module. Are you sure you registered it?"):$[K]=V.DEFAULTS||{},$},{});return L.modules!=null&&L.modules.toolbar&&L.modules.toolbar.constructor!==Object&&(L.modules.toolbar={container:L.modules.toolbar}),L=(0,O.default)(!0,{},U.DEFAULTS,{modules:M},I,L),["bounds","container","scrollingContainer"].forEach(function($){typeof L[$]=="string"&&(L[$]=document.querySelector(L[$]))}),L.modules=Object.keys(L.modules).reduce(function($,K){return L.modules[K]&&($[K]=L.modules[K]),$},{}),L}function j(q,L,I,B){if(this.options.strict&&!this.isEnabled()&&L===g.default.sources.USER)return new f.default;var M=I==null?null:this.getSelection(),$=this.editor.delta,K=q();if(M!=null&&(I===!0&&(I=M.index),B==null?M=z(M,K,L):B!==0&&(M=z(M,I,B,L)),this.setSelection(M,g.default.sources.SILENT)),K.length()>0){var V,H=[g.default.events.TEXT_CHANGE,K,$,L];if((V=this.emitter).emit.apply(V,[g.default.events.EDITOR_CHANGE].concat(H)),L!==g.default.sources.SILENT){var X;(X=this.emitter).emit.apply(X,H)}}return K}function G(q,L,I,B,M){var $={};return typeof q.index=="number"&&typeof q.length=="number"?typeof L!="number"?(M=B,B=I,I=L,L=q.length,q=q.index):(L=q.length,q=q.index):typeof L!="number"&&(M=B,B=I,I=L,L=0),(typeof I>"u"?"undefined":a(I))==="object"?($=I,M=B):typeof I=="string"&&(B!=null?$[I]=B:M=I),M=M||g.default.sources.API,[q,L,$,M]}function z(q,L,I,B){if(q==null)return null;var M=void 0,$=void 0;if(L instanceof f.default){var K=[q.index,q.index+q.length].map(function(Z){return L.transformPosition(Z,B!==g.default.sources.USER)}),V=o(K,2);M=V[0],$=V[1]}else{var H=[q.index,q.index+q.length].map(function(Z){return Z<L||Z===L&&B===g.default.sources.USER?Z:I>=0?Z+I:Math.max(L,Z+I)}),X=o(H,2);M=X[0],$=X[1]}return new h.Range(M,$-M)}n.expandConfig=Y,n.overload=G,n.default=U},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(y,h){for(var d=0;d<h.length;d++){var b=h[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,h,d){return h&&v(y.prototype,h),d&&v(y,d),y}}(),o=function v(y,h,d){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,h);if(b===void 0){var O=Object.getPrototypeOf(y);return O===null?void 0:v(O,h,d)}else{if("value"in b)return b.value;var x=b.get;return x===void 0?void 0:x.call(d)}},l=i(7),u=S(l),f=i(0),p=S(f);function S(v){return v&&v.__esModule?v:{default:v}}function w(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function g(v,y){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:v}function E(v,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);v.prototype=Object.create(y&&y.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(v,y):v.__proto__=y)}var m=function(v){E(y,v);function y(){return w(this,y),g(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"formatAt",value:function(d,b,O,x){if(y.compare(this.statics.blotName,O)<0&&p.default.query(O,p.default.Scope.BLOT)){var P=this.isolate(d,b);x&&P.wrap(O,x)}else o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"formatAt",this).call(this,d,b,O,x)}},{key:"optimize",value:function(d){if(o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"optimize",this).call(this,d),this.parent instanceof y&&y.compare(this.statics.blotName,this.parent.statics.blotName)>0){var b=this.parent.isolate(this.offset(),this.length());this.moveChildren(b),b.wrap(this)}}}],[{key:"compare",value:function(d,b){var O=y.order.indexOf(d),x=y.order.indexOf(b);return O>=0||x>=0?O-x:d===b?0:d<b?-1:1}}]),y}(p.default.Inline);m.allowedChildren=[m,p.default.Embed,u.default],m.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,g){if(!(w instanceof g))throw new TypeError("Cannot call a class as a function")}function f(w,g){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:w}function p(w,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);w.prototype=Object.create(g&&g.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(w,g):w.__proto__=g)}var S=function(w){p(g,w);function g(){return u(this,g),f(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return g}(o.default.Text);n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function h(d,b){for(var O=0;O<b.length;O++){var x=b[O];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(d,x.key,x)}}return function(d,b,O){return b&&h(d.prototype,b),O&&h(d,O),d}}(),o=function h(d,b,O){d===null&&(d=Function.prototype);var x=Object.getOwnPropertyDescriptor(d,b);if(x===void 0){var P=Object.getPrototypeOf(d);return P===null?void 0:h(P,b,O)}else{if("value"in x)return x.value;var _=x.get;return _===void 0?void 0:_.call(O)}},l=i(54),u=S(l),f=i(10),p=S(f);function S(h){return h&&h.__esModule?h:{default:h}}function w(h,d){if(!(h instanceof d))throw new TypeError("Cannot call a class as a function")}function g(h,d){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:h}function E(h,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);h.prototype=Object.create(d&&d.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(h,d):h.__proto__=d)}var m=(0,p.default)("quill:events"),v=["selectionchange","mousedown","mouseup","click"];v.forEach(function(h){document.addEventListener(h,function(){for(var d=arguments.length,b=Array(d),O=0;O<d;O++)b[O]=arguments[O];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(x){if(x.__quill&&x.__quill.emitter){var P;(P=x.__quill.emitter).handleDOM.apply(P,b)}})})});var y=function(h){E(d,h);function d(){w(this,d);var b=g(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return b.listeners={},b.on("error",m.error),b}return a(d,[{key:"emit",value:function(){m.log.apply(m,arguments),o(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(O){for(var x=arguments.length,P=Array(x>1?x-1:0),_=1;_<x;_++)P[_-1]=arguments[_];(this.listeners[O.type]||[]).forEach(function(A){var C=A.node,k=A.handler;(O.target===C||C.contains(O.target))&&k.apply(void 0,[O].concat(P))})}},{key:"listenDOM",value:function(O,x,P){this.listeners[O]||(this.listeners[O]=[]),this.listeners[O].push({node:x,handler:P})}}]),d}(u.default);y.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"},y.sources={API:"api",SILENT:"silent",USER:"user"},n.default=y},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 p,S=arguments.length,w=Array(S>1?S-1:0),g=1;g<S;g++)w[g-1]=arguments[g];(p=console)[f].apply(p,w)}}function u(f){return a.reduce(function(p,S){return p[S]=l.bind(console,S,f),p},{})}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(w,g,E){return E||(E={}),w===g?!0:w instanceof Date&&g instanceof Date?w.getTime()===g.getTime():!w||!g||typeof w!="object"&&typeof g!="object"?E.strict?w===g:w==g:S(w,g,E)};function f(w){return w==null}function p(w){return!(!w||typeof w!="object"||typeof w.length!="number"||typeof w.copy!="function"||typeof w.slice!="function"||w.length>0&&typeof w[0]!="number")}function S(w,g,E){var m,v;if(f(w)||f(g)||w.prototype!==g.prototype)return!1;if(l(w))return l(g)?(w=a.call(w),g=a.call(g),u(w,g,E)):!1;if(p(w)){if(!p(g)||w.length!==g.length)return!1;for(m=0;m<w.length;m++)if(w[m]!==g[m])return!1;return!0}try{var y=o(w),h=o(g)}catch{return!1}if(y.length!=h.length)return!1;for(y.sort(),h.sort(),m=y.length-1;m>=0;m--)if(y[m]!=h[m])return!1;for(m=y.length-1;m>=0;m--)if(v=y[m],!u(w[v],g[v],E))return!1;return typeof w==typeof g}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u,f,p){p===void 0&&(p={}),this.attrName=u,this.keyName=f;var S=a.Scope.TYPE&a.Scope.ATTRIBUTE;p.scope!=null?this.scope=p.scope&a.Scope.LEVEL|S:this.scope=a.Scope.ATTRIBUTE,p.whitelist!=null&&(this.whitelist=p.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 p=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return p==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 _(A,C){var k=[],R=!0,D=!1,U=void 0;try{for(var Y=A[Symbol.iterator](),j;!(R=(j=Y.next()).done)&&(k.push(j.value),!(C&&k.length===C));R=!0);}catch(G){D=!0,U=G}finally{try{!R&&Y.return&&Y.return()}finally{if(D)throw U}}return k}return function(A,C){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return _(A,C);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function _(A,C){for(var k=0;k<C.length;k++){var R=C[k];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(A,R.key,R)}}return function(A,C,k){return C&&_(A.prototype,C),k&&_(A,k),A}}(),l=function _(A,C,k){A===null&&(A=Function.prototype);var R=Object.getOwnPropertyDescriptor(A,C);if(R===void 0){var D=Object.getPrototypeOf(A);return D===null?void 0:_(D,C,k)}else{if("value"in R)return R.value;var U=R.get;return U===void 0?void 0:U.call(k)}},u=i(2),f=h(u),p=i(0),S=h(p),w=i(4),g=h(w),E=i(6),m=h(E),v=i(7),y=h(v);function h(_){return _&&_.__esModule?_:{default:_}}function d(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")}function b(_,A){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:_}function O(_,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);_.prototype=Object.create(A&&A.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(_,A):_.__proto__=A)}var x=function(_){O(A,_);function A(){return d(this,A),b(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return A}(m.default);x.blotName="code",x.tagName="CODE";var P=function(_){O(A,_);function A(){return d(this,A),b(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return o(A,[{key:"delta",value:function(){var k=this,R=this.domNode.textContent;return R.endsWith(`
125
+ `)&&(R=R.slice(0,-1)),R.split(`
126
+ `).reduce(function(D,U){return D.insert(U).insert(`
127
+ `,k.formats())},new f.default)}},{key:"format",value:function(k,R){if(!(k===this.statics.blotName&&R)){var D=this.descendant(y.default,this.length()-1),U=a(D,1),Y=U[0];Y!=null&&Y.deleteAt(Y.length()-1,1),l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"format",this).call(this,k,R)}}},{key:"formatAt",value:function(k,R,D,U){if(R!==0&&!(S.default.query(D,S.default.Scope.BLOCK)==null||D===this.statics.blotName&&U===this.statics.formats(this.domNode))){var Y=this.newlineIndex(k);if(!(Y<0||Y>=k+R)){var j=this.newlineIndex(k,!0)+1,G=Y-j+1,z=this.isolate(j,G),q=z.next;z.format(D,U),q instanceof A&&q.formatAt(0,k-j+R-G,D,U)}}}},{key:"insertAt",value:function(k,R,D){if(D==null){var U=this.descendant(y.default,k),Y=a(U,2),j=Y[0],G=Y[1];j.insertAt(G,R)}}},{key:"length",value:function(){var k=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
128
+ `)?k:k+1}},{key:"newlineIndex",value:function(k){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(R)return this.domNode.textContent.slice(0,k).lastIndexOf(`
129
+ `);var D=this.domNode.textContent.slice(k).indexOf(`
130
+ `);return D>-1?k+D:-1}},{key:"optimize",value:function(k){this.domNode.textContent.endsWith(`
131
+ `)||this.appendChild(S.default.create("text",`
132
+ `)),l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,k);var R=this.next;R!=null&&R.prev===this&&R.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===R.statics.formats(R.domNode)&&(R.optimize(k),R.moveChildren(this),R.remove())}},{key:"replace",value:function(k){l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"replace",this).call(this,k),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(R){var D=S.default.find(R);D==null?R.parentNode.removeChild(R):D instanceof S.default.Embed?D.remove():D.unwrap()})}}],[{key:"create",value:function(k){var R=l(A.__proto__||Object.getPrototypeOf(A),"create",this).call(this,k);return R.setAttribute("spellcheck",!1),R}},{key:"formats",value:function(){return!0}}]),A}(g.default);P.blotName="code-block",P.tagName="PRE",P.TAB=" ",n.Code=x,n.default=P},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!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(L,I){var B=[],M=!0,$=!1,K=void 0;try{for(var V=L[Symbol.iterator](),H;!(M=(H=V.next()).done)&&(B.push(H.value),!(I&&B.length===I));M=!0);}catch(X){$=!0,K=X}finally{try{!M&&V.return&&V.return()}finally{if($)throw K}}return B}return function(L,I){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return q(L,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function q(L,I){for(var B=0;B<I.length;B++){var M=I[B];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(L,M.key,M)}}return function(L,I,B){return I&&q(L.prototype,I),B&&q(L,B),L}}(),u=i(2),f=R(u),p=i(20),S=R(p),w=i(0),g=R(w),E=i(13),m=R(E),v=i(24),y=R(v),h=i(4),d=R(h),b=i(16),O=R(b),x=i(21),P=R(x),_=i(11),A=R(_),C=i(3),k=R(C);function R(q){return q&&q.__esModule?q:{default:q}}function D(q,L,I){return L in q?Object.defineProperty(q,L,{value:I,enumerable:!0,configurable:!0,writable:!0}):q[L]=I,q}function U(q,L){if(!(q instanceof L))throw new TypeError("Cannot call a class as a function")}var Y=/^[ -~]*$/,j=function(){function q(L){U(this,q),this.scroll=L,this.delta=this.getDelta()}return l(q,[{key:"applyDelta",value:function(I){var B=this,M=!1;this.scroll.update();var $=this.scroll.length();return this.scroll.batchStart(),I=z(I),I.reduce(function(K,V){var H=V.retain||V.delete||V.insert.length||1,X=V.attributes||{};if(V.insert!=null){if(typeof V.insert=="string"){var Z=V.insert;Z.endsWith(`
133
+ `)&&M&&(M=!1,Z=Z.slice(0,-1)),K>=$&&!Z.endsWith(`
134
+ `)&&(M=!0),B.scroll.insertAt(K,Z);var J=B.scroll.line(K),ee=o(J,2),re=ee[0],ne=ee[1],de=(0,k.default)({},(0,h.bubbleFormats)(re));if(re instanceof d.default){var pe=re.descendant(g.default.Leaf,ne),Me=o(pe,1),Fe=Me[0];de=(0,k.default)(de,(0,h.bubbleFormats)(Fe))}X=S.default.attributes.diff(de,X)||{}}else if(a(V.insert)==="object"){var fe=Object.keys(V.insert)[0];if(fe==null)return K;B.scroll.insertAt(K,fe,V.insert[fe])}$+=H}return Object.keys(X).forEach(function(ie){B.scroll.formatAt(K,H,ie,X[ie])}),K+H},0),I.reduce(function(K,V){return typeof V.delete=="number"?(B.scroll.deleteAt(K,V.delete),K):K+(V.retain||V.insert.length||1)},0),this.scroll.batchEnd(),this.update(I)}},{key:"deleteText",value:function(I,B){return this.scroll.deleteAt(I,B),this.update(new f.default().retain(I).delete(B))}},{key:"formatLine",value:function(I,B){var M=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys($).forEach(function(K){if(!(M.scroll.whitelist!=null&&!M.scroll.whitelist[K])){var V=M.scroll.lines(I,Math.max(B,1)),H=B;V.forEach(function(X){var Z=X.length();if(!(X instanceof m.default))X.format(K,$[K]);else{var J=I-X.offset(M.scroll),ee=X.newlineIndex(J+H)-J+1;X.formatAt(J,ee,K,$[K])}H-=Z})}}),this.scroll.optimize(),this.update(new f.default().retain(I).retain(B,(0,P.default)($)))}},{key:"formatText",value:function(I,B){var M=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys($).forEach(function(K){M.scroll.formatAt(I,B,K,$[K])}),this.update(new f.default().retain(I).retain(B,(0,P.default)($)))}},{key:"getContents",value:function(I,B){return this.delta.slice(I,I+B)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(I,B){return I.concat(B.delta())},new f.default)}},{key:"getFormat",value:function(I){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,M=[],$=[];B===0?this.scroll.path(I).forEach(function(V){var H=o(V,1),X=H[0];X instanceof d.default?M.push(X):X instanceof g.default.Leaf&&$.push(X)}):(M=this.scroll.lines(I,B),$=this.scroll.descendants(g.default.Leaf,I,B));var K=[M,$].map(function(V){if(V.length===0)return{};for(var H=(0,h.bubbleFormats)(V.shift());Object.keys(H).length>0;){var X=V.shift();if(X==null)return H;H=G((0,h.bubbleFormats)(X),H)}return H});return k.default.apply(k.default,K)}},{key:"getText",value:function(I,B){return this.getContents(I,B).filter(function(M){return typeof M.insert=="string"}).map(function(M){return M.insert}).join("")}},{key:"insertEmbed",value:function(I,B,M){return this.scroll.insertAt(I,B,M),this.update(new f.default().retain(I).insert(D({},B,M)))}},{key:"insertText",value:function(I,B){var M=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return B=B.replace(/\r\n/g,`
135
+ `).replace(/\r/g,`
136
+ `),this.scroll.insertAt(I,B),Object.keys($).forEach(function(K){M.scroll.formatAt(I,B.length,K,$[K])}),this.update(new f.default().retain(I).insert(B,(0,P.default)($)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var I=this.scroll.children.head;return I.statics.blotName!==d.default.blotName||I.children.length>1?!1:I.children.head instanceof O.default}},{key:"removeFormat",value:function(I,B){var M=this.getText(I,B),$=this.scroll.line(I+B),K=o($,2),V=K[0],H=K[1],X=0,Z=new f.default;V!=null&&(V instanceof m.default?X=V.newlineIndex(H)-H+1:X=V.length()-H,Z=V.delta().slice(H,H+X-1).insert(`
137
+ `));var J=this.getContents(I,B+X),ee=J.diff(new f.default().insert(M).concat(Z)),re=new f.default().retain(I).concat(ee);return this.applyDelta(re)}},{key:"update",value:function(I){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,$=this.delta;if(B.length===1&&B[0].type==="characterData"&&B[0].target.data.match(Y)&&g.default.find(B[0].target)){var K=g.default.find(B[0].target),V=(0,h.bubbleFormats)(K),H=K.offset(this.scroll),X=B[0].oldValue.replace(y.default.CONTENTS,""),Z=new f.default().insert(X),J=new f.default().insert(K.value()),ee=new f.default().retain(H).concat(Z.diff(J,M));I=ee.reduce(function(re,ne){return ne.insert?re.insert(ne.insert,V):re.push(ne)},new f.default),this.delta=$.compose(I)}else this.delta=this.getDelta(),(!I||!(0,A.default)($.compose(I),this.delta))&&(I=$.diff(this.delta,M));return I}}]),q}();function G(q,L){return Object.keys(L).reduce(function(I,B){return q[B]==null||(L[B]===q[B]?I[B]=L[B]:Array.isArray(L[B])?L[B].indexOf(q[B])<0&&(I[B]=L[B].concat([q[B]])):I[B]=[L[B],q[B]]),I},{})}function z(q){return q.reduce(function(L,I){if(I.insert===1){var B=(0,P.default)(I.attributes);return delete B.image,L.insert({image:I.attributes.image},B)}if(I.attributes!=null&&(I.attributes.list===!0||I.attributes.bullet===!0)&&(I=(0,P.default)(I),I.attributes.list?I.attributes.list="ordered":(I.attributes.list="bullet",delete I.attributes.bullet)),typeof I.insert=="string"){var M=I.insert.replace(/\r\n/g,`
138
+ `).replace(/\r/g,`
139
+ `);return L.insert(M,I.attributes)}return L.push(I)},new f.default)}n.default=j},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function _(A,C){var k=[],R=!0,D=!1,U=void 0;try{for(var Y=A[Symbol.iterator](),j;!(R=(j=Y.next()).done)&&(k.push(j.value),!(C&&k.length===C));R=!0);}catch(G){D=!0,U=G}finally{try{!R&&Y.return&&Y.return()}finally{if(D)throw U}}return k}return function(A,C){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return _(A,C);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function _(A,C){for(var k=0;k<C.length;k++){var R=C[k];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(A,R.key,R)}}return function(A,C,k){return C&&_(A.prototype,C),k&&_(A,k),A}}(),l=i(0),u=y(l),f=i(21),p=y(f),S=i(11),w=y(S),g=i(8),E=y(g),m=i(10),v=y(m);function y(_){return _&&_.__esModule?_:{default:_}}function h(_){if(Array.isArray(_)){for(var A=0,C=Array(_.length);A<_.length;A++)C[A]=_[A];return C}else return Array.from(_)}function d(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")}var b=(0,v.default)("quill:selection"),O=function _(A){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,_),this.index=A,this.length=C},x=function(){function _(A,C){var k=this;d(this,_),this.emitter=C,this.scroll=A,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(){k.mouseDown||setTimeout(k.update.bind(k,E.default.sources.USER),1)}),this.emitter.on(E.default.events.EDITOR_CHANGE,function(R,D){R===E.default.events.TEXT_CHANGE&&D.length()>0&&k.update(E.default.sources.SILENT)}),this.emitter.on(E.default.events.SCROLL_BEFORE_UPDATE,function(){if(k.hasFocus()){var R=k.getNativeRange();R!=null&&R.start.node!==k.cursor.textNode&&k.emitter.once(E.default.events.SCROLL_UPDATE,function(){try{k.setNativeRange(R.start.node,R.start.offset,R.end.node,R.end.offset)}catch{}})}}),this.emitter.on(E.default.events.SCROLL_OPTIMIZE,function(R,D){if(D.range){var U=D.range,Y=U.startNode,j=U.startOffset,G=U.endNode,z=U.endOffset;k.setNativeRange(Y,j,G,z)}}),this.update(E.default.sources.SILENT)}return o(_,[{key:"handleComposition",value:function(){var C=this;this.root.addEventListener("compositionstart",function(){C.composing=!0}),this.root.addEventListener("compositionend",function(){if(C.composing=!1,C.cursor.parent){var k=C.cursor.restore();if(!k)return;setTimeout(function(){C.setNativeRange(k.startNode,k.startOffset,k.endNode,k.endOffset)},1)}})}},{key:"handleDragging",value:function(){var C=this;this.emitter.listenDOM("mousedown",document.body,function(){C.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){C.mouseDown=!1,C.update(E.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(C,k){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[C])){this.scroll.update();var R=this.getNativeRange();if(!(R==null||!R.native.collapsed||u.default.query(C,u.default.Scope.BLOCK))){if(R.start.node!==this.cursor.textNode){var D=u.default.find(R.start.node,!1);if(D==null)return;if(D instanceof u.default.Leaf){var U=D.split(R.start.offset);D.parent.insertBefore(this.cursor,U)}else D.insertBefore(this.cursor,R.start.node);this.cursor.attach()}this.cursor.format(C,k),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,R=this.scroll.length();C=Math.min(C,R-1),k=Math.min(C+k,R-1)-C;var D=void 0,U=this.scroll.leaf(C),Y=a(U,2),j=Y[0],G=Y[1];if(j==null)return null;var z=j.position(G,!0),q=a(z,2);D=q[0],G=q[1];var L=document.createRange();if(k>0){L.setStart(D,G);var I=this.scroll.leaf(C+k),B=a(I,2);if(j=B[0],G=B[1],j==null)return null;var M=j.position(G,!0),$=a(M,2);return D=$[0],G=$[1],L.setEnd(D,G),L.getBoundingClientRect()}else{var K="left",V=void 0;return D instanceof Text?(G<D.data.length?(L.setStart(D,G),L.setEnd(D,G+1)):(L.setStart(D,G-1),L.setEnd(D,G),K="right"),V=L.getBoundingClientRect()):(V=j.domNode.getBoundingClientRect(),G>0&&(K="right")),{bottom:V.top+V.height,height:V.height,left:V[K],right:V[K],top:V.top,width:0}}}},{key:"getNativeRange",value:function(){var C=document.getSelection();if(C==null||C.rangeCount<=0)return null;var k=C.getRangeAt(0);if(k==null)return null;var R=this.normalizeNative(k);return b.info("getNativeRange",R),R}},{key:"getRange",value:function(){var C=this.getNativeRange();if(C==null)return[null,null];var k=this.normalizedToRange(C);return[k,C]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(C){var k=this,R=[[C.start.node,C.start.offset]];C.native.collapsed||R.push([C.end.node,C.end.offset]);var D=R.map(function(j){var G=a(j,2),z=G[0],q=G[1],L=u.default.find(z,!0),I=L.offset(k.scroll);return q===0?I:L instanceof u.default.Container?I+L.length():I+L.index(z,q)}),U=Math.min(Math.max.apply(Math,h(D)),this.scroll.length()-1),Y=Math.min.apply(Math,[U].concat(h(D)));return new O(Y,U-Y)}},{key:"normalizeNative",value:function(C){if(!P(this.root,C.startContainer)||!C.collapsed&&!P(this.root,C.endContainer))return null;var k={start:{node:C.startContainer,offset:C.startOffset},end:{node:C.endContainer,offset:C.endOffset},native:C};return[k.start,k.end].forEach(function(R){for(var D=R.node,U=R.offset;!(D instanceof Text)&&D.childNodes.length>0;)if(D.childNodes.length>U)D=D.childNodes[U],U=0;else if(D.childNodes.length===U)D=D.lastChild,U=D instanceof Text?D.data.length:D.childNodes.length+1;else break;R.node=D,R.offset=U}),k}},{key:"rangeToNative",value:function(C){var k=this,R=C.collapsed?[C.index]:[C.index,C.index+C.length],D=[],U=this.scroll.length();return R.forEach(function(Y,j){Y=Math.min(U-1,Y);var G=void 0,z=k.scroll.leaf(Y),q=a(z,2),L=q[0],I=q[1],B=L.position(I,j!==0),M=a(B,2);G=M[0],I=M[1],D.push(G,I)}),D.length<2&&(D=D.concat(D)),D}},{key:"scrollIntoView",value:function(C){var k=this.lastRange;if(k!=null){var R=this.getBounds(k.index,k.length);if(R!=null){var D=this.scroll.length()-1,U=this.scroll.line(Math.min(k.index,D)),Y=a(U,1),j=Y[0],G=j;if(k.length>0){var z=this.scroll.line(Math.min(k.index+k.length,D)),q=a(z,1);G=q[0]}if(!(j==null||G==null)){var L=C.getBoundingClientRect();R.top<L.top?C.scrollTop-=L.top-R.top:R.bottom>L.bottom&&(C.scrollTop+=R.bottom-L.bottom)}}}}},{key:"setNativeRange",value:function(C,k){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:C,D=arguments.length>3&&arguments[3]!==void 0?arguments[3]:k,U=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(b.info("setNativeRange",C,k,R,D),!(C!=null&&(this.root.parentNode==null||C.parentNode==null||R.parentNode==null))){var Y=document.getSelection();if(Y!=null)if(C!=null){this.hasFocus()||this.root.focus();var j=(this.getNativeRange()||{}).native;if(j==null||U||C!==j.startContainer||k!==j.startOffset||R!==j.endContainer||D!==j.endOffset){C.tagName=="BR"&&(k=[].indexOf.call(C.parentNode.childNodes,C),C=C.parentNode),R.tagName=="BR"&&(D=[].indexOf.call(R.parentNode.childNodes,R),R=R.parentNode);var G=document.createRange();G.setStart(C,k),G.setEnd(R,D),Y.removeAllRanges(),Y.addRange(G)}}else Y.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E.default.sources.API;if(typeof k=="string"&&(R=k,k=!1),b.info("setRange",C),C!=null){var D=this.rangeToNative(C);this.setNativeRange.apply(this,h(D).concat([k]))}else this.setNativeRange(null);this.update(R)}},{key:"update",value:function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E.default.sources.USER,k=this.lastRange,R=this.getRange(),D=a(R,2),U=D[0],Y=D[1];if(this.lastRange=U,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,w.default)(k,this.lastRange)){var j;!this.composing&&Y!=null&&Y.native.collapsed&&Y.start.node!==this.cursor.textNode&&this.cursor.restore();var G=[E.default.events.SELECTION_CHANGE,(0,p.default)(this.lastRange),(0,p.default)(k),C];if((j=this.emitter).emit.apply(j,[E.default.events.EDITOR_CHANGE].concat(G)),C!==E.default.sources.SILENT){var z;(z=this.emitter).emit.apply(z,G)}}}}]),_}();function P(_,A){try{A.parentNode}catch{return!1}return A instanceof Text&&(A=A.parentNode),_.contains(A)}n.Range=O,n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(m,v){for(var y=0;y<v.length;y++){var h=v[y];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(m,h.key,h)}}return function(m,v,y){return v&&E(m.prototype,v),y&&E(m,y),m}}(),o=function E(m,v,y){m===null&&(m=Function.prototype);var h=Object.getOwnPropertyDescriptor(m,v);if(h===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:E(d,v,y)}else{if("value"in h)return h.value;var b=h.get;return b===void 0?void 0:b.call(y)}},l=i(0),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function p(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function S(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function w(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var g=function(E){w(m,E);function m(){return p(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"insertInto",value:function(y,h){y.children.length===0?o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"insertInto",this).call(this,y,h):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),m}(u.default.Embed);g.blotName="break",g.tagName="BR",n.default=g},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,g){w.__proto__=g}||function(w,g){for(var E in g)g.hasOwnProperty(E)&&(w[E]=g[E])};return function(w,g){S(w,g);function E(){this.constructor=w}w.prototype=g===null?Object.create(g):(E.prototype=g.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(44),l=i(30),u=i(1),f=function(S){a(w,S);function w(g){var E=S.call(this,g)||this;return E.build(),E}return w.prototype.appendChild=function(g){this.insertBefore(g)},w.prototype.attach=function(){S.prototype.attach.call(this),this.children.forEach(function(g){g.attach()})},w.prototype.build=function(){var g=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(E){try{var m=p(E);g.insertBefore(m,g.children.head||void 0)}catch(v){if(v instanceof u.ParchmentError)return;throw v}})},w.prototype.deleteAt=function(g,E){if(g===0&&E===this.length())return this.remove();this.children.forEachAt(g,E,function(m,v,y){m.deleteAt(v,y)})},w.prototype.descendant=function(g,E){var m=this.children.find(E),v=m[0],y=m[1];return g.blotName==null&&g(v)||g.blotName!=null&&v instanceof g?[v,y]:v instanceof w?v.descendant(g,y):[null,-1]},w.prototype.descendants=function(g,E,m){E===void 0&&(E=0),m===void 0&&(m=Number.MAX_VALUE);var v=[],y=m;return this.children.forEachAt(E,m,function(h,d,b){(g.blotName==null&&g(h)||g.blotName!=null&&h instanceof g)&&v.push(h),h instanceof w&&(v=v.concat(h.descendants(g,d,y))),y-=b}),v},w.prototype.detach=function(){this.children.forEach(function(g){g.detach()}),S.prototype.detach.call(this)},w.prototype.formatAt=function(g,E,m,v){this.children.forEachAt(g,E,function(y,h,d){y.formatAt(h,d,m,v)})},w.prototype.insertAt=function(g,E,m){var v=this.children.find(g),y=v[0],h=v[1];if(y)y.insertAt(h,E,m);else{var d=m==null?u.create("text",E):u.create(E,m);this.appendChild(d)}},w.prototype.insertBefore=function(g,E){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(m){return g instanceof m}))throw new u.ParchmentError("Cannot insert "+g.statics.blotName+" into "+this.statics.blotName);g.insertInto(this,E)},w.prototype.length=function(){return this.children.reduce(function(g,E){return g+E.length()},0)},w.prototype.moveChildren=function(g,E){this.children.forEach(function(m){g.insertBefore(m,E)})},w.prototype.optimize=function(g){if(S.prototype.optimize.call(this,g),this.children.length===0)if(this.statics.defaultChild!=null){var E=u.create(this.statics.defaultChild);this.appendChild(E),E.optimize(g)}else this.remove()},w.prototype.path=function(g,E){E===void 0&&(E=!1);var m=this.children.find(g,E),v=m[0],y=m[1],h=[[this,g]];return v instanceof w?h.concat(v.path(y,E)):(v!=null&&h.push([v,y]),h)},w.prototype.removeChild=function(g){this.children.remove(g)},w.prototype.replace=function(g){g instanceof w&&g.moveChildren(this),S.prototype.replace.call(this,g)},w.prototype.split=function(g,E){if(E===void 0&&(E=!1),!E){if(g===0)return this;if(g===this.length())return this.next}var m=this.clone();return this.parent.insertBefore(m,this.next),this.children.forEachAt(g,this.length(),function(v,y,h){v=v.split(y,E),m.appendChild(v)}),m},w.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},w.prototype.update=function(g,E){var m=this,v=[],y=[];g.forEach(function(h){h.target===m.domNode&&h.type==="childList"&&(v.push.apply(v,h.addedNodes),y.push.apply(y,h.removedNodes))}),y.forEach(function(h){if(!(h.parentNode!=null&&h.tagName!=="IFRAME"&&document.body.compareDocumentPosition(h)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var d=u.find(h);d!=null&&(d.domNode.parentNode==null||d.domNode.parentNode===m.domNode)&&d.detach()}}),v.filter(function(h){return h.parentNode==m.domNode}).sort(function(h,d){return h===d?0:h.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(h){var d=null;h.nextSibling!=null&&(d=u.find(h.nextSibling));var b=p(h);(b.next!=d||b.next==null)&&(b.parent!=null&&b.parent.removeChild(m),m.insertBefore(b,d||void 0))})},w}(l.default);function p(S){var w=u.find(S);if(w==null)try{w=u.create(S)}catch{w=u.create(u.Scope.INLINE),[].slice.call(S.childNodes).forEach(function(E){w.domNode.appendChild(E)}),S.parentNode&&S.parentNode.replaceChild(w.domNode,S),w.attach()}return w}n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,g){w.__proto__=g}||function(w,g){for(var E in g)g.hasOwnProperty(E)&&(w[E]=g[E])};return function(w,g){S(w,g);function E(){this.constructor=w}w.prototype=g===null?Object.create(g):(E.prototype=g.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),l=i(31),u=i(17),f=i(1),p=function(S){a(w,S);function w(g){var E=S.call(this,g)||this;return E.attributes=new l.default(E.domNode),E}return w.formats=function(g){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return g.tagName.toLowerCase()},w.prototype.format=function(g,E){var m=f.query(g);m instanceof o.default?this.attributes.attribute(m,E):E&&m!=null&&(g!==this.statics.blotName||this.formats()[g]!==E)&&this.replaceWith(g,E)},w.prototype.formats=function(){var g=this.attributes.values(),E=this.statics.formats(this.domNode);return E!=null&&(g[this.statics.blotName]=E),g},w.prototype.replaceWith=function(g,E){var m=S.prototype.replaceWith.call(this,g,E);return this.attributes.copy(m),m},w.prototype.update=function(g,E){var m=this;S.prototype.update.call(this,g,E),g.some(function(v){return v.target===m.domNode&&v.type==="attributes"})&&this.attributes.build()},w.prototype.wrap=function(g,E){var m=S.prototype.wrap.call(this,g,E);return m instanceof w&&m.statics.scope===this.statics.scope&&this.attributes.move(m),m},w}(u.default);n.default=p},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,S){p.__proto__=S}||function(p,S){for(var w in S)S.hasOwnProperty(w)&&(p[w]=S[w])};return function(p,S){f(p,S);function w(){this.constructor=p}p.prototype=S===null?Object.create(S):(w.prototype=S.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),l=i(1),u=function(f){a(p,f);function p(){return f!==null&&f.apply(this,arguments)||this}return p.value=function(S){return!0},p.prototype.index=function(S,w){return this.domNode===S||this.domNode.compareDocumentPosition(S)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(w,1):-1},p.prototype.position=function(S,w){var g=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return S>0&&(g+=1),[this.parent.domNode,g]},p.prototype.value=function(){var S;return S={},S[this.statics.blotName]=this.statics.value(this.domNode)||!0,S},p.scope=l.Scope.INLINE_BLOT,p}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),l={attributes:{compose:function(f,p,S){typeof f!="object"&&(f={}),typeof p!="object"&&(p={});var w=o(!0,{},p);S||(w=Object.keys(w).reduce(function(E,m){return w[m]!=null&&(E[m]=w[m]),E},{}));for(var g in f)f[g]!==void 0&&p[g]===void 0&&(w[g]=f[g]);return Object.keys(w).length>0?w:void 0},diff:function(f,p){typeof f!="object"&&(f={}),typeof p!="object"&&(p={});var S=Object.keys(f).concat(Object.keys(p)).reduce(function(w,g){return a(f[g],p[g])||(w[g]=p[g]===void 0?null:p[g]),w},{});return Object.keys(S).length>0?S:void 0},transform:function(f,p,S){if(typeof f!="object")return p;if(typeof p=="object"){if(!S)return p;var w=Object.keys(p).reduce(function(g,E){return f[E]===void 0&&(g[E]=p[E]),g},{});return Object.keys(w).length>0?w: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 p=this.ops[this.index];if(p){var S=this.offset,w=l.length(p);if(f>=w-S?(f=w-S,this.index+=1,this.offset=0):this.offset+=f,typeof p.delete=="number")return{delete:f};var g={};return p.attributes&&(g.attributes=p.attributes),typeof p.retain=="number"?g.retain=f:typeof p.insert=="string"?g.insert=p.insert.substr(S,f):g.insert=p.insert,g}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,p=this.index,S=this.next(),w=this.ops.slice(this.index);return this.offset=f,this.index=p,[S].concat(w)}else return[]},r.exports=l},function(r,n){var i=function(){function a(m,v){return v!=null&&m instanceof v}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(m,v,y,h,d){typeof v=="object"&&(y=v.depth,h=v.prototype,d=v.includeNonEnumerable,v=v.circular);var b=[],O=[],x=typeof Buffer<"u";typeof v>"u"&&(v=!0),typeof y>"u"&&(y=1/0);function P(_,A){if(_===null)return null;if(A===0)return _;var C,k;if(typeof _!="object")return _;if(a(_,o))C=new o;else if(a(_,l))C=new l;else if(a(_,u))C=new u(function(L,I){_.then(function(B){L(P(B,A-1))},function(B){I(P(B,A-1))})});else if(f.__isArray(_))C=[];else if(f.__isRegExp(_))C=new RegExp(_.source,E(_)),_.lastIndex&&(C.lastIndex=_.lastIndex);else if(f.__isDate(_))C=new Date(_.getTime());else{if(x&&Buffer.isBuffer(_))return Buffer.allocUnsafe?C=Buffer.allocUnsafe(_.length):C=new Buffer(_.length),_.copy(C),C;a(_,Error)?C=Object.create(_):typeof h>"u"?(k=Object.getPrototypeOf(_),C=Object.create(k)):(C=Object.create(h),k=h)}if(v){var R=b.indexOf(_);if(R!=-1)return O[R];b.push(_),O.push(C)}a(_,o)&&_.forEach(function(L,I){var B=P(I,A-1),M=P(L,A-1);C.set(B,M)}),a(_,l)&&_.forEach(function(L){var I=P(L,A-1);C.add(I)});for(var D in _){var U;k&&(U=Object.getOwnPropertyDescriptor(k,D)),!(U&&U.set==null)&&(C[D]=P(_[D],A-1))}if(Object.getOwnPropertySymbols)for(var Y=Object.getOwnPropertySymbols(_),D=0;D<Y.length;D++){var j=Y[D],G=Object.getOwnPropertyDescriptor(_,j);G&&!G.enumerable&&!d||(C[j]=P(_[j],A-1),G.enumerable||Object.defineProperty(C,j,{enumerable:!1}))}if(d)for(var z=Object.getOwnPropertyNames(_),D=0;D<z.length;D++){var q=z[D],G=Object.getOwnPropertyDescriptor(_,q);G&&G.enumerable||(C[q]=P(_[q],A-1),Object.defineProperty(C,q,{enumerable:!1}))}return C}return P(m,y)}f.clonePrototype=function(v){if(v===null)return null;var y=function(){};return y.prototype=v,new y};function p(m){return Object.prototype.toString.call(m)}f.__objToStr=p;function S(m){return typeof m=="object"&&p(m)==="[object Date]"}f.__isDate=S;function w(m){return typeof m=="object"&&p(m)==="[object Array]"}f.__isArray=w;function g(m){return typeof m=="object"&&p(m)==="[object RegExp]"}f.__isRegExp=g;function E(m){var v="";return m.global&&(v+="g"),m.ignoreCase&&(v+="i"),m.multiline&&(v+="m"),v}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 C(k,R){var D=[],U=!0,Y=!1,j=void 0;try{for(var G=k[Symbol.iterator](),z;!(U=(z=G.next()).done)&&(D.push(z.value),!(R&&D.length===R));U=!0);}catch(q){Y=!0,j=q}finally{try{!U&&G.return&&G.return()}finally{if(Y)throw j}}return D}return function(k,R){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return C(k,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function C(k,R){for(var D=0;D<R.length;D++){var U=R[D];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(k,U.key,U)}}return function(k,R,D){return R&&C(k.prototype,R),D&&C(k,D),k}}(),l=function C(k,R,D){k===null&&(k=Function.prototype);var U=Object.getOwnPropertyDescriptor(k,R);if(U===void 0){var Y=Object.getPrototypeOf(k);return Y===null?void 0:C(Y,R,D)}else{if("value"in U)return U.value;var j=U.get;return j===void 0?void 0:j.call(D)}},u=i(0),f=b(u),p=i(8),S=b(p),w=i(4),g=b(w),E=i(16),m=b(E),v=i(13),y=b(v),h=i(25),d=b(h);function b(C){return C&&C.__esModule?C:{default:C}}function O(C,k){if(!(C instanceof k))throw new TypeError("Cannot call a class as a function")}function x(C,k){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:C}function P(C,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);C.prototype=Object.create(k&&k.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(C,k):C.__proto__=k)}function _(C){return C instanceof g.default||C instanceof w.BlockEmbed}var A=function(C){P(k,C);function k(R,D){O(this,k);var U=x(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,R));return U.emitter=D.emitter,Array.isArray(D.whitelist)&&(U.whitelist=D.whitelist.reduce(function(Y,j){return Y[j]=!0,Y},{})),U.domNode.addEventListener("DOMNodeInserted",function(){}),U.optimize(),U.enable(),U}return o(k,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(D,U){var Y=this.line(D),j=a(Y,2),G=j[0],z=j[1],q=this.line(D+U),L=a(q,1),I=L[0];if(l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"deleteAt",this).call(this,D,U),I!=null&&G!==I&&z>0){if(G instanceof w.BlockEmbed||I instanceof w.BlockEmbed){this.optimize();return}if(G instanceof y.default){var B=G.newlineIndex(G.length(),!0);if(B>-1&&(G=G.split(B+1),G===I)){this.optimize();return}}else if(I instanceof y.default){var M=I.newlineIndex(0);M>-1&&I.split(M+1)}var $=I.children.head instanceof m.default?null:I.children.head;G.moveChildren(I,$),G.remove()}this.optimize()}},{key:"enable",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",D)}},{key:"formatAt",value:function(D,U,Y,j){this.whitelist!=null&&!this.whitelist[Y]||(l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"formatAt",this).call(this,D,U,Y,j),this.optimize())}},{key:"insertAt",value:function(D,U,Y){if(!(Y!=null&&this.whitelist!=null&&!this.whitelist[U])){if(D>=this.length())if(Y==null||f.default.query(U,f.default.Scope.BLOCK)==null){var j=f.default.create(this.statics.defaultChild);this.appendChild(j),Y==null&&U.endsWith(`
140
+ `)&&(U=U.slice(0,-1)),j.insertAt(0,U,Y)}else{var G=f.default.create(U,Y);this.appendChild(G)}else l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertAt",this).call(this,D,U,Y);this.optimize()}}},{key:"insertBefore",value:function(D,U){if(D.statics.scope===f.default.Scope.INLINE_BLOT){var Y=f.default.create(this.statics.defaultChild);Y.appendChild(D),D=Y}l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertBefore",this).call(this,D,U)}},{key:"leaf",value:function(D){return this.path(D).pop()||[null,-1]}},{key:"line",value:function(D){return D===this.length()?this.line(D-1):this.descendant(_,D)}},{key:"lines",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,Y=function j(G,z,q){var L=[],I=q;return G.children.forEachAt(z,q,function(B,M,$){_(B)?L.push(B):B instanceof f.default.Container&&(L=L.concat(j(B,M,I))),I-=$}),L};return Y(this,D,U)}},{key:"optimize",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"optimize",this).call(this,D,U),D.length>0&&this.emitter.emit(S.default.events.SCROLL_OPTIMIZE,D,U))}},{key:"path",value:function(D){return l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"path",this).call(this,D).slice(1)}},{key:"update",value:function(D){if(this.batch!==!0){var U=S.default.sources.USER;typeof D=="string"&&(U=D),Array.isArray(D)||(D=this.observer.takeRecords()),D.length>0&&this.emitter.emit(S.default.events.SCROLL_BEFORE_UPDATE,U,D),l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"update",this).call(this,D.concat([])),D.length>0&&this.emitter.emit(S.default.events.SCROLL_UPDATE,U,D)}}}]),k}(f.default.Scroll);A.blotName="scroll",A.className="ql-editor",A.tagName="DIV",A.defaultChild="block",A.allowedChildren=[g.default,w.BlockEmbed,d.default],n.default=A},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(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},o=function(){function V(H,X){var Z=[],J=!0,ee=!1,re=void 0;try{for(var ne=H[Symbol.iterator](),de;!(J=(de=ne.next()).done)&&(Z.push(de.value),!(X&&Z.length===X));J=!0);}catch(pe){ee=!0,re=pe}finally{try{!J&&ne.return&&ne.return()}finally{if(ee)throw re}}return Z}return function(H,X){if(Array.isArray(H))return H;if(Symbol.iterator in Object(H))return V(H,X);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function V(H,X){for(var Z=0;Z<X.length;Z++){var J=X[Z];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(H,J.key,J)}}return function(H,X,Z){return X&&V(H.prototype,X),Z&&V(H,Z),H}}(),u=i(21),f=C(u),p=i(11),S=C(p),w=i(3),g=C(w),E=i(2),m=C(E),v=i(20),y=C(v),h=i(0),d=C(h),b=i(5),O=C(b),x=i(10),P=C(x),_=i(9),A=C(_);function C(V){return V&&V.__esModule?V:{default:V}}function k(V,H,X){return H in V?Object.defineProperty(V,H,{value:X,enumerable:!0,configurable:!0,writable:!0}):V[H]=X,V}function R(V,H){if(!(V instanceof H))throw new TypeError("Cannot call a class as a function")}function D(V,H){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return H&&(typeof H=="object"||typeof H=="function")?H:V}function U(V,H){if(typeof H!="function"&&H!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof H);V.prototype=Object.create(H&&H.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),H&&(Object.setPrototypeOf?Object.setPrototypeOf(V,H):V.__proto__=H)}var Y=(0,P.default)("quill:keyboard"),j=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",G=function(V){U(H,V),l(H,null,[{key:"match",value:function(Z,J){return J=K(J),["altKey","ctrlKey","metaKey","shiftKey"].some(function(ee){return!!J[ee]!==Z[ee]&&J[ee]!==null})?!1:J.key===(Z.which||Z.keyCode)}}]);function H(X,Z){R(this,H);var J=D(this,(H.__proto__||Object.getPrototypeOf(H)).call(this,X,Z));return J.bindings={},Object.keys(J.options.bindings).forEach(function(ee){ee==="list autofill"&&X.scroll.whitelist!=null&&!X.scroll.whitelist.list||J.options.bindings[ee]&&J.addBinding(J.options.bindings[ee])}),J.addBinding({key:H.keys.ENTER,shiftKey:null},B),J.addBinding({key:H.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(J.addBinding({key:H.keys.BACKSPACE},{collapsed:!0},q),J.addBinding({key:H.keys.DELETE},{collapsed:!0},L)):(J.addBinding({key:H.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},q),J.addBinding({key:H.keys.DELETE},{collapsed:!0,suffix:/^.?$/},L)),J.addBinding({key:H.keys.BACKSPACE},{collapsed:!1},I),J.addBinding({key:H.keys.DELETE},{collapsed:!1},I),J.addBinding({key:H.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},q),J.listen(),J}return l(H,[{key:"addBinding",value:function(Z){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},re=K(Z);if(re==null||re.key==null)return Y.warn("Attempted to add invalid keyboard binding",re);typeof J=="function"&&(J={handler:J}),typeof ee=="function"&&(ee={handler:ee}),re=(0,g.default)(re,J,ee),this.bindings[re.key]=this.bindings[re.key]||[],this.bindings[re.key].push(re)}},{key:"listen",value:function(){var Z=this;this.quill.root.addEventListener("keydown",function(J){if(!J.defaultPrevented){var ee=J.which||J.keyCode,re=(Z.bindings[ee]||[]).filter(function(tt){return H.match(J,tt)});if(re.length!==0){var ne=Z.quill.getSelection();if(!(ne==null||!Z.quill.hasFocus())){var de=Z.quill.getLine(ne.index),pe=o(de,2),Me=pe[0],Fe=pe[1],fe=Z.quill.getLeaf(ne.index),ie=o(fe,2),ve=ie[0],ge=ie[1],te=ne.length===0?[ve,ge]:Z.quill.getLeaf(ne.index+ne.length),ue=o(te,2),be=ue[0],se=ue[1],Pe=ve instanceof d.default.Text?ve.value().slice(0,ge):"",xe=be instanceof d.default.Text?be.value().slice(se):"",Ie={collapsed:ne.length===0,empty:ne.length===0&&Me.length()<=1,format:Z.quill.getFormat(ne),offset:Fe,prefix:Pe,suffix:xe},xt=re.some(function(tt){if(tt.collapsed!=null&&tt.collapsed!==Ie.collapsed||tt.empty!=null&&tt.empty!==Ie.empty||tt.offset!=null&&tt.offset!==Ie.offset)return!1;if(Array.isArray(tt.format)){if(tt.format.every(function(St){return Ie.format[St]==null}))return!1}else if(a(tt.format)==="object"&&!Object.keys(tt.format).every(function(St){return tt.format[St]===!0?Ie.format[St]!=null:tt.format[St]===!1?Ie.format[St]==null:(0,S.default)(tt.format[St],Ie.format[St])}))return!1;return tt.prefix!=null&&!tt.prefix.test(Ie.prefix)||tt.suffix!=null&&!tt.suffix.test(Ie.suffix)?!1:tt.handler.call(Z,ne,Ie)!==!0});xt&&J.preventDefault()}}}})}}]),H}(A.default);G.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},G.DEFAULTS={bindings:{bold:$("bold"),italic:$("italic"),underline:$("underline"),indent:{key:G.keys.TAB,format:["blockquote","indent","list"],handler:function(H,X){if(X.collapsed&&X.offset!==0)return!0;this.quill.format("indent","+1",O.default.sources.USER)}},outdent:{key:G.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(H,X){if(X.collapsed&&X.offset!==0)return!0;this.quill.format("indent","-1",O.default.sources.USER)}},"outdent backspace":{key:G.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(H,X){X.format.indent!=null?this.quill.format("indent","-1",O.default.sources.USER):X.format.list!=null&&this.quill.format("list",!1,O.default.sources.USER)}},"indent code-block":M(!0),"outdent code-block":M(!1),"remove tab":{key:G.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(H){this.quill.deleteText(H.index-1,1,O.default.sources.USER)}},tab:{key:G.keys.TAB,handler:function(H){this.quill.history.cutoff();var X=new m.default().retain(H.index).delete(H.length).insert(" ");this.quill.updateContents(X,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(H.index+1,O.default.sources.SILENT)}},"list empty enter":{key:G.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(H,X){this.quill.format("list",!1,O.default.sources.USER),X.format.indent&&this.quill.format("indent",!1,O.default.sources.USER)}},"checklist enter":{key:G.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(H){var X=this.quill.getLine(H.index),Z=o(X,2),J=Z[0],ee=Z[1],re=(0,g.default)({},J.formats(),{list:"checked"}),ne=new m.default().retain(H.index).insert(`
141
+ `,re).retain(J.length()-ee-1).retain(1,{list:"unchecked"});this.quill.updateContents(ne,O.default.sources.USER),this.quill.setSelection(H.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:G.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(H,X){var Z=this.quill.getLine(H.index),J=o(Z,2),ee=J[0],re=J[1],ne=new m.default().retain(H.index).insert(`
142
+ `,X.format).retain(ee.length()-re-1).retain(1,{header:null});this.quill.updateContents(ne,O.default.sources.USER),this.quill.setSelection(H.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(H,X){var Z=X.prefix.length,J=this.quill.getLine(H.index),ee=o(J,2),re=ee[0],ne=ee[1];if(ne>Z)return!0;var de=void 0;switch(X.prefix.trim()){case"[]":case"[ ]":de="unchecked";break;case"[x]":de="checked";break;case"-":case"*":de="bullet";break;default:de="ordered"}this.quill.insertText(H.index," ",O.default.sources.USER),this.quill.history.cutoff();var pe=new m.default().retain(H.index-ne).delete(Z+1).retain(re.length()-2-ne).retain(1,{list:de});this.quill.updateContents(pe,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(H.index-Z,O.default.sources.SILENT)}},"code exit":{key:G.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(H){var X=this.quill.getLine(H.index),Z=o(X,2),J=Z[0],ee=Z[1],re=new m.default().retain(H.index+J.length()-ee-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(re,O.default.sources.USER)}},"embed left":z(G.keys.LEFT,!1),"embed left shift":z(G.keys.LEFT,!0),"embed right":z(G.keys.RIGHT,!1),"embed right shift":z(G.keys.RIGHT,!0)}};function z(V,H){var X,Z=V===G.keys.LEFT?"prefix":"suffix";return X={key:V,shiftKey:H,altKey:null},k(X,Z,/^$/),k(X,"handler",function(ee){var re=ee.index;V===G.keys.RIGHT&&(re+=ee.length+1);var ne=this.quill.getLeaf(re),de=o(ne,1),pe=de[0];return pe instanceof d.default.Embed?(V===G.keys.LEFT?H?this.quill.setSelection(ee.index-1,ee.length+1,O.default.sources.USER):this.quill.setSelection(ee.index-1,O.default.sources.USER):H?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}),X}function q(V,H){if(!(V.index===0||this.quill.getLength()<=1)){var X=this.quill.getLine(V.index),Z=o(X,1),J=Z[0],ee={};if(H.offset===0){var re=this.quill.getLine(V.index-1),ne=o(re,1),de=ne[0];if(de!=null&&de.length()>1){var pe=J.formats(),Me=this.quill.getFormat(V.index-1,1);ee=y.default.attributes.diff(pe,Me)||{}}}var Fe=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(H.prefix)?2:1;this.quill.deleteText(V.index-Fe,Fe,O.default.sources.USER),Object.keys(ee).length>0&&this.quill.formatLine(V.index-Fe,Fe,ee,O.default.sources.USER),this.quill.focus()}}function L(V,H){var X=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(H.suffix)?2:1;if(!(V.index>=this.quill.getLength()-X)){var Z={},J=0,ee=this.quill.getLine(V.index),re=o(ee,1),ne=re[0];if(H.offset>=ne.length()-1){var de=this.quill.getLine(V.index+1),pe=o(de,1),Me=pe[0];if(Me){var Fe=ne.formats(),fe=this.quill.getFormat(V.index,1);Z=y.default.attributes.diff(Fe,fe)||{},J=Me.length()}}this.quill.deleteText(V.index,X,O.default.sources.USER),Object.keys(Z).length>0&&this.quill.formatLine(V.index+J-1,X,Z,O.default.sources.USER)}}function I(V){var H=this.quill.getLines(V),X={};if(H.length>1){var Z=H[0].formats(),J=H[H.length-1].formats();X=y.default.attributes.diff(J,Z)||{}}this.quill.deleteText(V,O.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine(V.index,1,X,O.default.sources.USER),this.quill.setSelection(V.index,O.default.sources.SILENT),this.quill.focus()}function B(V,H){var X=this;V.length>0&&this.quill.scroll.deleteAt(V.index,V.length);var Z=Object.keys(H.format).reduce(function(J,ee){return d.default.query(ee,d.default.Scope.BLOCK)&&!Array.isArray(H.format[ee])&&(J[ee]=H.format[ee]),J},{});this.quill.insertText(V.index,`
143
+ `,Z,O.default.sources.USER),this.quill.setSelection(V.index+1,O.default.sources.SILENT),this.quill.focus(),Object.keys(H.format).forEach(function(J){Z[J]==null&&(Array.isArray(H.format[J])||J!=="link"&&X.quill.format(J,H.format[J],O.default.sources.USER))})}function M(V){return{key:G.keys.TAB,shiftKey:!V,format:{"code-block":!0},handler:function(X){var Z=d.default.query("code-block"),J=X.index,ee=X.length,re=this.quill.scroll.descendant(Z,J),ne=o(re,2),de=ne[0],pe=ne[1];if(de!=null){var Me=this.quill.getIndex(de),Fe=de.newlineIndex(pe,!0)+1,fe=de.newlineIndex(Me+pe+ee),ie=de.domNode.textContent.slice(Fe,fe).split(`
144
+ `);pe=0,ie.forEach(function(ve,ge){V?(de.insertAt(Fe+pe,Z.TAB),pe+=Z.TAB.length,ge===0?J+=Z.TAB.length:ee+=Z.TAB.length):ve.startsWith(Z.TAB)&&(de.deleteAt(Fe+pe,Z.TAB.length),pe-=Z.TAB.length,ge===0?J-=Z.TAB.length:ee-=Z.TAB.length),pe+=ve.length+1}),this.quill.update(O.default.sources.USER),this.quill.setSelection(J,ee,O.default.sources.SILENT)}}}}function $(V){return{key:V[0].toUpperCase(),shortKey:!0,handler:function(X,Z){this.quill.format(V,!Z.format[V],O.default.sources.USER)}}}function K(V){if(typeof V=="string"||typeof V=="number")return K({key:V});if((typeof V>"u"?"undefined":a(V))==="object"&&(V=(0,f.default)(V,!1)),typeof V.key=="string")if(G.keys[V.key.toUpperCase()]!=null)V.key=G.keys[V.key.toUpperCase()];else if(V.key.length===1)V.key=V.key.toUpperCase().charCodeAt(0);else return null;return V.shortKey&&(V[j]=V.shortKey,delete V.shortKey),V}n.default=G,n.SHORTKEY=j},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(h,d){var b=[],O=!0,x=!1,P=void 0;try{for(var _=h[Symbol.iterator](),A;!(O=(A=_.next()).done)&&(b.push(A.value),!(d&&b.length===d));O=!0);}catch(C){x=!0,P=C}finally{try{!O&&_.return&&_.return()}finally{if(x)throw P}}return b}return function(h,d){if(Array.isArray(h))return h;if(Symbol.iterator in Object(h))return y(h,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function y(h,d,b){h===null&&(h=Function.prototype);var O=Object.getOwnPropertyDescriptor(h,d);if(O===void 0){var x=Object.getPrototypeOf(h);return x===null?void 0:y(x,d,b)}else{if("value"in O)return O.value;var P=O.get;return P===void 0?void 0:P.call(b)}},l=function(){function y(h,d){for(var b=0;b<d.length;b++){var O=d[b];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(h,O.key,O)}}return function(h,d,b){return d&&y(h.prototype,d),b&&y(h,b),h}}(),u=i(0),f=w(u),p=i(7),S=w(p);function w(y){return y&&y.__esModule?y:{default:y}}function g(y,h){if(!(y instanceof h))throw new TypeError("Cannot call a class as a function")}function E(y,h){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:y}function m(y,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);y.prototype=Object.create(h&&h.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(y,h):y.__proto__=h)}var v=function(y){m(h,y),l(h,null,[{key:"value",value:function(){}}]);function h(d,b){g(this,h);var O=E(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,d));return O.selection=b,O.textNode=document.createTextNode(h.CONTENTS),O.domNode.appendChild(O.textNode),O._length=0,O}return l(h,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(b,O){if(this._length!==0)return o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"format",this).call(this,b,O);for(var x=this,P=0;x!=null&&x.statics.scope!==f.default.Scope.BLOCK_BLOT;)P+=x.offset(x.parent),x=x.parent;x!=null&&(this._length=h.CONTENTS.length,x.optimize(),x.formatAt(P,h.CONTENTS.length,b,O),this._length=0)}},{key:"index",value:function(b,O){return b===this.textNode?0:o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"index",this).call(this,b,O)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var b=this.textNode,O=this.selection.getNativeRange(),x=void 0,P=void 0,_=void 0;if(O!=null&&O.start.node===b&&O.end.node===b){var A=[b,O.start.offset,O.end.offset];x=A[0],P=A[1],_=A[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==h.CONTENTS){var C=this.textNode.data.split(h.CONTENTS).join("");this.next instanceof S.default?(x=this.next.domNode,this.next.insertAt(0,C),this.textNode.data=h.CONTENTS):(this.textNode.data=C,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(h.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),P!=null){var k=[P,_].map(function(D){return Math.max(0,Math.min(x.data.length,D-1))}),R=a(k,2);return P=R[0],_=R[1],{startNode:x,startOffset:P,endNode:x,endOffset:_}}}}},{key:"update",value:function(b,O){var x=this;if(b.some(function(_){return _.type==="characterData"&&_.target===x.textNode})){var P=this.restore();P&&(O.range=P)}}},{key:"value",value:function(){return""}}]),h}(f.default.Embed);v.blotName="cursor",v.className="ql-cursor",v.tagName="span",v.CONTENTS="\uFEFF",n.default=v},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 p(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function S(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function w(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var g=function(E){w(m,E);function m(){return p(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(o.default.Container);g.allowedChildren=[u.default,l.BlockEmbed,g],n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function v(y,h){for(var d=0;d<h.length;d++){var b=h[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,h,d){return h&&v(y.prototype,h),d&&v(y,d),y}}(),o=function v(y,h,d){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,h);if(b===void 0){var O=Object.getPrototypeOf(y);return O===null?void 0:v(O,h,d)}else{if("value"in b)return b.value;var x=b.get;return x===void 0?void 0:x.call(d)}},l=i(0),u=f(l);function f(v){return v&&v.__esModule?v:{default:v}}function p(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function S(v,y){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:v}function w(v,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);v.prototype=Object.create(y&&y.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(v,y):v.__proto__=y)}var g=function(v){w(y,v);function y(){return p(this,y),S(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"value",value:function(d){var b=o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,d);return b.startsWith("rgb(")?(b=b.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+b.split(",").map(function(O){return("00"+parseInt(O).toString(16)).slice(-2)}).join("")):b}}]),y}(u.default.Attributor.Style),E=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),m=new g("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=g,n.ColorClass=E,n.ColorStyle=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function m(v,y){for(var h=0;h<y.length;h++){var d=y[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(v,d.key,d)}}return function(v,y,h){return y&&m(v.prototype,y),h&&m(v,h),v}}(),o=function m(v,y,h){v===null&&(v=Function.prototype);var d=Object.getOwnPropertyDescriptor(v,y);if(d===void 0){var b=Object.getPrototypeOf(v);return b===null?void 0:m(b,y,h)}else{if("value"in d)return d.value;var O=d.get;return O===void 0?void 0:O.call(h)}},l=i(6),u=f(l);function f(m){return m&&m.__esModule?m:{default:m}}function p(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function S(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function w(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}var g=function(m){w(v,m);function v(){return p(this,v),S(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"format",value:function(h,d){if(h!==this.statics.blotName||!d)return o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,h,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(h){var d=o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,h);return h=this.sanitize(h),d.setAttribute("href",h),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("target","_blank"),d}},{key:"formats",value:function(h){return h.getAttribute("href")}},{key:"sanitize",value:function(h){return E(h,this.PROTOCOL_WHITELIST)?h:this.SANITIZED_URL}}]),v}(u.default);g.blotName="link",g.tagName="A",g.SANITIZED_URL="about:blank",g.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function E(m,v){var y=document.createElement("a");y.href=m;var h=y.href.slice(0,y.href.indexOf(":"));return v.indexOf(h)>-1}n.default=g,n.sanitize=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},o=function(){function v(y,h){for(var d=0;d<h.length;d++){var b=h[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,h,d){return h&&v(y.prototype,h),d&&v(y,d),y}}(),l=i(23),u=S(l),f=i(107),p=S(f);function S(v){return v&&v.__esModule?v:{default:v}}function w(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}var g=0;function E(v,y){v.setAttribute(y,v.getAttribute(y)!=="true")}var m=function(){function v(y){var h=this;w(this,v),this.select=y,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(){h.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case u.default.keys.ENTER:h.togglePicker();break;case u.default.keys.ESCAPE:h.escape(),d.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(v,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),E(this.label,"aria-expanded"),E(this.options,"aria-hidden")}},{key:"buildItem",value:function(h){var d=this,b=document.createElement("span");return b.tabIndex="0",b.setAttribute("role","button"),b.classList.add("ql-picker-item"),h.hasAttribute("value")&&b.setAttribute("data-value",h.getAttribute("value")),h.textContent&&b.setAttribute("data-label",h.textContent),b.addEventListener("click",function(){d.selectItem(b,!0)}),b.addEventListener("keydown",function(O){switch(O.keyCode){case u.default.keys.ENTER:d.selectItem(b,!0),O.preventDefault();break;case u.default.keys.ESCAPE:d.escape(),O.preventDefault();break}}),b}},{key:"buildLabel",value:function(){var h=document.createElement("span");return h.classList.add("ql-picker-label"),h.innerHTML=p.default,h.tabIndex="0",h.setAttribute("role","button"),h.setAttribute("aria-expanded","false"),this.container.appendChild(h),h}},{key:"buildOptions",value:function(){var h=this,d=document.createElement("span");d.classList.add("ql-picker-options"),d.setAttribute("aria-hidden","true"),d.tabIndex="-1",d.id="ql-picker-options-"+g,g+=1,this.label.setAttribute("aria-controls",d.id),this.options=d,[].slice.call(this.select.options).forEach(function(b){var O=h.buildItem(b);d.appendChild(O),b.selected===!0&&h.selectItem(O)}),this.container.appendChild(d)}},{key:"buildPicker",value:function(){var h=this;[].slice.call(this.select.attributes).forEach(function(d){h.container.setAttribute(d.name,d.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var h=this;this.close(),setTimeout(function(){return h.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(h){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,b=this.container.querySelector(".ql-selected");if(h!==b&&(b!=null&&b.classList.remove("ql-selected"),h!=null&&(h.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(h.parentNode.children,h),h.hasAttribute("data-value")?this.label.setAttribute("data-value",h.getAttribute("data-value")):this.label.removeAttribute("data-value"),h.hasAttribute("data-label")?this.label.setAttribute("data-label",h.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 h=void 0;if(this.select.selectedIndex>-1){var d=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];h=this.select.options[this.select.selectedIndex],this.selectItem(d)}else this.selectItem(null);var b=h!=null&&h!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",b)}}]),v}();n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=Y(a),l=i(5),u=Y(l),f=i(4),p=Y(f),S=i(16),w=Y(S),g=i(25),E=Y(g),m=i(24),v=Y(m),y=i(35),h=Y(y),d=i(6),b=Y(d),O=i(22),x=Y(O),P=i(7),_=Y(P),A=i(55),C=Y(A),k=i(42),R=Y(k),D=i(23),U=Y(D);function Y(j){return j&&j.__esModule?j:{default:j}}u.default.register({"blots/block":p.default,"blots/block/embed":f.BlockEmbed,"blots/break":w.default,"blots/container":E.default,"blots/cursor":v.default,"blots/embed":h.default,"blots/inline":b.default,"blots/scroll":x.default,"blots/text":_.default,"modules/clipboard":C.default,"modules/history":R.default,"modules/keyboard":U.default}),o.default.register(p.default,w.default,v.default,b.default,x.default,_.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 p=this.isolate(u,f);p.remove()},l.prototype.formatAt=function(u,f,p,S){var w=this.isolate(u,f);if(a.query(p,a.Scope.BLOT)!=null&&S)w.wrap(p,S);else if(a.query(p,a.Scope.ATTRIBUTE)!=null){var g=a.create(this.statics.scope);w.wrap(g),g.format(p,S)}},l.prototype.insertAt=function(u,f,p){var S=p==null?a.create("text",f):a.create(f,p),w=this.split(u);this.parent.insertBefore(S,w)},l.prototype.insertInto=function(u,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var p=null;u.children.insertBefore(this,f),f!=null&&(p=f.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=p)&&u.domNode.insertBefore(this.domNode,p),this.parent=u,this.attach()},l.prototype.isolate=function(u,f){var p=this.split(u);return p.split(f),p},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 p=typeof u=="string"?a.create(u,f):u;return p.replace(this),p},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 p=typeof u=="string"?a.create(u,f):u;return this.parent!=null&&this.parent.insertBefore(p,this.next),p.appendChild(this),p},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 p(S){this.attributes={},this.domNode=S,this.build()}return p.prototype.attribute=function(S,w){w?S.add(this.domNode,w)&&(S.value(this.domNode)!=null?this.attributes[S.attrName]=S:delete this.attributes[S.attrName]):(S.remove(this.domNode),delete this.attributes[S.attrName])},p.prototype.build=function(){var S=this;this.attributes={};var w=a.default.keys(this.domNode),g=o.default.keys(this.domNode),E=l.default.keys(this.domNode);w.concat(g).concat(E).forEach(function(m){var v=u.query(m,u.Scope.ATTRIBUTE);v instanceof a.default&&(S.attributes[v.attrName]=v)})},p.prototype.copy=function(S){var w=this;Object.keys(this.attributes).forEach(function(g){var E=w.attributes[g].value(w.domNode);S.format(g,E)})},p.prototype.move=function(S){var w=this;this.copy(S),Object.keys(this.attributes).forEach(function(g){w.attributes[g].remove(w.domNode)}),this.attributes={}},p.prototype.values=function(){var S=this;return Object.keys(this.attributes).reduce(function(w,g){return w[g]=S.attributes[g].value(S.domNode),w},{})},p}();n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,S){p.__proto__=S}||function(p,S){for(var w in S)S.hasOwnProperty(w)&&(p[w]=S[w])};return function(p,S){f(p,S);function w(){this.constructor=p}p.prototype=S===null?Object.create(S):(w.prototype=S.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f,p){var S=f.getAttribute("class")||"";return S.split(/\s+/).filter(function(w){return w.indexOf(p+"-")===0})}var u=function(f){a(p,f);function p(){return f!==null&&f.apply(this,arguments)||this}return p.keys=function(S){return(S.getAttribute("class")||"").split(/\s+/).map(function(w){return w.split("-").slice(0,-1).join("-")})},p.prototype.add=function(S,w){return this.canAdd(S,w)?(this.remove(S),S.classList.add(this.keyName+"-"+w),!0):!1},p.prototype.remove=function(S){var w=l(S,this.keyName);w.forEach(function(g){S.classList.remove(g)}),S.classList.length===0&&S.removeAttribute("class")},p.prototype.value=function(S){var w=l(S,this.keyName)[0]||"",g=w.slice(this.keyName.length+1);return this.canAdd(S,g)?g:""},p}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,S){p.__proto__=S}||function(p,S){for(var w in S)S.hasOwnProperty(w)&&(p[w]=S[w])};return function(p,S){f(p,S);function w(){this.constructor=p}p.prototype=S===null?Object.create(S):(w.prototype=S.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f){var p=f.split("-"),S=p.slice(1).map(function(w){return w[0].toUpperCase()+w.slice(1)}).join("");return p[0]+S}var u=function(f){a(p,f);function p(){return f!==null&&f.apply(this,arguments)||this}return p.keys=function(S){return(S.getAttribute("style")||"").split(";").map(function(w){var g=w.split(":");return g[0].trim()})},p.prototype.add=function(S,w){return this.canAdd(S,w)?(S.style[l(this.keyName)]=w,!0):!1},p.prototype.remove=function(S){S.style[l(this.keyName)]="",S.getAttribute("style")||S.removeAttribute("style")},p.prototype.value=function(S){var w=S.style[l(this.keyName)];return this.canAdd(S,w)?w:""},p}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,p){for(var S=0;S<p.length;S++){var w=p[S];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,p,S){return p&&u(f.prototype,p),S&&u(f,S),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,p){o(this,u),this.quill=f,this.options=p,this.modules={}}return a(u,[{key:"init",value:function(){var p=this;Object.keys(this.options.modules).forEach(function(S){p.modules[S]==null&&p.addModule(S)})}},{key:"addModule",value:function(p){var S=this.quill.constructor.import("modules/"+p);return this.modules[p]=new S(this.quill,this.options.modules[p]||{}),this.modules[p]}}]),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 y(h,d){for(var b=0;b<d.length;b++){var O=d[b];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(h,O.key,O)}}return function(h,d,b){return d&&y(h.prototype,d),b&&y(h,b),h}}(),o=function y(h,d,b){h===null&&(h=Function.prototype);var O=Object.getOwnPropertyDescriptor(h,d);if(O===void 0){var x=Object.getPrototypeOf(h);return x===null?void 0:y(x,d,b)}else{if("value"in O)return O.value;var P=O.get;return P===void 0?void 0:P.call(b)}},l=i(0),u=S(l),f=i(7),p=S(f);function S(y){return y&&y.__esModule?y:{default:y}}function w(y,h){if(!(y instanceof h))throw new TypeError("Cannot call a class as a function")}function g(y,h){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:y}function E(y,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);y.prototype=Object.create(h&&h.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(y,h):y.__proto__=h)}var m="\uFEFF",v=function(y){E(h,y);function h(d){w(this,h);var b=g(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,d));return b.contentNode=document.createElement("span"),b.contentNode.setAttribute("contenteditable",!1),[].slice.call(b.domNode.childNodes).forEach(function(O){b.contentNode.appendChild(O)}),b.leftGuard=document.createTextNode(m),b.rightGuard=document.createTextNode(m),b.domNode.appendChild(b.leftGuard),b.domNode.appendChild(b.contentNode),b.domNode.appendChild(b.rightGuard),b}return a(h,[{key:"index",value:function(b,O){return b===this.leftGuard?0:b===this.rightGuard?1:o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"index",this).call(this,b,O)}},{key:"restore",value:function(b){var O=void 0,x=void 0,P=b.data.split(m).join("");if(b===this.leftGuard)if(this.prev instanceof p.default){var _=this.prev.length();this.prev.insertAt(_,P),O={startNode:this.prev.domNode,startOffset:_+P.length}}else x=document.createTextNode(P),this.parent.insertBefore(u.default.create(x),this),O={startNode:x,startOffset:P.length};else b===this.rightGuard&&(this.next instanceof p.default?(this.next.insertAt(0,P),O={startNode:this.next.domNode,startOffset:P.length}):(x=document.createTextNode(P),this.parent.insertBefore(u.default.create(x),this.next),O={startNode:x,startOffset:P.length}));return b.data=m,O}},{key:"update",value:function(b,O){var x=this;b.forEach(function(P){if(P.type==="characterData"&&(P.target===x.leftGuard||P.target===x.rightGuard)){var _=x.restore(P.target);_&&(O.range=_)}})}}]),h}(u.default.Embed);n.default=v},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(w){return w&&w.__esModule?w:{default:w}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new o.default.Attributor.Attribute("align","align",u),p=new o.default.Attributor.Class("align","ql-align",u),S=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=f,n.AlignClass=p,n.AlignStyle=S},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(S){return S&&S.__esModule?S:{default:S}}var f=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),p=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=p},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(w){return w&&w.__esModule?w:{default:w}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},f=new o.default.Attributor.Attribute("direction","dir",u),p=new o.default.Attributor.Class("direction","ql-direction",u),S=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=f,n.DirectionClass=p,n.DirectionStyle=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function y(h,d){for(var b=0;b<d.length;b++){var O=d[b];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(h,O.key,O)}}return function(h,d,b){return d&&y(h.prototype,d),b&&y(h,b),h}}(),o=function y(h,d,b){h===null&&(h=Function.prototype);var O=Object.getOwnPropertyDescriptor(h,d);if(O===void 0){var x=Object.getPrototypeOf(h);return x===null?void 0:y(x,d,b)}else{if("value"in O)return O.value;var P=O.get;return P===void 0?void 0:P.call(b)}},l=i(0),u=f(l);function f(y){return y&&y.__esModule?y:{default:y}}function p(y,h){if(!(y instanceof h))throw new TypeError("Cannot call a class as a function")}function S(y,h){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:y}function w(y,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);y.prototype=Object.create(h&&h.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(y,h):y.__proto__=h)}var g={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},E=new u.default.Attributor.Class("font","ql-font",g),m=function(y){w(h,y);function h(){return p(this,h),S(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return a(h,[{key:"value",value:function(b){return o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",this).call(this,b).replace(/["']/g,"")}}]),h}(u.default.Attributor.Style),v=new m("font","font-family",g);n.FontStyle=v,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(p){return p&&p.__esModule?p:{default:p}}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(b,O){for(var x=0;x<O.length;x++){var P=O[x];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(b,P.key,P)}}return function(b,O,x){return O&&d(b.prototype,O),x&&d(b,x),b}}(),o=i(0),l=w(o),u=i(5),f=w(u),p=i(9),S=w(p);function w(d){return d&&d.__esModule?d:{default:d}}function g(d,b){if(!(d instanceof b))throw new TypeError("Cannot call a class as a function")}function E(d,b){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:d}function m(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);d.prototype=Object.create(b&&b.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(d,b):d.__proto__=b)}var v=function(d){m(b,d);function b(O,x){g(this,b);var P=E(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,O,x));return P.lastRecorded=0,P.ignoreChange=!1,P.clear(),P.quill.on(f.default.events.EDITOR_CHANGE,function(_,A,C,k){_!==f.default.events.TEXT_CHANGE||P.ignoreChange||(!P.options.userOnly||k===f.default.sources.USER?P.record(A,C):P.transform(A))}),P.quill.keyboard.addBinding({key:"Z",shortKey:!0},P.undo.bind(P)),P.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},P.redo.bind(P)),/Win/i.test(navigator.platform)&&P.quill.keyboard.addBinding({key:"Y",shortKey:!0},P.redo.bind(P)),P}return a(b,[{key:"change",value:function(x,P){if(this.stack[x].length!==0){var _=this.stack[x].pop();this.stack[P].push(_),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(_[x],f.default.sources.USER),this.ignoreChange=!1;var A=h(_[x]);this.quill.setSelection(A)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(x,P){if(x.ops.length!==0){this.stack.redo=[];var _=this.quill.getContents().diff(P),A=Date.now();if(this.lastRecorded+this.options.delay>A&&this.stack.undo.length>0){var C=this.stack.undo.pop();_=_.compose(C.undo),x=C.redo.compose(x)}else this.lastRecorded=A;this.stack.undo.push({redo:x,undo:_}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(x){this.stack.undo.forEach(function(P){P.undo=x.transform(P.undo,!0),P.redo=x.transform(P.redo,!0)}),this.stack.redo.forEach(function(P){P.undo=x.transform(P.undo,!0),P.redo=x.transform(P.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),b}(S.default);v.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function y(d){var b=d.ops[d.ops.length-1];return b==null?!1:b.insert!=null?typeof b.insert=="string"&&b.insert.endsWith(`
145
+ `):b.attributes!=null?Object.keys(b.attributes).some(function(O){return l.default.query(O,l.default.Scope.BLOCK)!=null}):!1}function h(d){var b=d.reduce(function(x,P){return x+=P.delete||0,x},0),O=d.length()-b;return y(d)&&(O-=1),O}n.default=v,n.getLastChangeIndex=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function B(M,$){for(var K=0;K<$.length;K++){var V=$[K];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(M,V.key,V)}}return function(M,$,K){return $&&B(M.prototype,$),K&&B(M,K),M}}(),o=function B(M,$,K){M===null&&(M=Function.prototype);var V=Object.getOwnPropertyDescriptor(M,$);if(V===void 0){var H=Object.getPrototypeOf(M);return H===null?void 0:B(H,$,K)}else{if("value"in V)return V.value;var X=V.get;return X===void 0?void 0:X.call(K)}},l=i(3),u=A(l),f=i(2),p=A(f),S=i(8),w=A(S),g=i(23),E=A(g),m=i(34),v=A(m),y=i(59),h=A(y),d=i(60),b=A(d),O=i(28),x=A(O),P=i(61),_=A(P);function A(B){return B&&B.__esModule?B:{default:B}}function C(B,M){if(!(B instanceof M))throw new TypeError("Cannot call a class as a function")}function k(B,M){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:B}function R(B,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);B.prototype=Object.create(M&&M.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(B,M):B.__proto__=M)}var D=[!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"],Y=[!1,"serif","monospace"],j=["1","2","3",!1],G=["small",!1,"large","huge"],z=function(B){R(M,B);function M($,K){C(this,M);var V=k(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,$,K)),H=function X(Z){if(!document.body.contains($.root))return document.body.removeEventListener("click",X);V.tooltip!=null&&!V.tooltip.root.contains(Z.target)&&document.activeElement!==V.tooltip.textbox&&!V.quill.hasFocus()&&V.tooltip.hide(),V.pickers!=null&&V.pickers.forEach(function(J){J.container.contains(Z.target)||J.close()})};return $.emitter.listenDOM("click",document.body,H),V}return a(M,[{key:"addModule",value:function(K){var V=o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"addModule",this).call(this,K);return K==="toolbar"&&this.extendToolbar(V),V}},{key:"buildButtons",value:function(K,V){K.forEach(function(H){var X=H.getAttribute("class")||"";X.split(/\s+/).forEach(function(Z){if(Z.startsWith("ql-")&&(Z=Z.slice(3),V[Z]!=null))if(Z==="direction")H.innerHTML=V[Z][""]+V[Z].rtl;else if(typeof V[Z]=="string")H.innerHTML=V[Z];else{var J=H.value||"";J!=null&&V[Z][J]&&(H.innerHTML=V[Z][J])}})})}},{key:"buildPickers",value:function(K,V){var H=this;this.pickers=K.map(function(Z){if(Z.classList.contains("ql-align"))return Z.querySelector("option")==null&&I(Z,D),new b.default(Z,V.align);if(Z.classList.contains("ql-background")||Z.classList.contains("ql-color")){var J=Z.classList.contains("ql-background")?"background":"color";return Z.querySelector("option")==null&&I(Z,U,J==="background"?"#ffffff":"#000000"),new h.default(Z,V[J])}else return Z.querySelector("option")==null&&(Z.classList.contains("ql-font")?I(Z,Y):Z.classList.contains("ql-header")?I(Z,j):Z.classList.contains("ql-size")&&I(Z,G)),new x.default(Z)});var X=function(){H.pickers.forEach(function(J){J.update()})};this.quill.on(w.default.events.EDITOR_CHANGE,X)}}]),M}(v.default);z.DEFAULTS=(0,u.default)(!0,{},v.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var M=this,$=this.container.querySelector("input.ql-image[type=file]");$==null&&($=document.createElement("input"),$.setAttribute("type","file"),$.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),$.classList.add("ql-image"),$.addEventListener("change",function(){if($.files!=null&&$.files[0]!=null){var K=new FileReader;K.onload=function(V){var H=M.quill.getSelection(!0);M.quill.updateContents(new p.default().retain(H.index).delete(H.length).insert({image:V.target.result}),w.default.sources.USER),M.quill.setSelection(H.index+1,w.default.sources.SILENT),$.value=""},K.readAsDataURL($.files[0])}}),this.container.appendChild($)),$.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var q=function(B){R(M,B);function M($,K){C(this,M);var V=k(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,$,K));return V.textbox=V.root.querySelector('input[type="text"]'),V.listen(),V}return a(M,[{key:"listen",value:function(){var K=this;this.textbox.addEventListener("keydown",function(V){E.default.match(V,"enter")?(K.save(),V.preventDefault()):E.default.match(V,"escape")&&(K.cancel(),V.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),V!=null?this.textbox.value=V:K!==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-"+K)||""),this.root.setAttribute("data-mode",K)}},{key:"restoreFocus",value:function(){var K=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=K}},{key:"save",value:function(){var K=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var V=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",K,w.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",K,w.default.sources.USER)),this.quill.root.scrollTop=V;break}case"video":K=L(K);case"formula":{if(!K)break;var H=this.quill.getSelection(!0);if(H!=null){var X=H.index+H.length;this.quill.insertEmbed(X,this.root.getAttribute("data-mode"),K,w.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(X+1," ",w.default.sources.USER),this.quill.setSelection(X+2,w.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),M}(_.default);function L(B){var M=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 M?(M[1]||"https")+"://www.youtube.com/embed/"+M[2]+"?showinfo=0":(M=B.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(M[1]||"https")+"://player.vimeo.com/video/"+M[2]+"/":B}function I(B,M){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;M.forEach(function(K){var V=document.createElement("option");K===$?V.setAttribute("selected","selected"):V.setAttribute("value",K),B.appendChild(V)})}n.BaseTooltip=q,n.default=z},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,p=this.iterator();f=p();){var S=f.length();if(l<S||u&&l===S&&(f.next==null||f.next.length()!==0))return[f,l];l-=S}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 p=this.find(l),S=p[0],w=p[1],g,E=l-w,m=this.iterator(S);(g=m())&&E<l+u;){var v=g.length();l>E?f(g,l-E,Math.min(u,E+v-l)):f(g,0,Math.min(v,l+u-E)),E+=v}},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,p=this.iterator();f=p();)u=l(u,f);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,g){w.__proto__=g}||function(w,g){for(var E in g)g.hasOwnProperty(E)&&(w[E]=g[E])};return function(w,g){S(w,g);function E(){this.constructor=w}w.prototype=g===null?Object.create(g):(E.prototype=g.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,p=function(S){a(w,S);function w(g){var E=S.call(this,g)||this;return E.scroll=E,E.observer=new MutationObserver(function(m){E.update(m)}),E.observer.observe(E.domNode,u),E.attach(),E}return w.prototype.detach=function(){S.prototype.detach.call(this),this.observer.disconnect()},w.prototype.deleteAt=function(g,E){this.update(),g===0&&E===this.length()?this.children.forEach(function(m){m.remove()}):S.prototype.deleteAt.call(this,g,E)},w.prototype.formatAt=function(g,E,m,v){this.update(),S.prototype.formatAt.call(this,g,E,m,v)},w.prototype.insertAt=function(g,E,m){this.update(),S.prototype.insertAt.call(this,g,E,m)},w.prototype.optimize=function(g,E){var m=this;g===void 0&&(g=[]),E===void 0&&(E={}),S.prototype.optimize.call(this,E);for(var v=[].slice.call(this.observer.takeRecords());v.length>0;)g.push(v.pop());for(var y=function(O,x){x===void 0&&(x=!0),!(O==null||O===m)&&O.domNode.parentNode!=null&&(O.domNode[l.DATA_KEY].mutations==null&&(O.domNode[l.DATA_KEY].mutations=[]),x&&y(O.parent))},h=function(O){O.domNode[l.DATA_KEY]==null||O.domNode[l.DATA_KEY].mutations==null||(O instanceof o.default&&O.children.forEach(h),O.optimize(E))},d=g,b=0;d.length>0;b+=1){if(b>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(O){var x=l.find(O.target,!0);x!=null&&(x.domNode===O.target&&(O.type==="childList"?(y(l.find(O.previousSibling,!1)),[].forEach.call(O.addedNodes,function(P){var _=l.find(P,!1);y(_,!1),_ instanceof o.default&&_.children.forEach(function(A){y(A,!1)})})):O.type==="attributes"&&y(x.prev)),y(x))}),this.children.forEach(h),d=[].slice.call(this.observer.takeRecords()),v=d.slice();v.length>0;)g.push(v.pop())}},w.prototype.update=function(g,E){var m=this;E===void 0&&(E={}),g=g||this.observer.takeRecords(),g.map(function(v){var y=l.find(v.target,!0);return y==null?null:y.domNode[l.DATA_KEY].mutations==null?(y.domNode[l.DATA_KEY].mutations=[v],y):(y.domNode[l.DATA_KEY].mutations.push(v),null)}).forEach(function(v){v==null||v===m||v.domNode[l.DATA_KEY]==null||v.update(v.domNode[l.DATA_KEY].mutations||[],E)}),this.domNode[l.DATA_KEY].mutations!=null&&S.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,E),this.optimize(g,E)},w.blotName="scroll",w.defaultChild="block",w.scope=l.Scope.BLOCK_BLOT,w.tagName="DIV",w}(o.default);n.default=p},function(r,n,i){var a=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,w){S.__proto__=w}||function(S,w){for(var g in w)w.hasOwnProperty(g)&&(S[g]=w[g])};return function(S,w){p(S,w);function g(){this.constructor=S}S.prototype=w===null?Object.create(w):(g.prototype=w.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function u(p,S){if(Object.keys(p).length!==Object.keys(S).length)return!1;for(var w in p)if(p[w]!==S[w])return!1;return!0}var f=function(p){a(S,p);function S(){return p!==null&&p.apply(this,arguments)||this}return S.formats=function(w){if(w.tagName!==S.tagName)return p.formats.call(this,w)},S.prototype.format=function(w,g){var E=this;w===this.statics.blotName&&!g?(this.children.forEach(function(m){m instanceof o.default||(m=m.wrap(S.blotName,!0)),E.attributes.copy(m)}),this.unwrap()):p.prototype.format.call(this,w,g)},S.prototype.formatAt=function(w,g,E,m){if(this.formats()[E]!=null||l.query(E,l.Scope.ATTRIBUTE)){var v=this.isolate(w,g);v.format(E,m)}else p.prototype.formatAt.call(this,w,g,E,m)},S.prototype.optimize=function(w){p.prototype.optimize.call(this,w);var g=this.formats();if(Object.keys(g).length===0)return this.unwrap();var E=this.next;E instanceof S&&E.prev===this&&u(g,E.formats())&&(E.moveChildren(this),E.remove())},S.blotName="inline",S.scope=l.Scope.INLINE_BLOT,S.tagName="SPAN",S}(o.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,S){p.__proto__=S}||function(p,S){for(var w in S)S.hasOwnProperty(w)&&(p[w]=S[w])};return function(p,S){f(p,S);function w(){this.constructor=p}p.prototype=S===null?Object.create(S):(w.prototype=S.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1),u=function(f){a(p,f);function p(){return f!==null&&f.apply(this,arguments)||this}return p.formats=function(S){var w=l.query(p.blotName).tagName;if(S.tagName!==w)return f.formats.call(this,S)},p.prototype.format=function(S,w){l.query(S,l.Scope.BLOCK)!=null&&(S===this.statics.blotName&&!w?this.replaceWith(p.blotName):f.prototype.format.call(this,S,w))},p.prototype.formatAt=function(S,w,g,E){l.query(g,l.Scope.BLOCK)!=null?this.format(g,E):f.prototype.formatAt.call(this,S,w,g,E)},p.prototype.insertAt=function(S,w,g){if(g==null||l.query(w,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,S,w,g);else{var E=this.split(S),m=l.create(w,g);E.parent.insertBefore(m,E)}},p.prototype.update=function(S,w){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,S,w)},p.blotName="block",p.scope=l.Scope.BLOCK_BLOT,p.tagName="P",p}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,p){f.__proto__=p}||function(f,p){for(var S in p)p.hasOwnProperty(S)&&(f[S]=p[S])};return function(f,p){u(f,p);function S(){this.constructor=f}f.prototype=p===null?Object.create(p):(S.prototype=p.prototype,new S)}}();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(p){},f.prototype.format=function(p,S){u.prototype.formatAt.call(this,0,this.length(),p,S)},f.prototype.formatAt=function(p,S,w,g){p===0&&S===this.length()?this.format(w,g):u.prototype.formatAt.call(this,p,S,w,g)},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(p,S){p.__proto__=S}||function(p,S){for(var w in S)S.hasOwnProperty(w)&&(p[w]=S[w])};return function(p,S){f(p,S);function w(){this.constructor=p}p.prototype=S===null?Object.create(S):(w.prototype=S.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=i(1),u=function(f){a(p,f);function p(S){var w=f.call(this,S)||this;return w.text=w.statics.value(w.domNode),w}return p.create=function(S){return document.createTextNode(S)},p.value=function(S){var w=S.data;return w.normalize&&(w=w.normalize()),w},p.prototype.deleteAt=function(S,w){this.domNode.data=this.text=this.text.slice(0,S)+this.text.slice(S+w)},p.prototype.index=function(S,w){return this.domNode===S?w:-1},p.prototype.insertAt=function(S,w,g){g==null?(this.text=this.text.slice(0,S)+w+this.text.slice(S),this.domNode.data=this.text):f.prototype.insertAt.call(this,S,w,g)},p.prototype.length=function(){return this.text.length},p.prototype.optimize=function(S){f.prototype.optimize.call(this,S),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof p&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},p.prototype.position=function(S,w){return[this.domNode,S]},p.prototype.split=function(S,w){if(w===void 0&&(w=!1),!w){if(S===0)return this;if(S===this.length())return this.next}var g=l.create(this.domNode.splitText(S));return this.parent.insertBefore(g,this.next),this.text=this.statics.value(this.domNode),g},p.prototype.update=function(S,w){var g=this;S.some(function(E){return E.type==="characterData"&&E.target===g.domNode})&&(this.text=this.statics.value(this.domNode))},p.prototype.value=function(){return this.text},p.blotName="text",p.scope=l.Scope.INLINE_BLOT,p}(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 p=f.indexOf(l,u);return p!==-1&&p===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),p=f.length>>>0,S=arguments[1],w,g=0;g<p;g++)if(w=f[g],u.call(S,w,g,f))return w}}),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(b,O,x){if(b==O)return b?[[o,b]]:[];(x<0||b.length<x)&&(x=null);var P=S(b,O),_=b.substring(0,P);b=b.substring(P),O=O.substring(P),P=w(b,O);var A=b.substring(b.length-P);b=b.substring(0,b.length-P),O=O.substring(0,O.length-P);var C=u(b,O);return _&&C.unshift([o,_]),A&&C.push([o,A]),E(C),x!=null&&(C=y(C,x)),C=h(C),C}function u(b,O){var x;if(!b)return[[a,O]];if(!O)return[[i,b]];var P=b.length>O.length?b:O,_=b.length>O.length?O:b,A=P.indexOf(_);if(A!=-1)return x=[[a,P.substring(0,A)],[o,_],[a,P.substring(A+_.length)]],b.length>O.length&&(x[0][0]=x[2][0]=i),x;if(_.length==1)return[[i,b],[a,O]];var C=g(b,O);if(C){var k=C[0],R=C[1],D=C[2],U=C[3],Y=C[4],j=l(k,D),G=l(R,U);return j.concat([[o,Y]],G)}return f(b,O)}function f(b,O){for(var x=b.length,P=O.length,_=Math.ceil((x+P)/2),A=_,C=2*_,k=new Array(C),R=new Array(C),D=0;D<C;D++)k[D]=-1,R[D]=-1;k[A+1]=0,R[A+1]=0;for(var U=x-P,Y=U%2!=0,j=0,G=0,z=0,q=0,L=0;L<_;L++){for(var I=-L+j;I<=L-G;I+=2){var B=A+I,M;I==-L||I!=L&&k[B-1]<k[B+1]?M=k[B+1]:M=k[B-1]+1;for(var $=M-I;M<x&&$<P&&b.charAt(M)==O.charAt($);)M++,$++;if(k[B]=M,M>x)G+=2;else if($>P)j+=2;else if(Y){var K=A+U-I;if(K>=0&&K<C&&R[K]!=-1){var V=x-R[K];if(M>=V)return p(b,O,M,$)}}}for(var H=-L+z;H<=L-q;H+=2){var K=A+H,V;H==-L||H!=L&&R[K-1]<R[K+1]?V=R[K+1]:V=R[K-1]+1;for(var X=V-H;V<x&&X<P&&b.charAt(x-V-1)==O.charAt(P-X-1);)V++,X++;if(R[K]=V,V>x)q+=2;else if(X>P)z+=2;else if(!Y){var B=A+U-H;if(B>=0&&B<C&&k[B]!=-1){var M=k[B],$=A+M-B;if(V=x-V,M>=V)return p(b,O,M,$)}}}}return[[i,b],[a,O]]}function p(b,O,x,P){var _=b.substring(0,x),A=O.substring(0,P),C=b.substring(x),k=O.substring(P),R=l(_,A),D=l(C,k);return R.concat(D)}function S(b,O){if(!b||!O||b.charAt(0)!=O.charAt(0))return 0;for(var x=0,P=Math.min(b.length,O.length),_=P,A=0;x<_;)b.substring(A,_)==O.substring(A,_)?(x=_,A=x):P=_,_=Math.floor((P-x)/2+x);return _}function w(b,O){if(!b||!O||b.charAt(b.length-1)!=O.charAt(O.length-1))return 0;for(var x=0,P=Math.min(b.length,O.length),_=P,A=0;x<_;)b.substring(b.length-_,b.length-A)==O.substring(O.length-_,O.length-A)?(x=_,A=x):P=_,_=Math.floor((P-x)/2+x);return _}function g(b,O){var x=b.length>O.length?b:O,P=b.length>O.length?O:b;if(x.length<4||P.length*2<x.length)return null;function _(G,z,q){for(var L=G.substring(q,q+Math.floor(G.length/4)),I=-1,B="",M,$,K,V;(I=z.indexOf(L,I+1))!=-1;){var H=S(G.substring(q),z.substring(I)),X=w(G.substring(0,q),z.substring(0,I));B.length<X+H&&(B=z.substring(I-X,I)+z.substring(I,I+H),M=G.substring(0,q-X),$=G.substring(q+H),K=z.substring(0,I-X),V=z.substring(I+H))}return B.length*2>=G.length?[M,$,K,V,B]:null}var A=_(x,P,Math.ceil(x.length/4)),C=_(x,P,Math.ceil(x.length/2)),k;if(!A&&!C)return null;C?A?k=A[4].length>C[4].length?A:C:k=C:k=A;var R,D,U,Y;b.length>O.length?(R=k[0],D=k[1],U=k[2],Y=k[3]):(U=k[0],Y=k[1],R=k[2],D=k[3]);var j=k[4];return[R,D,U,Y,j]}function E(b){b.push([o,""]);for(var O=0,x=0,P=0,_="",A="",C;O<b.length;)switch(b[O][0]){case a:P++,A+=b[O][1],O++;break;case i:x++,_+=b[O][1],O++;break;case o:x+P>1?(x!==0&&P!==0&&(C=S(A,_),C!==0&&(O-x-P>0&&b[O-x-P-1][0]==o?b[O-x-P-1][1]+=A.substring(0,C):(b.splice(0,0,[o,A.substring(0,C)]),O++),A=A.substring(C),_=_.substring(C)),C=w(A,_),C!==0&&(b[O][1]=A.substring(A.length-C)+b[O][1],A=A.substring(0,A.length-C),_=_.substring(0,_.length-C))),x===0?b.splice(O-P,x+P,[a,A]):P===0?b.splice(O-x,x+P,[i,_]):b.splice(O-x-P,x+P,[i,_],[a,A]),O=O-x-P+(x?1:0)+(P?1:0)+1):O!==0&&b[O-1][0]==o?(b[O-1][1]+=b[O][1],b.splice(O,1)):O++,P=0,x=0,_="",A="";break}b[b.length-1][1]===""&&b.pop();var k=!1;for(O=1;O<b.length-1;)b[O-1][0]==o&&b[O+1][0]==o&&(b[O][1].substring(b[O][1].length-b[O-1][1].length)==b[O-1][1]?(b[O][1]=b[O-1][1]+b[O][1].substring(0,b[O][1].length-b[O-1][1].length),b[O+1][1]=b[O-1][1]+b[O+1][1],b.splice(O-1,1),k=!0):b[O][1].substring(0,b[O+1][1].length)==b[O+1][1]&&(b[O-1][1]+=b[O+1][1],b[O][1]=b[O][1].substring(b[O+1][1].length)+b[O+1][1],b.splice(O+1,1),k=!0)),O++;k&&E(b)}var m=l;m.INSERT=a,m.DELETE=i,m.EQUAL=o,r.exports=m;function v(b,O){if(O===0)return[o,b];for(var x=0,P=0;P<b.length;P++){var _=b[P];if(_[0]===i||_[0]===o){var A=x+_[1].length;if(O===A)return[P+1,b];if(O<A){b=b.slice();var C=O-x,k=[_[0],_[1].slice(0,C)],R=[_[0],_[1].slice(C)];return b.splice(P,1,k,R),[P+1,b]}else x=A}}throw new Error("cursor_pos is out of bounds!")}function y(b,O){var x=v(b,O),P=x[1],_=x[0],A=P[_],C=P[_+1];if(A==null)return b;if(A[0]!==o)return b;if(C!=null&&A[1]+C[1]===C[1]+A[1])return P.splice(_,2,C,A),d(P,_,2);if(C!=null&&C[1].indexOf(A[1])===0){P.splice(_,2,[C[0],A[1]],[0,A[1]]);var k=C[1].slice(A[1].length);return k.length>0&&P.splice(_+2,0,[C[0],k]),d(P,_,3)}else return b}function h(b){for(var O=!1,x=function(C){return C.charCodeAt(0)>=56320&&C.charCodeAt(0)<=57343},P=function(C){return C.charCodeAt(C.length-1)>=55296&&C.charCodeAt(C.length-1)<=56319},_=2;_<b.length;_+=1)b[_-2][0]===o&&P(b[_-2][1])&&b[_-1][0]===i&&x(b[_-1][1])&&b[_][0]===a&&x(b[_][1])&&(O=!0,b[_-1][1]=b[_-2][1].slice(-1)+b[_-1][1],b[_][1]=b[_-2][1].slice(-1)+b[_][1],b[_-2][1]=b[_-2][1].slice(0,-1));if(!O)return b;for(var A=[],_=0;_<b.length;_+=1)b[_][1].length>0&&A.push(b[_]);return A}function d(b,O,x){for(var P=O+x-1;P>=0&&P>=O-1;P--)if(P+1<b.length){var _=b[P],A=b[P+1];_[0]===A[1]&&b.splice(P,2,[_[0],_[1]+A[1]])}return b}},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,p,S){this.fn=f,this.context=p,this.once=S||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var p=[],S,w;if(this._eventsCount===0)return p;for(w in S=this._events)i.call(S,w)&&p.push(a?w.slice(1):w);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(S)):p},u.prototype.listeners=function(p,S){var w=a?a+p:p,g=this._events[w];if(S)return!!g;if(!g)return[];if(g.fn)return[g.fn];for(var E=0,m=g.length,v=new Array(m);E<m;E++)v[E]=g[E].fn;return v},u.prototype.emit=function(p,S,w,g,E,m){var v=a?a+p:p;if(!this._events[v])return!1;var y=this._events[v],h=arguments.length,d,b;if(y.fn){switch(y.once&&this.removeListener(p,y.fn,void 0,!0),h){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,S),!0;case 3:return y.fn.call(y.context,S,w),!0;case 4:return y.fn.call(y.context,S,w,g),!0;case 5:return y.fn.call(y.context,S,w,g,E),!0;case 6:return y.fn.call(y.context,S,w,g,E,m),!0}for(b=1,d=new Array(h-1);b<h;b++)d[b-1]=arguments[b];y.fn.apply(y.context,d)}else{var O=y.length,x;for(b=0;b<O;b++)switch(y[b].once&&this.removeListener(p,y[b].fn,void 0,!0),h){case 1:y[b].fn.call(y[b].context);break;case 2:y[b].fn.call(y[b].context,S);break;case 3:y[b].fn.call(y[b].context,S,w);break;case 4:y[b].fn.call(y[b].context,S,w,g);break;default:if(!d)for(x=1,d=new Array(h-1);x<h;x++)d[x-1]=arguments[x];y[b].fn.apply(y[b].context,d)}}return!0},u.prototype.on=function(p,S,w){var g=new l(S,w||this),E=a?a+p:p;return this._events[E]?this._events[E].fn?this._events[E]=[this._events[E],g]:this._events[E].push(g):(this._events[E]=g,this._eventsCount++),this},u.prototype.once=function(p,S,w){var g=new l(S,w||this,!0),E=a?a+p:p;return this._events[E]?this._events[E].fn?this._events[E]=[this._events[E],g]:this._events[E].push(g):(this._events[E]=g,this._eventsCount++),this},u.prototype.removeListener=function(p,S,w,g){var E=a?a+p:p;if(!this._events[E])return this;if(!S)return--this._eventsCount===0?this._events=new o:delete this._events[E],this;var m=this._events[E];if(m.fn)m.fn===S&&(!g||m.once)&&(!w||m.context===w)&&(--this._eventsCount===0?this._events=new o:delete this._events[E]);else{for(var v=0,y=[],h=m.length;v<h;v++)(m[v].fn!==S||g&&!m[v].once||w&&m[v].context!==w)&&y.push(m[v]);y.length?this._events[E]=y.length===1?y[0]:y:--this._eventsCount===0?this._events=new o:delete this._events[E]}return this},u.prototype.removeAllListeners=function(p){var S;return p?(S=a?a+p:p,this._events[S]&&(--this._eventsCount===0?this._events=new o:delete this._events[S])):(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,ve){var ge=[],te=!0,ue=!1,be=void 0;try{for(var se=ie[Symbol.iterator](),Pe;!(te=(Pe=se.next()).done)&&(ge.push(Pe.value),!(ve&&ge.length===ve));te=!0);}catch(xe){ue=!0,be=xe}finally{try{!te&&se.return&&se.return()}finally{if(ue)throw be}}return ge}return function(ie,ve){if(Array.isArray(ie))return ie;if(Symbol.iterator in Object(ie))return fe(ie,ve);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function fe(ie,ve){for(var ge=0;ge<ve.length;ge++){var te=ve[ge];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(ie,te.key,te)}}return function(ie,ve,ge){return ve&&fe(ie.prototype,ve),ge&&fe(ie,ge),ie}}(),u=i(3),f=R(u),p=i(2),S=R(p),w=i(0),g=R(w),E=i(5),m=R(E),v=i(10),y=R(v),h=i(9),d=R(h),b=i(36),O=i(37),x=i(13),P=R(x),_=i(26),A=i(38),C=i(39),k=i(40);function R(fe){return fe&&fe.__esModule?fe:{default:fe}}function D(fe,ie,ve){return ie in fe?Object.defineProperty(fe,ie,{value:ve,enumerable:!0,configurable:!0,writable:!0}):fe[ie]=ve,fe}function U(fe,ie){if(!(fe instanceof ie))throw new TypeError("Cannot call a class as a function")}function Y(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 j(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 G=(0,y.default)("quill:clipboard"),z="__ql-matcher",q=[[Node.TEXT_NODE,Fe],[Node.TEXT_NODE,de],["br",ee],[Node.ELEMENT_NODE,de],[Node.ELEMENT_NODE,J],[Node.ELEMENT_NODE,pe],[Node.ELEMENT_NODE,Z],[Node.ELEMENT_NODE,Me],["li",ne],["b",X.bind(X,"bold")],["i",X.bind(X,"italic")],["style",re]],L=[b.AlignAttribute,A.DirectionAttribute].reduce(function(fe,ie){return fe[ie.keyName]=ie,fe},{}),I=[b.AlignStyle,O.BackgroundStyle,_.ColorStyle,A.DirectionStyle,C.FontStyle,k.SizeStyle].reduce(function(fe,ie){return fe[ie.keyName]=ie,fe},{}),B=function(fe){j(ie,fe);function ie(ve,ge){U(this,ie);var te=Y(this,(ie.__proto__||Object.getPrototypeOf(ie)).call(this,ve,ge));return te.quill.root.addEventListener("paste",te.onPaste.bind(te)),te.container=te.quill.addContainer("ql-clipboard"),te.container.setAttribute("contenteditable",!0),te.container.setAttribute("tabindex",-1),te.matchers=[],q.concat(te.options.matchers).forEach(function(ue){var be=o(ue,2),se=be[0],Pe=be[1];!ge.matchVisual&&Pe===pe||te.addMatcher(se,Pe)}),te}return l(ie,[{key:"addMatcher",value:function(ge,te){this.matchers.push([ge,te])}},{key:"convert",value:function(ge){if(typeof ge=="string")return this.container.innerHTML=ge.replace(/\>\r?\n +\</g,"><"),this.convert();var te=this.quill.getFormat(this.quill.selection.savedRange.index);if(te[P.default.blotName]){var ue=this.container.innerText;return this.container.innerHTML="",new S.default().insert(ue,D({},P.default.blotName,te[P.default.blotName]))}var be=this.prepareMatching(),se=o(be,2),Pe=se[0],xe=se[1],Ie=H(this.container,Pe,xe);return K(Ie,`
146
+ `)&&Ie.ops[Ie.ops.length-1].attributes==null&&(Ie=Ie.compose(new S.default().retain(Ie.length()-1).delete(1))),G.log("convert",this.container.innerHTML,Ie),this.container.innerHTML="",Ie}},{key:"dangerouslyPasteHTML",value:function(ge,te){var ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.default.sources.API;if(typeof ge=="string")this.quill.setContents(this.convert(ge),te),this.quill.setSelection(0,m.default.sources.SILENT);else{var be=this.convert(te);this.quill.updateContents(new S.default().retain(ge).concat(be),ue),this.quill.setSelection(ge+be.length(),m.default.sources.SILENT)}}},{key:"onPaste",value:function(ge){var te=this;if(!(ge.defaultPrevented||!this.quill.isEnabled())){var ue=this.quill.getSelection(),be=new S.default().retain(ue.index),se=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(m.default.sources.SILENT),setTimeout(function(){be=be.concat(te.convert()).delete(ue.length),te.quill.updateContents(be,m.default.sources.USER),te.quill.setSelection(be.length()-ue.length,m.default.sources.SILENT),te.quill.scrollingContainer.scrollTop=se,te.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var ge=this,te=[],ue=[];return this.matchers.forEach(function(be){var se=o(be,2),Pe=se[0],xe=se[1];switch(Pe){case Node.TEXT_NODE:ue.push(xe);break;case Node.ELEMENT_NODE:te.push(xe);break;default:[].forEach.call(ge.container.querySelectorAll(Pe),function(Ie){Ie[z]=Ie[z]||[],Ie[z].push(xe)});break}}),[te,ue]}}]),ie}(d.default);B.DEFAULTS={matchers:[],matchVisual:!0};function M(fe,ie,ve){return(typeof ie>"u"?"undefined":a(ie))==="object"?Object.keys(ie).reduce(function(ge,te){return M(ge,te,ie[te])},fe):fe.reduce(function(ge,te){return te.attributes&&te.attributes[ie]?ge.push(te):ge.insert(te.insert,(0,f.default)({},D({},ie,ve),te.attributes))},new S.default)}function $(fe){if(fe.nodeType!==Node.ELEMENT_NODE)return{};var ie="__ql-computed-style";return fe[ie]||(fe[ie]=window.getComputedStyle(fe))}function K(fe,ie){for(var ve="",ge=fe.ops.length-1;ge>=0&&ve.length<ie.length;--ge){var te=fe.ops[ge];if(typeof te.insert!="string")break;ve=te.insert+ve}return ve.slice(-1*ie.length)===ie}function V(fe){if(fe.childNodes.length===0)return!1;var ie=$(fe);return["block","list-item"].indexOf(ie.display)>-1}function H(fe,ie,ve){return fe.nodeType===fe.TEXT_NODE?ve.reduce(function(ge,te){return te(fe,ge)},new S.default):fe.nodeType===fe.ELEMENT_NODE?[].reduce.call(fe.childNodes||[],function(ge,te){var ue=H(te,ie,ve);return te.nodeType===fe.ELEMENT_NODE&&(ue=ie.reduce(function(be,se){return se(te,be)},ue),ue=(te[z]||[]).reduce(function(be,se){return se(te,be)},ue)),ge.concat(ue)},new S.default):new S.default}function X(fe,ie,ve){return M(ve,fe,!0)}function Z(fe,ie){var ve=g.default.Attributor.Attribute.keys(fe),ge=g.default.Attributor.Class.keys(fe),te=g.default.Attributor.Style.keys(fe),ue={};return ve.concat(ge).concat(te).forEach(function(be){var se=g.default.query(be,g.default.Scope.ATTRIBUTE);se!=null&&(ue[se.attrName]=se.value(fe),ue[se.attrName])||(se=L[be],se!=null&&(se.attrName===be||se.keyName===be)&&(ue[se.attrName]=se.value(fe)||void 0),se=I[be],se!=null&&(se.attrName===be||se.keyName===be)&&(se=I[be],ue[se.attrName]=se.value(fe)||void 0))}),Object.keys(ue).length>0&&(ie=M(ie,ue)),ie}function J(fe,ie){var ve=g.default.query(fe);if(ve==null)return ie;if(ve.prototype instanceof g.default.Embed){var ge={},te=ve.value(fe);te!=null&&(ge[ve.blotName]=te,ie=new S.default().insert(ge,ve.formats(fe)))}else typeof ve.formats=="function"&&(ie=M(ie,ve.blotName,ve.formats(fe)));return ie}function ee(fe,ie){return K(ie,`
147
+ `)||ie.insert(`
148
+ `),ie}function re(){return new S.default}function ne(fe,ie){var ve=g.default.query(fe);if(ve==null||ve.blotName!=="list-item"||!K(ie,`
149
+ `))return ie;for(var ge=-1,te=fe.parentNode;!te.classList.contains("ql-clipboard");)(g.default.query(te)||{}).blotName==="list"&&(ge+=1),te=te.parentNode;return ge<=0?ie:ie.compose(new S.default().retain(ie.length()-1).retain(1,{indent:ge}))}function de(fe,ie){return K(ie,`
150
+ `)||(V(fe)||ie.length()>0&&fe.nextSibling&&V(fe.nextSibling))&&ie.insert(`
151
+ `),ie}function pe(fe,ie){if(V(fe)&&fe.nextElementSibling!=null&&!K(ie,`
152
+
153
+ `)){var ve=fe.offsetHeight+parseFloat($(fe).marginTop)+parseFloat($(fe).marginBottom);fe.nextElementSibling.offsetTop>fe.offsetTop+ve*1.5&&ie.insert(`
154
+ `)}return ie}function Me(fe,ie){var ve={},ge=fe.style||{};return ge.fontStyle&&$(fe).fontStyle==="italic"&&(ve.italic=!0),ge.fontWeight&&($(fe).fontWeight.startsWith("bold")||parseInt($(fe).fontWeight)>=700)&&(ve.bold=!0),Object.keys(ve).length>0&&(ie=M(ie,ve)),parseFloat(ge.textIndent||0)>0&&(ie=new S.default().insert(" ").concat(ie)),ie}function Fe(fe,ie){var ve=fe.data;if(fe.parentNode.tagName==="O:P")return ie.insert(ve.trim());if(ve.trim().length===0&&fe.parentNode.classList.contains("ql-clipboard"))return ie;if(!$(fe.parentNode).whiteSpace.startsWith("pre")){var ge=function(ue,be){return be=be.replace(/[^\u00a0]/g,""),be.length<1&&ue?" ":be};ve=ve.replace(/\r\n/g," ").replace(/\n/g," "),ve=ve.replace(/\s\s+/g,ge.bind(ge,!0)),(fe.previousSibling==null&&V(fe.parentNode)||fe.previousSibling!=null&&V(fe.previousSibling))&&(ve=ve.replace(/^\s+/,ge.bind(ge,!1))),(fe.nextSibling==null&&V(fe.parentNode)||fe.nextSibling!=null&&V(fe.nextSibling))&&(ve=ve.replace(/\s+$/,ge.bind(ge,!1)))}return ie.insert(ve)}n.default=B,n.matchAttributor=Z,n.matchBlot=J,n.matchNewline=de,n.matchSpacing=pe,n.matchText=Fe},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(m,v){for(var y=0;y<v.length;y++){var h=v[y];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(m,h.key,h)}}return function(m,v,y){return v&&E(m.prototype,v),y&&E(m,y),m}}(),o=function E(m,v,y){m===null&&(m=Function.prototype);var h=Object.getOwnPropertyDescriptor(m,v);if(h===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:E(d,v,y)}else{if("value"in h)return h.value;var b=h.get;return b===void 0?void 0:b.call(y)}},l=i(6),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function p(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function S(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function w(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var g=function(E){w(m,E);function m(){return p(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"optimize",value:function(y){o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"optimize",this).call(this,y),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),m}(u.default);g.blotName="bold",g.tagName=["STRONG","B"],n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=function(){function k(R,D){var U=[],Y=!0,j=!1,G=void 0;try{for(var z=R[Symbol.iterator](),q;!(Y=(q=z.next()).done)&&(U.push(q.value),!(D&&U.length===D));Y=!0);}catch(L){j=!0,G=L}finally{try{!Y&&z.return&&z.return()}finally{if(j)throw G}}return U}return function(R,D){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return k(R,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function k(R,D){for(var U=0;U<D.length;U++){var Y=D[U];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(R,Y.key,Y)}}return function(R,D,U){return D&&k(R.prototype,D),U&&k(R,U),R}}(),l=i(2),u=y(l),f=i(0),p=y(f),S=i(5),w=y(S),g=i(10),E=y(g),m=i(9),v=y(m);function y(k){return k&&k.__esModule?k:{default:k}}function h(k,R,D){return R in k?Object.defineProperty(k,R,{value:D,enumerable:!0,configurable:!0,writable:!0}):k[R]=D,k}function d(k,R){if(!(k instanceof R))throw new TypeError("Cannot call a class as a function")}function b(k,R){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:k}function O(k,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);k.prototype=Object.create(R&&R.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(k,R):k.__proto__=R)}var x=(0,E.default)("quill:toolbar"),P=function(k){O(R,k);function R(D,U){d(this,R);var Y=b(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,D,U));if(Array.isArray(Y.options.container)){var j=document.createElement("div");A(j,Y.options.container),D.container.parentNode.insertBefore(j,D.container),Y.container=j}else typeof Y.options.container=="string"?Y.container=document.querySelector(Y.options.container):Y.container=Y.options.container;if(!(Y.container instanceof HTMLElement)){var G;return G=x.error("Container required for toolbar",Y.options),b(Y,G)}return Y.container.classList.add("ql-toolbar"),Y.controls=[],Y.handlers={},Object.keys(Y.options.handlers).forEach(function(z){Y.addHandler(z,Y.options.handlers[z])}),[].forEach.call(Y.container.querySelectorAll("button, select"),function(z){Y.attach(z)}),Y.quill.on(w.default.events.EDITOR_CHANGE,function(z,q){z===w.default.events.SELECTION_CHANGE&&Y.update(q)}),Y.quill.on(w.default.events.SCROLL_OPTIMIZE,function(){var z=Y.quill.selection.getRange(),q=a(z,1),L=q[0];Y.update(L)}),Y}return o(R,[{key:"addHandler",value:function(U,Y){this.handlers[U]=Y}},{key:"attach",value:function(U){var Y=this,j=[].find.call(U.classList,function(z){return z.indexOf("ql-")===0});if(j){if(j=j.slice(3),U.tagName==="BUTTON"&&U.setAttribute("type","button"),this.handlers[j]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[j]==null){x.warn("ignoring attaching to disabled format",j,U);return}if(p.default.query(j)==null){x.warn("ignoring attaching to nonexistent format",j,U);return}}var G=U.tagName==="SELECT"?"change":"click";U.addEventListener(G,function(z){var q=void 0;if(U.tagName==="SELECT"){if(U.selectedIndex<0)return;var L=U.options[U.selectedIndex];L.hasAttribute("selected")?q=!1:q=L.value||!1}else U.classList.contains("ql-active")?q=!1:q=U.value||!U.hasAttribute("value"),z.preventDefault();Y.quill.focus();var I=Y.quill.selection.getRange(),B=a(I,1),M=B[0];if(Y.handlers[j]!=null)Y.handlers[j].call(Y,q);else if(p.default.query(j).prototype instanceof p.default.Embed){if(q=prompt("Enter "+j),!q)return;Y.quill.updateContents(new u.default().retain(M.index).delete(M.length).insert(h({},j,q)),w.default.sources.USER)}else Y.quill.format(j,q,w.default.sources.USER);Y.update(M)}),this.controls.push([j,U])}}},{key:"update",value:function(U){var Y=U==null?{}:this.quill.getFormat(U);this.controls.forEach(function(j){var G=a(j,2),z=G[0],q=G[1];if(q.tagName==="SELECT"){var L=void 0;if(U==null)L=null;else if(Y[z]==null)L=q.querySelector("option[selected]");else if(!Array.isArray(Y[z])){var I=Y[z];typeof I=="string"&&(I=I.replace(/\"/g,'\\"')),L=q.querySelector('option[value="'+I+'"]')}L==null?(q.value="",q.selectedIndex=-1):L.selected=!0}else if(U==null)q.classList.remove("ql-active");else if(q.hasAttribute("value")){var B=Y[z]===q.getAttribute("value")||Y[z]!=null&&Y[z].toString()===q.getAttribute("value")||Y[z]==null&&!q.getAttribute("value");q.classList.toggle("ql-active",B)}else q.classList.toggle("ql-active",Y[z]!=null)})}}]),R}(v.default);P.DEFAULTS={};function _(k,R,D){var U=document.createElement("button");U.setAttribute("type","button"),U.classList.add("ql-"+R),D!=null&&(U.value=D),k.appendChild(U)}function A(k,R){Array.isArray(R[0])||(R=[R]),R.forEach(function(D){var U=document.createElement("span");U.classList.add("ql-formats"),D.forEach(function(Y){if(typeof Y=="string")_(U,Y);else{var j=Object.keys(Y)[0],G=Y[j];Array.isArray(G)?C(U,j,G):_(U,j,G)}}),k.appendChild(U)})}function C(k,R,D){var U=document.createElement("select");U.classList.add("ql-"+R),D.forEach(function(Y){var j=document.createElement("option");Y!==!1?j.setAttribute("value",Y):j.setAttribute("selected","selected"),U.appendChild(j)}),k.appendChild(U)}P.DEFAULTS={container:null,handlers:{clean:function(){var R=this,D=this.quill.getSelection();if(D!=null)if(D.length==0){var U=this.quill.getFormat();Object.keys(U).forEach(function(Y){p.default.query(Y,p.default.Scope.INLINE)!=null&&R.quill.format(Y,!1)})}else this.quill.removeFormat(D,w.default.sources.USER)},direction:function(R){var D=this.quill.getFormat().align;R==="rtl"&&D==null?this.quill.format("align","right",w.default.sources.USER):!R&&D==="right"&&this.quill.format("align",!1,w.default.sources.USER),this.quill.format("direction",R,w.default.sources.USER)},indent:function(R){var D=this.quill.getSelection(),U=this.quill.getFormat(D),Y=parseInt(U.indent||0);if(R==="+1"||R==="-1"){var j=R==="+1"?1:-1;U.direction==="rtl"&&(j*=-1),this.quill.format("indent",Y+j,w.default.sources.USER)}},link:function(R){R===!0&&(R=prompt("Enter link URL:")),this.quill.format("link",R,w.default.sources.USER)},list:function(R){var D=this.quill.getSelection(),U=this.quill.getFormat(D);R==="check"?U.list==="checked"||U.list==="unchecked"?this.quill.format("list",!1,w.default.sources.USER):this.quill.format("list","unchecked",w.default.sources.USER):this.quill.format("list",R,w.default.sources.USER)}}},n.default=P,n.addControls=A},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(m,v){for(var y=0;y<v.length;y++){var h=v[y];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(m,h.key,h)}}return function(m,v,y){return v&&E(m.prototype,v),y&&E(m,y),m}}(),o=function E(m,v,y){m===null&&(m=Function.prototype);var h=Object.getOwnPropertyDescriptor(m,v);if(h===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:E(d,v,y)}else{if("value"in h)return h.value;var b=h.get;return b===void 0?void 0:b.call(y)}},l=i(28),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function p(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function S(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function w(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var g=function(E){w(m,E);function m(v,y){p(this,m);var h=S(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,v));return h.label.innerHTML=y,h.container.classList.add("ql-color-picker"),[].slice.call(h.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(d){d.classList.add("ql-primary")}),h}return a(m,[{key:"buildItem",value:function(y){var h=o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"buildItem",this).call(this,y);return h.style.backgroundColor=y.getAttribute("value")||"",h}},{key:"selectItem",value:function(y,h){o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"selectItem",this).call(this,y,h);var d=this.label.querySelector(".ql-color-label"),b=y&&y.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=b:d.style.fill=b)}}]),m}(u.default);n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(m,v){for(var y=0;y<v.length;y++){var h=v[y];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(m,h.key,h)}}return function(m,v,y){return v&&E(m.prototype,v),y&&E(m,y),m}}(),o=function E(m,v,y){m===null&&(m=Function.prototype);var h=Object.getOwnPropertyDescriptor(m,v);if(h===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:E(d,v,y)}else{if("value"in h)return h.value;var b=h.get;return b===void 0?void 0:b.call(y)}},l=i(28),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function p(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function S(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function w(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var g=function(E){w(m,E);function m(v,y){p(this,m);var h=S(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,v));return h.container.classList.add("ql-icon-picker"),[].forEach.call(h.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=y[d.getAttribute("data-value")||""]}),h.defaultItem=h.container.querySelector(".ql-selected"),h.selectItem(h.defaultItem),h}return a(m,[{key:"selectItem",value:function(y,h){o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"selectItem",this).call(this,y,h),y=y||this.defaultItem,this.label.innerHTML=y.innerHTML}}]),m}(u.default);n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,p){for(var S=0;S<p.length;S++){var w=p[S];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,p,S){return p&&u(f.prototype,p),S&&u(f,S),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,p){var S=this;o(this,u),this.quill=f,this.boundsContainer=p||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(){S.root.style.marginTop=-1*S.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(p){var S=p.left+p.width/2-this.root.offsetWidth/2,w=p.bottom+this.quill.root.scrollTop;this.root.style.left=S+"px",this.root.style.top=w+"px",this.root.classList.remove("ql-flip");var g=this.boundsContainer.getBoundingClientRect(),E=this.root.getBoundingClientRect(),m=0;if(E.right>g.right&&(m=g.right-E.right,this.root.style.left=S+m+"px"),E.left<g.left&&(m=g.left-E.left,this.root.style.left=S+m+"px"),E.bottom>g.bottom){var v=E.bottom-E.top,y=p.bottom-p.top+v;this.root.style.top=w-y+"px",this.root.classList.add("ql-flip")}return m}},{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 C(k,R){var D=[],U=!0,Y=!1,j=void 0;try{for(var G=k[Symbol.iterator](),z;!(U=(z=G.next()).done)&&(D.push(z.value),!(R&&D.length===R));U=!0);}catch(q){Y=!0,j=q}finally{try{!U&&G.return&&G.return()}finally{if(Y)throw j}}return D}return function(k,R){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return C(k,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function C(k,R,D){k===null&&(k=Function.prototype);var U=Object.getOwnPropertyDescriptor(k,R);if(U===void 0){var Y=Object.getPrototypeOf(k);return Y===null?void 0:C(Y,R,D)}else{if("value"in U)return U.value;var j=U.get;return j===void 0?void 0:j.call(D)}},l=function(){function C(k,R){for(var D=0;D<R.length;D++){var U=R[D];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(k,U.key,U)}}return function(k,R,D){return R&&C(k.prototype,R),D&&C(k,D),k}}(),u=i(3),f=d(u),p=i(8),S=d(p),w=i(43),g=d(w),E=i(27),m=d(E),v=i(15),y=i(41),h=d(y);function d(C){return C&&C.__esModule?C:{default:C}}function b(C,k){if(!(C instanceof k))throw new TypeError("Cannot call a class as a function")}function O(C,k){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:C}function x(C,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);C.prototype=Object.create(k&&k.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(C,k):C.__proto__=k)}var P=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],_=function(C){x(k,C);function k(R,D){b(this,k),D.modules.toolbar!=null&&D.modules.toolbar.container==null&&(D.modules.toolbar.container=P);var U=O(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,R,D));return U.quill.container.classList.add("ql-snow"),U}return l(k,[{key:"extendToolbar",value:function(D){D.container.classList.add("ql-snow"),this.buildButtons([].slice.call(D.container.querySelectorAll("button")),h.default),this.buildPickers([].slice.call(D.container.querySelectorAll("select")),h.default),this.tooltip=new A(this.quill,this.options.bounds),D.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(U,Y){D.handlers.link.call(D,!Y.format.link)})}}]),k}(g.default);_.DEFAULTS=(0,f.default)(!0,{},g.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(k){if(k){var R=this.quill.getSelection();if(R==null||R.length==0)return;var D=this.quill.getText(R);/^\S+@\S+\.\S+$/.test(D)&&D.indexOf("mailto:")!==0&&(D="mailto:"+D);var U=this.quill.theme.tooltip;U.edit("link",D)}else this.quill.format("link",!1)}}}}});var A=function(C){x(k,C);function k(R,D){b(this,k);var U=O(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,R,D));return U.preview=U.root.querySelector("a.ql-preview"),U}return l(k,[{key:"listen",value:function(){var D=this;o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(U){D.root.classList.contains("ql-editing")?D.save():D.edit("link",D.preview.textContent),U.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(U){if(D.linkRange!=null){var Y=D.linkRange;D.restoreFocus(),D.quill.formatText(Y,"link",!1,S.default.sources.USER),delete D.linkRange}U.preventDefault(),D.hide()}),this.quill.on(S.default.events.SELECTION_CHANGE,function(U,Y,j){if(U!=null){if(U.length===0&&j===S.default.sources.USER){var G=D.quill.scroll.descendant(m.default,U.index),z=a(G,2),q=z[0],L=z[1];if(q!=null){D.linkRange=new v.Range(U.index-L,q.length());var I=m.default.formats(q.domNode);D.preview.textContent=I,D.preview.setAttribute("href",I),D.show(),D.position(D.quill.getBounds(D.linkRange));return}}else delete D.linkRange;D.hide()}})}},{key:"show",value:function(){o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),k}(w.BaseTooltip);A.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=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(29),o=te(a),l=i(36),u=i(38),f=i(64),p=i(65),S=te(p),w=i(66),g=te(w),E=i(67),m=te(E),v=i(37),y=i(26),h=i(39),d=i(40),b=i(56),O=te(b),x=i(68),P=te(x),_=i(27),A=te(_),C=i(69),k=te(C),R=i(70),D=te(R),U=i(71),Y=te(U),j=i(72),G=te(j),z=i(73),q=te(z),L=i(13),I=te(L),B=i(74),M=te(B),$=i(75),K=te($),V=i(57),H=te(V),X=i(41),Z=te(X),J=i(28),ee=te(J),re=i(59),ne=te(re),de=i(60),pe=te(de),Me=i(61),Fe=te(Me),fe=i(108),ie=te(fe),ve=i(62),ge=te(ve);function te(ue){return ue&&ue.__esModule?ue:{default:ue}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":v.BackgroundClass,"attributors/class/color":y.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":h.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":v.BackgroundStyle,"attributors/style/color":y.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":h.FontStyle,"attributors/style/size":d.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":f.IndentClass,"formats/background":v.BackgroundStyle,"formats/color":y.ColorStyle,"formats/font":h.FontClass,"formats/size":d.SizeClass,"formats/blockquote":S.default,"formats/code-block":I.default,"formats/header":g.default,"formats/list":m.default,"formats/bold":O.default,"formats/code":L.Code,"formats/italic":P.default,"formats/link":A.default,"formats/script":k.default,"formats/strike":D.default,"formats/underline":Y.default,"formats/image":G.default,"formats/video":q.default,"formats/list/item":E.ListItem,"modules/formula":M.default,"modules/syntax":K.default,"modules/toolbar":H.default,"themes/bubble":ie.default,"themes/snow":ge.default,"ui/icons":Z.default,"ui/picker":ee.default,"ui/icon-picker":pe.default,"ui/color-picker":ne.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 m(v,y){for(var h=0;h<y.length;h++){var d=y[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(v,d.key,d)}}return function(v,y,h){return y&&m(v.prototype,y),h&&m(v,h),v}}(),o=function m(v,y,h){v===null&&(v=Function.prototype);var d=Object.getOwnPropertyDescriptor(v,y);if(d===void 0){var b=Object.getPrototypeOf(v);return b===null?void 0:m(b,y,h)}else{if("value"in d)return d.value;var O=d.get;return O===void 0?void 0:O.call(h)}},l=i(0),u=f(l);function f(m){return m&&m.__esModule?m:{default:m}}function p(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function S(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function w(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}var g=function(m){w(v,m);function v(){return p(this,v),S(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"add",value:function(h,d){if(d==="+1"||d==="-1"){var b=this.value(h)||0;d=d==="+1"?b+1:b-1}return d===0?(this.remove(h),!0):o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"add",this).call(this,h,d)}},{key:"canAdd",value:function(h,d){return o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"canAdd",this).call(this,h,d)||o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"canAdd",this).call(this,h,parseInt(d))}},{key:"value",value:function(h){return parseInt(o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"value",this).call(this,h))||void 0}}]),v}(u.default.Attributor.Class),E=new g("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(w){return w&&w.__esModule?w:{default:w}}function u(w,g){if(!(w instanceof g))throw new TypeError("Cannot call a class as a function")}function f(w,g){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:w}function p(w,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);w.prototype=Object.create(g&&g.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(w,g):w.__proto__=g)}var S=function(w){p(g,w);function g(){return u(this,g),f(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return g}(o.default);S.blotName="blockquote",S.tagName="blockquote",n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function g(E,m){for(var v=0;v<m.length;v++){var y=m[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(E,y.key,y)}}return function(E,m,v){return m&&g(E.prototype,m),v&&g(E,v),E}}(),o=i(4),l=u(o);function u(g){return g&&g.__esModule?g:{default:g}}function f(g,E){if(!(g instanceof E))throw new TypeError("Cannot call a class as a function")}function p(g,E){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:g}function S(g,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);g.prototype=Object.create(E&&E.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(g,E):g.__proto__=E)}var w=function(g){S(E,g);function E(){return f(this,E),p(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,null,[{key:"formats",value:function(v){return this.tagName.indexOf(v.tagName)+1}}]),E}(l.default);w.blotName="header",w.tagName=["H1","H2","H3","H4","H5","H6"],n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function b(O,x){for(var P=0;P<x.length;P++){var _=x[P];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(O,_.key,_)}}return function(O,x,P){return x&&b(O.prototype,x),P&&b(O,P),O}}(),o=function b(O,x,P){O===null&&(O=Function.prototype);var _=Object.getOwnPropertyDescriptor(O,x);if(_===void 0){var A=Object.getPrototypeOf(O);return A===null?void 0:b(A,x,P)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(P)}},l=i(0),u=g(l),f=i(4),p=g(f),S=i(25),w=g(S);function g(b){return b&&b.__esModule?b:{default:b}}function E(b,O,x){return O in b?Object.defineProperty(b,O,{value:x,enumerable:!0,configurable:!0,writable:!0}):b[O]=x,b}function m(b,O){if(!(b instanceof O))throw new TypeError("Cannot call a class as a function")}function v(b,O){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:b}function y(b,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);b.prototype=Object.create(O&&O.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(b,O):b.__proto__=O)}var h=function(b){y(O,b);function O(){return m(this,O),v(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return a(O,[{key:"format",value:function(P,_){P===d.blotName&&!_?this.replaceWith(u.default.create(this.statics.scope)):o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"format",this).call(this,P,_)}},{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(P,_){return this.parent.isolate(this.offset(this.parent),this.length()),P===this.parent.statics.blotName?(this.parent.replaceWith(P,_),this):(this.parent.unwrap(),o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,P,_))}}],[{key:"formats",value:function(P){return P.tagName===this.tagName?void 0:o(O.__proto__||Object.getPrototypeOf(O),"formats",this).call(this,P)}}]),O}(p.default);h.blotName="list-item",h.tagName="LI";var d=function(b){y(O,b),a(O,null,[{key:"create",value:function(P){var _=P==="ordered"?"OL":"UL",A=o(O.__proto__||Object.getPrototypeOf(O),"create",this).call(this,_);return(P==="checked"||P==="unchecked")&&A.setAttribute("data-checked",P==="checked"),A}},{key:"formats",value:function(P){if(P.tagName==="OL")return"ordered";if(P.tagName==="UL")return P.hasAttribute("data-checked")?P.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function O(x){m(this,O);var P=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,x)),_=function(C){if(C.target.parentNode===x){var k=P.statics.formats(x),R=u.default.find(C.target);k==="checked"?R.format("list","unchecked"):k==="unchecked"&&R.format("list","checked")}};return x.addEventListener("touchstart",_),x.addEventListener("mousedown",_),P}return a(O,[{key:"format",value:function(P,_){this.children.length>0&&this.children.tail.format(P,_)}},{key:"formats",value:function(){return E({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(P,_){if(P instanceof h)o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,P,_);else{var A=_==null?this.length():_.offset(this),C=this.split(A);C.parent.insertBefore(P,C)}}},{key:"optimize",value:function(P){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,P);var _=this.next;_!=null&&_.prev===this&&_.statics.blotName===this.statics.blotName&&_.domNode.tagName===this.domNode.tagName&&_.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(_.moveChildren(this),_.remove())}},{key:"replace",value:function(P){if(P.statics.blotName!==this.statics.blotName){var _=u.default.create(this.statics.defaultChild);P.moveChildren(_),this.appendChild(_)}o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replace",this).call(this,P)}}]),O}(w.default);d.blotName="list",d.scope=u.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[h],n.ListItem=h,n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,g){if(!(w instanceof g))throw new TypeError("Cannot call a class as a function")}function f(w,g){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:w}function p(w,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);w.prototype=Object.create(g&&g.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(w,g):w.__proto__=g)}var S=function(w){p(g,w);function g(){return u(this,g),f(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return g}(o.default);S.blotName="italic",S.tagName=["EM","I"],n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(m,v){for(var y=0;y<v.length;y++){var h=v[y];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(m,h.key,h)}}return function(m,v,y){return v&&E(m.prototype,v),y&&E(m,y),m}}(),o=function E(m,v,y){m===null&&(m=Function.prototype);var h=Object.getOwnPropertyDescriptor(m,v);if(h===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:E(d,v,y)}else{if("value"in h)return h.value;var b=h.get;return b===void 0?void 0:b.call(y)}},l=i(6),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function p(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function S(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function w(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var g=function(E){w(m,E);function m(){return p(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,null,[{key:"create",value:function(y){return y==="super"?document.createElement("sup"):y==="sub"?document.createElement("sub"):o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,y)}},{key:"formats",value:function(y){if(y.tagName==="SUB")return"sub";if(y.tagName==="SUP")return"super"}}]),m}(u.default);g.blotName="script",g.tagName=["SUB","SUP"],n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,g){if(!(w instanceof g))throw new TypeError("Cannot call a class as a function")}function f(w,g){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:w}function p(w,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);w.prototype=Object.create(g&&g.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(w,g):w.__proto__=g)}var S=function(w){p(g,w);function g(){return u(this,g),f(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return g}(o.default);S.blotName="strike",S.tagName="S",n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,g){if(!(w instanceof g))throw new TypeError("Cannot call a class as a function")}function f(w,g){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:w}function p(w,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);w.prototype=Object.create(g&&g.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(w,g):w.__proto__=g)}var S=function(w){p(g,w);function g(){return u(this,g),f(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return g}(o.default);S.blotName="underline",S.tagName="U",n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(y,h){for(var d=0;d<h.length;d++){var b=h[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,h,d){return h&&v(y.prototype,h),d&&v(y,d),y}}(),o=function v(y,h,d){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,h);if(b===void 0){var O=Object.getPrototypeOf(y);return O===null?void 0:v(O,h,d)}else{if("value"in b)return b.value;var x=b.get;return x===void 0?void 0:x.call(d)}},l=i(0),u=p(l),f=i(27);function p(v){return v&&v.__esModule?v:{default:v}}function S(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function w(v,y){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:v}function g(v,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);v.prototype=Object.create(y&&y.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(v,y):v.__proto__=y)}var E=["alt","height","width"],m=function(v){g(y,v);function y(){return S(this,y),w(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"format",value:function(d,b){E.indexOf(d)>-1?b?this.domNode.setAttribute(d,b):this.domNode.removeAttribute(d):o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,d,b)}}],[{key:"create",value:function(d){var b=o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,d);return typeof d=="string"&&b.setAttribute("src",this.sanitize(d)),b}},{key:"formats",value:function(d){return E.reduce(function(b,O){return d.hasAttribute(O)&&(b[O]=d.getAttribute(O)),b},{})}},{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")}}]),y}(u.default.Embed);m.blotName="image",m.tagName="IMG",n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(y,h){for(var d=0;d<h.length;d++){var b=h[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,h,d){return h&&v(y.prototype,h),d&&v(y,d),y}}(),o=function v(y,h,d){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,h);if(b===void 0){var O=Object.getPrototypeOf(y);return O===null?void 0:v(O,h,d)}else{if("value"in b)return b.value;var x=b.get;return x===void 0?void 0:x.call(d)}},l=i(4),u=i(27),f=p(u);function p(v){return v&&v.__esModule?v:{default:v}}function S(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function w(v,y){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:v}function g(v,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);v.prototype=Object.create(y&&y.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(v,y):v.__proto__=y)}var E=["height","width"],m=function(v){g(y,v);function y(){return S(this,y),w(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"format",value:function(d,b){E.indexOf(d)>-1?b?this.domNode.setAttribute(d,b):this.domNode.removeAttribute(d):o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,d,b)}}],[{key:"create",value:function(d){var b=o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,d);return b.setAttribute("frameborder","0"),b.setAttribute("allowfullscreen",!0),b.setAttribute("src",this.sanitize(d)),b}},{key:"formats",value:function(d){return E.reduce(function(b,O){return d.hasAttribute(O)&&(b[O]=d.getAttribute(O)),b},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),y}(l.BlockEmbed);m.blotName="video",m.className="ql-video",m.tagName="IFRAME",n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var a=function(){function d(b,O){for(var x=0;x<O.length;x++){var P=O[x];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(b,P.key,P)}}return function(b,O,x){return O&&d(b.prototype,O),x&&d(b,x),b}}(),o=function d(b,O,x){b===null&&(b=Function.prototype);var P=Object.getOwnPropertyDescriptor(b,O);if(P===void 0){var _=Object.getPrototypeOf(b);return _===null?void 0:d(_,O,x)}else{if("value"in P)return P.value;var A=P.get;return A===void 0?void 0:A.call(x)}},l=i(35),u=g(l),f=i(5),p=g(f),S=i(9),w=g(S);function g(d){return d&&d.__esModule?d:{default:d}}function E(d,b){if(!(d instanceof b))throw new TypeError("Cannot call a class as a function")}function m(d,b){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:d}function v(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);d.prototype=Object.create(b&&b.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(d,b):d.__proto__=b)}var y=function(d){v(b,d);function b(){return E(this,b),m(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,null,[{key:"create",value:function(x){var P=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,x);return typeof x=="string"&&(window.katex.render(x,P,{throwOnError:!1,errorColor:"#f00"}),P.setAttribute("data-value",x)),P}},{key:"value",value:function(x){return x.getAttribute("data-value")}}]),b}(u.default);y.blotName="formula",y.className="ql-formula",y.tagName="SPAN";var h=function(d){v(b,d),a(b,null,[{key:"register",value:function(){p.default.register(y,!0)}}]);function b(){E(this,b);var O=m(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return O}return b}(w.default);n.FormulaBlot=y,n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function x(P,_){for(var A=0;A<_.length;A++){var C=_[A];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(P,C.key,C)}}return function(P,_,A){return _&&x(P.prototype,_),A&&x(P,A),P}}(),o=function x(P,_,A){P===null&&(P=Function.prototype);var C=Object.getOwnPropertyDescriptor(P,_);if(C===void 0){var k=Object.getPrototypeOf(P);return k===null?void 0:x(k,_,A)}else{if("value"in C)return C.value;var R=C.get;return R===void 0?void 0:R.call(A)}},l=i(0),u=m(l),f=i(5),p=m(f),S=i(9),w=m(S),g=i(13),E=m(g);function m(x){return x&&x.__esModule?x:{default:x}}function v(x,P){if(!(x instanceof P))throw new TypeError("Cannot call a class as a function")}function y(x,P){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:x}function h(x,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);x.prototype=Object.create(P&&P.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(x,P):x.__proto__=P)}var d=function(x){h(P,x);function P(){return v(this,P),y(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return a(P,[{key:"replaceWith",value:function(A){this.domNode.textContent=this.domNode.textContent,this.attach(),o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replaceWith",this).call(this,A)}},{key:"highlight",value:function(A){var C=this.domNode.textContent;this.cachedText!==C&&((C.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=A(C),this.domNode.normalize(),this.attach()),this.cachedText=C)}}]),P}(E.default);d.className="ql-syntax";var b=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),O=function(x){h(P,x),a(P,null,[{key:"register",value:function(){p.default.register(b,!0),p.default.register(d,!0)}}]);function P(_,A){v(this,P);var C=y(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,_,A));if(typeof C.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var k=null;return C.quill.on(p.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(k),k=setTimeout(function(){C.highlight(),k=null},C.options.interval)}),C.highlight(),C}return a(P,[{key:"highlight",value:function(){var A=this;if(!this.quill.selection.composing){this.quill.update(p.default.sources.USER);var C=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(k){k.highlight(A.options.highlight)}),this.quill.update(p.default.sources.SILENT),C!=null&&this.quill.setSelection(C,p.default.sources.SILENT)}}}]),P}(w.default);O.DEFAULTS={highlight:function(){return window.hljs==null?null:function(x){var P=window.hljs.highlightAuto(x);return P.value}}(),interval:1e3},n.CodeBlock=d,n.CodeToken=b,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 P(_,A,C){_===null&&(_=Function.prototype);var k=Object.getOwnPropertyDescriptor(_,A);if(k===void 0){var R=Object.getPrototypeOf(_);return R===null?void 0:P(R,A,C)}else{if("value"in k)return k.value;var D=k.get;return D===void 0?void 0:D.call(C)}},o=function(){function P(_,A){for(var C=0;C<A.length;C++){var k=A[C];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(_,k.key,k)}}return function(_,A,C){return A&&P(_.prototype,A),C&&P(_,C),_}}(),l=i(3),u=v(l),f=i(8),p=v(f),S=i(43),w=v(S),g=i(15),E=i(41),m=v(E);function v(P){return P&&P.__esModule?P:{default:P}}function y(P,_){if(!(P instanceof _))throw new TypeError("Cannot call a class as a function")}function h(P,_){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:P}function d(P,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);P.prototype=Object.create(_&&_.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(P,_):P.__proto__=_)}var b=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],O=function(P){d(_,P);function _(A,C){y(this,_),C.modules.toolbar!=null&&C.modules.toolbar.container==null&&(C.modules.toolbar.container=b);var k=h(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,A,C));return k.quill.container.classList.add("ql-bubble"),k}return o(_,[{key:"extendToolbar",value:function(C){this.tooltip=new x(this.quill,this.options.bounds),this.tooltip.root.appendChild(C.container),this.buildButtons([].slice.call(C.container.querySelectorAll("button")),m.default),this.buildPickers([].slice.call(C.container.querySelectorAll("select")),m.default)}}]),_}(w.default);O.DEFAULTS=(0,u.default)(!0,{},w.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(_){_?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var x=function(P){d(_,P);function _(A,C){y(this,_);var k=h(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,A,C));return k.quill.on(p.default.events.EDITOR_CHANGE,function(R,D,U,Y){if(R===p.default.events.SELECTION_CHANGE)if(D!=null&&D.length>0&&Y===p.default.sources.USER){k.show(),k.root.style.left="0px",k.root.style.width="",k.root.style.width=k.root.offsetWidth+"px";var j=k.quill.getLines(D.index,D.length);if(j.length===1)k.position(k.quill.getBounds(D));else{var G=j[j.length-1],z=k.quill.getIndex(G),q=Math.min(G.length()-1,D.index+D.length-z),L=k.quill.getBounds(new g.Range(z,q));k.position(L)}}else document.activeElement!==k.textbox&&k.quill.hasFocus()&&k.hide()}),k}return o(_,[{key:"listen",value:function(){var C=this;a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){C.root.classList.remove("ql-editing")}),this.quill.on(p.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!C.root.classList.contains("ql-hidden")){var k=C.quill.getSelection();k!=null&&C.position(C.quill.getBounds(k))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(C){var k=a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"position",this).call(this,C),R=this.root.querySelector(".ql-tooltip-arrow");if(R.style.marginLeft="",k===0)return k;R.style.marginLeft=-1*k-R.offsetWidth/2+"px"}}]),_}(S.BaseTooltip);x.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=x,n.default=O},function(r,n,i){r.exports=i(63)}]).default})})(hS);var pS=hS.exports,yD={exports:{}};(function(e,t){(function(r,n){e.exports=n(pS)})(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(p){return o[p]}).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:p}=Object;let{freeze:S,seal:w,create:g}=Object,{apply:E,construct:m}=typeof Reflect<"u"&&Reflect;E||(E=function(ie,ve,ge){return ie.apply(ve,ge)}),S||(S=function(ie){return ie}),w||(w=function(ie){return ie}),m||(m=function(ie,ve){return new ie(...ve)});const v=R(Array.prototype.forEach),y=R(Array.prototype.pop),h=R(Array.prototype.push),d=R(String.prototype.toLowerCase),b=R(String.prototype.toString),O=R(String.prototype.match),x=R(String.prototype.replace),P=R(String.prototype.indexOf),_=R(String.prototype.trim),A=R(RegExp.prototype.test),C=(k=TypeError,function(){for(var ie=arguments.length,ve=new Array(ie),ge=0;ge<ie;ge++)ve[ge]=arguments[ge];return m(k,ve)});var k;function R(ie){return function(ve){for(var ge=arguments.length,te=new Array(ge>1?ge-1:0),ue=1;ue<ge;ue++)te[ue-1]=arguments[ue];return E(ie,ve,te)}}function D(ie,ve,ge){var te;ge=(te=ge)!==null&&te!==void 0?te:d,l&&l(ie,null);let ue=ve.length;for(;ue--;){let be=ve[ue];if(typeof be=="string"){const se=ge(be);se!==be&&(u(ve)||(ve[ue]=se),be=se)}ie[be]=!0}return ie}function U(ie){const ve=g(null);for(const[ge,te]of o(ie))ve[ge]=te;return ve}function Y(ie,ve){for(;ie!==null;){const ge=p(ie,ve);if(ge){if(ge.get)return R(ge.get);if(typeof ge.value=="function")return R(ge.value)}ie=f(ie)}return function(ge){return console.warn("fallback value for",ge),null}}const j=S(["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"]),G=S(["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"]),z=S(["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"]),q=S(["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"]),L=S(["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"]),I=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),B=S(["#text"]),M=S(["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"]),$=S(["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"]),K=S(["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"]),V=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),H=w(/\{\{[\w\W]*|[\w\W]*\}\}/gm),X=w(/<%[\w\W]*|[\w\W]*%>/gm),Z=w(/\${[\w\W]*}/gm),J=w(/^data-[\-\w.\u00B7-\uFFFF]/),ee=w(/^aria-[\-\w]+$/),re=w(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ne=w(/^(?:\w+script|data):/i),de=w(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),pe=w(/^html$/i);var Me=Object.freeze({__proto__:null,MUSTACHE_EXPR:H,ERB_EXPR:X,TMPLIT_EXPR:Z,DATA_ATTR:J,ARIA_ATTR:ee,IS_ALLOWED_URI:re,IS_SCRIPT_OR_DATA:ne,ATTR_WHITESPACE:de,DOCTYPE_NAME:pe});const Fe=()=>typeof window>"u"?null:window,fe=function(ie,ve){if(typeof ie!="object"||typeof ie.createPolicy!="function")return null;let ge=null;ve&&ve.hasAttribute("data-tt-policy-suffix")&&(ge=ve.getAttribute("data-tt-policy-suffix"));const te="dompurify"+(ge?"#"+ge:"");try{return ie.createPolicy(te,{createHTML:ue=>ue,createScriptURL:ue=>ue})}catch{return console.warn("TrustedTypes policy "+te+" could not be created."),null}};return function ie(){let ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Fe();const ge=ae=>ie(ae);if(ge.version="3.0.5",ge.removed=[],!ve||!ve.document||ve.document.nodeType!==9)return ge.isSupported=!1,ge;const te=ve.document,ue=te.currentScript;let{document:be}=ve;const{DocumentFragment:se,HTMLTemplateElement:Pe,Node:xe,Element:Ie,NodeFilter:xt,NamedNodeMap:tt=ve.NamedNodeMap||ve.MozNamedAttrMap,HTMLFormElement:St,DOMParser:Ht,trustedTypes:le}=ve,he=Ie.prototype,nt=Y(he,"cloneNode"),Ee=Y(he,"nextSibling"),je=Y(he,"childNodes"),Le=Y(he,"parentNode");if(typeof Pe=="function"){const ae=be.createElement("template");ae.content&&ae.content.ownerDocument&&(be=ae.content.ownerDocument)}let we,Ze="";const{implementation:Oe,createNodeIterator:We,createDocumentFragment:ke,getElementsByTagName:ze}=be,{importNode:Xe}=te;let ot={};ge.isSupported=typeof o=="function"&&typeof Le=="function"&&Oe&&Oe.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Et,ERB_EXPR:jr,TMPLIT_EXPR:Jt,DATA_ATTR:Sr,ARIA_ATTR:on,IS_SCRIPT_OR_DATA:Ln,ATTR_WHITESPACE:De}=Me;let{IS_ALLOWED_URI:Je}=Me,Qe=null;const At=D({},[...j,...G,...z,...L,...B]);let rt=null;const er=D({},[...M,...$,...K,...V]);let mt=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}})),Gt=null,zr=null,vr=!0,kr=!0,Mn=!1,gi=!0,vn=!1,ln=!1,Yn=!1,Va=!1,vi=!1,Wl=!1,qa=!1,Wa=!0,Yl=!1;const Pu="user-content-";let Cu=!0,ca=!1,Nn={},sn=null;const Nt=D({},["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 mi=D({},["audio","video","img","source","image","track"]);let mr=null;const Br=D({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kn="http://www.w3.org/1998/Math/MathML",yi="http://www.w3.org/2000/svg",Yt="http://www.w3.org/1999/xhtml";let bi=Yt,Kl=!1,Xl=null;const Zl=D({},[Kn,yi,Yt],b);let fa;const In=["application/xhtml+xml","text/html"],y0="text/html";let yr,Ya=null;const Ql=be.createElement("form"),Wo=function(ae){return ae instanceof RegExp||ae instanceof Function},da=function(ae){if(!Ya||Ya!==ae){if(ae&&typeof ae=="object"||(ae={}),ae=U(ae),fa=fa=In.indexOf(ae.PARSER_MEDIA_TYPE)===-1?y0:ae.PARSER_MEDIA_TYPE,yr=fa==="application/xhtml+xml"?b:d,Qe="ALLOWED_TAGS"in ae?D({},ae.ALLOWED_TAGS,yr):At,rt="ALLOWED_ATTR"in ae?D({},ae.ALLOWED_ATTR,yr):er,Xl="ALLOWED_NAMESPACES"in ae?D({},ae.ALLOWED_NAMESPACES,b):Zl,mr="ADD_URI_SAFE_ATTR"in ae?D(U(Br),ae.ADD_URI_SAFE_ATTR,yr):Br,Rt="ADD_DATA_URI_TAGS"in ae?D(U(mi),ae.ADD_DATA_URI_TAGS,yr):mi,sn="FORBID_CONTENTS"in ae?D({},ae.FORBID_CONTENTS,yr):Nt,Gt="FORBID_TAGS"in ae?D({},ae.FORBID_TAGS,yr):{},zr="FORBID_ATTR"in ae?D({},ae.FORBID_ATTR,yr):{},Nn="USE_PROFILES"in ae&&ae.USE_PROFILES,vr=ae.ALLOW_ARIA_ATTR!==!1,kr=ae.ALLOW_DATA_ATTR!==!1,Mn=ae.ALLOW_UNKNOWN_PROTOCOLS||!1,gi=ae.ALLOW_SELF_CLOSE_IN_ATTR!==!1,vn=ae.SAFE_FOR_TEMPLATES||!1,ln=ae.WHOLE_DOCUMENT||!1,vi=ae.RETURN_DOM||!1,Wl=ae.RETURN_DOM_FRAGMENT||!1,qa=ae.RETURN_TRUSTED_TYPE||!1,Va=ae.FORCE_BODY||!1,Wa=ae.SANITIZE_DOM!==!1,Yl=ae.SANITIZE_NAMED_PROPS||!1,Cu=ae.KEEP_CONTENT!==!1,ca=ae.IN_PLACE||!1,Je=ae.ALLOWED_URI_REGEXP||re,bi=ae.NAMESPACE||Yt,mt=ae.CUSTOM_ELEMENT_HANDLING||{},ae.CUSTOM_ELEMENT_HANDLING&&Wo(ae.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(mt.tagNameCheck=ae.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ae.CUSTOM_ELEMENT_HANDLING&&Wo(ae.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(mt.attributeNameCheck=ae.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ae.CUSTOM_ELEMENT_HANDLING&&typeof ae.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(mt.allowCustomizedBuiltInElements=ae.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),vn&&(kr=!1),Wl&&(vi=!0),Nn&&(Qe=D({},[...B]),rt=[],Nn.html===!0&&(D(Qe,j),D(rt,M)),Nn.svg===!0&&(D(Qe,G),D(rt,$),D(rt,V)),Nn.svgFilters===!0&&(D(Qe,z),D(rt,$),D(rt,V)),Nn.mathMl===!0&&(D(Qe,L),D(rt,K),D(rt,V))),ae.ADD_TAGS&&(Qe===At&&(Qe=U(Qe)),D(Qe,ae.ADD_TAGS,yr)),ae.ADD_ATTR&&(rt===er&&(rt=U(rt)),D(rt,ae.ADD_ATTR,yr)),ae.ADD_URI_SAFE_ATTR&&D(mr,ae.ADD_URI_SAFE_ATTR,yr),ae.FORBID_CONTENTS&&(sn===Nt&&(sn=U(sn)),D(sn,ae.FORBID_CONTENTS,yr)),Cu&&(Qe["#text"]=!0),ln&&D(Qe,["html","head","body"]),Qe.table&&(D(Qe,["tbody"]),delete Gt.tbody),ae.TRUSTED_TYPES_POLICY){if(typeof ae.TRUSTED_TYPES_POLICY.createHTML!="function")throw C('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ae.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw C('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');we=ae.TRUSTED_TYPES_POLICY,Ze=we.createHTML("")}else we===void 0&&(we=fe(le,ue)),we!==null&&typeof Ze=="string"&&(Ze=we.createHTML(""));S&&S(ae),Ya=ae}},Yo=D({},["mi","mo","mn","ms","mtext"]),Of=D({},["foreignobject","desc","title","annotation-xml"]),b0=D({},["title","style","font","a","script"]),Ka=D({},G);D(Ka,z),D(Ka,q);const Jl=D({},L);D(Jl,I);const Tu=function(ae){let Te=Le(ae);Te&&Te.tagName||(Te={namespaceURI:bi,tagName:"template"});const Ne=d(ae.tagName),ft=d(Te.tagName);return!!Xl[ae.namespaceURI]&&(ae.namespaceURI===yi?Te.namespaceURI===Yt?Ne==="svg":Te.namespaceURI===Kn?Ne==="svg"&&(ft==="annotation-xml"||Yo[ft]):!!Ka[Ne]:ae.namespaceURI===Kn?Te.namespaceURI===Yt?Ne==="math":Te.namespaceURI===yi?Ne==="math"&&Of[ft]:!!Jl[Ne]:ae.namespaceURI===Yt?!(Te.namespaceURI===yi&&!Of[ft])&&!(Te.namespaceURI===Kn&&!Yo[ft])&&!Jl[Ne]&&(b0[Ne]||!Ka[Ne]):!(fa!=="application/xhtml+xml"||!Xl[ae.namespaceURI]))},Dn=function(ae){h(ge.removed,{element:ae});try{ae.parentNode.removeChild(ae)}catch{ae.remove()}},Au=function(ae,Te){try{h(ge.removed,{attribute:Te.getAttributeNode(ae),from:Te})}catch{h(ge.removed,{attribute:null,from:Te})}if(Te.removeAttribute(ae),ae==="is"&&!rt[ae])if(vi||Wl)try{Dn(Te)}catch{}else try{Te.setAttribute(ae,"")}catch{}},es=function(ae){let Te,Ne;if(Va)ae="<remove></remove>"+ae;else{const Yr=O(ae,/^[\r\n\t ]+/);Ne=Yr&&Yr[0]}fa==="application/xhtml+xml"&&bi===Yt&&(ae='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ae+"</body></html>");const ft=we?we.createHTML(ae):ae;if(bi===Yt)try{Te=new Ht().parseFromString(ft,fa)}catch{}if(!Te||!Te.documentElement){Te=Oe.createDocument(bi,"template",null);try{Te.documentElement.innerHTML=Kl?Ze:ft}catch{}}const lr=Te.body||Te.documentElement;return ae&&Ne&&lr.insertBefore(be.createTextNode(Ne),lr.childNodes[0]||null),bi===Yt?ze.call(Te,ln?"html":"body")[0]:ln?Te.documentElement:lr},_t=function(ae){return We.call(ae.ownerDocument||ae,ae,xt.SHOW_ELEMENT|xt.SHOW_COMMENT|xt.SHOW_TEXT,null,!1)},xf=function(ae){return ae instanceof St&&(typeof ae.nodeName!="string"||typeof ae.textContent!="string"||typeof ae.removeChild!="function"||!(ae.attributes instanceof tt)||typeof ae.removeAttribute!="function"||typeof ae.setAttribute!="function"||typeof ae.namespaceURI!="string"||typeof ae.insertBefore!="function"||typeof ae.hasChildNodes!="function")},Xa=function(ae){return typeof xe=="object"?ae instanceof xe:ae&&typeof ae=="object"&&typeof ae.nodeType=="number"&&typeof ae.nodeName=="string"},Xn=function(ae,Te,Ne){ot[ae]&&v(ot[ae],ft=>{ft.call(ge,Te,Ne,Ya)})},Pf=function(ae){let Te;if(Xn("beforeSanitizeElements",ae,null),xf(ae))return Dn(ae),!0;const Ne=yr(ae.nodeName);if(Xn("uponSanitizeElement",ae,{tagName:Ne,allowedTags:Qe}),ae.hasChildNodes()&&!Xa(ae.firstElementChild)&&(!Xa(ae.content)||!Xa(ae.content.firstElementChild))&&A(/<[/\w]/g,ae.innerHTML)&&A(/<[/\w]/g,ae.textContent))return Dn(ae),!0;if(!Qe[Ne]||Gt[Ne]){if(!Gt[Ne]&&dr(Ne)&&(mt.tagNameCheck instanceof RegExp&&A(mt.tagNameCheck,Ne)||mt.tagNameCheck instanceof Function&&mt.tagNameCheck(Ne)))return!1;if(Cu&&!sn[Ne]){const ft=Le(ae)||ae.parentNode,lr=je(ae)||ae.childNodes;if(lr&&ft)for(let Yr=lr.length-1;Yr>=0;--Yr)ft.insertBefore(nt(lr[Yr],!0),Ee(ae))}return Dn(ae),!0}return ae instanceof Ie&&!Tu(ae)?(Dn(ae),!0):Ne!=="noscript"&&Ne!=="noembed"&&Ne!=="noframes"||!A(/<\/no(script|embed|frames)/i,ae.innerHTML)?(vn&&ae.nodeType===3&&(Te=ae.textContent,Te=x(Te,Et," "),Te=x(Te,jr," "),Te=x(Te,Jt," "),ae.textContent!==Te&&(h(ge.removed,{element:ae.cloneNode()}),ae.textContent=Te)),Xn("afterSanitizeElements",ae,null),!1):(Dn(ae),!0)},Cf=function(ae,Te,Ne){if(Wa&&(Te==="id"||Te==="name")&&(Ne in be||Ne in Ql))return!1;if(!(kr&&!zr[Te]&&A(Sr,Te))){if(!(vr&&A(on,Te))){if(!rt[Te]||zr[Te]){if(!(dr(ae)&&(mt.tagNameCheck instanceof RegExp&&A(mt.tagNameCheck,ae)||mt.tagNameCheck instanceof Function&&mt.tagNameCheck(ae))&&(mt.attributeNameCheck instanceof RegExp&&A(mt.attributeNameCheck,Te)||mt.attributeNameCheck instanceof Function&&mt.attributeNameCheck(Te))||Te==="is"&&mt.allowCustomizedBuiltInElements&&(mt.tagNameCheck instanceof RegExp&&A(mt.tagNameCheck,Ne)||mt.tagNameCheck instanceof Function&&mt.tagNameCheck(Ne))))return!1}else if(!mr[Te]){if(!A(Je,x(Ne,De,""))){if((Te!=="src"&&Te!=="xlink:href"&&Te!=="href"||ae==="script"||P(Ne,"data:")!==0||!Rt[ae])&&!(Mn&&!A(Ln,x(Ne,De,"")))){if(Ne)return!1}}}}}return!0},dr=function(ae){return ae.indexOf("-")>0},ts=function(ae){let Te,Ne,ft,lr;Xn("beforeSanitizeAttributes",ae,null);const{attributes:Yr}=ae;if(!Yr)return;const sr={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:rt};for(lr=Yr.length;lr--;){Te=Yr[lr];const{name:It,namespaceURI:_i}=Te;if(Ne=It==="value"?Te.value:_(Te.value),ft=yr(It),sr.attrName=ft,sr.attrValue=Ne,sr.keepAttr=!0,sr.forceKeepAttr=void 0,Xn("uponSanitizeAttribute",ae,sr),Ne=sr.attrValue,sr.forceKeepAttr||(Au(It,ae),!sr.keepAttr))continue;if(!gi&&A(/\/>/i,Ne)){Au(It,ae);continue}vn&&(Ne=x(Ne,Et," "),Ne=x(Ne,jr," "),Ne=x(Ne,Jt," "));const rs=yr(ae.nodeName);if(Cf(rs,ft,Ne)){if(!Yl||ft!=="id"&&ft!=="name"||(Au(It,ae),Ne=Pu+Ne),we&&typeof le=="object"&&typeof le.getAttributeType=="function"&&!_i)switch(le.getAttributeType(rs,ft)){case"TrustedHTML":Ne=we.createHTML(Ne);break;case"TrustedScriptURL":Ne=we.createScriptURL(Ne)}try{_i?ae.setAttributeNS(_i,It,Ne):ae.setAttribute(It,Ne),y(ge.removed)}catch{}}}Xn("afterSanitizeAttributes",ae,null)},_0=function ae(Te){let Ne;const ft=_t(Te);for(Xn("beforeSanitizeShadowDOM",Te,null);Ne=ft.nextNode();)Xn("uponSanitizeShadowNode",Ne,null),Pf(Ne)||(Ne.content instanceof se&&ae(Ne.content),ts(Ne));Xn("afterSanitizeShadowDOM",Te,null)};return ge.sanitize=function(ae){let Te,Ne,ft,lr,Yr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Kl=!ae,Kl&&(ae="<!-->"),typeof ae!="string"&&!Xa(ae)){if(typeof ae.toString!="function")throw C("toString is not a function");if(typeof(ae=ae.toString())!="string")throw C("dirty is not a string, aborting")}if(!ge.isSupported)return ae;if(Yn||da(Yr),ge.removed=[],typeof ae=="string"&&(ca=!1),ca){if(ae.nodeName){const _i=yr(ae.nodeName);if(!Qe[_i]||Gt[_i])throw C("root node is forbidden and cannot be sanitized in-place")}}else if(ae instanceof xe)Te=es("<!---->"),Ne=Te.ownerDocument.importNode(ae,!0),Ne.nodeType===1&&Ne.nodeName==="BODY"||Ne.nodeName==="HTML"?Te=Ne:Te.appendChild(Ne);else{if(!vi&&!vn&&!ln&&ae.indexOf("<")===-1)return we&&qa?we.createHTML(ae):ae;if(Te=es(ae),!Te)return vi?null:qa?Ze:""}Te&&Va&&Dn(Te.firstChild);const sr=_t(ca?ae:Te);for(;ft=sr.nextNode();)Pf(ft)||(ft.content instanceof se&&_0(ft.content),ts(ft));if(ca)return ae;if(vi){if(Wl)for(lr=ke.call(Te.ownerDocument);Te.firstChild;)lr.appendChild(Te.firstChild);else lr=Te;return(rt.shadowroot||rt.shadowrootmode)&&(lr=Xe.call(te,lr,!0)),lr}let It=ln?Te.outerHTML:Te.innerHTML;return ln&&Qe["!doctype"]&&Te.ownerDocument&&Te.ownerDocument.doctype&&Te.ownerDocument.doctype.name&&A(pe,Te.ownerDocument.doctype.name)&&(It="<!DOCTYPE "+Te.ownerDocument.doctype.name+`>
155
+ `+It),vn&&(It=x(It,Et," "),It=x(It,jr," "),It=x(It,Jt," ")),we&&qa?we.createHTML(It):It},ge.setConfig=function(ae){da(ae),Yn=!0},ge.clearConfig=function(){Ya=null,Yn=!1},ge.isValidAttribute=function(ae,Te,Ne){Ya||da({});const ft=yr(ae),lr=yr(Te);return Cf(ft,lr,Ne)},ge.addHook=function(ae,Te){typeof Te=="function"&&(ot[ae]=ot[ae]||[],h(ot[ae],Te))},ge.removeHook=function(ae){if(ot[ae])return y(ot[ae])},ge.removeHooks=function(ae){ot[ae]&&(ot[ae]=[])},ge.removeAllHooks=function(){ot={}},ge}()}()},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 p(x){return(p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P})(x)}function S(x,P){var _=Object.keys(x);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(x);P&&(A=A.filter(function(C){return Object.getOwnPropertyDescriptor(x,C).enumerable})),_.push.apply(_,A)}return _}function w(x){for(var P=1;P<arguments.length;P++){var _=arguments[P]!=null?arguments[P]:{};P%2?S(Object(_),!0).forEach(function(A){g(x,A,_[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(_)):S(Object(_)).forEach(function(A){Object.defineProperty(x,A,Object.getOwnPropertyDescriptor(_,A))})}return x}function g(x,P,_){return P in x?Object.defineProperty(x,P,{value:_,enumerable:!0,configurable:!0,writable:!0}):x[P]=_,x}function E(x,P){for(var _=0;_<P.length;_++){var A=P[_];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(x,A.key,A)}}function m(x,P){return(m=Object.setPrototypeOf||function(_,A){return _.__proto__=A,_})(x,P)}function v(x){var P=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 _,A=h(x);if(P){var C=h(this).constructor;_=Reflect.construct(A,arguments,C)}else _=A.apply(this,arguments);return y(this,_)}}function y(x,P){return!P||p(P)!=="object"&&typeof P!="function"?function(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}(x):P}function h(x){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(P){return P.__proto__||Object.getPrototypeOf(P)})(x)}var d=l.a.import("modules/clipboard"),b=l.a.import("delta"),O=function(x){(function(k,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(R&&R.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),R&&m(k,R)})(C,x);var P,_,A=v(C);function C(k,R){var D;return function(U,Y){if(!(U instanceof Y))throw new TypeError("Cannot call a class as a function")}(this,C),(D=A.call(this,k,R)).allowed=R.allowed,D.keepSelection=R.keepSelection,D.substituteBlockElements=R.substituteBlockElements,D.magicPasteLinks=R.magicPasteLinks,D.hooks=R.hooks,D}return P=C,(_=[{key:"onPaste",value:function(k){var R=this;k.preventDefault();var D,U,Y,j,G,z=this.quill.getSelection();k.clipboardData&&k.clipboardData.getData||!window.clipboardData||!window.clipboardData.getData?(D=k.clipboardData.getData("text/plain"),U=k.clipboardData.getData("text/html"),Y=(j=k.clipboardData)===null||j===void 0||(G=j.items)===null||G===void 0?void 0:G[0]):D=window.clipboardData.getData("Text");var q=new b().retain(z.index).delete(z.length),L=this.getDOMPurifyOptions(),I=!1,B=D;if(!U&&L.ALLOWED_TAGS.includes("a")&&this.isURL(D)&&z.length>0&&this.magicPasteLinks)B=this.quill.getText(z.index,z.length),q=q.insert(B,{link:D});else if(!U&&L.ALLOWED_TAGS.includes("img")&&Y&&Y.kind==="file"&&Y.type.match(/^image\//i)){var M=Y.getAsFile(),$=new FileReader;$.onload=function(de){R.quill.insertEmbed(z.index,"image",de.target.result),R.keepSelection||R.quill.setSelection(z.index+1)},$.readAsDataURL(M)}else{var K,V,H,X,Z,J,ee,re,ne;U||(I=!0,U=B),typeof((K=this.hooks)===null||K===void 0?void 0:K.beforeSanitizeElements)=="function"&&f.a.addHook("beforeSanitizeElements",this.hooks.beforeSanitizeElements),typeof((V=this.hooks)===null||V===void 0?void 0:V.uponSanitizeElement)=="function"&&f.a.addHook("uponSanitizeElement",this.hooks.uponSanitizeElement),typeof((H=this.hooks)===null||H===void 0?void 0:H.afterSanitizeElements)=="function"&&f.a.addHook("afterSanitizeElements",this.hooks.afterSanitizeElements),typeof((X=this.hooks)===null||X===void 0?void 0:X.beforeSanitizeAttributes)=="function"&&f.a.addHook("beforeSanitizeAttributes",this.hooks.beforeSanitizeAttributes),typeof((Z=this.hooks)===null||Z===void 0?void 0:Z.uponSanitizeAttribute)=="function"&&f.a.addHook("uponSanitizeAttribute",this.hooks.uponSanitizeAttribute),typeof((J=this.hooks)===null||J===void 0?void 0:J.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((re=this.hooks)===null||re===void 0?void 0:re.uponSanitizeShadowNode)=="function"&&f.a.addHook("uponSanitizeShadowNode",this.hooks.uponSanitizeShadowNode),typeof((ne=this.hooks)===null||ne===void 0?void 0:ne.afterSanitizeShadowDOM)=="function"&&f.a.addHook("afterSanitizeShadowDOM",this.hooks.afterSanitizeShadowDOM),I?(B=f.a.sanitize(U,L),q=q.insert(B)):(B=this.substituteBlockElements!==!1?(U=this.substitute(U,L)).innerHTML:f.a.sanitize(U,L),q=q.concat(this.convert(B)))}this.quill.updateContents(q,l.a.sources.USER),I||(q=this.convert(B)),this.keepSelection?this.quill.setSelection(z.index,q.length(),l.a.sources.SILENT):this.quill.setSelection(z.index+q.length(),l.a.sources.SILENT),this.quill.scrollIntoView(),f.a.removeAllHooks()}},{key:"getDOMPurifyOptions",value:function(){var k,R,D={};if((k=this.allowed)!==null&&k!==void 0&&k.tags&&(D.ALLOWED_TAGS=this.allowed.tags),(R=this.allowed)!==null&&R!==void 0&&R.attributes&&(D.ALLOWED_ATTR=this.allowed.attributes),D.ALLOWED_TAGS===void 0||D.ALLOWED_ATTR===void 0){var U,Y=!1;D.ALLOWED_TAGS===void 0&&(Y=!0,D.ALLOWED_TAGS=["p","br","span"]);var j=!1;D.ALLOWED_ATTR===void 0&&(j=!0,D.ALLOWED_ATTR=["class"]);var G=this.quill.getModule("toolbar");G==null||(U=G.controls)===null||U===void 0||U.forEach(function(z){switch(z[0]){case"bold":Y&&(D.ALLOWED_TAGS.push("b"),D.ALLOWED_TAGS.push("strong"));break;case"italic":Y&&(D.ALLOWED_TAGS.push("i"),D.ALLOWED_TAGS.push("em"));break;case"underline":Y&&D.ALLOWED_TAGS.push("u");break;case"strike":Y&&D.ALLOWED_TAGS.push("s");break;case"color":case"background":j&&D.ALLOWED_ATTR.push("style");break;case"script":Y&&(z[1].value==="super"?D.ALLOWED_TAGS.push("sup"):z[1].value==="sub"&&D.ALLOWED_TAGS.push("sub"));break;case"header":if(Y){var q=function(L){L==="1"?D.ALLOWED_TAGS.push("h1"):L==="2"?D.ALLOWED_TAGS.push("h2"):L==="3"?D.ALLOWED_TAGS.push("h3"):L==="4"?D.ALLOWED_TAGS.push("h4"):L==="5"?D.ALLOWED_TAGS.push("h5"):L==="6"&&D.ALLOWED_TAGS.push("h6")};z[1].value?q(z[1].value):z[1].options&&z[1].options.length&&[].forEach.call(z[1].options,function(L){L.value&&q(L.value)})}break;case"code-block":Y&&D.ALLOWED_TAGS.push("pre"),j&&D.ALLOWED_ATTR.push("spellcheck");break;case"list":Y&&(z[1].value==="ordered"?D.ALLOWED_TAGS.push("ol"):z[1].value==="bullet"&&D.ALLOWED_TAGS.push("ul"),D.ALLOWED_TAGS.push("li"));break;case"link":Y&&D.ALLOWED_TAGS.push("a"),j&&(D.ALLOWED_ATTR.push("href"),D.ALLOWED_ATTR.push("target"),D.ALLOWED_ATTR.push("rel"));break;case"image":Y&&D.ALLOWED_TAGS.push("img"),j&&(D.ALLOWED_ATTR.push("src"),D.ALLOWED_ATTR.push("title"),D.ALLOWED_ATTR.push("alt"));break;case"video":Y&&D.ALLOWED_TAGS.push("iframe"),j&&(D.ALLOWED_ATTR.push("frameborder"),D.ALLOWED_ATTR.push("allowfullscreen"),D.ALLOWED_ATTR.push("src"));break;case"blockquote":Y&&D.ALLOWED_TAGS.push(z[0])}})}return D}},{key:"substitute",value:function(k,R){var D,U=["h1","h2","h3","h4","h5","h6"],Y=["p","div","section","article","fieldset","address","aside","blockquote","canvas","dl","figcaption","figure","footer","form","header","main","nav","noscript","ol","pre","table","tfoot","ul","video"],j=["li","dt","dd","hr"];f.a.addHook("uponSanitizeElement",function(I,B,M){for(var $=0;!D&&$<3;)R.ALLOWED_TAGS.includes(Y[$])&&(D=Y[$]),++$;if(D&&I.tagName&&!R.ALLOWED_TAGS.includes(I.tagName.toLowerCase())){var K=I.tagName.toLowerCase();U.includes(K)?I.innerHTML="<".concat(D,"><b>").concat(I.innerHTML,"</b></").concat(D,">"):Y.includes(K)?I.innerHTML="<".concat(D,">").concat(I.innerHTML,"</").concat(D,">"):j.includes(K)&&(I.innerHTML="".concat(I.innerHTML,"<br>"))}}),k=f.a.sanitize(k,w(w({},R),{RETURN_DOM:!0,WHOLE_DOCUMENT:!1})),f.a.removeAllHooks();var G,z=function(I){var B=document.createElement(I.tagName.toLowerCase()),M=I.attributes;return M.length&&Array.from(M).forEach(function($){return B.setAttribute($.nodeName,$.value)}),B},q=0,L=document.createElement("body");return function I(B,M){for(M(B,q),B=q<=1?B.firstChild:void 0;B;)++q,I(B,M),B=B.nextSibling;--q}(k,function(I,B){if(B===1)if(I.tagName&&Y.includes(I.tagName.toLowerCase())){G&&(G=void 0);var M=z(I);M.innerHTML=I.innerHTML,L.appendChild(M)}else if(G===void 0&&(G=document.createElement(D),L.appendChild(G)),I.tagName){var $=z(I);I.innerHTML&&($.innerHTML=I.innerHTML),G.appendChild($)}else{var K=document.createTextNode(I.textContent);G.appendChild(K)}}),L}},{key:"isURL",value:function(k){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(k)}}])&&E(P.prototype,_),C}(d);l.a.register("modules/clipboard",O,!0),i.default=O}])})})(yD);var gS={},vS={exports:{}},ol={},sc={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */sc.exports;var U4;function bD(){return U4||(U4=1,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof Se=="object"&&Se;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,l=2147483647,u=36,f=1,p=26,S=38,w=700,g=72,E=128,m="-",v=/^xn--/,y=/[^\x20-\x7E]/,h=/[\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"},b=u-f,O=Math.floor,x=String.fromCharCode,P;function _(L){throw new RangeError(d[L])}function A(L,I){for(var B=L.length,M=[];B--;)M[B]=I(L[B]);return M}function C(L,I){var B=L.split("@"),M="";B.length>1&&(M=B[0]+"@",L=B[1]),L=L.replace(h,".");var $=L.split("."),K=A($,I).join(".");return M+K}function k(L){for(var I=[],B=0,M=L.length,$,K;B<M;)$=L.charCodeAt(B++),$>=55296&&$<=56319&&B<M?(K=L.charCodeAt(B++),(K&64512)==56320?I.push((($&1023)<<10)+(K&1023)+65536):(I.push($),B--)):I.push($);return I}function R(L){return A(L,function(I){var B="";return I>65535&&(I-=65536,B+=x(I>>>10&1023|55296),I=56320|I&1023),B+=x(I),B}).join("")}function D(L){return L-48<10?L-22:L-65<26?L-65:L-97<26?L-97:u}function U(L,I){return L+22+75*(L<26)-((I!=0)<<5)}function Y(L,I,B){var M=0;for(L=B?O(L/w):L>>1,L+=O(L/I);L>b*p>>1;M+=u)L=O(L/b);return O(M+(b+1)*L/(L+S))}function j(L){var I=[],B=L.length,M,$=0,K=E,V=g,H,X,Z,J,ee,re,ne,de,pe;for(H=L.lastIndexOf(m),H<0&&(H=0),X=0;X<H;++X)L.charCodeAt(X)>=128&&_("not-basic"),I.push(L.charCodeAt(X));for(Z=H>0?H+1:0;Z<B;){for(J=$,ee=1,re=u;Z>=B&&_("invalid-input"),ne=D(L.charCodeAt(Z++)),(ne>=u||ne>O((l-$)/ee))&&_("overflow"),$+=ne*ee,de=re<=V?f:re>=V+p?p:re-V,!(ne<de);re+=u)pe=u-de,ee>O(l/pe)&&_("overflow"),ee*=pe;M=I.length+1,V=Y($-J,M,J==0),O($/M)>l-K&&_("overflow"),K+=O($/M),$%=M,I.splice($++,0,K)}return R(I)}function G(L){var I,B,M,$,K,V,H,X,Z,J,ee,re=[],ne,de,pe,Me;for(L=k(L),ne=L.length,I=E,B=0,K=g,V=0;V<ne;++V)ee=L[V],ee<128&&re.push(x(ee));for(M=$=re.length,$&&re.push(m);M<ne;){for(H=l,V=0;V<ne;++V)ee=L[V],ee>=I&&ee<H&&(H=ee);for(de=M+1,H-I>O((l-B)/de)&&_("overflow"),B+=(H-I)*de,I=H,V=0;V<ne;++V)if(ee=L[V],ee<I&&++B>l&&_("overflow"),ee==I){for(X=B,Z=u;J=Z<=K?f:Z>=K+p?p:Z-K,!(X<J);Z+=u)Me=X-J,pe=u-J,re.push(x(U(J+Me%pe,0))),X=O(Me/pe);re.push(x(U(X,0))),K=Y(B,de,M==$),B=0,++M}++B,++I}return re.join("")}function z(L){return C(L,function(I){return v.test(I)?j(I.slice(4).toLowerCase()):I})}function q(L){return C(L,function(I){return y.test(I)?"xn--"+G(I):I})}if(o={version:"1.4.1",ucs2:{decode:k,encode:R},decode:j,encode:G,toASCII:q,toUnicode:z},n&&i)if(e.exports==n)i.exports=o;else for(P in o)o.hasOwnProperty(P)&&(n[P]=o[P]);else r.punycode=o})(Se)}(sc,sc.exports)),sc.exports}var mg,H4;function _D(){return H4||(H4=1,mg=Error),mg}var yg,G4;function wD(){return G4||(G4=1,yg=EvalError),yg}var bg,$4;function SD(){return $4||($4=1,bg=RangeError),bg}var _g,V4;function ED(){return V4||(V4=1,_g=ReferenceError),_g}var wg,q4;function mS(){return q4||(q4=1,wg=SyntaxError),wg}var Sg,W4;function Ef(){return W4||(W4=1,Sg=TypeError),Sg}var Eg,Y4;function OD(){return Y4||(Y4=1,Eg=URIError),Eg}var Og,K4;function xD(){return K4||(K4=1,Og=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}),Og}var xg,X4;function PD(){if(X4)return xg;X4=1;var e=typeof Symbol<"u"&&Symbol,t=xD();return xg=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},xg}var Pg,Z4;function CD(){if(Z4)return Pg;Z4=1;var e={__proto__:null,foo:{}},t=Object;return Pg=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)},Pg}var Cg,Q4;function TD(){if(Q4)return Cg;Q4=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 p=[],S=0;S<u.length;S+=1)p[S]=u[S];for(var w=0;w<f.length;w+=1)p[w+u.length]=f[w];return p},a=function(u,f){for(var p=[],S=f||0,w=0;S<u.length;S+=1,w+=1)p[w]=u[S];return p},o=function(l,u){for(var f="",p=0;p<l.length;p+=1)f+=l[p],p+1<l.length&&(f+=u);return f};return Cg=function(u){var f=this;if(typeof f!="function"||t.apply(f)!==n)throw new TypeError(e+f);for(var p=a(arguments,1),S,w=function(){if(this instanceof S){var y=f.apply(this,i(p,arguments));return Object(y)===y?y:this}return f.apply(u,i(p,arguments))},g=r(0,f.length-p.length),E=[],m=0;m<g;m++)E[m]="$"+m;if(S=Function("binder","return function ("+o(E,",")+"){ return binder.apply(this,arguments); }")(w),f.prototype){var v=function(){};v.prototype=f.prototype,S.prototype=new v,v.prototype=null}return S},Cg}var Tg,J4;function P2(){if(J4)return Tg;J4=1;var e=TD();return Tg=Function.prototype.bind||e,Tg}var Ag,e_;function AD(){if(e_)return Ag;e_=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=P2();return Ag=r.call(e,t),Ag}var kg,t_;function Ou(){if(t_)return kg;t_=1;var e,t=_D(),r=wD(),n=SD(),i=ED(),a=mS(),o=Ef(),l=OD(),u=Function,f=function(G){try{return u('"use strict"; return ('+G+").constructor;")()}catch{}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch{p=null}var S=function(){throw new o},w=p?function(){try{return arguments.callee,S}catch{try{return p(arguments,"callee").get}catch{return S}}}():S,g=PD()(),E=CD()(),m=Object.getPrototypeOf||(E?function(G){return G.__proto__}:null),v={},y=typeof Uint8Array>"u"||!m?e:m(Uint8Array),h={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":g&&m?m([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%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%":v,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&m?m(m([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!g||!m?e:m(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"||!g||!m?e:m(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&m?m(""[Symbol.iterator]()):e,"%Symbol%":g?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":w,"%TypedArray%":y,"%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(m)try{null.error}catch(G){var d=m(m(G));h["%Error.prototype%"]=d}var b=function G(z){var q;if(z==="%AsyncFunction%")q=f("async function () {}");else if(z==="%GeneratorFunction%")q=f("function* () {}");else if(z==="%AsyncGeneratorFunction%")q=f("async function* () {}");else if(z==="%AsyncGenerator%"){var L=G("%AsyncGeneratorFunction%");L&&(q=L.prototype)}else if(z==="%AsyncIteratorPrototype%"){var I=G("%AsyncGenerator%");I&&m&&(q=m(I.prototype))}return h[z]=q,q},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"]},x=P2(),P=AD(),_=x.call(Function.call,Array.prototype.concat),A=x.call(Function.apply,Array.prototype.splice),C=x.call(Function.call,String.prototype.replace),k=x.call(Function.call,String.prototype.slice),R=x.call(Function.call,RegExp.prototype.exec),D=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,U=/\\(\\)?/g,Y=function(z){var q=k(z,0,1),L=k(z,-1);if(q==="%"&&L!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(L==="%"&&q!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var I=[];return C(z,D,function(B,M,$,K){I[I.length]=$?C(K,U,"$1"):M||B}),I},j=function(z,q){var L=z,I;if(P(O,L)&&(I=O[L],L="%"+I[0]+"%"),P(h,L)){var B=h[L];if(B===v&&(B=b(L)),typeof B>"u"&&!q)throw new o("intrinsic "+z+" exists, but is not available. Please file an issue!");return{alias:I,name:L,value:B}}throw new a("intrinsic "+z+" does not exist!")};return kg=function(z,q){if(typeof z!="string"||z.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof q!="boolean")throw new o('"allowMissing" argument must be a boolean');if(R(/^%?[^%]*%?$/,z)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var L=Y(z),I=L.length>0?L[0]:"",B=j("%"+I+"%",q),M=B.name,$=B.value,K=!1,V=B.alias;V&&(I=V[0],A(L,_([0,1],V)));for(var H=1,X=!0;H<L.length;H+=1){var Z=L[H],J=k(Z,0,1),ee=k(Z,-1);if((J==='"'||J==="'"||J==="`"||ee==='"'||ee==="'"||ee==="`")&&J!==ee)throw new a("property names with quotes must have matching quotes");if((Z==="constructor"||!X)&&(K=!0),I+="."+Z,M="%"+I+"%",P(h,M))$=h[M];else if($!=null){if(!(Z in $)){if(!q)throw new o("base intrinsic for "+z+" exists, but the property is not available.");return}if(p&&H+1>=L.length){var re=p($,Z);X=!!re,X&&"get"in re&&!("originalValue"in re.get)?$=re.get:$=$[Z]}else X=P($,Z),$=$[Z];X&&!K&&(h[M]=$)}}return $},kg}var Rg={exports:{}},Lg,r_;function C2(){if(r_)return Lg;r_=1;var e=Ou(),t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return Lg=t,Lg}var Mg,n_;function yS(){if(n_)return Mg;n_=1;var e=Ou(),t=e("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return Mg=t,Mg}var Ng,i_;function kD(){if(i_)return Ng;i_=1;var e=C2(),t=mS(),r=Ef(),n=yS();return Ng=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,p=arguments.length>5?arguments[5]:null,S=arguments.length>6?arguments[6]:!1,w=!!n&&n(a,o);if(e)e(a,o,{configurable:p===null&&w?w.configurable:!p,enumerable:u===null&&w?w.enumerable:!u,value:l,writable:f===null&&w?w.writable:!f});else if(S||!u&&!f&&!p)a[o]=l;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Ng}var Ig,a_;function RD(){if(a_)return Ig;a_=1;var e=C2(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Ig=t,Ig}var Dg,o_;function LD(){if(o_)return Dg;o_=1;var e=Ou(),t=kD(),r=RD()(),n=yS(),i=Ef(),a=e("%Math.floor%");return Dg=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],p=!0,S=!0;if("length"in l&&n){var w=n(l,"length");w&&!w.configurable&&(p=!1),w&&!w.writable&&(S=!1)}return(p||S||!f)&&(r?t(l,"length",u,!0,!0):t(l,"length",u)),l},Dg}var l_;function MD(){return l_||(l_=1,function(e){var t=P2(),r=Ou(),n=LD(),i=Ef(),a=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),l=r("%Reflect.apply%",!0)||t.call(o,a),u=C2(),f=r("%Math.max%");e.exports=function(w){if(typeof w!="function")throw new i("a function is required");var g=l(t,o,arguments);return n(g,1+f(0,w.length-(arguments.length-1)),!0)};var p=function(){return l(t,a,arguments)};u?u(e.exports,"apply",{value:p}):e.exports.apply=p}(Rg)),Rg.exports}var Fg,s_;function ND(){if(s_)return Fg;s_=1;var e=Ou(),t=MD(),r=t(e("String.prototype.indexOf"));return Fg=function(i,a){var o=e(i,!!a);return typeof o=="function"&&r(i,".prototype.")>-1?t(o):o},Fg}const ID={},DD=Object.freeze(Object.defineProperty({__proto__:null,default:ID},Symbol.toStringTag,{value:"Module"})),FD=Lo(DD);var jg,u_;function jD(){if(u_)return jg;u_=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,p=typeof WeakSet=="function"&&WeakSet.prototype,S=p?WeakSet.prototype.has:null,w=typeof WeakRef=="function"&&WeakRef.prototype,g=w?WeakRef.prototype.deref:null,E=Boolean.prototype.valueOf,m=Object.prototype.toString,v=Function.prototype.toString,y=String.prototype.match,h=String.prototype.slice,d=String.prototype.replace,b=String.prototype.toUpperCase,O=String.prototype.toLowerCase,x=RegExp.prototype.test,P=Array.prototype.concat,_=Array.prototype.join,A=Array.prototype.slice,C=Math.floor,k=typeof BigInt=="function"?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,U=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Y=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===U||!0)?Symbol.toStringTag:null,j=Object.prototype.propertyIsEnumerable,G=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(le){return le.__proto__}:null);function z(le,he){if(le===1/0||le===-1/0||le!==le||le&&le>-1e3&&le<1e3||x.call(/e/,he))return he;var nt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof le=="number"){var Ee=le<0?-C(-le):C(le);if(Ee!==le){var je=String(Ee),Le=h.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 q=FD,L=q.custom,I=ee(L)?L:null;jg=function le(he,nt,Ee,je){var Le=nt||{};if(de(Le,"quoteStyle")&&Le.quoteStyle!=="single"&&Le.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(de(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 we=de(Le,"customInspect")?Le.customInspect:!0;if(typeof we!="boolean"&&we!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(de(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(de(Le,"numericSeparator")&&typeof Le.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Ze=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 Oe=String(he);return Ze?z(he,Oe):Oe}if(typeof he=="bigint"){var We=String(he)+"n";return Ze?z(he,We):We}var ke=typeof Le.depth>"u"?5:Le.depth;if(typeof Ee>"u"&&(Ee=0),Ee>=ke&&ke>0&&typeof he=="object")return $(he)?"[Array]":"[Object]";var ze=tt(Le,Ee);if(typeof je>"u")je=[];else if(Fe(je,he)>=0)return"[Circular]";function Xe(vr,kr,Mn){if(kr&&(je=A.call(je),je.push(kr)),Mn){var gi={depth:Le.depth};return de(Le,"quoteStyle")&&(gi.quoteStyle=Le.quoteStyle),le(vr,gi,Ee+1,je)}return le(vr,Le,Ee+1,je)}if(typeof he=="function"&&!V(he)){var ot=Me(he),Et=Ht(he,Xe);return"[Function"+(ot?": "+ot:" (anonymous)")+"]"+(Et.length>0?" { "+_.call(Et,", ")+" }":"")}if(ee(he)){var jr=U?d.call(String(he),/^(Symbol\(.*\))_[^)]*$/,"$1"):D.call(he);return typeof he=="object"&&!U?Pe(jr):jr}if(ue(he)){for(var Jt="<"+O.call(String(he.nodeName)),Sr=he.attributes||[],on=0;on<Sr.length;on++)Jt+=" "+Sr[on].name+"="+B(M(Sr[on].value),"double",Le);return Jt+=">",he.childNodes&&he.childNodes.length&&(Jt+="..."),Jt+="</"+O.call(String(he.nodeName))+">",Jt}if($(he)){if(he.length===0)return"[]";var Ln=Ht(he,Xe);return ze&&!xt(Ln)?"["+St(Ln,ze)+"]":"[ "+_.call(Ln,", ")+" ]"}if(H(he)){var De=Ht(he,Xe);return!("cause"in Error.prototype)&&"cause"in he&&!j.call(he,"cause")?"{ ["+String(he)+"] "+_.call(P.call("[cause]: "+Xe(he.cause),De),", ")+" }":De.length===0?"["+String(he)+"]":"{ ["+String(he)+"] "+_.call(De,", ")+" }"}if(typeof he=="object"&&we){if(I&&typeof he[I]=="function"&&q)return q(he,{depth:ke-Ee});if(we!=="symbol"&&typeof he.inspect=="function")return he.inspect()}if(fe(he)){var Je=[];return n&&n.call(he,function(vr,kr){Je.push(Xe(kr,he,!0)+" => "+Xe(vr,he))}),Ie("Map",r.call(he),Je,ze)}if(ge(he)){var Qe=[];return l&&l.call(he,function(vr){Qe.push(Xe(vr,he))}),Ie("Set",o.call(he),Qe,ze)}if(ie(he))return xe("WeakMap");if(te(he))return xe("WeakSet");if(ve(he))return xe("WeakRef");if(Z(he))return Pe(Xe(Number(he)));if(re(he))return Pe(Xe(k.call(he)));if(J(he))return Pe(E.call(he));if(X(he))return Pe(Xe(String(he)));if(typeof window<"u"&&he===window)return"{ [object Window] }";if(he===Se)return"{ [object globalThis] }";if(!K(he)&&!V(he)){var At=Ht(he,Xe),rt=G?G(he)===Object.prototype:he instanceof Object||he.constructor===Object,er=he instanceof Object?"":"null prototype",mt=!rt&&Y&&Object(he)===he&&Y in he?h.call(pe(he),8,-1):er?"Object":"",Gt=rt||typeof he.constructor!="function"?"":he.constructor.name?he.constructor.name+" ":"",zr=Gt+(mt||er?"["+_.call(P.call([],mt||[],er||[]),": ")+"] ":"");return At.length===0?zr+"{}":ze?zr+"{"+St(At,ze)+"}":zr+"{ "+_.call(At,", ")+" }"}return String(he)};function B(le,he,nt){var Ee=(nt.quoteStyle||he)==="double"?'"':"'";return Ee+le+Ee}function M(le){return d.call(String(le),/"/g,"&quot;")}function $(le){return pe(le)==="[object Array]"&&(!Y||!(typeof le=="object"&&Y in le))}function K(le){return pe(le)==="[object Date]"&&(!Y||!(typeof le=="object"&&Y in le))}function V(le){return pe(le)==="[object RegExp]"&&(!Y||!(typeof le=="object"&&Y in le))}function H(le){return pe(le)==="[object Error]"&&(!Y||!(typeof le=="object"&&Y in le))}function X(le){return pe(le)==="[object String]"&&(!Y||!(typeof le=="object"&&Y in le))}function Z(le){return pe(le)==="[object Number]"&&(!Y||!(typeof le=="object"&&Y in le))}function J(le){return pe(le)==="[object Boolean]"&&(!Y||!(typeof le=="object"&&Y in le))}function ee(le){if(U)return le&&typeof le=="object"&&le instanceof Symbol;if(typeof le=="symbol")return!0;if(!le||typeof le!="object"||!D)return!1;try{return D.call(le),!0}catch{}return!1}function re(le){if(!le||typeof le!="object"||!k)return!1;try{return k.call(le),!0}catch{}return!1}var ne=Object.prototype.hasOwnProperty||function(le){return le in this};function de(le,he){return ne.call(le,he)}function pe(le){return m.call(le)}function Me(le){if(le.name)return le.name;var he=y.call(v.call(le),/^function\s*([\w$]+)/);return he?he[1]:null}function Fe(le,he){if(le.indexOf)return le.indexOf(he);for(var nt=0,Ee=le.length;nt<Ee;nt++)if(le[nt]===he)return nt;return-1}function fe(le){if(!r||!le||typeof le!="object")return!1;try{r.call(le);try{o.call(le)}catch{return!0}return le instanceof Map}catch{}return!1}function ie(le){if(!f||!le||typeof le!="object")return!1;try{f.call(le,f);try{S.call(le,S)}catch{return!0}return le instanceof WeakMap}catch{}return!1}function ve(le){if(!g||!le||typeof le!="object")return!1;try{return g.call(le),!0}catch{}return!1}function ge(le){if(!o||!le||typeof le!="object")return!1;try{o.call(le);try{r.call(le)}catch{return!0}return le instanceof Set}catch{}return!1}function te(le){if(!S||!le||typeof le!="object")return!1;try{S.call(le,S);try{f.call(le,f)}catch{return!0}return le instanceof WeakSet}catch{}return!1}function ue(le){return!le||typeof le!="object"?!1:typeof HTMLElement<"u"&&le instanceof HTMLElement?!0:typeof le.nodeName=="string"&&typeof le.getAttribute=="function"}function be(le,he){if(le.length>he.maxStringLength){var nt=le.length-he.maxStringLength,Ee="... "+nt+" more character"+(nt>1?"s":"");return be(h.call(le,0,he.maxStringLength),he)+Ee}var je=d.call(d.call(le,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,se);return B(je,"single",he)}function se(le){var he=le.charCodeAt(0),nt={8:"b",9:"t",10:"n",12:"f",13:"r"}[he];return nt?"\\"+nt:"\\x"+(he<16?"0":"")+b.call(he.toString(16))}function Pe(le){return"Object("+le+")"}function xe(le){return le+" { ? }"}function Ie(le,he,nt,Ee){var je=Ee?St(nt,Ee):_.call(nt,", ");return le+" ("+he+") {"+je+"}"}function xt(le){for(var he=0;he<le.length;he++)if(Fe(le[he],`
156
+ `)>=0)return!1;return!0}function tt(le,he){var nt;if(le.indent===" ")nt=" ";else if(typeof le.indent=="number"&&le.indent>0)nt=_.call(Array(le.indent+1)," ");else return null;return{base:nt,prev:_.call(Array(he+1),nt)}}function St(le,he){if(le.length===0)return"";var nt=`
157
+ `+he.prev+he.base;return nt+_.call(le,","+nt)+`
158
+ `+he.prev}function Ht(le,he){var nt=$(le),Ee=[];if(nt){Ee.length=le.length;for(var je=0;je<le.length;je++)Ee[je]=de(le,je)?he(le[je],le):""}var Le=typeof R=="function"?R(le):[],we;if(U){we={};for(var Ze=0;Ze<Le.length;Ze++)we["$"+Le[Ze]]=Le[Ze]}for(var Oe in le)de(le,Oe)&&(nt&&String(Number(Oe))===Oe&&Oe<le.length||U&&we["$"+Oe]instanceof Symbol||(x.call(/[^\w$]/,Oe)?Ee.push(he(Oe,le)+": "+he(le[Oe],le)):Ee.push(Oe+": "+he(le[Oe],le))));if(typeof R=="function")for(var We=0;We<Le.length;We++)j.call(le,Le[We])&&Ee.push("["+he(Le[We])+"]: "+he(le[Le[We]],le));return Ee}return jg}var zg,c_;function zD(){if(c_)return zg;c_=1;var e=Ou(),t=ND(),r=jD(),n=Ef(),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),p=t("Map.prototype.set",!0),S=t("Map.prototype.has",!0),w=function(v,y){for(var h=v,d;(d=h.next)!==null;h=d)if(d.key===y)return h.next=d.next,d.next=v.next,v.next=d,d},g=function(v,y){var h=w(v,y);return h&&h.value},E=function(v,y,h){var d=w(v,y);d?d.value=h:v.next={key:y,next:v.next,value:h}},m=function(v,y){return!!w(v,y)};return zg=function(){var y,h,d,b={assert:function(O){if(!b.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(y)return o(y,O)}else if(a){if(h)return f(h,O)}else if(d)return g(d,O)},has:function(O){if(i&&O&&(typeof O=="object"||typeof O=="function")){if(y)return u(y,O)}else if(a){if(h)return S(h,O)}else if(d)return m(d,O);return!1},set:function(O,x){i&&O&&(typeof O=="object"||typeof O=="function")?(y||(y=new i),l(y,O,x)):a?(h||(h=new a),p(h,O,x)):(d||(d={key:{},next:null}),E(d,O,x))}};return b},zg}var Bg,f_;function T2(){if(f_)return Bg;f_=1;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Bg={default:r.RFC3986,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},Bg}var Ug,d_;function bS(){if(d_)return Ug;d_=1;var e=T2(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var v=[],y=0;y<256;++y)v.push("%"+((y<16?"0":"")+y.toString(16)).toUpperCase());return v}(),i=function(y){for(;y.length>1;){var h=y.pop(),d=h.obj[h.prop];if(r(d)){for(var b=[],O=0;O<d.length;++O)typeof d[O]<"u"&&b.push(d[O]);h.obj[h.prop]=b}}},a=function(y,h){for(var d=h&&h.plainObjects?Object.create(null):{},b=0;b<y.length;++b)typeof y[b]<"u"&&(d[b]=y[b]);return d},o=function v(y,h,d){if(!h)return y;if(typeof h!="object"){if(r(y))y.push(h);else if(y&&typeof y=="object")(d&&(d.plainObjects||d.allowPrototypes)||!t.call(Object.prototype,h))&&(y[h]=!0);else return[y,h];return y}if(!y||typeof y!="object")return[y].concat(h);var b=y;return r(y)&&!r(h)&&(b=a(y,d)),r(y)&&r(h)?(h.forEach(function(O,x){if(t.call(y,x)){var P=y[x];P&&typeof P=="object"&&O&&typeof O=="object"?y[x]=v(P,O,d):y.push(O)}else y[x]=O}),y):Object.keys(h).reduce(function(O,x){var P=h[x];return t.call(O,x)?O[x]=v(O[x],P,d):O[x]=P,O},b)},l=function(y,h){return Object.keys(h).reduce(function(d,b){return d[b]=h[b],d},y)},u=function(v,y,h){var d=v.replace(/\+/g," ");if(h==="iso-8859-1")return d.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(d)}catch{return d}},f=1024,p=function(y,h,d,b,O){if(y.length===0)return y;var x=y;if(typeof y=="symbol"?x=Symbol.prototype.toString.call(y):typeof y!="string"&&(x=String(y)),d==="iso-8859-1")return escape(x).replace(/%u[0-9a-f]{4}/gi,function(D){return"%26%23"+parseInt(D.slice(2),16)+"%3B"});for(var P="",_=0;_<x.length;_+=f){for(var A=x.length>=f?x.slice(_,_+f):x,C=[],k=0;k<A.length;++k){var R=A.charCodeAt(k);if(R===45||R===46||R===95||R===126||R>=48&&R<=57||R>=65&&R<=90||R>=97&&R<=122||O===e.RFC1738&&(R===40||R===41)){C[C.length]=A.charAt(k);continue}if(R<128){C[C.length]=n[R];continue}if(R<2048){C[C.length]=n[192|R>>6]+n[128|R&63];continue}if(R<55296||R>=57344){C[C.length]=n[224|R>>12]+n[128|R>>6&63]+n[128|R&63];continue}k+=1,R=65536+((R&1023)<<10|A.charCodeAt(k)&1023),C[C.length]=n[240|R>>18]+n[128|R>>12&63]+n[128|R>>6&63]+n[128|R&63]}P+=C.join("")}return P},S=function(y){for(var h=[{obj:{o:y},prop:"o"}],d=[],b=0;b<h.length;++b)for(var O=h[b],x=O.obj[O.prop],P=Object.keys(x),_=0;_<P.length;++_){var A=P[_],C=x[A];typeof C=="object"&&C!==null&&d.indexOf(C)===-1&&(h.push({obj:x,prop:A}),d.push(C))}return i(h),y},w=function(y){return Object.prototype.toString.call(y)==="[object RegExp]"},g=function(y){return!y||typeof y!="object"?!1:!!(y.constructor&&y.constructor.isBuffer&&y.constructor.isBuffer(y))},E=function(y,h){return[].concat(y,h)},m=function(y,h){if(r(y)){for(var d=[],b=0;b<y.length;b+=1)d.push(h(y[b]));return d}return h(y)};return Ug={arrayToObject:a,assign:l,combine:E,compact:S,decode:u,encode:p,isBuffer:g,isRegExp:w,maybeMap:m,merge:o},Ug}var Hg,h_;function BD(){if(h_)return Hg;h_=1;var e=zD(),t=bS(),r=T2(),n=Object.prototype.hasOwnProperty,i={brackets:function(v){return v+"[]"},comma:"comma",indices:function(v,y){return v+"["+y+"]"},repeat:function(v){return v}},a=Array.isArray,o=Array.prototype.push,l=function(m,v){o.apply(m,a(v)?v:[v])},u=Date.prototype.toISOString,f=r.default,p={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(v){return u.call(v)},skipNulls:!1,strictNullHandling:!1},S=function(v){return typeof v=="string"||typeof v=="number"||typeof v=="boolean"||typeof v=="symbol"||typeof v=="bigint"},w={},g=function m(v,y,h,d,b,O,x,P,_,A,C,k,R,D,U,Y,j,G){for(var z=v,q=G,L=0,I=!1;(q=q.get(w))!==void 0&&!I;){var B=q.get(v);if(L+=1,typeof B<"u"){if(B===L)throw new RangeError("Cyclic object value");I=!0}typeof q.get(w)>"u"&&(L=0)}if(typeof A=="function"?z=A(y,z):z instanceof Date?z=R(z):h==="comma"&&a(z)&&(z=t.maybeMap(z,function(pe){return pe instanceof Date?R(pe):pe})),z===null){if(O)return _&&!Y?_(y,p.encoder,j,"key",D):y;z=""}if(S(z)||t.isBuffer(z)){if(_){var M=Y?y:_(y,p.encoder,j,"key",D);return[U(M)+"="+U(_(z,p.encoder,j,"value",D))]}return[U(y)+"="+U(String(z))]}var $=[];if(typeof z>"u")return $;var K;if(h==="comma"&&a(z))Y&&_&&(z=t.maybeMap(z,_)),K=[{value:z.length>0?z.join(",")||null:void 0}];else if(a(A))K=A;else{var V=Object.keys(z);K=C?V.sort(C):V}var H=P?y.replace(/\./g,"%2E"):y,X=d&&a(z)&&z.length===1?H+"[]":H;if(b&&a(z)&&z.length===0)return X+"[]";for(var Z=0;Z<K.length;++Z){var J=K[Z],ee=typeof J=="object"&&typeof J.value<"u"?J.value:z[J];if(!(x&&ee===null)){var re=k&&P?J.replace(/\./g,"%2E"):J,ne=a(z)?typeof h=="function"?h(X,re):X:X+(k?"."+re:"["+re+"]");G.set(v,L);var de=e();de.set(w,G),l($,m(ee,ne,h,d,b,O,x,P,h==="comma"&&Y&&a(z)?null:_,A,C,k,R,D,U,Y,j,de))}}return $},E=function(v){if(!v)return p;if(typeof v.allowEmptyArrays<"u"&&typeof v.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof v.encodeDotInKeys<"u"&&typeof v.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(v.encoder!==null&&typeof v.encoder<"u"&&typeof v.encoder!="function")throw new TypeError("Encoder has to be a function.");var y=v.charset||p.charset;if(typeof v.charset<"u"&&v.charset!=="utf-8"&&v.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var h=r.default;if(typeof v.format<"u"){if(!n.call(r.formatters,v.format))throw new TypeError("Unknown format option provided.");h=v.format}var d=r.formatters[h],b=p.filter;(typeof v.filter=="function"||a(v.filter))&&(b=v.filter);var O;if(v.arrayFormat in i?O=v.arrayFormat:"indices"in v?O=v.indices?"indices":"repeat":O=p.arrayFormat,"commaRoundTrip"in v&&typeof v.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var x=typeof v.allowDots>"u"?v.encodeDotInKeys===!0?!0:p.allowDots:!!v.allowDots;return{addQueryPrefix:typeof v.addQueryPrefix=="boolean"?v.addQueryPrefix:p.addQueryPrefix,allowDots:x,allowEmptyArrays:typeof v.allowEmptyArrays=="boolean"?!!v.allowEmptyArrays:p.allowEmptyArrays,arrayFormat:O,charset:y,charsetSentinel:typeof v.charsetSentinel=="boolean"?v.charsetSentinel:p.charsetSentinel,commaRoundTrip:v.commaRoundTrip,delimiter:typeof v.delimiter>"u"?p.delimiter:v.delimiter,encode:typeof v.encode=="boolean"?v.encode:p.encode,encodeDotInKeys:typeof v.encodeDotInKeys=="boolean"?v.encodeDotInKeys:p.encodeDotInKeys,encoder:typeof v.encoder=="function"?v.encoder:p.encoder,encodeValuesOnly:typeof v.encodeValuesOnly=="boolean"?v.encodeValuesOnly:p.encodeValuesOnly,filter:b,format:h,formatter:d,serializeDate:typeof v.serializeDate=="function"?v.serializeDate:p.serializeDate,skipNulls:typeof v.skipNulls=="boolean"?v.skipNulls:p.skipNulls,sort:typeof v.sort=="function"?v.sort:null,strictNullHandling:typeof v.strictNullHandling=="boolean"?v.strictNullHandling:p.strictNullHandling}};return Hg=function(m,v){var y=m,h=E(v),d,b;typeof h.filter=="function"?(b=h.filter,y=b("",y)):a(h.filter)&&(b=h.filter,d=b);var O=[];if(typeof y!="object"||y===null)return"";var x=i[h.arrayFormat],P=x==="comma"&&h.commaRoundTrip;d||(d=Object.keys(y)),h.sort&&d.sort(h.sort);for(var _=e(),A=0;A<d.length;++A){var C=d[A];h.skipNulls&&y[C]===null||l(O,g(y[C],C,x,P,h.allowEmptyArrays,h.strictNullHandling,h.skipNulls,h.encodeDotInKeys,h.encode?h.encoder:null,h.filter,h.sort,h.allowDots,h.serializeDate,h.format,h.formatter,h.encodeValuesOnly,h.charset,_))}var k=O.join(h.delimiter),R=h.addQueryPrefix===!0?"?":"";return h.charsetSentinel&&(h.charset==="iso-8859-1"?R+="utf8=%26%2310003%3B&":R+="utf8=%E2%9C%93&"),k.length>0?R+k:""},Hg}var Gg,p_;function UD(){if(p_)return Gg;p_=1;var e=bS(),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(w){return w.replace(/&#(\d+);/g,function(g,E){return String.fromCharCode(parseInt(E,10))})},a=function(w,g){return w&&typeof w=="string"&&g.comma&&w.indexOf(",")>-1?w.split(","):w},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(g,E){var m={__proto__:null},v=E.ignoreQueryPrefix?g.replace(/^\?/,""):g,y=E.parameterLimit===1/0?void 0:E.parameterLimit,h=v.split(E.delimiter,y),d=-1,b,O=E.charset;if(E.charsetSentinel)for(b=0;b<h.length;++b)h[b].indexOf("utf8=")===0&&(h[b]===l?O="utf-8":h[b]===o&&(O="iso-8859-1"),d=b,b=h.length);for(b=0;b<h.length;++b)if(b!==d){var x=h[b],P=x.indexOf("]="),_=P===-1?x.indexOf("="):P+1,A,C;_===-1?(A=E.decoder(x,n.decoder,O,"key"),C=E.strictNullHandling?null:""):(A=E.decoder(x.slice(0,_),n.decoder,O,"key"),C=e.maybeMap(a(x.slice(_+1),E),function(R){return E.decoder(R,n.decoder,O,"value")})),C&&E.interpretNumericEntities&&O==="iso-8859-1"&&(C=i(C)),x.indexOf("[]=")>-1&&(C=r(C)?[C]:C);var k=t.call(m,A);k&&E.duplicates==="combine"?m[A]=e.combine(m[A],C):(!k||E.duplicates==="last")&&(m[A]=C)}return m},f=function(w,g,E,m){for(var v=m?g:a(g,E),y=w.length-1;y>=0;--y){var h,d=w[y];if(d==="[]"&&E.parseArrays)h=E.allowEmptyArrays&&v===""?[]:[].concat(v);else{h=E.plainObjects?Object.create(null):{};var b=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,O=E.decodeDotInKeys?b.replace(/%2E/g,"."):b,x=parseInt(O,10);!E.parseArrays&&O===""?h={0:v}:!isNaN(x)&&d!==O&&String(x)===O&&x>=0&&E.parseArrays&&x<=E.arrayLimit?(h=[],h[x]=v):O!=="__proto__"&&(h[O]=v)}v=h}return v},p=function(g,E,m,v){if(g){var y=m.allowDots?g.replace(/\.([^.[]+)/g,"[$1]"):g,h=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,b=m.depth>0&&h.exec(y),O=b?y.slice(0,b.index):y,x=[];if(O){if(!m.plainObjects&&t.call(Object.prototype,O)&&!m.allowPrototypes)return;x.push(O)}for(var P=0;m.depth>0&&(b=d.exec(y))!==null&&P<m.depth;){if(P+=1,!m.plainObjects&&t.call(Object.prototype,b[1].slice(1,-1))&&!m.allowPrototypes)return;x.push(b[1])}return b&&x.push("["+y.slice(b.index)+"]"),f(x,E,m,v)}},S=function(g){if(!g)return n;if(typeof g.allowEmptyArrays<"u"&&typeof g.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof g.decodeDotInKeys<"u"&&typeof g.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(g.decoder!==null&&typeof g.decoder<"u"&&typeof g.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof g.charset<"u"&&g.charset!=="utf-8"&&g.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var E=typeof g.charset>"u"?n.charset:g.charset,m=typeof g.duplicates>"u"?n.duplicates:g.duplicates;if(m!=="combine"&&m!=="first"&&m!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var v=typeof g.allowDots>"u"?g.decodeDotInKeys===!0?!0:n.allowDots:!!g.allowDots;return{allowDots:v,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof g.allowPrototypes=="boolean"?g.allowPrototypes:n.allowPrototypes,allowSparse:typeof g.allowSparse=="boolean"?g.allowSparse:n.allowSparse,arrayLimit:typeof g.arrayLimit=="number"?g.arrayLimit:n.arrayLimit,charset:E,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:n.charsetSentinel,comma:typeof g.comma=="boolean"?g.comma:n.comma,decodeDotInKeys:typeof g.decodeDotInKeys=="boolean"?g.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof g.decoder=="function"?g.decoder:n.decoder,delimiter:typeof g.delimiter=="string"||e.isRegExp(g.delimiter)?g.delimiter:n.delimiter,depth:typeof g.depth=="number"||g.depth===!1?+g.depth:n.depth,duplicates:m,ignoreQueryPrefix:g.ignoreQueryPrefix===!0,interpretNumericEntities:typeof g.interpretNumericEntities=="boolean"?g.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof g.parameterLimit=="number"?g.parameterLimit:n.parameterLimit,parseArrays:g.parseArrays!==!1,plainObjects:typeof g.plainObjects=="boolean"?g.plainObjects:n.plainObjects,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:n.strictNullHandling}};return Gg=function(w,g){var E=S(g);if(w===""||w===null||typeof w>"u")return E.plainObjects?Object.create(null):{};for(var m=typeof w=="string"?u(w,E):w,v=E.plainObjects?Object.create(null):{},y=Object.keys(m),h=0;h<y.length;++h){var d=y[h],b=p(d,m[d],E,typeof w=="string");v=e.merge(v,b,E)}return E.allowSparse===!0?v:e.compact(v)},Gg}var $g,g_;function HD(){if(g_)return $g;g_=1;var e=BD(),t=UD(),r=T2();return $g={formats:r,parse:t,stringify:e},$g}var v_;function _S(){if(v_)return ol;v_=1;var e=bD();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",`
159
+ `," "],o=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(o),u=["%","/","?",";","#"].concat(l),f=["/","?","#"],p=255,S=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=HD();function y(O,x,P){if(O&&typeof O=="object"&&O instanceof t)return O;var _=new t;return _.parse(O,x,P),_}t.prototype.parse=function(O,x,P){if(typeof O!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof O);var _=O.indexOf("?"),A=_!==-1&&_<O.indexOf("#")?"?":"#",C=O.split(A),k=/\\/g;C[0]=C[0].replace(k,"/"),O=C.join(A);var R=O;if(R=R.trim(),!P&&O.split("#").length===1){var D=i.exec(R);if(D)return this.path=R,this.href=R,this.pathname=D[1],D[2]?(this.search=D[2],x?this.query=v.parse(this.search.substr(1)):this.query=this.search.substr(1)):x&&(this.search="",this.query={}),this}var U=r.exec(R);if(U){U=U[0];var Y=U.toLowerCase();this.protocol=Y,R=R.substr(U.length)}if(P||U||R.match(/^\/\/[^@/]+@[^@/]+/)){var j=R.substr(0,2)==="//";j&&!(U&&E[U])&&(R=R.substr(2),this.slashes=!0)}if(!E[U]&&(j||U&&!m[U])){for(var G=-1,z=0;z<f.length;z++){var q=R.indexOf(f[z]);q!==-1&&(G===-1||q<G)&&(G=q)}var L,I;G===-1?I=R.lastIndexOf("@"):I=R.lastIndexOf("@",G),I!==-1&&(L=R.slice(0,I),R=R.slice(I+1),this.auth=decodeURIComponent(L)),G=-1;for(var z=0;z<u.length;z++){var q=R.indexOf(u[z]);q!==-1&&(G===-1||q<G)&&(G=q)}G===-1&&(G=R.length),this.host=R.slice(0,G),R=R.slice(G),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var M=this.hostname.split(/\./),z=0,$=M.length;z<$;z++){var K=M[z];if(K&&!K.match(S)){for(var V="",H=0,X=K.length;H<X;H++)K.charCodeAt(H)>127?V+="x":V+=K[H];if(!V.match(S)){var Z=M.slice(0,z),J=M.slice(z+1),ee=K.match(w);ee&&(Z.push(ee[1]),J.unshift(ee[2])),J.length&&(R="/"+J.join(".")+R),this.hostname=Z.join(".");break}}}this.hostname.length>p?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=e.toASCII(this.hostname));var re=this.port?":"+this.port:"",ne=this.hostname||"";this.host=ne+re,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),R[0]!=="/"&&(R="/"+R))}if(!g[Y])for(var z=0,$=l.length;z<$;z++){var de=l[z];if(R.indexOf(de)!==-1){var pe=encodeURIComponent(de);pe===de&&(pe=escape(de)),R=R.split(de).join(pe)}}var Me=R.indexOf("#");Me!==-1&&(this.hash=R.substr(Me),R=R.slice(0,Me));var Fe=R.indexOf("?");if(Fe!==-1?(this.search=R.substr(Fe),this.query=R.substr(Fe+1),x&&(this.query=v.parse(this.query)),R=R.slice(0,Fe)):x&&(this.search="",this.query={}),R&&(this.pathname=R),m[Y]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var re=this.pathname||"",fe=this.search||"";this.path=re+fe}return this.href=this.format(),this};function h(O){return typeof O=="string"&&(O=y(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 x=this.protocol||"",P=this.pathname||"",_=this.hash||"",A=!1,C="";this.host?A=O+this.host:this.hostname&&(A=O+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(A+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(C=v.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var k=this.search||C&&"?"+C||"";return x&&x.substr(-1)!==":"&&(x+=":"),this.slashes||(!x||m[x])&&A!==!1?(A="//"+(A||""),P&&P.charAt(0)!=="/"&&(P="/"+P)):A||(A=""),_&&_.charAt(0)!=="#"&&(_="#"+_),k&&k.charAt(0)!=="?"&&(k="?"+k),P=P.replace(/[?#]/g,function(R){return encodeURIComponent(R)}),k=k.replace("#","%23"),x+A+P+k+_};function d(O,x){return y(O,!1,!0).resolve(x)}t.prototype.resolve=function(O){return this.resolveObject(y(O,!1,!0)).format()};function b(O,x){return O?y(O,!1,!0).resolveObject(x):x}return t.prototype.resolveObject=function(O){if(typeof O=="string"){var x=new t;x.parse(O,!1,!0),O=x}for(var P=new t,_=Object.keys(this),A=0;A<_.length;A++){var C=_[A];P[C]=this[C]}if(P.hash=O.hash,O.href==="")return P.href=P.format(),P;if(O.slashes&&!O.protocol){for(var k=Object.keys(O),R=0;R<k.length;R++){var D=k[R];D!=="protocol"&&(P[D]=O[D])}return m[P.protocol]&&P.hostname&&!P.pathname&&(P.pathname="/",P.path=P.pathname),P.href=P.format(),P}if(O.protocol&&O.protocol!==P.protocol){if(!m[O.protocol]){for(var U=Object.keys(O),Y=0;Y<U.length;Y++){var j=U[Y];P[j]=O[j]}return P.href=P.format(),P}if(P.protocol=O.protocol,!O.host&&!E[O.protocol]){for(var $=(O.pathname||"").split("/");$.length&&!(O.host=$.shift()););O.host||(O.host=""),O.hostname||(O.hostname=""),$[0]!==""&&$.unshift(""),$.length<2&&$.unshift(""),P.pathname=$.join("/")}else P.pathname=O.pathname;if(P.search=O.search,P.query=O.query,P.host=O.host||"",P.auth=O.auth,P.hostname=O.hostname||O.host,P.port=O.port,P.pathname||P.search){var G=P.pathname||"",z=P.search||"";P.path=G+z}return P.slashes=P.slashes||O.slashes,P.href=P.format(),P}var q=P.pathname&&P.pathname.charAt(0)==="/",L=O.host||O.pathname&&O.pathname.charAt(0)==="/",I=L||q||P.host&&O.pathname,B=I,M=P.pathname&&P.pathname.split("/")||[],$=O.pathname&&O.pathname.split("/")||[],K=P.protocol&&!m[P.protocol];if(K&&(P.hostname="",P.port=null,P.host&&(M[0]===""?M[0]=P.host:M.unshift(P.host)),P.host="",O.protocol&&(O.hostname=null,O.port=null,O.host&&($[0]===""?$[0]=O.host:$.unshift(O.host)),O.host=null),I=I&&($[0]===""||M[0]==="")),L)P.host=O.host||O.host===""?O.host:P.host,P.hostname=O.hostname||O.hostname===""?O.hostname:P.hostname,P.search=O.search,P.query=O.query,M=$;else if($.length)M||(M=[]),M.pop(),M=M.concat($),P.search=O.search,P.query=O.query;else if(O.search!=null){if(K){P.host=M.shift(),P.hostname=P.host;var V=P.host&&P.host.indexOf("@")>0?P.host.split("@"):!1;V&&(P.auth=V.shift(),P.hostname=V.shift(),P.host=P.hostname)}return P.search=O.search,P.query=O.query,(P.pathname!==null||P.search!==null)&&(P.path=(P.pathname?P.pathname:"")+(P.search?P.search:"")),P.href=P.format(),P}if(!M.length)return P.pathname=null,P.search?P.path="/"+P.search:P.path=null,P.href=P.format(),P;for(var H=M.slice(-1)[0],X=(P.host||O.host||M.length>1)&&(H==="."||H==="..")||H==="",Z=0,J=M.length;J>=0;J--)H=M[J],H==="."?M.splice(J,1):H===".."?(M.splice(J,1),Z++):Z&&(M.splice(J,1),Z--);if(!I&&!B)for(;Z--;Z)M.unshift("..");I&&M[0]!==""&&(!M[0]||M[0].charAt(0)!=="/")&&M.unshift(""),X&&M.join("/").substr(-1)!=="/"&&M.push("");var ee=M[0]===""||M[0]&&M[0].charAt(0)==="/";if(K){P.hostname=ee?"":M.length?M.shift():"",P.host=P.hostname;var V=P.host&&P.host.indexOf("@")>0?P.host.split("@"):!1;V&&(P.auth=V.shift(),P.hostname=V.shift(),P.host=P.hostname)}return I=I||P.host&&M.length,I&&!ee&&M.unshift(""),M.length>0?P.pathname=M.join("/"):(P.pathname=null,P.path=null),(P.pathname!==null||P.search!==null)&&(P.path=(P.pathname?P.pathname:"")+(P.search?P.search:"")),P.auth=O.auth||P.auth,P.slashes=P.slashes||O.slashes,P.href=P.format(),P},t.prototype.parseHost=function(){var O=this.host,x=n.exec(O);x&&(x=x[0],x!==":"&&(this.port=x.substr(1)),O=O.substr(0,O.length-x.length)),O&&(this.hostname=O)},ol.parse=y,ol.resolve=d,ol.resolveObject=b,ol.format=h,ol.Url=t,ol}var Vg={exports:{}},m_;function GD(){return m_||(m_=1,function(e){(function(t,r){e.exports?e.exports=r():t.xmlserializer=r()})(Se,function(){var t=function(g){return g.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(g){return g.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},n=function(g){return g.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},i=function(g){var E=g.value;return" "+g.name+'="'+r(E)+'"'},a=function(g){var E=g.tagName;return g.namespaceURI==="http://www.w3.org/1999/xhtml"&&(E=E.toLowerCase()),E},o=function(g,E){var m=Array.prototype.map.call(g.attributes||g.attrs,function(v){return v.name}).indexOf("xmlns")>=0;return!m&&(E||g.namespaceURI!==g.parentNode.namespaceURI)?' xmlns="'+g.namespaceURI+'"':""},l=function(g){return Array.prototype.map.call(g.childNodes,function(E){return w(E)}).join("")},u=function(g,E){var m="<"+a(g);return m+=o(g,E),Array.prototype.forEach.call(g.attributes||g.attrs,function(v){m+=i(v)}),g.childNodes.length>0?(m+=">",m+=l(g),m+="</"+a(g)+">"):m+="/>",m},f=function(g){var E=g.nodeValue||g.value||"";return n(E)},p=function(g){return"<!--"+g.data.replace(/-/g,"&#45;")+"-->"},S=function(g){return"<![CDATA["+g.nodeValue+"]]>"},w=function(g,E){var m=E&&E.rootNode;if(g.nodeName==="#document"||g.nodeName==="#document-fragment")return l(g);if(g.tagName)return u(g,m);if(g.nodeName==="#text")return f(g);if(g.nodeName==="#comment")return p(g);if(g.nodeName==="#cdata-section")return S(g)};return{serializeToString:function(g){return t(w(g,{rootNode:!0}))}}})}(Vg)),Vg.exports}var qg={},y_;function $D(){if(y_)return qg;y_=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[^>]*>(.+?)
160
+ ?</div>`),new RegExp(`^(.+)
161
+ `)],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 Wg={},Yg={},b_;function g0(){return b_||(b_=1,function(e){var t=_S();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(p){u.push(p)})})).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,p){var S=new window.XMLHttpRequest,w=e.joinUrl(u.baseUrl,l),g,E=function(){p({msg:"Unable to load url",url:w})};g=n(w,u.cache),S.addEventListener("load",function(){S.status===200||S.status===0?f(S.response):E()},!1),S.addEventListener("error",E,!1);try{S.open("GET",g,!0),S.overrideMimeType(u.mimeType),S.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(p){for(var S="",w=0;w<p.length;w++)S+=String.fromCharCode(p.charCodeAt(w)&255);return S})};var i=function(l){var u=function(f,p){return f.substring(0,p.length)===p};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 p=btoa(f),S=i(f);return"data:"+S+";base64,"+p})};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 p=Array.prototype.slice.call(arguments),S=u(p),w=o(l),g;return f[w]&&f[w][S]?f[w][S]:(g=l.apply(null,p),f[w]=f[w]||{},f[w][S]=g,g)}}}(Yg)),Yg}var Kg={},__;function VD(){if(__)return Kg;__=1;var e=g0(),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(p){return p},function(p){throw{resourceType:"image",url:p.url,msg:"Unable to load image "+p.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 Kg.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 p=r(l);return e.collectAndReportErrors(p.map(function(S){return t(S,o).then(function(w){S.attributes.src?S.attributes.src.value=w:S.attributes["xlink:href"]?S.attributes["xlink:href"].value=w:S.attributes.href&&(S.attributes.href.value=w)})}))},Kg}var Xg={},w_;function qD(){if(w_)return Xg;w_=1;var e=g0(),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(p){throw{resourceType:"script",url:p.url,msg:"Unable to load script "+p.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 Xg.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)})}))},Xg}var Zg={},Qg={},S_;function A2(){return S_||(S_=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)}}(Qg)),Qg}var Jg={},E_;function WD(){return E_||(E_=1,function(e){var t=A2(),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*$",p=new RegExp(u,"g"),S,w=[],g=function(E){var m=new RegExp(l,"g"),v=[],y;for(y=m.exec(E);y;)v.push(y[1]),y=m.exec(E);return v};if(a.match(new RegExp(f))){for(S=p.exec(a);S;)w.push(g(S[0])),S=p.exec(a);return w}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(", ")}}(Jg)),Jg}function zd(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 ev={exports:{}},O_;function YD(){return O_||(O_=1,function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,a){function o(f,p){if(!i[f]){if(!n[f]){var S=typeof zd=="function"&&zd;if(!p&&S)return S(f,!0);if(l)return l(f,!0);var w=new Error("Cannot find module '"+f+"'");throw w.code="MODULE_NOT_FOUND",w}var g=i[f]={exports:{}};n[f][0].call(g.exports,function(E){var m=n[f][1][E];return o(m||E)},g,g.exports,r,n,i,a)}return i[f].exports}for(var l=typeof zd=="function"&&zd,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,f){function p(){this.constructor=u}p.prototype=f.prototype,u.prototype=new p}function o(u,f,p,S){this.message=u,this.expected=f,this.found=p,this.location=S,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,f){var p={literal:function(y){return'"'+w(y.text)+'"'},class:function(y){var h="",d;for(d=0;d<y.parts.length;d++)h+=y.parts[d]instanceof Array?g(y.parts[d][0])+"-"+g(y.parts[d][1]):g(y.parts[d]);return"["+(y.inverted?"^":"")+h+"]"},any:function(y){return"any character"},end:function(y){return"end of input"},other:function(y){return y.description}};function S(y){return y.charCodeAt(0).toString(16).toUpperCase()}function w(y){return y.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(h){return"\\x0"+S(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+S(h)})}function g(y){return y.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(h){return"\\x0"+S(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+S(h)})}function E(y){return p[y.type](y)}function m(y){var h=new Array(y.length),d,b;for(d=0;d<y.length;d++)h[d]=E(y[d]);if(h.sort(),h.length>0){for(d=1,b=1;d<h.length;d++)h[d-1]!==h[d]&&(h[b]=h[d],b++);h.length=b}switch(h.length){case 1:return h[0];case 2:return h[0]+" or "+h[1];default:return h.slice(0,-1).join(", ")+", or "+h[h.length-1]}}function v(y){return y?'"'+w(y)+'"':"end of input"}return"Expected "+m(u)+" but "+v(f)+" found."};function l(u,f){f=f!==void 0?f:{};var p={},S={start:re},w=re,g="",E=function(){return[]},m=",",v=K(",",!1),y=function(te,ue){return[te].concat(ue)},h=function(te){return[te]},d=function(te,ue){return{url:te,format:ue}},b=function(te){return{url:te}},O="url(",x=K("url(",!1),P=")",_=K(")",!1),A=function(te){return te},C="format(",k=K("format(",!1),R="local(",D=K("local(",!1),U=function(te){return{local:te}},Y=/^[^)]/,j=V([")"],!0,!1),G=function(te){return ge.extractValue(te.join(""))},z=/^[ \t\r\n\f]/,q=V([" "," ","\r",`
162
+ `,"\f"],!1,!1),L=0,I=[{line:1,column:1}],B=0,M=[],$;if("startRule"in f){if(!(f.startRule in S))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');w=S[f.startRule]}function K(te,ue){return{type:"literal",text:te,ignoreCase:ue}}function V(te,ue,be){return{type:"class",parts:te,inverted:ue,ignoreCase:be}}function H(){return{type:"end"}}function X(te){var ue=I[te],be;if(ue)return ue;for(be=te-1;!I[be];)be--;for(ue=I[be],ue={line:ue.line,column:ue.column};be<te;)u.charCodeAt(be)===10?(ue.line++,ue.column=1):ue.column++,be++;return I[te]=ue,ue}function Z(te,ue){var be=X(te),se=X(ue);return{start:{offset:te,line:be.line,column:be.column},end:{offset:ue,line:se.line,column:se.column}}}function J(te){L<B||(L>B&&(B=L,M=[]),M.push(te))}function ee(te,ue,be){return new o(o.buildMessage(te,ue),te,ue,be)}function re(){var te,ue;return te=ne(),te===p&&(te=L,ue=g,ue!==p&&(ue=E()),te=ue),te}function ne(){var te,ue,be,se,Pe,xe;if(te=L,ue=de(),ue!==p){for(be=[],se=ve();se!==p;)be.push(se),se=ve();if(be!==p)if(u.charCodeAt(L)===44?(se=m,L++):(se=p,J(v)),se!==p){for(Pe=[],xe=ve();xe!==p;)Pe.push(xe),xe=ve();Pe!==p?(xe=ne(),xe!==p?(ue=y(ue,xe),te=ue):(L=te,te=p)):(L=te,te=p)}else L=te,te=p;else L=te,te=p}else L=te,te=p;return te===p&&(te=L,ue=de(),ue!==p&&(ue=h(ue)),te=ue),te}function de(){var te;return te=pe(),te===p&&(te=fe()),te}function pe(){var te,ue,be,se;if(te=L,ue=Me(),ue!==p){if(be=[],se=ve(),se!==p)for(;se!==p;)be.push(se),se=ve();else be=p;be!==p?(se=Fe(),se!==p?(ue=d(ue,se),te=ue):(L=te,te=p)):(L=te,te=p)}else L=te,te=p;return te===p&&(te=L,ue=Me(),ue!==p&&(ue=b(ue)),te=ue),te}function Me(){var te,ue,be,se;return te=L,u.substr(L,4)===O?(ue=O,L+=4):(ue=p,J(x)),ue!==p?(be=ie(),be!==p?(u.charCodeAt(L)===41?(se=P,L++):(se=p,J(_)),se!==p?(ue=A(be),te=ue):(L=te,te=p)):(L=te,te=p)):(L=te,te=p),te}function Fe(){var te,ue,be,se;return te=L,u.substr(L,7)===C?(ue=C,L+=7):(ue=p,J(k)),ue!==p?(be=ie(),be!==p?(u.charCodeAt(L)===41?(se=P,L++):(se=p,J(_)),se!==p?(ue=A(be),te=ue):(L=te,te=p)):(L=te,te=p)):(L=te,te=p),te}function fe(){var te,ue,be,se;return te=L,u.substr(L,6)===R?(ue=R,L+=6):(ue=p,J(D)),ue!==p?(be=ie(),be!==p?(u.charCodeAt(L)===41?(se=P,L++):(se=p,J(_)),se!==p?(ue=U(be),te=ue):(L=te,te=p)):(L=te,te=p)):(L=te,te=p),te}function ie(){var te,ue,be;if(te=L,ue=[],Y.test(u.charAt(L))?(be=u.charAt(L),L++):(be=p,J(j)),be!==p)for(;be!==p;)ue.push(be),Y.test(u.charAt(L))?(be=u.charAt(L),L++):(be=p,J(j));else ue=p;return ue!==p&&(ue=G(ue)),te=ue,te}function ve(){var te;return z.test(u.charAt(L))?(te=u.charAt(L),L++):(te=p,J(q)),te}var ge=r("../util");if($=w(),$!==p&&L===u.length)return $;throw $!==p&&L<u.length&&J(H()),ee(M,B<u.length?u.charAt(B):null,B<u.length?Z(B,B+1):Z(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)})}(ev)),ev.exports}var x_;function KD(){return x_||(x_=1,function(e){var t=g0(),r=A2(),n=WD(),i=YD(),a=function(h,d,b){h.style.setProperty(d,b,h.style.getPropertyPriority(d))},o=function(h){return h.filter(function(d){return d.type===window.CSSRule.STYLE_RULE&&(d.style.getPropertyValue("background-image")||d.style.getPropertyValue("background"))})},l=function(h){var d=[];return h.forEach(function(b){b.style.getPropertyValue("background-image")?d.push({property:"background-image",value:b.style.getPropertyValue("background-image"),rule:b}):b.style.getPropertyValue("background")&&d.push({property:"background",value:b.style.getPropertyValue("background"),rule:b})}),d},u=function(h){return h.filter(function(d){return d.type===window.CSSRule.FONT_FACE_RULE&&d.style.getPropertyValue("src")})},f=function(h){return h.filter(function(d){return d.type===window.CSSRule.IMPORT_RULE&&d.href})},p=function(h){var d=[];return h.forEach(function(b,O){b.url&&!t.isDataUri(b.url)&&d.push(O)}),d},S=function(h){var d=[];return h.forEach(function(b,O){b.url&&!t.isDataUri(b.url)&&d.push(O)}),d};e.adjustPathsOfCssResources=function(h,d){var b=o(d),O=l(b),x=!1;return O.forEach(function(P){var _=n.parse(P.value),A=p(_),C;A.length>0&&(A.forEach(function(k){var R=_[k].url,D=t.joinUrl(h,R);_[k].url=D}),C=n.serialize(_),a(P.rule,P.property,C),x=!0)}),u(d).forEach(function(P){var _=P.style.getPropertyValue("src"),A,C;try{A=i.parse(_)}catch{return}C=S(A),C.length>0&&(C.forEach(function(k){var R=A[k].url,D=t.joinUrl(h,R);A[k].url=D}),r.changeFontFaceRuleSrc(d,P,i.serialize(A)),x=!0)}),f(d).forEach(function(P){var _=P.href,A=t.joinUrl(h,_);r.exchangeRule(d,P,"@import url("+A+");"),x=!0}),x};var w=function(h,d,b){var O=h.indexOf(d);h.splice(O,1),b.forEach(function(x,P){h.splice(O+P,0,x)})},g=function(h,d,b,O){var x=d.href,P;return x=r.unquoteString(x),P=t.joinUrl(O.baseUrl,x),b.indexOf(P)>=0?(w(h,d,[]),Promise.resolve([])):(b.push(P),t.ajax(x,O).then(function(_){var A=r.rulesForCssText(_);return e.loadCSSImportsForRules(A,b,O).then(function(C){return e.adjustPathsOfCssResources(x,A),w(h,d,A),C.errors})},function(_){throw{resourceType:"stylesheet",url:_.url,msg:"Unable to load stylesheet "+_.url}}))};e.loadCSSImportsForRules=function(h,d,b){var O=f(h),x=[],P=!1;return Promise.all(O.map(function(_){return g(h,_,d,b).then(function(A){x=x.concat(A),P=!0},function(A){x.push(A)})})).then(function(){return{hasChanges:P,errors:x}})};var E=function(h,d){var b=n.parse(h),O=p(b),x=!1;return t.collectAndReportErrors(O.map(function(P){var _=b[P].url;return t.getDataURIForImageURL(_,d).then(function(A){b[P].url=A,x=!0},function(A){throw{resourceType:"backgroundImage",url:A.url,msg:"Unable to load background-image "+A.url}})})).then(function(P){return{backgroundValue:n.serialize(b),hasChanges:x,errors:P}})},m=function(h,d){var b=o(h),O=l(b),x=[],P=!1;return Promise.all(O.map(function(_){return E(_.value,d).then(function(A){A.hasChanges&&(a(_.rule,_.property,A.backgroundValue),P=!0),x=x.concat(A.errors)})})).then(function(){return{hasChanges:P,errors:x}})},v=function(h,d){var b=!1,O,x;try{O=i.parse(h)}catch{O=[]}return x=S(O),t.collectAndReportErrors(x.map(function(P){var _=O[P],A=_.format||"woff";return t.binaryAjax(_.url,d).then(function(C){var k=btoa(C);_.url="data:font/"+A+";base64,"+k,b=!0},function(C){throw{resourceType:"fontFace",url:C.url,msg:"Unable to load font-face "+C.url}})})).then(function(P){return{srcDeclarationValue:i.serialize(O),hasChanges:b,errors:P}})},y=function(h,d){var b=u(h),O=[],x=!1;return Promise.all(b.map(function(P){var _=P.style.getPropertyValue("src");return v(_,d).then(function(A){A.hasChanges&&(r.changeFontFaceRuleSrc(h,P,A.srcDeclarationValue),x=!0),O=O.concat(A.errors)})})).then(function(){return{hasChanges:x,errors:O}})};e.loadAndInlineCSSResourcesForRules=function(h,d){var b=!1,O=[];return Promise.all([m,y].map(function(x){return x(h,d).then(function(P){b=b||P.hasChanges,O=O.concat(P.errors)})})).then(function(){return{hasChanges:b,errors:O}})}}(Zg)),Zg}var P_;function XD(){return P_||(P_=1,function(e){var t=g0(),r=VD(),n=qD(),i=KD(),a=A2(),o=function(v){return t.joinUrl(v,".")},l=function(v){var y=v.map(function(h,d){return d===v.length-1&&(h={baseUrl:o(h.baseUrl)}),JSON.stringify(h)});return y},u=function(v,y){return y.cache!==!1&&y.cache!=="none"&&y.cacheBucket?t.memoize(v,l,y.cacheBucket):v},f=function(v,y,h){var d=a.rulesForCssText(v);return i.loadCSSImportsForRules(d,y,h).then(function(b){return i.loadAndInlineCSSResourcesForRules(d,h).then(function(O){var x=b.errors.concat(O.errors),P=b.hasChanges||O.hasChanges;return P&&(v=a.cssRulesToText(d)),{hasChanges:P,content:v,errors:x}})})},p=function(v,y,h){var d=v.textContent,b=u(f,y);return b(d,h,y).then(function(O){return O.hasChanges&&(v.childNodes[0].nodeValue=O.content),t.cloneArray(O.errors)})},S=function(v){var y=v.getElementsByTagName("style");return Array.prototype.filter.call(y,function(h){return!h.attributes.type||h.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(v,y){var h=S(v),d=[],b=[],O;return O=t.clone(y),O.baseUrl=O.baseUrl||t.getDocumentBaseUrl(v),Promise.all(h.map(function(x){return p(x,O,b).then(function(P){d=d.concat(P)})})).then(function(){return d})};var w=function(v,y){var h=v.parentNode,d;y=y.trim(),y&&(d=v.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(v.ownerDocument.createTextNode(y)),h.insertBefore(d,v)),h.removeChild(v)},g=function(v,y){return t.ajax(v,y).then(function(h){var d=a.rulesForCssText(h);return{content:h,cssRules:d}}).then(function(h){var d=i.adjustPathsOfCssResources(v,h.cssRules);return{content:h.content,cssRules:h.cssRules,hasChanges:d}}).then(function(h){return i.loadCSSImportsForRules(h.cssRules,[],y).then(function(d){return{content:h.content,cssRules:h.cssRules,hasChanges:h.hasChanges||d.hasChanges,errors:d.errors}})}).then(function(h){return i.loadAndInlineCSSResourcesForRules(h.cssRules,y).then(function(d){return{content:h.content,cssRules:h.cssRules,hasChanges:h.hasChanges||d.hasChanges,errors:h.errors.concat(d.errors)}})}).then(function(h){var d=h.content;return h.hasChanges&&(d=a.cssRulesToText(h.cssRules)),{content:d,errors:h.errors}})},E=function(v,y){var h=v.attributes.href.value,d=t.getDocumentBaseUrl(v.ownerDocument),b=t.clone(y);!b.baseUrl&&d&&(b.baseUrl=d);var O=u(g,y);return O(h,b).then(function(x){return{content:x.content,errors:t.cloneArray(x.errors)}})},m=function(v){var y=v.getElementsByTagName("link");return Array.prototype.filter.call(y,function(h){return h.attributes.rel&&h.attributes.rel.value==="stylesheet"&&(!h.attributes.type||h.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(v,y){var h=m(v),d=[];return Promise.all(h.map(function(b){return E(b,y).then(function(O){w(b,O.content+`
163
+ `),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(v,y){var h=[],d=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return y.inlineScripts!==!1&&d.push(e.loadAndInlineScript),Promise.all(d.map(function(b){return b(v,y).then(function(O){h=h.concat(O)})})).then(function(){return h})}}(Wg)),Wg}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
164
+ * http://www.github.com/cburgmer/rasterizeHTML.js
165
+ * 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(_S(),GD(),$D(),XD()):t.rasterizeHTML=r(t.url,t.xmlserializer,t.sanedomparsererror,t.inlineresources)})(Se,function(t,r,n,i){var a=function(E){var m={},v=[];m.joinUrl=function(d,b){return d?E.resolve(d,b):b},m.getConstantUniqueIdFor=function(d){return v.indexOf(d)<0&&v.push(d),v.indexOf(d)},m.clone=function(d){var b={},O;for(O in d)d.hasOwnProperty(O)&&(b[O]=d[O]);return b};var y=function(d){return typeof d=="object"&&d!==null},h=function(d){return y(d)&&Object.prototype.toString.apply(d).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return m.parseOptionalParameters=function(d){var b={canvas:null,options:{}};return d[0]==null||h(d[0])?(b.canvas=d[0]||null,b.options=m.clone(d[1])):b.options=m.clone(d[0]),b},m}(t),o=function(E){var m={},v=function(y,h,d){var b=y[h];return y[h]=function(){var O=Array.prototype.slice.call(arguments);return d.apply(this,[O,b])},b};return m.baseUrlRespectingXhr=function(y,h){var d=function(){var b=new y;return v(b,"open",function(O,x){var P=O.shift(),_=O.shift(),A=E.joinUrl(h,_);return x.apply(this,[P,A].concat(O))}),b};return d},m.finishNotifyingXhr=function(y){var h=0,d=0,b=!1,O,x=new Promise(function(_){O=function(){var A=h-d;A<=0&&b&&_({totalCount:h})}}),P=function(){var _=new y;return v(_,"send",function(A,C){return h+=1,C.apply(this,arguments)}),_.addEventListener("load",function(){d+=1,O()}),_};return P.waitForRequestsToFinish=function(){return b=!0,O(),x},P},m}(a),l=function(){var E={},m=function(P){return Array.prototype.slice.call(P)};E.addClassName=function(P,_){P.className+=" "+_},E.addClassNameRecursively=function(P,_){E.addClassName(P,_),P.parentNode!==P.ownerDocument&&E.addClassNameRecursively(P.parentNode,_)};var v=function(P,_){var A=P.parentStyleSheet,C=m(A.cssRules).indexOf(P);A.insertRule(_,C+1),A.deleteRule(C)},y=function(P,_){var A=P.cssText.replace(/^[^\{]+/,""),C=_+" "+A;v(P,C)},h=function(P){return m(P).reduce(function(_,A){return _+A.cssText},"")},d=function(P){P.textContent=h(P.sheet.cssRules)},b=function(P){var _=document.implementation.createHTMLDocument(""),A=document.createElement("style");A.textContent=P.textContent,_.body.appendChild(A),P.sheet=A.sheet},O=function(P){return"((?:^|[^.#:\\w])|(?=\\W))("+P.join("|")+")(?=\\W|$)"},x=function(P,_,A){var C=O(_);m(P.querySelectorAll("style")).forEach(function(k){typeof k.sheet>"u"&&b(k);var R=m(k.sheet.cssRules).filter(function(D){return D.selectorText&&new RegExp(C,"i").test(D.selectorText)});R.length&&(R.forEach(function(D){var U=D.selectorText.replace(new RegExp(C,"gi"),function(Y,j,G){return j+A(G)});U!==D.selectorText&&y(D,U)}),d(k))})};return E.rewriteCssSelectorWith=function(P,_,A){x(P,[_],function(){return A})},E.lowercaseCssTypeSelectors=function(P,_){x(P,_,function(A){return A.toLowerCase()})},E.findHtmlOnlyNodeNames=function(P){var _=P.ownerDocument.createTreeWalker(P,NodeFilter.SHOW_ELEMENT),A={},C={},k;do k=_.currentNode.tagName.toLowerCase(),_.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?A[k]=!0:C[k]=!0;while(_.nextNode());return Object.keys(A).filter(function(R){return!C[R]})},E}(),u=function(E){var m={},v=function(h){return Array.prototype.slice.call(h)},y={active:!0,hover:!0,focus:!1,target:!1};return m.fakeUserAction=function(h,d,b){var O=h.querySelector(d),x=":"+b,P="rasterizehtml"+b;O&&(y[b]?E.addClassNameRecursively(O,P):E.addClassName(O,P),E.rewriteCssSelectorWith(h,x,"."+P))},m.persistInputValues=function(h){var d=h.querySelectorAll("input"),b=h.querySelectorAll("textarea"),O=function(x){return x.type==="checkbox"||x.type==="radio"};v(d).filter(O).forEach(function(x){x.checked?x.setAttribute("checked",""):x.removeAttribute("checked")}),v(d).filter(function(x){return!O(x)}).forEach(function(x){x.setAttribute("value",x.value)}),v(b).forEach(function(x){x.textContent=x.value})},m.rewriteTagNameSelectorsToLowerCase=function(h){E.lowercaseCssTypeSelectors(h,E.findHtmlOnlyNodeNames(h))},m}(l),f=function(E,m,v,y){var h={},d=function(G,z,q,L){var I=G.createElement(z);return I.style.visibility="hidden",I.style.width=q+"px",I.style.height=L+"px",I.style.position="absolute",I.style.top=-1e4-L+"px",I.style.left=-1e4-q+"px",G.getElementsByTagName("body")[0].appendChild(I),I},b=function(G){return G>0?new Promise(function(z){setTimeout(z,G)}):Promise.resolve()};h.executeJavascript=function(G,z){return new Promise(function(q){var L=d(y.document,"iframe",z.width,z.height),I=G.outerHTML,B=[],M=z.executeJsTimeout||0,$=function(){y.document.getElementsByTagName("body")[0].removeChild(L)},K=function(){var Z=L.contentDocument;q({document:Z,errors:B,cleanUp:$})},V=L.contentWindow.XMLHttpRequest,H=m.finishNotifyingXhr(V),X=m.baseUrlRespectingXhr(H,z.baseUrl);L.onload=function(){b(M).then(H.waitForRequestsToFinish).then(K)},L.contentDocument.open(),L.contentWindow.XMLHttpRequest=X,L.contentWindow.onerror=function(Z){B.push({resourceType:"scriptExecution",msg:Z})},L.contentDocument.write("<!DOCTYPE html>"),L.contentDocument.write(I),L.contentDocument.close()})};var O=function(G,z,q){var L=G.createElement("iframe");return L.style.width=z+"px",L.style.height=q+"px",L.style.visibility="hidden",L.style.position="absolute",L.style.top=-1e4-q+"px",L.style.left=-1e4-z+"px",L.style.borderWidth=0,L.sandbox="allow-same-origin",L.scrolling="no",L},x=function(G,z,q){var L=Math.floor(G/q),I=Math.floor(z/q);return O(y.document,L,I)},P=function(G,z,q,L){return{width:Math.max(G.width*L,z),height:Math.max(G.height*L,q)}},_=function(G,z){var q=G.querySelector(z);if(q)return q;if(G.ownerDocument.querySelector(z)===G)return G;throw{message:"Clipping selector not found"}},A=function(G,z,q,L,I){var B=Math.max(G.scrollWidth,G.clientWidth),M=Math.max(G.scrollHeight,G.clientHeight),$,K,V,H,X,Z,J,ee;return z?(Z=_(G,z),J=Z.getBoundingClientRect(),$=J.top,K=J.left,V=J.width,H=J.height):($=0,K=0,V=B,H=M),ee=P({width:V,height:H},q,L,I),X=y.getComputedStyle(G.ownerDocument.documentElement).fontSize,{left:K,top:$,width:ee.width,height:ee.height,viewportWidth:B,viewportHeight:M,rootFontSize:X}},C=function(G,z){var q=G.tagName;return z.querySelector(q)},k=function(G){var z=G.tagName.toLowerCase();return z==="html"||z==="body"?G.outerHTML:'<body style="margin: 0;">'+G.outerHTML+"</body>"};h.calculateDocumentContentSize=function(G,z){return new Promise(function(q,L){var I=z.zoom||1,B;B=x(z.width,z.height,I),y.document.getElementsByTagName("body")[0].appendChild(B),B.onload=function(){var M=B.contentDocument,$;try{$=A(C(G,M),z.clip,z.width,z.height,I),q($)}catch(K){L(K)}finally{y.document.getElementsByTagName("body")[0].removeChild(B)}},B.contentDocument.open(),B.contentDocument.write("<!DOCTYPE html>"),B.contentDocument.write(k(G)),B.contentDocument.close()})},h.parseHtmlFragment=function(G){var z=y.document.implementation.createHTMLDocument("");z.documentElement.innerHTML=G;var q=z.querySelector("body").firstChild;if(!q)throw"Invalid source";return q};var R=function(G,z){var q=/<html((?:\s+[^>]*)?)>/im.exec(z),L=y.document.implementation.createHTMLDocument(""),I,B,M,$;if(q)for(I="<div"+q[1]+"></div>",L.documentElement.innerHTML=I,M=L.querySelector("div"),B=0;B<M.attributes.length;B++)$=M.attributes[B],G.documentElement.setAttribute($.name,$.value)};h.parseHTML=function(G){var z=y.document.implementation.createHTMLDocument("");return z.documentElement.innerHTML=G,R(z,G),z};var D=function(G){try{return v.failOnParseError(G)}catch(z){throw{message:"Invalid source",originalError:z}}};h.validateXHTML=function(G){var z=new DOMParser,q=z.parseFromString(G,"application/xml");D(q)};var U=null,Y=function(G,z){return z==="none"||z==="repeated"?((U===null||z!=="repeated")&&(U=Date.now()),G+"?_="+U):G},j=function(G,z){return new Promise(function(q,L){var I=new window.XMLHttpRequest,B=E.joinUrl(z.baseUrl,G),M=Y(B,z.cache),$=function(K){L({message:"Unable to load page",originalError:K})};I.addEventListener("load",function(){I.status===200||I.status===0?q(I.responseXML):$(I.statusText)},!1),I.addEventListener("error",function(K){$(K)},!1);try{I.open("GET",M,!0),I.responseType="document",I.send(null)}catch(K){$(K)}})};return h.loadDocument=function(G,z){return j(G,z).then(function(q){return D(q)})},h}(a,o,n,window),p=function(E){var m={},v=function(C,k){return k?URL.createObjectURL(new Blob([C],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(C)},y=function(C){C instanceof Blob&&URL.revokeObjectURL(C)},h='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',d=function(C){return new Promise(function(k,R){var D=document.createElement("canvas"),U=new Image;U.onload=function(){var Y=D.getContext("2d");try{Y.drawImage(U,0,0),D.toDataURL("image/png"),k(!0)}catch{k(!1)}},U.onerror=R,U.src=C})},b=function(){var C=v(h,!0);return d(C).then(function(k){return y(C),k?!1:d(v(h,!1)).then(function(R){return R})},function(){return!1})},O=function(){if(E.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},x=function(){return new Promise(function(C,k){O()&&E.URL?b().then(function(R){C(!R)},function(){k()}):C(!1)})},P,_=function(){return P===void 0&&(P=x()),P},A=function(C){return _().then(function(k){return v(C,k)})};return m.renderSvg=function(C){return new Promise(function(k,R){var D,U,Y=function(){U.onload=null,U.onerror=null},j=function(){D&&y(D)};U=new Image,U.onload=function(){Y(),j(),k(U)},U.onerror=function(){j(),R()},A(C).then(function(G){D=G,U.src=D},R)})},m}(window),S=function(E,m,v,y){var h={},d=function(C,k){var R=k||1,D={width:C.width,height:C.height,"font-size":C.rootFontSize};return R!==1&&(D.style="transform:scale("+R+"); transform-origin: 0 0;"),D},b=function(C){var k,R,D,U;k=Math.round(C.viewportWidth),R=Math.round(C.viewportHeight),D=-C.left,U=-C.top;var Y={x:D,y:U,width:k,height:R};return Y},O=function(C){var k=C.style||"";C.style=k+"float: left;"},x=function(C){C.externalResourcesRequired=!0},P=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},_=function(C){var k=Object.keys(C);return k.length?" "+k.map(function(R){return R+'="'+C[R]+'"'}).join(" "):""},A=function(C,k,R){var D=y.serializeToString(C);m.validateXHTML(D);var U=b(k);return O(U),x(U),'<svg xmlns="http://www.w3.org/2000/svg"'+_(d(k,R))+">"+P()+"<foreignObject"+_(U)+">"+D+"</foreignObject></svg>"};return h.getSvgForDocument=function(C,k,R){return v.rewriteTagNameSelectorsToLowerCase(C),A(C,k,R)},h.drawDocumentAsSvg=function(C,k){return["hover","active","focus","target"].forEach(function(R){k[R]&&v.fakeUserAction(C,k[R],R)}),m.calculateDocumentContentSize(C,k).then(function(R){return h.getSvgForDocument(C,R,k.zoom)})},h}(a,f,u,r),w=function(E,m,v,y,h,d){var b={},O=function(C){return{message:"Error rendering page",originalError:C}},x=function(C){return h.renderSvg(C).then(function(k){return{image:k,svg:C}},function(k){throw O(k)})},P=function(C,k){try{k.getContext("2d").drawImage(C,0,0)}catch(R){throw O(R)}},_=function(C,k,R){return y.drawDocumentAsSvg(C,R).then(x).then(function(D){return k&&P(D.image,k),D})},A=function(C,k){return m.executeJavascript(C,k).then(function(R){var D=R.document;return v.persistInputValues(D),{document:D,errors:R.errors,cleanUp:R.cleanUp}})};return b.rasterize=function(C,k,R){var D;return D=E.clone(R),D.inlineScripts=R.executeJs===!0,d.inlineReferences(C,D).then(function(U){return R.executeJs?A(C,R).then(function(Y){return{element:Y.document.documentElement,errors:U.concat(Y.errors),cleanUp:Y.cleanUp}}):{element:C,errors:U,cleanUp:function(){}}}).then(function(U){return _(U.element,k,R).then(function(Y){return U.cleanUp(),{image:Y.image,svg:Y.svg,errors:U.errors}})})},b}(a,f,u,S,p,i),g=function(E,m,v){var y={},h=function(P,_){var A=300,C=200,k=P?P.width:A,R=P?P.height:C,D=_.width!==void 0?_.width:k,U=_.height!==void 0?_.height:R;return{width:D,height:U}},d=function(P){var _=h(P.canvas,P.options),A;return A=E.clone(P.options),A.width=_.width,A.height=_.height,A};y.drawDocument=function(){var P=arguments[0],_=Array.prototype.slice.call(arguments,1),A=E.parseOptionalParameters(_),C=P.documentElement?P.documentElement:P;return v.rasterize(C,A.canvas,d(A))};var b=function(P,_,A){var C=m.parseHTML(P);return y.drawDocument(C,_,A)};y.drawHTML=function(){var P=arguments[0],_=Array.prototype.slice.call(arguments,1),A=E.parseOptionalParameters(_);return b(P,A.canvas,A.options)};var O=function(P,_,A){var C=document.implementation.createHTMLDocument("");C.replaceChild(P.documentElement,C.documentElement);var k=A?E.clone(A):{};return A.baseUrl||(k.baseUrl=_),{document:C,options:k}},x=function(P,_,A){return m.loadDocument(P,A).then(function(C){var k=O(C,P,A);return y.drawDocument(k.document,_,k.options)})};return y.drawURL=function(){var P=arguments[0],_=Array.prototype.slice.call(arguments,1),A=E.parseOptionalParameters(_);return x(P,A.canvas,A.options)},y}(a,f,w);return g})})(vS);var ZD=vS.exports;(function(e){var t=Se&&Se.__createBinding||(Object.create?function(f,p,S,w){w===void 0&&(w=S);var g=Object.getOwnPropertyDescriptor(p,S);g&&!("get"in g?!p.__esModule:g.writable||g.configurable)||(g={enumerable:!0,get:function(){return p[S]}}),Object.defineProperty(f,w,g)}:function(f,p,S,w){w===void 0&&(w=S),f[w]=p[S]}),r=Se&&Se.__setModuleDefault||(Object.create?function(f,p){Object.defineProperty(f,"default",{enumerable:!0,value:p})}:function(f,p){f.default=p}),n=Se&&Se.__importStar||function(f){if(f&&f.__esModule)return f;var p={};if(f!=null)for(var S in f)S!=="default"&&Object.prototype.hasOwnProperty.call(f,S)&&t(p,f,S);return r(p,f),p};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToCanvas=e.detectSize=void 0;const i=n(ZD),a=`
166
+ <style>
167
+ html, body {
168
+ padding: 0;
169
+ margin: 0;
170
+ }
171
+ p {
172
+ margin: 0;
173
+ padding: 0
174
+ }
175
+ ul {
176
+ list-style-position: inside;
177
+ margin: 0;
178
+ }
179
+ </style>
180
+ `,o=document.createElement("div");function l(f){const p=document.createElement("div");p.innerHTML=f,p.style.display="inline-block",p.style.position="fixed",p.style.top="0px",p.style.left="0px",p.style.zIndex="1000",o.appendChild(p);const S=p.getBoundingClientRect();return o.removeChild(p),{width:S.width,height:S.height}}async function u({html:f,width:p,height:S,fontFamily:w,padding:g,font:E,pixelRatio:m}){const v=document.createElement("canvas");w==="Arial"||E||(f+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${w}" rel="stylesheet">`),E&&(f+=`<style>@font-face {font-family: '${E.fontFamily}'; src: url("${E.url}")}</style>`),f+=a;const y=await i.drawHTML(`<div style="padding: ${g}px;">${f}</div>`,v,{width:p+2*g,height:S+2*g});v.width=(p+2*g)*m,v.height=(S+2*g)*m;const h=v.getContext("2d");return h==null||h.drawImage(y.image,0,0,y.image.width*m,y.image.height*m),v}o.id="polotno-hidden-do-not-touch",o.style.overflow="hidden",o.style.position="relative",document.body.appendChild(o),o.innerHTML=`<style>
181
+ #polotno-hidden-do-not-touch p {
182
+ margin: 0;
183
+ padding: 0
184
+ }
185
+ #polotno-hidden-do-not-touch ul {
186
+ list-style-position: inside;
187
+ margin: 0;
188
+ }
189
+ </style>`,e.detectSize=l,e.htmlToCanvas=u})(gS);var k2={},wS={};(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 b=r(d),O=b.data;return b.data="",O},i=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(d,b)=>{let O="",x="",P="";for(let _ in d){let A=d[_];_[0]=="@"?_[1]=="i"?O=_+" "+A+";":x+=_[1]=="f"?o(A,_):_+"{"+o(A,_[1]=="k"?"":b)+"}":typeof A=="object"?x+=o(A,b?b.replace(/([^,])+/g,C=>_.replace(/(^:.*)|([^,])+/g,k=>/&/.test(k)?k.replace(/&/g,C):C?C+" "+k:k)):_):A!=null&&(_=_.replace(/[A-Z]/g,"-$&").toLowerCase(),P+=o.p?o.p(_,A):_+":"+A+";")}return O+(b&&P?b+"{"+P+"}":P)+x},l={},u=d=>{if(typeof d=="object"){let b="";for(let O in d)b+=O+u(d[O]);return b}return d},f=(d,b,O,x,P)=>{let _=u(d),A=l[_]||(l[_]=(C=>{let k=0,R=11;for(;k<C.length;)R=101*R+C.charCodeAt(k++)>>>0;return"go"+R})(_));if(!l[A]){let C=_!==d?d:(k=>{let R,D=[{}];for(;R=i.exec(k.replace(a,""));)R[4]?D.shift():R[3]?D.unshift(D[0][R[3]]=D[0][R[3]]||{}):D[0][R[1]]=R[2];return D[0]})(d);l[A]=o(P?{["@keyframes "+A]:C}:C,O?"":"."+A)}return((C,k,R)=>{k.data.indexOf(C)==-1&&(k.data=R?C+k.data:k.data+C)})(l[A],b,x),A},p=(d,b,O)=>d.reduce((x,P,_)=>{let A=b[_];if(A&&A.call){let C=A(O),k=C&&C.props&&C.props.className||/^go/.test(C)&&C;A=k?"."+k:C&&typeof C=="object"?C.props?"":o(C,""):C===!1?"":C}return x+P+(A??"")},"");function S(d){let b=this||{},O=d.call?d(b.p):d;return f(O.unshift?O.raw?p(O,[].slice.call(arguments,1),b.p):O.reduce((x,P)=>Object.assign(x,P&&P.call?P(b.p):P),{}):O,r(b.target),b.g,b.o,b.k)}e.extractCss=n,e.css=S;let w,g,E,m=S.bind({g:1}),v=S.bind({k:1});function y(d,b,O,x){o.p=b,w=d,g=O,E=x}function h(d,b){let O=this||{};return function(){let x=arguments;function P(_,A){let C=Object.assign({},_),k=C.className||P.className;O.p=Object.assign({theme:g&&g()},C),O.o=/ *go\d+/.test(k),C.className=S.apply(O,x)+(k?" "+k:""),b&&(C.ref=A);let R=d;return d[0]&&(R=C.as||d,delete C.as),E&&R[0]&&E(C),w(R,C)}return b?b(P):P}}e.glob=m,e.keyframes=v,e.setup=y,e.styled=h})(wS);var QD=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(k2,"__esModule",{value:!0});const JD=QD(it),C_=wS;(0,C_.setup)(JD.default.createElement),k2.default=C_.styled;(function(e){var t=Se&&Se.__createBinding||(Object.create?function(j,G,z,q){q===void 0&&(q=z);var L=Object.getOwnPropertyDescriptor(G,z);L&&!("get"in L?!G.__esModule:L.writable||L.configurable)||(L={enumerable:!0,get:function(){return G[z]}}),Object.defineProperty(j,q,L)}:function(j,G,z,q){q===void 0&&(q=z),j[q]=G[z]}),r=Se&&Se.__setModuleDefault||(Object.create?function(j,G){Object.defineProperty(j,"default",{enumerable:!0,value:G})}:function(j,G){j.default=G}),n=Se&&Se.__importStar||function(j){if(j&&j.__esModule)return j;var G={};if(j!=null)for(var z in j)z!=="default"&&Object.prototype.hasOwnProperty.call(j,z)&&t(G,j,z);return r(G,j),G},i=Se&&Se.__importDefault||function(j){return j&&j.__esModule?j:{default:j}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.quillRef=void 0;const a=i(it),o=zi,l=Ga,u=i(pS),f=i(Ui),p=n(ja),S=di,w=wf,g=c2,E=bf,m=gS,v=$l,y=Vl,h=yf,d=i(k2),b=Ia,O=h2,x=n(_f),P=$o;e.quillRef=p.observable({enabled:!1,currentFormat:{},editor:p.observable.object({instance:null},{},{deep:!1})});const _=(0,d.default)("div",a.default.forwardRef)`
190
+ .ql-editor {
191
+ outline: none;
192
+ }
193
+ ul {
194
+ list-style-position: inside;
195
+ margin: 0;
196
+ }
197
+ p {
198
+ line-height: auto;
199
+ margin: 0;
200
+ }
201
+ strong {
202
+ font-weight: 1800;
203
+ }
204
+ .ql-direction-rtl {
205
+ direction: rtl;
206
+ }
207
+ `,A=({html:j,onBlur:G,onChange:z,element:q})=>{const L=a.default.useRef(null);a.default.useEffect(()=>{if(!L.current)return;const B=new u.default(L.current,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:["background","bold","color","font","italic","size","strike","underline","indent","align","direction"]});return e.quillRef.editor.instance=B,window.__polotnoQuill=B,B.on("text-change",()=>{B.getSelection()&&(e.quillRef.currentFormat=B.getFormat()),setTimeout(()=>{var M;z((M=L.current)===null||M===void 0?void 0:M.childNodes[0].innerHTML)},10)}),B.setSelection(0,0,"api"),B.on("selection-change",M=>{M||G(),M&&(e.quillRef.currentFormat=B.getFormat())}),L.current.childNodes[0].addEventListener("blur",M=>{var $;!(($=M.relatedTarget)===null||$===void 0)&&$.classList.contains("ql-clipboard")||G()}),()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={},delete window.__polotnoQuill}},[]),a.default.useEffect(()=>{var B;const M=e.quillRef.editor.instance;if(!M)return;const $=M.getSelection();if(((B=L.current)===null||B===void 0?void 0:B.childNodes[0].innerHTML)!==q.text){var K=M.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+j+"<p><br></p></div>");M.setContents(K),M.history.clear(),$&&(M.setSelection($.index,$.length),e.quillRef.currentFormat=M.getFormat())}},[q.text]);const I=(0,E.useColor)(q).fill;return a.default.createElement(_,{ref:L,style:{fontSize:q.fontSize,color:I,width:q.a.width,fontFamily:q.fontFamily,lineHeight:q.lineHeight,letterSpacing:q.letterSpacing+"rem",textAlign:q.align},dir:(0,g.getDir)((0,O.removeTags)(q.text))})};function C(j,G,z){return a.default.useMemo(()=>(0,m.detectSize)(j),[j,G.width,z])}function k(j){const G=j.getContext("2d").getImageData(0,0,j.width,j.height).data;for(let z=0;z<G.length;z+=4)if(G[z+3]!==0)return!0;return!1}function R(j){return!k(j)}function D(j,{fontFamily:G="",color:z="black"}={}){let q=`color: ${z||j.fill}`;return`<div style="white-space: unset; width: ${Math.round(j.width||100)}px; ${q}; font-size: ${j.fontSize}px; font-family: '${G}'; text-decoration: ${j.textDecoration}; text-align: ${j.align}; line-height: ${j.lineHeight}; letter-spacing: ${j.letterSpacing}rem; font-style: ${j.fontStyle}; font-weight: ${j.fontWeight}; -webkit-text-stroke: ${j.strokeWidth}px ${j.stroke};" contentEditable dir="${(0,g.getDir)((0,O.removeTags)(j.text))}">${j.text}</div>`}const U=j=>{let G=j.fontSize;for(let z=1;z<50;z++){const q=D(Object.assign(Object.assign({},j.toJSON()),{fontSize:G}),{fontFamily:j.fontFamily}),{height:L}=(0,m.detectSize)(q);if(!(j.height&&L>j.height))break;G-=.5}return G},Y=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,o.observer)(({element:j,store:G})=>{const z=a.default.useRef(null),[q,L]=a.default.useState(),[I,B]=a.default.useState(!1),[M,$]=a.default.useState(!0),[K,V]=a.default.useState(!1),[H,X]=a.default.useState(!1),Z=a.default.useRef(j.height),J=G.selectedElements.indexOf(j)>=0,ee=j.fontSize/3,{textVerticalResizeEnabled:re}=S.flags,ne=(0,g.usePrevious)(j.fontFamily),[de]=(0,g.useFontLoader)(G,j.fontFamily);(0,v.useFadeIn)(z);const pe=de?j.fontFamily:ne!==j.fontFamily?ne:"Arial",Me=(0,E.useColor)(j).fill,Fe=D(j,{fontFamily:pe,color:Me}),{width:fe,height:ie}=C(Fe,j,de);a.default.useEffect(()=>{if(!de)return;if(!j.height)return void j.set({height:ie});const{textOverflow:se}=S.flags;if(se!=="change-font-size"||I)se==="resize"&&(re&&j.height<ie&&G.history.ignore(()=>{j.set({height:ie})}),re||j.height===ie||G.history.ignore(()=>{j.set({height:ie})}));else{const Pe=U(j);Pe!==j.fontSize?G.history.ignore(()=>{j.set({fontSize:Pe})}):j.height!==ie&&(re&&j.height<ie?G.history.ignore(()=>{j.set({height:ie})}):re||G.history.ignore(()=>{j.set({height:ie})}))}});const ve=a.default.useRef(0);a.default.useEffect(()=>{I||K||(async()=>{ve.current++;const se=ve.current,Pe=(0,b.incrementLoader)(`text ${j.id}`);$(!0);let xe=null;const Ie=Y?5:1;for(let xt=0;xt<Ie;xt++){if(xe=await(0,m.htmlToCanvas)({html:Fe,width:j.width||1,height:j.height||ie||1,fontFamily:pe,padding:ee,pixelRatio:G._elementsPixelRatio,font:G.fonts.find(tt=>tt.fontFamily===pe)||x.globalFonts.find(tt=>tt.fontFamily===pe)}),se!==ve.current)return void Pe();R(xe)&&Y&&await new Promise(tt=>setTimeout(tt,50*(xt+1)))}xe?(L(xe),$(!1),f.default.Util.requestAnimFrame(Pe)):Pe()})()},[Fe,I,ie,K,pe,j.height,G._elementsPixelRatio]);const ge=I||M;a.default.useEffect(()=>p.autorun(()=>{const se=z.current;(0,w.applyFilter)(se,j)}),[q,ge,j.shadowColor,j.shadowOffsetX,j.shadowOffsetY,j.shadowOpacity]);let te=0;j.verticalAlign==="middle"&&(te=(j.height-ie)/2),j.verticalAlign==="bottom"&&(te=j.height-ie);const ue=(0,g.getLineHeight)({fontLoaded:de,fontFamily:j.fontFamily,fontSize:j.fontSize,lineHeight:j.lineHeight}),be=(0,P.useMobile)();return a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Rect,{x:j.a.x,y:j.a.y,offsetX:j.backgroundPadding*(j.fontSize*ue*.5),offsetY:j.backgroundPadding*(j.fontSize*ue*.5),rotation:j.rotation,hideInExport:!j.showInExport||!j.text,listening:!1,visible:j.backgroundEnabled,opacity:j.backgroundOpacity,fill:j.backgroundColor,width:j.a.width+j.backgroundPadding*(j.fontSize*ue),height:j.a.height+j.backgroundPadding*(j.fontSize*ue),cornerRadius:j.backgroundCornerRadius*(j.fontSize*ue*.5)}),a.default.createElement(l.Rect,{ref:z,name:"element",x:j.a.x,y:j.a.y,listening:j.selectable,rotation:j.rotation,width:j.a.width,height:j.a.height,visible:!ge,draggable:be?j.draggable&&J:j.draggable,preventDefault:!be||J,opacity:K?0:j.a.opacity,hideInExport:!j.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:se=>{j.set({x:se.target.x(),y:se.target.y()})},onDragEnd:se=>{j.set({x:se.target.x(),y:se.target.y()})},id:j.id,onDblClick:()=>{j.contentEditable&&V(!0)},onDblTap:()=>{j.contentEditable&&V(!0)},onTransformStart:se=>{B(!0),Z.current=j.height},onTransform:se=>{var Pe;const xe=se.target,Ie=((Pe=xe.getStage())===null||Pe===void 0?void 0:Pe.findOne("Transformer")).getActiveAnchor(),xt=Ie==="middle-left"||Ie==="middle-right",tt=Ie==="top-center"||Ie==="bottom-center",St=xe.scaleX();if(xt){const Ht=xe.scaleX(),le=Math.max(xe.width()*Ht,j.fontSize);if(xe.width(le),xe.scaleX(1),S.flags.textVerticalResizeEnabled){const he=Math.max(ie,Z.current);j.set({height:he})}j.set({width:le,x:xe.x(),y:xe.y()})}else if(tt){let Ht=S.flags.textOverflow==="resize"?ie:j.lineHeight*j.fontSize;const le=Math.max(Ht,se.target.height()*se.target.scaleY());xe.scaleY(1),j.set({x:xe.x(),y:xe.y(),height:le,rotation:xe.rotation()})}else xe.scaleX(1),xe.scaleY(1),j.set({fontSize:j.fontSize*St,width:xe.width()*St,x:xe.x(),y:xe.y(),rotation:xe.rotation(),height:xe.height()*St})},onTransformEnd:se=>{B(!1),$(!0);const Pe=se.target.scaleX();se.target.scaleX(1),se.target.scaleY(1),j.set({fontSize:j.fontSize*Pe,width:se.target.width()*Pe,x:se.target.x(),y:se.target.y(),rotation:se.target.rotation(),shadowBlur:j.shadowBlur*Pe,shadowOffsetX:j.shadowOffsetX*Pe,shadowOffsetY:j.shadowOffsetY*Pe,strokeWidth:j.strokeWidth*Pe})}}),a.default.createElement(l.Image,{ref:z,image:q,x:j.a.x,y:j.a.y,offsetX:ee,offsetY:ee-te,listening:!1,rotation:j.rotation,width:j.a.width+2*ee,height:j.a.height+2*ee,visible:!ge,opacity:K?0:j.a.opacity,shadowEnabled:j.shadowEnabled,shadowBlur:j.shadowBlur,shadowOffsetX:j.shadowOffsetX,shadowOffsetY:j.shadowOffsetY,shadowColor:j.shadowColor,shadowOpacity:j.shadowOpacity,hideInExport:!j.showInExport}),ge&&a.default.createElement(l.Group,{x:j.a.x,y:j.a.y,rotation:j.rotation,offsetY:-te},a.default.createElement(h.Html,{divProps:{style:{pointerEvents:"none"}}},a.default.createElement(_,{dangerouslySetInnerHTML:{__html:Fe},style:{pointerEvents:"none",display:"inline-block"}}))),K&&a.default.createElement(l.Group,{x:j.a.x,y:j.a.y,rotation:j.rotation,offsetY:-te},a.default.createElement(h.Html,null,a.default.createElement(A,{html:Fe,element:j,onChange:se=>{j.set({text:se})},onBlur:se=>{V(!1)}}))),(J||H)&&a.default.createElement(y.Highlighter,{element:j}))})})(dS);var SS={},R2={},v0={};(function(e){var t=Se&&Se.__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(Ui);function n(o,l,u,f,p){const S=Math.sqrt(u*u+f*f);return p+=Math.atan2(f,u),{x:o+S*Math.cos(p),y:l+S*Math.sin(p)}}function i(o){const{x:l,y:u,width:f,height:p}=o,S=r.default.Util.degToRad(o.rotation),w=n(l,u,0,0,S),g=n(l,u,f,0,S),E=n(l,u,f,p,S),m=n(l,u,0,p,S),v=Math.min(w.x,g.x,E.x,m.x),y=Math.min(w.y,g.y,E.y,m.y),h=Math.max(w.x,g.x,E.x,m.x),d=Math.max(w.y,g.y,E.y,m.y);return{x:v,y,width:h-v,height:d-y,minX:v,minY:y,maxX:h,maxY:d}}function a(o){const l=o.map(w=>i(w)),u=Math.min(...l.map(w=>w.minX)),f=Math.min(...l.map(w=>w.minY)),p=Math.max(...l.map(w=>w.maxX)),S=Math.max(...l.map(w=>w.maxY));return{x:u,y:f,width:p-u,height:S-f,minX:u,minY:f,maxX:p,maxY:S}}e.getClientRect=i,e.getTotalClientRect=a})(v0);(function(e){var t=Se&&Se.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.useAnchorSnap=e.useSnap=void 0;const r=t(it),n=t(Ui),i=v0;var a=5;function o(S){const w=S.__getNodeRect(),g=(0,i.getClientRect)(Object.assign(Object.assign({},w),{rotation:n.default.Util.radToDeg(w.rotation)})),E=S.getAbsolutePosition();return{vertical:[{guide:g.x,offset:E.x-g.x,snap:"start"},{guide:g.x+g.width/2,offset:E.x-g.x-g.width/2,snap:"center"},{guide:g.x+g.width,offset:E.x-g.x-g.width,snap:"end"}],horizontal:[{guide:g.y,offset:E.y-g.y,snap:"start"},{guide:g.y+g.height/2,offset:E.y-g.y-g.height/2,snap:"center"},{guide:g.y+g.height,offset:E.y-g.y-g.height,snap:"end"}]}}function l(S,w){var g=[],E=[];S.vertical.forEach(b=>{w.vertical.forEach(O=>{var x=Math.abs(b-O.guide);x<a&&g.push({lineGuide:b,diff:x,snap:O.snap,offset:O.offset})})}),S.horizontal.forEach(b=>{w.horizontal.forEach(O=>{var x=Math.abs(b-O.guide);x<a&&E.push({lineGuide:b,diff:x,snap:O.snap,offset:O.offset})})});var m=[];const v=g.sort((b,O)=>b.diff-O.diff),y=E.sort((b,O)=>b.diff-O.diff);var h=v[0],d=y[0];return h&&v.filter(b=>Math.abs(b.diff-h.diff)<.1).forEach(b=>{m.push(Object.assign({orientation:"V"},b))}),d&&y.filter(b=>Math.abs(b.diff-d.diff)<.1).forEach(b=>{m.push(Object.assign({orientation:"H"},b))}),m}function u(S){const w=h=>h.hasName("element")||h.hasName("page-background")||h.hasName("elements-area");function g(h){var d;const b=(d=S.current)===null||d===void 0?void 0:d.getStage();var O=[],x=[];return b.find(w).forEach(P=>{if(!(h.indexOf(P)>=0)){var _=P.getClientRect({skipShadow:!0,skipStroke:!0});O.push(_.x,_.x+_.width,_.x+_.width/2),x.push(_.y,_.y+_.height,_.y+_.height/2)}}),{vertical:O,horizontal:x}}function E(h){var d;const b=(d=S.current)===null||d===void 0?void 0:d.getLayer(),O=b==null?void 0:b.children.find(x=>x.name()==="line-guides");h.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]});O==null||O.add(P),b.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]}),O==null||O.add(P))})}const m=h=>{h.target.getLayer().children.find(_=>_.name()==="line-guides").destroyChildren();var d=l(g(h.target.nodes()),o(h.target));if(!d.length)return;E(d);const b=h.target.getAbsolutePosition(),O=Object.assign({},b);d.forEach(_=>{switch(_.snap){case"start":case"center":case"end":switch(_.orientation){case"V":O.x=_.lineGuide+_.offset;break;case"H":O.y=_.lineGuide+_.offset}}});const x=O.x-b.x,P=O.y-b.y;h.evt.ctrlKey||h.evt.metaKey||h.target.nodes().forEach(_=>{const A=_.getAbsolutePosition();_.setAbsolutePosition({x:A.x+x,y:A.y+P})})},v=(h,d,b)=>{const O=S.current,x=O.getLayer();if(x.children.find(R=>R.name()==="line-guides").destroyChildren(),O.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(d.x-h.x,2)+Math.pow(d.y-h.y,2))>50||!x)return d;var P=l(g(O.nodes()),{vertical:[{guide:d.x,offset:0,snap:"start"}],horizontal:[{guide:d.y,offset:0,snap:"start"}]});if(!P.length||(E(P),b.ctrlKey||b.metaKey))return d;let _=d.x,A=d.x;P.forEach(R=>{switch(R.orientation){case"V":_=R.lineGuide;break;case"H":A=R.lineGuide}});const C=Math.abs(d.x-_)<10,k=Math.abs(d.y-A)<10;return C&&!k?{x:_,y:h.y}:k&&!C?{x:h.x,y:A}:C&&k?{x:_,y:A}:d},y=h=>{if(!h.target)return;const d=h.target.getLayer();d.children.find(b=>b.name()==="line-guides").destroyChildren(),d.batchDraw()};r.default.useEffect(()=>{S.current&&(S.current.anchorDragBoundFunc(v),S.current.on("dragstart",()=>{setTimeout(()=>{const h=[...n.default.DD._dragElements.entries()];h.reverse(),n.default.DD._dragElements.clear(),h.forEach(([d,b])=>{n.default.DD._dragElements.set(d,b)})})}),S.current.on("dragmove",m),S.current.on("dragend",y),S.current.on("transformend",y),S.current.on("transform",h=>{var d,b;h.evt.ctrlKey||h.evt.metaKey?(d=S.current)===null||d===void 0||d.rotationSnapTolerance(0):(b=S.current)===null||b===void 0||b.rotationSnapTolerance(5)}))},[])}function f(S){return{vertical:[{guide:S.absolutePosition().x,offset:0,snap:"center"}],horizontal:[{guide:S.absolutePosition().y,offset:0,snap:"center"}]}}function p(S,w,g){const E=y=>y.hasName("element")||y.hasName("line-anchor")||y.hasName("page-background")||y.hasName("elements-area"),m=y=>{y.target.getLayer().children.find(P=>P.name()==="line-guides").destroyChildren();var h=l(function(P){var _;const A=(_=S.current)===null||_===void 0?void 0:_.getStage();var C=[],k=[];return A.find(E).forEach(R=>{if(!(P.indexOf(R)>=0)){var D=R.getClientRect({skipShadow:!0,skipStroke:!0});R.hasName("line-anchor")&&(D={x:R.absolutePosition().x,y:R.absolutePosition().y,width:0,height:0}),C.push(D.x,D.x+D.width,D.x+D.width/2),k.push(D.y,D.y+D.height,D.y+D.height/2)}}),{vertical:C,horizontal:k}}([y.target,...w.map(P=>P.current)]),f(y.target));if(!h.length)return;(function(P){var _;const A=(_=S.current)===null||_===void 0?void 0:_.getLayer(),C=A==null?void 0:A.children.find(k=>k.name()==="line-guides");P.forEach(k=>{if(k.orientation==="H"){var R=new n.default.Line({points:[-6e3,k.lineGuide,6e3,k.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});C==null||C.add(R),A.batchDraw()}else k.orientation==="V"&&(R=new n.default.Line({points:[k.lineGuide,-6e3,k.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),C==null||C.add(R))})})(h);const d=y.target.getAbsolutePosition(),b=Object.assign({},d);h.forEach(P=>{switch(P.snap){case"start":case"center":case"end":switch(P.orientation){case"V":b.x=P.lineGuide+P.offset;break;case"H":b.y=P.lineGuide+P.offset}}});const O=b.x-d.x,x=b.y-d.y;if(!(y.evt.ctrlKey||y.evt.metaKey)){const P=y.target.getAbsolutePosition();y.target.absolutePosition({x:P.x+O,y:P.y+x})}},v=y=>{if(!y.target)return;const h=y.target.getLayer();h.children.find(d=>d.name()==="line-guides").destroyChildren(),h.batchDraw()};r.default.useEffect(()=>{S.current&&(S.current.on("dragmove",m),S.current.on("dragend",v))},g)}e.useSnap=u,e.useAnchorSnap=p})(R2);(function(e){var t=Se&&Se.__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(it),n=zi,i=Ga,a=bf,o=yf,l=Vl,u=R2,f=$o;function p(E){const{x:m,y:v,width:y,height:h,rotation:d}=E.a,b=d*Math.PI/180,O={x:m+h/2*Math.cos(b+Math.PI/2),y:v+h/2*Math.sin(b+Math.PI/2)};return{middleLeft:O,middleRight:{x:O.x+y*Math.cos(b),y:O.y+y*Math.sin(b)}}}function S(E,m,v){const y=Math.sqrt(Math.pow(m.x-E.x,2)+Math.pow(m.y-E.y,2)),h=Math.atan2(m.y-E.y,m.x-E.x),d=180*h/Math.PI;return{x:E.x+Math.cos(h-Math.PI/2)*v/2,y:E.y+Math.sin(h-Math.PI/2)*v/2,width:y,height:v,rotation:d}}e.getMiddlePoints=p,e.getLinePositionFromMiddlePoints=S;const w=(E,m)=>({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:v=>{v.target.getStage().container().style.cursor="crosshair"},onMouseLeave:v=>{v.target.getStage().container().style.cursor=""},onDragStart:v=>{m.history.startTransaction()},onDragEnd:v=>{m.history.endTransaction()}}),g=(0,n.observer)(({element:E,type:m})=>{const v=(0,a.useColor)(E,E.a.color,"fill"),y=(0,a.useColor)(E,E.a.color,"stroke"),h=Object.assign(Object.assign(Object.assign({strokeWidth:E.height,lineCap:"round",lineJoin:"round"},y),v),{opacity:E.a.opacity,hideInExport:!E.showInExport});return r.default.createElement(r.default.Fragment,null,m==="arrow"&&r.default.createElement(i.Line,Object.assign({points:[3*E.height,2*-E.height,0,0,3*E.height,2*E.height]},h)),m==="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},h)),m==="bar"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-E.height,0,2*E.height],closed:!0},h)),m==="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},h)),m==="circle"&&r.default.createElement(i.Circle,Object.assign({x:2*E.height,y:0,radius:2*E.height},h)))});e.LineElement=(0,n.observer)(({element:E,store:m})=>{const v=r.default.useRef(null),y=r.default.useRef(null),h=r.default.useRef(null),d=E.selectable||m.role==="admin",b=(0,f.useMobile)(),[O,x]=r.default.useState(!1),P=m.selectedElements.indexOf(E)>=0&&m.selectedElements.length===1,{middleLeft:_,middleRight:A}=p(E);(0,u.useAnchorSnap)(y,[v],[P]),(0,u.useAnchorSnap)(h,[v],[P]);const C=(0,a.useColor)(E,E.a.color,"stroke");return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Line,Object.assign({ref:v,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(k=>k*E.a.height)},C,{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:b?E.draggable&&P:E.draggable,preventDefault:!b||P,hideInExport:!E.showInExport,onMouseEnter:()=>{x(!0)},onMouseLeave:()=>{x(!1)},onDragMove:k=>{E.set({x:k.target.x(),y:k.target.y()})},onDragEnd:k=>{E.set({x:k.target.x(),y:k.target.y()})},onTransform:k=>{const R=k.target.scaleX();k.target.scaleX(1),k.target.scaleY(1),E.set({height:E.height*R,width:E.width*R,x:k.target.x(),y:k.target.y(),rotation:k.target.rotation()})}})),r.default.createElement(i.Group,{x:_.x,y:_.y,rotation:E.rotation,hideInExport:!E.showInExport},r.default.createElement(g,{element:E,type:E.startHead})),r.default.createElement(i.Group,{x:A.x,y:A.y,rotation:E.rotation+180},r.default.createElement(g,{element:E,type:E.endHead})),O&&!P&&r.default.createElement(l.Highlighter,{element:E}),P&&E.resizable&&r.default.createElement(o.Portal,{selector:".page-abs-container",enabled:!0},r.default.createElement(i.Group,{visible:P},r.default.createElement(i.Rect,Object.assign({x:_.x,y:_.y,ref:y,name:"line-anchor"},w(m.scale,m),{onDragMove:k=>{const R=S(k.target.position(),A,E.height);E.set({x:R.x,y:R.y,width:R.width,rotation:R.rotation})}})),r.default.createElement(i.Rect,Object.assign({x:A.x,y:A.y,ref:h,name:"line-anchor"},w(m.scale,m),{onDragMove:k=>{const R=S(_,k.target.position(),E.height);E.set({x:R.x,y:R.y,width:R.width,rotation:R.rotation})}})))))})})(SS);var ES={};(function(e){var t=Se&&Se.__createBinding||(Object.create?function(L,I,B,M){M===void 0&&(M=B);var $=Object.getOwnPropertyDescriptor(I,B);$&&!("get"in $?!I.__esModule:$.writable||$.configurable)||($={enumerable:!0,get:function(){return I[B]}}),Object.defineProperty(L,M,$)}:function(L,I,B,M){M===void 0&&(M=B),L[M]=I[B]}),r=Se&&Se.__setModuleDefault||(Object.create?function(L,I){Object.defineProperty(L,"default",{enumerable:!0,value:I})}:function(L,I){L.default=I}),n=Se&&Se.__importStar||function(L){if(L&&L.__esModule)return L;var I={};if(L!=null)for(var B in L)B!=="default"&&Object.prototype.hasOwnProperty.call(L,B)&&t(I,L,B);return r(I,L),I},i=Se&&Se.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(it),o=zi,l=ja,u=Ga,f=i(f0),p=i(Ui),S=yf,w=Vl,g=Ia,E=n(Eu),m=di,v=wf,y=$l,h=$o;function d(){return document.createElement("canvas")}async function b(L){if(!(L.indexOf("data:image/svg+xml")>=0||L.indexOf(".svg")>=0))return L;const I=await E.urlToString(L),B=E.fixSize(I);return E.svgToURL(B)}const O=L=>{const[I,B]=a.default.useState(L);return a.default.useEffect(()=>{(async()=>{const M=await b(L);M!==I&&B(M)})()},[L]),I},x=new window.Image;x.src=E.svgToURL(`
208
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
209
+ <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"/>
210
+ <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"/>
211
+ </svg>
212
+ `);const P=new window.Image;P.src=E.svgToURL(`
213
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
214
+ <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"/>
215
+ <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"/>
216
+ <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"/>
217
+ <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"/>
218
+ </svg>
219
+ `);function _(L,I,B,M,$,K,V){for(var H=new ImageData(I,B),X=new Int32Array(L.data.buffer),Z=L.width,J=new Int32Array(H.data.buffer),ee=H.width,re=I/K,ne=B/V,de=Math.round(1/re),pe=Math.round(1/ne),Me=de*pe,Fe=0;Fe<H.height;Fe++)for(var fe=0;fe<ee;fe++){for(var ie=M+Math.round(fe/re)+($+Math.round(Fe/ne))*Z,ve=0,ge=0,te=0,ue=0,be=0;be<pe;be++)for(var se=0;se<de;se++){var Pe=X[ie+se+be*Z];ve+=Pe<<24>>>24,ge+=Pe<<16>>>24,te+=Pe<<8>>>24,ue+=Pe>>>24}ve=Math.round(ve/Me),ge=Math.round(ge/Me),te=Math.round(te/Me),ue=Math.round(ue/Me),J[fe+Fe*ee]=ue<<24|te<<16|ge<<8|ve}return H}function A(L,I){var B,M;const $=d();$.width=L.width,$.height=L.height,(B=$.getContext("2d"))===null||B===void 0||B.drawImage(L,0,0,$.width,$.height);const K=_($.getContext("2d").getImageData(0,0,$.width,$.height),Math.floor($.width*I),Math.floor($.height*I),0,0,$.width,$.height);return $.width=Math.floor($.width*I),$.height=Math.floor($.height*I),(M=$.getContext("2d"))===null||M===void 0||M.putImageData(K,0,0),$}const C=(L,I,B,M,$=0,K=!1)=>{const V=Math.floor(Math.max(L.width*M,1)),H=Math.floor(Math.max(L.height*M,1)),X=Math.min($*M,V/2,H/2),Z=Math.max(L.width/B.width,L.height/B.height)*M,J=L.page._exporting&&m.flags.imageDownScalingEnabled&&Z<1&&!K,ee=B.x===0&&B.y===0&&B.width===(I==null?void 0:I.width)&&B.height===(I==null?void 0:I.height),re=a.default.useMemo(()=>{if(!(!I||!I.width||!I.height))return ee&&X===0&&!J?void 0:d()},[I,X,J,ee]);return a.default.useLayoutEffect(()=>{if(!re||!I)return;re.width=V,re.height=H;const ne=re.getContext("2d");if(!ne)return;X&&(ne.beginPath(),ne.moveTo(X,0),ne.lineTo(V-X,0),ne.arc(V-X,X,X,3*Math.PI/2,0,!1),ne.lineTo(V,H-X),ne.arc(V-X,H-X,X,0,Math.PI/2,!1),ne.lineTo(X,H),ne.arc(X,H-X,X,Math.PI/2,Math.PI,!1),ne.lineTo(0,X),ne.arc(X,X,X,Math.PI,3*Math.PI/2,!1),ne.clip());const de=J?A(I,Z):I,pe=J?{x:Math.floor(B.x*Z),y:Math.floor(B.y*Z),width:Math.floor(B.width*Z),height:Math.floor(B.height*Z)}:B;ne.drawImage(de,pe.x,pe.y,pe.width,pe.height,0,0,re.width,re.height)},[re,L.width,L.height,B.x,B.y,B.width,B.height,$,M,K,L.page._exporting,J]),a.default.useEffect(()=>()=>{re&&re.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(re)},[re]),re||I},k=(L,I,B,M)=>{const $=O(L.clipSrc||""),[K,V]=Y($,"anonymous"),H=L.clipSrc?V:"loaded";(0,e.useImageLoader)(H,L.id+"-clip");const X=a.default.useMemo(()=>{if(I&&K)return d()},[I,K]);return a.default.useLayoutEffect(()=>{var Z;if(!K||!I||!I.width||!I.height||!K||!K.width||!K.height||!X)return;const J=d(),ee=Math.max(L.width/K.width*B,L.height/K.height*B);J.width=K.width*ee,J.height=K.height*ee,(Z=J.getContext("2d"))===null||Z===void 0||Z.drawImage(K,0,0,J.width,J.height),X.width=Math.max(I.width,1),X.height=Math.max(I.height,1);const re=X.getContext("2d");re&&(re.save(),re.drawImage(J,0,0,I.width,I.height),p.default.Util.releaseCanvas(J),re.globalCompositeOperation="source-in",re.drawImage(I,0,0,X.width,X.height),re.restore())},[X,I,K,L.width,L.height,B,...M]),L.clipSrc&&K?X:I},R=d(),D=(0,o.observer)(({element:L})=>{const I=Math.min(30,L.width/4,L.height/4),B=a.default.useRef(null);return a.default.useEffect(()=>{const M=B.current;if(!M)return;const $=new p.default.Animation(K=>{M.rotate(((K==null?void 0:K.timeDiff)||0)/2)},M.getLayer());return $.start(),()=>{$.stop()}}),a.default.createElement(u.Group,{x:L.x,y:L.y,rotation:L.rotation,listening:!1,opacity:L.a.opacity,hideInExport:!L.showInExport},a.default.createElement(u.Rect,{width:L.width,height:L.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:B,x:L.width/2,y:L.height/2,fill:"white",outerRadius:Math.abs(I),innerRadius:Math.max(1,I-5),angle:270}))}),U=(0,o.observer)(({element:L})=>{const I="Can not load the video...",B=Math.max(10,Math.min(30,L.width/25));return a.default.createElement(u.Group,{x:L.x,y:L.y,rotation:L.rotation,listening:!1,opacity:L.a.opacity,hideInExport:!L.showInExport},a.default.createElement(u.Rect,{width:L.width,height:L.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:I,fontSize:B,width:L.width,height:L.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let Y=f.default;const j=L=>{Y=L};e.setImageLoaderHook=j;const G=(L,I)=>{const B=a.default.useRef(),M=()=>{var $;($=B.current)===null||$===void 0||$.call(B),B.current=void 0};a.default.useEffect(()=>M,[]),a.default.useLayoutEffect(()=>{L!=="loading"||B.current||(B.current=(0,g.incrementLoader)(`video ${I}`)),L!=="loading"&&M(),L==="failed"&&(0,g.triggerLoadError)(`video ${I}`)},[L])};e.useImageLoader=G;function z(L,I){for(var B=L.buffered,M=0;M<B.length;M++)if(I>=B.start(M)&&I<=B.end(M))return!0;return!1}function q(L,I,B){const M=a.default.useRef("loading"),$=a.default.useRef(),[K,V]=a.default.useState(0),H=a.default.useRef(),X=a.default.useRef(),Z=a.default.useRef();return H.current===L&&X.current===I&&Z.current===B||(M.current="loading",$.current=void 0,H.current=L,X.current=I,Z.current=B),a.default.useLayoutEffect(function(){if(L){var J=document.createElement("video");return J.addEventListener("canplay",ee),J.addEventListener("error",re),I&&(J.crossOrigin=I),B&&(J.referrerpolicy=B),J.src=L,function(){J.removeEventListener("canplay",ee),J.removeEventListener("error",re)}}function ee(){M.current="loaded",$.current=J,$.current.currentTime=0,V(Math.random()),$.current.removeEventListener("canplay",ee)}function re(ne){M.current="failed",$.current=void 0,V(Math.random())}},[L,I,B]),[$.current,M.current]}e.VideoElement=(0,o.observer)(({element:L,store:I})=>{var B;const[M,$]=a.default.useState(!1),K=a.default.useRef(null),V=a.default.useRef(null),[H,X]=a.default.useState(!1),Z=I.selectedElements.indexOf(L)>=0,[J,ee]=a.default.useState(!1),[re,ne]=q(L.src,"anonymous");(0,e.useImageLoader)(ne,L.id+"-video"),re&&(re.muted=!0,re.width=re.videoWidth,re.height=re.videoHeight);const de=re||R;a.default.useEffect(()=>{re&&I.history.ignore(()=>{L.set({duration:1e3*re.duration})})},[re]),a.default.useEffect(()=>{var ke;if(!re)return;const ze=I.isPlaying||J;if(!ze)return void re.pause();ze&&(re.currentTime=L.startTime*re.duration,re.play());const Xe=new p.default.Animation(()=>{},(ke=K.current)===null||ke===void 0?void 0:ke.getLayer());Xe.start();const ot=()=>{ee(!1),re.currentTime=L.startTime*re.duration},Et=()=>{re.currentTime>=L.endTime*re.duration&&(re.pause(),re.currentTime=L.startTime*re.duration,ee(!1))};return re.addEventListener("ended",ot),re.addEventListener("timeupdate",Et),()=>{Xe.stop(),re.removeEventListener("ended",ot),re.removeEventListener("timeupdate",Et)}},[re,J,I.isPlaying]);const pe=a.default.useRef();a.default.useEffect(()=>(0,l.autorun)(()=>{var ke,ze;if(re){const Xe=(I.currentTime-L.page.startTime)%L.duration;(Math.abs(1e3*re.currentTime-Xe)>500||!I.isPlaying)&&(re.currentTime=Xe/1e3,I.isPlaying||re.currentTime===0||(pe.current=(0,g.incrementLoader)(`video ${L.id}`))),(ze=(ke=K.current)===null||ke===void 0?void 0:ke.getLayer())===null||ze===void 0||ze.batchDraw()}}),[I,re]),a.default.useEffect(()=>{if(!re)return;let ke=null;const ze=()=>{var ot,Et;pe.current&&((Et=(ot=K.current)===null||ot===void 0?void 0:ot.getLayer())===null||Et===void 0||Et.batchDraw(),pe.current(),pe.current=null),z(re,re.currentTime)||(ke&&console.error("finish already exists"),ke=(0,g.incrementLoader)(`video ${L.id}`))},Xe=()=>{ke&&(ke(),ke=null)};return re.addEventListener("timeupdate",ze),re.addEventListener("canplay",Xe),()=>{re.removeEventListener("timeupdate",ze),re.removeEventListener("canplay",Xe)}},[re,L.id,g.incrementLoader]);let{cropX:Me,cropY:Fe,cropWidth:fe,cropHeight:ie}=L;ne!=="loaded"&&(Me=Fe=0,fe=ie=1);const ve=de.width*fe,ge=de.height*ie,te=L.width/L.height;let ue,be;const se=ve/ge,Pe=L.type==="svg";Pe?(ue=ve,be=ge):te>=se?(ue=ve,be=ve/te):(ue=ge*te,be=ge);const xe={x:de.width*Me,y:de.height*Fe,width:ue,height:be},Ie=(B=L.cornerRadius)!==null&&B!==void 0?B:0;let xt=k(L,C(L,de,xe,I._elementsPixelRatio,Ie,M||L._cropModeEnabled||L.type==="svg"),I._elementsPixelRatio,[xe,Ie,I._elementsPixelRatio]);const tt=Math.max(L.width/ue,L.height/be);a.default.useEffect(()=>{var ke;if(!L._cropModeEnabled)return;const ze=(ke=K.current)===null||ke===void 0?void 0:ke.getStage();function Xe(Et){L._cropModeEnabled&&Et.target!==V.current&&L.toggleCropMode(!1)}function ot(Et){L._cropModeEnabled&&Et.target.parentNode!==ze.content&&L.toggleCropMode(!1)}return document.body.addEventListener("click",ot),ze==null||ze.on("click",Xe),ze==null||ze.on("tap",Xe),()=>{document.body.removeEventListener("click",ot),document.body.removeEventListener("touchstart",ot),ze==null||ze.off("click",Xe),ze==null||ze.off("click",Xe)}},[L._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(M||L._cropModeEnabled))return(0,v.applyFilter)(K.current,L),(0,l.autorun)(()=>{(0,v.applyFilter)(K.current,L)},{delay:100})},[de,M,fe,ie,L._cropModeEnabled]),a.default.useLayoutEffect(()=>{var ke;M||L._cropModeEnabled?(ke=K.current)===null||ke===void 0||ke.clearCache():(0,v.applyFilter)(K.current,L)},[M,L.width,L.height,L._cropModeEnabled]),a.default.useEffect(()=>{(0,v.applyFilter)(K.current,L)},[L.shadowEnabled,L.shadowBlur,L.cornerRadius,L.shadowColor,L.shadowOffsetX,L.shadowOffsetY,L.shadowOpacity]);const St=a.default.useRef(null),Ht=a.default.useRef(null),le=a.default.useRef(null);a.default.useLayoutEffect(()=>{L._cropModeEnabled&&(Ht.current.nodes([St.current]),le.current.nodes([V.current]))},[L._cropModeEnabled]);const he=ke=>{Math.round(ke.target.x())>0&&(ke.target.x(0),ke.target.scaleX(1)),Math.round(ke.target.y())>0&&(ke.target.y(0),ke.target.scaleY(1));const ze=ke.target.width()*ke.target.scaleX(),Xe=ke.target.height()*ke.target.scaleY(),ot=Math.min(1,ue/ze),Et=Math.min(1,be/Xe),jr=1-ot,Jt=Math.min(jr,Math.max(0,Math.round(-ke.target.x())/ze)),Sr=1-Et,on=Math.min(Sr,Math.max(0,Math.round(-ke.target.y())/Xe));ke.target.setAttrs({x:-Jt*de.width,y:-on*de.height,scaleX:1,scaleY:1}),L.set({cropX:Jt,cropY:on,cropWidth:ot,cropHeight:Et})},nt=()=>{L.type!=="svg"&&L.contentEditable&&setTimeout(()=>{L.toggleCropMode(!0)})},Ee=ne==="loading",je=ne==="failed",Le=!Ee&&!je,we=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Ze=Le?L.a.opacity:0;(0,y.useFadeIn)(K,Ze);const Oe=L.selectable||I.role==="admin",We=(0,h.useMobile)();return a.default.createElement(a.default.Fragment,null,Ee&&a.default.createElement(D,{element:L}),je&&a.default.createElement(U,{element:L}),a.default.createElement(u.Image,{ref:K,name:"element",id:L.id,image:de,x:L.x,y:L.y,width:L.width||1,height:L.height||1,rotation:L.rotation,opacity:Ze,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur,shadowOffsetX:L.shadowOffsetX,shadowOffsetY:L.shadowOffsetY,shadowColor:L.shadowColor,shadowOpacity:L.shadowOpacity,customCrop:xe,listening:Oe,cropX:xe.x,cropY:xe.y,cropWidth:xe.width,cropHeight:xe.height,draggable:We?L.draggable&&Z:L.draggable,preventDefault:!We||Z,hideInExport:!L.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:ke=>{L.set({x:ke.target.x(),y:ke.target.y()})},onDragEnd:ke=>{L.set({x:ke.target.x(),y:ke.target.y()})},onDblClick:nt,onDblTap:nt,onTransformStart:()=>{$(!0),we.current={cropX:L.cropX,cropY:L.cropY,cropWidth:L.cropWidth,cropHeight:L.cropHeight}},onTransform:ke=>{var ze;const Xe=ke.currentTarget,ot=Math.abs(Xe.scaleX()-1)<1e-7?1:Xe.scaleX(),Et=Math.abs(Xe.scaleY()-1)<1e-7?1:Xe.scaleY();Xe.scaleX(1),Xe.scaleY(1);const jr=(ze=ke.target.getStage())===null||ze===void 0?void 0:ze.findOne("Transformer"),Jt=1-ue/de.width,Sr=Math.min(Jt,Math.max(0,L.cropX)),on=1-be/de.height,Ln=Math.min(on,Math.max(0,L.cropY)),De=jr.getActiveAnchor(),Je=!(De.indexOf("middle")>=0||De.indexOf("center")>=0),Qe=!Je&&ot<1&&we.current.cropHeight>be/de.height;let At=Je?L.cropWidth:L.cropWidth*ot;Qe&&(At=L.cropWidth);const rt=!Je&&Et<1&&we.current.cropWidth>ue/de.width;let er=Je?L.cropHeight:L.cropHeight*Et;rt&&(er=L.cropHeight),Pe&&(At=L.cropWidth,er=L.cropHeight),L.set({cropX:Sr,cropY:Ln,x:Xe.x(),y:Xe.y(),width:Xe.width()*ot,height:Xe.height()*Et,rotation:ke.target.rotation(),cropWidth:Math.min(At,1-Sr),cropHeight:Math.min(er,1-Ln)})},onTransformEnd:ke=>{const ze=ke.currentTarget;L.set({width:ze.width(),height:ze.height(),x:ze.x(),y:ze.y(),rotation:ke.target.rotation(),cropWidth:ue/de.width,cropHeight:be/de.height}),$(!1)}}),a.default.createElement(u.Rect,{x:L.x,y:L.y,width:Math.max(L.width-L.borderSize,0),height:Math.max(L.height-L.borderSize,0),opacity:Ze,offsetX:-L.borderSize/2,offsetY:-L.borderSize/2,stroke:L.borderColor,strokeWidth:L.borderSize,listening:!1,visible:!!L.borderSize,rotation:L.rotation,cornerRadius:Math.max(0,Ie-L.borderSize),hideInExport:!L.showInExport}),!J&&a.default.createElement(u.Image,{image:x,x:L.x+L.width/2-15/I.scale,y:L.y+L.height/2-15/I.scale,width:30/I.scale,height:30/I.scale,hideInExport:!0,onClick:()=>{ee(!0)}}),J&&a.default.createElement(u.Image,{image:P,x:L.x+L.width/2-15/I.scale,y:L.y+L.height/2-15/I.scale,width:30/I.scale,height:30/I.scale,hideInExport:!0,onClick:()=>{ee(!1)}}),L._cropModeEnabled&&a.default.createElement(S.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/I.scale,y:-window.innerWidth/I.scale,width:window.innerWidth/I.scale*3,height:window.innerWidth/I.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:xt,x:L.x,y:L.y,width:L.width,height:L.height,rotation:L.rotation,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur}),a.default.createElement(u.Group,{x:L.x,y:L.y,rotation:L.rotation,scaleX:tt,scaleY:tt},a.default.createElement(u.Image,{image:de,ref:V,opacity:.4,draggable:!0,x:-L.cropX*de.width,y:-L.cropY*de.height,onDragMove:he,onTransform:he}),a.default.createElement(u.Transformer,{ref:le,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ke,ze)=>ze.width<5||ze.height<5?ke:ze,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:ue,height:be,ref:St,listening:!1,onTransform:ke=>{ke.target.x()<-L.cropX*de.width-1e-9&&(ke.target.x(-L.cropX*de.width),ke.target.scaleX(1)),ke.target.y()<-L.cropY*de.height-1e-9&&(ke.target.y(-L.cropY*de.height),ke.target.scaleY(1));const ze=Math.min(1,Math.max(0,L.cropX+ke.target.x()/de.width)),Xe=Math.min(1,Math.max(0,ke.target.y()/de.height+L.cropY)),ot=ke.target.width()*ke.target.scaleX(),Et=ke.target.height()*ke.target.scaleY(),jr=Math.min(1-ze,ot/de.width),Jt=Math.min(1-Xe,Et/de.height),Sr=ke.target.getAbsolutePosition(ke.target.getParent().getParent());ke.target.scale({x:1,y:1}),ke.target.position({x:0,y:0}),L.set({x:Sr.x,y:Sr.y,cropX:ze,cropY:Xe,cropWidth:jr,cropHeight:Jt,width:Math.min(ot*tt,de.width*(1-ze)*tt),height:Math.min(Et*tt,de.height*(1-Xe)*tt)})}}),a.default.createElement(u.Transformer,{ref:Ht,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ke,ze)=>ze.width<5||ze.height<5?ke:ze,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(H||Z)&&a.default.createElement(w.Highlighter,{element:L}))})})(ES);var OS={},L2={};(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:m,height:v,cornerRadius:y})=>{if(y>0){const h=Math.min(y,m/2,v/2);return`M 0 ${h} A ${h} ${h} 0 0 1 ${h} 0 L ${m-h} 0 A ${h} ${h} 0 0 1 ${m} ${h} L ${m} ${v-h} A ${h} ${h} 0 0 1 ${m-h} ${v} L ${h} ${v} A ${h} ${h} 0 0 1 0 ${v-h} Z`}return`M 0 0 L ${m} 0 L ${m} ${v} L 0 ${v} Z`};e.rectData=t;const r=({width:m,height:v})=>`M ${m/2} 0 L ${m} ${v} L 0 ${v} Z`;e.triangleData=r;const n=({width:m,height:v})=>`M 0 0 L ${m} 0 L 0 ${v} Z`;e.rightTriangleData=n;const i=({width:m,height:v})=>`M ${m/2} ${v/2} m -${m/2}, 0 a ${m/2},${v/2} 0 1,0 ${m},0 a ${m/2},${v/2} 0 1,0 -${m},0`;function a({width:m,height:v}){const y=m/2,h=v/2,d=m/2,b=v/2,O=d/2,x=b/2;let P="",_=Math.PI/5;for(let A=0;A<10;A++){const C=A%2==0?b:x,k=y+(A%2==0?d:O)*Math.sin(A*_),R=h-C*Math.cos(A*_);A===0?P=`M ${k} ${R}`:P+=` L ${k} ${R}`}return P+" Z"}function o({width:m,height:v}){const y=m/2,h=v/2;return`M ${y} 0 L ${m} ${h} L ${y} ${v} L 0 ${h} Z`}function l({width:m,height:v}){const y=m/2,h=v/2,d=m/2,b=v/2;let O="",x=2*Math.PI/5;for(let P=0;P<5;P++){const _=b,A=y+d*Math.sin(P*x),C=h-_*Math.cos(P*x);P===0?O=`M ${A} ${C}`:O+=` L ${A} ${C}`}return O+" Z"}function u({width:m,height:v}){const y=m/2,h=v/2,d=m/2,b=v/2;let O="",x=2*Math.PI/6;for(let P=0;P<6;P++){const _=b,A=y+d*Math.sin(P*x),C=h-_*Math.cos(P*x);P===0?O=`M ${A} ${C}`:O+=` L ${A} ${C}`}return O+" Z"}function f({path:m,aspectRatio:v,width:y,height:h}){return{path:m,scaleX:y/v.width,scaleY:h/v.height}}function p({width:m,height:v}){const y=.1*Math.min(m,v),h=.2*m,d=.2*v,b=.5*m;let O=`M ${y},0`;return O+=" H "+(m-y),O+=` A ${y},${y} 0 0 1 ${m},${y}`,O+=" V "+(v-y-d),O+=` A ${y},${y} 0 0 1 ${m-y},${v-d}`,O+=` H ${b+h/2}`,O+=` L ${b},${v}`,O+=` L ${b-h/2},${v-d}`,O+=` H ${y}`,O+=` A ${y},${y} 0 0 1 0,${v-y-d}`,O+=` V ${y}`,O+=` A ${y},${y} 0 0 1 ${y},0`,O+=" Z",O}function S({width:m,height:v}){const y=.3*m,h=.3*v,d=m/2,b=v/2,O=d-y/2,x=d+y/2,P=b-h/2,_=b+h/2;let A=`M ${O},0 `;return A+=`H ${x} `,A+=`V ${P} `,A+=`H ${m} `,A+=`V ${_} `,A+=`H ${x} `,A+=`V ${v} `,A+=`H ${O} `,A+=`V ${_} `,A+="H 0 ",A+=`V ${P} `,A+=`H ${O} `,A+="V 0 ",A+="Z",A}function w(m){return e.TYPES[m]||e.rectData}function g(m,v){const{width:y,height:h,fill:d,stroke:b,strokeWidth:O,dash:x}=m,P=(x||[]).map(R=>R*O);let _=v(m),A=1,C=1;typeof _!="string"&&(A=_.scaleX,C=_.scaleY,_=_.path);const k=`clip-${Math.random()}`;return`
220
+ <svg xmlns="http://www.w3.org/2000/svg" width="${y}" height="${h}">
221
+ <defs>
222
+ <clipPath id="${k}">
223
+ <path d="${_}" />
224
+ </clipPath>
225
+ </defs>
226
+
227
+ <!-- Path for the fill -->
228
+ <path d="${_}" fill="${d}" transform="scale(${A}, ${C})"/>
229
+
230
+ <!-- Path for the stroke, clipped by the star path -->
231
+ <path d="${_}" fill="none" stroke="${b}" stroke-width="${2*O}" clip-path="url(#${k})" transform="scale(${A}, ${C})" stroke-dasharray="${P.join(" ")}"/>
232
+ </svg>
233
+ `}function E(m){const{subType:v}=m,y=w(v);return y?g(m,y):(console.error(`Polotno error: Can not convert ${m.subType} figure to svg.`),(0,e.rectData)(m))}e.circleData=i,e.starPath=a,e.diamondPath=o,e.pentagonPath=l,e.hexagonPath=u,e.speechBubblePath=p,e.crossPath=S,e.TYPES={rect:e.rectData,circle:e.circleData,star:a,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:o,pentagon:l,hexagon:u,speechBubble:p,cross:S,arc:({width:m,height:v})=>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:m,height:v}),cloud:({width:m,height:v})=>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:m,height:v}),rightArrow:({width:m,height:v})=>{const y=.6*m;return`M 0 ${v/4} L ${y} ${v/4} L ${y} 0 L ${m} ${v/2} L ${y} ${v} L ${y} ${.75*v} L 0 ${.75*v} Z`},leftArrow:({width:m,height:v})=>{const y=.4*m;return`M ${m} ${v/4} L ${y} ${v/4} L ${y} 0 L 0 ${v/2} L ${y} ${v} L ${y} ${.75*v} L ${m} ${.75*v} Z`},downArrow:({width:m,height:v})=>{const y=.6*v;return`M ${m/4} 0 L ${m/4} ${y} L 0 ${y} L ${m/2} ${v} L ${m} ${y} L ${.75*m} ${y} L ${.75*m} 0 Z`},upArrow:({width:m,height:v})=>{const y=.4*v;return`M ${m/4} ${v} L ${m/4} ${y} L 0 ${y} L ${m/2} 0 L ${m} ${y} L ${.75*m} ${y} L ${.75*m} ${v} Z`},asterisk1:({width:m,height:v})=>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:m,height:v}),asterisk2:({width:m,height:v})=>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:m,height:v}),bookmark:({width:m,height:v})=>f({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:m,height:v}),butterfly:({width:m,height:v})=>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:m,height:v}),cylinder:({width:m,height:v})=>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:m,height:v}),diamond2:({width:m,height:v})=>f({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:m,height:v}),door:({width:m,height:v})=>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:m,height:v}),drop1:({width:m,height:v})=>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:m,height:v}),drop2:({width:m,height:v})=>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:m,height:v}),explosion:({width:m,height:v})=>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:m,height:v}),flag:({width:m,height:v})=>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:m,height:v}),flower:({width:m,height:v})=>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:m,height:v}),frame:({width:m,height:v})=>f({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:m,height:v}),heart1:({width:m,height:v})=>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:m,height:v}),home:({width:m,height:v})=>f({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:m,height:v}),home2:({width:m,height:v})=>f({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:m,height:v}),hourglass:({width:m,height:v})=>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:m,height:v}),house:({width:m,height:v})=>f({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:m,height:v}),keyhole:({width:m,height:v})=>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:m,height:v}),kiss:({width:m,height:v})=>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:m,height:v}),leaf:({width:m,height:v})=>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:m,height:v}),lightning1:({width:m,height:v})=>f({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:m,height:v}),lightning2:({width:m,height:v})=>f({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:m,height:v}),magnet:({width:m,height:v})=>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:m,height:v}),mithosis:({width:m,height:v})=>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:m,height:v}),orangeRicky:({width:m,height:v})=>f({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:m,height:v}),party:({width:m,height:v})=>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:m,height:v}),pillow:({width:m,height:v})=>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:m,height:v}),polygon:({width:m,height:v})=>f({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:m,height:v}),rainbow:({width:m,height:v})=>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:m,height:v}),rhodeIsland:({width:m,height:v})=>f({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:m,height:v}),shell:({width:m,height:v})=>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:m,height:v}),shield1:({width:m,height:v})=>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:m,height:v}),shield2:({width:m,height:v})=>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:m,height:v}),skewedRectangle:({width:m,height:v})=>f({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:m,height:v}),softFlower:({width:m,height:v})=>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:m,height:v}),softStar:({width:m,height:v})=>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:m,height:v}),stairs1:({width:m,height:v})=>f({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:m,height:v}),stairs2:({width:m,height:v})=>f({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:m,height:v}),teewee:({width:m,height:v})=>f({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:m,height:v}),blob1:({width:m,height:v})=>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:m,height:v}),blob10:({width:m,height:v})=>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:m,height:v}),blob11:({width:m,height:v})=>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:m,height:v}),blob12:({width:m,height:v})=>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:m,height:v}),blob13:({width:m,height:v})=>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:m,height:v}),blob14:({width:m,height:v})=>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:m,height:v}),blob15:({width:m,height:v})=>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:m,height:v}),blob16:({width:m,height:v})=>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:m,height:v}),blob17:({width:m,height:v})=>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:m,height:v}),blob18:({width:m,height:v})=>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:m,height:v}),blob19:({width:m,height:v})=>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:m,height:v}),blob2:({width:m,height:v})=>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:m,height:v}),blob20:({width:m,height:v})=>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:m,height:v}),blob21:({width:m,height:v})=>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:m,height:v}),blob22:({width:m,height:v})=>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:m,height:v}),blob23:({width:m,height:v})=>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:m,height:v}),blob24:({width:m,height:v})=>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:m,height:v}),blob25:({width:m,height:v})=>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:m,height:v}),blob26:({width:m,height:v})=>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:m,height:v}),blob27:({width:m,height:v})=>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:m,height:v}),blob28:({width:m,height:v})=>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:m,height:v}),blob29:({width:m,height:v})=>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:m,height:v}),blob3:({width:m,height:v})=>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:m,height:v}),blob30:({width:m,height:v})=>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:m,height:v}),blob31:({width:m,height:v})=>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:m,height:v}),blob32:({width:m,height:v})=>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:m,height:v}),blob4:({width:m,height:v})=>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:m,height:v}),blob5:({width:m,height:v})=>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:m,height:v}),blob6:({width:m,height:v})=>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:m,height:v}),blob7:({width:m,height:v})=>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:m,height:v}),blob8:({width:m,height:v})=>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:m,height:v}),blob9:({width:m,height:v})=>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:m,height:v})},e.subTypeToPathDataFunc=w,e.figureToSvg=E})(L2);(function(e){var t=Se&&Se.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=t(it),n=zi,i=Ga,a=L2,o=Vl,l=$o,u=bf,f={};e.FigureElement=(0,n.observer)(({element:p,store:S})=>{const w=p.selectable||S.role==="admin",g=(0,l.useMobile)(),[E,m]=r.default.useState(!1),v=S.selectedElements.indexOf(p)>=0&&S.selectedElements.length===1,y=Math.min(p.strokeWidth,p.width/2,p.height/2),h=Math.max(0,Math.min(p.width/2,p.height/2,p.cornerRadius)),d=(0,u.useColor)(p,p.a.fill,"fill"),b=Object.assign(Object.assign({width:p.a.width,height:p.a.height},d),{cornerRadius:h,opacity:p.animated("opacity"),shadowEnabled:p.shadowEnabled,shadowBlur:p.shadowBlur,shadowOffsetX:p.shadowOffsetX,shadowOffsetY:p.shadowOffsetY,shadowColor:p.shadowColor,shadowOpacity:p.shadowOpacity,listening:w,preventDefault:!g||v,hideInExport:!p.showInExport}),O=(0,u.useColor)(p,p.stroke,"stroke"),x=Object.assign(Object.assign({visible:y>0,x:y/2,y:y/2,width:p.a.width-y,height:p.a.height-y},O),{strokeWidth:y,cornerRadius:Math.max(0,h-y),dash:p.dash.map(C=>C*y),opacity:p.animated("opacity"),hideInExport:!p.showInExport,listening:!1}),P=(_=p.subType,f[_]||(f[_]=(A=(0,a.subTypeToPathDataFunc)(_),(0,n.observer)(({element:C,fillProps:k,strokeProps:R})=>{let D=A({width:C.a.width,height:C.a.height,cornerRadius:C.cornerRadius}),U=1,Y=1;typeof D!="string"&&(U=D.scaleX,Y=D.scaleY,D=D.path);const j=r.default.useRef(null);return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Rect,{width:C.width,height:C.height,fill:"transparent"}),r.default.createElement(i.Path,Object.assign({},k,{ref:j,data:D,scaleX:U,scaleY:Y})),r.default.createElement(i.Group,{clipFunc:G=>{const z=j.current;if(z){var q=z.dataArray;G.beginPath();for(var L=0;L<q.length;L++){var I=q[L].command,B=q[L].points;switch(I){case"L":G.lineTo(B[0],B[1]);break;case"M":G.moveTo(B[0],B[1]);break;case"C":G.bezierCurveTo(B[0],B[1],B[2],B[3],B[4],B[5]);break;case"Q":G.quadraticCurveTo(B[0],B[1],B[2],B[3]);break;case"A":var M=B[0],$=B[1],K=B[2],V=B[3],H=B[4],X=B[5],Z=B[6],J=B[7],ee=K>V?K:V,re=K>V?1:K/V,ne=K>V?V/K:1;G.translate(M,$),G.rotate(Z),G.scale(re,ne),G.arc(0,0,ee,H,H+X,1-J),G.scale(1/re,1/ne),G.rotate(-Z),G.translate(-M,-$);break;case"z":G.closePath()}}}},scaleX:U,scaleY:Y},r.default.createElement(i.Path,Object.assign({},R,{x:0,y:0,data:D,strokeWidth:2*R.strokeWidth,dash:R.dash.map(G=>G)}))))}))),f[_]||i.Group);var _,A;return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Group,{id:p.id,x:p.a.x,y:p.a.y,rotation:p.a.rotation,opacity:p.a.opacity,draggable:g?p.draggable&&v:p.draggable,name:"element",onMouseEnter:()=>{m(!0)},onMouseLeave:()=>{m(!1)},onDragMove:C=>{p.set({x:C.target.x(),y:C.target.y()})},onDragEnd:C=>{p.set({x:C.target.x(),y:C.target.y()})},onTransform:C=>{const k=C.target.scale();C.target.scaleX(1),C.target.scaleY(1),p.set({width:p.width*k.x,height:p.height*k.y,x:C.target.x(),y:C.target.y(),rotation:C.target.rotation()})}},r.default.createElement(P,{element:p,fillProps:b,strokeProps:x})),E&&!v&&r.default.createElement(o.Highlighter,{element:p}))})})(OS);(function(e){var t=Se&&Se.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=void 0;const r=t(it),n=zi,i=c2,a=x2,o=dS,l=SS,u=ES,f=OS,p=Ga,S=di,w=(0,n.observer)(v=>{const{element:y,store:h}=v,{children:d}=y,b=y.selectable||h.role==="admin";return r.default.createElement(p.Group,{opacity:y.opacity,listening:b,hideInExport:!y.showInExport},d.map(O=>r.default.createElement(m,Object.assign({},v,{key:O.id,store:h,element:O}))))}),g={text:i.TextElement,image:a.ImageElement,svg:a.ImageElement,line:l.LineElement,video:u.VideoElement,figure:f.FigureElement,group:w};function E(v,y){g[v]=y}e.registerShapeComponent=E;const m=(0,n.observer)(v=>{let y=g[v.element.type];return v.element.type==="text"&&S.flags.htmlRenderEnabled&&(y=o.HTMLElement),v.element.visible?y?r.default.createElement(y,Object.assign({},v)):(console.error("Can not find component for "+v.element.type),null):null});e.default=m})(l7);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 tv={},rv={},T_;function eF(){return T_||(T_=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.URL=e.API=void 0;const t=M2();e.API="https://api.polotno.com/api",e.URL="https://api.polotno.com";const r={},n=(h,d)=>{r[h]||(r[h]=!0,console.error(d))},i=`API for iconscout is provided as a demonstration.
234
+ For production usage you have to use your own API endpoint.
235
+ https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
236
+ https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:h,page:d=1})=>`${e.API}/get-unsplash?query=${h}&per_page=20&page=${d}&KEY=${(0,t.getKey)()}`,unsplashDownload:h=>`${e.API}/download-unsplash?id=${h}&KEY=${(0,t.getKey)()}`,svgapiList:({query:h,page:d=0})=>`${e.API}/get-svgapi?query=${h}&page=${d}&per_page=20&KEY=${(0,t.getKey)()}`,svgapiDownload:h=>`${e.API}/download-svgapi?path=${h}&KEY=${(0,t.getKey)()}`,iconscoutList:({query:h,page:d=1})=>(n("iconscout",i),`${e.API}/get-iconscout?query=${h}&page=${d}&KEY=${(0,t.getKey)()}`),iconscoutDownload:h=>(n("iconscout",i),`${e.API}/download-iconscout?uuid=${h}&KEY=${(0,t.getKey)()}`),templateList:({query:h,page:d=1,sizeQuery:b})=>`${e.API}/get-templates?${b}&query=${h}&per_page=30&page=${d}&KEY=${(0,t.getKey)()}`};const a=()=>`${e.API}/get-google-fonts?KEY=${(0,t.getKey)()}`;e.getGoogleFontsListAPI=a;const o=h=>{return`${e.URL}/google-fonts-previews/black/${d=h,b=" ",O="-",d.replace(new RegExp(b,"g"),O)}.png`;var d,b,O};e.getGoogleFontImage=o;const l=()=>`${e.API}/get-basic-shapes?KEY=${(0,t.getKey)()}`;e.polotnoShapesList=l;const u=()=>`${e.API}/remove-image-background?KEY=${(0,t.getKey)()}`;e.removeBackground=u;const f=h=>e.URLS.templateList(h);e.templateList=f;const p=()=>`${e.API}/get-text-templates?KEY=${(0,t.getKey)()}`;e.textTemplateList=p;const S=h=>e.URLS.unsplashList(h);e.unsplashList=S;const w=h=>e.URLS.unsplashDownload(h);e.unsplashDownload=w;const g=h=>e.URLS.svgapiList(h);e.svgapiList=g;const E=h=>e.URLS.svgapiDownload(h);e.svgapiDownload=E;const m=h=>e.URLS.iconscoutList(h);e.iconscoutList=m;const v=h=>e.URLS.iconscoutDownload(h);e.iconscoutDownload=v;const y=(h,d)=>{e.URLS[h]=d};e.setAPI=y}(rv)),rv}var A_;function M2(){return A_||(A_=1,function(e){var t=Se&&Se.__createBinding||(Object.create?function(x,P,_,A){A===void 0&&(A=_);var C=Object.getOwnPropertyDescriptor(P,_);C&&!("get"in C?!P.__esModule:C.writable||C.configurable)||(C={enumerable:!0,get:function(){return P[_]}}),Object.defineProperty(x,A,C)}:function(x,P,_,A){A===void 0&&(A=_),x[A]=P[_]}),r=Se&&Se.__setModuleDefault||(Object.create?function(x,P){Object.defineProperty(x,"default",{enumerable:!0,value:P})}:function(x,P){x.default=P}),n=Se&&Se.__importStar||function(x){if(x&&x.__esModule)return x;var P={};if(x!=null)for(var _ in x)_!=="default"&&Object.prototype.hasOwnProperty.call(x,_)&&t(P,x,_);return r(P,x),P};Object.defineProperty(e,"__esModule",{value:!0}),e.validateKey=e.isKeyPaid=e.getKey=e.shouldShowCredit=void 0;const i=n(ja),a=eF(),o=di;e.shouldShowCredit=i.observable({value:!1});const l=i.action(()=>{e.shouldShowCredit.value=!0});let u="";const f=()=>u||"";e.getKey=f;const p=5,S=3e3,w="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",g="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.",m="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let v=window.location.origin;const y=navigator.userAgent.indexOf("Headless")>-1,h=navigator.userAgent.indexOf("Electron")>-1;v==="file://"&&y&&(v="headless"),v==="file://"&&h&&(v="electron");const d=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${v}" here: https://polotno.com/cabinet`;async function b(x){for(let P=0;P<p;P++)try{const _=await fetch(a.API+"/validate-key",{method:"POST",body:JSON.stringify({key:x,site:location.host})});if(!x)return console.warn(w),!1;if(_.status!==200){await new Promise(C=>setTimeout(C,S));continue}const A=await _.json();return A.is_valid||console.warn(g),A.is_paid||console.log(m,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),A.is_domain_valid||console.log(d,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,o.useRemoveBackground)(A.remove_background_enabled),A.is_paid||!1}catch{await new Promise(A=>setTimeout(A,S))}return console.error(E),!0}async function O(x,P){u=x,await b(x)&&!P||l()}e.isKeyPaid=b,e.validateKey=O}(tv)),tv}var m0={};(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})(m0);(function(e){var t=Se&&Se.__rest||function(z,q){var L={};for(var I in z)Object.prototype.hasOwnProperty.call(z,I)&&q.indexOf(I)<0&&(L[I]=z[I]);if(z!=null&&typeof Object.getOwnPropertySymbols=="function"){var B=0;for(I=Object.getOwnPropertySymbols(z);B<I.length;B++)q.indexOf(I[B])<0&&Object.prototype.propertyIsEnumerable.call(z,I[B])&&(L[I[B]]=z[I[B]])}return L},r=Se&&Se.__importDefault||function(z){return z&&z.__esModule?z:{default:z}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.registerTransformerAttrs=e.setTransformerStyle=void 0;const n=r(it),i=zi,a=ja,o=Ga,l=r(f0),u=r(Ui),f=r(l7),p=R2,S=x2,w=xS,g=M2(),E=v0,m=m0,v=di,y=$o,h=u.default.DD._drag;window.removeEventListener("mousemove",h),u.default.DD._drag=function(z){(0,a.runInAction)(()=>{h.call(this,z)})},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 b=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:z=>{z.hasName("rotater")&&z.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:b,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},x=z=>{Object.assign(O,z)};e.setTransformerStyle=x;const P={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 _(z,q){P[z]=P[z]||q,Object.assign(P[z],q)}e.registerTransformerAttrs=_;const A=z=>n.default.createElement(o.Rect,Object.assign({},z,{preventDefault:!1})),C=z=>{var{url:q}=z,L=t(z,["url"]);const[I,B]=(0,l.default)(q,"anonymous"),M=I?(0,w.getCrop)(I,{width:L.width,height:L.height},"center-middle"):{};return(0,S.useImageLoader)(B,"background"),n.default.createElement(o.Image,Object.assign({image:I},L,M))},k=z=>n.default.createElement(o.Rect,Object.assign({},z)),R=z=>{const{background:q,scale:L,borderColor:I}=z,B=t(z,["background","scale","borderColor"]),M=n.default.useMemo(()=>!!u.default.Util.colorToRGBA(q),[q]),$=n.default.useMemo(()=>{const K=document.createElement("canvas"),V=30;K.width=60,K.height=60;const H=K.getContext("2d");return H&&(H.fillStyle="black",H.fillRect(V,0,V,V),H.fillRect(0,V,V,V)),K},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:$},B,{opacity:.1,hideInExport:!0})),M?n.default.createElement(k,Object.assign({fill:q},B)):n.default.createElement(C,Object.assign({url:q},B)))},D=(0,i.observer)(({selection:z})=>z.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(z.x1,z.x2),y:Math.min(z.y1,z.y2),width:Math.abs(z.x1-z.x2),height:Math.abs(z.y1-z.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),U=(0,i.observer)(({x:z,y:q,width:L,height:I,rotation:B,anchor:M,store:$})=>{const K=(0,E.getClientRect)({x:z,y:q,width:L,height:I,rotation:u.default.Util.radToDeg(B)});if(M===void 0)return null;const V=(I/2+70)*Math.cos(B-Math.PI/2),H=(I/2+70)*Math.sin(B-Math.PI/2),X=(0,m.pxToUnitRounded)({unit:$.unit,dpi:$.dpi,px:L/$.scale,precious:$.unit==="px"?0:1})+" x "+(0,m.pxToUnitRounded)({unit:$.unit,dpi:$.dpi,px:I/$.scale,precious:$.unit==="px"?0:1})+($.unit==="px"?"":" "+$.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(K.minX+K.maxX)/2+V,y:(K.minY+K.maxY)/2+H,offsetX:14,offsetY:14,visible:M==="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:(K.minX+K.maxX)/2,y:K.maxY+20,visible:M!=="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:X})))}),Y=(0,i.observer)(({elements:z,store:q})=>{const L=z.filter(B=>B.alwaysOnTop),I=z.filter(B=>!B.alwaysOnTop).concat(L);return n.default.createElement(n.default.Fragment,null,I.map(B=>n.default.createElement(f.default,{key:B.id,store:q,element:B,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let j=null;const G=z=>{j=z};e.registerNextDomDrop=G,e.default=(0,i.observer)(({store:z,page:q,width:L,height:I,pageControlsEnabled:B,backColor:M,pageBorderColor:$,activePageBorderColor:K,components:V,bleedColor:H,altCloneEnabled:X})=>{const Z=z.bleedVisible?q.bleed:0,J=q.computedWidth+2*Z,ee=q.computedHeight+2*Z,re=(L-J*z.scale)/2,ne=(I-ee*z.scale)/2,de=n.default.useRef(null),pe=n.default.useRef(null),Me=n.default.useRef(null),Fe=B==null||B,[fe,ie]=n.default.useState(null),[ve,ge]=n.default.useState({}),te=z.selectedElements.find(Ee=>Ee._cropModeEnabled),ue=z.selectedShapes.filter(Ee=>!Ee.resizable).length>0,be=z.selectedShapes.filter(Ee=>!Ee.draggable).length>0,se=z.selectedElements.filter(Ee=>!Ee.visible).length>0;n.default.useLayoutEffect(()=>{var Ee,je,Le;if(!de.current)return;const we=de.current.getStage(),Ze=z.selectedShapes.map(We=>We._cropModeEnabled?null:we.findOne("#"+We.id)).filter(We=>We),Oe=z.selectedElements.length===1&&((Ee=z.selectedElements[0])===null||Ee===void 0?void 0:Ee.type)||"many";P[Oe]?(de.current.setAttrs(Object.assign(Object.assign({},O),P[Oe])),Oe!=="svg"&&Oe!=="image"||z.selectedElements[0].keepRatio||de.current.setAttrs({enabledAnchors:O.enabledAnchors}),Oe==="text"&&v.flags.textVerticalResizeEnabled&&de.current.setAttrs({enabledAnchors:(je=P.text.enabledAnchors)===null||je===void 0?void 0:je.concat(["bottom-center"])})):de.current.setAttrs(O),ue&&de.current.enabledAnchors([]),be&&de.current.rotateEnabled(!1),Ze.find(We=>We==null?void 0:We.isDragging())&&Ze.forEach(We=>{We.isDragging()||We==null||We.startDrag()}),de.current.nodes(Ze),(Le=de.current.getLayer())===null||Le===void 0||Le.batchDraw()},[z.selectedElements,te,ue,se,be]);const Pe=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),xe=n.default.useRef(!1),Ie=(0,y.useMobile)(),xt=(0,a.action)(Ee=>{var je,Le;if(Ie)return;xe.current=!1;const we=Ee.target.findAncestor(".elements-container"),Ze=Ee.target.findAncestor("Transformer"),Oe=Ee.target.findAncestor(".page-abs-container");if(we||Ze||Oe)return;const We=(je=Ee.target.getStage())===null||je===void 0?void 0:je.getPointerPosition();We&&(Pe.visible=!0,Pe.x1=We.x,Pe.y1=We.y,Pe.x2=We.x,Pe.y2=We.y,((Le=Ee.target.getStage())===null||Le===void 0?void 0:Le.getPointersPositions().length)>=2&&(Pe.visible=!1))});n.default.useEffect(()=>{const Ee=(0,a.action)(Le=>{var we,Ze;if(!Pe.visible)return;(we=pe.current)===null||we===void 0||we.setPointersPositions(Le);let Oe=((Ze=pe.current)===null||Ze===void 0?void 0:Ze.getPointerPosition())||{x:Pe.x2,y:Pe.y2};Pe.x2=Oe.x,Pe.y2=Oe.y}),je=(0,a.action)(()=>{if(!Pe.visible||!pe.current)return;const Le=pe.current.findOne(".selection"),we=Le?Le.getClientRect():{width:0,height:0,x:0,y:0};if(we.width&&we.height){const Ze=[];pe.current.find(".element").forEach(We=>{const ke=We.getClientRect(),ze=z.getElementById(We.id()),Xe=ze==null?void 0:ze.draggable,ot=ze==null?void 0:ze.selectable;u.default.Util.haveIntersection(we,ke)&&Xe&&ot&&Ze.push(ze.top.id)});const Oe=[...new Set(Ze)];z.selectElements(Oe)}Pe.visible=!1,xe.current=!0});return window.addEventListener("mousemove",Ee),window.addEventListener("touchmove",Ee),window.addEventListener("mouseup",je),window.addEventListener("touchend",je),()=>{window.removeEventListener("mousemove",Ee),window.removeEventListener("touchmove",Ee),window.removeEventListener("mouseup",je),window.removeEventListener("touchend",je)}},[]);const tt=Ee=>{if(z.activePage!==q&&q.select(),xe.current)return;const je=Ee.evt.ctrlKey||Ee.evt.metaKey||Ee.evt.shiftKey,Le=Ee.target.findAncestor(".elements-container"),we=Ee.target.findAncestor(".page-abs-container"),Ze=Ee.target.findAncestor("Transformer");if(!(je||Le||Ze||we))return void z.selectElements([]);const Oe=Ee.target.findAncestor(".element",!0),We=z.getElementById(Oe==null?void 0:Oe.id()),ke=We==null?void 0:We.top,ze=ke==null?void 0:ke.id,Xe=z.selectedElementsIds.indexOf(ze)>=0;ze&&je&&!Xe?z.selectElements(z.selectedElementsIds.concat([ze])):ze&&je&&Xe?z.selectElements(z.selectedElementsIds.filter(ot=>ot!==ze)):!ze||je||Xe||z.selectElements([ze])};(0,p.useSnap)(de);const St=z.activePage===q,Ht=V==null?void 0:V.PageControls,le=V==null?void 0:V.Tooltip,he=1/z.scale,nt=0/z.scale;return n.default.createElement("div",{ref:Me,onDragOver:Ee=>Ee.preventDefault(),onDrop:Ee=>{if(Ee.preventDefault(),!pe.current)return;pe.current.setPointersPositions(Ee);const je=pe.current.findOne(".elements-container").getRelativePointerPosition(),Le=pe.current.getPointerPosition(),we=pe.current.getAllIntersections(Le).map(We=>We.findAncestor(".element",!0)).filter(Boolean),Ze=[...new Set(we.reverse())].map(We=>z.getElementById(We.id())),Oe=Ze[0];j&&(j(je,Oe,{elements:Ze,page:q}),j=null)},style:{position:"relative",width:L+"px"},className:"polotno-page-container"+(St?" active-page":"")},n.default.createElement(o.Stage,{ref:pe,width:Math.min(L,4*window.innerWidth),height:Math.min(I,4*window.innerHeight),onClick:tt,onTap:tt,onMouseDown:xt,onMouseMove:Ee=>{if(!Ee.evt.altKey&&fe)return void ie(null);if(!Ee.evt.altKey)return;const je=Ee.target.findAncestor(".element",!0),Le=je==null?void 0:je.id();if(!z.selectedElements[0]||z.selectedElementsIds.includes(Le))return;const we=(0,E.getTotalClientRect)(z.selectedShapes),Ze=Le?z.getElementById(Le):{x:0,y:0,width:q.computedWidth,height:q.computedHeight,rotation:0},Oe=(0,E.getClientRect)(Ze),We=[];we.minX>Oe.maxX&&We.push({distance:we.minX-Oe.maxX,box1:we,box2:Oe,points:[{x:we.minX,y:we.minY+we.height/2},{x:Oe.maxX,y:we.minY+we.height/2},{x:Oe.maxX,y:Oe.minY+Oe.height/2}]}),we.maxX<Oe.minX&&We.push({distance:Oe.minX-we.maxX,box1:we,box2:Oe,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Oe.minX,y:we.minY+we.height/2},{x:Oe.minX,y:Oe.minY+Oe.height/2}]}),we.minY>Oe.maxY&&We.push({box1:we,box2:Oe,distance:we.minY-Oe.maxY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Oe.maxY},{x:Oe.minX+Oe.width/2,y:Oe.maxY}]}),we.maxY<Oe.minY&&We.push({box1:we,box2:Oe,distance:Oe.minY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Oe.minY},{x:Oe.minX+Oe.width/2,y:Oe.minY}]}),we.minX>=Oe.minX&&we.maxX<=Oe.maxX&&we.minY>=Oe.minY&&we.maxY<=Oe.maxY&&(We.push({distance:we.minX-Oe.minX,box1:we,box2:Oe,points:[{x:we.minX,y:we.minY+we.height/2},{x:Oe.minX,y:we.minY+we.height/2},{x:Oe.minX,y:Oe.minY+Oe.height/2}]}),We.push({distance:Oe.maxX-we.maxX,box1:we,box2:Oe,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Oe.maxX,y:we.minY+we.height/2},{x:Oe.maxX,y:Oe.minY+Oe.height/2}]}),We.push({box1:we,box2:Oe,distance:we.minY-Oe.minY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Oe.minY},{x:Oe.minX+Oe.width/2,y:Oe.minY}]}),We.push({box1:we,box2:Oe,distance:Oe.maxY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Oe.maxY},{x:Oe.minX+Oe.width/2,y:Oe.maxY}]})),JSON.stringify(fe)!==JSON.stringify(We)&&ie(We)},onTouchStart:xt,onDragStart:Ee=>{var je;const Le=Ee.target.findAncestor(".element",!0);if(Le){const we=z.getElementById(Le==null?void 0:Le.id()),Ze=we==null?void 0:we.top,Oe=Ze==null?void 0:Ze.id;!(z.selectedElementsIds.indexOf(Oe)>=0)&&Oe&&(z.selectElements([Oe]),Ee.target.stopDrag(),Ee.target.startDrag(Ee),(je=de.current)===null||je===void 0||je.startDrag(Ee))}fe&&ie(null)},pageId:q.id,style:{position:"relative"}},n.default.createElement(o.Layer,null,n.default.createElement(A,{width:L,height:I,fill:M}),n.default.createElement(o.Group,{x:re,y:ne,scaleX:z.scale,scaleY:z.scale,name:"page-container"},n.default.createElement(o.Group,{name:"page-container-2"},n.default.createElement(o.Group,{name:"page-background-group",x:Z,y:Z},n.default.createElement(R,{x:-q.bleed,y:-q.bleed,width:q.computedWidth+2*q.bleed,height:q.computedHeight+2*q.bleed,background:q.background,shadowBlur:10,shadowColor:"lightgrey",name:"page-background",preventDefault:!1,scale:z.scale})),n.default.createElement(o.Group,{x:Z,y:Z,name:"elements-container",listening:!z.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:q.computedWidth,height:q.computedHeight,listening:!1}),n.default.createElement(Y,{elements:q.children,store:z})),n.default.createElement(o.Rect,{stroke:H,name:"bleed",strokeWidth:q.bleed,x:q.bleed/2,y:q.bleed/2,width:q.computedWidth+q.bleed,height:q.computedHeight+q.bleed,listening:!1,visible:q.bleed>0&&z.bleedVisible,hideInExport:!0}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,L,0,L,I,0,I,0,0,re,ne,re,I-ne,L-re,I-ne,L-re,ne,re,ne],listening:!1,closed:!0,fill:M}),n.default.createElement(o.Group,{x:re,y:ne,scaleX:z.scale,scaleY:z.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-he/2-nt,y:-he/2-nt,width:J+he+2*nt,height:ee+he+2*nt,stroke:St&&z.pages.length>1?K:$,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:re+Z*z.scale,y:ne+Z*z.scale,scaleX:z.scale,scaleY:z.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:de,onDragStart:Ee=>{var je;!((je=Ee.evt)===null||je===void 0)&&je.altKey&&X&&z.selectedElements.forEach(Le=>{const we=Le.clone({},{skipSelect:!0}),Ze=q.children.indexOf(Le);q.setElementZIndex(we.id,Ze)}),z.history.startTransaction()},onDragEnd:()=>{z.history.endTransaction()},onTransformStart:()=>{z.history.startTransaction()},boundBoxFunc:(Ee,je)=>{const Le=Math.abs(je.width)<1||Math.abs(je.height)<1,we=Math.abs(Ee.width)<1||Math.abs(Ee.height)<1;return Le&&!we?Ee:je},onTransform:Ee=>{var je,Le;const we=de.current.nodes(),Ze=we[we.length-1];if(Ee.target!==Ze)return;const Oe=(je=de.current)===null||je===void 0?void 0:je.__getNodeRect(),We=(Le=de.current)===null||Le===void 0?void 0:Le.getActiveAnchor();ge({anchor:We,x:Oe.x,y:Oe.y,rotation:Oe.rotation,width:Oe.width,height:Oe.height})},onTransformEnd:Ee=>{ge({}),z.history.endTransaction()},visible:!z.isPlaying}),fe&&fe.map(({points:Ee,distance:je,box1:Le,box2:we},Ze)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:Ze,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({},we,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[Ee[0].x,Ee[0].y,Ee[1].x,Ee[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[Ee[1].x,Ee[1].y,Ee[2].x,Ee[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(Ee[0].x+Ee[1].x)/2,y:(Ee[0].y+Ee[1].y)/2,offsetY:-10,scaleX:1/z.scale,scaleY:1/z.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,m.pxToUnitString)({unit:z.unit,dpi:z.dpi,px:je})})))),q._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:J,height:ee,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:J,height:ee,align:"center",verticalAlign:"middle"})),le&&n.default.createElement(le,{components:V,store:z,page:q,stageRef:pe})),n.default.createElement(U,Object.assign({},ve,{store:z})),n.default.createElement(D,{selection:Pe}),g.shouldShowCredit.value&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:L-170,y:I-18,onMouseEnter:Ee=>{Ee.target.getStage().container().style.cursor="pointer"},onMouseLeave:Ee=>{Ee.target.getStage().container().style.cursor=""},onTouchStart:Ee=>{Ee.cancelBubble=!0},onMouseDown:Ee=>{Ee.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),Fe&&St&&Ht&&n.default.createElement(Ht,{store:z,page:q,xPadding:re,yPadding:ne}))})})(g9);var PS={};(function(e){var t=Se&&Se.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.LeftRules=e.TopRules=void 0;const r=t(it),n=v0,i=m0,a=zi,o=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];function l(){return r.default.createElement("div",null,r.default.createElement("h1",null,"Top rules"))}e.TopRules=(0,a.observer)(({store:u,width:f,height:p})=>{const S=r.default.useRef(null);if(!u.activePage)return null;const w=u.activePage,g=(u.bleedVisible&&w.bleed,w.computedWidth*u.scale),E=w.computedHeight*u.scale,m=(f-g)/2,v=(y=x=>(0,i.unitToPx)({unitVal:x,dpi:u.dpi,unit:u.unit})*u.scale,o.find(x=>y(x)>30)||1e4);var y;const h=(0,i.unitToPx)({unitVal:v,dpi:u.dpi,unit:u.unit})*u.scale,d=Math.round(g/h)+1,b=Math.round(E/h)+1,O=(0,n.getTotalClientRect)(u.selectedShapes);return r.default.createElement("div",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},ref:S},r.default.createElement("div",{style:{width:f+"px",height:"14px",position:"sticky",fontSize:"8px",lineHeight:"14px",top:"0px",left:"0px",color:"grey",borderBottom:"1px solid grey",backgroundColor:"#e8e8e8",overflow:"hidden"}},[...Array(d)].map((x,P)=>r.default.createElement("div",{key:P,style:{position:"absolute",left:m+P*h+"px",borderLeft:"1px solid grey",paddingLeft:"2px",width:h+"px"}},u.unit==="px"||v>=1?Math.round(v*P):(v*P).toFixed(1))),!!u.selectedShapes.length&&r.default.createElement("div",{style:{position:"absolute",left:m+O.x*u.scale+"px",height:"14px",width:O.width*u.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),u.pages.map((x,P)=>{var _;const A=x.computedHeight*u.scale,C=(p-A)/2;return r.default.createElement("div",{key:x.id,style:{left:"0px",width:"14px",height:p+"px",position:"sticky",fontSize:"8px",lineHeight:"14px",color:"grey",borderRight:"1px solid grey",backgroundColor:"#e8e8e8",overflow:"hidden"}},[...Array(b)].map((k,R)=>r.default.createElement("div",{key:R,style:{position:"absolute",left:"14px",top:C+R*h-14+"px",borderLeft:"1px solid grey",paddingLeft:"2px",transform:"rotate(90deg)",transformOrigin:"left top",width:h+"px",overflow:"hidden"}},u.unit==="px"||v>=1?Math.round(v*R):(v*R).toFixed(1))),((_=u.selectedShapes[0])===null||_===void 0?void 0:_.page)===x&&r.default.createElement("div",{style:{position:"absolute",top:C+O.y*u.scale-14+"px",width:"14px",height:O.height*u.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),e.LeftRules=l})(PS);var CS={},nv={},iv={};let tF="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}}},rF=(e,t=21)=>AS(e,t,TS),nF=(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 iF=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:rF,customRandom:AS,nanoid:nF,random:TS,urlAlphabet:tF},Symbol.toStringTag,{value:"Module"})),N2=Lo(iF);var av={},kS={},I2={};(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})(I2);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const t=Hi,r=I2;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 p=()=>f>0;function S(){const g=(0,t.getSnapshot)(i);return{pages:g.pages,width:g.width,height:g.height}}function w(g){const E=i.pages.map(v=>v.id),m=g.pages.map(v=>v.id);(0,r.deepEqual)(E,m)?i.pages.forEach((v,y)=>{(0,t.applySnapshot)(v,g.pages[y])}):(0,t.applySnapshot)(i.pages,g.pages),i.setSize(g.width,g.height)}return{startTransaction(){f++},endTransaction(g){f--,g||this.requestAddState(S())},async ignore(g,E=!1,m=!1){m&&await new Promise(b=>setTimeout(b,10)),u&&n.addUndoState();let v=p();n.startTransaction();let y=f;try{await g()}catch(b){setTimeout(()=>{throw b})}const h=y!==f,d=!h;n.endTransaction(d),E||v||n.replaceState(),h||(clearTimeout(u),u=0)},async transaction(g){await n.ignore(g,!0),this.addUndoState()},requestAddState(g){l=g,u||p()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),p()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const g=n.history[n.undoIdx];!(0,r.deepEqual)(l,g)&&(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(S())}),n.history.length===0&&this.requestAddState(S())},clear(){clearTimeout(u),u=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(S())},beforeDestroy(){a()},undo(){u&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,w(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,w(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=S()}}}),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
237
+ (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]);
238
+ `],{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={},Kc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=e.cropImage=e.loadImage=e.getImageSize=void 0;const t=Eu;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=p=>{u(p)},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 p=document.createElement("canvas");p.width=l.width,p.height=l.height;const S=p.getContext("2d");let{cropX:w,cropY:g}=l;const E=f.width*l.cropWidth,m=f.height*l.cropHeight,v=l.width/l.height;let y,h;const d=E/m;return l.type==="svg"?(y=E,h=m):v>=d?(y=E,h=E/v):(y=m*v,h=m),S.drawImage(f,w*f.width,g*f.height,y,h,0,0,p.width,p.height),p.toDataURL("image/png")}function a(o,l){const{width:u,height:f}=o,p=u/f;let S,w;p>=l.width/l.height?(S=l.width,w=l.width/p):(S=l.height*p,w=l.height);const g=(l.width-S)/2,E=(l.height-w)/2;return{cropX:g/l.width,cropY:E/l.height,cropWidth:S/l.width,cropHeight:w/l.height}}e.getImageSize=r,e.loadImage=n,e.cropImage=i,e.getCrop=a})(Kc);(function(e){var t=Se&&Se.__createBinding||(Object.create?function(_,A,C,k){k===void 0&&(k=C);var R=Object.getOwnPropertyDescriptor(A,C);R&&!("get"in R?!A.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return A[C]}}),Object.defineProperty(_,k,R)}:function(_,A,C,k){k===void 0&&(k=C),_[k]=A[C]}),r=Se&&Se.__setModuleDefault||(Object.create?function(_,A){Object.defineProperty(_,"default",{enumerable:!0,value:A})}:function(_,A){_.default=A}),n=Se&&Se.__importStar||function(_){if(_&&_.__esModule)return _;var A={};if(_!=null)for(var C in _)C!=="default"&&Object.prototype.hasOwnProperty.call(_,C)&&t(A,_,C);return r(A,_),A},i=Se&&Se.__rest||function(_,A){var C={};for(var k in _)Object.prototype.hasOwnProperty.call(_,k)&&A.indexOf(k)<0&&(C[k]=_[k]);if(_!=null&&typeof Object.getOwnPropertySymbols=="function"){var R=0;for(k=Object.getOwnPropertySymbols(_);R<k.length;R++)A.indexOf(k[R])<0&&Object.prototype.propertyIsEnumerable.call(_,k[R])&&(C[k[R]]=_[k[R]])}return C};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToHTML=e.jsonToDOM=e.fixRatio=void 0;const a=Kc,o=n(Eu),l=Kc,u=L2,f=(_,A,...C)=>({type:_,props:A,children:C||[]});function p(_){var A=new DOMParser().parseFromString(_,"image/svg+xml");return A.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(A)}e.fixRatio=p;const S=async({element:_,page:A,store:C})=>{let{src:k}=_;if(_.type==="svg"&&Object.keys(_.colorsReplace).length){const X=await o.urlToString(k);k=o.replaceColors(X,new Map(Object.entries(_.colorsReplace)))}let R="";_.flipX&&(R+="scaleX(-1)"),_.flipY&&(R+="scaleY(-1)"),R||(R="none");const D={};if(_.clipSrc){const X=await o.urlToBase64(_.clipSrc);D["clip-path"]=`url(${X})`}const U=await(0,l.loadImage)(k),Y=U.width*_.cropWidth,j=U.height*_.cropHeight,G=_.width/_.height;let z,q;const L=Y/j;_.type==="svg"?(z=Y,q=j):G>=L?(z=Y,q=Y/G):(z=j*G,q=j);const I=z/U.width,B=q/U.height,M=z/q>_.width/_.height?_.height/q:_.width/z,$=z*M/I,K=q*M/B,V=_.cropX*M*U.width,H=_.cropY*M*U.height;return f("div",{style:Object.assign(Object.assign({},D),{width:"100%",height:"100%","border-radius":_.cornerRadius+"px",border:_.borderSize?`${_.borderSize}px solid ${_.borderColor}`:"none",background:`url(${k})`,transform:R,"background-size":`${Math.round($)}px ${Math.round(K)}px`,"background-position-x":-Math.round(V)+"px","background-position-y":-Math.round(H)+"px"})})},w=async({element:_,page:A,store:C})=>{let k={};_.fill.indexOf("gradient")>=0&&(k=Object.assign(Object.assign({},k),{"background-color":_.fill,"background-image":_.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const R=_.backgroundPadding*(_.fontSize*_.lineHeight),D=f("div",{style:{position:"absolute",top:-R/2+"px",left:-R/2+"px",display:_.backgroundEnabled?"block":"none",width:_.width+R+"px",height:_.height+R+"px","background-color":_.backgroundColor,"border-radius":_.backgroundCornerRadius*(_.fontSize*_.lineHeight*.5)+"px"}}),U=f("div",{style:Object.assign(Object.assign({},k),{position:"absolute",top:0,left:0,width:_.width+"px",color:_.fill,"white-space":"pre-wrap","font-size":_.fontSize+"px","text-align":_.align,"font-family":_.fontFamily,"text-decoration":_.textDecoration||"none","line-height":_.lineHeight,"letter-spacing":_.letterSpacing+"em","font-style":_.fontStyle,"font-weight":_.fontWeight,"-webkit-text-stroke":`${_.strokeWidth}px ${_.stroke}`,"text-stroke":`${_.strokeWidth}px ${_.stroke}`})},_.text.split(`
239
+ `).join("<br />"));return f("div",{style:{position:"relative"}},D,U)},g=({element:_,type:A})=>{const C={"stroke-width":_.height,stroke:_.color,"line-cap":"round","stroke-linejoin":"round",opacity:_.opacity};return A==="arrow"||A==="triangle"?f("polyline",Object.assign({points:`${3*_.height},${2*-_.height} 0,0 ${3*_.height},${2*_.height}`},C)):A==="bar"?f("polyline",Object.assign({points:`0,${2*-_.height} 0,${2*_.height}`},C)):A==="circle"?f("circle",Object.assign({r:_.height},C)):A==="square"?f("polyline",Object.assign({points:`${-_.height},${-_.height} ${-_.height},${_.height} ${_.height},${_.height} ${_.height},${-_.height}`},C)):null},E=async({element:_,page:A,store:C})=>f("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},f("rect",{x:0,y:0,width:_.width,height:_.height,fill:_.color}),f("g",{transform:`translate(0 ${_.height/2})`},g({element:_,type:_.startHead})),f("g",{transform:`translate(${_.width} ${_.height/2}) rotate(180)`},g({element:_,type:_.endHead}))),m=async({element:_,page:A,store:C,elementHook:k})=>{const R=await Promise.all(_.children.map(U=>h({element:U,page:A,store:C,elementHook:k}))),D=f("div",{style:{"transform-origin":"top left",opacity:_.opacity}},...R);return k&&k({dom:D,element:_})||D},v=async({element:_,page:A,store:C,elementHook:k})=>{const R=(0,u.figureToSvg)(_),D=f("div",{innerHTML:R});return k&&k({dom:D,element:_})||D},y={image:S,svg:S,text:w,line:E,figure:v,group:m};async function h({element:_,page:A,store:C,elementHook:k}){let R=await y[_.type];R||(R=()=>f("div",{}),console.error(`HTML export does not support ${_.type} type...`));const D=await R({element:_,page:A,store:C}),U=[];_.blurEnabled&&U.push(`blur(${_.blurRadius/2}px)`),_.brightnessEnabled&&U.push(`brightness(${100*_.brightness+100}%)`),_.sepiaEnabled&&U.push("sepia()"),_.grayscaleEnabled&&U.push("grayscale()"),_.shadowEnabled&&U.push(`drop-shadow(${_.shadowOffsetX}px ${_.shadowOffsetY}px ${_.shadowBlur}px ${_.shadowColor})`);const Y=f("div",{style:{position:"absolute",left:_.x+"px",top:_.y+"px",width:_.width+"px",height:_.height+"px",transform:`rotate(${_.rotation}deg)`,"transform-origin":"top left",opacity:_.opacity,filter:U.join(" ")||"none"}},D);return k&&k({dom:Y,element:_})||Y}async function d({page:_,store:A,elementHook:C}){const k=await Promise.all(_.children.map(Y=>h({element:Y,page:_,store:A,elementHook:C}))),R=_.width==="auto"?A.width:_.width,D=_.height==="auto"?A.height:_.height;let U={};if(_.background.indexOf("url")>=0||_.background.indexOf("http")>=0||_.background.indexOf(".jpg")>=0||_.background.indexOf(".png")>=0||_.background.indexOf(".jpeg")>=0){const{width:Y,height:j}=await(0,l.loadImage)(_.background),G=await S({element:Object.assign({x:0,y:0,width:Y,height:j,src:_.background,cornerRadius:0},(0,a.getCrop)({width:Y,height:j},{width:Y,height:j})),page:_,store:A});k.unshift(G)}else U=Object.assign(Object.assign({},U),{"background-color":_.background});return f("div",{className:"page",style:Object.assign(Object.assign({},U),{width:R+"px",height:D+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...k)}async function b({json:_,elementHook:A}){const C=await Promise.all(_.pages.map(D=>d({page:D,store:_,elementHook:A}))),k=[];_.pages.forEach(D=>{D.children.forEach(U=>{U.type==="text"&&k.indexOf(U.fontFamily)===-1&&k.push(U.fontFamily)})});const R=k.map(D=>_.fonts.find(U=>U.fontFamily===D)?f("style",{},""):f("link",{href:`https://fonts.googleapis.com/css?family=${D}`,rel:"stylesheet"}));return f("div",{className:"design"},...R,...C)}e.jsonToDOM=b;const O=(_,A)=>typeof A=="object"?`${_}="${Object.keys(A).map(C=>`${C}:${A[C]};`).join(" ")}"`:`${_}="${A}"`,x=({dom:_})=>{if(typeof _=="string")return _;if(!_)return"";const A=_.props,{innerHTML:C}=A,k=i(A,["innerHTML"]);return`<${_.type} ${Object.keys(k).map(R=>O(R,_.props[R])).join(" ")}>${C||_.children.map(R=>x({dom:R})).join("")}</${_.type}>`};async function P({json:_,elementHook:A}){const C=await b({json:_,elementHook:A});return x({dom:C})}e.jsonToHTML=P})(IS);var DS={};(function(e){var t=Se&&Se.__createBinding||(Object.create?function(x,P,_,A){A===void 0&&(A=_);var C=Object.getOwnPropertyDescriptor(P,_);C&&!("get"in C?!P.__esModule:C.writable||C.configurable)||(C={enumerable:!0,get:function(){return P[_]}}),Object.defineProperty(x,A,C)}:function(x,P,_,A){A===void 0&&(A=_),x[A]=P[_]}),r=Se&&Se.__setModuleDefault||(Object.create?function(x,P){Object.defineProperty(x,"default",{enumerable:!0,value:P})}:function(x,P){x.default=P}),n=Se&&Se.__importStar||function(x){if(x&&x.__esModule)return x;var P={};if(x!=null)for(var _ in x)_!=="default"&&Object.prototype.hasOwnProperty.call(x,_)&&t(P,x,_);return r(P,x),P};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToSVG=e.jsonToDOM=e.fixRatio=void 0;const i=Kc,a=n(Eu),o=Kc,l=(x,P,..._)=>({type:x,props:P,children:_||[]});function u(x){var P=new DOMParser().parseFromString(x,"image/svg+xml");return P.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(P)}e.fixRatio=u;const f=async x=>{const P=await(0,o.loadImage)(x),_=document.createElement("canvas");return _.width=P.width,_.height=P.height,_.getContext("2d").drawImage(P,0,0),_.toDataURL("image/png")},p=async({element:x,page:P,store:_})=>{let{src:A}=x;if(x.type==="svg"){const H=await a.urlToString(A);A=a.replaceColors(H,new Map(Object.entries(x.colorsReplace)))}let C="";x.flipX&&(C+="scaleX(-1)"),x.flipY&&(C+="scaleY(-1)");const k={};if(x.clipSrc){const H=await a.urlToBase64(x.clipSrc);k["clip-path"]=`url(${H})`}const R=await(0,o.loadImage)(A),D=R.width*x.cropWidth,U=R.height*x.cropHeight,Y=x.width/x.height;let j,G;const z=D/U;x.type==="svg"?(j=D,G=U):Y>=z?(j=D,G=D/Y):(j=U*Y,G=U);const q=j/R.width,L=G/R.height,I=j/G>x.width/x.height?x.height/G:x.width/j,B=j*I/q,M=G*I/L,$=x.cropX*I*R.width,K=x.cropY*I*R.height,V=`clip-${Math.random()}`;return l("g",{style:{"clip-path":k["clip-path"],transform:C}},l("defs",{},l("clipPath",{id:V},l("rect",{x:$,y:K,width:B,height:M}))),l("image",{"xlink:href":await f(A),width:x.width,height:x.height,preserveAspectRatio:"none","clip-path":`url(#${V})`}))},S=async({element:x,page:P,store:_})=>{let A={};x.fill.indexOf("gradient")>=0&&(A=Object.assign(Object.assign({},A),{"background-color":x.fill,"background-image":x.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const C=x.backgroundPadding*(x.fontSize*x.lineHeight),k=l("div",{style:{position:"absolute",top:-C/2+"px",left:-C/2+"px",display:x.backgroundEnabled?"block":"none",width:x.width+C+"px",height:x.height+C+"px","background-color":x.backgroundColor,"border-radius":x.backgroundCornerRadius*(x.fontSize*x.lineHeight*.5)+"px"}}),R=l("div",{style:Object.assign(Object.assign({},A),{position:"absolute",top:0,left:0,width:x.width+"px",color:x.fill,"white-space":"pre-wrap","font-size":x.fontSize+"px","text-align":x.align,"font-family":x.fontFamily,"text-decoration":x.textDecoration||"none","line-height":x.lineHeight,"letter-spacing":x.letterSpacing+"em","font-style":x.fontStyle,"font-weight":x.fontWeight,"-webkit-text-stroke":`${x.strokeWidth}px ${x.stroke}`,"text-stroke":`${x.strokeWidth}px ${x.stroke}`})},x.text.split(`
240
+ `).join("<br />"));return l("foreignObject",{width:x.width,height:x.height},l("div",{style:{position:"relative"},xmlns:"http://www.w3.org/1999/xhtml"},k,R))},w=({element:x,type:P})=>{const _={"stroke-width":x.height,stroke:x.color,"line-cap":"round","stroke-linejoin":"round",opacity:x.opacity};return P==="arrow"||P==="triangle"?l("polyline",Object.assign({points:`${3*x.height},${2*-x.height} 0,0 ${3*x.height},${2*x.height}`},_)):P==="bar"?l("polyline",Object.assign({points:`0,${2*-x.height} 0,${2*x.height}`},_)):P==="circle"?l("circle",Object.assign({r:x.height},_)):P==="square"?l("polyline",Object.assign({points:`${-x.height},${-x.height} ${-x.height},${x.height} ${x.height},${x.height} ${x.height},${-x.height}`},_)):null},g=async({element:x,page:P,store:_})=>l("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},l("rect",{x:0,y:0,width:x.width,height:x.height,fill:x.color}),l("g",{transform:`translate(0 ${x.height/2})`},w({element:x,type:x.startHead})),l("g",{transform:`translate(${x.width} ${x.height/2}) rotate(180)`},w({element:x,type:x.endHead}))),E=async({element:x,page:P,store:_,elementHook:A})=>{const C=await Promise.all(x.children.map(R=>v({element:R,page:P,store:_,elementHook:A}))),k=l("g",{opacity:x.opacity,style:{"transform-origin":"top left"}},...C);return A&&A({dom:k,element:x})||k},m={image:p,svg:p,text:S,line:g,group:E};async function v({element:x,page:P,store:_,elementHook:A}){let C=await m[x.type];C||(C=()=>l("div",{}),console.error(`HTML export does not support ${x.type} type...`));const k=await C({element:x,page:P,store:_}),R=[];x.blurEnabled&&R.push(`blur(${x.blurRadius/2}px)`),x.brightnessEnabled&&R.push(`brightness(${100*x.brightness+100}%)`),x.sepiaEnabled&&R.push("sepia()"),x.grayscaleEnabled&&R.push("grayscale()"),x.shadowEnabled&&R.push(`drop-shadow(${x.shadowOffsetX}px ${x.shadowOffsetY}px ${x.shadowBlur}px ${x.shadowColor})`);const D=l("g",{transform:`translate(${x.x}, ${x.y}) rotate(${x.rotation})`,rotation:x.rotation,width:x.width,height:x.height,opacity:x.opacity,style:{"transform-origin":"top left",filter:R.join(" ")}},k);return A&&A({dom:D,element:x})||D}async function y({page:x,store:P,elementHook:_}){const A=await Promise.all(x.children.map(k=>v({element:k,page:x,store:P,elementHook:_})));let C={};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 k=await(0,o.loadImage)(x.background),R=await(0,o.cropImage)(x.background,Object.assign({width:P.width,height:P.height,x:0,y:0},(0,i.getCrop)({width:P.width,height:P.height},{width:k.width,height:k.height})));C=Object.assign(Object.assign({},C),{"background-image":`url(${R})`})}return l("g",{className:"page",style:Object.assign(Object.assign({},C),{background:x.background})},l("rect",{x:0,y:0,width:P.width,height:P.height,fill:x.background}),...A)}async function h({json:x,elementHook:P}){const _=await Promise.all(x.pages.map(k=>y({page:k,store:x,elementHook:P}))),A=[];x.pages.forEach(k=>{k.children.forEach(R=>{R.type==="text"&&A.indexOf(R.fontFamily)===-1&&A.push(R.fontFamily)})});const C=A.map(k=>x.fonts.find(R=>R.fontFamily===k)?l("style",{},""):l("link",{href:`https://fonts.googleapis.com/css?family=${k}`,rel:"stylesheet"}));return l("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${x.width} ${x.height}`,preserveAspectRatio:"xMidYMin slice"},...C,..._)}e.jsonToDOM=h;const d=(x,P)=>typeof P=="object"?`${x}="${Object.keys(P).map(_=>`${_}:${P[_]};`).join(" ")}"`:`${x}="${P}"`,b=({dom:x})=>typeof x=="string"?x:x?`<${x.type} ${Object.keys(x.props).map(P=>d(P,x.props[P])).join(" ")}>${x.children.map(P=>b({dom:P})).join("")}</${x.type}>
241
+ `:"";async function O({json:x,elementHook:P}){const _=await h({json:x,elementHook:P});return b({dom:_})}e.jsonToSVG=O})(DS);var ov={},k_;function FS(){return k_||(k_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const t=Hi,r=N2,n=Xc(),i=D2(),a=Xc();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(o=>{const l=Object.assign({},o),u={};for(var f in l)f[0]!=="_"&&(u[f]=o[f]);return u}).views(o=>({get store(){return(0,t.getParentOfType)(o,i.Store)},get startTime(){let l=0;for(const u of o.store.pages){if(u.id===o.id)return l;l+=u.duration}return l}})).views(o=>({get computedWidth(){return o.width==="auto"?o.store.width:o.width},get computedHeight(){return o.height==="auto"?o.store.height:o.height}})).actions(o=>({toJSON:()=>JSON.parse(JSON.stringify((0,t.getSnapshot)(o))),_forEachElementUp(l,u){const f=l.map(p=>({id:p,index:o.children.findIndex(S=>S.id===p)}));f.sort((p,S)=>S.index-p.index);for(const{index:p}of f){if(p==-1)continue;const S=p<o.children.length-1&&o.children[p+1],w=l.indexOf(S==null?void 0:S.id)>=0;p===o.children.length-1||w||u(p)}},_forEachElementDown(l,u){const f=l.map(p=>({id:p,index:o.children.findIndex(S=>S.id===p)}));f.sort((p,S)=>p.index-S.index);for(const{index:p}of f){if(p==-1)continue;const S=p>0&&o.children[p-1],w=l.indexOf(S==null?void 0:S.id)>=0;p===0||w||u(p)}return!1}})).actions(o=>({clone(l={}){const u=o.toJSON();u.children.forEach(w=>{w.id=(0,r.nanoid)(10),(0,a.forEveryChild)(w,g=>{g.id=(0,r.nanoid)(10)})});const f=Object.assign(Object.assign(Object.assign({},u),{id:(0,r.nanoid)(10)}),l),p=o.store.addPage(f),S=o.store.pages.indexOf(o);p.setZIndex(S+1),p.select()},setZIndex(l){o.store.setPageZIndex(o.id,l)},set(l){Object.assign(o,l)},select(){o.store.selectPage(o.id)},addElement(l,{skipSelect:u=!1}={}){const f=a.TYPES_MAP[l.type];if(!f)return void console.error("Can not find model with type "+l.type);l.children&&l.children.forEach(S=>{S.id=(0,r.nanoid)(10)});const p=f.create(Object.assign({id:(0,r.nanoid)(10)},l));return o.children.push(p),p.selectable&&!u&&o.store.selectElements([p.id]),p},canMoveElementsUp(l){let u=!1;return o._forEachElementUp(l,()=>{u=u||!0}),u},moveElementsUp(l){o._forEachElementUp(l,u=>{const f=o.children[u];(0,t.detach)(f),o.children.splice(u+1,0,f)})},canMoveElementsTop(l){return this.canMoveElementsUp(l)},moveElementsTop(l){const u=[],f=[];o.children.forEach(p=>{l.indexOf(p.id)>=0?u.push(p):f.push(p)}),o.children.replace(f.concat(u))},canMoveElementsDown(l){let u=!1;return o._forEachElementDown(l,()=>{u=u||!0}),u},moveElementsDown(l){o._forEachElementDown(l,u=>{const f=o.children[u];(0,t.detach)(f),o.children.splice(u-1,0,f)})},canMoveElementsBottom(l){return this.canMoveElementsDown(l)},moveElementsBottom(l){const u=[],f=[];o.children.forEach(p=>{l.indexOf(p.id)>=0?u.push(p):f.push(p)}),o.children.replace(u.concat(f))},setElementZIndex(l,u){const f=o.children.find(p=>p.id===l);f&&((0,t.detach)(f),o.children.remove(f),o.children.splice(u,0,f))},setSize({width:l,height:u,useMagic:f,softChange:p}){if(f){const S=l/o.computedWidth,w=u/o.computedHeight,g=Math.min(S,w),E=Math.max(0,(l-o.computedWidth*g)/2),m=Math.max(0,(u-o.computedHeight*g)/2);(0,a.forEveryChild)(o,v=>{v.type!=="group"&&(v.type==="image"&&v.x<1&&v.y<1&&v.width>=o.computedWidth-2&&v.height>=o.computedHeight-2?v.set({x:v.x*g,y:v.y*g,width:v.width*S,height:v.height*w,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(v.set({x:E+v.x*g,y:m+v.y*g,width:v.width*g,height:v.height*g}),v.type==="text"?v.set({fontSize:v.fontSize*g}):v.type==="figure"&&v.set({strokeWidth:v.strokeWidth*g})))})}p||(o.width=l),p||(o.height=u)}})).actions(o=>({moveElementUp(l){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),o.moveElementsUp([l])},moveElementDown(l){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),o.moveElementsDown([l])},moveElementTop(l){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),o.moveElementsTop([l])},moveElementBottom(l){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),o.moveElementsBottom([l])},play(){o.store.play({startTime:o.startTime,endTime:o.startTime+o.duration})}}))}(ov)),ov}var R_;function D2(){return R_||(R_=1,function(e){var t=Se&&Se.__createBinding||(Object.create?function(_,A,C,k){k===void 0&&(k=C);var R=Object.getOwnPropertyDescriptor(A,C);R&&!("get"in R?!A.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return A[C]}}),Object.defineProperty(_,k,R)}:function(_,A,C,k){k===void 0&&(k=C),_[k]=A[C]}),r=Se&&Se.__setModuleDefault||(Object.create?function(_,A){Object.defineProperty(_,"default",{enumerable:!0,value:A})}:function(_,A){_.default=A}),n=Se&&Se.__importStar||function(_){if(_&&_.__esModule)return _;var A={};if(_!=null)for(var C in _)C!=="default"&&Object.prototype.hasOwnProperty.call(_,C)&&t(A,_,C);return r(A,_),A},i=Se&&Se.__rest||function(_,A){var C={};for(var k in _)Object.prototype.hasOwnProperty.call(_,k)&&A.indexOf(k)<0&&(C[k]=_[k]);if(_!=null&&typeof Object.getOwnPropertySymbols=="function"){var R=0;for(k=Object.getOwnPropertySymbols(_);R<k.length;R++)A.indexOf(k[R])<0&&Object.prototype.propertyIsEnumerable.call(_,k[R])&&(C[k[R]]=_[k[R]])}return C},a=Se&&Se.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.createStore=e.Store=e.Font=void 0;const o=Hi,l=kS,u=N2,f=a(Ui),p=RS,S=LS,w=MS,g=M2(),E=n(_f),m=Ia,v=m0,y=I2,h=NS,d=IS,b=DS,O=FS(),x=Xc();function P({key:_,showCredit:A}={key:"",showCredit:!1}){const C=e.Store.create();return(0,g.validateKey)(_,A),C}(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(_=>Object.assign(Object.assign({},_),{fontFamily:_.fontFamily||_.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:"",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(_=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),_.bleedVisible},get selectedElements(){return _.selectedElementsIds.map(A=>{for(const C of _.pages)for(const k of C.children)if(k.id===A)return k}).filter(A=>!!A)},get children(){return _.pages},get selectedShapes(){const A=[];return(0,x.forEveryChild)({children:_.selectedElements},C=>{C.type!=="group"&&A.push(C)}),A},get activePage(){return _.pages.slice().find(A=>A.id===_._activePageId)||(_.pages.length?_.pages[0]:null)},get duration(){let A=0;return _.pages.forEach(C=>{A+=C.duration}),A},get _hasCroppedImages(){return _.find(A=>A.type==="image"&&A._cropModeEnabled)},find(A){let C;return(0,x.forEveryChild)({children:_.pages},k=>{if(!C&&A(k))return C=k,!0}),C},getElementById:A=>_.find(C=>C.id===A)})).actions(_=>{let A=0,C=null;return{afterCreate(){_.history.canUndo},setCurrentTime(k){_.currentTime=k},play({animatedElementsIds:k=[],startTime:R=0,currentTime:D=0,endTime:U=_.duration}={}){D&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),R=D),_.animatedElementsIds=(0,o.cast)(k),_.currentTime=R,_.isPlaying=!0,A=Date.now(),C=U,requestAnimationFrame(_.seek)},checkActivePage(){let k=0;for(const R of _.pages){if(_.currentTime>=R.startTime&&_.currentTime<R.startTime+R.duration){_.selectPage(R.id);break}k+=R.duration}},seek(){if(!_.isPlaying)return;const k=Date.now(),R=k-A;A=k,_.currentTime+=R,_.checkActivePage();const D=C||_.duration;_.isPlaying&&_.currentTime<D?requestAnimationFrame(_.seek):_.stop()},stop(){_.isPlaying=!1,_.currentTime=0,_.animatedElementsIds=(0,o.cast)([]),_.checkActivePage()}}}).actions(_=>({set(A){Object.assign(_,A)},setUnit({unit:A,dpi:C}){_.unit=A||_.unit,_.dpi=C||_.dpi},setRole(A){_.role=A},addPage(A){const C=O.Page.create(Object.assign({id:(0,u.nanoid)(10)},A));return _.pages.push(C),_._activePageId=C.id,C},selectPage(A){_._activePageId=A},selectElements(A){const C=A.map(k=>_.getElementById(k)).sort((k,R)=>k.page.children.indexOf(k)-k.page.children.indexOf(R)).filter(k=>!!k).map(k=>k.id);_.selectedElementsIds=(0,o.cast)(C)},toggleBleed(A){_.bleedVisible=A??!_.bleedVisible},toggleRulers(A){_.rulesVisible=A??!_.rulesVisible},openSidePanel(A){_.openedSidePanel=A},setScale(A){_.scale=A},_setScaleToFit(A){_.scaleToFit=A},setElementsPixelRatio(A){_._elementsPixelRatio=A},setSize(A,C,k){_.pages.forEach(R=>{R.setSize({width:A,height:C,useMagic:k,softChange:!0})}),_.width=A,_.height=C},setPageZIndex(A,C){const k=_.pages.find(R=>R.id===A);k&&((0,o.detach)(k),_.pages.remove(k),_.pages.splice(C,0,k))},deletePages(A){const C=_.pages.indexOf(_.activePage);A.forEach(D=>{const U=_.pages.find(Y=>Y.id===D);(0,o.destroy)(U)});const k=Math.min(_.pages.length-1,C),R=_.pages[k];R&&(_._activePageId=R.id),_.selectedElementsIds=(0,o.cast)(_.selectedElementsIds.filter(D=>_.getElementById(D)))},groupElements(A){const C=A.map(D=>_.getElementById(D));C.forEach(D=>{D&&(0,o.detach)(D)});const k=_.activePage,R={id:(0,u.nanoid)(10),children:C,type:"group"};return k.children.push(R),_.selectedElementsIds=(0,o.cast)([R.id]),R},ungroupElements(A){const C=A.map(R=>_.getElementById(R)),k=[];C.forEach(R=>{if(R&&R.type==="group"){const D=R.page,U=D.children.indexOf(R);R.children.forEach(Y=>{k.push(Y.id)}),R.children.forEach(Y=>{(0,o.detach)(Y),D.children.push(Y)}),D.children.splice(U,1)}}),_.selectedElementsIds=(0,o.cast)(k)},deleteElements(A){A.forEach(C=>{_.pages.forEach(k=>{const R=k.children.find(D=>D.id===C);R&&(0,o.destroy)(R)})}),_.selectedElementsIds=(0,o.cast)(_.selectedElementsIds.filter(C=>_.getElementById(C)))},on(A,C){if(A==="change"){let k=_.toJSON();return(0,o.onSnapshot)(_,R=>{const D=_.toJSON();!(0,y.deepEqual)(k,D)&&(k=D,C(D))})}},async _toCanvas({pixelRatio:A,ignoreBackground:C,pageId:k,mimeType:R,includeBleed:D}={}){var U;const Y=A||1;k=k||((U=_.pages[0])===null||U===void 0?void 0:U.id);const j=_.pages.find(ne=>ne.id===k);if(!j)throw new Error(`No page for export with id ${k}`);j==null||j.set({_exporting:!0});const G=await(0,h.waitTillAvailable)(()=>f.default.stages.find(ne=>ne.getAttr("pageId")===k));if(!G)throw new Error(`Export is failed. Can not find stage for page ${k}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const z=!!G.findOne(".page-container"),q=_._elementsPixelRatio;Y>_._elementsPixelRatio&&_.setElementsPixelRatio(Y),await _.waitLoading();const L=G.findOne(".page-container");if(!L)throw new Error(`Export is failed. Can't find page container. ${z}`);G.find("Transformer").forEach(ne=>ne.visible(!1)),L.find(".page-background").forEach(ne=>ne.shadowEnabled(!1)),L.find(".page-background").forEach(ne=>ne.strokeEnabled(!1)),L.find(".highlighter").forEach(ne=>ne.visible(!1));const I=L.findOne(".page-background-group"),B=I.clip();I.clip({x:null,y:null,width:null,height:null});const M=L.findOne(".elements-container"),$=M.clip();M.clip({x:null,y:null,width:null,height:null});const K=L.find(ne=>ne.getAttr("hideInExport"));K.forEach(ne=>{ne.setAttr("oldVisible",ne.visible()),ne.hide()});const V=L.find(ne=>!ne.visible()&&ne.getAttr("editModeEnabled"));V.forEach(ne=>{ne.setAttr("oldVisible",ne.visible()),ne.show()}),C&&L.find(".page-background").forEach(ne=>ne.hide());const H=D?j.bleed:0;let X=H;!_.bleedVisible&&D||(_.bleedVisible||D?_.bleedVisible&&D?X=0:_.bleedVisible&&!D&&(X=-j.bleed):X=0);const Z=document.createElement("canvas");Z.width=Math.round((j.computedWidth+2*H)*Y),Z.height=Math.round((j.computedHeight+2*H)*Y);const J=Z.getContext("2d");R==="image/jpeg"&&(J.fillStyle="white",J.fillRect(0,0,Z.width,Z.height));const ee=L.scale();L.scale({x:1,y:1});const re=L.toCanvas({x:L.x()-X,y:L.y()-X,width:j.computedWidth+2*H,height:j.computedHeight+2*H,pixelRatio:Y});return L.scale(ee),J.drawImage(re,0,0,Z.width,Z.height),f.default.Util.releaseCanvas(re),C&&L.find(".page-background").forEach(ne=>ne.show()),K.forEach(ne=>{ne.visible(ne.getAttr("oldVisible"))}),V.forEach(ne=>{ne.visible(ne.getAttr("oldVisible"))}),L.find(".page-background").forEach(ne=>ne.shadowEnabled(!0)),L.find(".page-background").forEach(ne=>ne.strokeEnabled(!0)),G.find("Transformer").forEach(ne=>ne.visible(!0)),L.find(".highlighter").forEach(ne=>ne.visible(!0)),I.clip(B),M.clip($),_.setElementsPixelRatio(q),j==null||j.set({_exporting:!1}),Z},async toDataURL({pixelRatio:A,ignoreBackground:C,pageId:k,mimeType:R,includeBleed:D,quality:U}={}){const Y=await _._toCanvas({pixelRatio:A,ignoreBackground:C,pageId:k,mimeType:R,includeBleed:D}),j=Y.toDataURL(R,U);return f.default.Util.releaseCanvas(Y),j},async toBlob({pixelRatio:A,ignoreBackground:C,pageId:k,mimeType:R,includeBleed:D,quality:U}={}){const Y=await _._toCanvas({pixelRatio:A,ignoreBackground:C,pageId:k,mimeType:R,includeBleed:D}),j=new Promise(G=>{Y.toBlob(G,R,U)});return f.default.Util.releaseCanvas(Y),j},async saveAsImage(A={}){var{fileName:C}=A,k=i(A,["fileName"]);const R=k.mimeType||"image/png",D=R.split("/")[1];(0,p.downloadFile)(await _.toDataURL(k),C||"polotno."+D,R)},async _toPDF(A){const C=A.dpi||_.dpi,k=A.parallel||1,R=A.unit||(_.unit==="px"?"mm":_.unit),D=A.pixelRatio||1,U=A.pageIds||_.pages.map(K=>K.id),Y=_.pages.filter(K=>U.includes(K.id)),j=await(0,S.getJsPDF)(),G=K=>(0,v.pxToUnit)({px:K,unit:R,dpi:C}),z=G(A.cropMarkSize||0),q=Y[0]||{},L=A.includeBleed?q.bleed:0,I=G(q.computedWidth+2*L)+2*z,B=G(q.computedHeight+2*L)+2*z;var M=new j({unit:R,orientation:I>B?"landscape":"portrait",format:[I,B],compress:!0,putOnlyUsedFonts:!0});M.deletePage(1);const $=((K,V)=>{for(var H=[],X=0;X<K.length;X+=V)H.push(K.slice(X,X+V));return H})(Y,k);for(const K of $){const V=K.map(async H=>{const X=A.includeBleed?H.bleed:0,Z=G(H.computedWidth+2*X)+2*z,J=G(H.computedHeight+2*X)+2*z;let ee=0,re=D;for(;ee<10;){ee+=1,ee===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const ne=await _.toDataURL(Object.assign(Object.assign({},A),{pageId:H.id,pixelRatio:re}));if(ne.length>20)return{url:ne,width:Z,height:J};re*=.8}});(await Promise.all(V)).forEach(({url:H,width:X,height:Z})=>{M.addPage([X,Z],X>Z?"landscape":"portrait"),z&&(M.setLineWidth(G(1)),M.line(2*z,0,2*z,z),M.line(0,2*z,z,2*z),M.line(X-2*z,0,X-2*z,z),M.line(X,2*z,X-z,2*z),M.line(0,Z-2*z,z,Z-2*z),M.line(2*z,Z,2*z,Z-z),M.line(X,Z-2*z,X-z,Z-2*z),M.line(X-2*z,Z,X-2*z,Z-z)),M.addImage(H,z,z,X-2*z,Z-2*z,void 0,"FAST")})}return M},toPDFDataURL:async A=>(await _._toPDF(Object.assign({mimeType:"image/jpeg"},A))).output("datauristring"),async toGIFDataURL(A={}){const C=A.pixelRatio||1,k=await(0,w.createGIF)({width:_.width*C,height:_.height*C}),R=1e3/(A.fps||10),D=_.duration/R;for(let U=0;U<D-1;U++){const Y=U*R||1;_.setCurrentTime(Y);let j=0,G="";for(const q of _.pages)if(j+=q.duration,q.set({_rendering:j>Y}),j>Y){G=q.id;break}const z=await _._toCanvas({pixelRatio:C,pageId:G});k.addFrame(z.getContext("2d"),{delay:R,copy:!0})}for(const U of _.pages)U.set({_rendering:!1});return _.stop(),k.render(),new Promise(U=>{k.on("finished",function(Y){(function(j,G){var z=new FileReader;z.onload=function(q){G(q.target.result)},z.readAsDataURL(j)})(Y,U)})})},async saveAsGIF(A={}){var{fileName:C}=A,k=i(A,["fileName"]);const R=await _.toGIFDataURL(k);(0,p.downloadFile)(R,C||"polotno.gif")},async toHTML({elementHook:A}={elementHook:void 0}){const C=_.toJSON();return(0,d.jsonToHTML)({json:C,elementHook:A})},async saveAsHTML({fileName:A}={}){const C=await _.toHTML(),k="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(C)));(0,p.downloadFile)(k,A||"polotno.html")},async toSVG(){const A=_.toJSON();return(0,b.jsonToSVG)({json:A})},async saveAsSVG({fileName:A}={}){const C=await _.toSVG(),k="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(C)));(0,p.downloadFile)(k,A||"polotno.svg")},async saveAsPDF(A={}){var{fileName:C}=A,k=i(A,["fileName"]);(await _._toPDF(Object.assign({mimeType:"image/jpeg"},k))).save(C||"polotno.pdf")},async waitLoading(){await new Promise(A=>setTimeout(A,50)),await(0,m.whenLoaded)()},toJSON:()=>({width:_.width,height:_.height,fonts:(0,o.getSnapshot)(_.fonts),pages:(0,o.getSnapshot)(_.pages),unit:_.unit,dpi:_.dpi,custom:_.custom}),loadJSON(A,C=!1){var k;const R=Object.assign({},A),D=_.pages.indexOf(_.activePage);let U=(k=R.pages[D]||R.pages[0])===null||k===void 0?void 0:k.id;R._activePageId=U;const Y=Object.assign({},(0,o.getSnapshot)(_));Object.assign(Y,R),Y.history=C?_.history.toJSON():{history:[],undoIdx:-1},(0,o.applySnapshot)(_,Y)},clear({keepHistory:A=!1}={}){const C=_.pages.map(k=>k.id);_.deletePages(C),A||_.history.clear()},addFont(A){_.removeFont(A.fontFamily),_.fonts.push(A),_.loadFont(A.fontFamily)},removeFont(A){_.fonts.filter(C=>C.fontFamily===A).forEach(C=>(0,o.destroy)(C))},async loadFont(A){const C=_.fonts.find(k=>k.fontFamily===A)||E.globalFonts.find(k=>k.fontFamily===A);C?E.injectCustomFont(C):E.injectGoogleFont(A),await E.loadFont(A)},validate:A=>e.Store.validate(A,[{path:"",type:e.Store}]).map(C=>({path:"store"+C.context.map(k=>k.path).join("."),message:C.message}))})),e.createStore=P,e.default=P}(av)),av}var L_;function jS(){return L_||(L_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const t=Hi,r=N2,n=D2(),i=FS(),a=Xc();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}})).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,p=>{p.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])},beforeDestroy(){}}))}(iv)),iv}var lv={},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 p=l.from[f],S=l.to[f];o.type==="exit"&&(p=l.to[f],S=-l.from[f]);const w=a[f]+p,g=a[f]+S-w;u[f]=w+i/o.duration*g}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 p in u){let S=u[p],w=f[p];if(o.type==="exit"){const E=S;S=w,w=E}const g=w-S;l[p]=S+i/o.duration*g}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 M_;function xu(){return M_||(M_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.Animation=void 0;const t=Hi,r=zS,n=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=n.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(i=>{const a=Object.assign(Object.assign({},i),{x:i.x||0,y:i.y||0});return"width"in i&&(a.width=a.width||1),"height"in i&&(a.height=a.height||1),i.locked&&(a.draggable=!1,a.contentEditable=!1,a.styleEditable=!1,a.resizable=!1),a}).views(i=>({get a(){const{currentTime:a}=i.store,o={x:i.x,y:i.y,width:i.width,height:i.height,rotation:i.rotation,opacity:i.opacity,color:i.color,fontSize:i.fontSize};if(a===0)return o;const l=a-i.page.startTime;if(l>i.page.duration||l<0)return o;const u=i.store.animatedElementsIds;if(u.length&&!u.includes(i.id))return o;const f=i.animations.find(S=>S.type==="enter");if(f!=null&&f.enabled&&l<f.delay&&(o.opacity=0),f!=null&&f.enabled&&l>=f.delay&&l<=f.delay+f.duration){const S=l-f.delay,w=(0,r.animate)({element:i,animation:f,dTime:S});Object.assign(o,w)}const p=i.animations.find(S=>S.type==="exit");if(p!=null&&p.enabled&&l>=i.page.duration-p.duration){const S=l-(i.page.duration-p.duration),w=(0,r.animate)({element:i,animation:p,dTime:S});Object.assign(o,w)}return o},animated:a=>i.a[a]})).actions(i=>({setAnimation(a,o){const l=i.animations.find(u=>u.type===a);l?Object.assign(l,o):i.animations.push(Object.assign({type:a},o))}}))}(lv)),lv}var sv={},N_;function aF(){return N_||(N_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const t=Hi,r=xu();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()}}))}(sv)),sv}var uv={},I_;function BS(){return I_||(I_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const t=xu();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()}}))}(uv)),uv}var cv={},D_;function oF(){return D_||(D_=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})}(cv)),cv}var fv={},F_;function lF(){return F_||(F_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const t=Hi,r=xu();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=>({}))}(fv)),fv}var dv={},j_;function sF(){return j_||(j_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const t=Hi,r=xu();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)}}))}(dv)),dv}var hv={},z_;function uF(){return z_||(z_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=Hi,r=xu();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})}(hv)),hv}var B_;function Xc(){return B_||(B_=1,function(e){var t=Se&&Se.__rest||function(m,v){var y={};for(var h in m)Object.prototype.hasOwnProperty.call(m,h)&&v.indexOf(h)<0&&(y[h]=m[h]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var d=0;for(h=Object.getOwnPropertySymbols(m);d<h.length;d++)v.indexOf(h[d])<0&&Object.prototype.propertyIsEnumerable.call(m,h[d])&&(y[h[d]]=m[h[d]])}return y};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeModel=e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0;const r=Hi,n=jS(),i=xu(),a=aF(),o=BS(),l=oF(),u=lF(),f=sF(),p=uF(),S=(m,v)=>{if(m.children)for(const y of m.children){if(v(y)===!0)break;(0,e.forEveryChild)(y,v)}};e.forEveryChild=S;const w=[...new Array(20)].map((m,v)=>r.types.late(()=>g[v]));e.ElementTypes=r.types.union({dispatcher:m=>{const v=e.TYPES_MAP[m.type];if(!v)throw new Error(`Unknown element type: "${m.type}"`);return v}},f.SVGElement,a.TextElement,o.ImageElement,u.LineElement,l.VideoElement,p.FigureElement,r.types.late(()=>e.GroupElement),...w),e.GroupElement=n.Node.named("Group").props({type:"group",children:r.types.array(e.ElementTypes)}).views(m=>({get draggable(){let v=!0;return(0,e.forEveryChild)(m,y=>{y.draggable||(v=!1)}),v},get resizable(){let v=!0;return(0,e.forEveryChild)(m,y=>{y.resizable||(v=!1)}),v},get contentEditable(){let v=!0;return(0,e.forEveryChild)(m,y=>{y.contentEditable||(v=!1)}),v},get styleEditable(){let v=!0;return(0,e.forEveryChild)(m,y=>{y.styleEditable||(v=!1)}),v},get locked(){let v=!0;return(0,e.forEveryChild)(m,y=>{y.locked||(v=!1)}),v}})).actions(m=>({set(v){var{draggable:y,contentEditable:h,styleEditable:d,resizable:b}=v,O=t(v,["draggable","contentEditable","styleEditable","resizable"]);y!==void 0&&(0,e.forEveryChild)(m,x=>{x.set({draggable:y})}),h!==void 0&&(0,e.forEveryChild)(m,x=>{x.set({contentEditable:h})}),d!==void 0&&(0,e.forEveryChild)(m,x=>{x.set({styleEditable:d})}),b!==void 0&&(0,e.forEveryChild)(m,x=>{x.set({resizable:b})}),Object.assign(m,O)}}));const g=[];function E(m,v){const y=m.type;if(!y)throw new Error('You must pass "type" attribute to custom model.');let h=i.Shape.named(y).props(m);v&&(h=v(h)),e.TYPES_MAP[y]=h,g.push(h)}e.TYPES_MAP={svg:f.SVGElement,text:a.TextElement,image:o.ImageElement,group:e.GroupElement,line:u.LineElement,video:l.VideoElement,figure:p.FigureElement},e.registerShapeModel=E}(nv)),nv}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=void 0;const t=Xc();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 p,S,w,g,E,m,v,y;if(((p=document.activeElement)===null||p===void 0?void 0:p.tagName)==="INPUT"||((S=document.activeElement)===null||S===void 0?void 0:S.tagName)==="TEXTAREA"||((w=document.activeElement)===null||w===void 0?void 0:w.contentEditable)==="true")return;const h=f.selectedElements.filter(x=>x.removable),d=h.map(x=>x.id);u.keyCode!==46&&u.keyCode!==8||f.deleteElements(d);const b=u.ctrlKey||u.metaKey,O=u.shiftKey;if(b&&!O&&u.code==="KeyZ"&&(u.preventDefault(),f.history.undo()),b&&O&&u.code==="KeyZ"&&(u.preventDefault(),f.history.redo()),b&&u.code==="KeyA"){u.preventDefault();const x=(g=f.activePage)===null||g===void 0?void 0:g.children.filter(_=>_.selectable),P=(x==null?void 0:x.map(_=>_.id))||[];f.selectElements(P)}if(b&&u.code==="KeyC"&&(u.preventDefault(),n=(E=f.activePage)===null||E===void 0?void 0:E.id,a(f.selectedElements.map(x=>x.toJSON()))),b&&u.code==="KeyX"&&(u.preventDefault(),n=(m=f.activePage)===null||m===void 0?void 0:m.id,a(f.selectedElements.map(x=>x.toJSON())),f.deleteElements(h)),b&&u.code==="KeyV"){u.preventDefault();let x=0;n===((v=f.activePage)===null||v===void 0?void 0:v.id)&&(x=f.width/20),n=(y=f.activePage)===null||y===void 0?void 0:y.id,f.history.transaction(()=>{const P=[],_=o();(0,t.forEveryChild)({children:_},A=>{delete A.id,A.type!=="group"&&(A.x+=x,A.y+=x)}),console.log(_),_.forEach(A=>{var C;const k=(C=f.activePage)===null||C===void 0?void 0:C.addElement(A);k&&P.push(k.id)}),a(_),f.selectElements(P)})}u.code==="ArrowDown"&&(u.preventDefault(),f.selectedElements.forEach(x=>{x.set({y:x.y+1})})),u.code==="ArrowUp"&&(u.preventDefault(),f.selectedElements.forEach(x=>{x.set({y:x.y-1})})),u.code==="ArrowLeft"&&(u.preventDefault(),f.selectedElements.forEach(x=>{x.set({x:x.x-1})})),u.code==="ArrowRight"&&(u.preventDefault(),f.selectedElements.forEach(x=>{x.set({x:x.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=ja,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",removeClip:"Remove clip",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",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",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,p){var S,w=p.split("."),g=f;for(S=0;S<w.length;++S){if(g[w[S]]==null)return;g=g[w[S]]}return g}const i=f=>f&&typeof f=="object";function a(f,p){Object.keys(p).forEach(S=>{const w=f[S],g=p[S];i(g)&&i(w)?a(w,g):f[S]=g})}e.setTranslations=(0,t.action)(f=>{a(r,f)});const o=()=>(0,t.toJS)(r);e.getTranslations=o;const l={},u=f=>{const p=n(r,f);if(p!==void 0)return p;l[f]||(l[f]=!0,console.warn(`Missing translation '${f}'`));const S=f.split("."),w=S[S.length-1]||" ";return w.charAt(0).toUpperCase()+w.slice(1)};e.t=u})(US);(function(e){var t=Se&&Se.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const r=t(it),n=zi,i=t(g9),a=PS,o=CS,l=US,u=`Polotno warning: <Workspace /> component can not automatically detect its size.
242
+ Width or height of parent elements is equal 0.
243
+ Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
244
+ For simpler debugging here is the log of the parent element:`,f=(g,E,m,v,y,h)=>{const d=r.default.useRef({width:E,height:m}),b=r.default.useRef({top:0,left:0}),O=r.default.useRef(!1),x=r.default.useRef(y.pages.length);O.current=x.current!==y.pages.length,x.current=y.pages.length,r.default.useEffect(()=>{const P=g.current,_=A=>{b.current={top:P.scrollTop,left:P.scrollLeft}};return P.addEventListener("scroll",_),()=>{P.removeEventListener("scroll",_)}},[]),r.default.useLayoutEffect(()=>{if(!g.current||O.current)return;const P=g.current,_=(b.current.left+P.offsetWidth/2)/d.current.width,A=(b.current.top+P.offsetHeight/2)/d.current.height;h.current=!0,P.scrollLeft=_*E-P.offsetWidth/2,P.scrollTop=A*m-P.offsetHeight/2,d.current={width:E,height:m}},[v,E,m])},p=(g,E,m,v,y)=>{const h=r.default.useRef(!1),d=r.default.useRef(null);r.default.useEffect(()=>{const O=g.current,x=()=>{y.current};return O.addEventListener("scroll",x),()=>{O.removeEventListener("scroll",x)}},[]);const b=m.pages.indexOf(m.activePage);return r.default.useLayoutEffect(()=>{if(!m.activePage||!g.current||h.current)return;const O=g.current,x=m.pages.indexOf(m.activePage)*E;Math.abs(x-O.scrollTop)>.5*E&&(y.current=!0,O.scrollTop=x)},[m.activePage,b]),{handleScroll:O=>{if(y.current)return void(y.current=!1);h.current=!0,clearTimeout(d.current),d.current=setTimeout(()=>{h.current=!1},300);const x=O.currentTarget.childNodes[0].offsetHeight,P=O.currentTarget.scrollTop,_=Math.floor((P+v.height/3)/x),A=m.pages[_];A&&A.select()}}},S=({store:g})=>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:()=>{g.addPage()}},(0,l.t)("workspace.addPage"))),w=({width:g,height:E,xPadding:m,yPadding:v,backgroundColor:y})=>r.default.createElement("div",{style:{width:g+"px",height:E+"px",backgroundColor:y,paddingLeft:m+"px",paddingRight:m+"px",paddingTop:v+"px",paddingBottom:v+"px"}},r.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:g,pageControlsEnabled:E,backgroundColor:m,pageBorderColor:v,activePageBorderColor:y,bleedColor:h,components:d,onKeyDown:b,paddingX:O,paddingY:x,altCloneEnabled:P=!0})=>{const _=O??20,A=x??55,[C,k]=r.default.useState({width:100,height:100}),R=r.default.useRef(C),D=r.default.useRef(null),U=r.default.useRef(null),Y=g.bleedVisible?Math.max(0,...g.pages.map(ee=>ee.bleed)):0,j=Math.max(...g.pages.map(ee=>ee.computedWidth)),G=Math.max(...g.pages.map(ee=>ee.computedHeight)),z=j+2*Y,q=G+2*Y,L=async({skipTimeout:ee}={skipTimeout:!1})=>{if(ee||await new Promise(fe=>setTimeout(fe,50)),D.current===null)return;const re=D.current.getBoundingClientRect();re.width!==0&&re.height!==0||(console.warn(u),console.log(D.current));const ne=U.current.clientWidth||re.width,de={width:ne,height:re.height};(R.current.width!==de.width||R.current.height!==de.height)&&(k(de),R.current=de);const pe=(ne-2*_)/z,Me=(re.height-2*A)/q,Fe=Math.max(Math.min(pe,Me),.01);g.scaleToFit!==Fe&&(g.setScale(Fe),g._setScaleToFit(Fe))};r.default.useLayoutEffect(()=>{L({skipTimeout:!0})},[]),r.default.useEffect(()=>{L()},[z,q]),r.default.useEffect(()=>{const ee=D.current;if(window.ResizeObserver){const re=new ResizeObserver(()=>{L({skipTimeout:!0})});return re.observe(ee),()=>re.unobserve(ee)}{const re=setInterval(()=>{L({skipTimeout:!0})},100);return()=>clearInterval(re)}},[z,q]);const I=Math.max(_,(C.width-z*g.scale)/2),B=q*g.scale*g.pages.length,M=Math.max(A,(C.height-B)/g.pages.length/2);r.default.useEffect(()=>{const ee=re=>{(b||o.handleHotkey)(re,g)};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[]),r.default.useEffect(()=>{var ee;const re=ne=>{if(ne.ctrlKey||ne.metaKey){ne.preventDefault();const Fe=Math.max(3,g.scaleToFit),fe=Math.min(.1,g.scaleToFit),ie=(de=ne.deltaY<0?1.05*g.scale:g.scale/1.05,pe=fe,Me=Fe,Math.max(pe,Math.min(Me,de)));g.setScale(ie)}else var de,pe,Me};return(ee=U.current)===null||ee===void 0||ee.addEventListener("wheel",re),()=>{var ne;return(ne=U.current)===null||ne===void 0?void 0:ne.removeEventListener("wheel",re)}},[]);const $=r.default.useRef(!1);f(U,z*g.scale+2*I,q*g.scale+2*M,g.scale,g,$);const{handleScroll:K}=p(U,q*g.scale+2*M,g,C,$),V=C.width>=z*g.scale+2*I,H=m||"rgba(232, 232, 232, 0.9)",X=g.pages.indexOf(g.activePage),Z=(d==null?void 0:d.NoPages)||S,J=Math.min(3,Math.max(1,Math.ceil(C.height/2/(q*g.scale))));return r.default.createElement("div",{ref:D,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:H},tabIndex:0,className:"polotno-workspace-container"},r.default.createElement("div",{ref:U,onScroll:K,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:V?"hidden":"auto"},className:"polotno-workspace-inner"},g.pages.map((ee,re)=>Math.abs(re-X)<=J||ee._exporting?r.default.createElement(i.default,{key:ee.id,page:ee,xPadding:I,yPadding:M,width:z*g.scale+2*I,height:q*g.scale+2*M,store:g,pageControlsEnabled:E,backColor:H,pageBorderColor:v||"lightgrey",activePageBorderColor:y||"rgb(0, 161, 255)",altCloneEnabled:P,bleedColor:h||"rgba(255, 0, 0, 0.1)",components:d}):r.default.createElement(w,{key:ee.id,width:z*g.scale+2*I,height:q*g.scale+2*M,backgroundColor:H,xPadding:I,yPadding:M})),g.rulesVisible&&r.default.createElement(a.TopRules,{store:g,xPadding:I,yPadding:M,width:z*g.scale+2*I,height:q*g.scale+2*M}),g.pages.length===0&&r.default.createElement(Z,{store:g})))}),e.default=e.WorkspaceCanvas})(Jw);var cF=D2();$l.toggleFadeInAnimation(!1);di.setTextOverflow("change-font-size");const fF=new URLSearchParams(location.search).get("key"),HS=cF.createStore({key:fF});window.store=HS;window.config={addGlobalFont:_f.addGlobalFont,unstable_useHtmlTextRender:di.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:di.setTextVerticalResizeEnabled,unstable_setTextOverflow:di.setTextOverflow,onLoadError:Ia.onLoadError,setAssetLoadTimeout:Ia.setAssetLoadTimeout};const dF=rh.createRoot(document.getElementById("root"));dF.render(vt.createElement(Jw.WorkspaceCanvas,{store:HS,components:{PageControls:()=>null,Tooltip:()=>null}}));