polotno-node 2.6.2 → 2.6.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,228 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.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 ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ya(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var I3={exports:{}},ht={};/**
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 lc=Symbol.for("react.element"),I9=Symbol.for("react.portal"),L9=Symbol.for("react.fragment"),j9=Symbol.for("react.strict_mode"),D9=Symbol.for("react.profiler"),F9=Symbol.for("react.provider"),z9=Symbol.for("react.context"),B9=Symbol.for("react.forward_ref"),U9=Symbol.for("react.suspense"),G9=Symbol.for("react.memo"),H9=Symbol.for("react.lazy"),_b=Symbol.iterator;function V9(t){return t===null||typeof t!="object"?null:(t=_b&&t[_b]||t["@@iterator"],typeof t=="function"?t:null)}var L3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j3=Object.assign,D3={};function Es(t,e,r){this.props=t,this.context=e,this.refs=D3,this.updater=r||L3}Es.prototype.isReactComponent={};Es.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};Es.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function F3(){}F3.prototype=Es.prototype;function Im(t,e,r){this.props=t,this.context=e,this.refs=D3,this.updater=r||L3}var Lm=Im.prototype=new F3;Lm.constructor=Im;j3(Lm,Es.prototype);Lm.isPureReactComponent=!0;var wb=Array.isArray,z3=Object.prototype.hasOwnProperty,jm={current:null},B3={key:!0,ref:!0,__self:!0,__source:!0};function U3(t,e,r){var n,i={},a=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(a=""+e.key),e)z3.call(e,n)&&!B3.hasOwnProperty(n)&&(i[n]=e[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(t&&t.defaultProps)for(n in l=t.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return{$$typeof:lc,type:t,key:a,ref:o,props:i,_owner:jm.current}}function q9(t,e){return{$$typeof:lc,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Dm(t){return typeof t=="object"&&t!==null&&t.$$typeof===lc}function $9(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var Sb=/\/+/g;function Wg(t,e){return typeof t=="object"&&t!==null&&t.key!=null?$9(""+t.key):e.toString(36)}function ed(t,e,r,n,i){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case lc:case I9:o=!0}}if(o)return o=t,i=i(o),t=n===""?"."+Wg(o,0):n,wb(i)?(r="",t!=null&&(r=t.replace(Sb,"$&/")+"/"),ed(i,e,r,"",function(f){return f})):i!=null&&(Dm(i)&&(i=q9(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Sb,"$&/")+"/")+t)),e.push(i)),1;if(o=0,n=n===""?".":n+":",wb(t))for(var l=0;l<t.length;l++){a=t[l];var u=n+Wg(a,l);o+=ed(a,e,r,u,i)}else if(u=V9(t),typeof u=="function")for(t=u.call(t),l=0;!(a=t.next()).done;)a=a.value,u=n+Wg(a,l++),o+=ed(a,e,r,u,i);else if(a==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function xf(t,e,r){if(t==null)return t;var n=[],i=0;return ed(t,n,"","",function(a){return e.call(r,a,i++)}),n}function W9(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var qr={current:null},td={transition:null},Y9={ReactCurrentDispatcher:qr,ReactCurrentBatchConfig:td,ReactCurrentOwner:jm};ht.Children={map:xf,forEach:function(t,e,r){xf(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return xf(t,function(){e++}),e},toArray:function(t){return xf(t,function(e){return e})||[]},only:function(t){if(!Dm(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ht.Component=Es;ht.Fragment=L9;ht.Profiler=D9;ht.PureComponent=Im;ht.StrictMode=j9;ht.Suspense=U9;ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y9;ht.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=j3({},t.props),i=t.key,a=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(a=e.ref,o=jm.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(u in e)z3.call(e,u)&&!B3.hasOwnProperty(u)&&(n[u]=e[u]===void 0&&l!==void 0?l[u]:e[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:lc,type:t.type,key:i,ref:a,props:n,_owner:o}};ht.createContext=function(t){return t={$$typeof:z9,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:F9,_context:t},t.Consumer=t};ht.createElement=U3;ht.createFactory=function(t){var e=U3.bind(null,t);return e.type=t,e};ht.createRef=function(){return{current:null}};ht.forwardRef=function(t){return{$$typeof:B9,render:t}};ht.isValidElement=Dm;ht.lazy=function(t){return{$$typeof:H9,_payload:{_status:-1,_result:t},_init:W9}};ht.memo=function(t,e){return{$$typeof:G9,type:t,compare:e===void 0?null:e}};ht.startTransition=function(t){var e=td.transition;td.transition={};try{t()}finally{td.transition=e}};ht.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};ht.useCallback=function(t,e){return qr.current.useCallback(t,e)};ht.useContext=function(t){return qr.current.useContext(t)};ht.useDebugValue=function(){};ht.useDeferredValue=function(t){return qr.current.useDeferredValue(t)};ht.useEffect=function(t,e){return qr.current.useEffect(t,e)};ht.useId=function(){return qr.current.useId()};ht.useImperativeHandle=function(t,e,r){return qr.current.useImperativeHandle(t,e,r)};ht.useInsertionEffect=function(t,e){return qr.current.useInsertionEffect(t,e)};ht.useLayoutEffect=function(t,e){return qr.current.useLayoutEffect(t,e)};ht.useMemo=function(t,e){return qr.current.useMemo(t,e)};ht.useReducer=function(t,e,r){return qr.current.useReducer(t,e,r)};ht.useRef=function(t){return qr.current.useRef(t)};ht.useState=function(t){return qr.current.useState(t)};ht.useSyncExternalStore=function(t,e,r){return qr.current.useSyncExternalStore(t,e,r)};ht.useTransition=function(){return qr.current.useTransition()};ht.version="18.2.0";I3.exports=ht;var at=I3.exports;const dt=oh(at);var vd={},G3={exports:{}},_n={},H3={exports:{}},V3={};/**
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(t){function e(W,j){var M=W.length;W.push(j);e:for(;0<M;){var k=M-1>>>1,D=W[k];if(0<i(D,j))W[k]=j,W[M]=D,M=k;else break e}}function r(W){return W.length===0?null:W[0]}function n(W){if(W.length===0)return null;var j=W[0],M=W.pop();if(M!==j){W[0]=M;e:for(var k=0,D=W.length,B=D>>>1;k<B;){var q=2*(k+1)-1,K=W[q],$=q+1,U=W[$];if(0>i(K,M))$<D&&0>i(U,K)?(W[k]=U,W[$]=M,k=$):(W[k]=K,W[q]=M,k=q);else if($<D&&0>i(U,M))W[k]=U,W[$]=M,k=$;else break e}}return j}function i(W,j){var M=W.sortIndex-j.sortIndex;return M!==0?M:W.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],f=[],y=1,b=null,v=3,h=!1,w=!1,E=!1,S=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,p=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(W){for(var j=r(f);j!==null;){if(j.callback===null)n(f);else if(j.startTime<=W)n(f),j.sortIndex=j.expirationTime,e(u,j);else break;j=r(f)}}function g(W){if(E=!1,d(W),!w)if(r(u)!==null)w=!0,Y(m);else{var j=r(f);j!==null&&G(g,j.startTime-W)}}function m(W,j){w=!1,E&&(E=!1,_(O),O=-1),h=!0;var M=v;try{for(d(j),b=r(u);b!==null&&(!(b.expirationTime>j)||W&&!C());){var k=b.callback;if(typeof k=="function"){b.callback=null,v=b.priorityLevel;var D=k(b.expirationTime<=j);j=t.unstable_now(),typeof D=="function"?b.callback=D:b===r(u)&&n(u),d(j)}else n(u);b=r(u)}if(b!==null)var B=!0;else{var q=r(f);q!==null&&G(g,q.startTime-j),B=!1}return B}finally{b=null,v=M,h=!1}}var x=!1,P=null,O=-1,R=5,T=-1;function C(){return!(t.unstable_now()-T<R)}function N(){if(P!==null){var W=t.unstable_now();T=W;var j=!0;try{j=P(!0,W)}finally{j?F():(x=!1,P=null)}}else x=!1}var F;if(typeof p=="function")F=function(){p(N)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,z=H.port2;H.port1.onmessage=N,F=function(){z.postMessage(null)}}else F=function(){S(N,0)};function Y(W){P=W,x||(x=!0,F())}function G(W,j){O=S(function(){W(t.unstable_now())},j)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(W){W.callback=null},t.unstable_continueExecution=function(){w||h||(w=!0,Y(m))},t.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<W?Math.floor(1e3/W):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(W){switch(v){case 1:case 2:case 3:var j=3;break;default:j=v}var M=v;v=j;try{return W()}finally{v=M}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(W,j){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var M=v;v=W;try{return j()}finally{v=M}},t.unstable_scheduleCallback=function(W,j,M){var k=t.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?k+M:k):M=k,W){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=M+D,W={id:y++,callback:j,priorityLevel:W,startTime:M,expirationTime:D,sortIndex:-1},M>k?(W.sortIndex=M,e(f,W),r(u)===null&&W===r(f)&&(E?(_(O),O=-1):E=!0,G(g,M-k))):(W.sortIndex=D,e(u,W),w||h||(w=!0,Y(m))),W},t.unstable_shouldYield=C,t.unstable_wrapCallback=function(W){var j=v;return function(){var M=v;v=j;try{return W.apply(this,arguments)}finally{v=M}}}})(V3);H3.exports=V3;var yu=H3.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 q3=at,mn=yu;function Pe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var $3=new Set,Nu={};function Ko(t,e){ts(t,e),ts(t+"Capture",e)}function ts(t,e){for(Nu[t]=e,t=0;t<e.length;t++)$3.add(e[t])}var Zi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),S0=Object.prototype.hasOwnProperty,K9=/^[: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]*$/,Eb={},Ob={};function X9(t){return S0.call(Ob,t)?!0:S0.call(Eb,t)?!1:K9.test(t)?Ob[t]=!0:(Eb[t]=!0,!1)}function Q9(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Z9(t,e,r,n){if(e===null||typeof e>"u"||Q9(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function $r(t,e,r,n,i,a,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=o}var xr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){xr[t]=new $r(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];xr[e]=new $r(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){xr[t]=new $r(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){xr[t]=new $r(t,2,!1,t,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(t){xr[t]=new $r(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){xr[t]=new $r(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){xr[t]=new $r(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){xr[t]=new $r(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){xr[t]=new $r(t,5,!1,t.toLowerCase(),null,!1,!1)});var Fm=/[\-:]([a-z])/g;function zm(t){return t[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(t){var e=t.replace(Fm,zm);xr[e]=new $r(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Fm,zm);xr[e]=new $r(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Fm,zm);xr[e]=new $r(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){xr[t]=new $r(t,1,!1,t.toLowerCase(),null,!1,!1)});xr.xlinkHref=new $r("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){xr[t]=new $r(t,1,!1,t.toLowerCase(),null,!0,!0)});function Bm(t,e,r,n){var i=xr.hasOwnProperty(e)?xr[e]:null;(i!==null?i.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(Z9(e,r,i,n)&&(r=null),n||i===null?X9(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):i.mustUseProperty?t[i.propertyName]=r===null?i.type===3?!1:"":r:(e=i.attributeName,n=i.attributeNamespace,r===null?t.removeAttribute(e):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?t.setAttributeNS(n,e,r):t.setAttribute(e,r))))}var aa=q3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Pf=Symbol.for("react.element"),Ml=Symbol.for("react.portal"),Il=Symbol.for("react.fragment"),Um=Symbol.for("react.strict_mode"),E0=Symbol.for("react.profiler"),W3=Symbol.for("react.provider"),Y3=Symbol.for("react.context"),Gm=Symbol.for("react.forward_ref"),O0=Symbol.for("react.suspense"),x0=Symbol.for("react.suspense_list"),Hm=Symbol.for("react.memo"),ka=Symbol.for("react.lazy"),K3=Symbol.for("react.offscreen"),xb=Symbol.iterator;function ru(t){return t===null||typeof t!="object"?null:(t=xb&&t[xb]||t["@@iterator"],typeof t=="function"?t:null)}var qt=Object.assign,Yg;function hu(t){if(Yg===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);Yg=e&&e[1]||""}return`
26
+ `+Yg+t}var Kg=!1;function Xg(t,e){if(!t||Kg)return"";Kg=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(f){var n=f}Reflect.construct(t,[],e)}else{try{e.call()}catch(f){n=f}t.call(e.prototype)}else{try{throw Error()}catch(f){n=f}t()}}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 t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=o&&0<=l);break}}}finally{Kg=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?hu(t):""}function J9(t){switch(t.tag){case 5:return hu(t.type);case 16:return hu("Lazy");case 13:return hu("Suspense");case 19:return hu("SuspenseList");case 0:case 2:case 15:return t=Xg(t.type,!1),t;case 11:return t=Xg(t.type.render,!1),t;case 1:return t=Xg(t.type,!0),t;default:return""}}function P0(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Il:return"Fragment";case Ml:return"Portal";case E0:return"Profiler";case Um:return"StrictMode";case O0:return"Suspense";case x0:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Y3:return(t.displayName||"Context")+".Consumer";case W3:return(t._context.displayName||"Context")+".Provider";case Gm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Hm:return e=t.displayName||null,e!==null?e:P0(t.type)||"Memo";case ka:e=t._payload,t=t._init;try{return P0(t(e))}catch{}}return null}function eO(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return P0(e);case 8:return e===Um?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function qa(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function X3(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function tO(t){var e=X3(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Af(t){t._valueTracker||(t._valueTracker=tO(t))}function Q3(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=X3(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function md(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function A0(t,e){var r=e.checked;return qt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Pb(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=qa(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Z3(t,e){e=e.checked,e!=null&&Bm(t,"checked",e,!1)}function k0(t,e){Z3(t,e);var r=qa(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?T0(t,e.type,r):e.hasOwnProperty("defaultValue")&&T0(t,e.type,qa(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Ab(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function T0(t,e,r){(e!=="number"||md(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var pu=Array.isArray;function Yl(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i<r.length;i++)e["$"+r[i]]=!0;for(r=0;r<t.length;r++)i=e.hasOwnProperty("$"+t[r].value),t[r].selected!==i&&(t[r].selected=i),i&&n&&(t[r].defaultSelected=!0)}else{for(r=""+qa(r),e=null,i=0;i<t.length;i++){if(t[i].value===r){t[i].selected=!0,n&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function C0(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Pe(91));return qt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function kb(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(Pe(92));if(pu(r)){if(1<r.length)throw Error(Pe(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:qa(r)}}function J3(t,e){var r=qa(e.value),n=qa(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),n!=null&&(t.defaultValue=""+n)}function Tb(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function e5(t){switch(t){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 R0(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?e5(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var kf,t5=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,n,i){MSApp.execUnsafeLocalFunction(function(){return t(e,r,n,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(kf=kf||document.createElement("div"),kf.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=kf.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Mu(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var bu={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},rO=["Webkit","ms","Moz","O"];Object.keys(bu).forEach(function(t){rO.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),bu[e]=bu[t]})});function r5(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||bu.hasOwnProperty(t)&&bu[t]?(""+e).trim():e+"px"}function n5(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=r5(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var nO=qt({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 N0(t,e){if(e){if(nO[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Pe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Pe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Pe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Pe(62))}}function M0(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 I0=null;function Vm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var L0=null,Kl=null,Xl=null;function Cb(t){if(t=cc(t)){if(typeof L0!="function")throw Error(Pe(280));var e=t.stateNode;e&&(e=fh(e),L0(t.stateNode,t.type,e))}}function i5(t){Kl?Xl?Xl.push(t):Xl=[t]:Kl=t}function a5(){if(Kl){var t=Kl,e=Xl;if(Xl=Kl=null,Cb(t),e)for(t=0;t<e.length;t++)Cb(e[t])}}function o5(t,e){return t(e)}function l5(){}var Qg=!1;function s5(t,e,r){if(Qg)return t(e,r);Qg=!0;try{return o5(t,e,r)}finally{Qg=!1,(Kl!==null||Xl!==null)&&(l5(),a5())}}function Iu(t,e){var r=t.stateNode;if(r===null)return null;var n=fh(r);if(n===null)return null;r=n[e];e:switch(e){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)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(Pe(231,e,typeof r));return r}var j0=!1;if(Zi)try{var nu={};Object.defineProperty(nu,"passive",{get:function(){j0=!0}}),window.addEventListener("test",nu,nu),window.removeEventListener("test",nu,nu)}catch{j0=!1}function iO(t,e,r,n,i,a,o,l,u){var f=Array.prototype.slice.call(arguments,3);try{e.apply(r,f)}catch(y){this.onError(y)}}var _u=!1,yd=null,bd=!1,D0=null,aO={onError:function(t){_u=!0,yd=t}};function oO(t,e,r,n,i,a,o,l,u){_u=!1,yd=null,iO.apply(aO,arguments)}function lO(t,e,r,n,i,a,o,l,u){if(oO.apply(this,arguments),_u){if(_u){var f=yd;_u=!1,yd=null}else throw Error(Pe(198));bd||(bd=!0,D0=f)}}function Xo(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function u5(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Rb(t){if(Xo(t)!==t)throw Error(Pe(188))}function sO(t){var e=t.alternate;if(!e){if(e=Xo(t),e===null)throw Error(Pe(188));return e!==t?null:t}for(var r=t,n=e;;){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 Rb(i),t;if(a===n)return Rb(i),e;a=a.sibling}throw Error(Pe(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(Pe(189))}}if(r.alternate!==n)throw Error(Pe(190))}if(r.tag!==3)throw Error(Pe(188));return r.stateNode.current===r?t:e}function c5(t){return t=sO(t),t!==null?f5(t):null}function f5(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=f5(t);if(e!==null)return e;t=t.sibling}return null}var d5=mn.unstable_scheduleCallback,Nb=mn.unstable_cancelCallback,uO=mn.unstable_shouldYield,cO=mn.unstable_requestPaint,Zt=mn.unstable_now,fO=mn.unstable_getCurrentPriorityLevel,qm=mn.unstable_ImmediatePriority,h5=mn.unstable_UserBlockingPriority,_d=mn.unstable_NormalPriority,dO=mn.unstable_LowPriority,p5=mn.unstable_IdlePriority,lh=null,Oi=null;function hO(t){if(Oi&&typeof Oi.onCommitFiberRoot=="function")try{Oi.onCommitFiberRoot(lh,t,void 0,(t.current.flags&128)===128)}catch{}}var Jn=Math.clz32?Math.clz32:vO,pO=Math.log,gO=Math.LN2;function vO(t){return t>>>=0,t===0?32:31-(pO(t)/gO|0)|0}var Tf=64,Cf=4194304;function gu(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function wd(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,a=t.pingedLanes,o=r&268435455;if(o!==0){var l=o&~i;l!==0?n=gu(l):(a&=o,a!==0&&(n=gu(a)))}else o=r&~i,o!==0?n=gu(o):a!==0&&(n=gu(a));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,a=e&-e,i>=a||i===16&&(a&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0<e;)r=31-Jn(e),i=1<<r,n|=t[r],e&=~i;return n}function mO(t,e){switch(t){case 1:case 2:case 4:return e+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 e+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 yO(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,a=t.pendingLanes;0<a;){var o=31-Jn(a),l=1<<o,u=i[o];u===-1?(!(l&r)||l&n)&&(i[o]=mO(l,e)):u<=e&&(t.expiredLanes|=l),a&=~l}}function F0(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function g5(){var t=Tf;return Tf<<=1,!(Tf&4194240)&&(Tf=64),t}function Zg(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function sc(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Jn(e),t[e]=r}function bO(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0<r;){var i=31-Jn(r),a=1<<i;e[i]=0,n[i]=-1,t[i]=-1,r&=~a}}function $m(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-Jn(r),i=1<<n;i&e|t[n]&e&&(t[n]|=e),r&=~i}}var Et=0;function v5(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var m5,Wm,y5,b5,_5,z0=!1,Rf=[],ja=null,Da=null,Fa=null,Lu=new Map,ju=new Map,Ca=[],_O="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 Mb(t,e){switch(t){case"focusin":case"focusout":ja=null;break;case"dragenter":case"dragleave":Da=null;break;case"mouseover":case"mouseout":Fa=null;break;case"pointerover":case"pointerout":Lu.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":ju.delete(e.pointerId)}}function iu(t,e,r,n,i,a){return t===null||t.nativeEvent!==a?(t={blockedOn:e,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},e!==null&&(e=cc(e),e!==null&&Wm(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function wO(t,e,r,n,i){switch(e){case"focusin":return ja=iu(ja,t,e,r,n,i),!0;case"dragenter":return Da=iu(Da,t,e,r,n,i),!0;case"mouseover":return Fa=iu(Fa,t,e,r,n,i),!0;case"pointerover":var a=i.pointerId;return Lu.set(a,iu(Lu.get(a)||null,t,e,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,ju.set(a,iu(ju.get(a)||null,t,e,r,n,i)),!0}return!1}function w5(t){var e=ko(t.target);if(e!==null){var r=Xo(e);if(r!==null){if(e=r.tag,e===13){if(e=u5(r),e!==null){t.blockedOn=e,_5(t.priority,function(){y5(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function rd(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=B0(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);I0=n,r.target.dispatchEvent(n),I0=null}else return e=cc(r),e!==null&&Wm(e),t.blockedOn=r,!1;e.shift()}return!0}function Ib(t,e,r){rd(t)&&r.delete(e)}function SO(){z0=!1,ja!==null&&rd(ja)&&(ja=null),Da!==null&&rd(Da)&&(Da=null),Fa!==null&&rd(Fa)&&(Fa=null),Lu.forEach(Ib),ju.forEach(Ib)}function au(t,e){t.blockedOn===e&&(t.blockedOn=null,z0||(z0=!0,mn.unstable_scheduleCallback(mn.unstable_NormalPriority,SO)))}function Du(t){function e(i){return au(i,t)}if(0<Rf.length){au(Rf[0],t);for(var r=1;r<Rf.length;r++){var n=Rf[r];n.blockedOn===t&&(n.blockedOn=null)}}for(ja!==null&&au(ja,t),Da!==null&&au(Da,t),Fa!==null&&au(Fa,t),Lu.forEach(e),ju.forEach(e),r=0;r<Ca.length;r++)n=Ca[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<Ca.length&&(r=Ca[0],r.blockedOn===null);)w5(r),r.blockedOn===null&&Ca.shift()}var Ql=aa.ReactCurrentBatchConfig,Sd=!0;function EO(t,e,r,n){var i=Et,a=Ql.transition;Ql.transition=null;try{Et=1,Ym(t,e,r,n)}finally{Et=i,Ql.transition=a}}function OO(t,e,r,n){var i=Et,a=Ql.transition;Ql.transition=null;try{Et=4,Ym(t,e,r,n)}finally{Et=i,Ql.transition=a}}function Ym(t,e,r,n){if(Sd){var i=B0(t,e,r,n);if(i===null)sv(t,e,n,Ed,r),Mb(t,n);else if(wO(i,t,e,r,n))n.stopPropagation();else if(Mb(t,n),e&4&&-1<_O.indexOf(t)){for(;i!==null;){var a=cc(i);if(a!==null&&m5(a),a=B0(t,e,r,n),a===null&&sv(t,e,n,Ed,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else sv(t,e,n,null,r)}}var Ed=null;function B0(t,e,r,n){if(Ed=null,t=Vm(n),t=ko(t),t!==null)if(e=Xo(t),e===null)t=null;else if(r=e.tag,r===13){if(t=u5(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Ed=t,null}function S5(t){switch(t){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(fO()){case qm:return 1;case h5:return 4;case _d:case dO:return 16;case p5:return 536870912;default:return 16}default:return 16}}var Ma=null,Km=null,nd=null;function E5(){if(nd)return nd;var t,e=Km,r=e.length,n,i="value"in Ma?Ma.value:Ma.textContent,a=i.length;for(t=0;t<r&&e[t]===i[t];t++);var o=r-t;for(n=1;n<=o&&e[r-n]===i[a-n];n++);return nd=i.slice(t,1<n?1-n:void 0)}function id(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Nf(){return!0}function Lb(){return!1}function wn(t){function e(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 t)t.hasOwnProperty(l)&&(r=t[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Nf:Lb,this.isPropagationStopped=Lb,this}return qt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Nf)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Nf)},persist:function(){},isPersistent:Nf}),e}var Os={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xm=wn(Os),uc=qt({},Os,{view:0,detail:0}),xO=wn(uc),Jg,ev,ou,sh=qt({},uc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qm,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ou&&(ou&&t.type==="mousemove"?(Jg=t.screenX-ou.screenX,ev=t.screenY-ou.screenY):ev=Jg=0,ou=t),Jg)},movementY:function(t){return"movementY"in t?t.movementY:ev}}),jb=wn(sh),PO=qt({},sh,{dataTransfer:0}),AO=wn(PO),kO=qt({},uc,{relatedTarget:0}),tv=wn(kO),TO=qt({},Os,{animationName:0,elapsedTime:0,pseudoElement:0}),CO=wn(TO),RO=qt({},Os,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),NO=wn(RO),MO=qt({},Os,{data:0}),Db=wn(MO),IO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},LO={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"},jO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function DO(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=jO[t])?!!e[t]:!1}function Qm(){return DO}var FO=qt({},uc,{key:function(t){if(t.key){var e=IO[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=id(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?LO[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qm,charCode:function(t){return t.type==="keypress"?id(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?id(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),zO=wn(FO),BO=qt({},sh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fb=wn(BO),UO=qt({},uc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qm}),GO=wn(UO),HO=qt({},Os,{propertyName:0,elapsedTime:0,pseudoElement:0}),VO=wn(HO),qO=qt({},sh,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),$O=wn(qO),WO=[9,13,27,32],Zm=Zi&&"CompositionEvent"in window,wu=null;Zi&&"documentMode"in document&&(wu=document.documentMode);var YO=Zi&&"TextEvent"in window&&!wu,O5=Zi&&(!Zm||wu&&8<wu&&11>=wu),zb=String.fromCharCode(32),Bb=!1;function x5(t,e){switch(t){case"keyup":return WO.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function P5(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ll=!1;function KO(t,e){switch(t){case"compositionend":return P5(e);case"keypress":return e.which!==32?null:(Bb=!0,zb);case"textInput":return t=e.data,t===zb&&Bb?null:t;default:return null}}function XO(t,e){if(Ll)return t==="compositionend"||!Zm&&x5(t,e)?(t=E5(),nd=Km=Ma=null,Ll=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return O5&&e.locale!=="ko"?null:e.data;default:return null}}var QO={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 Ub(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!QO[t.type]:e==="textarea"}function A5(t,e,r,n){i5(n),e=Od(e,"onChange"),0<e.length&&(r=new Xm("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var Su=null,Fu=null;function ZO(t){F5(t,0)}function uh(t){var e=Fl(t);if(Q3(e))return t}function JO(t,e){if(t==="change")return e}var k5=!1;if(Zi){var rv;if(Zi){var nv="oninput"in document;if(!nv){var Gb=document.createElement("div");Gb.setAttribute("oninput","return;"),nv=typeof Gb.oninput=="function"}rv=nv}else rv=!1;k5=rv&&(!document.documentMode||9<document.documentMode)}function Hb(){Su&&(Su.detachEvent("onpropertychange",T5),Fu=Su=null)}function T5(t){if(t.propertyName==="value"&&uh(Fu)){var e=[];A5(e,Fu,t,Vm(t)),s5(ZO,e)}}function ex(t,e,r){t==="focusin"?(Hb(),Su=e,Fu=r,Su.attachEvent("onpropertychange",T5)):t==="focusout"&&Hb()}function tx(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return uh(Fu)}function rx(t,e){if(t==="click")return uh(e)}function nx(t,e){if(t==="input"||t==="change")return uh(e)}function ix(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ai=typeof Object.is=="function"?Object.is:ix;function zu(t,e){if(ai(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!S0.call(e,i)||!ai(t[i],e[i]))return!1}return!0}function Vb(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function qb(t,e){var r=Vb(t);t=0;for(var n;r;){if(r.nodeType===3){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Vb(r)}}function C5(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?C5(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function R5(){for(var t=window,e=md();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=md(t.document)}return e}function Jm(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function ax(t){var e=R5(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&C5(r.ownerDocument.documentElement,r)){if(n!==null&&Jm(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!t.extend&&a>n&&(i=n,n=a,a=i),i=qb(r,a);var o=qb(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),a>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<e.length;r++)t=e[r],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var ox=Zi&&"documentMode"in document&&11>=document.documentMode,jl=null,U0=null,Eu=null,G0=!1;function $b(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;G0||jl==null||jl!==md(n)||(n=jl,"selectionStart"in n&&Jm(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}),Eu&&zu(Eu,n)||(Eu=n,n=Od(U0,"onSelect"),0<n.length&&(e=new Xm("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=jl)))}function Mf(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var Dl={animationend:Mf("Animation","AnimationEnd"),animationiteration:Mf("Animation","AnimationIteration"),animationstart:Mf("Animation","AnimationStart"),transitionend:Mf("Transition","TransitionEnd")},iv={},N5={};Zi&&(N5=document.createElement("div").style,"AnimationEvent"in window||(delete Dl.animationend.animation,delete Dl.animationiteration.animation,delete Dl.animationstart.animation),"TransitionEvent"in window||delete Dl.transitionend.transition);function ch(t){if(iv[t])return iv[t];if(!Dl[t])return t;var e=Dl[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in N5)return iv[t]=e[r];return t}var M5=ch("animationend"),I5=ch("animationiteration"),L5=ch("animationstart"),j5=ch("transitionend"),D5=new Map,Wb="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 Ka(t,e){D5.set(t,e),Ko(e,[t])}for(var av=0;av<Wb.length;av++){var ov=Wb[av],lx=ov.toLowerCase(),sx=ov[0].toUpperCase()+ov.slice(1);Ka(lx,"on"+sx)}Ka(M5,"onAnimationEnd");Ka(I5,"onAnimationIteration");Ka(L5,"onAnimationStart");Ka("dblclick","onDoubleClick");Ka("focusin","onFocus");Ka("focusout","onBlur");Ka(j5,"onTransitionEnd");ts("onMouseEnter",["mouseout","mouseover"]);ts("onMouseLeave",["mouseout","mouseover"]);ts("onPointerEnter",["pointerout","pointerover"]);ts("onPointerLeave",["pointerout","pointerover"]);Ko("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ko("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ko("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ko("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ko("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ko("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vu="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(" "),ux=new Set("cancel close invalid load scroll toggle".split(" ").concat(vu));function Yb(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,lO(n,e,void 0,t),t.currentTarget=null}function F5(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var n=t[r],i=n.event;n=n.listeners;e:{var a=void 0;if(e)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;Yb(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;Yb(i,l,f),a=u}}}if(bd)throw t=D0,bd=!1,D0=null,t}function It(t,e){var r=e[W0];r===void 0&&(r=e[W0]=new Set);var n=t+"__bubble";r.has(n)||(z5(e,t,2,!1),r.add(n))}function lv(t,e,r){var n=0;e&&(n|=4),z5(r,t,n,e)}var If="_reactListening"+Math.random().toString(36).slice(2);function Bu(t){if(!t[If]){t[If]=!0,$3.forEach(function(r){r!=="selectionchange"&&(ux.has(r)||lv(r,!1,t),lv(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[If]||(e[If]=!0,lv("selectionchange",!1,e))}}function z5(t,e,r,n){switch(S5(e)){case 1:var i=EO;break;case 4:i=OO;break;default:i=Ym}r=i.bind(null,e,r,t),i=void 0,!j0||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),n?i!==void 0?t.addEventListener(e,r,{capture:!0,passive:i}):t.addEventListener(e,r,!0):i!==void 0?t.addEventListener(e,r,{passive:i}):t.addEventListener(e,r,!1)}function sv(t,e,r,n,i){var a=n;if(!(e&1)&&!(e&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=ko(l),o===null)return;if(u=o.tag,u===5||u===6){n=a=o;continue e}l=l.parentNode}}n=n.return}s5(function(){var f=a,y=Vm(r),b=[];e:{var v=D5.get(t);if(v!==void 0){var h=Xm,w=t;switch(t){case"keypress":if(id(r)===0)break e;case"keydown":case"keyup":h=zO;break;case"focusin":w="focus",h=tv;break;case"focusout":w="blur",h=tv;break;case"beforeblur":case"afterblur":h=tv;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=jb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=AO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=GO;break;case M5:case I5:case L5:h=CO;break;case j5:h=VO;break;case"scroll":h=xO;break;case"wheel":h=$O;break;case"copy":case"cut":case"paste":h=NO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Fb}var E=(e&4)!==0,S=!E&&t==="scroll",_=E?v!==null?v+"Capture":null:v;E=[];for(var p=f,d;p!==null;){d=p;var g=d.stateNode;if(d.tag===5&&g!==null&&(d=g,_!==null&&(g=Iu(p,_),g!=null&&E.push(Uu(p,g,d)))),S)break;p=p.return}0<E.length&&(v=new h(v,w,null,r,y),b.push({event:v,listeners:E}))}}if(!(e&7)){e:{if(v=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",v&&r!==I0&&(w=r.relatedTarget||r.fromElement)&&(ko(w)||w[Ji]))break e;if((h||v)&&(v=y.window===y?y:(v=y.ownerDocument)?v.defaultView||v.parentWindow:window,h?(w=r.relatedTarget||r.toElement,h=f,w=w?ko(w):null,w!==null&&(S=Xo(w),w!==S||w.tag!==5&&w.tag!==6)&&(w=null)):(h=null,w=f),h!==w)){if(E=jb,g="onMouseLeave",_="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(E=Fb,g="onPointerLeave",_="onPointerEnter",p="pointer"),S=h==null?v:Fl(h),d=w==null?v:Fl(w),v=new E(g,p+"leave",h,r,y),v.target=S,v.relatedTarget=d,g=null,ko(y)===f&&(E=new E(_,p+"enter",w,r,y),E.target=d,E.relatedTarget=S,g=E),S=g,h&&w)t:{for(E=h,_=w,p=0,d=E;d;d=Al(d))p++;for(d=0,g=_;g;g=Al(g))d++;for(;0<p-d;)E=Al(E),p--;for(;0<d-p;)_=Al(_),d--;for(;p--;){if(E===_||_!==null&&E===_.alternate)break t;E=Al(E),_=Al(_)}E=null}else E=null;h!==null&&Kb(b,v,h,E,!1),w!==null&&S!==null&&Kb(b,S,w,E,!0)}}e:{if(v=f?Fl(f):window,h=v.nodeName&&v.nodeName.toLowerCase(),h==="select"||h==="input"&&v.type==="file")var m=JO;else if(Ub(v))if(k5)m=nx;else{m=tx;var x=ex}else(h=v.nodeName)&&h.toLowerCase()==="input"&&(v.type==="checkbox"||v.type==="radio")&&(m=rx);if(m&&(m=m(t,f))){A5(b,m,r,y);break e}x&&x(t,v,f),t==="focusout"&&(x=v._wrapperState)&&x.controlled&&v.type==="number"&&T0(v,"number",v.value)}switch(x=f?Fl(f):window,t){case"focusin":(Ub(x)||x.contentEditable==="true")&&(jl=x,U0=f,Eu=null);break;case"focusout":Eu=U0=jl=null;break;case"mousedown":G0=!0;break;case"contextmenu":case"mouseup":case"dragend":G0=!1,$b(b,r,y);break;case"selectionchange":if(ox)break;case"keydown":case"keyup":$b(b,r,y)}var P;if(Zm)e:{switch(t){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else Ll?x5(t,r)&&(O="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(O="onCompositionStart");O&&(O5&&r.locale!=="ko"&&(Ll||O!=="onCompositionStart"?O==="onCompositionEnd"&&Ll&&(P=E5()):(Ma=y,Km="value"in Ma?Ma.value:Ma.textContent,Ll=!0)),x=Od(f,O),0<x.length&&(O=new Db(O,t,null,r,y),b.push({event:O,listeners:x}),P?O.data=P:(P=P5(r),P!==null&&(O.data=P)))),(P=YO?KO(t,r):XO(t,r))&&(f=Od(f,"onBeforeInput"),0<f.length&&(y=new Db("onBeforeInput","beforeinput",null,r,y),b.push({event:y,listeners:f}),y.data=P))}F5(b,e)})}function Uu(t,e,r){return{instance:t,listener:e,currentTarget:r}}function Od(t,e){for(var r=e+"Capture",n=[];t!==null;){var i=t,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Iu(t,r),a!=null&&n.unshift(Uu(t,a,i)),a=Iu(t,e),a!=null&&n.push(Uu(t,a,i))),t=t.return}return n}function Al(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Kb(t,e,r,n,i){for(var a=e._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=Iu(r,a),u!=null&&o.unshift(Uu(r,u,l))):i||(u=Iu(r,a),u!=null&&o.push(Uu(r,u,l)))),r=r.return}o.length!==0&&t.push({event:e,listeners:o})}var cx=/\r\n?/g,fx=/\u0000|\uFFFD/g;function Xb(t){return(typeof t=="string"?t:""+t).replace(cx,`
30
+ `).replace(fx,"")}function Lf(t,e,r){if(e=Xb(e),Xb(t)!==e&&r)throw Error(Pe(425))}function xd(){}var H0=null,V0=null;function q0(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var $0=typeof setTimeout=="function"?setTimeout:void 0,dx=typeof clearTimeout=="function"?clearTimeout:void 0,Qb=typeof Promise=="function"?Promise:void 0,hx=typeof queueMicrotask=="function"?queueMicrotask:typeof Qb<"u"?function(t){return Qb.resolve(null).then(t).catch(px)}:$0;function px(t){setTimeout(function(){throw t})}function uv(t,e){var r=e,n=0;do{var i=r.nextSibling;if(t.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){t.removeChild(i),Du(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);Du(e)}function za(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Zb(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var xs=Math.random().toString(36).slice(2),_i="__reactFiber$"+xs,Gu="__reactProps$"+xs,Ji="__reactContainer$"+xs,W0="__reactEvents$"+xs,gx="__reactListeners$"+xs,vx="__reactHandles$"+xs;function ko(t){var e=t[_i];if(e)return e;for(var r=t.parentNode;r;){if(e=r[Ji]||r[_i]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=Zb(t);t!==null;){if(r=t[_i])return r;t=Zb(t)}return e}t=r,r=t.parentNode}return null}function cc(t){return t=t[_i]||t[Ji],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Fl(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(Pe(33))}function fh(t){return t[Gu]||null}var Y0=[],zl=-1;function Xa(t){return{current:t}}function Lt(t){0>zl||(t.current=Y0[zl],Y0[zl]=null,zl--)}function Rt(t,e){zl++,Y0[zl]=t.current,t.current=e}var $a={},jr=Xa($a),on=Xa(!1),Do=$a;function rs(t,e){var r=t.type.contextTypes;if(!r)return $a;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=e[a];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ln(t){return t=t.childContextTypes,t!=null}function Pd(){Lt(on),Lt(jr)}function Jb(t,e,r){if(jr.current!==$a)throw Error(Pe(168));Rt(jr,e),Rt(on,r)}function B5(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(Pe(108,eO(t)||"Unknown",i));return qt({},r,n)}function Ad(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||$a,Do=jr.current,Rt(jr,t),Rt(on,on.current),!0}function e_(t,e,r){var n=t.stateNode;if(!n)throw Error(Pe(169));r?(t=B5(t,e,Do),n.__reactInternalMemoizedMergedChildContext=t,Lt(on),Lt(jr),Rt(jr,t)):Lt(on),Rt(on,r)}var Vi=null,dh=!1,cv=!1;function U5(t){Vi===null?Vi=[t]:Vi.push(t)}function mx(t){dh=!0,U5(t)}function Qa(){if(!cv&&Vi!==null){cv=!0;var t=0,e=Et;try{var r=Vi;for(Et=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}Vi=null,dh=!1}catch(i){throw Vi!==null&&(Vi=Vi.slice(t+1)),d5(qm,Qa),i}finally{Et=e,cv=!1}}return null}var Bl=[],Ul=0,kd=null,Td=0,Mn=[],In=0,Fo=null,qi=1,$i="";function Po(t,e){Bl[Ul++]=Td,Bl[Ul++]=kd,kd=t,Td=e}function G5(t,e,r){Mn[In++]=qi,Mn[In++]=$i,Mn[In++]=Fo,Fo=t;var n=qi;t=$i;var i=32-Jn(n)-1;n&=~(1<<i),r+=1;var a=32-Jn(e)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,qi=1<<32-Jn(e)+i|r<<i|n,$i=a+t}else qi=1<<a|r<<i|n,$i=t}function ey(t){t.return!==null&&(Po(t,1),G5(t,1,0))}function ty(t){for(;t===kd;)kd=Bl[--Ul],Bl[Ul]=null,Td=Bl[--Ul],Bl[Ul]=null;for(;t===Fo;)Fo=Mn[--In],Mn[In]=null,$i=Mn[--In],Mn[In]=null,qi=Mn[--In],Mn[In]=null}var vn=null,gn=null,zt=!1,Zn=null;function H5(t,e){var r=Dn(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,e=t.deletions,e===null?(t.deletions=[r],t.flags|=16):e.push(r)}function t_(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,vn=t,gn=za(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,vn=t,gn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=Fo!==null?{id:qi,overflow:$i}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=Dn(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,vn=t,gn=null,!0):!1;default:return!1}}function K0(t){return(t.mode&1)!==0&&(t.flags&128)===0}function X0(t){if(zt){var e=gn;if(e){var r=e;if(!t_(t,e)){if(K0(t))throw Error(Pe(418));e=za(r.nextSibling);var n=vn;e&&t_(t,e)?H5(n,r):(t.flags=t.flags&-4097|2,zt=!1,vn=t)}}else{if(K0(t))throw Error(Pe(418));t.flags=t.flags&-4097|2,zt=!1,vn=t}}}function r_(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;vn=t}function jf(t){if(t!==vn)return!1;if(!zt)return r_(t),zt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!q0(t.type,t.memoizedProps)),e&&(e=gn)){if(K0(t))throw V5(),Error(Pe(418));for(;e;)H5(t,e),e=za(e.nextSibling)}if(r_(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Pe(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){gn=za(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}gn=null}}else gn=vn?za(t.stateNode.nextSibling):null;return!0}function V5(){for(var t=gn;t;)t=za(t.nextSibling)}function ns(){gn=vn=null,zt=!1}function ry(t){Zn===null?Zn=[t]:Zn.push(t)}var yx=aa.ReactCurrentBatchConfig;function Xn(t,e){if(t&&t.defaultProps){e=qt({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}var Cd=Xa(null),Rd=null,Gl=null,ny=null;function iy(){ny=Gl=Rd=null}function ay(t){var e=Cd.current;Lt(Cd),t._currentValue=e}function Q0(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function Zl(t,e){Rd=t,ny=Gl=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(rn=!0),t.firstContext=null)}function Bn(t){var e=t._currentValue;if(ny!==t)if(t={context:t,memoizedValue:e,next:null},Gl===null){if(Rd===null)throw Error(Pe(308));Gl=t,Rd.dependencies={lanes:0,firstContext:t}}else Gl=Gl.next=t;return e}var To=null;function oy(t){To===null?To=[t]:To.push(t)}function q5(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,oy(e)):(r.next=i.next,i.next=r),e.interleaved=r,ea(t,n)}function ea(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var Ta=!1;function ly(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $5(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Wi(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,pt&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,ea(t,r)}return i=n.interleaved,i===null?(e.next=e,oy(n)):(e.next=i.next,i.next=e),n.interleaved=e,ea(t,r)}function ad(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,$m(t,r)}}function n_(t,e){var r=t.updateQueue,n=t.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=e:a=a.next=e}else i=a=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function Nd(t,e,r,n){var i=t.updateQueue;Ta=!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 y=t.alternate;y!==null&&(y=y.updateQueue,l=y.lastBaseUpdate,l!==o&&(l===null?y.firstBaseUpdate=f:l.next=f,y.lastBaseUpdate=u))}if(a!==null){var b=i.baseState;o=0,y=f=u=null,l=a;do{var v=l.lane,h=l.eventTime;if((n&v)===v){y!==null&&(y=y.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=t,E=l;switch(v=e,h=r,E.tag){case 1:if(w=E.payload,typeof w=="function"){b=w.call(h,b,v);break e}b=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=E.payload,v=typeof w=="function"?w.call(h,b,v):w,v==null)break e;b=qt({},b,v);break e;case 2:Ta=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,v=i.effects,v===null?i.effects=[l]:v.push(l))}else h={eventTime:h,lane:v,tag:l.tag,payload:l.payload,callback:l.callback,next:null},y===null?(f=y=h,u=b):y=y.next=h,o|=v;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;v=l,l=v.next,v.next=null,i.lastBaseUpdate=v,i.shared.pending=null}}while(1);if(y===null&&(u=b),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=y,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else a===null&&(i.shared.lanes=0);Bo|=o,t.lanes=o,t.memoizedState=b}}function i_(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var n=t[e],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(Pe(191,i));i.call(n)}}}var W5=new q3.Component().refs;function Z0(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:qt({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var hh={isMounted:function(t){return(t=t._reactInternals)?Xo(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Hr(),i=Ga(t),a=Wi(n,i);a.payload=e,r!=null&&(a.callback=r),e=Ba(t,a,i),e!==null&&(ei(e,t,i,n),ad(e,t,i))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Hr(),i=Ga(t),a=Wi(n,i);a.tag=1,a.payload=e,r!=null&&(a.callback=r),e=Ba(t,a,i),e!==null&&(ei(e,t,i,n),ad(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Hr(),n=Ga(t),i=Wi(r,n);i.tag=2,e!=null&&(i.callback=e),e=Ba(t,i,n),e!==null&&(ei(e,t,n,r),ad(e,t,n))}};function a_(t,e,r,n,i,a,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,a,o):e.prototype&&e.prototype.isPureReactComponent?!zu(r,n)||!zu(i,a):!0}function Y5(t,e,r){var n=!1,i=$a,a=e.contextType;return typeof a=="object"&&a!==null?a=Bn(a):(i=ln(e)?Do:jr.current,n=e.contextTypes,a=(n=n!=null)?rs(t,i):$a),e=new e(r,a),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=hh,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=a),e}function o_(t,e,r,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&hh.enqueueReplaceState(e,e.state,null)}function J0(t,e,r,n){var i=t.stateNode;i.props=r,i.state=t.memoizedState,i.refs=W5,ly(t);var a=e.contextType;typeof a=="object"&&a!==null?i.context=Bn(a):(a=ln(e)?Do:jr.current,i.context=rs(t,a)),i.state=t.memoizedState,a=e.getDerivedStateFromProps,typeof a=="function"&&(Z0(t,e,a,r),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&hh.enqueueReplaceState(i,i.state,null),Nd(t,r,i,n),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function lu(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Pe(309));var n=r.stateNode}if(!n)throw Error(Pe(147,t));var i=n,a=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===a?e.ref:(e=function(o){var l=i.refs;l===W5&&(l=i.refs={}),o===null?delete l[a]:l[a]=o},e._stringRef=a,e)}if(typeof t!="string")throw Error(Pe(284));if(!r._owner)throw Error(Pe(290,t))}return t}function Df(t,e){throw t=Object.prototype.toString.call(e),Error(Pe(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function l_(t){var e=t._init;return e(t._payload)}function K5(t){function e(_,p){if(t){var d=_.deletions;d===null?(_.deletions=[p],_.flags|=16):d.push(p)}}function r(_,p){if(!t)return null;for(;p!==null;)e(_,p),p=p.sibling;return null}function n(_,p){for(_=new Map;p!==null;)p.key!==null?_.set(p.key,p):_.set(p.index,p),p=p.sibling;return _}function i(_,p){return _=Ha(_,p),_.index=0,_.sibling=null,_}function a(_,p,d){return _.index=d,t?(d=_.alternate,d!==null?(d=d.index,d<p?(_.flags|=2,p):d):(_.flags|=2,p)):(_.flags|=1048576,p)}function o(_){return t&&_.alternate===null&&(_.flags|=2),_}function l(_,p,d,g){return p===null||p.tag!==6?(p=mv(d,_.mode,g),p.return=_,p):(p=i(p,d),p.return=_,p)}function u(_,p,d,g){var m=d.type;return m===Il?y(_,p,d.props.children,g,d.key):p!==null&&(p.elementType===m||typeof m=="object"&&m!==null&&m.$$typeof===ka&&l_(m)===p.type)?(g=i(p,d.props),g.ref=lu(_,p,d),g.return=_,g):(g=fd(d.type,d.key,d.props,null,_.mode,g),g.ref=lu(_,p,d),g.return=_,g)}function f(_,p,d,g){return p===null||p.tag!==4||p.stateNode.containerInfo!==d.containerInfo||p.stateNode.implementation!==d.implementation?(p=yv(d,_.mode,g),p.return=_,p):(p=i(p,d.children||[]),p.return=_,p)}function y(_,p,d,g,m){return p===null||p.tag!==7?(p=Mo(d,_.mode,g,m),p.return=_,p):(p=i(p,d),p.return=_,p)}function b(_,p,d){if(typeof p=="string"&&p!==""||typeof p=="number")return p=mv(""+p,_.mode,d),p.return=_,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Pf:return d=fd(p.type,p.key,p.props,null,_.mode,d),d.ref=lu(_,null,p),d.return=_,d;case Ml:return p=yv(p,_.mode,d),p.return=_,p;case ka:var g=p._init;return b(_,g(p._payload),d)}if(pu(p)||ru(p))return p=Mo(p,_.mode,d,null),p.return=_,p;Df(_,p)}return null}function v(_,p,d,g){var m=p!==null?p.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return m!==null?null:l(_,p,""+d,g);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Pf:return d.key===m?u(_,p,d,g):null;case Ml:return d.key===m?f(_,p,d,g):null;case ka:return m=d._init,v(_,p,m(d._payload),g)}if(pu(d)||ru(d))return m!==null?null:y(_,p,d,g,null);Df(_,d)}return null}function h(_,p,d,g,m){if(typeof g=="string"&&g!==""||typeof g=="number")return _=_.get(d)||null,l(p,_,""+g,m);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Pf:return _=_.get(g.key===null?d:g.key)||null,u(p,_,g,m);case Ml:return _=_.get(g.key===null?d:g.key)||null,f(p,_,g,m);case ka:var x=g._init;return h(_,p,d,x(g._payload),m)}if(pu(g)||ru(g))return _=_.get(d)||null,y(p,_,g,m,null);Df(p,g)}return null}function w(_,p,d,g){for(var m=null,x=null,P=p,O=p=0,R=null;P!==null&&O<d.length;O++){P.index>O?(R=P,P=null):R=P.sibling;var T=v(_,P,d[O],g);if(T===null){P===null&&(P=R);break}t&&P&&T.alternate===null&&e(_,P),p=a(T,p,O),x===null?m=T:x.sibling=T,x=T,P=R}if(O===d.length)return r(_,P),zt&&Po(_,O),m;if(P===null){for(;O<d.length;O++)P=b(_,d[O],g),P!==null&&(p=a(P,p,O),x===null?m=P:x.sibling=P,x=P);return zt&&Po(_,O),m}for(P=n(_,P);O<d.length;O++)R=h(P,_,O,d[O],g),R!==null&&(t&&R.alternate!==null&&P.delete(R.key===null?O:R.key),p=a(R,p,O),x===null?m=R:x.sibling=R,x=R);return t&&P.forEach(function(C){return e(_,C)}),zt&&Po(_,O),m}function E(_,p,d,g){var m=ru(d);if(typeof m!="function")throw Error(Pe(150));if(d=m.call(d),d==null)throw Error(Pe(151));for(var x=m=null,P=p,O=p=0,R=null,T=d.next();P!==null&&!T.done;O++,T=d.next()){P.index>O?(R=P,P=null):R=P.sibling;var C=v(_,P,T.value,g);if(C===null){P===null&&(P=R);break}t&&P&&C.alternate===null&&e(_,P),p=a(C,p,O),x===null?m=C:x.sibling=C,x=C,P=R}if(T.done)return r(_,P),zt&&Po(_,O),m;if(P===null){for(;!T.done;O++,T=d.next())T=b(_,T.value,g),T!==null&&(p=a(T,p,O),x===null?m=T:x.sibling=T,x=T);return zt&&Po(_,O),m}for(P=n(_,P);!T.done;O++,T=d.next())T=h(P,_,O,T.value,g),T!==null&&(t&&T.alternate!==null&&P.delete(T.key===null?O:T.key),p=a(T,p,O),x===null?m=T:x.sibling=T,x=T);return t&&P.forEach(function(N){return e(_,N)}),zt&&Po(_,O),m}function S(_,p,d,g){if(typeof d=="object"&&d!==null&&d.type===Il&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case Pf:e:{for(var m=d.key,x=p;x!==null;){if(x.key===m){if(m=d.type,m===Il){if(x.tag===7){r(_,x.sibling),p=i(x,d.props.children),p.return=_,_=p;break e}}else if(x.elementType===m||typeof m=="object"&&m!==null&&m.$$typeof===ka&&l_(m)===x.type){r(_,x.sibling),p=i(x,d.props),p.ref=lu(_,x,d),p.return=_,_=p;break e}r(_,x);break}else e(_,x);x=x.sibling}d.type===Il?(p=Mo(d.props.children,_.mode,g,d.key),p.return=_,_=p):(g=fd(d.type,d.key,d.props,null,_.mode,g),g.ref=lu(_,p,d),g.return=_,_=g)}return o(_);case Ml:e:{for(x=d.key;p!==null;){if(p.key===x)if(p.tag===4&&p.stateNode.containerInfo===d.containerInfo&&p.stateNode.implementation===d.implementation){r(_,p.sibling),p=i(p,d.children||[]),p.return=_,_=p;break e}else{r(_,p);break}else e(_,p);p=p.sibling}p=yv(d,_.mode,g),p.return=_,_=p}return o(_);case ka:return x=d._init,S(_,p,x(d._payload),g)}if(pu(d))return w(_,p,d,g);if(ru(d))return E(_,p,d,g);Df(_,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,p!==null&&p.tag===6?(r(_,p.sibling),p=i(p,d),p.return=_,_=p):(r(_,p),p=mv(d,_.mode,g),p.return=_,_=p),o(_)):r(_,p)}return S}var is=K5(!0),X5=K5(!1),fc={},xi=Xa(fc),Hu=Xa(fc),Vu=Xa(fc);function Co(t){if(t===fc)throw Error(Pe(174));return t}function sy(t,e){switch(Rt(Vu,e),Rt(Hu,t),Rt(xi,fc),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:R0(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=R0(e,t)}Lt(xi),Rt(xi,e)}function as(){Lt(xi),Lt(Hu),Lt(Vu)}function Q5(t){Co(Vu.current);var e=Co(xi.current),r=R0(e,t.type);e!==r&&(Rt(Hu,t),Rt(xi,r))}function uy(t){Hu.current===t&&(Lt(xi),Lt(Hu))}var Ht=Xa(0);function Md(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var fv=[];function cy(){for(var t=0;t<fv.length;t++)fv[t]._workInProgressVersionPrimary=null;fv.length=0}var od=aa.ReactCurrentDispatcher,dv=aa.ReactCurrentBatchConfig,zo=0,Vt=null,ar=null,gr=null,Id=!1,Ou=!1,qu=0,bx=0;function Mr(){throw Error(Pe(321))}function fy(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!ai(t[r],e[r]))return!1;return!0}function dy(t,e,r,n,i,a){if(zo=a,Vt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,od.current=t===null||t.memoizedState===null?Ex:Ox,t=r(n,i),Ou){a=0;do{if(Ou=!1,qu=0,25<=a)throw Error(Pe(301));a+=1,gr=ar=null,e.updateQueue=null,od.current=xx,t=r(n,i)}while(Ou)}if(od.current=Ld,e=ar!==null&&ar.next!==null,zo=0,gr=ar=Vt=null,Id=!1,e)throw Error(Pe(300));return t}function hy(){var t=qu!==0;return qu=0,t}function bi(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gr===null?Vt.memoizedState=gr=t:gr=gr.next=t,gr}function Un(){if(ar===null){var t=Vt.alternate;t=t!==null?t.memoizedState:null}else t=ar.next;var e=gr===null?Vt.memoizedState:gr.next;if(e!==null)gr=e,ar=t;else{if(t===null)throw Error(Pe(310));ar=t,t={memoizedState:ar.memoizedState,baseState:ar.baseState,baseQueue:ar.baseQueue,queue:ar.queue,next:null},gr===null?Vt.memoizedState=gr=t:gr=gr.next=t}return gr}function $u(t,e){return typeof e=="function"?e(t):e}function hv(t){var e=Un(),r=e.queue;if(r===null)throw Error(Pe(311));r.lastRenderedReducer=t;var n=ar,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 y=f.lane;if((zo&y)===y)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),n=f.hasEagerState?f.eagerState:t(n,f.action);else{var b={lane:y,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=b,o=n):u=u.next=b,Vt.lanes|=y,Bo|=y}f=f.next}while(f!==null&&f!==a);u===null?o=n:u.next=l,ai(n,e.memoizedState)||(rn=!0),e.memoizedState=n,e.baseState=o,e.baseQueue=u,r.lastRenderedState=n}if(t=r.interleaved,t!==null){i=t;do a=i.lane,Vt.lanes|=a,Bo|=a,i=i.next;while(i!==t)}else i===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function pv(t){var e=Un(),r=e.queue;if(r===null)throw Error(Pe(311));r.lastRenderedReducer=t;var n=r.dispatch,i=r.pending,a=e.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do a=t(a,o.action),o=o.next;while(o!==i);ai(a,e.memoizedState)||(rn=!0),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),r.lastRenderedState=a}return[a,n]}function Z5(){}function J5(t,e){var r=Vt,n=Un(),i=e(),a=!ai(n.memoizedState,i);if(a&&(n.memoizedState=i,rn=!0),n=n.queue,py(r4.bind(null,r,n,t),[t]),n.getSnapshot!==e||a||gr!==null&&gr.memoizedState.tag&1){if(r.flags|=2048,Wu(9,t4.bind(null,r,n,i,e),void 0,null),mr===null)throw Error(Pe(349));zo&30||e4(r,e,i)}return i}function e4(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=Vt.updateQueue,e===null?(e={lastEffect:null,stores:null},Vt.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function t4(t,e,r,n){e.value=r,e.getSnapshot=n,n4(e)&&i4(t)}function r4(t,e,r){return r(function(){n4(e)&&i4(t)})}function n4(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!ai(t,r)}catch{return!0}}function i4(t){var e=ea(t,1);e!==null&&ei(e,t,1,-1)}function s_(t){var e=bi();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$u,lastRenderedState:t},e.queue=t,t=t.dispatch=Sx.bind(null,Vt,t),[e.memoizedState,t]}function Wu(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=Vt.updateQueue,e===null?(e={lastEffect:null,stores:null},Vt.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t)),t}function a4(){return Un().memoizedState}function ld(t,e,r,n){var i=bi();Vt.flags|=t,i.memoizedState=Wu(1|e,r,void 0,n===void 0?null:n)}function ph(t,e,r,n){var i=Un();n=n===void 0?null:n;var a=void 0;if(ar!==null){var o=ar.memoizedState;if(a=o.destroy,n!==null&&fy(n,o.deps)){i.memoizedState=Wu(e,r,a,n);return}}Vt.flags|=t,i.memoizedState=Wu(1|e,r,a,n)}function u_(t,e){return ld(8390656,8,t,e)}function py(t,e){return ph(2048,8,t,e)}function o4(t,e){return ph(4,2,t,e)}function l4(t,e){return ph(4,4,t,e)}function s4(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function u4(t,e,r){return r=r!=null?r.concat([t]):null,ph(4,4,s4.bind(null,e,t),r)}function gy(){}function c4(t,e){var r=Un();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&fy(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function f4(t,e){var r=Un();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&fy(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function d4(t,e,r){return zo&21?(ai(r,e)||(r=g5(),Vt.lanes|=r,Bo|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,rn=!0),t.memoizedState=r)}function _x(t,e){var r=Et;Et=r!==0&&4>r?r:4,t(!0);var n=dv.transition;dv.transition={};try{t(!1),e()}finally{Et=r,dv.transition=n}}function h4(){return Un().memoizedState}function wx(t,e,r){var n=Ga(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},p4(t))g4(e,r);else if(r=q5(t,e,r,n),r!==null){var i=Hr();ei(r,t,n,i),v4(r,e,n)}}function Sx(t,e,r){var n=Ga(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(p4(t))g4(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,l=a(o,r);if(i.hasEagerState=!0,i.eagerState=l,ai(l,o)){var u=e.interleaved;u===null?(i.next=i,oy(e)):(i.next=u.next,u.next=i),e.interleaved=i;return}}catch{}finally{}r=q5(t,e,i,n),r!==null&&(i=Hr(),ei(r,t,n,i),v4(r,e,n))}}function p4(t){var e=t.alternate;return t===Vt||e!==null&&e===Vt}function g4(t,e){Ou=Id=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function v4(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,$m(t,r)}}var Ld={readContext:Bn,useCallback:Mr,useContext:Mr,useEffect:Mr,useImperativeHandle:Mr,useInsertionEffect:Mr,useLayoutEffect:Mr,useMemo:Mr,useReducer:Mr,useRef:Mr,useState:Mr,useDebugValue:Mr,useDeferredValue:Mr,useTransition:Mr,useMutableSource:Mr,useSyncExternalStore:Mr,useId:Mr,unstable_isNewReconciler:!1},Ex={readContext:Bn,useCallback:function(t,e){return bi().memoizedState=[t,e===void 0?null:e],t},useContext:Bn,useEffect:u_,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,ld(4194308,4,s4.bind(null,e,t),r)},useLayoutEffect:function(t,e){return ld(4194308,4,t,e)},useInsertionEffect:function(t,e){return ld(4,2,t,e)},useMemo:function(t,e){var r=bi();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=bi();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=wx.bind(null,Vt,t),[n.memoizedState,t]},useRef:function(t){var e=bi();return t={current:t},e.memoizedState=t},useState:s_,useDebugValue:gy,useDeferredValue:function(t){return bi().memoizedState=t},useTransition:function(){var t=s_(!1),e=t[0];return t=_x.bind(null,t[1]),bi().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Vt,i=bi();if(zt){if(r===void 0)throw Error(Pe(407));r=r()}else{if(r=e(),mr===null)throw Error(Pe(349));zo&30||e4(n,e,r)}i.memoizedState=r;var a={value:r,getSnapshot:e};return i.queue=a,u_(r4.bind(null,n,a,t),[t]),n.flags|=2048,Wu(9,t4.bind(null,n,a,r,e),void 0,null),r},useId:function(){var t=bi(),e=mr.identifierPrefix;if(zt){var r=$i,n=qi;r=(n&~(1<<32-Jn(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=qu++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=bx++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Ox={readContext:Bn,useCallback:c4,useContext:Bn,useEffect:py,useImperativeHandle:u4,useInsertionEffect:o4,useLayoutEffect:l4,useMemo:f4,useReducer:hv,useRef:a4,useState:function(){return hv($u)},useDebugValue:gy,useDeferredValue:function(t){var e=Un();return d4(e,ar.memoizedState,t)},useTransition:function(){var t=hv($u)[0],e=Un().memoizedState;return[t,e]},useMutableSource:Z5,useSyncExternalStore:J5,useId:h4,unstable_isNewReconciler:!1},xx={readContext:Bn,useCallback:c4,useContext:Bn,useEffect:py,useImperativeHandle:u4,useInsertionEffect:o4,useLayoutEffect:l4,useMemo:f4,useReducer:pv,useRef:a4,useState:function(){return pv($u)},useDebugValue:gy,useDeferredValue:function(t){var e=Un();return ar===null?e.memoizedState=t:d4(e,ar.memoizedState,t)},useTransition:function(){var t=pv($u)[0],e=Un().memoizedState;return[t,e]},useMutableSource:Z5,useSyncExternalStore:J5,useId:h4,unstable_isNewReconciler:!1};function os(t,e){try{var r="",n=e;do r+=J9(n),n=n.return;while(n);var i=r}catch(a){i=`
31
+ Error generating stack: `+a.message+`
32
+ `+a.stack}return{value:t,source:e,stack:i,digest:null}}function gv(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function em(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var Px=typeof WeakMap=="function"?WeakMap:Map;function m4(t,e,r){r=Wi(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){Dd||(Dd=!0,cm=n),em(t,e)},r}function y4(t,e,r){r=Wi(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){em(t,e)}}var a=t.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){em(t,e),typeof n!="function"&&(Ua===null?Ua=new Set([this]):Ua.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function c_(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new Px;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=Bx.bind(null,t,e,r),e.then(t,t))}function f_(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function d_(t,e,r,n,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=Wi(-1,1),e.tag=2,Ba(r,e,1))),r.lanes|=1),t)}var Ax=aa.ReactCurrentOwner,rn=!1;function Gr(t,e,r,n){e.child=t===null?X5(e,null,r,n):is(e,t.child,r,n)}function h_(t,e,r,n,i){r=r.render;var a=e.ref;return Zl(e,i),n=dy(t,e,r,n,a,i),r=hy(),t!==null&&!rn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ta(t,e,i)):(zt&&r&&ey(e),e.flags|=1,Gr(t,e,n,i),e.child)}function p_(t,e,r,n,i){if(t===null){var a=r.type;return typeof a=="function"&&!Ey(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=a,b4(t,e,a,n,i)):(t=fd(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!(t.lanes&i)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:zu,r(o,n)&&t.ref===e.ref)return ta(t,e,i)}return e.flags|=1,t=Ha(a,n),t.ref=e.ref,t.return=e,e.child=t}function b4(t,e,r,n,i){if(t!==null){var a=t.memoizedProps;if(zu(a,n)&&t.ref===e.ref)if(rn=!1,e.pendingProps=n=a,(t.lanes&i)!==0)t.flags&131072&&(rn=!0);else return e.lanes=t.lanes,ta(t,e,i)}return tm(t,e,r,n,i)}function _4(t,e,r){var n=e.pendingProps,i=n.children,a=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Rt(Vl,hn),hn|=r;else{if(!(r&1073741824))return t=a!==null?a.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Rt(Vl,hn),hn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Rt(Vl,hn),hn|=n}else a!==null?(n=a.baseLanes|r,e.memoizedState=null):n=r,Rt(Vl,hn),hn|=n;return Gr(t,e,i,r),e.child}function w4(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function tm(t,e,r,n,i){var a=ln(r)?Do:jr.current;return a=rs(e,a),Zl(e,i),r=dy(t,e,r,n,a,i),n=hy(),t!==null&&!rn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ta(t,e,i)):(zt&&n&&ey(e),e.flags|=1,Gr(t,e,r,i),e.child)}function g_(t,e,r,n,i){if(ln(r)){var a=!0;Ad(e)}else a=!1;if(Zl(e,i),e.stateNode===null)sd(t,e),Y5(e,r,n),J0(e,r,n,i),n=!0;else if(t===null){var o=e.stateNode,l=e.memoizedProps;o.props=l;var u=o.context,f=r.contextType;typeof f=="object"&&f!==null?f=Bn(f):(f=ln(r)?Do:jr.current,f=rs(e,f));var y=r.getDerivedStateFromProps,b=typeof y=="function"||typeof o.getSnapshotBeforeUpdate=="function";b||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||u!==f)&&o_(e,o,n,f),Ta=!1;var v=e.memoizedState;o.state=v,Nd(e,n,o,i),u=e.memoizedState,l!==n||v!==u||on.current||Ta?(typeof y=="function"&&(Z0(e,r,y,n),u=e.memoizedState),(l=Ta||a_(e,r,l,n,v,u,f))?(b||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"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=u),o.props=n,o.state=u,o.context=f,n=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,$5(t,e),l=e.memoizedProps,f=e.type===e.elementType?l:Xn(e.type,l),o.props=f,b=e.pendingProps,v=o.context,u=r.contextType,typeof u=="object"&&u!==null?u=Bn(u):(u=ln(r)?Do:jr.current,u=rs(e,u));var h=r.getDerivedStateFromProps;(y=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==b||v!==u)&&o_(e,o,n,u),Ta=!1,v=e.memoizedState,o.state=v,Nd(e,n,o,i);var w=e.memoizedState;l!==b||v!==w||on.current||Ta?(typeof h=="function"&&(Z0(e,r,h,n),w=e.memoizedState),(f=Ta||a_(e,r,f,n,v,w,u)||!1)?(y||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,w,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,w,u)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&v===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&v===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=w),o.props=n,o.state=w,o.context=u,n=f):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&v===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&v===t.memoizedState||(e.flags|=1024),n=!1)}return rm(t,e,r,n,a,i)}function rm(t,e,r,n,i,a){w4(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&e_(e,r,!1),ta(t,e,a);n=e.stateNode,Ax.current=e;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=is(e,t.child,null,a),e.child=is(e,null,l,a)):Gr(t,e,l,a),e.memoizedState=n.state,i&&e_(e,r,!0),e.child}function S4(t){var e=t.stateNode;e.pendingContext?Jb(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Jb(t,e.context,!1),sy(t,e.containerInfo)}function v_(t,e,r,n,i){return ns(),ry(i),e.flags|=256,Gr(t,e,r,n),e.child}var nm={dehydrated:null,treeContext:null,retryLane:0};function im(t){return{baseLanes:t,cachePool:null,transitions:null}}function E4(t,e,r){var n=e.pendingProps,i=Ht.current,a=!1,o=(e.flags&128)!==0,l;if((l=o)||(l=t!==null&&t.memoizedState===null?!1:(i&2)!==0),l?(a=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),Rt(Ht,i&1),t===null)return X0(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,a?(n=e.mode,a=e.child,o={mode:"hidden",children:o},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=mh(o,n,0,null),t=Mo(t,n,r,null),a.return=e,t.return=e,a.sibling=t,e.child=a,e.child.memoizedState=im(r),e.memoizedState=nm,t):vy(e,o));if(i=t.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return kx(t,e,o,n,l,i,r);if(a){a=n.fallback,o=e.mode,i=t.child,l=i.sibling;var u={mode:"hidden",children:n.children};return!(o&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=u,e.deletions=null):(n=Ha(i,u),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Ha(l,a):(a=Mo(a,o,r,null),a.flags|=2),a.return=e,n.return=e,n.sibling=a,e.child=n,n=a,a=e.child,o=t.child.memoizedState,o=o===null?im(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=t.childLanes&~r,e.memoizedState=nm,n}return a=t.child,t=a.sibling,n=Ha(a,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function vy(t,e){return e=mh({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Ff(t,e,r,n){return n!==null&&ry(n),is(e,t.child,null,r),t=vy(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function kx(t,e,r,n,i,a,o){if(r)return e.flags&256?(e.flags&=-257,n=gv(Error(Pe(422))),Ff(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(a=n.fallback,i=e.mode,n=mh({mode:"visible",children:n.children},i,0,null),a=Mo(a,i,o,null),a.flags|=2,n.return=e,a.return=e,n.sibling=a,e.child=n,e.mode&1&&is(e,t.child,null,o),e.child.memoizedState=im(o),e.memoizedState=nm,a);if(!(e.mode&1))return Ff(t,e,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(Pe(419)),n=gv(a,n,void 0),Ff(t,e,o,n)}if(l=(o&t.childLanes)!==0,rn||l){if(n=mr,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,ea(t,i),ei(n,t,i,-1))}return Sy(),n=gv(Error(Pe(421))),Ff(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=Ux.bind(null,t),i._reactRetry=e,null):(t=a.treeContext,gn=za(i.nextSibling),vn=e,zt=!0,Zn=null,t!==null&&(Mn[In++]=qi,Mn[In++]=$i,Mn[In++]=Fo,qi=t.id,$i=t.overflow,Fo=e),e=vy(e,n.children),e.flags|=4096,e)}function m_(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),Q0(t.return,e,r)}function vv(t,e,r,n,i){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function O4(t,e,r){var n=e.pendingProps,i=n.revealOrder,a=n.tail;if(Gr(t,e,n.children,r),n=Ht.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&m_(t,r,e);else if(t.tag===19)m_(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(Rt(Ht,n),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&Md(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),vv(e,!1,i,r,a);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Md(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}vv(e,!0,r,null,a);break;case"together":vv(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function sd(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function ta(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Bo|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Pe(153));if(e.child!==null){for(t=e.child,r=Ha(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Ha(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function Tx(t,e,r){switch(e.tag){case 3:S4(e),ns();break;case 5:Q5(e);break;case 1:ln(e.type)&&Ad(e);break;case 4:sy(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;Rt(Cd,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(Rt(Ht,Ht.current&1),e.flags|=128,null):r&e.child.childLanes?E4(t,e,r):(Rt(Ht,Ht.current&1),t=ta(t,e,r),t!==null?t.sibling:null);Rt(Ht,Ht.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return O4(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Rt(Ht,Ht.current),n)break;return null;case 22:case 23:return e.lanes=0,_4(t,e,r)}return ta(t,e,r)}var x4,am,P4,A4;x4=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};am=function(){};P4=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,Co(xi.current);var a=null;switch(r){case"input":i=A0(t,i),n=A0(t,n),a=[];break;case"select":i=qt({},i,{value:void 0}),n=qt({},n,{value:void 0}),a=[];break;case"textarea":i=C0(t,i),n=C0(t,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=xd)}N0(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"&&(Nu.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"&&(Nu.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&It("scroll",t),a||l===u||(a=[])):(a=a||[]).push(f,u))}r&&(a=a||[]).push("style",r);var f=a;(e.updateQueue=f)&&(e.flags|=4)}};A4=function(t,e,r,n){r!==n&&(e.flags|=4)};function su(t,e){if(!zt)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function Ir(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function Cx(t,e,r){var n=e.pendingProps;switch(ty(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ir(e),null;case 1:return ln(e.type)&&Pd(),Ir(e),null;case 3:return n=e.stateNode,as(),Lt(on),Lt(jr),cy(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(jf(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Zn!==null&&(hm(Zn),Zn=null))),am(t,e),Ir(e),null;case 5:uy(e);var i=Co(Vu.current);if(r=e.type,t!==null&&e.stateNode!=null)P4(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(Pe(166));return Ir(e),null}if(t=Co(xi.current),jf(e)){n=e.stateNode,r=e.type;var a=e.memoizedProps;switch(n[_i]=e,n[Gu]=a,t=(e.mode&1)!==0,r){case"dialog":It("cancel",n),It("close",n);break;case"iframe":case"object":case"embed":It("load",n);break;case"video":case"audio":for(i=0;i<vu.length;i++)It(vu[i],n);break;case"source":It("error",n);break;case"img":case"image":case"link":It("error",n),It("load",n);break;case"details":It("toggle",n);break;case"input":Pb(n,a),It("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},It("invalid",n);break;case"textarea":kb(n,a),It("invalid",n)}N0(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&&Lf(n.textContent,l,t),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Lf(n.textContent,l,t),i=["children",""+l]):Nu.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&It("scroll",n)}switch(r){case"input":Af(n),Ab(n,a,!0);break;case"textarea":Af(n),Tb(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=xd)}n=i,e.updateQueue=n,n!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=e5(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[_i]=e,t[Gu]=n,x4(t,e,!1,!1),e.stateNode=t;e:{switch(o=M0(r,n),r){case"dialog":It("cancel",t),It("close",t),i=n;break;case"iframe":case"object":case"embed":It("load",t),i=n;break;case"video":case"audio":for(i=0;i<vu.length;i++)It(vu[i],t);i=n;break;case"source":It("error",t),i=n;break;case"img":case"image":case"link":It("error",t),It("load",t),i=n;break;case"details":It("toggle",t),i=n;break;case"input":Pb(t,n),i=A0(t,n),It("invalid",t);break;case"option":i=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},i=qt({},n,{value:void 0}),It("invalid",t);break;case"textarea":kb(t,n),i=C0(t,n),It("invalid",t);break;default:i=n}N0(r,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var u=l[a];a==="style"?n5(t,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&t5(t,u)):a==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Mu(t,u):typeof u=="number"&&Mu(t,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Nu.hasOwnProperty(a)?u!=null&&a==="onScroll"&&It("scroll",t):u!=null&&Bm(t,a,u,o))}switch(r){case"input":Af(t),Ab(t,n,!1);break;case"textarea":Af(t),Tb(t);break;case"option":n.value!=null&&t.setAttribute("value",""+qa(n.value));break;case"select":t.multiple=!!n.multiple,a=n.value,a!=null?Yl(t,!!n.multiple,a,!1):n.defaultValue!=null&&Yl(t,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=xd)}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&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Ir(e),null;case 6:if(t&&e.stateNode!=null)A4(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(Pe(166));if(r=Co(Vu.current),Co(xi.current),jf(e)){if(n=e.stateNode,r=e.memoizedProps,n[_i]=e,(a=n.nodeValue!==r)&&(t=vn,t!==null))switch(t.tag){case 3:Lf(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Lf(n.nodeValue,r,(t.mode&1)!==0)}a&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[_i]=e,e.stateNode=n}return Ir(e),null;case 13:if(Lt(Ht),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(zt&&gn!==null&&e.mode&1&&!(e.flags&128))V5(),ns(),e.flags|=98560,a=!1;else if(a=jf(e),n!==null&&n.dehydrated!==null){if(t===null){if(!a)throw Error(Pe(318));if(a=e.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Pe(317));a[_i]=e}else ns(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Ir(e),a=!1}else Zn!==null&&(hm(Zn),Zn=null),a=!0;if(!a)return e.flags&65536?e:null}return e.flags&128?(e.lanes=r,e):(n=n!==null,n!==(t!==null&&t.memoizedState!==null)&&n&&(e.child.flags|=8192,e.mode&1&&(t===null||Ht.current&1?lr===0&&(lr=3):Sy())),e.updateQueue!==null&&(e.flags|=4),Ir(e),null);case 4:return as(),am(t,e),t===null&&Bu(e.stateNode.containerInfo),Ir(e),null;case 10:return ay(e.type._context),Ir(e),null;case 17:return ln(e.type)&&Pd(),Ir(e),null;case 19:if(Lt(Ht),a=e.memoizedState,a===null)return Ir(e),null;if(n=(e.flags&128)!==0,o=a.rendering,o===null)if(n)su(a,!1);else{if(lr!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Md(t),o!==null){for(e.flags|=128,su(a,!1),n=o.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=r,r=e.child;r!==null;)a=r,t=n,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=t,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,t=o.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return Rt(Ht,Ht.current&1|2),e.child}t=t.sibling}a.tail!==null&&Zt()>ls&&(e.flags|=128,n=!0,su(a,!1),e.lanes=4194304)}else{if(!n)if(t=Md(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),su(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!zt)return Ir(e),null}else 2*Zt()-a.renderingStartTime>ls&&r!==1073741824&&(e.flags|=128,n=!0,su(a,!1),e.lanes=4194304);a.isBackwards?(o.sibling=e.child,e.child=o):(r=a.last,r!==null?r.sibling=o:e.child=o,a.last=o)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Zt(),e.sibling=null,r=Ht.current,Rt(Ht,n?r&1|2:r&1),e):(Ir(e),null);case 22:case 23:return wy(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?hn&1073741824&&(Ir(e),e.subtreeFlags&6&&(e.flags|=8192)):Ir(e),null;case 24:return null;case 25:return null}throw Error(Pe(156,e.tag))}function Rx(t,e){switch(ty(e),e.tag){case 1:return ln(e.type)&&Pd(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return as(),Lt(on),Lt(jr),cy(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return uy(e),null;case 13:if(Lt(Ht),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Pe(340));ns()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Lt(Ht),null;case 4:return as(),null;case 10:return ay(e.type._context),null;case 22:case 23:return wy(),null;case 24:return null;default:return null}}var zf=!1,Lr=!1,Nx=typeof WeakSet=="function"?WeakSet:Set,ze=null;function Hl(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Yt(t,e,n)}else r.current=null}function om(t,e,r){try{r()}catch(n){Yt(t,e,n)}}var y_=!1;function Mx(t,e){if(H0=Sd,t=R5(),Jm(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.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,y=0,b=t,v=null;t:for(;;){for(var h;b!==r||i!==0&&b.nodeType!==3||(l=o+i),b!==a||n!==0&&b.nodeType!==3||(u=o+n),b.nodeType===3&&(o+=b.nodeValue.length),(h=b.firstChild)!==null;)v=b,b=h;for(;;){if(b===t)break t;if(v===r&&++f===i&&(l=o),v===a&&++y===n&&(u=o),(h=b.nextSibling)!==null)break;b=v,v=b.parentNode}b=h}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(V0={focusedElem:t,selectionRange:r},Sd=!1,ze=e;ze!==null;)if(e=ze,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ze=t;else for(;ze!==null;){e=ze;try{var w=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var E=w.memoizedProps,S=w.memoizedState,_=e.stateNode,p=_.getSnapshotBeforeUpdate(e.elementType===e.type?E:Xn(e.type,E),S);_.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var d=e.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(Pe(163))}}catch(g){Yt(e,e.return,g)}if(t=e.sibling,t!==null){t.return=e.return,ze=t;break}ze=e.return}return w=y_,y_=!1,w}function xu(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var a=i.destroy;i.destroy=void 0,a!==void 0&&om(e,r,a)}i=i.next}while(i!==n)}}function gh(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function lm(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function k4(t){var e=t.alternate;e!==null&&(t.alternate=null,k4(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[_i],delete e[Gu],delete e[W0],delete e[gx],delete e[vx])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function T4(t){return t.tag===5||t.tag===3||t.tag===4}function b_(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||T4(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function sm(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=xd));else if(n!==4&&(t=t.child,t!==null))for(sm(t,e,r),t=t.sibling;t!==null;)sm(t,e,r),t=t.sibling}function um(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(um(t,e,r),t=t.sibling;t!==null;)um(t,e,r),t=t.sibling}var Sr=null,Qn=!1;function Pa(t,e,r){for(r=r.child;r!==null;)C4(t,e,r),r=r.sibling}function C4(t,e,r){if(Oi&&typeof Oi.onCommitFiberUnmount=="function")try{Oi.onCommitFiberUnmount(lh,r)}catch{}switch(r.tag){case 5:Lr||Hl(r,e);case 6:var n=Sr,i=Qn;Sr=null,Pa(t,e,r),Sr=n,Qn=i,Sr!==null&&(Qn?(t=Sr,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Sr.removeChild(r.stateNode));break;case 18:Sr!==null&&(Qn?(t=Sr,r=r.stateNode,t.nodeType===8?uv(t.parentNode,r):t.nodeType===1&&uv(t,r),Du(t)):uv(Sr,r.stateNode));break;case 4:n=Sr,i=Qn,Sr=r.stateNode.containerInfo,Qn=!0,Pa(t,e,r),Sr=n,Qn=i;break;case 0:case 11:case 14:case 15:if(!Lr&&(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)&&om(r,e,o),i=i.next}while(i!==n)}Pa(t,e,r);break;case 1:if(!Lr&&(Hl(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Yt(r,e,l)}Pa(t,e,r);break;case 21:Pa(t,e,r);break;case 22:r.mode&1?(Lr=(n=Lr)||r.memoizedState!==null,Pa(t,e,r),Lr=n):Pa(t,e,r);break;default:Pa(t,e,r)}}function __(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Nx),e.forEach(function(n){var i=Gx.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Yn(t,e){var r=e.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var a=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 5:Sr=l.stateNode,Qn=!1;break e;case 3:Sr=l.stateNode.containerInfo,Qn=!0;break e;case 4:Sr=l.stateNode.containerInfo,Qn=!0;break e}l=l.return}if(Sr===null)throw Error(Pe(160));C4(a,o,i),Sr=null,Qn=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(f){Yt(i,e,f)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)R4(e,t),e=e.sibling}function R4(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Yn(e,t),mi(t),n&4){try{xu(3,t,t.return),gh(3,t)}catch(E){Yt(t,t.return,E)}try{xu(5,t,t.return)}catch(E){Yt(t,t.return,E)}}break;case 1:Yn(e,t),mi(t),n&512&&r!==null&&Hl(r,r.return);break;case 5:if(Yn(e,t),mi(t),n&512&&r!==null&&Hl(r,r.return),t.flags&32){var i=t.stateNode;try{Mu(i,"")}catch(E){Yt(t,t.return,E)}}if(n&4&&(i=t.stateNode,i!=null)){var a=t.memoizedProps,o=r!==null?r.memoizedProps:a,l=t.type,u=t.updateQueue;if(t.updateQueue=null,u!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&Z3(i,a),M0(l,o);var f=M0(l,a);for(o=0;o<u.length;o+=2){var y=u[o],b=u[o+1];y==="style"?n5(i,b):y==="dangerouslySetInnerHTML"?t5(i,b):y==="children"?Mu(i,b):Bm(i,y,b,f)}switch(l){case"input":k0(i,a);break;case"textarea":J3(i,a);break;case"select":var v=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var h=a.value;h!=null?Yl(i,!!a.multiple,h,!1):v!==!!a.multiple&&(a.defaultValue!=null?Yl(i,!!a.multiple,a.defaultValue,!0):Yl(i,!!a.multiple,a.multiple?[]:"",!1))}i[Gu]=a}catch(E){Yt(t,t.return,E)}}break;case 6:if(Yn(e,t),mi(t),n&4){if(t.stateNode===null)throw Error(Pe(162));i=t.stateNode,a=t.memoizedProps;try{i.nodeValue=a}catch(E){Yt(t,t.return,E)}}break;case 3:if(Yn(e,t),mi(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Du(e.containerInfo)}catch(E){Yt(t,t.return,E)}break;case 4:Yn(e,t),mi(t);break;case 13:Yn(e,t),mi(t),i=t.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(by=Zt())),n&4&&__(t);break;case 22:if(y=r!==null&&r.memoizedState!==null,t.mode&1?(Lr=(f=Lr)||y,Yn(e,t),Lr=f):Yn(e,t),mi(t),n&8192){if(f=t.memoizedState!==null,(t.stateNode.isHidden=f)&&!y&&t.mode&1)for(ze=t,y=t.child;y!==null;){for(b=ze=y;ze!==null;){switch(v=ze,h=v.child,v.tag){case 0:case 11:case 14:case 15:xu(4,v,v.return);break;case 1:Hl(v,v.return);var w=v.stateNode;if(typeof w.componentWillUnmount=="function"){n=v,r=v.return;try{e=n,w.props=e.memoizedProps,w.state=e.memoizedState,w.componentWillUnmount()}catch(E){Yt(n,r,E)}}break;case 5:Hl(v,v.return);break;case 22:if(v.memoizedState!==null){S_(b);continue}}h!==null?(h.return=v,ze=h):S_(b)}y=y.sibling}e:for(y=null,b=t;;){if(b.tag===5){if(y===null){y=b;try{i=b.stateNode,f?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=b.stateNode,u=b.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=r5("display",o))}catch(E){Yt(t,t.return,E)}}}else if(b.tag===6){if(y===null)try{b.stateNode.nodeValue=f?"":b.memoizedProps}catch(E){Yt(t,t.return,E)}}else if((b.tag!==22&&b.tag!==23||b.memoizedState===null||b===t)&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;y===b&&(y=null),b=b.return}y===b&&(y=null),b.sibling.return=b.return,b=b.sibling}}break;case 19:Yn(e,t),mi(t),n&4&&__(t);break;case 21:break;default:Yn(e,t),mi(t)}}function mi(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(T4(r)){var n=r;break e}r=r.return}throw Error(Pe(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(Mu(i,""),n.flags&=-33);var a=b_(t);um(t,a,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=b_(t);sm(t,l,o);break;default:throw Error(Pe(161))}}catch(u){Yt(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Ix(t,e,r){ze=t,N4(t)}function N4(t,e,r){for(var n=(t.mode&1)!==0;ze!==null;){var i=ze,a=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||zf;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||Lr;l=zf;var f=Lr;if(zf=o,(Lr=u)&&!f)for(ze=i;ze!==null;)o=ze,u=o.child,o.tag===22&&o.memoizedState!==null?E_(i):u!==null?(u.return=o,ze=u):E_(i);for(;a!==null;)ze=a,N4(a),a=a.sibling;ze=i,zf=l,Lr=f}w_(t)}else i.subtreeFlags&8772&&a!==null?(a.return=i,ze=a):w_(t)}}function w_(t){for(;ze!==null;){var e=ze;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Lr||gh(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!Lr)if(r===null)n.componentDidMount();else{var i=e.elementType===e.type?r.memoizedProps:Xn(e.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=e.updateQueue;a!==null&&i_(e,a,n);break;case 3:var o=e.updateQueue;if(o!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}i_(e,o,r)}break;case 5:var l=e.stateNode;if(r===null&&e.flags&4){r=l;var u=e.memoizedProps;switch(e.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(e.memoizedState===null){var f=e.alternate;if(f!==null){var y=f.memoizedState;if(y!==null){var b=y.dehydrated;b!==null&&Du(b)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Pe(163))}Lr||e.flags&512&&lm(e)}catch(v){Yt(e,e.return,v)}}if(e===t){ze=null;break}if(r=e.sibling,r!==null){r.return=e.return,ze=r;break}ze=e.return}}function S_(t){for(;ze!==null;){var e=ze;if(e===t){ze=null;break}var r=e.sibling;if(r!==null){r.return=e.return,ze=r;break}ze=e.return}}function E_(t){for(;ze!==null;){var e=ze;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{gh(4,e)}catch(u){Yt(e,r,u)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var i=e.return;try{n.componentDidMount()}catch(u){Yt(e,i,u)}}var a=e.return;try{lm(e)}catch(u){Yt(e,a,u)}break;case 5:var o=e.return;try{lm(e)}catch(u){Yt(e,o,u)}}}catch(u){Yt(e,e.return,u)}if(e===t){ze=null;break}var l=e.sibling;if(l!==null){l.return=e.return,ze=l;break}ze=e.return}}var Lx=Math.ceil,jd=aa.ReactCurrentDispatcher,my=aa.ReactCurrentOwner,Fn=aa.ReactCurrentBatchConfig,pt=0,mr=null,tr=null,Or=0,hn=0,Vl=Xa(0),lr=0,Yu=null,Bo=0,vh=0,yy=0,Pu=null,tn=null,by=0,ls=1/0,Hi=null,Dd=!1,cm=null,Ua=null,Bf=!1,Ia=null,Fd=0,Au=0,fm=null,ud=-1,cd=0;function Hr(){return pt&6?Zt():ud!==-1?ud:ud=Zt()}function Ga(t){return t.mode&1?pt&2&&Or!==0?Or&-Or:yx.transition!==null?(cd===0&&(cd=g5()),cd):(t=Et,t!==0||(t=window.event,t=t===void 0?16:S5(t.type)),t):1}function ei(t,e,r,n){if(50<Au)throw Au=0,fm=null,Error(Pe(185));sc(t,r,n),(!(pt&2)||t!==mr)&&(t===mr&&(!(pt&2)&&(vh|=r),lr===4&&Ra(t,Or)),sn(t,n),r===1&&pt===0&&!(e.mode&1)&&(ls=Zt()+500,dh&&Qa()))}function sn(t,e){var r=t.callbackNode;yO(t,e);var n=wd(t,t===mr?Or:0);if(n===0)r!==null&&Nb(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&Nb(r),e===1)t.tag===0?mx(O_.bind(null,t)):U5(O_.bind(null,t)),hx(function(){!(pt&6)&&Qa()}),r=null;else{switch(v5(n)){case 1:r=qm;break;case 4:r=h5;break;case 16:r=_d;break;case 536870912:r=p5;break;default:r=_d}r=B4(r,M4.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function M4(t,e){if(ud=-1,cd=0,pt&6)throw Error(Pe(327));var r=t.callbackNode;if(Jl()&&t.callbackNode!==r)return null;var n=wd(t,t===mr?Or:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=zd(t,n);else{e=n;var i=pt;pt|=2;var a=L4();(mr!==t||Or!==e)&&(Hi=null,ls=Zt()+500,No(t,e));do try{Fx();break}catch(l){I4(t,l)}while(1);iy(),jd.current=a,pt=i,tr!==null?e=0:(mr=null,Or=0,e=lr)}if(e!==0){if(e===2&&(i=F0(t),i!==0&&(n=i,e=dm(t,i))),e===1)throw r=Yu,No(t,0),Ra(t,n),sn(t,Zt()),r;if(e===6)Ra(t,n);else{if(i=t.current.alternate,!(n&30)&&!jx(i)&&(e=zd(t,n),e===2&&(a=F0(t),a!==0&&(n=a,e=dm(t,a))),e===1))throw r=Yu,No(t,0),Ra(t,n),sn(t,Zt()),r;switch(t.finishedWork=i,t.finishedLanes=n,e){case 0:case 1:throw Error(Pe(345));case 2:Ao(t,tn,Hi);break;case 3:if(Ra(t,n),(n&130023424)===n&&(e=by+500-Zt(),10<e)){if(wd(t,0)!==0)break;if(i=t.suspendedLanes,(i&n)!==n){Hr(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=$0(Ao.bind(null,t,tn,Hi),e);break}Ao(t,tn,Hi);break;case 4:if(Ra(t,n),(n&4194240)===n)break;for(e=t.eventTimes,i=-1;0<n;){var o=31-Jn(n);a=1<<o,o=e[o],o>i&&(i=o),n&=~a}if(n=i,n=Zt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Lx(n/1960))-n,10<n){t.timeoutHandle=$0(Ao.bind(null,t,tn,Hi),n);break}Ao(t,tn,Hi);break;case 5:Ao(t,tn,Hi);break;default:throw Error(Pe(329))}}}return sn(t,Zt()),t.callbackNode===r?M4.bind(null,t):null}function dm(t,e){var r=Pu;return t.current.memoizedState.isDehydrated&&(No(t,e).flags|=256),t=zd(t,e),t!==2&&(e=tn,tn=r,e!==null&&hm(e)),t}function hm(t){tn===null?tn=t:tn.push.apply(tn,t)}function jx(t){for(var e=t;;){if(e.flags&16384){var r=e.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(!ai(a(),i))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Ra(t,e){for(e&=~yy,e&=~vh,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-Jn(e),n=1<<r;t[r]=-1,e&=~n}}function O_(t){if(pt&6)throw Error(Pe(327));Jl();var e=wd(t,0);if(!(e&1))return sn(t,Zt()),null;var r=zd(t,e);if(t.tag!==0&&r===2){var n=F0(t);n!==0&&(e=n,r=dm(t,n))}if(r===1)throw r=Yu,No(t,0),Ra(t,e),sn(t,Zt()),r;if(r===6)throw Error(Pe(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Ao(t,tn,Hi),sn(t,Zt()),null}function _y(t,e){var r=pt;pt|=1;try{return t(e)}finally{pt=r,pt===0&&(ls=Zt()+500,dh&&Qa())}}function Uo(t){Ia!==null&&Ia.tag===0&&!(pt&6)&&Jl();var e=pt;pt|=1;var r=Fn.transition,n=Et;try{if(Fn.transition=null,Et=1,t)return t()}finally{Et=n,Fn.transition=r,pt=e,!(pt&6)&&Qa()}}function wy(){hn=Vl.current,Lt(Vl)}function No(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,dx(r)),tr!==null)for(r=tr.return;r!==null;){var n=r;switch(ty(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Pd();break;case 3:as(),Lt(on),Lt(jr),cy();break;case 5:uy(n);break;case 4:as();break;case 13:Lt(Ht);break;case 19:Lt(Ht);break;case 10:ay(n.type._context);break;case 22:case 23:wy()}r=r.return}if(mr=t,tr=t=Ha(t.current,null),Or=hn=e,lr=0,Yu=null,yy=vh=Bo=0,tn=Pu=null,To!==null){for(e=0;e<To.length;e++)if(r=To[e],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}To=null}return t}function I4(t,e){do{var r=tr;try{if(iy(),od.current=Ld,Id){for(var n=Vt.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Id=!1}if(zo=0,gr=ar=Vt=null,Ou=!1,qu=0,my.current=null,r===null||r.return===null){lr=1,Yu=e,tr=null;break}e:{var a=t,o=r.return,l=r,u=e;if(e=Or,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,y=l,b=y.tag;if(!(y.mode&1)&&(b===0||b===11||b===15)){var v=y.alternate;v?(y.updateQueue=v.updateQueue,y.memoizedState=v.memoizedState,y.lanes=v.lanes):(y.updateQueue=null,y.memoizedState=null)}var h=f_(o);if(h!==null){h.flags&=-257,d_(h,o,l,a,e),h.mode&1&&c_(a,f,e),e=h,u=f;var w=e.updateQueue;if(w===null){var E=new Set;E.add(u),e.updateQueue=E}else w.add(u);break e}else{if(!(e&1)){c_(a,f,e),Sy();break e}u=Error(Pe(426))}}else if(zt&&l.mode&1){var S=f_(o);if(S!==null){!(S.flags&65536)&&(S.flags|=256),d_(S,o,l,a,e),ry(os(u,l));break e}}a=u=os(u,l),lr!==4&&(lr=2),Pu===null?Pu=[a]:Pu.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,e&=-e,a.lanes|=e;var _=m4(a,u,e);n_(a,_);break e;case 1:l=u;var p=a.type,d=a.stateNode;if(!(a.flags&128)&&(typeof p.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Ua===null||!Ua.has(d)))){a.flags|=65536,e&=-e,a.lanes|=e;var g=y4(a,l,e);n_(a,g);break e}}a=a.return}while(a!==null)}D4(r)}catch(m){e=m,tr===r&&r!==null&&(tr=r=r.return);continue}break}while(1)}function L4(){var t=jd.current;return jd.current=Ld,t===null?Ld:t}function Sy(){(lr===0||lr===3||lr===2)&&(lr=4),mr===null||!(Bo&268435455)&&!(vh&268435455)||Ra(mr,Or)}function zd(t,e){var r=pt;pt|=2;var n=L4();(mr!==t||Or!==e)&&(Hi=null,No(t,e));do try{Dx();break}catch(i){I4(t,i)}while(1);if(iy(),pt=r,jd.current=n,tr!==null)throw Error(Pe(261));return mr=null,Or=0,lr}function Dx(){for(;tr!==null;)j4(tr)}function Fx(){for(;tr!==null&&!uO();)j4(tr)}function j4(t){var e=z4(t.alternate,t,hn);t.memoizedProps=t.pendingProps,e===null?D4(t):tr=e,my.current=null}function D4(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=Rx(r,e),r!==null){r.flags&=32767,tr=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{lr=6,tr=null;return}}else if(r=Cx(r,e,hn),r!==null){tr=r;return}if(e=e.sibling,e!==null){tr=e;return}tr=e=t}while(e!==null);lr===0&&(lr=5)}function Ao(t,e,r){var n=Et,i=Fn.transition;try{Fn.transition=null,Et=1,zx(t,e,r,n)}finally{Fn.transition=i,Et=n}return null}function zx(t,e,r,n){do Jl();while(Ia!==null);if(pt&6)throw Error(Pe(327));r=t.finishedWork;var i=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(Pe(177));t.callbackNode=null,t.callbackPriority=0;var a=r.lanes|r.childLanes;if(bO(t,a),t===mr&&(tr=mr=null,Or=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Bf||(Bf=!0,B4(_d,function(){return Jl(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=Fn.transition,Fn.transition=null;var o=Et;Et=1;var l=pt;pt|=4,my.current=null,Mx(t,r),R4(r,t),ax(V0),Sd=!!H0,V0=H0=null,t.current=r,Ix(r),cO(),pt=l,Et=o,Fn.transition=a}else t.current=r;if(Bf&&(Bf=!1,Ia=t,Fd=i),a=t.pendingLanes,a===0&&(Ua=null),hO(r.stateNode),sn(t,Zt()),e!==null)for(n=t.onRecoverableError,r=0;r<e.length;r++)i=e[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Dd)throw Dd=!1,t=cm,cm=null,t;return Fd&1&&t.tag!==0&&Jl(),a=t.pendingLanes,a&1?t===fm?Au++:(Au=0,fm=t):Au=0,Qa(),null}function Jl(){if(Ia!==null){var t=v5(Fd),e=Fn.transition,r=Et;try{if(Fn.transition=null,Et=16>t?16:t,Ia===null)var n=!1;else{if(t=Ia,Ia=null,Fd=0,pt&6)throw Error(Pe(331));var i=pt;for(pt|=4,ze=t.current;ze!==null;){var a=ze,o=a.child;if(ze.flags&16){var l=a.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for(ze=f;ze!==null;){var y=ze;switch(y.tag){case 0:case 11:case 15:xu(8,y,a)}var b=y.child;if(b!==null)b.return=y,ze=b;else for(;ze!==null;){y=ze;var v=y.sibling,h=y.return;if(k4(y),y===f){ze=null;break}if(v!==null){v.return=h,ze=v;break}ze=h}}}var w=a.alternate;if(w!==null){var E=w.child;if(E!==null){w.child=null;do{var S=E.sibling;E.sibling=null,E=S}while(E!==null)}}ze=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,ze=o;else e:for(;ze!==null;){if(a=ze,a.flags&2048)switch(a.tag){case 0:case 11:case 15:xu(9,a,a.return)}var _=a.sibling;if(_!==null){_.return=a.return,ze=_;break e}ze=a.return}}var p=t.current;for(ze=p;ze!==null;){o=ze;var d=o.child;if(o.subtreeFlags&2064&&d!==null)d.return=o,ze=d;else e:for(o=p;ze!==null;){if(l=ze,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:gh(9,l)}}catch(m){Yt(l,l.return,m)}if(l===o){ze=null;break e}var g=l.sibling;if(g!==null){g.return=l.return,ze=g;break e}ze=l.return}}if(pt=i,Qa(),Oi&&typeof Oi.onPostCommitFiberRoot=="function")try{Oi.onPostCommitFiberRoot(lh,t)}catch{}n=!0}return n}finally{Et=r,Fn.transition=e}}return!1}function x_(t,e,r){e=os(r,e),e=m4(t,e,1),t=Ba(t,e,1),e=Hr(),t!==null&&(sc(t,1,e),sn(t,e))}function Yt(t,e,r){if(t.tag===3)x_(t,t,r);else for(;e!==null;){if(e.tag===3){x_(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ua===null||!Ua.has(n))){t=os(r,t),t=y4(e,t,1),e=Ba(e,t,1),t=Hr(),e!==null&&(sc(e,1,t),sn(e,t));break}}e=e.return}}function Bx(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=Hr(),t.pingedLanes|=t.suspendedLanes&r,mr===t&&(Or&r)===r&&(lr===4||lr===3&&(Or&130023424)===Or&&500>Zt()-by?No(t,0):yy|=r),sn(t,e)}function F4(t,e){e===0&&(t.mode&1?(e=Cf,Cf<<=1,!(Cf&130023424)&&(Cf=4194304)):e=1);var r=Hr();t=ea(t,e),t!==null&&(sc(t,e,r),sn(t,r))}function Ux(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),F4(t,r)}function Gx(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(Pe(314))}n!==null&&n.delete(e),F4(t,r)}var z4;z4=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||on.current)rn=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return rn=!1,Tx(t,e,r);rn=!!(t.flags&131072)}else rn=!1,zt&&e.flags&1048576&&G5(e,Td,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;sd(t,e),t=e.pendingProps;var i=rs(e,jr.current);Zl(e,r),i=dy(null,e,n,t,i,r);var a=hy();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ln(n)?(a=!0,Ad(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ly(e),i.updater=hh,e.stateNode=i,i._reactInternals=e,J0(e,n,t,r),e=rm(null,e,n,!0,a,r)):(e.tag=0,zt&&a&&ey(e),Gr(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(sd(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=Vx(n),t=Xn(n,t),i){case 0:e=tm(null,e,n,t,r);break e;case 1:e=g_(null,e,n,t,r);break e;case 11:e=h_(null,e,n,t,r);break e;case 14:e=p_(null,e,n,Xn(n.type,t),r);break e}throw Error(Pe(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Xn(n,i),tm(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Xn(n,i),g_(t,e,n,i,r);case 3:e:{if(S4(e),t===null)throw Error(Pe(387));n=e.pendingProps,a=e.memoizedState,i=a.element,$5(t,e),Nd(e,n,null,r);var o=e.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){i=os(Error(Pe(423)),e),e=v_(t,e,n,r,i);break e}else if(n!==i){i=os(Error(Pe(424)),e),e=v_(t,e,n,r,i);break e}else for(gn=za(e.stateNode.containerInfo.firstChild),vn=e,zt=!0,Zn=null,r=X5(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ns(),n===i){e=ta(t,e,r);break e}Gr(t,e,n,r)}e=e.child}return e;case 5:return Q5(e),t===null&&X0(e),n=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,o=i.children,q0(n,i)?o=null:a!==null&&q0(n,a)&&(e.flags|=32),w4(t,e),Gr(t,e,o,r),e.child;case 6:return t===null&&X0(e),null;case 13:return E4(t,e,r);case 4:return sy(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=is(e,null,n,r):Gr(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Xn(n,i),h_(t,e,n,i,r);case 7:return Gr(t,e,e.pendingProps,r),e.child;case 8:return Gr(t,e,e.pendingProps.children,r),e.child;case 12:return Gr(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,a=e.memoizedProps,o=i.value,Rt(Cd,n._currentValue),n._currentValue=o,a!==null)if(ai(a.value,o)){if(a.children===i.children&&!on.current){e=ta(t,e,r);break e}}else for(a=e.child,a!==null&&(a.return=e);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=Wi(-1,r&-r),u.tag=2;var f=a.updateQueue;if(f!==null){f=f.shared;var y=f.pending;y===null?u.next=u:(u.next=y.next,y.next=u),f.pending=u}}a.lanes|=r,u=a.alternate,u!==null&&(u.lanes|=r),Q0(a.return,r,e),l.lanes|=r;break}u=u.next}}else if(a.tag===10)o=a.type===e.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Pe(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Q0(o,r,e),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===e){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Gr(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Zl(e,r),i=Bn(i),n=n(i),e.flags|=1,Gr(t,e,n,r),e.child;case 14:return n=e.type,i=Xn(n,e.pendingProps),i=Xn(n.type,i),p_(t,e,n,i,r);case 15:return b4(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Xn(n,i),sd(t,e),e.tag=1,ln(n)?(t=!0,Ad(e)):t=!1,Zl(e,r),Y5(e,n,i),J0(e,n,i,r),rm(null,e,n,!0,t,r);case 19:return O4(t,e,r);case 22:return _4(t,e,r)}throw Error(Pe(156,e.tag))};function B4(t,e){return d5(t,e)}function Hx(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,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 Dn(t,e,r,n){return new Hx(t,e,r,n)}function Ey(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Vx(t){if(typeof t=="function")return Ey(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Gm)return 11;if(t===Hm)return 14}return 2}function Ha(t,e){var r=t.alternate;return r===null?(r=Dn(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function fd(t,e,r,n,i,a){var o=2;if(n=t,typeof t=="function")Ey(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Il:return Mo(r.children,i,a,e);case Um:o=8,i|=8;break;case E0:return t=Dn(12,r,e,i|2),t.elementType=E0,t.lanes=a,t;case O0:return t=Dn(13,r,e,i),t.elementType=O0,t.lanes=a,t;case x0:return t=Dn(19,r,e,i),t.elementType=x0,t.lanes=a,t;case K3:return mh(r,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case W3:o=10;break e;case Y3:o=9;break e;case Gm:o=11;break e;case Hm:o=14;break e;case ka:o=16,n=null;break e}throw Error(Pe(130,t==null?t:typeof t,""))}return e=Dn(o,r,e,i),e.elementType=t,e.type=n,e.lanes=a,e}function Mo(t,e,r,n){return t=Dn(7,t,n,e),t.lanes=r,t}function mh(t,e,r,n){return t=Dn(22,t,n,e),t.elementType=K3,t.lanes=r,t.stateNode={isHidden:!1},t}function mv(t,e,r){return t=Dn(6,t,null,e),t.lanes=r,t}function yv(t,e,r){return e=Dn(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function qx(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Zg(0),this.expirationTimes=Zg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zg(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Oy(t,e,r,n,i,a,o,l,u){return t=new qx(t,e,r,l,u),e===1?(e=1,a===!0&&(e|=8)):e=0,a=Dn(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ly(a),t}function $x(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ml,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function U4(t){if(!t)return $a;t=t._reactInternals;e:{if(Xo(t)!==t||t.tag!==1)throw Error(Pe(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(ln(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Pe(171))}if(t.tag===1){var r=t.type;if(ln(r))return B5(t,r,e)}return e}function G4(t,e,r,n,i,a,o,l,u){return t=Oy(r,n,!0,t,i,a,o,l,u),t.context=U4(null),r=t.current,n=Hr(),i=Ga(r),a=Wi(n,i),a.callback=e??null,Ba(r,a,i),t.current.lanes=i,sc(t,i,n),sn(t,n),t}function yh(t,e,r,n){var i=e.current,a=Hr(),o=Ga(i);return r=U4(r),e.context===null?e.context=r:e.pendingContext=r,e=Wi(a,o),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=Ba(i,e,o),t!==null&&(ei(t,i,o,a),ad(t,i,o)),o}function Bd(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function P_(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function xy(t,e){P_(t,e),(t=t.alternate)&&P_(t,e)}function Wx(){return null}var H4=typeof reportError=="function"?reportError:function(t){console.error(t)};function Py(t){this._internalRoot=t}bh.prototype.render=Py.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(Pe(409));yh(t,e,null,null)};bh.prototype.unmount=Py.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Uo(function(){yh(null,t,null,null)}),e[Ji]=null}};function bh(t){this._internalRoot=t}bh.prototype.unstable_scheduleHydration=function(t){if(t){var e=b5();t={blockedOn:null,target:t,priority:e};for(var r=0;r<Ca.length&&e!==0&&e<Ca[r].priority;r++);Ca.splice(r,0,t),r===0&&w5(t)}};function Ay(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function _h(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function A_(){}function Yx(t,e,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var f=Bd(o);a.call(f)}}var o=G4(e,n,t,0,null,!1,!1,"",A_);return t._reactRootContainer=o,t[Ji]=o.current,Bu(t.nodeType===8?t.parentNode:t),Uo(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var f=Bd(u);l.call(f)}}var u=Oy(t,0,!1,null,null,!1,!1,"",A_);return t._reactRootContainer=u,t[Ji]=u.current,Bu(t.nodeType===8?t.parentNode:t),Uo(function(){yh(e,u,r,n)}),u}function wh(t,e,r,n,i){var a=r._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;i=function(){var u=Bd(o);l.call(u)}}yh(e,o,t,i)}else o=Yx(r,e,t,i,n);return Bd(o)}m5=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=gu(e.pendingLanes);r!==0&&($m(e,r|1),sn(e,Zt()),!(pt&6)&&(ls=Zt()+500,Qa()))}break;case 13:Uo(function(){var n=ea(t,1);if(n!==null){var i=Hr();ei(n,t,1,i)}}),xy(t,1)}};Wm=function(t){if(t.tag===13){var e=ea(t,134217728);if(e!==null){var r=Hr();ei(e,t,134217728,r)}xy(t,134217728)}};y5=function(t){if(t.tag===13){var e=Ga(t),r=ea(t,e);if(r!==null){var n=Hr();ei(r,t,e,n)}xy(t,e)}};b5=function(){return Et};_5=function(t,e){var r=Et;try{return Et=t,e()}finally{Et=r}};L0=function(t,e,r){switch(e){case"input":if(k0(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var i=fh(n);if(!i)throw Error(Pe(90));Q3(n),k0(n,i)}}}break;case"textarea":J3(t,r);break;case"select":e=r.value,e!=null&&Yl(t,!!r.multiple,e,!1)}};o5=_y;l5=Uo;var Kx={usingClientEntryPoint:!1,Events:[cc,Fl,fh,i5,a5,_y]},uu={findFiberByHostInstance:ko,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},Xx={bundleType:uu.bundleType,version:uu.version,rendererPackageName:uu.rendererPackageName,rendererConfig:uu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:aa.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=c5(t),t===null?null:t.stateNode},findFiberByHostInstance:uu.findFiberByHostInstance||Wx,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 Uf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Uf.isDisabled&&Uf.supportsFiber)try{lh=Uf.inject(Xx),Oi=Uf}catch{}}_n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kx;_n.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ay(e))throw Error(Pe(200));return $x(t,e,null,r)};_n.createRoot=function(t,e){if(!Ay(t))throw Error(Pe(299));var r=!1,n="",i=H4;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Oy(t,1,!1,null,null,r,!1,n,i),t[Ji]=e.current,Bu(t.nodeType===8?t.parentNode:t),new Py(e)};_n.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(Pe(188)):(t=Object.keys(t).join(","),Error(Pe(268,t)));return t=c5(e),t=t===null?null:t.stateNode,t};_n.flushSync=function(t){return Uo(t)};_n.hydrate=function(t,e,r){if(!_h(e))throw Error(Pe(200));return wh(null,t,e,!0,r)};_n.hydrateRoot=function(t,e,r){if(!Ay(t))throw Error(Pe(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",o=H4;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),e=G4(e,null,t,1,r??null,i,!1,a,o),t[Ji]=e.current,Bu(t),n)for(t=0;t<n.length;t++)r=n[t],i=r._getVersion,i=i(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,i]:e.mutableSourceEagerHydrationData.push(r,i);return new bh(e)};_n.render=function(t,e,r){if(!_h(e))throw Error(Pe(200));return wh(null,t,e,!1,r)};_n.unmountComponentAtNode=function(t){if(!_h(t))throw Error(Pe(40));return t._reactRootContainer?(Uo(function(){wh(null,null,t,!1,function(){t._reactRootContainer=null,t[Ji]=null})}),!0):!1};_n.unstable_batchedUpdates=_y;_n.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!_h(r))throw Error(Pe(200));if(t==null||t._reactInternals===void 0)throw Error(Pe(38));return wh(t,e,r,!1,n)};_n.version="18.2.0-next-9e3b772b8-20220608";function V4(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(V4)}catch(t){console.error(t)}}V4(),G3.exports=_n;var q4=G3.exports,k_=q4;vd.createRoot=k_.createRoot,vd.hydrateRoot=k_.hydrateRoot;var $4={};function it(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];throw new Error(typeof t=="number"?"[MobX] minified error nr: "+t+(r.length?" "+r.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var Qx={};function ky(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Qx}var W4=Object.assign,Ud=Object.getOwnPropertyDescriptor,Pi=Object.defineProperty,dc=Object.prototype,pm=[];Object.freeze(pm);var Ty={};Object.freeze(Ty);var Zx=typeof Proxy<"u",Jx=Object.toString();function Y4(){Zx||it("Proxy not available")}function K4(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var ql=function(){};function yn(t){return typeof t=="function"}function Go(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function Sh(t){return t!==null&&typeof t=="object"}function ra(t){if(!Sh(t))return!1;var e=Object.getPrototypeOf(t);if(e==null)return!0;var r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r.toString()===Jx}function X4(t){var e=t==null?void 0:t.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function hc(t,e,r){Pi(t,e,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Q4(t,e,r){Pi(t,e,{enumerable:!1,writable:!1,configurable:!0,value:r})}function Za(t,e){var r="isMobX"+t;return e.prototype[r]=!0,function(n){return Sh(n)&&n[r]===!0}}function Ps(t){return t instanceof Map}function pc(t){return t instanceof Set}var Z4=typeof Object.getOwnPropertySymbols<"u";function eP(t){var e=Object.keys(t);if(!Z4)return e;var r=Object.getOwnPropertySymbols(t);return r.length?[].concat(e,r.filter(function(n){return dc.propertyIsEnumerable.call(t,n)})):e}var ss=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Z4?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function J4(t){return t===null?null:typeof t=="object"?""+t:t}function Yi(t,e){return dc.hasOwnProperty.call(t,e)}var tP=Object.getOwnPropertyDescriptors||function(e){var r={};return ss(e).forEach(function(n){r[n]=Ud(e,n)}),r};function T_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,iP(n.key),n)}}function Cy(t,e,r){return e&&T_(t.prototype,e),r&&T_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ho(){return Ho=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ho.apply(this,arguments)}function eS(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,gm(t,e)}function gm(t,e){return gm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},gm(t,e)}function bv(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rP(t,e){if(t){if(typeof t=="string")return C_(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C_(t,e)}}function C_(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function $l(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=rP(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[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 nP(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function iP(t){var e=nP(t,"string");return typeof e=="symbol"?e:String(e)}var Ei=Symbol("mobx-stored-annotations");function ti(t){function e(r,n){gc(r,n,t)}return Object.assign(e,t)}function gc(t,e,r){Yi(t,Ei)||hc(t,Ei,Ho({},t[Ei])),hP(r)||(t[Ei][e]=r)}function aP(t){return Yi(t,Ei)||hc(t,Ei,Ho({},t[Ei])),t[Ei]}var qe=Symbol("mobx administration"),vc=function(){function t(r){r===void 0&&(r="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.batchId_=void 0,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=bt.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r,this.batchId_=Ee.inBatch?Ee.batchId:NaN}var e=t.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},e.reportObserved=function(){return ES(this)},e.reportChanged=function(){(!Ee.inBatch||this.batchId_!==Ee.batchId)&&(Ee.stateVersion=Ee.stateVersion<Number.MAX_SAFE_INTEGER?Ee.stateVersion+1:Number.MIN_SAFE_INTEGER,this.batchId_=NaN),nn(),OS(this),an()},e.toString=function(){return this.name_},t}(),Ry=Za("Atom",vc);function Ku(t,e,r){e===void 0&&(e=ql),r===void 0&&(r=ql);var n=new vc(t);return e!==ql&&LS(n,e),r!==ql&&Dy(n,r),n}function oP(t,e){return t===e}function lP(t,e){return Wy(t,e)}function sP(t,e){return Wy(t,e,1)}function uP(t,e){return Object.is?Object.is(t,e):t===e?t!==0||1/t===1/e:t!==t&&e!==e}var Vo={identity:oP,structural:lP,default:uP,shallow:sP};function us(t,e,r){return Rh(t)?t:Array.isArray(t)?Pt.array(t,{name:r}):ra(t)?Pt.object(t,void 0,{name:r}):Ps(t)?Pt.map(t,{name:r}):pc(t)?Pt.set(t,{name:r}):typeof t=="function"&&!kh(t)&&!Qu(t)?X4(t)?hs(t):fs(r,t):t}function cP(t,e,r){if(t==null||yr(t)||Wr(t)||Pr(t)||Vr(t))return t;if(Array.isArray(t))return Pt.array(t,{name:r,deep:!1});if(ra(t))return Pt.object(t,void 0,{name:r,deep:!1});if(Ps(t))return Pt.map(t,{name:r,deep:!1});if(pc(t))return Pt.set(t,{name:r,deep:!1})}function Eh(t){return t}function fP(t,e){return Wy(t,e)?e:t}var tS="override",dP=ti({annotationType_:tS,make_:pP,extend_:gP});function hP(t){return t.annotationType_===tS}function pP(t,e){return 0}function gP(t,e,r,n){it("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function mc(t,e){return{annotationType_:t,options_:e,make_:vP,extend_:mP}}function vP(t,e,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(t,e,r,!1)===null?0:1;if(n===t.target_)return this.extend_(t,e,r,!1)===null?0:2;if(kh(r.value))return 1;var a=rS(t,this,e,r,!1);return Pi(n,e,a),2}function mP(t,e,r,n){var i=rS(t,this,e,r);return t.defineProperty_(e,i,n)}function yP(t,e,r,n){e.annotationType_,n.value}function rS(t,e,r,n,i){var a,o,l,u,f,y,b;i===void 0&&(i=Ee.safeDescriptors),yP(t,e,r,n);var v=n.value;if((a=e.options_)!=null&&a.bound){var h;v=v.bind((h=t.proxy_)!=null?h:t.target_)}return{value:qo((o=(l=e.options_)==null?void 0:l.name)!=null?o:r.toString(),v,(u=(f=e.options_)==null?void 0:f.autoAction)!=null?u:!1,(y=e.options_)!=null&&y.bound?(b=t.proxy_)!=null?b:t.target_:void 0),configurable:i?t.isPlainObject_:!0,enumerable:!1,writable:!i}}function nS(t,e){return{annotationType_:t,options_:e,make_:bP,extend_:_P}}function bP(t,e,r,n){var i;if(n===t.target_)return this.extend_(t,e,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!Yi(t.target_,e)||!Qu(t.target_[e]))&&this.extend_(t,e,r,!1)===null)return 0;if(Qu(r.value))return 1;var a=iS(t,this,e,r,!1,!1);return Pi(n,e,a),2}function _P(t,e,r,n){var i,a=iS(t,this,e,r,(i=this.options_)==null?void 0:i.bound);return t.defineProperty_(e,a,n)}function wP(t,e,r,n){e.annotationType_,n.value}function iS(t,e,r,n,i,a){a===void 0&&(a=Ee.safeDescriptors),wP(t,e,r,n);var o=n.value;if(Qu(o)||(o=hs(o)),i){var l;o=o.bind((l=t.proxy_)!=null?l:t.target_),o.isMobXFlow=!0}return{value:o,configurable:a?t.isPlainObject_:!0,enumerable:!1,writable:!a}}function Ny(t,e){return{annotationType_:t,options_:e,make_:SP,extend_:EP}}function SP(t,e,r){return this.extend_(t,e,r,!1)===null?0:1}function EP(t,e,r,n){return OP(t,this,e,r),t.defineComputedProperty_(e,Ho({},this.options_,{get:r.get,set:r.set}),n)}function OP(t,e,r,n){e.annotationType_,n.get}function Oh(t,e){return{annotationType_:t,options_:e,make_:xP,extend_:PP}}function xP(t,e,r){return this.extend_(t,e,r,!1)===null?0:1}function PP(t,e,r,n){var i,a;return AP(t,this),t.defineObservableProperty_(e,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:us,n)}function AP(t,e,r,n){e.annotationType_}var kP="true",TP=aS();function aS(t){return{annotationType_:kP,options_:t,make_:CP,extend_:RP}}function CP(t,e,r,n){var i,a;if(r.get)return Qo.make_(t,e,r,n);if(r.set){var o=qo(e.toString(),r.set);return n===t.target_?t.defineProperty_(e,{configurable:Ee.safeDescriptors?t.isPlainObject_:!0,set:o})===null?0:2:(Pi(n,e,{configurable:!0,set:o}),2)}if(n!==t.target_&&typeof r.value=="function"){var l;if(X4(r.value)){var u,f=(u=this.options_)!=null&&u.autoBind?hs.bound:hs;return f.make_(t,e,r,n)}var y=(l=this.options_)!=null&&l.autoBind?fs.bound:fs;return y.make_(t,e,r,n)}var b=((i=this.options_)==null?void 0:i.deep)===!1?Pt.ref:Pt;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var v;r.value=r.value.bind((v=t.proxy_)!=null?v:t.target_)}return b.make_(t,e,r,n)}function RP(t,e,r,n){var i,a;if(r.get)return Qo.extend_(t,e,r,n);if(r.set)return t.defineProperty_(e,{configurable:Ee.safeDescriptors?t.isPlainObject_:!0,set:qo(e.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=t.proxy_)!=null?o:t.target_)}var l=((a=this.options_)==null?void 0:a.deep)===!1?Pt.ref:Pt;return l.extend_(t,e,r,n)}var NP="observable",MP="observable.ref",IP="observable.shallow",LP="observable.struct",oS={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(oS);function Gf(t){return t||oS}var lS=Oh(NP),jP=Oh(MP,{enhancer:Eh}),DP=Oh(IP,{enhancer:cP}),FP=Oh(LP,{enhancer:fP}),sS=ti(lS);function Hf(t){return t.deep===!0?us:t.deep===!1?Eh:BP(t.defaultDecorator)}function zP(t){var e;return t?(e=t.defaultDecorator)!=null?e:aS(t):void 0}function BP(t){var e,r;return t&&(e=(r=t.options_)==null?void 0:r.enhancer)!=null?e:us}function uS(t,e,r){if(Go(e)){gc(t,e,lS);return}return Rh(t)?t:ra(t)?Pt.object(t,e,r):Array.isArray(t)?Pt.array(t,e):Ps(t)?Pt.map(t,e):pc(t)?Pt.set(t,e):typeof t=="object"&&t!==null?t:Pt.box(t,e)}W4(uS,sS);var UP={box:function(e,r){var n=Gf(r);return new Io(e,Hf(n),n.name,!0,n.equals)},array:function(e,r){var n=Gf(r);return(Ee.useProxies===!1||n.proxy===!1?W7:D7)(e,Hf(n),n.name)},map:function(e,r){var n=Gf(r);return new Mh(e,Hf(n),n.name)},set:function(e,r){var n=Gf(r);return new qy(e,Hf(n),n.name)},object:function(e,r,n){return eo(function(){return Fy(Ee.useProxies===!1||(n==null?void 0:n.proxy)===!1?_c({},n):M7({},n),e,r)})},ref:ti(jP),shallow:ti(DP),deep:sS,struct:ti(FP)},Pt=W4(uS,UP),cS="computed",GP="computed.struct",fS=Ny(cS),HP=Ny(GP,{equals:Vo.structural}),Qo=function(e,r){if(Go(r))return gc(e,r,fS);if(ra(e))return ti(Ny(cS,e));var n=ra(r)?r:{};return n.get=e,n.name||(n.name=e.name||""),new Xu(n)};Object.assign(Qo,fS);Qo.struct=ti(HP);var R_,N_,Gd=0,VP=1,qP=(R_=(N_=Ud(function(){},"name"))==null?void 0:N_.configurable)!=null?R_:!1,M_={value:"action",configurable:!0,writable:!1,enumerable:!1};function qo(t,e,r,n){r===void 0&&(r=!1);function i(){return dS(t,r,e,n||this,arguments)}return i.isMobxAction=!0,qP&&(M_.value=t,Pi(i,"name",M_)),i}function dS(t,e,r,n,i){var a=hS(t,e);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{pS(a)}}function hS(t,e,r,n){var i=!1,a=0,o=Ee.trackingDerivation,l=!e||!o;nn();var u=Ee.allowStateChanges;l&&(Zo(),u=xh(!0));var f=Ah(!0),y={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:f,notifySpy_:i,startTime_:a,actionId_:VP++,parentActionId_:Gd};return Gd=y.actionId_,y}function pS(t){Gd!==t.actionId_&&it(30),Gd=t.parentActionId_,t.error_!==void 0&&(Ee.suppressReactionErrors=!0),Ph(t.prevAllowStateChanges_),es(t.prevAllowStateReads_),an(),t.runAsAction_&&Ki(t.prevDerivation_),Ee.suppressReactionErrors=!1}function My(t,e){var r=xh(t);try{return e()}finally{Ph(r)}}function xh(t){var e=Ee.allowStateChanges;return Ee.allowStateChanges=t,e}function Ph(t){Ee.allowStateChanges=t}var gS;gS=Symbol.toPrimitive;var Io=function(t){eS(e,t);function e(n,i,a,o,l){var u;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=Vo.default),u=t.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=e.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!==Ee.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(Ln(this)){var a=jn(this,{object:this,type:Ai,newValue:i});if(!a)return Ee.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Ee.UNCHANGED:i},r.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),ri(this)&&ni(this,{type:Ai,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return yc(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Ai,newValue:this.value_,oldValue:void 0}),bc(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 J4(this.get())},r[gS]=function(){return this.valueOf()},e}(vc),Iy=Za("ObservableValue",Io),vS;vS=Symbol.toPrimitive;var Xu=function(){function t(r){this.dependenciesState_=bt.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_=bt.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Vd(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_=Hd.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||it(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=qo("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?Vo.structural:Vo.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){t7(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},e.get=function(){if(this.isComputing_&&it(32,this.name_,this.derivation),Ee.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)vm(this)&&(this.warnAboutUntrackedRead_(),nn(),this.value_=this.computeValue_(!1),an());else if(ES(this),vm(this)){var n=Ee.trackingContext;this.keepAlive_&&!n&&(Ee.trackingContext=this),this.trackAndCompute()&&e7(this),Ee.trackingContext=n}var i=this.value_;if(dd(i))throw i.cause;return i},e.set=function(n){if(this.setter_){this.isRunningSetter_&&it(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter_=!1}}else it(34,this.name_)},e.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===bt.NOT_TRACKING_,a=this.computeValue_(!0),o=i||dd(n)||dd(a)||!this.equals_(n,a);return o&&(this.value_=a),o},e.computeValue_=function(n){this.isComputing_=!0;var i=xh(!1),a;if(n)a=mS(this,this.derivation,this.scope_);else if(Ee.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new Vd(o)}return Ph(i),this.isComputing_=!1,a},e.suspend_=function(){this.keepAlive_||(mm(this),this.value_=void 0)},e.observe_=function(n,i){var a=this,o=!0,l=void 0;return jy(function(){var u=a.get();if(!o||i){var f=Zo();n({observableKind:"computed",debugObjectName:a.name_,type:Ai,object:a,newValue:u,oldValue:l}),Ki(f)}o=!1,l=u})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return J4(this.get())},e[vS]=function(){return this.valueOf()},t}(),$o=Za("ComputedValue",Xu),bt;(function(t){t[t.NOT_TRACKING_=-1]="NOT_TRACKING_",t[t.UP_TO_DATE_=0]="UP_TO_DATE_",t[t.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",t[t.STALE_=2]="STALE_"})(bt||(bt={}));var Hd;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(Hd||(Hd={}));var Vd=function(e){this.cause=void 0,this.cause=e};function dd(t){return t instanceof Vd}function vm(t){switch(t.dependenciesState_){case bt.UP_TO_DATE_:return!1;case bt.NOT_TRACKING_:case bt.STALE_:return!0;case bt.POSSIBLY_STALE_:{for(var e=Ah(!0),r=Zo(),n=t.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if($o(o)){if(Ee.disableErrorBoundaries)o.get();else try{o.get()}catch{return Ki(r),es(e),!0}if(t.dependenciesState_===bt.STALE_)return Ki(r),es(e),!0}}return yS(t),Ki(r),es(e),!1}}}function $P(){return Ee.trackingDerivation!==null}function mS(t,e,r){var n=Ah(!0);yS(t),t.newObserving_=new Array(t.observing_.length+100),t.unboundDepsCount_=0,t.runId_=++Ee.runId;var i=Ee.trackingDerivation;Ee.trackingDerivation=t,Ee.inBatch++;var a;if(Ee.disableErrorBoundaries===!0)a=e.call(r);else try{a=e.call(r)}catch(o){a=new Vd(o)}return Ee.inBatch--,Ee.trackingDerivation=i,WP(t),es(n),a}function WP(t){for(var e=t.observing_,r=t.observing_=t.newObserving_,n=bt.UP_TO_DATE_,i=0,a=t.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,t.newObserving_=null,a=e.length;a--;){var u=e[a];u.diffValue_===0&&wS(u,t),u.diffValue_=0}for(;i--;){var f=r[i];f.diffValue_===1&&(f.diffValue_=0,JP(f,t))}n!==bt.UP_TO_DATE_&&(t.dependenciesState_=n,t.onBecomeStale_())}function mm(t){var e=t.observing_;t.observing_=[];for(var r=e.length;r--;)wS(e[r],t);t.dependenciesState_=bt.NOT_TRACKING_}function Ly(t){var e=Zo();try{return t()}finally{Ki(e)}}function Zo(){var t=Ee.trackingDerivation;return Ee.trackingDerivation=null,t}function Ki(t){Ee.trackingDerivation=t}function Ah(t){var e=Ee.allowStateReads;return Ee.allowStateReads=t,e}function es(t){Ee.allowStateReads=t}function yS(t){if(t.dependenciesState_!==bt.UP_TO_DATE_){t.dependenciesState_=bt.UP_TO_DATE_;for(var e=t.observing_,r=e.length;r--;)e[r].lowestObserverState_=bt.UP_TO_DATE_}}var YP=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],ku=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.batchId=Number.MIN_SAFE_INTEGER,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,this.stateVersion=Number.MIN_SAFE_INTEGER},hd=!0,bS=!1,Ee=function(){var t=ky();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(hd=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new ku().version&&(hd=!1),hd?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new ku):(setTimeout(function(){bS||it(35)},1),new ku)}();function KP(){if((Ee.pendingReactions.length||Ee.inBatch||Ee.isRunningReactions)&&it(36),bS=!0,hd){var t=ky();--t.__mobxInstanceCount===0&&(t.__mobxGlobals=void 0),Ee=new ku}}function _S(){return Ee}function XP(){var t=new ku;for(var e in t)YP.indexOf(e)===-1&&(Ee[e]=t[e]);Ee.allowStateChanges=!Ee.enforceActions}function QP(t){return t.observers_&&t.observers_.size>0}function ZP(t){return t.observers_}function JP(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function wS(t,e){t.observers_.delete(e),t.observers_.size===0&&SS(t)}function SS(t){t.isPendingUnobservation_===!1&&(t.isPendingUnobservation_=!0,Ee.pendingUnobservations.push(t))}function nn(){Ee.inBatch===0&&(Ee.batchId=Ee.batchId<Number.MAX_SAFE_INTEGER?Ee.batchId+1:Number.MIN_SAFE_INTEGER),Ee.inBatch++}function an(){if(--Ee.inBatch===0){xS();for(var t=Ee.pendingUnobservations,e=0;e<t.length;e++){var r=t[e];r.isPendingUnobservation_=!1,r.observers_.size===0&&(r.isBeingObserved_&&(r.isBeingObserved_=!1,r.onBUO()),r instanceof Xu&&r.suspend_())}Ee.pendingUnobservations=[]}}function ES(t){var e=Ee.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved_&&Ee.trackingContext&&(t.isBeingObserved_=!0,t.onBO())),t.isBeingObserved_):(t.observers_.size===0&&Ee.inBatch>0&&SS(t),!1)}function OS(t){t.lowestObserverState_!==bt.STALE_&&(t.lowestObserverState_=bt.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===bt.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=bt.STALE_}))}function e7(t){t.lowestObserverState_!==bt.STALE_&&(t.lowestObserverState_=bt.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===bt.POSSIBLY_STALE_?e.dependenciesState_=bt.STALE_:e.dependenciesState_===bt.UP_TO_DATE_&&(t.lowestObserverState_=bt.UP_TO_DATE_)}))}function t7(t){t.lowestObserverState_===bt.UP_TO_DATE_&&(t.lowestObserverState_=bt.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===bt.UP_TO_DATE_&&(e.dependenciesState_=bt.POSSIBLY_STALE_,e.onBecomeStale_())}))}var cs=function(){function t(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_=bt.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_=Hd.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=a}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,Ee.pendingReactions.push(this),xS())},e.isScheduled=function(){return this.isScheduled_},e.runReaction_=function(){if(!this.isDisposed_){nn(),this.isScheduled_=!1;var n=Ee.trackingContext;if(Ee.trackingContext=this,vm(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Ee.trackingContext=n,an()}},e.track=function(n){if(!this.isDisposed_){nn(),this.isRunning_=!0;var i=Ee.trackingContext;Ee.trackingContext=this;var a=mS(this,n,void 0);Ee.trackingContext=i,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&mm(this),dd(a)&&this.reportExceptionInDerivation_(a.cause),an()}},e.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Ee.disableErrorBoundaries)throw n;var a="[mobx] uncaught error in '"+this+"'";Ee.suppressReactionErrors||console.error(a,n),Ee.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},e.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(nn(),mm(this),an()))},e.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[qe]=this,a},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(n){},t}();function r7(t){return Ee.globalReactionErrorHandlers.push(t),function(){var e=Ee.globalReactionErrorHandlers.indexOf(t);e>=0&&Ee.globalReactionErrorHandlers.splice(e,1)}}var n7=100,ym=function(e){return e()};function xS(){Ee.inBatch>0||Ee.isRunningReactions||ym(i7)}function i7(){Ee.isRunningReactions=!0;for(var t=Ee.pendingReactions,e=0;t.length>0;){++e===n7&&(console.error("[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var r=t.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}Ee.isRunningReactions=!1}var qd=Za("Reaction",cs);function a7(t){var e=ym;ym=function(n){return t(function(){return e(n)})}}function Tu(){return!1}function PS(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var AS="action",o7="action.bound",kS="autoAction",l7="autoAction.bound",TS="<unnamed action>",CS=mc(AS),s7=mc(o7,{bound:!0}),RS=mc(kS,{autoAction:!0}),u7=mc(l7,{autoAction:!0,bound:!0});function NS(t){var e=function(n,i){if(yn(n))return qo(n.name||TS,n,t);if(yn(i))return qo(n,i,t);if(Go(i))return gc(n,i,t?RS:CS);if(Go(n))return ti(mc(t?kS:AS,{name:n,autoAction:t}))};return e}var rr=NS(!1);Object.assign(rr,CS);var fs=NS(!0);Object.assign(fs,RS);rr.bound=ti(s7);fs.bound=ti(u7);function ds(t){return dS(t.name||TS,!1,t,this,void 0)}function kh(t){return yn(t)&&t.isMobxAction===!0}function jy(t,e){var r,n,i,a,o;e===void 0&&(e=Ty);var l=(r=(n=e)==null?void 0:n.name)!=null?r:"Autorun",u=!e.scheduler&&!e.delay,f;if(u)f=new cs(l,function(){this.track(v)},e.onError,e.requiresObservable);else{var y=MS(e),b=!1;f=new cs(l,function(){b||(b=!0,y(function(){b=!1,f.isDisposed_||f.track(v)}))},e.onError,e.requiresObservable)}function v(){t(f)}return(i=e)!=null&&(a=i.signal)!=null&&a.aborted||f.schedule_(),f.getDisposer_((o=e)==null?void 0:o.signal)}var c7=function(e){return e()};function MS(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:c7}function IS(t,e,r){var n,i,a,o;r===void 0&&(r=Ty);var l=(n=r.name)!=null?n:"Reaction",u=rr(l,r.onError?f7(r.onError,e):e),f=!r.scheduler&&!r.delay,y=MS(r),b=!0,v=!1,h,w,E=r.compareStructural?Vo.structural:r.equals||Vo.default,S=new cs(l,function(){b||f?_():v||(v=!0,y(_))},r.onError,r.requiresObservable);function _(){if(v=!1,!S.isDisposed_){var p=!1;S.track(function(){var d=My(!1,function(){return t(S)});p=b||!E(h,d),w=h,h=d}),(b&&r.fireImmediately||!b&&p)&&u(h,w,S),b=!1}}return(i=r)!=null&&(a=i.signal)!=null&&a.aborted||S.schedule_(),S.getDisposer_((o=r)==null?void 0:o.signal)}function f7(t,e){return function(){try{return e.apply(this,arguments)}catch(r){t.call(this,r)}}}var d7="onBO",h7="onBUO";function LS(t,e,r){return jS(d7,t,e,r)}function Dy(t,e,r){return jS(h7,t,e,r)}function jS(t,e,r,n){var i=typeof n=="function"?ki(e,r):ki(e),a=yn(n)?n:r,o=t+"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 p7="never",Vf="always",g7="observed";function DS(t){t.isolateGlobalState===!0&&KP();var e=t.useProxies,r=t.enforceActions;if(e!==void 0&&(Ee.useProxies=e===Vf?!0:e===p7?!1:typeof Proxy<"u"),e==="ifavailable"&&(Ee.verifyProxies=!0),r!==void 0){var n=r===Vf?Vf:r===g7;Ee.enforceActions=n,Ee.allowStateChanges=!(n===!0||n===Vf)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in t&&(Ee[i]=!!t[i])}),Ee.allowStateReads=!Ee.observableRequiresReaction,t.reactionScheduler&&a7(t.reactionScheduler)}function Fy(t,e,r,n){var i=tP(e);return eo(function(){var a=_c(t,n)[qe];ss(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),t}function FS(t,e){return zS(ki(t,e))}function zS(t){var e={name:t.name_};return t.observing_&&t.observing_.length>0&&(e.dependencies=m7(t.observing_).map(zS)),e}function v7(t,e){return BS(ki(t,e))}function BS(t){var e={name:t.name_};return QP(t)&&(e.observers=Array.from(ZP(t)).map(BS)),e}function m7(t){return Array.from(new Set(t))}var y7=0;function Th(){this.message="FLOW_CANCELLED"}Th.prototype=Object.create(Error.prototype);function b7(t){return t instanceof Th}var I_=nS("flow"),_7=nS("flow.bound",{bound:!0}),hs=Object.assign(function(e,r){if(Go(r))return gc(e,r,I_);var n=e,i=n.name||"<unnamed flow>",a=function(){var l=this,u=arguments,f=++y7,y=rr(i+" - runid: "+f+" - init",n).apply(l,u),b,v=void 0,h=new Promise(function(w,E){var S=0;b=E;function _(g){v=void 0;var m;try{m=rr(i+" - runid: "+f+" - yield "+S++,y.next).call(y,g)}catch(x){return E(x)}d(m)}function p(g){v=void 0;var m;try{m=rr(i+" - runid: "+f+" - yield "+S++,y.throw).call(y,g)}catch(x){return E(x)}d(m)}function d(g){if(yn(g==null?void 0:g.then)){g.then(d,E);return}return g.done?w(g.value):(v=Promise.resolve(g.value),v.then(_,p))}_(void 0)});return h.cancel=rr(i+" - runid: "+f+" - cancel",function(){try{v&&L_(v);var w=y.return(void 0),E=Promise.resolve(w.value);E.then(ql,ql),L_(E),b(new Th)}catch(S){b(S)}}),h};return a.isMobXFlow=!0,a},I_);hs.bound=ti(_7);function L_(t){yn(t.cancel)&&t.cancel()}function w7(t){return t}function Qu(t){return(t==null?void 0:t.isMobXFlow)===!0}function zy(t,e,r){var n;return Pr(t)||Wr(t)||Iy(t)?n=oi(t):yr(t)&&(n=oi(t,e)),n.dehancer=typeof e=="function"?e:r,function(){n.dehancer=void 0}}function Ch(t,e,r){return yn(r)?E7(t,e,r):S7(t,e)}function S7(t,e){return oi(t).intercept_(e)}function E7(t,e,r){return oi(t,e).intercept_(r)}function US(t,e){if(e===void 0)return $o(t);if(yr(t)===!1||!t[qe].values_.has(e))return!1;var r=ki(t,e);return $o(r)}function O7(t){return US(t)}function GS(t,e){return US(t,e)}function HS(t,e){return t?e!==void 0?yr(t)?t[qe].values_.has(e):!1:yr(t)||!!t[qe]||Ry(t)||qd(t)||$o(t):!1}function Rh(t){return HS(t)}function VS(t,e){return HS(t,e)}function Zu(t){if(yr(t))return t[qe].keys_();if(Pr(t)||Vr(t))return Array.from(t.keys());if(Wr(t))return t.map(function(e,r){return r});it(5)}function By(t){if(yr(t))return Zu(t).map(function(e){return t[e]});if(Pr(t))return Zu(t).map(function(e){return t.get(e)});if(Vr(t))return Array.from(t.values());if(Wr(t))return t.slice();it(6)}function qS(t){if(yr(t))return Zu(t).map(function(e){return[e,t[e]]});if(Pr(t))return Zu(t).map(function(e){return[e,t.get(e)]});if(Vr(t))return Array.from(t.entries());if(Wr(t))return t.map(function(e,r){return[r,e]});it(7)}function Uy(t,e,r){if(arguments.length===2&&!Vr(t)){nn();var n=e;try{for(var i in n)Uy(t,i,n[i])}finally{an()}return}yr(t)?t[qe].set_(e,r):Pr(t)?t.set(e,r):Vr(t)?t.add(e):Wr(t)?(typeof e!="number"&&(e=parseInt(e,10)),e<0&&it("Invalid index: '"+e+"'"),nn(),e>=t.length&&(t.length=e+1),t[e]=r,an()):it(8)}function x7(t,e){yr(t)?t[qe].delete_(e):Pr(t)||Vr(t)?t.delete(e):Wr(t)?(typeof e!="number"&&(e=parseInt(e,10)),t.splice(e,1)):it(9)}function $S(t,e){if(yr(t))return t[qe].has_(e);if(Pr(t))return t.has(e);if(Vr(t))return t.has(e);if(Wr(t))return e>=0&&e<t.length;it(10)}function P7(t,e){if($S(t,e)){if(yr(t))return t[qe].get_(e);if(Pr(t))return t.get(e);if(Wr(t))return t[e];it(11)}}function Gy(t,e,r){if(yr(t))return t[qe].defineProperty_(e,r);it(39)}function WS(t){if(yr(t))return t[qe].ownKeys_();it(38)}function Nh(t,e,r,n){return yn(r)?k7(t,e,r,n):A7(t,e,r)}function A7(t,e,r){return oi(t).observe_(e,r)}function k7(t,e,r,n){return oi(t,e).observe_(r,n)}function qf(t,e,r){return t.set(e,r),r}function Nl(t,e){if(t==null||typeof t!="object"||t instanceof Date||!Rh(t))return t;if(Iy(t)||$o(t))return Nl(t.get(),e);if(e.has(t))return e.get(t);if(Wr(t)){var r=qf(e,t,new Array(t.length));return t.forEach(function(o,l){r[l]=Nl(o,e)}),r}if(Vr(t)){var n=qf(e,t,new Set);return t.forEach(function(o){n.add(Nl(o,e))}),n}if(Pr(t)){var i=qf(e,t,new Map);return t.forEach(function(o,l){i.set(l,Nl(o,e))}),i}else{var a=qf(e,t,{});return WS(t).forEach(function(o){dc.propertyIsEnumerable.call(t,o)&&(a[o]=Nl(t[o],e))}),a}}function T7(t,e){return Nl(t,new Map)}function C7(){}function wi(t,e){e===void 0&&(e=void 0),nn();try{return t.apply(e)}finally{an()}}function bm(t,e,r){return arguments.length===1||e&&typeof e=="object"?R7(t,e):YS(t,e,r||{})}function YS(t,e,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[qe].isDisposed_)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=qo("When-effect",e),o=jy(function(l){var u=My(!1,t);u&&(l.dispose(),n&&clearTimeout(n),a())},r);return o}function R7(t,e){var r;if(e!=null&&(r=e.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=YS(t,o,Ho({},e,{onError:l}));n=function(){f(),l(new Error("WHEN_CANCELLED"))},i=function(){f(),l(new Error("WHEN_ABORTED"))},e==null||(u=e.signal)==null||u.addEventListener==null||u.addEventListener("abort",i)}).finally(function(){var o;return e==null||(o=e.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",i)});return a.cancel=n,a}function kl(t){return t[qe]}var N7={has:function(e,r){return kl(e).has_(r)},get:function(e,r){return kl(e).get_(r)},set:function(e,r,n){var i;return Go(r)?(i=kl(e).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(e,r){var n;return Go(r)?(n=kl(e).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(e,r,n){var i;return(i=kl(e).defineProperty_(r,n))!=null?i:!0},ownKeys:function(e){return kl(e).ownKeys_()},preventExtensions:function(e){it(13)}};function M7(t,e){var r,n;return Y4(),t=_c(t,e),(n=(r=t[qe]).proxy_)!=null?n:r.proxy_=new Proxy(t,N7)}function Ln(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function yc(t,e){var r=t.interceptors_||(t.interceptors_=[]);return r.push(e),K4(function(){var n=r.indexOf(e);n!==-1&&r.splice(n,1)})}function jn(t,e){var r=Zo();try{for(var n=[].concat(t.interceptors_||[]),i=0,a=n.length;i<a&&(e=n[i](e),e&&!e.type&&it(14),!!e);i++);return e}finally{Ki(r)}}function ri(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function bc(t,e){var r=t.changeListeners_||(t.changeListeners_=[]);return r.push(e),K4(function(){var n=r.indexOf(e);n!==-1&&r.splice(n,1)})}function ni(t,e){var r=Zo(),n=t.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](e);Ki(r)}}function Hy(t,e,r){return eo(function(){var n,i=_c(t,r)[qe];(n=e)!=null||(e=aP(t)),ss(e).forEach(function(a){return i.make_(a,e[a])})}),t}var _v=Symbol("mobx-keys");function I7(t,e,r){return ra(t)?Fy(t,t,e,r):(eo(function(){var n=_c(t,r)[qe];if(!t[_v]){var i=Object.getPrototypeOf(t),a=new Set([].concat(ss(t),ss(i)));a.delete("constructor"),a.delete(qe),hc(i,_v,a)}t[_v].forEach(function(o){return n.make_(o,e&&o in e?e[o]:!0)})}),t)}var j_="splice",Ai="update",L7=1e4,j7={get:function(e,r){var n=e[qe];return r===qe?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):Yi($d,r)?$d[r]:e[r]},set:function(e,r,n){var i=e[qe];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?e[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){it(15)}},Vy=function(){function t(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 vc(r),this.enhancer_=function(o,l){return n(o,l,"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},e.intercept_=function(n){return yc(this,n)},e.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}),bc(this,n)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&it("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)},e.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&it(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&n6(n+i+1)},e.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=pm),Ln(this)){var u=jn(this,{object:this.proxy_,type:j_,index:n,removedCount:i,added:a});if(!u)return pm;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(b){return o.enhancer_(b,void 0)}),this.legacyMode_){var f=a.length-i;this.updateArrayLength_(l,f)}var y=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,y),this.dehanceValues_(y)},e.spliceItemsIntoValues_=function(n,i,a){if(a.length<L7){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 y=0;y<u.length;y++)this.values_[n+a.length+y]=u[y];return l}},e.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&Tu(),l=ri(this),u=l||o?{observableKind:"array",object:this.proxy_,type:Ai,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&ni(this,u)},e.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&Tu(),l=ri(this),u=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:j_,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&ni(this,u)},e.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])},e.set_=function(n,i){var a=this.values_;if(this.legacyMode_&&n>a.length&&it(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(Ln(this)){var l=jn(this,{type:Ai,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),y=0;y<f.length-1;y++)f[y]=void 0;f[f.length-1]=i,this.spliceWithArray_(a.length,0,f)}},t}();function D7(t,e,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),Y4(),eo(function(){var i=new Vy(r,e,n,!1);Q4(i.values_,qe,i);var a=new Proxy(i.values_,j7);return i.proxy_=a,t&&t.length&&i.spliceWithArray_(0,0,t),a})}var $d={clear:function(){return this.splice(0)},replace:function(e){var r=this[qe];return r.spliceWithArray_(0,r.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,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[qe];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(e);case 2:return o.spliceWithArray_(e,r)}return o.spliceWithArray_(e,r,i)},spliceWithArray:function(e,r,n){return this[qe].spliceWithArray_(e,r,n)},push:function(){for(var e=this[qe],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.spliceWithArray_(e.values_.length,0,n),e.values_.length},pop:function(){return this.splice(Math.max(this[qe].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[qe],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.spliceWithArray_(0,0,n),e.values_.length},reverse:function(){return Ee.trackingDerivation&&it(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Ee.trackingDerivation&&it(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var r=this[qe],n=r.dehanceValues_(r.values_).indexOf(e);return n>-1?(this.splice(n,1),!0):!1}};sr("concat",oa);sr("flat",oa);sr("includes",oa);sr("indexOf",oa);sr("join",oa);sr("lastIndexOf",oa);sr("slice",oa);sr("toString",oa);sr("toLocaleString",oa);sr("every",Ja);sr("filter",Ja);sr("find",Ja);sr("findIndex",Ja);sr("flatMap",Ja);sr("forEach",Ja);sr("map",Ja);sr("some",Ja);sr("reduce",KS);sr("reduceRight",KS);function sr(t,e){typeof Array.prototype[t]=="function"&&($d[t]=e(t))}function oa(t){return function(){var e=this[qe];e.atom_.reportObserved();var r=e.dehanceValues_(e.values_);return r[t].apply(r,arguments)}}function Ja(t){return function(e,r){var n=this,i=this[qe];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[t](function(o,l){return e.call(r,o,l,n)})}}function KS(t){return function(){var e=this,r=this[qe];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(a,o,l){return i(a,o,l,e)},n[t].apply(n,arguments)}}var F7=Za("ObservableArrayAdministration",Vy);function Wr(t){return Sh(t)&&F7(t[qe])}var XS,QS,z7={},La="add",Wd="delete";XS=Symbol.iterator;QS=Symbol.toStringTag;var Mh=function(){function t(r,n,i){var a=this;n===void 0&&(n=us),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[qe]=z7,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,yn(Map)||it(18),eo(function(){a.keysAtom_=Ku("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,r&&a.merge(r)})}var e=t.prototype;return e.has_=function(n){return this.data_.has(n)},e.has=function(n){var i=this;if(!Ee.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var o=a=new Io(this.has_(n),Eh,"ObservableMap.key?",!1);this.hasMap_.set(n,o),Dy(o,function(){return i.hasMap_.delete(n)})}return a.get()},e.set=function(n,i){var a=this.has_(n);if(Ln(this)){var o=jn(this,{type:a?Ai:La,object:this,newValue:i,name:n});if(!o)return this;i=o.newValue}return a?this.updateValue_(n,i):this.addValue_(n,i),this},e.delete=function(n){var i=this;if(this.keysAtom_,Ln(this)){var a=jn(this,{type:Wd,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=Tu(),l=ri(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Wd,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return wi(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var y=i.data_.get(n);y.setNewValue_(void 0),i.data_.delete(n)}),l&&ni(this,u),!0}return!1},e.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==Ee.UNCHANGED){var o=Tu(),l=ri(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Ai,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&ni(this,u)}},e.addValue_=function(n,i){var a=this;this.keysAtom_,wi(function(){var f,y=new Io(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,y),i=y.value_,(f=a.hasMap_.get(n))==null||f.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Tu(),l=ri(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:La,object:this,name:n,newValue:i}:null;l&&ni(this,u)},e.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var n=this,i=this.keys();return Ju({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:n.get(u)}}})},e.entries=function(){var n=this,i=this.keys();return Ju({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:[u,n.get(u)]}}})},e[XS]=function(){return this.entries()},e.forEach=function(n,i){for(var a=$l(this),o;!(o=a()).done;){var l=o.value,u=l[0],f=l[1];n.call(i,f,u,this)}},e.merge=function(n){var i=this;return Pr(n)&&(n=new Map(n)),wi(function(){ra(n)?eP(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)}):Ps(n)?(n.constructor!==Map&&it(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&it(20,n)}),this},e.clear=function(){var n=this;wi(function(){Ly(function(){for(var i=$l(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},e.replace=function(n){var i=this;return wi(function(){for(var a=B7(n),o=new Map,l=!1,u=$l(i.data_.keys()),f;!(f=u()).done;){var y=f.value;if(!a.has(y)){var b=i.delete(y);if(b)l=!0;else{var v=i.data_.get(y);o.set(y,v)}}}for(var h=$l(a.entries()),w;!(w=h()).done;){var E=w.value,S=E[0],_=E[1],p=i.data_.has(S);if(i.set(S,_),i.data_.has(S)){var d=i.data_.get(S);o.set(S,d),p||(l=!0)}}if(!l)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var g=i.data_.keys(),m=o.keys(),x=g.next(),P=m.next();!x.done;){if(x.value!==P.value){i.keysAtom_.reportChanged();break}x=g.next(),P=m.next()}i.data_=o}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(n,i){return bc(this,n)},e.intercept_=function(n){return yc(this,n)},Cy(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:QS,get:function(){return"Map"}}]),t}(),Pr=Za("ObservableMap",Mh);function B7(t){if(Ps(t)||Pr(t))return t;if(Array.isArray(t))return new Map(t);if(ra(t)){var e=new Map;for(var r in t)e.set(r,t[r]);return e}else return it(21,t)}var ZS,JS,U7={};ZS=Symbol.iterator;JS=Symbol.toStringTag;var qy=function(){function t(r,n,i){var a=this;n===void 0&&(n=us),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[qe]=U7,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,yn(Set)||it(22),this.enhancer_=function(o,l){return n(o,l,i)},eo(function(){a.atom_=Ku(a.name_),r&&a.replace(r)})}var e=t.prototype;return e.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.clear=function(){var n=this;wi(function(){Ly(function(){for(var i=$l(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},e.forEach=function(n,i){for(var a=$l(this),o;!(o=a()).done;){var l=o.value;n.call(i,l,l,this)}},e.add=function(n){var i=this;if(this.atom_,Ln(this)){var a=jn(this,{type:La,object:this,newValue:n});if(!a)return this}if(!this.has(n)){wi(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,l=ri(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:La,object:this,newValue:n}:null;l&&ni(this,u)}return this},e.delete=function(n){var i=this;if(Ln(this)){var a=jn(this,{type:Wd,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,l=ri(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:Wd,object:this,oldValue:n}:null;return wi(function(){i.atom_.reportChanged(),i.data_.delete(n)}),l&&ni(this,u),!0}return!1},e.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},e.entries=function(){var n=0,i=Array.from(this.keys()),a=Array.from(this.values());return Ju({next:function(){var l=n;return n+=1,l<a.length?{value:[i[l],a[l]],done:!1}:{done:!0}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var n=this,i=0,a=Array.from(this.data_.values());return Ju({next:function(){return i<a.length?{value:n.dehanceValue_(a[i++]),done:!1}:{done:!0}}})},e.replace=function(n){var i=this;return Vr(n)&&(n=new Set(n)),wi(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):pc(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&it("Cannot initialize set from "+n)}),this},e.observe_=function(n,i){return bc(this,n)},e.intercept_=function(n){return yc(this,n)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[ZS]=function(){return this.values()},Cy(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:JS,get:function(){return"Set"}}]),t}(),Vr=Za("ObservableSet",qy),D_=Object.create(null),F_="remove",e6=function(){function t(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=TP),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 vc("ObservableObject.keys"),this.isPlainObject_=ra(this.target_)}var e=t.prototype;return e.getObservablePropValue_=function(n){return this.values_.get(n).get()},e.setObservablePropValue_=function(n,i){var a=this.values_.get(n);if(a instanceof Xu)return a.set(i),!0;if(Ln(this)){var o=jn(this,{type:Ai,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Ee.UNCHANGED){var l=ri(this),u=!1,f=l||u?{type:Ai,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},e.get_=function(n){return Ee.trackingDerivation&&!Yi(this.target_,n)&&this.has_(n),this.target_[n]},e.set_=function(n,i,a){return a===void 0&&(a=!1),Yi(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)},e.has_=function(n){if(!Ee.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new Io(n in this.target_,Eh,"ObservableObject.key?",!1),this.pendingKeys_.set(n,i)),i.get()},e.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(n in this.target_)){var a;if((a=this.target_[Ei])!=null&&a[n])return;it(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==dc;){var l=Ud(o,n);if(l){var u=i.make_(this,n,l,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}B_(this,i,n)}},e.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&&B_(this,a,n),l},e.defineProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{nn();var o=this.delete_(n);if(!o)return o;if(Ln(this)){var l=jn(this,{object:this.proxy_||this.target_,name:n,type:La,newValue:i.value});if(!l)return null;var u=l.newValue;i.value!==u&&(i=Ho({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Pi(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{an()}return!0},e.defineObservableProperty_=function(n,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{nn();var l=this.delete_(n);if(!l)return l;if(Ln(this)){var u=jn(this,{object:this.proxy_||this.target_,name:n,type:La,newValue:i});if(!u)return null;i=u.newValue}var f=z_(n),y={configurable:Ee.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(o){if(!Reflect.defineProperty(this.target_,n,y))return!1}else Pi(this.target_,n,y);var b=new Io(i,a,"ObservableObject.key",!1);this.values_.set(n,b),this.notifyPropertyAddition_(n,b.value_)}finally{an()}return!0},e.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{nn();var o=this.delete_(n);if(!o)return o;if(Ln(this)){var l=jn(this,{object:this.proxy_||this.target_,name:n,type:La,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=z_(n),f={configurable:Ee.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,n,f))return!1}else Pi(this.target_,n,f);this.values_.set(n,new Xu(i)),this.notifyPropertyAddition_(n,void 0)}finally{an()}return!0},e.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!Yi(this.target_,n))return!0;if(Ln(this)){var a=jn(this,{object:this.proxy_||this.target_,name:n,type:F_});if(!a)return null}try{var o,l;nn();var u=ri(this),f=!1,y=this.values_.get(n),b=void 0;if(!y&&(u||f)){var v;b=(v=Ud(this.target_,n))==null?void 0:v.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(y&&(this.values_.delete(n),y instanceof Io&&(b=y.value_),OS(y)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(l=o.get(n))==null||l.set(n in this.target_),u||f){var h={type:F_,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:b,name:n};u&&ni(this,h)}}finally{an()}return!0},e.observe_=function(n,i){return bc(this,n)},e.intercept_=function(n){return yc(this,n)},e.notifyPropertyAddition_=function(n,i){var a,o,l=ri(this),u=!1;if(l||u){var f=l||u?{type:La,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()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),ss(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function _c(t,e){var r;if(Yi(t,qe))return t;var n=(r=e==null?void 0:e.name)!=null?r:"ObservableObject",i=new e6(t,new Map,String(n),zP(e));return hc(t,qe,i),t}var G7=Za("ObservableObjectAdministration",e6);function z_(t){return D_[t]||(D_[t]={get:function(){return this[qe].getObservablePropValue_(t)},set:function(r){return this[qe].setObservablePropValue_(t,r)}})}function yr(t){return Sh(t)?G7(t[qe]):!1}function B_(t,e,r){var n;(n=t.target_[Ei])==null||delete n[r]}var H7=r6(0),V7=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1}(),wv=0,t6=function(){};function q7(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):t.prototype.__proto__!==void 0?t.prototype.__proto__=e:t.prototype=e}q7(t6,Array.prototype);var $y=function(t,e,r){eS(n,t);function n(a,o,l,u){var f;return l===void 0&&(l="ObservableArray"),u===void 0&&(u=!1),f=t.call(this)||this,eo(function(){var y=new Vy(l,o,u,!0);y.proxy_=bv(f),Q4(bv(f),qe,y),a&&a.length&&f.spliceWithArray(0,0,a),V7&&Object.defineProperty(bv(f),"0",H7)}),f}var i=n.prototype;return i.concat=function(){this[qe].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 Wr(f)?f.slice():f}))},i[r]=function(){var a=this,o=0;return Ju({next:function(){return o<a.length?{value:a[o++],done:!1}:{done:!0,value:void 0}}})},Cy(n,[{key:"length",get:function(){return this[qe].getArrayLength_()},set:function(o){this[qe].setArrayLength_(o)}},{key:e,get:function(){return"Array"}}]),n}(t6,Symbol.toStringTag,Symbol.iterator);Object.entries($d).forEach(function(t){var e=t[0],r=t[1];e!=="concat"&&hc($y.prototype,e,r)});function r6(t){return{enumerable:!1,configurable:!0,get:function(){return this[qe].get_(t)},set:function(r){this[qe].set_(t,r)}}}function $7(t){Pi($y.prototype,""+t,r6(t))}function n6(t){if(t>wv){for(var e=wv;e<t+100;e++)$7(e);wv=t}}n6(1e3);function W7(t,e,r){return new $y(t,e,r)}function ki(t,e){if(typeof t=="object"&&t!==null){if(Wr(t))return e!==void 0&&it(23),t[qe].atom_;if(Vr(t))return t.atom_;if(Pr(t)){if(e===void 0)return t.keysAtom_;var r=t.data_.get(e)||t.hasMap_.get(e);return r||it(25,e,Yd(t)),r}if(yr(t)){if(!e)return it(26);var n=t[qe].values_.get(e);return n||it(27,e,Yd(t)),n}if(Ry(t)||$o(t)||qd(t))return t}else if(yn(t)&&qd(t[qe]))return t[qe];it(28)}function oi(t,e){if(t||it(29),e!==void 0)return oi(ki(t,e));if(Ry(t)||$o(t)||qd(t)||Pr(t)||Vr(t))return t;if(t[qe])return t[qe];it(24,t)}function Yd(t,e){var r;if(e!==void 0)r=ki(t,e);else{if(kh(t))return t.name;yr(t)||Pr(t)||Vr(t)?r=oi(t):r=ki(t)}return r.name_}function eo(t){var e=Zo(),r=xh(!0);nn();try{return t()}finally{an(),Ph(r),Ki(e)}}var U_=dc.toString;function Wy(t,e,r){return r===void 0&&(r=-1),_m(t,e,r)}function _m(t,e,r,n,i){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var a=typeof t;if(a!=="function"&&a!=="object"&&typeof e!="object")return!1;var o=U_.call(t);if(o!==U_.call(e))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":r>=0&&r++;break}t=G_(t),e=G_(e);var l=o==="[object Array]";if(!l){if(typeof t!="object"||typeof e!="object")return!1;var u=t.constructor,f=e.constructor;if(u!==f&&!(yn(u)&&u instanceof u&&yn(f)&&f instanceof f)&&"constructor"in t&&"constructor"in e)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var y=n.length;y--;)if(n[y]===t)return i[y]===e;if(n.push(t),i.push(e),l){if(y=t.length,y!==e.length)return!1;for(;y--;)if(!_m(t[y],e[y],r-1,n,i))return!1}else{var b=Object.keys(t),v;if(y=b.length,Object.keys(e).length!==y)return!1;for(;y--;)if(v=b[y],!(Yi(e,v)&&_m(t[v],e[v],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function G_(t){return Wr(t)?t.slice():Ps(t)||Pr(t)||pc(t)||Vr(t)?Array.from(t.entries()):t}function Ju(t){return t[Symbol.iterator]=Y7,t}function Y7(){return this}["Symbol","Map","Set"].forEach(function(t){var e=ky();typeof e[t]>"u"&&it("MobX requires global '"+t+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:PS,extras:{getDebugName:Yd},$mobx:qe});const K7=Object.freeze(Object.defineProperty({__proto__:null,$mobx:qe,FlowCancellationError:Th,ObservableMap:Mh,ObservableSet:qy,Reaction:cs,_allowStateChanges:My,_allowStateChangesInsideComputed:ds,_allowStateReadsEnd:es,_allowStateReadsStart:Ah,_autoAction:fs,_endAction:pS,_getAdministration:oi,_getGlobalState:_S,_interceptReads:zy,_isComputingDerivation:$P,_resetGlobalState:XP,_startAction:hS,action:rr,autorun:jy,comparer:Vo,computed:Qo,configure:DS,createAtom:Ku,defineProperty:Gy,entries:qS,extendObservable:Fy,flow:hs,flowResult:w7,get:P7,getAtom:ki,getDebugName:Yd,getDependencyTree:FS,getObserverTree:v7,has:$S,intercept:Ch,isAction:kh,isBoxedObservable:Iy,isComputed:O7,isComputedProp:GS,isFlow:Qu,isFlowCancellationError:b7,isObservable:Rh,isObservableArray:Wr,isObservableMap:Pr,isObservableObject:yr,isObservableProp:VS,isObservableSet:Vr,keys:Zu,makeAutoObservable:I7,makeObservable:Hy,observable:Pt,observe:Nh,onBecomeObserved:LS,onBecomeUnobserved:Dy,onReactionError:r7,override:dP,ownKeys:WS,reaction:IS,remove:x7,runInAction:ds,set:Uy,spy:PS,toJS:T7,trace:C7,transaction:wi,untracked:Ly,values:By,when:bm},Symbol.toStringTag,{value:"Module"}));if(!at.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!Hy)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function X7(t){t()}function i6(t){t||(t=X7),DS({reactionScheduler:t})}var Q7=function(){return!0};function Z7(t){return FS(t)}var a6=!1;function o6(t){a6=t}function Yy(){return a6}var J7=1e4,eA=1e4,tA=function(){function t(e){var r=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),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=J7),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(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,n){this.registrations.set(n,{value:r,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(t.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,eA))}}),t}(),rA=typeof FinalizationRegistry<"u"?FinalizationRegistry:tA,Kd=new rA(function(t){var e;(e=t.reaction)===null||e===void 0||e.dispose(),t.reaction=null}),l6={exports:{}},s6={};/**
34
+ * @license React
35
+ * use-sync-external-store-shim.production.min.js
36
+ *
37
+ * Copyright (c) Facebook, Inc. and its affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var ps=at;function nA(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var iA=typeof Object.is=="function"?Object.is:nA,aA=ps.useState,oA=ps.useEffect,lA=ps.useLayoutEffect,sA=ps.useDebugValue;function uA(t,e){var r=e(),n=aA({inst:{value:r,getSnapshot:e}}),i=n[0].inst,a=n[1];return lA(function(){i.value=r,i.getSnapshot=e,Sv(i)&&a({inst:i})},[t,r,e]),oA(function(){return Sv(i)&&a({inst:i}),t(function(){Sv(i)&&a({inst:i})})},[t]),sA(r),r}function Sv(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!iA(t,r)}catch{return!0}}function cA(t,e){return e()}var fA=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?cA:uA;s6.useSyncExternalStore=ps.useSyncExternalStore!==void 0?ps.useSyncExternalStore:fA;l6.exports=s6;var dA=l6.exports,hA=function(){};function H_(t){t.reaction=new cs("observer".concat(t.name),function(){var e;t.stateVersion=Symbol(),(e=t.onStoreChange)===null||e===void 0||e.call(t)})}function Ky(t,e){if(e===void 0&&(e="observed"),Yy())return t();var r=dt.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:e,subscribe:function(l){return Kd.unregister(n),n.onStoreChange=l,n.reaction||(H_(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||(H_(i),Kd.register(r,i,i)),dt.useDebugValue(i.reaction,Z7),dA.useSyncExternalStore(i.subscribe,i.getSnapshot,hA);var a,o;if(i.reaction.track(function(){try{a=t()}catch(l){o=l}}),o)throw o;return a}var u6=typeof Symbol=="function"&&Symbol.for,V_=u6?Symbol.for("react.forward_ref"):typeof at.forwardRef=="function"&&at.forwardRef(function(t){return null}).$$typeof,q_=u6?Symbol.for("react.memo"):typeof at.memo=="function"&&at.memo(function(t){return null}).$$typeof;function pA(t,e){var r;if(q_&&t.$$typeof===q_)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(Yy())return t;var n=(r=e==null?void 0:e.forwardRef)!==null&&r!==void 0?r:!1,i=t,a=t.displayName||t.name;if(V_&&t.$$typeof===V_&&(n=!0,i=t.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(l,u){return Ky(function(){return i(l,u)},a)};return o.displayName=t.displayName,Object.defineProperty(o,"name",{value:t.name,writable:!0,configurable:!0}),t.contextTypes&&(o.contextTypes=t.contextTypes),n&&(o=at.forwardRef(o)),o=at.memo(o),vA(t,o),o}var gA={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function vA(t,e){Object.keys(t).forEach(function(r){gA[r]||Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}function c6(t){var e=t.children,r=t.render,n=e||r;return typeof n!="function"?null:Ky(n)}c6.displayName="Observer";function mA(t,e){return at.useState(function(){return Pt(t(),e,{autoBind:!0})})[0]}var yA=globalThis&&globalThis.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >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 f6(t){var e=yA(at.useState(function(){return Pt(t,{},{deep:!1})}),1),r=e[0];return ds(function(){Object.assign(r,t)}),r}function bA(t,e){var r=e&&f6(e);return at.useState(function(){return Pt(t(r),void 0,{autoBind:!0})})[0]}var Ev;i6(q4.unstable_batchedUpdates);var _A=(Ev=Kd.finalizeAllImmediately)!==null&&Ev!==void 0?Ev:function(){};function wA(t,e){return e===void 0&&(e="observed"),Ky(t,e)}function SA(t){o6(t)}const EA=Object.freeze(Object.defineProperty({__proto__:null,Observer:c6,_observerFinalizationRegistry:Kd,clearTimers:_A,enableStaticRendering:o6,isObserverBatched:Q7,isUsingStaticRendering:Yy,observer:pA,observerBatching:i6,useAsObservableSource:f6,useLocalObservable:mA,useLocalStore:bA,useObserver:wA,useStaticRendering:SA},Symbol.toStringTag,{value:"Module"})),Ti=Ya(EA);var d6={};const la=Ya(K7);var Xy={exports:{}},Ih={},Xd={},lt={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._registerNode=t.Konva=t.glob=void 0;const e=Math.PI/180;function r(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}t.glob=typeof ye<"u"?ye:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},t.Konva={_global:t.glob,version:"9.2.2",isBrowser:r(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return t.Konva.angleDeg?i*e: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 t.Konva.DD.isDragging},isDragReady(){return!!t.Konva.DD.node},releaseCanvasOnDestroy:!0,document:t.glob.document,_injectGlobal(i){t.glob.Konva=i}};const n=i=>{t.Konva[i.prototype.getClassName()]=i};t._registerNode=n,t.Konva._injectGlobal(t.Konva)})(lt);var $t={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Util=t.Transform=void 0;const e=lt;class r{constructor(g=[1,0,0,1,0,0]){this.dirty=!1,this.m=g&&g.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(g){g.m[0]=this.m[0],g.m[1]=this.m[1],g.m[2]=this.m[2],g.m[3]=this.m[3],g.m[4]=this.m[4],g.m[5]=this.m[5]}point(g){var m=this.m;return{x:m[0]*g.x+m[2]*g.y+m[4],y:m[1]*g.x+m[3]*g.y+m[5]}}translate(g,m){return this.m[4]+=this.m[0]*g+this.m[2]*m,this.m[5]+=this.m[1]*g+this.m[3]*m,this}scale(g,m){return this.m[0]*=g,this.m[1]*=g,this.m[2]*=m,this.m[3]*=m,this}rotate(g){var m=Math.cos(g),x=Math.sin(g),P=this.m[0]*m+this.m[2]*x,O=this.m[1]*m+this.m[3]*x,R=this.m[0]*-x+this.m[2]*m,T=this.m[1]*-x+this.m[3]*m;return this.m[0]=P,this.m[1]=O,this.m[2]=R,this.m[3]=T,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(g,m){var x=this.m[0]+this.m[2]*m,P=this.m[1]+this.m[3]*m,O=this.m[2]+this.m[0]*g,R=this.m[3]+this.m[1]*g;return this.m[0]=x,this.m[1]=P,this.m[2]=O,this.m[3]=R,this}multiply(g){var m=this.m[0]*g.m[0]+this.m[2]*g.m[1],x=this.m[1]*g.m[0]+this.m[3]*g.m[1],P=this.m[0]*g.m[2]+this.m[2]*g.m[3],O=this.m[1]*g.m[2]+this.m[3]*g.m[3],R=this.m[0]*g.m[4]+this.m[2]*g.m[5]+this.m[4],T=this.m[1]*g.m[4]+this.m[3]*g.m[5]+this.m[5];return this.m[0]=m,this.m[1]=x,this.m[2]=P,this.m[3]=O,this.m[4]=R,this.m[5]=T,this}invert(){var g=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),m=this.m[3]*g,x=-this.m[1]*g,P=-this.m[2]*g,O=this.m[0]*g,R=g*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),T=g*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=m,this.m[1]=x,this.m[2]=P,this.m[3]=O,this.m[4]=R,this.m[5]=T,this}getMatrix(){return this.m}decompose(){var g=this.m[0],m=this.m[1],x=this.m[2],P=this.m[3],O=this.m[4],R=this.m[5],T=g*P-m*x;let C={x:O,y:R,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(g!=0||m!=0){var N=Math.sqrt(g*g+m*m);C.rotation=m>0?Math.acos(g/N):-Math.acos(g/N),C.scaleX=N,C.scaleY=T/N,C.skewX=(g*x+m*P)/T,C.skewY=0}else if(x!=0||P!=0){var F=Math.sqrt(x*x+P*P);C.rotation=Math.PI/2-(P>0?Math.acos(-x/F):-Math.acos(x/F)),C.scaleX=T/F,C.scaleY=F,C.skewX=0,C.skewY=(g*x+m*P)/T}return C.rotation=t.Util._getRotation(C.rotation),C}}t.Transform=r;var n="[object Array]",i="[object Number]",a="[object String]",o="[object Boolean]",l=Math.PI/180,u=180/Math.PI,f="#",y="",b="0",v="Konva warning: ",h="Konva error: ",w="rgb(",E={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]},S=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,_=[];const p=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(d){setTimeout(d,60)};t.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 g=d[0];return g==="#"||g==="."||g===g.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){_.push(d),_.length===1&&p(function(){const g=_;_=[],g.forEach(function(m){m()})})},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,g){var m=t.Util.createImageElement();m.onload=function(){g(m)},m.src=d},_rgbToHex(d,g,m){return((1<<24)+(d<<16)+(g<<8)+m).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,y);var g=parseInt(d,16);return{r:g>>16&255,g:g>>8&255,b:g&255}},getRandomColor(){for(var d=(Math.random()*16777215<<0).toString(16);d.length<6;)d=b+d;return f+d},getRGB(d){var g;return d in E?(g=E[d],{r:g[0],g:g[1],b:g[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===w?(g=S.exec(d.replace(/ /g,"")),{r:parseInt(g[1],10),g:parseInt(g[2],10),b:parseInt(g[3],10)}):{r:0,g:0,b:0}},colorToRGBA(d){return d=d||"black",t.Util._namedColorToRBA(d)||t.Util._hex3ColorToRGBA(d)||t.Util._hex4ColorToRGBA(d)||t.Util._hex6ColorToRGBA(d)||t.Util._hex8ColorToRGBA(d)||t.Util._rgbColorToRGBA(d)||t.Util._rgbaColorToRGBA(d)||t.Util._hslColorToRGBA(d)},_namedColorToRBA(d){var g=E[d.toLowerCase()];return g?{r:g[0],g:g[1],b:g[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];var g=d.split(/ *, */).map(Number);return{r:g[0],g:g[1],b:g[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];var g=d.split(/ *, */).map((m,x)=>m.slice(-1)==="%"?x===3?parseInt(m)/100:parseInt(m)/100*255:Number(m));return{r:g[0],g:g[1],b:g[2],a:g[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[g,...m]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),x=Number(m[0])/360,P=Number(m[1])/100,O=Number(m[2])/100;let R,T,C;if(P===0)return C=O*255,{r:Math.round(C),g:Math.round(C),b:Math.round(C),a:1};O<.5?R=O*(1+P):R=O+P-O*P;const N=2*O-R,F=[0,0,0];for(let H=0;H<3;H++)T=x+1/3*-(H-1),T<0&&T++,T>1&&T--,6*T<1?C=N+(R-N)*6*T:2*T<1?C=R:3*T<2?C=N+(R-N)*(2/3-T)*6:C=N,F[H]=C*255;return{r:Math.round(F[0]),g:Math.round(F[1]),b:Math.round(F[2]),a:1}}},haveIntersection(d,g){return!(g.x>d.x+d.width||g.x+g.width<d.x||g.y>d.y+d.height||g.y+g.height<d.y)},cloneObject(d){var g={};for(var m in d)this._isPlainObject(d[m])?g[m]=this.cloneObject(d[m]):this._isArray(d[m])?g[m]=this.cloneArray(d[m]):g[m]=d[m];return g},cloneArray(d){return d.slice(0)},degToRad(d){return d*l},radToDeg(d){return d*u},_degToRad(d){return t.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),t.Util.degToRad(d)},_radToDeg(d){return t.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),t.Util.radToDeg(d)},_getRotation(d){return e.Konva.angleDeg?t.Util.radToDeg(d):d},_capitalize(d){return d.charAt(0).toUpperCase()+d.slice(1)},throw(d){throw new Error(h+d)},error(d){console.error(h+d)},warn(d){e.Konva.showWarnings&&console.warn(v+d)},each(d,g){for(var m in d)g(m,d[m])},_inRange(d,g,m){return g<=d&&d<m},_getProjectionToSegment(d,g,m,x,P,O){var R,T,C,N=(d-m)*(d-m)+(g-x)*(g-x);if(N==0)R=d,T=g,C=(P-m)*(P-m)+(O-x)*(O-x);else{var F=((P-d)*(m-d)+(O-g)*(x-g))/N;F<0?(R=d,T=g,C=(d-P)*(d-P)+(g-O)*(g-O)):F>1?(R=m,T=x,C=(m-P)*(m-P)+(x-O)*(x-O)):(R=d+F*(m-d),T=g+F*(x-g),C=(R-P)*(R-P)+(T-O)*(T-O))}return[R,T,C]},_getProjectionToLine(d,g,m){var x=t.Util.cloneObject(d),P=Number.MAX_VALUE;return g.forEach(function(O,R){if(!(!m&&R===g.length-1)){var T=g[(R+1)%g.length],C=t.Util._getProjectionToSegment(O.x,O.y,T.x,T.y,d.x,d.y),N=C[0],F=C[1],H=C[2];H<P&&(x.x=N,x.y=F,P=H)}}),x},_prepareArrayForTween(d,g,m){var x,P=[],O=[];if(d.length>g.length){var R=g;g=d,d=R}for(x=0;x<d.length;x+=2)P.push({x:d[x],y:d[x+1]});for(x=0;x<g.length;x+=2)O.push({x:g[x],y:g[x+1]});var T=[];return O.forEach(function(C){var N=t.Util._getProjectionToLine(C,P,m);T.push(N.x),T.push(N.y)}),T},_prepareToStringify(d){var g;d.visitedByCircularReferenceRemoval=!0;for(var m in d)if(d.hasOwnProperty(m)&&d[m]&&typeof d[m]=="object"){if(g=Object.getOwnPropertyDescriptor(d,m),d[m].visitedByCircularReferenceRemoval||t.Util._isElement(d[m]))if(g.configurable)delete d[m];else return null;else if(t.Util._prepareToStringify(d[m])===null)if(g.configurable)delete d[m];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,g){for(var m in g)d[m]=g[m];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){e.Konva.releaseCanvasOnDestroy&&d.forEach(g=>{g.width=0,g.height=0})},drawRoundedRectPath(d,g,m,x){let P=0,O=0,R=0,T=0;typeof x=="number"?P=O=R=T=Math.min(x,g/2,m/2):(P=Math.min(x[0]||0,g/2,m/2),O=Math.min(x[1]||0,g/2,m/2),T=Math.min(x[2]||0,g/2,m/2),R=Math.min(x[3]||0,g/2,m/2)),d.moveTo(P,0),d.lineTo(g-O,0),d.arc(g-O,O,O,Math.PI*3/2,0,!1),d.lineTo(g,m-T),d.arc(g-T,m-T,T,0,Math.PI/2,!1),d.lineTo(R,m),d.arc(R,m-R,R,Math.PI/2,Math.PI,!1),d.lineTo(0,P),d.arc(P,P,P,Math.PI,Math.PI*3/2,!1)}}})($t);var Bt={},st={},Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.getComponentValidator=Ve.getBooleanValidator=Ve.getNumberArrayValidator=Ve.getFunctionValidator=Ve.getStringOrGradientValidator=Ve.getStringValidator=Ve.getNumberOrAutoValidator=Ve.getNumberOrArrayOfNumbersValidator=Ve.getNumberValidator=Ve.alphaComponent=Ve.RGBComponent=void 0;const sa=lt,Kt=$t;function ua(t){return Kt.Util._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||Kt.Util._isBoolean(t)?t:Object.prototype.toString.call(t)}function OA(t){return t>255?255:t<0?0:Math.round(t)}Ve.RGBComponent=OA;function xA(t){return t>1?1:t<1e-4?1e-4:t}Ve.alphaComponent=xA;function PA(){if(sa.Konva.isUnminified)return function(t,e){return Kt.Util._isNumber(t)||Kt.Util.warn(ua(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}Ve.getNumberValidator=PA;function AA(t){if(sa.Konva.isUnminified)return function(e,r){let n=Kt.Util._isNumber(e),i=Kt.Util._isArray(e)&&e.length==t;return!n&&!i&&Kt.Util.warn(ua(e)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+t+")"),e}}Ve.getNumberOrArrayOfNumbersValidator=AA;function kA(){if(sa.Konva.isUnminified)return function(t,e){var r=Kt.Util._isNumber(t),n=t==="auto";return r||n||Kt.Util.warn(ua(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}Ve.getNumberOrAutoValidator=kA;function TA(){if(sa.Konva.isUnminified)return function(t,e){return Kt.Util._isString(t)||Kt.Util.warn(ua(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}Ve.getStringValidator=TA;function CA(){if(sa.Konva.isUnminified)return function(t,e){const r=Kt.Util._isString(t),n=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return r||n||Kt.Util.warn(ua(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}Ve.getStringOrGradientValidator=CA;function RA(){if(sa.Konva.isUnminified)return function(t,e){return Kt.Util._isFunction(t)||Kt.Util.warn(ua(t)+' is a not valid value for "'+e+'" attribute. The value should be a function.'),t}}Ve.getFunctionValidator=RA;function NA(){if(sa.Konva.isUnminified)return function(t,e){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&t instanceof r||(Kt.Util._isArray(t)?t.forEach(function(n){Kt.Util._isNumber(n)||Kt.Util.warn('"'+e+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):Kt.Util.warn(ua(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}Ve.getNumberArrayValidator=NA;function MA(){if(sa.Konva.isUnminified)return function(t,e){var r=t===!0||t===!1;return r||Kt.Util.warn(ua(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}Ve.getBooleanValidator=MA;function IA(t){if(sa.Konva.isUnminified)return function(e,r){return e==null||Kt.Util.isObject(e)||Kt.Util.warn(ua(e)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+t),e}}Ve.getComponentValidator=IA;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Factory=void 0;const e=$t,r=Ve;var n="get",i="set";t.Factory={addGetterSetter(a,o,l,u,f){t.Factory.addGetter(a,o,l),t.Factory.addSetter(a,o,u,f),t.Factory.addOverloadedGetterSetter(a,o)},addGetter(a,o,l){var u=n+e.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+e.Util._capitalize(o);a.prototype[f]||t.Factory.overWriteSetter(a,o,l,u)},overWriteSetter(a,o,l,u){var f=i+e.Util._capitalize(o);a.prototype[f]=function(y){return l&&y!==void 0&&y!==null&&(y=l.call(this,y,o)),this._setAttr(o,y),u&&u.call(this),this}},addComponentsGetterSetter(a,o,l,u,f){var y=l.length,b=e.Util._capitalize,v=n+b(o),h=i+b(o),w,E;a.prototype[v]=function(){var _={};for(w=0;w<y;w++)E=l[w],_[E]=this.getAttr(o+b(E));return _};var S=(0,r.getComponentValidator)(l);a.prototype[h]=function(_){var p=this.attrs[o],d;u&&(_=u.call(this,_)),S&&S.call(this,_,o);for(d in _)_.hasOwnProperty(d)&&this._setAttr(o+b(d),_[d]);return _||l.forEach(g=>{this._setAttr(o+b(g),void 0)}),this._fireChangeEvent(o,p,_),f&&f.call(this),this},t.Factory.addOverloadedGetterSetter(a,o)},addOverloadedGetterSetter(a,o){var l=e.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){e.Util.error("Adding deprecated "+o);var f=n+e.Util._capitalize(o),y=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[f]=function(){e.Util.error(y);var b=this.attrs[o];return b===void 0?l:b},t.Factory.addSetter(a,o,u,function(){e.Util.error(y)}),t.Factory.addOverloadedGetterSetter(a,o)},backCompat(a,o){e.Util.each(o,function(l,u){var f=a.prototype[u],y=n+e.Util._capitalize(l),b=i+e.Util._capitalize(l);function v(){f.apply(this,arguments),e.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}a.prototype[l]=v,a.prototype[y]=v,a.prototype[b]=v})},afterSetFilter(){this._filterUpToDate=!1}}})(st);var ii={},Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.HitContext=Xi.SceneContext=Xi.Context=void 0;const h6=$t,LA=lt;function jA(t){var e=[],r=t.length,n=h6.Util,i,a;for(i=0;i<r;i++)a=t[i],n._isNumber(a)?a=Math.round(a*1e3)/1e3:n._isString(a)||(a=a+""),e.push(a);return e}var $_=",",DA="(",FA=")",zA="([",BA="])",UA=";",GA="()",HA="=",W_=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],VA=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const qA=100;class Lh{constructor(e){this.canvas=e,LA.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,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,e?a+=GA:h6.Util._isArray(f[0])?a+=zA+f.join($_)+BA:(r&&(f=f.map(y=>typeof y=="number"?Math.floor(y):y)),a+=DA+f.join($_)+FA)):(a+=l.property,e||(a+=HA+l.val)),a+=UA;return a}clearTrace(){this.traceArr=[]}_trace(e){var r=this.traceArr,n;r.push(e),n=r.length,n>=qA&&r.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var r=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,r.getWidth()/r.pixelRatio,r.getHeight()/r.pixelRatio)}_applyLineCap(e){const r=e.attrs.lineCap;r&&this.setAttr("lineCap",r)}_applyOpacity(e){var r=e.getAbsoluteOpacity();r!==1&&this.setAttr("globalAlpha",r)}_applyLineJoin(e){const r=e.attrs.lineJoin;r&&this.setAttr("lineJoin",r)}setAttr(e,r){this._context[e]=r}arc(e,r,n,i,a,o){this._context.arc(e,r,n,i,a,o)}arcTo(e,r,n,i,a){this._context.arcTo(e,r,n,i,a)}beginPath(){this._context.beginPath()}bezierCurveTo(e,r,n,i,a,o){this._context.bezierCurveTo(e,r,n,i,a,o)}clearRect(e,r,n,i){this._context.clearRect(e,r,n,i)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,r){var n=arguments;if(n.length===2)return this._context.createImageData(e,r);if(n.length===1)return this._context.createImageData(e)}createLinearGradient(e,r,n,i){return this._context.createLinearGradient(e,r,n,i)}createPattern(e,r){return this._context.createPattern(e,r)}createRadialGradient(e,r,n,i,a,o){return this._context.createRadialGradient(e,r,n,i,a,o)}drawImage(e,r,n,i,a,o,l,u,f){var y=arguments,b=this._context;y.length===3?b.drawImage(e,r,n):y.length===5?b.drawImage(e,r,n,i,a):y.length===9&&b.drawImage(e,r,n,i,a,o,l,u,f)}ellipse(e,r,n,i,a,o,l,u){this._context.ellipse(e,r,n,i,a,o,l,u)}isPointInPath(e,r,n,i){return n?this._context.isPointInPath(n,e,r,i):this._context.isPointInPath(e,r,i)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,r,n,i){this._context.fillRect(e,r,n,i)}strokeRect(e,r,n,i){this._context.strokeRect(e,r,n,i)}fillText(e,r,n,i){i?this._context.fillText(e,r,n,i):this._context.fillText(e,r,n)}measureText(e){return this._context.measureText(e)}getImageData(e,r,n,i){return this._context.getImageData(e,r,n,i)}lineTo(e,r){this._context.lineTo(e,r)}moveTo(e,r){this._context.moveTo(e,r)}rect(e,r,n,i){this._context.rect(e,r,n,i)}putImageData(e,r,n){this._context.putImageData(e,r,n)}quadraticCurveTo(e,r,n,i){this._context.quadraticCurveTo(e,r,n,i)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,r){this._context.scale(e,r)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,r,n,i,a,o){this._context.setTransform(e,r,n,i,a,o)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,r,n,i){this._context.strokeText(e,r,n,i)}transform(e,r,n,i,a,o){this._context.transform(e,r,n,i,a,o)}translate(e,r){this._context.translate(e,r)}_enableTrace(){var e=this,r=W_.length,n=this.setAttr,i,a,o=function(l){var u=e[l],f;e[l]=function(){return a=jA(Array.prototype.slice.call(arguments,0)),f=u.apply(e,arguments),e._trace({method:l,args:a}),f}};for(i=0;i<r;i++)o(W_[i]);e.setAttr=function(){n.apply(e,arguments);var l=arguments[0],u=arguments[1];(l==="shadowOffsetX"||l==="shadowOffsetY"||l==="shadowBlur")&&(u=u/this.canvas.getPixelRatio()),e._trace({property:l,val:u})}}_applyGlobalCompositeOperation(e){const r=e.attrs.globalCompositeOperation;var n=!r||r==="source-over";n||this.setAttr("globalCompositeOperation",r)}}Xi.Context=Lh;VA.forEach(function(t){Object.defineProperty(Lh.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class $A extends Lh{constructor(e,{willReadFrequently:r=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:r})}_fillColor(e){var r=e.fill();this.setAttr("fillStyle",r),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){var r=e._getLinearGradient();r&&(this.setAttr("fillStyle",r),e._fillFunc(this))}_fillRadialGradient(e){const r=e._getRadialGradient();r&&(this.setAttr("fillStyle",r),e._fillFunc(this))}_fill(e){const r=e.fill(),n=e.getFillPriority();if(r&&n==="color"){this._fillColor(e);return}const i=e.getFillPatternImage();if(i&&n==="pattern"){this._fillPattern(e);return}const a=e.getFillLinearGradientColorStops();if(a&&n==="linear-gradient"){this._fillLinearGradient(e);return}const o=e.getFillRadialGradientColorStops();if(o&&n==="radial-gradient"){this._fillRadialGradient(e);return}r?this._fillColor(e):i?this._fillPattern(e):a?this._fillLinearGradient(e):o&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const r=e.getStrokeLinearGradientStartPoint(),n=e.getStrokeLinearGradientEndPoint(),i=e.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(e){var r=e.dash(),n=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!n){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(e),r&&e.dashEnabled()&&(this.setLineDash(r),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var a=e.getStrokeLinearGradientColorStops();a?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),n||this.restore()}}_applyShadow(e){var r,n,i,a=(r=e.getShadowRGBA())!==null&&r!==void 0?r:"black",o=(n=e.getShadowBlur())!==null&&n!==void 0?n:5,l=(i=e.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},u=e.getAbsoluteScale(),f=this.canvas.getPixelRatio(),y=u.x*f,b=u.y*f;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(y),Math.abs(b))),this.setAttr("shadowOffsetX",l.x*y),this.setAttr("shadowOffsetY",l.y*b)}}Xi.SceneContext=$A;class WA extends Lh{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const a=e.getStrokeScaleEnabled();if(!a){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(e);var n=e.hitStrokeWidth(),i=n==="auto"?e.strokeWidth():n;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),a||this.restore()}}}Xi.HitContext=WA;Object.defineProperty(ii,"__esModule",{value:!0});ii.HitCanvas=ii.SceneCanvas=ii.Canvas=void 0;const Qd=$t,p6=Xi,g6=lt,YA=st,KA=Ve;var $f;function XA(){if($f)return $f;var t=Qd.Util.createCanvasElement(),e=t.getContext("2d");return $f=function(){var r=g6.Konva._global.devicePixelRatio||1,n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return r/n}(),Qd.Util.releaseCanvas(t),$f}class jh{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var r=e||{},n=r.pixelRatio||g6.Konva.pixelRatio||XA();this.pixelRatio=n,this._canvas=Qd.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(e){var r=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/r,this.getHeight()/r)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";var r=this.pixelRatio,n=this.getContext()._context;n.scale(r,r)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";var r=this.pixelRatio,n=this.getContext()._context;n.scale(r,r)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,r){this.setWidth(e||0),this.setHeight(r||0)}toDataURL(e,r){try{return this._canvas.toDataURL(e,r)}catch{try{return this._canvas.toDataURL()}catch(i){return Qd.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}ii.Canvas=jh;YA.Factory.addGetterSetter(jh,"pixelRatio",void 0,(0,KA.getNumberValidator)());class QA extends jh{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new p6.SceneContext(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}ii.SceneCanvas=QA;class ZA extends jh{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new p6.HitContext(this),this.setSize(e.width,e.height)}}ii.HitCanvas=ZA;var Dh={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DD=void 0;const e=lt,r=$t;t.DD={get isDragging(){var n=!1;return t.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){var n;return t.DD._dragElements.forEach(i=>{n=i.node}),n},_dragElements:new Map,_drag(n){const i=[];t.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(v=>v.id===a.pointerId);if(f){if(a.dragStatus!=="dragging"){var y=l.dragDistance(),b=Math.max(Math.abs(f.x-a.startPointerPos.x),Math.abs(f.y-a.startPointerPos.y));if(b<y||(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=[];t.DD._dragElements.forEach(a=>{const{node:o}=a,l=o.getStage();if(n&&l.setPointersPositions(n),!l._changedPointerPositions.find(y=>y.id===a.pointerId))return;(a.dragStatus==="dragging"||a.dragStatus==="stopped")&&(t.DD.justDragged=!0,e.Konva._mouseListenClick=!1,e.Konva._touchListenClick=!1,e.Konva._pointerListenClick=!1,a.dragStatus="stopped");const f=a.node.getLayer()||a.node instanceof e.Konva.Stage&&a.node;f&&i.indexOf(f)===-1&&i.push(f)}),i.forEach(a=>{a.draw()})},_endDragAfter(n){t.DD._dragElements.forEach((i,a)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:n},!0),i.dragStatus!=="dragging"&&t.DD._dragElements.delete(a)})}},e.Konva.isBrowser&&(window.addEventListener("mouseup",t.DD._endDragBefore,!0),window.addEventListener("touchend",t.DD._endDragBefore,!0),window.addEventListener("mousemove",t.DD._drag),window.addEventListener("touchmove",t.DD._drag),window.addEventListener("mouseup",t.DD._endDragAfter,!1),window.addEventListener("touchend",t.DD._endDragAfter,!1))})(Dh);Object.defineProperty(Bt,"__esModule",{value:!0});Bt.Node=void 0;const ft=$t,wc=st,Wf=ii,So=lt,Nn=Dh,Jt=Ve;var pd="absoluteOpacity",Yf="allEventListeners",Gi="absoluteTransform",Y_="absoluteScale",Eo="canvas",JA="Change",ek="children",tk="konva",wm="listening",K_="mouseenter",X_="mouseleave",Q_="set",Z_="Shape",gd=" ",J_="stage",Aa="transform",rk="Stage",Sm="visible",nk=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(gd);let ik=1,nt=class Em{constructor(e){this._id=ik++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===Aa||e===Gi)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,r){var n=this._cache.get(e),i=e===Aa||e===Gi,a=n===void 0||i&&n.dirty===!0;return a&&(n=r.call(this),this._cache.set(e,n)),n}_calculate(e,r,n){if(!this._attachedDepsListeners.get(e)){const i=r.map(a=>a+"Change.konva").join(gd);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(Eo)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===Gi&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Eo)){const{scene:e,filter:r,hit:n}=this._cache.get(Eo);ft.Util.releaseCanvas(e,r,n),this._cache.delete(Eo)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var r=e||{},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,y=r.drawBorder||!1,b=r.hitCanvasPixelRatio||1;if(!i||!a){ft.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=f*2+1,a+=f*2+1,l-=f,u-=f;var v=new Wf.SceneCanvas({pixelRatio:o,width:i,height:a}),h=new Wf.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),w=new Wf.HitCanvas({pixelRatio:b,width:i,height:a}),E=v.getContext(),S=w.getContext();return w.isCache=!0,v.isCache=!0,this._cache.delete(Eo),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(v.getContext()._context.imageSmoothingEnabled=!1,h.getContext()._context.imageSmoothingEnabled=!1),E.save(),S.save(),E.translate(-l,-u),S.translate(-l,-u),this._isUnderCache=!0,this._clearSelfAndDescendantCache(pd),this._clearSelfAndDescendantCache(Y_),this.drawScene(v,this),this.drawHit(w,this),this._isUnderCache=!1,E.restore(),S.restore(),y&&(E.save(),E.beginPath(),E.rect(0,0,i,a),E.closePath(),E.setAttr("strokeStyle","red"),E.setAttr("lineWidth",5),E.stroke(),E.restore()),this._cache.set(Eo,{scene:v,filter:h,hit:w,x:l,y:u}),this._requestDraw(),this}isCached(){return this._cache.has(Eo)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,r){var n=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],i=1/0,a=1/0,o=-1/0,l=-1/0,u=this.getAbsoluteTransform(r);return n.forEach(function(f){var y=u.point(f);i===void 0&&(i=o=y.x,a=l=y.y),i=Math.min(i,y.x),a=Math.min(a,y.y),o=Math.max(o,y.x),l=Math.max(l,y.y)}),{x:i,y:a,width:o-i,height:l-a}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const r=this._getCanvasCache();e.translate(r.x,r.y);var n=this._getCachedSceneCanvas(),i=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/i,n.height/i),e.restore()}_drawCachedHitCanvas(e){var r=this._getCanvasCache(),n=r.hit;e.save(),e.translate(r.x,r.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e=this.filters(),r=this._getCanvasCache(),n=r.scene,i=r.filter,a=i.getContext(),o,l,u,f;if(e){if(!this._filterUpToDate){var y=n.pixelRatio;i.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio);try{for(o=e.length,a.clear(),a.drawImage(n._canvas,0,0,n.getWidth()/y,n.getHeight()/y),l=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++){if(f=e[u],typeof f!="function"){ft.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(b){ft.Util.error("Unable to apply filter. "+b.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return n}on(e,r){if(this._cache&&this._cache.delete(Yf),arguments.length===3)return this._delegate.apply(this,arguments);var n=e.split(gd),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(e,r){var n=(e||"").split(gd),i=n.length,a,o,l,u,f,y;if(this._cache&&this._cache.delete(Yf),!e)for(o in this.eventListeners)this._off(o);for(a=0;a<i;a++)if(l=n[a],u=l.split("."),f=u[0],y=u[1],f)this.eventListeners[f]&&this._off(f,y,r);else for(o in this.eventListeners)this._off(o,y,r);return this}dispatchEvent(e){var r={target:this,type:e.type,evt:e};return this.fire(e.type,r),this}addEventListener(e,r){return this.on(e,function(n){r.call(this,n.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,r,n){var i=this;this.on(e,function(a){for(var o=a.target.findAncestors(r,!0,i),l=0;l<o.length;l++)a=ft.Util.cloneObject(a),a.currentTarget=o[l],n.call(o[l],a)})}remove(){return this.isDragging()&&this.stopDrag(),Nn.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Gi),this._clearSelfAndDescendantCache(pd),this._clearSelfAndDescendantCache(Y_),this._clearSelfAndDescendantCache(J_),this._clearSelfAndDescendantCache(Sm),this._clearSelfAndDescendantCache(wm)}_remove(){this._clearCaches();var e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){var r="get"+ft.Util._capitalize(e);return ft.Util._isFunction(this[r])?this[r]():this.attrs[e]}getAncestors(){for(var e=this.getParent(),r=[];e;)r.push(e),e=e.getParent();return r}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{var r,n;if(!e)return this;for(r in e)r!==ek&&(n=Q_+ft.Util._capitalize(r),ft.Util._isFunction(this[n])?this[n](e[r]):this._setAttr(r,e[r]))}),this}isListening(){return this._getCache(wm,this._isListening)}_isListening(e){if(!this.listening())return!1;const n=this.getParent();return n&&n!==e&&this!==e?n._isListening(e):!0}isVisible(){return this._getCache(Sm,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const n=this.getParent();return n&&n!==e&&this!==e?n._isVisible(e):!0}shouldDrawHit(e,r=!1){if(e)return this._isVisible(e)&&this._isListening(e);var n=this.getLayer(),i=!1;Nn.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(i=!0)});var a=!r&&!So.Konva.hitOnDragEnabled&&i;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 e=this.getDepth(),r=this,n=0,i,a,o,l;function u(y){for(i=[],a=y.length,o=0;o<a;o++)l=y[o],n++,l.nodeType!==Z_&&(i=i.concat(l.getChildren().slice())),l._id===r._id&&(o=a);i.length>0&&i[0].getDepth()<=e&&u(i)}const f=this.getStage();return r.nodeType!==rk&&f&&u(f.getChildren()),n}getDepth(){for(var e=0,r=this.parent;r;)e++,r=r.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Aa),this._clearSelfAndDescendantCache(Gi)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;var r=e.getPointerPosition();if(!r)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(r)}getAbsolutePosition(e){let r=!1,n=this.parent;for(;n;){if(n.isCached()){r=!0;break}n=n.parent}r&&!e&&(e=!0);var i=this.getAbsoluteTransform(e).getMatrix(),a=new ft.Transform,o=this.offset();return a.m=i.slice(),a.translate(o.x,o.y),a.getTranslation()}setAbsolutePosition(e){const{x:r,y:n,...i}=this._clearTransform();this.attrs.x=r,this.attrs.y=n,this._clearCache(Aa);var a=this._getAbsoluteTransform().copy();return a.invert(),a.translate(e.x,e.y),e={x:this.attrs.x+a.getTranslation().x,y:this.attrs.y+a.getTranslation().y},this._setTransform(i),this.setPosition({x:e.x,y:e.y}),this._clearCache(Aa),this._clearSelfAndDescendantCache(Gi),this}_setTransform(e){var r;for(r in e)this.attrs[r]=e[r]}_clearTransform(){var e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){var r=e.x,n=e.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(e,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++)e(n[o])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return ft.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var e=this.index,r=this.parent.getChildren().length;return e<r-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return ft.Util.warn("Node has no parent. moveUp function is ignored."),!1;var e=this.index,r=this.parent.getChildren().length;return e<r-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return ft.Util.warn("Node has no parent. moveDown function is ignored."),!1;var e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return ft.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return ft.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&ft.Util.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var r=this.index;return this.parent.children.splice(r,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(pd,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),r=this.getParent();return r&&!r._isUnderCache&&(e*=r.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e={},r=this.getAttrs(),n,i,a,o,l;e.attrs={};for(n in r)i=r[n],l=ft.Util.isObject(i)&&!ft.Util._isPlainObject(i)&&!ft.Util._isArray(i),!l&&(a=typeof this[n]=="function"&&this[n],delete r[n],o=a?a.call(this):null,r[n]=i,o!==i&&(e.attrs[n]=i));return e.className=this.getClassName(),ft.Util._prepareToStringify(e)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,r,n){var i=[];r&&this._isMatch(e)&&i.push(this);for(var a=this.parent;a;){if(a===n)return i;a._isMatch(e)&&i.push(a),a=a.parent}return i}isAncestorOf(e){return!1}findAncestor(e,r,n){return this.findAncestors(e,r,n)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);var r=e.replace(/ /g,"").split(","),n=r.length,i,a;for(i=0;i<n;i++)if(a=r[i],ft.Util.isValidSelector(a)||(ft.Util.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),ft.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),ft.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 e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(J_,this._getStage)}_getStage(){var e=this.getParent();return e?e.getStage():null}fire(e,r={},n){return r.target=r.target||this,n?this._fireAndBubble(e,r):this._fire(e,r),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(Gi,this._getAbsoluteTransform)}_getAbsoluteTransform(e){var r;if(e)return r=new ft.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())},e),r;r=this._cache.get(Gi)||new ft.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(e){for(var r=this;r;)r._isUnderCache&&(e=r),r=r.getParent();const i=this.getAbsoluteTransform(e).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(Aa,this._getTransform)}_getTransform(){var e,r,n=this._cache.get(Aa)||new ft.Transform;n.reset();var i=this.x(),a=this.y(),o=So.Konva.getAngle(this.rotation()),l=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,u=(r=this.attrs.scaleY)!==null&&r!==void 0?r:1,f=this.attrs.skewX||0,y=this.attrs.skewY||0,b=this.attrs.offsetX||0,v=this.attrs.offsetY||0;return(i!==0||a!==0)&&n.translate(i,a),o!==0&&n.rotate(o),(f!==0||y!==0)&&n.skew(f,y),(l!==1||u!==1)&&n.scale(l,u),(b!==0||v!==0)&&n.translate(-1*b,-1*v),n.dirty=!1,n}clone(e){var r=ft.Util.cloneObject(this.attrs),n,i,a,o,l;for(n in e)r[n]=e[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(tk)<0&&(u.eventListeners[n]||(u.eventListeners[n]=[]),u.eventListeners[n].push(l));return u}_toKonvaCanvas(e){e=e||{};var r=this.getClientRect(),n=this.getStage(),i=e.x!==void 0?e.x:Math.floor(r.x),a=e.y!==void 0?e.y:Math.floor(r.y),o=e.pixelRatio||1,l=new Wf.SceneCanvas({width:e.width||Math.ceil(r.width)||(n?n.width():0),height:e.height||Math.ceil(r.height)||(n?n.height():0),pixelRatio:o}),u=l.getContext();return e.imageSmoothingEnabled===!1&&(u._context.imageSmoothingEnabled=!1),u.save(),(i||a)&&u.translate(-1*i,-1*a),this.drawScene(l),u.restore(),l}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};var r=e.mimeType||null,n=e.quality||null,i=this._toKonvaCanvas(e).toDataURL(r,n);return e.callback&&e.callback(i),i}toImage(e){return new Promise((r,n)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,ft.Util._urlToImage(this.toDataURL(e),function(a){r(a),i==null||i(a)})}catch(i){n(i)}})}toBlob(e){return new Promise((r,n)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,this.toCanvas(e).toBlob(a=>{r(a),i==null||i(a)})}catch(i){n(i)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():So.Konva.dragDistance}_off(e,r,n){var i=this.eventListeners[e],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[e];break}a--}}_fireChangeEvent(e,r,n){this._fire(e+JA,{oldVal:r,newVal:n})}addName(e){if(!this.hasName(e)){var r=this.name(),n=r?r+" "+e:e;this.name(n)}return this}hasName(e){if(!e)return!1;const r=this.name();if(!r)return!1;var n=(r||"").split(/\s/g);return n.indexOf(e)!==-1}removeName(e){var r=(this.name()||"").split(/\s/g),n=r.indexOf(e);return n!==-1&&(r.splice(n,1),this.name(r.join(" "))),this}setAttr(e,r){var n=this[Q_+ft.Util._capitalize(e)];return ft.Util._isFunction(n)?n.call(this,r):this._setAttr(e,r),this}_requestDraw(){if(So.Konva.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,r){var n=this.attrs[e];n===r&&!ft.Util.isObject(r)||(r==null?delete this.attrs[e]:this.attrs[e]=r,this._shouldFireChangeEvents&&this._fireChangeEvent(e,n,r),this._requestDraw())}_setComponentAttr(e,r,n){var i;n!==void 0&&(i=this.attrs[e],i||(this.attrs[e]=this.getAttr(e)),this.attrs[e][r]=n,this._fireChangeEvent(e,i,n))}_fireAndBubble(e,r,n){r&&this.nodeType===Z_&&(r.target=this);var i=(e===K_||e===X_)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n);if(!i){this._fire(e,r);var a=(e===K_||e===X_)&&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,e,r,n):this._fireAndBubble.call(this.parent,e,r))}}_getProtoListeners(e){var r,n,i;const a=(r=this._cache.get(Yf))!==null&&r!==void 0?r:{};let o=a==null?void 0:a[e];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[e])!==null&&i!==void 0?i:[];o.push(...u),l=Object.getPrototypeOf(l)}a[e]=o,this._cache.set(Yf,a)}return o}_fire(e,r){r=r||{},r.currentTarget=this,r.type=e;const n=this._getProtoListeners(e);if(n)for(var i=0;i<n.length;i++)n[i].handler.call(this,r);const a=this.eventListeners[e];if(a)for(var i=0;i<a.length;i++)a[i].handler.call(this,r)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){var r=e?e.pointerId:void 0,n=this.getStage(),i=this.getAbsolutePosition();if(n){var a=n._getPointerById(r)||n._changedPointerPositions[0]||i;Nn.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(e,r=!0){Nn.DD._dragElements.has(this._id)||this._createDragElement(e);const n=Nn.DD._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},r)}_setDragPosition(e,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,e);o?i=o:ft.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(e){const r=Nn.DD._dragElements.get(this._id);r&&(r.dragStatus="stopped"),Nn.DD._endDragBefore(e),Nn.DD._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=Nn.DD._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){var r=e.evt.button!==void 0,n=!r||So.Konva.dragButtons.indexOf(e.evt.button)>=0;if(n&&!this.isDragging()){var i=!1;Nn.DD._dragElements.forEach(a=>{this.isAncestorOf(a.node)&&(i=!0)}),i||this._createDragElement(e)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var e=this.getStage();if(!e)return;const r=Nn.DD._dragElements.get(this._id),n=r&&r.dragStatus==="dragging",i=r&&r.dragStatus==="ready";n?this.stopDrag():i&&Nn.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const r=this.getStage();if(!r)return!1;const n={x:-e.x,y:-e.y,width:r.width()+2*e.x,height:r.height()+2*e.y};return ft.Util.haveIntersection(n,this.getClientRect())}static create(e,r){return ft.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,r)}static _createNode(e,r){var n=Em.prototype.getClassName.call(e),i=e.children,a,o,l;r&&(e.attrs.container=r),So.Konva[n]||(ft.Util.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=So.Konva[n];if(a=new u(e.attrs),i)for(o=i.length,l=0;l<o;l++)a.add(Em._createNode(i[l]));return a}};Bt.Node=nt;nt.prototype.nodeType="Node";nt.prototype._attrsAffectingSize=[];nt.prototype.eventListeners={};nt.prototype.on.call(nt.prototype,nk,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Aa),this._clearSelfAndDescendantCache(Gi)});nt.prototype.on.call(nt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(Sm)});nt.prototype.on.call(nt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(wm)});nt.prototype.on.call(nt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(pd)});const Tt=wc.Factory.addGetterSetter;Tt(nt,"zIndex");Tt(nt,"absolutePosition");Tt(nt,"position");Tt(nt,"x",0,(0,Jt.getNumberValidator)());Tt(nt,"y",0,(0,Jt.getNumberValidator)());Tt(nt,"globalCompositeOperation","source-over",(0,Jt.getStringValidator)());Tt(nt,"opacity",1,(0,Jt.getNumberValidator)());Tt(nt,"name","",(0,Jt.getStringValidator)());Tt(nt,"id","",(0,Jt.getStringValidator)());Tt(nt,"rotation",0,(0,Jt.getNumberValidator)());wc.Factory.addComponentsGetterSetter(nt,"scale",["x","y"]);Tt(nt,"scaleX",1,(0,Jt.getNumberValidator)());Tt(nt,"scaleY",1,(0,Jt.getNumberValidator)());wc.Factory.addComponentsGetterSetter(nt,"skew",["x","y"]);Tt(nt,"skewX",0,(0,Jt.getNumberValidator)());Tt(nt,"skewY",0,(0,Jt.getNumberValidator)());wc.Factory.addComponentsGetterSetter(nt,"offset",["x","y"]);Tt(nt,"offsetX",0,(0,Jt.getNumberValidator)());Tt(nt,"offsetY",0,(0,Jt.getNumberValidator)());Tt(nt,"dragDistance",null,(0,Jt.getNumberValidator)());Tt(nt,"width",0,(0,Jt.getNumberValidator)());Tt(nt,"height",0,(0,Jt.getNumberValidator)());Tt(nt,"listening",!0,(0,Jt.getBooleanValidator)());Tt(nt,"preventDefault",!0,(0,Jt.getBooleanValidator)());Tt(nt,"filters",null,function(t){return this._filterUpToDate=!1,t});Tt(nt,"visible",!0,(0,Jt.getBooleanValidator)());Tt(nt,"transformsEnabled","all",(0,Jt.getStringValidator)());Tt(nt,"size");Tt(nt,"dragBoundFunc");Tt(nt,"draggable",!1,(0,Jt.getBooleanValidator)());wc.Factory.backCompat(nt,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var Jo={};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.Container=void 0;const As=st,Ov=Bt,Fh=Ve;class el extends Ov.Node{constructor(){super(...arguments),this.children=[]}getChildren(e){if(!e)return this.children||[];const r=this.children||[];var n=[];return r.forEach(function(i){e(i)&&n.push(i)}),n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(var r=0;r<e.length;r++)this.add(e[r]);return this}const n=e[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(e){return this._generalFind(e,!1)}findOne(e){var r=this._generalFind(e,!0);return r.length>0?r[0]:void 0}_generalFind(e,r){var n=[];return this._descendants(i=>{const a=i._isMatch(e);return a&&n.push(i),!!(a&&r)}),n}_descendants(e){let r=!1;const n=this.getChildren();for(const i of n){if(r=e(i),r)return!0;if(i.hasChildren()&&(r=i._descendants(e),r))return!0}return!1}toObject(){var e=Ov.Node.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(r=>{e.children.push(r.toObject())}),e}isAncestorOf(e){for(var r=e.getParent();r;){if(r._id===this._id)return!0;r=r.getParent()}return!1}clone(e){var r=Ov.Node.prototype.clone.call(this,e);return this.getChildren().forEach(function(n){r.add(n.clone())}),r}getAllIntersections(e){var r=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(e)&&r.push(n)}),r}_clearSelfAndDescendantCache(e){var r;super._clearSelfAndDescendantCache(e),!this.isCached()&&((r=this.children)===null||r===void 0||r.forEach(function(n){n._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(r,n){r.index=n}),this._requestDraw()}drawScene(e,r){var n=this.getLayer(),i=e||n&&n.getCanvas(),a=i&&i.getContext(),o=this._getCanvasCache(),l=o&&o.scene,u=i&&i.isCache;if(!this.isVisible()&&!u)return this;if(l){a.save();var f=this.getAbsoluteTransform(r).getMatrix();a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren("drawScene",i,r);return this}drawHit(e,r){if(!this.shouldDrawHit(r))return this;var n=this.getLayer(),i=e||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(e,r,n){var i,a=r&&r.getContext(),o=this.clipWidth(),l=this.clipHeight(),u=this.clipFunc(),f=o&&l||u;const y=n===this;if(f){a.save();var b=this.getAbsoluteTransform(n),v=b.getMatrix();a.transform(v[0],v[1],v[2],v[3],v[4],v[5]),a.beginPath();let S;if(u)S=u.call(this,a,this);else{var h=this.clipX(),w=this.clipY();a.rect(h,w,o,l)}a.clip.apply(a,S),v=b.copy().invert().getMatrix(),a.transform(v[0],v[1],v[2],v[3],v[4],v[5])}var E=!y&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";E&&(a.save(),a._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(S){S[e](r,n)}),E&&a.restore(),f&&a.restore()}getClientRect(e={}){var r,n=e.skipTransform,i=e.relativeTo,a,o,l,u,f={x:1/0,y:1/0,width:0,height:0},y=this;(r=this.children)===null||r===void 0||r.forEach(function(E){if(E.visible()){var S=E.getClientRect({relativeTo:y,skipShadow:e.skipShadow,skipStroke:e.skipStroke});S.width===0&&S.height===0||(a===void 0?(a=S.x,o=S.y,l=S.x+S.width,u=S.y+S.height):(a=Math.min(a,S.x),o=Math.min(o,S.y),l=Math.max(l,S.x+S.width),u=Math.max(u,S.y+S.height)))}});for(var b=this.find("Shape"),v=!1,h=0;h<b.length;h++){var w=b[h];if(w._isVisible(this)){v=!0;break}}return v&&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)}}Jo.Container=el;As.Factory.addComponentsGetterSetter(el,"clip",["x","y","width","height"]);As.Factory.addGetterSetter(el,"clipX",void 0,(0,Fh.getNumberValidator)());As.Factory.addGetterSetter(el,"clipY",void 0,(0,Fh.getNumberValidator)());As.Factory.addGetterSetter(el,"clipWidth",void 0,(0,Fh.getNumberValidator)());As.Factory.addGetterSetter(el,"clipHeight",void 0,(0,Fh.getNumberValidator)());As.Factory.addGetterSetter(el,"clipFunc");var v6={},pn={};Object.defineProperty(pn,"__esModule",{value:!0});pn.releaseCapture=pn.setPointerCapture=pn.hasPointerCapture=pn.createEvent=pn.getCapturedShape=void 0;const ak=lt,ec=new Map,m6=ak.Konva._global.PointerEvent!==void 0;function ok(t){return ec.get(t)}pn.getCapturedShape=ok;function Qy(t){return{evt:t,pointerId:t.pointerId}}pn.createEvent=Qy;function lk(t,e){return ec.get(t)===e}pn.hasPointerCapture=lk;function sk(t,e){y6(t),e.getStage()&&(ec.set(t,e),m6&&e._fire("gotpointercapture",Qy(new PointerEvent("gotpointercapture"))))}pn.setPointerCapture=sk;function y6(t,e){const r=ec.get(t);if(!r)return;const n=r.getStage();n&&n.content,ec.delete(t),m6&&r._fire("lostpointercapture",Qy(new PointerEvent("lostpointercapture")))}pn.releaseCapture=y6;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Stage=t.stages=void 0;const e=$t,r=st,n=Jo,i=lt,a=ii,o=Dh,l=lt,u=pn;var f="Stage",y="string",b="px",v="mouseout",h="mouseleave",w="mouseover",E="mouseenter",S="mousemove",_="mousedown",p="mouseup",d="pointermove",g="pointerdown",m="pointerup",x="pointercancel",P="lostpointercapture",O="pointerout",R="pointerleave",T="pointerover",C="pointerenter",N="contextmenu",F="touchstart",H="touchend",z="touchmove",Y="touchcancel",G="wheel",W=5,j=[[E,"_pointerenter"],[_,"_pointerdown"],[S,"_pointermove"],[p,"_pointerup"],[h,"_pointerleave"],[F,"_pointerdown"],[z,"_pointermove"],[H,"_pointerup"],[Y,"_pointercancel"],[w,"_pointerover"],[G,"_wheel"],[N,"_contextmenu"],[g,"_pointerdown"],[d,"_pointermove"],[m,"_pointerup"],[x,"_pointercancel"],[P,"_lostpointercapture"]];const M={mouse:{[O]:v,[R]:h,[T]:w,[C]:E,[d]:S,[g]:_,[m]:p,[x]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[O]:"touchout",[R]:"touchleave",[T]:"touchover",[C]:"touchenter",[d]:z,[g]:F,[m]:H,[x]:Y,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[O]:O,[R]:R,[T]:T,[C]:C,[d]:d,[g]:g,[m]:m,[x]:x,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},k=$=>$.indexOf("pointer")>=0?"pointer":$.indexOf("touch")>=0?"touch":"mouse",D=$=>{const U=k($);if(U==="pointer")return i.Konva.pointerEventsEnabled&&M.pointer;if(U==="touch")return M.touch;if(U==="mouse")return M.mouse};function B($={}){return($.clipFunc||$.clipWidth||$.clipHeight)&&e.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),$}const q="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);";t.stages=[];class K extends n.Container{constructor(U){super(B(U)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),t.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",()=>{B(this.attrs)}),this._checkVisibility()}_validateAdd(U){const X=U.getType()==="Layer",Q=U.getType()==="FastLayer";X||Q||e.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const U=this.visible()?"":"none";this.content.style.display=U}setContainer(U){if(typeof U===y){if(U.charAt(0)==="."){var X=U.slice(1);U=document.getElementsByClassName(X)[0]}else{var Q;U.charAt(0)!=="#"?Q=U:Q=U.slice(1),U=document.getElementById(Q)}if(!U)throw"Can not find container in document with id "+Q}return this._setAttr("container",U),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),U.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var U=this.children,X=U.length,Q;for(Q=0;Q<X;Q++)U[Q].clear();return this}clone(U){return U||(U={}),U.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,U)}destroy(){super.destroy();var U=this.content;U&&e.Util._isInDocument(U)&&this.container().removeChild(U);var X=t.stages.indexOf(this);return X>-1&&t.stages.splice(X,1),e.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const U=this._pointerPositions[0]||this._changedPointerPositions[0];return U?{x:U.x,y:U.y}:(e.Util.warn(q),null)}_getPointerById(U){return this._pointerPositions.find(X=>X.id===U)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(U){U=U||{},U.x=U.x||0,U.y=U.y||0,U.width=U.width||this.width(),U.height=U.height||this.height();var X=new a.SceneCanvas({width:U.width,height:U.height,pixelRatio:U.pixelRatio||1}),Q=X.getContext()._context,ee=this.children;return(U.x||U.y)&&Q.translate(-1*U.x,-1*U.y),ee.forEach(function(Z){if(Z.isVisible()){var ne=Z._toKonvaCanvas(U);Q.drawImage(ne._canvas,U.x,U.y,ne.getWidth()/ne.getPixelRatio(),ne.getHeight()/ne.getPixelRatio())}}),X}getIntersection(U){if(!U)return null;var X=this.children,Q=X.length,ee=Q-1,Z;for(Z=ee;Z>=0;Z--){const ne=X[Z].getIntersection(U);if(ne)return ne}return null}_resizeDOM(){var U=this.width(),X=this.height();this.content&&(this.content.style.width=U+b,this.content.style.height=X+b),this.bufferCanvas.setSize(U,X),this.bufferHitCanvas.setSize(U,X),this.children.forEach(Q=>{Q.setSize({width:U,height:X}),Q.draw()})}add(U,...X){if(arguments.length>1){for(var Q=0;Q<arguments.length;Q++)this.add(arguments[Q]);return this}super.add(U);var ee=this.children.length;return ee>W&&e.Util.warn("The stage has "+ee+" 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."),U.setSize({width:this.width(),height:this.height()}),U.draw(),i.Konva.isBrowser&&this.content.appendChild(U.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(U){return u.hasPointerCapture(U,this)}setPointerCapture(U){u.setPointerCapture(U,this)}releaseCapture(U){u.releaseCapture(U,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&j.forEach(([U,X])=>{this.content.addEventListener(U,Q=>{this[X](Q)},{passive:!1})})}_pointerenter(U){this.setPointersPositions(U);const X=D(U.type);X&&this._fire(X.pointerenter,{evt:U,target:this,currentTarget:this})}_pointerover(U){this.setPointersPositions(U);const X=D(U.type);X&&this._fire(X.pointerover,{evt:U,target:this,currentTarget:this})}_getTargetShape(U){let X=this[U+"targetShape"];return X&&!X.getStage()&&(X=null),X}_pointerleave(U){const X=D(U.type),Q=k(U.type);if(X){this.setPointersPositions(U);var ee=this._getTargetShape(Q),Z=!o.DD.isDragging||i.Konva.hitOnDragEnabled;ee&&Z?(ee._fireAndBubble(X.pointerout,{evt:U}),ee._fireAndBubble(X.pointerleave,{evt:U}),this._fire(X.pointerleave,{evt:U,target:this,currentTarget:this}),this[Q+"targetShape"]=null):Z&&(this._fire(X.pointerleave,{evt:U,target:this,currentTarget:this}),this._fire(X.pointerout,{evt:U,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(U){const X=D(U.type),Q=k(U.type);if(X){this.setPointersPositions(U);var ee=!1;this._changedPointerPositions.forEach(Z=>{var ne=this.getIntersection(Z);if(o.DD.justDragged=!1,i.Konva["_"+Q+"ListenClick"]=!0,!ne||!ne.isListening())return;i.Konva.capturePointerEventsEnabled&&ne.setPointerCapture(Z.id),this[Q+"ClickStartShape"]=ne,ne._fireAndBubble(X.pointerdown,{evt:U,pointerId:Z.id}),ee=!0;const ie=U.type.indexOf("touch")>=0;ne.preventDefault()&&U.cancelable&&ie&&U.preventDefault()}),ee||this._fire(X.pointerdown,{evt:U,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(U){const X=D(U.type),Q=k(U.type);if(!X)return;o.DD.isDragging&&o.DD.node.preventDefault()&&U.cancelable&&U.preventDefault(),this.setPointersPositions(U);var ee=!o.DD.isDragging||i.Konva.hitOnDragEnabled;if(!ee)return;var Z={};let ne=!1;var ie=this._getTargetShape(Q);this._changedPointerPositions.forEach(pe=>{const we=u.getCapturedShape(pe.id)||this.getIntersection(pe),Re=pe.id,xe={evt:U,pointerId:Re};var le=ie!==we;if(le&&ie&&(ie._fireAndBubble(X.pointerout,{...xe},we),ie._fireAndBubble(X.pointerleave,{...xe},we)),we){if(Z[we._id])return;Z[we._id]=!0}we&&we.isListening()?(ne=!0,le&&(we._fireAndBubble(X.pointerover,{...xe},ie),we._fireAndBubble(X.pointerenter,{...xe},ie),this[Q+"targetShape"]=we),we._fireAndBubble(X.pointermove,{...xe})):ie&&(this._fire(X.pointerover,{evt:U,target:this,currentTarget:this,pointerId:Re}),this[Q+"targetShape"]=null)}),ne||this._fire(X.pointermove,{evt:U,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(U){const X=D(U.type),Q=k(U.type);if(!X)return;this.setPointersPositions(U);const ee=this[Q+"ClickStartShape"],Z=this[Q+"ClickEndShape"];var ne={};let ie=!1;this._changedPointerPositions.forEach(pe=>{const we=u.getCapturedShape(pe.id)||this.getIntersection(pe);if(we){if(we.releaseCapture(pe.id),ne[we._id])return;ne[we._id]=!0}const Re=pe.id,xe={evt:U,pointerId:Re};let le=!1;i.Konva["_"+Q+"InDblClickWindow"]?(le=!0,clearTimeout(this[Q+"DblTimeout"])):o.DD.justDragged||(i.Konva["_"+Q+"InDblClickWindow"]=!0,clearTimeout(this[Q+"DblTimeout"])),this[Q+"DblTimeout"]=setTimeout(function(){i.Konva["_"+Q+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),we&&we.isListening()?(ie=!0,this[Q+"ClickEndShape"]=we,we._fireAndBubble(X.pointerup,{...xe}),i.Konva["_"+Q+"ListenClick"]&&ee&&ee===we&&(we._fireAndBubble(X.pointerclick,{...xe}),le&&Z&&Z===we&&we._fireAndBubble(X.pointerdblclick,{...xe}))):(this[Q+"ClickEndShape"]=null,i.Konva["_"+Q+"ListenClick"]&&this._fire(X.pointerclick,{evt:U,target:this,currentTarget:this,pointerId:Re}),le&&this._fire(X.pointerdblclick,{evt:U,target:this,currentTarget:this,pointerId:Re}))}),ie||this._fire(X.pointerup,{evt:U,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+Q+"ListenClick"]=!1,U.cancelable&&Q!=="touch"&&U.preventDefault()}_contextmenu(U){this.setPointersPositions(U);var X=this.getIntersection(this.getPointerPosition());X&&X.isListening()?X._fireAndBubble(N,{evt:U}):this._fire(N,{evt:U,target:this,currentTarget:this})}_wheel(U){this.setPointersPositions(U);var X=this.getIntersection(this.getPointerPosition());X&&X.isListening()?X._fireAndBubble(G,{evt:U}):this._fire(G,{evt:U,target:this,currentTarget:this})}_pointercancel(U){this.setPointersPositions(U);const X=u.getCapturedShape(U.pointerId)||this.getIntersection(this.getPointerPosition());X&&X._fireAndBubble(m,u.createEvent(U)),u.releaseCapture(U.pointerId)}_lostpointercapture(U){u.releaseCapture(U.pointerId)}setPointersPositions(U){var X=this._getContentPosition(),Q=null,ee=null;U=U||window.event,U.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(U.touches,Z=>{this._pointerPositions.push({id:Z.identifier,x:(Z.clientX-X.left)/X.scaleX,y:(Z.clientY-X.top)/X.scaleY})}),Array.prototype.forEach.call(U.changedTouches||U.touches,Z=>{this._changedPointerPositions.push({id:Z.identifier,x:(Z.clientX-X.left)/X.scaleX,y:(Z.clientY-X.top)/X.scaleY})})):(Q=(U.clientX-X.left)/X.scaleX,ee=(U.clientY-X.top)/X.scaleY,this.pointerPos={x:Q,y:ee},this._pointerPositions=[{x:Q,y:ee,id:e.Util._getFirstPointerId(U)}],this._changedPointerPositions=[{x:Q,y:ee,id:e.Util._getFirstPointerId(U)}])}_setPointerPosition(U){e.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(U)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var U=this.content.getBoundingClientRect();return{top:U.top,left:U.left,scaleX:U.width/this.content.clientWidth||1,scaleY:U.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 U=this.container();if(!U)throw"Stage has no container. A container is required.";U.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"),U.appendChild(this.content),this._resizeDOM()}}cache(){return e.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(U){U.batchDraw()}),this}}t.Stage=K,K.prototype.nodeType=f,(0,l._registerNode)(K),r.Factory.addGetterSetter(K,"container")})(v6);var Sc={},ur={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.shapes=void 0;const e=lt,r=$t,n=st,i=Bt,a=Ve,o=lt,l=pn;var u="hasShadow",f="shadowRGBA",y="patternImage",b="linearGradient",v="radialGradient";let h;function w(){return h||(h=r.Util.createCanvasElement().getContext("2d"),h)}t.shapes={};function E(R){const T=this.attrs.fillRule;T?R.fill(T):R.fill()}function S(R){R.stroke()}function _(R){R.fill()}function p(R){R.stroke()}function d(){this._clearCache(u)}function g(){this._clearCache(f)}function m(){this._clearCache(y)}function x(){this._clearCache(b)}function P(){this._clearCache(v)}class O extends i.Node{constructor(T){super(T);let C;for(;C=r.Util.getRandomColor(),!(C&&!(C in t.shapes)););this.colorKey=C,t.shapes[C]=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(y,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var T=w();const C=T.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(C&&C.setTransform){const N=new r.Transform;N.translate(this.fillPatternX(),this.fillPatternY()),N.rotate(e.Konva.getAngle(this.fillPatternRotation())),N.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),N.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const F=N.getMatrix(),H=typeof DOMMatrix>"u"?{a:F[0],b:F[1],c:F[2],d:F[3],e:F[4],f:F[5]}:new DOMMatrix(F);C.setTransform(H)}return C}}_getLinearGradient(){return this._getCache(b,this.__getLinearGradient)}__getLinearGradient(){var T=this.fillLinearGradientColorStops();if(T){for(var C=w(),N=this.fillLinearGradientStartPoint(),F=this.fillLinearGradientEndPoint(),H=C.createLinearGradient(N.x,N.y,F.x,F.y),z=0;z<T.length;z+=2)H.addColorStop(T[z],T[z+1]);return H}}_getRadialGradient(){return this._getCache(v,this.__getRadialGradient)}__getRadialGradient(){var T=this.fillRadialGradientColorStops();if(T){for(var C=w(),N=this.fillRadialGradientStartPoint(),F=this.fillRadialGradientEndPoint(),H=C.createRadialGradient(N.x,N.y,this.fillRadialGradientStartRadius(),F.x,F.y,this.fillRadialGradientEndRadius()),z=0;z<T.length;z+=2)H.addColorStop(T[z],T[z+1]);return H}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var T=r.Util.colorToRGBA(this.shadowColor());if(T)return"rgba("+T.r+","+T.g+","+T.b+","+T.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 T=this.hitStrokeWidth();return T==="auto"?this.hasStroke():this.strokeEnabled()&&!!T}intersects(T){var C=this.getStage();if(!C)return!1;const N=C.bufferHitCanvas;return N.getContext().clear(),this.drawHit(N,void 0,!0),N.context.getImageData(Math.round(T.x),Math.round(T.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete t.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(T){var C;if(!this.getStage()||!((C=this.attrs.perfectDrawEnabled)!==null&&C!==void 0?C:!0))return!1;const F=T||this.hasFill(),H=this.hasStroke(),z=this.getAbsoluteOpacity()!==1;if(F&&H&&z)return!0;const Y=this.hasShadow(),G=this.shadowForStrokeEnabled();return!!(F&&H&&Y&&G)}setStrokeHitEnabled(T){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),T?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var T=this.size();return{x:this._centroid?-T.width/2:0,y:this._centroid?-T.height/2:0,width:T.width,height:T.height}}getClientRect(T={}){const C=T.skipTransform,N=T.relativeTo,F=this.getSelfRect(),z=!T.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,Y=F.width+z,G=F.height+z,W=!T.skipShadow&&this.hasShadow(),j=W?this.shadowOffsetX():0,M=W?this.shadowOffsetY():0,k=Y+Math.abs(j),D=G+Math.abs(M),B=W&&this.shadowBlur()||0,q=k+B*2,K=D+B*2,$={width:q,height:K,x:-(z/2+B)+Math.min(j,0)+F.x,y:-(z/2+B)+Math.min(M,0)+F.y};return C?$:this._transformedRect($,N)}drawScene(T,C){var N=this.getLayer(),F=T||N.getCanvas(),H=F.getContext(),z=this._getCanvasCache(),Y=this.getSceneFunc(),G=this.hasShadow(),W,j,M,k=F.isCache,D=C===this;if(!this.isVisible()&&!D)return this;if(z){H.save();var B=this.getAbsoluteTransform(C).getMatrix();return H.transform(B[0],B[1],B[2],B[3],B[4],B[5]),this._drawCachedSceneCanvas(H),H.restore(),this}if(!Y)return this;if(H.save(),this._useBufferCanvas()&&!k){W=this.getStage(),j=W.bufferCanvas,M=j.getContext(),M.clear(),M.save(),M._applyLineJoin(this);var q=this.getAbsoluteTransform(C).getMatrix();M.transform(q[0],q[1],q[2],q[3],q[4],q[5]),Y.call(this,M,this),M.restore();var K=j.pixelRatio;G&&H._applyShadow(this),H._applyOpacity(this),H._applyGlobalCompositeOperation(this),H.drawImage(j._canvas,0,0,j.width/K,j.height/K)}else{if(H._applyLineJoin(this),!D){var q=this.getAbsoluteTransform(C).getMatrix();H.transform(q[0],q[1],q[2],q[3],q[4],q[5]),H._applyOpacity(this),H._applyGlobalCompositeOperation(this)}G&&H._applyShadow(this),Y.call(this,H,this)}return H.restore(),this}drawHit(T,C,N=!1){if(!this.shouldDrawHit(C,N))return this;var F=this.getLayer(),H=T||F.hitCanvas,z=H&&H.getContext(),Y=this.hitFunc()||this.sceneFunc(),G=this._getCanvasCache(),W=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()"),W){z.save();var j=this.getAbsoluteTransform(C).getMatrix();return z.transform(j[0],j[1],j[2],j[3],j[4],j[5]),this._drawCachedHitCanvas(z),z.restore(),this}if(!Y)return this;if(z.save(),z._applyLineJoin(this),!(this===C)){var k=this.getAbsoluteTransform(C).getMatrix();z.transform(k[0],k[1],k[2],k[3],k[4],k[5])}return Y.call(this,z,this),z.restore(),this}drawHitFromCache(T=0){var C=this._getCanvasCache(),N=this._getCachedSceneCanvas(),F=C.hit,H=F.getContext(),z=F.getWidth(),Y=F.getHeight(),G,W,j,M,k,D;H.clear(),H.drawImage(N._canvas,0,0,z,Y);try{for(G=H.getImageData(0,0,z,Y),W=G.data,j=W.length,M=r.Util._hexToRgb(this.colorKey),k=0;k<j;k+=4)D=W[k+3],D>T?(W[k]=M.r,W[k+1]=M.g,W[k+2]=M.b,W[k+3]=255):W[k+3]=0;H.putImageData(G,0,0)}catch(B){r.Util.error("Unable to draw hit graph from cached scene canvas. "+B.message)}return this}hasPointerCapture(T){return l.hasPointerCapture(T,this)}setPointerCapture(T){l.setPointerCapture(T,this)}releaseCapture(T){l.releaseCapture(T,this)}}t.Shape=O,O.prototype._fillFunc=E,O.prototype._strokeFunc=S,O.prototype._fillFuncHit=_,O.prototype._strokeFuncHit=p,O.prototype._centroid=!1,O.prototype.nodeType="Shape",(0,o._registerNode)(O),O.prototype.eventListeners={},O.prototype.on.call(O.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),O.prototype.on.call(O.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",g),O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",m),O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",x),O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",P),n.Factory.addGetterSetter(O,"stroke",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(O,"strokeWidth",2,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(O,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(O,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(O,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(O,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(O,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(O,"lineJoin"),n.Factory.addGetterSetter(O,"lineCap"),n.Factory.addGetterSetter(O,"sceneFunc"),n.Factory.addGetterSetter(O,"hitFunc"),n.Factory.addGetterSetter(O,"dash"),n.Factory.addGetterSetter(O,"dashOffset",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(O,"shadowColor",void 0,(0,a.getStringValidator)()),n.Factory.addGetterSetter(O,"shadowBlur",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(O,"shadowOpacity",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(O,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(O,"shadowOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(O,"shadowOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(O,"fillPatternImage"),n.Factory.addGetterSetter(O,"fill",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(O,"fillPatternX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(O,"fillPatternY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(O,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(O,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(O,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(O,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(O,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(O,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(O,"fillEnabled",!0),n.Factory.addGetterSetter(O,"strokeEnabled",!0),n.Factory.addGetterSetter(O,"shadowEnabled",!0),n.Factory.addGetterSetter(O,"dashEnabled",!0),n.Factory.addGetterSetter(O,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(O,"fillPriority","color"),n.Factory.addComponentsGetterSetter(O,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(O,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(O,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(O,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(O,"fillPatternScaleX",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(O,"fillPatternScaleY",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(O,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(O,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(O,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(O,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(O,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(O,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(O,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(O,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(O,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(O,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(O,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(O,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(O,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(O,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(O,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(O,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(O,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(O,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(O,"fillPatternRotation",0),n.Factory.addGetterSetter(O,"fillRule",void 0,(0,a.getStringValidator)()),n.Factory.backCompat(O,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(ur);Object.defineProperty(Sc,"__esModule",{value:!0});Sc.Layer=void 0;const Ui=$t,xv=Jo,Tl=Bt,Zy=st,ew=ii,uk=Ve,ck=ur,fk=lt;var dk="#",hk="beforeDraw",pk="draw",b6=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],gk=b6.length;let ks=class extends xv.Container{constructor(e){super(e),this.canvas=new ew.SceneCanvas,this.hitCanvas=new ew.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(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);var r=this.getStage();return r&&r.content&&(r.content.removeChild(this.getNativeCanvasElement()),e<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[e+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Tl.Node.prototype.moveToTop.call(this);var e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var e=Tl.Node.prototype.moveUp.call(this);if(!e)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(Tl.Node.prototype.moveDown.call(this)){var e=this.getStage();if(e){var r=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),r[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Tl.Node.prototype.moveToBottom.call(this)){var e=this.getStage();if(e){var r=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),r[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var e=this.getNativeCanvasElement();return Tl.Node.prototype.remove.call(this),e&&e.parentNode&&Ui.Util._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:r}){return this.canvas.setSize(e,r),this.hitCanvas.setSize(e,r),this._setSmoothEnabled(),this}_validateAdd(e){var r=e.getType();r!=="Group"&&r!=="Shape"&&Ui.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e=e||{},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),Tl.Node.prototype._toKonvaCanvas.call(this,e)}_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(){Ui.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Ui.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Ui.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var r=1,n=!1;;){for(let i=0;i<gk;i++){const a=b6[i],o=this._getIntersection({x:e.x+a.x*r,y:e.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(e){const r=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(e.x*r),Math.round(e.y*r),1,1).data,i=n[3];if(i===255){const a=Ui.Util._rgbToHex(n[0],n[1],n[2]),o=ck.shapes[dk+a];return o?{shape:o}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(e,r){var n=this.getLayer(),i=e||n&&n.getCanvas();return this._fire(hk,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),xv.Container.prototype.drawScene.call(this,i,r),this._fire(pk,{node:this}),this}drawHit(e,r){var n=this.getLayer(),i=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),xv.Container.prototype.drawHit.call(this,i,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){Ui.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return Ui.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var e=this.parent,r=!!this.hitCanvas._canvas.parentNode;r?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}destroy(){return Ui.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Sc.Layer=ks;ks.prototype.nodeType="Layer";(0,fk._registerNode)(ks);Zy.Factory.addGetterSetter(ks,"imageSmoothingEnabled",!0);Zy.Factory.addGetterSetter(ks,"clearBeforeDraw",!0);Zy.Factory.addGetterSetter(ks,"hitGraphEnabled",!0,(0,uk.getBooleanValidator)());var zh={};Object.defineProperty(zh,"__esModule",{value:!0});zh.FastLayer=void 0;const vk=$t,mk=Sc,yk=lt;let Jy=class extends mk.Layer{constructor(e){super(e),this.listening(!1),vk.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};zh.FastLayer=Jy;Jy.prototype.nodeType="FastLayer";(0,yk._registerNode)(Jy);var Ts={};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.Group=void 0;const bk=$t,_k=Jo,wk=lt;let e1=class extends _k.Container{_validateAdd(e){var r=e.getType();r!=="Group"&&r!=="Shape"&&bk.Util.throw("You may only add groups and shapes to groups.")}};Ts.Group=e1;e1.prototype.nodeType="Group";(0,wk._registerNode)(e1);var Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});Cs.Animation=void 0;const Pv=lt,tw=$t,Av=function(){return Pv.glob.performance&&Pv.glob.performance.now?function(){return Pv.glob.performance.now()}:function(){return new Date().getTime()}}();class Si{constructor(e,r){this.id=Si.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Av(),frameRate:0},this.func=e,this.setLayers(r)}setLayers(e){let r=[];return e&&(r=Array.isArray(e)?e:[e]),this.layers=r,this}getLayers(){return this.layers}addLayer(e){const r=this.layers,n=r.length;for(let i=0;i<n;i++)if(r[i]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const r=Si.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=Av(),Si._addAnimation(this),this}stop(){return Si._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const r=e.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 e={},r=this.animations;for(let n=0;n<r.length;n++){const i=r[n],a=i.layers,o=i.func;i._updateFrameObject(Av());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 y=a[f];y._id!==void 0&&(e[y._id]=y)}}for(let n in e)e.hasOwnProperty(n)&&e[n].batchDraw()}static _animationLoop(){const e=Si;e.animations.length?(e._runFrames(),tw.Util.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,tw.Util.requestAnimFrame(this._animationLoop))}}Cs.Animation=Si;Si.animations=[];Si.animIdCounter=0;Si.animRunning=!1;var _6={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Easings=t.Tween=void 0;const e=$t,r=Cs,n=Bt,i=lt;var a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,f=0,y=["fill","stroke","shadowColor"];class b{constructor(w,E,S,_,p,d,g){this.prop=w,this.propFunc=E,this.begin=_,this._pos=_,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=g,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=S,this._change=p-this.begin,this.pause()}fire(w){var E=this[w];E&&E()}setTime(w){w>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():w<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=w,this.update())}getTime(){return this._time}setPosition(w){this.prevPos=this._pos,this.propFunc(w),this._pos=w}getPosition(w){return w===void 0&&(w=this._time),this.func(w,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(w){this.pause(),this._time=w,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 w=this.getTimer()-this._startTime;this.state===l?this.setTime(w):this.state===u&&this.setTime(this.duration-w)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class v{constructor(w){var E=this,S=w.node,_=S._id,p,d=w.easing||t.Easings.Linear,g=!!w.yoyo,m;typeof w.duration>"u"?p=.3:w.duration===0?p=.001:p=w.duration,this.node=S,this._id=f++;var x=S.getLayer()||(S instanceof i.Konva.Stage?S.getLayers():null);x||e.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new r.Animation(function(){E.tween.onEnterFrame()},x),this.tween=new b(m,function(P){E._tweenFunc(P)},d,0,1,p*1e3,g),this._addListeners(),v.attrs[_]||(v.attrs[_]={}),v.attrs[_][this._id]||(v.attrs[_][this._id]={}),v.tweens[_]||(v.tweens[_]={});for(m in w)a[m]===void 0&&this._addAttr(m,w[m]);this.reset(),this.onFinish=w.onFinish,this.onReset=w.onReset,this.onUpdate=w.onUpdate}_addAttr(w,E){var S=this.node,_=S._id,p,d,g,m,x,P,O,R;if(g=v.tweens[_][w],g&&delete v.attrs[_][g][w],p=S.getAttr(w),e.Util._isArray(E))if(d=[],x=Math.max(E.length,p.length),w==="points"&&E.length!==p.length&&(E.length>p.length?(O=p,p=e.Util._prepareArrayForTween(p,E,S.closed())):(P=E,E=e.Util._prepareArrayForTween(E,p,S.closed()))),w.indexOf("fill")===0)for(m=0;m<x;m++)if(m%2===0)d.push(E[m]-p[m]);else{var T=e.Util.colorToRGBA(p[m]);R=e.Util.colorToRGBA(E[m]),p[m]=T,d.push({r:R.r-T.r,g:R.g-T.g,b:R.b-T.b,a:R.a-T.a})}else for(m=0;m<x;m++)d.push(E[m]-p[m]);else y.indexOf(w)!==-1?(p=e.Util.colorToRGBA(p),R=e.Util.colorToRGBA(E),d={r:R.r-p.r,g:R.g-p.g,b:R.b-p.b,a:R.a-p.a}):d=E-p;v.attrs[_][this._id][w]={start:p,diff:d,end:E,trueEnd:P,trueStart:O},v.tweens[_][w]=this._id}_tweenFunc(w){var E=this.node,S=v.attrs[E._id][this._id],_,p,d,g,m,x,P,O;for(_ in S){if(p=S[_],d=p.start,g=p.diff,O=p.end,e.Util._isArray(d))if(m=[],P=Math.max(d.length,O.length),_.indexOf("fill")===0)for(x=0;x<P;x++)x%2===0?m.push((d[x]||0)+g[x]*w):m.push("rgba("+Math.round(d[x].r+g[x].r*w)+","+Math.round(d[x].g+g[x].g*w)+","+Math.round(d[x].b+g[x].b*w)+","+(d[x].a+g[x].a*w)+")");else for(x=0;x<P;x++)m.push((d[x]||0)+g[x]*w);else y.indexOf(_)!==-1?m="rgba("+Math.round(d.r+g.r*w)+","+Math.round(d.g+g.g*w)+","+Math.round(d.b+g.b*w)+","+(d.a+g.a*w)+")":m=d+g*w;E.setAttr(_,m)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var w=this.node,E=v.attrs[w._id][this._id];E.points&&E.points.trueEnd&&w.setAttr("points",E.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var w=this.node,E=v.attrs[w._id][this._id];E.points&&E.points.trueStart&&w.points(E.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(w){return this.tween.seek(w*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var w=this.node._id,E=this._id,S=v.tweens[w],_;this.pause();for(_ in S)delete v.tweens[w][_];delete v.attrs[w][E]}}t.Tween=v,v.attrs={},v.tweens={},n.Node.prototype.to=function(h){var w=h.onFinish;h.node=this,h.onFinish=function(){this.destroy(),w&&w()};var E=new v(h);E.play()},t.Easings={BackEaseIn(h,w,E,S){var _=1.70158;return E*(h/=S)*h*((_+1)*h-_)+w},BackEaseOut(h,w,E,S){var _=1.70158;return E*((h=h/S-1)*h*((_+1)*h+_)+1)+w},BackEaseInOut(h,w,E,S){var _=1.70158;return(h/=S/2)<1?E/2*(h*h*(((_*=1.525)+1)*h-_))+w:E/2*((h-=2)*h*(((_*=1.525)+1)*h+_)+2)+w},ElasticEaseIn(h,w,E,S,_,p){var d=0;return h===0?w:(h/=S)===1?w+E:(p||(p=S*.3),!_||_<Math.abs(E)?(_=E,d=p/4):d=p/(2*Math.PI)*Math.asin(E/_),-(_*Math.pow(2,10*(h-=1))*Math.sin((h*S-d)*(2*Math.PI)/p))+w)},ElasticEaseOut(h,w,E,S,_,p){var d=0;return h===0?w:(h/=S)===1?w+E:(p||(p=S*.3),!_||_<Math.abs(E)?(_=E,d=p/4):d=p/(2*Math.PI)*Math.asin(E/_),_*Math.pow(2,-10*h)*Math.sin((h*S-d)*(2*Math.PI)/p)+E+w)},ElasticEaseInOut(h,w,E,S,_,p){var d=0;return h===0?w:(h/=S/2)===2?w+E:(p||(p=S*(.3*1.5)),!_||_<Math.abs(E)?(_=E,d=p/4):d=p/(2*Math.PI)*Math.asin(E/_),h<1?-.5*(_*Math.pow(2,10*(h-=1))*Math.sin((h*S-d)*(2*Math.PI)/p))+w:_*Math.pow(2,-10*(h-=1))*Math.sin((h*S-d)*(2*Math.PI)/p)*.5+E+w)},BounceEaseOut(h,w,E,S){return(h/=S)<1/2.75?E*(7.5625*h*h)+w:h<2/2.75?E*(7.5625*(h-=1.5/2.75)*h+.75)+w:h<2.5/2.75?E*(7.5625*(h-=2.25/2.75)*h+.9375)+w:E*(7.5625*(h-=2.625/2.75)*h+.984375)+w},BounceEaseIn(h,w,E,S){return E-t.Easings.BounceEaseOut(S-h,0,E,S)+w},BounceEaseInOut(h,w,E,S){return h<S/2?t.Easings.BounceEaseIn(h*2,0,E,S)*.5+w:t.Easings.BounceEaseOut(h*2-S,0,E,S)*.5+E*.5+w},EaseIn(h,w,E,S){return E*(h/=S)*h+w},EaseOut(h,w,E,S){return-E*(h/=S)*(h-2)+w},EaseInOut(h,w,E,S){return(h/=S/2)<1?E/2*h*h+w:-E/2*(--h*(h-2)-1)+w},StrongEaseIn(h,w,E,S){return E*(h/=S)*h*h*h*h+w},StrongEaseOut(h,w,E,S){return E*((h=h/S-1)*h*h*h*h+1)+w},StrongEaseInOut(h,w,E,S){return(h/=S/2)<1?E/2*h*h*h*h*h+w:E/2*((h-=2)*h*h*h*h+2)+w},Linear(h,w,E,S){return E*h/S+w}}})(_6);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;const e=lt,r=$t,n=Bt,i=Jo,a=v6,o=Sc,l=zh,u=Ts,f=Dh,y=ur,b=Cs,v=_6,h=Xi,w=ii;t.Konva=r.Util._assign(e.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:y.Shape,shapes:y.shapes,Animation:b.Animation,Tween:v.Tween,Easings:v.Easings,Context:h.Context,Canvas:w.Canvas}),t.default=t.Konva})(Xd);var Bh={};Object.defineProperty(Bh,"__esModule",{value:!0});Bh.Arc=void 0;const Uh=st,Sk=ur,rw=lt,Gh=Ve,Ek=lt;let ca=class extends Sk.Shape{_sceneFunc(e){var r=rw.Konva.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,r,n),e.arc(0,0,this.innerRadius(),r,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),r=this.outerRadius(),n=this.clockwise(),i=rw.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?e:r),y=o*r,b=l*(l>0?e:r),v=u*(u>0?r:e);return{x:f,y:n?-1*v:b,width:y-f,height:v-b}}};Bh.Arc=ca;ca.prototype._centroid=!0;ca.prototype.className="Arc";ca.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,Ek._registerNode)(ca);Uh.Factory.addGetterSetter(ca,"innerRadius",0,(0,Gh.getNumberValidator)());Uh.Factory.addGetterSetter(ca,"outerRadius",0,(0,Gh.getNumberValidator)());Uh.Factory.addGetterSetter(ca,"angle",0,(0,Gh.getNumberValidator)());Uh.Factory.addGetterSetter(ca,"clockwise",!1,(0,Gh.getBooleanValidator)());var Hh={},Ec={};Object.defineProperty(Ec,"__esModule",{value:!0});Ec.Line=void 0;const Vh=st,Ok=ur,w6=Ve,xk=lt;function Om(t,e,r,n,i,a,o){var l=Math.sqrt(Math.pow(r-t,2)+Math.pow(n-e,2)),u=Math.sqrt(Math.pow(i-r,2)+Math.pow(a-n,2)),f=o*l/(l+u),y=o*u/(l+u),b=r-f*(i-t),v=n-f*(a-e),h=r+y*(i-t),w=n+y*(a-e);return[b,v,h,w]}function nw(t,e){var r=t.length,n=[],i,a;for(i=2;i<r-2;i+=2)a=Om(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e),!isNaN(a[0])&&(n.push(a[0]),n.push(a[1]),n.push(t[i]),n.push(t[i+1]),n.push(a[2]),n.push(a[3]));return n}let to=class extends Ok.Shape{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){var r=this.points(),n=r.length,i=this.tension(),a=this.closed(),o=this.bezier(),l,u,f;if(n){if(e.beginPath(),e.moveTo(r[0],r[1]),i!==0&&n>4){for(l=this.getTensionPoints(),u=l.length,f=a?0:4,a||e.quadraticCurveTo(l[0],l[1],l[2],l[3]);f<u-2;)e.bezierCurveTo(l[f++],l[f++],l[f++],l[f++],l[f++],l[f++]);a||e.quadraticCurveTo(l[u-2],l[u-1],r[n-2],r[n-1])}else if(o)for(f=2;f<n;)e.bezierCurveTo(r[f++],r[f++],r[f++],r[f++],r[f++],r[f++]);else for(f=2;f<n;f+=2)e.lineTo(r[f],r[f+1]);a?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():nw(this.points(),this.tension())}_getTensionPointsClosed(){var e=this.points(),r=e.length,n=this.tension(),i=Om(e[r-2],e[r-1],e[0],e[1],e[2],e[3],n),a=Om(e[r-4],e[r-3],e[r-2],e[r-1],e[0],e[1],n),o=nw(e,n),l=[i[2],i[3]].concat(o).concat([a[0],a[1],e[r-2],e[r-1],a[2],a[3],i[0],i[1],e[0],e[1]]);return l}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:e=this.points();for(var r=e[0],n=e[0],i=e[1],a=e[1],o,l,u=0;u<e.length/2;u++)o=e[u*2],l=e[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}}};Ec.Line=to;to.prototype.className="Line";to.prototype._attrsAffectingSize=["points","bezier","tension"];(0,xk._registerNode)(to);Vh.Factory.addGetterSetter(to,"closed",!1);Vh.Factory.addGetterSetter(to,"bezier",!1);Vh.Factory.addGetterSetter(to,"tension",0,(0,w6.getNumberValidator)());Vh.Factory.addGetterSetter(to,"points",[],(0,w6.getNumberArrayValidator)());var Rs={},S6={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.t2length=t.getQuadraticArcLength=t.getCubicArcLength=t.binomialCoefficients=t.cValues=t.tValues=void 0,t.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]],t.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]],t.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const e=(o,l,u)=>{let f,y,b;f=u/2,y=0;for(let h=0;h<20;h++)b=f*t.tValues[20][h]+f,y+=t.cValues[20][h]*n(o,l,b);return f*y};t.getCubicArcLength=e;const r=(o,l,u)=>{u===void 0&&(u=1);const f=o[0]-2*o[1]+o[2],y=l[0]-2*l[1]+l[2],b=2*o[1]-2*o[0],v=2*l[1]-2*l[0],h=4*(f*f+y*y),w=4*(f*b+y*v),E=b*b+v*v;if(h===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(l[2]-l[0],2));const S=w/(2*h),_=E/h,p=u+S,d=_-S*S,g=p*p+d>0?Math.sqrt(p*p+d):0,m=S*S+d>0?Math.sqrt(S*S+d):0,x=S+Math.sqrt(S*S+d)!==0?d*Math.log(Math.abs((p+g)/(S+m))):0;return Math.sqrt(h)/2*(p*g-S*m+x)};t.getQuadraticArcLength=r;function n(o,l,u){const f=i(1,u,o),y=i(1,u,l),b=f*f+y*y;return Math.sqrt(b)}const i=(o,l,u)=>{const f=u.length-1;let y,b;if(f===0)return 0;if(o===0){b=0;for(let v=0;v<=f;v++)b+=t.binomialCoefficients[f][v]*Math.pow(1-l,f-v)*Math.pow(l,v)*u[v];return b}else{y=new Array(f);for(let v=0;v<f;v++)y[v]=f*(u[v+1]-u[v]);return i(o-1,l,y)}},a=(o,l,u)=>{let f=1,y=o/l,b=(o-u(y))/l,v=0;for(;f>.001;){const h=u(y+b),w=Math.abs(o-h)/l;if(w<f)f=w,y+=b;else{const E=u(y-b),S=Math.abs(o-E)/l;S<f?(f=S,y-=b):b/=2}if(v++,v>500)break}return y};t.t2length=a})(S6);Object.defineProperty(Rs,"__esModule",{value:!0});Rs.Path=void 0;const Pk=st,Ak=ur,kk=lt,Cl=S6;let Oc=class en extends Ak.Shape{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=en.parsePathData(this.data()),this.pathLength=en.getPathLength(this.dataArray)}_sceneFunc(e){var r=this.dataArray;e.beginPath();for(var n=!1,i=0;i<r.length;i++){var a=r[i].command,o=r[i].points;switch(a){case"L":e.lineTo(o[0],o[1]);break;case"M":e.moveTo(o[0],o[1]);break;case"C":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":e.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":var l=o[0],u=o[1],f=o[2],y=o[3],b=o[4],v=o[5],h=o[6],w=o[7],E=f>y?f:y,S=f>y?1:f/y,_=f>y?y/f:1;e.translate(l,u),e.rotate(h),e.scale(S,_),e.arc(0,0,E,b,b+v,1-w),e.scale(1/S,1/_),e.rotate(-h),e.translate(-l,-u);break;case"z":n=!0,e.closePath();break}}!n&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach(function(f){if(f.command==="A"){var y=f.points[4],b=f.points[5],v=f.points[4]+b,h=Math.PI/180;if(Math.abs(y-v)<h&&(h=Math.abs(y-v)),b<0)for(let w=y-h;w>v;w-=h){const E=en.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],w,0);e.push(E.x,E.y)}else for(let w=y+h;w<v;w+=h){const E=en.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],w,0);e.push(E.x,E.y)}}else if(f.command==="C")for(let w=0;w<=1;w+=.01){const E=en.getPointOnCubicBezier(w,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3],f.points[4],f.points[5]);e.push(E.x,E.y)}else e=e.concat(f.points)});for(var r=e[0],n=e[0],i=e[1],a=e[1],o,l,u=0;u<e.length/2;u++)o=e[u*2],l=e[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(e){return en.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,r,n,i){return Math.sqrt((n-e)*(n-e)+(i-r)*(i-r))}static getPathLength(e){let r=0;for(var n=0;n<e.length;++n)r+=e[n].pathLength;return r}static getPointAtLengthOfDataArray(e,r){var n,i=0,a=r.length;if(!a)return null;for(;i<a&&e>r[i].pathLength;)e-=r[i].pathLength,++i;if(i===a)return n=r[i-1].points.slice(-2),{x:n[0],y:n[1]};if(e<.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 en.getPointOnLine(e,o.start.x,o.start.y,l[0],l[1]);case"C":return en.getPointOnCubicBezier((0,Cl.t2length)(e,en.getPathLength(r),E=>(0,Cl.getCubicArcLength)([o.start.x,l[0],l[2],l[4]],[o.start.y,l[1],l[3],l[5]],E)),o.start.x,o.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return en.getPointOnQuadraticBezier((0,Cl.t2length)(e,en.getPathLength(r),E=>(0,Cl.getQuadraticArcLength)([o.start.x,l[0],l[2]],[o.start.y,l[1],l[3]],E)),o.start.x,o.start.y,l[0],l[1],l[2],l[3]);case"A":var u=l[0],f=l[1],y=l[2],b=l[3],v=l[4],h=l[5],w=l[6];return v+=h*e/o.pathLength,en.getPointOnEllipticalArc(u,f,y,b,v,w)}return null}static getPointOnLine(e,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(e*e/(1+u*u));i<r&&(f*=-1);var y=u*f,b;if(i===r)b={x:o,y:l+y};else if((l-n)/(o-r+1e-8)===u)b={x:o+f,y:l+y};else{var v,h,w=this.getLineLength(r,n,i,a),E=(o-r)*(i-r)+(l-n)*(a-n);E=E/(w*w),v=r+E*(i-r),h=n+E*(a-n);var S=this.getLineLength(o,l,v,h),_=Math.sqrt(e*e-S*S);f=Math.sqrt(_*_/(1+u*u)),i<r&&(f*=-1),y=u*f,b={x:v+f,y:h+y}}return b}static getPointOnCubicBezier(e,r,n,i,a,o,l,u,f){function y(S){return S*S*S}function b(S){return 3*S*S*(1-S)}function v(S){return 3*S*(1-S)*(1-S)}function h(S){return(1-S)*(1-S)*(1-S)}var w=u*y(e)+o*b(e)+i*v(e)+r*h(e),E=f*y(e)+l*b(e)+a*v(e)+n*h(e);return{x:w,y:E}}static getPointOnQuadraticBezier(e,r,n,i,a,o,l){function u(h){return h*h}function f(h){return 2*h*(1-h)}function y(h){return(1-h)*(1-h)}var b=o*u(e)+i*f(e)+r*y(e),v=l*u(e)+a*f(e)+n*y(e);return{x:b,y:v}}static getPointOnEllipticalArc(e,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:e+(f.x*l-f.y*u),y:r+(f.x*u+f.y*l)}}static parsePathData(e){if(!e)return[];var r=e,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,y=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,b;for(i=1;i<a.length;i++){var v=a[i],h=v.charAt(0);for(v=v.slice(1),l.length=0;b=y.exec(v);)l.push(b[0]);for(var w=[],E=0,S=l.length;E<S;E++){if(l[E]==="00"){w.push(0,0);continue}var _=parseFloat(l[E]);isNaN(_)?w.push(0):w.push(_)}for(;w.length>0&&!isNaN(w[0]);){var p="",d=[],g=u,m=f,x,P,O,R,T,C,N,F,H,z;switch(h){case"l":u+=w.shift(),f+=w.shift(),p="L",d.push(u,f);break;case"L":u=w.shift(),f=w.shift(),d.push(u,f);break;case"m":var Y=w.shift(),G=w.shift();if(u+=Y,f+=G,p="M",o.length>2&&o[o.length-1].command==="z"){for(var W=o.length-2;W>=0;W--)if(o[W].command==="M"){u=o[W].points[0]+Y,f=o[W].points[1]+G;break}}d.push(u,f),h="l";break;case"M":u=w.shift(),f=w.shift(),p="M",d.push(u,f),h="L";break;case"h":u+=w.shift(),p="L",d.push(u,f);break;case"H":u=w.shift(),p="L",d.push(u,f);break;case"v":f+=w.shift(),p="L",d.push(u,f);break;case"V":f=w.shift(),p="L",d.push(u,f);break;case"C":d.push(w.shift(),w.shift(),w.shift(),w.shift()),u=w.shift(),f=w.shift(),d.push(u,f);break;case"c":d.push(u+w.shift(),f+w.shift(),u+w.shift(),f+w.shift()),u+=w.shift(),f+=w.shift(),p="C",d.push(u,f);break;case"S":P=u,O=f,x=o[o.length-1],x.command==="C"&&(P=u+(u-x.points[2]),O=f+(f-x.points[3])),d.push(P,O,w.shift(),w.shift()),u=w.shift(),f=w.shift(),p="C",d.push(u,f);break;case"s":P=u,O=f,x=o[o.length-1],x.command==="C"&&(P=u+(u-x.points[2]),O=f+(f-x.points[3])),d.push(P,O,u+w.shift(),f+w.shift()),u+=w.shift(),f+=w.shift(),p="C",d.push(u,f);break;case"Q":d.push(w.shift(),w.shift()),u=w.shift(),f=w.shift(),d.push(u,f);break;case"q":d.push(u+w.shift(),f+w.shift()),u+=w.shift(),f+=w.shift(),p="Q",d.push(u,f);break;case"T":P=u,O=f,x=o[o.length-1],x.command==="Q"&&(P=u+(u-x.points[0]),O=f+(f-x.points[1])),u=w.shift(),f=w.shift(),p="Q",d.push(P,O,u,f);break;case"t":P=u,O=f,x=o[o.length-1],x.command==="Q"&&(P=u+(u-x.points[0]),O=f+(f-x.points[1])),u+=w.shift(),f+=w.shift(),p="Q",d.push(P,O,u,f);break;case"A":R=w.shift(),T=w.shift(),C=w.shift(),N=w.shift(),F=w.shift(),H=u,z=f,u=w.shift(),f=w.shift(),p="A",d=this.convertEndpointToCenterParameterization(H,z,u,f,N,F,R,T,C);break;case"a":R=w.shift(),T=w.shift(),C=w.shift(),N=w.shift(),F=w.shift(),H=u,z=f,u+=w.shift(),f+=w.shift(),p="A",d=this.convertEndpointToCenterParameterization(H,z,u,f,N,F,R,T,C);break}o.push({command:p||h,points:d,start:{x:g,y:m},pathLength:this.calcLength(g,m,p||h,d)})}(h==="z"||h==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(e,r,n,i){var a,o,l,u,f=en;switch(n){case"L":return f.getLineLength(e,r,i[0],i[1]);case"C":return(0,Cl.getCubicArcLength)([e,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return(0,Cl.getQuadraticArcLength)([e,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;var y=i[4],b=i[5],v=i[4]+b,h=Math.PI/180;if(Math.abs(y-v)<h&&(h=Math.abs(y-v)),o=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],y,0),b<0)for(u=y-h;u>v;u-=h)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;else for(u=y+h;u<v;u+=h)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;return l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],v,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),a}return 0}static convertEndpointToCenterParameterization(e,r,n,i,a,o,l,u,f){var y=f*(Math.PI/180),b=Math.cos(y)*(e-n)/2+Math.sin(y)*(r-i)/2,v=-1*Math.sin(y)*(e-n)/2+Math.cos(y)*(r-i)/2,h=b*b/(l*l)+v*v/(u*u);h>1&&(l*=Math.sqrt(h),u*=Math.sqrt(h));var w=Math.sqrt((l*l*(u*u)-l*l*(v*v)-u*u*(b*b))/(l*l*(v*v)+u*u*(b*b)));a===o&&(w*=-1),isNaN(w)&&(w=0);var E=w*l*v/u,S=w*-u*b/l,_=(e+n)/2+Math.cos(y)*E-Math.sin(y)*S,p=(r+i)/2+Math.sin(y)*E+Math.cos(y)*S,d=function(T){return Math.sqrt(T[0]*T[0]+T[1]*T[1])},g=function(T,C){return(T[0]*C[0]+T[1]*C[1])/(d(T)*d(C))},m=function(T,C){return(T[0]*C[1]<T[1]*C[0]?-1:1)*Math.acos(g(T,C))},x=m([1,0],[(b-E)/l,(v-S)/u]),P=[(b-E)/l,(v-S)/u],O=[(-1*b-E)/l,(-1*v-S)/u],R=m(P,O);return g(P,O)<=-1&&(R=Math.PI),g(P,O)>=1&&(R=0),o===0&&R>0&&(R=R-2*Math.PI),o===1&&R<0&&(R=R+2*Math.PI),[_,p,l,u,x,R,y,o]}};Rs.Path=Oc;Oc.prototype.className="Path";Oc.prototype._attrsAffectingSize=["data"];(0,kk._registerNode)(Oc);Pk.Factory.addGetterSetter(Oc,"data");Object.defineProperty(Hh,"__esModule",{value:!0});Hh.Arrow=void 0;const qh=st,Tk=Ec,E6=Ve,Ck=lt,iw=Rs;let tl=class extends Tk.Line{_sceneFunc(e){super._sceneFunc(e);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 v=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],n[l-2],n[l-1]],h=iw.Path.calcLength(i[i.length-4],i[i.length-3],"C",v),w=iw.Path.getPointOnQuadraticBezier(Math.min(1,1-o/h),v[0],v[1],v[2],v[3],v[4],v[5]);u=n[l-2]-w.x,f=n[l-1]-w.y}else u=n[l-2]-n[l-4],f=n[l-1]-n[l-3];var y=(Math.atan2(f,u)+r)%r,b=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[l-2],n[l-1]),e.rotate(y),e.moveTo(0,0),e.lineTo(-o,b/2),e.lineTo(-o,-b/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.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]),e.rotate((Math.atan2(-f,-u)+r)%r),e.moveTo(0,0),e.lineTo(-o,b/2),e.lineTo(-o,-b/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var r=this.dashEnabled();r&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),r&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),r=this.pointerWidth()/2;return{x:e.x-r,y:e.y-r,width:e.width+r*2,height:e.height+r*2}}};Hh.Arrow=tl;tl.prototype.className="Arrow";(0,Ck._registerNode)(tl);qh.Factory.addGetterSetter(tl,"pointerLength",10,(0,E6.getNumberValidator)());qh.Factory.addGetterSetter(tl,"pointerWidth",10,(0,E6.getNumberValidator)());qh.Factory.addGetterSetter(tl,"pointerAtBeginning",!1);qh.Factory.addGetterSetter(tl,"pointerAtEnding",!0);var $h={};Object.defineProperty($h,"__esModule",{value:!0});$h.Circle=void 0;const Rk=st,Nk=ur,Mk=Ve,Ik=lt;let Ns=class extends Nk.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};$h.Circle=Ns;Ns.prototype._centroid=!0;Ns.prototype.className="Circle";Ns.prototype._attrsAffectingSize=["radius"];(0,Ik._registerNode)(Ns);Rk.Factory.addGetterSetter(Ns,"radius",0,(0,Mk.getNumberValidator)());var Wh={};Object.defineProperty(Wh,"__esModule",{value:!0});Wh.Ellipse=void 0;const t1=st,Lk=ur,O6=Ve,jk=lt;let ro=class extends Lk.Shape{_sceneFunc(e){var r=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),r!==n&&e.scale(1,n/r),e.arc(0,0,r,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}};Wh.Ellipse=ro;ro.prototype.className="Ellipse";ro.prototype._centroid=!0;ro.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,jk._registerNode)(ro);t1.Factory.addComponentsGetterSetter(ro,"radius",["x","y"]);t1.Factory.addGetterSetter(ro,"radiusX",0,(0,O6.getNumberValidator)());t1.Factory.addGetterSetter(ro,"radiusY",0,(0,O6.getNumberValidator)());var Yh={};Object.defineProperty(Yh,"__esModule",{value:!0});Yh.Image=void 0;const kv=$t,rl=st,Dk=ur,Fk=lt,xc=Ve;let Ci=class x6 extends Dk.Shape{constructor(e){super(e),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){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)&&(e.beginPath(),i?kv.Util.drawRoundedRectPath(e,r,n,i):e.rect(0,0,r,n),e.closePath(),e.fillStrokeShape(this)),a&&(i&&e.clip(),e.drawImage.apply(e,o))}_hitFunc(e){var r=this.width(),n=this.height(),i=this.cornerRadius();e.beginPath(),i?kv.Util.drawRoundedRectPath(e,r,n,i):e.rect(0,0,r,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,r;return(e=this.attrs.width)!==null&&e!==void 0?e:(r=this.image())===null||r===void 0?void 0:r.width}getHeight(){var e,r;return(e=this.attrs.height)!==null&&e!==void 0?e:(r=this.image())===null||r===void 0?void 0:r.height}static fromURL(e,r,n=null){var i=kv.Util.createImageElement();i.onload=function(){var a=new x6({image:i});r(a)},i.onerror=n,i.crossOrigin="Anonymous",i.src=e}};Yh.Image=Ci;Ci.prototype.className="Image";(0,Fk._registerNode)(Ci);rl.Factory.addGetterSetter(Ci,"cornerRadius",0,(0,xc.getNumberOrArrayOfNumbersValidator)(4));rl.Factory.addGetterSetter(Ci,"image");rl.Factory.addComponentsGetterSetter(Ci,"crop",["x","y","width","height"]);rl.Factory.addGetterSetter(Ci,"cropX",0,(0,xc.getNumberValidator)());rl.Factory.addGetterSetter(Ci,"cropY",0,(0,xc.getNumberValidator)());rl.Factory.addGetterSetter(Ci,"cropWidth",0,(0,xc.getNumberValidator)());rl.Factory.addGetterSetter(Ci,"cropHeight",0,(0,xc.getNumberValidator)());var gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.Tag=gs.Label=void 0;const Kh=st,zk=ur,Bk=Ts,r1=Ve,P6=lt;var A6=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Uk="Change.konva",Gk="none",xm="up",Pm="right",Am="down",km="left",Hk=A6.length;let n1=class extends Bk.Group{constructor(e){super(e),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(e){var r=this,n,i=function(){r._sync()};for(n=0;n<Hk;n++)e.on(A6[n]+Uk,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var e=this.getText(),r=this.getTag(),n,i,a,o,l,u,f;if(e&&r){switch(n=e.width(),i=e.height(),a=r.pointerDirection(),o=r.pointerWidth(),f=r.pointerHeight(),l=0,u=0,a){case xm:l=n/2,u=-1*f;break;case Pm:l=n+o,u=i/2;break;case Am:l=n/2,u=i+f;break;case km:l=-1*o,u=i/2;break}r.setAttrs({x:-1*l,y:-1*u,width:n,height:i}),e.setAttrs({x:-1*l,y:-1*u})}}};gs.Label=n1;n1.prototype.className="Label";(0,P6._registerNode)(n1);let nl=class extends zk.Shape{_sceneFunc(e){var r=this.width(),n=this.height(),i=this.pointerDirection(),a=this.pointerWidth(),o=this.pointerHeight(),l=this.cornerRadius();let u=0,f=0,y=0,b=0;typeof l=="number"?u=f=y=b=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),b=Math.min(l[2]||0,r/2,n/2),y=Math.min(l[3]||0,r/2,n/2)),e.beginPath(),e.moveTo(u,0),i===xm&&(e.lineTo((r-a)/2,0),e.lineTo(r/2,-1*o),e.lineTo((r+a)/2,0)),e.lineTo(r-f,0),e.arc(r-f,f,f,Math.PI*3/2,0,!1),i===Pm&&(e.lineTo(r,(n-o)/2),e.lineTo(r+a,n/2),e.lineTo(r,(n+o)/2)),e.lineTo(r,n-b),e.arc(r-b,n-b,b,0,Math.PI/2,!1),i===Am&&(e.lineTo((r+a)/2,n),e.lineTo(r/2,n+o),e.lineTo((r-a)/2,n)),e.lineTo(y,n),e.arc(y,n-y,y,Math.PI/2,Math.PI,!1),i===km&&(e.lineTo(0,(n+o)/2),e.lineTo(-1*a,n/2),e.lineTo(0,(n-o)/2)),e.lineTo(0,u),e.arc(u,u,u,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){var e=0,r=0,n=this.pointerWidth(),i=this.pointerHeight(),a=this.pointerDirection(),o=this.width(),l=this.height();return a===xm?(r-=i,l+=i):a===Am?l+=i:a===km?(e-=n*1.5,o+=n):a===Pm&&(o+=n*1.5),{x:e,y:r,width:o,height:l}}};gs.Tag=nl;nl.prototype.className="Tag";(0,P6._registerNode)(nl);Kh.Factory.addGetterSetter(nl,"pointerDirection",Gk);Kh.Factory.addGetterSetter(nl,"pointerWidth",0,(0,r1.getNumberValidator)());Kh.Factory.addGetterSetter(nl,"pointerHeight",0,(0,r1.getNumberValidator)());Kh.Factory.addGetterSetter(nl,"cornerRadius",0,(0,r1.getNumberOrArrayOfNumbersValidator)(4));var Pc={};Object.defineProperty(Pc,"__esModule",{value:!0});Pc.Rect=void 0;const Vk=st,qk=ur,$k=lt,Wk=$t,Yk=Ve;let Xh=class extends qk.Shape{_sceneFunc(e){var r=this.cornerRadius(),n=this.width(),i=this.height();e.beginPath(),r?Wk.Util.drawRoundedRectPath(e,n,i,r):e.rect(0,0,n,i),e.closePath(),e.fillStrokeShape(this)}};Pc.Rect=Xh;Xh.prototype.className="Rect";(0,$k._registerNode)(Xh);Vk.Factory.addGetterSetter(Xh,"cornerRadius",0,(0,Yk.getNumberOrArrayOfNumbersValidator)(4));var Qh={};Object.defineProperty(Qh,"__esModule",{value:!0});Qh.RegularPolygon=void 0;const k6=st,Kk=ur,T6=Ve,Xk=lt;let il=class extends Kk.Shape{_sceneFunc(e){const r=this._getPoints();e.beginPath(),e.moveTo(r[0].x,r[0].y);for(var n=1;n<r.length;n++)e.lineTo(r[n].x,r[n].y);e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,r=this.attrs.radius||0,n=[];for(var i=0;i<e;i++)n.push({x:r*Math.sin(i*2*Math.PI/e),y:-1*r*Math.cos(i*2*Math.PI/e)});return n}getSelfRect(){const e=this._getPoints();var r=e[0].x,n=e[0].y,i=e[0].x,a=e[0].y;return e.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(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};Qh.RegularPolygon=il;il.prototype.className="RegularPolygon";il.prototype._centroid=!0;il.prototype._attrsAffectingSize=["radius"];(0,Xk._registerNode)(il);k6.Factory.addGetterSetter(il,"radius",0,(0,T6.getNumberValidator)());k6.Factory.addGetterSetter(il,"sides",0,(0,T6.getNumberValidator)());var Zh={};Object.defineProperty(Zh,"__esModule",{value:!0});Zh.Ring=void 0;const C6=st,Qk=ur,R6=Ve,Zk=lt;var aw=Math.PI*2;let al=class extends Qk.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,aw,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),aw,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};Zh.Ring=al;al.prototype.className="Ring";al.prototype._centroid=!0;al.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,Zk._registerNode)(al);C6.Factory.addGetterSetter(al,"innerRadius",0,(0,R6.getNumberValidator)());C6.Factory.addGetterSetter(al,"outerRadius",0,(0,R6.getNumberValidator)());var Jh={};Object.defineProperty(Jh,"__esModule",{value:!0});Jh.Sprite=void 0;const ol=st,Jk=ur,eT=Cs,N6=Ve,tT=lt;let Ri=class extends Jk.Shape{constructor(e){super(e),this._updated=!0,this.anim=new eT.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(e){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],y=a[i+3],b=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,f,y),e.closePath(),e.fillStrokeShape(this)),b)if(o){var v=o[r],h=n*2;e.drawImage(b,l,u,f,y,v[h+0],v[h+1],f,y)}else e.drawImage(b,l,u,f,y,0,0,f,y)}_hitFunc(e){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(e.beginPath(),o){var f=o[r],y=n*2;e.rect(f[y+0],f[y+1],l,u)}else e.rect(0,0,l,u);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),r=this.animation(),n=this.animations(),i=n[r],a=i.length/4;e<a-1?this.frameIndex(e+1):this.frameIndex(0)}};Jh.Sprite=Ri;Ri.prototype.className="Sprite";(0,tT._registerNode)(Ri);ol.Factory.addGetterSetter(Ri,"animation");ol.Factory.addGetterSetter(Ri,"animations");ol.Factory.addGetterSetter(Ri,"frameOffsets");ol.Factory.addGetterSetter(Ri,"image");ol.Factory.addGetterSetter(Ri,"frameIndex",0,(0,N6.getNumberValidator)());ol.Factory.addGetterSetter(Ri,"frameRate",17,(0,N6.getNumberValidator)());ol.Factory.backCompat(Ri,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var ep={};Object.defineProperty(ep,"__esModule",{value:!0});ep.Star=void 0;const i1=st,rT=ur,a1=Ve,nT=lt;let no=class extends rT.Shape{_sceneFunc(e){var r=this.innerRadius(),n=this.outerRadius(),i=this.numPoints();e.beginPath(),e.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);e.lineTo(l,u)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};ep.Star=no;no.prototype.className="Star";no.prototype._centroid=!0;no.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,nT._registerNode)(no);i1.Factory.addGetterSetter(no,"numPoints",5,(0,a1.getNumberValidator)());i1.Factory.addGetterSetter(no,"innerRadius",0,(0,a1.getNumberValidator)());i1.Factory.addGetterSetter(no,"outerRadius",0,(0,a1.getNumberValidator)());var Wo={};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.Text=Wo.stringToArray=void 0;const Tm=$t,Fr=st,iT=ur,io=Ve,aT=lt;function M6(t){return Array.from(t)}Wo.stringToArray=M6;var Rl="auto",oT="center",I6="inherit",cu="justify",lT="Change.konva",sT="2d",ow="-",L6="left",uT="text",cT="Text",fT="top",dT="bottom",lw="middle",j6="normal",hT="px ",Kf=" ",pT="right",sw="rtl",gT="word",vT="char",uw="none",Tv="…",D6=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],mT=D6.length;function yT(t){return t.split(",").map(e=>{e=e.trim();const r=e.indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return r&&!n&&(e=`"${e}"`),e}).join(", ")}var Xf;function Cv(){return Xf||(Xf=Tm.Util.createCanvasElement().getContext(sT),Xf)}function bT(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function _T(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function wT(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let Xt=class extends iT.Shape{constructor(e){super(wT(e)),this._partialTextX=0,this._partialTextY=0;for(var r=0;r<mT;r++)this.on(D6[r]+lT,this._setTextData);this._setTextData()}_sceneFunc(e){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,y=this.align(),b=this.getWidth(),v=this.letterSpacing(),h=this.fill(),w=this.textDecoration(),E=w.indexOf("underline")!==-1,S=w.indexOf("line-through")!==-1,_;u=u===I6?e.direction:u;var p=0,p=o/2,d=0,g=0;for(u===sw&&e.setAttr("direction",u),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",lw),e.setAttr("textAlign",L6),l===lw?f=(this.getHeight()-n*o-i*2)/2:l===dT&&(f=this.getHeight()-n*o-i*2),e.translate(i,f+i),_=0;_<n;_++){var d=0,g=0,m=r[_],x=m.text,P=m.width,O=m.lastInParagraph,R,T,C;if(e.save(),y===pT?d+=b-P-i*2:y===oT&&(d+=(b-P-i*2)/2),E){e.save(),e.beginPath(),e.moveTo(d,p+g+Math.round(a/2)),R=x.split(" ").length-1,T=R===0,C=y===cu&&!O?b-i*2:P,e.lineTo(d+Math.round(C),p+g+Math.round(a/2)),e.lineWidth=a/15;const G=this._getLinearGradient();e.strokeStyle=G||h,e.stroke(),e.restore()}if(S){e.save(),e.beginPath(),e.moveTo(d,p+g),R=x.split(" ").length-1,T=R===0,C=y===cu&&O&&!T?b-i*2:P,e.lineTo(d+Math.round(C),p+g),e.lineWidth=a/15;const G=this._getLinearGradient();e.strokeStyle=G||h,e.stroke(),e.restore()}if(u!==sw&&(v!==0||y===cu)){R=x.split(" ").length-1;for(var N=M6(x),F=0;F<N.length;F++){var H=N[F];H===" "&&!O&&y===cu&&(d+=(b-i*2-P)/R),this._partialTextX=d,this._partialTextY=p+g,this._partialText=H,e.fillStrokeShape(this),d+=this.measureSize(H).width+v}}else v!==0&&e.setAttr("letterSpacing",`${v}px`),this._partialTextX=d,this._partialTextY=p+g,this._partialText=x,e.fillStrokeShape(this);e.restore(),n>1&&(p+=o)}}}_hitFunc(e){var r=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,r,n),e.closePath(),e.fillStrokeShape(this)}setText(e){var r=Tm.Util._isString(e)?e:e==null?"":e+"";return this._setAttr(uT,r),this}getWidth(){var e=this.attrs.width===Rl||this.attrs.width===void 0;return e?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var e=this.attrs.height===Rl||this.attrs.height===void 0;return e?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return Tm.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var r=Cv(),n=this.fontSize(),i;return r.save(),r.font=this._getContextFont(),i=r.measureText(e),r.restore(),{width:i.width,height:n}}_getContextFont(){return this.fontStyle()+Kf+this.fontVariant()+Kf+(this.fontSize()+hT)+yT(this.fontFamily())}_addTextLine(e){this.align()===cu&&(e=e.trim());var n=this._getTextWidth(e);return this.textArr.push({text:e,width:n,lastInParagraph:!1})}_getTextWidth(e){var r=this.letterSpacing(),n=e.length;return Cv().measureText(e).width+(n?r*(n-1):0)}_setTextData(){var e=this.text().split(`
42
+ `),r=+this.fontSize(),n=0,i=this.lineHeight()*r,a=this.attrs.width,o=this.attrs.height,l=a!==Rl&&a!==void 0,u=o!==Rl&&o!==void 0,f=this.padding(),y=a-f*2,b=o-f*2,v=0,h=this.wrap(),w=h!==uw,E=h!==vT&&w,S=this.ellipsis();this.textArr=[],Cv().font=this._getContextFont();for(var _=S?this._getTextWidth(Tv):0,p=0,d=e.length;p<d;++p){var g=e[p],m=this._getTextWidth(g);if(l&&m>y)for(;g.length>0;){for(var x=0,P=g.length,O="",R=0;x<P;){var T=x+P>>>1,C=g.slice(0,T+1),N=this._getTextWidth(C)+_;N<=y?(x=T+1,O=C,R=N):P=T}if(O){if(E){var F,H=g[O.length],z=H===Kf||H===ow;z&&R<=y?F=O.length:F=Math.max(O.lastIndexOf(Kf),O.lastIndexOf(ow))+1,F>0&&(x=F,O=O.slice(0,x),R=this._getTextWidth(O))}O=O.trimRight(),this._addTextLine(O),n=Math.max(n,R),v+=i;var Y=this._shouldHandleEllipsis(v);if(Y){this._tryToAddEllipsisToLastLine();break}if(g=g.slice(x),g=g.trimLeft(),g.length>0&&(m=this._getTextWidth(g),m<=y)){this._addTextLine(g),v+=i,n=Math.max(n,m);break}}else break}else this._addTextLine(g),v+=i,n=Math.max(n,m),this._shouldHandleEllipsis(v)&&p<d-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&v+i>b)break}this.textHeight=r,this.textWidth=n}_shouldHandleEllipsis(e){var r=+this.fontSize(),n=this.lineHeight()*r,i=this.attrs.height,a=i!==Rl&&i!==void 0,o=this.padding(),l=i-o*2,u=this.wrap(),f=u!==uw;return!f||a&&e+n>l}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,r=e!==Rl&&e!==void 0,n=this.padding(),i=e-n*2,a=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(!(!o||!a)){if(r){var l=this._getTextWidth(o.text+Tv)<i;l||(o.text=o.text.slice(0,o.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+Tv)}}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,r=this.hasShadow();return e&&r?!0:super._useBufferCanvas()}};Wo.Text=Xt;Xt.prototype._fillFunc=bT;Xt.prototype._strokeFunc=_T;Xt.prototype.className=cT;Xt.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,aT._registerNode)(Xt);Fr.Factory.overWriteSetter(Xt,"width",(0,io.getNumberOrAutoValidator)());Fr.Factory.overWriteSetter(Xt,"height",(0,io.getNumberOrAutoValidator)());Fr.Factory.addGetterSetter(Xt,"direction",I6);Fr.Factory.addGetterSetter(Xt,"fontFamily","Arial");Fr.Factory.addGetterSetter(Xt,"fontSize",12,(0,io.getNumberValidator)());Fr.Factory.addGetterSetter(Xt,"fontStyle",j6);Fr.Factory.addGetterSetter(Xt,"fontVariant",j6);Fr.Factory.addGetterSetter(Xt,"padding",0,(0,io.getNumberValidator)());Fr.Factory.addGetterSetter(Xt,"align",L6);Fr.Factory.addGetterSetter(Xt,"verticalAlign",fT);Fr.Factory.addGetterSetter(Xt,"lineHeight",1,(0,io.getNumberValidator)());Fr.Factory.addGetterSetter(Xt,"wrap",gT);Fr.Factory.addGetterSetter(Xt,"ellipsis",!1,(0,io.getBooleanValidator)());Fr.Factory.addGetterSetter(Xt,"letterSpacing",0,(0,io.getNumberValidator)());Fr.Factory.addGetterSetter(Xt,"text","",(0,io.getStringValidator)());Fr.Factory.addGetterSetter(Xt,"textDecoration","");var tp={};Object.defineProperty(tp,"__esModule",{value:!0});tp.TextPath=void 0;const Rv=$t,li=st,ST=ur,fu=Rs,Nv=Wo,F6=Ve,ET=lt;var OT="",z6="normal";function B6(t){t.fillText(this.partialText,0,0)}function U6(t){t.strokeText(this.partialText,0,0)}let cr=class extends ST.Shape{constructor(e){super(e),this.dummyCanvas=Rv.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 fu.Path.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const r=this.pathLength;return e-1>r?null:fu.Path.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=fu.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();var r=this.textDecoration(),n=this.fill(),i=this.fontSize(),a=this.glyphInfo;r==="underline"&&e.beginPath();for(var o=0;o<a.length;o++){e.save();var l=a[o].p0;e.translate(l.x,l.y),e.rotate(a[o].rotation),this.partialText=a[o].text,e.fillStrokeShape(this),r==="underline"&&(o===0&&e.moveTo(0,i/2+1),e.lineTo(i,i/2+1)),e.restore()}r==="underline"&&(e.strokeStyle=n,e.lineWidth=i/20,e.stroke()),e.restore()}_hitFunc(e){e.beginPath();var r=this.glyphInfo;if(r.length>=1){var n=r[0].p0;e.moveTo(n.x,n.y)}for(var i=0;i<r.length;i++){var a=r[i].p1;e.lineTo(a.x,a.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return Rv.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return Nv.Text.prototype.setText.call(this,e)}_getContextFont(){return Nv.Text.prototype._getContextFont.call(this)}_getTextSize(e){var r=this.dummyCanvas,n=r.getContext("2d");n.save(),n.font=this._getContextFont();var i=n.measureText(e);return n.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:e,height:r}=this._getTextSize(this.attrs.text);if(this.textWidth=e,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,Nv.stringToArray)(this.text());let f=l;for(var y=0;y<u.length;y++){const b=this._getPointAtLength(f);if(!b)return;let v=this._getTextSize(u[y]).width+n;if(u[y]===" "&&i==="justify"){const p=this.text().split(" ").length-1;v+=(this.pathLength-o)/p}const h=this._getPointAtLength(f+v);if(!h)return;const w=fu.Path.getLineLength(b.x,b.y,h.x,h.y);let E=0;if(a)try{E=a(u[y-1],u[y])*this.fontSize()}catch{E=0}b.x+=E,h.x+=E,this.textWidth+=E;const S=fu.Path.getPointOnLine(E+w/2,b.x,b.y,h.x,h.y),_=Math.atan2(h.y-b.y,h.x-b.x);this.glyphInfo.push({transposeX:S.x,transposeY:S.y,text:u[y],rotation:_,p0:b,p1:h}),f+=v}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var e=[];this.glyphInfo.forEach(function(y){e.push(y.p0.x),e.push(y.p0.y),e.push(y.p1.x),e.push(y.p1.y)});for(var r=e[0]||0,n=e[0]||0,i=e[1]||0,a=e[1]||0,o,l,u=0;u<e.length/2;u++)o=e[u*2],l=e[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 Rv.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};tp.TextPath=cr;cr.prototype._fillFunc=B6;cr.prototype._strokeFunc=U6;cr.prototype._fillFuncHit=B6;cr.prototype._strokeFuncHit=U6;cr.prototype.className="TextPath";cr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,ET._registerNode)(cr);li.Factory.addGetterSetter(cr,"data");li.Factory.addGetterSetter(cr,"fontFamily","Arial");li.Factory.addGetterSetter(cr,"fontSize",12,(0,F6.getNumberValidator)());li.Factory.addGetterSetter(cr,"fontStyle",z6);li.Factory.addGetterSetter(cr,"align","left");li.Factory.addGetterSetter(cr,"letterSpacing",0,(0,F6.getNumberValidator)());li.Factory.addGetterSetter(cr,"textBaseline","middle");li.Factory.addGetterSetter(cr,"fontVariant",z6);li.Factory.addGetterSetter(cr,"text",OT);li.Factory.addGetterSetter(cr,"textDecoration",null);li.Factory.addGetterSetter(cr,"kerningFunc",null);var rp={};Object.defineProperty(rp,"__esModule",{value:!0});rp.Transformer=void 0;const xt=$t,St=st,cw=Bt,xT=ur,PT=Pc,fw=Ts,Kn=lt,ao=Ve,AT=lt;var G6="tr-konva",kT=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${G6}`).join(" "),dw="nodesRect",TT=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],CT={"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 RT="ontouchstart"in Kn.Konva._global;function NT(t,e,r){if(t==="rotater")return r;e+=xt.Util.degToRad(CT[t]||0);var n=(xt.Util.radToDeg(e)%360+360)%360;return xt.Util._inRange(n,315+22.5,360)||xt.Util._inRange(n,0,22.5)?"ns-resize":xt.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":xt.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":xt.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":xt.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":xt.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":xt.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":xt.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(xt.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var Zd=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],hw=1e8;function MT(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}function H6(t,e,r){const n=r.x+(t.x-r.x)*Math.cos(e)-(t.y-r.y)*Math.sin(e),i=r.y+(t.x-r.x)*Math.sin(e)+(t.y-r.y)*Math.cos(e);return{...t,rotation:t.rotation+e,x:n,y:i}}function IT(t,e){const r=MT(t);return H6(t,e,r)}function LT(t,e,r){let n=e;for(let i=0;i<t.length;i++){const a=Kn.Konva.getAngle(t[i]),o=Math.abs(a-e)%(Math.PI*2);Math.min(o,Math.PI*2-o)<r&&(n=a)}return n}let gt=class extends fw.Group{constructor(e){super(e),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(kT,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return xt.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return G6+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const r=e.filter(i=>i.isAncestorOf(this)?(xt.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=e=r,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[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(TT.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(e){let r;e.on(`dragstart.${this._getEventNamespace()}`,n=>{r=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(n,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!r)return;const i=e.getAbsolutePosition(),a=i.x-r.x,o=i.y-r.y;this.nodes().forEach(l=>{if(l===e||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(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(dw),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(dw,this.__getNodeRect)}__getNodeShape(e,r=this.rotation(),n){var i=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=e.getAbsoluteScale(n),o=e.getAbsolutePosition(n),l=i.x*a.x-e.offsetX()*a.x,u=i.y*a.y-e.offsetY()*a.y;const f=(Kn.Konva.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),y={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 H6(y,-Kn.Konva.getAngle(r),{x:0,y:0})}__getNodeRect(){var e=this.getNode();if(!e)return{x:-hw,y:-hw,width:0,height:0,rotation:0};const r=[];this.nodes().map(f=>{const y=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var b=[{x:y.x,y:y.y},{x:y.x+y.width,y:y.y},{x:y.x+y.width,y:y.y+y.height},{x:y.x,y:y.y+y.height}],v=f.getAbsoluteTransform();b.forEach(function(h){var w=v.point(h);r.push(w)})});const n=new xt.Transform;n.rotate(-Kn.Konva.getAngle(this.rotation()));var i=1/0,a=1/0,o=-1/0,l=-1/0;r.forEach(function(f){var y=n.point(f);i===void 0&&(i=o=y.x,a=l=y.y),i=Math.min(i,y.x),a=Math.min(a,y.y),o=Math.max(o,y.x),l=Math.max(l,y.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:Kn.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(),Zd.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater")}_createAnchor(e){var r=new PT.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:RT?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=Kn.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=NT(e,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 e=new xT.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()&&r.lineTo(n.width()/2,-i.rotateAnchorOffset()*xt.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(e),this._proxyDrag(e),e.on("dragstart",r=>{r.cancelBubble=!0}),e.on("dragmove",r=>{r.cancelBubble=!0}),e.on("dragend",r=>{r.cancelBubble=!0}),this.on("dragmove",r=>{this.update()})}_handleMouseDown(e){this._movingAnchorName=e.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=e.target.getAbsolutePosition(),l=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:l.x-o.x,y:l.y-o.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(u=>{u._fire("transformstart",{evt:e.evt,target:u})})}_handleMouseMove(e){var r,n,i,a=this.findOne("."+this._movingAnchorName),o=a.getStage();o.setPointersPositions(e);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,e)),a.setAbsolutePosition(u);const y=a.getAbsolutePosition();if(!(f.x===y.x&&f.y===y.y)){if(this._movingAnchorName==="rotater"){var b=this._getNodeRect();r=a.x()-b.width/2,n=-a.y()+b.height/2;let F=Math.atan2(-n,r)+Math.PI/2;b.height<0&&(F-=Math.PI);var v=Kn.Konva.getAngle(this.rotation());const H=v+F,z=Kn.Konva.getAngle(this.rotationSnapTolerance()),G=LT(this.rotationSnaps(),H,z)-b.rotation,W=IT(b,G);this._fitNodesInto(W,e);return}var h=this.shiftBehavior(),w;h==="inverted"?w=this.keepRatio()&&!e.shiftKey:h==="none"?w=this.keepRatio():w=this.keepRatio()||e.shiftKey;var d=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(w){var E=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(E.x-a.x(),2)+Math.pow(E.y-a.y(),2));var S=this.findOne(".top-left").x()>E.x?-1:1,_=this.findOne(".top-left").y()>E.y?-1:1;r=i*this.cos*S,n=i*this.sin*_,this.findOne(".top-left").x(E.x-r),this.findOne(".top-left").y(E.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(w){var E=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()-E.x,2)+Math.pow(E.y-a.y(),2));var S=this.findOne(".top-right").x()<E.x?-1:1,_=this.findOne(".top-right").y()>E.y?-1:1;r=i*this.cos*S,n=i*this.sin*_,this.findOne(".top-right").x(E.x+r),this.findOne(".top-right").y(E.y-n)}var p=a.position();this.findOne(".top-left").y(p.y),this.findOne(".bottom-right").x(p.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(w){var E=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(E.x-a.x(),2)+Math.pow(a.y()-E.y,2));var S=E.x<a.x()?-1:1,_=a.y()<E.y?-1:1;r=i*this.cos*S,n=i*this.sin*_,a.x(E.x-r),a.y(E.y+n)}p=a.position(),this.findOne(".top-left").x(p.x),this.findOne(".bottom-right").y(p.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(w){var E=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()-E.x,2)+Math.pow(a.y()-E.y,2));var S=this.findOne(".bottom-right").x()<E.x?-1:1,_=this.findOne(".bottom-right").y()<E.y?-1:1;r=i*this.cos*S,n=i*this.sin*_,this.findOne(".bottom-right").x(E.x+r),this.findOne(".bottom-right").y(E.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var d=this.centeredScaling()||e.altKey;if(d){var g=this.findOne(".top-left"),m=this.findOne(".bottom-right"),x=g.x(),P=g.y(),O=this.getWidth()-m.x(),R=this.getHeight()-m.y();m.move({x:-x,y:-P}),g.move({x:O,y:R})}var T=this.findOne(".top-left").getAbsolutePosition();r=T.x,n=T.y;var C=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),N=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:r,y:n,width:C,height:N,rotation:Kn.Konva.getAngle(this.rotation())},e)}}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){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 r=this.getNode();this._fire("transformend",{evt:e,target:r}),r&&this._nodes.forEach(n=>{n._fire("transformend",{evt:e,target:n})}),this._movingAnchorName=null}}_fitNodesInto(e,r){var n=this._getNodeRect();const i=1;if(xt.Util._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(xt.Util._inRange(e.height,-this.padding()*2-i,i)){this.update();return}const a=this.flipEnabled();var o=new xt.Transform;if(o.rotate(Kn.Konva.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const b=o.point({x:-this.padding()*2,y:0});if(e.x+=b.x,e.y+=b.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=b.x,this._anchorDragOffset.y-=b.y,!a){this.update();return}}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const b=o.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=b.x,this._anchorDragOffset.y-=b.y,e.width+=this.padding()*2,!a){this.update();return}}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const b=o.point({x:0,y:-this.padding()*2});if(e.x+=b.x,e.y+=b.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=b.x,this._anchorDragOffset.y-=b.y,e.height+=this.padding()*2,!a){this.update();return}}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const b=o.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=b.x,this._anchorDragOffset.y-=b.y,e.height+=this.padding()*2,!a){this.update();return}}if(this.boundBoxFunc()){const b=this.boundBoxFunc()(n,e);b?e=b:xt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const l=1e7,u=new xt.Transform;u.translate(n.x,n.y),u.rotate(n.rotation),u.scale(n.width/l,n.height/l);const f=new xt.Transform;f.translate(e.x,e.y),f.rotate(e.rotation),f.scale(e.width/l,e.height/l);const y=f.multiply(u.invert());this._nodes.forEach(b=>{var v;const h=b.getParent().getAbsoluteTransform(),w=b.getTransform().copy();w.translate(b.offsetX(),b.offsetY());const E=new xt.Transform;E.multiply(h.copy().invert()).multiply(y).multiply(h).multiply(w);const S=E.decompose();b.setAttrs(S),this._fire("transform",{evt:r,target:b}),b._fire("transform",{evt:r,target:b}),(v=b.getLayer())===null||v===void 0||v.batchDraw()}),this.rotation(xt.Util._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,r){this.findOne(e).setAttrs(r)}update(){var e,r=this._getNodeRect();this.rotation(xt.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(b=>{b.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()*xt.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 y=this.anchorStyleFunc();y&&f.forEach(b=>{y(b)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),fw.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return cw.Node.prototype.toObject.call(this)}clone(e){var r=cw.Node.prototype.clone.call(this,e);return r}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};rp.Transformer=gt;function jT(t){return t instanceof Array||xt.Util.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){Zd.indexOf(e)===-1&&xt.Util.warn("Unknown anchor name: "+e+". Available names are: "+Zd.join(", "))}),t||[]}gt.prototype.className="Transformer";(0,AT._registerNode)(gt);St.Factory.addGetterSetter(gt,"enabledAnchors",Zd,jT);St.Factory.addGetterSetter(gt,"flipEnabled",!0,(0,ao.getBooleanValidator)());St.Factory.addGetterSetter(gt,"resizeEnabled",!0);St.Factory.addGetterSetter(gt,"anchorSize",10,(0,ao.getNumberValidator)());St.Factory.addGetterSetter(gt,"rotateEnabled",!0);St.Factory.addGetterSetter(gt,"rotationSnaps",[]);St.Factory.addGetterSetter(gt,"rotateAnchorOffset",50,(0,ao.getNumberValidator)());St.Factory.addGetterSetter(gt,"rotateAnchorCursor","crosshair");St.Factory.addGetterSetter(gt,"rotationSnapTolerance",5,(0,ao.getNumberValidator)());St.Factory.addGetterSetter(gt,"borderEnabled",!0);St.Factory.addGetterSetter(gt,"anchorStroke","rgb(0, 161, 255)");St.Factory.addGetterSetter(gt,"anchorStrokeWidth",1,(0,ao.getNumberValidator)());St.Factory.addGetterSetter(gt,"anchorFill","white");St.Factory.addGetterSetter(gt,"anchorCornerRadius",0,(0,ao.getNumberValidator)());St.Factory.addGetterSetter(gt,"borderStroke","rgb(0, 161, 255)");St.Factory.addGetterSetter(gt,"borderStrokeWidth",1,(0,ao.getNumberValidator)());St.Factory.addGetterSetter(gt,"borderDash");St.Factory.addGetterSetter(gt,"keepRatio",!0);St.Factory.addGetterSetter(gt,"shiftBehavior","default");St.Factory.addGetterSetter(gt,"centeredScaling",!1);St.Factory.addGetterSetter(gt,"ignoreStroke",!1);St.Factory.addGetterSetter(gt,"padding",0,(0,ao.getNumberValidator)());St.Factory.addGetterSetter(gt,"node");St.Factory.addGetterSetter(gt,"nodes");St.Factory.addGetterSetter(gt,"boundBoxFunc");St.Factory.addGetterSetter(gt,"anchorDragBoundFunc");St.Factory.addGetterSetter(gt,"anchorStyleFunc");St.Factory.addGetterSetter(gt,"shouldOverdrawWholeArea",!1);St.Factory.addGetterSetter(gt,"useSingleNodeRotation",!0);St.Factory.backCompat(gt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var np={};Object.defineProperty(np,"__esModule",{value:!0});np.Wedge=void 0;const ip=st,DT=ur,FT=lt,V6=Ve,zT=lt;let fa=class extends DT.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,FT.Konva.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};np.Wedge=fa;fa.prototype.className="Wedge";fa.prototype._centroid=!0;fa.prototype._attrsAffectingSize=["radius"];(0,zT._registerNode)(fa);ip.Factory.addGetterSetter(fa,"radius",0,(0,V6.getNumberValidator)());ip.Factory.addGetterSetter(fa,"angle",0,(0,V6.getNumberValidator)());ip.Factory.addGetterSetter(fa,"clockwise",!1);ip.Factory.backCompat(fa,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var ap={};Object.defineProperty(ap,"__esModule",{value:!0});ap.Blur=void 0;const pw=st,BT=Bt,UT=Ve;function gw(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var GT=[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],HT=[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 VT(t,e){var r=t.data,n=t.width,i=t.height,a,o,l,u,f,y,b,v,h,w,E,S,_,p,d,g,m,x,P,O,R,T,C,N,F=e+e+1,H=n-1,z=i-1,Y=e+1,G=Y*(Y+1)/2,W=new gw,j=null,M=W,k=null,D=null,B=GT[e],q=HT[e];for(l=1;l<F;l++)M=M.next=new gw,l===Y&&(j=M);for(M.next=W,b=y=0,o=0;o<i;o++){for(g=m=x=P=v=h=w=E=0,S=Y*(O=r[y]),_=Y*(R=r[y+1]),p=Y*(T=r[y+2]),d=Y*(C=r[y+3]),v+=G*O,h+=G*R,w+=G*T,E+=G*C,M=W,l=0;l<Y;l++)M.r=O,M.g=R,M.b=T,M.a=C,M=M.next;for(l=1;l<Y;l++)u=y+((H<l?H:l)<<2),v+=(M.r=O=r[u])*(N=Y-l),h+=(M.g=R=r[u+1])*N,w+=(M.b=T=r[u+2])*N,E+=(M.a=C=r[u+3])*N,g+=O,m+=R,x+=T,P+=C,M=M.next;for(k=W,D=j,a=0;a<n;a++)r[y+3]=C=E*B>>q,C!==0?(C=255/C,r[y]=(v*B>>q)*C,r[y+1]=(h*B>>q)*C,r[y+2]=(w*B>>q)*C):r[y]=r[y+1]=r[y+2]=0,v-=S,h-=_,w-=p,E-=d,S-=k.r,_-=k.g,p-=k.b,d-=k.a,u=b+((u=a+e+1)<H?u:H)<<2,g+=k.r=r[u],m+=k.g=r[u+1],x+=k.b=r[u+2],P+=k.a=r[u+3],v+=g,h+=m,w+=x,E+=P,k=k.next,S+=O=D.r,_+=R=D.g,p+=T=D.b,d+=C=D.a,g-=O,m-=R,x-=T,P-=C,D=D.next,y+=4;b+=n}for(a=0;a<n;a++){for(m=x=P=g=h=w=E=v=0,y=a<<2,S=Y*(O=r[y]),_=Y*(R=r[y+1]),p=Y*(T=r[y+2]),d=Y*(C=r[y+3]),v+=G*O,h+=G*R,w+=G*T,E+=G*C,M=W,l=0;l<Y;l++)M.r=O,M.g=R,M.b=T,M.a=C,M=M.next;for(f=n,l=1;l<=e;l++)y=f+a<<2,v+=(M.r=O=r[y])*(N=Y-l),h+=(M.g=R=r[y+1])*N,w+=(M.b=T=r[y+2])*N,E+=(M.a=C=r[y+3])*N,g+=O,m+=R,x+=T,P+=C,M=M.next,l<z&&(f+=n);for(y=a,k=W,D=j,o=0;o<i;o++)u=y<<2,r[u+3]=C=E*B>>q,C>0?(C=255/C,r[u]=(v*B>>q)*C,r[u+1]=(h*B>>q)*C,r[u+2]=(w*B>>q)*C):r[u]=r[u+1]=r[u+2]=0,v-=S,h-=_,w-=p,E-=d,S-=k.r,_-=k.g,p-=k.b,d-=k.a,u=a+((u=o+Y)<z?u:z)*n<<2,v+=g+=k.r=r[u],h+=m+=k.g=r[u+1],w+=x+=k.b=r[u+2],E+=P+=k.a=r[u+3],k=k.next,S+=O=D.r,_+=R=D.g,p+=T=D.b,d+=C=D.a,g-=O,m-=R,x-=T,P-=C,D=D.next,y+=n}}const qT=function(e){var r=Math.round(this.blurRadius());r>0&&VT(e,r)};ap.Blur=qT;pw.Factory.addGetterSetter(BT.Node,"blurRadius",0,(0,UT.getNumberValidator)(),pw.Factory.afterSetFilter);var op={};Object.defineProperty(op,"__esModule",{value:!0});op.Brighten=void 0;const vw=st,$T=Bt,WT=Ve,YT=function(t){var e=this.brightness()*255,r=t.data,n=r.length,i;for(i=0;i<n;i+=4)r[i]+=e,r[i+1]+=e,r[i+2]+=e};op.Brighten=YT;vw.Factory.addGetterSetter($T.Node,"brightness",0,(0,WT.getNumberValidator)(),vw.Factory.afterSetFilter);var lp={};Object.defineProperty(lp,"__esModule",{value:!0});lp.Contrast=void 0;const mw=st,KT=Bt,XT=Ve,QT=function(t){var e=Math.pow((this.contrast()+100)/100,2),r=t.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*=e,i+=.5,i*=255,a/=255,a-=.5,a*=e,a+=.5,a*=255,o/=255,o-=.5,o*=e,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};lp.Contrast=QT;mw.Factory.addGetterSetter(KT.Node,"contrast",0,(0,XT.getNumberValidator)(),mw.Factory.afterSetFilter);var sp={};Object.defineProperty(sp,"__esModule",{value:!0});sp.Emboss=void 0;const Wa=st,up=Bt,ZT=$t,q6=Ve,JT=function(t){var e=this.embossStrength()*10,r=this.embossWhiteLevel()*255,n=this.embossDirection(),i=this.embossBlend(),a=0,o=0,l=t.data,u=t.width,f=t.height,y=u*4,b=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:ZT.Util.error("Unknown emboss direction: "+n)}do{var v=(b-1)*y,h=a;b+h<1&&(h=0),b+h>f&&(h=0);var w=(b-1+h)*u*4,E=u;do{var S=v+(E-1)*4,_=o;E+_<1&&(_=0),E+_>u&&(_=0);var p=w+(E-1+_)*4,d=l[S]-l[p],g=l[S+1]-l[p+1],m=l[S+2]-l[p+2],x=d,P=x>0?x:-x,O=g>0?g:-g,R=m>0?m:-m;if(O>P&&(x=g),R>P&&(x=m),x*=e,i){var T=l[S]+x,C=l[S+1]+x,N=l[S+2]+x;l[S]=T>255?255:T<0?0:T,l[S+1]=C>255?255:C<0?0:C,l[S+2]=N>255?255:N<0?0:N}else{var F=r-x;F<0?F=0:F>255&&(F=255),l[S]=l[S+1]=l[S+2]=F}}while(--E)}while(--b)};sp.Emboss=JT;Wa.Factory.addGetterSetter(up.Node,"embossStrength",.5,(0,q6.getNumberValidator)(),Wa.Factory.afterSetFilter);Wa.Factory.addGetterSetter(up.Node,"embossWhiteLevel",.5,(0,q6.getNumberValidator)(),Wa.Factory.afterSetFilter);Wa.Factory.addGetterSetter(up.Node,"embossDirection","top-left",null,Wa.Factory.afterSetFilter);Wa.Factory.addGetterSetter(up.Node,"embossBlend",!1,null,Wa.Factory.afterSetFilter);var cp={};Object.defineProperty(cp,"__esModule",{value:!0});cp.Enhance=void 0;const yw=st,eC=Bt,tC=Ve;function Mv(t,e,r,n,i){var a=r-e,o=i-n,l;return a===0?n+o/2:o===0?n:(l=(t-e)/a,l=o*l+n,l)}const rC=function(t){var e=t.data,r=e.length,n=e[0],i=n,a,o=e[1],l=o,u,f=e[2],y=f,b,v,h=this.enhance();if(h!==0){for(v=0;v<r;v+=4)a=e[v+0],a<n?n=a:a>i&&(i=a),u=e[v+1],u<o?o=u:u>l&&(l=u),b=e[v+2],b<f?f=b:b>y&&(y=b);i===n&&(i=255,n=0),l===o&&(l=255,o=0),y===f&&(y=255,f=0);var w,E,S,_,p,d,g,m,x;for(h>0?(E=i+h*(255-i),S=n-h*(n-0),p=l+h*(255-l),d=o-h*(o-0),m=y+h*(255-y),x=f-h*(f-0)):(w=(i+n)*.5,E=i+h*(i-w),S=n+h*(n-w),_=(l+o)*.5,p=l+h*(l-_),d=o+h*(o-_),g=(y+f)*.5,m=y+h*(y-g),x=f+h*(f-g)),v=0;v<r;v+=4)e[v+0]=Mv(e[v+0],n,i,S,E),e[v+1]=Mv(e[v+1],o,l,d,p),e[v+2]=Mv(e[v+2],f,y,x,m)}};cp.Enhance=rC;yw.Factory.addGetterSetter(eC.Node,"enhance",0,(0,tC.getNumberValidator)(),yw.Factory.afterSetFilter);var fp={};Object.defineProperty(fp,"__esModule",{value:!0});fp.Grayscale=void 0;const nC=function(t){var e=t.data,r=e.length,n,i;for(n=0;n<r;n+=4)i=.34*e[n]+.5*e[n+1]+.16*e[n+2],e[n]=i,e[n+1]=i,e[n+2]=i};fp.Grayscale=nC;var dp={};Object.defineProperty(dp,"__esModule",{value:!0});dp.HSL=void 0;const vs=st,o1=Bt,l1=Ve;vs.Factory.addGetterSetter(o1.Node,"hue",0,(0,l1.getNumberValidator)(),vs.Factory.afterSetFilter);vs.Factory.addGetterSetter(o1.Node,"saturation",0,(0,l1.getNumberValidator)(),vs.Factory.afterSetFilter);vs.Factory.addGetterSetter(o1.Node,"luminance",0,(0,l1.getNumberValidator)(),vs.Factory.afterSetFilter);const iC=function(t){var e=t.data,r=e.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),y=.299*n+.701*u+.167*f,b=.587*n-.587*u+.33*f,v=.114*n-.114*u-.497*f,h=.299*n-.299*u-.328*f,w=.587*n+.413*u+.035*f,E=.114*n-.114*u+.293*f,S=.299*n-.3*u+1.25*f,_=.587*n-.586*u-1.05*f,p=.114*n+.886*u-.2*f,d,g,m,x;for(l=0;l<r;l+=4)d=e[l+0],g=e[l+1],m=e[l+2],x=e[l+3],e[l+0]=y*d+b*g+v*m+o,e[l+1]=h*d+w*g+E*m+o,e[l+2]=S*d+_*g+p*m+o,e[l+3]=x};dp.HSL=iC;var hp={};Object.defineProperty(hp,"__esModule",{value:!0});hp.HSV=void 0;const ms=st,s1=Bt,u1=Ve,aC=function(t){var e=t.data,r=e.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,y=.587*n-.587*l+.33*u,b=.114*n-.114*l-.497*u,v=.299*n-.299*l-.328*u,h=.587*n+.413*l+.035*u,w=.114*n-.114*l+.293*u,E=.299*n-.3*l+1.25*u,S=.587*n-.586*l-1.05*u,_=.114*n+.886*l-.2*u,p,d,g,m;for(o=0;o<r;o+=4)p=e[o+0],d=e[o+1],g=e[o+2],m=e[o+3],e[o+0]=f*p+y*d+b*g,e[o+1]=v*p+h*d+w*g,e[o+2]=E*p+S*d+_*g,e[o+3]=m};hp.HSV=aC;ms.Factory.addGetterSetter(s1.Node,"hue",0,(0,u1.getNumberValidator)(),ms.Factory.afterSetFilter);ms.Factory.addGetterSetter(s1.Node,"saturation",0,(0,u1.getNumberValidator)(),ms.Factory.afterSetFilter);ms.Factory.addGetterSetter(s1.Node,"value",0,(0,u1.getNumberValidator)(),ms.Factory.afterSetFilter);var pp={};Object.defineProperty(pp,"__esModule",{value:!0});pp.Invert=void 0;const oC=function(t){var e=t.data,r=e.length,n;for(n=0;n<r;n+=4)e[n]=255-e[n],e[n+1]=255-e[n+1],e[n+2]=255-e[n+2]};pp.Invert=oC;var gp={};Object.defineProperty(gp,"__esModule",{value:!0});gp.Kaleidoscope=void 0;const Jd=st,$6=Bt,bw=$t,W6=Ve;var lC=function(t,e,r){var n=t.data,i=e.data,a=t.width,o=t.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,y,b,v=0,h=0,w=0,E=0,S,_=Math.sqrt(l*l+u*u);y=a-l,b=o-u,S=Math.sqrt(y*y+b*b),_=S>_?S:_;var p=o,d=a,g,m,x=360/d*Math.PI/180,P,O;for(m=0;m<d;m+=1)for(P=Math.sin(m*x),O=Math.cos(m*x),g=0;g<p;g+=1)y=Math.floor(l+_*g/p*O),b=Math.floor(u+_*g/p*P),f=(b*a+y)*4,v=n[f+0],h=n[f+1],w=n[f+2],E=n[f+3],f=(m+g*a)*4,i[f+0]=v,i[f+1]=h,i[f+2]=w,i[f+3]=E},sC=function(t,e,r){var n=t.data,i=e.data,a=t.width,o=t.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,y,b,v,h,w=0,E=0,S=0,_=0,p,d=Math.sqrt(l*l+u*u);y=a-l,b=o-u,p=Math.sqrt(y*y+b*b),d=p>d?p:d;var g=o,m=a,x,P,O=r.polarRotation||0,R,T;for(y=0;y<a;y+=1)for(b=0;b<o;b+=1)v=y-l,h=b-u,x=Math.sqrt(v*v+h*h)*g/d,P=(Math.atan2(h,v)*180/Math.PI+360+O)%360,P=P*m/360,R=Math.floor(P),T=Math.floor(x),f=(T*a+R)*4,w=n[f+0],E=n[f+1],S=n[f+2],_=n[f+3],f=(b*a+y)*4,i[f+0]=w,i[f+1]=E,i[f+2]=S,i[f+3]=_};const uC=function(t){var e=t.width,r=t.height,n,i,a,o,l,u,f,y,b,v,h=Math.round(this.kaleidoscopePower()),w=Math.round(this.kaleidoscopeAngle()),E=Math.floor(e*(w%360)/360);if(!(h<1)){var S=bw.Util.createCanvasElement();S.width=e,S.height=r;var _=S.getContext("2d").getImageData(0,0,e,r);bw.Util.releaseCanvas(S),lC(t,_,{polarCenterX:e/2,polarCenterY:r/2});for(var p=e/Math.pow(2,h);p<=8;)p=p*2,h-=1;p=Math.ceil(p);var d=p,g=0,m=d,x=1;for(E+p>e&&(g=d,m=0,x=-1),i=0;i<r;i+=1)for(n=g;n!==m;n+=x)a=Math.round(n+E)%e,b=(e*i+a)*4,l=_.data[b+0],u=_.data[b+1],f=_.data[b+2],y=_.data[b+3],v=(e*i+n)*4,_.data[v+0]=l,_.data[v+1]=u,_.data[v+2]=f,_.data[v+3]=y;for(i=0;i<r;i+=1)for(d=Math.floor(p),o=0;o<h;o+=1){for(n=0;n<d+1;n+=1)b=(e*i+n)*4,l=_.data[b+0],u=_.data[b+1],f=_.data[b+2],y=_.data[b+3],v=(e*i+d*2-n-1)*4,_.data[v+0]=l,_.data[v+1]=u,_.data[v+2]=f,_.data[v+3]=y;d*=2}sC(_,t,{polarRotation:0})}};gp.Kaleidoscope=uC;Jd.Factory.addGetterSetter($6.Node,"kaleidoscopePower",2,(0,W6.getNumberValidator)(),Jd.Factory.afterSetFilter);Jd.Factory.addGetterSetter($6.Node,"kaleidoscopeAngle",0,(0,W6.getNumberValidator)(),Jd.Factory.afterSetFilter);var vp={};Object.defineProperty(vp,"__esModule",{value:!0});vp.Mask=void 0;const _w=st,cC=Bt,fC=Ve;function Qf(t,e,r){var n=(r*t.width+e)*4,i=[];return i.push(t.data[n++],t.data[n++],t.data[n++],t.data[n++]),i}function du(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function dC(t){for(var e=[0,0,0],r=0;r<t.length;r++)e[0]+=t[r][0],e[1]+=t[r][1],e[2]+=t[r][2];return e[0]/=t.length,e[1]/=t.length,e[2]/=t.length,e}function hC(t,e){var r=Qf(t,0,0),n=Qf(t,t.width-1,0),i=Qf(t,0,t.height-1),a=Qf(t,t.width-1,t.height-1),o=e||10;if(du(r,n)<o&&du(n,a)<o&&du(a,i)<o&&du(i,r)<o){for(var l=dC([n,r,a,i]),u=[],f=0;f<t.width*t.height;f++){var y=du(l,[t.data[f*4],t.data[f*4+1],t.data[f*4+2]]);u[f]=y<o?0:255}return u}}function pC(t,e){for(var r=0;r<t.width*t.height;r++)t.data[4*r+3]=e[r]}function gC(t,e,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<e;u++){for(var f=l*e+u,y=0,b=0;b<i;b++)for(var v=0;v<i;v++){var h=l+b-a,w=u+v-a;if(h>=0&&h<r&&w>=0&&w<e){var E=h*e+w,S=n[b*i+v];y+=t[E]*S}}o[f]=y===255*8?255:0}return o}function vC(t,e,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<e;u++){for(var f=l*e+u,y=0,b=0;b<i;b++)for(var v=0;v<i;v++){var h=l+b-a,w=u+v-a;if(h>=0&&h<r&&w>=0&&w<e){var E=h*e+w,S=n[b*i+v];y+=t[E]*S}}o[f]=y>=255*4?255:0}return o}function mC(t,e,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<e;u++){for(var f=l*e+u,y=0,b=0;b<i;b++)for(var v=0;v<i;v++){var h=l+b-a,w=u+v-a;if(h>=0&&h<r&&w>=0&&w<e){var E=h*e+w,S=n[b*i+v];y+=t[E]*S}}o[f]=y}return o}const yC=function(t){var e=this.threshold(),r=hC(t,e);return r&&(r=gC(r,t.width,t.height),r=vC(r,t.width,t.height),r=mC(r,t.width,t.height),pC(t,r)),t};vp.Mask=yC;_w.Factory.addGetterSetter(cC.Node,"threshold",0,(0,fC.getNumberValidator)(),_w.Factory.afterSetFilter);var mp={};Object.defineProperty(mp,"__esModule",{value:!0});mp.Noise=void 0;const ww=st,bC=Bt,_C=Ve,wC=function(t){var e=this.noise()*255,r=t.data,n=r.length,i=e/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()};mp.Noise=wC;ww.Factory.addGetterSetter(bC.Node,"noise",.2,(0,_C.getNumberValidator)(),ww.Factory.afterSetFilter);var yp={};Object.defineProperty(yp,"__esModule",{value:!0});yp.Pixelate=void 0;const Sw=st,SC=$t,EC=Bt,OC=Ve,xC=function(t){var e=Math.ceil(this.pixelSize()),r=t.width,n=t.height,i,a,o,l,u,f,y,b=Math.ceil(r/e),v=Math.ceil(n/e),h,w,E,S,_,p,d,g=t.data;if(e<=0){SC.Util.error("pixelSize value can not be <= 0");return}for(_=0;_<b;_+=1)for(p=0;p<v;p+=1){for(l=0,u=0,f=0,y=0,h=_*e,w=h+e,E=p*e,S=E+e,d=0,i=h;i<w;i+=1)if(!(i>=r))for(a=E;a<S;a+=1)a>=n||(o=(r*a+i)*4,l+=g[o+0],u+=g[o+1],f+=g[o+2],y+=g[o+3],d+=1);for(l=l/d,u=u/d,f=f/d,y=y/d,i=h;i<w;i+=1)if(!(i>=r))for(a=E;a<S;a+=1)a>=n||(o=(r*a+i)*4,g[o+0]=l,g[o+1]=u,g[o+2]=f,g[o+3]=y)}};yp.Pixelate=xC;Sw.Factory.addGetterSetter(EC.Node,"pixelSize",8,(0,OC.getNumberValidator)(),Sw.Factory.afterSetFilter);var bp={};Object.defineProperty(bp,"__esModule",{value:!0});bp.Posterize=void 0;const Ew=st,PC=Bt,AC=Ve,kC=function(t){var e=Math.round(this.levels()*254)+1,r=t.data,n=r.length,i=255/e,a;for(a=0;a<n;a+=1)r[a]=Math.floor(r[a]/i)*i};bp.Posterize=kC;Ew.Factory.addGetterSetter(PC.Node,"levels",.5,(0,AC.getNumberValidator)(),Ew.Factory.afterSetFilter);var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.RGB=void 0;const eh=st,c1=Bt,TC=Ve,CC=function(t){var e=t.data,r=e.length,n=this.red(),i=this.green(),a=this.blue(),o,l;for(o=0;o<r;o+=4)l=(.34*e[o]+.5*e[o+1]+.16*e[o+2])/255,e[o]=l*n,e[o+1]=l*i,e[o+2]=l*a,e[o+3]=e[o+3]};_p.RGB=CC;eh.Factory.addGetterSetter(c1.Node,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});eh.Factory.addGetterSetter(c1.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});eh.Factory.addGetterSetter(c1.Node,"blue",0,TC.RGBComponent,eh.Factory.afterSetFilter);var wp={};Object.defineProperty(wp,"__esModule",{value:!0});wp.RGBA=void 0;const tc=st,Sp=Bt,RC=Ve,NC=function(t){var e=t.data,r=e.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,e[l]=n*o+e[l]*u,e[l+1]=i*o+e[l+1]*u,e[l+2]=a*o+e[l+2]*u};wp.RGBA=NC;tc.Factory.addGetterSetter(Sp.Node,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});tc.Factory.addGetterSetter(Sp.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});tc.Factory.addGetterSetter(Sp.Node,"blue",0,RC.RGBComponent,tc.Factory.afterSetFilter);tc.Factory.addGetterSetter(Sp.Node,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Sepia=void 0;const MC=function(t){var e=t.data,r=e.length,n,i,a,o;for(n=0;n<r;n+=4)i=e[n+0],a=e[n+1],o=e[n+2],e[n+0]=Math.min(255,i*.393+a*.769+o*.189),e[n+1]=Math.min(255,i*.349+a*.686+o*.168),e[n+2]=Math.min(255,i*.272+a*.534+o*.131)};Ep.Sepia=MC;var Op={};Object.defineProperty(Op,"__esModule",{value:!0});Op.Solarize=void 0;const IC=function(t){var e=t.data,r=t.width,n=t.height,i=r*4,a=n;do{var o=(a-1)*i,l=r;do{var u=o+(l-1)*4,f=e[u],y=e[u+1],b=e[u+2];f>127&&(f=255-f),y>127&&(y=255-y),b>127&&(b=255-b),e[u]=f,e[u+1]=y,e[u+2]=b}while(--l)}while(--a)};Op.Solarize=IC;var xp={};Object.defineProperty(xp,"__esModule",{value:!0});xp.Threshold=void 0;const Ow=st,LC=Bt,jC=Ve,DC=function(t){var e=this.threshold()*255,r=t.data,n=r.length,i;for(i=0;i<n;i+=1)r[i]=r[i]<e?0:255};xp.Threshold=DC;Ow.Factory.addGetterSetter(LC.Node,"threshold",.5,(0,jC.getNumberValidator)(),Ow.Factory.afterSetFilter);Object.defineProperty(Ih,"__esModule",{value:!0});Ih.Konva=void 0;const xw=Xd,FC=Bh,zC=Hh,BC=$h,UC=Wh,GC=Yh,Pw=gs,HC=Ec,VC=Rs,qC=Pc,$C=Qh,WC=Zh,YC=Jh,KC=ep,XC=Wo,QC=tp,ZC=rp,JC=np,eR=ap,tR=op,rR=lp,nR=sp,iR=cp,aR=fp,oR=dp,lR=hp,sR=pp,uR=gp,cR=vp,fR=mp,dR=yp,hR=bp,pR=_p,gR=wp,vR=Ep,mR=Op,yR=xp;Ih.Konva=xw.Konva.Util._assign(xw.Konva,{Arc:FC.Arc,Arrow:zC.Arrow,Circle:BC.Circle,Ellipse:UC.Ellipse,Image:GC.Image,Label:Pw.Label,Tag:Pw.Tag,Line:HC.Line,Path:VC.Path,Rect:qC.Rect,RegularPolygon:$C.RegularPolygon,Ring:WC.Ring,Sprite:YC.Sprite,Star:KC.Star,Text:XC.Text,TextPath:QC.TextPath,Transformer:ZC.Transformer,Wedge:JC.Wedge,Filters:{Blur:eR.Blur,Brighten:tR.Brighten,Contrast:rR.Contrast,Emboss:nR.Emboss,Enhance:iR.Enhance,Grayscale:aR.Grayscale,HSL:oR.HSL,HSV:lR.HSV,Invert:sR.Invert,Kaleidoscope:uR.Kaleidoscope,Mask:cR.Mask,Noise:fR.Noise,Pixelate:dR.Pixelate,Posterize:hR.Posterize,RGB:pR.RGB,RGBA:gR.RGBA,Sepia:vR.Sepia,Solarize:mR.Solarize,Threshold:yR.Threshold}});var bR=Xy.exports;Object.defineProperty(bR,"__esModule",{value:!0});const _R=Ih;Xy.exports=_R.Konva;var si=Xy.exports,Cm={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;var r=Xd;Object.defineProperty(e,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=Xd;t.exports=n.Konva})(Cm,Cm.exports);var wR=Cm.exports;const rc=oh(wR);var Y6={exports:{}};/**
43
+ * @license React
44
+ * react-reconciler.production.min.js
45
+ *
46
+ * Copyright (c) Facebook, Inc. and its affiliates.
47
+ *
48
+ * This source code is licensed under the MIT license found in the
49
+ * LICENSE file in the root directory of this source tree.
50
+ */var SR=function(e){var r={},n=at,i=yu,a=Object.assign;function o(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,A=1;A<arguments.length;A++)c+="&args[]="+encodeURIComponent(arguments[A]);return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),f=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),w=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),m=Symbol.iterator;function x(s){return s===null||typeof s!="object"?null:(s=m&&s[m]||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 y:return"Fragment";case f:return"Portal";case v:return"Profiler";case b:return"StrictMode";case S:return"Suspense";case _:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case w:return(s.displayName||"Context")+".Consumer";case h:return(s._context.displayName||"Context")+".Provider";case E:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case p: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 O(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===b?"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 R(s){var c=s,A=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,c.flags&4098&&(A=c.return),s=c.return;while(s)}return c.tag===3?A:null}function T(s){if(R(s)!==s)throw Error(o(188))}function C(s){var c=s.alternate;if(!c){if(c=R(s),c===null)throw Error(o(188));return c!==s?null:s}for(var A=s,I=c;;){var L=A.return;if(L===null)break;var V=L.alternate;if(V===null){if(I=L.return,I!==null){A=I;continue}break}if(L.child===V.child){for(V=L.child;V;){if(V===A)return T(L),s;if(V===I)return T(L),c;V=V.sibling}throw Error(o(188))}if(A.return!==I.return)A=L,I=V;else{for(var J=!1,ae=L.child;ae;){if(ae===A){J=!0,A=L,I=V;break}if(ae===I){J=!0,I=L,A=V;break}ae=ae.sibling}if(!J){for(ae=V.child;ae;){if(ae===A){J=!0,A=V,I=L;break}if(ae===I){J=!0,I=V,A=L;break}ae=ae.sibling}if(!J)throw Error(o(189))}}if(A.alternate!==I)throw Error(o(190))}if(A.tag!==3)throw Error(o(188));return A.stateNode.current===A?s:c}function N(s){return s=C(s),s!==null?F(s):null}function F(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=F(s);if(c!==null)return c;s=s.sibling}return null}function H(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){if(s.tag!==4){var c=H(s);if(c!==null)return c}s=s.sibling}return null}var z=Array.isArray,Y=e.getPublicInstance,G=e.getRootHostContext,W=e.getChildHostContext,j=e.prepareForCommit,M=e.resetAfterCommit,k=e.createInstance,D=e.appendInitialChild,B=e.finalizeInitialChildren,q=e.prepareUpdate,K=e.shouldSetTextContent,$=e.createTextInstance,U=e.scheduleTimeout,X=e.cancelTimeout,Q=e.noTimeout,ee=e.isPrimaryRenderer,Z=e.supportsMutation,ne=e.supportsPersistence,ie=e.supportsHydration,pe=e.getInstanceFromNode,we=e.preparePortalMount,Re=e.getCurrentEventPriority,xe=e.detachDeletedInstance,le=e.supportsMicrotasks,ce=e.scheduleMicrotask,be=e.supportsTestSelectors,_e=e.findFiberRoot,te=e.getBoundingRect,fe=e.getTextContent,ue=e.isHiddenSubtree,me=e.matchAccessibilityRole,Ne=e.setFocusIfFocusable,Xe=e.setupIntersectionObserver,Ye=e.appendChild,Te=e.appendChildToContainer,Be=e.commitTextUpdate,Ze=e.commitMount,Qe=e.commitUpdate,se=e.insertBefore,re=e.insertInContainerBefore,ke=e.removeChild,Ie=e.removeChildFromContainer,ve=e.resetTextContent,Ce=e.hideInstance,Se=e.hideTextInstance,$e=e.unhideInstance,Oe=e.unhideTextInstance,Ue=e.clearContainer,Je=e.cloneInstance,wt=e.createContainerChildSet,_t=e.appendChildToContainerChildSet,De=e.finalizeContainerChildren,Ke=e.replaceContainerChildren,ct=e.cloneHiddenInstance,At=e.cloneHiddenTextInstance,Wt=e.canHydrateInstance,zr=e.canHydrateTextInstance,br=e.canHydrateSuspenseInstance,Ar=e.isSuspenseInstancePending,Br=e.isSuspenseInstanceFallback,Ni=e.getSuspenseInstanceFallbackErrorDetails,Sn=e.registerSuspenseInstanceRetry,En=e.getNextHydratableSibling,co=e.getFirstHydratableChild,pa=e.getFirstHydratableChildWithinContainer,js=e.getFirstHydratableChildWithinSuspenseInstance,Mi=e.hydrateInstance,ga=e.hydrateTextInstance,dl=e.hydrateSuspenseInstance,Ip=e.getNextHydratableInstanceAfterSuspenseInstance,Nc=e.commitHydratedContainer,jE=e.commitHydratedSuspenseInstance,DE=e.clearSuspenseBoundary,FE=e.clearSuspenseBoundaryFromContainer,zE=e.shouldDeleteUnhydratedTailInstances,BE=e.didNotMatchHydratedContainerTextInstance,UE=e.didNotMatchHydratedTextInstance,Lp;function Ds(s){if(Lp===void 0)try{throw Error()}catch(A){var c=A.stack.trim().match(/\n( *(at )?)/);Lp=c&&c[1]||""}return`
51
+ `+Lp+s}var jp=!1;function Dp(s,c){if(!s||jp)return"";jp=!0;var A=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(Ae){var I=Ae}Reflect.construct(s,[],c)}else{try{c.call()}catch(Ae){I=Ae}s.call(c.prototype)}else{try{throw Error()}catch(Ae){I=Ae}s()}}catch(Ae){if(Ae&&I&&typeof Ae.stack=="string"){for(var L=Ae.stack.split(`
52
+ `),V=I.stack.split(`
53
+ `),J=L.length-1,ae=V.length-1;1<=J&&0<=ae&&L[J]!==V[ae];)ae--;for(;1<=J&&0<=ae;J--,ae--)if(L[J]!==V[ae]){if(J!==1||ae!==1)do if(J--,ae--,0>ae||L[J]!==V[ae]){var he=`
54
+ `+L[J].replace(" at new "," at ");return s.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",s.displayName)),he}while(1<=J&&0<=ae);break}}}finally{jp=!1,Error.prepareStackTrace=A}return(s=s?s.displayName||s.name:"")?Ds(s):""}var GE=Object.prototype.hasOwnProperty,Fp=[],hl=-1;function va(s){return{current:s}}function Nt(s){0>hl||(s.current=Fp[hl],Fp[hl]=null,hl--)}function Ct(s,c){hl++,Fp[hl]=s.current,s.current=c}var ma={},kr=va(ma),Yr=va(!1),fo=ma;function pl(s,c){var A=s.type.contextTypes;if(!A)return ma;var I=s.stateNode;if(I&&I.__reactInternalMemoizedUnmaskedChildContext===c)return I.__reactInternalMemoizedMaskedChildContext;var L={},V;for(V in A)L[V]=c[V];return I&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=L),L}function Kr(s){return s=s.childContextTypes,s!=null}function Mc(){Nt(Yr),Nt(kr)}function F1(s,c,A){if(kr.current!==ma)throw Error(o(168));Ct(kr,c),Ct(Yr,A)}function z1(s,c,A){var I=s.stateNode;if(c=c.childContextTypes,typeof I.getChildContext!="function")return A;I=I.getChildContext();for(var L in I)if(!(L in c))throw Error(o(108,O(s)||"Unknown",L));return a({},A,I)}function Ic(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ma,fo=kr.current,Ct(kr,s),Ct(Yr,Yr.current),!0}function B1(s,c,A){var I=s.stateNode;if(!I)throw Error(o(169));A?(s=z1(s,c,fo),I.__reactInternalMemoizedMergedChildContext=s,Nt(Yr),Nt(kr),Ct(kr,s)):Nt(Yr),Ct(Yr,A)}var Gn=Math.clz32?Math.clz32:qE,HE=Math.log,VE=Math.LN2;function qE(s){return s>>>=0,s===0?32:31-(HE(s)/VE|0)|0}var Lc=64,jc=4194304;function Fs(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 Dc(s,c){var A=s.pendingLanes;if(A===0)return 0;var I=0,L=s.suspendedLanes,V=s.pingedLanes,J=A&268435455;if(J!==0){var ae=J&~L;ae!==0?I=Fs(ae):(V&=J,V!==0&&(I=Fs(V)))}else J=A&~L,J!==0?I=Fs(J):V!==0&&(I=Fs(V));if(I===0)return 0;if(c!==0&&c!==I&&!(c&L)&&(L=I&-I,V=c&-c,L>=V||L===16&&(V&4194240)!==0))return c;if(I&4&&(I|=A&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=I;0<c;)A=31-Gn(c),L=1<<A,I|=s[A],c&=~L;return I}function $E(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 WE(s,c){for(var A=s.suspendedLanes,I=s.pingedLanes,L=s.expirationTimes,V=s.pendingLanes;0<V;){var J=31-Gn(V),ae=1<<J,he=L[J];he===-1?(!(ae&A)||ae&I)&&(L[J]=$E(ae,c)):he<=c&&(s.expiredLanes|=ae),V&=~ae}}function zp(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function U1(){var s=Lc;return Lc<<=1,!(Lc&4194240)&&(Lc=64),s}function Bp(s){for(var c=[],A=0;31>A;A++)c.push(s);return c}function zs(s,c,A){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-Gn(c),s[c]=A}function YE(s,c){var A=s.pendingLanes&~c;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=c,s.mutableReadLanes&=c,s.entangledLanes&=c,c=s.entanglements;var I=s.eventTimes;for(s=s.expirationTimes;0<A;){var L=31-Gn(A),V=1<<L;c[L]=0,I[L]=-1,s[L]=-1,A&=~V}}function Up(s,c){var A=s.entangledLanes|=c;for(s=s.entanglements;A;){var I=31-Gn(A),L=1<<I;L&c|s[I]&c&&(s[I]|=c),A&=~L}}var vt=0;function G1(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var Gp=i.unstable_scheduleCallback,H1=i.unstable_cancelCallback,KE=i.unstable_shouldYield,XE=i.unstable_requestPaint,fr=i.unstable_now,Hp=i.unstable_ImmediatePriority,QE=i.unstable_UserBlockingPriority,Vp=i.unstable_NormalPriority,ZE=i.unstable_IdlePriority,Fc=null,ui=null;function JE(s){if(ui&&typeof ui.onCommitFiberRoot=="function")try{ui.onCommitFiberRoot(Fc,s,void 0,(s.current.flags&128)===128)}catch{}}function e9(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var Hn=typeof Object.is=="function"?Object.is:e9,Ii=null,zc=!1,qp=!1;function V1(s){Ii===null?Ii=[s]:Ii.push(s)}function t9(s){zc=!0,V1(s)}function ci(){if(!qp&&Ii!==null){qp=!0;var s=0,c=vt;try{var A=Ii;for(vt=1;s<A.length;s++){var I=A[s];do I=I(!0);while(I!==null)}Ii=null,zc=!1}catch(L){throw Ii!==null&&(Ii=Ii.slice(s+1)),Gp(Hp,ci),L}finally{vt=c,qp=!1}}return null}var gl=[],vl=0,Bc=null,Uc=0,On=[],xn=0,ho=null,Li=1,ji="";function po(s,c){gl[vl++]=Uc,gl[vl++]=Bc,Bc=s,Uc=c}function q1(s,c,A){On[xn++]=Li,On[xn++]=ji,On[xn++]=ho,ho=s;var I=Li;s=ji;var L=32-Gn(I)-1;I&=~(1<<L),A+=1;var V=32-Gn(c)+L;if(30<V){var J=L-L%5;V=(I&(1<<J)-1).toString(32),I>>=J,L-=J,Li=1<<32-Gn(c)+L|A<<L|I,ji=V+s}else Li=1<<V|A<<L|I,ji=s}function $p(s){s.return!==null&&(po(s,1),q1(s,1,0))}function Wp(s){for(;s===Bc;)Bc=gl[--vl],gl[vl]=null,Uc=gl[--vl],gl[vl]=null;for(;s===ho;)ho=On[--xn],On[xn]=null,ji=On[--xn],On[xn]=null,Li=On[--xn],On[xn]=null}var fn=null,Pn=null,Dt=!1,Bs=!1,Vn=null;function $1(s,c){var A=Rn(5,null,null,0);A.elementType="DELETED",A.stateNode=c,A.return=s,c=s.deletions,c===null?(s.deletions=[A],s.flags|=16):c.push(A)}function W1(s,c){switch(s.tag){case 5:return c=Wt(c,s.type,s.pendingProps),c!==null?(s.stateNode=c,fn=s,Pn=co(c),!0):!1;case 6:return c=zr(c,s.pendingProps),c!==null?(s.stateNode=c,fn=s,Pn=null,!0):!1;case 13:if(c=br(c),c!==null){var A=ho!==null?{id:Li,overflow:ji}:null;return s.memoizedState={dehydrated:c,treeContext:A,retryLane:1073741824},A=Rn(18,null,null,0),A.stateNode=c,A.return=s,s.child=A,fn=s,Pn=null,!0}return!1;default:return!1}}function Yp(s){return(s.mode&1)!==0&&(s.flags&128)===0}function Kp(s){if(Dt){var c=Pn;if(c){var A=c;if(!W1(s,c)){if(Yp(s))throw Error(o(418));c=En(A);var I=fn;c&&W1(s,c)?$1(I,A):(s.flags=s.flags&-4097|2,Dt=!1,fn=s)}}else{if(Yp(s))throw Error(o(418));s.flags=s.flags&-4097|2,Dt=!1,fn=s}}}function Y1(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;fn=s}function Gc(s){if(!ie||s!==fn)return!1;if(!Dt)return Y1(s),Dt=!0,!1;if(s.tag!==3&&(s.tag!==5||zE(s.type)&&!K(s.type,s.memoizedProps))){var c=Pn;if(c){if(Yp(s))throw K1(),Error(o(418));for(;c;)$1(s,c),c=En(c)}}if(Y1(s),s.tag===13){if(!ie)throw Error(o(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));Pn=Ip(s)}else Pn=fn?En(s.stateNode):null;return!0}function K1(){for(var s=Pn;s;)s=En(s)}function ml(){ie&&(Pn=fn=null,Bs=Dt=!1)}function Xp(s){Vn===null?Vn=[s]:Vn.push(s)}var r9=l.ReactCurrentBatchConfig;function Hc(s,c){if(Hn(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var A=Object.keys(s),I=Object.keys(c);if(A.length!==I.length)return!1;for(I=0;I<A.length;I++){var L=A[I];if(!GE.call(c,L)||!Hn(s[L],c[L]))return!1}return!0}function n9(s){switch(s.tag){case 5:return Ds(s.type);case 16:return Ds("Lazy");case 13:return Ds("Suspense");case 19:return Ds("SuspenseList");case 0:case 2:case 15:return s=Dp(s.type,!1),s;case 11:return s=Dp(s.type.render,!1),s;case 1:return s=Dp(s.type,!0),s;default:return""}}function qn(s,c){if(s&&s.defaultProps){c=a({},c),s=s.defaultProps;for(var A in s)c[A]===void 0&&(c[A]=s[A]);return c}return c}var Vc=va(null),qc=null,yl=null,Qp=null;function Zp(){Qp=yl=qc=null}function X1(s,c,A){ee?(Ct(Vc,c._currentValue),c._currentValue=A):(Ct(Vc,c._currentValue2),c._currentValue2=A)}function Jp(s){var c=Vc.current;Nt(Vc),ee?s._currentValue=c:s._currentValue2=c}function eg(s,c,A){for(;s!==null;){var I=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,I!==null&&(I.childLanes|=c)):I!==null&&(I.childLanes&c)!==c&&(I.childLanes|=c),s===A)break;s=s.return}}function bl(s,c){qc=s,Qp=yl=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&c&&(Xr=!0),s.firstContext=null)}function An(s){var c=ee?s._currentValue:s._currentValue2;if(Qp!==s)if(s={context:s,memoizedValue:c,next:null},yl===null){if(qc===null)throw Error(o(308));yl=s,qc.dependencies={lanes:0,firstContext:s}}else yl=yl.next=s;return c}var go=null;function tg(s){go===null?go=[s]:go.push(s)}function Q1(s,c,A,I){var L=c.interleaved;return L===null?(A.next=A,tg(c)):(A.next=L.next,L.next=A),c.interleaved=A,fi(s,I)}function fi(s,c){s.lanes|=c;var A=s.alternate;for(A!==null&&(A.lanes|=c),A=s,s=s.return;s!==null;)s.childLanes|=c,A=s.alternate,A!==null&&(A.childLanes|=c),A=s,s=s.return;return A.tag===3?A.stateNode:null}var ya=!1;function rg(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Z1(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 Di(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function ba(s,c,A){var I=s.updateQueue;if(I===null)return null;if(I=I.shared,ut&2){var L=I.pending;return L===null?c.next=c:(c.next=L.next,L.next=c),I.pending=c,fi(s,A)}return L=I.interleaved,L===null?(c.next=c,tg(I)):(c.next=L.next,L.next=c),I.interleaved=c,fi(s,A)}function $c(s,c,A){if(c=c.updateQueue,c!==null&&(c=c.shared,(A&4194240)!==0)){var I=c.lanes;I&=s.pendingLanes,A|=I,c.lanes=A,Up(s,A)}}function J1(s,c){var A=s.updateQueue,I=s.alternate;if(I!==null&&(I=I.updateQueue,A===I)){var L=null,V=null;if(A=A.firstBaseUpdate,A!==null){do{var J={eventTime:A.eventTime,lane:A.lane,tag:A.tag,payload:A.payload,callback:A.callback,next:null};V===null?L=V=J:V=V.next=J,A=A.next}while(A!==null);V===null?L=V=c:V=V.next=c}else L=V=c;A={baseState:I.baseState,firstBaseUpdate:L,lastBaseUpdate:V,shared:I.shared,effects:I.effects},s.updateQueue=A;return}s=A.lastBaseUpdate,s===null?A.firstBaseUpdate=c:s.next=c,A.lastBaseUpdate=c}function Wc(s,c,A,I){var L=s.updateQueue;ya=!1;var V=L.firstBaseUpdate,J=L.lastBaseUpdate,ae=L.shared.pending;if(ae!==null){L.shared.pending=null;var he=ae,Ae=he.next;he.next=null,J===null?V=Ae:J.next=Ae,J=he;var Ge=s.alternate;Ge!==null&&(Ge=Ge.updateQueue,ae=Ge.lastBaseUpdate,ae!==J&&(ae===null?Ge.firstBaseUpdate=Ae:ae.next=Ae,Ge.lastBaseUpdate=he))}if(V!==null){var et=L.baseState;J=0,Ge=Ae=he=null,ae=V;do{var Me=ae.lane,Mt=ae.eventTime;if((I&Me)===Me){Ge!==null&&(Ge=Ge.next={eventTime:Mt,lane:0,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null});e:{var kt=s,Jr=ae;switch(Me=c,Mt=A,Jr.tag){case 1:if(kt=Jr.payload,typeof kt=="function"){et=kt.call(Mt,et,Me);break e}et=kt;break e;case 3:kt.flags=kt.flags&-65537|128;case 0:if(kt=Jr.payload,Me=typeof kt=="function"?kt.call(Mt,et,Me):kt,Me==null)break e;et=a({},et,Me);break e;case 2:ya=!0}}ae.callback!==null&&ae.lane!==0&&(s.flags|=64,Me=L.effects,Me===null?L.effects=[ae]:Me.push(ae))}else Mt={eventTime:Mt,lane:Me,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null},Ge===null?(Ae=Ge=Mt,he=et):Ge=Ge.next=Mt,J|=Me;if(ae=ae.next,ae===null){if(ae=L.shared.pending,ae===null)break;Me=ae,ae=Me.next,Me.next=null,L.lastBaseUpdate=Me,L.shared.pending=null}}while(1);if(Ge===null&&(he=et),L.baseState=he,L.firstBaseUpdate=Ae,L.lastBaseUpdate=Ge,c=L.shared.interleaved,c!==null){L=c;do J|=L.lane,L=L.next;while(L!==c)}else V===null&&(L.shared.lanes=0);mo|=J,s.lanes=J,s.memoizedState=et}}function e2(s,c,A){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var I=s[c],L=I.callback;if(L!==null){if(I.callback=null,I=A,typeof L!="function")throw Error(o(191,L));L.call(I)}}}var t2=new n.Component().refs;function ng(s,c,A,I){c=s.memoizedState,A=A(I,c),A=A==null?c:a({},c,A),s.memoizedState=A,s.lanes===0&&(s.updateQueue.baseState=A)}var Yc={isMounted:function(s){return(s=s._reactInternals)?R(s)===s:!1},enqueueSetState:function(s,c,A){s=s._reactInternals;var I=Nr(),L=Sa(s),V=Di(I,L);V.payload=c,A!=null&&(V.callback=A),c=ba(s,V,L),c!==null&&(Cn(c,s,L,I),$c(c,s,L))},enqueueReplaceState:function(s,c,A){s=s._reactInternals;var I=Nr(),L=Sa(s),V=Di(I,L);V.tag=1,V.payload=c,A!=null&&(V.callback=A),c=ba(s,V,L),c!==null&&(Cn(c,s,L,I),$c(c,s,L))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var A=Nr(),I=Sa(s),L=Di(A,I);L.tag=2,c!=null&&(L.callback=c),c=ba(s,L,I),c!==null&&(Cn(c,s,I,A),$c(c,s,I))}};function r2(s,c,A,I,L,V,J){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(I,V,J):c.prototype&&c.prototype.isPureReactComponent?!Hc(A,I)||!Hc(L,V):!0}function n2(s,c,A){var I=!1,L=ma,V=c.contextType;return typeof V=="object"&&V!==null?V=An(V):(L=Kr(c)?fo:kr.current,I=c.contextTypes,V=(I=I!=null)?pl(s,L):ma),c=new c(A,V),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Yc,s.stateNode=c,c._reactInternals=s,I&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=L,s.__reactInternalMemoizedMaskedChildContext=V),c}function i2(s,c,A,I){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(A,I),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(A,I),c.state!==s&&Yc.enqueueReplaceState(c,c.state,null)}function ig(s,c,A,I){var L=s.stateNode;L.props=A,L.state=s.memoizedState,L.refs=t2,rg(s);var V=c.contextType;typeof V=="object"&&V!==null?L.context=An(V):(V=Kr(c)?fo:kr.current,L.context=pl(s,V)),L.state=s.memoizedState,V=c.getDerivedStateFromProps,typeof V=="function"&&(ng(s,c,V,A),L.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof L.getSnapshotBeforeUpdate=="function"||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(c=L.state,typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount(),c!==L.state&&Yc.enqueueReplaceState(L,L.state,null),Wc(s,A,L,I),L.state=s.memoizedState),typeof L.componentDidMount=="function"&&(s.flags|=4194308)}function Us(s,c,A){if(s=A.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(A._owner){if(A=A._owner,A){if(A.tag!==1)throw Error(o(309));var I=A.stateNode}if(!I)throw Error(o(147,s));var L=I,V=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===V?c.ref:(c=function(J){var ae=L.refs;ae===t2&&(ae=L.refs={}),J===null?delete ae[V]:ae[V]=J},c._stringRef=V,c)}if(typeof s!="string")throw Error(o(284));if(!A._owner)throw Error(o(290,s))}return s}function Kc(s,c){throw s=Object.prototype.toString.call(c),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function a2(s){var c=s._init;return c(s._payload)}function o2(s){function c(de,oe){if(s){var ge=de.deletions;ge===null?(de.deletions=[oe],de.flags|=16):ge.push(oe)}}function A(de,oe){if(!s)return null;for(;oe!==null;)c(de,oe),oe=oe.sibling;return null}function I(de,oe){for(de=new Map;oe!==null;)oe.key!==null?de.set(oe.key,oe):de.set(oe.index,oe),oe=oe.sibling;return de}function L(de,oe){return de=Oa(de,oe),de.index=0,de.sibling=null,de}function V(de,oe,ge){return de.index=ge,s?(ge=de.alternate,ge!==null?(ge=ge.index,ge<oe?(de.flags|=2,oe):ge):(de.flags|=2,oe)):(de.flags|=1048576,oe)}function J(de){return s&&de.alternate===null&&(de.flags|=2),de}function ae(de,oe,ge,Le){return oe===null||oe.tag!==6?(oe=qg(ge,de.mode,Le),oe.return=de,oe):(oe=L(oe,ge),oe.return=de,oe)}function he(de,oe,ge,Le){var We=ge.type;return We===y?Ge(de,oe,ge.props.children,Le,ge.key):oe!==null&&(oe.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===d&&a2(We)===oe.type)?(Le=L(oe,ge.props),Le.ref=Us(de,oe,ge),Le.return=de,Le):(Le=Sf(ge.type,ge.key,ge.props,null,de.mode,Le),Le.ref=Us(de,oe,ge),Le.return=de,Le)}function Ae(de,oe,ge,Le){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==ge.containerInfo||oe.stateNode.implementation!==ge.implementation?(oe=$g(ge,de.mode,Le),oe.return=de,oe):(oe=L(oe,ge.children||[]),oe.return=de,oe)}function Ge(de,oe,ge,Le,We){return oe===null||oe.tag!==7?(oe=wo(ge,de.mode,Le,We),oe.return=de,oe):(oe=L(oe,ge),oe.return=de,oe)}function et(de,oe,ge){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return oe=qg(""+oe,de.mode,ge),oe.return=de,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case u:return ge=Sf(oe.type,oe.key,oe.props,null,de.mode,ge),ge.ref=Us(de,null,oe),ge.return=de,ge;case f:return oe=$g(oe,de.mode,ge),oe.return=de,oe;case d:var Le=oe._init;return et(de,Le(oe._payload),ge)}if(z(oe)||x(oe))return oe=wo(oe,de.mode,ge,null),oe.return=de,oe;Kc(de,oe)}return null}function Me(de,oe,ge,Le){var We=oe!==null?oe.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number")return We!==null?null:ae(de,oe,""+ge,Le);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case u:return ge.key===We?he(de,oe,ge,Le):null;case f:return ge.key===We?Ae(de,oe,ge,Le):null;case d:return We=ge._init,Me(de,oe,We(ge._payload),Le)}if(z(ge)||x(ge))return We!==null?null:Ge(de,oe,ge,Le,null);Kc(de,ge)}return null}function Mt(de,oe,ge,Le,We){if(typeof Le=="string"&&Le!==""||typeof Le=="number")return de=de.get(ge)||null,ae(oe,de,""+Le,We);if(typeof Le=="object"&&Le!==null){switch(Le.$$typeof){case u:return de=de.get(Le.key===null?ge:Le.key)||null,he(oe,de,Le,We);case f:return de=de.get(Le.key===null?ge:Le.key)||null,Ae(oe,de,Le,We);case d:var ot=Le._init;return Mt(de,oe,ge,ot(Le._payload),We)}if(z(Le)||x(Le))return de=de.get(ge)||null,Ge(oe,de,Le,We,null);Kc(oe,Le)}return null}function kt(de,oe,ge,Le){for(var We=null,ot=null,tt=oe,mt=oe=0,pr=null;tt!==null&&mt<ge.length;mt++){tt.index>mt?(pr=tt,tt=null):pr=tt.sibling;var yt=Me(de,tt,ge[mt],Le);if(yt===null){tt===null&&(tt=pr);break}s&&tt&&yt.alternate===null&&c(de,tt),oe=V(yt,oe,mt),ot===null?We=yt:ot.sibling=yt,ot=yt,tt=pr}if(mt===ge.length)return A(de,tt),Dt&&po(de,mt),We;if(tt===null){for(;mt<ge.length;mt++)tt=et(de,ge[mt],Le),tt!==null&&(oe=V(tt,oe,mt),ot===null?We=tt:ot.sibling=tt,ot=tt);return Dt&&po(de,mt),We}for(tt=I(de,tt);mt<ge.length;mt++)pr=Mt(tt,de,mt,ge[mt],Le),pr!==null&&(s&&pr.alternate!==null&&tt.delete(pr.key===null?mt:pr.key),oe=V(pr,oe,mt),ot===null?We=pr:ot.sibling=pr,ot=pr);return s&&tt.forEach(function(xa){return c(de,xa)}),Dt&&po(de,mt),We}function Jr(de,oe,ge,Le){var We=x(ge);if(typeof We!="function")throw Error(o(150));if(ge=We.call(ge),ge==null)throw Error(o(151));for(var ot=We=null,tt=oe,mt=oe=0,pr=null,yt=ge.next();tt!==null&&!yt.done;mt++,yt=ge.next()){tt.index>mt?(pr=tt,tt=null):pr=tt.sibling;var xa=Me(de,tt,yt.value,Le);if(xa===null){tt===null&&(tt=pr);break}s&&tt&&xa.alternate===null&&c(de,tt),oe=V(xa,oe,mt),ot===null?We=xa:ot.sibling=xa,ot=xa,tt=pr}if(yt.done)return A(de,tt),Dt&&po(de,mt),We;if(tt===null){for(;!yt.done;mt++,yt=ge.next())yt=et(de,yt.value,Le),yt!==null&&(oe=V(yt,oe,mt),ot===null?We=yt:ot.sibling=yt,ot=yt);return Dt&&po(de,mt),We}for(tt=I(de,tt);!yt.done;mt++,yt=ge.next())yt=Mt(tt,de,mt,yt.value,Le),yt!==null&&(s&&yt.alternate!==null&&tt.delete(yt.key===null?mt:yt.key),oe=V(yt,oe,mt),ot===null?We=yt:ot.sibling=yt,ot=yt);return s&&tt.forEach(function(M9){return c(de,M9)}),Dt&&po(de,mt),We}function Bi(de,oe,ge,Le){if(typeof ge=="object"&&ge!==null&&ge.type===y&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case u:e:{for(var We=ge.key,ot=oe;ot!==null;){if(ot.key===We){if(We=ge.type,We===y){if(ot.tag===7){A(de,ot.sibling),oe=L(ot,ge.props.children),oe.return=de,de=oe;break e}}else if(ot.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===d&&a2(We)===ot.type){A(de,ot.sibling),oe=L(ot,ge.props),oe.ref=Us(de,ot,ge),oe.return=de,de=oe;break e}A(de,ot);break}else c(de,ot);ot=ot.sibling}ge.type===y?(oe=wo(ge.props.children,de.mode,Le,ge.key),oe.return=de,de=oe):(Le=Sf(ge.type,ge.key,ge.props,null,de.mode,Le),Le.ref=Us(de,oe,ge),Le.return=de,de=Le)}return J(de);case f:e:{for(ot=ge.key;oe!==null;){if(oe.key===ot)if(oe.tag===4&&oe.stateNode.containerInfo===ge.containerInfo&&oe.stateNode.implementation===ge.implementation){A(de,oe.sibling),oe=L(oe,ge.children||[]),oe.return=de,de=oe;break e}else{A(de,oe);break}else c(de,oe);oe=oe.sibling}oe=$g(ge,de.mode,Le),oe.return=de,de=oe}return J(de);case d:return ot=ge._init,Bi(de,oe,ot(ge._payload),Le)}if(z(ge))return kt(de,oe,ge,Le);if(x(ge))return Jr(de,oe,ge,Le);Kc(de,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,oe!==null&&oe.tag===6?(A(de,oe.sibling),oe=L(oe,ge),oe.return=de,de=oe):(A(de,oe),oe=qg(ge,de.mode,Le),oe.return=de,de=oe),J(de)):A(de,oe)}return Bi}var _l=o2(!0),l2=o2(!1),Gs={},kn=va(Gs),Hs=va(Gs),wl=va(Gs);function di(s){if(s===Gs)throw Error(o(174));return s}function ag(s,c){Ct(wl,c),Ct(Hs,s),Ct(kn,Gs),s=G(c),Nt(kn),Ct(kn,s)}function Sl(){Nt(kn),Nt(Hs),Nt(wl)}function s2(s){var c=di(wl.current),A=di(kn.current);c=W(A,s.type,c),A!==c&&(Ct(Hs,s),Ct(kn,c))}function og(s){Hs.current===s&&(Nt(kn),Nt(Hs))}var Ut=va(0);function Xc(s){for(var c=s;c!==null;){if(c.tag===13){var A=c.memoizedState;if(A!==null&&(A=A.dehydrated,A===null||Ar(A)||Br(A)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var lg=[];function sg(){for(var s=0;s<lg.length;s++){var c=lg[s];ee?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}lg.length=0}var Qc=l.ReactCurrentDispatcher,ug=l.ReactCurrentBatchConfig,vo=0,Gt=null,nr=null,dr=null,Zc=!1,Vs=!1,qs=0,i9=0;function Tr(){throw Error(o(321))}function cg(s,c){if(c===null)return!1;for(var A=0;A<c.length&&A<s.length;A++)if(!Hn(s[A],c[A]))return!1;return!0}function fg(s,c,A,I,L,V){if(vo=V,Gt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Qc.current=s===null||s.memoizedState===null?s9:u9,s=A(I,L),Vs){V=0;do{if(Vs=!1,qs=0,25<=V)throw Error(o(301));V+=1,dr=nr=null,c.updateQueue=null,Qc.current=c9,s=A(I,L)}while(Vs)}if(Qc.current=tf,c=nr!==null&&nr.next!==null,vo=0,dr=nr=Gt=null,Zc=!1,c)throw Error(o(300));return s}function dg(){var s=qs!==0;return qs=0,s}function hi(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dr===null?Gt.memoizedState=dr=s:dr=dr.next=s,dr}function Tn(){if(nr===null){var s=Gt.alternate;s=s!==null?s.memoizedState:null}else s=nr.next;var c=dr===null?Gt.memoizedState:dr.next;if(c!==null)dr=c,nr=s;else{if(s===null)throw Error(o(310));nr=s,s={memoizedState:nr.memoizedState,baseState:nr.baseState,baseQueue:nr.baseQueue,queue:nr.queue,next:null},dr===null?Gt.memoizedState=dr=s:dr=dr.next=s}return dr}function $s(s,c){return typeof c=="function"?c(s):c}function hg(s){var c=Tn(),A=c.queue;if(A===null)throw Error(o(311));A.lastRenderedReducer=s;var I=nr,L=I.baseQueue,V=A.pending;if(V!==null){if(L!==null){var J=L.next;L.next=V.next,V.next=J}I.baseQueue=L=V,A.pending=null}if(L!==null){V=L.next,I=I.baseState;var ae=J=null,he=null,Ae=V;do{var Ge=Ae.lane;if((vo&Ge)===Ge)he!==null&&(he=he.next={lane:0,action:Ae.action,hasEagerState:Ae.hasEagerState,eagerState:Ae.eagerState,next:null}),I=Ae.hasEagerState?Ae.eagerState:s(I,Ae.action);else{var et={lane:Ge,action:Ae.action,hasEagerState:Ae.hasEagerState,eagerState:Ae.eagerState,next:null};he===null?(ae=he=et,J=I):he=he.next=et,Gt.lanes|=Ge,mo|=Ge}Ae=Ae.next}while(Ae!==null&&Ae!==V);he===null?J=I:he.next=ae,Hn(I,c.memoizedState)||(Xr=!0),c.memoizedState=I,c.baseState=J,c.baseQueue=he,A.lastRenderedState=I}if(s=A.interleaved,s!==null){L=s;do V=L.lane,Gt.lanes|=V,mo|=V,L=L.next;while(L!==s)}else L===null&&(A.lanes=0);return[c.memoizedState,A.dispatch]}function pg(s){var c=Tn(),A=c.queue;if(A===null)throw Error(o(311));A.lastRenderedReducer=s;var I=A.dispatch,L=A.pending,V=c.memoizedState;if(L!==null){A.pending=null;var J=L=L.next;do V=s(V,J.action),J=J.next;while(J!==L);Hn(V,c.memoizedState)||(Xr=!0),c.memoizedState=V,c.baseQueue===null&&(c.baseState=V),A.lastRenderedState=V}return[V,I]}function u2(){}function c2(s,c){var A=Gt,I=Tn(),L=c(),V=!Hn(I.memoizedState,L);if(V&&(I.memoizedState=L,Xr=!0),I=I.queue,gg(h2.bind(null,A,I,s),[s]),I.getSnapshot!==c||V||dr!==null&&dr.memoizedState.tag&1){if(A.flags|=2048,Ws(9,d2.bind(null,A,I,L,c),void 0,null),hr===null)throw Error(o(349));vo&30||f2(A,c,L)}return L}function f2(s,c,A){s.flags|=16384,s={getSnapshot:c,value:A},c=Gt.updateQueue,c===null?(c={lastEffect:null,stores:null},Gt.updateQueue=c,c.stores=[s]):(A=c.stores,A===null?c.stores=[s]:A.push(s))}function d2(s,c,A,I){c.value=A,c.getSnapshot=I,p2(c)&&g2(s)}function h2(s,c,A){return A(function(){p2(c)&&g2(s)})}function p2(s){var c=s.getSnapshot;s=s.value;try{var A=c();return!Hn(s,A)}catch{return!0}}function g2(s){var c=fi(s,1);c!==null&&Cn(c,s,1,-1)}function v2(s){var c=hi();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$s,lastRenderedState:s},c.queue=s,s=s.dispatch=l9.bind(null,Gt,s),[c.memoizedState,s]}function Ws(s,c,A,I){return s={tag:s,create:c,destroy:A,deps:I,next:null},c=Gt.updateQueue,c===null?(c={lastEffect:null,stores:null},Gt.updateQueue=c,c.lastEffect=s.next=s):(A=c.lastEffect,A===null?c.lastEffect=s.next=s:(I=A.next,A.next=s,s.next=I,c.lastEffect=s)),s}function m2(){return Tn().memoizedState}function Jc(s,c,A,I){var L=hi();Gt.flags|=s,L.memoizedState=Ws(1|c,A,void 0,I===void 0?null:I)}function ef(s,c,A,I){var L=Tn();I=I===void 0?null:I;var V=void 0;if(nr!==null){var J=nr.memoizedState;if(V=J.destroy,I!==null&&cg(I,J.deps)){L.memoizedState=Ws(c,A,V,I);return}}Gt.flags|=s,L.memoizedState=Ws(1|c,A,V,I)}function y2(s,c){return Jc(8390656,8,s,c)}function gg(s,c){return ef(2048,8,s,c)}function b2(s,c){return ef(4,2,s,c)}function _2(s,c){return ef(4,4,s,c)}function w2(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 S2(s,c,A){return A=A!=null?A.concat([s]):null,ef(4,4,w2.bind(null,c,s),A)}function vg(){}function E2(s,c){var A=Tn();c=c===void 0?null:c;var I=A.memoizedState;return I!==null&&c!==null&&cg(c,I[1])?I[0]:(A.memoizedState=[s,c],s)}function O2(s,c){var A=Tn();c=c===void 0?null:c;var I=A.memoizedState;return I!==null&&c!==null&&cg(c,I[1])?I[0]:(s=s(),A.memoizedState=[s,c],s)}function x2(s,c,A){return vo&21?(Hn(A,c)||(A=U1(),Gt.lanes|=A,mo|=A,s.baseState=!0),c):(s.baseState&&(s.baseState=!1,Xr=!0),s.memoizedState=A)}function a9(s,c){var A=vt;vt=A!==0&&4>A?A:4,s(!0);var I=ug.transition;ug.transition={};try{s(!1),c()}finally{vt=A,ug.transition=I}}function P2(){return Tn().memoizedState}function o9(s,c,A){var I=Sa(s);if(A={lane:I,action:A,hasEagerState:!1,eagerState:null,next:null},A2(s))k2(c,A);else if(A=Q1(s,c,A,I),A!==null){var L=Nr();Cn(A,s,I,L),T2(A,c,I)}}function l9(s,c,A){var I=Sa(s),L={lane:I,action:A,hasEagerState:!1,eagerState:null,next:null};if(A2(s))k2(c,L);else{var V=s.alternate;if(s.lanes===0&&(V===null||V.lanes===0)&&(V=c.lastRenderedReducer,V!==null))try{var J=c.lastRenderedState,ae=V(J,A);if(L.hasEagerState=!0,L.eagerState=ae,Hn(ae,J)){var he=c.interleaved;he===null?(L.next=L,tg(c)):(L.next=he.next,he.next=L),c.interleaved=L;return}}catch{}finally{}A=Q1(s,c,L,I),A!==null&&(L=Nr(),Cn(A,s,I,L),T2(A,c,I))}}function A2(s){var c=s.alternate;return s===Gt||c!==null&&c===Gt}function k2(s,c){Vs=Zc=!0;var A=s.pending;A===null?c.next=c:(c.next=A.next,A.next=c),s.pending=c}function T2(s,c,A){if(A&4194240){var I=c.lanes;I&=s.pendingLanes,A|=I,c.lanes=A,Up(s,A)}}var tf={readContext:An,useCallback:Tr,useContext:Tr,useEffect:Tr,useImperativeHandle:Tr,useInsertionEffect:Tr,useLayoutEffect:Tr,useMemo:Tr,useReducer:Tr,useRef:Tr,useState:Tr,useDebugValue:Tr,useDeferredValue:Tr,useTransition:Tr,useMutableSource:Tr,useSyncExternalStore:Tr,useId:Tr,unstable_isNewReconciler:!1},s9={readContext:An,useCallback:function(s,c){return hi().memoizedState=[s,c===void 0?null:c],s},useContext:An,useEffect:y2,useImperativeHandle:function(s,c,A){return A=A!=null?A.concat([s]):null,Jc(4194308,4,w2.bind(null,c,s),A)},useLayoutEffect:function(s,c){return Jc(4194308,4,s,c)},useInsertionEffect:function(s,c){return Jc(4,2,s,c)},useMemo:function(s,c){var A=hi();return c=c===void 0?null:c,s=s(),A.memoizedState=[s,c],s},useReducer:function(s,c,A){var I=hi();return c=A!==void 0?A(c):c,I.memoizedState=I.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},I.queue=s,s=s.dispatch=o9.bind(null,Gt,s),[I.memoizedState,s]},useRef:function(s){var c=hi();return s={current:s},c.memoizedState=s},useState:v2,useDebugValue:vg,useDeferredValue:function(s){return hi().memoizedState=s},useTransition:function(){var s=v2(!1),c=s[0];return s=a9.bind(null,s[1]),hi().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,A){var I=Gt,L=hi();if(Dt){if(A===void 0)throw Error(o(407));A=A()}else{if(A=c(),hr===null)throw Error(o(349));vo&30||f2(I,c,A)}L.memoizedState=A;var V={value:A,getSnapshot:c};return L.queue=V,y2(h2.bind(null,I,V,s),[s]),I.flags|=2048,Ws(9,d2.bind(null,I,V,A,c),void 0,null),A},useId:function(){var s=hi(),c=hr.identifierPrefix;if(Dt){var A=ji,I=Li;A=(I&~(1<<32-Gn(I)-1)).toString(32)+A,c=":"+c+"R"+A,A=qs++,0<A&&(c+="H"+A.toString(32)),c+=":"}else A=i9++,c=":"+c+"r"+A.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},u9={readContext:An,useCallback:E2,useContext:An,useEffect:gg,useImperativeHandle:S2,useInsertionEffect:b2,useLayoutEffect:_2,useMemo:O2,useReducer:hg,useRef:m2,useState:function(){return hg($s)},useDebugValue:vg,useDeferredValue:function(s){var c=Tn();return x2(c,nr.memoizedState,s)},useTransition:function(){var s=hg($s)[0],c=Tn().memoizedState;return[s,c]},useMutableSource:u2,useSyncExternalStore:c2,useId:P2,unstable_isNewReconciler:!1},c9={readContext:An,useCallback:E2,useContext:An,useEffect:gg,useImperativeHandle:S2,useInsertionEffect:b2,useLayoutEffect:_2,useMemo:O2,useReducer:pg,useRef:m2,useState:function(){return pg($s)},useDebugValue:vg,useDeferredValue:function(s){var c=Tn();return nr===null?c.memoizedState=s:x2(c,nr.memoizedState,s)},useTransition:function(){var s=pg($s)[0],c=Tn().memoizedState;return[s,c]},useMutableSource:u2,useSyncExternalStore:c2,useId:P2,unstable_isNewReconciler:!1};function El(s,c){try{var A="",I=c;do A+=n9(I),I=I.return;while(I);var L=A}catch(V){L=`
55
+ Error generating stack: `+V.message+`
56
+ `+V.stack}return{value:s,source:c,stack:L,digest:null}}function mg(s,c,A){return{value:s,source:null,stack:A??null,digest:c??null}}function yg(s,c){try{console.error(c.value)}catch(A){setTimeout(function(){throw A})}}var f9=typeof WeakMap=="function"?WeakMap:Map;function C2(s,c,A){A=Di(-1,A),A.tag=3,A.payload={element:null};var I=c.value;return A.callback=function(){vf||(vf=!0,Fg=I),yg(s,c)},A}function R2(s,c,A){A=Di(-1,A),A.tag=3;var I=s.type.getDerivedStateFromError;if(typeof I=="function"){var L=c.value;A.payload=function(){return I(L)},A.callback=function(){yg(s,c)}}var V=s.stateNode;return V!==null&&typeof V.componentDidCatch=="function"&&(A.callback=function(){yg(s,c),typeof I!="function"&&(_a===null?_a=new Set([this]):_a.add(this));var J=c.stack;this.componentDidCatch(c.value,{componentStack:J!==null?J:""})}),A}function N2(s,c,A){var I=s.pingCache;if(I===null){I=s.pingCache=new f9;var L=new Set;I.set(c,L)}else L=I.get(c),L===void 0&&(L=new Set,I.set(c,L));L.has(A)||(L.add(A),s=x9.bind(null,s,c,A),c.then(s,s))}function M2(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 I2(s,c,A,I,L){return s.mode&1?(s.flags|=65536,s.lanes=L,s):(s===c?s.flags|=65536:(s.flags|=128,A.flags|=131072,A.flags&=-52805,A.tag===1&&(A.alternate===null?A.tag=17:(c=Di(-1,1),c.tag=2,ba(A,c,1))),A.lanes|=1),s)}var d9=l.ReactCurrentOwner,Xr=!1;function Ur(s,c,A,I){c.child=s===null?l2(c,null,A,I):_l(c,s.child,A,I)}function L2(s,c,A,I,L){A=A.render;var V=c.ref;return bl(c,L),I=fg(s,c,A,I,V,L),A=dg(),s!==null&&!Xr?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~L,Fi(s,c,L)):(Dt&&A&&$p(c),c.flags|=1,Ur(s,c,I,L),c.child)}function j2(s,c,A,I,L){if(s===null){var V=A.type;return typeof V=="function"&&!Vg(V)&&V.defaultProps===void 0&&A.compare===null&&A.defaultProps===void 0?(c.tag=15,c.type=V,D2(s,c,V,I,L)):(s=Sf(A.type,null,I,c,c.mode,L),s.ref=c.ref,s.return=c,c.child=s)}if(V=s.child,!(s.lanes&L)){var J=V.memoizedProps;if(A=A.compare,A=A!==null?A:Hc,A(J,I)&&s.ref===c.ref)return Fi(s,c,L)}return c.flags|=1,s=Oa(V,I),s.ref=c.ref,s.return=c,c.child=s}function D2(s,c,A,I,L){if(s!==null){var V=s.memoizedProps;if(Hc(V,I)&&s.ref===c.ref)if(Xr=!1,c.pendingProps=I=V,(s.lanes&L)!==0)s.flags&131072&&(Xr=!0);else return c.lanes=s.lanes,Fi(s,c,L)}return bg(s,c,A,I,L)}function F2(s,c,A){var I=c.pendingProps,L=I.children,V=s!==null?s.memoizedState:null;if(I.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ct(xl,dn),dn|=A;else{if(!(A&1073741824))return s=V!==null?V.baseLanes|A:A,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Ct(xl,dn),dn|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},I=V!==null?V.baseLanes:A,Ct(xl,dn),dn|=I}else V!==null?(I=V.baseLanes|A,c.memoizedState=null):I=A,Ct(xl,dn),dn|=I;return Ur(s,c,L,A),c.child}function z2(s,c){var A=c.ref;(s===null&&A!==null||s!==null&&s.ref!==A)&&(c.flags|=512,c.flags|=2097152)}function bg(s,c,A,I,L){var V=Kr(A)?fo:kr.current;return V=pl(c,V),bl(c,L),A=fg(s,c,A,I,V,L),I=dg(),s!==null&&!Xr?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~L,Fi(s,c,L)):(Dt&&I&&$p(c),c.flags|=1,Ur(s,c,A,L),c.child)}function B2(s,c,A,I,L){if(Kr(A)){var V=!0;Ic(c)}else V=!1;if(bl(c,L),c.stateNode===null)nf(s,c),n2(c,A,I),ig(c,A,I,L),I=!0;else if(s===null){var J=c.stateNode,ae=c.memoizedProps;J.props=ae;var he=J.context,Ae=A.contextType;typeof Ae=="object"&&Ae!==null?Ae=An(Ae):(Ae=Kr(A)?fo:kr.current,Ae=pl(c,Ae));var Ge=A.getDerivedStateFromProps,et=typeof Ge=="function"||typeof J.getSnapshotBeforeUpdate=="function";et||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(ae!==I||he!==Ae)&&i2(c,J,I,Ae),ya=!1;var Me=c.memoizedState;J.state=Me,Wc(c,I,J,L),he=c.memoizedState,ae!==I||Me!==he||Yr.current||ya?(typeof Ge=="function"&&(ng(c,A,Ge,I),he=c.memoizedState),(ae=ya||r2(c,A,ae,I,Me,he,Ae))?(et||typeof J.UNSAFE_componentWillMount!="function"&&typeof J.componentWillMount!="function"||(typeof J.componentWillMount=="function"&&J.componentWillMount(),typeof J.UNSAFE_componentWillMount=="function"&&J.UNSAFE_componentWillMount()),typeof J.componentDidMount=="function"&&(c.flags|=4194308)):(typeof J.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=I,c.memoizedState=he),J.props=I,J.state=he,J.context=Ae,I=ae):(typeof J.componentDidMount=="function"&&(c.flags|=4194308),I=!1)}else{J=c.stateNode,Z1(s,c),ae=c.memoizedProps,Ae=c.type===c.elementType?ae:qn(c.type,ae),J.props=Ae,et=c.pendingProps,Me=J.context,he=A.contextType,typeof he=="object"&&he!==null?he=An(he):(he=Kr(A)?fo:kr.current,he=pl(c,he));var Mt=A.getDerivedStateFromProps;(Ge=typeof Mt=="function"||typeof J.getSnapshotBeforeUpdate=="function")||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(ae!==et||Me!==he)&&i2(c,J,I,he),ya=!1,Me=c.memoizedState,J.state=Me,Wc(c,I,J,L);var kt=c.memoizedState;ae!==et||Me!==kt||Yr.current||ya?(typeof Mt=="function"&&(ng(c,A,Mt,I),kt=c.memoizedState),(Ae=ya||r2(c,A,Ae,I,Me,kt,he)||!1)?(Ge||typeof J.UNSAFE_componentWillUpdate!="function"&&typeof J.componentWillUpdate!="function"||(typeof J.componentWillUpdate=="function"&&J.componentWillUpdate(I,kt,he),typeof J.UNSAFE_componentWillUpdate=="function"&&J.UNSAFE_componentWillUpdate(I,kt,he)),typeof J.componentDidUpdate=="function"&&(c.flags|=4),typeof J.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof J.componentDidUpdate!="function"||ae===s.memoizedProps&&Me===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||ae===s.memoizedProps&&Me===s.memoizedState||(c.flags|=1024),c.memoizedProps=I,c.memoizedState=kt),J.props=I,J.state=kt,J.context=he,I=Ae):(typeof J.componentDidUpdate!="function"||ae===s.memoizedProps&&Me===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||ae===s.memoizedProps&&Me===s.memoizedState||(c.flags|=1024),I=!1)}return _g(s,c,A,I,V,L)}function _g(s,c,A,I,L,V){z2(s,c);var J=(c.flags&128)!==0;if(!I&&!J)return L&&B1(c,A,!1),Fi(s,c,V);I=c.stateNode,d9.current=c;var ae=J&&typeof A.getDerivedStateFromError!="function"?null:I.render();return c.flags|=1,s!==null&&J?(c.child=_l(c,s.child,null,V),c.child=_l(c,null,ae,V)):Ur(s,c,ae,V),c.memoizedState=I.state,L&&B1(c,A,!0),c.child}function U2(s){var c=s.stateNode;c.pendingContext?F1(s,c.pendingContext,c.pendingContext!==c.context):c.context&&F1(s,c.context,!1),ag(s,c.containerInfo)}function G2(s,c,A,I,L){return ml(),Xp(L),c.flags|=256,Ur(s,c,A,I),c.child}var wg={dehydrated:null,treeContext:null,retryLane:0};function Sg(s){return{baseLanes:s,cachePool:null,transitions:null}}function H2(s,c,A){var I=c.pendingProps,L=Ut.current,V=!1,J=(c.flags&128)!==0,ae;if((ae=J)||(ae=s!==null&&s.memoizedState===null?!1:(L&2)!==0),ae?(V=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(L|=1),Ct(Ut,L&1),s===null)return Kp(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(c.mode&1?Br(s)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(J=I.children,s=I.fallback,V?(I=c.mode,V=c.child,J={mode:"hidden",children:J},!(I&1)&&V!==null?(V.childLanes=0,V.pendingProps=J):V=Ef(J,I,0,null),s=wo(s,I,A,null),V.return=c,s.return=c,V.sibling=s,c.child=V,c.child.memoizedState=Sg(A),c.memoizedState=wg,s):Eg(c,J));if(L=s.memoizedState,L!==null&&(ae=L.dehydrated,ae!==null))return h9(s,c,J,I,ae,L,A);if(V){V=I.fallback,J=c.mode,L=s.child,ae=L.sibling;var he={mode:"hidden",children:I.children};return!(J&1)&&c.child!==L?(I=c.child,I.childLanes=0,I.pendingProps=he,c.deletions=null):(I=Oa(L,he),I.subtreeFlags=L.subtreeFlags&14680064),ae!==null?V=Oa(ae,V):(V=wo(V,J,A,null),V.flags|=2),V.return=c,I.return=c,I.sibling=V,c.child=I,I=V,V=c.child,J=s.child.memoizedState,J=J===null?Sg(A):{baseLanes:J.baseLanes|A,cachePool:null,transitions:J.transitions},V.memoizedState=J,V.childLanes=s.childLanes&~A,c.memoizedState=wg,I}return V=s.child,s=V.sibling,I=Oa(V,{mode:"visible",children:I.children}),!(c.mode&1)&&(I.lanes=A),I.return=c,I.sibling=null,s!==null&&(A=c.deletions,A===null?(c.deletions=[s],c.flags|=16):A.push(s)),c.child=I,c.memoizedState=null,I}function Eg(s,c){return c=Ef({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function rf(s,c,A,I){return I!==null&&Xp(I),_l(c,s.child,null,A),s=Eg(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function h9(s,c,A,I,L,V,J){if(A)return c.flags&256?(c.flags&=-257,I=mg(Error(o(422))),rf(s,c,J,I)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(V=I.fallback,L=c.mode,I=Ef({mode:"visible",children:I.children},L,0,null),V=wo(V,L,J,null),V.flags|=2,I.return=c,V.return=c,I.sibling=V,c.child=I,c.mode&1&&_l(c,s.child,null,J),c.child.memoizedState=Sg(J),c.memoizedState=wg,V);if(!(c.mode&1))return rf(s,c,J,null);if(Br(L))return I=Ni(L).digest,V=Error(o(419)),I=mg(V,I,void 0),rf(s,c,J,I);if(A=(J&s.childLanes)!==0,Xr||A){if(I=hr,I!==null){switch(J&-J){case 4:L=2;break;case 16:L=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:L=32;break;case 536870912:L=268435456;break;default:L=0}L=L&(I.suspendedLanes|J)?0:L,L!==0&&L!==V.retryLane&&(V.retryLane=L,fi(s,L),Cn(I,s,L,-1))}return Hg(),I=mg(Error(o(421))),rf(s,c,J,I)}return Ar(L)?(c.flags|=128,c.child=s.child,c=P9.bind(null,s),Sn(L,c),null):(s=V.treeContext,ie&&(Pn=js(L),fn=c,Dt=!0,Vn=null,Bs=!1,s!==null&&(On[xn++]=Li,On[xn++]=ji,On[xn++]=ho,Li=s.id,ji=s.overflow,ho=c)),c=Eg(c,I.children),c.flags|=4096,c)}function V2(s,c,A){s.lanes|=c;var I=s.alternate;I!==null&&(I.lanes|=c),eg(s.return,c,A)}function Og(s,c,A,I,L){var V=s.memoizedState;V===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:I,tail:A,tailMode:L}:(V.isBackwards=c,V.rendering=null,V.renderingStartTime=0,V.last=I,V.tail=A,V.tailMode=L)}function q2(s,c,A){var I=c.pendingProps,L=I.revealOrder,V=I.tail;if(Ur(s,c,I.children,A),I=Ut.current,I&2)I=I&1|2,c.flags|=128;else{if(s!==null&&s.flags&128)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&V2(s,A,c);else if(s.tag===19)V2(s,A,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}I&=1}if(Ct(Ut,I),!(c.mode&1))c.memoizedState=null;else switch(L){case"forwards":for(A=c.child,L=null;A!==null;)s=A.alternate,s!==null&&Xc(s)===null&&(L=A),A=A.sibling;A=L,A===null?(L=c.child,c.child=null):(L=A.sibling,A.sibling=null),Og(c,!1,L,A,V);break;case"backwards":for(A=null,L=c.child,c.child=null;L!==null;){if(s=L.alternate,s!==null&&Xc(s)===null){c.child=L;break}s=L.sibling,L.sibling=A,A=L,L=s}Og(c,!0,A,null,V);break;case"together":Og(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function nf(s,c){!(c.mode&1)&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function Fi(s,c,A){if(s!==null&&(c.dependencies=s.dependencies),mo|=c.lanes,!(A&c.childLanes))return null;if(s!==null&&c.child!==s.child)throw Error(o(153));if(c.child!==null){for(s=c.child,A=Oa(s,s.pendingProps),c.child=A,A.return=c;s.sibling!==null;)s=s.sibling,A=A.sibling=Oa(s,s.pendingProps),A.return=c;A.sibling=null}return c.child}function p9(s,c,A){switch(c.tag){case 3:U2(c),ml();break;case 5:s2(c);break;case 1:Kr(c.type)&&Ic(c);break;case 4:ag(c,c.stateNode.containerInfo);break;case 10:X1(c,c.type._context,c.memoizedProps.value);break;case 13:var I=c.memoizedState;if(I!==null)return I.dehydrated!==null?(Ct(Ut,Ut.current&1),c.flags|=128,null):A&c.child.childLanes?H2(s,c,A):(Ct(Ut,Ut.current&1),s=Fi(s,c,A),s!==null?s.sibling:null);Ct(Ut,Ut.current&1);break;case 19:if(I=(A&c.childLanes)!==0,s.flags&128){if(I)return q2(s,c,A);c.flags|=128}var L=c.memoizedState;if(L!==null&&(L.rendering=null,L.tail=null,L.lastEffect=null),Ct(Ut,Ut.current),I)break;return null;case 22:case 23:return c.lanes=0,F2(s,c,A)}return Fi(s,c,A)}function pi(s){s.flags|=4}function $2(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 Ys,Ks,af,of;if(Z)Ys=function(s,c){for(var A=c.child;A!==null;){if(A.tag===5||A.tag===6)D(s,A.stateNode);else if(A.tag!==4&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===c)break;for(;A.sibling===null;){if(A.return===null||A.return===c)return;A=A.return}A.sibling.return=A.return,A=A.sibling}},Ks=function(){},af=function(s,c,A,I,L){if(s=s.memoizedProps,s!==I){var V=c.stateNode,J=di(kn.current);A=q(V,A,s,I,L,J),(c.updateQueue=A)&&pi(c)}},of=function(s,c,A,I){A!==I&&pi(c)};else if(ne){Ys=function(s,c,A,I){for(var L=c.child;L!==null;){if(L.tag===5){var V=L.stateNode;A&&I&&(V=ct(V,L.type,L.memoizedProps,L)),D(s,V)}else if(L.tag===6)V=L.stateNode,A&&I&&(V=At(V,L.memoizedProps,L)),D(s,V);else if(L.tag!==4){if(L.tag===22&&L.memoizedState!==null)V=L.child,V!==null&&(V.return=L),Ys(s,L,!0,!0);else if(L.child!==null){L.child.return=L,L=L.child;continue}}if(L===c)break;for(;L.sibling===null;){if(L.return===null||L.return===c)return;L=L.return}L.sibling.return=L.return,L=L.sibling}};var W2=function(s,c,A,I){for(var L=c.child;L!==null;){if(L.tag===5){var V=L.stateNode;A&&I&&(V=ct(V,L.type,L.memoizedProps,L)),_t(s,V)}else if(L.tag===6)V=L.stateNode,A&&I&&(V=At(V,L.memoizedProps,L)),_t(s,V);else if(L.tag!==4){if(L.tag===22&&L.memoizedState!==null)V=L.child,V!==null&&(V.return=L),W2(s,L,!0,!0);else if(L.child!==null){L.child.return=L,L=L.child;continue}}if(L===c)break;for(;L.sibling===null;){if(L.return===null||L.return===c)return;L=L.return}L.sibling.return=L.return,L=L.sibling}};Ks=function(s,c){var A=c.stateNode;if(!$2(s,c)){s=A.containerInfo;var I=wt(s);W2(I,c,!1,!1),A.pendingChildren=I,pi(c),De(s,I)}},af=function(s,c,A,I,L){var V=s.stateNode,J=s.memoizedProps;if((s=$2(s,c))&&J===I)c.stateNode=V;else{var ae=c.stateNode,he=di(kn.current),Ae=null;J!==I&&(Ae=q(ae,A,J,I,L,he)),s&&Ae===null?c.stateNode=V:(V=Je(V,Ae,A,J,I,c,s,ae),B(V,A,I,L,he)&&pi(c),c.stateNode=V,s?pi(c):Ys(V,c,!1,!1))}},of=function(s,c,A,I){A!==I?(s=di(wl.current),A=di(kn.current),c.stateNode=$(I,s,A,c),pi(c)):c.stateNode=s.stateNode}}else Ks=function(){},af=function(){},of=function(){};function Xs(s,c){if(!Dt)switch(s.tailMode){case"hidden":c=s.tail;for(var A=null;c!==null;)c.alternate!==null&&(A=c),c=c.sibling;A===null?s.tail=null:A.sibling=null;break;case"collapsed":A=s.tail;for(var I=null;A!==null;)A.alternate!==null&&(I=A),A=A.sibling;I===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:I.sibling=null}}function Cr(s){var c=s.alternate!==null&&s.alternate.child===s.child,A=0,I=0;if(c)for(var L=s.child;L!==null;)A|=L.lanes|L.childLanes,I|=L.subtreeFlags&14680064,I|=L.flags&14680064,L.return=s,L=L.sibling;else for(L=s.child;L!==null;)A|=L.lanes|L.childLanes,I|=L.subtreeFlags,I|=L.flags,L.return=s,L=L.sibling;return s.subtreeFlags|=I,s.childLanes=A,c}function g9(s,c,A){var I=c.pendingProps;switch(Wp(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cr(c),null;case 1:return Kr(c.type)&&Mc(),Cr(c),null;case 3:return A=c.stateNode,Sl(),Nt(Yr),Nt(kr),sg(),A.pendingContext&&(A.context=A.pendingContext,A.pendingContext=null),(s===null||s.child===null)&&(Gc(c)?pi(c):s===null||s.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,Vn!==null&&(Ug(Vn),Vn=null))),Ks(s,c),Cr(c),null;case 5:og(c),A=di(wl.current);var L=c.type;if(s!==null&&c.stateNode!=null)af(s,c,L,I,A),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!I){if(c.stateNode===null)throw Error(o(166));return Cr(c),null}if(s=di(kn.current),Gc(c)){if(!ie)throw Error(o(175));s=Mi(c.stateNode,c.type,c.memoizedProps,A,s,c,!Bs),c.updateQueue=s,s!==null&&pi(c)}else{var V=k(L,I,A,s,c);Ys(V,c,!1,!1),c.stateNode=V,B(V,L,I,A,s)&&pi(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Cr(c),null;case 6:if(s&&c.stateNode!=null)of(s,c,s.memoizedProps,I);else{if(typeof I!="string"&&c.stateNode===null)throw Error(o(166));if(s=di(wl.current),A=di(kn.current),Gc(c)){if(!ie)throw Error(o(176));if(s=c.stateNode,A=c.memoizedProps,(I=ga(s,A,c,!Bs))&&(L=fn,L!==null))switch(L.tag){case 3:BE(L.stateNode.containerInfo,s,A,(L.mode&1)!==0);break;case 5:UE(L.type,L.memoizedProps,L.stateNode,s,A,(L.mode&1)!==0)}I&&pi(c)}else c.stateNode=$(I,s,A,c)}return Cr(c),null;case 13:if(Nt(Ut),I=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Dt&&Pn!==null&&c.mode&1&&!(c.flags&128))K1(),ml(),c.flags|=98560,L=!1;else if(L=Gc(c),I!==null&&I.dehydrated!==null){if(s===null){if(!L)throw Error(o(318));if(!ie)throw Error(o(344));if(L=c.memoizedState,L=L!==null?L.dehydrated:null,!L)throw Error(o(317));dl(L,c)}else ml(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Cr(c),L=!1}else Vn!==null&&(Ug(Vn),Vn=null),L=!0;if(!L)return c.flags&65536?c:null}return c.flags&128?(c.lanes=A,c):(A=I!==null,A!==(s!==null&&s.memoizedState!==null)&&A&&(c.child.flags|=8192,c.mode&1&&(s===null||Ut.current&1?ir===0&&(ir=3):Hg())),c.updateQueue!==null&&(c.flags|=4),Cr(c),null);case 4:return Sl(),Ks(s,c),s===null&&we(c.stateNode.containerInfo),Cr(c),null;case 10:return Jp(c.type._context),Cr(c),null;case 17:return Kr(c.type)&&Mc(),Cr(c),null;case 19:if(Nt(Ut),L=c.memoizedState,L===null)return Cr(c),null;if(I=(c.flags&128)!==0,V=L.rendering,V===null)if(I)Xs(L,!1);else{if(ir!==0||s!==null&&s.flags&128)for(s=c.child;s!==null;){if(V=Xc(s),V!==null){for(c.flags|=128,Xs(L,!1),s=V.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),c.subtreeFlags=0,s=A,A=c.child;A!==null;)I=A,L=s,I.flags&=14680066,V=I.alternate,V===null?(I.childLanes=0,I.lanes=L,I.child=null,I.subtreeFlags=0,I.memoizedProps=null,I.memoizedState=null,I.updateQueue=null,I.dependencies=null,I.stateNode=null):(I.childLanes=V.childLanes,I.lanes=V.lanes,I.child=V.child,I.subtreeFlags=0,I.deletions=null,I.memoizedProps=V.memoizedProps,I.memoizedState=V.memoizedState,I.updateQueue=V.updateQueue,I.type=V.type,L=V.dependencies,I.dependencies=L===null?null:{lanes:L.lanes,firstContext:L.firstContext}),A=A.sibling;return Ct(Ut,Ut.current&1|2),c.child}s=s.sibling}L.tail!==null&&fr()>Dg&&(c.flags|=128,I=!0,Xs(L,!1),c.lanes=4194304)}else{if(!I)if(s=Xc(V),s!==null){if(c.flags|=128,I=!0,s=s.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),Xs(L,!0),L.tail===null&&L.tailMode==="hidden"&&!V.alternate&&!Dt)return Cr(c),null}else 2*fr()-L.renderingStartTime>Dg&&A!==1073741824&&(c.flags|=128,I=!0,Xs(L,!1),c.lanes=4194304);L.isBackwards?(V.sibling=c.child,c.child=V):(s=L.last,s!==null?s.sibling=V:c.child=V,L.last=V)}return L.tail!==null?(c=L.tail,L.rendering=c,L.tail=c.sibling,L.renderingStartTime=fr(),c.sibling=null,s=Ut.current,Ct(Ut,I?s&1|2:s&1),c):(Cr(c),null);case 22:case 23:return Gg(),A=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==A&&(c.flags|=8192),A&&c.mode&1?dn&1073741824&&(Cr(c),Z&&c.subtreeFlags&6&&(c.flags|=8192)):Cr(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}function v9(s,c){switch(Wp(c),c.tag){case 1:return Kr(c.type)&&Mc(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Sl(),Nt(Yr),Nt(kr),sg(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return og(c),null;case 13:if(Nt(Ut),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(o(340));ml()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return Nt(Ut),null;case 4:return Sl(),null;case 10:return Jp(c.type._context),null;case 22:case 23:return Gg(),null;case 24:return null;default:return null}}var lf=!1,Rr=!1,m9=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function Ol(s,c){var A=s.ref;if(A!==null)if(typeof A=="function")try{A(null)}catch(I){Ft(s,c,I)}else A.current=null}function xg(s,c,A){try{A()}catch(I){Ft(s,c,I)}}var Y2=!1;function y9(s,c){for(j(s.containerInfo),Fe=c;Fe!==null;)if(s=Fe,c=s.child,(s.subtreeFlags&1028)!==0&&c!==null)c.return=s,Fe=c;else for(;Fe!==null;){s=Fe;try{var A=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(A!==null){var I=A.memoizedProps,L=A.memoizedState,V=s.stateNode,J=V.getSnapshotBeforeUpdate(s.elementType===s.type?I:qn(s.type,I),L);V.__reactInternalSnapshotBeforeUpdate=J}break;case 3:Z&&Ue(s.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(ae){Ft(s,s.return,ae)}if(c=s.sibling,c!==null){c.return=s.return,Fe=c;break}Fe=s.return}return A=Y2,Y2=!1,A}function Qs(s,c,A){var I=c.updateQueue;if(I=I!==null?I.lastEffect:null,I!==null){var L=I=I.next;do{if((L.tag&s)===s){var V=L.destroy;L.destroy=void 0,V!==void 0&&xg(c,A,V)}L=L.next}while(L!==I)}}function sf(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var A=c=c.next;do{if((A.tag&s)===s){var I=A.create;A.destroy=I()}A=A.next}while(A!==c)}}function Pg(s){var c=s.ref;if(c!==null){var A=s.stateNode;switch(s.tag){case 5:s=Y(A);break;default:s=A}typeof c=="function"?c(s):c.current=s}}function K2(s){var c=s.alternate;c!==null&&(s.alternate=null,K2(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&xe(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 X2(s){return s.tag===5||s.tag===3||s.tag===4}function Q2(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||X2(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 Ag(s,c,A){var I=s.tag;if(I===5||I===6)s=s.stateNode,c?re(A,s,c):Te(A,s);else if(I!==4&&(s=s.child,s!==null))for(Ag(s,c,A),s=s.sibling;s!==null;)Ag(s,c,A),s=s.sibling}function kg(s,c,A){var I=s.tag;if(I===5||I===6)s=s.stateNode,c?se(A,s,c):Ye(A,s);else if(I!==4&&(s=s.child,s!==null))for(kg(s,c,A),s=s.sibling;s!==null;)kg(s,c,A),s=s.sibling}var _r=null,$n=!1;function gi(s,c,A){for(A=A.child;A!==null;)Tg(s,c,A),A=A.sibling}function Tg(s,c,A){if(ui&&typeof ui.onCommitFiberUnmount=="function")try{ui.onCommitFiberUnmount(Fc,A)}catch{}switch(A.tag){case 5:Rr||Ol(A,c);case 6:if(Z){var I=_r,L=$n;_r=null,gi(s,c,A),_r=I,$n=L,_r!==null&&($n?Ie(_r,A.stateNode):ke(_r,A.stateNode))}else gi(s,c,A);break;case 18:Z&&_r!==null&&($n?FE(_r,A.stateNode):DE(_r,A.stateNode));break;case 4:Z?(I=_r,L=$n,_r=A.stateNode.containerInfo,$n=!0,gi(s,c,A),_r=I,$n=L):(ne&&(I=A.stateNode.containerInfo,L=wt(I),Ke(I,L)),gi(s,c,A));break;case 0:case 11:case 14:case 15:if(!Rr&&(I=A.updateQueue,I!==null&&(I=I.lastEffect,I!==null))){L=I=I.next;do{var V=L,J=V.destroy;V=V.tag,J!==void 0&&(V&2||V&4)&&xg(A,c,J),L=L.next}while(L!==I)}gi(s,c,A);break;case 1:if(!Rr&&(Ol(A,c),I=A.stateNode,typeof I.componentWillUnmount=="function"))try{I.props=A.memoizedProps,I.state=A.memoizedState,I.componentWillUnmount()}catch(ae){Ft(A,c,ae)}gi(s,c,A);break;case 21:gi(s,c,A);break;case 22:A.mode&1?(Rr=(I=Rr)||A.memoizedState!==null,gi(s,c,A),Rr=I):gi(s,c,A);break;default:gi(s,c,A)}}function Z2(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var A=s.stateNode;A===null&&(A=s.stateNode=new m9),c.forEach(function(I){var L=A9.bind(null,s,I);A.has(I)||(A.add(I),I.then(L,L))})}}function Wn(s,c){var A=c.deletions;if(A!==null)for(var I=0;I<A.length;I++){var L=A[I];try{var V=s,J=c;if(Z){var ae=J;e:for(;ae!==null;){switch(ae.tag){case 5:_r=ae.stateNode,$n=!1;break e;case 3:_r=ae.stateNode.containerInfo,$n=!0;break e;case 4:_r=ae.stateNode.containerInfo,$n=!0;break e}ae=ae.return}if(_r===null)throw Error(o(160));Tg(V,J,L),_r=null,$n=!1}else Tg(V,J,L);var he=L.alternate;he!==null&&(he.return=null),L.return=null}catch(Ae){Ft(L,c,Ae)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)J2(c,s),c=c.sibling}function J2(s,c){var A=s.alternate,I=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Wn(c,s),vi(s),I&4){try{Qs(3,s,s.return),sf(3,s)}catch(Me){Ft(s,s.return,Me)}try{Qs(5,s,s.return)}catch(Me){Ft(s,s.return,Me)}}break;case 1:Wn(c,s),vi(s),I&512&&A!==null&&Ol(A,A.return);break;case 5:if(Wn(c,s),vi(s),I&512&&A!==null&&Ol(A,A.return),Z){if(s.flags&32){var L=s.stateNode;try{ve(L)}catch(Me){Ft(s,s.return,Me)}}if(I&4&&(L=s.stateNode,L!=null)){var V=s.memoizedProps;if(A=A!==null?A.memoizedProps:V,I=s.type,c=s.updateQueue,s.updateQueue=null,c!==null)try{Qe(L,c,I,A,V,s)}catch(Me){Ft(s,s.return,Me)}}}break;case 6:if(Wn(c,s),vi(s),I&4&&Z){if(s.stateNode===null)throw Error(o(162));L=s.stateNode,V=s.memoizedProps,A=A!==null?A.memoizedProps:V;try{Be(L,A,V)}catch(Me){Ft(s,s.return,Me)}}break;case 3:if(Wn(c,s),vi(s),I&4){if(Z&&ie&&A!==null&&A.memoizedState.isDehydrated)try{Nc(c.containerInfo)}catch(Me){Ft(s,s.return,Me)}if(ne){L=c.containerInfo,V=c.pendingChildren;try{Ke(L,V)}catch(Me){Ft(s,s.return,Me)}}}break;case 4:if(Wn(c,s),vi(s),I&4&&ne){V=s.stateNode,L=V.containerInfo,V=V.pendingChildren;try{Ke(L,V)}catch(Me){Ft(s,s.return,Me)}}break;case 13:Wn(c,s),vi(s),L=s.child,L.flags&8192&&(V=L.memoizedState!==null,L.stateNode.isHidden=V,!V||L.alternate!==null&&L.alternate.memoizedState!==null||(jg=fr())),I&4&&Z2(s);break;case 22:var J=A!==null&&A.memoizedState!==null;if(s.mode&1?(Rr=(A=Rr)||J,Wn(c,s),Rr=A):Wn(c,s),vi(s),I&8192){if(A=s.memoizedState!==null,(s.stateNode.isHidden=A)&&!J&&s.mode&1)for(Fe=s,I=s.child;I!==null;){for(c=Fe=I;Fe!==null;){J=Fe;var ae=J.child;switch(J.tag){case 0:case 11:case 14:case 15:Qs(4,J,J.return);break;case 1:Ol(J,J.return);var he=J.stateNode;if(typeof he.componentWillUnmount=="function"){var Ae=J,Ge=J.return;try{var et=Ae;he.props=et.memoizedProps,he.state=et.memoizedState,he.componentWillUnmount()}catch(Me){Ft(Ae,Ge,Me)}}break;case 5:Ol(J,J.return);break;case 22:if(J.memoizedState!==null){rb(c);continue}}ae!==null?(ae.return=J,Fe=ae):rb(c)}I=I.sibling}if(Z){e:if(I=null,Z)for(c=s;;){if(c.tag===5){if(I===null){I=c;try{L=c.stateNode,A?Ce(L):$e(c.stateNode,c.memoizedProps)}catch(Me){Ft(s,s.return,Me)}}}else if(c.tag===6){if(I===null)try{V=c.stateNode,A?Se(V):Oe(V,c.memoizedProps)}catch(Me){Ft(s,s.return,Me)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;I===c&&(I=null),c=c.return}I===c&&(I=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:Wn(c,s),vi(s),I&4&&Z2(s);break;case 21:break;default:Wn(c,s),vi(s)}}function vi(s){var c=s.flags;if(c&2){try{if(Z){e:{for(var A=s.return;A!==null;){if(X2(A)){var I=A;break e}A=A.return}throw Error(o(160))}switch(I.tag){case 5:var L=I.stateNode;I.flags&32&&(ve(L),I.flags&=-33);var V=Q2(s);kg(s,V,L);break;case 3:case 4:var J=I.stateNode.containerInfo,ae=Q2(s);Ag(s,ae,J);break;default:throw Error(o(161))}}}catch(he){Ft(s,s.return,he)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function b9(s,c,A){Fe=s,eb(s)}function eb(s,c,A){for(var I=(s.mode&1)!==0;Fe!==null;){var L=Fe,V=L.child;if(L.tag===22&&I){var J=L.memoizedState!==null||lf;if(!J){var ae=L.alternate,he=ae!==null&&ae.memoizedState!==null||Rr;ae=lf;var Ae=Rr;if(lf=J,(Rr=he)&&!Ae)for(Fe=L;Fe!==null;)J=Fe,he=J.child,J.tag===22&&J.memoizedState!==null?nb(L):he!==null?(he.return=J,Fe=he):nb(L);for(;V!==null;)Fe=V,eb(V),V=V.sibling;Fe=L,lf=ae,Rr=Ae}tb(s)}else L.subtreeFlags&8772&&V!==null?(V.return=L,Fe=V):tb(s)}}function tb(s){for(;Fe!==null;){var c=Fe;if(c.flags&8772){var A=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:Rr||sf(5,c);break;case 1:var I=c.stateNode;if(c.flags&4&&!Rr)if(A===null)I.componentDidMount();else{var L=c.elementType===c.type?A.memoizedProps:qn(c.type,A.memoizedProps);I.componentDidUpdate(L,A.memoizedState,I.__reactInternalSnapshotBeforeUpdate)}var V=c.updateQueue;V!==null&&e2(c,V,I);break;case 3:var J=c.updateQueue;if(J!==null){if(A=null,c.child!==null)switch(c.child.tag){case 5:A=Y(c.child.stateNode);break;case 1:A=c.child.stateNode}e2(c,J,A)}break;case 5:var ae=c.stateNode;A===null&&c.flags&4&&Ze(ae,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(ie&&c.memoizedState===null){var he=c.alternate;if(he!==null){var Ae=he.memoizedState;if(Ae!==null){var Ge=Ae.dehydrated;Ge!==null&&jE(Ge)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Rr||c.flags&512&&Pg(c)}catch(et){Ft(c,c.return,et)}}if(c===s){Fe=null;break}if(A=c.sibling,A!==null){A.return=c.return,Fe=A;break}Fe=c.return}}function rb(s){for(;Fe!==null;){var c=Fe;if(c===s){Fe=null;break}var A=c.sibling;if(A!==null){A.return=c.return,Fe=A;break}Fe=c.return}}function nb(s){for(;Fe!==null;){var c=Fe;try{switch(c.tag){case 0:case 11:case 15:var A=c.return;try{sf(4,c)}catch(he){Ft(c,A,he)}break;case 1:var I=c.stateNode;if(typeof I.componentDidMount=="function"){var L=c.return;try{I.componentDidMount()}catch(he){Ft(c,L,he)}}var V=c.return;try{Pg(c)}catch(he){Ft(c,V,he)}break;case 5:var J=c.return;try{Pg(c)}catch(he){Ft(c,J,he)}}}catch(he){Ft(c,c.return,he)}if(c===s){Fe=null;break}var ae=c.sibling;if(ae!==null){ae.return=c.return,Fe=ae;break}Fe=c.return}}var uf=0,cf=1,ff=2,df=3,hf=4;if(typeof Symbol=="function"&&Symbol.for){var Zs=Symbol.for;uf=Zs("selector.component"),cf=Zs("selector.has_pseudo_class"),ff=Zs("selector.role"),df=Zs("selector.test_id"),hf=Zs("selector.text")}function Cg(s){var c=pe(s);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(o(364));return c}if(s=_e(s),s===null)throw Error(o(362));return s.stateNode.current}function Rg(s,c){switch(c.$$typeof){case uf:if(s.type===c.value)return!0;break;case cf:e:{c=c.value,s=[s,0];for(var A=0;A<s.length;){var I=s[A++],L=s[A++],V=c[L];if(I.tag!==5||!ue(I)){for(;V!=null&&Rg(I,V);)L++,V=c[L];if(L===c.length){c=!0;break e}else for(I=I.child;I!==null;)s.push(I,L),I=I.sibling}}c=!1}return c;case ff:if(s.tag===5&&me(s.stateNode,c.value))return!0;break;case hf:if((s.tag===5||s.tag===6)&&(s=fe(s),s!==null&&0<=s.indexOf(c.value)))return!0;break;case df: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 Ng(s){switch(s.$$typeof){case uf:return"<"+(P(s.value)||"Unknown")+">";case cf:return":has("+(Ng(s)||"")+")";case ff:return'[role="'+s.value+'"]';case hf:return'"'+s.value+'"';case df:return'[data-testname="'+s.value+'"]';default:throw Error(o(365))}}function ib(s,c){var A=[];s=[s,0];for(var I=0;I<s.length;){var L=s[I++],V=s[I++],J=c[V];if(L.tag!==5||!ue(L)){for(;J!=null&&Rg(L,J);)V++,J=c[V];if(V===c.length)A.push(L);else for(L=L.child;L!==null;)s.push(L,V),L=L.sibling}}return A}function Mg(s,c){if(!be)throw Error(o(363));s=Cg(s),s=ib(s,c),c=[],s=Array.from(s);for(var A=0;A<s.length;){var I=s[A++];if(I.tag===5)ue(I)||c.push(I.stateNode);else for(I=I.child;I!==null;)s.push(I),I=I.sibling}return c}var _9=Math.ceil,pf=l.ReactCurrentDispatcher,Ig=l.ReactCurrentOwner,Qt=l.ReactCurrentBatchConfig,ut=0,hr=null,er=null,wr=0,dn=0,xl=va(0),ir=0,Js=null,mo=0,gf=0,Lg=0,eu=null,Qr=null,jg=0,Dg=1/0,zi=null;function Pl(){Dg=fr()+500}var vf=!1,Fg=null,_a=null,mf=!1,wa=null,yf=0,tu=0,zg=null,bf=-1,_f=0;function Nr(){return ut&6?fr():bf!==-1?bf:bf=fr()}function Sa(s){return s.mode&1?ut&2&&wr!==0?wr&-wr:r9.transition!==null?(_f===0&&(_f=U1()),_f):(s=vt,s!==0?s:Re()):1}function Cn(s,c,A,I){if(50<tu)throw tu=0,zg=null,Error(o(185));zs(s,A,I),(!(ut&2)||s!==hr)&&(s===hr&&(!(ut&2)&&(gf|=A),ir===4&&Ea(s,wr)),Zr(s,I),A===1&&ut===0&&!(c.mode&1)&&(Pl(),zc&&ci()))}function Zr(s,c){var A=s.callbackNode;WE(s,c);var I=Dc(s,s===hr?wr:0);if(I===0)A!==null&&H1(A),s.callbackNode=null,s.callbackPriority=0;else if(c=I&-I,s.callbackPriority!==c){if(A!=null&&H1(A),c===1)s.tag===0?t9(ob.bind(null,s)):V1(ob.bind(null,s)),le?ce(function(){!(ut&6)&&ci()}):Gp(Hp,ci),A=null;else{switch(G1(I)){case 1:A=Hp;break;case 4:A=QE;break;case 16:A=Vp;break;case 536870912:A=ZE;break;default:A=Vp}A=gb(A,ab.bind(null,s))}s.callbackPriority=c,s.callbackNode=A}}function ab(s,c){if(bf=-1,_f=0,ut&6)throw Error(o(327));var A=s.callbackNode;if(_o()&&s.callbackNode!==A)return null;var I=Dc(s,s===hr?wr:0);if(I===0)return null;if(I&30||I&s.expiredLanes||c)c=wf(s,I);else{c=I;var L=ut;ut|=2;var V=ub();(hr!==s||wr!==c)&&(zi=null,Pl(),yo(s,c));do try{E9();break}catch(ae){sb(s,ae)}while(1);Zp(),pf.current=V,ut=L,er!==null?c=0:(hr=null,wr=0,c=ir)}if(c!==0){if(c===2&&(L=zp(s),L!==0&&(I=L,c=Bg(s,L))),c===1)throw A=Js,yo(s,0),Ea(s,I),Zr(s,fr()),A;if(c===6)Ea(s,I);else{if(L=s.current.alternate,!(I&30)&&!w9(L)&&(c=wf(s,I),c===2&&(V=zp(s),V!==0&&(I=V,c=Bg(s,V))),c===1))throw A=Js,yo(s,0),Ea(s,I),Zr(s,fr()),A;switch(s.finishedWork=L,s.finishedLanes=I,c){case 0:case 1:throw Error(o(345));case 2:bo(s,Qr,zi);break;case 3:if(Ea(s,I),(I&130023424)===I&&(c=jg+500-fr(),10<c)){if(Dc(s,0)!==0)break;if(L=s.suspendedLanes,(L&I)!==I){Nr(),s.pingedLanes|=s.suspendedLanes&L;break}s.timeoutHandle=U(bo.bind(null,s,Qr,zi),c);break}bo(s,Qr,zi);break;case 4:if(Ea(s,I),(I&4194240)===I)break;for(c=s.eventTimes,L=-1;0<I;){var J=31-Gn(I);V=1<<J,J=c[J],J>L&&(L=J),I&=~V}if(I=L,I=fr()-I,I=(120>I?120:480>I?480:1080>I?1080:1920>I?1920:3e3>I?3e3:4320>I?4320:1960*_9(I/1960))-I,10<I){s.timeoutHandle=U(bo.bind(null,s,Qr,zi),I);break}bo(s,Qr,zi);break;case 5:bo(s,Qr,zi);break;default:throw Error(o(329))}}}return Zr(s,fr()),s.callbackNode===A?ab.bind(null,s):null}function Bg(s,c){var A=eu;return s.current.memoizedState.isDehydrated&&(yo(s,c).flags|=256),s=wf(s,c),s!==2&&(c=Qr,Qr=A,c!==null&&Ug(c)),s}function Ug(s){Qr===null?Qr=s:Qr.push.apply(Qr,s)}function w9(s){for(var c=s;;){if(c.flags&16384){var A=c.updateQueue;if(A!==null&&(A=A.stores,A!==null))for(var I=0;I<A.length;I++){var L=A[I],V=L.getSnapshot;L=L.value;try{if(!Hn(V(),L))return!1}catch{return!1}}}if(A=c.child,c.subtreeFlags&16384&&A!==null)A.return=c,c=A;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ea(s,c){for(c&=~Lg,c&=~gf,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var A=31-Gn(c),I=1<<A;s[A]=-1,c&=~I}}function ob(s){if(ut&6)throw Error(o(327));_o();var c=Dc(s,0);if(!(c&1))return Zr(s,fr()),null;var A=wf(s,c);if(s.tag!==0&&A===2){var I=zp(s);I!==0&&(c=I,A=Bg(s,I))}if(A===1)throw A=Js,yo(s,0),Ea(s,c),Zr(s,fr()),A;if(A===6)throw Error(o(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,bo(s,Qr,zi),Zr(s,fr()),null}function lb(s){wa!==null&&wa.tag===0&&!(ut&6)&&_o();var c=ut;ut|=1;var A=Qt.transition,I=vt;try{if(Qt.transition=null,vt=1,s)return s()}finally{vt=I,Qt.transition=A,ut=c,!(ut&6)&&ci()}}function Gg(){dn=xl.current,Nt(xl)}function yo(s,c){s.finishedWork=null,s.finishedLanes=0;var A=s.timeoutHandle;if(A!==Q&&(s.timeoutHandle=Q,X(A)),er!==null)for(A=er.return;A!==null;){var I=A;switch(Wp(I),I.tag){case 1:I=I.type.childContextTypes,I!=null&&Mc();break;case 3:Sl(),Nt(Yr),Nt(kr),sg();break;case 5:og(I);break;case 4:Sl();break;case 13:Nt(Ut);break;case 19:Nt(Ut);break;case 10:Jp(I.type._context);break;case 22:case 23:Gg()}A=A.return}if(hr=s,er=s=Oa(s.current,null),wr=dn=c,ir=0,Js=null,Lg=gf=mo=0,Qr=eu=null,go!==null){for(c=0;c<go.length;c++)if(A=go[c],I=A.interleaved,I!==null){A.interleaved=null;var L=I.next,V=A.pending;if(V!==null){var J=V.next;V.next=L,I.next=J}A.pending=I}go=null}return s}function sb(s,c){do{var A=er;try{if(Zp(),Qc.current=tf,Zc){for(var I=Gt.memoizedState;I!==null;){var L=I.queue;L!==null&&(L.pending=null),I=I.next}Zc=!1}if(vo=0,dr=nr=Gt=null,Vs=!1,qs=0,Ig.current=null,A===null||A.return===null){ir=1,Js=c,er=null;break}e:{var V=s,J=A.return,ae=A,he=c;if(c=wr,ae.flags|=32768,he!==null&&typeof he=="object"&&typeof he.then=="function"){var Ae=he,Ge=ae,et=Ge.tag;if(!(Ge.mode&1)&&(et===0||et===11||et===15)){var Me=Ge.alternate;Me?(Ge.updateQueue=Me.updateQueue,Ge.memoizedState=Me.memoizedState,Ge.lanes=Me.lanes):(Ge.updateQueue=null,Ge.memoizedState=null)}var Mt=M2(J);if(Mt!==null){Mt.flags&=-257,I2(Mt,J,ae,V,c),Mt.mode&1&&N2(V,Ae,c),c=Mt,he=Ae;var kt=c.updateQueue;if(kt===null){var Jr=new Set;Jr.add(he),c.updateQueue=Jr}else kt.add(he);break e}else{if(!(c&1)){N2(V,Ae,c),Hg();break e}he=Error(o(426))}}else if(Dt&&ae.mode&1){var Bi=M2(J);if(Bi!==null){!(Bi.flags&65536)&&(Bi.flags|=256),I2(Bi,J,ae,V,c),Xp(El(he,ae));break e}}V=he=El(he,ae),ir!==4&&(ir=2),eu===null?eu=[V]:eu.push(V),V=J;do{switch(V.tag){case 3:V.flags|=65536,c&=-c,V.lanes|=c;var de=C2(V,he,c);J1(V,de);break e;case 1:ae=he;var oe=V.type,ge=V.stateNode;if(!(V.flags&128)&&(typeof oe.getDerivedStateFromError=="function"||ge!==null&&typeof ge.componentDidCatch=="function"&&(_a===null||!_a.has(ge)))){V.flags|=65536,c&=-c,V.lanes|=c;var Le=R2(V,ae,c);J1(V,Le);break e}}V=V.return}while(V!==null)}fb(A)}catch(We){c=We,er===A&&A!==null&&(er=A=A.return);continue}break}while(1)}function ub(){var s=pf.current;return pf.current=tf,s===null?tf:s}function Hg(){(ir===0||ir===3||ir===2)&&(ir=4),hr===null||!(mo&268435455)&&!(gf&268435455)||Ea(hr,wr)}function wf(s,c){var A=ut;ut|=2;var I=ub();(hr!==s||wr!==c)&&(zi=null,yo(s,c));do try{S9();break}catch(L){sb(s,L)}while(1);if(Zp(),ut=A,pf.current=I,er!==null)throw Error(o(261));return hr=null,wr=0,ir}function S9(){for(;er!==null;)cb(er)}function E9(){for(;er!==null&&!KE();)cb(er)}function cb(s){var c=pb(s.alternate,s,dn);s.memoizedProps=s.pendingProps,c===null?fb(s):er=c,Ig.current=null}function fb(s){var c=s;do{var A=c.alternate;if(s=c.return,c.flags&32768){if(A=v9(A,c),A!==null){A.flags&=32767,er=A;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{ir=6,er=null;return}}else if(A=g9(A,c,dn),A!==null){er=A;return}if(c=c.sibling,c!==null){er=c;return}er=c=s}while(c!==null);ir===0&&(ir=5)}function bo(s,c,A){var I=vt,L=Qt.transition;try{Qt.transition=null,vt=1,O9(s,c,A,I)}finally{Qt.transition=L,vt=I}return null}function O9(s,c,A,I){do _o();while(wa!==null);if(ut&6)throw Error(o(327));A=s.finishedWork;var L=s.finishedLanes;if(A===null)return null;if(s.finishedWork=null,s.finishedLanes=0,A===s.current)throw Error(o(177));s.callbackNode=null,s.callbackPriority=0;var V=A.lanes|A.childLanes;if(YE(s,V),s===hr&&(er=hr=null,wr=0),!(A.subtreeFlags&2064)&&!(A.flags&2064)||mf||(mf=!0,gb(Vp,function(){return _o(),null})),V=(A.flags&15990)!==0,A.subtreeFlags&15990||V){V=Qt.transition,Qt.transition=null;var J=vt;vt=1;var ae=ut;ut|=4,Ig.current=null,y9(s,A),J2(A,s),M(s.containerInfo),s.current=A,b9(A),XE(),ut=ae,vt=J,Qt.transition=V}else s.current=A;if(mf&&(mf=!1,wa=s,yf=L),V=s.pendingLanes,V===0&&(_a=null),JE(A.stateNode),Zr(s,fr()),c!==null)for(I=s.onRecoverableError,A=0;A<c.length;A++)L=c[A],I(L.value,{componentStack:L.stack,digest:L.digest});if(vf)throw vf=!1,s=Fg,Fg=null,s;return yf&1&&s.tag!==0&&_o(),V=s.pendingLanes,V&1?s===zg?tu++:(tu=0,zg=s):tu=0,ci(),null}function _o(){if(wa!==null){var s=G1(yf),c=Qt.transition,A=vt;try{if(Qt.transition=null,vt=16>s?16:s,wa===null)var I=!1;else{if(s=wa,wa=null,yf=0,ut&6)throw Error(o(331));var L=ut;for(ut|=4,Fe=s.current;Fe!==null;){var V=Fe,J=V.child;if(Fe.flags&16){var ae=V.deletions;if(ae!==null){for(var he=0;he<ae.length;he++){var Ae=ae[he];for(Fe=Ae;Fe!==null;){var Ge=Fe;switch(Ge.tag){case 0:case 11:case 15:Qs(8,Ge,V)}var et=Ge.child;if(et!==null)et.return=Ge,Fe=et;else for(;Fe!==null;){Ge=Fe;var Me=Ge.sibling,Mt=Ge.return;if(K2(Ge),Ge===Ae){Fe=null;break}if(Me!==null){Me.return=Mt,Fe=Me;break}Fe=Mt}}}var kt=V.alternate;if(kt!==null){var Jr=kt.child;if(Jr!==null){kt.child=null;do{var Bi=Jr.sibling;Jr.sibling=null,Jr=Bi}while(Jr!==null)}}Fe=V}}if(V.subtreeFlags&2064&&J!==null)J.return=V,Fe=J;else e:for(;Fe!==null;){if(V=Fe,V.flags&2048)switch(V.tag){case 0:case 11:case 15:Qs(9,V,V.return)}var de=V.sibling;if(de!==null){de.return=V.return,Fe=de;break e}Fe=V.return}}var oe=s.current;for(Fe=oe;Fe!==null;){J=Fe;var ge=J.child;if(J.subtreeFlags&2064&&ge!==null)ge.return=J,Fe=ge;else e:for(J=oe;Fe!==null;){if(ae=Fe,ae.flags&2048)try{switch(ae.tag){case 0:case 11:case 15:sf(9,ae)}}catch(We){Ft(ae,ae.return,We)}if(ae===J){Fe=null;break e}var Le=ae.sibling;if(Le!==null){Le.return=ae.return,Fe=Le;break e}Fe=ae.return}}if(ut=L,ci(),ui&&typeof ui.onPostCommitFiberRoot=="function")try{ui.onPostCommitFiberRoot(Fc,s)}catch{}I=!0}return I}finally{vt=A,Qt.transition=c}}return!1}function db(s,c,A){c=El(A,c),c=C2(s,c,1),s=ba(s,c,1),c=Nr(),s!==null&&(zs(s,1,c),Zr(s,c))}function Ft(s,c,A){if(s.tag===3)db(s,s,A);else for(;c!==null;){if(c.tag===3){db(c,s,A);break}else if(c.tag===1){var I=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof I.componentDidCatch=="function"&&(_a===null||!_a.has(I))){s=El(A,s),s=R2(c,s,1),c=ba(c,s,1),s=Nr(),c!==null&&(zs(c,1,s),Zr(c,s));break}}c=c.return}}function x9(s,c,A){var I=s.pingCache;I!==null&&I.delete(c),c=Nr(),s.pingedLanes|=s.suspendedLanes&A,hr===s&&(wr&A)===A&&(ir===4||ir===3&&(wr&130023424)===wr&&500>fr()-jg?yo(s,0):Lg|=A),Zr(s,c)}function hb(s,c){c===0&&(s.mode&1?(c=jc,jc<<=1,!(jc&130023424)&&(jc=4194304)):c=1);var A=Nr();s=fi(s,c),s!==null&&(zs(s,c,A),Zr(s,A))}function P9(s){var c=s.memoizedState,A=0;c!==null&&(A=c.retryLane),hb(s,A)}function A9(s,c){var A=0;switch(s.tag){case 13:var I=s.stateNode,L=s.memoizedState;L!==null&&(A=L.retryLane);break;case 19:I=s.stateNode;break;default:throw Error(o(314))}I!==null&&I.delete(c),hb(s,A)}var pb;pb=function(s,c,A){if(s!==null)if(s.memoizedProps!==c.pendingProps||Yr.current)Xr=!0;else{if(!(s.lanes&A)&&!(c.flags&128))return Xr=!1,p9(s,c,A);Xr=!!(s.flags&131072)}else Xr=!1,Dt&&c.flags&1048576&&q1(c,Uc,c.index);switch(c.lanes=0,c.tag){case 2:var I=c.type;nf(s,c),s=c.pendingProps;var L=pl(c,kr.current);bl(c,A),L=fg(null,c,I,s,L,A);var V=dg();return c.flags|=1,typeof L=="object"&&L!==null&&typeof L.render=="function"&&L.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Kr(I)?(V=!0,Ic(c)):V=!1,c.memoizedState=L.state!==null&&L.state!==void 0?L.state:null,rg(c),L.updater=Yc,c.stateNode=L,L._reactInternals=c,ig(c,I,s,A),c=_g(null,c,I,!0,V,A)):(c.tag=0,Dt&&V&&$p(c),Ur(null,c,L,A),c=c.child),c;case 16:I=c.elementType;e:{switch(nf(s,c),s=c.pendingProps,L=I._init,I=L(I._payload),c.type=I,L=c.tag=T9(I),s=qn(I,s),L){case 0:c=bg(null,c,I,s,A);break e;case 1:c=B2(null,c,I,s,A);break e;case 11:c=L2(null,c,I,s,A);break e;case 14:c=j2(null,c,I,qn(I.type,s),A);break e}throw Error(o(306,I,""))}return c;case 0:return I=c.type,L=c.pendingProps,L=c.elementType===I?L:qn(I,L),bg(s,c,I,L,A);case 1:return I=c.type,L=c.pendingProps,L=c.elementType===I?L:qn(I,L),B2(s,c,I,L,A);case 3:e:{if(U2(c),s===null)throw Error(o(387));I=c.pendingProps,V=c.memoizedState,L=V.element,Z1(s,c),Wc(c,I,null,A);var J=c.memoizedState;if(I=J.element,ie&&V.isDehydrated)if(V={element:I,isDehydrated:!1,cache:J.cache,pendingSuspenseBoundaries:J.pendingSuspenseBoundaries,transitions:J.transitions},c.updateQueue.baseState=V,c.memoizedState=V,c.flags&256){L=El(Error(o(423)),c),c=G2(s,c,I,A,L);break e}else if(I!==L){L=El(Error(o(424)),c),c=G2(s,c,I,A,L);break e}else for(ie&&(Pn=pa(c.stateNode.containerInfo),fn=c,Dt=!0,Vn=null,Bs=!1),A=l2(c,null,I,A),c.child=A;A;)A.flags=A.flags&-3|4096,A=A.sibling;else{if(ml(),I===L){c=Fi(s,c,A);break e}Ur(s,c,I,A)}c=c.child}return c;case 5:return s2(c),s===null&&Kp(c),I=c.type,L=c.pendingProps,V=s!==null?s.memoizedProps:null,J=L.children,K(I,L)?J=null:V!==null&&K(I,V)&&(c.flags|=32),z2(s,c),Ur(s,c,J,A),c.child;case 6:return s===null&&Kp(c),null;case 13:return H2(s,c,A);case 4:return ag(c,c.stateNode.containerInfo),I=c.pendingProps,s===null?c.child=_l(c,null,I,A):Ur(s,c,I,A),c.child;case 11:return I=c.type,L=c.pendingProps,L=c.elementType===I?L:qn(I,L),L2(s,c,I,L,A);case 7:return Ur(s,c,c.pendingProps,A),c.child;case 8:return Ur(s,c,c.pendingProps.children,A),c.child;case 12:return Ur(s,c,c.pendingProps.children,A),c.child;case 10:e:{if(I=c.type._context,L=c.pendingProps,V=c.memoizedProps,J=L.value,X1(c,I,J),V!==null)if(Hn(V.value,J)){if(V.children===L.children&&!Yr.current){c=Fi(s,c,A);break e}}else for(V=c.child,V!==null&&(V.return=c);V!==null;){var ae=V.dependencies;if(ae!==null){J=V.child;for(var he=ae.firstContext;he!==null;){if(he.context===I){if(V.tag===1){he=Di(-1,A&-A),he.tag=2;var Ae=V.updateQueue;if(Ae!==null){Ae=Ae.shared;var Ge=Ae.pending;Ge===null?he.next=he:(he.next=Ge.next,Ge.next=he),Ae.pending=he}}V.lanes|=A,he=V.alternate,he!==null&&(he.lanes|=A),eg(V.return,A,c),ae.lanes|=A;break}he=he.next}}else if(V.tag===10)J=V.type===c.type?null:V.child;else if(V.tag===18){if(J=V.return,J===null)throw Error(o(341));J.lanes|=A,ae=J.alternate,ae!==null&&(ae.lanes|=A),eg(J,A,c),J=V.sibling}else J=V.child;if(J!==null)J.return=V;else for(J=V;J!==null;){if(J===c){J=null;break}if(V=J.sibling,V!==null){V.return=J.return,J=V;break}J=J.return}V=J}Ur(s,c,L.children,A),c=c.child}return c;case 9:return L=c.type,I=c.pendingProps.children,bl(c,A),L=An(L),I=I(L),c.flags|=1,Ur(s,c,I,A),c.child;case 14:return I=c.type,L=qn(I,c.pendingProps),L=qn(I.type,L),j2(s,c,I,L,A);case 15:return D2(s,c,c.type,c.pendingProps,A);case 17:return I=c.type,L=c.pendingProps,L=c.elementType===I?L:qn(I,L),nf(s,c),c.tag=1,Kr(I)?(s=!0,Ic(c)):s=!1,bl(c,A),n2(c,I,L),ig(c,I,L,A),_g(null,c,I,!0,s,A);case 19:return q2(s,c,A);case 22:return F2(s,c,A)}throw Error(o(156,c.tag))};function gb(s,c){return Gp(s,c)}function k9(s,c,A,I){this.tag=s,this.key=A,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=I,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rn(s,c,A,I){return new k9(s,c,A,I)}function Vg(s){return s=s.prototype,!(!s||!s.isReactComponent)}function T9(s){if(typeof s=="function")return Vg(s)?1:0;if(s!=null){if(s=s.$$typeof,s===E)return 11;if(s===p)return 14}return 2}function Oa(s,c){var A=s.alternate;return A===null?(A=Rn(s.tag,c,s.key,s.mode),A.elementType=s.elementType,A.type=s.type,A.stateNode=s.stateNode,A.alternate=s,s.alternate=A):(A.pendingProps=c,A.type=s.type,A.flags=0,A.subtreeFlags=0,A.deletions=null),A.flags=s.flags&14680064,A.childLanes=s.childLanes,A.lanes=s.lanes,A.child=s.child,A.memoizedProps=s.memoizedProps,A.memoizedState=s.memoizedState,A.updateQueue=s.updateQueue,c=s.dependencies,A.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},A.sibling=s.sibling,A.index=s.index,A.ref=s.ref,A}function Sf(s,c,A,I,L,V){var J=2;if(I=s,typeof s=="function")Vg(s)&&(J=1);else if(typeof s=="string")J=5;else e:switch(s){case y:return wo(A.children,L,V,c);case b:J=8,L|=8;break;case v:return s=Rn(12,A,c,L|2),s.elementType=v,s.lanes=V,s;case S:return s=Rn(13,A,c,L),s.elementType=S,s.lanes=V,s;case _:return s=Rn(19,A,c,L),s.elementType=_,s.lanes=V,s;case g:return Ef(A,L,V,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case h:J=10;break e;case w:J=9;break e;case E:J=11;break e;case p:J=14;break e;case d:J=16,I=null;break e}throw Error(o(130,s==null?s:typeof s,""))}return c=Rn(J,A,c,L),c.elementType=s,c.type=I,c.lanes=V,c}function wo(s,c,A,I){return s=Rn(7,s,I,c),s.lanes=A,s}function Ef(s,c,A,I){return s=Rn(22,s,I,c),s.elementType=g,s.lanes=A,s.stateNode={isHidden:!1},s}function qg(s,c,A){return s=Rn(6,s,null,c),s.lanes=A,s}function $g(s,c,A){return c=Rn(4,s.children!==null?s.children:[],s.key,c),c.lanes=A,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function C9(s,c,A,I,L){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Q,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bp(0),this.expirationTimes=Bp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bp(0),this.identifierPrefix=I,this.onRecoverableError=L,ie&&(this.mutableSourceEagerHydrationData=null)}function vb(s,c,A,I,L,V,J,ae,he){return s=new C9(s,c,A,ae,he),c===1?(c=1,V===!0&&(c|=8)):c=0,V=Rn(3,null,null,c),s.current=V,V.stateNode=s,V.memoizedState={element:I,isDehydrated:A,cache:null,transitions:null,pendingSuspenseBoundaries:null},rg(V),s}function mb(s){if(!s)return ma;s=s._reactInternals;e:{if(R(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(Kr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(o(171))}if(s.tag===1){var A=s.type;if(Kr(A))return z1(s,A,c)}return c}function yb(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=N(c),s===null?null:s.stateNode}function bb(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var A=s.retryLane;s.retryLane=A!==0&&A<c?A:c}}function Of(s,c){bb(s,c),(s=s.alternate)&&bb(s,c)}function R9(s){return s=N(s),s===null?null:s.stateNode}function N9(){return null}return r.attemptContinuousHydration=function(s){if(s.tag===13){var c=fi(s,134217728);if(c!==null){var A=Nr();Cn(c,s,134217728,A)}Of(s,134217728)}},r.attemptDiscreteHydration=function(s){if(s.tag===13){var c=fi(s,1);if(c!==null){var A=Nr();Cn(c,s,1,A)}Of(s,1)}},r.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var c=Sa(s),A=fi(s,c);if(A!==null){var I=Nr();Cn(A,s,c,I)}Of(s,c)}},r.attemptSynchronousHydration=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var A=Fs(c.pendingLanes);A!==0&&(Up(c,A|1),Zr(c,fr()),!(ut&6)&&(Pl(),ci()))}break;case 13:lb(function(){var I=fi(s,1);if(I!==null){var L=Nr();Cn(I,s,1,L)}}),Of(s,1)}},r.batchedUpdates=function(s,c){var A=ut;ut|=1;try{return s(c)}finally{ut=A,ut===0&&(Pl(),zc&&ci())}},r.createComponentSelector=function(s){return{$$typeof:uf,value:s}},r.createContainer=function(s,c,A,I,L,V,J){return vb(s,c,!1,null,A,I,L,V,J)},r.createHasPseudoClassSelector=function(s){return{$$typeof:cf,value:s}},r.createHydrationContainer=function(s,c,A,I,L,V,J,ae,he){return s=vb(A,I,!0,s,L,V,J,ae,he),s.context=mb(null),A=s.current,I=Nr(),L=Sa(A),V=Di(I,L),V.callback=c??null,ba(A,V,L),s.current.lanes=L,zs(s,L,I),Zr(s,I),s},r.createPortal=function(s,c,A){var I=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:I==null?null:""+I,children:s,containerInfo:c,implementation:A}},r.createRoleSelector=function(s){return{$$typeof:ff,value:s}},r.createTestNameSelector=function(s){return{$$typeof:df,value:s}},r.createTextSelector=function(s){return{$$typeof:hf,value:s}},r.deferredUpdates=function(s){var c=vt,A=Qt.transition;try{return Qt.transition=null,vt=16,s()}finally{vt=c,Qt.transition=A}},r.discreteUpdates=function(s,c,A,I,L){var V=vt,J=Qt.transition;try{return Qt.transition=null,vt=1,s(c,A,I,L)}finally{vt=V,Qt.transition=J,ut===0&&Pl()}},r.findAllNodes=Mg,r.findBoundingRects=function(s,c){if(!be)throw Error(o(363));c=Mg(s,c),s=[];for(var A=0;A<c.length;A++)s.push(te(c[A]));for(c=s.length-1;0<c;c--){A=s[c];for(var I=A.x,L=I+A.width,V=A.y,J=V+A.height,ae=c-1;0<=ae;ae--)if(c!==ae){var he=s[ae],Ae=he.x,Ge=Ae+he.width,et=he.y,Me=et+he.height;if(I>=Ae&&V>=et&&L<=Ge&&J<=Me){s.splice(c,1);break}else if(I!==Ae||A.width!==he.width||Me<V||et>J){if(!(V!==et||A.height!==he.height||Ge<I||Ae>L)){Ae>I&&(he.width+=Ae-I,he.x=I),Ge<L&&(he.width=L-Ae),s.splice(c,1);break}}else{et>V&&(he.height+=et-V,he.y=V),Me<J&&(he.height=J-et),s.splice(c,1);break}}}return s},r.findHostInstance=yb,r.findHostInstanceWithNoPortals=function(s){return s=C(s),s=s!==null?H(s):null,s===null?null:s.stateNode},r.findHostInstanceWithWarning=function(s){return yb(s)},r.flushControlled=function(s){var c=ut;ut|=1;var A=Qt.transition,I=vt;try{Qt.transition=null,vt=1,s()}finally{vt=I,Qt.transition=A,ut=c,ut===0&&(Pl(),ci())}},r.flushPassiveEffects=_o,r.flushSync=lb,r.focusWithin=function(s,c){if(!be)throw Error(o(363));for(s=Cg(s),c=ib(s,c),c=Array.from(c),s=0;s<c.length;){var A=c[s++];if(!ue(A)){if(A.tag===5&&Ne(A.stateNode))return!0;for(A=A.child;A!==null;)c.push(A),A=A.sibling}}return!1},r.getCurrentUpdatePriority=function(){return vt},r.getFindAllNodesFailureDescription=function(s,c){if(!be)throw Error(o(363));var A=0,I=[];s=[Cg(s),0];for(var L=0;L<s.length;){var V=s[L++],J=s[L++],ae=c[J];if((V.tag!==5||!ue(V))&&(Rg(V,ae)&&(I.push(Ng(ae)),J++,J>A&&(A=J)),J<c.length))for(V=V.child;V!==null;)s.push(V,J),V=V.sibling}if(A<c.length){for(s=[];A<c.length;A++)s.push(Ng(c[A]));return`findAllNodes was able to match part of the selector:
57
+ `+(I.join(" > ")+`
58
+
59
+ No matching component was found for:
60
+ `)+s.join(" > ")}return null},r.getPublicRootInstance=function(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return Y(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:R9,findFiberByHostInstance:s.findFiberByHostInstance||N9,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{Fc=c.inject(s),ui=c}catch{}s=!!c.checkDCE}}return s},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(s,c,A,I){if(!be)throw Error(o(363));s=Mg(s,c);var L=Xe(s,A,I).disconnect;return{disconnect:function(){L()}}},r.registerMutableSourceForHydration=function(s,c){var A=c._getVersion;A=A(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,A]:s.mutableSourceEagerHydrationData.push(c,A)},r.runWithPriority=function(s,c){var A=vt;try{return vt=s,c()}finally{vt=A}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(s,c,A,I){var L=c.current,V=Nr(),J=Sa(L);return A=mb(A),c.context===null?c.context=A:c.pendingContext=A,c=Di(V,J),c.payload={element:s},I=I===void 0?null:I,I!==null&&(c.callback=I),s=ba(L,c,J),s!==null&&(Cn(s,L,J,V),$c(s,L,J)),J},r};Y6.exports=SR;var ER=Y6.exports;const OR=oh(ER);var K6={exports:{}},ll={};/**
61
+ * @license React
62
+ * react-reconciler-constants.production.min.js
63
+ *
64
+ * Copyright (c) Facebook, Inc. and its affiliates.
65
+ *
66
+ * This source code is licensed under the MIT license found in the
67
+ * LICENSE file in the root directory of this source tree.
68
+ */ll.ConcurrentRoot=1;ll.ContinuousEventPriority=4;ll.DefaultEventPriority=16;ll.DiscreteEventPriority=1;ll.IdleEventPriority=536870912;ll.LegacyRoot=0;K6.exports=ll;var X6=K6.exports;const Aw={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let kw=!1,Tw=!1;const f1=".react-konva-event";let Q6=!1;function xR(t){Q6=t}const PR=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
69
+ Position of a node will be changed during drag&drop, so you should update state of the react app as well.
70
+ Consider to add onDragMove or onDragEnd events.
71
+ For more info see: https://github.com/konvajs/react-konva/issues/256
72
+ `,AR=`ReactKonva: You are using "zIndex" attribute for a Konva node.
73
+ react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
74
+ For more info see: https://github.com/konvajs/react-konva/issues/194
75
+ `,kR={};function Pp(t,e,r=kR){if(!kw&&"zIndex"in e&&(console.warn(AR),kw=!0),!Tw&&e.draggable){var n=e.x!==void 0||e.y!==void 0,i=e.onDragEnd||e.onDragMove;n&&!i&&(console.warn(PR),Tw=!0)}for(var a in r)if(!Aw[a]){var o=a.slice(0,2)==="on",l=r[a]!==e[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)),t.off(u,r[a])}var f=!e.hasOwnProperty(a);f&&t.setAttr(a,void 0)}var y=Q6||e._useStrictMode,b={},v=!1;const h={};for(var a in e)if(!Aw[a]){var o=a.slice(0,2)==="on",w=r[a]!==e[a];if(o&&w){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e[a]&&(h[u]=e[a])}!o&&(e[a]!==r[a]||y&&e[a]!==t.getAttr(a))&&(v=!0,b[a]=e[a])}v&&(t.setAttrs(b),oo(t));for(var u in h)t.on(u+f1,h[u])}function oo(t){if(!lt.Konva.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}const Z6={},TR={};rc.Node.prototype._applyProps=Pp;function CR(t,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}t.add(e),oo(t)}function RR(t,e,r){let n=rc[t];n||(console.error(`Konva has no node with the type ${t}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${t}" 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=rc.Group);const i={},a={};for(var o in e){var l=o.slice(0,2)==="on";l?a[o]=e[o]:i[o]=e[o]}const u=new n(i);return Pp(u,a),u}function NR(t,e,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function MR(t,e,r){return!1}function IR(t){return t}function LR(){return null}function jR(){return null}function DR(t,e,r,n){return TR}function FR(){}function zR(t){}function BR(t,e){return!1}function UR(){return Z6}function GR(){return Z6}const HR=setTimeout,VR=clearTimeout,qR=-1;function $R(t,e){return!1}const WR=!1,YR=!0,KR=!0;function XR(t,e){e.parent===t?e.moveToTop():t.add(e),oo(t)}function QR(t,e){e.parent===t?e.moveToTop():t.add(e),oo(t)}function J6(t,e,r){e._remove(),t.add(e),e.setZIndex(r.getZIndex()),oo(t)}function ZR(t,e,r){J6(t,e,r)}function JR(t,e){e.destroy(),e.off(f1),oo(t)}function eN(t,e){e.destroy(),e.off(f1),oo(t)}function tN(t,e,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function rN(t,e,r){}function nN(t,e,r,n,i){Pp(t,i,n)}function iN(t){t.hide(),oo(t)}function aN(t){}function oN(t,e){(e.visible==null||e.visible)&&t.show()}function lN(t,e){}function sN(t){}function uN(){}const cN=()=>X6.DefaultEventPriority,fN=Object.freeze(Object.defineProperty({__proto__:null,appendChild:XR,appendChildToContainer:QR,appendInitialChild:CR,cancelTimeout:VR,clearContainer:sN,commitMount:rN,commitTextUpdate:tN,commitUpdate:nN,createInstance:RR,createTextInstance:NR,detachDeletedInstance:uN,finalizeInitialChildren:MR,getChildHostContext:GR,getCurrentEventPriority:cN,getPublicInstance:IR,getRootHostContext:UR,hideInstance:iN,hideTextInstance:aN,idlePriority:yu.unstable_IdlePriority,insertBefore:J6,insertInContainerBefore:ZR,isPrimaryRenderer:WR,noTimeout:qR,now:yu.unstable_now,prepareForCommit:LR,preparePortalMount:jR,prepareUpdate:DR,removeChild:JR,removeChildFromContainer:eN,resetAfterCommit:FR,resetTextContent:zR,run:yu.unstable_runWithPriority,scheduleTimeout:HR,shouldDeprioritizeSubtree:BR,shouldSetTextContent:$R,supportsMutation:KR,unhideInstance:oN,unhideTextInstance:lN,warnsIfNotActing:YR},Symbol.toStringTag,{value:"Module"}));var dN=Object.defineProperty,hN=Object.defineProperties,pN=Object.getOwnPropertyDescriptors,Cw=Object.getOwnPropertySymbols,gN=Object.prototype.hasOwnProperty,vN=Object.prototype.propertyIsEnumerable,Rw=(t,e,r)=>e in t?dN(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Nw=(t,e)=>{for(var r in e||(e={}))gN.call(e,r)&&Rw(t,r,e[r]);if(Cw)for(var r of Cw(e))vN.call(e,r)&&Rw(t,r,e[r]);return t},mN=(t,e)=>hN(t,pN(e));function e8(t,e,r){if(!t)return;if(r(t)===!0)return t;let n=e?t.return:t.child;for(;n;){const i=e8(n,e,r);if(i)return i;n=e?null:n.sibling}}function t8(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const d1=t8(at.createContext(null));class r8 extends at.Component{render(){return at.createElement(d1.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:Mw,ReactCurrentDispatcher:Iw}=at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function yN(){const t=at.useContext(d1);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=at.useId();return at.useMemo(()=>{for(const n of[Mw==null?void 0:Mw.current,t,t==null?void 0:t.alternate]){if(!n)continue;const i=e8(n,!1,a=>{let o=a.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(i)return i}},[t,e])}function bN(){var t,e;const r=yN(),[n]=at.useState(()=>new Map);n.clear();let i=r;for(;i;){const a=(t=i.type)==null?void 0:t._context;a&&a!==d1&&!n.has(a)&&n.set(a,(e=Iw==null?void 0:Iw.current)==null?void 0:e.readContext(t8(a))),i=i.return}return n}function _N(){const t=bN();return at.useMemo(()=>Array.from(t.keys()).reduce((e,r)=>n=>at.createElement(e,null,at.createElement(r.Provider,mN(Nw({},n),{value:t.get(r)}))),e=>at.createElement(r8,Nw({},e))),[t])}function wN(t){const e=dt.useRef({});return dt.useLayoutEffect(()=>{e.current=t}),dt.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const SN=t=>{const e=dt.useRef(),r=dt.useRef(),n=dt.useRef(),i=wN(t),a=_N(),o=l=>{const{forwardedRef:u}=t;u&&(typeof u=="function"?u(l):u.current=l)};return dt.useLayoutEffect(()=>(r.current=new rc.Stage({width:t.width,height:t.height,container:e.current}),o(r.current),n.current=Wl.createContainer(r.current,X6.LegacyRoot,!1,null),Wl.updateContainer(dt.createElement(a,{},t.children),n.current),()=>{rc.isBrowser&&(o(null),Wl.updateContainer(null,n.current,null),r.current.destroy())}),[]),dt.useLayoutEffect(()=>{o(r.current),Pp(r.current,t,i),Wl.updateContainer(dt.createElement(a,{},t.children),n.current,null)}),dt.createElement("div",{ref:e,id:t.id,accessKey:t.accessKey,className:t.className,role:t.role,style:t.style,tabIndex:t.tabIndex,title:t.title})},EN="Layer",ON="FastLayer",th="Group",xN="Label",PN="Rect",AN="Circle",kN="Ellipse",TN="Wedge",CN="Line",RN="Sprite",NN="Image",MN="Text",IN="TextPath",LN="Star",jN="Ring",DN="Arc",FN="Tag",zN="Path",BN="RegularPolygon",UN="Arrow",GN="Shape",HN="Transformer",Wl=OR(fN);Wl.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:dt.version,rendererPackageName:"react-konva"});const VN=dt.forwardRef((t,e)=>dt.createElement(r8,{},dt.createElement(SN,{...t,forwardedRef:e}))),qN=xR,$N=Object.freeze(Object.defineProperty({__proto__:null,Arc:DN,Arrow:UN,Circle:AN,Ellipse:kN,FastLayer:ON,Group:th,Image:NN,KonvaRenderer:Wl,Label:xN,Layer:EN,Line:CN,Path:zN,Rect:PN,RegularPolygon:BN,Ring:jN,Shape:GN,Sprite:RN,Stage:VN,Star:LN,Tag:FN,Text:MN,TextPath:IN,Transformer:HN,Wedge:TN,useStrictMode:qN},Symbol.toStringTag,{value:"Module"})),lo=Ya($N);var Oo=at,Ap=function(e,r,n){const i=Oo.useRef("loading"),a=Oo.useRef(),[o,l]=Oo.useState(0),u=Oo.useRef(),f=Oo.useRef(),y=Oo.useRef();return(u.current!==e||f.current!==r||y.current!==n)&&(i.current="loading",a.current=void 0,u.current=e,f.current=r,y.current=n),Oo.useLayoutEffect(function(){if(!e)return;var b=document.createElement("img");function v(){i.current="loaded",a.current=b,l(Math.random())}function h(){i.current="failed",a.current=void 0,l(Math.random())}return b.addEventListener("load",v),b.addEventListener("error",h),r&&(b.crossOrigin=r),n&&(b.referrerPolicy=n),b.src=e,function(){b.removeEventListener("load",v),b.removeEventListener("error",h)}},[e,r,n]),[a.current,i.current]};const WN=oh(Ap);var n8={},h1={},YN=globalThis&&globalThis.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};const KN=t=>{const e=window.getComputedStyle(t).position;return!(e==="absolute"||e==="relative")};function i8(t=()=>{}){const e=dt.useRef(t);return e.current=t,dt.useCallback((...r)=>e.current.apply(null,r),[])}const XN=({children:t,groupProps:e,divProps:r,transform:n,transformFunc:i})=>{const a=dt.useRef(null);dt.useRef();const[o]=dt.useState(()=>document.createElement("div")),l=dt.useMemo(()=>vd.createRoot(o),[o]),u=n??!0,f=i8(()=>{if(u&&a.current){let w=a.current.getAbsoluteTransform().decompose();i&&(w=i(w)),o.style.position="absolute",o.style.zIndex="10",o.style.top="0px",o.style.left="0px",o.style.transform=`translate(${w.x}px, ${w.y}px) rotate(${w.rotation}deg) scaleX(${w.scaleX}) scaleY(${w.scaleY})`,o.style.transformOrigin="top left"}else o.style.position="",o.style.zIndex="",o.style.top="",o.style.left="",o.style.transform="",o.style.transformOrigin="";const y=r||{},{style:b}=y,v=YN(y,["style"]);Object.assign(o.style,b),Object.assign(o,v)});return dt.useLayoutEffect(()=>{var y;const b=a.current;if(!b)return;const v=(y=b.getStage())===null||y===void 0?void 0:y.container();if(v)return v.appendChild(o),u&&KN(v)&&(v.style.position="relative"),b.on("absoluteTransformChange",f),f(),()=>{var h;b.off("absoluteTransformChange",f),(h=o.parentNode)===null||h===void 0||h.removeChild(o)}},[u]),dt.useLayoutEffect(()=>{f()},[r,i]),dt.useLayoutEffect(()=>{l.render(t)}),dt.useLayoutEffect(()=>()=>{setTimeout(()=>{l.unmount()})},[]),dt.createElement(th,Object.assign({ref:a},e))},QN=({selector:t,enabled:e,children:r})=>{const n=dt.useRef(null),i=dt.useRef(null),a=dt.useRef(),o=e??!0;return dt.useLayoutEffect(()=>{if(!n.current||!i.current)return;a.current=i.current;const u=n.current.getStage().findOne(t);o&&u?i.current.moveTo(u):i.current.moveTo(n.current);const f=n.current.getLayer();if(f&&(f.batchDraw(),u)){const y=u.getLayer();if(!y)return;y.batchDraw()}},[t,o]),dt.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.destroy()},[]),dt.createElement(th,{name:"_outer_portal",ref:n},dt.createElement(th,{name:"_inner_portal",ref:i},r))},ZN=Object.freeze(Object.defineProperty({__proto__:null,Html:XN,Portal:QN,useEvent:i8,useImage:WN},Symbol.toStringTag,{value:"Module"})),Ac=Ya(ZN);function JN(t,e){return Object.keys(t.values).forEach(r=>t.values[r]=t.values[r]&&parseFloat(t.values[r].toFixed(e))),t}function a8(t,e,r){const n=e-1,i=r[l8(n,r.length)];return i.marker!=="Z"?i:a8(t,n,r)}function o8(t,e,r){const n=e+1,i=r[l8(n,r.length)];return i.marker==="Z"?o8(t,n,r):i}function eM(t,e,r){let n=r[e-1]||{values:{x:0,y:0}};if(t.marker===t.marker.toLowerCase())switch(t.marker=t.marker.toUpperCase(),t.marker){case"M":t.values.x+=n.values.x,t.values.y+=n.values.y;break;case"L":case"A":t.values.x+=n.values.x,t.values.y+=n.values.y;break;case"H":t.marker="L",t.values.x+=n.values.x,t.values.y=n.values.y;break;case"V":t.marker="L",t.values.x=n.values.x,t.values.y+=n.values.y;break;case"C":t.values.x+=n.values.x,t.values.y+=n.values.y,t.values.x1+=n.values.x,t.values.y1+=n.values.y,t.values.x2+=n.values.x,t.values.y2+=n.values.y;break;case"S":t.values.x+=n.values.x,t.values.y+=n.values.y,t.values.x2+=n.values.x,t.values.y2+=n.values.y;break;case"Q":t.values.x+=n.values.x,t.values.y+=n.values.y,t.values.x1+=n.values.x,t.values.y1+=n.values.y;break;case"T":t.values.x+=n.values.x,t.values.y+=n.values.y;break}else if(t.marker===t.marker.toUpperCase())switch(t.marker){case"H":t.marker="L",t.values.y=n.values.y;break;case"V":t.marker="L",t.values.x=n.values.x;break}if(t.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,e);t.values.x=o.values.x,t.values.y=o.values.y}return t}function tM(t,e){const r=[];switch(t.toUpperCase()){case"M":for(let n=0;n<e.length;n+=2){let i;t===t.toUpperCase()?i=n===0?"M":"L":i=n===0?"m":"l",r.push({marker:i,values:{x:e[n],y:e[n+1]}})}break;case"L":for(let n=0;n<e.length;n+=2)r.push({marker:t,values:{x:e[n],y:e[n+1]}});break;case"H":for(let n=0;n<e.length;n++)r.push({marker:t,values:{x:e[n],y:0}});break;case"V":for(let n=0;n<e.length;n++)r.push({marker:t,values:{x:0,y:e[n]}});break;case"C":for(let n=0;n<e.length;n+=6)r.push({marker:t,values:{x1:e[n],y1:e[n+1],x2:e[n+2],y2:e[n+3],x:e[n+4],y:e[n+5]}});break;case"S":for(let n=0;n<e.length;n+=4)r.push({marker:t,values:{x2:e[n],y2:e[n+1],x:e[n+2],y:e[n+3]}});break;case"Q":for(let n=0;n<e.length;n+=4)r.push({marker:t,values:{x1:e[n],y1:e[n+1],x:e[n+2],y:e[n+3]}});break;case"T":for(let n=0;n<e.length;n+=2)r.push({marker:t,values:{x:e[n],y:e[n+1]}});break;case"A":for(let n=0;n<e.length;n+=7)r.push({marker:t,values:{radiusX:e[n],radiusY:e[n+1],rotation:e[n+2],largeArc:e[n+3],sweep:e[n+4],x:e[n+5],y:e[n+6]}});break;case"Z":r.push({marker:t,values:{x:0,y:0}});break}return r}function l8(t,e){return(t%e+e)%e}function rM(t,e,r){if(e!==0&&t.marker==="L"){let n=r[e-1];["x","y"].every(a=>Math.round(Math.abs(n.values[a]-t.values[a]))===0)&&(t.overlap=!0)}return t}function Rm(t,e){const r=["x","y"].every(n=>Math.round(Math.abs(t[e].values[n]-t[0].values[n]))===0);t[e].marker==="L"&&r&&(t[e].overlap=!0,Rm(t,e-1)),t[e].marker==="Z"&&Rm(t,e-1)}function nM(t,e,r){const n=jw(t.values,r.values),i=jw(e.values,t.values);return Math.min(i,n)}function Lw(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}function jw(t,e){const r=t.x-e.x,n=t.y-e.y;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2))}function Dw(t,e){return Math.sin(t)*e}function Fw(t,e){return Math.cos(t)*e}function zw(t,e){const r=e/Math.tan(t);return r===1/0||r===-1/0||isNaN(r)?e:r}function iM(t,e){return e*Math.tan(t)}function aM(t,e){let r,n=0,i=t*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=zw(t/2,-e):(r=zw(t/2,e),n=1,r===1/0&&(r=e)),{offset:r,sweepFlag:n}}function oM(t){const e=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return t.map(r=>{let n="";if(r.marker!=="Z"){const i=Object.keys(r.values);n=e.filter(a=>i.indexOf(a)!==-1).map(a=>r.values[a]).join()}return`${r.marker}${n}`}).join("").trim()}function s8(t){const e=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,r=/-?[0-9]*\.?\d+/g;return[...t.matchAll(e)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,i)=>{const a=t.substring(i.index,n.length?n[n.length-1].index:t.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 tM(n.marker,a)}).map(eM)}function u8(t,e,r){let n=[],i=[];return r&&t.forEach(a=>JN(a,r)),t.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(rM),Rm(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(l=>!l.overlap).map((l,u,f)=>{const b=a8(l,u,f),v=o8(l,u,f),h=Lw(l.values,b.values),w=Lw(l.values,v.values),E=w-h,S=E*(180/Math.PI),_=nM(l,b,v),p=Math.abs(iM(E/2,_/2)),d=Math.min(e,p),g=aM(E,d),m=g.offset,x=g.sweepFlag,P=(u==0||u==f.length-1)&&!o;switch(l.marker){case"M":case"L":const O=[l.values.x+Dw(h,m),l.values.y+Fw(h,m)],R=[l.values.x+Dw(w,m),l.values.y+Fw(w,m)];P?i.push({marker:l.marker,values:l.values}):i.push({marker:l.marker,values:{x:parseFloat(O[0].toFixed(3)),y:parseFloat(O[1].toFixed(3))}}),!P&&(v.marker==="L"||v.marker==="M")&&i.push({marker:"A",radius:d,values:{radiusX:d,radiusY:d,rotation:S,largeArc:0,sweep:x,x:parseFloat(R[0].toFixed(3)),y:parseFloat(R[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:oM(i),commands:i}}function lM(t,e,r){return u8([...s8(t)],e,r)}const sM=Object.freeze(Object.defineProperty({__proto__:null,parsePath:s8,roundCommands:u8,roundCorners:lM},Symbol.toStringTag,{value:"Module"})),uM=Ya(sM);var na={},sl={};(function(t){var e=ye&&ye.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFadeIn=t.isAnimationUsed=t.toggleFadeInAnimation=void 0;const r=e(at),n=e(si);let i=!1;const a=(u=!i)=>{i=u};t.toggleFadeInAnimation=a;const o=()=>i;function l(u,f){const y=r.default.useRef();r.default.useLayoutEffect(()=>{y.current&&y.current.destroy()},[f]),r.default.useLayoutEffect(()=>{if(!i)return;const b=u.current.opacity();return b?(u.current.opacity(0),y.current=new n.default.Tween({node:u.current,opacity:b,onFinish:()=>{var v;(v=y.current)===null||v===void 0||v.destroy()}}),y.current.play(),()=>{var v;(v=y.current)===null||v===void 0||v.destroy()}):void 0},[])}t.isAnimationUsed=o,t.useFadeIn=l})(sl);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.triggerLoadError=t.onLoadError=t.whenLoaded=t.decrementLoader=t.incrementLoader=t.setAssetLoadTimeout=void 0;const e=sl;let r=0,n=[],i=3e4;const a=h=>{i=h};function o(h){r+=1;let w=!1;const E=setTimeout(()=>{w||(v(`Timeout loading image ${h}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",h),w=!0,l())},i);return()=>{w||(clearTimeout(E),l())}}function l(){r-=1,r===0&&(n.forEach(h=>h()),n=[])}function u(h){r===0?h():n.push(h)}function f(){return new Promise(h=>u(()=>{(0,e.isAnimationUsed)()?setTimeout(h,300):h(!0)}))}t.setAssetLoadTimeout=a,t.incrementLoader=o,t.decrementLoader=l,t.whenLoaded=f;let y=[];function b(h){y.push(h)}function v(h){y.forEach(w=>w(h))}t.onLoadError=b,t.triggerLoadError=v})(na);var kc={};(function(t){var e=ye&&ye.__createBinding||(Object.create?function(N,F,H,z){z===void 0&&(z=H);var Y=Object.getOwnPropertyDescriptor(F,H);Y&&!("get"in Y?!F.__esModule:Y.writable||Y.configurable)||(Y={enumerable:!0,get:function(){return F[H]}}),Object.defineProperty(N,z,Y)}:function(N,F,H,z){z===void 0&&(z=H),N[z]=F[H]}),r=ye&&ye.__setModuleDefault||(Object.create?function(N,F){Object.defineProperty(N,"default",{enumerable:!0,value:F})}:function(N,F){N.default=F}),n=ye&&ye.__importStar||function(N){if(N&&N.__esModule)return N;var F={};if(N!=null)for(var H in N)H!=="default"&&Object.prototype.hasOwnProperty.call(N,H)&&e(F,N,H);return r(F,N),F};Object.defineProperty(t,"__esModule",{value:!0}),t.injectCustomFont=t.injectGoogleFont=t.setGoogleFontsVariants=t.loadFont=t.isFontLoaded=t.replaceGlobalFonts=t.removeGlobalFont=t.addGlobalFont=t.globalFonts=t.getFontsList=t.setGoogleFonts=t.isGoogleFontChanged=void 0;const i=n(la),a=na;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(N){N!=="default"?(l.value=!0,o.splice(0,o.length),o.push(...N)):l.value=!1}function y(){return o}function b(N){t.globalFonts.push(N)}function v(N){const F=t.globalFonts.findIndex(H=>H.fontFamily===N);F!==-1&&t.globalFonts.splice(F,1)}function h(N){t.globalFonts.replace(N)}t.isGoogleFontChanged=u,t.setGoogleFonts=f,t.getFontsList=y,t.globalFonts=i.observable([]),t.addGlobalFont=b,t.removeGlobalFont=v,t.replaceGlobalFonts=h;var w="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",E=document.createElement("canvas");function S(){return p("Arial")}function _(){return p("Times","Times")}function p(N,F="Arial"){var H=E.getContext("2d");return H.font=`normal 40px '${N}', ${F}`,H.measureText(w).width}const d={Arial:!0},g=N=>d[N];async function m(N){var F;if(d[N])return;const H=!!(!((F=document.fonts)===null||F===void 0)&&F.load),z=S();if(H)try{await document.fonts.load(`16px '${N}'`);const W=p(N);if(z!==W)return void(d[N]=!0)}catch{}const Y=_(),G=p(N);for(let W=0;W<100;W++){const j=p(N,"Arial"),M=p(N,"Times");if(j!==G||j!==z||M!==Y)return void(d[N]=!0);await new Promise(k=>setTimeout(k,60))}console.warn(`Timeout for loading font "${N}". Looks like polotno can't load it. Is it a correct font family?`),(0,a.triggerLoadError)(`Timeout for loading font "${N}"`)}t.isFontLoaded=g,t.loadFont=m;const x={};let P="400,400italic,700,700italic";function O(N){P=N}function R(N){if(x[N])return;const F=`https://fonts.googleapis.com/css?family=${N.replace(/ /g,"+")}:${P}`,H=document.createElement("link");H.type="text/css",H.href=F,H.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(H),x[N]=!0}t.setGoogleFontsVariants=O,t.injectGoogleFont=R;const T={};function C(N){const F=N.fontFamily;if(T[F]||!N.url&&!N.styles)return;const H=document.createElement("style");H.type="text/css";const z=N.styles||(N.url?[{src:`url("${N.url}")`}]:[]);let Y="";z.forEach(G=>{Y+=`
76
+ @font-face {
77
+ font-family: '${F}';
78
+ src: ${G.src};
79
+ font-style: ${G.fontStyle||"normal"};
80
+ font-weight: ${G.fontWeight||"normal"};
81
+ }
82
+ `}),H.innerHTML=Y,document.getElementsByTagName("head")[0].appendChild(H),T[N.fontFamily]=!0}t.injectCustomFont=C})(kc);var zn={};(function(t){var e=ye&&ye.__createBinding||(Object.create?function(h,w,E,S){S===void 0&&(S=E);var _=Object.getOwnPropertyDescriptor(w,E);_&&!("get"in _?!w.__esModule:_.writable||_.configurable)||(_={enumerable:!0,get:function(){return w[E]}}),Object.defineProperty(h,S,_)}:function(h,w,E,S){S===void 0&&(S=E),h[S]=w[E]}),r=ye&&ye.__setModuleDefault||(Object.create?function(h,w){Object.defineProperty(h,"default",{enumerable:!0,value:w})}:function(h,w){h.default=w}),n=ye&&ye.__importStar||function(h){if(h&&h.__esModule)return h;var w={};if(h!=null)for(var E in h)E!=="default"&&Object.prototype.hasOwnProperty.call(h,E)&&e(w,h,E);return r(w,h),w};Object.defineProperty(t,"__esModule",{value:!0}),t.setAnimationsEnabled=t.setTextOverflow=t.setForceTextFit=t.useDownScaling=t.setDownScalingEnabled=t.useHtmlTextRender=t.useRemoveBackground=t.setTextVerticalResizeEnabled=t.flags=void 0;const i=n(la);function a(h){t.flags.textVerticalResizeEnabled=h}function o(h){t.flags.removeBackgroundEnabled=h}function l(h){t.flags.htmlRenderEnabled=h}function u(h){t.flags.imageDownScalingEnabled=h}function f(h){console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),u(h)}function y(h){console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),t.flags.textOverflow="change-font-size"}function b(h){t.flags.textOverflow=h}function v(h){t.flags.animationsEnabled=h}t.flags=i.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",animationsEnabled:!1}),t.setTextVerticalResizeEnabled=a,t.useRemoveBackground=o,t.useHtmlTextRender=l,t.setDownScalingEnabled=u,t.useDownScaling=f,t.setForceTextFit=y,t.setTextOverflow=b,t.setAnimationsEnabled=v})(zn);var p1={};(function(t){function e(r=""){return(r=r.replace(/<\/p>/gi,`
83
+ `)).replace(/(<([^>]+)>)/gi,"")}Object.defineProperty(t,"__esModule",{value:!0}),t.removeTags=void 0,t.removeTags=e})(p1);var g1={},v1={},ul=ul||{};ul.stringify=function(){var t={"visit_linear-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return t.visit_gradient(e)},"visit_radial-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return t.visit_gradient(e)},visit_gradient:function(e){var r=t.visit(e.orientation);return r&&(r+=", "),e.type+"("+r+t.visit(e.colorStops)+")"},visit_shape:function(e){var r=e.value,n=t.visit(e.at),i=t.visit(e.style);return i&&(r+=" "+i),n&&(r+=" at "+n),r},"visit_default-radial":function(e){var r="",n=t.visit(e.at);return n&&(r+=n),r},"visit_extent-keyword":function(e){var r=e.value,n=t.visit(e.at);return n&&(r+=" at "+n),r},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return t.visit(e.value.x)+" "+t.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_literal:function(e){return t.visit_color(e.value,e)},visit_hex:function(e){return t.visit_color("#"+e.value,e)},visit_rgb:function(e){return t.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return t.visit_color("rgba("+e.value.join(", ")+")",e)},visit_color:function(e,r){var n=e,i=t.visit(r.length);return i&&(n+=" "+i),n},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var r="",n=e.length;return e.forEach(function(i,a){r+=t.visit(i),a<n-1&&(r+=", ")}),r},visit:function(e){if(!e)return"";var r="";if(e instanceof Array)return t.visit_array(e,r);if(e.type){var n=t["visit_"+e.type];if(n)return n(e);throw Error("Missing visitor visit_"+e.type)}else throw Error("Invalid node.")}};return function(e){return t.visit(e)}}();var ul=ul||{};ul.parse=function(){var t={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]+\.?))/},e="";function r(G){var W=new Error(e+": "+G);throw W.source=e,W}function n(){var G=i();return e.length>0&&r("Invalid input not EOF"),G}function i(){return d(a)}function a(){return o("linear-gradient",t.linearGradient,u)||o("repeating-linear-gradient",t.repeatingLinearGradient,u)||o("radial-gradient",t.radialGradient,b)||o("repeating-radial-gradient",t.repeatingRadialGradient,b)}function o(G,W,j){return l(W,function(M){var k=j();return k&&(z(t.comma)||r("Missing comma before color stops")),{type:G,orientation:k,colorStops:d(g)}})}function l(G,W){var j=z(G);if(j){z(t.startCall)||r("Missing (");var M=W(j);return z(t.endCall)||r("Missing )"),M}}function u(){return f()||y()}function f(){return H("directional",t.sideOrCorner,1)}function y(){return H("angular",t.angleValue,1)}function b(){var G,W=v(),j;return W&&(G=[],G.push(W),j=e,z(t.comma)&&(W=v(),W?G.push(W):e=j)),G}function v(){var G=h()||w();if(G)G.at=S();else{var W=E();if(W){G=W;var j=S();j&&(G.at=j)}else{var M=_();M&&(G={type:"default-radial",at:M})}}return G}function h(){var G=H("shape",/^(circle)/i,0);return G&&(G.style=F()||E()),G}function w(){var G=H("shape",/^(ellipse)/i,0);return G&&(G.style=C()||E()),G}function E(){return H("extent-keyword",t.extentKeywords,1)}function S(){if(H("position",/^at/,0)){var G=_();return G||r("Missing positioning value"),G}}function _(){var G=p();if(G.x||G.y)return{type:"position",value:G}}function p(){return{x:C(),y:C()}}function d(G){var W=G(),j=[];if(W)for(j.push(W);z(t.comma);)W=G(),W?j.push(W):r("One extra comma");return j}function g(){var G=m();return G||r("Expected color definition"),G.length=C(),G}function m(){return P()||R()||O()||x()}function x(){return H("literal",t.literalColor,0)}function P(){return H("hex",t.hexColor,1)}function O(){return l(t.rgbColor,function(){return{type:"rgb",value:d(T)}})}function R(){return l(t.rgbaColor,function(){return{type:"rgba",value:d(T)}})}function T(){return z(t.number)[1]}function C(){return H("%",t.percentageValue,1)||N()||F()}function N(){return H("position-keyword",t.positionKeywords,1)}function F(){return H("px",t.pixelValue,1)||H("em",t.emValue,1)}function H(G,W,j){var M=z(W);if(M)return{type:G,value:M[j]}}function z(G){var W,j;return j=/^[\n\r\t\s]+/.exec(e),j&&Y(j[0].length),W=G.exec(e),W&&Y(W[0].length),W}function Y(G){e=e.substr(G)}return function(G){return e=G.toString(),n()}}();v1.parse=ul.parse;v1.stringify=ul.stringify;(function(t){var e=ye&&ye.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseColor=t.isGradient=void 0;const r=e(v1),n=o=>o.indexOf("linear-gradient")>=0;t.isGradient=n;const i=o=>o.type==="hex"?"#"+o.value:o.type==="literal"?o.value:`${o.type}(${o.value.join(",")})`,a=o=>{if(!(0,t.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)}))}};t.parseColor=a})(g1);var Tc={};(function(t){var e=ye&&ye.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.applyFilter=void 0;const r=e(si);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()}t.applyFilter=n})(Tc);var Ms={};(function(t){var e=ye&&ye.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(t,"__esModule",{value:!0}),t.Highlighter=t.setHighlighterStyle=void 0;const r=e(at),n=Ti,i=lo,a={stroke:"rgb(0, 161, 255)",strokeWidth:2},o=l=>{Object.assign(a,l)};t.setHighlighterStyle=o,t.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)))})(Ms);var cl={};(function(t){var e=ye&&ye.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0}),t.useMobile=t.mobileStyle=t.isMobile=t.MOBILE_BREAKPOINT=void 0;const r=e(at);t.MOBILE_BREAKPOINT=500;const n=()=>window.innerWidth<=t.MOBILE_BREAKPOINT;t.isMobile=n;const i=o=>`
84
+ @media (max-width: ${t.MOBILE_BREAKPOINT}px) {
85
+ ${o}
86
+ }
87
+
88
+ .polotno-mobile & {
89
+ ${o}
90
+ }
91
+ `;t.mobileStyle=i;const a=()=>{const[o,l]=r.default.useState((0,t.isMobile)());return r.default.useEffect(()=>{const u=()=>{l((0,t.isMobile)())};return window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}},[]),o};t.useMobile=a})(cl);(function(t){var e=ye&&ye.__createBinding||(Object.create?function(M,k,D,B){B===void 0&&(B=D);var q=Object.getOwnPropertyDescriptor(k,D);q&&!("get"in q?!k.__esModule:q.writable||q.configurable)||(q={enumerable:!0,get:function(){return k[D]}}),Object.defineProperty(M,B,q)}:function(M,k,D,B){B===void 0&&(B=D),M[B]=k[D]}),r=ye&&ye.__setModuleDefault||(Object.create?function(M,k){Object.defineProperty(M,"default",{enumerable:!0,value:k})}:function(M,k){M.default=k}),n=ye&&ye.__importStar||function(M){if(M&&M.__esModule)return M;var k={};if(M!=null)for(var D in M)D!=="default"&&Object.prototype.hasOwnProperty.call(M,D)&&e(k,M,D);return r(k,M),k},i=ye&&ye.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(t,"__esModule",{value:!0}),t.TextElement=t.useTextColor=t.usePrevious=t.getLineHeight=t.useFontLoader=t.getDir=t.isRTLText=void 0;const a=i(at),o=Ti,l=lo,u=Ac,f=la,y=i(si),b=uM,v=na,h=kc,w=zn,E=p1,S=n(g1),_=Tc,p=sl,d=Ms,g=cl,m=document.createElement("style");m.type="text/css",document.head.appendChild(m);const x={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function P(M){var k="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+k+"]*?["+k+"]").test(M)}function O(M){M=M.replace(/\s/g,"");let k=0;for(var D=0;D<M.length;D++)P(M[D])&&(k+=1);return k>M.length/2}function R(M){return O(M)?"rtl":"ltr"}t.isRTLText=O,t.getDir=R;const T=(0,o.observer)(({textNodeRef:M,element:k,onBlur:D,selectAll:B,cursorPosition:q})=>{const[K,$]=a.default.useState(x),U=M.current;a.default.useLayoutEffect(()=>{const ne={};ne.width=U.width()-2*U.padding()+"px",ne.height=U.height()-2*U.padding()+10+"px",ne.fontSize=U.fontSize()+"px",ne.lineHeight=U.lineHeight()+.01,ne.fontFamily=U.fontFamily(),ne.textAlign=U.align(),ne.color=U.fill(),ne.fontWeight=k.fontWeight,ne.fontStyle=k.fontStyle,ne.letterSpacing=k.letterSpacing+"em";const ie=`
92
+ .polotno-input::placeholder {
93
+ color: ${K.color};
94
+ opacity: 0.6;
95
+ }
96
+ `;m.innerHTML="",m.appendChild(document.createTextNode(ie)),JSON.stringify(ne)!==JSON.stringify(K)&&$(ne)});const X=a.default.useRef(null);a.default.useEffect(()=>{const ne=setTimeout(()=>{var ie;const pe=X.current;if(!pe)return;(ie=X.current)===null||ie===void 0||ie.focus();const we=q||pe.value.length;pe.selectionStart=pe.selectionEnd=we,B&&(pe==null||pe.select(),document.execCommand("selectAll",!1,null))});return()=>{clearTimeout(ne)}},[]);let Q=0;const ee=U.textArr.length*U.lineHeight()*U.fontSize();k.verticalAlign==="middle"&&(Q=(k.a.height-ee)/2),k.verticalAlign==="bottom"&&(Q=k.a.height-ee);const Z=(0,E.removeTags)(k.text);return a.default.createElement(u.Html,null,a.default.createElement("textarea",{className:"polotno-input",ref:X,dir:R(Z),style:Object.assign(Object.assign(Object.assign({},x),K),{paddingTop:Q+"px"}),value:Z,onChange:ne=>{k.set({text:ne.target.value})},placeholder:k.placeholder,onBlur:D}))}),C=M=>{const[k,D]=a.default.useState(!1),B=a.default.useRef(!1);return a.default.useEffect(()=>{var q=!0;return setTimeout(()=>{q&&(M._editModeEnabled&&(B.current=!0),D(!0),setTimeout(()=>{B.current=!1},50))},50),()=>{q=!1}},[]),{editorEnabled:k&&M._editModeEnabled,selectAll:B.current}},N=(M,k)=>{const[D,B]=a.default.useReducer(K=>K+1,0),q=a.default.useRef(!!(0,h.isFontLoaded)(k));return a.default.useLayoutEffect(()=>{if(q.current)return;let K=!0;return(async()=>{q.current=!1,B();const $=(0,v.incrementLoader)(`text ${k}`);await M.loadFont(k),y.default.Util.requestAnimFrame($),K&&(q.current=!0,B())})(),()=>{K=!1}},[k]),[q.current]};t.useFontLoader=N;const F=({fontLoaded:M,fontFamily:k,fontSize:D,lineHeight:B})=>a.default.useMemo(()=>{if(typeof B=="number")return B;const q=document.createElement("div");q.style.fontFamily=k,q.style.fontSize=D+"px",q.style.lineHeight=B,q.innerText="Test text",document.body.appendChild(q);const K=q.offsetHeight;return document.body.removeChild(q),K/D},[M,k,D,B]);function H(M){var k=M.getAbsoluteTransform().copy();k.invert();var D=M.getStage().getPointerPosition();return k.point(D)}function z(M){var k;const D=M.target,B=H(D),q=D.textArr,K=Math.floor(B.y/(D.fontSize()*D.lineHeight())),$=q.slice(0,K).reduce((Q,ee)=>Q+ee.text.length,K),U=(k=q[K])!==null&&k!==void 0?k:q[0];let X=0;return D.align()==="right"?X=D.width()-U.width:D.align()==="center"&&(X=D.width()/2-U.width/2),$+Math.round((B.x-X)/U.width*U.text.length)}function Y(M){const k=a.default.useRef(M),D=a.default.useRef(M);return a.default.useMemo(()=>{D.current=k.current,k.current=M},[M]),D.current}function G(M,k){const D=M.fontSize(),B=M.height(),q=(0,E.removeTags)(k.text);let K=k.a.fontSize;M.height(void 0);const $=Math.round(2*k.a.fontSize)-1;for(let U=1;U<$;U++){const X=k.a.height&&M.height()>k.a.height,Q=q.split(`
97
+ `).join(" ").split(/[\s-]+/);let ee=M.textArr.map(ne=>ne.text).join(";");const Z=Q.find(ne=>!ee.includes(ne)||(ee=ee.replace(ne,""),!1));if(!(X||Z))break;K-=.5,M.fontSize(K)}return M.fontSize(D),M.height(B),K}function W({lines:M,lineHeight:k,width:D,align:B="left",padding:q=0,cornerRadius:K=0}){var $;M.forEach((ee,Z)=>{ee.cx=D/2,B==="right"?ee.cx=D-ee.width/2:B==="left"&&(ee.cx=ee.width/2),B!=="justify"||ee.lastInParagraph||(ee.width=D),B==="justify"&&(ee.cx=ee.width/2)});let U=`M ${($=M[0])===null||$===void 0?void 0:$.cx} ${-q}`;M.forEach((ee,Z)=>{const{cx:ne}=ee,ie=M[Z-1];ie&&ie.width>ee.width?U+=` L ${ne+ee.width/2+q} ${Z*k+q}`:U+=` L ${ne+ee.width/2+q} ${Z*k-q}`;const pe=M[Z+1];pe&&pe.width>ee.width?U+=` L ${ne+ee.width/2+q} ${(Z+1)*k-q}`:U+=` L ${ne+ee.width/2+q} ${(Z+1)*k+q}`});for(var X=M.length-1;X>=0;X--){const ee=M[X],{cx:Z}=ee,ne=M[X+1];ne&&ne.width>ee.width?U+=` L ${Z-ee.width/2-q} ${(X+1)*k-q}`:U+=` L ${Z-ee.width/2-q} ${(X+1)*k+q}`;const ie=M[X-1];ie&&ie.width>ee.width?U+=` L ${Z-ee.width/2-q} ${X*k+q}`:U+=` L ${Z-ee.width/2-q} ${X*k-q}`}U+=" Z";const Q=(0,b.parsePath)(U);return(0,b.roundCommands)(Q,K).path}t.getLineHeight=F,t.usePrevious=Y;const j=M=>a.default.useMemo(()=>{if(!S.isGradient(M.fill))return{fill:M.fill};const{stops:k,rotation:D}=S.parseColor(M.fill),B={x:M.a.width/2,y:M.a.height/2},q=Math.sqrt(Math.pow(B.x,2)+Math.pow(B.y,2)),K=y.default.Util.degToRad(D)-Math.PI/2,$=[];return k.forEach(({offset:U,color:X})=>{$.push(U,X)}),{fillLinearGradientStartPointX:B.x-q*Math.cos(K),fillLinearGradientStartPointY:B.y-q*Math.sin(K),fillLinearGradientColorStops:$,fillLinearGradientEndPointX:B.x+q*Math.cos(K),fillLinearGradientEndPointY:B.y+q*Math.sin(K),fill:k[1].color,fillPriority:"linear-gradient"}},[M.fill]);t.useTextColor=j,t.TextElement=(0,o.observer)(({element:M,store:k})=>{const D=a.default.useRef(null),B=a.default.useRef(null),{editorEnabled:q,selectAll:K}=C(M),[$,U]=a.default.useState(!1),[X,Q]=a.default.useState(!1),ee=a.default.useRef(M.a.height),Z=k.selectedElements.indexOf(M)>=0,{textVerticalResizeEnabled:ne}=w.flags,ie=Y(M.fontFamily),[pe,we]=a.default.useState([]);a.default.useEffect(()=>{var Te,Be;const Ze=(Be=(Te=D.current)===null||Te===void 0?void 0:Te.textArr)!==null&&Be!==void 0?Be:[];JSON.stringify(Ze)!==JSON.stringify(pe)&&we(Ze)}),a.default.useEffect(()=>{if(M.a.width)return;const Te=D.current;Te.width(600),M.set({width:1.4*Te.getTextWidth()})},[]),a.default.useLayoutEffect(()=>(0,f.autorun)(()=>{const Te=D.current;(0,_.applyFilter)(Te,M)}));const[Re]=(0,t.useFontLoader)(k,M.fontFamily),xe=(0,E.removeTags)(M.text),le=()=>{const Te=D.current.clone({height:void 0}),Be=Math.ceil(Te.fontSize()*Te.lineHeight()*Te.textArr.length+1);return Te.destroy(),Be};a.default.useLayoutEffect(()=>{if(!Re)return;const{textOverflow:Te}=w.flags;if(M.a.height)if(Te!=="change-font-size"||X){if(Te==="resize"){const Be=le();ne&&M.a.height<Be&&k.history.ignore(()=>{M.set({height:Be}),D.current.height(Be)}),ne||M.a.height===Be||k.history.ignore(()=>{M.set({height:Be}),D.current.height(Be)})}}else{const Be=G(D.current,M);if(Be!==M.a.fontSize)return void k.history.ignore(()=>{M.set({fontSize:Be})});const Ze=le();M.a.height===Ze||ne||k.history.ignore(()=>{M.set({height:Ze})})}else{const Be=le();k.history.ignore(()=>{M.set({height:Be})})}}),a.default.useLayoutEffect(()=>{const Te=D.current;Te&&(Te.width(Te.width()+1e-8),Te._setTextData(),(0,_.applyFilter)(Te,M))},[Re]);const ce=a.default.useRef(null),be=a.default.useRef(0),_e=Te=>{Te.evt.preventDefault(),k.selectedShapes.find(Ze=>Ze===M)&&M.contentEditable&&(be.current=z(Te),M.toggleEditMode())},te=!xe&&M.placeholder?.6:M.a.opacity;(0,p.useFadeIn)(D,te);const fe=(0,t.getLineHeight)({fontLoaded:Re,fontFamily:M.fontFamily,fontSize:M.a.fontSize,lineHeight:M.lineHeight}),ue=M.selectable||k.role==="admin",me=(0,t.useTextColor)(M),Ne=a.default.useMemo(()=>M.backgroundEnabled?W({lines:JSON.parse(JSON.stringify(pe)),cornerRadius:M.backgroundCornerRadius*(M.a.fontSize*fe*.5),lineHeight:fe*M.a.fontSize,padding:M.backgroundPadding*(M.a.fontSize*fe*.5),width:M.a.width,align:M.align}):"",[M.backgroundEnabled,M.backgroundCornerRadius,M.a.fontSize,fe,M.backgroundPadding,M.a.width,M.align,pe]),Xe=(0,g.useMobile)();let Ye=0;return M.verticalAlign==="middle"?Ye=(M.a.height-pe.length*fe*M.a.fontSize)/2:M.verticalAlign==="bottom"&&(Ye=M.a.height-pe.length*fe*M.a.fontSize),a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Path,{ref:B,x:M.a.x,y:M.a.y,rotation:M.a.rotation,hideInExport:!M.showInExport||!xe,listening:!1,visible:M.backgroundEnabled,opacity:M.backgroundOpacity,data:Ne,fill:M.backgroundColor,offsetY:-Ye}),a.default.createElement(l.Text,Object.assign({ref:D,id:M.id,name:"element",hideInExport:!M.showInExport||!xe,editModeEnabled:M._editModeEnabled,x:M.a.x,y:M.a.y,rotation:M.a.rotation,width:M.a.width,height:M.a.height,text:xe||M.placeholder},me,{stroke:M.stroke,lineJoin:"round",strokeWidth:M.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:M.a.fontSize,fontFamily:`"${M.fontFamily}", "${ie}"`,fontStyle:M.fontStyle+" "+M.fontWeight,textDecoration:M.textDecoration,align:M.align,verticalAlign:M.verticalAlign,draggable:Xe?M.draggable&&Z:M.draggable,preventDefault:!Xe||Z,opacity:te,visible:!M._editModeEnabled,ellipsis:w.flags.textOverflow==="ellipsis",shadowEnabled:M.shadowEnabled,shadowBlur:M.shadowBlur,shadowOffsetX:M.shadowOffsetX,shadowOffsetY:M.shadowOffsetY,shadowColor:M.shadowColor,shadowOpacity:M.shadowOpacity,lineHeight:fe,letterSpacing:M.letterSpacing*M.a.fontSize,listening:ue,onDragStart:()=>{k.history.startTransaction()},onDragMove:Te=>{M.set({x:Te.target.x(),y:Te.target.y()})},onDragEnd:Te=>{M.set({x:Te.target.x(),y:Te.target.y()}),k.history.endTransaction()},onMouseEnter:()=>{U(!0)},onMouseLeave:()=>{U(!1)},onClick:_e,onTap:_e,onTransformStart:()=>{Q(!0),k.history.startTransaction(),ee.current=D.current.height()},onTransform:Te=>{var Be,Ze;const Qe=Te.target;(Be=B.current)===null||Be===void 0||Be.setAttrs({x:Qe.x(),y:Qe.y(),rotation:Qe.rotation(),scale:Qe.scale()});const se=((Ze=Qe.getStage())===null||Ze===void 0?void 0:Ze.findOne("Transformer")).getActiveAnchor();if(se==="middle-left"||se==="middle-right"){const re=Qe.scaleX(),ke=Qe.width()*re,Ie=M.a.fontSize;let ve=ke;ke<Ie&&(ve=Ie,ce.current&&Qe.position(ce.current)),Qe.width(ve),Qe.scaleX(1),Qe.scaleY(1);const Ce=le();if(w.flags.textOverflow!=="ellipsis"){const Se=Math.max(Ce,ee.current);Qe.height(Se),M.set({height:Qe.height()})}M.set({x:Qe.x(),y:Qe.y(),width:Qe.width(),rotation:Qe.rotation()}),(0,_.applyFilter)(Qe,M)}if(se==="top-center"||se==="bottom-center"){let re=w.flags.textOverflow==="resize"?le():fe*M.a.fontSize;Te.target.height(Math.max(re,Te.target.height()*Te.target.scaleY())),Te.target.scaleY(1)}Te.target.strokeWidth(M.strokeWidth/Te.target.scaleX()),ce.current=Te.target.position()},onTransformEnd:Te=>{var Be;const Ze=Te.target.scaleX();Te.target.scaleX(1),Te.target.scaleY(1),Te.target.strokeWidth(M.strokeWidth),M.set({fontSize:Math.round(M.a.fontSize*Ze),width:Math.ceil(Te.target.width()*Ze),x:Te.target.x(),y:Te.target.y(),rotation:Te.target.rotation(),height:Te.target.height()*Ze}),(Be=B.current)===null||Be===void 0||Be.setAttrs({scaleX:1,scaleY:1}),k.history.endTransaction(),Q(!1)}})),q&&a.default.createElement(l.Group,{x:M.a.x,y:M.a.y,rotation:M.a.rotation},a.default.createElement(T,{textNodeRef:D,element:M,selectAll:K,cursorPosition:be.current,onBlur:()=>{M.toggleEditMode(!1)}})),!X&&($||Z)&&a.default.createElement(d.Highlighter,{element:M}))})})(h1);var m1={},Is={};(function(t){var e=ye&&ye.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(t,"__esModule",{value:!0}),t.useSvgColors=t.replaceColors=t.sameColors=t.fixSize=t.getSvgSize=t.svgToURL=t.getColors=t.urlToString=t.urlToBase64=void 0;const r=e(si),n=e(at),i=g1;function a(d){for(;d.parentNode;){if(d.nodeName==="defs")return!0;d=d.parentNode}return!1}function o(d){const g={fill:"",stroke:""};return d.getAttribute("fill")&&d.getAttribute("fill")!=="none"&&(g.fill=d.getAttribute("fill")),!g.fill&&d.style.fill&&d.style.fill!=="none"&&(g.fill=d.style.fill),d.getAttribute("stroke")&&(g.stroke=d.getAttribute("stroke")),!g.stroke&&d.style.stroke&&(g.stroke=d.style.stroke),g.stroke||g.fill||(g.fill="black"),g}const l=["path","rect","circle"];function u(d){for(var g=[],m=d.getElementsByTagName("*"),x=0,P=m.length;x<P;x++){const O=m[x];a(O)||(O.getAttribute("fill")!==null&&g.push(O),(O.getAttribute("stroke")!==null||O.style&&O.style.fill||l.indexOf(O.nodeName)>=0)&&g.push(O))}return g}async function f(d){const g=await fetch(d);return v(await g.text())}async function y(d){return await(await fetch(d,{mode:"cors"})).text()}function b(d){const g=u(new DOMParser().parseFromString(d,"image/svg+xml")),m=[];return g.forEach(x=>{const{fill:P,stroke:O}=o(x);[P,O].forEach(R=>{R&&r.default.Util.colorToRGBA(R)&&m.indexOf(R)===-1&&m.push(R)})}),m}function v(d){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(d)))}async function h(d){const g=await y(d),m=new DOMParser().parseFromString(g,"image/svg+xml").documentElement.getAttribute("viewBox"),[x,P,O,R]=(m==null?void 0:m.split(" "))||[];return{width:parseFloat(O),height:parseFloat(R)}}function w(d){var g=new DOMParser().parseFromString(d,"image/svg+xml");const m=g.documentElement.getAttribute("viewBox"),[x,P,O,R]=(m==null?void 0:m.split(" "))||[],T=g.documentElement.getAttribute("width");!T&&g.documentElement.setAttribute("width",O+"px");const C=g.documentElement.getAttribute("height");if((!C||C.indexOf("%")>=0)&&g.documentElement.setAttribute("height",R+"px"),T&&T.indexOf("%")>=0&&C&&C.indexOf("%")===-1){const N=parseFloat(C)/parseFloat(R);g.documentElement.setAttribute("width",N*parseFloat(O)+"px")}if(C&&C.indexOf("%")>=0&&T&&T.indexOf("%")===-1){const N=parseFloat(T)/parseFloat(O);g.documentElement.setAttribute("height",N*parseFloat(R)+"px")}return new XMLSerializer().serializeToString(g)}t.urlToBase64=f,t.urlToString=y,t.getColors=b,t.svgToURL=v,t.getSvgSize=h,t.fixSize=w;const E=(d,g)=>{if(!d||!g)return!1;const m=r.default.Util.colorToRGBA(d),x=r.default.Util.colorToRGBA(g);return m&&x?m.r===x.r&&m.g===x.g&&m.b===x.b&&m.a===x.a:void 0};function S(d,g,m,x){var P=d.namespaceURI,O=document.createElementNS(P,"linearGradient");const R=r.default.Util.degToRad(m+90),T=(Math.cos(R)+1)/2,C=(Math.sin(R)+1)/2,N=(Math.cos(R+Math.PI)+1)/2,F=(Math.sin(R+Math.PI)+1)/2;O.setAttribute("x1",100*T+"%"),O.setAttribute("y1",100*C+"%"),O.setAttribute("x2",100*N+"%"),O.setAttribute("y2",100*F+"%"),O.setAttribute("gradientUnits","userSpaceOnUse"),O.setAttribute("id",g);for(var H=0;H<x.length;H++){var z=x[H],Y=document.createElementNS(P,"stop");for(var G in z)z.hasOwnProperty(G)&&Y.setAttribute(G,z[G]);O.appendChild(Y)}return(d.querySelector("defs")||d.insertBefore(document.createElementNS(P,"defs"),d.firstChild)).appendChild(O)}function _(d,g){var m=new DOMParser().parseFromString(d,"image/svg+xml");const x=u(m),P=Array.from(g.keys());return x.forEach(O=>{const{fill:R,stroke:T}=o(O);[{prop:"fill",color:R},{prop:"stroke",color:T}].forEach(({prop:C,color:N})=>{const F=P.find(H=>(0,t.sameColors)(H,N));if(F){const H=g.get(F);if((0,i.isGradient)(H)){const{rotation:z,stops:Y}=(0,i.parseColor)(H),G=Y.map(j=>({offset:100*j.offset+"%","stop-color":j.color})),W="color"+Math.round(1e8*Math.random());S(m.children[0],W,z,G),O.style[C]=null,O.setAttribute(C,`url('#${W}')`)}else O.style[C]=g.get(F)}})}),v(new XMLSerializer().serializeToString(m))}t.sameColors=E,t.replaceColors=_;const p=d=>{const[g,m]=n.default.useState([]);return n.default.useEffect(()=>{let x=!1;return(async()=>{m([]);const P=b(await y(d));x||m(P)})(),()=>{x=!0}},[d]),g};t.useSvgColors=p})(Is);(function(t){var e=ye&&ye.__createBinding||(Object.create?function(k,D,B,q){q===void 0&&(q=B);var K=Object.getOwnPropertyDescriptor(D,B);K&&!("get"in K?!D.__esModule:K.writable||K.configurable)||(K={enumerable:!0,get:function(){return D[B]}}),Object.defineProperty(k,q,K)}:function(k,D,B,q){q===void 0&&(q=B),k[q]=D[B]}),r=ye&&ye.__setModuleDefault||(Object.create?function(k,D){Object.defineProperty(k,"default",{enumerable:!0,value:D})}:function(k,D){k.default=D}),n=ye&&ye.__importStar||function(k){if(k&&k.__esModule)return k;var D={};if(k!=null)for(var B in k)B!=="default"&&Object.prototype.hasOwnProperty.call(k,B)&&e(D,k,B);return r(D,k),D},i=ye&&ye.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(t,"__esModule",{value:!0}),t.ImageElement=t.useImageLoader=t.setImageLoaderHook=void 0;const a=i(at),o=Ti,l=la,u=lo,f=i(Ap),y=i(si),b=Ac,v=Ms,h=na,w=n(Is),E=zn,S=Tc,_=sl,p=cl;function d(){return document.createElement("canvas")}async function g(k){if(!(k.indexOf("data:image/svg+xml")>=0||k.indexOf(".svg")>=0))return k;const D=await w.urlToString(k),B=w.fixSize(D);return w.svgToURL(B)}const m=k=>{const[D,B]=a.default.useState(k);return a.default.useEffect(()=>{(async()=>{const q=await g(k);q!==D&&B(q)})()},[k]),D},x=(k,D,B)=>{const q=a.default.useMemo(()=>{var K,$;const{flipX:U,flipY:X}=k,Q=k.type==="svg"||k.src.indexOf("data:image/svg+xml")>=0||k.src.indexOf(".svg")>=0,ee=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&Q||k.maskSrc;if(!U&&!X&&!ee)return D;if(!D||!D.width||!D.height)return null;const Z=d();let ne=1;k.type==="svg"&&(ne=Math.max(k.a.width/D.width*B,k.a.height/D.height*B)),Z.width=Math.max(D.width*ne,1),Z.height=Math.max(D.height*ne,1);let ie=U?-Z.width:0,pe=X?-Z.height:0;return(K=Z.getContext("2d"))===null||K===void 0||K.scale(U?-1:1,X?-1:1),($=Z.getContext("2d"))===null||$===void 0||$.drawImage(D,ie,pe,Z.width,Z.height),Z},[k.maskSrc,k.flipX,k.flipY,D,k.a.width,k.a.height,B]);return a.default.useEffect(()=>()=>{q&&q.nodeName==="CANVAS"&&y.default.Util.releaseCanvas(q)},[q]),q};function P(k,D){const B=D.width/D.height;let q,K;return B>=k.width/k.height?(q=k.width,K=k.width/B):(q=k.height*B,K=k.height),{x:(k.width-q)/2,y:(k.height-K)/2,width:q,height:K}}function O(k,D,B,q,K,$,U){for(var X=new ImageData(D,B),Q=new Int32Array(k.data.buffer),ee=k.width,Z=new Int32Array(X.data.buffer),ne=X.width,ie=D/$,pe=B/U,we=Math.round(1/ie),Re=Math.round(1/pe),xe=we*Re,le=0;le<X.height;le++)for(var ce=0;ce<ne;ce++){for(var be=q+Math.round(ce/ie)+(K+Math.round(le/pe))*ee,_e=0,te=0,fe=0,ue=0,me=0;me<Re;me++)for(var Ne=0;Ne<we;Ne++){var Xe=Q[be+Ne+me*ee];_e+=Xe<<24>>>24,te+=Xe<<16>>>24,fe+=Xe<<8>>>24,ue+=Xe>>>24}_e=Math.round(_e/xe),te=Math.round(te/xe),fe=Math.round(fe/xe),ue=Math.round(ue/xe),Z[ce+le*ne]=ue<<24|fe<<16|te<<8|_e}return X}function R(k,D){var B,q;const K=d();K.width=k.width,K.height=k.height,(B=K.getContext("2d"))===null||B===void 0||B.drawImage(k,0,0,K.width,K.height);const $=O(K.getContext("2d").getImageData(0,0,K.width,K.height),Math.floor(K.width*D),Math.floor(K.height*D),0,0,K.width,K.height);return K.width=Math.floor(K.width*D),K.height=Math.floor(K.height*D),(q=K.getContext("2d"))===null||q===void 0||q.putImageData($,0,0),K}const T=(k,D)=>{const[B,q]=Y(k.maskSrc,"anonymous"),K=k.maskSrc?q:"loaded";return(0,t.useImageLoader)(K,k.id+"-mask"),a.default.useMemo(()=>{if(!B||!D||!D.width||!D.height)return D;const $=d();$.width=Math.max(D.width,1),$.height=Math.max(D.height,1);const U=$.getContext("2d");if(!U)return D;U.drawImage(D,0,0),U.globalCompositeOperation="source-in";const X=P(B,k);return U.drawImage(B,X.x,X.y,X.width,X.height,0,0,D.width,D.height),$},[D,B,k.a.width,k.a.height])},C=(k,D,B,q,K=0,$=!1)=>{const U=Math.floor(Math.max(k.a.width*q,1)),X=Math.floor(Math.max(k.a.height*q,1)),Q=Math.min(K*q,U/2,X/2),ee=Math.max(k.a.width/B.width,k.a.height/B.height)*q,Z=k.page._exporting&&E.flags.imageDownScalingEnabled&&ee<1&&!$,ne=B.x===0&&B.y===0&&B.width===(D==null?void 0:D.width)&&B.height===(D==null?void 0:D.height),ie=a.default.useMemo(()=>{if(!(!D||!D.width||!D.height))return ne&&Q===0&&!Z?void 0:d()},[D,Q,Z,ne]);return a.default.useLayoutEffect(()=>{if(!ie||!D)return;ie.width=U,ie.height=X;const pe=ie.getContext("2d");if(!pe)return;Q&&(pe.beginPath(),pe.moveTo(Q,0),pe.lineTo(U-Q,0),pe.arc(U-Q,Q,Q,3*Math.PI/2,0,!1),pe.lineTo(U,X-Q),pe.arc(U-Q,X-Q,Q,0,Math.PI/2,!1),pe.lineTo(Q,X),pe.arc(Q,X-Q,Q,Math.PI/2,Math.PI,!1),pe.lineTo(0,Q),pe.arc(Q,Q,Q,Math.PI,3*Math.PI/2,!1),pe.clip());const we=Z?R(D,ee):D,Re=Z?{x:Math.floor(B.x*ee),y:Math.floor(B.y*ee),width:Math.floor(B.width*ee),height:Math.floor(B.height*ee)}:B;pe.drawImage(we,Re.x,Re.y,Re.width,Re.height,0,0,ie.width,ie.height)},[ie,k.a.width,k.a.height,B.x,B.y,B.width,B.height,K,q,$,k.page._exporting,Z]),a.default.useEffect(()=>()=>{ie&&ie.nodeName==="CANVAS"&&y.default.Util.releaseCanvas(ie)},[ie]),ie||D},N=(k,D,B,q)=>{const K=m(k.clipSrc||""),[$,U]=Y(K,"anonymous"),X=k.clipSrc?U:"loaded";(0,t.useImageLoader)(X,k.id+"-clip");const Q=a.default.useMemo(()=>{if(D&&$)return d()},[D,$]);return a.default.useLayoutEffect(()=>{var ee;if(!$||!D||!D.width||!D.height||!$||!$.width||!$.height||!Q)return;const Z=d(),ne=Math.max(k.a.width/$.width*B,k.a.height/$.height*B);Z.width=$.width*ne,Z.height=$.height*ne,(ee=Z.getContext("2d"))===null||ee===void 0||ee.drawImage($,0,0,Z.width,Z.height),Q.width=Math.max(D.width,1),Q.height=Math.max(D.height,1);const ie=Q.getContext("2d");ie&&(ie.save(),ie.drawImage(Z,0,0,D.width,D.height),y.default.Util.releaseCanvas(Z),ie.globalCompositeOperation="source-in",ie.drawImage(D,0,0,Q.width,Q.height),ie.restore())},[Q,D,$,k.a.width,k.a.height,B,...q]),k.clipSrc&&$?Q:D},F=d(),H=(0,o.observer)(({element:k})=>{const D=Math.min(30,k.a.width/4,k.a.height/4),B=a.default.useRef(null);return a.default.useEffect(()=>{const q=B.current;if(!q)return;const K=new y.default.Animation($=>{q.rotate((($==null?void 0:$.timeDiff)||0)/2)},q.getLayer());return K.start(),()=>{K.stop()}}),a.default.createElement(u.Group,{x:k.x,y:k.y,rotation:k.rotation,listening:!1,opacity:k.a.opacity,hideInExport:!k.showInExport},a.default.createElement(u.Rect,{width:k.a.width,height:k.a.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:B,x:k.a.width/2,y:k.a.height/2,fill:"white",outerRadius:Math.abs(D),innerRadius:Math.max(1,D-5),angle:270}))}),z=(0,o.observer)(({element:k})=>{const D="Can not load the image...",B=Math.max(10,Math.min(30,k.a.width/25));return a.default.createElement(u.Group,{x:k.x,y:k.y,rotation:k.rotation,listening:!1,opacity:k.a.opacity,hideInExport:!k.showInExport},a.default.createElement(u.Rect,{width:k.a.width,height:k.a.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:D,fontSize:B,width:k.a.width,height:k.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let Y=f.default;const G=k=>{Y=k};t.setImageLoaderHook=G;const W=(k,D)=>{const B=a.default.useRef(),q=()=>{var K;(K=B.current)===null||K===void 0||K.call(B),B.current=void 0};a.default.useEffect(()=>q,[]),a.default.useLayoutEffect(()=>{k!=="loading"||B.current||(B.current=(0,h.incrementLoader)(`image ${D}`)),k!=="loading"&&q(),k==="failed"&&(0,h.triggerLoadError)(`image ${D}`)},[k])};t.useImageLoader=W;const j=({image:k,status:D,type:B})=>{const q=a.default.useRef();return a.default.useEffect(()=>{q.current=k||q.current},[k]),D!=="failed"||D!=="failed"&&B==="svg"?q.current:void 0},M=k=>{const[D,B]=a.default.useReducer(U=>U+1,0),q=a.default.useRef("loading"),K=a.default.useRef(k.src),$=a.default.useRef(k.src);return $.current!==k.src&&($.current=k.src,q.current="loading"),a.default.useEffect(()=>{if(k.type==="image"||!k.src)return;let U=!1;return(async()=>{q.current="loading",B();const X=await w.urlToString(k.src),Q=w.fixSize(X),ee=w.replaceColors(Q,k.colorsReplace);U||(K.current=ee,q.current="loaded",B())})(),()=>{U=!0}},[k.src,JSON.stringify(k.colorsReplace)]),k.type==="image"?[k.src,"loaded"]:[K.current,q.current]};t.ImageElement=(0,o.observer)(({element:k,store:D})=>{var B;const[q,K]=a.default.useState(!1),$=a.default.useRef(null),U=a.default.useRef(null),[X,Q]=a.default.useState(!1),ee=D.selectedElements.indexOf(k)>=0,[Z,ne]=M(k),[ie,pe]=Y(Z,"anonymous"),we=k.type!=="svg"||ne==="loaded"?pe:"loading";(0,t.useImageLoader)(we,k.id);const Re=j({image:ie,status:pe,type:k.type}),xe=T(k,x(k,ie||Re,D._elementsPixelRatio))||F;let{cropX:le,cropY:ce,cropWidth:be,cropHeight:_e}=k;pe!=="loaded"&&(le=ce=0,be=_e=1);const te=xe.width*be,fe=xe.height*_e,ue=k.a.width/k.a.height;let me,Ne;const Xe=te/fe,Ye=k.type==="svg";Ye?(me=te,Ne=fe):ue>=Xe?(me=te,Ne=te/ue):(me=fe*ue,Ne=fe);const Te={x:xe.width*le,y:xe.height*ce,width:me,height:Ne},Be=(B=k.cornerRadius)!==null&&B!==void 0?B:0;let Ze=N(k,C(k,xe,Te,D._elementsPixelRatio,Be,q||k._cropModeEnabled||k.type==="svg"),D._elementsPixelRatio,[Te,Be,D._elementsPixelRatio]);const Qe=Math.max(k.a.width/me,k.a.height/Ne);a.default.useEffect(()=>{var De;if(!k._cropModeEnabled)return;const Ke=(De=$.current)===null||De===void 0?void 0:De.getStage();function ct(Wt){k._cropModeEnabled&&Wt.target!==U.current&&k.toggleCropMode(!1)}function At(Wt){k._cropModeEnabled&&Wt.target.nodeName!=="CANVAS"&&k.toggleCropMode(!1)}return document.body.addEventListener("click",At),Ke==null||Ke.on("click",ct),Ke==null||Ke.on("tap",ct),()=>{document.body.removeEventListener("click",At),document.body.removeEventListener("touchstart",At),Ke==null||Ke.off("click",ct),Ke==null||Ke.off("click",ct)}},[k._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(q||k._cropModeEnabled))return(0,S.applyFilter)($.current,k),(0,l.autorun)(()=>{(0,S.applyFilter)($.current,k)},{delay:100})},[xe,q,be,_e,k._cropModeEnabled]),a.default.useLayoutEffect(()=>{var De;q||k._cropModeEnabled?(De=$.current)===null||De===void 0||De.clearCache():(0,S.applyFilter)($.current,k)},[q,k.a.width,k.a.height,k._cropModeEnabled]),a.default.useEffect(()=>{(0,S.applyFilter)($.current,k)},[k.shadowEnabled,k.shadowBlur,k.cornerRadius,k.shadowColor,k.shadowOffsetX,k.shadowOffsetY,k.shadowOpacity]);const se=a.default.useRef(null),re=a.default.useRef(null),ke=a.default.useRef(null);a.default.useLayoutEffect(()=>{k._cropModeEnabled&&(re.current.nodes([se.current]),ke.current.nodes([U.current]))},[k._cropModeEnabled]);const Ie=De=>{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 Ke=De.target.width()*De.target.scaleX(),ct=De.target.height()*De.target.scaleY(),At=Math.min(1,me/Ke),Wt=Math.min(1,Ne/ct),zr=1-At,br=Math.min(zr,Math.max(0,Math.round(-De.target.x())/Ke)),Ar=1-Wt,Br=Math.min(Ar,Math.max(0,Math.round(-De.target.y())/ct));De.target.setAttrs({x:-br*xe.width,y:-Br*xe.height,scaleX:1,scaleY:1}),k.set({cropX:br,cropY:Br,cropWidth:At,cropHeight:Wt})},ve=()=>{k.type!=="svg"&&k.contentEditable&&setTimeout(()=>{k.toggleCropMode(!0)})},Ce=k.type==="svg"&&Re,Se=pe==="loading"&&!Ce,$e=pe==="failed",Oe=!Se&&!$e,Ue=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Je=Oe?k.a.opacity:0;(0,_.useFadeIn)($,Je);const wt=k.selectable||D.role==="admin",_t=(0,p.useMobile)();return a.default.createElement(a.default.Fragment,null,Se&&a.default.createElement(H,{element:k}),$e&&a.default.createElement(z,{element:k}),a.default.createElement(u.Image,{ref:$,name:"element",id:k.id,image:Ze,x:k.a.x,y:k.a.y,width:k.a.width||1,height:k.a.height||1,rotation:k.rotation,opacity:Je,shadowEnabled:k.shadowEnabled,shadowBlur:k.shadowBlur,shadowOffsetX:k.shadowOffsetX,shadowOffsetY:k.shadowOffsetY,shadowColor:k.shadowColor,shadowOpacity:k.shadowOpacity,customCrop:Te,listening:wt,draggable:_t?k.draggable&&ee:k.draggable,preventDefault:!_t||ee,hideInExport:!k.showInExport,onMouseEnter:()=>{Q(!0)},onMouseLeave:()=>{Q(!1)},onDragStart:()=>{D.history.startTransaction()},onDragMove:De=>{k.set({x:De.target.x(),y:De.target.y()})},onDragEnd:De=>{k.set({x:De.target.x(),y:De.target.y()}),D.history.endTransaction()},onDblClick:ve,onDblTap:ve,onTransformStart:()=>{K(!0),D.history.startTransaction(),Ue.current={cropX:k.cropX,cropY:k.cropY,cropWidth:k.cropWidth,cropHeight:k.cropHeight}},onTransform:De=>{var Ke;const ct=De.currentTarget,At=Math.abs(ct.scaleX()-1)<1e-7?1:ct.scaleX(),Wt=Math.abs(ct.scaleY()-1)<1e-7?1:ct.scaleY();ct.scaleX(1),ct.scaleY(1);const zr=(Ke=De.target.getStage())===null||Ke===void 0?void 0:Ke.findOne("Transformer"),br=1-me/xe.width,Ar=Math.min(br,Math.max(0,k.cropX)),Br=1-Ne/xe.height,Ni=Math.min(Br,Math.max(0,k.cropY)),Sn=zr.getActiveAnchor(),En=!(Sn.indexOf("middle")>=0||Sn.indexOf("center")>=0),co=!En&&At<1&&Ue.current.cropHeight>Ne/xe.height;let pa=En?k.cropWidth:k.cropWidth*At;co&&(pa=k.cropWidth);const js=!En&&Wt<1&&Ue.current.cropWidth>me/xe.width;let Mi=En?k.cropHeight:k.cropHeight*Wt;js&&(Mi=k.cropHeight),Ye&&(pa=k.cropWidth,Mi=k.cropHeight),k.set({cropX:Ar,cropY:Ni,x:ct.x(),y:ct.y(),width:ct.width()*At,height:ct.height()*Wt,rotation:De.target.rotation(),cropWidth:Math.min(pa,1-Ar),cropHeight:Math.min(Mi,1-Ni)})},onTransformEnd:De=>{const Ke=De.currentTarget;k.set({width:Ke.width(),height:Ke.height(),x:Ke.x(),y:Ke.y(),rotation:De.target.rotation(),cropWidth:me/xe.width,cropHeight:Ne/xe.height}),K(!1),D.history.endTransaction()}}),a.default.createElement(u.Rect,{x:k.x,y:k.y,width:Math.max(k.a.width-k.borderSize,0),height:Math.max(k.a.height-k.borderSize,0),opacity:Je,offsetX:-k.borderSize/2,offsetY:-k.borderSize/2,stroke:k.borderColor,strokeWidth:k.borderSize,listening:!1,visible:!!k.borderSize,rotation:k.rotation,cornerRadius:Math.max(0,Be-k.borderSize),hideInExport:!k.showInExport}),k._cropModeEnabled&&a.default.createElement(b.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/D.scale,y:-window.innerWidth/D.scale,width:window.innerWidth/D.scale*3,height:window.innerWidth/D.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:Ze,x:k.x,y:k.y,width:k.a.width,height:k.a.height,rotation:k.rotation,shadowEnabled:k.shadowEnabled,shadowBlur:k.shadowBlur}),a.default.createElement(u.Group,{x:k.x,y:k.y,rotation:k.rotation,scaleX:Qe,scaleY:Qe},a.default.createElement(u.Image,{image:xe,ref:U,opacity:.4,draggable:!0,x:-k.cropX*xe.width,y:-k.cropY*xe.height,onDragMove:Ie,onTransform:Ie}),a.default.createElement(u.Transformer,{ref:ke,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(De,Ke)=>Ke.width<5||Ke.height<5?De:Ke,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:me,height:Ne,ref:se,listening:!1,onTransform:De=>{De.target.x()<-k.cropX*xe.width-1e-9&&(De.target.x(-k.cropX*xe.width),De.target.scaleX(1)),De.target.y()<-k.cropY*xe.height-1e-9&&(De.target.y(-k.cropY*xe.height),De.target.scaleY(1));const Ke=Math.min(1,Math.max(0,k.cropX+De.target.x()/xe.width)),ct=Math.min(1,Math.max(0,De.target.y()/xe.height+k.cropY)),At=De.target.width()*De.target.scaleX(),Wt=De.target.height()*De.target.scaleY(),zr=Math.min(1-Ke,At/xe.width),br=Math.min(1-ct,Wt/xe.height),Ar=De.target.getAbsolutePosition(De.target.getParent().getParent());De.target.scale({x:1,y:1}),De.target.position({x:0,y:0}),k.set({x:Ar.x,y:Ar.y,cropX:Ke,cropY:ct,cropWidth:zr,cropHeight:br,width:Math.min(At*Qe,xe.width*(1-Ke)*Qe),height:Math.min(Wt*Qe,xe.height*(1-ct)*Qe)})}}),a.default.createElement(u.Transformer,{ref:re,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(De,Ke)=>Ke.width<5||Ke.height<5?De:Ke,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(X||ee)&&a.default.createElement(v.Highlighter,{element:k}))})})(m1);var c8={},f8={exports:{}};/*!
98
+ * Quill Editor v1.3.7
99
+ * https://quilljs.com/
100
+ * Copyright (c) 2014, Jason Chen
101
+ * Copyright (c) 2013, salesforce.com
102
+ */(function(t,e){(function(n,i){t.exports=i()})(typeof self<"u"?self:ye,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),y=i(47),b=i(48),v=i(49),h=i(12),w=i(32),E=i(33),S=i(31),_=i(1),p={Scope:_.Scope,create:_.create,find:_.find,query:_.query,register:_.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:b.default,Scroll:u.default,Block:y.default,Inline:f.default,Text:v.default,Attributor:{Attribute:h.default,Class:w.default,Style:E.default,Store:S.default}};n.default=p},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,p){_.__proto__=p}||function(_,p){for(var d in p)p.hasOwnProperty(d)&&(_[d]=p[d])};return function(_,p){S(_,p);function d(){this.constructor=_}_.prototype=p===null?Object.create(p):(d.prototype=p.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(S){a(_,S);function _(p){var d=this;return p="[Parchment] "+p,d=S.call(this,p)||this,d.message=p,d.name=d.constructor.name,d}return _}(Error);n.ParchmentError=o;var l={},u={},f={},y={};n.DATA_KEY="__blot";var b;(function(S){S[S.TYPE=3]="TYPE",S[S.LEVEL=12]="LEVEL",S[S.ATTRIBUTE=13]="ATTRIBUTE",S[S.BLOT=14]="BLOT",S[S.INLINE=7]="INLINE",S[S.BLOCK=11]="BLOCK",S[S.BLOCK_BLOT=10]="BLOCK_BLOT",S[S.INLINE_BLOT=6]="INLINE_BLOT",S[S.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",S[S.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",S[S.ANY=15]="ANY"})(b=n.Scope||(n.Scope={}));function v(S,_){var p=w(S);if(p==null)throw new o("Unable to create "+S+" blot");var d=p,g=S instanceof Node||S.nodeType===Node.TEXT_NODE?S:d.create(_);return new d(g,_)}n.create=v;function h(S,_){return _===void 0&&(_=!1),S==null?null:S[n.DATA_KEY]!=null?S[n.DATA_KEY].blot:_?h(S.parentNode,_):null}n.find=h;function w(S,_){_===void 0&&(_=b.ANY);var p;if(typeof S=="string")p=y[S]||l[S];else if(S instanceof Text||S.nodeType===Node.TEXT_NODE)p=y.text;else if(typeof S=="number")S&b.LEVEL&b.BLOCK?p=y.block:S&b.LEVEL&b.INLINE&&(p=y.inline);else if(S instanceof HTMLElement){var d=(S.getAttribute("class")||"").split(/\s+/);for(var g in d)if(p=u[d[g]],p)break;p=p||f[S.tagName]}return p==null?null:_&b.LEVEL&p.scope&&_&b.TYPE&p.scope?p:null}n.query=w;function E(){for(var S=[],_=0;_<arguments.length;_++)S[_]=arguments[_];if(S.length>1)return S.map(function(g){return E(g)});var p=S[0];if(typeof p.blotName!="string"&&typeof p.attrName!="string")throw new o("Invalid definition");if(p.blotName==="abstract")throw new o("Cannot register abstract class");if(y[p.blotName||p.attrName]=p,typeof p.keyName=="string")l[p.keyName]=p;else if(p.className!=null&&(u[p.className]=p),p.tagName!=null){Array.isArray(p.tagName)?p.tagName=p.tagName.map(function(g){return g.toUpperCase()}):p.tagName=p.tagName.toUpperCase();var d=Array.isArray(p.tagName)?p.tagName:[p.tagName];d.forEach(function(g){(f[g]==null||p.className==null)&&(f[g]=p)})}return p}n.register=E},function(r,n,i){var a=i(51),o=i(11),l=i(3),u=i(20),f=String.fromCharCode(0),y=function(b){Array.isArray(b)?this.ops=b:b!=null&&Array.isArray(b.ops)?this.ops=b.ops:this.ops=[]};y.prototype.insert=function(b,v){var h={};return b.length===0?this:(h.insert=b,v!=null&&typeof v=="object"&&Object.keys(v).length>0&&(h.attributes=v),this.push(h))},y.prototype.delete=function(b){return b<=0?this:this.push({delete:b})},y.prototype.retain=function(b,v){if(b<=0)return this;var h={retain:b};return v!=null&&typeof v=="object"&&Object.keys(v).length>0&&(h.attributes=v),this.push(h)},y.prototype.push=function(b){var v=this.ops.length,h=this.ops[v-1];if(b=l(!0,{},b),typeof h=="object"){if(typeof b.delete=="number"&&typeof h.delete=="number")return this.ops[v-1]={delete:h.delete+b.delete},this;if(typeof h.delete=="number"&&b.insert!=null&&(v-=1,h=this.ops[v-1],typeof h!="object"))return this.ops.unshift(b),this;if(o(b.attributes,h.attributes)){if(typeof b.insert=="string"&&typeof h.insert=="string")return this.ops[v-1]={insert:h.insert+b.insert},typeof b.attributes=="object"&&(this.ops[v-1].attributes=b.attributes),this;if(typeof b.retain=="number"&&typeof h.retain=="number")return this.ops[v-1]={retain:h.retain+b.retain},typeof b.attributes=="object"&&(this.ops[v-1].attributes=b.attributes),this}}return v===this.ops.length?this.ops.push(b):this.ops.splice(v,0,b),this},y.prototype.chop=function(){var b=this.ops[this.ops.length-1];return b&&b.retain&&!b.attributes&&this.ops.pop(),this},y.prototype.filter=function(b){return this.ops.filter(b)},y.prototype.forEach=function(b){this.ops.forEach(b)},y.prototype.map=function(b){return this.ops.map(b)},y.prototype.partition=function(b){var v=[],h=[];return this.forEach(function(w){var E=b(w)?v:h;E.push(w)}),[v,h]},y.prototype.reduce=function(b,v){return this.ops.reduce(b,v)},y.prototype.changeLength=function(){return this.reduce(function(b,v){return v.insert?b+u.length(v):v.delete?b-v.delete:b},0)},y.prototype.length=function(){return this.reduce(function(b,v){return b+u.length(v)},0)},y.prototype.slice=function(b,v){b=b||0,typeof v!="number"&&(v=1/0);for(var h=[],w=u.iterator(this.ops),E=0;E<v&&w.hasNext();){var S;E<b?S=w.next(b-E):(S=w.next(v-E),h.push(S)),E+=u.length(S)}return new y(h)},y.prototype.compose=function(b){var v=u.iterator(this.ops),h=u.iterator(b.ops),w=[],E=h.peek();if(E!=null&&typeof E.retain=="number"&&E.attributes==null){for(var S=E.retain;v.peekType()==="insert"&&v.peekLength()<=S;)S-=v.peekLength(),w.push(v.next());E.retain-S>0&&h.next(E.retain-S)}for(var _=new y(w);v.hasNext()||h.hasNext();)if(h.peekType()==="insert")_.push(h.next());else if(v.peekType()==="delete")_.push(v.next());else{var p=Math.min(v.peekLength(),h.peekLength()),d=v.next(p),g=h.next(p);if(typeof g.retain=="number"){var m={};typeof d.retain=="number"?m.retain=p:m.insert=d.insert;var x=u.attributes.compose(d.attributes,g.attributes,typeof d.retain=="number");if(x&&(m.attributes=x),_.push(m),!h.hasNext()&&o(_.ops[_.ops.length-1],m)){var P=new y(v.rest());return _.concat(P).chop()}}else typeof g.delete=="number"&&typeof d.retain=="number"&&_.push(g)}return _.chop()},y.prototype.concat=function(b){var v=new y(this.ops.slice());return b.ops.length>0&&(v.push(b.ops[0]),v.ops=v.ops.concat(b.ops.slice(1))),v},y.prototype.diff=function(b,v){if(this.ops===b.ops)return new y;var h=[this,b].map(function(p){return p.map(function(d){if(d.insert!=null)return typeof d.insert=="string"?d.insert:f;var g=p===b?"on":"with";throw new Error("diff() called "+g+" non-document")}).join("")}),w=new y,E=a(h[0],h[1],v),S=u.iterator(this.ops),_=u.iterator(b.ops);return E.forEach(function(p){for(var d=p[1].length;d>0;){var g=0;switch(p[0]){case a.INSERT:g=Math.min(_.peekLength(),d),w.push(_.next(g));break;case a.DELETE:g=Math.min(d,S.peekLength()),S.next(g),w.delete(g);break;case a.EQUAL:g=Math.min(S.peekLength(),_.peekLength(),d);var m=S.next(g),x=_.next(g);o(m.insert,x.insert)?w.retain(g,u.attributes.diff(m.attributes,x.attributes)):w.push(x).delete(g);break}d-=g}}),w.chop()},y.prototype.eachLine=function(b,v){v=v||`
103
+ `;for(var h=u.iterator(this.ops),w=new y,E=0;h.hasNext();){if(h.peekType()!=="insert")return;var S=h.peek(),_=u.length(S)-h.peekLength(),p=typeof S.insert=="string"?S.insert.indexOf(v,_)-_:-1;if(p<0)w.push(h.next());else if(p>0)w.push(h.next(p));else{if(b(w,h.next(1).attributes||{},E)===!1)return;E+=1,w=new y}}w.length()>0&&b(w,{},E)},y.prototype.transform=function(b,v){if(v=!!v,typeof b=="number")return this.transformPosition(b,v);for(var h=u.iterator(this.ops),w=u.iterator(b.ops),E=new y;h.hasNext()||w.hasNext();)if(h.peekType()==="insert"&&(v||w.peekType()!=="insert"))E.retain(u.length(h.next()));else if(w.peekType()==="insert")E.push(w.next());else{var S=Math.min(h.peekLength(),w.peekLength()),_=h.next(S),p=w.next(S);if(_.delete)continue;p.delete?E.push(p):E.retain(S,u.attributes.transform(_.attributes,p.attributes,v))}return E.chop()},y.prototype.transformPosition=function(b,v){v=!!v;for(var h=u.iterator(this.ops),w=0;h.hasNext()&&w<=b;){var E=h.peekLength(),S=h.peekType();if(h.next(),S==="delete"){b-=Math.min(E,b-w);continue}else S==="insert"&&(w<b||!v)&&(b+=E);w+=E}return b},r.exports=y},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(h){return typeof Array.isArray=="function"?Array.isArray(h):a.call(h)==="[object Array]"},f=function(h){if(!h||a.call(h)!=="[object Object]")return!1;var w=i.call(h,"constructor"),E=h.constructor&&h.constructor.prototype&&i.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!w&&!E)return!1;var S;for(S in h);return typeof S>"u"||i.call(h,S)},y=function(h,w){o&&w.name==="__proto__"?o(h,w.name,{enumerable:!0,configurable:!0,value:w.newValue,writable:!0}):h[w.name]=w.newValue},b=function(h,w){if(w==="__proto__")if(i.call(h,w)){if(l)return l(h,w).value}else return;return h[w]};r.exports=function v(){var h,w,E,S,_,p,d=arguments[0],g=1,m=arguments.length,x=!1;for(typeof d=="boolean"&&(x=d,d=arguments[1]||{},g=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});g<m;++g)if(h=arguments[g],h!=null)for(w in h)E=b(d,w),S=b(h,w),d!==S&&(x&&S&&(f(S)||(_=u(S)))?(_?(_=!1,p=E&&u(E)?E:[]):p=E&&f(E)?E:{},y(d,{name:w,newValue:v(x,p,S)})):typeof S<"u"&&y(d,{name:w,newValue:S}));return d}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=function(){function C(N,F){for(var H=0;H<F.length;H++){var z=F[H];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(N,z.key,z)}}return function(N,F,H){return F&&C(N.prototype,F),H&&C(N,H),N}}(),o=function C(N,F,H){N===null&&(N=Function.prototype);var z=Object.getOwnPropertyDescriptor(N,F);if(z===void 0){var Y=Object.getPrototypeOf(N);return Y===null?void 0:C(Y,F,H)}else{if("value"in z)return z.value;var G=z.get;return G===void 0?void 0:G.call(H)}},l=i(3),u=d(l),f=i(2),y=d(f),b=i(0),v=d(b),h=i(16),w=d(h),E=i(6),S=d(E),_=i(7),p=d(_);function d(C){return C&&C.__esModule?C:{default:C}}function g(C,N){if(!(C instanceof N))throw new TypeError("Cannot call a class as a function")}function m(C,N){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:C}function x(C,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);C.prototype=Object.create(N&&N.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(C,N):C.__proto__=N)}var P=1,O=function(C){x(N,C);function N(){return g(this,N),m(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return a(N,[{key:"attach",value:function(){o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"attach",this).call(this),this.attributes=new v.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new y.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(H,z){var Y=v.default.query(H,v.default.Scope.BLOCK_ATTRIBUTE);Y!=null&&this.attributes.attribute(Y,z)}},{key:"formatAt",value:function(H,z,Y,G){this.format(Y,G)}},{key:"insertAt",value:function(H,z,Y){if(typeof z=="string"&&z.endsWith(`
104
+ `)){var G=v.default.create(R.blotName);this.parent.insertBefore(G,H===0?this:this.next),G.insertAt(0,z.slice(0,-1))}else o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertAt",this).call(this,H,z,Y)}}]),N}(v.default.Embed);O.scope=v.default.Scope.BLOCK_BLOT;var R=function(C){x(N,C);function N(F){g(this,N);var H=m(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,F));return H.cache={},H}return a(N,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(v.default.Leaf).reduce(function(H,z){return z.length()===0?H:H.insert(z.value(),T(z))},new y.default).insert(`
105
+ `,T(this))),this.cache.delta}},{key:"deleteAt",value:function(H,z){o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"deleteAt",this).call(this,H,z),this.cache={}}},{key:"formatAt",value:function(H,z,Y,G){z<=0||(v.default.query(Y,v.default.Scope.BLOCK)?H+z===this.length()&&this.format(Y,G):o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"formatAt",this).call(this,H,Math.min(z,this.length()-H-1),Y,G),this.cache={})}},{key:"insertAt",value:function(H,z,Y){if(Y!=null)return o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertAt",this).call(this,H,z,Y);if(z.length!==0){var G=z.split(`
106
+ `),W=G.shift();W.length>0&&(H<this.length()-1||this.children.tail==null?o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertAt",this).call(this,Math.min(H,this.length()-1),W):this.children.tail.insertAt(this.children.tail.length(),W),this.cache={});var j=this;G.reduce(function(M,k){return j=j.split(M,!0),j.insertAt(0,k),k.length},H+W.length)}}},{key:"insertBefore",value:function(H,z){var Y=this.children.head;o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertBefore",this).call(this,H,z),Y instanceof w.default&&Y.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"length",this).call(this)+P),this.cache.length}},{key:"moveChildren",value:function(H,z){o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"moveChildren",this).call(this,H,z),this.cache={}}},{key:"optimize",value:function(H){o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"optimize",this).call(this,H),this.cache={}}},{key:"path",value:function(H){return o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"path",this).call(this,H,!0)}},{key:"removeChild",value:function(H){o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"removeChild",this).call(this,H),this.cache={}}},{key:"split",value:function(H){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(z&&(H===0||H>=this.length()-P)){var Y=this.clone();return H===0?(this.parent.insertBefore(Y,this),this):(this.parent.insertBefore(Y,this.next),Y)}else{var G=o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"split",this).call(this,H,z);return this.cache={},G}}}]),N}(v.default.Block);R.blotName="block",R.tagName="P",R.defaultChild="break",R.allowedChildren=[S.default,v.default.Embed,p.default];function T(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return C==null||(typeof C.formats=="function"&&(N=(0,u.default)(N,C.formats())),C.parent==null||C.parent.blotName=="scroll"||C.parent.statics.scope!==C.statics.scope)?N:T(C.parent,N)}n.bubbleFormats=T,n.BlockEmbed=O,n.default=R},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(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},o=function(){function j(M,k){var D=[],B=!0,q=!1,K=void 0;try{for(var $=M[Symbol.iterator](),U;!(B=(U=$.next()).done)&&(D.push(U.value),!(k&&D.length===k));B=!0);}catch(X){q=!0,K=X}finally{try{!B&&$.return&&$.return()}finally{if(q)throw K}}return D}return function(M,k){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return j(M,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function j(M,k){for(var D=0;D<k.length;D++){var B=k[D];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(M,B.key,B)}}return function(M,k,D){return k&&j(M.prototype,k),D&&j(M,D),M}}();i(50);var u=i(2),f=T(u),y=i(14),b=T(y),v=i(8),h=T(v),w=i(9),E=T(w),S=i(0),_=T(S),p=i(15),d=T(p),g=i(3),m=T(g),x=i(10),P=T(x),O=i(34),R=T(O);function T(j){return j&&j.__esModule?j:{default:j}}function C(j,M,k){return M in j?Object.defineProperty(j,M,{value:k,enumerable:!0,configurable:!0,writable:!0}):j[M]=k,j}function N(j,M){if(!(j instanceof M))throw new TypeError("Cannot call a class as a function")}var F=(0,P.default)("quill"),H=function(){l(j,null,[{key:"debug",value:function(k){k===!0&&(k="log"),P.default.level(k)}},{key:"find",value:function(k){return k.__quill||_.default.find(k)}},{key:"import",value:function(k){return this.imports[k]==null&&F.error("Cannot import "+k+". Are you sure it was registered?"),this.imports[k]}},{key:"register",value:function(k,D){var B=this,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof k!="string"){var K=k.attrName||k.blotName;typeof K=="string"?this.register("formats/"+K,k,D):Object.keys(k).forEach(function($){B.register($,k[$],D)})}else this.imports[k]!=null&&!q&&F.warn("Overwriting "+k+" with",D),this.imports[k]=D,(k.startsWith("blots/")||k.startsWith("formats/"))&&D.blotName!=="abstract"?_.default.register(D):k.startsWith("modules")&&typeof D.register=="function"&&D.register()}}]);function j(M){var k=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(N(this,j),this.options=z(M,D),this.container=this.options.container,this.container==null)return F.error("Invalid Quill container",M);this.options.debug&&j.debug(this.options.debug);var B=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new h.default,this.scroll=_.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new b.default(this.scroll),this.selection=new d.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(h.default.events.EDITOR_CHANGE,function(K){K===h.default.events.TEXT_CHANGE&&k.root.classList.toggle("ql-blank",k.editor.isBlank())}),this.emitter.on(h.default.events.SCROLL_UPDATE,function(K,$){var U=k.selection.lastRange,X=U&&U.length===0?U.index:void 0;Y.call(k,function(){return k.editor.update(null,$,X)},K)});var q=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+B+"<p><br></p></div>");this.setContents(q),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(j,[{key:"addContainer",value:function(k){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof k=="string"){var B=k;k=document.createElement("div"),k.classList.add(B)}return this.container.insertBefore(k,D),k}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(k,D,B){var q=this,K=G(k,D,B),$=o(K,4);return k=$[0],D=$[1],B=$[3],Y.call(this,function(){return q.editor.deleteText(k,D)},B,k,-1*D)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(k),this.container.classList.toggle("ql-disabled",!k)}},{key:"focus",value:function(){var k=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=k,this.scrollIntoView()}},{key:"format",value:function(k,D){var B=this,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h.default.sources.API;return Y.call(this,function(){var K=B.getSelection(!0),$=new f.default;if(K==null)return $;if(_.default.query(k,_.default.Scope.BLOCK))$=B.editor.formatLine(K.index,K.length,C({},k,D));else{if(K.length===0)return B.selection.format(k,D),$;$=B.editor.formatText(K.index,K.length,C({},k,D))}return B.setSelection(K,h.default.sources.SILENT),$},q)}},{key:"formatLine",value:function(k,D,B,q,K){var $=this,U=void 0,X=G(k,D,B,q,K),Q=o(X,4);return k=Q[0],D=Q[1],U=Q[2],K=Q[3],Y.call(this,function(){return $.editor.formatLine(k,D,U)},K,k,0)}},{key:"formatText",value:function(k,D,B,q,K){var $=this,U=void 0,X=G(k,D,B,q,K),Q=o(X,4);return k=Q[0],D=Q[1],U=Q[2],K=Q[3],Y.call(this,function(){return $.editor.formatText(k,D,U)},K,k,0)}},{key:"getBounds",value:function(k){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,B=void 0;typeof k=="number"?B=this.selection.getBounds(k,D):B=this.selection.getBounds(k.index,k.length);var q=this.container.getBoundingClientRect();return{bottom:B.bottom-q.top,height:B.height,left:B.left-q.left,right:B.right-q.left,top:B.top-q.top,width:B.width}}},{key:"getContents",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-k,B=G(k,D),q=o(B,2);return k=q[0],D=q[1],this.editor.getContents(k,D)}},{key:"getFormat",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof k=="number"?this.editor.getFormat(k,D):this.editor.getFormat(k.index,k.length)}},{key:"getIndex",value:function(k){return k.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(k){return this.scroll.leaf(k)}},{key:"getLine",value:function(k){return this.scroll.line(k)}},{key:"getLines",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof k!="number"?this.scroll.lines(k.index,k.length):this.scroll.lines(k,D)}},{key:"getModule",value:function(k){return this.theme.modules[k]}},{key:"getSelection",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return k&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-k,B=G(k,D),q=o(B,2);return k=q[0],D=q[1],this.editor.getText(k,D)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(k,D,B){var q=this,K=arguments.length>3&&arguments[3]!==void 0?arguments[3]:j.sources.API;return Y.call(this,function(){return q.editor.insertEmbed(k,D,B)},K,k)}},{key:"insertText",value:function(k,D,B,q,K){var $=this,U=void 0,X=G(k,0,B,q,K),Q=o(X,4);return k=Q[0],U=Q[2],K=Q[3],Y.call(this,function(){return $.editor.insertText(k,D,U)},K,k,D.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(k,D,B){this.clipboard.dangerouslyPasteHTML(k,D,B)}},{key:"removeFormat",value:function(k,D,B){var q=this,K=G(k,D,B),$=o(K,4);return k=$[0],D=$[1],B=$[3],Y.call(this,function(){return q.editor.removeFormat(k,D)},B,k)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(k){var D=this,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API;return Y.call(this,function(){k=new f.default(k);var q=D.getLength(),K=D.editor.deleteText(0,q),$=D.editor.applyDelta(k),U=$.ops[$.ops.length-1];U!=null&&typeof U.insert=="string"&&U.insert[U.insert.length-1]===`
107
+ `&&(D.editor.deleteText(D.getLength()-1,1),$.delete(1));var X=K.compose($);return X},B)}},{key:"setSelection",value:function(k,D,B){if(k==null)this.selection.setRange(null,D||j.sources.API);else{var q=G(k,D,B),K=o(q,4);k=K[0],D=K[1],B=K[3],this.selection.setRange(new p.Range(k,D),B),B!==h.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(k){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API,B=new f.default().insert(k);return this.setContents(B,D)}},{key:"update",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h.default.sources.USER,D=this.scroll.update(k);return this.selection.update(k),D}},{key:"updateContents",value:function(k){var D=this,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API;return Y.call(this,function(){return k=new f.default(k),D.editor.applyDelta(k,B)},B,!0)}}]),j}();H.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},H.events=h.default.events,H.sources=h.default.sources,H.version="1.3.7",H.imports={delta:f.default,parchment:_.default,"core/module":E.default,"core/theme":R.default};function z(j,M){if(M=(0,m.default)(!0,{container:j,modules:{clipboard:!0,keyboard:!0,history:!0}},M),!M.theme||M.theme===H.DEFAULTS.theme)M.theme=R.default;else if(M.theme=H.import("themes/"+M.theme),M.theme==null)throw new Error("Invalid theme "+M.theme+". Did you register it?");var k=(0,m.default)(!0,{},M.theme.DEFAULTS);[k,M].forEach(function(q){q.modules=q.modules||{},Object.keys(q.modules).forEach(function(K){q.modules[K]===!0&&(q.modules[K]={})})});var D=Object.keys(k.modules).concat(Object.keys(M.modules)),B=D.reduce(function(q,K){var $=H.import("modules/"+K);return $==null?F.error("Cannot load "+K+" module. Are you sure you registered it?"):q[K]=$.DEFAULTS||{},q},{});return M.modules!=null&&M.modules.toolbar&&M.modules.toolbar.constructor!==Object&&(M.modules.toolbar={container:M.modules.toolbar}),M=(0,m.default)(!0,{},H.DEFAULTS,{modules:B},k,M),["bounds","container","scrollingContainer"].forEach(function(q){typeof M[q]=="string"&&(M[q]=document.querySelector(M[q]))}),M.modules=Object.keys(M.modules).reduce(function(q,K){return M.modules[K]&&(q[K]=M.modules[K]),q},{}),M}function Y(j,M,k,D){if(this.options.strict&&!this.isEnabled()&&M===h.default.sources.USER)return new f.default;var B=k==null?null:this.getSelection(),q=this.editor.delta,K=j();if(B!=null&&(k===!0&&(k=B.index),D==null?B=W(B,K,M):D!==0&&(B=W(B,k,D,M)),this.setSelection(B,h.default.sources.SILENT)),K.length()>0){var $,U=[h.default.events.TEXT_CHANGE,K,q,M];if(($=this.emitter).emit.apply($,[h.default.events.EDITOR_CHANGE].concat(U)),M!==h.default.sources.SILENT){var X;(X=this.emitter).emit.apply(X,U)}}return K}function G(j,M,k,D,B){var q={};return typeof j.index=="number"&&typeof j.length=="number"?typeof M!="number"?(B=D,D=k,k=M,M=j.length,j=j.index):(M=j.length,j=j.index):typeof M!="number"&&(B=D,D=k,k=M,M=0),(typeof k>"u"?"undefined":a(k))==="object"?(q=k,B=D):typeof k=="string"&&(D!=null?q[k]=D:B=k),B=B||h.default.sources.API,[j,M,q,B]}function W(j,M,k,D){if(j==null)return null;var B=void 0,q=void 0;if(M instanceof f.default){var K=[j.index,j.index+j.length].map(function(Q){return M.transformPosition(Q,D!==h.default.sources.USER)}),$=o(K,2);B=$[0],q=$[1]}else{var U=[j.index,j.index+j.length].map(function(Q){return Q<M||Q===M&&D===h.default.sources.USER?Q:k>=0?Q+k:Math.max(M,Q+k)}),X=o(U,2);B=X[0],q=X[1]}return new p.Range(B,q-B)}n.expandConfig=z,n.overload=G,n.default=H},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(_,p){for(var d=0;d<p.length;d++){var g=p[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(_,g.key,g)}}return function(_,p,d){return p&&S(_.prototype,p),d&&S(_,d),_}}(),o=function S(_,p,d){_===null&&(_=Function.prototype);var g=Object.getOwnPropertyDescriptor(_,p);if(g===void 0){var m=Object.getPrototypeOf(_);return m===null?void 0:S(m,p,d)}else{if("value"in g)return g.value;var x=g.get;return x===void 0?void 0:x.call(d)}},l=i(7),u=b(l),f=i(0),y=b(f);function b(S){return S&&S.__esModule?S:{default:S}}function v(S,_){if(!(S instanceof _))throw new TypeError("Cannot call a class as a function")}function h(S,_){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:S}function w(S,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);S.prototype=Object.create(_&&_.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(S,_):S.__proto__=_)}var E=function(S){w(_,S);function _(){return v(this,_),h(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"formatAt",value:function(d,g,m,x){if(_.compare(this.statics.blotName,m)<0&&y.default.query(m,y.default.Scope.BLOT)){var P=this.isolate(d,g);x&&P.wrap(m,x)}else o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"formatAt",this).call(this,d,g,m,x)}},{key:"optimize",value:function(d){if(o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,d),this.parent instanceof _&&_.compare(this.statics.blotName,this.parent.statics.blotName)>0){var g=this.parent.isolate(this.offset(),this.length());this.moveChildren(g),g.wrap(this)}}}],[{key:"compare",value:function(d,g){var m=_.order.indexOf(d),x=_.order.indexOf(g);return m>=0||x>=0?m-x:d===g?0:d<g?-1:1}}]),_}(y.default.Inline);E.allowedChildren=[E,y.default.Embed,u.default],E.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=l(a);function l(v){return v&&v.__esModule?v:{default:v}}function u(v,h){if(!(v instanceof h))throw new TypeError("Cannot call a class as a function")}function f(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 y(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 b=function(v){y(h,v);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default.Text);n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(d,g){for(var m=0;m<g.length;m++){var x=g[m];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(d,x.key,x)}}return function(d,g,m){return g&&p(d.prototype,g),m&&p(d,m),d}}(),o=function p(d,g,m){d===null&&(d=Function.prototype);var x=Object.getOwnPropertyDescriptor(d,g);if(x===void 0){var P=Object.getPrototypeOf(d);return P===null?void 0:p(P,g,m)}else{if("value"in x)return x.value;var O=x.get;return O===void 0?void 0:O.call(m)}},l=i(54),u=b(l),f=i(10),y=b(f);function b(p){return p&&p.__esModule?p:{default:p}}function v(p,d){if(!(p instanceof d))throw new TypeError("Cannot call a class as a function")}function h(p,d){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:p}function w(p,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);p.prototype=Object.create(d&&d.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(p,d):p.__proto__=d)}var E=(0,y.default)("quill:events"),S=["selectionchange","mousedown","mouseup","click"];S.forEach(function(p){document.addEventListener(p,function(){for(var d=arguments.length,g=Array(d),m=0;m<d;m++)g[m]=arguments[m];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(x){if(x.__quill&&x.__quill.emitter){var P;(P=x.__quill.emitter).handleDOM.apply(P,g)}})})});var _=function(p){w(d,p);function d(){v(this,d);var g=h(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return g.listeners={},g.on("error",E.error),g}return a(d,[{key:"emit",value:function(){E.log.apply(E,arguments),o(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(m){for(var x=arguments.length,P=Array(x>1?x-1:0),O=1;O<x;O++)P[O-1]=arguments[O];(this.listeners[m.type]||[]).forEach(function(R){var T=R.node,C=R.handler;(m.target===T||T.contains(m.target))&&C.apply(void 0,[m].concat(P))})}},{key:"listenDOM",value:function(m,x,P){this.listeners[m]||(this.listeners[m]=[]),this.listeners[m].push({node:x,handler:P})}}]),d}(u.default);_.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"},_.sources={API:"api",SILENT:"silent",USER:"user"},n.default=_},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 y,b=arguments.length,v=Array(b>1?b-1:0),h=1;h<b;h++)v[h-1]=arguments[h];(y=console)[f].apply(y,v)}}function u(f){return a.reduce(function(y,b){return y[b]=l.bind(console,b,f),y},{})}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(v,h,w){return w||(w={}),v===h?!0:v instanceof Date&&h instanceof Date?v.getTime()===h.getTime():!v||!h||typeof v!="object"&&typeof h!="object"?w.strict?v===h:v==h:b(v,h,w)};function f(v){return v==null}function y(v){return!(!v||typeof v!="object"||typeof v.length!="number"||typeof v.copy!="function"||typeof v.slice!="function"||v.length>0&&typeof v[0]!="number")}function b(v,h,w){var E,S;if(f(v)||f(h)||v.prototype!==h.prototype)return!1;if(l(v))return l(h)?(v=a.call(v),h=a.call(h),u(v,h,w)):!1;if(y(v)){if(!y(h)||v.length!==h.length)return!1;for(E=0;E<v.length;E++)if(v[E]!==h[E])return!1;return!0}try{var _=o(v),p=o(h)}catch{return!1}if(_.length!=p.length)return!1;for(_.sort(),p.sort(),E=_.length-1;E>=0;E--)if(_[E]!=p[E])return!1;for(E=_.length-1;E>=0;E--)if(S=_[E],!u(v[S],h[S],w))return!1;return typeof v==typeof h}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u,f,y){y===void 0&&(y={}),this.attrName=u,this.keyName=f;var b=a.Scope.TYPE&a.Scope.ATTRIBUTE;y.scope!=null?this.scope=y.scope&a.Scope.LEVEL|b:this.scope=a.Scope.ATTRIBUTE,y.whitelist!=null&&(this.whitelist=y.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 y=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return y==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 O(R,T){var C=[],N=!0,F=!1,H=void 0;try{for(var z=R[Symbol.iterator](),Y;!(N=(Y=z.next()).done)&&(C.push(Y.value),!(T&&C.length===T));N=!0);}catch(G){F=!0,H=G}finally{try{!N&&z.return&&z.return()}finally{if(F)throw H}}return C}return function(R,T){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return O(R,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function O(R,T){for(var C=0;C<T.length;C++){var N=T[C];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(R,N.key,N)}}return function(R,T,C){return T&&O(R.prototype,T),C&&O(R,C),R}}(),l=function O(R,T,C){R===null&&(R=Function.prototype);var N=Object.getOwnPropertyDescriptor(R,T);if(N===void 0){var F=Object.getPrototypeOf(R);return F===null?void 0:O(F,T,C)}else{if("value"in N)return N.value;var H=N.get;return H===void 0?void 0:H.call(C)}},u=i(2),f=p(u),y=i(0),b=p(y),v=i(4),h=p(v),w=i(6),E=p(w),S=i(7),_=p(S);function p(O){return O&&O.__esModule?O:{default:O}}function d(O,R){if(!(O instanceof R))throw new TypeError("Cannot call a class as a function")}function g(O,R){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:O}function m(O,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);O.prototype=Object.create(R&&R.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(O,R):O.__proto__=R)}var x=function(O){m(R,O);function R(){return d(this,R),g(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return R}(E.default);x.blotName="code",x.tagName="CODE";var P=function(O){m(R,O);function R(){return d(this,R),g(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return o(R,[{key:"delta",value:function(){var C=this,N=this.domNode.textContent;return N.endsWith(`
108
+ `)&&(N=N.slice(0,-1)),N.split(`
109
+ `).reduce(function(F,H){return F.insert(H).insert(`
110
+ `,C.formats())},new f.default)}},{key:"format",value:function(C,N){if(!(C===this.statics.blotName&&N)){var F=this.descendant(_.default,this.length()-1),H=a(F,1),z=H[0];z!=null&&z.deleteAt(z.length()-1,1),l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"format",this).call(this,C,N)}}},{key:"formatAt",value:function(C,N,F,H){if(N!==0&&!(b.default.query(F,b.default.Scope.BLOCK)==null||F===this.statics.blotName&&H===this.statics.formats(this.domNode))){var z=this.newlineIndex(C);if(!(z<0||z>=C+N)){var Y=this.newlineIndex(C,!0)+1,G=z-Y+1,W=this.isolate(Y,G),j=W.next;W.format(F,H),j instanceof R&&j.formatAt(0,C-Y+N-G,F,H)}}}},{key:"insertAt",value:function(C,N,F){if(F==null){var H=this.descendant(_.default,C),z=a(H,2),Y=z[0],G=z[1];Y.insertAt(G,N)}}},{key:"length",value:function(){var C=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
111
+ `)?C:C+1}},{key:"newlineIndex",value:function(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(N)return this.domNode.textContent.slice(0,C).lastIndexOf(`
112
+ `);var F=this.domNode.textContent.slice(C).indexOf(`
113
+ `);return F>-1?C+F:-1}},{key:"optimize",value:function(C){this.domNode.textContent.endsWith(`
114
+ `)||this.appendChild(b.default.create("text",`
115
+ `)),l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"optimize",this).call(this,C);var N=this.next;N!=null&&N.prev===this&&N.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===N.statics.formats(N.domNode)&&(N.optimize(C),N.moveChildren(this),N.remove())}},{key:"replace",value:function(C){l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"replace",this).call(this,C),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(N){var F=b.default.find(N);F==null?N.parentNode.removeChild(N):F instanceof b.default.Embed?F.remove():F.unwrap()})}}],[{key:"create",value:function(C){var N=l(R.__proto__||Object.getPrototypeOf(R),"create",this).call(this,C);return N.setAttribute("spellcheck",!1),N}},{key:"formats",value:function(){return!0}}]),R}(h.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(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},o=function(){function j(M,k){var D=[],B=!0,q=!1,K=void 0;try{for(var $=M[Symbol.iterator](),U;!(B=(U=$.next()).done)&&(D.push(U.value),!(k&&D.length===k));B=!0);}catch(X){q=!0,K=X}finally{try{!B&&$.return&&$.return()}finally{if(q)throw K}}return D}return function(M,k){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return j(M,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function j(M,k){for(var D=0;D<k.length;D++){var B=k[D];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(M,B.key,B)}}return function(M,k,D){return k&&j(M.prototype,k),D&&j(M,D),M}}(),u=i(2),f=N(u),y=i(20),b=N(y),v=i(0),h=N(v),w=i(13),E=N(w),S=i(24),_=N(S),p=i(4),d=N(p),g=i(16),m=N(g),x=i(21),P=N(x),O=i(11),R=N(O),T=i(3),C=N(T);function N(j){return j&&j.__esModule?j:{default:j}}function F(j,M,k){return M in j?Object.defineProperty(j,M,{value:k,enumerable:!0,configurable:!0,writable:!0}):j[M]=k,j}function H(j,M){if(!(j instanceof M))throw new TypeError("Cannot call a class as a function")}var z=/^[ -~]*$/,Y=function(){function j(M){H(this,j),this.scroll=M,this.delta=this.getDelta()}return l(j,[{key:"applyDelta",value:function(k){var D=this,B=!1;this.scroll.update();var q=this.scroll.length();return this.scroll.batchStart(),k=W(k),k.reduce(function(K,$){var U=$.retain||$.delete||$.insert.length||1,X=$.attributes||{};if($.insert!=null){if(typeof $.insert=="string"){var Q=$.insert;Q.endsWith(`
116
+ `)&&B&&(B=!1,Q=Q.slice(0,-1)),K>=q&&!Q.endsWith(`
117
+ `)&&(B=!0),D.scroll.insertAt(K,Q);var ee=D.scroll.line(K),Z=o(ee,2),ne=Z[0],ie=Z[1],pe=(0,C.default)({},(0,p.bubbleFormats)(ne));if(ne instanceof d.default){var we=ne.descendant(h.default.Leaf,ie),Re=o(we,1),xe=Re[0];pe=(0,C.default)(pe,(0,p.bubbleFormats)(xe))}X=b.default.attributes.diff(pe,X)||{}}else if(a($.insert)==="object"){var le=Object.keys($.insert)[0];if(le==null)return K;D.scroll.insertAt(K,le,$.insert[le])}q+=U}return Object.keys(X).forEach(function(ce){D.scroll.formatAt(K,U,ce,X[ce])}),K+U},0),k.reduce(function(K,$){return typeof $.delete=="number"?(D.scroll.deleteAt(K,$.delete),K):K+($.retain||$.insert.length||1)},0),this.scroll.batchEnd(),this.update(k)}},{key:"deleteText",value:function(k,D){return this.scroll.deleteAt(k,D),this.update(new f.default().retain(k).delete(D))}},{key:"formatLine",value:function(k,D){var B=this,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(q).forEach(function(K){if(!(B.scroll.whitelist!=null&&!B.scroll.whitelist[K])){var $=B.scroll.lines(k,Math.max(D,1)),U=D;$.forEach(function(X){var Q=X.length();if(!(X instanceof E.default))X.format(K,q[K]);else{var ee=k-X.offset(B.scroll),Z=X.newlineIndex(ee+U)-ee+1;X.formatAt(ee,Z,K,q[K])}U-=Q})}}),this.scroll.optimize(),this.update(new f.default().retain(k).retain(D,(0,P.default)(q)))}},{key:"formatText",value:function(k,D){var B=this,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(q).forEach(function(K){B.scroll.formatAt(k,D,K,q[K])}),this.update(new f.default().retain(k).retain(D,(0,P.default)(q)))}},{key:"getContents",value:function(k,D){return this.delta.slice(k,k+D)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(k,D){return k.concat(D.delta())},new f.default)}},{key:"getFormat",value:function(k){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,B=[],q=[];D===0?this.scroll.path(k).forEach(function($){var U=o($,1),X=U[0];X instanceof d.default?B.push(X):X instanceof h.default.Leaf&&q.push(X)}):(B=this.scroll.lines(k,D),q=this.scroll.descendants(h.default.Leaf,k,D));var K=[B,q].map(function($){if($.length===0)return{};for(var U=(0,p.bubbleFormats)($.shift());Object.keys(U).length>0;){var X=$.shift();if(X==null)return U;U=G((0,p.bubbleFormats)(X),U)}return U});return C.default.apply(C.default,K)}},{key:"getText",value:function(k,D){return this.getContents(k,D).filter(function(B){return typeof B.insert=="string"}).map(function(B){return B.insert}).join("")}},{key:"insertEmbed",value:function(k,D,B){return this.scroll.insertAt(k,D,B),this.update(new f.default().retain(k).insert(F({},D,B)))}},{key:"insertText",value:function(k,D){var B=this,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return D=D.replace(/\r\n/g,`
118
+ `).replace(/\r/g,`
119
+ `),this.scroll.insertAt(k,D),Object.keys(q).forEach(function(K){B.scroll.formatAt(k,D.length,K,q[K])}),this.update(new f.default().retain(k).insert(D,(0,P.default)(q)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var k=this.scroll.children.head;return k.statics.blotName!==d.default.blotName||k.children.length>1?!1:k.children.head instanceof m.default}},{key:"removeFormat",value:function(k,D){var B=this.getText(k,D),q=this.scroll.line(k+D),K=o(q,2),$=K[0],U=K[1],X=0,Q=new f.default;$!=null&&($ instanceof E.default?X=$.newlineIndex(U)-U+1:X=$.length()-U,Q=$.delta().slice(U,U+X-1).insert(`
120
+ `));var ee=this.getContents(k,D+X),Z=ee.diff(new f.default().insert(B).concat(Q)),ne=new f.default().retain(k).concat(Z);return this.applyDelta(ne)}},{key:"update",value:function(k){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,q=this.delta;if(D.length===1&&D[0].type==="characterData"&&D[0].target.data.match(z)&&h.default.find(D[0].target)){var K=h.default.find(D[0].target),$=(0,p.bubbleFormats)(K),U=K.offset(this.scroll),X=D[0].oldValue.replace(_.default.CONTENTS,""),Q=new f.default().insert(X),ee=new f.default().insert(K.value()),Z=new f.default().retain(U).concat(Q.diff(ee,B));k=Z.reduce(function(ne,ie){return ie.insert?ne.insert(ie.insert,$):ne.push(ie)},new f.default),this.delta=q.compose(k)}else this.delta=this.getDelta(),(!k||!(0,R.default)(q.compose(k),this.delta))&&(k=q.diff(this.delta,B));return k}}]),j}();function G(j,M){return Object.keys(M).reduce(function(k,D){return j[D]==null||(M[D]===j[D]?k[D]=M[D]:Array.isArray(M[D])?M[D].indexOf(j[D])<0&&(k[D]=M[D].concat([j[D]])):k[D]=[M[D],j[D]]),k},{})}function W(j){return j.reduce(function(M,k){if(k.insert===1){var D=(0,P.default)(k.attributes);return delete D.image,M.insert({image:k.attributes.image},D)}if(k.attributes!=null&&(k.attributes.list===!0||k.attributes.bullet===!0)&&(k=(0,P.default)(k),k.attributes.list?k.attributes.list="ordered":(k.attributes.list="bullet",delete k.attributes.bullet)),typeof k.insert=="string"){var B=k.insert.replace(/\r\n/g,`
121
+ `).replace(/\r/g,`
122
+ `);return M.insert(B,k.attributes)}return M.push(k)},new f.default)}n.default=Y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function O(R,T){var C=[],N=!0,F=!1,H=void 0;try{for(var z=R[Symbol.iterator](),Y;!(N=(Y=z.next()).done)&&(C.push(Y.value),!(T&&C.length===T));N=!0);}catch(G){F=!0,H=G}finally{try{!N&&z.return&&z.return()}finally{if(F)throw H}}return C}return function(R,T){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return O(R,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function O(R,T){for(var C=0;C<T.length;C++){var N=T[C];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(R,N.key,N)}}return function(R,T,C){return T&&O(R.prototype,T),C&&O(R,C),R}}(),l=i(0),u=_(l),f=i(21),y=_(f),b=i(11),v=_(b),h=i(8),w=_(h),E=i(10),S=_(E);function _(O){return O&&O.__esModule?O:{default:O}}function p(O){if(Array.isArray(O)){for(var R=0,T=Array(O.length);R<O.length;R++)T[R]=O[R];return T}else return Array.from(O)}function d(O,R){if(!(O instanceof R))throw new TypeError("Cannot call a class as a function")}var g=(0,S.default)("quill:selection"),m=function O(R){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,O),this.index=R,this.length=T},x=function(){function O(R,T){var C=this;d(this,O),this.emitter=T,this.scroll=R,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new m(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){C.mouseDown||setTimeout(C.update.bind(C,w.default.sources.USER),1)}),this.emitter.on(w.default.events.EDITOR_CHANGE,function(N,F){N===w.default.events.TEXT_CHANGE&&F.length()>0&&C.update(w.default.sources.SILENT)}),this.emitter.on(w.default.events.SCROLL_BEFORE_UPDATE,function(){if(C.hasFocus()){var N=C.getNativeRange();N!=null&&N.start.node!==C.cursor.textNode&&C.emitter.once(w.default.events.SCROLL_UPDATE,function(){try{C.setNativeRange(N.start.node,N.start.offset,N.end.node,N.end.offset)}catch{}})}}),this.emitter.on(w.default.events.SCROLL_OPTIMIZE,function(N,F){if(F.range){var H=F.range,z=H.startNode,Y=H.startOffset,G=H.endNode,W=H.endOffset;C.setNativeRange(z,Y,G,W)}}),this.update(w.default.sources.SILENT)}return o(O,[{key:"handleComposition",value:function(){var T=this;this.root.addEventListener("compositionstart",function(){T.composing=!0}),this.root.addEventListener("compositionend",function(){if(T.composing=!1,T.cursor.parent){var C=T.cursor.restore();if(!C)return;setTimeout(function(){T.setNativeRange(C.startNode,C.startOffset,C.endNode,C.endOffset)},1)}})}},{key:"handleDragging",value:function(){var T=this;this.emitter.listenDOM("mousedown",document.body,function(){T.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){T.mouseDown=!1,T.update(w.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(T,C){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[T])){this.scroll.update();var N=this.getNativeRange();if(!(N==null||!N.native.collapsed||u.default.query(T,u.default.Scope.BLOCK))){if(N.start.node!==this.cursor.textNode){var F=u.default.find(N.start.node,!1);if(F==null)return;if(F instanceof u.default.Leaf){var H=F.split(N.start.offset);F.parent.insertBefore(this.cursor,H)}else F.insertBefore(this.cursor,N.start.node);this.cursor.attach()}this.cursor.format(T,C),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(T){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,N=this.scroll.length();T=Math.min(T,N-1),C=Math.min(T+C,N-1)-T;var F=void 0,H=this.scroll.leaf(T),z=a(H,2),Y=z[0],G=z[1];if(Y==null)return null;var W=Y.position(G,!0),j=a(W,2);F=j[0],G=j[1];var M=document.createRange();if(C>0){M.setStart(F,G);var k=this.scroll.leaf(T+C),D=a(k,2);if(Y=D[0],G=D[1],Y==null)return null;var B=Y.position(G,!0),q=a(B,2);return F=q[0],G=q[1],M.setEnd(F,G),M.getBoundingClientRect()}else{var K="left",$=void 0;return F instanceof Text?(G<F.data.length?(M.setStart(F,G),M.setEnd(F,G+1)):(M.setStart(F,G-1),M.setEnd(F,G),K="right"),$=M.getBoundingClientRect()):($=Y.domNode.getBoundingClientRect(),G>0&&(K="right")),{bottom:$.top+$.height,height:$.height,left:$[K],right:$[K],top:$.top,width:0}}}},{key:"getNativeRange",value:function(){var T=document.getSelection();if(T==null||T.rangeCount<=0)return null;var C=T.getRangeAt(0);if(C==null)return null;var N=this.normalizeNative(C);return g.info("getNativeRange",N),N}},{key:"getRange",value:function(){var T=this.getNativeRange();if(T==null)return[null,null];var C=this.normalizedToRange(T);return[C,T]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(T){var C=this,N=[[T.start.node,T.start.offset]];T.native.collapsed||N.push([T.end.node,T.end.offset]);var F=N.map(function(Y){var G=a(Y,2),W=G[0],j=G[1],M=u.default.find(W,!0),k=M.offset(C.scroll);return j===0?k:M instanceof u.default.Container?k+M.length():k+M.index(W,j)}),H=Math.min(Math.max.apply(Math,p(F)),this.scroll.length()-1),z=Math.min.apply(Math,[H].concat(p(F)));return new m(z,H-z)}},{key:"normalizeNative",value:function(T){if(!P(this.root,T.startContainer)||!T.collapsed&&!P(this.root,T.endContainer))return null;var C={start:{node:T.startContainer,offset:T.startOffset},end:{node:T.endContainer,offset:T.endOffset},native:T};return[C.start,C.end].forEach(function(N){for(var F=N.node,H=N.offset;!(F instanceof Text)&&F.childNodes.length>0;)if(F.childNodes.length>H)F=F.childNodes[H],H=0;else if(F.childNodes.length===H)F=F.lastChild,H=F instanceof Text?F.data.length:F.childNodes.length+1;else break;N.node=F,N.offset=H}),C}},{key:"rangeToNative",value:function(T){var C=this,N=T.collapsed?[T.index]:[T.index,T.index+T.length],F=[],H=this.scroll.length();return N.forEach(function(z,Y){z=Math.min(H-1,z);var G=void 0,W=C.scroll.leaf(z),j=a(W,2),M=j[0],k=j[1],D=M.position(k,Y!==0),B=a(D,2);G=B[0],k=B[1],F.push(G,k)}),F.length<2&&(F=F.concat(F)),F}},{key:"scrollIntoView",value:function(T){var C=this.lastRange;if(C!=null){var N=this.getBounds(C.index,C.length);if(N!=null){var F=this.scroll.length()-1,H=this.scroll.line(Math.min(C.index,F)),z=a(H,1),Y=z[0],G=Y;if(C.length>0){var W=this.scroll.line(Math.min(C.index+C.length,F)),j=a(W,1);G=j[0]}if(!(Y==null||G==null)){var M=T.getBoundingClientRect();N.top<M.top?T.scrollTop-=M.top-N.top:N.bottom>M.bottom&&(T.scrollTop+=N.bottom-M.bottom)}}}}},{key:"setNativeRange",value:function(T,C){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:T,F=arguments.length>3&&arguments[3]!==void 0?arguments[3]:C,H=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(g.info("setNativeRange",T,C,N,F),!(T!=null&&(this.root.parentNode==null||T.parentNode==null||N.parentNode==null))){var z=document.getSelection();if(z!=null)if(T!=null){this.hasFocus()||this.root.focus();var Y=(this.getNativeRange()||{}).native;if(Y==null||H||T!==Y.startContainer||C!==Y.startOffset||N!==Y.endContainer||F!==Y.endOffset){T.tagName=="BR"&&(C=[].indexOf.call(T.parentNode.childNodes,T),T=T.parentNode),N.tagName=="BR"&&(F=[].indexOf.call(N.parentNode.childNodes,N),N=N.parentNode);var G=document.createRange();G.setStart(T,C),G.setEnd(N,F),z.removeAllRanges(),z.addRange(G)}}else z.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(T){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:w.default.sources.API;if(typeof C=="string"&&(N=C,C=!1),g.info("setRange",T),T!=null){var F=this.rangeToNative(T);this.setNativeRange.apply(this,p(F).concat([C]))}else this.setNativeRange(null);this.update(N)}},{key:"update",value:function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w.default.sources.USER,C=this.lastRange,N=this.getRange(),F=a(N,2),H=F[0],z=F[1];if(this.lastRange=H,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,v.default)(C,this.lastRange)){var Y;!this.composing&&z!=null&&z.native.collapsed&&z.start.node!==this.cursor.textNode&&this.cursor.restore();var G=[w.default.events.SELECTION_CHANGE,(0,y.default)(this.lastRange),(0,y.default)(C),T];if((Y=this.emitter).emit.apply(Y,[w.default.events.EDITOR_CHANGE].concat(G)),T!==w.default.sources.SILENT){var W;(W=this.emitter).emit.apply(W,G)}}}}]),O}();function P(O,R){try{R.parentNode}catch{return!1}return R instanceof Text&&(R=R.parentNode),O.contains(R)}n.Range=m,n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function w(E,S){for(var _=0;_<S.length;_++){var p=S[_];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,p.key,p)}}return function(E,S,_){return S&&w(E.prototype,S),_&&w(E,_),E}}(),o=function w(E,S,_){E===null&&(E=Function.prototype);var p=Object.getOwnPropertyDescriptor(E,S);if(p===void 0){var d=Object.getPrototypeOf(E);return d===null?void 0:w(d,S,_)}else{if("value"in p)return p.value;var g=p.get;return g===void 0?void 0:g.call(_)}},l=i(0),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function y(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function b(w,E){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:w}function v(w,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);w.prototype=Object.create(E&&E.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(w,E):w.__proto__=E)}var h=function(w){v(E,w);function E(){return y(this,E),b(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,[{key:"insertInto",value:function(_,p){_.children.length===0?o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertInto",this).call(this,_,p):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),E}(u.default.Embed);h.blotName="break",h.tagName="BR",n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,h){v.__proto__=h}||function(v,h){for(var w in h)h.hasOwnProperty(w)&&(v[w]=h[w])};return function(v,h){b(v,h);function w(){this.constructor=v}v.prototype=h===null?Object.create(h):(w.prototype=h.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(44),l=i(30),u=i(1),f=function(b){a(v,b);function v(h){var w=b.call(this,h)||this;return w.build(),w}return v.prototype.appendChild=function(h){this.insertBefore(h)},v.prototype.attach=function(){b.prototype.attach.call(this),this.children.forEach(function(h){h.attach()})},v.prototype.build=function(){var h=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(w){try{var E=y(w);h.insertBefore(E,h.children.head||void 0)}catch(S){if(S instanceof u.ParchmentError)return;throw S}})},v.prototype.deleteAt=function(h,w){if(h===0&&w===this.length())return this.remove();this.children.forEachAt(h,w,function(E,S,_){E.deleteAt(S,_)})},v.prototype.descendant=function(h,w){var E=this.children.find(w),S=E[0],_=E[1];return h.blotName==null&&h(S)||h.blotName!=null&&S instanceof h?[S,_]:S instanceof v?S.descendant(h,_):[null,-1]},v.prototype.descendants=function(h,w,E){w===void 0&&(w=0),E===void 0&&(E=Number.MAX_VALUE);var S=[],_=E;return this.children.forEachAt(w,E,function(p,d,g){(h.blotName==null&&h(p)||h.blotName!=null&&p instanceof h)&&S.push(p),p instanceof v&&(S=S.concat(p.descendants(h,d,_))),_-=g}),S},v.prototype.detach=function(){this.children.forEach(function(h){h.detach()}),b.prototype.detach.call(this)},v.prototype.formatAt=function(h,w,E,S){this.children.forEachAt(h,w,function(_,p,d){_.formatAt(p,d,E,S)})},v.prototype.insertAt=function(h,w,E){var S=this.children.find(h),_=S[0],p=S[1];if(_)_.insertAt(p,w,E);else{var d=E==null?u.create("text",w):u.create(w,E);this.appendChild(d)}},v.prototype.insertBefore=function(h,w){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(E){return h instanceof E}))throw new u.ParchmentError("Cannot insert "+h.statics.blotName+" into "+this.statics.blotName);h.insertInto(this,w)},v.prototype.length=function(){return this.children.reduce(function(h,w){return h+w.length()},0)},v.prototype.moveChildren=function(h,w){this.children.forEach(function(E){h.insertBefore(E,w)})},v.prototype.optimize=function(h){if(b.prototype.optimize.call(this,h),this.children.length===0)if(this.statics.defaultChild!=null){var w=u.create(this.statics.defaultChild);this.appendChild(w),w.optimize(h)}else this.remove()},v.prototype.path=function(h,w){w===void 0&&(w=!1);var E=this.children.find(h,w),S=E[0],_=E[1],p=[[this,h]];return S instanceof v?p.concat(S.path(_,w)):(S!=null&&p.push([S,_]),p)},v.prototype.removeChild=function(h){this.children.remove(h)},v.prototype.replace=function(h){h instanceof v&&h.moveChildren(this),b.prototype.replace.call(this,h)},v.prototype.split=function(h,w){if(w===void 0&&(w=!1),!w){if(h===0)return this;if(h===this.length())return this.next}var E=this.clone();return this.parent.insertBefore(E,this.next),this.children.forEachAt(h,this.length(),function(S,_,p){S=S.split(_,w),E.appendChild(S)}),E},v.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},v.prototype.update=function(h,w){var E=this,S=[],_=[];h.forEach(function(p){p.target===E.domNode&&p.type==="childList"&&(S.push.apply(S,p.addedNodes),_.push.apply(_,p.removedNodes))}),_.forEach(function(p){if(!(p.parentNode!=null&&p.tagName!=="IFRAME"&&document.body.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var d=u.find(p);d!=null&&(d.domNode.parentNode==null||d.domNode.parentNode===E.domNode)&&d.detach()}}),S.filter(function(p){return p.parentNode==E.domNode}).sort(function(p,d){return p===d?0:p.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(p){var d=null;p.nextSibling!=null&&(d=u.find(p.nextSibling));var g=y(p);(g.next!=d||g.next==null)&&(g.parent!=null&&g.parent.removeChild(E),E.insertBefore(g,d||void 0))})},v}(l.default);function y(b){var v=u.find(b);if(v==null)try{v=u.create(b)}catch{v=u.create(u.Scope.INLINE),[].slice.call(b.childNodes).forEach(function(w){v.domNode.appendChild(w)}),b.parentNode&&b.parentNode.replaceChild(v.domNode,b),v.attach()}return v}n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,h){v.__proto__=h}||function(v,h){for(var w in h)h.hasOwnProperty(w)&&(v[w]=h[w])};return function(v,h){b(v,h);function w(){this.constructor=v}v.prototype=h===null?Object.create(h):(w.prototype=h.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),l=i(31),u=i(17),f=i(1),y=function(b){a(v,b);function v(h){var w=b.call(this,h)||this;return w.attributes=new l.default(w.domNode),w}return v.formats=function(h){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return h.tagName.toLowerCase()},v.prototype.format=function(h,w){var E=f.query(h);E instanceof o.default?this.attributes.attribute(E,w):w&&E!=null&&(h!==this.statics.blotName||this.formats()[h]!==w)&&this.replaceWith(h,w)},v.prototype.formats=function(){var h=this.attributes.values(),w=this.statics.formats(this.domNode);return w!=null&&(h[this.statics.blotName]=w),h},v.prototype.replaceWith=function(h,w){var E=b.prototype.replaceWith.call(this,h,w);return this.attributes.copy(E),E},v.prototype.update=function(h,w){var E=this;b.prototype.update.call(this,h,w),h.some(function(S){return S.target===E.domNode&&S.type==="attributes"})&&this.attributes.build()},v.prototype.wrap=function(h,w){var E=b.prototype.wrap.call(this,h,w);return E instanceof v&&E.statics.scope===this.statics.scope&&this.attributes.move(E),E},v}(u.default);n.default=y},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,b){y.__proto__=b}||function(y,b){for(var v in b)b.hasOwnProperty(v)&&(y[v]=b[v])};return function(y,b){f(y,b);function v(){this.constructor=y}y.prototype=b===null?Object.create(b):(v.prototype=b.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),l=i(1),u=function(f){a(y,f);function y(){return f!==null&&f.apply(this,arguments)||this}return y.value=function(b){return!0},y.prototype.index=function(b,v){return this.domNode===b||this.domNode.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(v,1):-1},y.prototype.position=function(b,v){var h=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return b>0&&(h+=1),[this.parent.domNode,h]},y.prototype.value=function(){var b;return b={},b[this.statics.blotName]=this.statics.value(this.domNode)||!0,b},y.scope=l.Scope.INLINE_BLOT,y}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),l={attributes:{compose:function(f,y,b){typeof f!="object"&&(f={}),typeof y!="object"&&(y={});var v=o(!0,{},y);b||(v=Object.keys(v).reduce(function(w,E){return v[E]!=null&&(w[E]=v[E]),w},{}));for(var h in f)f[h]!==void 0&&y[h]===void 0&&(v[h]=f[h]);return Object.keys(v).length>0?v:void 0},diff:function(f,y){typeof f!="object"&&(f={}),typeof y!="object"&&(y={});var b=Object.keys(f).concat(Object.keys(y)).reduce(function(v,h){return a(f[h],y[h])||(v[h]=y[h]===void 0?null:y[h]),v},{});return Object.keys(b).length>0?b:void 0},transform:function(f,y,b){if(typeof f!="object")return y;if(typeof y=="object"){if(!b)return y;var v=Object.keys(y).reduce(function(h,w){return f[w]===void 0&&(h[w]=y[w]),h},{});return Object.keys(v).length>0?v: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 y=this.ops[this.index];if(y){var b=this.offset,v=l.length(y);if(f>=v-b?(f=v-b,this.index+=1,this.offset=0):this.offset+=f,typeof y.delete=="number")return{delete:f};var h={};return y.attributes&&(h.attributes=y.attributes),typeof y.retain=="number"?h.retain=f:typeof y.insert=="string"?h.insert=y.insert.substr(b,f):h.insert=y.insert,h}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var f=this.offset,y=this.index,b=this.next(),v=this.ops.slice(this.index);return this.offset=f,this.index=y,[b].concat(v)}else return[]},r.exports=l},function(r,n){var i=function(){function a(E,S){return S!=null&&E instanceof S}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(E,S,_,p,d){typeof S=="object"&&(_=S.depth,p=S.prototype,d=S.includeNonEnumerable,S=S.circular);var g=[],m=[],x=typeof Buffer<"u";typeof S>"u"&&(S=!0),typeof _>"u"&&(_=1/0);function P(O,R){if(O===null)return null;if(R===0)return O;var T,C;if(typeof O!="object")return O;if(a(O,o))T=new o;else if(a(O,l))T=new l;else if(a(O,u))T=new u(function(M,k){O.then(function(D){M(P(D,R-1))},function(D){k(P(D,R-1))})});else if(f.__isArray(O))T=[];else if(f.__isRegExp(O))T=new RegExp(O.source,w(O)),O.lastIndex&&(T.lastIndex=O.lastIndex);else if(f.__isDate(O))T=new Date(O.getTime());else{if(x&&Buffer.isBuffer(O))return Buffer.allocUnsafe?T=Buffer.allocUnsafe(O.length):T=new Buffer(O.length),O.copy(T),T;a(O,Error)?T=Object.create(O):typeof p>"u"?(C=Object.getPrototypeOf(O),T=Object.create(C)):(T=Object.create(p),C=p)}if(S){var N=g.indexOf(O);if(N!=-1)return m[N];g.push(O),m.push(T)}a(O,o)&&O.forEach(function(M,k){var D=P(k,R-1),B=P(M,R-1);T.set(D,B)}),a(O,l)&&O.forEach(function(M){var k=P(M,R-1);T.add(k)});for(var F in O){var H;C&&(H=Object.getOwnPropertyDescriptor(C,F)),!(H&&H.set==null)&&(T[F]=P(O[F],R-1))}if(Object.getOwnPropertySymbols)for(var z=Object.getOwnPropertySymbols(O),F=0;F<z.length;F++){var Y=z[F],G=Object.getOwnPropertyDescriptor(O,Y);G&&!G.enumerable&&!d||(T[Y]=P(O[Y],R-1),G.enumerable||Object.defineProperty(T,Y,{enumerable:!1}))}if(d)for(var W=Object.getOwnPropertyNames(O),F=0;F<W.length;F++){var j=W[F],G=Object.getOwnPropertyDescriptor(O,j);G&&G.enumerable||(T[j]=P(O[j],R-1),Object.defineProperty(T,j,{enumerable:!1}))}return T}return P(E,_)}f.clonePrototype=function(S){if(S===null)return null;var _=function(){};return _.prototype=S,new _};function y(E){return Object.prototype.toString.call(E)}f.__objToStr=y;function b(E){return typeof E=="object"&&y(E)==="[object Date]"}f.__isDate=b;function v(E){return typeof E=="object"&&y(E)==="[object Array]"}f.__isArray=v;function h(E){return typeof E=="object"&&y(E)==="[object RegExp]"}f.__isRegExp=h;function w(E){var S="";return E.global&&(S+="g"),E.ignoreCase&&(S+="i"),E.multiline&&(S+="m"),S}return f.__getRegExpFlags=w,f}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function T(C,N){var F=[],H=!0,z=!1,Y=void 0;try{for(var G=C[Symbol.iterator](),W;!(H=(W=G.next()).done)&&(F.push(W.value),!(N&&F.length===N));H=!0);}catch(j){z=!0,Y=j}finally{try{!H&&G.return&&G.return()}finally{if(z)throw Y}}return F}return function(C,N){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return T(C,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function T(C,N){for(var F=0;F<N.length;F++){var H=N[F];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(C,H.key,H)}}return function(C,N,F){return N&&T(C.prototype,N),F&&T(C,F),C}}(),l=function T(C,N,F){C===null&&(C=Function.prototype);var H=Object.getOwnPropertyDescriptor(C,N);if(H===void 0){var z=Object.getPrototypeOf(C);return z===null?void 0:T(z,N,F)}else{if("value"in H)return H.value;var Y=H.get;return Y===void 0?void 0:Y.call(F)}},u=i(0),f=g(u),y=i(8),b=g(y),v=i(4),h=g(v),w=i(16),E=g(w),S=i(13),_=g(S),p=i(25),d=g(p);function g(T){return T&&T.__esModule?T:{default:T}}function m(T,C){if(!(T instanceof C))throw new TypeError("Cannot call a class as a function")}function x(T,C){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:T}function P(T,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);T.prototype=Object.create(C&&C.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(T,C):T.__proto__=C)}function O(T){return T instanceof h.default||T instanceof v.BlockEmbed}var R=function(T){P(C,T);function C(N,F){m(this,C);var H=x(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,N));return H.emitter=F.emitter,Array.isArray(F.whitelist)&&(H.whitelist=F.whitelist.reduce(function(z,Y){return z[Y]=!0,z},{})),H.domNode.addEventListener("DOMNodeInserted",function(){}),H.optimize(),H.enable(),H}return o(C,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(F,H){var z=this.line(F),Y=a(z,2),G=Y[0],W=Y[1],j=this.line(F+H),M=a(j,1),k=M[0];if(l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"deleteAt",this).call(this,F,H),k!=null&&G!==k&&W>0){if(G instanceof v.BlockEmbed||k instanceof v.BlockEmbed){this.optimize();return}if(G instanceof _.default){var D=G.newlineIndex(G.length(),!0);if(D>-1&&(G=G.split(D+1),G===k)){this.optimize();return}}else if(k instanceof _.default){var B=k.newlineIndex(0);B>-1&&k.split(B+1)}var q=k.children.head instanceof E.default?null:k.children.head;G.moveChildren(k,q),G.remove()}this.optimize()}},{key:"enable",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",F)}},{key:"formatAt",value:function(F,H,z,Y){this.whitelist!=null&&!this.whitelist[z]||(l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"formatAt",this).call(this,F,H,z,Y),this.optimize())}},{key:"insertAt",value:function(F,H,z){if(!(z!=null&&this.whitelist!=null&&!this.whitelist[H])){if(F>=this.length())if(z==null||f.default.query(H,f.default.Scope.BLOCK)==null){var Y=f.default.create(this.statics.defaultChild);this.appendChild(Y),z==null&&H.endsWith(`
123
+ `)&&(H=H.slice(0,-1)),Y.insertAt(0,H,z)}else{var G=f.default.create(H,z);this.appendChild(G)}else l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,F,H,z);this.optimize()}}},{key:"insertBefore",value:function(F,H){if(F.statics.scope===f.default.Scope.INLINE_BLOT){var z=f.default.create(this.statics.defaultChild);z.appendChild(F),F=z}l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertBefore",this).call(this,F,H)}},{key:"leaf",value:function(F){return this.path(F).pop()||[null,-1]}},{key:"line",value:function(F){return F===this.length()?this.line(F-1):this.descendant(O,F)}},{key:"lines",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,z=function Y(G,W,j){var M=[],k=j;return G.children.forEachAt(W,j,function(D,B,q){O(D)?M.push(D):D instanceof f.default.Container&&(M=M.concat(Y(D,B,k))),k-=q}),M};return z(this,F,H)}},{key:"optimize",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"optimize",this).call(this,F,H),F.length>0&&this.emitter.emit(b.default.events.SCROLL_OPTIMIZE,F,H))}},{key:"path",value:function(F){return l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"path",this).call(this,F).slice(1)}},{key:"update",value:function(F){if(this.batch!==!0){var H=b.default.sources.USER;typeof F=="string"&&(H=F),Array.isArray(F)||(F=this.observer.takeRecords()),F.length>0&&this.emitter.emit(b.default.events.SCROLL_BEFORE_UPDATE,H,F),l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"update",this).call(this,F.concat([])),F.length>0&&this.emitter.emit(b.default.events.SCROLL_UPDATE,H,F)}}}]),C}(f.default.Scroll);R.blotName="scroll",R.className="ql-editor",R.tagName="DIV",R.defaultChild="block",R.allowedChildren=[h.default,v.BlockEmbed,d.default],n.default=R},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($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},o=function(){function $(U,X){var Q=[],ee=!0,Z=!1,ne=void 0;try{for(var ie=U[Symbol.iterator](),pe;!(ee=(pe=ie.next()).done)&&(Q.push(pe.value),!(X&&Q.length===X));ee=!0);}catch(we){Z=!0,ne=we}finally{try{!ee&&ie.return&&ie.return()}finally{if(Z)throw ne}}return Q}return function(U,X){if(Array.isArray(U))return U;if(Symbol.iterator in Object(U))return $(U,X);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function $(U,X){for(var Q=0;Q<X.length;Q++){var ee=X[Q];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(U,ee.key,ee)}}return function(U,X,Q){return X&&$(U.prototype,X),Q&&$(U,Q),U}}(),u=i(21),f=T(u),y=i(11),b=T(y),v=i(3),h=T(v),w=i(2),E=T(w),S=i(20),_=T(S),p=i(0),d=T(p),g=i(5),m=T(g),x=i(10),P=T(x),O=i(9),R=T(O);function T($){return $&&$.__esModule?$:{default:$}}function C($,U,X){return U in $?Object.defineProperty($,U,{value:X,enumerable:!0,configurable:!0,writable:!0}):$[U]=X,$}function N($,U){if(!($ instanceof U))throw new TypeError("Cannot call a class as a function")}function F($,U){if(!$)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:$}function H($,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);$.prototype=Object.create(U&&U.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf($,U):$.__proto__=U)}var z=(0,P.default)("quill:keyboard"),Y=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",G=function($){H(U,$),l(U,null,[{key:"match",value:function(Q,ee){return ee=K(ee),["altKey","ctrlKey","metaKey","shiftKey"].some(function(Z){return!!ee[Z]!==Q[Z]&&ee[Z]!==null})?!1:ee.key===(Q.which||Q.keyCode)}}]);function U(X,Q){N(this,U);var ee=F(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,X,Q));return ee.bindings={},Object.keys(ee.options.bindings).forEach(function(Z){Z==="list autofill"&&X.scroll.whitelist!=null&&!X.scroll.whitelist.list||ee.options.bindings[Z]&&ee.addBinding(ee.options.bindings[Z])}),ee.addBinding({key:U.keys.ENTER,shiftKey:null},D),ee.addBinding({key:U.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ee.addBinding({key:U.keys.BACKSPACE},{collapsed:!0},j),ee.addBinding({key:U.keys.DELETE},{collapsed:!0},M)):(ee.addBinding({key:U.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},j),ee.addBinding({key:U.keys.DELETE},{collapsed:!0,suffix:/^.?$/},M)),ee.addBinding({key:U.keys.BACKSPACE},{collapsed:!1},k),ee.addBinding({key:U.keys.DELETE},{collapsed:!1},k),ee.addBinding({key:U.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},j),ee.listen(),ee}return l(U,[{key:"addBinding",value:function(Q){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ne=K(Q);if(ne==null||ne.key==null)return z.warn("Attempted to add invalid keyboard binding",ne);typeof ee=="function"&&(ee={handler:ee}),typeof Z=="function"&&(Z={handler:Z}),ne=(0,h.default)(ne,ee,Z),this.bindings[ne.key]=this.bindings[ne.key]||[],this.bindings[ne.key].push(ne)}},{key:"listen",value:function(){var Q=this;this.quill.root.addEventListener("keydown",function(ee){if(!ee.defaultPrevented){var Z=ee.which||ee.keyCode,ne=(Q.bindings[Z]||[]).filter(function(Be){return U.match(ee,Be)});if(ne.length!==0){var ie=Q.quill.getSelection();if(!(ie==null||!Q.quill.hasFocus())){var pe=Q.quill.getLine(ie.index),we=o(pe,2),Re=we[0],xe=we[1],le=Q.quill.getLeaf(ie.index),ce=o(le,2),be=ce[0],_e=ce[1],te=ie.length===0?[be,_e]:Q.quill.getLeaf(ie.index+ie.length),fe=o(te,2),ue=fe[0],me=fe[1],Ne=be instanceof d.default.Text?be.value().slice(0,_e):"",Xe=ue instanceof d.default.Text?ue.value().slice(me):"",Ye={collapsed:ie.length===0,empty:ie.length===0&&Re.length()<=1,format:Q.quill.getFormat(ie),offset:xe,prefix:Ne,suffix:Xe},Te=ne.some(function(Be){if(Be.collapsed!=null&&Be.collapsed!==Ye.collapsed||Be.empty!=null&&Be.empty!==Ye.empty||Be.offset!=null&&Be.offset!==Ye.offset)return!1;if(Array.isArray(Be.format)){if(Be.format.every(function(Ze){return Ye.format[Ze]==null}))return!1}else if(a(Be.format)==="object"&&!Object.keys(Be.format).every(function(Ze){return Be.format[Ze]===!0?Ye.format[Ze]!=null:Be.format[Ze]===!1?Ye.format[Ze]==null:(0,b.default)(Be.format[Ze],Ye.format[Ze])}))return!1;return Be.prefix!=null&&!Be.prefix.test(Ye.prefix)||Be.suffix!=null&&!Be.suffix.test(Ye.suffix)?!1:Be.handler.call(Q,ie,Ye)!==!0});Te&&ee.preventDefault()}}}})}}]),U}(R.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:q("bold"),italic:q("italic"),underline:q("underline"),indent:{key:G.keys.TAB,format:["blockquote","indent","list"],handler:function(U,X){if(X.collapsed&&X.offset!==0)return!0;this.quill.format("indent","+1",m.default.sources.USER)}},outdent:{key:G.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(U,X){if(X.collapsed&&X.offset!==0)return!0;this.quill.format("indent","-1",m.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(U,X){X.format.indent!=null?this.quill.format("indent","-1",m.default.sources.USER):X.format.list!=null&&this.quill.format("list",!1,m.default.sources.USER)}},"indent code-block":B(!0),"outdent code-block":B(!1),"remove tab":{key:G.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(U){this.quill.deleteText(U.index-1,1,m.default.sources.USER)}},tab:{key:G.keys.TAB,handler:function(U){this.quill.history.cutoff();var X=new E.default().retain(U.index).delete(U.length).insert(" ");this.quill.updateContents(X,m.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(U.index+1,m.default.sources.SILENT)}},"list empty enter":{key:G.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(U,X){this.quill.format("list",!1,m.default.sources.USER),X.format.indent&&this.quill.format("indent",!1,m.default.sources.USER)}},"checklist enter":{key:G.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(U){var X=this.quill.getLine(U.index),Q=o(X,2),ee=Q[0],Z=Q[1],ne=(0,h.default)({},ee.formats(),{list:"checked"}),ie=new E.default().retain(U.index).insert(`
124
+ `,ne).retain(ee.length()-Z-1).retain(1,{list:"unchecked"});this.quill.updateContents(ie,m.default.sources.USER),this.quill.setSelection(U.index+1,m.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:G.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(U,X){var Q=this.quill.getLine(U.index),ee=o(Q,2),Z=ee[0],ne=ee[1],ie=new E.default().retain(U.index).insert(`
125
+ `,X.format).retain(Z.length()-ne-1).retain(1,{header:null});this.quill.updateContents(ie,m.default.sources.USER),this.quill.setSelection(U.index+1,m.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(U,X){var Q=X.prefix.length,ee=this.quill.getLine(U.index),Z=o(ee,2),ne=Z[0],ie=Z[1];if(ie>Q)return!0;var pe=void 0;switch(X.prefix.trim()){case"[]":case"[ ]":pe="unchecked";break;case"[x]":pe="checked";break;case"-":case"*":pe="bullet";break;default:pe="ordered"}this.quill.insertText(U.index," ",m.default.sources.USER),this.quill.history.cutoff();var we=new E.default().retain(U.index-ie).delete(Q+1).retain(ne.length()-2-ie).retain(1,{list:pe});this.quill.updateContents(we,m.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(U.index-Q,m.default.sources.SILENT)}},"code exit":{key:G.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(U){var X=this.quill.getLine(U.index),Q=o(X,2),ee=Q[0],Z=Q[1],ne=new E.default().retain(U.index+ee.length()-Z-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(ne,m.default.sources.USER)}},"embed left":W(G.keys.LEFT,!1),"embed left shift":W(G.keys.LEFT,!0),"embed right":W(G.keys.RIGHT,!1),"embed right shift":W(G.keys.RIGHT,!0)}};function W($,U){var X,Q=$===G.keys.LEFT?"prefix":"suffix";return X={key:$,shiftKey:U,altKey:null},C(X,Q,/^$/),C(X,"handler",function(Z){var ne=Z.index;$===G.keys.RIGHT&&(ne+=Z.length+1);var ie=this.quill.getLeaf(ne),pe=o(ie,1),we=pe[0];return we instanceof d.default.Embed?($===G.keys.LEFT?U?this.quill.setSelection(Z.index-1,Z.length+1,m.default.sources.USER):this.quill.setSelection(Z.index-1,m.default.sources.USER):U?this.quill.setSelection(Z.index,Z.length+1,m.default.sources.USER):this.quill.setSelection(Z.index+Z.length+1,m.default.sources.USER),!1):!0}),X}function j($,U){if(!($.index===0||this.quill.getLength()<=1)){var X=this.quill.getLine($.index),Q=o(X,1),ee=Q[0],Z={};if(U.offset===0){var ne=this.quill.getLine($.index-1),ie=o(ne,1),pe=ie[0];if(pe!=null&&pe.length()>1){var we=ee.formats(),Re=this.quill.getFormat($.index-1,1);Z=_.default.attributes.diff(we,Re)||{}}}var xe=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(U.prefix)?2:1;this.quill.deleteText($.index-xe,xe,m.default.sources.USER),Object.keys(Z).length>0&&this.quill.formatLine($.index-xe,xe,Z,m.default.sources.USER),this.quill.focus()}}function M($,U){var X=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(U.suffix)?2:1;if(!($.index>=this.quill.getLength()-X)){var Q={},ee=0,Z=this.quill.getLine($.index),ne=o(Z,1),ie=ne[0];if(U.offset>=ie.length()-1){var pe=this.quill.getLine($.index+1),we=o(pe,1),Re=we[0];if(Re){var xe=ie.formats(),le=this.quill.getFormat($.index,1);Q=_.default.attributes.diff(xe,le)||{},ee=Re.length()}}this.quill.deleteText($.index,X,m.default.sources.USER),Object.keys(Q).length>0&&this.quill.formatLine($.index+ee-1,X,Q,m.default.sources.USER)}}function k($){var U=this.quill.getLines($),X={};if(U.length>1){var Q=U[0].formats(),ee=U[U.length-1].formats();X=_.default.attributes.diff(ee,Q)||{}}this.quill.deleteText($,m.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine($.index,1,X,m.default.sources.USER),this.quill.setSelection($.index,m.default.sources.SILENT),this.quill.focus()}function D($,U){var X=this;$.length>0&&this.quill.scroll.deleteAt($.index,$.length);var Q=Object.keys(U.format).reduce(function(ee,Z){return d.default.query(Z,d.default.Scope.BLOCK)&&!Array.isArray(U.format[Z])&&(ee[Z]=U.format[Z]),ee},{});this.quill.insertText($.index,`
126
+ `,Q,m.default.sources.USER),this.quill.setSelection($.index+1,m.default.sources.SILENT),this.quill.focus(),Object.keys(U.format).forEach(function(ee){Q[ee]==null&&(Array.isArray(U.format[ee])||ee!=="link"&&X.quill.format(ee,U.format[ee],m.default.sources.USER))})}function B($){return{key:G.keys.TAB,shiftKey:!$,format:{"code-block":!0},handler:function(X){var Q=d.default.query("code-block"),ee=X.index,Z=X.length,ne=this.quill.scroll.descendant(Q,ee),ie=o(ne,2),pe=ie[0],we=ie[1];if(pe!=null){var Re=this.quill.getIndex(pe),xe=pe.newlineIndex(we,!0)+1,le=pe.newlineIndex(Re+we+Z),ce=pe.domNode.textContent.slice(xe,le).split(`
127
+ `);we=0,ce.forEach(function(be,_e){$?(pe.insertAt(xe+we,Q.TAB),we+=Q.TAB.length,_e===0?ee+=Q.TAB.length:Z+=Q.TAB.length):be.startsWith(Q.TAB)&&(pe.deleteAt(xe+we,Q.TAB.length),we-=Q.TAB.length,_e===0?ee-=Q.TAB.length:Z-=Q.TAB.length),we+=be.length+1}),this.quill.update(m.default.sources.USER),this.quill.setSelection(ee,Z,m.default.sources.SILENT)}}}}function q($){return{key:$[0].toUpperCase(),shortKey:!0,handler:function(X,Q){this.quill.format($,!Q.format[$],m.default.sources.USER)}}}function K($){if(typeof $=="string"||typeof $=="number")return K({key:$});if((typeof $>"u"?"undefined":a($))==="object"&&($=(0,f.default)($,!1)),typeof $.key=="string")if(G.keys[$.key.toUpperCase()]!=null)$.key=G.keys[$.key.toUpperCase()];else if($.key.length===1)$.key=$.key.toUpperCase().charCodeAt(0);else return null;return $.shortKey&&($[Y]=$.shortKey,delete $.shortKey),$}n.default=G,n.SHORTKEY=Y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function _(p,d){var g=[],m=!0,x=!1,P=void 0;try{for(var O=p[Symbol.iterator](),R;!(m=(R=O.next()).done)&&(g.push(R.value),!(d&&g.length===d));m=!0);}catch(T){x=!0,P=T}finally{try{!m&&O.return&&O.return()}finally{if(x)throw P}}return g}return function(p,d){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return _(p,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function _(p,d,g){p===null&&(p=Function.prototype);var m=Object.getOwnPropertyDescriptor(p,d);if(m===void 0){var x=Object.getPrototypeOf(p);return x===null?void 0:_(x,d,g)}else{if("value"in m)return m.value;var P=m.get;return P===void 0?void 0:P.call(g)}},l=function(){function _(p,d){for(var g=0;g<d.length;g++){var m=d[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(p,m.key,m)}}return function(p,d,g){return d&&_(p.prototype,d),g&&_(p,g),p}}(),u=i(0),f=v(u),y=i(7),b=v(y);function v(_){return _&&_.__esModule?_:{default:_}}function h(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function w(_,p){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:_}function E(_,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);_.prototype=Object.create(p&&p.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(_,p):_.__proto__=p)}var S=function(_){E(p,_),l(p,null,[{key:"value",value:function(){}}]);function p(d,g){h(this,p);var m=w(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,d));return m.selection=g,m.textNode=document.createTextNode(p.CONTENTS),m.domNode.appendChild(m.textNode),m._length=0,m}return l(p,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(g,m){if(this._length!==0)return o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,g,m);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=p.CONTENTS.length,x.optimize(),x.formatAt(P,p.CONTENTS.length,g,m),this._length=0)}},{key:"index",value:function(g,m){return g===this.textNode?0:o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"index",this).call(this,g,m)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var g=this.textNode,m=this.selection.getNativeRange(),x=void 0,P=void 0,O=void 0;if(m!=null&&m.start.node===g&&m.end.node===g){var R=[g,m.start.offset,m.end.offset];x=R[0],P=R[1],O=R[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==p.CONTENTS){var T=this.textNode.data.split(p.CONTENTS).join("");this.next instanceof b.default?(x=this.next.domNode,this.next.insertAt(0,T),this.textNode.data=p.CONTENTS):(this.textNode.data=T,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(p.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),P!=null){var C=[P,O].map(function(F){return Math.max(0,Math.min(x.data.length,F-1))}),N=a(C,2);return P=N[0],O=N[1],{startNode:x,startOffset:P,endNode:x,endOffset:O}}}}},{key:"update",value:function(g,m){var x=this;if(g.some(function(O){return O.type==="characterData"&&O.target===x.textNode})){var P=this.restore();P&&(m.range=P)}}},{key:"value",value:function(){return""}}]),p}(f.default.Embed);S.blotName="cursor",S.className="ql-cursor",S.tagName="span",S.CONTENTS="\uFEFF",n.default=S},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(w){return w&&w.__esModule?w:{default:w}}function y(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function b(w,E){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:w}function v(w,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);w.prototype=Object.create(E&&E.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(w,E):w.__proto__=E)}var h=function(w){v(E,w);function E(){return y(this,E),b(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return E}(o.default.Container);h.allowedChildren=[u.default,l.BlockEmbed,h],n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function S(_,p){for(var d=0;d<p.length;d++){var g=p[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(_,g.key,g)}}return function(_,p,d){return p&&S(_.prototype,p),d&&S(_,d),_}}(),o=function S(_,p,d){_===null&&(_=Function.prototype);var g=Object.getOwnPropertyDescriptor(_,p);if(g===void 0){var m=Object.getPrototypeOf(_);return m===null?void 0:S(m,p,d)}else{if("value"in g)return g.value;var x=g.get;return x===void 0?void 0:x.call(d)}},l=i(0),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function y(S,_){if(!(S instanceof _))throw new TypeError("Cannot call a class as a function")}function b(S,_){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:S}function v(S,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);S.prototype=Object.create(_&&_.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(S,_):S.__proto__=_)}var h=function(S){v(_,S);function _(){return y(this,_),b(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"value",value:function(d){var g=o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"value",this).call(this,d);return g.startsWith("rgb(")?(g=g.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+g.split(",").map(function(m){return("00"+parseInt(m).toString(16)).slice(-2)}).join("")):g}}]),_}(u.default.Attributor.Style),w=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),E=new h("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=h,n.ColorClass=w,n.ColorStyle=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function E(S,_){for(var p=0;p<_.length;p++){var d=_[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(S,d.key,d)}}return function(S,_,p){return _&&E(S.prototype,_),p&&E(S,p),S}}(),o=function E(S,_,p){S===null&&(S=Function.prototype);var d=Object.getOwnPropertyDescriptor(S,_);if(d===void 0){var g=Object.getPrototypeOf(S);return g===null?void 0:E(g,_,p)}else{if("value"in d)return d.value;var m=d.get;return m===void 0?void 0:m.call(p)}},l=i(6),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function y(E,S){if(!(E instanceof S))throw new TypeError("Cannot call a class as a function")}function b(E,S){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:E}function v(E,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);E.prototype=Object.create(S&&S.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(E,S):E.__proto__=S)}var h=function(E){v(S,E);function S(){return y(this,S),b(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,[{key:"format",value:function(p,d){if(p!==this.statics.blotName||!d)return o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"format",this).call(this,p,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(p){var d=o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,p);return p=this.sanitize(p),d.setAttribute("href",p),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("target","_blank"),d}},{key:"formats",value:function(p){return p.getAttribute("href")}},{key:"sanitize",value:function(p){return w(p,this.PROTOCOL_WHITELIST)?p:this.SANITIZED_URL}}]),S}(u.default);h.blotName="link",h.tagName="A",h.SANITIZED_URL="about:blank",h.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function w(E,S){var _=document.createElement("a");_.href=E;var p=_.href.slice(0,_.href.indexOf(":"));return S.indexOf(p)>-1}n.default=h,n.sanitize=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},o=function(){function S(_,p){for(var d=0;d<p.length;d++){var g=p[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(_,g.key,g)}}return function(_,p,d){return p&&S(_.prototype,p),d&&S(_,d),_}}(),l=i(23),u=b(l),f=i(107),y=b(f);function b(S){return S&&S.__esModule?S:{default:S}}function v(S,_){if(!(S instanceof _))throw new TypeError("Cannot call a class as a function")}var h=0;function w(S,_){S.setAttribute(_,S.getAttribute(_)!=="true")}var E=function(){function S(_){var p=this;v(this,S),this.select=_,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(){p.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case u.default.keys.ENTER:p.togglePicker();break;case u.default.keys.ESCAPE:p.escape(),d.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(S,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),w(this.label,"aria-expanded"),w(this.options,"aria-hidden")}},{key:"buildItem",value:function(p){var d=this,g=document.createElement("span");return g.tabIndex="0",g.setAttribute("role","button"),g.classList.add("ql-picker-item"),p.hasAttribute("value")&&g.setAttribute("data-value",p.getAttribute("value")),p.textContent&&g.setAttribute("data-label",p.textContent),g.addEventListener("click",function(){d.selectItem(g,!0)}),g.addEventListener("keydown",function(m){switch(m.keyCode){case u.default.keys.ENTER:d.selectItem(g,!0),m.preventDefault();break;case u.default.keys.ESCAPE:d.escape(),m.preventDefault();break}}),g}},{key:"buildLabel",value:function(){var p=document.createElement("span");return p.classList.add("ql-picker-label"),p.innerHTML=y.default,p.tabIndex="0",p.setAttribute("role","button"),p.setAttribute("aria-expanded","false"),this.container.appendChild(p),p}},{key:"buildOptions",value:function(){var p=this,d=document.createElement("span");d.classList.add("ql-picker-options"),d.setAttribute("aria-hidden","true"),d.tabIndex="-1",d.id="ql-picker-options-"+h,h+=1,this.label.setAttribute("aria-controls",d.id),this.options=d,[].slice.call(this.select.options).forEach(function(g){var m=p.buildItem(g);d.appendChild(m),g.selected===!0&&p.selectItem(m)}),this.container.appendChild(d)}},{key:"buildPicker",value:function(){var p=this;[].slice.call(this.select.attributes).forEach(function(d){p.container.setAttribute(d.name,d.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var p=this;this.close(),setTimeout(function(){return p.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(p){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=this.container.querySelector(".ql-selected");if(p!==g&&(g!=null&&g.classList.remove("ql-selected"),p!=null&&(p.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(p.parentNode.children,p),p.hasAttribute("data-value")?this.label.setAttribute("data-value",p.getAttribute("data-value")):this.label.removeAttribute("data-value"),p.hasAttribute("data-label")?this.label.setAttribute("data-label",p.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 m=document.createEvent("Event");m.initEvent("change",!0,!0),this.select.dispatchEvent(m)}this.close()}}},{key:"update",value:function(){var p=void 0;if(this.select.selectedIndex>-1){var d=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];p=this.select.options[this.select.selectedIndex],this.selectItem(d)}else this.selectItem(null);var g=p!=null&&p!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",g)}}]),S}();n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=z(a),l=i(5),u=z(l),f=i(4),y=z(f),b=i(16),v=z(b),h=i(25),w=z(h),E=i(24),S=z(E),_=i(35),p=z(_),d=i(6),g=z(d),m=i(22),x=z(m),P=i(7),O=z(P),R=i(55),T=z(R),C=i(42),N=z(C),F=i(23),H=z(F);function z(Y){return Y&&Y.__esModule?Y:{default:Y}}u.default.register({"blots/block":y.default,"blots/block/embed":f.BlockEmbed,"blots/break":v.default,"blots/container":w.default,"blots/cursor":S.default,"blots/embed":p.default,"blots/inline":g.default,"blots/scroll":x.default,"blots/text":O.default,"modules/clipboard":T.default,"modules/history":N.default,"modules/keyboard":H.default}),o.default.register(y.default,v.default,S.default,g.default,x.default,O.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 y=this.isolate(u,f);y.remove()},l.prototype.formatAt=function(u,f,y,b){var v=this.isolate(u,f);if(a.query(y,a.Scope.BLOT)!=null&&b)v.wrap(y,b);else if(a.query(y,a.Scope.ATTRIBUTE)!=null){var h=a.create(this.statics.scope);v.wrap(h),h.format(y,b)}},l.prototype.insertAt=function(u,f,y){var b=y==null?a.create("text",f):a.create(f,y),v=this.split(u);this.parent.insertBefore(b,v)},l.prototype.insertInto=function(u,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var y=null;u.children.insertBefore(this,f),f!=null&&(y=f.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=y)&&u.domNode.insertBefore(this.domNode,y),this.parent=u,this.attach()},l.prototype.isolate=function(u,f){var y=this.split(u);return y.split(f),y},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 y=typeof u=="string"?a.create(u,f):u;return y.replace(this),y},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 y=typeof u=="string"?a.create(u,f):u;return this.parent!=null&&this.parent.insertBefore(y,this.next),y.appendChild(this),y},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 y(b){this.attributes={},this.domNode=b,this.build()}return y.prototype.attribute=function(b,v){v?b.add(this.domNode,v)&&(b.value(this.domNode)!=null?this.attributes[b.attrName]=b:delete this.attributes[b.attrName]):(b.remove(this.domNode),delete this.attributes[b.attrName])},y.prototype.build=function(){var b=this;this.attributes={};var v=a.default.keys(this.domNode),h=o.default.keys(this.domNode),w=l.default.keys(this.domNode);v.concat(h).concat(w).forEach(function(E){var S=u.query(E,u.Scope.ATTRIBUTE);S instanceof a.default&&(b.attributes[S.attrName]=S)})},y.prototype.copy=function(b){var v=this;Object.keys(this.attributes).forEach(function(h){var w=v.attributes[h].value(v.domNode);b.format(h,w)})},y.prototype.move=function(b){var v=this;this.copy(b),Object.keys(this.attributes).forEach(function(h){v.attributes[h].remove(v.domNode)}),this.attributes={}},y.prototype.values=function(){var b=this;return Object.keys(this.attributes).reduce(function(v,h){return v[h]=b.attributes[h].value(b.domNode),v},{})},y}();n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,b){y.__proto__=b}||function(y,b){for(var v in b)b.hasOwnProperty(v)&&(y[v]=b[v])};return function(y,b){f(y,b);function v(){this.constructor=y}y.prototype=b===null?Object.create(b):(v.prototype=b.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f,y){var b=f.getAttribute("class")||"";return b.split(/\s+/).filter(function(v){return v.indexOf(y+"-")===0})}var u=function(f){a(y,f);function y(){return f!==null&&f.apply(this,arguments)||this}return y.keys=function(b){return(b.getAttribute("class")||"").split(/\s+/).map(function(v){return v.split("-").slice(0,-1).join("-")})},y.prototype.add=function(b,v){return this.canAdd(b,v)?(this.remove(b),b.classList.add(this.keyName+"-"+v),!0):!1},y.prototype.remove=function(b){var v=l(b,this.keyName);v.forEach(function(h){b.classList.remove(h)}),b.classList.length===0&&b.removeAttribute("class")},y.prototype.value=function(b){var v=l(b,this.keyName)[0]||"",h=v.slice(this.keyName.length+1);return this.canAdd(b,h)?h:""},y}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,b){y.__proto__=b}||function(y,b){for(var v in b)b.hasOwnProperty(v)&&(y[v]=b[v])};return function(y,b){f(y,b);function v(){this.constructor=y}y.prototype=b===null?Object.create(b):(v.prototype=b.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f){var y=f.split("-"),b=y.slice(1).map(function(v){return v[0].toUpperCase()+v.slice(1)}).join("");return y[0]+b}var u=function(f){a(y,f);function y(){return f!==null&&f.apply(this,arguments)||this}return y.keys=function(b){return(b.getAttribute("style")||"").split(";").map(function(v){var h=v.split(":");return h[0].trim()})},y.prototype.add=function(b,v){return this.canAdd(b,v)?(b.style[l(this.keyName)]=v,!0):!1},y.prototype.remove=function(b){b.style[l(this.keyName)]="",b.getAttribute("style")||b.removeAttribute("style")},y.prototype.value=function(b){var v=b.style[l(this.keyName)];return this.canAdd(b,v)?v:""},y}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,y){for(var b=0;b<y.length;b++){var v=y[b];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}return function(f,y,b){return y&&u(f.prototype,y),b&&u(f,b),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,y){o(this,u),this.quill=f,this.options=y,this.modules={}}return a(u,[{key:"init",value:function(){var y=this;Object.keys(this.options.modules).forEach(function(b){y.modules[b]==null&&y.addModule(b)})}},{key:"addModule",value:function(y){var b=this.quill.constructor.import("modules/"+y);return this.modules[y]=new b(this.quill,this.options.modules[y]||{}),this.modules[y]}}]),u}();l.DEFAULTS={modules:{}},l.themes={default:l},n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function _(p,d){for(var g=0;g<d.length;g++){var m=d[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(p,m.key,m)}}return function(p,d,g){return d&&_(p.prototype,d),g&&_(p,g),p}}(),o=function _(p,d,g){p===null&&(p=Function.prototype);var m=Object.getOwnPropertyDescriptor(p,d);if(m===void 0){var x=Object.getPrototypeOf(p);return x===null?void 0:_(x,d,g)}else{if("value"in m)return m.value;var P=m.get;return P===void 0?void 0:P.call(g)}},l=i(0),u=b(l),f=i(7),y=b(f);function b(_){return _&&_.__esModule?_:{default:_}}function v(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function h(_,p){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:_}function w(_,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);_.prototype=Object.create(p&&p.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(_,p):_.__proto__=p)}var E="\uFEFF",S=function(_){w(p,_);function p(d){v(this,p);var g=h(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,d));return g.contentNode=document.createElement("span"),g.contentNode.setAttribute("contenteditable",!1),[].slice.call(g.domNode.childNodes).forEach(function(m){g.contentNode.appendChild(m)}),g.leftGuard=document.createTextNode(E),g.rightGuard=document.createTextNode(E),g.domNode.appendChild(g.leftGuard),g.domNode.appendChild(g.contentNode),g.domNode.appendChild(g.rightGuard),g}return a(p,[{key:"index",value:function(g,m){return g===this.leftGuard?0:g===this.rightGuard?1:o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"index",this).call(this,g,m)}},{key:"restore",value:function(g){var m=void 0,x=void 0,P=g.data.split(E).join("");if(g===this.leftGuard)if(this.prev instanceof y.default){var O=this.prev.length();this.prev.insertAt(O,P),m={startNode:this.prev.domNode,startOffset:O+P.length}}else x=document.createTextNode(P),this.parent.insertBefore(u.default.create(x),this),m={startNode:x,startOffset:P.length};else g===this.rightGuard&&(this.next instanceof y.default?(this.next.insertAt(0,P),m={startNode:this.next.domNode,startOffset:P.length}):(x=document.createTextNode(P),this.parent.insertBefore(u.default.create(x),this.next),m={startNode:x,startOffset:P.length}));return g.data=E,m}},{key:"update",value:function(g,m){var x=this;g.forEach(function(P){if(P.type==="characterData"&&(P.target===x.leftGuard||P.target===x.rightGuard)){var O=x.restore(P.target);O&&(m.range=O)}})}}]),p}(u.default.Embed);n.default=S},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(v){return v&&v.__esModule?v:{default:v}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new o.default.Attributor.Attribute("align","align",u),y=new o.default.Attributor.Class("align","ql-align",u),b=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=f,n.AlignClass=y,n.AlignStyle=b},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(b){return b&&b.__esModule?b:{default:b}}var f=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),y=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=y},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(v){return v&&v.__esModule?v:{default:v}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},f=new o.default.Attributor.Attribute("direction","dir",u),y=new o.default.Attributor.Class("direction","ql-direction",u),b=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=f,n.DirectionClass=y,n.DirectionStyle=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function _(p,d){for(var g=0;g<d.length;g++){var m=d[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(p,m.key,m)}}return function(p,d,g){return d&&_(p.prototype,d),g&&_(p,g),p}}(),o=function _(p,d,g){p===null&&(p=Function.prototype);var m=Object.getOwnPropertyDescriptor(p,d);if(m===void 0){var x=Object.getPrototypeOf(p);return x===null?void 0:_(x,d,g)}else{if("value"in m)return m.value;var P=m.get;return P===void 0?void 0:P.call(g)}},l=i(0),u=f(l);function f(_){return _&&_.__esModule?_:{default:_}}function y(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function b(_,p){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:_}function v(_,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);_.prototype=Object.create(p&&p.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(_,p):_.__proto__=p)}var h={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},w=new u.default.Attributor.Class("font","ql-font",h),E=function(_){v(p,_);function p(){return y(this,p),b(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"value",value:function(g){return o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"value",this).call(this,g).replace(/["']/g,"")}}]),p}(u.default.Attributor.Style),S=new E("font","font-family",h);n.FontStyle=S,n.FontClass=w},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(y){return y&&y.__esModule?y:{default:y}}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(g,m){for(var x=0;x<m.length;x++){var P=m[x];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(g,P.key,P)}}return function(g,m,x){return m&&d(g.prototype,m),x&&d(g,x),g}}(),o=i(0),l=v(o),u=i(5),f=v(u),y=i(9),b=v(y);function v(d){return d&&d.__esModule?d:{default:d}}function h(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")}function w(d,g){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:d}function E(d,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);d.prototype=Object.create(g&&g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(d,g):d.__proto__=g)}var S=function(d){E(g,d);function g(m,x){h(this,g);var P=w(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,m,x));return P.lastRecorded=0,P.ignoreChange=!1,P.clear(),P.quill.on(f.default.events.EDITOR_CHANGE,function(O,R,T,C){O!==f.default.events.TEXT_CHANGE||P.ignoreChange||(!P.options.userOnly||C===f.default.sources.USER?P.record(R,T):P.transform(R))}),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(g,[{key:"change",value:function(x,P){if(this.stack[x].length!==0){var O=this.stack[x].pop();this.stack[P].push(O),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(O[x],f.default.sources.USER),this.ignoreChange=!1;var R=p(O[x]);this.quill.setSelection(R)}}},{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 O=this.quill.getContents().diff(P),R=Date.now();if(this.lastRecorded+this.options.delay>R&&this.stack.undo.length>0){var T=this.stack.undo.pop();O=O.compose(T.undo),x=T.redo.compose(x)}else this.lastRecorded=R;this.stack.undo.push({redo:x,undo:O}),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")}}]),g}(b.default);S.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function _(d){var g=d.ops[d.ops.length-1];return g==null?!1:g.insert!=null?typeof g.insert=="string"&&g.insert.endsWith(`
128
+ `):g.attributes!=null?Object.keys(g.attributes).some(function(m){return l.default.query(m,l.default.Scope.BLOCK)!=null}):!1}function p(d){var g=d.reduce(function(x,P){return x+=P.delete||0,x},0),m=d.length()-g;return _(d)&&(m-=1),m}n.default=S,n.getLastChangeIndex=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function D(B,q){for(var K=0;K<q.length;K++){var $=q[K];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(B,$.key,$)}}return function(B,q,K){return q&&D(B.prototype,q),K&&D(B,K),B}}(),o=function D(B,q,K){B===null&&(B=Function.prototype);var $=Object.getOwnPropertyDescriptor(B,q);if($===void 0){var U=Object.getPrototypeOf(B);return U===null?void 0:D(U,q,K)}else{if("value"in $)return $.value;var X=$.get;return X===void 0?void 0:X.call(K)}},l=i(3),u=R(l),f=i(2),y=R(f),b=i(8),v=R(b),h=i(23),w=R(h),E=i(34),S=R(E),_=i(59),p=R(_),d=i(60),g=R(d),m=i(28),x=R(m),P=i(61),O=R(P);function R(D){return D&&D.__esModule?D:{default:D}}function T(D,B){if(!(D instanceof B))throw new TypeError("Cannot call a class as a function")}function C(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 N(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 F=[!1,"center","right","justify"],H=["#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"],z=[!1,"serif","monospace"],Y=["1","2","3",!1],G=["small",!1,"large","huge"],W=function(D){N(B,D);function B(q,K){T(this,B);var $=C(this,(B.__proto__||Object.getPrototypeOf(B)).call(this,q,K)),U=function X(Q){if(!document.body.contains(q.root))return document.body.removeEventListener("click",X);$.tooltip!=null&&!$.tooltip.root.contains(Q.target)&&document.activeElement!==$.tooltip.textbox&&!$.quill.hasFocus()&&$.tooltip.hide(),$.pickers!=null&&$.pickers.forEach(function(ee){ee.container.contains(Q.target)||ee.close()})};return q.emitter.listenDOM("click",document.body,U),$}return a(B,[{key:"addModule",value:function(K){var $=o(B.prototype.__proto__||Object.getPrototypeOf(B.prototype),"addModule",this).call(this,K);return K==="toolbar"&&this.extendToolbar($),$}},{key:"buildButtons",value:function(K,$){K.forEach(function(U){var X=U.getAttribute("class")||"";X.split(/\s+/).forEach(function(Q){if(Q.startsWith("ql-")&&(Q=Q.slice(3),$[Q]!=null))if(Q==="direction")U.innerHTML=$[Q][""]+$[Q].rtl;else if(typeof $[Q]=="string")U.innerHTML=$[Q];else{var ee=U.value||"";ee!=null&&$[Q][ee]&&(U.innerHTML=$[Q][ee])}})})}},{key:"buildPickers",value:function(K,$){var U=this;this.pickers=K.map(function(Q){if(Q.classList.contains("ql-align"))return Q.querySelector("option")==null&&k(Q,F),new g.default(Q,$.align);if(Q.classList.contains("ql-background")||Q.classList.contains("ql-color")){var ee=Q.classList.contains("ql-background")?"background":"color";return Q.querySelector("option")==null&&k(Q,H,ee==="background"?"#ffffff":"#000000"),new p.default(Q,$[ee])}else return Q.querySelector("option")==null&&(Q.classList.contains("ql-font")?k(Q,z):Q.classList.contains("ql-header")?k(Q,Y):Q.classList.contains("ql-size")&&k(Q,G)),new x.default(Q)});var X=function(){U.pickers.forEach(function(ee){ee.update()})};this.quill.on(v.default.events.EDITOR_CHANGE,X)}}]),B}(S.default);W.DEFAULTS=(0,u.default)(!0,{},S.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var B=this,q=this.container.querySelector("input.ql-image[type=file]");q==null&&(q=document.createElement("input"),q.setAttribute("type","file"),q.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),q.classList.add("ql-image"),q.addEventListener("change",function(){if(q.files!=null&&q.files[0]!=null){var K=new FileReader;K.onload=function($){var U=B.quill.getSelection(!0);B.quill.updateContents(new y.default().retain(U.index).delete(U.length).insert({image:$.target.result}),v.default.sources.USER),B.quill.setSelection(U.index+1,v.default.sources.SILENT),q.value=""},K.readAsDataURL(q.files[0])}}),this.container.appendChild(q)),q.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var j=function(D){N(B,D);function B(q,K){T(this,B);var $=C(this,(B.__proto__||Object.getPrototypeOf(B)).call(this,q,K));return $.textbox=$.root.querySelector('input[type="text"]'),$.listen(),$}return a(B,[{key:"listen",value:function(){var K=this;this.textbox.addEventListener("keydown",function($){w.default.match($,"enter")?(K.save(),$.preventDefault()):w.default.match($,"escape")&&(K.cancel(),$.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),$!=null?this.textbox.value=$: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 $=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",K,v.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",K,v.default.sources.USER)),this.quill.root.scrollTop=$;break}case"video":K=M(K);case"formula":{if(!K)break;var U=this.quill.getSelection(!0);if(U!=null){var X=U.index+U.length;this.quill.insertEmbed(X,this.root.getAttribute("data-mode"),K,v.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(X+1," ",v.default.sources.USER),this.quill.setSelection(X+2,v.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),B}(O.default);function M(D){var B=D.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||D.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return B?(B[1]||"https")+"://www.youtube.com/embed/"+B[2]+"?showinfo=0":(B=D.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(B[1]||"https")+"://player.vimeo.com/video/"+B[2]+"/":D}function k(D,B){var q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;B.forEach(function(K){var $=document.createElement("option");K===q?$.setAttribute("selected","selected"):$.setAttribute("value",K),D.appendChild($)})}n.BaseTooltip=j,n.default=W},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,y=this.iterator();f=y();){var b=f.length();if(l<b||u&&l===b&&(f.next==null||f.next.length()!==0))return[f,l];l-=b}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 y=this.find(l),b=y[0],v=y[1],h,w=l-v,E=this.iterator(b);(h=E())&&w<l+u;){var S=h.length();l>w?f(h,l-w,Math.min(u,w+S-l)):f(h,0,Math.min(S,l+u-w)),w+=S}},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,y=this.iterator();f=y();)u=l(u,f);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,h){v.__proto__=h}||function(v,h){for(var w in h)h.hasOwnProperty(w)&&(v[w]=h[w])};return function(v,h){b(v,h);function w(){this.constructor=v}v.prototype=h===null?Object.create(h):(w.prototype=h.prototype,new w)}}();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,y=function(b){a(v,b);function v(h){var w=b.call(this,h)||this;return w.scroll=w,w.observer=new MutationObserver(function(E){w.update(E)}),w.observer.observe(w.domNode,u),w.attach(),w}return v.prototype.detach=function(){b.prototype.detach.call(this),this.observer.disconnect()},v.prototype.deleteAt=function(h,w){this.update(),h===0&&w===this.length()?this.children.forEach(function(E){E.remove()}):b.prototype.deleteAt.call(this,h,w)},v.prototype.formatAt=function(h,w,E,S){this.update(),b.prototype.formatAt.call(this,h,w,E,S)},v.prototype.insertAt=function(h,w,E){this.update(),b.prototype.insertAt.call(this,h,w,E)},v.prototype.optimize=function(h,w){var E=this;h===void 0&&(h=[]),w===void 0&&(w={}),b.prototype.optimize.call(this,w);for(var S=[].slice.call(this.observer.takeRecords());S.length>0;)h.push(S.pop());for(var _=function(m,x){x===void 0&&(x=!0),!(m==null||m===E)&&m.domNode.parentNode!=null&&(m.domNode[l.DATA_KEY].mutations==null&&(m.domNode[l.DATA_KEY].mutations=[]),x&&_(m.parent))},p=function(m){m.domNode[l.DATA_KEY]==null||m.domNode[l.DATA_KEY].mutations==null||(m instanceof o.default&&m.children.forEach(p),m.optimize(w))},d=h,g=0;d.length>0;g+=1){if(g>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(m){var x=l.find(m.target,!0);x!=null&&(x.domNode===m.target&&(m.type==="childList"?(_(l.find(m.previousSibling,!1)),[].forEach.call(m.addedNodes,function(P){var O=l.find(P,!1);_(O,!1),O instanceof o.default&&O.children.forEach(function(R){_(R,!1)})})):m.type==="attributes"&&_(x.prev)),_(x))}),this.children.forEach(p),d=[].slice.call(this.observer.takeRecords()),S=d.slice();S.length>0;)h.push(S.pop())}},v.prototype.update=function(h,w){var E=this;w===void 0&&(w={}),h=h||this.observer.takeRecords(),h.map(function(S){var _=l.find(S.target,!0);return _==null?null:_.domNode[l.DATA_KEY].mutations==null?(_.domNode[l.DATA_KEY].mutations=[S],_):(_.domNode[l.DATA_KEY].mutations.push(S),null)}).forEach(function(S){S==null||S===E||S.domNode[l.DATA_KEY]==null||S.update(S.domNode[l.DATA_KEY].mutations||[],w)}),this.domNode[l.DATA_KEY].mutations!=null&&b.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,w),this.optimize(h,w)},v.blotName="scroll",v.defaultChild="block",v.scope=l.Scope.BLOCK_BLOT,v.tagName="DIV",v}(o.default);n.default=y},function(r,n,i){var a=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,v){b.__proto__=v}||function(b,v){for(var h in v)v.hasOwnProperty(h)&&(b[h]=v[h])};return function(b,v){y(b,v);function h(){this.constructor=b}b.prototype=v===null?Object.create(v):(h.prototype=v.prototype,new h)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function u(y,b){if(Object.keys(y).length!==Object.keys(b).length)return!1;for(var v in y)if(y[v]!==b[v])return!1;return!0}var f=function(y){a(b,y);function b(){return y!==null&&y.apply(this,arguments)||this}return b.formats=function(v){if(v.tagName!==b.tagName)return y.formats.call(this,v)},b.prototype.format=function(v,h){var w=this;v===this.statics.blotName&&!h?(this.children.forEach(function(E){E instanceof o.default||(E=E.wrap(b.blotName,!0)),w.attributes.copy(E)}),this.unwrap()):y.prototype.format.call(this,v,h)},b.prototype.formatAt=function(v,h,w,E){if(this.formats()[w]!=null||l.query(w,l.Scope.ATTRIBUTE)){var S=this.isolate(v,h);S.format(w,E)}else y.prototype.formatAt.call(this,v,h,w,E)},b.prototype.optimize=function(v){y.prototype.optimize.call(this,v);var h=this.formats();if(Object.keys(h).length===0)return this.unwrap();var w=this.next;w instanceof b&&w.prev===this&&u(h,w.formats())&&(w.moveChildren(this),w.remove())},b.blotName="inline",b.scope=l.Scope.INLINE_BLOT,b.tagName="SPAN",b}(o.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,b){y.__proto__=b}||function(y,b){for(var v in b)b.hasOwnProperty(v)&&(y[v]=b[v])};return function(y,b){f(y,b);function v(){this.constructor=y}y.prototype=b===null?Object.create(b):(v.prototype=b.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1),u=function(f){a(y,f);function y(){return f!==null&&f.apply(this,arguments)||this}return y.formats=function(b){var v=l.query(y.blotName).tagName;if(b.tagName!==v)return f.formats.call(this,b)},y.prototype.format=function(b,v){l.query(b,l.Scope.BLOCK)!=null&&(b===this.statics.blotName&&!v?this.replaceWith(y.blotName):f.prototype.format.call(this,b,v))},y.prototype.formatAt=function(b,v,h,w){l.query(h,l.Scope.BLOCK)!=null?this.format(h,w):f.prototype.formatAt.call(this,b,v,h,w)},y.prototype.insertAt=function(b,v,h){if(h==null||l.query(v,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,b,v,h);else{var w=this.split(b),E=l.create(v,h);w.parent.insertBefore(E,w)}},y.prototype.update=function(b,v){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,b,v)},y.blotName="block",y.scope=l.Scope.BLOCK_BLOT,y.tagName="P",y}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,y){f.__proto__=y}||function(f,y){for(var b in y)y.hasOwnProperty(b)&&(f[b]=y[b])};return function(f,y){u(f,y);function b(){this.constructor=f}f.prototype=y===null?Object.create(y):(b.prototype=y.prototype,new b)}}();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(y){},f.prototype.format=function(y,b){u.prototype.formatAt.call(this,0,this.length(),y,b)},f.prototype.formatAt=function(y,b,v,h){y===0&&b===this.length()?this.format(v,h):u.prototype.formatAt.call(this,y,b,v,h)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f}(o.default);n.default=l},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,b){y.__proto__=b}||function(y,b){for(var v in b)b.hasOwnProperty(v)&&(y[v]=b[v])};return function(y,b){f(y,b);function v(){this.constructor=y}y.prototype=b===null?Object.create(b):(v.prototype=b.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=i(1),u=function(f){a(y,f);function y(b){var v=f.call(this,b)||this;return v.text=v.statics.value(v.domNode),v}return y.create=function(b){return document.createTextNode(b)},y.value=function(b){var v=b.data;return v.normalize&&(v=v.normalize()),v},y.prototype.deleteAt=function(b,v){this.domNode.data=this.text=this.text.slice(0,b)+this.text.slice(b+v)},y.prototype.index=function(b,v){return this.domNode===b?v:-1},y.prototype.insertAt=function(b,v,h){h==null?(this.text=this.text.slice(0,b)+v+this.text.slice(b),this.domNode.data=this.text):f.prototype.insertAt.call(this,b,v,h)},y.prototype.length=function(){return this.text.length},y.prototype.optimize=function(b){f.prototype.optimize.call(this,b),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof y&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},y.prototype.position=function(b,v){return[this.domNode,b]},y.prototype.split=function(b,v){if(v===void 0&&(v=!1),!v){if(b===0)return this;if(b===this.length())return this.next}var h=l.create(this.domNode.splitText(b));return this.parent.insertBefore(h,this.next),this.text=this.statics.value(this.domNode),h},y.prototype.update=function(b,v){var h=this;b.some(function(w){return w.type==="characterData"&&w.target===h.domNode})&&(this.text=this.statics.value(this.domNode))},y.prototype.value=function(){return this.text},y.blotName="text",y.scope=l.Scope.INLINE_BLOT,y}(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 y=f.indexOf(l,u);return y!==-1&&y===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),y=f.length>>>0,b=arguments[1],v,h=0;h<y;h++)if(v=f[h],u.call(b,v,h,f))return v}}),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(g,m,x){if(g==m)return g?[[o,g]]:[];(x<0||g.length<x)&&(x=null);var P=b(g,m),O=g.substring(0,P);g=g.substring(P),m=m.substring(P),P=v(g,m);var R=g.substring(g.length-P);g=g.substring(0,g.length-P),m=m.substring(0,m.length-P);var T=u(g,m);return O&&T.unshift([o,O]),R&&T.push([o,R]),w(T),x!=null&&(T=_(T,x)),T=p(T),T}function u(g,m){var x;if(!g)return[[a,m]];if(!m)return[[i,g]];var P=g.length>m.length?g:m,O=g.length>m.length?m:g,R=P.indexOf(O);if(R!=-1)return x=[[a,P.substring(0,R)],[o,O],[a,P.substring(R+O.length)]],g.length>m.length&&(x[0][0]=x[2][0]=i),x;if(O.length==1)return[[i,g],[a,m]];var T=h(g,m);if(T){var C=T[0],N=T[1],F=T[2],H=T[3],z=T[4],Y=l(C,F),G=l(N,H);return Y.concat([[o,z]],G)}return f(g,m)}function f(g,m){for(var x=g.length,P=m.length,O=Math.ceil((x+P)/2),R=O,T=2*O,C=new Array(T),N=new Array(T),F=0;F<T;F++)C[F]=-1,N[F]=-1;C[R+1]=0,N[R+1]=0;for(var H=x-P,z=H%2!=0,Y=0,G=0,W=0,j=0,M=0;M<O;M++){for(var k=-M+Y;k<=M-G;k+=2){var D=R+k,B;k==-M||k!=M&&C[D-1]<C[D+1]?B=C[D+1]:B=C[D-1]+1;for(var q=B-k;B<x&&q<P&&g.charAt(B)==m.charAt(q);)B++,q++;if(C[D]=B,B>x)G+=2;else if(q>P)Y+=2;else if(z){var K=R+H-k;if(K>=0&&K<T&&N[K]!=-1){var $=x-N[K];if(B>=$)return y(g,m,B,q)}}}for(var U=-M+W;U<=M-j;U+=2){var K=R+U,$;U==-M||U!=M&&N[K-1]<N[K+1]?$=N[K+1]:$=N[K-1]+1;for(var X=$-U;$<x&&X<P&&g.charAt(x-$-1)==m.charAt(P-X-1);)$++,X++;if(N[K]=$,$>x)j+=2;else if(X>P)W+=2;else if(!z){var D=R+H-U;if(D>=0&&D<T&&C[D]!=-1){var B=C[D],q=R+B-D;if($=x-$,B>=$)return y(g,m,B,q)}}}}return[[i,g],[a,m]]}function y(g,m,x,P){var O=g.substring(0,x),R=m.substring(0,P),T=g.substring(x),C=m.substring(P),N=l(O,R),F=l(T,C);return N.concat(F)}function b(g,m){if(!g||!m||g.charAt(0)!=m.charAt(0))return 0;for(var x=0,P=Math.min(g.length,m.length),O=P,R=0;x<O;)g.substring(R,O)==m.substring(R,O)?(x=O,R=x):P=O,O=Math.floor((P-x)/2+x);return O}function v(g,m){if(!g||!m||g.charAt(g.length-1)!=m.charAt(m.length-1))return 0;for(var x=0,P=Math.min(g.length,m.length),O=P,R=0;x<O;)g.substring(g.length-O,g.length-R)==m.substring(m.length-O,m.length-R)?(x=O,R=x):P=O,O=Math.floor((P-x)/2+x);return O}function h(g,m){var x=g.length>m.length?g:m,P=g.length>m.length?m:g;if(x.length<4||P.length*2<x.length)return null;function O(G,W,j){for(var M=G.substring(j,j+Math.floor(G.length/4)),k=-1,D="",B,q,K,$;(k=W.indexOf(M,k+1))!=-1;){var U=b(G.substring(j),W.substring(k)),X=v(G.substring(0,j),W.substring(0,k));D.length<X+U&&(D=W.substring(k-X,k)+W.substring(k,k+U),B=G.substring(0,j-X),q=G.substring(j+U),K=W.substring(0,k-X),$=W.substring(k+U))}return D.length*2>=G.length?[B,q,K,$,D]:null}var R=O(x,P,Math.ceil(x.length/4)),T=O(x,P,Math.ceil(x.length/2)),C;if(!R&&!T)return null;T?R?C=R[4].length>T[4].length?R:T:C=T:C=R;var N,F,H,z;g.length>m.length?(N=C[0],F=C[1],H=C[2],z=C[3]):(H=C[0],z=C[1],N=C[2],F=C[3]);var Y=C[4];return[N,F,H,z,Y]}function w(g){g.push([o,""]);for(var m=0,x=0,P=0,O="",R="",T;m<g.length;)switch(g[m][0]){case a:P++,R+=g[m][1],m++;break;case i:x++,O+=g[m][1],m++;break;case o:x+P>1?(x!==0&&P!==0&&(T=b(R,O),T!==0&&(m-x-P>0&&g[m-x-P-1][0]==o?g[m-x-P-1][1]+=R.substring(0,T):(g.splice(0,0,[o,R.substring(0,T)]),m++),R=R.substring(T),O=O.substring(T)),T=v(R,O),T!==0&&(g[m][1]=R.substring(R.length-T)+g[m][1],R=R.substring(0,R.length-T),O=O.substring(0,O.length-T))),x===0?g.splice(m-P,x+P,[a,R]):P===0?g.splice(m-x,x+P,[i,O]):g.splice(m-x-P,x+P,[i,O],[a,R]),m=m-x-P+(x?1:0)+(P?1:0)+1):m!==0&&g[m-1][0]==o?(g[m-1][1]+=g[m][1],g.splice(m,1)):m++,P=0,x=0,O="",R="";break}g[g.length-1][1]===""&&g.pop();var C=!1;for(m=1;m<g.length-1;)g[m-1][0]==o&&g[m+1][0]==o&&(g[m][1].substring(g[m][1].length-g[m-1][1].length)==g[m-1][1]?(g[m][1]=g[m-1][1]+g[m][1].substring(0,g[m][1].length-g[m-1][1].length),g[m+1][1]=g[m-1][1]+g[m+1][1],g.splice(m-1,1),C=!0):g[m][1].substring(0,g[m+1][1].length)==g[m+1][1]&&(g[m-1][1]+=g[m+1][1],g[m][1]=g[m][1].substring(g[m+1][1].length)+g[m+1][1],g.splice(m+1,1),C=!0)),m++;C&&w(g)}var E=l;E.INSERT=a,E.DELETE=i,E.EQUAL=o,r.exports=E;function S(g,m){if(m===0)return[o,g];for(var x=0,P=0;P<g.length;P++){var O=g[P];if(O[0]===i||O[0]===o){var R=x+O[1].length;if(m===R)return[P+1,g];if(m<R){g=g.slice();var T=m-x,C=[O[0],O[1].slice(0,T)],N=[O[0],O[1].slice(T)];return g.splice(P,1,C,N),[P+1,g]}else x=R}}throw new Error("cursor_pos is out of bounds!")}function _(g,m){var x=S(g,m),P=x[1],O=x[0],R=P[O],T=P[O+1];if(R==null)return g;if(R[0]!==o)return g;if(T!=null&&R[1]+T[1]===T[1]+R[1])return P.splice(O,2,T,R),d(P,O,2);if(T!=null&&T[1].indexOf(R[1])===0){P.splice(O,2,[T[0],R[1]],[0,R[1]]);var C=T[1].slice(R[1].length);return C.length>0&&P.splice(O+2,0,[T[0],C]),d(P,O,3)}else return g}function p(g){for(var m=!1,x=function(T){return T.charCodeAt(0)>=56320&&T.charCodeAt(0)<=57343},P=function(T){return T.charCodeAt(T.length-1)>=55296&&T.charCodeAt(T.length-1)<=56319},O=2;O<g.length;O+=1)g[O-2][0]===o&&P(g[O-2][1])&&g[O-1][0]===i&&x(g[O-1][1])&&g[O][0]===a&&x(g[O][1])&&(m=!0,g[O-1][1]=g[O-2][1].slice(-1)+g[O-1][1],g[O][1]=g[O-2][1].slice(-1)+g[O][1],g[O-2][1]=g[O-2][1].slice(0,-1));if(!m)return g;for(var R=[],O=0;O<g.length;O+=1)g[O][1].length>0&&R.push(g[O]);return R}function d(g,m,x){for(var P=m+x-1;P>=0&&P>=m-1;P--)if(P+1<g.length){var O=g[P],R=g[P+1];O[0]===R[1]&&g.splice(P,2,[O[0],O[1]+R[1]])}return g}},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,y,b){this.fn=f,this.context=y,this.once=b||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var y=[],b,v;if(this._eventsCount===0)return y;for(v in b=this._events)i.call(b,v)&&y.push(a?v.slice(1):v);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(b)):y},u.prototype.listeners=function(y,b){var v=a?a+y:y,h=this._events[v];if(b)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var w=0,E=h.length,S=new Array(E);w<E;w++)S[w]=h[w].fn;return S},u.prototype.emit=function(y,b,v,h,w,E){var S=a?a+y:y;if(!this._events[S])return!1;var _=this._events[S],p=arguments.length,d,g;if(_.fn){switch(_.once&&this.removeListener(y,_.fn,void 0,!0),p){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,b),!0;case 3:return _.fn.call(_.context,b,v),!0;case 4:return _.fn.call(_.context,b,v,h),!0;case 5:return _.fn.call(_.context,b,v,h,w),!0;case 6:return _.fn.call(_.context,b,v,h,w,E),!0}for(g=1,d=new Array(p-1);g<p;g++)d[g-1]=arguments[g];_.fn.apply(_.context,d)}else{var m=_.length,x;for(g=0;g<m;g++)switch(_[g].once&&this.removeListener(y,_[g].fn,void 0,!0),p){case 1:_[g].fn.call(_[g].context);break;case 2:_[g].fn.call(_[g].context,b);break;case 3:_[g].fn.call(_[g].context,b,v);break;case 4:_[g].fn.call(_[g].context,b,v,h);break;default:if(!d)for(x=1,d=new Array(p-1);x<p;x++)d[x-1]=arguments[x];_[g].fn.apply(_[g].context,d)}}return!0},u.prototype.on=function(y,b,v){var h=new l(b,v||this),w=a?a+y:y;return this._events[w]?this._events[w].fn?this._events[w]=[this._events[w],h]:this._events[w].push(h):(this._events[w]=h,this._eventsCount++),this},u.prototype.once=function(y,b,v){var h=new l(b,v||this,!0),w=a?a+y:y;return this._events[w]?this._events[w].fn?this._events[w]=[this._events[w],h]:this._events[w].push(h):(this._events[w]=h,this._eventsCount++),this},u.prototype.removeListener=function(y,b,v,h){var w=a?a+y:y;if(!this._events[w])return this;if(!b)return--this._eventsCount===0?this._events=new o:delete this._events[w],this;var E=this._events[w];if(E.fn)E.fn===b&&(!h||E.once)&&(!v||E.context===v)&&(--this._eventsCount===0?this._events=new o:delete this._events[w]);else{for(var S=0,_=[],p=E.length;S<p;S++)(E[S].fn!==b||h&&!E[S].once||v&&E[S].context!==v)&&_.push(E[S]);_.length?this._events[w]=_.length===1?_[0]:_:--this._eventsCount===0?this._events=new o:delete this._events[w]}return this},u.prototype.removeAllListeners=function(y){var b;return y?(b=a?a+y:y,this._events[b]&&(--this._eventsCount===0?this._events=new o:delete this._events[b])):(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(le){return typeof le}:function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},o=function(){function le(ce,be){var _e=[],te=!0,fe=!1,ue=void 0;try{for(var me=ce[Symbol.iterator](),Ne;!(te=(Ne=me.next()).done)&&(_e.push(Ne.value),!(be&&_e.length===be));te=!0);}catch(Xe){fe=!0,ue=Xe}finally{try{!te&&me.return&&me.return()}finally{if(fe)throw ue}}return _e}return function(ce,be){if(Array.isArray(ce))return ce;if(Symbol.iterator in Object(ce))return le(ce,be);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function le(ce,be){for(var _e=0;_e<be.length;_e++){var te=be[_e];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(ce,te.key,te)}}return function(ce,be,_e){return be&&le(ce.prototype,be),_e&&le(ce,_e),ce}}(),u=i(3),f=N(u),y=i(2),b=N(y),v=i(0),h=N(v),w=i(5),E=N(w),S=i(10),_=N(S),p=i(9),d=N(p),g=i(36),m=i(37),x=i(13),P=N(x),O=i(26),R=i(38),T=i(39),C=i(40);function N(le){return le&&le.__esModule?le:{default:le}}function F(le,ce,be){return ce in le?Object.defineProperty(le,ce,{value:be,enumerable:!0,configurable:!0,writable:!0}):le[ce]=be,le}function H(le,ce){if(!(le instanceof ce))throw new TypeError("Cannot call a class as a function")}function z(le,ce){if(!le)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ce&&(typeof ce=="object"||typeof ce=="function")?ce:le}function Y(le,ce){if(typeof ce!="function"&&ce!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ce);le.prototype=Object.create(ce&&ce.prototype,{constructor:{value:le,enumerable:!1,writable:!0,configurable:!0}}),ce&&(Object.setPrototypeOf?Object.setPrototypeOf(le,ce):le.__proto__=ce)}var G=(0,_.default)("quill:clipboard"),W="__ql-matcher",j=[[Node.TEXT_NODE,xe],[Node.TEXT_NODE,pe],["br",Z],[Node.ELEMENT_NODE,pe],[Node.ELEMENT_NODE,ee],[Node.ELEMENT_NODE,we],[Node.ELEMENT_NODE,Q],[Node.ELEMENT_NODE,Re],["li",ie],["b",X.bind(X,"bold")],["i",X.bind(X,"italic")],["style",ne]],M=[g.AlignAttribute,R.DirectionAttribute].reduce(function(le,ce){return le[ce.keyName]=ce,le},{}),k=[g.AlignStyle,m.BackgroundStyle,O.ColorStyle,R.DirectionStyle,T.FontStyle,C.SizeStyle].reduce(function(le,ce){return le[ce.keyName]=ce,le},{}),D=function(le){Y(ce,le);function ce(be,_e){H(this,ce);var te=z(this,(ce.__proto__||Object.getPrototypeOf(ce)).call(this,be,_e));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=[],j.concat(te.options.matchers).forEach(function(fe){var ue=o(fe,2),me=ue[0],Ne=ue[1];!_e.matchVisual&&Ne===we||te.addMatcher(me,Ne)}),te}return l(ce,[{key:"addMatcher",value:function(_e,te){this.matchers.push([_e,te])}},{key:"convert",value:function(_e){if(typeof _e=="string")return this.container.innerHTML=_e.replace(/\>\r?\n +\</g,"><"),this.convert();var te=this.quill.getFormat(this.quill.selection.savedRange.index);if(te[P.default.blotName]){var fe=this.container.innerText;return this.container.innerHTML="",new b.default().insert(fe,F({},P.default.blotName,te[P.default.blotName]))}var ue=this.prepareMatching(),me=o(ue,2),Ne=me[0],Xe=me[1],Ye=U(this.container,Ne,Xe);return K(Ye,`
129
+ `)&&Ye.ops[Ye.ops.length-1].attributes==null&&(Ye=Ye.compose(new b.default().retain(Ye.length()-1).delete(1))),G.log("convert",this.container.innerHTML,Ye),this.container.innerHTML="",Ye}},{key:"dangerouslyPasteHTML",value:function(_e,te){var fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E.default.sources.API;if(typeof _e=="string")this.quill.setContents(this.convert(_e),te),this.quill.setSelection(0,E.default.sources.SILENT);else{var ue=this.convert(te);this.quill.updateContents(new b.default().retain(_e).concat(ue),fe),this.quill.setSelection(_e+ue.length(),E.default.sources.SILENT)}}},{key:"onPaste",value:function(_e){var te=this;if(!(_e.defaultPrevented||!this.quill.isEnabled())){var fe=this.quill.getSelection(),ue=new b.default().retain(fe.index),me=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(E.default.sources.SILENT),setTimeout(function(){ue=ue.concat(te.convert()).delete(fe.length),te.quill.updateContents(ue,E.default.sources.USER),te.quill.setSelection(ue.length()-fe.length,E.default.sources.SILENT),te.quill.scrollingContainer.scrollTop=me,te.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var _e=this,te=[],fe=[];return this.matchers.forEach(function(ue){var me=o(ue,2),Ne=me[0],Xe=me[1];switch(Ne){case Node.TEXT_NODE:fe.push(Xe);break;case Node.ELEMENT_NODE:te.push(Xe);break;default:[].forEach.call(_e.container.querySelectorAll(Ne),function(Ye){Ye[W]=Ye[W]||[],Ye[W].push(Xe)});break}}),[te,fe]}}]),ce}(d.default);D.DEFAULTS={matchers:[],matchVisual:!0};function B(le,ce,be){return(typeof ce>"u"?"undefined":a(ce))==="object"?Object.keys(ce).reduce(function(_e,te){return B(_e,te,ce[te])},le):le.reduce(function(_e,te){return te.attributes&&te.attributes[ce]?_e.push(te):_e.insert(te.insert,(0,f.default)({},F({},ce,be),te.attributes))},new b.default)}function q(le){if(le.nodeType!==Node.ELEMENT_NODE)return{};var ce="__ql-computed-style";return le[ce]||(le[ce]=window.getComputedStyle(le))}function K(le,ce){for(var be="",_e=le.ops.length-1;_e>=0&&be.length<ce.length;--_e){var te=le.ops[_e];if(typeof te.insert!="string")break;be=te.insert+be}return be.slice(-1*ce.length)===ce}function $(le){if(le.childNodes.length===0)return!1;var ce=q(le);return["block","list-item"].indexOf(ce.display)>-1}function U(le,ce,be){return le.nodeType===le.TEXT_NODE?be.reduce(function(_e,te){return te(le,_e)},new b.default):le.nodeType===le.ELEMENT_NODE?[].reduce.call(le.childNodes||[],function(_e,te){var fe=U(te,ce,be);return te.nodeType===le.ELEMENT_NODE&&(fe=ce.reduce(function(ue,me){return me(te,ue)},fe),fe=(te[W]||[]).reduce(function(ue,me){return me(te,ue)},fe)),_e.concat(fe)},new b.default):new b.default}function X(le,ce,be){return B(be,le,!0)}function Q(le,ce){var be=h.default.Attributor.Attribute.keys(le),_e=h.default.Attributor.Class.keys(le),te=h.default.Attributor.Style.keys(le),fe={};return be.concat(_e).concat(te).forEach(function(ue){var me=h.default.query(ue,h.default.Scope.ATTRIBUTE);me!=null&&(fe[me.attrName]=me.value(le),fe[me.attrName])||(me=M[ue],me!=null&&(me.attrName===ue||me.keyName===ue)&&(fe[me.attrName]=me.value(le)||void 0),me=k[ue],me!=null&&(me.attrName===ue||me.keyName===ue)&&(me=k[ue],fe[me.attrName]=me.value(le)||void 0))}),Object.keys(fe).length>0&&(ce=B(ce,fe)),ce}function ee(le,ce){var be=h.default.query(le);if(be==null)return ce;if(be.prototype instanceof h.default.Embed){var _e={},te=be.value(le);te!=null&&(_e[be.blotName]=te,ce=new b.default().insert(_e,be.formats(le)))}else typeof be.formats=="function"&&(ce=B(ce,be.blotName,be.formats(le)));return ce}function Z(le,ce){return K(ce,`
130
+ `)||ce.insert(`
131
+ `),ce}function ne(){return new b.default}function ie(le,ce){var be=h.default.query(le);if(be==null||be.blotName!=="list-item"||!K(ce,`
132
+ `))return ce;for(var _e=-1,te=le.parentNode;!te.classList.contains("ql-clipboard");)(h.default.query(te)||{}).blotName==="list"&&(_e+=1),te=te.parentNode;return _e<=0?ce:ce.compose(new b.default().retain(ce.length()-1).retain(1,{indent:_e}))}function pe(le,ce){return K(ce,`
133
+ `)||($(le)||ce.length()>0&&le.nextSibling&&$(le.nextSibling))&&ce.insert(`
134
+ `),ce}function we(le,ce){if($(le)&&le.nextElementSibling!=null&&!K(ce,`
135
+
136
+ `)){var be=le.offsetHeight+parseFloat(q(le).marginTop)+parseFloat(q(le).marginBottom);le.nextElementSibling.offsetTop>le.offsetTop+be*1.5&&ce.insert(`
137
+ `)}return ce}function Re(le,ce){var be={},_e=le.style||{};return _e.fontStyle&&q(le).fontStyle==="italic"&&(be.italic=!0),_e.fontWeight&&(q(le).fontWeight.startsWith("bold")||parseInt(q(le).fontWeight)>=700)&&(be.bold=!0),Object.keys(be).length>0&&(ce=B(ce,be)),parseFloat(_e.textIndent||0)>0&&(ce=new b.default().insert(" ").concat(ce)),ce}function xe(le,ce){var be=le.data;if(le.parentNode.tagName==="O:P")return ce.insert(be.trim());if(be.trim().length===0&&le.parentNode.classList.contains("ql-clipboard"))return ce;if(!q(le.parentNode).whiteSpace.startsWith("pre")){var _e=function(fe,ue){return ue=ue.replace(/[^\u00a0]/g,""),ue.length<1&&fe?" ":ue};be=be.replace(/\r\n/g," ").replace(/\n/g," "),be=be.replace(/\s\s+/g,_e.bind(_e,!0)),(le.previousSibling==null&&$(le.parentNode)||le.previousSibling!=null&&$(le.previousSibling))&&(be=be.replace(/^\s+/,_e.bind(_e,!1))),(le.nextSibling==null&&$(le.parentNode)||le.nextSibling!=null&&$(le.nextSibling))&&(be=be.replace(/\s+$/,_e.bind(_e,!1)))}return ce.insert(be)}n.default=D,n.matchAttributor=Q,n.matchBlot=ee,n.matchNewline=pe,n.matchSpacing=we,n.matchText=xe},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function w(E,S){for(var _=0;_<S.length;_++){var p=S[_];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,p.key,p)}}return function(E,S,_){return S&&w(E.prototype,S),_&&w(E,_),E}}(),o=function w(E,S,_){E===null&&(E=Function.prototype);var p=Object.getOwnPropertyDescriptor(E,S);if(p===void 0){var d=Object.getPrototypeOf(E);return d===null?void 0:w(d,S,_)}else{if("value"in p)return p.value;var g=p.get;return g===void 0?void 0:g.call(_)}},l=i(6),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function y(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function b(w,E){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:w}function v(w,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);w.prototype=Object.create(E&&E.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(w,E):w.__proto__=E)}var h=function(w){v(E,w);function E(){return y(this,E),b(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,[{key:"optimize",value:function(_){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"optimize",this).call(this,_),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),E}(u.default);h.blotName="bold",h.tagName=["STRONG","B"],n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=function(){function C(N,F){var H=[],z=!0,Y=!1,G=void 0;try{for(var W=N[Symbol.iterator](),j;!(z=(j=W.next()).done)&&(H.push(j.value),!(F&&H.length===F));z=!0);}catch(M){Y=!0,G=M}finally{try{!z&&W.return&&W.return()}finally{if(Y)throw G}}return H}return function(N,F){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return C(N,F);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function C(N,F){for(var H=0;H<F.length;H++){var z=F[H];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(N,z.key,z)}}return function(N,F,H){return F&&C(N.prototype,F),H&&C(N,H),N}}(),l=i(2),u=_(l),f=i(0),y=_(f),b=i(5),v=_(b),h=i(10),w=_(h),E=i(9),S=_(E);function _(C){return C&&C.__esModule?C:{default:C}}function p(C,N,F){return N in C?Object.defineProperty(C,N,{value:F,enumerable:!0,configurable:!0,writable:!0}):C[N]=F,C}function d(C,N){if(!(C instanceof N))throw new TypeError("Cannot call a class as a function")}function g(C,N){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:C}function m(C,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);C.prototype=Object.create(N&&N.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(C,N):C.__proto__=N)}var x=(0,w.default)("quill:toolbar"),P=function(C){m(N,C);function N(F,H){d(this,N);var z=g(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,F,H));if(Array.isArray(z.options.container)){var Y=document.createElement("div");R(Y,z.options.container),F.container.parentNode.insertBefore(Y,F.container),z.container=Y}else typeof z.options.container=="string"?z.container=document.querySelector(z.options.container):z.container=z.options.container;if(!(z.container instanceof HTMLElement)){var G;return G=x.error("Container required for toolbar",z.options),g(z,G)}return z.container.classList.add("ql-toolbar"),z.controls=[],z.handlers={},Object.keys(z.options.handlers).forEach(function(W){z.addHandler(W,z.options.handlers[W])}),[].forEach.call(z.container.querySelectorAll("button, select"),function(W){z.attach(W)}),z.quill.on(v.default.events.EDITOR_CHANGE,function(W,j){W===v.default.events.SELECTION_CHANGE&&z.update(j)}),z.quill.on(v.default.events.SCROLL_OPTIMIZE,function(){var W=z.quill.selection.getRange(),j=a(W,1),M=j[0];z.update(M)}),z}return o(N,[{key:"addHandler",value:function(H,z){this.handlers[H]=z}},{key:"attach",value:function(H){var z=this,Y=[].find.call(H.classList,function(W){return W.indexOf("ql-")===0});if(Y){if(Y=Y.slice(3),H.tagName==="BUTTON"&&H.setAttribute("type","button"),this.handlers[Y]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[Y]==null){x.warn("ignoring attaching to disabled format",Y,H);return}if(y.default.query(Y)==null){x.warn("ignoring attaching to nonexistent format",Y,H);return}}var G=H.tagName==="SELECT"?"change":"click";H.addEventListener(G,function(W){var j=void 0;if(H.tagName==="SELECT"){if(H.selectedIndex<0)return;var M=H.options[H.selectedIndex];M.hasAttribute("selected")?j=!1:j=M.value||!1}else H.classList.contains("ql-active")?j=!1:j=H.value||!H.hasAttribute("value"),W.preventDefault();z.quill.focus();var k=z.quill.selection.getRange(),D=a(k,1),B=D[0];if(z.handlers[Y]!=null)z.handlers[Y].call(z,j);else if(y.default.query(Y).prototype instanceof y.default.Embed){if(j=prompt("Enter "+Y),!j)return;z.quill.updateContents(new u.default().retain(B.index).delete(B.length).insert(p({},Y,j)),v.default.sources.USER)}else z.quill.format(Y,j,v.default.sources.USER);z.update(B)}),this.controls.push([Y,H])}}},{key:"update",value:function(H){var z=H==null?{}:this.quill.getFormat(H);this.controls.forEach(function(Y){var G=a(Y,2),W=G[0],j=G[1];if(j.tagName==="SELECT"){var M=void 0;if(H==null)M=null;else if(z[W]==null)M=j.querySelector("option[selected]");else if(!Array.isArray(z[W])){var k=z[W];typeof k=="string"&&(k=k.replace(/\"/g,'\\"')),M=j.querySelector('option[value="'+k+'"]')}M==null?(j.value="",j.selectedIndex=-1):M.selected=!0}else if(H==null)j.classList.remove("ql-active");else if(j.hasAttribute("value")){var D=z[W]===j.getAttribute("value")||z[W]!=null&&z[W].toString()===j.getAttribute("value")||z[W]==null&&!j.getAttribute("value");j.classList.toggle("ql-active",D)}else j.classList.toggle("ql-active",z[W]!=null)})}}]),N}(S.default);P.DEFAULTS={};function O(C,N,F){var H=document.createElement("button");H.setAttribute("type","button"),H.classList.add("ql-"+N),F!=null&&(H.value=F),C.appendChild(H)}function R(C,N){Array.isArray(N[0])||(N=[N]),N.forEach(function(F){var H=document.createElement("span");H.classList.add("ql-formats"),F.forEach(function(z){if(typeof z=="string")O(H,z);else{var Y=Object.keys(z)[0],G=z[Y];Array.isArray(G)?T(H,Y,G):O(H,Y,G)}}),C.appendChild(H)})}function T(C,N,F){var H=document.createElement("select");H.classList.add("ql-"+N),F.forEach(function(z){var Y=document.createElement("option");z!==!1?Y.setAttribute("value",z):Y.setAttribute("selected","selected"),H.appendChild(Y)}),C.appendChild(H)}P.DEFAULTS={container:null,handlers:{clean:function(){var N=this,F=this.quill.getSelection();if(F!=null)if(F.length==0){var H=this.quill.getFormat();Object.keys(H).forEach(function(z){y.default.query(z,y.default.Scope.INLINE)!=null&&N.quill.format(z,!1)})}else this.quill.removeFormat(F,v.default.sources.USER)},direction:function(N){var F=this.quill.getFormat().align;N==="rtl"&&F==null?this.quill.format("align","right",v.default.sources.USER):!N&&F==="right"&&this.quill.format("align",!1,v.default.sources.USER),this.quill.format("direction",N,v.default.sources.USER)},indent:function(N){var F=this.quill.getSelection(),H=this.quill.getFormat(F),z=parseInt(H.indent||0);if(N==="+1"||N==="-1"){var Y=N==="+1"?1:-1;H.direction==="rtl"&&(Y*=-1),this.quill.format("indent",z+Y,v.default.sources.USER)}},link:function(N){N===!0&&(N=prompt("Enter link URL:")),this.quill.format("link",N,v.default.sources.USER)},list:function(N){var F=this.quill.getSelection(),H=this.quill.getFormat(F);N==="check"?H.list==="checked"||H.list==="unchecked"?this.quill.format("list",!1,v.default.sources.USER):this.quill.format("list","unchecked",v.default.sources.USER):this.quill.format("list",N,v.default.sources.USER)}}},n.default=P,n.addControls=R},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 w(E,S){for(var _=0;_<S.length;_++){var p=S[_];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,p.key,p)}}return function(E,S,_){return S&&w(E.prototype,S),_&&w(E,_),E}}(),o=function w(E,S,_){E===null&&(E=Function.prototype);var p=Object.getOwnPropertyDescriptor(E,S);if(p===void 0){var d=Object.getPrototypeOf(E);return d===null?void 0:w(d,S,_)}else{if("value"in p)return p.value;var g=p.get;return g===void 0?void 0:g.call(_)}},l=i(28),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function y(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function b(w,E){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:w}function v(w,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);w.prototype=Object.create(E&&E.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(w,E):w.__proto__=E)}var h=function(w){v(E,w);function E(S,_){y(this,E);var p=b(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,S));return p.label.innerHTML=_,p.container.classList.add("ql-color-picker"),[].slice.call(p.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(d){d.classList.add("ql-primary")}),p}return a(E,[{key:"buildItem",value:function(_){var p=o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"buildItem",this).call(this,_);return p.style.backgroundColor=_.getAttribute("value")||"",p}},{key:"selectItem",value:function(_,p){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"selectItem",this).call(this,_,p);var d=this.label.querySelector(".ql-color-label"),g=_&&_.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=g:d.style.fill=g)}}]),E}(u.default);n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function w(E,S){for(var _=0;_<S.length;_++){var p=S[_];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,p.key,p)}}return function(E,S,_){return S&&w(E.prototype,S),_&&w(E,_),E}}(),o=function w(E,S,_){E===null&&(E=Function.prototype);var p=Object.getOwnPropertyDescriptor(E,S);if(p===void 0){var d=Object.getPrototypeOf(E);return d===null?void 0:w(d,S,_)}else{if("value"in p)return p.value;var g=p.get;return g===void 0?void 0:g.call(_)}},l=i(28),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function y(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function b(w,E){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:w}function v(w,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);w.prototype=Object.create(E&&E.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(w,E):w.__proto__=E)}var h=function(w){v(E,w);function E(S,_){y(this,E);var p=b(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,S));return p.container.classList.add("ql-icon-picker"),[].forEach.call(p.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=_[d.getAttribute("data-value")||""]}),p.defaultItem=p.container.querySelector(".ql-selected"),p.selectItem(p.defaultItem),p}return a(E,[{key:"selectItem",value:function(_,p){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"selectItem",this).call(this,_,p),_=_||this.defaultItem,this.label.innerHTML=_.innerHTML}}]),E}(u.default);n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,y){for(var b=0;b<y.length;b++){var v=y[b];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}return function(f,y,b){return y&&u(f.prototype,y),b&&u(f,b),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,y){var b=this;o(this,u),this.quill=f,this.boundsContainer=y||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(){b.root.style.marginTop=-1*b.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(y){var b=y.left+y.width/2-this.root.offsetWidth/2,v=y.bottom+this.quill.root.scrollTop;this.root.style.left=b+"px",this.root.style.top=v+"px",this.root.classList.remove("ql-flip");var h=this.boundsContainer.getBoundingClientRect(),w=this.root.getBoundingClientRect(),E=0;if(w.right>h.right&&(E=h.right-w.right,this.root.style.left=b+E+"px"),w.left<h.left&&(E=h.left-w.left,this.root.style.left=b+E+"px"),w.bottom>h.bottom){var S=w.bottom-w.top,_=y.bottom-y.top+S;this.root.style.top=v-_+"px",this.root.classList.add("ql-flip")}return E}},{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 T(C,N){var F=[],H=!0,z=!1,Y=void 0;try{for(var G=C[Symbol.iterator](),W;!(H=(W=G.next()).done)&&(F.push(W.value),!(N&&F.length===N));H=!0);}catch(j){z=!0,Y=j}finally{try{!H&&G.return&&G.return()}finally{if(z)throw Y}}return F}return function(C,N){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return T(C,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function T(C,N,F){C===null&&(C=Function.prototype);var H=Object.getOwnPropertyDescriptor(C,N);if(H===void 0){var z=Object.getPrototypeOf(C);return z===null?void 0:T(z,N,F)}else{if("value"in H)return H.value;var Y=H.get;return Y===void 0?void 0:Y.call(F)}},l=function(){function T(C,N){for(var F=0;F<N.length;F++){var H=N[F];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(C,H.key,H)}}return function(C,N,F){return N&&T(C.prototype,N),F&&T(C,F),C}}(),u=i(3),f=d(u),y=i(8),b=d(y),v=i(43),h=d(v),w=i(27),E=d(w),S=i(15),_=i(41),p=d(_);function d(T){return T&&T.__esModule?T:{default:T}}function g(T,C){if(!(T instanceof C))throw new TypeError("Cannot call a class as a function")}function m(T,C){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:T}function x(T,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);T.prototype=Object.create(C&&C.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(T,C):T.__proto__=C)}var P=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],O=function(T){x(C,T);function C(N,F){g(this,C),F.modules.toolbar!=null&&F.modules.toolbar.container==null&&(F.modules.toolbar.container=P);var H=m(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,N,F));return H.quill.container.classList.add("ql-snow"),H}return l(C,[{key:"extendToolbar",value:function(F){F.container.classList.add("ql-snow"),this.buildButtons([].slice.call(F.container.querySelectorAll("button")),p.default),this.buildPickers([].slice.call(F.container.querySelectorAll("select")),p.default),this.tooltip=new R(this.quill,this.options.bounds),F.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(H,z){F.handlers.link.call(F,!z.format.link)})}}]),C}(h.default);O.DEFAULTS=(0,f.default)(!0,{},h.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(C){if(C){var N=this.quill.getSelection();if(N==null||N.length==0)return;var F=this.quill.getText(N);/^\S+@\S+\.\S+$/.test(F)&&F.indexOf("mailto:")!==0&&(F="mailto:"+F);var H=this.quill.theme.tooltip;H.edit("link",F)}else this.quill.format("link",!1)}}}}});var R=function(T){x(C,T);function C(N,F){g(this,C);var H=m(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,N,F));return H.preview=H.root.querySelector("a.ql-preview"),H}return l(C,[{key:"listen",value:function(){var F=this;o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(H){F.root.classList.contains("ql-editing")?F.save():F.edit("link",F.preview.textContent),H.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(H){if(F.linkRange!=null){var z=F.linkRange;F.restoreFocus(),F.quill.formatText(z,"link",!1,b.default.sources.USER),delete F.linkRange}H.preventDefault(),F.hide()}),this.quill.on(b.default.events.SELECTION_CHANGE,function(H,z,Y){if(H!=null){if(H.length===0&&Y===b.default.sources.USER){var G=F.quill.scroll.descendant(E.default,H.index),W=a(G,2),j=W[0],M=W[1];if(j!=null){F.linkRange=new S.Range(H.index-M,j.length());var k=E.default.formats(j.domNode);F.preview.textContent=k,F.preview.setAttribute("href",k),F.show(),F.position(F.quill.getBounds(F.linkRange));return}}else delete F.linkRange;F.hide()}})}},{key:"show",value:function(){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),C}(v.BaseTooltip);R.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=O},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),y=i(65),b=te(y),v=i(66),h=te(v),w=i(67),E=te(w),S=i(37),_=i(26),p=i(39),d=i(40),g=i(56),m=te(g),x=i(68),P=te(x),O=i(27),R=te(O),T=i(69),C=te(T),N=i(70),F=te(N),H=i(71),z=te(H),Y=i(72),G=te(Y),W=i(73),j=te(W),M=i(13),k=te(M),D=i(74),B=te(D),q=i(75),K=te(q),$=i(57),U=te($),X=i(41),Q=te(X),ee=i(28),Z=te(ee),ne=i(59),ie=te(ne),pe=i(60),we=te(pe),Re=i(61),xe=te(Re),le=i(108),ce=te(le),be=i(62),_e=te(be);function te(fe){return fe&&fe.__esModule?fe:{default:fe}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":S.BackgroundClass,"attributors/class/color":_.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":p.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":S.BackgroundStyle,"attributors/style/color":_.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":p.FontStyle,"attributors/style/size":d.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":f.IndentClass,"formats/background":S.BackgroundStyle,"formats/color":_.ColorStyle,"formats/font":p.FontClass,"formats/size":d.SizeClass,"formats/blockquote":b.default,"formats/code-block":k.default,"formats/header":h.default,"formats/list":E.default,"formats/bold":m.default,"formats/code":M.Code,"formats/italic":P.default,"formats/link":R.default,"formats/script":C.default,"formats/strike":F.default,"formats/underline":z.default,"formats/image":G.default,"formats/video":j.default,"formats/list/item":w.ListItem,"modules/formula":B.default,"modules/syntax":K.default,"modules/toolbar":U.default,"themes/bubble":ce.default,"themes/snow":_e.default,"ui/icons":Q.default,"ui/picker":Z.default,"ui/icon-picker":we.default,"ui/color-picker":ie.default,"ui/tooltip":xe.default},!0),n.default=o.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=function(){function E(S,_){for(var p=0;p<_.length;p++){var d=_[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(S,d.key,d)}}return function(S,_,p){return _&&E(S.prototype,_),p&&E(S,p),S}}(),o=function E(S,_,p){S===null&&(S=Function.prototype);var d=Object.getOwnPropertyDescriptor(S,_);if(d===void 0){var g=Object.getPrototypeOf(S);return g===null?void 0:E(g,_,p)}else{if("value"in d)return d.value;var m=d.get;return m===void 0?void 0:m.call(p)}},l=i(0),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function y(E,S){if(!(E instanceof S))throw new TypeError("Cannot call a class as a function")}function b(E,S){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:E}function v(E,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);E.prototype=Object.create(S&&S.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(E,S):E.__proto__=S)}var h=function(E){v(S,E);function S(){return y(this,S),b(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,[{key:"add",value:function(p,d){if(d==="+1"||d==="-1"){var g=this.value(p)||0;d=d==="+1"?g+1:g-1}return d===0?(this.remove(p),!0):o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"add",this).call(this,p,d)}},{key:"canAdd",value:function(p,d){return o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"canAdd",this).call(this,p,d)||o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"canAdd",this).call(this,p,parseInt(d))}},{key:"value",value:function(p){return parseInt(o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"value",this).call(this,p))||void 0}}]),S}(u.default.Attributor.Class),w=new h("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(4),o=l(a);function l(v){return v&&v.__esModule?v:{default:v}}function u(v,h){if(!(v instanceof h))throw new TypeError("Cannot call a class as a function")}function f(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 y(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 b=function(v){y(h,v);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);b.blotName="blockquote",b.tagName="blockquote",n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function h(w,E){for(var S=0;S<E.length;S++){var _=E[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(w,_.key,_)}}return function(w,E,S){return E&&h(w.prototype,E),S&&h(w,S),w}}(),o=i(4),l=u(o);function u(h){return h&&h.__esModule?h:{default:h}}function f(h,w){if(!(h instanceof w))throw new TypeError("Cannot call a class as a function")}function y(h,w){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:h}function b(h,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);h.prototype=Object.create(w&&w.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(h,w):h.__proto__=w)}var v=function(h){b(w,h);function w(){return f(this,w),y(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return a(w,null,[{key:"formats",value:function(S){return this.tagName.indexOf(S.tagName)+1}}]),w}(l.default);v.blotName="header",v.tagName=["H1","H2","H3","H4","H5","H6"],n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function g(m,x){for(var P=0;P<x.length;P++){var O=x[P];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(m,O.key,O)}}return function(m,x,P){return x&&g(m.prototype,x),P&&g(m,P),m}}(),o=function g(m,x,P){m===null&&(m=Function.prototype);var O=Object.getOwnPropertyDescriptor(m,x);if(O===void 0){var R=Object.getPrototypeOf(m);return R===null?void 0:g(R,x,P)}else{if("value"in O)return O.value;var T=O.get;return T===void 0?void 0:T.call(P)}},l=i(0),u=h(l),f=i(4),y=h(f),b=i(25),v=h(b);function h(g){return g&&g.__esModule?g:{default:g}}function w(g,m,x){return m in g?Object.defineProperty(g,m,{value:x,enumerable:!0,configurable:!0,writable:!0}):g[m]=x,g}function E(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}function S(g,m){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:g}function _(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(g,m):g.__proto__=m)}var p=function(g){_(m,g);function m(){return E(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"format",value:function(P,O){P===d.blotName&&!O?this.replaceWith(u.default.create(this.statics.scope)):o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"format",this).call(this,P,O)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(P,O){return this.parent.isolate(this.offset(this.parent),this.length()),P===this.parent.statics.blotName?(this.parent.replaceWith(P,O),this):(this.parent.unwrap(),o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"replaceWith",this).call(this,P,O))}}],[{key:"formats",value:function(P){return P.tagName===this.tagName?void 0:o(m.__proto__||Object.getPrototypeOf(m),"formats",this).call(this,P)}}]),m}(y.default);p.blotName="list-item",p.tagName="LI";var d=function(g){_(m,g),a(m,null,[{key:"create",value:function(P){var O=P==="ordered"?"OL":"UL",R=o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,O);return(P==="checked"||P==="unchecked")&&R.setAttribute("data-checked",P==="checked"),R}},{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 m(x){E(this,m);var P=S(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,x)),O=function(T){if(T.target.parentNode===x){var C=P.statics.formats(x),N=u.default.find(T.target);C==="checked"?N.format("list","unchecked"):C==="unchecked"&&N.format("list","checked")}};return x.addEventListener("touchstart",O),x.addEventListener("mousedown",O),P}return a(m,[{key:"format",value:function(P,O){this.children.length>0&&this.children.tail.format(P,O)}},{key:"formats",value:function(){return w({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(P,O){if(P instanceof p)o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"insertBefore",this).call(this,P,O);else{var R=O==null?this.length():O.offset(this),T=this.split(R);T.parent.insertBefore(P,T)}}},{key:"optimize",value:function(P){o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"optimize",this).call(this,P);var O=this.next;O!=null&&O.prev===this&&O.statics.blotName===this.statics.blotName&&O.domNode.tagName===this.domNode.tagName&&O.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(O.moveChildren(this),O.remove())}},{key:"replace",value:function(P){if(P.statics.blotName!==this.statics.blotName){var O=u.default.create(this.statics.defaultChild);P.moveChildren(O),this.appendChild(O)}o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"replace",this).call(this,P)}}]),m}(v.default);d.blotName="list",d.scope=u.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[p],n.ListItem=p,n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),o=l(a);function l(v){return v&&v.__esModule?v:{default:v}}function u(v,h){if(!(v instanceof h))throw new TypeError("Cannot call a class as a function")}function f(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 y(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 b=function(v){y(h,v);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);b.blotName="italic",b.tagName=["EM","I"],n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function w(E,S){for(var _=0;_<S.length;_++){var p=S[_];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,p.key,p)}}return function(E,S,_){return S&&w(E.prototype,S),_&&w(E,_),E}}(),o=function w(E,S,_){E===null&&(E=Function.prototype);var p=Object.getOwnPropertyDescriptor(E,S);if(p===void 0){var d=Object.getPrototypeOf(E);return d===null?void 0:w(d,S,_)}else{if("value"in p)return p.value;var g=p.get;return g===void 0?void 0:g.call(_)}},l=i(6),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function y(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function b(w,E){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:w}function v(w,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);w.prototype=Object.create(E&&E.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(w,E):w.__proto__=E)}var h=function(w){v(E,w);function E(){return y(this,E),b(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,null,[{key:"create",value:function(_){return _==="super"?document.createElement("sup"):_==="sub"?document.createElement("sub"):o(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this,_)}},{key:"formats",value:function(_){if(_.tagName==="SUB")return"sub";if(_.tagName==="SUP")return"super"}}]),E}(u.default);h.blotName="script",h.tagName=["SUB","SUP"],n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(v){return v&&v.__esModule?v:{default:v}}function u(v,h){if(!(v instanceof h))throw new TypeError("Cannot call a class as a function")}function f(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 y(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 b=function(v){y(h,v);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);b.blotName="strike",b.tagName="S",n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(v){return v&&v.__esModule?v:{default:v}}function u(v,h){if(!(v instanceof h))throw new TypeError("Cannot call a class as a function")}function f(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 y(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 b=function(v){y(h,v);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);b.blotName="underline",b.tagName="U",n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(_,p){for(var d=0;d<p.length;d++){var g=p[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(_,g.key,g)}}return function(_,p,d){return p&&S(_.prototype,p),d&&S(_,d),_}}(),o=function S(_,p,d){_===null&&(_=Function.prototype);var g=Object.getOwnPropertyDescriptor(_,p);if(g===void 0){var m=Object.getPrototypeOf(_);return m===null?void 0:S(m,p,d)}else{if("value"in g)return g.value;var x=g.get;return x===void 0?void 0:x.call(d)}},l=i(0),u=y(l),f=i(27);function y(S){return S&&S.__esModule?S:{default:S}}function b(S,_){if(!(S instanceof _))throw new TypeError("Cannot call a class as a function")}function v(S,_){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:S}function h(S,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);S.prototype=Object.create(_&&_.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(S,_):S.__proto__=_)}var w=["alt","height","width"],E=function(S){h(_,S);function _(){return b(this,_),v(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"format",value:function(d,g){w.indexOf(d)>-1?g?this.domNode.setAttribute(d,g):this.domNode.removeAttribute(d):o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,d,g)}}],[{key:"create",value:function(d){var g=o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,d);return typeof d=="string"&&g.setAttribute("src",this.sanitize(d)),g}},{key:"formats",value:function(d){return w.reduce(function(g,m){return d.hasAttribute(m)&&(g[m]=d.getAttribute(m)),g},{})}},{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")}}]),_}(u.default.Embed);E.blotName="image",E.tagName="IMG",n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(_,p){for(var d=0;d<p.length;d++){var g=p[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(_,g.key,g)}}return function(_,p,d){return p&&S(_.prototype,p),d&&S(_,d),_}}(),o=function S(_,p,d){_===null&&(_=Function.prototype);var g=Object.getOwnPropertyDescriptor(_,p);if(g===void 0){var m=Object.getPrototypeOf(_);return m===null?void 0:S(m,p,d)}else{if("value"in g)return g.value;var x=g.get;return x===void 0?void 0:x.call(d)}},l=i(4),u=i(27),f=y(u);function y(S){return S&&S.__esModule?S:{default:S}}function b(S,_){if(!(S instanceof _))throw new TypeError("Cannot call a class as a function")}function v(S,_){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:S}function h(S,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);S.prototype=Object.create(_&&_.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(S,_):S.__proto__=_)}var w=["height","width"],E=function(S){h(_,S);function _(){return b(this,_),v(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"format",value:function(d,g){w.indexOf(d)>-1?g?this.domNode.setAttribute(d,g):this.domNode.removeAttribute(d):o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,d,g)}}],[{key:"create",value:function(d){var g=o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,d);return g.setAttribute("frameborder","0"),g.setAttribute("allowfullscreen",!0),g.setAttribute("src",this.sanitize(d)),g}},{key:"formats",value:function(d){return w.reduce(function(g,m){return d.hasAttribute(m)&&(g[m]=d.getAttribute(m)),g},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),_}(l.BlockEmbed);E.blotName="video",E.className="ql-video",E.tagName="IFRAME",n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var a=function(){function d(g,m){for(var x=0;x<m.length;x++){var P=m[x];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(g,P.key,P)}}return function(g,m,x){return m&&d(g.prototype,m),x&&d(g,x),g}}(),o=function d(g,m,x){g===null&&(g=Function.prototype);var P=Object.getOwnPropertyDescriptor(g,m);if(P===void 0){var O=Object.getPrototypeOf(g);return O===null?void 0:d(O,m,x)}else{if("value"in P)return P.value;var R=P.get;return R===void 0?void 0:R.call(x)}},l=i(35),u=h(l),f=i(5),y=h(f),b=i(9),v=h(b);function h(d){return d&&d.__esModule?d:{default:d}}function w(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")}function E(d,g){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:d}function S(d,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);d.prototype=Object.create(g&&g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(d,g):d.__proto__=g)}var _=function(d){S(g,d);function g(){return w(this,g),E(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,null,[{key:"create",value:function(x){var P=o(g.__proto__||Object.getPrototypeOf(g),"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")}}]),g}(u.default);_.blotName="formula",_.className="ql-formula",_.tagName="SPAN";var p=function(d){S(g,d),a(g,null,[{key:"register",value:function(){y.default.register(_,!0)}}]);function g(){w(this,g);var m=E(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return m}return g}(v.default);n.FormulaBlot=_,n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function x(P,O){for(var R=0;R<O.length;R++){var T=O[R];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(P,T.key,T)}}return function(P,O,R){return O&&x(P.prototype,O),R&&x(P,R),P}}(),o=function x(P,O,R){P===null&&(P=Function.prototype);var T=Object.getOwnPropertyDescriptor(P,O);if(T===void 0){var C=Object.getPrototypeOf(P);return C===null?void 0:x(C,O,R)}else{if("value"in T)return T.value;var N=T.get;return N===void 0?void 0:N.call(R)}},l=i(0),u=E(l),f=i(5),y=E(f),b=i(9),v=E(b),h=i(13),w=E(h);function E(x){return x&&x.__esModule?x:{default:x}}function S(x,P){if(!(x instanceof P))throw new TypeError("Cannot call a class as a function")}function _(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 p(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){p(P,x);function P(){return S(this,P),_(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return a(P,[{key:"replaceWith",value:function(R){this.domNode.textContent=this.domNode.textContent,this.attach(),o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replaceWith",this).call(this,R)}},{key:"highlight",value:function(R){var T=this.domNode.textContent;this.cachedText!==T&&((T.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=R(T),this.domNode.normalize(),this.attach()),this.cachedText=T)}}]),P}(w.default);d.className="ql-syntax";var g=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),m=function(x){p(P,x),a(P,null,[{key:"register",value:function(){y.default.register(g,!0),y.default.register(d,!0)}}]);function P(O,R){S(this,P);var T=_(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,O,R));if(typeof T.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var C=null;return T.quill.on(y.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(C),C=setTimeout(function(){T.highlight(),C=null},T.options.interval)}),T.highlight(),T}return a(P,[{key:"highlight",value:function(){var R=this;if(!this.quill.selection.composing){this.quill.update(y.default.sources.USER);var T=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(C){C.highlight(R.options.highlight)}),this.quill.update(y.default.sources.SILENT),T!=null&&this.quill.setSelection(T,y.default.sources.SILENT)}}}]),P}(v.default);m.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=g,n.default=m},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(O,R,T){O===null&&(O=Function.prototype);var C=Object.getOwnPropertyDescriptor(O,R);if(C===void 0){var N=Object.getPrototypeOf(O);return N===null?void 0:P(N,R,T)}else{if("value"in C)return C.value;var F=C.get;return F===void 0?void 0:F.call(T)}},o=function(){function P(O,R){for(var T=0;T<R.length;T++){var C=R[T];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(O,C.key,C)}}return function(O,R,T){return R&&P(O.prototype,R),T&&P(O,T),O}}(),l=i(3),u=S(l),f=i(8),y=S(f),b=i(43),v=S(b),h=i(15),w=i(41),E=S(w);function S(P){return P&&P.__esModule?P:{default:P}}function _(P,O){if(!(P instanceof O))throw new TypeError("Cannot call a class as a function")}function p(P,O){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:P}function d(P,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);P.prototype=Object.create(O&&O.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(P,O):P.__proto__=O)}var g=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],m=function(P){d(O,P);function O(R,T){_(this,O),T.modules.toolbar!=null&&T.modules.toolbar.container==null&&(T.modules.toolbar.container=g);var C=p(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,R,T));return C.quill.container.classList.add("ql-bubble"),C}return o(O,[{key:"extendToolbar",value:function(T){this.tooltip=new x(this.quill,this.options.bounds),this.tooltip.root.appendChild(T.container),this.buildButtons([].slice.call(T.container.querySelectorAll("button")),E.default),this.buildPickers([].slice.call(T.container.querySelectorAll("select")),E.default)}}]),O}(v.default);m.DEFAULTS=(0,u.default)(!0,{},v.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(O){O?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var x=function(P){d(O,P);function O(R,T){_(this,O);var C=p(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,R,T));return C.quill.on(y.default.events.EDITOR_CHANGE,function(N,F,H,z){if(N===y.default.events.SELECTION_CHANGE)if(F!=null&&F.length>0&&z===y.default.sources.USER){C.show(),C.root.style.left="0px",C.root.style.width="",C.root.style.width=C.root.offsetWidth+"px";var Y=C.quill.getLines(F.index,F.length);if(Y.length===1)C.position(C.quill.getBounds(F));else{var G=Y[Y.length-1],W=C.quill.getIndex(G),j=Math.min(G.length()-1,F.index+F.length-W),M=C.quill.getBounds(new h.Range(W,j));C.position(M)}}else document.activeElement!==C.textbox&&C.quill.hasFocus()&&C.hide()}),C}return o(O,[{key:"listen",value:function(){var T=this;a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){T.root.classList.remove("ql-editing")}),this.quill.on(y.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!T.root.classList.contains("ql-hidden")){var C=T.quill.getSelection();C!=null&&T.position(T.quill.getBounds(C))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(T){var C=a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"position",this).call(this,T),N=this.root.querySelector(".ql-tooltip-arrow");if(N.style.marginLeft="",C===0)return C;N.style.marginLeft=-1*C-N.offsetWidth/2+"px"}}]),O}(b.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=m},function(r,n,i){r.exports=i(63)}]).default})})(f8);var cM=f8.exports,d8={},h8={exports:{}},xo={},mu={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */mu.exports;var Bw;function fM(){return Bw||(Bw=1,function(t,e){(function(r){var n=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,a=typeof ye=="object"&&ye;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,l=2147483647,u=36,f=1,y=26,b=38,v=700,h=72,w=128,E="-",S=/^xn--/,_=/[^\x20-\x7E]/,p=/[\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"},g=u-f,m=Math.floor,x=String.fromCharCode,P;function O(M){throw new RangeError(d[M])}function R(M,k){for(var D=M.length,B=[];D--;)B[D]=k(M[D]);return B}function T(M,k){var D=M.split("@"),B="";D.length>1&&(B=D[0]+"@",M=D[1]),M=M.replace(p,".");var q=M.split("."),K=R(q,k).join(".");return B+K}function C(M){for(var k=[],D=0,B=M.length,q,K;D<B;)q=M.charCodeAt(D++),q>=55296&&q<=56319&&D<B?(K=M.charCodeAt(D++),(K&64512)==56320?k.push(((q&1023)<<10)+(K&1023)+65536):(k.push(q),D--)):k.push(q);return k}function N(M){return R(M,function(k){var D="";return k>65535&&(k-=65536,D+=x(k>>>10&1023|55296),k=56320|k&1023),D+=x(k),D}).join("")}function F(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:u}function H(M,k){return M+22+75*(M<26)-((k!=0)<<5)}function z(M,k,D){var B=0;for(M=D?m(M/v):M>>1,M+=m(M/k);M>g*y>>1;B+=u)M=m(M/g);return m(B+(g+1)*M/(M+b))}function Y(M){var k=[],D=M.length,B,q=0,K=w,$=h,U,X,Q,ee,Z,ne,ie,pe,we;for(U=M.lastIndexOf(E),U<0&&(U=0),X=0;X<U;++X)M.charCodeAt(X)>=128&&O("not-basic"),k.push(M.charCodeAt(X));for(Q=U>0?U+1:0;Q<D;){for(ee=q,Z=1,ne=u;Q>=D&&O("invalid-input"),ie=F(M.charCodeAt(Q++)),(ie>=u||ie>m((l-q)/Z))&&O("overflow"),q+=ie*Z,pe=ne<=$?f:ne>=$+y?y:ne-$,!(ie<pe);ne+=u)we=u-pe,Z>m(l/we)&&O("overflow"),Z*=we;B=k.length+1,$=z(q-ee,B,ee==0),m(q/B)>l-K&&O("overflow"),K+=m(q/B),q%=B,k.splice(q++,0,K)}return N(k)}function G(M){var k,D,B,q,K,$,U,X,Q,ee,Z,ne=[],ie,pe,we,Re;for(M=C(M),ie=M.length,k=w,D=0,K=h,$=0;$<ie;++$)Z=M[$],Z<128&&ne.push(x(Z));for(B=q=ne.length,q&&ne.push(E);B<ie;){for(U=l,$=0;$<ie;++$)Z=M[$],Z>=k&&Z<U&&(U=Z);for(pe=B+1,U-k>m((l-D)/pe)&&O("overflow"),D+=(U-k)*pe,k=U,$=0;$<ie;++$)if(Z=M[$],Z<k&&++D>l&&O("overflow"),Z==k){for(X=D,Q=u;ee=Q<=K?f:Q>=K+y?y:Q-K,!(X<ee);Q+=u)Re=X-ee,we=u-ee,ne.push(x(H(ee+Re%we,0))),X=m(Re/we);ne.push(x(H(X,0))),K=z(D,pe,B==q),D=0,++B}++D,++k}return ne.join("")}function W(M){return T(M,function(k){return S.test(k)?Y(k.slice(4).toLowerCase()):k})}function j(M){return T(M,function(k){return _.test(k)?"xn--"+G(k):k})}if(o={version:"1.4.1",ucs2:{decode:C,encode:N},decode:Y,encode:G,toASCII:j,toUnicode:W},n&&i)if(t.exports==n)i.exports=o;else for(P in o)o.hasOwnProperty(P)&&(n[P]=o[P]);else r.punycode=o})(ye)}(mu,mu.exports)),mu.exports}var Iv,Uw;function dM(){return Uw||(Uw=1,Iv=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},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;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0}),Iv}var Lv,Gw;function hM(){if(Gw)return Lv;Gw=1;var t=typeof Symbol<"u"&&Symbol,e=dM();return Lv=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Lv}var jv,Hw;function pM(){if(Hw)return jv;Hw=1;var t={foo:{}},e=Object;return jv=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof e)},jv}var Dv,Vw;function gM(){if(Vw)return Dv;Vw=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(u,f){for(var y=[],b=0;b<u.length;b+=1)y[b]=u[b];for(var v=0;v<f.length;v+=1)y[v+u.length]=f[v];return y},a=function(u,f){for(var y=[],b=f||0,v=0;b<u.length;b+=1,v+=1)y[v]=u[b];return y},o=function(l,u){for(var f="",y=0;y<l.length;y+=1)f+=l[y],y+1<l.length&&(f+=u);return f};return Dv=function(u){var f=this;if(typeof f!="function"||e.apply(f)!==n)throw new TypeError(t+f);for(var y=a(arguments,1),b,v=function(){if(this instanceof b){var _=f.apply(this,i(y,arguments));return Object(_)===_?_:this}return f.apply(u,i(y,arguments))},h=r(0,f.length-y.length),w=[],E=0;E<h;E++)w[E]="$"+E;if(b=Function("binder","return function ("+o(w,",")+"){ return binder.apply(this,arguments); }")(v),f.prototype){var S=function(){};S.prototype=f.prototype,b.prototype=new S,S.prototype=null}return b},Dv}var Fv,qw;function p8(){if(qw)return Fv;qw=1;var t=gM();return Fv=Function.prototype.bind||t,Fv}var zv,$w;function vM(){if($w)return zv;$w=1;var t={}.hasOwnProperty,e=Function.prototype.call;return zv=e.bind?e.bind(t):function(r,n){return e.call(t,r,n)},zv}var Bv,Ww;function y1(){if(Ww)return Bv;Ww=1;var t,e=SyntaxError,r=Function,n=TypeError,i=function(N){try{return r('"use strict"; return ('+N+").constructor;")()}catch{}},a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch{a=null}var o=function(){throw new n},l=a?function(){try{return arguments.callee,o}catch{try{return a(arguments,"callee").get}catch{return o}}}():o,u=hM()(),f=pM()(),y=Object.getPrototypeOf||(f?function(N){return N.__proto__}:null),b={},v=typeof Uint8Array>"u"||!y?t:y(Uint8Array),h={"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":u&&y?y([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":r,"%GeneratorFunction%":b,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u&&y?y(y([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!u||!y?t:y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!u||!y?t:y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":u&&y?y(""[Symbol.iterator]()):t,"%Symbol%":u?Symbol:t,"%SyntaxError%":e,"%ThrowTypeError%":l,"%TypedArray%":v,"%TypeError%":n,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(y)try{null.error}catch(N){var w=y(y(N));h["%Error.prototype%"]=w}var E=function N(F){var H;if(F==="%AsyncFunction%")H=i("async function () {}");else if(F==="%GeneratorFunction%")H=i("function* () {}");else if(F==="%AsyncGeneratorFunction%")H=i("async function* () {}");else if(F==="%AsyncGenerator%"){var z=N("%AsyncGeneratorFunction%");z&&(H=z.prototype)}else if(F==="%AsyncIteratorPrototype%"){var Y=N("%AsyncGenerator%");Y&&y&&(H=y(Y.prototype))}return h[F]=H,H},S={"%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"]},_=p8(),p=vM(),d=_.call(Function.call,Array.prototype.concat),g=_.call(Function.apply,Array.prototype.splice),m=_.call(Function.call,String.prototype.replace),x=_.call(Function.call,String.prototype.slice),P=_.call(Function.call,RegExp.prototype.exec),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,T=function(F){var H=x(F,0,1),z=x(F,-1);if(H==="%"&&z!=="%")throw new e("invalid intrinsic syntax, expected closing `%`");if(z==="%"&&H!=="%")throw new e("invalid intrinsic syntax, expected opening `%`");var Y=[];return m(F,O,function(G,W,j,M){Y[Y.length]=j?m(M,R,"$1"):W||G}),Y},C=function(F,H){var z=F,Y;if(p(S,z)&&(Y=S[z],z="%"+Y[0]+"%"),p(h,z)){var G=h[z];if(G===b&&(G=E(z)),typeof G>"u"&&!H)throw new n("intrinsic "+F+" exists, but is not available. Please file an issue!");return{alias:Y,name:z,value:G}}throw new e("intrinsic "+F+" does not exist!")};return Bv=function(F,H){if(typeof F!="string"||F.length===0)throw new n("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof H!="boolean")throw new n('"allowMissing" argument must be a boolean');if(P(/^%?[^%]*%?$/,F)===null)throw new e("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var z=T(F),Y=z.length>0?z[0]:"",G=C("%"+Y+"%",H),W=G.name,j=G.value,M=!1,k=G.alias;k&&(Y=k[0],g(z,d([0,1],k)));for(var D=1,B=!0;D<z.length;D+=1){var q=z[D],K=x(q,0,1),$=x(q,-1);if((K==='"'||K==="'"||K==="`"||$==='"'||$==="'"||$==="`")&&K!==$)throw new e("property names with quotes must have matching quotes");if((q==="constructor"||!B)&&(M=!0),Y+="."+q,W="%"+Y+"%",p(h,W))j=h[W];else if(j!=null){if(!(q in j)){if(!H)throw new n("base intrinsic for "+F+" exists, but the property is not available.");return}if(a&&D+1>=z.length){var U=a(j,q);B=!!U,B&&"get"in U&&!("originalValue"in U.get)?j=U.get:j=j[q]}else B=p(j,q),j=j[q];B&&!M&&(h[W]=j)}}return j},Bv}var Uv={exports:{}},Yw;function mM(){return Yw||(Yw=1,function(t){var e=p8(),r=y1(),n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||e.call(i,n),o=r("%Object.getOwnPropertyDescriptor%",!0),l=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(l)try{l({},"a",{value:1})}catch{l=null}t.exports=function(b){var v=a(e,i,arguments);if(o&&l){var h=o(v,"length");h.configurable&&l(v,"length",{value:1+u(0,b.length-(arguments.length-1))})}return v};var f=function(){return a(e,n,arguments)};l?l(t.exports,"apply",{value:f}):t.exports.apply=f}(Uv)),Uv.exports}var Gv,Kw;function yM(){if(Kw)return Gv;Kw=1;var t=y1(),e=mM(),r=e(t("String.prototype.indexOf"));return Gv=function(i,a){var o=t(i,!!a);return typeof o=="function"&&r(i,".prototype.")>-1?e(o):o},Gv}const bM={},_M=Object.freeze(Object.defineProperty({__proto__:null,default:bM},Symbol.toStringTag,{value:"Module"})),wM=Ya(_M);var Hv,Xw;function SM(){if(Xw)return Hv;Xw=1;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=t&&e&&typeof e.get=="function"?e.get:null,n=t&&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,y=typeof WeakSet=="function"&&WeakSet.prototype,b=y?WeakSet.prototype.has:null,v=typeof WeakRef=="function"&&WeakRef.prototype,h=v?WeakRef.prototype.deref:null,w=Boolean.prototype.valueOf,E=Object.prototype.toString,S=Function.prototype.toString,_=String.prototype.match,p=String.prototype.slice,d=String.prototype.replace,g=String.prototype.toUpperCase,m=String.prototype.toLowerCase,x=RegExp.prototype.test,P=Array.prototype.concat,O=Array.prototype.join,R=Array.prototype.slice,T=Math.floor,C=typeof BigInt=="function"?BigInt.prototype.valueOf:null,N=Object.getOwnPropertySymbols,F=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,H=typeof Symbol=="function"&&typeof Symbol.iterator=="object",z=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===H||"symbol")?Symbol.toStringTag:null,Y=Object.prototype.propertyIsEnumerable,G=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(se){return se.__proto__}:null);function W(se,re){if(se===1/0||se===-1/0||se!==se||se&&se>-1e3&&se<1e3||x.call(/e/,re))return re;var ke=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof se=="number"){var Ie=se<0?-T(-se):T(se);if(Ie!==se){var ve=String(Ie),Ce=p.call(re,ve.length+1);return d.call(ve,ke,"$&_")+"."+d.call(d.call(Ce,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(re,ke,"$&_")}var j=wM,M=j.custom,k=Z(M)?M:null;Hv=function se(re,ke,Ie,ve){var Ce=ke||{};if(pe(Ce,"quoteStyle")&&Ce.quoteStyle!=="single"&&Ce.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(pe(Ce,"maxStringLength")&&(typeof Ce.maxStringLength=="number"?Ce.maxStringLength<0&&Ce.maxStringLength!==1/0:Ce.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Se=pe(Ce,"customInspect")?Ce.customInspect:!0;if(typeof Se!="boolean"&&Se!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(pe(Ce,"indent")&&Ce.indent!==null&&Ce.indent!==" "&&!(parseInt(Ce.indent,10)===Ce.indent&&Ce.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(pe(Ce,"numericSeparator")&&typeof Ce.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var $e=Ce.numericSeparator;if(typeof re>"u")return"undefined";if(re===null)return"null";if(typeof re=="boolean")return re?"true":"false";if(typeof re=="string")return ue(re,Ce);if(typeof re=="number"){if(re===0)return 1/0/re>0?"0":"-0";var Oe=String(re);return $e?W(re,Oe):Oe}if(typeof re=="bigint"){var Ue=String(re)+"n";return $e?W(re,Ue):Ue}var Je=typeof Ce.depth>"u"?5:Ce.depth;if(typeof Ie>"u"&&(Ie=0),Ie>=Je&&Je>0&&typeof re=="object")return q(re)?"[Array]":"[Object]";var wt=Be(Ce,Ie);if(typeof ve>"u")ve=[];else if(xe(ve,re)>=0)return"[Circular]";function _t(ga,dl,Ip){if(dl&&(ve=R.call(ve),ve.push(dl)),Ip){var Nc={depth:Ce.depth};return pe(Ce,"quoteStyle")&&(Nc.quoteStyle=Ce.quoteStyle),se(ga,Nc,Ie+1,ve)}return se(ga,Ce,Ie+1,ve)}if(typeof re=="function"&&!$(re)){var De=Re(re),Ke=Qe(re,_t);return"[Function"+(De?": "+De:" (anonymous)")+"]"+(Ke.length>0?" { "+O.call(Ke,", ")+" }":"")}if(Z(re)){var ct=H?d.call(String(re),/^(Symbol\(.*\))_[^)]*$/,"$1"):F.call(re);return typeof re=="object"&&!H?Ne(ct):ct}if(fe(re)){for(var At="<"+m.call(String(re.nodeName)),Wt=re.attributes||[],zr=0;zr<Wt.length;zr++)At+=" "+Wt[zr].name+"="+D(B(Wt[zr].value),"double",Ce);return At+=">",re.childNodes&&re.childNodes.length&&(At+="..."),At+="</"+m.call(String(re.nodeName))+">",At}if(q(re)){if(re.length===0)return"[]";var br=Qe(re,_t);return wt&&!Te(br)?"["+Ze(br,wt)+"]":"[ "+O.call(br,", ")+" ]"}if(U(re)){var Ar=Qe(re,_t);return!("cause"in Error.prototype)&&"cause"in re&&!Y.call(re,"cause")?"{ ["+String(re)+"] "+O.call(P.call("[cause]: "+_t(re.cause),Ar),", ")+" }":Ar.length===0?"["+String(re)+"]":"{ ["+String(re)+"] "+O.call(Ar,", ")+" }"}if(typeof re=="object"&&Se){if(k&&typeof re[k]=="function"&&j)return j(re,{depth:Je-Ie});if(Se!=="symbol"&&typeof re.inspect=="function")return re.inspect()}if(le(re)){var Br=[];return n&&n.call(re,function(ga,dl){Br.push(_t(dl,re,!0)+" => "+_t(ga,re))}),Ye("Map",r.call(re),Br,wt)}if(_e(re)){var Ni=[];return l&&l.call(re,function(ga){Ni.push(_t(ga,re))}),Ye("Set",o.call(re),Ni,wt)}if(ce(re))return Xe("WeakMap");if(te(re))return Xe("WeakSet");if(be(re))return Xe("WeakRef");if(Q(re))return Ne(_t(Number(re)));if(ne(re))return Ne(_t(C.call(re)));if(ee(re))return Ne(w.call(re));if(X(re))return Ne(_t(String(re)));if(!K(re)&&!$(re)){var Sn=Qe(re,_t),En=G?G(re)===Object.prototype:re instanceof Object||re.constructor===Object,co=re instanceof Object?"":"null prototype",pa=!En&&z&&Object(re)===re&&z in re?p.call(we(re),8,-1):co?"Object":"",js=En||typeof re.constructor!="function"?"":re.constructor.name?re.constructor.name+" ":"",Mi=js+(pa||co?"["+O.call(P.call([],pa||[],co||[]),": ")+"] ":"");return Sn.length===0?Mi+"{}":wt?Mi+"{"+Ze(Sn,wt)+"}":Mi+"{ "+O.call(Sn,", ")+" }"}return String(re)};function D(se,re,ke){var Ie=(ke.quoteStyle||re)==="double"?'"':"'";return Ie+se+Ie}function B(se){return d.call(String(se),/"/g,"&quot;")}function q(se){return we(se)==="[object Array]"&&(!z||!(typeof se=="object"&&z in se))}function K(se){return we(se)==="[object Date]"&&(!z||!(typeof se=="object"&&z in se))}function $(se){return we(se)==="[object RegExp]"&&(!z||!(typeof se=="object"&&z in se))}function U(se){return we(se)==="[object Error]"&&(!z||!(typeof se=="object"&&z in se))}function X(se){return we(se)==="[object String]"&&(!z||!(typeof se=="object"&&z in se))}function Q(se){return we(se)==="[object Number]"&&(!z||!(typeof se=="object"&&z in se))}function ee(se){return we(se)==="[object Boolean]"&&(!z||!(typeof se=="object"&&z in se))}function Z(se){if(H)return se&&typeof se=="object"&&se instanceof Symbol;if(typeof se=="symbol")return!0;if(!se||typeof se!="object"||!F)return!1;try{return F.call(se),!0}catch{}return!1}function ne(se){if(!se||typeof se!="object"||!C)return!1;try{return C.call(se),!0}catch{}return!1}var ie=Object.prototype.hasOwnProperty||function(se){return se in this};function pe(se,re){return ie.call(se,re)}function we(se){return E.call(se)}function Re(se){if(se.name)return se.name;var re=_.call(S.call(se),/^function\s*([\w$]+)/);return re?re[1]:null}function xe(se,re){if(se.indexOf)return se.indexOf(re);for(var ke=0,Ie=se.length;ke<Ie;ke++)if(se[ke]===re)return ke;return-1}function le(se){if(!r||!se||typeof se!="object")return!1;try{r.call(se);try{o.call(se)}catch{return!0}return se instanceof Map}catch{}return!1}function ce(se){if(!f||!se||typeof se!="object")return!1;try{f.call(se,f);try{b.call(se,b)}catch{return!0}return se instanceof WeakMap}catch{}return!1}function be(se){if(!h||!se||typeof se!="object")return!1;try{return h.call(se),!0}catch{}return!1}function _e(se){if(!o||!se||typeof se!="object")return!1;try{o.call(se);try{r.call(se)}catch{return!0}return se instanceof Set}catch{}return!1}function te(se){if(!b||!se||typeof se!="object")return!1;try{b.call(se,b);try{f.call(se,f)}catch{return!0}return se instanceof WeakSet}catch{}return!1}function fe(se){return!se||typeof se!="object"?!1:typeof HTMLElement<"u"&&se instanceof HTMLElement?!0:typeof se.nodeName=="string"&&typeof se.getAttribute=="function"}function ue(se,re){if(se.length>re.maxStringLength){var ke=se.length-re.maxStringLength,Ie="... "+ke+" more character"+(ke>1?"s":"");return ue(p.call(se,0,re.maxStringLength),re)+Ie}var ve=d.call(d.call(se,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,me);return D(ve,"single",re)}function me(se){var re=se.charCodeAt(0),ke={8:"b",9:"t",10:"n",12:"f",13:"r"}[re];return ke?"\\"+ke:"\\x"+(re<16?"0":"")+g.call(re.toString(16))}function Ne(se){return"Object("+se+")"}function Xe(se){return se+" { ? }"}function Ye(se,re,ke,Ie){var ve=Ie?Ze(ke,Ie):O.call(ke,", ");return se+" ("+re+") {"+ve+"}"}function Te(se){for(var re=0;re<se.length;re++)if(xe(se[re],`
138
+ `)>=0)return!1;return!0}function Be(se,re){var ke;if(se.indent===" ")ke=" ";else if(typeof se.indent=="number"&&se.indent>0)ke=O.call(Array(se.indent+1)," ");else return null;return{base:ke,prev:O.call(Array(re+1),ke)}}function Ze(se,re){if(se.length===0)return"";var ke=`
139
+ `+re.prev+re.base;return ke+O.call(se,","+ke)+`
140
+ `+re.prev}function Qe(se,re){var ke=q(se),Ie=[];if(ke){Ie.length=se.length;for(var ve=0;ve<se.length;ve++)Ie[ve]=pe(se,ve)?re(se[ve],se):""}var Ce=typeof N=="function"?N(se):[],Se;if(H){Se={};for(var $e=0;$e<Ce.length;$e++)Se["$"+Ce[$e]]=Ce[$e]}for(var Oe in se)pe(se,Oe)&&(ke&&String(Number(Oe))===Oe&&Oe<se.length||H&&Se["$"+Oe]instanceof Symbol||(x.call(/[^\w$]/,Oe)?Ie.push(re(Oe,se)+": "+re(se[Oe],se)):Ie.push(Oe+": "+re(se[Oe],se))));if(typeof N=="function")for(var Ue=0;Ue<Ce.length;Ue++)Y.call(se,Ce[Ue])&&Ie.push("["+re(Ce[Ue])+"]: "+re(se[Ce[Ue]],se));return Ie}return Hv}var Vv,Qw;function EM(){if(Qw)return Vv;Qw=1;var t=y1(),e=yM(),r=SM(),n=t("%TypeError%"),i=t("%WeakMap%",!0),a=t("%Map%",!0),o=e("WeakMap.prototype.get",!0),l=e("WeakMap.prototype.set",!0),u=e("WeakMap.prototype.has",!0),f=e("Map.prototype.get",!0),y=e("Map.prototype.set",!0),b=e("Map.prototype.has",!0),v=function(S,_){for(var p=S,d;(d=p.next)!==null;p=d)if(d.key===_)return p.next=d.next,d.next=S.next,S.next=d,d},h=function(S,_){var p=v(S,_);return p&&p.value},w=function(S,_,p){var d=v(S,_);d?d.value=p:S.next={key:_,next:S.next,value:p}},E=function(S,_){return!!v(S,_)};return Vv=function(){var _,p,d,g={assert:function(m){if(!g.has(m))throw new n("Side channel does not contain "+r(m))},get:function(m){if(i&&m&&(typeof m=="object"||typeof m=="function")){if(_)return o(_,m)}else if(a){if(p)return f(p,m)}else if(d)return h(d,m)},has:function(m){if(i&&m&&(typeof m=="object"||typeof m=="function")){if(_)return u(_,m)}else if(a){if(p)return b(p,m)}else if(d)return E(d,m);return!1},set:function(m,x){i&&m&&(typeof m=="object"||typeof m=="function")?(_||(_=new i),l(_,m,x)):a?(p||(p=new a),y(p,m,x)):(d||(d={key:{},next:null}),w(d,m,x))}};return g},Vv}var qv,Zw;function b1(){if(Zw)return qv;Zw=1;var t=String.prototype.replace,e=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return qv={default:r.RFC3986,formatters:{RFC1738:function(n){return t.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},qv}var $v,Jw;function g8(){if(Jw)return $v;Jw=1;var t=b1(),e=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var E=[],S=0;S<256;++S)E.push("%"+((S<16?"0":"")+S.toString(16)).toUpperCase());return E}(),i=function(S){for(;S.length>1;){var _=S.pop(),p=_.obj[_.prop];if(r(p)){for(var d=[],g=0;g<p.length;++g)typeof p[g]<"u"&&d.push(p[g]);_.obj[_.prop]=d}}},a=function(S,_){for(var p=_&&_.plainObjects?Object.create(null):{},d=0;d<S.length;++d)typeof S[d]<"u"&&(p[d]=S[d]);return p},o=function E(S,_,p){if(!_)return S;if(typeof _!="object"){if(r(S))S.push(_);else if(S&&typeof S=="object")(p&&(p.plainObjects||p.allowPrototypes)||!e.call(Object.prototype,_))&&(S[_]=!0);else return[S,_];return S}if(!S||typeof S!="object")return[S].concat(_);var d=S;return r(S)&&!r(_)&&(d=a(S,p)),r(S)&&r(_)?(_.forEach(function(g,m){if(e.call(S,m)){var x=S[m];x&&typeof x=="object"&&g&&typeof g=="object"?S[m]=E(x,g,p):S.push(g)}else S[m]=g}),S):Object.keys(_).reduce(function(g,m){var x=_[m];return e.call(g,m)?g[m]=E(g[m],x,p):g[m]=x,g},d)},l=function(S,_){return Object.keys(_).reduce(function(p,d){return p[d]=_[d],p},S)},u=function(E,S,_){var p=E.replace(/\+/g," ");if(_==="iso-8859-1")return p.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(p)}catch{return p}},f=function(S,_,p,d,g){if(S.length===0)return S;var m=S;if(typeof S=="symbol"?m=Symbol.prototype.toString.call(S):typeof S!="string"&&(m=String(S)),p==="iso-8859-1")return escape(m).replace(/%u[0-9a-f]{4}/gi,function(R){return"%26%23"+parseInt(R.slice(2),16)+"%3B"});for(var x="",P=0;P<m.length;++P){var O=m.charCodeAt(P);if(O===45||O===46||O===95||O===126||O>=48&&O<=57||O>=65&&O<=90||O>=97&&O<=122||g===t.RFC1738&&(O===40||O===41)){x+=m.charAt(P);continue}if(O<128){x=x+n[O];continue}if(O<2048){x=x+(n[192|O>>6]+n[128|O&63]);continue}if(O<55296||O>=57344){x=x+(n[224|O>>12]+n[128|O>>6&63]+n[128|O&63]);continue}P+=1,O=65536+((O&1023)<<10|m.charCodeAt(P)&1023),x+=n[240|O>>18]+n[128|O>>12&63]+n[128|O>>6&63]+n[128|O&63]}return x},y=function(S){for(var _=[{obj:{o:S},prop:"o"}],p=[],d=0;d<_.length;++d)for(var g=_[d],m=g.obj[g.prop],x=Object.keys(m),P=0;P<x.length;++P){var O=x[P],R=m[O];typeof R=="object"&&R!==null&&p.indexOf(R)===-1&&(_.push({obj:m,prop:O}),p.push(R))}return i(_),S},b=function(S){return Object.prototype.toString.call(S)==="[object RegExp]"},v=function(S){return!S||typeof S!="object"?!1:!!(S.constructor&&S.constructor.isBuffer&&S.constructor.isBuffer(S))},h=function(S,_){return[].concat(S,_)},w=function(S,_){if(r(S)){for(var p=[],d=0;d<S.length;d+=1)p.push(_(S[d]));return p}return _(S)};return $v={arrayToObject:a,assign:l,combine:h,compact:y,decode:u,encode:f,isBuffer:v,isRegExp:b,maybeMap:w,merge:o},$v}var Wv,e3;function OM(){if(e3)return Wv;e3=1;var t=EM(),e=g8(),r=b1(),n=Object.prototype.hasOwnProperty,i={brackets:function(S){return S+"[]"},comma:"comma",indices:function(S,_){return S+"["+_+"]"},repeat:function(S){return S}},a=Array.isArray,o=Array.prototype.push,l=function(E,S){o.apply(E,a(S)?S:[S])},u=Date.prototype.toISOString,f=r.default,y={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:e.encode,encodeValuesOnly:!1,format:f,formatter:r.formatters[f],indices:!1,serializeDate:function(S){return u.call(S)},skipNulls:!1,strictNullHandling:!1},b=function(S){return typeof S=="string"||typeof S=="number"||typeof S=="boolean"||typeof S=="symbol"||typeof S=="bigint"},v={},h=function E(S,_,p,d,g,m,x,P,O,R,T,C,N,F,H,z){for(var Y=S,G=z,W=0,j=!1;(G=G.get(v))!==void 0&&!j;){var M=G.get(S);if(W+=1,typeof M<"u"){if(M===W)throw new RangeError("Cyclic object value");j=!0}typeof G.get(v)>"u"&&(W=0)}if(typeof P=="function"?Y=P(_,Y):Y instanceof Date?Y=T(Y):p==="comma"&&a(Y)&&(Y=e.maybeMap(Y,function(Z){return Z instanceof Date?T(Z):Z})),Y===null){if(g)return x&&!F?x(_,y.encoder,H,"key",C):_;Y=""}if(b(Y)||e.isBuffer(Y)){if(x){var k=F?_:x(_,y.encoder,H,"key",C);return[N(k)+"="+N(x(Y,y.encoder,H,"value",C))]}return[N(_)+"="+N(String(Y))]}var D=[];if(typeof Y>"u")return D;var B;if(p==="comma"&&a(Y))F&&x&&(Y=e.maybeMap(Y,x)),B=[{value:Y.length>0?Y.join(",")||null:void 0}];else if(a(P))B=P;else{var q=Object.keys(Y);B=O?q.sort(O):q}for(var K=d&&a(Y)&&Y.length===1?_+"[]":_,$=0;$<B.length;++$){var U=B[$],X=typeof U=="object"&&typeof U.value<"u"?U.value:Y[U];if(!(m&&X===null)){var Q=a(Y)?typeof p=="function"?p(K,U):K:K+(R?"."+U:"["+U+"]");z.set(S,W);var ee=t();ee.set(v,z),l(D,E(X,Q,p,d,g,m,p==="comma"&&F&&a(Y)?null:x,P,O,R,T,C,N,F,H,ee))}}return D},w=function(S){if(!S)return y;if(S.encoder!==null&&typeof S.encoder<"u"&&typeof S.encoder!="function")throw new TypeError("Encoder has to be a function.");var _=S.charset||y.charset;if(typeof S.charset<"u"&&S.charset!=="utf-8"&&S.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var p=r.default;if(typeof S.format<"u"){if(!n.call(r.formatters,S.format))throw new TypeError("Unknown format option provided.");p=S.format}var d=r.formatters[p],g=y.filter;return(typeof S.filter=="function"||a(S.filter))&&(g=S.filter),{addQueryPrefix:typeof S.addQueryPrefix=="boolean"?S.addQueryPrefix:y.addQueryPrefix,allowDots:typeof S.allowDots>"u"?y.allowDots:!!S.allowDots,charset:_,charsetSentinel:typeof S.charsetSentinel=="boolean"?S.charsetSentinel:y.charsetSentinel,delimiter:typeof S.delimiter>"u"?y.delimiter:S.delimiter,encode:typeof S.encode=="boolean"?S.encode:y.encode,encoder:typeof S.encoder=="function"?S.encoder:y.encoder,encodeValuesOnly:typeof S.encodeValuesOnly=="boolean"?S.encodeValuesOnly:y.encodeValuesOnly,filter:g,format:p,formatter:d,serializeDate:typeof S.serializeDate=="function"?S.serializeDate:y.serializeDate,skipNulls:typeof S.skipNulls=="boolean"?S.skipNulls:y.skipNulls,sort:typeof S.sort=="function"?S.sort:null,strictNullHandling:typeof S.strictNullHandling=="boolean"?S.strictNullHandling:y.strictNullHandling}};return Wv=function(E,S){var _=E,p=w(S),d,g;typeof p.filter=="function"?(g=p.filter,_=g("",_)):a(p.filter)&&(g=p.filter,d=g);var m=[];if(typeof _!="object"||_===null)return"";var x;S&&S.arrayFormat in i?x=S.arrayFormat:S&&"indices"in S?x=S.indices?"indices":"repeat":x="indices";var P=i[x];if(S&&"commaRoundTrip"in S&&typeof S.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var O=P==="comma"&&S&&S.commaRoundTrip;d||(d=Object.keys(_)),p.sort&&d.sort(p.sort);for(var R=t(),T=0;T<d.length;++T){var C=d[T];p.skipNulls&&_[C]===null||l(m,h(_[C],C,P,O,p.strictNullHandling,p.skipNulls,p.encode?p.encoder:null,p.filter,p.sort,p.allowDots,p.serializeDate,p.format,p.formatter,p.encodeValuesOnly,p.charset,R))}var N=m.join(p.delimiter),F=p.addQueryPrefix===!0?"?":"";return p.charsetSentinel&&(p.charset==="iso-8859-1"?F+="utf8=%26%2310003%3B&":F+="utf8=%E2%9C%93&"),N.length>0?F+N:""},Wv}var Yv,t3;function xM(){if(t3)return Yv;t3=1;var t=g8(),e=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:t.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(v){return v.replace(/&#(\d+);/g,function(h,w){return String.fromCharCode(parseInt(w,10))})},a=function(v,h){return v&&typeof v=="string"&&h.comma&&v.indexOf(",")>-1?v.split(","):v},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(h,w){var E={__proto__:null},S=w.ignoreQueryPrefix?h.replace(/^\?/,""):h,_=w.parameterLimit===1/0?void 0:w.parameterLimit,p=S.split(w.delimiter,_),d=-1,g,m=w.charset;if(w.charsetSentinel)for(g=0;g<p.length;++g)p[g].indexOf("utf8=")===0&&(p[g]===l?m="utf-8":p[g]===o&&(m="iso-8859-1"),d=g,g=p.length);for(g=0;g<p.length;++g)if(g!==d){var x=p[g],P=x.indexOf("]="),O=P===-1?x.indexOf("="):P+1,R,T;O===-1?(R=w.decoder(x,n.decoder,m,"key"),T=w.strictNullHandling?null:""):(R=w.decoder(x.slice(0,O),n.decoder,m,"key"),T=t.maybeMap(a(x.slice(O+1),w),function(C){return w.decoder(C,n.decoder,m,"value")})),T&&w.interpretNumericEntities&&m==="iso-8859-1"&&(T=i(T)),x.indexOf("[]=")>-1&&(T=r(T)?[T]:T),e.call(E,R)?E[R]=t.combine(E[R],T):E[R]=T}return E},f=function(v,h,w,E){for(var S=E?h:a(h,w),_=v.length-1;_>=0;--_){var p,d=v[_];if(d==="[]"&&w.parseArrays)p=[].concat(S);else{p=w.plainObjects?Object.create(null):{};var g=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,m=parseInt(g,10);!w.parseArrays&&g===""?p={0:S}:!isNaN(m)&&d!==g&&String(m)===g&&m>=0&&w.parseArrays&&m<=w.arrayLimit?(p=[],p[m]=S):g!=="__proto__"&&(p[g]=S)}S=p}return S},y=function(h,w,E,S){if(h){var _=E.allowDots?h.replace(/\.([^.[]+)/g,"[$1]"):h,p=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,g=E.depth>0&&p.exec(_),m=g?_.slice(0,g.index):_,x=[];if(m){if(!E.plainObjects&&e.call(Object.prototype,m)&&!E.allowPrototypes)return;x.push(m)}for(var P=0;E.depth>0&&(g=d.exec(_))!==null&&P<E.depth;){if(P+=1,!E.plainObjects&&e.call(Object.prototype,g[1].slice(1,-1))&&!E.allowPrototypes)return;x.push(g[1])}return g&&x.push("["+_.slice(g.index)+"]"),f(x,w,E,S)}},b=function(h){if(!h)return n;if(h.decoder!==null&&h.decoder!==void 0&&typeof h.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof h.charset<"u"&&h.charset!=="utf-8"&&h.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var w=typeof h.charset>"u"?n.charset:h.charset;return{allowDots:typeof h.allowDots>"u"?n.allowDots:!!h.allowDots,allowPrototypes:typeof h.allowPrototypes=="boolean"?h.allowPrototypes:n.allowPrototypes,allowSparse:typeof h.allowSparse=="boolean"?h.allowSparse:n.allowSparse,arrayLimit:typeof h.arrayLimit=="number"?h.arrayLimit:n.arrayLimit,charset:w,charsetSentinel:typeof h.charsetSentinel=="boolean"?h.charsetSentinel:n.charsetSentinel,comma:typeof h.comma=="boolean"?h.comma:n.comma,decoder:typeof h.decoder=="function"?h.decoder:n.decoder,delimiter:typeof h.delimiter=="string"||t.isRegExp(h.delimiter)?h.delimiter:n.delimiter,depth:typeof h.depth=="number"||h.depth===!1?+h.depth:n.depth,ignoreQueryPrefix:h.ignoreQueryPrefix===!0,interpretNumericEntities:typeof h.interpretNumericEntities=="boolean"?h.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof h.parameterLimit=="number"?h.parameterLimit:n.parameterLimit,parseArrays:h.parseArrays!==!1,plainObjects:typeof h.plainObjects=="boolean"?h.plainObjects:n.plainObjects,strictNullHandling:typeof h.strictNullHandling=="boolean"?h.strictNullHandling:n.strictNullHandling}};return Yv=function(v,h){var w=b(h);if(v===""||v===null||typeof v>"u")return w.plainObjects?Object.create(null):{};for(var E=typeof v=="string"?u(v,w):v,S=w.plainObjects?Object.create(null):{},_=Object.keys(E),p=0;p<_.length;++p){var d=_[p],g=y(d,E[d],w,typeof v=="string");S=t.merge(S,g,w)}return w.allowSparse===!0?S:t.compact(S)},Yv}var Kv,r3;function PM(){if(r3)return Kv;r3=1;var t=OM(),e=xM(),r=b1();return Kv={formats:r,parse:e,stringify:t},Kv}var n3;function v8(){if(n3)return xo;n3=1;var t=fM();function e(){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",`
141
+ `," "],o=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(o),u=["%","/","?",";","#"].concat(l),f=["/","?","#"],y=255,b=/^[+a-z0-9A-Z_-]{0,63}$/,v=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},S=PM();function _(m,x,P){if(m&&typeof m=="object"&&m instanceof e)return m;var O=new e;return O.parse(m,x,P),O}e.prototype.parse=function(m,x,P){if(typeof m!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof m);var O=m.indexOf("?"),R=O!==-1&&O<m.indexOf("#")?"?":"#",T=m.split(R),C=/\\/g;T[0]=T[0].replace(C,"/"),m=T.join(R);var N=m;if(N=N.trim(),!P&&m.split("#").length===1){var F=i.exec(N);if(F)return this.path=N,this.href=N,this.pathname=F[1],F[2]?(this.search=F[2],x?this.query=S.parse(this.search.substr(1)):this.query=this.search.substr(1)):x&&(this.search="",this.query={}),this}var H=r.exec(N);if(H){H=H[0];var z=H.toLowerCase();this.protocol=z,N=N.substr(H.length)}if(P||H||N.match(/^\/\/[^@/]+@[^@/]+/)){var Y=N.substr(0,2)==="//";Y&&!(H&&w[H])&&(N=N.substr(2),this.slashes=!0)}if(!w[H]&&(Y||H&&!E[H])){for(var G=-1,W=0;W<f.length;W++){var j=N.indexOf(f[W]);j!==-1&&(G===-1||j<G)&&(G=j)}var M,k;G===-1?k=N.lastIndexOf("@"):k=N.lastIndexOf("@",G),k!==-1&&(M=N.slice(0,k),N=N.slice(k+1),this.auth=decodeURIComponent(M)),G=-1;for(var W=0;W<u.length;W++){var j=N.indexOf(u[W]);j!==-1&&(G===-1||j<G)&&(G=j)}G===-1&&(G=N.length),this.host=N.slice(0,G),N=N.slice(G),this.parseHost(),this.hostname=this.hostname||"";var D=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!D)for(var B=this.hostname.split(/\./),W=0,q=B.length;W<q;W++){var K=B[W];if(K&&!K.match(b)){for(var $="",U=0,X=K.length;U<X;U++)K.charCodeAt(U)>127?$+="x":$+=K[U];if(!$.match(b)){var Q=B.slice(0,W),ee=B.slice(W+1),Z=K.match(v);Z&&(Q.push(Z[1]),ee.unshift(Z[2])),ee.length&&(N="/"+ee.join(".")+N),this.hostname=Q.join(".");break}}}this.hostname.length>y?this.hostname="":this.hostname=this.hostname.toLowerCase(),D||(this.hostname=t.toASCII(this.hostname));var ne=this.port?":"+this.port:"",ie=this.hostname||"";this.host=ie+ne,this.href+=this.host,D&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),N[0]!=="/"&&(N="/"+N))}if(!h[z])for(var W=0,q=l.length;W<q;W++){var pe=l[W];if(N.indexOf(pe)!==-1){var we=encodeURIComponent(pe);we===pe&&(we=escape(pe)),N=N.split(pe).join(we)}}var Re=N.indexOf("#");Re!==-1&&(this.hash=N.substr(Re),N=N.slice(0,Re));var xe=N.indexOf("?");if(xe!==-1?(this.search=N.substr(xe),this.query=N.substr(xe+1),x&&(this.query=S.parse(this.query)),N=N.slice(0,xe)):x&&(this.search="",this.query={}),N&&(this.pathname=N),E[z]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ne=this.pathname||"",le=this.search||"";this.path=ne+le}return this.href=this.format(),this};function p(m){return typeof m=="string"&&(m=_(m)),m instanceof e?m.format():e.prototype.format.call(m)}e.prototype.format=function(){var m=this.auth||"";m&&(m=encodeURIComponent(m),m=m.replace(/%3A/i,":"),m+="@");var x=this.protocol||"",P=this.pathname||"",O=this.hash||"",R=!1,T="";this.host?R=m+this.host:this.hostname&&(R=m+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(R+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(T=S.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var C=this.search||T&&"?"+T||"";return x&&x.substr(-1)!==":"&&(x+=":"),this.slashes||(!x||E[x])&&R!==!1?(R="//"+(R||""),P&&P.charAt(0)!=="/"&&(P="/"+P)):R||(R=""),O&&O.charAt(0)!=="#"&&(O="#"+O),C&&C.charAt(0)!=="?"&&(C="?"+C),P=P.replace(/[?#]/g,function(N){return encodeURIComponent(N)}),C=C.replace("#","%23"),x+R+P+C+O};function d(m,x){return _(m,!1,!0).resolve(x)}e.prototype.resolve=function(m){return this.resolveObject(_(m,!1,!0)).format()};function g(m,x){return m?_(m,!1,!0).resolveObject(x):x}return e.prototype.resolveObject=function(m){if(typeof m=="string"){var x=new e;x.parse(m,!1,!0),m=x}for(var P=new e,O=Object.keys(this),R=0;R<O.length;R++){var T=O[R];P[T]=this[T]}if(P.hash=m.hash,m.href==="")return P.href=P.format(),P;if(m.slashes&&!m.protocol){for(var C=Object.keys(m),N=0;N<C.length;N++){var F=C[N];F!=="protocol"&&(P[F]=m[F])}return E[P.protocol]&&P.hostname&&!P.pathname&&(P.pathname="/",P.path=P.pathname),P.href=P.format(),P}if(m.protocol&&m.protocol!==P.protocol){if(!E[m.protocol]){for(var H=Object.keys(m),z=0;z<H.length;z++){var Y=H[z];P[Y]=m[Y]}return P.href=P.format(),P}if(P.protocol=m.protocol,!m.host&&!w[m.protocol]){for(var q=(m.pathname||"").split("/");q.length&&!(m.host=q.shift()););m.host||(m.host=""),m.hostname||(m.hostname=""),q[0]!==""&&q.unshift(""),q.length<2&&q.unshift(""),P.pathname=q.join("/")}else P.pathname=m.pathname;if(P.search=m.search,P.query=m.query,P.host=m.host||"",P.auth=m.auth,P.hostname=m.hostname||m.host,P.port=m.port,P.pathname||P.search){var G=P.pathname||"",W=P.search||"";P.path=G+W}return P.slashes=P.slashes||m.slashes,P.href=P.format(),P}var j=P.pathname&&P.pathname.charAt(0)==="/",M=m.host||m.pathname&&m.pathname.charAt(0)==="/",k=M||j||P.host&&m.pathname,D=k,B=P.pathname&&P.pathname.split("/")||[],q=m.pathname&&m.pathname.split("/")||[],K=P.protocol&&!E[P.protocol];if(K&&(P.hostname="",P.port=null,P.host&&(B[0]===""?B[0]=P.host:B.unshift(P.host)),P.host="",m.protocol&&(m.hostname=null,m.port=null,m.host&&(q[0]===""?q[0]=m.host:q.unshift(m.host)),m.host=null),k=k&&(q[0]===""||B[0]==="")),M)P.host=m.host||m.host===""?m.host:P.host,P.hostname=m.hostname||m.hostname===""?m.hostname:P.hostname,P.search=m.search,P.query=m.query,B=q;else if(q.length)B||(B=[]),B.pop(),B=B.concat(q),P.search=m.search,P.query=m.query;else if(m.search!=null){if(K){P.host=B.shift(),P.hostname=P.host;var $=P.host&&P.host.indexOf("@")>0?P.host.split("@"):!1;$&&(P.auth=$.shift(),P.hostname=$.shift(),P.host=P.hostname)}return P.search=m.search,P.query=m.query,(P.pathname!==null||P.search!==null)&&(P.path=(P.pathname?P.pathname:"")+(P.search?P.search:"")),P.href=P.format(),P}if(!B.length)return P.pathname=null,P.search?P.path="/"+P.search:P.path=null,P.href=P.format(),P;for(var U=B.slice(-1)[0],X=(P.host||m.host||B.length>1)&&(U==="."||U==="..")||U==="",Q=0,ee=B.length;ee>=0;ee--)U=B[ee],U==="."?B.splice(ee,1):U===".."?(B.splice(ee,1),Q++):Q&&(B.splice(ee,1),Q--);if(!k&&!D)for(;Q--;Q)B.unshift("..");k&&B[0]!==""&&(!B[0]||B[0].charAt(0)!=="/")&&B.unshift(""),X&&B.join("/").substr(-1)!=="/"&&B.push("");var Z=B[0]===""||B[0]&&B[0].charAt(0)==="/";if(K){P.hostname=Z?"":B.length?B.shift():"",P.host=P.hostname;var $=P.host&&P.host.indexOf("@")>0?P.host.split("@"):!1;$&&(P.auth=$.shift(),P.hostname=$.shift(),P.host=P.hostname)}return k=k||P.host&&B.length,k&&!Z&&B.unshift(""),B.length>0?P.pathname=B.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=m.auth||P.auth,P.slashes=P.slashes||m.slashes,P.href=P.format(),P},e.prototype.parseHost=function(){var m=this.host,x=n.exec(m);x&&(x=x[0],x!==":"&&(this.port=x.substr(1)),m=m.substr(0,m.length-x.length)),m&&(this.hostname=m)},xo.parse=_,xo.resolve=d,xo.resolveObject=g,xo.format=p,xo.Url=e,xo}var Xv={exports:{}},i3;function AM(){return i3||(i3=1,function(t){(function(e,r){t.exports?t.exports=r():e.xmlserializer=r()})(ye,function(){var e=function(h){return h.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(h){return h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},n=function(h){return h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},i=function(h){var w=h.value;return" "+h.name+'="'+r(w)+'"'},a=function(h){var w=h.tagName;return h.namespaceURI==="http://www.w3.org/1999/xhtml"&&(w=w.toLowerCase()),w},o=function(h,w){var E=Array.prototype.map.call(h.attributes||h.attrs,function(S){return S.name}).indexOf("xmlns")>=0;return!E&&(w||h.namespaceURI!==h.parentNode.namespaceURI)?' xmlns="'+h.namespaceURI+'"':""},l=function(h){return Array.prototype.map.call(h.childNodes,function(w){return v(w)}).join("")},u=function(h,w){var E="<"+a(h);return E+=o(h,w),Array.prototype.forEach.call(h.attributes||h.attrs,function(S){E+=i(S)}),h.childNodes.length>0?(E+=">",E+=l(h),E+="</"+a(h)+">"):E+="/>",E},f=function(h){var w=h.nodeValue||h.value||"";return n(w)},y=function(h){return"<!--"+h.data.replace(/-/g,"&#45;")+"-->"},b=function(h){return"<![CDATA["+h.nodeValue+"]]>"},v=function(h,w){var E=w&&w.rootNode;if(h.nodeName==="#document"||h.nodeName==="#document-fragment")return l(h);if(h.tagName)return u(h,E);if(h.nodeName==="#text")return f(h);if(h.nodeName==="#comment")return y(h);if(h.nodeName==="#cdata-section")return b(h)};return{serializeToString:function(h){return e(v(h,{rootNode:!0}))}}})}(Xv)),Xv.exports}var Qv={},a3;function kM(){if(a3)return Qv;a3=1;var t=function(a){var o=new XMLSerializer;return Array.prototype.map.call(a.childNodes,function(l){return o.serializeToString(l)}).join("")},e=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[^>]*>(.+?)
142
+ ?</div>`),new RegExp(`^(.+)
143
+ `)],n=function(a){var o=t(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=e(a);if(l!==void 0)throw o=n(l)||"Parse error",new Error(o)};return Qv.failOnParseError=function(a){return i(a),a},Qv}var Zv={},Jv={},o3;function kp(){return o3||(o3=1,function(t){var e=v8();t.getDocumentBaseUrl=function(l){return l.baseURI!=="about:blank"?l.baseURI:null},t.clone=function(l){var u={},f;for(f in l)l.hasOwnProperty(f)&&(u[f]=l[f]);return u},t.cloneArray=function(l){return Array.prototype.slice.apply(l,[0])},t.joinUrl=function(l,u){return l?e.resolve(l,u):u},t.isDataUri=function(l){return/^data:/.test(l)},t.collectAndReportErrors=function(l){var u=[];return Promise.all(l.map(function(f){return f.catch(function(y){u.push(y)})})).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};t.ajax=function(l,u){return new Promise(function(f,y){var b=new window.XMLHttpRequest,v=t.joinUrl(u.baseUrl,l),h,w=function(){y({msg:"Unable to load url",url:v})};h=n(v,u.cache),b.addEventListener("load",function(){b.status===200||b.status===0?f(b.response):w()},!1),b.addEventListener("error",w,!1);try{b.open("GET",h,!0),b.overrideMimeType(u.mimeType),b.send(null)}catch{w()}})},t.binaryAjax=function(l,u){var f=t.clone(u);return f.mimeType="text/plain; charset=x-user-defined",t.ajax(l,f).then(function(y){for(var b="",v=0;v<y.length;v++)b+=String.fromCharCode(y.charCodeAt(v)&255);return b})};var i=function(l){var u=function(f,y){return f.substring(0,y.length)===y};return u(l,"<?xml")||u(l,"<svg")?"image/svg+xml":"image/png"};t.getDataURIForImageURL=function(l,u){return t.binaryAjax(l,u).then(function(f){var y=btoa(f),b=i(f);return"data:"+b+";base64,"+y})};var a=[],o=function(l){return a.indexOf(l)<0&&a.push(l),a.indexOf(l)};t.memoize=function(l,u,f){if(typeof f!="object")throw new Error("cacheBucket is not an object");return function(){var y=Array.prototype.slice.call(arguments),b=u(y),v=o(l),h;return f[v]&&f[v][b]?f[v][b]:(h=l.apply(null,y),f[v]=f[v]||{},f[v][b]=h,h)}}}(Jv)),Jv}var e0={},l3;function TM(){if(l3)return e0;l3=1;var t=kp(),e=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=t.getDocumentBaseUrl(a.ownerDocument),f=t.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),t.getDataURIForImageURL(l,f).then(function(y){return y},function(y){throw{resourceType:"image",url:y.url,msg:"Unable to load image "+y.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&&!t.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 e0.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 y=r(l);return t.collectAndReportErrors(y.map(function(b){return e(b,o).then(function(v){b.attributes.src?b.attributes.src.value=v:b.attributes["xlink:href"]?b.attributes["xlink:href"].value=v:b.attributes.href&&(b.attributes.href.value=v)})}))},e0}var t0={},s3;function CM(){if(s3)return t0;s3=1;var t=kp(),e=function(a,o){var l=a.attributes.src.value,u=t.getDocumentBaseUrl(a.ownerDocument),f=t.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),t.ajax(l,f).catch(function(y){throw{resourceType:"script",url:y.url,msg:"Unable to load script "+y.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 t0.inline=function(a,o){var l=i(a);return t.collectAndReportErrors(l.map(function(u){return e(u,o).then(function(f){n(u,f)})}))},t0}var r0={},n0={},u3;function _1(){return u3||(u3=1,function(t){t.unquoteString=function(e){var r=/^"(.*)"$/,n=/^'(.*)'$/;return r.test(e)?e.replace(r,"$1"):n.test(e)?e.replace(n,"$1"):e},t.rulesForCssText=function(e){var r=document.implementation.createHTMLDocument(""),n=document.createElement("style"),i;return n.textContent=e,r.body.appendChild(n),i=n.sheet.cssRules,Array.prototype.slice.call(i)},t.cssRulesToText=function(e){return e.reduce(function(r,n){return r+n.cssText},"")},t.exchangeRule=function(e,r,n){var i=e.indexOf(r);e[i]=t.rulesForCssText(n)[0]},t.changeFontFaceRuleSrc=function(e,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+"}",t.exchangeRule(e,r,i)}}(n0)),n0}var i0={},c3;function RM(){return c3||(c3=1,function(t){var e=_1(),r=function(a){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return a.replace(o,"$1")};t.extractCssUrl=function(a){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,l;if(!o.test(a))throw new Error("Invalid url");return l=o.exec(a)[1],e.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*$",y=new RegExp(u,"g"),b,v=[],h=function(w){var E=new RegExp(l,"g"),S=[],_;for(_=E.exec(w);_;)S.push(_[1]),_=E.exec(w);return S};if(a.match(new RegExp(f))){for(b=y.exec(a);b;)v.push(h(b[0])),b=y.exec(a);return v}return[]},i=function(a){var o,l;for(o=0;o<a.length;o++)try{return l=t.extractCssUrl(a[o]),{url:l,idx:o}}catch{}};t.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}})},t.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(", ")}}(i0)),i0}function Zf(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var a0={exports:{}},f3;function NM(){return f3||(f3=1,function(t,e){(function(r){t.exports=r()})(function(){return function r(n,i,a){function o(f,y){if(!i[f]){if(!n[f]){var b=typeof Zf=="function"&&Zf;if(!y&&b)return b(f,!0);if(l)return l(f,!0);var v=new Error("Cannot find module '"+f+"'");throw v.code="MODULE_NOT_FOUND",v}var h=i[f]={exports:{}};n[f][0].call(h.exports,function(w){var E=n[f][1][w];return o(E||w)},h,h.exports,r,n,i,a)}return i[f].exports}for(var l=typeof Zf=="function"&&Zf,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,f){function y(){this.constructor=u}y.prototype=f.prototype,u.prototype=new y}function o(u,f,y,b){this.message=u,this.expected=f,this.found=y,this.location=b,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,f){var y={literal:function(_){return'"'+v(_.text)+'"'},class:function(_){var p="",d;for(d=0;d<_.parts.length;d++)p+=_.parts[d]instanceof Array?h(_.parts[d][0])+"-"+h(_.parts[d][1]):h(_.parts[d]);return"["+(_.inverted?"^":"")+p+"]"},any:function(_){return"any character"},end:function(_){return"end of input"},other:function(_){return _.description}};function b(_){return _.charCodeAt(0).toString(16).toUpperCase()}function v(_){return _.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(p){return"\\x0"+b(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+b(p)})}function h(_){return _.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(p){return"\\x0"+b(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+b(p)})}function w(_){return y[_.type](_)}function E(_){var p=new Array(_.length),d,g;for(d=0;d<_.length;d++)p[d]=w(_[d]);if(p.sort(),p.length>0){for(d=1,g=1;d<p.length;d++)p[d-1]!==p[d]&&(p[g]=p[d],g++);p.length=g}switch(p.length){case 1:return p[0];case 2:return p[0]+" or "+p[1];default:return p.slice(0,-1).join(", ")+", or "+p[p.length-1]}}function S(_){return _?'"'+v(_)+'"':"end of input"}return"Expected "+E(u)+" but "+S(f)+" found."};function l(u,f){f=f!==void 0?f:{};var y={},b={start:ne},v=ne,h="",w=function(){return[]},E=",",S=K(",",!1),_=function(te,fe){return[te].concat(fe)},p=function(te){return[te]},d=function(te,fe){return{url:te,format:fe}},g=function(te){return{url:te}},m="url(",x=K("url(",!1),P=")",O=K(")",!1),R=function(te){return te},T="format(",C=K("format(",!1),N="local(",F=K("local(",!1),H=function(te){return{local:te}},z=/^[^)]/,Y=$([")"],!0,!1),G=function(te){return _e.extractValue(te.join(""))},W=/^[ \t\r\n\f]/,j=$([" "," ","\r",`
144
+ `,"\f"],!1,!1),M=0,k=[{line:1,column:1}],D=0,B=[],q;if("startRule"in f){if(!(f.startRule in b))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');v=b[f.startRule]}function K(te,fe){return{type:"literal",text:te,ignoreCase:fe}}function $(te,fe,ue){return{type:"class",parts:te,inverted:fe,ignoreCase:ue}}function U(){return{type:"end"}}function X(te){var fe=k[te],ue;if(fe)return fe;for(ue=te-1;!k[ue];)ue--;for(fe=k[ue],fe={line:fe.line,column:fe.column};ue<te;)u.charCodeAt(ue)===10?(fe.line++,fe.column=1):fe.column++,ue++;return k[te]=fe,fe}function Q(te,fe){var ue=X(te),me=X(fe);return{start:{offset:te,line:ue.line,column:ue.column},end:{offset:fe,line:me.line,column:me.column}}}function ee(te){M<D||(M>D&&(D=M,B=[]),B.push(te))}function Z(te,fe,ue){return new o(o.buildMessage(te,fe),te,fe,ue)}function ne(){var te,fe;return te=ie(),te===y&&(te=M,fe=h,fe!==y&&(fe=w()),te=fe),te}function ie(){var te,fe,ue,me,Ne,Xe;if(te=M,fe=pe(),fe!==y){for(ue=[],me=be();me!==y;)ue.push(me),me=be();if(ue!==y)if(u.charCodeAt(M)===44?(me=E,M++):(me=y,ee(S)),me!==y){for(Ne=[],Xe=be();Xe!==y;)Ne.push(Xe),Xe=be();Ne!==y?(Xe=ie(),Xe!==y?(fe=_(fe,Xe),te=fe):(M=te,te=y)):(M=te,te=y)}else M=te,te=y;else M=te,te=y}else M=te,te=y;return te===y&&(te=M,fe=pe(),fe!==y&&(fe=p(fe)),te=fe),te}function pe(){var te;return te=we(),te===y&&(te=le()),te}function we(){var te,fe,ue,me;if(te=M,fe=Re(),fe!==y){if(ue=[],me=be(),me!==y)for(;me!==y;)ue.push(me),me=be();else ue=y;ue!==y?(me=xe(),me!==y?(fe=d(fe,me),te=fe):(M=te,te=y)):(M=te,te=y)}else M=te,te=y;return te===y&&(te=M,fe=Re(),fe!==y&&(fe=g(fe)),te=fe),te}function Re(){var te,fe,ue,me;return te=M,u.substr(M,4)===m?(fe=m,M+=4):(fe=y,ee(x)),fe!==y?(ue=ce(),ue!==y?(u.charCodeAt(M)===41?(me=P,M++):(me=y,ee(O)),me!==y?(fe=R(ue),te=fe):(M=te,te=y)):(M=te,te=y)):(M=te,te=y),te}function xe(){var te,fe,ue,me;return te=M,u.substr(M,7)===T?(fe=T,M+=7):(fe=y,ee(C)),fe!==y?(ue=ce(),ue!==y?(u.charCodeAt(M)===41?(me=P,M++):(me=y,ee(O)),me!==y?(fe=R(ue),te=fe):(M=te,te=y)):(M=te,te=y)):(M=te,te=y),te}function le(){var te,fe,ue,me;return te=M,u.substr(M,6)===N?(fe=N,M+=6):(fe=y,ee(F)),fe!==y?(ue=ce(),ue!==y?(u.charCodeAt(M)===41?(me=P,M++):(me=y,ee(O)),me!==y?(fe=H(ue),te=fe):(M=te,te=y)):(M=te,te=y)):(M=te,te=y),te}function ce(){var te,fe,ue;if(te=M,fe=[],z.test(u.charAt(M))?(ue=u.charAt(M),M++):(ue=y,ee(Y)),ue!==y)for(;ue!==y;)fe.push(ue),z.test(u.charAt(M))?(ue=u.charAt(M),M++):(ue=y,ee(Y));else fe=y;return fe!==y&&(fe=G(fe)),te=fe,te}function be(){var te;return W.test(u.charAt(M))?(te=u.charAt(M),M++):(te=y,ee(j)),te}var _e=r("../util");if(q=v(),q!==y&&M===u.length)return q;throw q!==y&&M<u.length&&ee(U()),Z(B,D<u.length?u.charAt(D):null,D<u.length?Q(D,D+1):Q(D,D))}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)})}(a0)),a0.exports}var d3;function MM(){return d3||(d3=1,function(t){var e=kp(),r=_1(),n=RM(),i=NM(),a=function(p,d,g){p.style.setProperty(d,g,p.style.getPropertyPriority(d))},o=function(p){return p.filter(function(d){return d.type===window.CSSRule.STYLE_RULE&&(d.style.getPropertyValue("background-image")||d.style.getPropertyValue("background"))})},l=function(p){var d=[];return p.forEach(function(g){g.style.getPropertyValue("background-image")?d.push({property:"background-image",value:g.style.getPropertyValue("background-image"),rule:g}):g.style.getPropertyValue("background")&&d.push({property:"background",value:g.style.getPropertyValue("background"),rule:g})}),d},u=function(p){return p.filter(function(d){return d.type===window.CSSRule.FONT_FACE_RULE&&d.style.getPropertyValue("src")})},f=function(p){return p.filter(function(d){return d.type===window.CSSRule.IMPORT_RULE&&d.href})},y=function(p){var d=[];return p.forEach(function(g,m){g.url&&!e.isDataUri(g.url)&&d.push(m)}),d},b=function(p){var d=[];return p.forEach(function(g,m){g.url&&!e.isDataUri(g.url)&&d.push(m)}),d};t.adjustPathsOfCssResources=function(p,d){var g=o(d),m=l(g),x=!1;return m.forEach(function(P){var O=n.parse(P.value),R=y(O),T;R.length>0&&(R.forEach(function(C){var N=O[C].url,F=e.joinUrl(p,N);O[C].url=F}),T=n.serialize(O),a(P.rule,P.property,T),x=!0)}),u(d).forEach(function(P){var O=P.style.getPropertyValue("src"),R,T;try{R=i.parse(O)}catch{return}T=b(R),T.length>0&&(T.forEach(function(C){var N=R[C].url,F=e.joinUrl(p,N);R[C].url=F}),r.changeFontFaceRuleSrc(d,P,i.serialize(R)),x=!0)}),f(d).forEach(function(P){var O=P.href,R=e.joinUrl(p,O);r.exchangeRule(d,P,"@import url("+R+");"),x=!0}),x};var v=function(p,d,g){var m=p.indexOf(d);p.splice(m,1),g.forEach(function(x,P){p.splice(m+P,0,x)})},h=function(p,d,g,m){var x=d.href,P;return x=r.unquoteString(x),P=e.joinUrl(m.baseUrl,x),g.indexOf(P)>=0?(v(p,d,[]),Promise.resolve([])):(g.push(P),e.ajax(x,m).then(function(O){var R=r.rulesForCssText(O);return t.loadCSSImportsForRules(R,g,m).then(function(T){return t.adjustPathsOfCssResources(x,R),v(p,d,R),T.errors})},function(O){throw{resourceType:"stylesheet",url:O.url,msg:"Unable to load stylesheet "+O.url}}))};t.loadCSSImportsForRules=function(p,d,g){var m=f(p),x=[],P=!1;return Promise.all(m.map(function(O){return h(p,O,d,g).then(function(R){x=x.concat(R),P=!0},function(R){x.push(R)})})).then(function(){return{hasChanges:P,errors:x}})};var w=function(p,d){var g=n.parse(p),m=y(g),x=!1;return e.collectAndReportErrors(m.map(function(P){var O=g[P].url;return e.getDataURIForImageURL(O,d).then(function(R){g[P].url=R,x=!0},function(R){throw{resourceType:"backgroundImage",url:R.url,msg:"Unable to load background-image "+R.url}})})).then(function(P){return{backgroundValue:n.serialize(g),hasChanges:x,errors:P}})},E=function(p,d){var g=o(p),m=l(g),x=[],P=!1;return Promise.all(m.map(function(O){return w(O.value,d).then(function(R){R.hasChanges&&(a(O.rule,O.property,R.backgroundValue),P=!0),x=x.concat(R.errors)})})).then(function(){return{hasChanges:P,errors:x}})},S=function(p,d){var g=!1,m,x;try{m=i.parse(p)}catch{m=[]}return x=b(m),e.collectAndReportErrors(x.map(function(P){var O=m[P],R=O.format||"woff";return e.binaryAjax(O.url,d).then(function(T){var C=btoa(T);O.url="data:font/"+R+";base64,"+C,g=!0},function(T){throw{resourceType:"fontFace",url:T.url,msg:"Unable to load font-face "+T.url}})})).then(function(P){return{srcDeclarationValue:i.serialize(m),hasChanges:g,errors:P}})},_=function(p,d){var g=u(p),m=[],x=!1;return Promise.all(g.map(function(P){var O=P.style.getPropertyValue("src");return S(O,d).then(function(R){R.hasChanges&&(r.changeFontFaceRuleSrc(p,P,R.srcDeclarationValue),x=!0),m=m.concat(R.errors)})})).then(function(){return{hasChanges:x,errors:m}})};t.loadAndInlineCSSResourcesForRules=function(p,d){var g=!1,m=[];return Promise.all([E,_].map(function(x){return x(p,d).then(function(P){g=g||P.hasChanges,m=m.concat(P.errors)})})).then(function(){return{hasChanges:g,errors:m}})}}(r0)),r0}var h3;function IM(){return h3||(h3=1,function(t){var e=kp(),r=TM(),n=CM(),i=MM(),a=_1(),o=function(S){return e.joinUrl(S,".")},l=function(S){var _=S.map(function(p,d){return d===S.length-1&&(p={baseUrl:o(p.baseUrl)}),JSON.stringify(p)});return _},u=function(S,_){return _.cache!==!1&&_.cache!=="none"&&_.cacheBucket?e.memoize(S,l,_.cacheBucket):S},f=function(S,_,p){var d=a.rulesForCssText(S);return i.loadCSSImportsForRules(d,_,p).then(function(g){return i.loadAndInlineCSSResourcesForRules(d,p).then(function(m){var x=g.errors.concat(m.errors),P=g.hasChanges||m.hasChanges;return P&&(S=a.cssRulesToText(d)),{hasChanges:P,content:S,errors:x}})})},y=function(S,_,p){var d=S.textContent,g=u(f,_);return g(d,p,_).then(function(m){return m.hasChanges&&(S.childNodes[0].nodeValue=m.content),e.cloneArray(m.errors)})},b=function(S){var _=S.getElementsByTagName("style");return Array.prototype.filter.call(_,function(p){return!p.attributes.type||p.attributes.type.value==="text/css"})};t.loadAndInlineStyles=function(S,_){var p=b(S),d=[],g=[],m;return m=e.clone(_),m.baseUrl=m.baseUrl||e.getDocumentBaseUrl(S),Promise.all(p.map(function(x){return y(x,m,g).then(function(P){d=d.concat(P)})})).then(function(){return d})};var v=function(S,_){var p=S.parentNode,d;_=_.trim(),_&&(d=S.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(S.ownerDocument.createTextNode(_)),p.insertBefore(d,S)),p.removeChild(S)},h=function(S,_){return e.ajax(S,_).then(function(p){var d=a.rulesForCssText(p);return{content:p,cssRules:d}}).then(function(p){var d=i.adjustPathsOfCssResources(S,p.cssRules);return{content:p.content,cssRules:p.cssRules,hasChanges:d}}).then(function(p){return i.loadCSSImportsForRules(p.cssRules,[],_).then(function(d){return{content:p.content,cssRules:p.cssRules,hasChanges:p.hasChanges||d.hasChanges,errors:d.errors}})}).then(function(p){return i.loadAndInlineCSSResourcesForRules(p.cssRules,_).then(function(d){return{content:p.content,cssRules:p.cssRules,hasChanges:p.hasChanges||d.hasChanges,errors:p.errors.concat(d.errors)}})}).then(function(p){var d=p.content;return p.hasChanges&&(d=a.cssRulesToText(p.cssRules)),{content:d,errors:p.errors}})},w=function(S,_){var p=S.attributes.href.value,d=e.getDocumentBaseUrl(S.ownerDocument),g=e.clone(_);!g.baseUrl&&d&&(g.baseUrl=d);var m=u(h,_);return m(p,g).then(function(x){return{content:x.content,errors:e.cloneArray(x.errors)}})},E=function(S){var _=S.getElementsByTagName("link");return Array.prototype.filter.call(_,function(p){return p.attributes.rel&&p.attributes.rel.value==="stylesheet"&&(!p.attributes.type||p.attributes.type.value==="text/css")})};t.loadAndInlineCssLinks=function(S,_){var p=E(S),d=[];return Promise.all(p.map(function(g){return w(g,_).then(function(m){v(g,m.content+`
145
+ `),d=d.concat(m.errors)},function(m){d.push({resourceType:"stylesheet",url:m.url,msg:"Unable to load stylesheet "+m.url})})})).then(function(){return d})},t.loadAndInlineImages=r.inline,t.loadAndInlineScript=n.inline,t.inlineReferences=function(S,_){var p=[],d=[t.loadAndInlineImages,t.loadAndInlineStyles,t.loadAndInlineCssLinks];return _.inlineScripts!==!1&&d.push(t.loadAndInlineScript),Promise.all(d.map(function(g){return g(S,_).then(function(m){p=p.concat(m)})})).then(function(){return p})}}(Zv)),Zv}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
146
+ * http://www.github.com/cburgmer/rasterizeHTML.js
147
+ * Copyright (c) 2022 Christoph Burgmer; Licensed MIT */(function(t){(function(e,r){e===void 0&&window!==void 0&&(e=window),t.exports?t.exports=r(v8(),AM(),kM(),IM()):e.rasterizeHTML=r(e.url,e.xmlserializer,e.sanedomparsererror,e.inlineresources)})(ye,function(e,r,n,i){var a=function(w){var E={},S=[];E.joinUrl=function(d,g){return d?w.resolve(d,g):g},E.getConstantUniqueIdFor=function(d){return S.indexOf(d)<0&&S.push(d),S.indexOf(d)},E.clone=function(d){var g={},m;for(m in d)d.hasOwnProperty(m)&&(g[m]=d[m]);return g};var _=function(d){return typeof d=="object"&&d!==null},p=function(d){return _(d)&&Object.prototype.toString.apply(d).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return E.parseOptionalParameters=function(d){var g={canvas:null,options:{}};return d[0]==null||p(d[0])?(g.canvas=d[0]||null,g.options=E.clone(d[1])):g.options=E.clone(d[0]),g},E}(e),o=function(w){var E={},S=function(_,p,d){var g=_[p];return _[p]=function(){var m=Array.prototype.slice.call(arguments);return d.apply(this,[m,g])},g};return E.baseUrlRespectingXhr=function(_,p){var d=function(){var g=new _;return S(g,"open",function(m,x){var P=m.shift(),O=m.shift(),R=w.joinUrl(p,O);return x.apply(this,[P,R].concat(m))}),g};return d},E.finishNotifyingXhr=function(_){var p=0,d=0,g=!1,m,x=new Promise(function(O){m=function(){var R=p-d;R<=0&&g&&O({totalCount:p})}}),P=function(){var O=new _;return S(O,"send",function(R,T){return p+=1,T.apply(this,arguments)}),O.addEventListener("load",function(){d+=1,m()}),O};return P.waitForRequestsToFinish=function(){return g=!0,m(),x},P},E}(a),l=function(){var w={},E=function(P){return Array.prototype.slice.call(P)};w.addClassName=function(P,O){P.className+=" "+O},w.addClassNameRecursively=function(P,O){w.addClassName(P,O),P.parentNode!==P.ownerDocument&&w.addClassNameRecursively(P.parentNode,O)};var S=function(P,O){var R=P.parentStyleSheet,T=E(R.cssRules).indexOf(P);R.insertRule(O,T+1),R.deleteRule(T)},_=function(P,O){var R=P.cssText.replace(/^[^\{]+/,""),T=O+" "+R;S(P,T)},p=function(P){return E(P).reduce(function(O,R){return O+R.cssText},"")},d=function(P){P.textContent=p(P.sheet.cssRules)},g=function(P){var O=document.implementation.createHTMLDocument(""),R=document.createElement("style");R.textContent=P.textContent,O.body.appendChild(R),P.sheet=R.sheet},m=function(P){return"((?:^|[^.#:\\w])|(?=\\W))("+P.join("|")+")(?=\\W|$)"},x=function(P,O,R){var T=m(O);E(P.querySelectorAll("style")).forEach(function(C){typeof C.sheet>"u"&&g(C);var N=E(C.sheet.cssRules).filter(function(F){return F.selectorText&&new RegExp(T,"i").test(F.selectorText)});N.length&&(N.forEach(function(F){var H=F.selectorText.replace(new RegExp(T,"gi"),function(z,Y,G){return Y+R(G)});H!==F.selectorText&&_(F,H)}),d(C))})};return w.rewriteCssSelectorWith=function(P,O,R){x(P,[O],function(){return R})},w.lowercaseCssTypeSelectors=function(P,O){x(P,O,function(R){return R.toLowerCase()})},w.findHtmlOnlyNodeNames=function(P){var O=P.ownerDocument.createTreeWalker(P,NodeFilter.SHOW_ELEMENT),R={},T={},C;do C=O.currentNode.tagName.toLowerCase(),O.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?R[C]=!0:T[C]=!0;while(O.nextNode());return Object.keys(R).filter(function(N){return!T[N]})},w}(),u=function(w){var E={},S=function(p){return Array.prototype.slice.call(p)},_={active:!0,hover:!0,focus:!1,target:!1};return E.fakeUserAction=function(p,d,g){var m=p.querySelector(d),x=":"+g,P="rasterizehtml"+g;m&&(_[g]?w.addClassNameRecursively(m,P):w.addClassName(m,P),w.rewriteCssSelectorWith(p,x,"."+P))},E.persistInputValues=function(p){var d=p.querySelectorAll("input"),g=p.querySelectorAll("textarea"),m=function(x){return x.type==="checkbox"||x.type==="radio"};S(d).filter(m).forEach(function(x){x.checked?x.setAttribute("checked",""):x.removeAttribute("checked")}),S(d).filter(function(x){return!m(x)}).forEach(function(x){x.setAttribute("value",x.value)}),S(g).forEach(function(x){x.textContent=x.value})},E.rewriteTagNameSelectorsToLowerCase=function(p){w.lowercaseCssTypeSelectors(p,w.findHtmlOnlyNodeNames(p))},E}(l),f=function(w,E,S,_){var p={},d=function(G,W,j,M){var k=G.createElement(W);return k.style.visibility="hidden",k.style.width=j+"px",k.style.height=M+"px",k.style.position="absolute",k.style.top=-1e4-M+"px",k.style.left=-1e4-j+"px",G.getElementsByTagName("body")[0].appendChild(k),k},g=function(G){return G>0?new Promise(function(W){setTimeout(W,G)}):Promise.resolve()};p.executeJavascript=function(G,W){return new Promise(function(j){var M=d(_.document,"iframe",W.width,W.height),k=G.outerHTML,D=[],B=W.executeJsTimeout||0,q=function(){_.document.getElementsByTagName("body")[0].removeChild(M)},K=function(){var Q=M.contentDocument;j({document:Q,errors:D,cleanUp:q})},$=M.contentWindow.XMLHttpRequest,U=E.finishNotifyingXhr($),X=E.baseUrlRespectingXhr(U,W.baseUrl);M.onload=function(){g(B).then(U.waitForRequestsToFinish).then(K)},M.contentDocument.open(),M.contentWindow.XMLHttpRequest=X,M.contentWindow.onerror=function(Q){D.push({resourceType:"scriptExecution",msg:Q})},M.contentDocument.write("<!DOCTYPE html>"),M.contentDocument.write(k),M.contentDocument.close()})};var m=function(G,W,j){var M=G.createElement("iframe");return M.style.width=W+"px",M.style.height=j+"px",M.style.visibility="hidden",M.style.position="absolute",M.style.top=-1e4-j+"px",M.style.left=-1e4-W+"px",M.style.borderWidth=0,M.sandbox="allow-same-origin",M.scrolling="no",M},x=function(G,W,j){var M=Math.floor(G/j),k=Math.floor(W/j);return m(_.document,M,k)},P=function(G,W,j,M){return{width:Math.max(G.width*M,W),height:Math.max(G.height*M,j)}},O=function(G,W){var j=G.querySelector(W);if(j)return j;if(G.ownerDocument.querySelector(W)===G)return G;throw{message:"Clipping selector not found"}},R=function(G,W,j,M,k){var D=Math.max(G.scrollWidth,G.clientWidth),B=Math.max(G.scrollHeight,G.clientHeight),q,K,$,U,X,Q,ee,Z;return W?(Q=O(G,W),ee=Q.getBoundingClientRect(),q=ee.top,K=ee.left,$=ee.width,U=ee.height):(q=0,K=0,$=D,U=B),Z=P({width:$,height:U},j,M,k),X=_.getComputedStyle(G.ownerDocument.documentElement).fontSize,{left:K,top:q,width:Z.width,height:Z.height,viewportWidth:D,viewportHeight:B,rootFontSize:X}},T=function(G,W){var j=G.tagName;return W.querySelector(j)},C=function(G){var W=G.tagName.toLowerCase();return W==="html"||W==="body"?G.outerHTML:'<body style="margin: 0;">'+G.outerHTML+"</body>"};p.calculateDocumentContentSize=function(G,W){return new Promise(function(j,M){var k=W.zoom||1,D;D=x(W.width,W.height,k),_.document.getElementsByTagName("body")[0].appendChild(D),D.onload=function(){var B=D.contentDocument,q;try{q=R(T(G,B),W.clip,W.width,W.height,k),j(q)}catch(K){M(K)}finally{_.document.getElementsByTagName("body")[0].removeChild(D)}},D.contentDocument.open(),D.contentDocument.write("<!DOCTYPE html>"),D.contentDocument.write(C(G)),D.contentDocument.close()})},p.parseHtmlFragment=function(G){var W=_.document.implementation.createHTMLDocument("");W.documentElement.innerHTML=G;var j=W.querySelector("body").firstChild;if(!j)throw"Invalid source";return j};var N=function(G,W){var j=/<html((?:\s+[^>]*)?)>/im.exec(W),M=_.document.implementation.createHTMLDocument(""),k,D,B,q;if(j)for(k="<div"+j[1]+"></div>",M.documentElement.innerHTML=k,B=M.querySelector("div"),D=0;D<B.attributes.length;D++)q=B.attributes[D],G.documentElement.setAttribute(q.name,q.value)};p.parseHTML=function(G){var W=_.document.implementation.createHTMLDocument("");return W.documentElement.innerHTML=G,N(W,G),W};var F=function(G){try{return S.failOnParseError(G)}catch(W){throw{message:"Invalid source",originalError:W}}};p.validateXHTML=function(G){var W=new DOMParser,j=W.parseFromString(G,"application/xml");F(j)};var H=null,z=function(G,W){return W==="none"||W==="repeated"?((H===null||W!=="repeated")&&(H=Date.now()),G+"?_="+H):G},Y=function(G,W){return new Promise(function(j,M){var k=new window.XMLHttpRequest,D=w.joinUrl(W.baseUrl,G),B=z(D,W.cache),q=function(K){M({message:"Unable to load page",originalError:K})};k.addEventListener("load",function(){k.status===200||k.status===0?j(k.responseXML):q(k.statusText)},!1),k.addEventListener("error",function(K){q(K)},!1);try{k.open("GET",B,!0),k.responseType="document",k.send(null)}catch(K){q(K)}})};return p.loadDocument=function(G,W){return Y(G,W).then(function(j){return F(j)})},p}(a,o,n,window),y=function(w){var E={},S=function(T,C){return C?URL.createObjectURL(new Blob([T],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(T)},_=function(T){T instanceof Blob&&URL.revokeObjectURL(T)},p='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',d=function(T){return new Promise(function(C,N){var F=document.createElement("canvas"),H=new Image;H.onload=function(){var z=F.getContext("2d");try{z.drawImage(H,0,0),F.toDataURL("image/png"),C(!0)}catch{C(!1)}},H.onerror=N,H.src=T})},g=function(){var T=S(p,!0);return d(T).then(function(C){return _(T),C?!1:d(S(p,!1)).then(function(N){return N})},function(){return!1})},m=function(){if(w.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},x=function(){return new Promise(function(T,C){m()&&w.URL?g().then(function(N){T(!N)},function(){C()}):T(!1)})},P,O=function(){return P===void 0&&(P=x()),P},R=function(T){return O().then(function(C){return S(T,C)})};return E.renderSvg=function(T){return new Promise(function(C,N){var F,H,z=function(){H.onload=null,H.onerror=null},Y=function(){F&&_(F)};H=new Image,H.onload=function(){z(),Y(),C(H)},H.onerror=function(){Y(),N()},R(T).then(function(G){F=G,H.src=F},N)})},E}(window),b=function(w,E,S,_){var p={},d=function(T,C){var N=C||1,F={width:T.width,height:T.height,"font-size":T.rootFontSize};return N!==1&&(F.style="transform:scale("+N+"); transform-origin: 0 0;"),F},g=function(T){var C,N,F,H;C=Math.round(T.viewportWidth),N=Math.round(T.viewportHeight),F=-T.left,H=-T.top;var z={x:F,y:H,width:C,height:N};return z},m=function(T){var C=T.style||"";T.style=C+"float: left;"},x=function(T){T.externalResourcesRequired=!0},P=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},O=function(T){var C=Object.keys(T);return C.length?" "+C.map(function(N){return N+'="'+T[N]+'"'}).join(" "):""},R=function(T,C,N){var F=_.serializeToString(T);E.validateXHTML(F);var H=g(C);return m(H),x(H),'<svg xmlns="http://www.w3.org/2000/svg"'+O(d(C,N))+">"+P()+"<foreignObject"+O(H)+">"+F+"</foreignObject></svg>"};return p.getSvgForDocument=function(T,C,N){return S.rewriteTagNameSelectorsToLowerCase(T),R(T,C,N)},p.drawDocumentAsSvg=function(T,C){return["hover","active","focus","target"].forEach(function(N){C[N]&&S.fakeUserAction(T,C[N],N)}),E.calculateDocumentContentSize(T,C).then(function(N){return p.getSvgForDocument(T,N,C.zoom)})},p}(a,f,u,r),v=function(w,E,S,_,p,d){var g={},m=function(T){return{message:"Error rendering page",originalError:T}},x=function(T){return p.renderSvg(T).then(function(C){return{image:C,svg:T}},function(C){throw m(C)})},P=function(T,C){try{C.getContext("2d").drawImage(T,0,0)}catch(N){throw m(N)}},O=function(T,C,N){return _.drawDocumentAsSvg(T,N).then(x).then(function(F){return C&&P(F.image,C),F})},R=function(T,C){return E.executeJavascript(T,C).then(function(N){var F=N.document;return S.persistInputValues(F),{document:F,errors:N.errors,cleanUp:N.cleanUp}})};return g.rasterize=function(T,C,N){var F;return F=w.clone(N),F.inlineScripts=N.executeJs===!0,d.inlineReferences(T,F).then(function(H){return N.executeJs?R(T,N).then(function(z){return{element:z.document.documentElement,errors:H.concat(z.errors),cleanUp:z.cleanUp}}):{element:T,errors:H,cleanUp:function(){}}}).then(function(H){return O(H.element,C,N).then(function(z){return H.cleanUp(),{image:z.image,svg:z.svg,errors:H.errors}})})},g}(a,f,u,b,y,i),h=function(w,E,S){var _={},p=function(P,O){var R=300,T=200,C=P?P.width:R,N=P?P.height:T,F=O.width!==void 0?O.width:C,H=O.height!==void 0?O.height:N;return{width:F,height:H}},d=function(P){var O=p(P.canvas,P.options),R;return R=w.clone(P.options),R.width=O.width,R.height=O.height,R};_.drawDocument=function(){var P=arguments[0],O=Array.prototype.slice.call(arguments,1),R=w.parseOptionalParameters(O),T=P.documentElement?P.documentElement:P;return S.rasterize(T,R.canvas,d(R))};var g=function(P,O,R){var T=E.parseHTML(P);return _.drawDocument(T,O,R)};_.drawHTML=function(){var P=arguments[0],O=Array.prototype.slice.call(arguments,1),R=w.parseOptionalParameters(O);return g(P,R.canvas,R.options)};var m=function(P,O,R){var T=document.implementation.createHTMLDocument("");T.replaceChild(P.documentElement,T.documentElement);var C=R?w.clone(R):{};return R.baseUrl||(C.baseUrl=O),{document:T,options:C}},x=function(P,O,R){return E.loadDocument(P,R).then(function(T){var C=m(T,P,R);return _.drawDocument(C.document,O,C.options)})};return _.drawURL=function(){var P=arguments[0],O=Array.prototype.slice.call(arguments,1),R=w.parseOptionalParameters(O);return x(P,R.canvas,R.options)},_}(a,f,v);return h})})(h8);var LM=h8.exports;(function(t){var e=ye&&ye.__createBinding||(Object.create?function(f,y,b,v){v===void 0&&(v=b);var h=Object.getOwnPropertyDescriptor(y,b);h&&!("get"in h?!y.__esModule:h.writable||h.configurable)||(h={enumerable:!0,get:function(){return y[b]}}),Object.defineProperty(f,v,h)}:function(f,y,b,v){v===void 0&&(v=b),f[v]=y[b]}),r=ye&&ye.__setModuleDefault||(Object.create?function(f,y){Object.defineProperty(f,"default",{enumerable:!0,value:y})}:function(f,y){f.default=y}),n=ye&&ye.__importStar||function(f){if(f&&f.__esModule)return f;var y={};if(f!=null)for(var b in f)b!=="default"&&Object.prototype.hasOwnProperty.call(f,b)&&e(y,f,b);return r(y,f),y};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToCanvas=t.detectSize=void 0;const i=n(LM),a=`
148
+ <style>
149
+ html, body {
150
+ padding: 0;
151
+ margin: 0;
152
+ }
153
+ p {
154
+ margin: 0;
155
+ padding: 0
156
+ }
157
+ ul {
158
+ list-style-position: inside;
159
+ margin: 0;
160
+ }
161
+ </style>
162
+ `,o=document.createElement("div");function l(f){const y=document.createElement("div");y.innerHTML=f,y.style.display="inline-block",y.style.position="fixed",y.style.top="0px",y.style.left="0px",y.style.zIndex="1000",o.appendChild(y);const b=y.getBoundingClientRect();return o.removeChild(y),{width:b.width,height:b.height}}async function u({html:f,width:y,height:b,fontFamily:v,padding:h,font:w,pixelRatio:E}){const S=document.createElement("canvas");v==="Arial"||w||(f+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${v}" rel="stylesheet">`),w&&(f+=`<style>@font-face {font-family: '${w.fontFamily}'; src: url("${w.url}")}</style>`),f+=a;const _=await i.drawHTML(`<div style="padding: ${h}px;">${f}</div>`,S,{width:y+2*h,height:b+2*h});S.width=(y+2*h)*E,S.height=(b+2*h)*E;const p=S.getContext("2d");return p==null||p.drawImage(_.image,0,0,_.image.width*E,_.image.height*E),S}o.id="polotno-hidden-do-not-touch",o.style.overflow="hidden",o.style.position="relative",document.body.appendChild(o),o.innerHTML=`<style>
163
+ #polotno-hidden-do-not-touch p {
164
+ margin: 0;
165
+ padding: 0
166
+ }
167
+ #polotno-hidden-do-not-touch ul {
168
+ list-style-position: inside;
169
+ margin: 0;
170
+ }
171
+ </style>`,t.detectSize=l,t.htmlToCanvas=u})(d8);var w1={},m8={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.styled=t.setup=t.keyframes=t.glob=t.extractCss=t.css=void 0;let e={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||e,n=d=>{let g=r(d),m=g.data;return g.data="",m},i=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(d,g)=>{let m="",x="",P="";for(let O in d){let R=d[O];O[0]=="@"?O[1]=="i"?m=O+" "+R+";":x+=O[1]=="f"?o(R,O):O+"{"+o(R,O[1]=="k"?"":g)+"}":typeof R=="object"?x+=o(R,g?g.replace(/([^,])+/g,T=>O.replace(/(^:.*)|([^,])+/g,C=>/&/.test(C)?C.replace(/&/g,T):T?T+" "+C:C)):O):R!=null&&(O=O.replace(/[A-Z]/g,"-$&").toLowerCase(),P+=o.p?o.p(O,R):O+":"+R+";")}return m+(g&&P?g+"{"+P+"}":P)+x},l={},u=d=>{if(typeof d=="object"){let g="";for(let m in d)g+=m+u(d[m]);return g}return d},f=(d,g,m,x,P)=>{let O=u(d),R=l[O]||(l[O]=(T=>{let C=0,N=11;for(;C<T.length;)N=101*N+T.charCodeAt(C++)>>>0;return"go"+N})(O));if(!l[R]){let T=O!==d?d:(C=>{let N,F=[{}];for(;N=i.exec(C.replace(a,""));)N[4]?F.shift():N[3]?F.unshift(F[0][N[3]]=F[0][N[3]]||{}):F[0][N[1]]=N[2];return F[0]})(d);l[R]=o(P?{["@keyframes "+R]:T}:T,m?"":"."+R)}return((T,C,N)=>{C.data.indexOf(T)==-1&&(C.data=N?T+C.data:C.data+T)})(l[R],g,x),R},y=(d,g,m)=>d.reduce((x,P,O)=>{let R=g[O];if(R&&R.call){let T=R(m),C=T&&T.props&&T.props.className||/^go/.test(T)&&T;R=C?"."+C:T&&typeof T=="object"?T.props?"":o(T,""):T===!1?"":T}return x+P+(R??"")},"");function b(d){let g=this||{},m=d.call?d(g.p):d;return f(m.unshift?m.raw?y(m,[].slice.call(arguments,1),g.p):m.reduce((x,P)=>Object.assign(x,P&&P.call?P(g.p):P),{}):m,r(g.target),g.g,g.o,g.k)}t.extractCss=n,t.css=b;let v,h,w,E=b.bind({g:1}),S=b.bind({k:1});function _(d,g,m,x){o.p=g,v=d,h=m,w=x}function p(d,g){let m=this||{};return function(){let x=arguments;function P(O,R){let T=Object.assign({},O),C=T.className||P.className;m.p=Object.assign({theme:h&&h()},T),m.o=/ *go\d+/.test(C),T.className=b.apply(m,x)+(C?" "+C:""),g&&(T.ref=R);let N=d;return d[0]&&(N=T.as||d,delete T.as),w&&N[0]&&w(T),v(N,T)}return g?g(P):P}}t.glob=E,t.keyframes=S,t.setup=_,t.styled=p})(m8);var jM=ye&&ye.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(w1,"__esModule",{value:!0});const DM=jM(at),p3=m8;(0,p3.setup)(DM.default.createElement),w1.default=p3.styled;(function(t){var e=ye&&ye.__createBinding||(Object.create?function(z,Y,G,W){W===void 0&&(W=G);var j=Object.getOwnPropertyDescriptor(Y,G);j&&!("get"in j?!Y.__esModule:j.writable||j.configurable)||(j={enumerable:!0,get:function(){return Y[G]}}),Object.defineProperty(z,W,j)}:function(z,Y,G,W){W===void 0&&(W=G),z[W]=Y[G]}),r=ye&&ye.__setModuleDefault||(Object.create?function(z,Y){Object.defineProperty(z,"default",{enumerable:!0,value:Y})}:function(z,Y){z.default=Y}),n=ye&&ye.__importStar||function(z){if(z&&z.__esModule)return z;var Y={};if(z!=null)for(var G in z)G!=="default"&&Object.prototype.hasOwnProperty.call(z,G)&&e(Y,z,G);return r(Y,z),Y},i=ye&&ye.__importDefault||function(z){return z&&z.__esModule?z:{default:z}};Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLElement=t.quillRef=void 0;const a=i(at),o=Ti,l=lo,u=i(cM),f=i(si),y=n(la),b=zn,v=Tc,h=h1,w=d8,E=sl,S=Ms,_=Ac,p=i(w1),d=na,g=p1,m=n(kc),x=cl;t.quillRef=y.observable({enabled:!1,currentFormat:{},editor:y.observable.object({instance:null},{},{deep:!1})});const P=(0,p.default)("div",a.default.forwardRef)`
172
+ .ql-editor {
173
+ outline: none;
174
+ }
175
+ ul {
176
+ list-style-position: inside;
177
+ margin: 0;
178
+ }
179
+ p {
180
+ line-height: auto;
181
+ margin: 0;
182
+ }
183
+ strong {
184
+ font-weight: 1800;
185
+ }
186
+ .ql-direction-rtl {
187
+ direction: rtl;
188
+ }
189
+ `,O=({html:z,onBlur:Y,onChange:G,element:W})=>{const j=a.default.useRef(null);a.default.useEffect(()=>{if(!j.current)return;const k=new u.default(j.current,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:["background","bold","color","font","italic","size","strike","underline","indent","align","direction"]});return t.quillRef.editor.instance=k,window.__polotnoQuill=k,k.on("text-change",()=>{k.getSelection()&&(t.quillRef.currentFormat=k.getFormat()),setTimeout(()=>{var D;G((D=j.current)===null||D===void 0?void 0:D.childNodes[0].innerHTML)},10)}),k.setSelection(0,0,"api"),k.on("selection-change",D=>{D||Y(),D&&(t.quillRef.currentFormat=k.getFormat())}),j.current.childNodes[0].addEventListener("blur",D=>{var B;!((B=D.relatedTarget)===null||B===void 0)&&B.classList.contains("ql-clipboard")||Y()}),()=>{t.quillRef.editor.instance=null,t.quillRef.currentFormat={},delete window.__polotnoQuill}},[]),a.default.useEffect(()=>{var k;const D=t.quillRef.editor.instance;if(!D)return;const B=D.getSelection();if(((k=j.current)===null||k===void 0?void 0:k.childNodes[0].innerHTML)!==W.text){var q=D.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+z+"<p><br></p></div>");D.setContents(q),D.history.clear(),B&&(D.setSelection(B.index,B.length),t.quillRef.currentFormat=D.getFormat())}},[W.text]);const M=(0,h.useTextColor)(W).fill;return a.default.createElement(P,{ref:j,style:{fontSize:W.fontSize,color:M,width:W.width,fontFamily:W.fontFamily,lineHeight:W.lineHeight,letterSpacing:W.letterSpacing+"rem",textAlign:W.align},dir:(0,h.getDir)((0,g.removeTags)(W.text))})};function R(z,Y,G){return a.default.useMemo(()=>(0,w.detectSize)(z),[z,Y.width,G])}function T(z){const Y=z.getContext("2d").getImageData(0,0,z.width,z.height).data;for(let G=0;G<Y.length;G+=4)if(Y[G+3]!==0)return!0;return!1}function C(z){return!T(z)}function N(z,{fontFamily:Y="",color:G="black"}={}){let W=`color: ${G||z.fill}`;return`<div style="white-space: unset; width: ${Math.round(z.width||100)}px; ${W}; font-size: ${z.fontSize}px; font-family: '${Y}'; text-decoration: ${z.textDecoration}; text-align: ${z.align}; line-height: ${z.lineHeight}; letter-spacing: ${z.letterSpacing}rem; font-style: ${z.fontStyle}; font-weight: ${z.fontWeight}; -webkit-text-stroke: ${z.strokeWidth}px ${z.stroke};" contentEditable dir="${(0,h.getDir)((0,g.removeTags)(z.text))}">${z.text}</div>`}const F=z=>{let Y=z.fontSize;for(let G=1;G<50;G++){const W=N(Object.assign(Object.assign({},z.toJSON()),{fontSize:Y}),{fontFamily:z.fontFamily}),{height:j}=(0,w.detectSize)(W);if(!(z.height&&j>z.height))break;Y-=.5}return Y},H=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);t.HTMLElement=(0,o.observer)(({element:z,store:Y})=>{const G=a.default.useRef(null),[W,j]=a.default.useState(),[M,k]=a.default.useState(!1),[D,B]=a.default.useState(!0),[q,K]=a.default.useState(!1),[$,U]=a.default.useState(!1),X=a.default.useRef(z.height),Q=Y.selectedElements.indexOf(z)>=0,ee=z.fontSize/3,{textVerticalResizeEnabled:Z}=b.flags,ne=(0,h.usePrevious)(z.fontFamily),[ie]=(0,h.useFontLoader)(Y,z.fontFamily);(0,E.useFadeIn)(G);const pe=ie?z.fontFamily:ne!==z.fontFamily?ne:"Arial",we=(0,h.useTextColor)(z).fill,Re=N(z,{fontFamily:pe,color:we}),{width:xe,height:le}=R(Re,z,ie);a.default.useEffect(()=>{if(!ie)return;if(!z.height)return void z.set({height:le});const{textOverflow:ue}=b.flags;if(ue!=="change-font-size"||M)ue==="resize"&&(Z&&z.height<le&&Y.history.ignore(()=>{z.set({height:le})}),Z||z.height===le||Y.history.ignore(()=>{z.set({height:le})}));else{const me=F(z);me!==z.fontSize?Y.history.ignore(()=>{z.set({fontSize:me})}):z.height!==le&&Y.history.ignore(()=>{z.set({height:le})})}});const ce=a.default.useRef(0);a.default.useEffect(()=>{M||q||(async()=>{ce.current++;const ue=ce.current,me=(0,d.incrementLoader)(`text ${z.id}`);B(!0);let Ne=null;const Xe=H?5:1;for(let Ye=0;Ye<Xe;Ye++){if(Ne=await(0,w.htmlToCanvas)({html:Re,width:z.width||1,height:z.height||le||1,fontFamily:pe,padding:ee,pixelRatio:Y._elementsPixelRatio,font:Y.fonts.find(Te=>Te.fontFamily===pe)||m.globalFonts.find(Te=>Te.fontFamily===pe)}),ue!==ce.current)return void me();C(Ne)&&H&&await new Promise(Te=>setTimeout(Te,50*(Ye+1)))}Ne?(j(Ne),B(!1),f.default.Util.requestAnimFrame(me)):me()})()},[Re,M,le,q,pe,z.height,Y._elementsPixelRatio]);const be=M||D;a.default.useEffect(()=>y.autorun(()=>{const ue=G.current;(0,v.applyFilter)(ue,z)}),[W,be,z.shadowColor,z.shadowOffsetX,z.shadowOffsetY,z.shadowOpacity]);let _e=0;z.verticalAlign==="middle"&&(_e=(z.height-le)/2),z.verticalAlign==="bottom"&&(_e=z.height-le);const te=(0,h.getLineHeight)({fontLoaded:ie,fontFamily:z.fontFamily,fontSize:z.fontSize,lineHeight:z.lineHeight}),fe=(0,x.useMobile)();return a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Rect,{x:z.x,y:z.y,offsetX:z.backgroundPadding*(z.fontSize*te*.5),offsetY:z.backgroundPadding*(z.fontSize*te*.5),rotation:z.rotation,hideInExport:!z.showInExport||!z.text,listening:!1,visible:z.backgroundEnabled,opacity:z.backgroundOpacity,fill:z.backgroundColor,width:z.width+z.backgroundPadding*(z.fontSize*te),height:z.height+z.backgroundPadding*(z.fontSize*te),cornerRadius:z.backgroundCornerRadius*(z.fontSize*te*.5)}),a.default.createElement(l.Rect,{ref:G,name:"element",x:z.x,y:z.y,listening:z.selectable,rotation:z.rotation,width:z.width,height:z.height,visible:!be,draggable:fe?z.draggable&&Q:z.draggable,preventDefault:!fe||Q,opacity:q?0:z.opacity,hideInExport:!z.showInExport,onMouseEnter:()=>{U(!0)},onMouseLeave:()=>{U(!1)},onDragStart:()=>{Y.history.startTransaction()},onDragMove:ue=>{z.set({x:ue.target.x(),y:ue.target.y()})},onDragEnd:ue=>{z.set({x:ue.target.x(),y:ue.target.y()}),Y.history.endTransaction()},id:z.id,onDblClick:()=>{z.contentEditable&&K(!0)},onDblTap:()=>{z.contentEditable&&K(!0)},onTransformStart:ue=>{k(!0),X.current=z.height},onTransform:ue=>{var me;const Ne=ue.target,Xe=((me=Ne.getStage())===null||me===void 0?void 0:me.findOne("Transformer")).getActiveAnchor(),Ye=Xe==="middle-left"||Xe==="middle-right",Te=Xe==="top-center"||Xe==="bottom-center",Be=Ne.scaleX();if(Ye){const Ze=Ne.scaleX(),Qe=Math.max(Ne.width()*Ze,z.fontSize);if(Ne.width(Qe),Ne.scaleX(1),b.flags.textVerticalResizeEnabled){const se=Math.max(le,X.current);z.set({height:se})}z.set({width:Qe,x:Ne.x(),y:Ne.y()})}else if(Te){let Ze=b.flags.textOverflow==="resize"?le:z.lineHeight*z.fontSize;const Qe=Math.max(Ze,ue.target.height()*ue.target.scaleY());Ne.scaleY(1),z.set({x:Ne.x(),y:Ne.y(),height:Qe,rotation:Ne.rotation()})}else Ne.scaleX(1),Ne.scaleY(1),z.set({fontSize:z.fontSize*Be,width:Ne.width()*Be,x:Ne.x(),y:Ne.y(),rotation:Ne.rotation(),height:Ne.height()*Be})},onTransformEnd:ue=>{k(!1),B(!0);const me=ue.target.scaleX();ue.target.scaleX(1),ue.target.scaleY(1),z.set({fontSize:z.fontSize*me,width:ue.target.width()*me,x:ue.target.x(),y:ue.target.y(),rotation:ue.target.rotation()})}}),a.default.createElement(l.Image,{ref:G,image:W,x:z.x,y:z.y,offsetX:ee,offsetY:ee-_e,listening:!1,rotation:z.rotation,width:z.width+2*ee,height:z.height+2*ee,visible:!be,opacity:q?0:z.opacity,shadowEnabled:z.shadowEnabled,shadowBlur:z.shadowBlur,shadowOffsetX:z.shadowOffsetX,shadowOffsetY:z.shadowOffsetY,shadowColor:z.shadowColor,shadowOpacity:z.shadowOpacity,hideInExport:!z.showInExport}),be&&a.default.createElement(l.Group,{x:z.x,y:z.y,rotation:z.rotation,offsetY:-_e},a.default.createElement(_.Html,{divProps:{style:{pointerEvents:"none"}}},a.default.createElement(P,{dangerouslySetInnerHTML:{__html:Re},style:{pointerEvents:"none",display:"inline-block"}}))),q&&a.default.createElement(l.Group,{x:z.x,y:z.y,rotation:z.rotation,offsetY:-_e},a.default.createElement(_.Html,null,a.default.createElement(O,{html:Re,element:z,onChange:ue=>{z.set({text:ue})},onBlur:ue=>{K(!1)}}))),(Q||$)&&a.default.createElement(S.Highlighter,{element:z}))})})(c8);var y8={},S1={},Tp={};(function(t){var e=ye&&ye.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0}),t.getTotalClientRect=t.getClientRect=void 0;const r=e(si);function n(o,l,u,f,y){const b=Math.sqrt(u*u+f*f);return y+=Math.atan2(f,u),{x:o+b*Math.cos(y),y:l+b*Math.sin(y)}}function i(o){const{x:l,y:u,width:f,height:y}=o,b=r.default.Util.degToRad(o.rotation),v=n(l,u,0,0,b),h=n(l,u,f,0,b),w=n(l,u,f,y,b),E=n(l,u,0,y,b),S=Math.min(v.x,h.x,w.x,E.x),_=Math.min(v.y,h.y,w.y,E.y),p=Math.max(v.x,h.x,w.x,E.x),d=Math.max(v.y,h.y,w.y,E.y);return{x:S,y:_,width:p-S,height:d-_,minX:S,minY:_,maxX:p,maxY:d}}function a(o){const l=o.map(v=>i(v)),u=Math.min(...l.map(v=>v.minX)),f=Math.min(...l.map(v=>v.minY)),y=Math.max(...l.map(v=>v.maxX)),b=Math.max(...l.map(v=>v.maxY));return{x:u,y:f,width:y-u,height:b-f,minX:u,minY:f,maxX:y,maxY:b}}t.getClientRect=i,t.getTotalClientRect=a})(Tp);(function(t){var e=ye&&ye.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(t,"__esModule",{value:!0}),t.useAnchorSnap=t.useSnap=void 0;const r=e(at),n=e(si),i=Tp;var a=5;function o(b){const v=b.__getNodeRect(),h=(0,i.getClientRect)(Object.assign(Object.assign({},v),{rotation:n.default.Util.radToDeg(v.rotation)})),w=b.getAbsolutePosition();return{vertical:[{guide:h.x,offset:w.x-h.x,snap:"start"},{guide:h.x+h.width/2,offset:w.x-h.x-h.width/2,snap:"center"},{guide:h.x+h.width,offset:w.x-h.x-h.width,snap:"end"}],horizontal:[{guide:h.y,offset:w.y-h.y,snap:"start"},{guide:h.y+h.height/2,offset:w.y-h.y-h.height/2,snap:"center"},{guide:h.y+h.height,offset:w.y-h.y-h.height,snap:"end"}]}}function l(b,v){var h=[],w=[];b.vertical.forEach(g=>{v.vertical.forEach(m=>{var x=Math.abs(g-m.guide);x<a&&h.push({lineGuide:g,diff:x,snap:m.snap,offset:m.offset})})}),b.horizontal.forEach(g=>{v.horizontal.forEach(m=>{var x=Math.abs(g-m.guide);x<a&&w.push({lineGuide:g,diff:x,snap:m.snap,offset:m.offset})})});var E=[];const S=h.sort((g,m)=>g.diff-m.diff),_=w.sort((g,m)=>g.diff-m.diff);var p=S[0],d=_[0];return p&&S.filter(g=>Math.abs(g.diff-p.diff)<.1).forEach(g=>{E.push(Object.assign({orientation:"V"},g))}),d&&_.filter(g=>Math.abs(g.diff-d.diff)<.1).forEach(g=>{E.push(Object.assign({orientation:"H"},g))}),E}function u(b){const v=p=>p.hasName("element")||p.hasName("page-background")||p.hasName("elements-area");function h(p){var d;const g=(d=b.current)===null||d===void 0?void 0:d.getStage();var m=[],x=[];return g.find(v).forEach(P=>{if(!(p.indexOf(P)>=0)){var O=P.getClientRect({skipShadow:!0,skipStroke:!0});m.push(O.x,O.x+O.width,O.x+O.width/2),x.push(O.y,O.y+O.height,O.y+O.height/2)}}),{vertical:m,horizontal:x}}function w(p){var d;const g=(d=b.current)===null||d===void 0?void 0:d.getLayer(),m=g==null?void 0:g.children.find(x=>x.name()==="line-guides");p.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]});m==null||m.add(P),g.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]}),m==null||m.add(P))})}const E=p=>{p.target.getLayer().children.find(O=>O.name()==="line-guides").destroyChildren();var d=l(h(p.target.nodes()),o(p.target));if(!d.length)return;w(d);const g=p.target.getAbsolutePosition(),m=Object.assign({},g);d.forEach(O=>{switch(O.snap){case"start":case"center":case"end":switch(O.orientation){case"V":m.x=O.lineGuide+O.offset;break;case"H":m.y=O.lineGuide+O.offset}}});const x=m.x-g.x,P=m.y-g.y;p.evt.ctrlKey||p.evt.metaKey||p.target.nodes().forEach(O=>{const R=O.getAbsolutePosition();O.setAbsolutePosition({x:R.x+x,y:R.y+P})})},S=(p,d,g)=>{const m=b.current,x=m.getLayer();if(x.children.find(N=>N.name()==="line-guides").destroyChildren(),m.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(d.x-p.x,2)+Math.pow(d.y-p.y,2))>50||!x)return d;var P=l(h(m.nodes()),{vertical:[{guide:d.x,offset:0,snap:"start"}],horizontal:[{guide:d.y,offset:0,snap:"start"}]});if(!P.length||(w(P),g.ctrlKey||g.metaKey))return d;let O=d.x,R=d.x;P.forEach(N=>{switch(N.orientation){case"V":O=N.lineGuide;break;case"H":R=N.lineGuide}});const T=Math.abs(d.x-O)<10,C=Math.abs(d.y-R)<10;return T&&!C?{x:O,y:p.y}:C&&!T?{x:p.x,y:R}:T&&C?{x:O,y:R}:d},_=p=>{if(!p.target)return;const d=p.target.getLayer();d.children.find(g=>g.name()==="line-guides").destroyChildren(),d.batchDraw()};r.default.useEffect(()=>{b.current&&(b.current.anchorDragBoundFunc(S),b.current.on("dragstart",()=>{setTimeout(()=>{const p=[...n.default.DD._dragElements.entries()];p.reverse(),n.default.DD._dragElements.clear(),p.forEach(([d,g])=>{n.default.DD._dragElements.set(d,g)})})}),b.current.on("dragmove",E),b.current.on("dragend",_),b.current.on("transformend",_),b.current.on("transform",p=>{var d,g;p.evt.ctrlKey||p.evt.metaKey?(d=b.current)===null||d===void 0||d.rotationSnapTolerance(0):(g=b.current)===null||g===void 0||g.rotationSnapTolerance(5)}))},[])}function f(b){return{vertical:[{guide:b.absolutePosition().x,offset:0,snap:"center"}],horizontal:[{guide:b.absolutePosition().y,offset:0,snap:"center"}]}}function y(b,v,h){const w=_=>_.hasName("element")||_.hasName("line-anchor")||_.hasName("page-background")||_.hasName("elements-area"),E=_=>{_.target.getLayer().children.find(P=>P.name()==="line-guides").destroyChildren();var p=l(function(P){var O;const R=(O=b.current)===null||O===void 0?void 0:O.getStage();var T=[],C=[];return R.find(w).forEach(N=>{if(!(P.indexOf(N)>=0)){var F=N.getClientRect({skipShadow:!0,skipStroke:!0});N.hasName("line-anchor")&&(F={x:N.absolutePosition().x,y:N.absolutePosition().y,width:0,height:0}),T.push(F.x,F.x+F.width,F.x+F.width/2),C.push(F.y,F.y+F.height,F.y+F.height/2)}}),{vertical:T,horizontal:C}}([_.target,...v.map(P=>P.current)]),f(_.target));if(!p.length)return;(function(P){var O;const R=(O=b.current)===null||O===void 0?void 0:O.getLayer(),T=R==null?void 0:R.children.find(C=>C.name()==="line-guides");P.forEach(C=>{if(C.orientation==="H"){var N=new n.default.Line({points:[-6e3,C.lineGuide,6e3,C.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});T==null||T.add(N),R.batchDraw()}else C.orientation==="V"&&(N=new n.default.Line({points:[C.lineGuide,-6e3,C.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),T==null||T.add(N))})})(p);const d=_.target.getAbsolutePosition(),g=Object.assign({},d);p.forEach(P=>{switch(P.snap){case"start":case"center":case"end":switch(P.orientation){case"V":g.x=P.lineGuide+P.offset;break;case"H":g.y=P.lineGuide+P.offset}}});const m=g.x-d.x,x=g.y-d.y;if(!(_.evt.ctrlKey||_.evt.metaKey)){const P=_.target.getAbsolutePosition();_.target.absolutePosition({x:P.x+m,y:P.y+x})}},S=_=>{if(!_.target)return;const p=_.target.getLayer();p.children.find(d=>d.name()==="line-guides").destroyChildren(),p.batchDraw()};r.default.useEffect(()=>{b.current&&(b.current.on("dragmove",E),b.current.on("dragend",S))},h)}t.useSnap=u,t.useAnchorSnap=y})(S1);(function(t){var e=ye&&ye.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(t,"__esModule",{value:!0}),t.LineElement=t.getLinePositionFromMiddlePoints=t.getMiddlePoints=void 0;const r=e(at),n=Ti,i=lo,a=Ac,o=Ms,l=S1,u=cl;function f(h){const{x:w,y:E,width:S,height:_,rotation:p}=h.a,d=p*Math.PI/180,g={x:w+_/2*Math.cos(d+Math.PI/2),y:E+_/2*Math.sin(d+Math.PI/2)};return{middleLeft:g,middleRight:{x:g.x+S*Math.cos(d),y:g.y+S*Math.sin(d)}}}function y(h,w,E){const S=Math.sqrt(Math.pow(w.x-h.x,2)+Math.pow(w.y-h.y,2)),_=Math.atan2(w.y-h.y,w.x-h.x),p=180*_/Math.PI;return{x:h.x+Math.cos(_-Math.PI/2)*E/2,y:h.y+Math.sin(_-Math.PI/2)*E/2,width:S,height:E,rotation:p}}t.getMiddlePoints=f,t.getLinePositionFromMiddlePoints=y;const b=(h,w)=>({offsetX:5/h,offsetY:5/h,width:10/h,height:10/h,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:E=>{E.target.getStage().container().style.cursor="crosshair"},onMouseLeave:E=>{E.target.getStage().container().style.cursor=""},onDragStart:E=>{w.history.startTransaction()},onDragEnd:E=>{w.history.endTransaction()}}),v=(0,n.observer)(({element:h,type:w})=>{const E={strokeWidth:h.height,stroke:h.a.color,lineCap:"round",lineJoin:"round",fill:h.a.color,opacity:h.a.opacity};return r.default.createElement(r.default.Fragment,null,w==="arrow"&&r.default.createElement(i.Line,Object.assign({points:[3*h.height,2*-h.height,0,0,3*h.height,2*h.height]},E)),w==="triangle"&&r.default.createElement(i.Line,Object.assign({points:[3*h.height,2*-h.height,0,0,3*h.height,2*h.height],closed:!0},E)),w==="bar"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-h.height,0,2*h.height],closed:!0},E)),w==="square"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-h.height,4*h.height,2*-h.height,4*h.height,2*h.height,0,2*h.height],closed:!0},E)),w==="circle"&&r.default.createElement(i.Circle,Object.assign({x:2*h.height,y:0,radius:2*h.height},E)))});t.LineElement=(0,n.observer)(({element:h,store:w})=>{const E=r.default.useRef(null),S=r.default.useRef(null),_=r.default.useRef(null),p=h.selectable||w.role==="admin",d=(0,u.useMobile)(),[g,m]=r.default.useState(!1),x=w.selectedElements.indexOf(h)>=0&&w.selectedElements.length===1,{middleLeft:P,middleRight:O}=f(h);return(0,l.useAnchorSnap)(S,[E],[x]),(0,l.useAnchorSnap)(_,[E],[x]),r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Line,{ref:E,name:"element",id:h.id,x:h.a.x,y:h.a.y,points:[0,0,h.a.width,0],offsetY:-h.a.height/2,strokeWidth:h.a.height,hitStrokeWidth:Math.max(h.a.height,20),dash:h.dash.map(R=>R*h.a.height),stroke:h.a.color,rotation:h.a.rotation,opacity:h.animated("opacity"),shadowEnabled:h.shadowEnabled,shadowBlur:h.shadowBlur,shadowOffsetX:h.shadowOffsetX,shadowOffsetY:h.shadowOffsetY,shadowColor:h.shadowColor,shadowOpacity:h.shadowOpacity,listening:p,draggable:d?h.draggable&&x:h.draggable,preventDefault:!d||x,hideInExport:!h.showInExport,onMouseEnter:()=>{m(!0)},onMouseLeave:()=>{m(!1)},onDragStart:()=>{w.history.startTransaction()},onDragMove:R=>{h.set({x:R.target.x(),y:R.target.y()})},onDragEnd:R=>{h.set({x:R.target.x(),y:R.target.y()}),w.history.endTransaction()},onTransformStart:()=>{w.history.startTransaction()},onTransform:R=>{const T=R.target.scaleX();R.target.scaleX(1),R.target.scaleY(1),h.set({height:h.height*T,width:h.width*T,x:R.target.x(),y:R.target.y(),rotation:R.target.rotation()})},onTransformEnd:R=>{w.history.endTransaction()}}),r.default.createElement(i.Group,{x:P.x,y:P.y,rotation:h.rotation},r.default.createElement(v,{element:h,type:h.startHead})),r.default.createElement(i.Group,{x:O.x,y:O.y,rotation:h.rotation+180},r.default.createElement(v,{element:h,type:h.endHead})),g&&!x&&r.default.createElement(o.Highlighter,{element:h}),x&&h.resizable&&r.default.createElement(a.Portal,{selector:".page-abs-container",enabled:!0},r.default.createElement(i.Group,{visible:x},r.default.createElement(i.Rect,Object.assign({x:P.x,y:P.y,ref:S,name:"line-anchor"},b(w.scale,w),{onDragMove:R=>{const T=y(R.target.position(),O,h.height);h.set({x:T.x,y:T.y,width:T.width,rotation:T.rotation})}})),r.default.createElement(i.Rect,Object.assign({x:O.x,y:O.y,ref:_,name:"line-anchor"},b(w.scale,w),{onDragMove:R=>{const T=y(P,R.target.position(),h.height);h.set({x:T.x,y:T.y,width:T.width,rotation:T.rotation})}})))))})})(y8);var b8={};(function(t){var e=ye&&ye.__createBinding||(Object.create?function(j,M,k,D){D===void 0&&(D=k);var B=Object.getOwnPropertyDescriptor(M,k);B&&!("get"in B?!M.__esModule:B.writable||B.configurable)||(B={enumerable:!0,get:function(){return M[k]}}),Object.defineProperty(j,D,B)}:function(j,M,k,D){D===void 0&&(D=k),j[D]=M[k]}),r=ye&&ye.__setModuleDefault||(Object.create?function(j,M){Object.defineProperty(j,"default",{enumerable:!0,value:M})}:function(j,M){j.default=M}),n=ye&&ye.__importStar||function(j){if(j&&j.__esModule)return j;var M={};if(j!=null)for(var k in j)k!=="default"&&Object.prototype.hasOwnProperty.call(j,k)&&e(M,j,k);return r(M,j),M},i=ye&&ye.__importDefault||function(j){return j&&j.__esModule?j:{default:j}};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoElement=t.useImageLoader=t.setImageLoaderHook=void 0;const a=i(at),o=Ti,l=la,u=lo,f=i(Ap),y=i(si),b=Ac,v=Ms,h=na,w=n(Is),E=zn,S=Tc,_=sl,p=cl;function d(){return document.createElement("canvas")}async function g(j){if(!(j.indexOf("data:image/svg+xml")>=0||j.indexOf(".svg")>=0))return j;const M=await w.urlToString(j),k=w.fixSize(M);return w.svgToURL(k)}const m=j=>{const[M,k]=a.default.useState(j);return a.default.useEffect(()=>{(async()=>{const D=await g(j);D!==M&&k(D)})()},[j]),M},x=new window.Image;x.src=w.svgToURL(`
190
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
191
+ <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"/>
192
+ <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"/>
193
+ </svg>
194
+ `);const P=new window.Image;P.src=w.svgToURL(`
195
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
196
+ <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"/>
197
+ <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"/>
198
+ <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"/>
199
+ <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"/>
200
+ </svg>
201
+ `);function O(j,M,k,D,B,q,K){for(var $=new ImageData(M,k),U=new Int32Array(j.data.buffer),X=j.width,Q=new Int32Array($.data.buffer),ee=$.width,Z=M/q,ne=k/K,ie=Math.round(1/Z),pe=Math.round(1/ne),we=ie*pe,Re=0;Re<$.height;Re++)for(var xe=0;xe<ee;xe++){for(var le=D+Math.round(xe/Z)+(B+Math.round(Re/ne))*X,ce=0,be=0,_e=0,te=0,fe=0;fe<pe;fe++)for(var ue=0;ue<ie;ue++){var me=U[le+ue+fe*X];ce+=me<<24>>>24,be+=me<<16>>>24,_e+=me<<8>>>24,te+=me>>>24}ce=Math.round(ce/we),be=Math.round(be/we),_e=Math.round(_e/we),te=Math.round(te/we),Q[xe+Re*ee]=te<<24|_e<<16|be<<8|ce}return $}function R(j,M){var k,D;const B=d();B.width=j.width,B.height=j.height,(k=B.getContext("2d"))===null||k===void 0||k.drawImage(j,0,0,B.width,B.height);const q=O(B.getContext("2d").getImageData(0,0,B.width,B.height),Math.floor(B.width*M),Math.floor(B.height*M),0,0,B.width,B.height);return B.width=Math.floor(B.width*M),B.height=Math.floor(B.height*M),(D=B.getContext("2d"))===null||D===void 0||D.putImageData(q,0,0),B}const T=(j,M,k,D,B=0,q=!1)=>{const K=Math.floor(Math.max(j.width*D,1)),$=Math.floor(Math.max(j.height*D,1)),U=Math.min(B*D,K/2,$/2),X=Math.max(j.width/k.width,j.height/k.height)*D,Q=j.page._exporting&&E.flags.imageDownScalingEnabled&&X<1&&!q,ee=k.x===0&&k.y===0&&k.width===(M==null?void 0:M.width)&&k.height===(M==null?void 0:M.height),Z=a.default.useMemo(()=>{if(!(!M||!M.width||!M.height))return ee&&U===0&&!Q?void 0:d()},[M,U,Q,ee]);return a.default.useLayoutEffect(()=>{if(!Z||!M)return;Z.width=K,Z.height=$;const ne=Z.getContext("2d");if(!ne)return;U&&(ne.beginPath(),ne.moveTo(U,0),ne.lineTo(K-U,0),ne.arc(K-U,U,U,3*Math.PI/2,0,!1),ne.lineTo(K,$-U),ne.arc(K-U,$-U,U,0,Math.PI/2,!1),ne.lineTo(U,$),ne.arc(U,$-U,U,Math.PI/2,Math.PI,!1),ne.lineTo(0,U),ne.arc(U,U,U,Math.PI,3*Math.PI/2,!1),ne.clip());const ie=Q?R(M,X):M,pe=Q?{x:Math.floor(k.x*X),y:Math.floor(k.y*X),width:Math.floor(k.width*X),height:Math.floor(k.height*X)}:k;ne.drawImage(ie,pe.x,pe.y,pe.width,pe.height,0,0,Z.width,Z.height)},[Z,j.width,j.height,k.x,k.y,k.width,k.height,B,D,q,j.page._exporting,Q]),a.default.useEffect(()=>()=>{Z&&Z.nodeName==="CANVAS"&&y.default.Util.releaseCanvas(Z)},[Z]),Z||M},C=(j,M,k,D)=>{const B=m(j.clipSrc||""),[q,K]=z(B,"anonymous"),$=j.clipSrc?K:"loaded";(0,t.useImageLoader)($,j.id+"-clip");const U=a.default.useMemo(()=>{if(M&&q)return d()},[M,q]);return a.default.useLayoutEffect(()=>{var X;if(!q||!M||!M.width||!M.height||!q||!q.width||!q.height||!U)return;const Q=d(),ee=Math.max(j.width/q.width*k,j.height/q.height*k);Q.width=q.width*ee,Q.height=q.height*ee,(X=Q.getContext("2d"))===null||X===void 0||X.drawImage(q,0,0,Q.width,Q.height),U.width=Math.max(M.width,1),U.height=Math.max(M.height,1);const Z=U.getContext("2d");Z&&(Z.save(),Z.drawImage(Q,0,0,M.width,M.height),y.default.Util.releaseCanvas(Q),Z.globalCompositeOperation="source-in",Z.drawImage(M,0,0,U.width,U.height),Z.restore())},[U,M,q,j.width,j.height,k,...D]),j.clipSrc&&q?U:M},N=d(),F=(0,o.observer)(({element:j})=>{const M=Math.min(30,j.width/4,j.height/4),k=a.default.useRef(null);return a.default.useEffect(()=>{const D=k.current;if(!D)return;const B=new y.default.Animation(q=>{D.rotate(((q==null?void 0:q.timeDiff)||0)/2)},D.getLayer());return B.start(),()=>{B.stop()}}),a.default.createElement(u.Group,{x:j.x,y:j.y,rotation:j.rotation,listening:!1,opacity:j.a.opacity,hideInExport:!j.showInExport},a.default.createElement(u.Rect,{width:j.width,height:j.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:k,x:j.width/2,y:j.height/2,fill:"white",outerRadius:Math.abs(M),innerRadius:Math.max(1,M-5),angle:270}))}),H=(0,o.observer)(({element:j})=>{const M="Can not load the video...",k=Math.max(10,Math.min(30,j.width/25));return a.default.createElement(u.Group,{x:j.x,y:j.y,rotation:j.rotation,listening:!1,opacity:j.a.opacity,hideInExport:!j.showInExport},a.default.createElement(u.Rect,{width:j.width,height:j.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:M,fontSize:k,width:j.width,height:j.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let z=f.default;const Y=j=>{z=j};t.setImageLoaderHook=Y;const G=(j,M)=>{const k=a.default.useRef(),D=()=>{var B;(B=k.current)===null||B===void 0||B.call(k),k.current=void 0};a.default.useEffect(()=>D,[]),a.default.useLayoutEffect(()=>{j!=="loading"||k.current||(k.current=(0,h.incrementLoader)(`video ${M}`)),j!=="loading"&&D(),j==="failed"&&(0,h.triggerLoadError)(`video ${M}`)},[j])};t.useImageLoader=G;function W(j,M,k){const D=a.default.useRef("loading"),B=a.default.useRef(),[q,K]=a.default.useState(0),$=a.default.useRef(),U=a.default.useRef(),X=a.default.useRef();return $.current===j&&U.current===M&&X.current===k||(D.current="loading",B.current=void 0,$.current=j,U.current=M,X.current=k),a.default.useLayoutEffect(function(){if(j){var Q=document.createElement("video");return Q.addEventListener("canplay",ee),Q.addEventListener("error",Z),M&&(Q.crossOrigin=M),k&&(Q.referrerpolicy=k),Q.src=j,function(){Q.removeEventListener("canplay",ee),Q.removeEventListener("error",Z)}}function ee(){D.current="loaded",B.current=Q,K(Math.random())}function Z(ne){D.current="failed",B.current=void 0,K(Math.random())}},[j,M,k]),[B.current,D.current]}t.VideoElement=(0,o.observer)(({element:j,store:M})=>{var k;const[D,B]=a.default.useState(!1),q=a.default.useRef(null),K=a.default.useRef(null),[$,U]=a.default.useState(!1),X=M.selectedElements.indexOf(j)>=0,[Q,ee]=a.default.useState(!1),[Z,ne]=W(j.src,"anonymous");(0,t.useImageLoader)(ne,j.id+"-video"),Z&&(Z.muted=!0,Z.width=Z.videoWidth,Z.height=Z.videoHeight);const ie=Z||N;a.default.useEffect(()=>{Z&&M.history.ignore(()=>{j.set({duration:1e3*Z.duration})})},[Z]),a.default.useEffect(()=>{var Oe;if(!Z)return;const Ue=M.isPlaying||Q;if(!Ue)return void Z.pause();Ue&&Z.play();const Je=new y.default.Animation(()=>{},(Oe=q.current)===null||Oe===void 0?void 0:Oe.getLayer());Je.start();const wt=()=>{ee(!1),Z.currentTime=0};return Z.addEventListener("ended",wt),()=>{Je.stop(),Z.removeEventListener("ended",wt)}},[Z,Q,M.isPlaying]),a.default.useEffect(()=>(0,l.autorun)(()=>{var Oe,Ue;if(Z){const Je=M.currentTime%j.duration;Z.currentTime=Je/1e3,(Ue=(Oe=q.current)===null||Oe===void 0?void 0:Oe.getLayer())===null||Ue===void 0||Ue.batchDraw()}}),[M,Z]),a.default.useEffect(()=>{if(!Z)return;let Oe=null;Z.addEventListener("timeupdate",()=>{Oe=(0,h.incrementLoader)(`video ${j.id}`)}),Z.addEventListener("seeked",()=>{Oe&&(Oe(),Oe=null)})},[Z]);let{cropX:pe,cropY:we,cropWidth:Re,cropHeight:xe}=j;ne!=="loaded"&&(pe=we=0,Re=xe=1);const le=ie.width*Re,ce=ie.height*xe,be=j.width/j.height;let _e,te;const fe=le/ce,ue=j.type==="svg";ue?(_e=le,te=ce):be>=fe?(_e=le,te=le/be):(_e=ce*be,te=ce);const me={x:ie.width*pe,y:ie.height*we,width:_e,height:te},Ne=(k=j.cornerRadius)!==null&&k!==void 0?k:0;let Xe=C(j,T(j,ie,me,M._elementsPixelRatio,Ne,D||j._cropModeEnabled||j.type==="svg"),M._elementsPixelRatio,[me,Ne,M._elementsPixelRatio]);const Ye=Math.max(j.width/_e,j.height/te);a.default.useEffect(()=>{var Oe;if(!j._cropModeEnabled)return;const Ue=(Oe=q.current)===null||Oe===void 0?void 0:Oe.getStage();function Je(_t){j._cropModeEnabled&&_t.target!==K.current&&j.toggleCropMode(!1)}function wt(_t){j._cropModeEnabled&&_t.target.nodeName!=="CANVAS"&&j.toggleCropMode(!1)}return document.body.addEventListener("click",wt),Ue==null||Ue.on("click",Je),Ue==null||Ue.on("tap",Je),()=>{document.body.removeEventListener("click",wt),document.body.removeEventListener("touchstart",wt),Ue==null||Ue.off("click",Je),Ue==null||Ue.off("click",Je)}},[j._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(D||j._cropModeEnabled))return(0,S.applyFilter)(q.current,j),(0,l.autorun)(()=>{(0,S.applyFilter)(q.current,j)},{delay:100})},[ie,D,Re,xe,j._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Oe;D||j._cropModeEnabled?(Oe=q.current)===null||Oe===void 0||Oe.clearCache():(0,S.applyFilter)(q.current,j)},[D,j.width,j.height,j._cropModeEnabled]),a.default.useEffect(()=>{(0,S.applyFilter)(q.current,j)},[j.shadowEnabled,j.shadowBlur,j.cornerRadius,j.shadowColor,j.shadowOffsetX,j.shadowOffsetY,j.shadowOpacity]);const Te=a.default.useRef(null),Be=a.default.useRef(null),Ze=a.default.useRef(null);a.default.useLayoutEffect(()=>{j._cropModeEnabled&&(Be.current.nodes([Te.current]),Ze.current.nodes([K.current]))},[j._cropModeEnabled]);const Qe=Oe=>{Math.round(Oe.target.x())>0&&(Oe.target.x(0),Oe.target.scaleX(1)),Math.round(Oe.target.y())>0&&(Oe.target.y(0),Oe.target.scaleY(1));const Ue=Oe.target.width()*Oe.target.scaleX(),Je=Oe.target.height()*Oe.target.scaleY(),wt=Math.min(1,_e/Ue),_t=Math.min(1,te/Je),De=1-wt,Ke=Math.min(De,Math.max(0,Math.round(-Oe.target.x())/Ue)),ct=1-_t,At=Math.min(ct,Math.max(0,Math.round(-Oe.target.y())/Je));Oe.target.setAttrs({x:-Ke*ie.width,y:-At*ie.height,scaleX:1,scaleY:1}),j.set({cropX:Ke,cropY:At,cropWidth:wt,cropHeight:_t})},se=()=>{j.type!=="svg"&&j.contentEditable&&setTimeout(()=>{j.toggleCropMode(!0)})},re=ne==="loading",ke=ne==="failed",Ie=!re&&!ke,ve=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Ce=Ie?j.a.opacity:0;(0,_.useFadeIn)(q,Ce);const Se=j.selectable||M.role==="admin",$e=(0,p.useMobile)();return a.default.createElement(a.default.Fragment,null,re&&a.default.createElement(F,{element:j}),ke&&a.default.createElement(H,{element:j}),a.default.createElement(u.Image,{ref:q,name:"element",id:j.id,image:ie,x:j.x,y:j.y,width:j.width||1,height:j.height||1,rotation:j.rotation,opacity:Ce,shadowEnabled:j.shadowEnabled,shadowBlur:j.shadowBlur,shadowOffsetX:j.shadowOffsetX,shadowOffsetY:j.shadowOffsetY,shadowColor:j.shadowColor,shadowOpacity:j.shadowOpacity,customCrop:me,listening:Se,cropX:me.x,cropY:me.y,cropWidth:me.width,cropHeight:me.height,draggable:$e?j.draggable&&X:j.draggable,preventDefault:!$e||X,hideInExport:!j.showInExport,onMouseEnter:()=>{U(!0)},onMouseLeave:()=>{U(!1)},onDragStart:()=>{M.history.startTransaction()},onDragMove:Oe=>{j.set({x:Oe.target.x(),y:Oe.target.y()})},onDragEnd:Oe=>{j.set({x:Oe.target.x(),y:Oe.target.y()}),M.history.endTransaction()},onDblClick:se,onDblTap:se,onTransformStart:()=>{B(!0),M.history.startTransaction(),ve.current={cropX:j.cropX,cropY:j.cropY,cropWidth:j.cropWidth,cropHeight:j.cropHeight}},onTransform:Oe=>{var Ue;const Je=Oe.currentTarget,wt=Math.abs(Je.scaleX()-1)<1e-7?1:Je.scaleX(),_t=Math.abs(Je.scaleY()-1)<1e-7?1:Je.scaleY();Je.scaleX(1),Je.scaleY(1);const De=(Ue=Oe.target.getStage())===null||Ue===void 0?void 0:Ue.findOne("Transformer"),Ke=1-_e/ie.width,ct=Math.min(Ke,Math.max(0,j.cropX)),At=1-te/ie.height,Wt=Math.min(At,Math.max(0,j.cropY)),zr=De.getActiveAnchor(),br=!(zr.indexOf("middle")>=0||zr.indexOf("center")>=0),Ar=!br&&wt<1&&ve.current.cropHeight>te/ie.height;let Br=br?j.cropWidth:j.cropWidth*wt;Ar&&(Br=j.cropWidth);const Ni=!br&&_t<1&&ve.current.cropWidth>_e/ie.width;let Sn=br?j.cropHeight:j.cropHeight*_t;Ni&&(Sn=j.cropHeight),ue&&(Br=j.cropWidth,Sn=j.cropHeight),j.set({cropX:ct,cropY:Wt,x:Je.x(),y:Je.y(),width:Je.width()*wt,height:Je.height()*_t,rotation:Oe.target.rotation(),cropWidth:Math.min(Br,1-ct),cropHeight:Math.min(Sn,1-Wt)})},onTransformEnd:Oe=>{const Ue=Oe.currentTarget;j.set({width:Ue.width(),height:Ue.height(),x:Ue.x(),y:Ue.y(),rotation:Oe.target.rotation(),cropWidth:_e/ie.width,cropHeight:te/ie.height}),B(!1),M.history.endTransaction()}}),a.default.createElement(u.Rect,{x:j.x,y:j.y,width:Math.max(j.width-j.borderSize,0),height:Math.max(j.height-j.borderSize,0),opacity:Ce,offsetX:-j.borderSize/2,offsetY:-j.borderSize/2,stroke:j.borderColor,strokeWidth:j.borderSize,listening:!1,visible:!!j.borderSize,rotation:j.rotation,cornerRadius:Math.max(0,Ne-j.borderSize),hideInExport:!j.showInExport}),!Q&&a.default.createElement(u.Image,{image:x,x:j.x+j.width/2-20,y:j.y+j.height/2-20,width:40,height:40,hideInExport:!0,onClick:()=>{ee(!0)}}),Q&&a.default.createElement(u.Image,{image:P,x:j.x+j.width/2-20,y:j.y+j.height/2-20,width:40,height:40,hideInExport:!0,onClick:()=>{ee(!1)}}),j._cropModeEnabled&&a.default.createElement(b.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/M.scale,y:-window.innerWidth/M.scale,width:window.innerWidth/M.scale*3,height:window.innerWidth/M.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:Xe,x:j.x,y:j.y,width:j.width,height:j.height,rotation:j.rotation,shadowEnabled:j.shadowEnabled,shadowBlur:j.shadowBlur}),a.default.createElement(u.Group,{x:j.x,y:j.y,rotation:j.rotation,scaleX:Ye,scaleY:Ye},a.default.createElement(u.Image,{image:ie,ref:K,opacity:.4,draggable:!0,x:-j.cropX*ie.width,y:-j.cropY*ie.height,onDragMove:Qe,onTransform:Qe}),a.default.createElement(u.Transformer,{ref:Ze,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Oe,Ue)=>Ue.width<5||Ue.height<5?Oe:Ue,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:_e,height:te,ref:Te,listening:!1,onTransform:Oe=>{Oe.target.x()<-j.cropX*ie.width-1e-9&&(Oe.target.x(-j.cropX*ie.width),Oe.target.scaleX(1)),Oe.target.y()<-j.cropY*ie.height-1e-9&&(Oe.target.y(-j.cropY*ie.height),Oe.target.scaleY(1));const Ue=Math.min(1,Math.max(0,j.cropX+Oe.target.x()/ie.width)),Je=Math.min(1,Math.max(0,Oe.target.y()/ie.height+j.cropY)),wt=Oe.target.width()*Oe.target.scaleX(),_t=Oe.target.height()*Oe.target.scaleY(),De=Math.min(1-Ue,wt/ie.width),Ke=Math.min(1-Je,_t/ie.height),ct=Oe.target.getAbsolutePosition(Oe.target.getParent().getParent());Oe.target.scale({x:1,y:1}),Oe.target.position({x:0,y:0}),j.set({x:ct.x,y:ct.y,cropX:Ue,cropY:Je,cropWidth:De,cropHeight:Ke,width:Math.min(wt*Ye,ie.width*(1-Ue)*Ye),height:Math.min(_t*Ye,ie.height*(1-Je)*Ye)})}}),a.default.createElement(u.Transformer,{ref:Be,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Oe,Ue)=>Ue.width<5||Ue.height<5?Oe:Ue,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),($||X)&&a.default.createElement(v.Highlighter,{element:j}))})})(b8);(function(t){var e=ye&&ye.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerShapeComponent=void 0;const r=e(at),n=Ti,i=h1,a=m1,o=c8,l=y8,u=b8,f=lo,y=zn,b=(0,n.observer)(E=>{const{element:S,store:_}=E,{children:p}=S,d=S.selectable||_.role==="admin";return r.default.createElement(f.Group,{opacity:S.opacity,listening:d},p.map(g=>r.default.createElement(w,Object.assign({},E,{key:g.id,store:_,element:g}))))}),v={text:i.TextElement,image:a.ImageElement,svg:a.ImageElement,line:l.LineElement,video:u.VideoElement,group:b};function h(E,S){v[E]=S}t.registerShapeComponent=h;const w=(0,n.observer)(E=>{let S=v[E.element.type];return E.element.type==="text"&&y.flags.htmlRenderEnabled&&(S=o.HTMLElement),E.element.visible?S?r.default.createElement(S,Object.assign({},E)):(console.error("Can not find component for "+E.element.type),null):null});t.default=w})(n8);var _8={};(function(t){function e(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(t,"__esModule",{value:!0}),t.getCrop=void 0,t.getCrop=e})(_8);var o0={},l0={},g3;function FM(){return g3||(g3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.setAPI=t.iconscoutDownload=t.iconscoutList=t.svgapiDownload=t.svgapiList=t.unsplashDownload=t.unsplashList=t.textTemplateList=t.templateList=t.removeBackground=t.polotnoShapesList=t.getGoogleFontImage=t.getGoogleFontsListAPI=t.URLS=t.URL=t.API=void 0;const e=E1();t.API="https://api.polotno.dev/api",t.URL="https://api.polotno.dev";const r={},n=(p,d)=>{r[p]||(r[p]=!0,console.error(d))},i=`API for iconscout is provided as a demonstration.
202
+ For production usage you have to use your own API endpoint.
203
+ https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
204
+ https://polotno.com/docs/server-api`;t.URLS={unsplashList:({query:p,page:d=1})=>`${t.API}/get-unsplash?query=${p}&per_page=20&page=${d}&KEY=${(0,e.getKey)()}`,unsplashDownload:p=>`${t.API}/download-unsplash?id=${p}&KEY=${(0,e.getKey)()}`,svgapiList:({query:p,page:d=0})=>`${t.API}/get-svgapi?query=${p}&page=${d}&per_page=20&KEY=${(0,e.getKey)()}`,svgapiDownload:p=>`${t.API}/download-svgapi?path=${p}&KEY=${(0,e.getKey)()}`,iconscoutList:({query:p,page:d=1})=>(n("iconscout",i),`${t.API}/get-iconscout?query=${p}&page=${d}&KEY=${(0,e.getKey)()}`),iconscoutDownload:p=>(n("iconscout",i),`${t.API}/download-iconscout?uuid=${p}&KEY=${(0,e.getKey)()}`),templateList:({query:p,page:d=1,sizeQuery:g})=>`${t.API}/get-templates?${g}&query=${p}&per_page=30&page=${d}&KEY=${(0,e.getKey)()}`};const a=()=>`${t.API}/get-google-fonts?KEY=${(0,e.getKey)()}`;t.getGoogleFontsListAPI=a;const o=p=>{return`${t.URL}/google-fonts-previews/black/${d=p,g=" ",m="-",d.replace(new RegExp(g,"g"),m)}.png`;var d,g,m};t.getGoogleFontImage=o;const l=()=>`${t.API}/get-basic-shapes?KEY=${(0,e.getKey)()}`;t.polotnoShapesList=l;const u=()=>`${t.API}/remove-image-background?KEY=${(0,e.getKey)()}`;t.removeBackground=u;const f=p=>t.URLS.templateList(p);t.templateList=f;const y=()=>`${t.API}/get-text-templates?KEY=${(0,e.getKey)()}`;t.textTemplateList=y;const b=p=>t.URLS.unsplashList(p);t.unsplashList=b;const v=p=>t.URLS.unsplashDownload(p);t.unsplashDownload=v;const h=p=>t.URLS.svgapiList(p);t.svgapiList=h;const w=p=>t.URLS.svgapiDownload(p);t.svgapiDownload=w;const E=p=>t.URLS.iconscoutList(p);t.iconscoutList=E;const S=p=>t.URLS.iconscoutDownload(p);t.iconscoutDownload=S;const _=(p,d)=>{t.URLS[p]=d};t.setAPI=_}(l0)),l0}var v3;function E1(){return v3||(v3=1,function(t){var e=ye&&ye.__createBinding||(Object.create?function(x,P,O,R){R===void 0&&(R=O);var T=Object.getOwnPropertyDescriptor(P,O);T&&!("get"in T?!P.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return P[O]}}),Object.defineProperty(x,R,T)}:function(x,P,O,R){R===void 0&&(R=O),x[R]=P[O]}),r=ye&&ye.__setModuleDefault||(Object.create?function(x,P){Object.defineProperty(x,"default",{enumerable:!0,value:P})}:function(x,P){x.default=P}),n=ye&&ye.__importStar||function(x){if(x&&x.__esModule)return x;var P={};if(x!=null)for(var O in x)O!=="default"&&Object.prototype.hasOwnProperty.call(x,O)&&e(P,x,O);return r(P,x),P};Object.defineProperty(t,"__esModule",{value:!0}),t.validateKey=t.isKeyPaid=t.getKey=t.shouldShowCredit=void 0;const i=n(la),a=FM(),o=zn;t.shouldShowCredit=i.observable({value:!1});const l=i.action(()=>{t.shouldShowCredit.value=!0});let u="";const f=()=>u||"";t.getKey=f;const y=5,b=3e3,v="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",h="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",w="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",E="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let S=window.location.origin;const _=navigator.userAgent.indexOf("Headless")>-1,p=navigator.userAgent.indexOf("Electron")>-1;S==="file://"&&_&&(S="headless"),S==="file://"&&p&&(S="electron");const d=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${S}" here: https://polotno.com/cabinet`;async function g(x){for(let P=0;P<y;P++)try{const O=await fetch(a.API+"/validate-key",{method:"POST",body:JSON.stringify({key:x,site:location.host})});if(!x)return console.warn(v),!1;if(O.status!==200){await new Promise(T=>setTimeout(T,b));continue}const R=await O.json();return R.is_valid||console.warn(h),R.is_paid||console.log(E,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),R.is_domain_valid||console.log(d,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,o.useRemoveBackground)(R.remove_background_enabled),R.is_paid||!1}catch{await new Promise(R=>setTimeout(R,b))}return console.error(w),!0}async function m(x,P){u=x,await g(x)&&!P||l()}t.isKeyPaid=g,t.validateKey=m}(o0)),o0}var Cp={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pxToUnitString=t.unitToPx=t.pxToUnitRounded=t.pxToUnit=void 0;const e=({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}};t.pxToUnit=e;const r=({px:a,precious:o=2,dpi:l=72,unit:u="px"})=>parseFloat((0,t.pxToUnit)({px:a,dpi:l,unit:u}).toFixed(o));t.pxToUnitRounded=r;const n=({unitVal:a,dpi:o,unit:l})=>a/(0,t.pxToUnit)({px:1,unit:l,dpi:o});t.unitToPx=n;const i=a=>{const o=parseFloat((0,t.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`}};t.pxToUnitString=i})(Cp);(function(t){var e=ye&&ye.__rest||function(G,W){var j={};for(var M in G)Object.prototype.hasOwnProperty.call(G,M)&&W.indexOf(M)<0&&(j[M]=G[M]);if(G!=null&&typeof Object.getOwnPropertySymbols=="function"){var k=0;for(M=Object.getOwnPropertySymbols(G);k<M.length;k++)W.indexOf(M[k])<0&&Object.prototype.propertyIsEnumerable.call(G,M[k])&&(j[M[k]]=G[M[k]])}return j},r=ye&&ye.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerNextDomDrop=t.registerTransformerAttrs=t.setTransformerStyle=void 0;const n=r(at),i=Ti,a=la,o=lo,l=r(Ap),u=r(si),f=r(n8),y=S1,b=m1,v=_8,h=E1(),w=Tp,E=Cp,S=zn,_=cl,p=new u.default.Group;p.add(new u.default.Rect({width:20,height:20,fill:"white"})),p.add(new u.default.Path({scaleX:20/24,scaleY:20/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));const d=p.toCanvas({pixelRatio:2,width:20,height:20}),g={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,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:G=>{G.hasName("rotater")&&G.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:d,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},m=G=>{Object.assign(g,G)};t.setTransformerStyle=m;const x={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 P(G,W){x[G]=x[G]||W,Object.assign(x[G],W)}t.registerTransformerAttrs=P;const O=G=>n.default.createElement(o.Rect,Object.assign({},G,{preventDefault:!1})),R=G=>{var{url:W}=G,j=e(G,["url"]);const[M,k]=(0,l.default)(W,"anonymous"),D=M?(0,v.getCrop)(M,{width:j.width,height:j.height},"center-middle"):{};return(0,b.useImageLoader)(k,"background"),n.default.createElement(o.Image,Object.assign({image:M},j,D))},T=G=>n.default.createElement(o.Rect,Object.assign({},G)),C=G=>{const{background:W,scale:j,borderColor:M}=G,k=e(G,["background","scale","borderColor"]),D=n.default.useMemo(()=>!!u.default.Util.colorToRGBA(W),[W]),B=n.default.useMemo(()=>{const q=document.createElement("canvas"),K=30;q.width=60,q.height=60;const $=q.getContext("2d");return $&&($.fillStyle="black",$.fillRect(K,0,K,K),$.fillRect(0,K,K,K)),q},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:B},k,{opacity:.1,hideInExport:!0})),D?n.default.createElement(T,Object.assign({fill:W},k)):n.default.createElement(R,Object.assign({url:W},k)))},N=(0,i.observer)(({selection:G})=>G.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(G.x1,G.x2),y:Math.min(G.y1,G.y2),width:Math.abs(G.x1-G.x2),height:Math.abs(G.y1-G.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),F=(0,i.observer)(({x:G,y:W,width:j,height:M,rotation:k,anchor:D,store:B})=>{const q=(0,w.getClientRect)({x:G,y:W,width:j,height:M,rotation:u.default.Util.radToDeg(k)});if(D===void 0)return null;const K=(M/2+70)*Math.cos(k-Math.PI/2),$=(M/2+70)*Math.sin(k-Math.PI/2),U=(0,E.pxToUnitRounded)({unit:B.unit,dpi:B.dpi,px:j/B.scale,precious:B.unit==="px"?0:1})+" x "+(0,E.pxToUnitRounded)({unit:B.unit,dpi:B.dpi,px:M/B.scale,precious:B.unit==="px"?0:1})+(B.unit==="px"?"":" "+B.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(q.minX+q.maxX)/2+K,y:(q.minY+q.maxY)/2+$,offsetX:14,offsetY:14,visible:D==="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(u.default.Util.radToDeg(k)).toString()+"°"})),n.default.createElement(o.Label,{x:(q.minX+q.maxX)/2,y:q.maxY+20,visible:D!=="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:U})))}),H=(0,i.observer)(({elements:G,store:W})=>{const j=G.filter(k=>k.alwaysOnTop),M=G.filter(k=>!k.alwaysOnTop).concat(j);return n.default.createElement(n.default.Fragment,null,M.map(k=>n.default.createElement(f.default,{key:k.id,store:W,element:k,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let z=null;const Y=G=>{z=G};t.registerNextDomDrop=Y,t.default=(0,i.observer)(({store:G,page:W,width:j,height:M,pageControlsEnabled:k,backColor:D,pageBorderColor:B,activePageBorderColor:q,components:K,bleedColor:$})=>{const U=G.bleedVisible?W.bleed:0,X=W.computedWidth+2*U,Q=W.computedHeight+2*U,ee=(j-X*G.scale)/2,Z=(M-Q*G.scale)/2,ne=n.default.useRef(null),ie=n.default.useRef(null),pe=n.default.useRef(null),we=k==null||k,[Re,xe]=n.default.useState(null),[le,ce]=n.default.useState({}),be=G.selectedElements.find(re=>re._cropModeEnabled),_e=G.selectedShapes.filter(re=>!re.resizable).length>0,te=G.selectedShapes.filter(re=>!re.draggable).length>0,fe=G.selectedElements.filter(re=>!re.visible).length>0;n.default.useLayoutEffect(()=>{var re,ke,Ie;if(!ne.current)return;const ve=ne.current.getStage(),Ce=G.selectedShapes.map($e=>$e._cropModeEnabled?null:ve.findOne("#"+$e.id)).filter($e=>$e),Se=G.selectedElements.length===1&&((re=G.selectedElements[0])===null||re===void 0?void 0:re.type)||"many";x[Se]?(ne.current.setAttrs(Object.assign(Object.assign({},g),x[Se])),Se!=="svg"&&Se!=="image"||G.selectedElements[0].keepRatio||ne.current.setAttrs({enabledAnchors:g.enabledAnchors}),Se==="text"&&S.flags.textVerticalResizeEnabled&&ne.current.setAttrs({enabledAnchors:(ke=x.text.enabledAnchors)===null||ke===void 0?void 0:ke.concat(["bottom-center"])})):ne.current.setAttrs(g),_e&&ne.current.enabledAnchors([]),te&&ne.current.rotateEnabled(!1),Ce.find($e=>$e==null?void 0:$e.isDragging())&&Ce.forEach($e=>{$e==null||$e.startDrag()}),ne.current.nodes(Ce),(Ie=ne.current.getLayer())===null||Ie===void 0||Ie.batchDraw()},[G.selectedElements,be,_e,fe,te]);const ue=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),me=n.default.useRef(!1),Ne=(0,_.useMobile)(),Xe=(0,a.action)(re=>{var ke,Ie;if(Ne)return;me.current=!1;const ve=re.target.findAncestor(".elements-container"),Ce=re.target.findAncestor("Transformer"),Se=re.target.findAncestor(".page-abs-container");if(ve||Ce||Se)return;const $e=(ke=re.target.getStage())===null||ke===void 0?void 0:ke.getPointerPosition();$e&&(ue.visible=!0,ue.x1=$e.x,ue.y1=$e.y,ue.x2=$e.x,ue.y2=$e.y,((Ie=re.target.getStage())===null||Ie===void 0?void 0:Ie.getPointersPositions().length)>=2&&(ue.visible=!1))});n.default.useEffect(()=>{const re=(0,a.action)(Ie=>{var ve,Ce;if(!ue.visible)return;(ve=ie.current)===null||ve===void 0||ve.setPointersPositions(Ie);let Se=((Ce=ie.current)===null||Ce===void 0?void 0:Ce.getPointerPosition())||{x:ue.x2,y:ue.y2};ue.x2=Se.x,ue.y2=Se.y}),ke=(0,a.action)(()=>{if(!ue.visible||!ie.current)return;const Ie=ie.current.findOne(".selection"),ve=Ie?Ie.getClientRect():{width:0,height:0,x:0,y:0};if(ve.width&&ve.height){const Ce=[];ie.current.find(".element").forEach(Se=>{const $e=Se.getClientRect(),Oe=G.getElementById(Se.id()),Ue=Oe==null?void 0:Oe.draggable,Je=Oe==null?void 0:Oe.selectable;u.default.Util.haveIntersection(ve,$e)&&Ue&&Je&&Ce.push(Se.id())}),G.selectElements(Ce)}ue.visible=!1,me.current=!0});return window.addEventListener("mousemove",re),window.addEventListener("touchmove",re),window.addEventListener("mouseup",ke),window.addEventListener("touchend",ke),()=>{window.removeEventListener("mousemove",re),window.removeEventListener("touchmove",re),window.removeEventListener("mouseup",ke),window.removeEventListener("touchend",ke)}},[]);const Ye=re=>{if(G.activePage!==W&&W.select(),me.current)return;const ke=re.evt.ctrlKey||re.evt.metaKey||re.evt.shiftKey,Ie=re.target.findAncestor(".elements-container"),ve=re.target.findAncestor(".page-abs-container"),Ce=re.target.findAncestor("Transformer");if(!(ke||Ie||Ce||ve))return void G.selectElements([]);const Se=re.target.findAncestor(".element",!0),$e=G.getElementById(Se==null?void 0:Se.id()),Oe=$e==null?void 0:$e.top,Ue=Oe==null?void 0:Oe.id,Je=G.selectedElementsIds.indexOf(Ue)>=0;Ue&&ke&&!Je?G.selectElements(G.selectedElementsIds.concat([Ue])):Ue&&ke&&Je?G.selectElements(G.selectedElementsIds.filter(wt=>wt!==Ue)):!Ue||ke||Je||G.selectElements([Ue])};(0,y.useSnap)(ne);const Te=G.activePage===W,Be=K==null?void 0:K.PageControls,Ze=K==null?void 0:K.Tooltip,Qe=1/G.scale,se=0/G.scale;return n.default.createElement("div",{ref:pe,onDragOver:re=>re.preventDefault(),onDrop:re=>{if(re.preventDefault(),!ie.current)return;ie.current.setPointersPositions(re);const ke=ie.current.findOne(".elements-container").getRelativePointerPosition(),Ie=ie.current.getPointerPosition(),ve=ie.current.getAllIntersections(Ie).map($e=>$e.findAncestor(".element",!0)).filter(Boolean),Ce=[...new Set(ve.reverse())].map($e=>G.getElementById($e.id())),Se=Ce[0];z&&(z(ke,Se,{elements:Ce,page:W}),z=null)},style:{position:"relative",width:j+"px"},className:"polotno-page-container"+(Te?" active-page":"")},n.default.createElement(o.Stage,{ref:ie,width:j,height:M,onClick:Ye,onTap:Ye,onMouseDown:Xe,onMouseMove:re=>{if(!re.evt.altKey&&Re)return void xe(null);if(!re.evt.altKey)return;const ke=re.target.findAncestor(".element",!0),Ie=ke==null?void 0:ke.id();if(!G.selectedElements[0]||G.selectedElementsIds.includes(Ie))return;const ve=(0,w.getTotalClientRect)(G.selectedElements),Ce=Ie?G.getElementById(Ie):{x:0,y:0,width:W.computedWidth,height:W.computedHeight,rotation:0},Se=(0,w.getClientRect)(Ce),$e=[];ve.minX>Se.maxX&&$e.push({distance:ve.minX-Se.maxX,box1:ve,box2:Se,points:[{x:ve.minX,y:ve.minY+ve.height/2},{x:Se.maxX,y:ve.minY+ve.height/2},{x:Se.maxX,y:Se.minY+Se.height/2}]}),ve.maxX<Se.minX&&$e.push({distance:Se.minX-ve.maxX,box1:ve,box2:Se,points:[{x:ve.maxX,y:ve.minY+ve.height/2},{x:Se.minX,y:ve.minY+ve.height/2},{x:Se.minX,y:Se.minY+Se.height/2}]}),ve.minY>Se.maxY&&$e.push({box1:ve,box2:Se,distance:ve.minY-Se.maxY,points:[{x:ve.minX+ve.width/2,y:ve.minY},{x:ve.minX+ve.width/2,y:Se.maxY},{x:Se.minX+Se.width/2,y:Se.maxY}]}),ve.maxY<Se.minY&&$e.push({box1:ve,box2:Se,distance:Se.minY-ve.maxY,points:[{x:ve.minX+ve.width/2,y:ve.maxY},{x:ve.minX+ve.width/2,y:Se.minY},{x:Se.minX+Se.width/2,y:Se.minY}]}),ve.minX>=Se.minX&&ve.maxX<=Se.maxX&&ve.minY>=Se.minY&&ve.maxY<=Se.maxY&&($e.push({distance:ve.minX-Se.minX,box1:ve,box2:Se,points:[{x:ve.minX,y:ve.minY+ve.height/2},{x:Se.minX,y:ve.minY+ve.height/2},{x:Se.minX,y:Se.minY+Se.height/2}]}),$e.push({distance:Se.maxX-ve.maxX,box1:ve,box2:Se,points:[{x:ve.maxX,y:ve.minY+ve.height/2},{x:Se.maxX,y:ve.minY+ve.height/2},{x:Se.maxX,y:Se.minY+Se.height/2}]}),$e.push({box1:ve,box2:Se,distance:ve.minY-Se.minY,points:[{x:ve.minX+ve.width/2,y:ve.minY},{x:ve.minX+ve.width/2,y:Se.minY},{x:Se.minX+Se.width/2,y:Se.minY}]}),$e.push({box1:ve,box2:Se,distance:Se.maxY-ve.maxY,points:[{x:ve.minX+ve.width/2,y:ve.maxY},{x:ve.minX+ve.width/2,y:Se.maxY},{x:Se.minX+Se.width/2,y:Se.maxY}]})),JSON.stringify(Re)!==JSON.stringify($e)&&xe($e)},onTouchStart:Xe,onDragStart:re=>{var ke;const Ie=re.target.findAncestor(".element",!0);if(Ie){const ve=G.getElementById(Ie==null?void 0:Ie.id()),Ce=ve==null?void 0:ve.top,Se=Ce==null?void 0:Ce.id;!(G.selectedElementsIds.indexOf(Se)>=0)&&Se&&(G.selectElements([Se]),re.target.stopDrag(),re.target.startDrag(),(ke=ne.current)===null||ke===void 0||ke.startDrag(re))}Re&&xe(null)},pageId:W.id,style:{position:"relative"}},n.default.createElement(o.Layer,null,n.default.createElement(O,{width:j,height:M,fill:D}),n.default.createElement(o.Group,{x:ee,y:Z,scaleX:G.scale,scaleY:G.scale,name:"page-container"},n.default.createElement(o.Group,{name:"page-background-group",x:U,y:U},n.default.createElement(C,{x:-W.bleed,y:-W.bleed,width:W.computedWidth+2*W.bleed,height:W.computedHeight+2*W.bleed,background:W.background,shadowBlur:10,shadowColor:"lightgrey",name:"page-background",preventDefault:!1,scale:G.scale})),n.default.createElement(o.Group,{x:U,y:U,name:"elements-container",listening:!G.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:W.computedWidth,height:W.computedHeight,listening:!1}),n.default.createElement(H,{elements:W.children,store:G})),n.default.createElement(o.Rect,{stroke:$,name:"bleed",strokeWidth:W.bleed,x:W.bleed/2,y:W.bleed/2,width:W.computedWidth+W.bleed,height:W.computedHeight+W.bleed,listening:!1,visible:W.bleed>0&&G.bleedVisible,hideInExport:!0})),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,j,0,j,M,0,M,0,0,ee,Z,ee,M-Z,j-ee,M-Z,j-ee,Z,ee,Z],listening:!1,closed:!0,fill:D}),n.default.createElement(o.Group,{x:ee,y:Z,scaleX:G.scale,scaleY:G.scale,name:"page-container"},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-Qe/2-se,y:-Qe/2-se,width:X+Qe+2*se,height:Q+Qe+2*se,stroke:Te&&G.pages.length>1?q:B,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:ee+U*G.scale,y:Z+U*G.scale,scaleX:G.scale,scaleY:G.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:ne,boundBoxFunc:(re,ke)=>{const Ie=ke.width<1||ke.height<1,ve=re.width<1||re.height<1;return Ie&&!ve?re:ke},onTransform:re=>{var ke,Ie;const ve=(ke=ne.current)===null||ke===void 0?void 0:ke.__getNodeRect(),Ce=(Ie=ne.current)===null||Ie===void 0?void 0:Ie.getActiveAnchor();ce({anchor:Ce,x:ve.x,y:ve.y,rotation:ve.rotation,width:ve.width,height:ve.height})},onTransformEnd:re=>{ce({})},visible:!G.isPlaying}),Re&&Re.map(({points:re,distance:ke,box1:Ie,box2:ve},Ce)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:Ce,listening:!1},n.default.createElement(o.Rect,Object.assign({},Ie,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Rect,Object.assign({},ve,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[re[0].x,re[0].y,re[1].x,re[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[re[1].x,re[1].y,re[2].x,re[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(re[0].x+re[1].x)/2,y:(re[0].y+re[1].y)/2,offsetY:-10,scaleX:1/G.scale,scaleY:1/G.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,E.pxToUnitString)({unit:G.unit,dpi:G.dpi,px:ke})})))),W._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:X,height:Q,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:X,height:Q,align:"center",verticalAlign:"middle"})),Ze&&n.default.createElement(Ze,{components:K,store:G,page:W,stageRef:ie})),n.default.createElement(F,Object.assign({},le,{store:G})),n.default.createElement(N,{selection:ue}),h.shouldShowCredit.value&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:j-170,y:M-18,onMouseEnter:re=>{re.target.getStage().container().style.cursor="pointer"},onMouseLeave:re=>{re.target.getStage().container().style.cursor=""},onTouchStart:re=>{re.cancelBubble=!0},onMouseDown:re=>{re.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),we&&Te&&n.default.createElement(Be,{store:G,page:W,xPadding:ee,yPadding:Z}))})})(d6);var w8={};(function(t){var e=ye&&ye.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.LeftRules=t.TopRules=void 0;const r=e(at),n=Tp,i=Cp,a=Ti,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"))}t.TopRules=(0,a.observer)(({store:u,width:f,height:y})=>{const b=r.default.useRef(null);if(!u.activePage)return null;const v=u.activePage,h=(u.bleedVisible&&v.bleed,v.computedWidth*u.scale),w=v.computedHeight*u.scale,E=(f-h)/2,S=(_=x=>(0,i.unitToPx)({unitVal:x,dpi:u.dpi,unit:u.unit})*u.scale,o.find(x=>_(x)>30)||1e4);var _;const p=(0,i.unitToPx)({unitVal:S,dpi:u.dpi,unit:u.unit})*u.scale,d=Math.round(h/p)+1,g=Math.round(w/p)+1,m=(0,n.getTotalClientRect)(u.selectedElements);return r.default.createElement("div",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},ref:b},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:E+P*p+"px",borderLeft:"1px solid grey",paddingLeft:"2px",width:p+"px"}},u.unit==="px"||S>=1?Math.round(S*P):(S*P).toFixed(1))),!!u.selectedElements.length&&r.default.createElement("div",{style:{position:"absolute",left:E+m.x*u.scale+"px",height:"14px",width:m.width*u.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),u.pages.map((x,P)=>{var O;const R=x.computedHeight*u.scale,T=(y-R)/2;return r.default.createElement("div",{key:x.id,style:{left:"0px",width:"14px",height:y+"px",position:"sticky",fontSize:"8px",lineHeight:"14px",color:"grey",borderRight:"1px solid grey",backgroundColor:"#e8e8e8",overflow:"hidden"}},[...Array(g)].map((C,N)=>r.default.createElement("div",{key:N,style:{position:"absolute",left:"14px",top:T+N*p-14+"px",borderLeft:"1px solid grey",paddingLeft:"2px",transform:"rotate(90deg)",transformOrigin:"left top",width:p+"px",overflow:"hidden"}},u.unit==="px"||S>=1?Math.round(S*N):(S*N).toFixed(1))),((O=u.selectedElements[0])===null||O===void 0?void 0:O.page)===x&&r.default.createElement("div",{style:{position:"absolute",top:T+m.y*u.scale-14+"px",width:"14px",height:m.height*u.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),t.LeftRules=l})(w8);var S8={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.handleHotkey=void 0;let e=[],r="";const n="polotno_clipboard",i=l=>{e=l;try{localStorage.setItem(n,JSON.stringify(l))}catch{}},a=()=>{try{const l=localStorage.getItem(n);if(l)return JSON.parse(l)}catch{}return e};function o(l,u){var f,y,b,v,h,w,E,S;if(((f=document.activeElement)===null||f===void 0?void 0:f.tagName)==="INPUT"||((y=document.activeElement)===null||y===void 0?void 0:y.tagName)==="TEXTAREA"||((b=document.activeElement)===null||b===void 0?void 0:b.contentEditable)==="true")return;const _=u.selectedElements.filter(m=>m.removable),p=_.map(m=>m.id);l.keyCode!==46&&l.keyCode!==8||u.deleteElements(p);const d=l.ctrlKey||l.metaKey,g=l.shiftKey;if(d&&!g&&l.code==="KeyZ"&&(l.preventDefault(),u.history.undo()),d&&g&&l.code==="KeyZ"&&(l.preventDefault(),u.history.redo()),d&&l.code==="KeyA"){l.preventDefault();const m=(v=u.activePage)===null||v===void 0?void 0:v.children.filter(P=>P.selectable),x=(m==null?void 0:m.map(P=>P.id))||[];u.selectElements(x)}if(d&&l.code==="KeyC"&&(l.preventDefault(),r=(h=u.activePage)===null||h===void 0?void 0:h.id,i(u.selectedElements.map(m=>m.toJSON()))),d&&l.code==="KeyX"&&(l.preventDefault(),r=(w=u.activePage)===null||w===void 0?void 0:w.id,i(u.selectedElements.map(m=>m.toJSON())),u.deleteElements(_)),d&&l.code==="KeyV"){l.preventDefault();let m=0;r===((E=u.activePage)===null||E===void 0?void 0:E.id)&&(m=u.width/20),r=(S=u.activePage)===null||S===void 0?void 0:S.id,u.history.transaction(()=>{const x=[],P=a();P.forEach(O=>{var R;delete O.id,O.x+=m,O.y+=m;const T=(R=u.activePage)===null||R===void 0?void 0:R.addElement(O);T&&x.push(T.id)}),i(P),u.selectElements(x)})}l.code==="ArrowDown"&&(l.preventDefault(),u.selectedElements.forEach(m=>{m.set({y:m.y+1})})),l.code==="ArrowUp"&&(l.preventDefault(),u.selectedElements.forEach(m=>{m.set({y:m.y-1})})),l.code==="ArrowLeft"&&(l.preventDefault(),u.selectedElements.forEach(m=>{m.set({x:m.x-1})})),l.code==="ArrowRight"&&(l.preventDefault(),u.selectedElements.forEach(m=>{m.set({x:m.x+1})}))}t.handleHotkey=o})(S8);var E8={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.t=t.getTranslations=t.setTranslations=void 0;const e=la,r=(0,e.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"},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",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,y){var b,v=y.split("."),h=f;for(b=0;b<v.length;++b){if(h[v[b]]==null)return;h=h[v[b]]}return h}const i=f=>f&&typeof f=="object";function a(f,y){Object.keys(y).forEach(b=>{const v=f[b],h=y[b];i(h)&&i(v)?a(v,h):f[b]=h})}t.setTranslations=(0,e.action)(f=>{a(r,f)});const o=()=>(0,e.toJS)(r);t.getTranslations=o;const l={},u=f=>{const y=n(r,f);if(y!==void 0)return y;l[f]||(l[f]=!0,console.warn(`Missing translation '${f}'`));const b=f.split("."),v=b[b.length-1]||" ";return v.charAt(0).toUpperCase()+v.slice(1)};t.t=u})(E8);(function(t){var e=ye&&ye.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceCanvas=void 0;const r=e(at),n=Ti,i=e(d6),a=w8,o=S8,l=E8,u=`Polotno warning: <Workspace /> component can not automatically detect its size.
205
+ Width or height of parent elements is equal 0.
206
+ Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
207
+ For simpler debugging here is the log of the parent element:`,f=(v,h,w,E,S,_)=>{const p=r.default.useRef({width:h,height:w}),d=r.default.useRef({top:0,left:0}),g=r.default.useRef(!1),m=r.default.useRef(S.pages.length);g.current=m.current!==S.pages.length,m.current=S.pages.length,r.default.useEffect(()=>{const x=v.current,P=O=>{d.current={top:x.scrollTop,left:x.scrollLeft}};return x.addEventListener("scroll",P),()=>{x.removeEventListener("scroll",P)}},[]),r.default.useLayoutEffect(()=>{if(!v.current||g.current)return;const x=v.current,P=(d.current.left+x.offsetWidth/2)/p.current.width,O=(d.current.top+x.offsetHeight/2)/p.current.height;_.current=!0,x.scrollLeft=P*h-x.offsetWidth/2,x.scrollTop=O*w-x.offsetHeight/2,p.current={width:h,height:w}},[E,h,w])},y=(v,h,w,E,S)=>{const _=r.default.useRef(!1),p=r.default.useRef(null);r.default.useEffect(()=>{const g=v.current,m=()=>{S.current};return g.addEventListener("scroll",m),()=>{g.removeEventListener("scroll",m)}},[]);const d=w.pages.indexOf(w.activePage);return r.default.useLayoutEffect(()=>{if(!w.activePage||!v.current||_.current)return;const g=v.current,m=w.pages.indexOf(w.activePage)*h;Math.abs(m-g.scrollTop)>.5*h&&(S.current=!0,g.scrollTop=m)},[w.activePage,d]),{handleScroll:g=>{if(S.current)return void(S.current=!1);_.current=!0,clearTimeout(p.current),p.current=setTimeout(()=>{_.current=!1},300);const m=g.currentTarget.childNodes[0].offsetHeight,x=g.currentTarget.scrollTop,P=Math.floor((x+E.height/3)/m),O=w.pages[P];O&&O.select()}}},b=({store:v})=>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:()=>{v.addPage()}},(0,l.t)("workspace.addPage")));t.WorkspaceCanvas=(0,n.observer)(({store:v,pageControlsEnabled:h,backgroundColor:w,pageBorderColor:E,activePageBorderColor:S,bleedColor:_,components:p,onKeyDown:d})=>{const[g,m]=r.default.useState({width:100,height:100}),x=r.default.useRef(g),P=r.default.useRef(null),O=r.default.useRef(null),R=v.bleedVisible?Math.max(0,...v.pages.map(q=>q.bleed)):0,T=Math.max(...v.pages.map(q=>q.computedWidth)),C=Math.max(...v.pages.map(q=>q.computedHeight)),N=T+2*R,F=C+2*R,H=()=>{if(P.current===null)return;const q=P.current.getBoundingClientRect();q.width!==0&&q.height!==0||(console.warn(u),console.log(P.current));const K=O.current.clientWidth||q.width,$={width:K,height:q.height};(x.current.width!==$.width||x.current.height!==$.height)&&(m($),x.current=$);const U=(K-40)/N,X=(q.height-110)/F,Q=Math.max(Math.min(U,X),.01);v.scaleToFit!==Q&&(v.setScale(Q),v._setScaleToFit(Q))};r.default.useEffect(H,[N,F]),r.default.useEffect(()=>{const q=P.current;if(window.ResizeObserver){const K=new ResizeObserver(H);return K.observe(q),()=>K.unobserve(q)}{const K=setInterval(H,100);return()=>clearInterval(K)}},[N,F]);const z=Math.max(20,(g.width-N*v.scale)/2),Y=F*v.scale*v.pages.length,G=Math.max(55,(g.height-Y)/v.pages.length/2);r.default.useEffect(()=>{const q=K=>{(d||o.handleHotkey)(K,v)};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[]),r.default.useEffect(()=>{var q;const K=$=>{if($.ctrlKey||$.metaKey){$.preventDefault();const ee=Math.max(2,v.scaleToFit),Z=Math.min(.5,v.scaleToFit),ne=(U=$.deltaY<0?1.05*v.scale:v.scale/1.05,X=Z,Q=ee,Math.max(X,Math.min(Q,U)));v.setScale(ne)}else var U,X,Q};return(q=O.current)===null||q===void 0||q.addEventListener("wheel",K),()=>{var $;return($=O.current)===null||$===void 0?void 0:$.removeEventListener("wheel",K)}},[]);const W=r.default.useRef(!1);f(O,N*v.scale+2*z,F*v.scale+2*G,v.scale,v,W);const{handleScroll:j}=y(O,F*v.scale+2*G,v,g,W),M=g.width>=N*v.scale+2*z,k=w||"rgba(232, 232, 232, 0.9)",D=v.pages.indexOf(v.activePage),B=(p==null?void 0:p.NoPages)||b;return r.default.createElement("div",{ref:P,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:k},tabIndex:0,className:"polotno-workspace-container"},r.default.createElement("div",{ref:O,onScroll:j,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:M?"hidden":"auto"},className:"polotno-workspace-inner"},v.pages.map((q,K)=>Math.abs(K-D)<=1||q._exporting?r.default.createElement(i.default,{key:q.id,page:q,xPadding:z,yPadding:G,width:N*v.scale+2*z,height:F*v.scale+2*G,store:v,pageControlsEnabled:h,backColor:k,pageBorderColor:E||"lightgrey",activePageBorderColor:S||"rgb(0, 161, 255)",bleedColor:_||"rgba(255, 0, 0, 0.1)",components:p}):r.default.createElement("div",{key:q.id,style:{width:N*v.scale+2*z+"px",height:F*v.scale+2*G+"px",backgroundColor:k,paddingLeft:z+"px",paddingRight:z+"px",paddingTop:G+"px",paddingBottom:G+"px"}},r.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}))),v.rulesVisible&&r.default.createElement(a.TopRules,{store:v,xPadding:z,yPadding:G,width:N*v.scale+2*z,height:F*v.scale+2*G}),v.pages.length===0&&r.default.createElement(B,{store:v})))}),t.default=t.WorkspaceCanvas})($4);var s0={},O8="warn";function x8(t){O8=t}function P8(){return O8}function zM(t){x8(t)}var or;(function(t){t.afterCreate="afterCreate",t.afterAttach="afterAttach",t.afterCreationFinalization="afterCreationFinalization",t.beforeDetach="beforeDetach",t.beforeDestroy="beforeDestroy"})(or||(or={}));/*! *****************************************************************************
208
+ Copyright (c) Microsoft Corporation.
209
+
210
+ Permission to use, copy, modify, and/or distribute this software for any
211
+ purpose with or without fee is hereby granted.
212
+
213
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
214
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
215
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
216
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
217
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
218
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
219
+ PERFORMANCE OF THIS SOFTWARE.
220
+ ***************************************************************************** */var Nm=function(t,e){return Nm=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])},Nm(t,e)};function jt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Nm(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var vr=function(){return vr=Object.assign||function(e){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)&&(e[a]=r[a])}return e},vr.apply(this,arguments)};function BM(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function A8(t,e){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(y){return u([f,y])}}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=e.call(t,r)}catch(y){f=[6,y],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Cu(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function O1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >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 so(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(O1(arguments[e]));return t}function Cc(t){return He(t).type}function UM(t,e){return He(t).getChildType(e)}function k8(t,e){return He(t).onPatch(e)}function GM(t,e){return He(t).onSnapshot(e)}function ys(t,e){He(t).applyPatches(N1(e))}function HM(t,e){var r={patches:[],reversedInversePatches:[]},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.reversedInversePatches.slice()),n.reversedInversePatches},get inversePatches(){return n.inversePatches||(n.inversePatches=r.reversedInversePatches.slice().reverse()),n.inversePatches},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=k8(t,function(o,l){e&&!e(o,l,k1())||(r.patches.push(o),r.reversedInversePatches.unshift(l),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){ys(o||t,r.patches)},undo:function(o){ys(o||t,r.reversedInversePatches)}};return a.resume(),a}function VM(t){var e=He(t);if(!e.isRoot)throw je("`protect` can only be invoked on root nodes");e.isProtectionEnabled=!0}function qM(t){var e=He(t);if(!e.isRoot)throw je("`unprotect` can only be invoked on root nodes");e.isProtectionEnabled=!1}function $M(t){return He(t).isProtected}function T8(t,e){return He(t).applySnapshot(e)}function x1(t,e){e===void 0&&(e=!0);var r=He(t);return e?r.snapshot:r.type.getSnapshot(r,!1)}function WM(t,e){e===void 0&&(e=1);for(var r=He(t).parent;r;){if(--e===0)return!0;r=r.parent}return!1}function YM(t,e){e===void 0&&(e=1);for(var r=e,n=He(t).parent;n;){if(--r===0)return n.storedValue;n=n.parent}throw je("Failed to find the parent of "+He(t)+" at depth "+e)}function KM(t,e){for(var r=He(t).parent;r;){if(e.is(r.storedValue))return!0;r=r.parent}return!1}function XM(t,e){for(var r=He(t).parent;r;){if(e.is(r.storedValue))return r.storedValue;r=r.parent}throw je("Failed to find the parent of "+He(t)+" of a given type")}function C8(t){return He(t).root.storedValue}function R8(t){return He(t).path}function QM(t){return Ss(He(t).path)}function ZM(t){return He(t).isRoot}function JM(t,e){var r=K8(He(t),e);return r?r.value:void 0}function eI(t,e,r){var n=He(e).root.identifierCache.resolve(t,Ls(r));return n==null?void 0:n.value}function N8(t){return He(t).identifier}function tI(t,e){e===void 0&&(e=!0);try{var r=t();if(r==null)return;if(Ot(r))return e?P1(r)?r:void 0:r;throw je("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof M1)return;throw n}}function rI(t,e){e===void 0&&(e=!0);try{var r=t();if(r==null)return!1;if(Ot(r))return e?P1(r):!0;throw je("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof M1)return!1;throw n}}function M8(t,e){var r=K8(He(t),e,!1);if(r!==void 0)try{return r.value}catch{return}}function nI(t,e){return Y8(He(t),He(e))}function iI(t,e){e===void 0&&(e=!0);var r=He(t);return r.type.create(r.snapshot,e===!0?r.root.environment:e===!1?void 0:e)}function aI(t){return He(t).detach(),t}function oI(t){var e=He(t);e.isRoot?e.die():e.parent.removeChild(e.subpath)}function P1(t){return He(t).observableIsAlive}function lI(t,e){var r=He(t);return r.addDisposer(e),e}function sI(t){var e=He(t),r=e.root.environment;return r||Yo}function I8(t,e){var r=He(t);r.getChildren().forEach(function(n){Ot(n.storedValue)&&I8(n.storedValue,e)}),e(r.storedValue)}function L8(t){var e;return Ot(t)?e=Cc(t):e=t,{name:e.name,properties:vr({},e.properties)}}function uI(t){var e=He(t).type,r=vr(vr({},L8(e)),{actions:[],volatile:[],views:[],flowActions:[]}),n=Object.getOwnPropertyNames(t);return n.forEach(function(i){if(!(i in r.properties)){var a=Object.getOwnPropertyDescriptor(t,i);if(a.get){GS(t,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):VS(t,i)?r.volatile.push(i):r.views.push(i)}}),r}function cI(t){return t}function fI(t){return t}function dI(t){return t}function hI(t){return He(t).nodeId}var j8=function(){function t(e,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:e}),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:Er.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(t.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){var r=this.isAlive;this._state=e;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._hookSubscribers&&this._hookSubscribers.emit(e,this,e)}}),Object.defineProperty(t.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return this._hookSubscribers||(this._hookSubscribers=new eE),this._hookSubscribers.register(e,r)}}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(t.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){this._parent=e,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(t.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e&&(this.pathAtom||(this.pathAtom=Ku("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Va(this._subpath):""),this.parent.getEscapedPath(e)+"/"+this._escapedSubpath):""}}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlive",{get:function(){return this.state!==Er.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDetaching",{get:function(){return this.state===Er.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=Ku("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.state===Er.CREATED){if(this.parent){if(this.parent.state!==Er.FINALIZED)return;this.fireHook(or.afterAttach)}this.state=Er.FINALIZED,e&&e()}}}),Object.defineProperty(t.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=Er.DEAD}}),Object.defineProperty(t.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(or.beforeDestroy)}}),t}(),nc=function(t){jt(e,t);function e(r,n,i,a,o){var l=t.call(this,r,n,i,a)||this;try{l.storedValue=r.createNewInstance(o)}catch(u){throw l.state=Er.DEAD,u}return l.state=Er.CREATED,l.finalizeCreation(),l}return Object.defineProperty(e.prototype,"root",{get:function(){if(!this.parent)throw je("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.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(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Er.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(e.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(e.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(e.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),e}(j8);nc.prototype.die=rr(nc.prototype.die);var pI=1,gI={onError:function(t){throw t}},bn=function(t){jt(e,t);function e(r,n,i,a,o){var l=t.call(this,r,n,i,a)||this;if(Object.defineProperty(l,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++pI}),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,"_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=Qo(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=o,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new LI),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 je("Instance identifier '"+l.identifierAttribute+"' for type '"+l.type.name+"' must be a string or a number");l.identifier=Ls(u),l.unnormalizedIdentifier=u}return n?n.root.identifierCache.addNodeToCache(l):l.identifierCache.addNodeToCache(l),l}return Object.defineProperty(e.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(e.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===0&&this.createObservableInstance(r)}}),Object.defineProperty(e.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=Cu(l),y=f.next();!y.done;y=f.next()){var b=y.value;b.createObservableInstanceIfNeeded(!1)}}catch(E){n={error:E}}finally{try{y&&!y.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}var v=this.type;try{this.storedValue=v.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,v.finalizeNewInstance(this,this.storedValue)}catch(E){throw this.state=Er.DEAD,E}finally{this._isRunningAction=!1}if(this._observableInstanceState=2,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Yo,this.state=Er.CREATED,r){this.fireHook(or.afterCreate),this.finalizeCreation();try{for(var h=Cu(l.reverse()),w=h.next();!w.done;w=h.next()){var b=w.value;b.fireHook(or.afterCreate),b.finalizeCreation()}}catch(E){a={error:E}}finally{try{w&&!w.done&&(o=h.return)&&o.call(h)}finally{if(a)throw a.error}}}}}),Object.defineProperty(e.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(or.beforeDetach);var r=this.state;this.state=Er.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(e.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(or.afterAttach)):a&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(e.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"&&(ds?ds(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===2?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(e.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.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(e.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(e.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=P8();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw je(i);case"warn":YI(i)}}}}),Object.defineProperty(e.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&Va(r.subpath)||"",a=r.actionContext||A1();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var l=a&&a.context&&R8(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(e.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(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(Yo),this._autoUnbox=!1;try{return this._observableInstanceState===2?this.type.getChildren(this):Q8(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(e.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw je("Cannot modify '"+this+"', the object is protected and can only be modified by using an action.")}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(e.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(e.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(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var a=Cu(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(or.afterCreationFinalization)})}}),Object.defineProperty(e.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw je("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(e.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=ic(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=Ss(i.path),o=X8(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=ic(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),Lo(this.storedValue,"$treenode",this),Lo(this.storedValue,"toJSON",DI)}}),Object.defineProperty(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Er.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.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(e.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(e.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister("snapshot",r)}}),Object.defineProperty(e.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit("snapshot",r)}}),Object.defineProperty(e.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister("patch",r)}}),Object.defineProperty(e.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers("patch")){var i=qI({},r,{path:n.path.substr(this.path.length)+"/"+r.path}),a=O1(eL(i),2),o=a[0],l=a[1];this._internalEventsEmit("patch",o,l)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(e.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas("dispose",r)}}),Object.defineProperty(e.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister("dispose",r,!0);return}throw je("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(e.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas("dispose",r))throw je("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister("dispose",r)}}),Object.defineProperty(e.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(e.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(e.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(e.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=IS(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},gI);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(e.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(e.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new eE),this._internalEvents.register(r,n,i)}}),Object.defineProperty(e.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(e.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(e.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,so([r],i))}}),Object.defineProperty(e.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(e.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),e}(j8);bn.prototype.createObservableInstance=rr(bn.prototype.createObservableInstance);bn.prototype.detach=rr(bn.prototype.detach);bn.prototype.die=rr(bn.prototype.die);var D8,rt;(function(t){t[t.String=1]="String",t[t.Number=2]="Number",t[t.Boolean=4]="Boolean",t[t.Date=8]="Date",t[t.Literal=16]="Literal",t[t.Array=32]="Array",t[t.Map=64]="Map",t[t.Object=128]="Object",t[t.Frozen=256]="Frozen",t[t.Optional=512]="Optional",t[t.Reference=1024]="Reference",t[t.Identifier=2048]="Identifier",t[t.Late=4096]="Late",t[t.Refinement=8192]="Refinement",t[t.Union=16384]="Union",t[t.Null=32768]="Null",t[t.Undefined=65536]="Undefined",t[t.Integer=131072]="Integer",t[t.Custom=262144]="Custom",t[t.SnapshotProcessor=524288]="SnapshotProcessor",t[t.Lazy=1048576]="Lazy",t[t.Finite=2097152]="Finite",t[t.Float=4194304]="Float"})(rt||(rt={}));var F8="cannotDetermine",vI=Symbol("$type"),ia=function(){function t(e){Object.defineProperty(this,D8,{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=e}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return Qi(this,e),this.instantiate(null,"",r,e).value}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){throw je("unimplemented method")}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e===this}}),Object.defineProperty(t.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=W8(e);if(n){var i=Cc(e);return this.isAssignableFrom(i)?un():cn(r,e)}return this.isValidSnapshot(e,r)}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.validate(e,[{path:"",type:this}]).length===0}}),Object.defineProperty(t.prototype,"Type",{get:function(){throw je("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(t.prototype,"TypeWithoutSTN",{get:function(){throw je("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(t.prototype,"SnapshotType",{get:function(){throw je("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(t.prototype,"CreationType",{get:function(){throw je("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}),t}();D8=vI;ia.prototype.create=rr(ia.prototype.create);var bs=function(t){jt(e,t);function e(r){var n=t.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),t.prototype.create.call(this,r,n)}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(e.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===Ls(n[r.identifierAttribute])}}),Object.defineProperty(e.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||Ot(n)&&He(n)===r?!0:r.type===this&&Z8(n)&&!Ot(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(e.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(),Ot(n)&&this.isAssignableFrom(Cc(n))){var l=He(n);return l.setParent(i,a),l}return this.instantiate(i,a,void 0,n)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e}(ia);bs.prototype.create=rr(bs.prototype.create);var fl=function(t){jt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.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(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e}(ia);function Dr(t){return typeof t=="object"&&t&&t.isType===!0}var yi=new Map;function mI(t){return function(r,n,i){switch(r.type){case"action":if(!t.filter||t.filter(r)===!0){var a=t.onStart(r);t.onResume(r,a),yi.set(r.id,{call:r,context:a,async:!1});try{var o=n(r);return t.onSuspend(r,a),yi.get(r.id).async===!1&&(yi.delete(r.id),t.onSuccess(r,a,o)),o}catch(u){throw yi.delete(r.id),t.onFail(r,a,u),u}}else return n(r);case"flow_spawn":{var l=yi.get(r.rootId);return l.async=!0,n(r)}case"flow_resume":case"flow_resume_error":{var l=yi.get(r.rootId);t.onResume(r,l.context);try{return n(r)}finally{t.onSuspend(r,l.context)}}case"flow_throw":{var l=yi.get(r.rootId);return yi.delete(r.rootId),t.onFail(r,l.context,r.args[0]),n(r)}case"flow_return":{var l=yi.get(r.rootId);return yi.delete(r.rootId),t.onSuccess(r,l.context,r.args[0]),n(r)}}}}var yI=function(){function t(e,r){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:e}),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}),e&&e.onStart(r)}return Object.defineProperty(t.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,e))}}),Object.defineProperty(t.prototype,"incFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(t.prototype,"decFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(t.prototype,"hasFlowsPending",{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),t}();function bI(t){var e=new WeakMap;return function(n,i){var a=n.parentActionEvent?e.get(n.parentActionEvent):void 0;if(n.type==="action"){var o=vr(vr({},n),{env:a&&a.call.env,parentCall:a&&a.call}),l=!t.filter||t.filter(o),u=l?t:void 0,f=new yI(u,o);e.set(n,f);var y=void 0;try{y=i(n)}catch(v){throw f.finish(v),v}return f.hasFlowsPending||f.finish(),y}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 b=n.args[0];try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||a.finish(b)}}case"flow_return":try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||a.finish()}}}}}function _I(t,e,r,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(ws(n))return n;if(Ot(n))return Jf("[MSTNode: "+Cc(n).name+"]");if(typeof n=="function")return Jf("[function]");if(typeof n=="object"&&!Ro(n)&&!R1(n))return Jf("[object "+(n&&n.constructor&&n.constructor.name||"Complex Object")+"]");try{return JSON.stringify(n),n}catch(i){return Jf(""+i)}}function wI(t,e){return e&&typeof e=="object"&&"$MST_DATE"in e?new Date(e.$MST_DATE):e}function Jf(t){return{$MST_UNSERIALIZABLE:!0,type:t}}function z8(t,e){ds(function(){N1(e).forEach(function(r){return SI(t,r)})})}function SI(t,e){var r=M8(t,e.path||"");if(!r)throw je("Invalid action path: "+(e.path||""));var n=He(r);if(e.name==="@APPLY_PATCHES")return ys.call(null,r,e.args[0]);if(e.name==="@APPLY_SNAPSHOT")return T8.call(null,r,e.args[0]);if(typeof r[e.name]!="function")throw je("Action '"+e.name+"' does not exist in '"+n.path+"'");return r[e.name].apply(r,e.args?e.args.map(function(i){return wI(n,i)}):[])}function EI(t,e){var r=[],n=function(o){var l=e?e(o,k1()):!0;l&&r.push(o)},i,a={actions:r,get recording(){return!!i},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=B8(t,n))},replay:function(o){z8(o,r)}};return a.resume(),a}function B8(t,e,r){return r===void 0&&(r=!1),H8(t,function(i,a){if(i.type==="action"&&i.id===i.rootId){var o=He(i.context),l={name:i.name,path:Y8(He(t),o),args:i.args.map(function(f,y){return _I(o,i.name,y,f)})};if(r){var u=a(i);return e(l),u}else return e(l),a(i)}else return a(i)})}var OI=1,Ru;function A1(){return Ru}function U8(){return OI++}function Mm(t,e){var r=He(t.context);t.type==="action"&&r.assertAlive({actionContext:t});var n=r._isRunningAction;r._isRunningAction=!0;var i=Ru;Ru=t;try{return AI(r,t,e)}finally{Ru=i,r._isRunningAction=n}}function G8(t){if(t)return t.type==="action"?t:t.parentActionEvent}function ic(t,e,r){var n=function(){var i=U8(),a=Ru,o=G8(a);return Mm({type:"action",name:e,id:i,args:tE(arguments),context:t,tree:C8(t),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?so(a.allParentIds,[a.id]):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}function H8(t,e,r){r===void 0&&(r=!0);var n=He(t);return n.addMiddleWare(e,r)}function xI(t,e,r){r===void 0&&(r=!0);var n={handler:t,includeHooks:r};return e.$mst_middleware=e.$mst_middleware||[],e.$mst_middleware.push(n),e}var PI=function(){function t(e,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=e;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.middlewares[this.arrayIndex];if(e){var r=e[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),t}();function AI(t,e,r){var n=new PI(t,r);if(n.isEmpty)return rr(r).apply(null,e.args);var i=null;function a(o){var l=n.getNextMiddleware(),u=l&&l.handler;if(!u)return rr(r).apply(null,o.args);if(!l.includeHooks&&or[o.name])return a(o);function f(b,v){i=a(b),v&&(i=v(i))}function y(b){i=b}return u(o,f,y),i}return a(e)}function k1(){for(var t=A1();t&&t.type!=="action";)t=t.parentActionEvent;return t}function V8(t,e,r){for(var n=typeof e=="number"?e:e.id,i=r?t:t.parentActionEvent;i;){if(i.id===n)return!0;i=i.parentActionEvent}return!1}function kI(t,e){return V8(t,e,!1)}function TI(t,e){return V8(t,e,!0)}function CI(t){try{return JSON.stringify(t)}catch(e){return"<Unserializable: "+e+">"}}function q8(t){return typeof t=="function"?"<function"+(t.name?" "+t.name:"")+">":Ot(t)?"<"+t+">":"`"+CI(t)+"`"}function RI(t){return t.length<280?t:t.substring(0,272)+"......"+t.substring(t.length-8)}function NI(t){var e=t.value,r=t.context[t.context.length-1].type,n=t.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=Ot(e)?"value of type "+He(e).type.name+":":ws(e)?"value":"snapshot",o=r&&Ot(e)&&r.is(He(e).snapshot);return""+i+a+" "+q8(e)+" is not assignable "+(r?"to type: `"+r.name+"`":"")+(t.message?" ("+t.message+")":"")+(r?pE(r)||ws(e)?".":", 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 T1(t,e,r){return t.concat([{path:e,type:r}])}function un(){return _s}function cn(t,e,r){return[{context:t,value:e,message:r}]}function Rp(t){return t.reduce(function(e,r){return e.concat(r)},[])}function Qi(t,e){KI()&&$8(t,e)}function $8(t,e){var r=t.validate(e,[{path:"",type:t}]);if(r.length>0)throw je(MI(t,e,r))}function MI(t,e,r){if(r.length!==0)return"Error while converting "+RI(q8(e))+" to `"+t.name+`\`:
221
+
222
+ `+r.map(NI).join(`
223
+ `)}var II=0,LI=function(){function t(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:II++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Pt.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Pt.map()})}return Object.defineProperty(t.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.lastCacheModificationPerId.get(e);this.lastCacheModificationPerId.set(e,r===void 0?1:r+1)}}),Object.defineProperty(t.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.lastCacheModificationPerId.get(e)||0;return this.cacheId+"-"+r}}),Object.defineProperty(t.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){if(r===void 0&&(r=!0),e.identifierAttribute){var n=e.identifier;this.cache.has(n)||this.cache.set(n,Pt.array([],Np));var i=this.cache.get(n);if(i.indexOf(e)!==-1)throw je("Already registered");i.push(e),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(t.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this;By(e.identifierCache.cache).forEach(function(n){return n.forEach(function(i){r.addNodeToCache(i)})})}}),Object.defineProperty(t.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.identifierAttribute){var r=e.identifier,n=this.cache.get(r);n&&(n.remove(e),n.length||this.cache.delete(r),this.updateLastCacheModificationPerId(e.identifier))}}}),Object.defineProperty(t.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this,n=new t,i=e.path+"/";return qS(this.cache).forEach(function(a){for(var o=O1(a,2),l=o[0],u=o[1],f=!1,y=u.length-1;y>=0;y--){var b=u[y];(b===e||b.path.indexOf(i)===0)&&(n.addNodeToCache(b,!1),u.splice(y,1),u.length||r.cache.delete(l),f=!0)}f&&r.updateLastCacheModificationPerId(l)}),n}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.cache.get(r);return n?n.some(function(i){return e.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(t.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(a){return e.isAssignableFrom(a.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw je("Cannot resolve a reference to type '"+e.name+"' with id: '"+r+"' unambigously, there are multiple candidates: "+i.map(function(a){return a.path}).join(", "))}}}),t}();function C1(t,e,r,n,i){var a=W8(i);if(a){if(a.parent)throw je("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?e.path:"")+"/"+r+"', but it lives already at '"+a.path+"'");return e&&a.setParent(e,r),a}return new bn(t,e,r,n,i)}function uo(t,e,r,n,i){return new nc(t,e,r,n,i)}function jI(t){return t instanceof nc||t instanceof bn}var Er;(function(t){t[t.INITIALIZING=0]="INITIALIZING",t[t.CREATED=1]="CREATED",t[t.FINALIZED=2]="FINALIZED",t[t.DETACHING=3]="DETACHING",t[t.DEAD=4]="DEAD"})(Er||(Er={}));function Ot(t){return!!(t&&t.$treenode)}function He(t){if(!Ot(t))throw je("Value "+t+" is no MST Node");return t.$treenode}function W8(t){return t&&t.$treenode||null}function DI(){return He(this).snapshot}var FI=function(t){return".."};function Y8(t,e){if(t.root!==e.root)throw je("Cannot calculate relative path: objects '"+t+"' and '"+e+"' are not part of the same object tree");for(var r=Ss(t.path),n=Ss(e.path),i=0;i<r.length&&r[i]===n[i];i++);return r.slice(i).map(FI).join("/")+rh(n.slice(i))}function K8(t,e,r){return r===void 0&&(r=!0),X8(t,Ss(e),r)}function X8(t,e,r){r===void 0&&(r=!0);for(var n=t,i=0;i<e.length;i++){var a=e[i];if(a===".."){if(n=n.parent,n)continue}else{if(a===".")continue;if(n){if(n instanceof nc)try{var o=n.value;Ot(o)&&(n=He(o))}catch(u){if(!r)return;throw u}if(n instanceof bn){var l=n.getChildType(a);if(l&&(n=n.getChildNode(a),n))continue}}}if(r)throw je("Could not resolve '"+a+"' in path '"+(rh(e.slice(0,i))||"/")+"' while resolving '"+rh(e)+"'");return}return n}function Q8(t){if(!t)return _s;var e=Object.keys(t);if(!e.length)return _s;var r=new Array(e.length);return e.forEach(function(n,i){r[i]=t[n]}),r}function zI(t){return rE(),nE(t)}var BI=Object.toString(),_s=Object.freeze([]),Yo=Object.freeze({}),Np=_S().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Np);function je(t){return t===void 0&&(t="Illegal state"),new Error("[mobx-state-tree] "+t)}function UI(t){return t}var GI=Number.isInteger;function HI(t){return Number(t)===t&&t%1!==0}function VI(t){return Number.isFinite(t)}function R1(t){return Array.isArray(t)||Wr(t)}function N1(t){return t?R1(t)?t:[t]:_s}function qI(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=0;n<e.length;n++){var i=e[n];for(var a in i)t[a]=i[a]}return t}function Ro(t){var e;if(t===null||typeof t!="object")return!1;var r=Object.getPrototypeOf(t);return r==null?!0:((e=r.constructor)===null||e===void 0?void 0:e.toString())===BI}function Z8(t){return t!==null&&typeof t=="object"&&!(t instanceof Date)&&!(t instanceof RegExp)}function ws(t,e){return e===void 0&&(e=!0),t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e&&t instanceof Date}function J8(t){return typeof t!="function"}function $I(t,e,r){yr(t)?Gy(t,e,r):Object.defineProperty(t,e,r)}function Lo(t,e,r){$I(t,e,{enumerable:!1,writable:!1,configurable:!0,value:r})}var WI=function(){function t(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(t.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this;return r===void 0&&(r=!1),r?this.handlers.unshift(e):this.handlers.push(e),function(){n.unregister(e)}}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.handlers.indexOf(e)>=0}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.handlers.indexOf(e);r>=0&&this.handlers.splice(r,1)}}),Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(t.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=this.handlers.slice();n.forEach(function(i){return i.apply(void 0,so(e))})}}),t}(),eE=function(){function t(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(t.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.eventHandlers&&this.eventHandlers[e];return!!r&&r.hasSubscribers}}),Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[e];return i||(i=this.eventHandlers[e]=new WI),i.register(r,n)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.eventHandlers&&this.eventHandlers[e];return!!n&&n.has(r)}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.eventHandlers&&this.eventHandlers[e];n&&n.unregister(r)}}),Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.eventHandlers&&delete this.eventHandlers[e]}}),Object.defineProperty(t.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(t.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this.eventHandlers&&this.eventHandlers[e];a&&(r=a).emit.apply(r,so(n))}}),t}();function tE(t){for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=t[r];return e}function u0(t,e){return t.indexOf(e)===0}var rE=function(t,e){};rE.ids={};function YI(t){console.warn(new Error("[mobx-state-tree] "+t))}function KI(){return typeof process<"u"&&process.env&&{}.ENABLE_TYPE_CHECK==="true"}function c0(t){typeof queueMicrotask=="function"?queueMicrotask(t):typeof setImmediate=="function"?setImmediate(t):setTimeout(t,1)}function nE(t){return JI(t.name,t)}function XI(t){return t}function QI(t){return function(){var e,r=[];for(e=0;e<arguments.length;e++)r[e]=arguments[e];return A8(this,function(n){switch(n.label){case 0:return[4,t.apply(void 0,so(r))];case 1:return[2,n.sent()]}})}}function ZI(t){return A8(this,function(e){switch(e.label){case 0:return[4,t];case 1:return[2,e.sent()]}})}function JI(t,e){var r=function(){var i=U8(),a=A1();if(!a)throw je("a mst flow must always have a parent context");var o=G8(a);if(!o)throw je("a mst flow must always have a parent action context");var l={name:t,id:i,tree:a.tree,context:a.context,parentId:a.id,allParentIds:so(a.allParentIds,[a.id]),rootId:a.rootId,parentEvent:a,parentActionEvent:o},u=arguments;function f(y,b,v){return y.$mst_middleware=r.$mst_middleware,Mm(vr(vr({},l),{type:b,args:[v]}),y)}return new Promise(function(y,b){var v,h=function(){v=e.apply(null,arguments),w(void 0)};h.$mst_middleware=r.$mst_middleware,Mm(vr(vr({},l),{type:"flow_spawn",args:tE(u)}),h);function w(_){var p;try{var d=f(function(g){p=v.next(g)},"flow_resume",_);d instanceof Error&&(p=v.throw(d))}catch(g){c0(function(){f(function(m){b(g)},"flow_throw",g)});return}S(p)}function E(_){var p;try{f(function(d){p=v.throw(d)},"flow_resume_error",_)}catch(d){c0(function(){f(function(g){b(d)},"flow_throw",d)});return}S(p)}function S(_){if(_.done){c0(function(){f(function(p){y(p)},"flow_return",_.value)});return}if(!_.value||typeof _.value.then!="function")throw je("Only promises can be yielded to `async`, got: "+_);return _.value.then(w,E)}})};return r._isFlowAction=!0,r}function eL(t){if(!("oldValue"in t))throw je("Patches without `oldValue` field cannot be inversed");return[tL(t),rL(t)]}function tL(t){switch(t.op){case"add":return{op:"add",path:t.path,value:t.value};case"remove":return{op:"remove",path:t.path};case"replace":return{op:"replace",path:t.path,value:t.value}}}function rL(t){switch(t.op){case"add":return{op:"remove",path:t.path};case"remove":return{op:"add",path:t.path,value:t.oldValue};case"replace":return{op:"replace",path:t.path,value:t.oldValue}}}function nL(t){return typeof t=="number"}function Va(t){return nL(t)===!0?""+t:t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function iE(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function rh(t){if(t.length===0)return"";var e=function(r){return r.map(Va).join("/")};return t[0]==="."||t[0]===".."?e(t):"/"+e(t)}function Ss(t){var e=t.split("/").map(iE),r=t===""||t==="."||t===".."||u0(t,"/")||u0(t,"./")||u0(t,"../");if(!r)throw je("a json path must be either rooted, empty or relative, but got '"+t+"'");return e[0]===""&&e.shift(),e}var f0=Symbol("$preProcessorFailed"),iL=function(t){jt(e,t);function e(r,n,i){var a=t.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(e.prototype,"flags",{get:function(){return this._subtype.flags|rt.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor("+this._subtype.describe()+")"}}),Object.defineProperty(e.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.preProcessor?this._processors.preProcessor.call(null,r):r}}),Object.defineProperty(e.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(r){try{return this.preProcessSnapshot(r)}catch{return f0}}}),Object.defineProperty(e.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.postProcessor?this._processors.postProcessor.call(null,r):r}}),Object.defineProperty(e.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;aL(r.type,this,"create");var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r))},vE(this._subtype)||(r.getReconciliationType=function(){return n})}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Ot(a)?a:this.preProcessSnapshot(a),l=this._subtype.instantiate(r,n,i,o);return this._fixNode(l),l}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this._subtype.reconcile(r,Ot(n)?n:this.preProcessSnapshot(n),i,a);return o!==r&&this._fixNode(o),o}}),Object.defineProperty(e.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):i}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.preProcessSnapshotSafe(r);return i===f0?cn(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Dr(r)?this._subtype:Ot(r)?x1(r,!1):this.preProcessSnapshotSafe(r);return n===f0?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!(this._subtype instanceof bs))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),e}(ia);function aL(t,e){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=Cu(i),l=o.next();!l.done;l=o.next()){var u=l.value;t[u]=e[u].bind(e)}}catch(f){r={error:f}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}function oL(t,e,r){return new iL(t,e,r)}var m3="Map.put can only be used to store complex values that have an identifier type attribute";function aE(t,e){var r,n,i=t.getSubTypes();if(i===F8)return!1;if(i){var a=N1(i);try{for(var o=Cu(a),l=o.next();!l.done;l=o.next()){var u=l.value;if(!aE(u,e))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 t instanceof ac&&e.push(t),!0}var Na;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.YES=1]="YES",t[t.NO=2]="NO"})(Na||(Na={}));var lL=function(t){jt(e,t);function e(r,n){return t.call(this,r,Pt.ref.enhancer,n)||this}return Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return t.prototype.get.call(this,""+r)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return t.prototype.has.call(this,""+r)}}),Object.defineProperty(e.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return t.prototype.delete.call(this,""+r)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return t.prototype.set.call(this,""+r,n)}}),Object.defineProperty(e.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!r)throw je("Map.put cannot be used to set empty values");if(Ot(r)){var n=He(r);if(n.identifier===null)throw je(m3);return this.set(n.identifier,r),r}else if(Z8(r)){var i=He(this),a=i.type;if(a.identifierMode!==Na.YES)throw je(m3);var o=a.mapIdentifierAttribute,l=r[o];if(!I1(l)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(x1(u))}var f=Ls(l);return this.set(f,r),this.get(f)}else throw je("Map.put can only be used to store complex values")}}),e}(Mh),nh=function(t){jt(e,t);function e(r,n,i){i===void 0&&(i=[]);var a=t.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:Na.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:rt.Map}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a._determineIdentifierMode(),a.hookInitializers=i,a}return Object.defineProperty(e.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new e(this.name,this._subType,n)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._determineIdentifierMode(),C1(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Na.UNKNOWN){var r=[];if(aE(this._subType,r)){var n=r.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw je("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=Na.YES,this.mapIdentifierAttribute=n):this.identifierMode=Na.NO}}}}),Object.defineProperty(e.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(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new lL(r,this.name)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){zy(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=ic(n,l,u);Lo(n,l,f)})}),Ch(n,this.willChange),Nh(n,this.didChange)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return By(r.storedValue)}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r.storedValue.get(""+n);if(!i)throw je("Not a child "+n);return i}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=He(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;Qi(o,l),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":Qi(o,r.newValue),r.newValue=o.instantiate(n,i,void 0,r.newValue),a.processIdentifier(i,r.newValue);break}return r}}),Object.defineProperty(e.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.identifierMode===Na.YES&&n instanceof bn){var i=n.identifier;if(i!==r)throw je("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(e.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(e.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(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=He(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:Va(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:Va(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:Va(r.name),oldValue:i},n)}}}),Object.defineProperty(e.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(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Qi(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(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return Ro(r)?Rp(Object.keys(r).map(function(a){return i._subType.validate(r[a],T1(n,a,i._subType))})):cn(n,r,"Value is not a plain object")}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Yo}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),e}(bs);nh.prototype.applySnapshot=rr(nh.prototype.applySnapshot);function sL(t){return new nh("Map<string, "+t.name+">",t)}function uL(t){return Dr(t)&&(t.flags&rt.Map)>0}var ih=function(t){jt(e,t);function e(r,n,i){i===void 0&&(i=[]);var a=t.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:rt.Array}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a.hookInitializers=i,a}return Object.defineProperty(e.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new e(this.name,this._subType,n)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return C1(this,r,n,i,a)}}),Object.defineProperty(e.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(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=vr(vr({},Np),{name:this.name});return Pt.array(Q8(r),n)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){oi(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=ic(n,l,u);Lo(n,l,f)})}),Ch(n,this.willChange),Nh(n,this.didChange)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue.slice()}}),Object.defineProperty(e.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 je("Not a child: "+n)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=He(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=y3(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,y=y3(n,i,a.slice(l,l+u),f,f.map(function(v,h){return l+h}));if(!y)return null;r.added=y;for(var b=l+u;b<a.length;b++)a[b].setParent(n,""+(b+f.length-u))}break}return r}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(e.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(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=He(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(e.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(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Qi(this,n);var i=r.storedValue;i.replace(n)}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return R1(r)?Rp(r.map(function(a,o){return i._subType.validate(a,T1(n,""+o,i._subType))})):cn(n,r,"Value is not an array")}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _s}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),e}(bs);ih.prototype.applySnapshot=rr(ih.prototype.applySnapshot);function cL(t){return new ih(t.name+"[]",t)}function y3(t,e,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,y=""+i[o];if(jI(f)&&(f=f.storedValue),!u&&!l)break;if(!l)a=!1,r.splice(o,1),u instanceof bn&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(b3(u,f))r[o]=d0(e,t,y,f,u);else{for(var v=void 0,h=o;h<r.length;h++)if(b3(r[h],f)){v=r.splice(h,1)[0];break}a=!1;var b=d0(e,t,y,f,v);r.splice(o,0,b)}else{if(Ot(f)&&He(f).parent===t)throw je("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.path+"/"+y+"', but it lives already at '"+He(f).path+"'");a=!1;var b=d0(e,t,y,f);r.splice(o,0,b)}}return a?null:r}function d0(t,e,r,n,i){Qi(t,n);function a(){if(Ot(n)){var l=He(n);if(l.assertAlive(Yo),l.parent!==null&&l.parent===e)return l.setParent(e,r),l}return i?t.reconcile(i,n,e,r):t.instantiate(e,r,void 0,n)}var o=a();return i&&i!==o&&(i instanceof bn&&i.createObservableInstanceIfNeeded(),i.die()),o}function b3(t,e){if(!t.isAlive)return!1;if(Ot(e)){var r=He(e);return r.isAlive&&r===t}if(t.snapshot===e)return!0;if(!(t instanceof bn))return!1;var n=t.getReconciliationType();return t.identifier!==null&&t.identifierAttribute&&Ro(e)&&n.is(e)&&n.isMatchingSnapshotId(t,e)}function fL(t){return Dr(t)&&(t.flags&rt.Array)>0}var _3="preProcessSnapshot",w3="postProcessSnapshot";function dL(){return He(this).toString()}var S3={name:"AnonymousModel",properties:{},initializers:_s};function hL(t){var e=Object.keys(t),r={};return e.forEach(function(n){if(r[n])throw je(n+" is declared twice in the model. Model should not contain same keys");r[n]=!0}),e.reduce(function(n,i){var a,o,l;if(i in or)throw je("Hook '"+i+"' was defined as property. Hooks should be defined as part of the actions");var u=Object.getOwnPropertyDescriptor(n,i);if("get"in u)throw je("Getters are not supported as properties. Please use views instead");var f=u.value;if(f==null)throw je("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(ws(f))return Object.assign({},n,(a={},a[i]=jo(bL(f),f),a));if(f instanceof nh)return Object.assign({},n,(o={},o[i]=jo(f,{}),o));if(f instanceof ih)return Object.assign({},n,(l={},l[i]=jo(f,[]),l));if(Dr(f))return n;throw je("Invalid type definition for property '"+i+"', cannot infer a type from a value like '"+f+"' ("+typeof f+")")},t)}var ac=function(t){jt(e,t);function e(r){var n=t.call(this,r.name||S3.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rt.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,S3,r),n.properties=hL(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(e.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=void 0;return this.forAllProps(function(n,i){if(i.flags&rt.Identifier){if(r)throw je("Cannot define property '"+n+"' as object identifier, property '"+r+"' is already defined as identifier property");r=n}}),r}}),Object.defineProperty(e.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new e({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(e.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(e.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Ro(n))throw je("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===_3)throw je("Cannot define action '"+_3+"', it should be defined using 'type.preProcessSnapshot(fn)' instead");if(i===w3)throw je("Cannot define action '"+w3+"', it should be defined using 'type.postProcessSnapshot(fn)' instead");var a=n[i],o=r[i];if(i in or&&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 y=ic(r,i,f);n[i]=y,Lo(r,i,y)})}}),Object.defineProperty(e.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw je("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(e.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Ro(n))throw je("volatile state initializer should return a plain object containing state");Uy(r,n)}}),Object.defineProperty(e.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,y=BM(o,["actions","views","state"]);for(var b in y)throw je("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '"+b+"'");return f&&n.instantiateVolatileState(a,f),u&&n.instantiateViews(a,u),l&&n.instantiateActions(a,l),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.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(e.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Ro(n))throw je("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)Gy(r,i,o),Hy(r,(a={},a[i]=Qo,a));else if(typeof o.value=="function")Lo(r,i,o.value);else throw je("A view member should either be a function or getter based property")})}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Ot(a)?a:this.applySnapshotPreProcessor(a);return C1(this,r,n,i,o)}}),Object.defineProperty(e.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(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=vr(vr({},Np),{name:this.name});return Pt.object(r,Yo,n)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Lo(n,"toString",dL),this.forAllProps(function(i){zy(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),Ch(n,this.willChange),Nh(n,this.didChange)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=He(n.object),a=n.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(Qi(o,n.newValue),n.newValue=o.reconcile(i.getChildNode(a),n.newValue,i,a)),n}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=He(n.object),a=i.type.properties[n.name];if(a){var o=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:Va(n.name),value:n.newValue.snapshot,oldValue:o},i)}}}),Object.defineProperty(e.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(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i;if(!(n in this.properties))throw je("Not a value property: "+n);var a=oi(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw je("Node not available for property "+n);return o}}),Object.defineProperty(e.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=ki(r.storedValue,o);u.reportObserved()}catch{throw je(o+" property is declared twice")}a[o]=i.getChildNode(r,o).snapshot}),n?this.applySnapshotPostProcessor(a):a}}),Object.defineProperty(e.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(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){if(!(i.op==="replace"||i.op==="add"))throw je("object does not support operation "+i.op);r.storedValue[n]=i.value}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Qi(this,n);var i=this.applySnapshotPreProcessor(n);this.forAllProps(function(a){r.storedValue[a]=i[a]})}}),Object.defineProperty(e.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.preProcessor;return n?n.call(null,r):r}}),Object.defineProperty(e.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.postProcessor;return n?n.call(null,r):r}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.properties[r]}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.applySnapshotPreProcessor(r);return Ro(a)?Rp(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],T1(n,o,i.properties[o]))})):cn(n,a,"Value is not a plain object")}}),Object.defineProperty(e.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(e.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(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Yo}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),e}(bs);ac.prototype.applySnapshot=rr(ac.prototype.applySnapshot);function pL(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=typeof t[0]=="string"?t.shift():"AnonymousModel",n=t.shift()||{};return new ac({name:r,properties:n})}function gL(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=typeof t[0]=="string",n=r?t[0]:"AnonymousModel";return r&&t.shift(),t.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 oE(t){return Dr(t)&&(t.flags&rt.Object)>0}var da=function(t){jt(e,t);function e(r,n,i,a){a===void 0&&(a=UI);var o=t.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(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return uo(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.initializer(r)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(ws(r)&&this.checker(r))return un();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return cn(n,r,"Value is not a "+i)}}),e}(fl),lE=new da("string",rt.String,function(t){return typeof t=="string"}),sE=new da("number",rt.Number,function(t){return typeof t=="number"}),vL=new da("integer",rt.Integer,function(t){return GI(t)}),mL=new da("float",rt.Float,function(t){return HI(t)}),yL=new da("finite",rt.Finite,function(t){return VI(t)}),uE=new da("boolean",rt.Boolean,function(t){return typeof t=="boolean"}),cE=new da("null",rt.Null,function(t){return t===null}),fE=new da("undefined",rt.Undefined,function(t){return t===void 0}),dE=new da("Date",rt.Date,function(t){return typeof t=="number"||t instanceof Date},function(t){return t instanceof Date?t:new Date(t)});dE.getSnapshot=function(t){return t.storedValue.getTime()};var hE=dE;function bL(t){switch(typeof t){case"string":return lE;case"number":return sE;case"boolean":return uE;case"object":if(t instanceof Date)return hE}throw je("Cannot determine primitive type from value "+t)}function pE(t){return Dr(t)&&(t.flags&(rt.String|rt.Number|rt.Integer|rt.Boolean|rt.Date))>0}var _L=function(t){jt(e,t);function e(r){var n=t.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:rt.Literal}),n.value=r,n}return Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return uo(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return ws(r)&&r===this.value?un():cn(n,r,"Value is not a literal "+JSON.stringify(this.value))}}),e}(fl);function gE(t){return new _L(t)}function wL(t){return Dr(t)&&(t.flags&rt.Literal)>0}var SL=function(t){jt(e,t);function e(r,n,i,a){var o=t.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(e.prototype,"flags",{get:function(){return this._subtype.flags|rt.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(e.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=Ot(r)?He(r).snapshot:r;return this._predicate(a)?un():cn(n,r,this._message(r))}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,n,i,a)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),e}(ia);function EL(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=typeof t[0]=="string"?t.shift():Dr(t[0])?t[0].name:null,n=t[0],i=t[1],a=t[2]?t[2]:function(o){return"Value does not respect the refinement predicate"};return new SL(r,n,i,a)}function OL(t){return(t.flags&rt.Refinement)>0}function xL(t,e){var r=typeof t=="string"?e:t,n=Mp.apply(void 0,so(r.map(function(i){return gE(""+i)})));return typeof t=="string"&&(n.name=t),n}var PL=function(t){jt(e,t);function e(r,n,i){var a=t.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=vr({eager:!0,dispatcher:void 0},i),a._dispatcher=i.dispatcher,i.eager||(a._eager=!1),a}return Object.defineProperty(e.prototype,"flags",{get:function(){var r=rt.Union;return this._types.forEach(function(n){r|=n.flags}),r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._types.some(function(n){return n.isAssignableFrom(r)})}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(r){return r.describe()}).join(" | ")+")"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(a,void 0);if(!o)throw je("No matching type for union "+this.describe());return o.instantiate(r,n,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(n,r.getReconciliationType());if(!o)throw je("No matching type for union "+this.describe());return o.reconcile(r,n,i,a)}}),Object.defineProperty(e.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(e.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 un();a++}else i.push(u)}return a===1?un():cn(n,r,"No type is applicable for the union").concat(Rp(i))}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),e}(ia);function Mp(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=Dr(t)?void 0:t,i=Dr(t)?so([t],e):e,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new PL(a,i,n)}function vE(t){return(t.flags&rt.Union)>0}var AL=function(t){jt(e,t);function e(r,n,i){var a=t.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(e.prototype,"flags",{get:function(){return this._subtype.flags|rt.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(e.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(e.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(e.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"&&Qi(this,r),r}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?un():this._subtype.validate(r,n)}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),e}(ia);function kL(t,e){if(typeof e!="function"&&Ot(e))throw je("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function jo(t,e,r){return kL(t,e),new AL(t,e,r||TL)}var TL=[void 0];function CL(t){return Dr(t)&&(t.flags&rt.Optional)>0}var RL=jo(fE,void 0),NL=jo(cE,null);function mE(t){return Mp(t,RL)}function ML(t){return Mp(t,NL)}var IL=function(t){jt(e,t);function e(r,n){var i=t.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(e.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|rt.Late},enumerable:!1,configurable:!0}),Object.defineProperty(e.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 je("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(e.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(e.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(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):un()}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||F8}}),e}(ia);function LL(t,e){var r=typeof t=="string"?t:"late("+t.toString()+")",n=typeof t=="string"?e:t;return new IL(r,n)}function jL(t){return Dr(t)&&(t.flags&rt.Late)>0}function DL(t,e){return new FL(t,e)}var FL=function(t){jt(e,t);function e(r,n){var i=t.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:rt.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Pt.array()}),bm(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(rr(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(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy "+this.name+">"}}),Object.defineProperty(e.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=uo(this,r,n,i,a);return this.pendingNodeList.push(l),bm(function(){return!l.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(l),1)}),l}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.loadedType?this.loadedType.validate(r,n):J8(r)?un():cn(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(e.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)):t.prototype.reconcile.call(this,r,n,i,a)}}),e}(fl),yE=function(t){jt(e,t);function e(r){var n=t.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:rt.Frozen}),n}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return uo(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return J8(r)?this.subType?this.subType.validate(r,n):un():cn(n,r,"Value is not serializable and cannot be frozen")}}),e}(fl),E3=new yE;function zL(t){return arguments.length===0?E3:Dr(t)?new yE(t):jo(E3,t)}function BL(t){return Dr(t)&&(t.flags&rt.Frozen)>0}function UL(t){switch(t){case or.beforeDestroy:return"destroy";case or.beforeDetach:return"detach";default:return}}var GL=function(){function t(e,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}),I1(e))this.identifier=e;else if(Ot(e)){var n=He(e);if(!n.identifierAttribute)throw je("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw je("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw je("Can only store references to tree nodes or identifiers, got: '"+e+"'")}return Object.defineProperty(t.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=Ls(this.identifier),n=e.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 M1("[mobx-state-tree] Failed to resolve reference '"+this.identifier+"' to type '"+this.targetType.name+"' (from node: "+e.path+")");this.resolvedReference={node:o,lastCacheModification:i}}}}),Object.defineProperty(t.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),t}(),M1=function(t){jt(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return e}(Error),bE=function(t){jt(e,t);function e(r,n){var i=t.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:rt.Reference}),i}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.targetType.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return I1(r)?un():cn(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(e.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){ys(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){oE(o.type)?this.replaceRef(void 0):ys(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(e.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.getValue(r);if(a){var o=He(a),l=function(y,b){var v=UL(b);v&&i.fireInvalidated(v,r,n,o)},u=o.registerHook(or.beforeDetach,l),f=o.registerHook(or.beforeDestroy,l);return function(){u(),f()}}}}),Object.defineProperty(e.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=this;if(this.onInvalidated){var o;r.registerHook(or.beforeDestroy,function(){o&&o()});var l=function(u){o&&o();var f=r.parent,y=f&&f.storedValue;if(f&&f.isAlive&&y){var b=void 0;i?b=!!i.get(n,y):b=r.root.identifierCache.has(a.targetType,Ls(n)),b?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===Er.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(or.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(or.afterAttach,function(){l(!1)}))}}}),e}(fl),HL=function(t){jt(e,t);function e(r,n){return t.call(this,r,n)||this}return Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=r.storedValue;return n.resolvedValue}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r.storedValue;return n.identifier}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Ot(a)?N8(a):a,l=new GL(a,this.targetType),u=uo(this,r,n,i,l);return l.node=u,this.watchTargetNodeForInvalidations(u,o,void 0),u}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this){var o=Ot(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}}),e}(bE),VL=function(t){jt(e,t);function e(r,n,i){var a=t.call(this,r,i)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(e.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(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Ot(a)?this.options.set(a,r?r.storedValue:null):a,l=uo(this,r,n,i,o);return this.watchTargetNodeForInvalidations(l,o,this.options),l}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Ot(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}}),e}(bE);function _E(t,e){var r=e||void 0,n=e?e.onInvalidated:void 0;return r&&(r.get||r.set)?new VL(t,{get:r.get,set:r.set},n):new HL(t,n)}function qL(t){return(t.flags&rt.Reference)>0}function $L(t,e){var r=_E(t,vr(vr({},e),{onInvalidated:function(n){e&&e.onInvalidated&&e.onInvalidated(n),n.removeRef()}}));return e&&e.acceptsUndefined===!1?r:mE(r)}var wE=function(t){jt(e,t);function e(r,n){var i=t.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:rt.Identifier}),i}return Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r||!(r.type instanceof ac))throw je("Identifier types can only be instantiated as direct child of a model type");return uo(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(r.storedValue!==n)throw je("Tried to change identifier from '"+r.storedValue+"' to '"+n+"'. Changing identifiers is not allowed.");return r.setParent(i,a),r}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?cn(n,r,"Value is not a valid "+this.describe()+", expected a "+this.validType):un()}}),e}(fl),WL=function(t){jt(e,t);function e(){var r=t.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rt.Identifier}),r}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),e}(wE),YL=function(t){jt(e,t);function e(){return t.call(this,"identifierNumber","number")||this}return Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),e}(wE),KL=new WL,XL=new YL;function QL(t){return Dr(t)&&(t.flags&rt.Identifier)>0}function Ls(t){return""+t}function I1(t){return typeof t=="string"||typeof t=="number"}function ZL(t){return new JL(t)}var JL=function(t){jt(e,t);function e(r){var n=t.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:rt.Custom}),n}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return un();var i=this.options.getValidationMessage(r);return i?cn(n,r,"Invalid value for type '"+this.name+"': "+i):un()}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(e.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 uo(this,r,n,i,o)}}),Object.defineProperty(e.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}}),e}(fl),ej={enumeration:xL,model:pL,compose:gL,custom:ZL,reference:_E,safeReference:$L,union:Mp,optional:jo,literal:gE,maybe:mE,maybeNull:ML,refinement:EL,string:lE,boolean:uE,number:sE,integer:vL,float:mL,finite:yL,Date:hE,map:sL,array:cL,frozen:zL,identifier:KL,identifierNumber:XL,late:LL,lazy:DL,undefined:fE,null:cE,snapshotProcessor:oL};const tj=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:lI,addMiddleware:H8,applyAction:z8,applyPatch:ys,applySnapshot:T8,cast:cI,castFlowReturn:XI,castToReferenceSnapshot:dI,castToSnapshot:fI,clone:iI,createActionTrackingMiddleware:mI,createActionTrackingMiddleware2:bI,decorate:xI,destroy:oI,detach:aI,escapeJsonPath:Va,flow:nE,getChildType:UM,getEnv:sI,getIdentifier:N8,getLivelinessChecking:P8,getMembers:uI,getNodeId:hI,getParent:YM,getParentOfType:XM,getPath:R8,getPathParts:QM,getPropertyMembers:L8,getRelativePath:nI,getRoot:C8,getRunningActionContext:k1,getSnapshot:x1,getType:Cc,hasParent:WM,hasParentOfType:KM,isActionContextChildOf:kI,isActionContextThisOrChildOf:TI,isAlive:P1,isArrayType:fL,isFrozenType:BL,isIdentifierType:QL,isLateType:jL,isLiteralType:wL,isMapType:uL,isModelType:oE,isOptionalType:CL,isPrimitiveType:pE,isProtected:$M,isReferenceType:qL,isRefinementType:OL,isRoot:ZM,isStateTreeNode:Ot,isType:Dr,isUnionType:vE,isValidReference:rI,joinJsonPath:rh,onAction:B8,onPatch:k8,onSnapshot:GM,process:zI,protect:VM,recordActions:EI,recordPatches:HM,resolveIdentifier:eI,resolvePath:JM,setLivelinessChecking:x8,setLivelynessChecking:zM,splitJsonPath:Ss,toGenerator:ZI,toGeneratorFunction:QI,tryReference:tI,tryResolve:M8,typecheck:$8,types:ej,unescapeJsonPath:iE,unprotect:qM,walk:I8},Symbol.toStringTag,{value:"Module"})),ha=Ya(tj);var SE={},L1={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.deepEqual=void 0;const e=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,t.deepEqual)(r[i],n[i]))return!1;return!0}return!1};t.deepEqual=e})(L1);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UndoManager=void 0;const e=ha,r=L1;Object.assign(e.types),t.UndoManager=e.types.model("UndoManager",{history:e.types.array(e.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=!1;function y(){const v=(0,e.getSnapshot)(i);return{pages:v.pages,width:v.width,height:v.height}}function b(v){(0,e.applySnapshot)(i.pages,v.pages),i.setSize(v.width,v.height)}return{startTransaction(){f=!0},endTransaction(v){f=!1,v||this.requestAddState(y())},async ignore(v,h=!1){u&&n.addUndoState();let w=f;w||n.startTransaction();try{await v()}catch(E){setTimeout(()=>{throw E})}w||n.endTransaction(!0),h||w||n.replaceState(),clearTimeout(u),u=0},async transaction(v){await n.ignore(v,!0),this.addUndoState()},requestAddState(v){l=v,u||f||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),f||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const v=n.history[n.undoIdx];!(0,r.deepEqual)(l,v)&&(clearTimeout(u),u=0,n.history.splice(n.undoIdx+1),n.history.push(l),n.undoIdx=n.history.length-1)},afterCreate(){if(i=(0,e.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,e.onSnapshot)(i,()=>{this.requestAddState(y())}),n.history.length===0&&this.requestAddState(y())},clear(){clearTimeout(u),u=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(y())},beforeDestroy(){a()},undo(){u&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,b(n.history[n.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){u&&this.addUndoState(),n.canRedo?(n.undoIdx++,o=!0,b(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=y()}}}),t.default=t.UndoManager})(SE);let rj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",EE=t=>crypto.getRandomValues(new Uint8Array(t)),OE=(t,e,r)=>{let n=(2<<Math.log(t.length-1)/Math.LN2)-1,i=-~(1.6*n*e/t.length);return(a=e)=>{let o="";for(;;){let l=r(i),u=i;for(;u--;)if(o+=t[l[u]&n]||"",o.length===a)return o}}},nj=(t,e=21)=>OE(t,e,EE),ij=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),"");const aj=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:nj,customRandom:OE,nanoid:ij,random:EE,urlAlphabet:rj},Symbol.toStringTag,{value:"Module"})),j1=Ya(aj);var xE={};(function(t){async function e(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(t,"__esModule",{value:!0}),t.downloadFile=void 0,t.downloadFile=e})(xE);var PE={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getJsPDF=void 0;const e="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=e,document.head.appendChild(a)})}t.getJsPDF=n})(PE);var AE={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createGIF=t.getGIF=void 0;const e="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=e,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
224
+ (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]);
225
+ `],{type:"application/javascript"}))})}t.getGIF=r,t.createGIF=n})(AE);var kE={};(function(t){async function e(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(t,"__esModule",{value:!0}),t.waitTillAvailable=void 0,t.waitTillAvailable=e})(kE);var TE={},oc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCrop=t.cropImage=t.loadImage=t.getImageSize=void 0;const e=Is;function r(o){return new Promise(l=>{const u=document.createElement("img");u.onload=async()=>{u.width===0||u.height===0?l(await(0,e.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=y=>{u(y)},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 y=document.createElement("canvas");y.width=l.width,y.height=l.height;const b=y.getContext("2d");let{cropX:v,cropY:h}=l;const w=f.width*l.cropWidth,E=f.height*l.cropHeight,S=l.width/l.height;let _,p;const d=w/E;return l.type==="svg"?(_=w,p=E):S>=d?(_=w,p=w/S):(_=E*S,p=E),b.drawImage(f,v*f.width,h*f.height,_,p,0,0,y.width,y.height),y.toDataURL("image/png")}function a(o,l){const{width:u,height:f}=o,y=u/f;let b,v;y>=l.width/l.height?(b=l.width,v=l.width/y):(b=l.height*y,v=l.height);const h=(l.width-b)/2,w=(l.height-v)/2;return{cropX:h/l.width,cropY:w/l.height,cropWidth:b/l.width,cropHeight:v/l.height}}t.getImageSize=r,t.loadImage=n,t.cropImage=i,t.getCrop=a})(oc);(function(t){var e=ye&&ye.__createBinding||(Object.create?function(m,x,P,O){O===void 0&&(O=P);var R=Object.getOwnPropertyDescriptor(x,P);R&&!("get"in R?!x.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return x[P]}}),Object.defineProperty(m,O,R)}:function(m,x,P,O){O===void 0&&(O=P),m[O]=x[P]}),r=ye&&ye.__setModuleDefault||(Object.create?function(m,x){Object.defineProperty(m,"default",{enumerable:!0,value:x})}:function(m,x){m.default=x}),n=ye&&ye.__importStar||function(m){if(m&&m.__esModule)return m;var x={};if(m!=null)for(var P in m)P!=="default"&&Object.prototype.hasOwnProperty.call(m,P)&&e(x,m,P);return r(x,m),x};Object.defineProperty(t,"__esModule",{value:!0}),t.jsonToHTML=t.jsonToDOM=t.fixRatio=void 0;const i=oc,a=n(Is),o=oc,l=(m,x,...P)=>({type:m,props:x,children:P||[]});function u(m){var x=new DOMParser().parseFromString(m,"image/svg+xml");return x.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(x)}t.fixRatio=u;const f=async({element:m,page:x,store:P})=>{let{src:O}=m;if(m.type==="svg"){const K=await a.urlToString(O);O=a.replaceColors(K,new Map(Object.entries(m.colorsReplace)))}let R="";m.flipX&&(R+="scaleX(-1)"),m.flipY&&(R+="scaleY(-1)");const T={};if(m.clipSrc){const K=await a.urlToBase64(m.clipSrc);T["clip-path"]=`url(${K})`}const C=await(0,o.loadImage)(O),N=C.width*m.cropWidth,F=C.height*m.cropHeight,H=m.width/m.height;let z,Y;const G=N/F;m.type==="svg"?(z=N,Y=F):H>=G?(z=N,Y=N/H):(z=F*H,Y=F);const W=z/C.width,j=Y/C.height,M=z/Y>m.width/m.height?m.height/Y:m.width/z,k=z*M/W,D=Y*M/j,B=m.cropX*M*C.width,q=m.cropY*M*C.height;return l("div",{src:O,style:Object.assign(Object.assign({},T),{width:"100%",height:"100%","border-radius":m.cornerRadius+"px",border:m.borderSize?`${m.borderSize}px solid ${m.borderColor}`:"none",background:`url(${O})`,transform:R,"background-size":`${Math.round(k)}px ${Math.round(D)}px`,"background-position-x":`${Math.round(B)}px`,"background-position-y":`${Math.round(q)}px`})})},y=async({element:m,page:x,store:P})=>{let O={};m.fill.indexOf("gradient")>=0&&(O=Object.assign(Object.assign({},O),{"background-color":m.fill,"background-image":m.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const R=m.backgroundPadding*(m.fontSize*m.lineHeight),T=l("div",{style:{position:"absolute",top:-R/2+"px",left:-R/2+"px",display:m.backgroundEnabled?"block":"none",width:m.width+R+"px",height:m.height+R+"px","background-color":m.backgroundColor,"border-radius":m.backgroundCornerRadius*(m.fontSize*m.lineHeight*.5)+"px"}}),C=l("div",{style:Object.assign(Object.assign({},O),{position:"absolute",top:0,left:0,width:m.width+"px",color:m.fill,"white-space":"pre-wrap","font-size":m.fontSize+"px","text-align":m.align,"font-family":m.fontFamily,"text-decoration":m.textDecoration||"none","line-height":m.lineHeight,"letter-spacing":m.letterSpacing+"em","font-style":m.fontStyle,"font-weight":m.fontWeight,"-webkit-text-stroke":`${m.strokeWidth}px ${m.stroke}`,"text-stroke":`${m.strokeWidth}px ${m.stroke}`})},m.text.split(`
226
+ `).join("<br />"));return l("div",{style:{position:"relative"}},T,C)},b=({element:m,type:x})=>{const P={"stroke-width":m.height,stroke:m.color,"line-cap":"round","stroke-linejoin":"round",opacity:m.opacity};return x==="arrow"||x==="triangle"?l("polyline",Object.assign({points:`${3*m.height},${2*-m.height} 0,0 ${3*m.height},${2*m.height}`},P)):x==="bar"?l("polyline",Object.assign({points:`0,${2*-m.height} 0,${2*m.height}`},P)):x==="circle"?l("circle",Object.assign({r:m.height},P)):x==="square"?l("polyline",Object.assign({points:`${-m.height},${-m.height} ${-m.height},${m.height} ${m.height},${m.height} ${m.height},${-m.height}`},P)):null},v=async({element:m,page:x,store:P})=>l("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},l("rect",{x:0,y:0,width:m.width,height:m.height,fill:m.color}),l("g",{transform:`translate(0 ${m.height/2})`},b({element:m,type:m.startHead})),l("g",{transform:`translate(${m.width} ${m.height/2}) rotate(180)`},b({element:m,type:m.endHead}))),h=async({element:m,page:x,store:P,elementHook:O})=>{const R=await Promise.all(m.children.map(C=>E({element:C,page:x,store:P,elementHook:O}))),T=l("div",{style:{"transform-origin":"top left",opacity:m.opacity}},...R);return O&&O({dom:T,element:m})||T},w={image:f,svg:f,text:y,line:v,group:h};async function E({element:m,page:x,store:P,elementHook:O}){let R=await w[m.type];R||(R=()=>l("div",{}),console.error(`HTML export does not support ${m.type} type...`));const T=await R({element:m,page:x,store:P}),C=[];m.blurEnabled&&C.push(`blur(${m.blurRadius/2}px)`),m.brightnessEnabled&&C.push(`brightness(${100*m.brightness+100}%)`),m.sepiaEnabled&&C.push("sepia()"),m.grayscaleEnabled&&C.push("grayscale()"),m.shadowEnabled&&C.push(`drop-shadow(${m.shadowOffsetX}px ${m.shadowOffsetY}px ${m.shadowBlur}px ${m.shadowColor})`);const N=l("div",{style:{position:"absolute",left:m.x+"px",top:m.y+"px",width:m.width+"px",height:m.height+"px",transform:`rotate(${m.rotation}deg)`,"transform-origin":"top left",opacity:m.opacity,filter:C.join(" ")}},T);return O&&O({dom:N,element:m})||N}async function S({page:m,store:x,elementHook:P}){const O=await Promise.all(m.children.map(T=>E({element:T,page:m,store:x,elementHook:P})));let R={};if(m.background.indexOf("url")>=0||m.background.indexOf("http")>=0||m.background.indexOf(".jpg")>=0||m.background.indexOf(".png")>=0||m.background.indexOf(".jpeg")>=0){const T=await(0,o.loadImage)(m.background),C=await(0,o.cropImage)(m.background,Object.assign({width:x.width,height:x.height,x:0,y:0},(0,i.getCrop)({width:x.width,height:x.height},{width:T.width,height:T.height})));R=Object.assign(Object.assign({},R),{"background-image":`url(${C})`})}return l("div",{className:"page",style:Object.assign(Object.assign({},R),{width:x.width+"px",height:x.height+"px",background:m.background,border:"1px solid grey",overflow:"hidden",position:"relative"})},...O)}async function _({json:m,elementHook:x}){const P=await Promise.all(m.pages.map(T=>S({page:T,store:m,elementHook:x}))),O=[];m.pages.forEach(T=>{T.children.forEach(C=>{C.type==="text"&&O.indexOf(C.fontFamily)===-1&&O.push(C.fontFamily)})});const R=O.map(T=>m.fonts.find(C=>C.fontFamily===T)?l("style",{},""):l("link",{href:`https://fonts.googleapis.com/css?family=${T}`,rel:"stylesheet"}));return l("div",{className:"design"},...R,...P)}t.jsonToDOM=_;const p=(m,x)=>typeof x=="object"?`${m}="${Object.keys(x).map(P=>`${P}:${x[P]};`).join(" ")}"`:`${m}="${x}"`,d=({dom:m})=>typeof m=="string"?m:m?`<${m.type} ${Object.keys(m.props).map(x=>p(x,m.props[x])).join(" ")}>${m.children.map(x=>d({dom:x})).join("")}</${m.type}>`:"";async function g({json:m,elementHook:x}){const P=await _({json:m,elementHook:x});return d({dom:P})}t.jsonToHTML=g})(TE);var CE={};(function(t){var e=ye&&ye.__createBinding||(Object.create?function(x,P,O,R){R===void 0&&(R=O);var T=Object.getOwnPropertyDescriptor(P,O);T&&!("get"in T?!P.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return P[O]}}),Object.defineProperty(x,R,T)}:function(x,P,O,R){R===void 0&&(R=O),x[R]=P[O]}),r=ye&&ye.__setModuleDefault||(Object.create?function(x,P){Object.defineProperty(x,"default",{enumerable:!0,value:P})}:function(x,P){x.default=P}),n=ye&&ye.__importStar||function(x){if(x&&x.__esModule)return x;var P={};if(x!=null)for(var O in x)O!=="default"&&Object.prototype.hasOwnProperty.call(x,O)&&e(P,x,O);return r(P,x),P};Object.defineProperty(t,"__esModule",{value:!0}),t.jsonToSVG=t.jsonToDOM=t.fixRatio=void 0;const i=oc,a=n(Is),o=oc,l=(x,P,...O)=>({type:x,props:P,children:O||[]});function u(x){var P=new DOMParser().parseFromString(x,"image/svg+xml");return P.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(P)}t.fixRatio=u;const f=async x=>{const P=await(0,o.loadImage)(x),O=document.createElement("canvas");return O.width=P.width,O.height=P.height,O.getContext("2d").drawImage(P,0,0),O.toDataURL("image/png")},y=async({element:x,page:P,store:O})=>{let{src:R}=x;if(x.type==="svg"){const U=await a.urlToString(R);R=a.replaceColors(U,new Map(Object.entries(x.colorsReplace)))}let T="";x.flipX&&(T+="scaleX(-1)"),x.flipY&&(T+="scaleY(-1)");const C={};if(x.clipSrc){const U=await a.urlToBase64(x.clipSrc);C["clip-path"]=`url(${U})`}const N=await(0,o.loadImage)(R),F=N.width*x.cropWidth,H=N.height*x.cropHeight,z=x.width/x.height;let Y,G;const W=F/H;x.type==="svg"?(Y=F,G=H):z>=W?(Y=F,G=F/z):(Y=H*z,G=H);const j=Y/N.width,M=G/N.height,k=Y/G>x.width/x.height?x.height/G:x.width/Y,D=Y*k/j,B=G*k/M,q=x.cropX*k*N.width,K=x.cropY*k*N.height,$=`clip-${Math.random()}`;return l("g",{style:{"clip-path":C["clip-path"],transform:T}},l("defs",{},l("clipPath",{id:$},l("rect",{x:q,y:K,width:D,height:B}))),l("image",{"xlink:href":await f(R),width:x.width,height:x.height,preserveAspectRatio:"none","clip-path":`url(#${$})`}))},b=async({element:x,page:P,store:O})=>{let R={};x.fill.indexOf("gradient")>=0&&(R=Object.assign(Object.assign({},R),{"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 T=x.backgroundPadding*(x.fontSize*x.lineHeight),C=l("div",{style:{position:"absolute",top:-T/2+"px",left:-T/2+"px",display:x.backgroundEnabled?"block":"none",width:x.width+T+"px",height:x.height+T+"px","background-color":x.backgroundColor,"border-radius":x.backgroundCornerRadius*(x.fontSize*x.lineHeight*.5)+"px"}}),N=l("div",{style:Object.assign(Object.assign({},R),{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(`
227
+ `).join("<br />"));return l("foreignObject",{width:x.width,height:x.height},l("div",{style:{position:"relative"},xmlns:"http://www.w3.org/1999/xhtml"},C,N))},v=({element:x,type:P})=>{const O={"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}`},O)):P==="bar"?l("polyline",Object.assign({points:`0,${2*-x.height} 0,${2*x.height}`},O)):P==="circle"?l("circle",Object.assign({r:x.height},O)):P==="square"?l("polyline",Object.assign({points:`${-x.height},${-x.height} ${-x.height},${x.height} ${x.height},${x.height} ${x.height},${-x.height}`},O)):null},h=async({element:x,page:P,store:O})=>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})`},v({element:x,type:x.startHead})),l("g",{transform:`translate(${x.width} ${x.height/2}) rotate(180)`},v({element:x,type:x.endHead}))),w=async({element:x,page:P,store:O,elementHook:R})=>{const T=await Promise.all(x.children.map(N=>S({element:N,page:P,store:O,elementHook:R}))),C=l("g",{opacity:x.opacity,style:{"transform-origin":"top left"}},...T);return R&&R({dom:C,element:x})||C},E={image:y,svg:y,text:b,line:h,group:w};async function S({element:x,page:P,store:O,elementHook:R}){let T=await E[x.type];T||(T=()=>l("div",{}),console.error(`HTML export does not support ${x.type} type...`));const C=await T({element:x,page:P,store:O}),N=[];x.blurEnabled&&N.push(`blur(${x.blurRadius/2}px)`),x.brightnessEnabled&&N.push(`brightness(${100*x.brightness+100}%)`),x.sepiaEnabled&&N.push("sepia()"),x.grayscaleEnabled&&N.push("grayscale()"),x.shadowEnabled&&N.push(`drop-shadow(${x.shadowOffsetX}px ${x.shadowOffsetY}px ${x.shadowBlur}px ${x.shadowColor})`);const F=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:N.join(" ")}},C);return R&&R({dom:F,element:x})||F}async function _({page:x,store:P,elementHook:O}){const R=await Promise.all(x.children.map(C=>S({element:C,page:x,store:P,elementHook:O})));let T={};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 C=await(0,o.loadImage)(x.background),N=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:C.width,height:C.height})));T=Object.assign(Object.assign({},T),{"background-image":`url(${N})`})}return l("g",{className:"page",style:Object.assign(Object.assign({},T),{background:x.background})},l("rect",{x:0,y:0,width:P.width,height:P.height,fill:x.background}),...R)}async function p({json:x,elementHook:P}){const O=await Promise.all(x.pages.map(C=>_({page:C,store:x,elementHook:P}))),R=[];x.pages.forEach(C=>{C.children.forEach(N=>{N.type==="text"&&R.indexOf(N.fontFamily)===-1&&R.push(N.fontFamily)})});const T=R.map(C=>x.fonts.find(N=>N.fontFamily===C)?l("style",{},""):l("link",{href:`https://fonts.googleapis.com/css?family=${C}`,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"},...T,...O)}t.jsonToDOM=p;const d=(x,P)=>typeof P=="object"?`${x}="${Object.keys(P).map(O=>`${O}:${P[O]};`).join(" ")}"`:`${x}="${P}"`,g=({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=>g({dom:P})).join("")}</${x.type}>
228
+ `:"";async function m({json:x,elementHook:P}){const O=await p({json:x,elementHook:P});return g({dom:O})}t.jsonToSVG=m})(CE);var h0={},p0={},g0={},O3;function RE(){return O3||(O3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Node=void 0;const e=ha,r=j1,n=D1(),i=IE(),a=ah();t.Node=e.types.model("Node",{id:e.types.identifier,type:"none",name:"",opacity:1,custom:e.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).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,e.getParentOfType)(o,i.Page)},get store(){return(0,e.getParentOfType)(o,n.Store)},get top(){let l=o;for(;;){if(!(0,e.hasParentOfType)(l,a.GroupElement))return l;l=(0,e.getParentOfType)(l,a.GroupElement)}},get parent(){return(0,e.hasParentOfType)(o,a.GroupElement)?(0,e.getParentOfType)(o,a.GroupElement):(0,e.hasParentOfType)(o,i.Page)?(0,e.getParentOfType)(o,i.Page):(0,e.hasParentOfType)(o,n.Store)?(0,e.getParentOfType)(o,n.Store):null}})).actions(o=>({toJSON:()=>Object.assign({},(0,e.getSnapshot)(o))})).actions(o=>({clone(l={}){const u=o.toJSON();return l.id=l.id||(0,r.nanoid)(10),(0,a.forEveryChild)(u,f=>{f.id=(0,r.nanoid)(10)}),Object.assign(u,l),o.page.addElement(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(){o.store.history.endTransaction()}}))}(g0)),g0}var v0={},NE={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.registerAnimation=t.animate=t.animations=void 0;const e={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}}};t.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=e[o.data.direction]||e.right,u={};for(var f in l.from){let y=a[f]+l.from[f],b=a[f]+l.to[f];if(o.type==="exit"){const h=y;y=b,b=-h}const v=b-y;u[f]=y+i/o.duration*v}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 y in u){let b=u[y],v=f[y];if(o.type==="exit"){const w=b;b=v,v=w}const h=v-b;l[y]=b+i/o.duration*h}return l}};const r=({element:i,dTime:a,animation:o})=>{const l=t.animations[o.name];return l?l({element:i,dTime:a,animation:o}):(console.error("Can not find animation type: "+o.name),{})};t.animate=r;const n=(i,a)=>{};t.registerAnimation=n})(NE);var x3;function Rc(){return x3||(x3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.Animation=void 0;const e=ha,r=NE,n=RE();t.Animation=e.types.model("Animation",{delay:0,duration:500,enabled:!0,type:e.types.enumeration("Type",["enter","exit"]),name:"none",data:e.types.frozen({})}),t.Shape=n.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:e.types.array(t.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(b=>b.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 b=l-f.delay,v=(0,r.animate)({element:i,animation:f,dTime:b});Object.assign(o,v)}const y=i.animations.find(b=>b.type==="exit");if(y!=null&&y.enabled&&l>=i.page.duration-y.duration){const b=l-(i.page.duration-y.duration),v=(0,r.animate)({element:i,animation:y,dTime:b});Object.assign(o,v)}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))}}))}(v0)),v0}var m0={},P3;function oj(){return P3||(P3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextElement=void 0;const e=ha,r=Rc();t.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:e.types.optional(e.types.union(e.types.number,e.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()}}))}(m0)),m0}var y0={},A3;function ME(){return A3||(A3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageElement=void 0;const e=Rc();t.ImageElement=e.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()}}))}(y0)),y0}var b0={},k3;function lj(){return k3||(k3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.VideoElement=void 0;const e=ME();t.VideoElement=e.ImageElement.named("Video").props({type:"video",duration:0})}(b0)),b0}var _0={},T3;function sj(){return T3||(T3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LineElement=void 0;const e=ha,r=Rc();t.LineElement=r.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:e.types.array(e.types.number),startHead:"",endHead:""}).actions(n=>({}))}(_0)),_0}var w0={},C3;function uj(){return C3||(C3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SVGElement=void 0;const e=ha,r=Rc();t.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:e.types.map(e.types.string)}).preProcessSnapshot(n=>Object.assign(Object.assign({},n),{src:n.src||n.svgSource})).actions(n=>({replaceColor(i,a){n.colorsReplace.set(i,a)}}))}(w0)),w0}var R3;function ah(){return R3||(R3=1,function(t){var e=ye&&ye.__rest||function(w,E){var S={};for(var _ in w)Object.prototype.hasOwnProperty.call(w,_)&&E.indexOf(_)<0&&(S[_]=w[_]);if(w!=null&&typeof Object.getOwnPropertySymbols=="function"){var p=0;for(_=Object.getOwnPropertySymbols(w);p<_.length;p++)E.indexOf(_[p])<0&&Object.prototype.propertyIsEnumerable.call(w,_[p])&&(S[_[p]]=w[_[p]])}return S};Object.defineProperty(t,"__esModule",{value:!0}),t.registerShapeModel=t.TYPES_MAP=t.GroupElement=t.ElementTypes=t.forEveryChild=void 0;const r=ha,n=RE(),i=Rc(),a=oj(),o=ME(),l=lj(),u=sj(),f=uj(),y=(w,E)=>{w.children&&w.children.forEach(S=>{E(S),(0,t.forEveryChild)(S,E)})};t.forEveryChild=y;const b=[...new Array(20)].map((w,E)=>r.types.late(()=>v[E]));t.ElementTypes=r.types.union({dispatcher:w=>{const E=t.TYPES_MAP[w.type];if(!E)throw new Error(`Unknown element type: "${w.type}"`);return E}},f.SVGElement,a.TextElement,o.ImageElement,u.LineElement,l.VideoElement,r.types.late(()=>t.GroupElement),...b),t.GroupElement=n.Node.named("Group").props({type:"group",children:r.types.array(t.ElementTypes)}).views(w=>({get draggable(){let E=!0;return(0,t.forEveryChild)(w,S=>{S.draggable||(E=!1)}),E},get resizable(){let E=!0;return(0,t.forEveryChild)(w,S=>{S.resizable||(E=!1)}),E},get contentEditable(){let E=!0;return(0,t.forEveryChild)(w,S=>{S.contentEditable||(E=!1)}),E},get styleEditable(){let E=!0;return(0,t.forEveryChild)(w,S=>{S.styleEditable||(E=!1)}),E},get locked(){let E=!0;return(0,t.forEveryChild)(w,S=>{S.locked||(E=!1)}),E}})).actions(w=>({set(E){var{draggable:S,contentEditable:_,styleEditable:p,resizable:d}=E,g=e(E,["draggable","contentEditable","styleEditable","resizable"]);S!==void 0&&(0,t.forEveryChild)(w,m=>{m.set({draggable:S})}),_!==void 0&&(0,t.forEveryChild)(w,m=>{m.set({contentEditable:_})}),p!==void 0&&(0,t.forEveryChild)(w,m=>{m.set({styleEditable:p})}),d!==void 0&&(0,t.forEveryChild)(w,m=>{m.set({resizable:d})}),Object.assign(w,g)}}));const v=[];function h(w){const E=w.type;if(!E)throw new Error('You must pass "type" attribute to custom model.');const S=i.Shape.named(E).props(w);t.TYPES_MAP[E]=S,v.push(S)}t.TYPES_MAP={svg:f.SVGElement,text:a.TextElement,image:o.ImageElement,group:t.GroupElement,line:u.LineElement,video:l.VideoElement},t.registerShapeModel=h}(p0)),p0}var N3;function IE(){return N3||(N3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Page=void 0;const e=ha,r=j1,n=ah(),i=D1(),a=ah();t.Page=e.types.model("Page",{id:e.types.identifier,children:e.types.array(n.ElementTypes),width:e.types.optional(e.types.union(e.types.number,e.types.literal("auto")),"auto"),height:e.types.optional(e.types.union(e.types.number,e.types.literal("auto")),"auto"),background:"white",bleed:0,custom:e.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,e.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,e.getSnapshot)(o))),_forEachElementUp(l,u){const f=l.map(y=>({id:y,index:o.children.findIndex(b=>b.id===y)}));f.sort((y,b)=>b.index-y.index);for(const{index:y}of f){if(y==-1)continue;const b=y<o.children.length-1&&o.children[y+1],v=l.indexOf(b==null?void 0:b.id)>=0;y===o.children.length-1||v||u(y)}},_forEachElementDown(l,u){const f=l.map(y=>({id:y,index:o.children.findIndex(b=>b.id===y)}));f.sort((y,b)=>y.index-b.index);for(const{index:y}of f){if(y==-1)continue;const b=y>0&&o.children[y-1],v=l.indexOf(b==null?void 0:b.id)>=0;y===0||v||u(y)}return!1}})).actions(o=>({clone(l={}){const u=o.toJSON();u.children.forEach(v=>{v.id=(0,r.nanoid)(10),(0,a.forEveryChild)(v,h=>{h.id=(0,r.nanoid)(10)})});const f=Object.assign(Object.assign(Object.assign({},u),{id:(0,r.nanoid)(10)}),l),y=o.store.addPage(f),b=o.store.pages.indexOf(o);y.setZIndex(b+1),y.select()},setZIndex(l){o.store.setPageZIndex(o.id,l)},set(l){Object.assign(o,l)},select(){o.store.selectPage(o.id)},addElement(l){const u=a.TYPES_MAP[l.type];if(!u)return void console.error("Can not find model with type "+l.type);l.children&&l.children.forEach(y=>{y.id=(0,r.nanoid)(10)});const f=u.create(Object.assign({id:(0,r.nanoid)(10)},l));return o.children.push(f),f.selectable&&o.store.selectElements([f.id]),f},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,e.detach)(f),o.children.splice(u+1,0,f)})},canMoveElementsTop(l){return this.canMoveElementsUp(l)},moveElementsTop(l){const u=[],f=[];o.children.forEach(y=>{l.indexOf(y.id)>=0?u.push(y):f.push(y)}),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,e.detach)(f),o.children.splice(u-1,0,f)})},canMoveElementsBottom(l){return this.canMoveElementsDown(l)},moveElementsBottom(l){const u=[],f=[];o.children.forEach(y=>{l.indexOf(y.id)>=0?u.push(y):f.push(y)}),o.children.replace(u.concat(f))},setElementZIndex(l,u){const f=o.children.find(y=>y.id===l);f&&((0,e.detach)(f),o.children.remove(f),o.children.splice(u,0,f))},setSize({width:l,height:u,useMagic:f,softChange:y}){if(f){const b=l/o.computedWidth,v=u/o.computedHeight,h=Math.min(b,v),w=Math.max(0,(l-o.computedWidth*h)/2),E=Math.max(0,(u-o.computedHeight*h)/2);(0,a.forEveryChild)(o,async S=>{S.type!=="group"&&(S.type==="image"&&S.x<1&&S.y<1&&S.width>=o.computedWidth-2&&S.height>=o.computedHeight-2?S.set({x:S.x*h,y:S.y*h,width:S.width*b,height:S.height*v,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(S.set({x:w+S.x*h,y:E+S.y*h,width:S.width*h,height:S.height*h}),S.type==="text"&&S.set({fontSize:S.fontSize*h})))})}y||(o.width=l),y||(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])}}))}(h0)),h0}var M3;function D1(){return M3||(M3=1,function(t){var e=ye&&ye.__createBinding||(Object.create?function(O,R,T,C){C===void 0&&(C=T);var N=Object.getOwnPropertyDescriptor(R,T);N&&!("get"in N?!R.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return R[T]}}),Object.defineProperty(O,C,N)}:function(O,R,T,C){C===void 0&&(C=T),O[C]=R[T]}),r=ye&&ye.__setModuleDefault||(Object.create?function(O,R){Object.defineProperty(O,"default",{enumerable:!0,value:R})}:function(O,R){O.default=R}),n=ye&&ye.__importStar||function(O){if(O&&O.__esModule)return O;var R={};if(O!=null)for(var T in O)T!=="default"&&Object.prototype.hasOwnProperty.call(O,T)&&e(R,O,T);return r(R,O),R},i=ye&&ye.__rest||function(O,R){var T={};for(var C in O)Object.prototype.hasOwnProperty.call(O,C)&&R.indexOf(C)<0&&(T[C]=O[C]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(C=Object.getOwnPropertySymbols(O);N<C.length;N++)R.indexOf(C[N])<0&&Object.prototype.propertyIsEnumerable.call(O,C[N])&&(T[C[N]]=O[C[N]])}return T},a=ye&&ye.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(t,"__esModule",{value:!0}),t.createStore=t.Store=t.Font=void 0;const o=ha,l=SE,u=j1,f=a(si),y=xE,b=PE,v=AE,h=E1(),w=n(kc),E=na,S=Cp,_=L1,p=kE,d=TE,g=CE,m=IE(),x=ah();function P({key:O,showCredit:R}={key:"",showCredit:!1}){const T=t.Store.create();return(0,h.validateKey)(O,R),T}(0,o.setLivelinessChecking)("ignore"),t.Font=o.types.model("Font",{fontFamily:o.types.string,url:o.types.optional(o.types.string,""),styles:o.types.frozen()}).preProcessSnapshot(O=>Object.assign(Object.assign({},O),{fontFamily:O.fontFamily||O.name})),t.Store=o.types.model("Store",{role:"",pages:o.types.array(m.Page),fonts:o.types.array(t.Font),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",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(O=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),O.bleedVisible},get selectedElements(){return O.selectedElementsIds.map(R=>{for(const T of O.pages)for(const C of T.children)if(C.id===R)return C}).filter(R=>!!R)},get children(){return O.pages},get selectedShapes(){const R=[];return O.selectedElementsIds.forEach(T=>{for(const C of O.pages)for(const N of C.children)N.id===T&&N.type!=="group"&&R.push(N),N.type==="group"&&N.id===T&&R.push(...N.children)}),R},get activePage(){return O.pages.slice().find(R=>R.id===O._activePageId)||(O.pages.length?O.pages[0]:null)},get duration(){let R=0;return O.pages.forEach(T=>{R+=T.duration}),R}})).actions(O=>{let R=0;return{afterCreate(){O.history.canUndo},setCurrentTime(T){O.currentTime=T},play({animatedElementsIds:T=[],currentTime:C=0}={}){O.animatedElementsIds=(0,o.cast)(T),O.currentTime=C,O.isPlaying=!0,R=Date.now(),requestAnimationFrame(O.seek)},seek(){if(!O.isPlaying)return;const T=Date.now(),C=T-R;R=T,O.currentTime+=C;let N=0;for(const F of O.pages){if(O.currentTime>=F.startTime&&O.currentTime<F.startTime+F.duration){O.selectPage(F.id);break}N+=F.duration}O.isPlaying&&O.currentTime<O.duration?requestAnimationFrame(O.seek):O.stop()},stop(){O.isPlaying=!1,O.currentTime=0,O.animatedElementsIds=(0,o.cast)([])}}}).actions(O=>({setUnit({unit:R,dpi:T}){O.unit=R||O.unit,O.dpi=T||O.dpi},setRole(R){O.role=R},find(R){let T;return(0,x.forEveryChild)({children:O.pages},C=>{!T&&R(C)&&(T=C)}),T},getElementById:R=>O.find(T=>T.id===R),addPage(R){const T=m.Page.create(Object.assign({id:(0,u.nanoid)(10)},R));return O.pages.push(T),O._activePageId=T.id,T},selectPage(R){O._activePageId=R},selectElements(R){const T=R.map(C=>O.getElementById(C)).sort((C,N)=>C.page.children.indexOf(C)-C.page.children.indexOf(N)).filter(C=>!!C).map(C=>C.id);O.selectedElementsIds=(0,o.cast)(T)},toggleBleed(R){O.bleedVisible=R??!O.bleedVisible},toggleRulers(R){O.rulesVisible=R??!O.rulesVisible},openSidePanel(R){O.openedSidePanel=R},setScale(R){O.scale=R},_setScaleToFit(R){O.scaleToFit=R},setElementsPixelRatio(R){O._elementsPixelRatio=R},setSize(R,T,C){O.pages.forEach(N=>{N.setSize({width:R,height:T,useMagic:C,softChange:!0})}),O.width=R,O.height=T},setPageZIndex(R,T){const C=O.pages.find(N=>N.id===R);C&&((0,o.detach)(C),O.pages.remove(C),O.pages.splice(T,0,C))},deletePages(R){const T=O.pages.indexOf(O.activePage);R.forEach(F=>{const H=O.pages.find(z=>z.id===F);(0,o.destroy)(H)});const C=Math.min(O.pages.length-1,T),N=O.pages[C];N&&(O._activePageId=N.id),O.selectedElementsIds=(0,o.cast)(O.selectedElementsIds.filter(F=>O.getElementById(F)))},groupElements(R){const T=R.map(F=>O.getElementById(F));T.forEach(F=>{F&&(0,o.detach)(F)});const C=O.activePage,N={id:(0,u.nanoid)(10),children:T,type:"group"};return C.children.push(N),O.selectedElementsIds=(0,o.cast)([N.id]),N},ungroupElements(R){const T=R.map(N=>O.getElementById(N)),C=[];T.forEach(N=>{if(N&&N.type==="group"){const F=N.page,H=F.children.indexOf(N);N.children.forEach(z=>{C.push(z.id)}),N.children.forEach(z=>{(0,o.detach)(z),F.children.push(z)}),F.children.splice(H,1)}}),O.selectedElementsIds=(0,o.cast)(C)},deleteElements(R){R.forEach(T=>{O.pages.forEach(C=>{const N=C.children.find(F=>F.id===T);N&&(0,o.destroy)(N)})}),O.selectedElementsIds=(0,o.cast)(O.selectedElementsIds.filter(T=>O.getElementById(T)))},on(R,T){if(R==="change"){let C=O.toJSON();return(0,o.onSnapshot)(O,N=>{const F=O.toJSON();!(0,_.deepEqual)(C,F)&&(C=F,T(F))})}},async _toCanvas({pixelRatio:R,ignoreBackground:T,pageId:C,mimeType:N,includeBleed:F}={}){var H;const z=R||1;C=C||((H=O.pages[0])===null||H===void 0?void 0:H.id);const Y=O.pages.find(Z=>Z.id===C);if(!Y)throw new Error(`No page for export with id ${C}`);Y==null||Y.set({_exporting:!0});const G=await(0,p.waitTillAvailable)(()=>f.default.stages.find(Z=>Z.getAttr("pageId")===C));if(!G)throw new Error(`Export is failed. Can not find stage for page ${C}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const W=!!G.findOne(".page-container");await O.waitLoading();const j=G.findOne(".page-container");if(!j)throw new Error(`Export is failed. Can't find page container. ${W}`);G.find("Transformer").forEach(Z=>Z.visible(!1)),j.find(".page-background").forEach(Z=>Z.shadowEnabled(!1)),j.find(".page-background").forEach(Z=>Z.strokeEnabled(!1)),j.find(".highlighter").forEach(Z=>Z.visible(!1));const M=j.findOne(".page-background-group"),k=M.clip();M.clip({x:null,y:null,width:null,height:null});const D=j.findOne(".elements-container"),B=D.clip();D.clip({x:null,y:null,width:null,height:null});const q=j.find(Z=>Z.getAttr("hideInExport"));q.forEach(Z=>{Z.setAttr("oldVisible",Z.visible()),Z.hide()});const K=j.find(Z=>!Z.visible()&&Z.getAttr("editModeEnabled"));K.forEach(Z=>{Z.setAttr("oldVisible",Z.visible()),Z.show()}),T&&j.find(".page-background").forEach(Z=>Z.hide());const $=F?Y.bleed:0;let U=$;O.bleedVisible&&F?U=0:O.bleedVisible&&!F&&(U=-Y.bleed);const X=document.createElement("canvas");X.width=(Y.computedWidth+2*$)*z,X.height=(Y.computedHeight+2*$)*z;const Q=X.getContext("2d");N==="image/jpeg"&&(Q.fillStyle="white",Q.fillRect(0,0,X.width,X.height));const ee=j.toCanvas({x:j.x()-U*j.scaleX(),y:j.y()-U*j.scaleY(),width:(Y.computedWidth+2*$)*j.scaleX(),height:(Y.computedHeight+2*$)*j.scaleY(),pixelRatio:1/j.scaleX()*z});return Q.drawImage(ee,0,0),f.default.Util.releaseCanvas(ee),T&&j.find(".page-background").forEach(Z=>Z.show()),q.forEach(Z=>{Z.visible(Z.getAttr("oldVisible"))}),K.forEach(Z=>{Z.visible(Z.getAttr("oldVisible"))}),j.find(".page-background").forEach(Z=>Z.shadowEnabled(!0)),j.find(".page-background").forEach(Z=>Z.strokeEnabled(!0)),G.find("Transformer").forEach(Z=>Z.visible(!0)),j.find(".highlighter").forEach(Z=>Z.visible(!0)),M.clip(k),D.clip(B),Y==null||Y.set({_exporting:!1}),X},async toDataURL({pixelRatio:R,ignoreBackground:T,pageId:C,mimeType:N,includeBleed:F,quality:H}={}){const z=await O._toCanvas({pixelRatio:R,ignoreBackground:T,pageId:C,mimeType:N,includeBleed:F}),Y=z.toDataURL(N,H);return f.default.Util.releaseCanvas(z),Y},async toBlob({pixelRatio:R,ignoreBackground:T,pageId:C,mimeType:N,includeBleed:F,quality:H}={}){const z=await O._toCanvas({pixelRatio:R,ignoreBackground:T,pageId:C,mimeType:N,includeBleed:F}),Y=new Promise(G=>{z.toBlob(G,N,H)});return f.default.Util.releaseCanvas(z),Y},async saveAsImage(R={}){var{fileName:T}=R,C=i(R,["fileName"]);const N=C.mimeType||"image/png",F=N.split("/")[1];(0,y.downloadFile)(await O.toDataURL(C),T||"polotno."+F,N)},async _toPDF(R){const T=R.dpi||O.dpi,C=R.parallel||1,N=R.unit||(O.unit==="px"?"mm":O.unit),F=R.pixelRatio||1,H=R.pageIds||O.pages.map($=>$.id),z=O.pages.filter($=>H.includes($.id)),Y=await(0,b.getJsPDF)(),G=$=>(0,S.pxToUnit)({px:$,unit:N,dpi:T}),W=G(R.cropMarkSize||0),j=z[0]||{},M=R.includeBleed?j.bleed:0,k=G(j.computedWidth+2*M)+2*W,D=G(j.computedHeight+2*M)+2*W;var B=new Y({unit:N,orientation:k>D?"landscape":"portrait",format:[k,D],compress:!0,putOnlyUsedFonts:!0});B.deletePage(1);const q=O._elementsPixelRatio;O.setElementsPixelRatio(F),await new Promise($=>setTimeout($));const K=(($,U)=>{for(var X=[],Q=0;Q<$.length;Q+=U)X.push($.slice(Q,Q+U));return X})(z,C);for(const $ of K){const U=$.map(async X=>{const Q=R.includeBleed?X.bleed:0,ee=G(X.computedWidth+2*Q)+2*W,Z=G(X.computedHeight+2*Q)+2*W;let ne=0,ie=F;for(;ne<10;){ne+=1,ne===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const pe=await O.toDataURL(Object.assign(Object.assign({},R),{pageId:X.id,pixelRatio:ie}));if(pe.length>20)return{url:pe,width:ee,height:Z};ie*=.8}});(await Promise.all(U)).forEach(({url:X,width:Q,height:ee})=>{B.addPage([Q,ee],Q>ee?"landscape":"portrait"),W&&(B.setLineWidth(G(1)),B.line(2*W,0,2*W,W),B.line(0,2*W,W,2*W),B.line(Q-2*W,0,Q-2*W,W),B.line(Q,2*W,Q-W,2*W),B.line(0,ee-2*W,W,ee-2*W),B.line(2*W,ee,2*W,ee-W),B.line(Q,ee-2*W,Q-W,ee-2*W),B.line(Q-2*W,ee,Q-2*W,ee-W)),B.addImage(X,W,W,Q-2*W,ee-2*W,void 0,"FAST")})}return O.setElementsPixelRatio(q),B},toPDFDataURL:async R=>(await O._toPDF(Object.assign({mimeType:"image/jpeg"},R))).output("datauristring"),async toGIFDataURL(R={}){const T=R.pixelRatio||1,C=await(0,v.createGIF)({width:O.width*T,height:O.height*T}),N=1e3/(R.fps||10),F=O.duration/N;for(let H=0;H<F-1;H++){const z=H*N||1;O.setCurrentTime(z);let Y=0,G="";for(const j of O.pages)if(Y+=j.duration,j.set({_rendering:Y>z}),Y>z){G=j.id;break}const W=await O._toCanvas({pixelRatio:T,pageId:G});C.addFrame(W.getContext("2d"),{delay:N,copy:!0})}for(const H of O.pages)H.set({_rendering:!1});return O.stop(),C.render(),new Promise(H=>{C.on("finished",function(z){(function(Y,G){var W=new FileReader;W.onload=function(j){G(j.target.result)},W.readAsDataURL(Y)})(z,H)})})},async saveAsGIF(R={}){var{fileName:T}=R,C=i(R,["fileName"]);const N=await O.toGIFDataURL(C);(0,y.downloadFile)(N,T||"polotno.gif")},async toHTML(){const R=O.toJSON();return(0,d.jsonToHTML)({json:R})},async saveAsHTML({fileName:R}={}){const T=await O.toHTML(),C="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(T)));(0,y.downloadFile)(C,R||"polotno.html")},async toSVG(){const R=O.toJSON();return(0,g.jsonToSVG)({json:R})},async saveAsSVG({fileName:R}={}){const T=await O.toSVG(),C="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(T)));(0,y.downloadFile)(C,R||"polotno.svg")},async saveAsPDF(R={}){var{fileName:T}=R,C=i(R,["fileName"]);(await O._toPDF(Object.assign({mimeType:"image/jpeg"},C))).save(T||"polotno.pdf")},async waitLoading(){await new Promise(R=>setTimeout(R,50)),await(0,E.whenLoaded)()},toJSON:()=>({width:O.width,height:O.height,fonts:(0,o.getSnapshot)(O.fonts),pages:(0,o.getSnapshot)(O.pages),unit:O.unit,dpi:O.dpi}),loadJSON(R,T=!1){var C;const N=Object.assign({},R),F=O.pages.indexOf(O.activePage);let H=(C=N.pages[F]||N.pages[0])===null||C===void 0?void 0:C.id;N._activePageId=H;const z=Object.assign({},(0,o.getSnapshot)(O));Object.assign(z,N),z.history=T?O.history.toJSON():{history:[],undoIdx:-1},(0,o.applySnapshot)(O,z)},clear({keepHistory:R=!1}={}){const T=O.pages.map(C=>C.id);O.deletePages(T),R||O.history.clear()},addFont(R){O.removeFont(R.fontFamily),O.fonts.push(R),O.loadFont(R.fontFamily)},removeFont(R){O.fonts.filter(T=>T.fontFamily===R).forEach(T=>(0,o.destroy)(T))},async loadFont(R){const T=O.fonts.find(C=>C.fontFamily===R)||w.globalFonts.find(C=>C.fontFamily===R);T?w.injectCustomFont(T):w.injectGoogleFont(R),await w.loadFont(R)}})),t.createStore=P,t.default=P}(s0)),s0}var cj=D1();sl.toggleFadeInAnimation(!1);zn.setTextOverflow("change-font-size");const fj=new URLSearchParams(location.search).get("key"),LE=cj.createStore({key:fj});window.store=LE;window.config={addGlobalFont:kc.addGlobalFont,unstable_useHtmlTextRender:zn.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:zn.setTextVerticalResizeEnabled,unstable_setTextOverflow:zn.setTextOverflow,onLoadError:na.onLoadError,setAssetLoadTimeout:na.setAssetLoadTimeout};const dj=vd.createRoot(document.getElementById("root"));dj.render(dt.createElement($4.WorkspaceCanvas,{store:LE,components:{PageControls:()=>null,Tooltip:()=>null}}));