polotno-node 2.7.0 → 2.7.2
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.
- package/dist/assets/index-db239b7c.js +229 -0
- package/dist/index.html +1 -1
- package/index.js +5 -2
- package/package.json +4 -3
- package/video-parallel.js +19 -15
- package/dist/assets/index-13b6e0f3.js +0 -228
|
@@ -0,0 +1,229 @@
|
|
|
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 me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function uh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Za(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 Y3={exports:{}},dt={};/**
|
|
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 cc=Symbol.for("react.element"),q9=Symbol.for("react.portal"),$9=Symbol.for("react.fragment"),W9=Symbol.for("react.strict_mode"),Y9=Symbol.for("react.profiler"),K9=Symbol.for("react.provider"),X9=Symbol.for("react.context"),Q9=Symbol.for("react.forward_ref"),Z9=Symbol.for("react.suspense"),J9=Symbol.for("react.memo"),eO=Symbol.for("react.lazy"),Rb=Symbol.iterator;function tO(t){return t===null||typeof t!="object"?null:(t=Rb&&t[Rb]||t["@@iterator"],typeof t=="function"?t:null)}var K3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},X3=Object.assign,Q3={};function ks(t,e,r){this.props=t,this.context=e,this.refs=Q3,this.updater=r||K3}ks.prototype.isReactComponent={};ks.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")};ks.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Z3(){}Z3.prototype=ks.prototype;function qm(t,e,r){this.props=t,this.context=e,this.refs=Q3,this.updater=r||K3}var $m=qm.prototype=new Z3;$m.constructor=qm;X3($m,ks.prototype);$m.isPureReactComponent=!0;var Nb=Array.isArray,J3=Object.prototype.hasOwnProperty,Wm={current:null},e5={key:!0,ref:!0,__self:!0,__source:!0};function t5(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)J3.call(e,n)&&!e5.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:cc,type:t,key:a,ref:o,props:i,_owner:Wm.current}}function rO(t,e){return{$$typeof:cc,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Ym(t){return typeof t=="object"&&t!==null&&t.$$typeof===cc}function nO(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var Mb=/\/+/g;function Kg(t,e){return typeof t=="object"&&t!==null&&t.key!=null?nO(""+t.key):e.toString(36)}function nd(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 cc:case q9:o=!0}}if(o)return o=t,i=i(o),t=n===""?"."+Kg(o,0):n,Nb(i)?(r="",t!=null&&(r=t.replace(Mb,"$&/")+"/"),nd(i,e,r,"",function(f){return f})):i!=null&&(Ym(i)&&(i=rO(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Mb,"$&/")+"/")+t)),e.push(i)),1;if(o=0,n=n===""?".":n+":",Nb(t))for(var l=0;l<t.length;l++){a=t[l];var u=n+Kg(a,l);o+=nd(a,e,r,u,i)}else if(u=tO(t),typeof u=="function")for(t=u.call(t),l=0;!(a=t.next()).done;)a=a.value,u=n+Kg(a,l++),o+=nd(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 Af(t,e,r){if(t==null)return t;var n=[],i=0;return nd(t,n,"","",function(a){return e.call(r,a,i++)}),n}function iO(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},id={transition:null},aO={ReactCurrentDispatcher:qr,ReactCurrentBatchConfig:id,ReactCurrentOwner:Wm};dt.Children={map:Af,forEach:function(t,e,r){Af(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return Af(t,function(){e++}),e},toArray:function(t){return Af(t,function(e){return e})||[]},only:function(t){if(!Ym(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};dt.Component=ks;dt.Fragment=$9;dt.Profiler=Y9;dt.PureComponent=qm;dt.StrictMode=W9;dt.Suspense=Z9;dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=aO;dt.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=X3({},t.props),i=t.key,a=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(a=e.ref,o=Wm.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(u in e)J3.call(e,u)&&!e5.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:cc,type:t.type,key:i,ref:a,props:n,_owner:o}};dt.createContext=function(t){return t={$$typeof:X9,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:K9,_context:t},t.Consumer=t};dt.createElement=t5;dt.createFactory=function(t){var e=t5.bind(null,t);return e.type=t,e};dt.createRef=function(){return{current:null}};dt.forwardRef=function(t){return{$$typeof:Q9,render:t}};dt.isValidElement=Ym;dt.lazy=function(t){return{$$typeof:eO,_payload:{_status:-1,_result:t},_init:iO}};dt.memo=function(t,e){return{$$typeof:J9,type:t,compare:e===void 0?null:e}};dt.startTransition=function(t){var e=id.transition;id.transition={};try{t()}finally{id.transition=e}};dt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};dt.useCallback=function(t,e){return qr.current.useCallback(t,e)};dt.useContext=function(t){return qr.current.useContext(t)};dt.useDebugValue=function(){};dt.useDeferredValue=function(t){return qr.current.useDeferredValue(t)};dt.useEffect=function(t,e){return qr.current.useEffect(t,e)};dt.useId=function(){return qr.current.useId()};dt.useImperativeHandle=function(t,e,r){return qr.current.useImperativeHandle(t,e,r)};dt.useInsertionEffect=function(t,e){return qr.current.useInsertionEffect(t,e)};dt.useLayoutEffect=function(t,e){return qr.current.useLayoutEffect(t,e)};dt.useMemo=function(t,e){return qr.current.useMemo(t,e)};dt.useReducer=function(t,e,r){return qr.current.useReducer(t,e,r)};dt.useRef=function(t){return qr.current.useRef(t)};dt.useState=function(t){return qr.current.useState(t)};dt.useSyncExternalStore=function(t,e,r){return qr.current.useSyncExternalStore(t,e,r)};dt.useTransition=function(){return qr.current.useTransition()};dt.version="18.2.0";Y3.exports=dt;var at=Y3.exports;const ft=uh(at);var bd={},r5={exports:{}},wn={},n5={exports:{}},i5={};/**
|
|
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){var C=$.length;$.push(W);e:for(;0<C;){var A=C-1>>>1,j=$[A];if(0<i(j,W))$[A]=W,$[C]=j,C=A;else break e}}function r($){return $.length===0?null:$[0]}function n($){if($.length===0)return null;var W=$[0],C=$.pop();if(C!==W){$[0]=C;e:for(var A=0,j=$.length,z=j>>>1;A<z;){var H=2*(A+1)-1,Y=$[H],q=H+1,U=$[q];if(0>i(Y,C))q<j&&0>i(U,Y)?($[A]=U,$[q]=C,A=q):($[A]=Y,$[H]=C,A=H);else if(q<j&&0>i(U,C))$[A]=U,$[q]=C,A=q;else break e}}return W}function i($,W){var C=$.sortIndex-W.sortIndex;return C!==0?C:$.id-W.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=[],v=1,_=null,g=3,h=!1,w=!1,E=!1,S=typeof setTimeout=="function"?setTimeout:null,b=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($){for(var W=r(f);W!==null;){if(W.callback===null)n(f);else if(W.startTime<=$)n(f),W.sortIndex=W.expirationTime,e(u,W);else break;W=r(f)}}function m($){if(E=!1,d($),!w)if(r(u)!==null)w=!0,K(y);else{var W=r(f);W!==null&&B(m,W.startTime-$)}}function y($,W){w=!1,E&&(E=!1,b(O),O=-1),h=!0;var C=g;try{for(d(W),_=r(u);_!==null&&(!(_.expirationTime>W)||$&&!R());){var A=_.callback;if(typeof A=="function"){_.callback=null,g=_.priorityLevel;var j=A(_.expirationTime<=W);W=t.unstable_now(),typeof j=="function"?_.callback=j:_===r(u)&&n(u),d(W)}else n(u);_=r(u)}if(_!==null)var z=!0;else{var H=r(f);H!==null&&B(m,H.startTime-W),z=!1}return z}finally{_=null,g=C,h=!1}}var x=!1,P=null,O=-1,N=5,T=-1;function R(){return!(t.unstable_now()-T<N)}function M(){if(P!==null){var $=t.unstable_now();T=$;var W=!0;try{W=P(!0,$)}finally{W?D():(x=!1,P=null)}}else x=!1}var D;if(typeof p=="function")D=function(){p(M)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,F=G.port2;G.port1.onmessage=M,D=function(){F.postMessage(null)}}else D=function(){S(M,0)};function K($){P=$,x||(x=!0,D())}function B($,W){O=S(function(){$(t.unstable_now())},W)}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($){$.callback=null},t.unstable_continueExecution=function(){w||h||(w=!0,K(y))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function($){switch(g){case 1:case 2:case 3:var W=3;break;default:W=g}var C=g;g=W;try{return $()}finally{g=C}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,W){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var C=g;g=$;try{return W()}finally{g=C}},t.unstable_scheduleCallback=function($,W,C){var A=t.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?A+C:A):C=A,$){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=C+j,$={id:v++,callback:W,priorityLevel:$,startTime:C,expirationTime:j,sortIndex:-1},C>A?($.sortIndex=C,e(f,$),r(u)===null&&$===r(f)&&(E?(b(O),O=-1):E=!0,B(m,C-A))):($.sortIndex=j,e(u,$),w||h||(w=!0,K(y))),$},t.unstable_shouldYield=R,t.unstable_wrapCallback=function($){var W=g;return function(){var C=g;g=W;try{return $.apply(this,arguments)}finally{g=C}}}})(i5);n5.exports=i5;var Eu=n5.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 a5=at,yn=Eu;function xe(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 o5=new Set,Du={};function Qo(t,e){as(t,e),as(t+"Capture",e)}function as(t,e){for(Du[t]=e,t=0;t<e.length;t++)o5.add(e[t])}var ea=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),T0=Object.prototype.hasOwnProperty,oO=/^[: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]*$/,Lb={},Ib={};function lO(t){return T0.call(Ib,t)?!0:T0.call(Lb,t)?!1:oO.test(t)?Ib[t]=!0:(Lb[t]=!0,!1)}function sO(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 uO(t,e,r,n){if(e===null||typeof e>"u"||sO(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 Km=/[\-:]([a-z])/g;function Xm(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(Km,Xm);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(Km,Xm);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(Km,Xm);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 Qm(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")&&(uO(e,r,i,n)&&(r=null),n||i===null?lO(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 la=a5.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Tf=Symbol.for("react.element"),Dl=Symbol.for("react.portal"),Fl=Symbol.for("react.fragment"),Zm=Symbol.for("react.strict_mode"),C0=Symbol.for("react.profiler"),l5=Symbol.for("react.provider"),s5=Symbol.for("react.context"),Jm=Symbol.for("react.forward_ref"),R0=Symbol.for("react.suspense"),N0=Symbol.for("react.suspense_list"),ey=Symbol.for("react.memo"),Ta=Symbol.for("react.lazy"),u5=Symbol.for("react.offscreen"),jb=Symbol.iterator;function lu(t){return t===null||typeof t!="object"?null:(t=jb&&t[jb]||t["@@iterator"],typeof t=="function"?t:null)}var Wt=Object.assign,Xg;function yu(t){if(Xg===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);Xg=e&&e[1]||""}return`
|
|
26
|
+
`+Xg+t}var Qg=!1;function Zg(t,e){if(!t||Qg)return"";Qg=!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{Qg=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?yu(t):""}function cO(t){switch(t.tag){case 5:return yu(t.type);case 16:return yu("Lazy");case 13:return yu("Suspense");case 19:return yu("SuspenseList");case 0:case 2:case 15:return t=Zg(t.type,!1),t;case 11:return t=Zg(t.type.render,!1),t;case 1:return t=Zg(t.type,!0),t;default:return""}}function M0(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 Fl:return"Fragment";case Dl:return"Portal";case C0:return"Profiler";case Zm:return"StrictMode";case R0:return"Suspense";case N0:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case s5:return(t.displayName||"Context")+".Consumer";case l5:return(t._context.displayName||"Context")+".Provider";case Jm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ey:return e=t.displayName||null,e!==null?e:M0(t.type)||"Memo";case Ta:e=t._payload,t=t._init;try{return M0(t(e))}catch{}}return null}function fO(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 M0(e);case 8:return e===Zm?"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 Wa(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function c5(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function dO(t){var e=c5(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 Cf(t){t._valueTracker||(t._valueTracker=dO(t))}function f5(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=c5(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function _d(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 L0(t,e){var r=e.checked;return Wt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Db(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Wa(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 d5(t,e){e=e.checked,e!=null&&Qm(t,"checked",e,!1)}function I0(t,e){d5(t,e);var r=Wa(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")?j0(t,e.type,r):e.hasOwnProperty("defaultValue")&&j0(t,e.type,Wa(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Fb(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 j0(t,e,r){(e!=="number"||_d(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var bu=Array.isArray;function Zl(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=""+Wa(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 D0(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(xe(91));return Wt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function zb(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(xe(92));if(bu(r)){if(1<r.length)throw Error(xe(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:Wa(r)}}function h5(t,e){var r=Wa(e.value),n=Wa(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 Bb(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function p5(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 F0(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?p5(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Rf,g5=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(Rf=Rf||document.createElement("div"),Rf.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Rf.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Fu(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Ou={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},hO=["Webkit","ms","Moz","O"];Object.keys(Ou).forEach(function(t){hO.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Ou[e]=Ou[t]})});function v5(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Ou.hasOwnProperty(t)&&Ou[t]?(""+e).trim():e+"px"}function m5(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=v5(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var pO=Wt({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 z0(t,e){if(e){if(pO[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(xe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(xe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(xe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(xe(62))}}function B0(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 U0=null;function ty(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var G0=null,Jl=null,es=null;function Ub(t){if(t=hc(t)){if(typeof G0!="function")throw Error(xe(280));var e=t.stateNode;e&&(e=ph(e),G0(t.stateNode,t.type,e))}}function y5(t){Jl?es?es.push(t):es=[t]:Jl=t}function b5(){if(Jl){var t=Jl,e=es;if(es=Jl=null,Ub(t),e)for(t=0;t<e.length;t++)Ub(e[t])}}function _5(t,e){return t(e)}function w5(){}var Jg=!1;function S5(t,e,r){if(Jg)return t(e,r);Jg=!0;try{return _5(t,e,r)}finally{Jg=!1,(Jl!==null||es!==null)&&(w5(),b5())}}function zu(t,e){var r=t.stateNode;if(r===null)return null;var n=ph(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(xe(231,e,typeof r));return r}var H0=!1;if(ea)try{var su={};Object.defineProperty(su,"passive",{get:function(){H0=!0}}),window.addEventListener("test",su,su),window.removeEventListener("test",su,su)}catch{H0=!1}function gO(t,e,r,n,i,a,o,l,u){var f=Array.prototype.slice.call(arguments,3);try{e.apply(r,f)}catch(v){this.onError(v)}}var xu=!1,wd=null,Sd=!1,V0=null,vO={onError:function(t){xu=!0,wd=t}};function mO(t,e,r,n,i,a,o,l,u){xu=!1,wd=null,gO.apply(vO,arguments)}function yO(t,e,r,n,i,a,o,l,u){if(mO.apply(this,arguments),xu){if(xu){var f=wd;xu=!1,wd=null}else throw Error(xe(198));Sd||(Sd=!0,V0=f)}}function Zo(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 E5(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 Gb(t){if(Zo(t)!==t)throw Error(xe(188))}function bO(t){var e=t.alternate;if(!e){if(e=Zo(t),e===null)throw Error(xe(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 Gb(i),t;if(a===n)return Gb(i),e;a=a.sibling}throw Error(xe(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(xe(189))}}if(r.alternate!==n)throw Error(xe(190))}if(r.tag!==3)throw Error(xe(188));return r.stateNode.current===r?t:e}function O5(t){return t=bO(t),t!==null?x5(t):null}function x5(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=x5(t);if(e!==null)return e;t=t.sibling}return null}var P5=yn.unstable_scheduleCallback,Hb=yn.unstable_cancelCallback,_O=yn.unstable_shouldYield,wO=yn.unstable_requestPaint,Jt=yn.unstable_now,SO=yn.unstable_getCurrentPriorityLevel,ry=yn.unstable_ImmediatePriority,k5=yn.unstable_UserBlockingPriority,Ed=yn.unstable_NormalPriority,EO=yn.unstable_LowPriority,A5=yn.unstable_IdlePriority,ch=null,ki=null;function OO(t){if(ki&&typeof ki.onCommitFiberRoot=="function")try{ki.onCommitFiberRoot(ch,t,void 0,(t.current.flags&128)===128)}catch{}}var ei=Math.clz32?Math.clz32:kO,xO=Math.log,PO=Math.LN2;function kO(t){return t>>>=0,t===0?32:31-(xO(t)/PO|0)|0}var Nf=64,Mf=4194304;function _u(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 Od(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=_u(l):(a&=o,a!==0&&(n=_u(a)))}else o=r&~i,o!==0?n=_u(o):a!==0&&(n=_u(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-ei(e),i=1<<r,n|=t[r],e&=~i;return n}function AO(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 TO(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,a=t.pendingLanes;0<a;){var o=31-ei(a),l=1<<o,u=i[o];u===-1?(!(l&r)||l&n)&&(i[o]=AO(l,e)):u<=e&&(t.expiredLanes|=l),a&=~l}}function q0(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function T5(){var t=Nf;return Nf<<=1,!(Nf&4194240)&&(Nf=64),t}function ev(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function fc(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ei(e),t[e]=r}function CO(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-ei(r),a=1<<i;e[i]=0,n[i]=-1,t[i]=-1,r&=~a}}function ny(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-ei(r),i=1<<n;i&e|t[n]&e&&(t[n]|=e),r&=~i}}var Et=0;function C5(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var R5,iy,N5,M5,L5,$0=!1,Lf=[],Da=null,Fa=null,za=null,Bu=new Map,Uu=new Map,Ra=[],RO="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 Vb(t,e){switch(t){case"focusin":case"focusout":Da=null;break;case"dragenter":case"dragleave":Fa=null;break;case"mouseover":case"mouseout":za=null;break;case"pointerover":case"pointerout":Bu.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uu.delete(e.pointerId)}}function uu(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=hc(e),e!==null&&iy(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function NO(t,e,r,n,i){switch(e){case"focusin":return Da=uu(Da,t,e,r,n,i),!0;case"dragenter":return Fa=uu(Fa,t,e,r,n,i),!0;case"mouseover":return za=uu(za,t,e,r,n,i),!0;case"pointerover":var a=i.pointerId;return Bu.set(a,uu(Bu.get(a)||null,t,e,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,Uu.set(a,uu(Uu.get(a)||null,t,e,r,n,i)),!0}return!1}function I5(t){var e=Ro(t.target);if(e!==null){var r=Zo(e);if(r!==null){if(e=r.tag,e===13){if(e=E5(r),e!==null){t.blockedOn=e,L5(t.priority,function(){N5(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 ad(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=W0(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);U0=n,r.target.dispatchEvent(n),U0=null}else return e=hc(r),e!==null&&iy(e),t.blockedOn=r,!1;e.shift()}return!0}function qb(t,e,r){ad(t)&&r.delete(e)}function MO(){$0=!1,Da!==null&&ad(Da)&&(Da=null),Fa!==null&&ad(Fa)&&(Fa=null),za!==null&&ad(za)&&(za=null),Bu.forEach(qb),Uu.forEach(qb)}function cu(t,e){t.blockedOn===e&&(t.blockedOn=null,$0||($0=!0,yn.unstable_scheduleCallback(yn.unstable_NormalPriority,MO)))}function Gu(t){function e(i){return cu(i,t)}if(0<Lf.length){cu(Lf[0],t);for(var r=1;r<Lf.length;r++){var n=Lf[r];n.blockedOn===t&&(n.blockedOn=null)}}for(Da!==null&&cu(Da,t),Fa!==null&&cu(Fa,t),za!==null&&cu(za,t),Bu.forEach(e),Uu.forEach(e),r=0;r<Ra.length;r++)n=Ra[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<Ra.length&&(r=Ra[0],r.blockedOn===null);)I5(r),r.blockedOn===null&&Ra.shift()}var ts=la.ReactCurrentBatchConfig,xd=!0;function LO(t,e,r,n){var i=Et,a=ts.transition;ts.transition=null;try{Et=1,ay(t,e,r,n)}finally{Et=i,ts.transition=a}}function IO(t,e,r,n){var i=Et,a=ts.transition;ts.transition=null;try{Et=4,ay(t,e,r,n)}finally{Et=i,ts.transition=a}}function ay(t,e,r,n){if(xd){var i=W0(t,e,r,n);if(i===null)cv(t,e,n,Pd,r),Vb(t,n);else if(NO(i,t,e,r,n))n.stopPropagation();else if(Vb(t,n),e&4&&-1<RO.indexOf(t)){for(;i!==null;){var a=hc(i);if(a!==null&&R5(a),a=W0(t,e,r,n),a===null&&cv(t,e,n,Pd,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else cv(t,e,n,null,r)}}var Pd=null;function W0(t,e,r,n){if(Pd=null,t=ty(n),t=Ro(t),t!==null)if(e=Zo(t),e===null)t=null;else if(r=e.tag,r===13){if(t=E5(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 Pd=t,null}function j5(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(SO()){case ry:return 1;case k5:return 4;case Ed:case EO:return 16;case A5:return 536870912;default:return 16}default:return 16}}var La=null,oy=null,od=null;function D5(){if(od)return od;var t,e=oy,r=e.length,n,i="value"in La?La.value:La.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 od=i.slice(t,1<n?1-n:void 0)}function ld(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 If(){return!0}function $b(){return!1}function Sn(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)?If:$b,this.isPropagationStopped=$b,this}return Wt(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=If)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=If)},persist:function(){},isPersistent:If}),e}var As={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ly=Sn(As),dc=Wt({},As,{view:0,detail:0}),jO=Sn(dc),tv,rv,fu,fh=Wt({},dc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sy,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!==fu&&(fu&&t.type==="mousemove"?(tv=t.screenX-fu.screenX,rv=t.screenY-fu.screenY):rv=tv=0,fu=t),tv)},movementY:function(t){return"movementY"in t?t.movementY:rv}}),Wb=Sn(fh),DO=Wt({},fh,{dataTransfer:0}),FO=Sn(DO),zO=Wt({},dc,{relatedTarget:0}),nv=Sn(zO),BO=Wt({},As,{animationName:0,elapsedTime:0,pseudoElement:0}),UO=Sn(BO),GO=Wt({},As,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),HO=Sn(GO),VO=Wt({},As,{data:0}),Yb=Sn(VO),qO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$O={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"},WO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function YO(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=WO[t])?!!e[t]:!1}function sy(){return YO}var KO=Wt({},dc,{key:function(t){if(t.key){var e=qO[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=ld(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?$O[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sy,charCode:function(t){return t.type==="keypress"?ld(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ld(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),XO=Sn(KO),QO=Wt({},fh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kb=Sn(QO),ZO=Wt({},dc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sy}),JO=Sn(ZO),ex=Wt({},As,{propertyName:0,elapsedTime:0,pseudoElement:0}),tx=Sn(ex),rx=Wt({},fh,{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}),nx=Sn(rx),ix=[9,13,27,32],uy=ea&&"CompositionEvent"in window,Pu=null;ea&&"documentMode"in document&&(Pu=document.documentMode);var ax=ea&&"TextEvent"in window&&!Pu,F5=ea&&(!uy||Pu&&8<Pu&&11>=Pu),Xb=String.fromCharCode(32),Qb=!1;function z5(t,e){switch(t){case"keyup":return ix.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function B5(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var zl=!1;function ox(t,e){switch(t){case"compositionend":return B5(e);case"keypress":return e.which!==32?null:(Qb=!0,Xb);case"textInput":return t=e.data,t===Xb&&Qb?null:t;default:return null}}function lx(t,e){if(zl)return t==="compositionend"||!uy&&z5(t,e)?(t=D5(),od=oy=La=null,zl=!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 F5&&e.locale!=="ko"?null:e.data;default:return null}}var sx={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 Zb(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!sx[t.type]:e==="textarea"}function U5(t,e,r,n){y5(n),e=kd(e,"onChange"),0<e.length&&(r=new ly("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var ku=null,Hu=null;function ux(t){Z5(t,0)}function dh(t){var e=Gl(t);if(f5(e))return t}function cx(t,e){if(t==="change")return e}var G5=!1;if(ea){var iv;if(ea){var av="oninput"in document;if(!av){var Jb=document.createElement("div");Jb.setAttribute("oninput","return;"),av=typeof Jb.oninput=="function"}iv=av}else iv=!1;G5=iv&&(!document.documentMode||9<document.documentMode)}function e_(){ku&&(ku.detachEvent("onpropertychange",H5),Hu=ku=null)}function H5(t){if(t.propertyName==="value"&&dh(Hu)){var e=[];U5(e,Hu,t,ty(t)),S5(ux,e)}}function fx(t,e,r){t==="focusin"?(e_(),ku=e,Hu=r,ku.attachEvent("onpropertychange",H5)):t==="focusout"&&e_()}function dx(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return dh(Hu)}function hx(t,e){if(t==="click")return dh(e)}function px(t,e){if(t==="input"||t==="change")return dh(e)}function gx(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var oi=typeof Object.is=="function"?Object.is:gx;function Vu(t,e){if(oi(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(!T0.call(e,i)||!oi(t[i],e[i]))return!1}return!0}function t_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function r_(t,e){var r=t_(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=t_(r)}}function V5(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?V5(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function q5(){for(var t=window,e=_d();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=_d(t.document)}return e}function cy(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 vx(t){var e=q5(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&V5(r.ownerDocument.documentElement,r)){if(n!==null&&cy(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=r_(r,a);var o=r_(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 mx=ea&&"documentMode"in document&&11>=document.documentMode,Bl=null,Y0=null,Au=null,K0=!1;function n_(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;K0||Bl==null||Bl!==_d(n)||(n=Bl,"selectionStart"in n&&cy(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}),Au&&Vu(Au,n)||(Au=n,n=kd(Y0,"onSelect"),0<n.length&&(e=new ly("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=Bl)))}function jf(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var Ul={animationend:jf("Animation","AnimationEnd"),animationiteration:jf("Animation","AnimationIteration"),animationstart:jf("Animation","AnimationStart"),transitionend:jf("Transition","TransitionEnd")},ov={},$5={};ea&&($5=document.createElement("div").style,"AnimationEvent"in window||(delete Ul.animationend.animation,delete Ul.animationiteration.animation,delete Ul.animationstart.animation),"TransitionEvent"in window||delete Ul.transitionend.transition);function hh(t){if(ov[t])return ov[t];if(!Ul[t])return t;var e=Ul[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in $5)return ov[t]=e[r];return t}var W5=hh("animationend"),Y5=hh("animationiteration"),K5=hh("animationstart"),X5=hh("transitionend"),Q5=new Map,i_="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 Ja(t,e){Q5.set(t,e),Qo(e,[t])}for(var lv=0;lv<i_.length;lv++){var sv=i_[lv],yx=sv.toLowerCase(),bx=sv[0].toUpperCase()+sv.slice(1);Ja(yx,"on"+bx)}Ja(W5,"onAnimationEnd");Ja(Y5,"onAnimationIteration");Ja(K5,"onAnimationStart");Ja("dblclick","onDoubleClick");Ja("focusin","onFocus");Ja("focusout","onBlur");Ja(X5,"onTransitionEnd");as("onMouseEnter",["mouseout","mouseover"]);as("onMouseLeave",["mouseout","mouseover"]);as("onPointerEnter",["pointerout","pointerover"]);as("onPointerLeave",["pointerout","pointerover"]);Qo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Qo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Qo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Qo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Qo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Qo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wu="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(" "),_x=new Set("cancel close invalid load scroll toggle".split(" ").concat(wu));function a_(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,yO(n,e,void 0,t),t.currentTarget=null}function Z5(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;a_(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;a_(i,l,f),a=u}}}if(Sd)throw t=V0,Sd=!1,V0=null,t}function It(t,e){var r=e[em];r===void 0&&(r=e[em]=new Set);var n=t+"__bubble";r.has(n)||(J5(e,t,2,!1),r.add(n))}function uv(t,e,r){var n=0;e&&(n|=4),J5(r,t,n,e)}var Df="_reactListening"+Math.random().toString(36).slice(2);function qu(t){if(!t[Df]){t[Df]=!0,o5.forEach(function(r){r!=="selectionchange"&&(_x.has(r)||uv(r,!1,t),uv(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Df]||(e[Df]=!0,uv("selectionchange",!1,e))}}function J5(t,e,r,n){switch(j5(e)){case 1:var i=LO;break;case 4:i=IO;break;default:i=ay}r=i.bind(null,e,r,t),i=void 0,!H0||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 cv(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=Ro(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,v=ty(r),_=[];e:{var g=Q5.get(t);if(g!==void 0){var h=ly,w=t;switch(t){case"keypress":if(ld(r)===0)break e;case"keydown":case"keyup":h=XO;break;case"focusin":w="focus",h=nv;break;case"focusout":w="blur",h=nv;break;case"beforeblur":case"afterblur":h=nv;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=Wb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=FO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=JO;break;case W5:case Y5:case K5:h=UO;break;case X5:h=tx;break;case"scroll":h=jO;break;case"wheel":h=nx;break;case"copy":case"cut":case"paste":h=HO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Kb}var E=(e&4)!==0,S=!E&&t==="scroll",b=E?g!==null?g+"Capture":null:g;E=[];for(var p=f,d;p!==null;){d=p;var m=d.stateNode;if(d.tag===5&&m!==null&&(d=m,b!==null&&(m=zu(p,b),m!=null&&E.push($u(p,m,d)))),S)break;p=p.return}0<E.length&&(g=new h(g,w,null,r,v),_.push({event:g,listeners:E}))}}if(!(e&7)){e:{if(g=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",g&&r!==U0&&(w=r.relatedTarget||r.fromElement)&&(Ro(w)||w[ta]))break e;if((h||g)&&(g=v.window===v?v:(g=v.ownerDocument)?g.defaultView||g.parentWindow:window,h?(w=r.relatedTarget||r.toElement,h=f,w=w?Ro(w):null,w!==null&&(S=Zo(w),w!==S||w.tag!==5&&w.tag!==6)&&(w=null)):(h=null,w=f),h!==w)){if(E=Wb,m="onMouseLeave",b="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(E=Kb,m="onPointerLeave",b="onPointerEnter",p="pointer"),S=h==null?g:Gl(h),d=w==null?g:Gl(w),g=new E(m,p+"leave",h,r,v),g.target=S,g.relatedTarget=d,m=null,Ro(v)===f&&(E=new E(b,p+"enter",w,r,v),E.target=d,E.relatedTarget=S,m=E),S=m,h&&w)t:{for(E=h,b=w,p=0,d=E;d;d=Rl(d))p++;for(d=0,m=b;m;m=Rl(m))d++;for(;0<p-d;)E=Rl(E),p--;for(;0<d-p;)b=Rl(b),d--;for(;p--;){if(E===b||b!==null&&E===b.alternate)break t;E=Rl(E),b=Rl(b)}E=null}else E=null;h!==null&&o_(_,g,h,E,!1),w!==null&&S!==null&&o_(_,S,w,E,!0)}}e:{if(g=f?Gl(f):window,h=g.nodeName&&g.nodeName.toLowerCase(),h==="select"||h==="input"&&g.type==="file")var y=cx;else if(Zb(g))if(G5)y=px;else{y=dx;var x=fx}else(h=g.nodeName)&&h.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(y=hx);if(y&&(y=y(t,f))){U5(_,y,r,v);break e}x&&x(t,g,f),t==="focusout"&&(x=g._wrapperState)&&x.controlled&&g.type==="number"&&j0(g,"number",g.value)}switch(x=f?Gl(f):window,t){case"focusin":(Zb(x)||x.contentEditable==="true")&&(Bl=x,Y0=f,Au=null);break;case"focusout":Au=Y0=Bl=null;break;case"mousedown":K0=!0;break;case"contextmenu":case"mouseup":case"dragend":K0=!1,n_(_,r,v);break;case"selectionchange":if(mx)break;case"keydown":case"keyup":n_(_,r,v)}var P;if(uy)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 zl?z5(t,r)&&(O="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(O="onCompositionStart");O&&(F5&&r.locale!=="ko"&&(zl||O!=="onCompositionStart"?O==="onCompositionEnd"&&zl&&(P=D5()):(La=v,oy="value"in La?La.value:La.textContent,zl=!0)),x=kd(f,O),0<x.length&&(O=new Yb(O,t,null,r,v),_.push({event:O,listeners:x}),P?O.data=P:(P=B5(r),P!==null&&(O.data=P)))),(P=ax?ox(t,r):lx(t,r))&&(f=kd(f,"onBeforeInput"),0<f.length&&(v=new Yb("onBeforeInput","beforeinput",null,r,v),_.push({event:v,listeners:f}),v.data=P))}Z5(_,e)})}function $u(t,e,r){return{instance:t,listener:e,currentTarget:r}}function kd(t,e){for(var r=e+"Capture",n=[];t!==null;){var i=t,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=zu(t,r),a!=null&&n.unshift($u(t,a,i)),a=zu(t,e),a!=null&&n.push($u(t,a,i))),t=t.return}return n}function Rl(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function o_(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=zu(r,a),u!=null&&o.unshift($u(r,u,l))):i||(u=zu(r,a),u!=null&&o.push($u(r,u,l)))),r=r.return}o.length!==0&&t.push({event:e,listeners:o})}var wx=/\r\n?/g,Sx=/\u0000|\uFFFD/g;function l_(t){return(typeof t=="string"?t:""+t).replace(wx,`
|
|
30
|
+
`).replace(Sx,"")}function Ff(t,e,r){if(e=l_(e),l_(t)!==e&&r)throw Error(xe(425))}function Ad(){}var X0=null,Q0=null;function Z0(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 J0=typeof setTimeout=="function"?setTimeout:void 0,Ex=typeof clearTimeout=="function"?clearTimeout:void 0,s_=typeof Promise=="function"?Promise:void 0,Ox=typeof queueMicrotask=="function"?queueMicrotask:typeof s_<"u"?function(t){return s_.resolve(null).then(t).catch(xx)}:J0;function xx(t){setTimeout(function(){throw t})}function fv(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),Gu(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);Gu(e)}function Ba(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 u_(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 Ts=Math.random().toString(36).slice(2),Ei="__reactFiber$"+Ts,Wu="__reactProps$"+Ts,ta="__reactContainer$"+Ts,em="__reactEvents$"+Ts,Px="__reactListeners$"+Ts,kx="__reactHandles$"+Ts;function Ro(t){var e=t[Ei];if(e)return e;for(var r=t.parentNode;r;){if(e=r[ta]||r[Ei]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=u_(t);t!==null;){if(r=t[Ei])return r;t=u_(t)}return e}t=r,r=t.parentNode}return null}function hc(t){return t=t[Ei]||t[ta],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Gl(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(xe(33))}function ph(t){return t[Wu]||null}var tm=[],Hl=-1;function eo(t){return{current:t}}function jt(t){0>Hl||(t.current=tm[Hl],tm[Hl]=null,Hl--)}function Rt(t,e){Hl++,tm[Hl]=t.current,t.current=e}var Ya={},jr=eo(Ya),on=eo(!1),zo=Ya;function os(t,e){var r=t.type.contextTypes;if(!r)return Ya;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 Td(){jt(on),jt(jr)}function c_(t,e,r){if(jr.current!==Ya)throw Error(xe(168));Rt(jr,e),Rt(on,r)}function e4(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(xe(108,fO(t)||"Unknown",i));return Wt({},r,n)}function Cd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ya,zo=jr.current,Rt(jr,t),Rt(on,on.current),!0}function f_(t,e,r){var n=t.stateNode;if(!n)throw Error(xe(169));r?(t=e4(t,e,zo),n.__reactInternalMemoizedMergedChildContext=t,jt(on),jt(jr),Rt(jr,t)):jt(on),Rt(on,r)}var $i=null,gh=!1,dv=!1;function t4(t){$i===null?$i=[t]:$i.push(t)}function Ax(t){gh=!0,t4(t)}function to(){if(!dv&&$i!==null){dv=!0;var t=0,e=Et;try{var r=$i;for(Et=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}$i=null,gh=!1}catch(i){throw $i!==null&&($i=$i.slice(t+1)),P5(ry,to),i}finally{Et=e,dv=!1}}return null}var Vl=[],ql=0,Rd=null,Nd=0,Mn=[],Ln=0,Bo=null,Wi=1,Yi="";function To(t,e){Vl[ql++]=Nd,Vl[ql++]=Rd,Rd=t,Nd=e}function r4(t,e,r){Mn[Ln++]=Wi,Mn[Ln++]=Yi,Mn[Ln++]=Bo,Bo=t;var n=Wi;t=Yi;var i=32-ei(n)-1;n&=~(1<<i),r+=1;var a=32-ei(e)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,Wi=1<<32-ei(e)+i|r<<i|n,Yi=a+t}else Wi=1<<a|r<<i|n,Yi=t}function fy(t){t.return!==null&&(To(t,1),r4(t,1,0))}function dy(t){for(;t===Rd;)Rd=Vl[--ql],Vl[ql]=null,Nd=Vl[--ql],Vl[ql]=null;for(;t===Bo;)Bo=Mn[--Ln],Mn[Ln]=null,Yi=Mn[--Ln],Mn[Ln]=null,Wi=Mn[--Ln],Mn[Ln]=null}var mn=null,vn=null,Ut=!1,Jn=null;function n4(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 d_(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,mn=t,vn=Ba(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,mn=t,vn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=Bo!==null?{id:Wi,overflow:Yi}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=Dn(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,mn=t,vn=null,!0):!1;default:return!1}}function rm(t){return(t.mode&1)!==0&&(t.flags&128)===0}function nm(t){if(Ut){var e=vn;if(e){var r=e;if(!d_(t,e)){if(rm(t))throw Error(xe(418));e=Ba(r.nextSibling);var n=mn;e&&d_(t,e)?n4(n,r):(t.flags=t.flags&-4097|2,Ut=!1,mn=t)}}else{if(rm(t))throw Error(xe(418));t.flags=t.flags&-4097|2,Ut=!1,mn=t}}}function h_(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;mn=t}function zf(t){if(t!==mn)return!1;if(!Ut)return h_(t),Ut=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Z0(t.type,t.memoizedProps)),e&&(e=vn)){if(rm(t))throw i4(),Error(xe(418));for(;e;)n4(t,e),e=Ba(e.nextSibling)}if(h_(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(xe(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){vn=Ba(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}vn=null}}else vn=mn?Ba(t.stateNode.nextSibling):null;return!0}function i4(){for(var t=vn;t;)t=Ba(t.nextSibling)}function ls(){vn=mn=null,Ut=!1}function hy(t){Jn===null?Jn=[t]:Jn.push(t)}var Tx=la.ReactCurrentBatchConfig;function Qn(t,e){if(t&&t.defaultProps){e=Wt({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}var Md=eo(null),Ld=null,$l=null,py=null;function gy(){py=$l=Ld=null}function vy(t){var e=Md.current;jt(Md),t._currentValue=e}function im(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 rs(t,e){Ld=t,py=$l=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(py!==t)if(t={context:t,memoizedValue:e,next:null},$l===null){if(Ld===null)throw Error(xe(308));$l=t,Ld.dependencies={lanes:0,firstContext:t}}else $l=$l.next=t;return e}var No=null;function my(t){No===null?No=[t]:No.push(t)}function a4(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,my(e)):(r.next=i.next,i.next=r),e.interleaved=r,ra(t,n)}function ra(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 Ca=!1;function yy(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function o4(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 Ki(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,gt&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,ra(t,r)}return i=n.interleaved,i===null?(e.next=e,my(n)):(e.next=i.next,i.next=e),n.interleaved=e,ra(t,r)}function sd(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,ny(t,r)}}function p_(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 Id(t,e,r,n){var i=t.updateQueue;Ca=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,f=u.next;u.next=null,o===null?a=f:o.next=f,o=u;var v=t.alternate;v!==null&&(v=v.updateQueue,l=v.lastBaseUpdate,l!==o&&(l===null?v.firstBaseUpdate=f:l.next=f,v.lastBaseUpdate=u))}if(a!==null){var _=i.baseState;o=0,v=f=u=null,l=a;do{var g=l.lane,h=l.eventTime;if((n&g)===g){v!==null&&(v=v.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=t,E=l;switch(g=e,h=r,E.tag){case 1:if(w=E.payload,typeof w=="function"){_=w.call(h,_,g);break e}_=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=E.payload,g=typeof w=="function"?w.call(h,_,g):w,g==null)break e;_=Wt({},_,g);break e;case 2:Ca=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,g=i.effects,g===null?i.effects=[l]:g.push(l))}else h={eventTime:h,lane:g,tag:l.tag,payload:l.payload,callback:l.callback,next:null},v===null?(f=v=h,u=_):v=v.next=h,o|=g;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;g=l,l=g.next,g.next=null,i.lastBaseUpdate=g,i.shared.pending=null}}while(1);if(v===null&&(u=_),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=v,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);Go|=o,t.lanes=o,t.memoizedState=_}}function g_(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(xe(191,i));i.call(n)}}}var l4=new a5.Component().refs;function am(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:Wt({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var vh={isMounted:function(t){return(t=t._reactInternals)?Zo(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Hr(),i=Ha(t),a=Ki(n,i);a.payload=e,r!=null&&(a.callback=r),e=Ua(t,a,i),e!==null&&(ti(e,t,i,n),sd(e,t,i))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Hr(),i=Ha(t),a=Ki(n,i);a.tag=1,a.payload=e,r!=null&&(a.callback=r),e=Ua(t,a,i),e!==null&&(ti(e,t,i,n),sd(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Hr(),n=Ha(t),i=Ki(r,n);i.tag=2,e!=null&&(i.callback=e),e=Ua(t,i,n),e!==null&&(ti(e,t,n,r),sd(e,t,n))}};function v_(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?!Vu(r,n)||!Vu(i,a):!0}function s4(t,e,r){var n=!1,i=Ya,a=e.contextType;return typeof a=="object"&&a!==null?a=Bn(a):(i=ln(e)?zo:jr.current,n=e.contextTypes,a=(n=n!=null)?os(t,i):Ya),e=new e(r,a),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=vh,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=a),e}function m_(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&&vh.enqueueReplaceState(e,e.state,null)}function om(t,e,r,n){var i=t.stateNode;i.props=r,i.state=t.memoizedState,i.refs=l4,yy(t);var a=e.contextType;typeof a=="object"&&a!==null?i.context=Bn(a):(a=ln(e)?zo:jr.current,i.context=os(t,a)),i.state=t.memoizedState,a=e.getDerivedStateFromProps,typeof a=="function"&&(am(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&&vh.enqueueReplaceState(i,i.state,null),Id(t,r,i,n),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function du(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(xe(309));var n=r.stateNode}if(!n)throw Error(xe(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===l4&&(l=i.refs={}),o===null?delete l[a]:l[a]=o},e._stringRef=a,e)}if(typeof t!="string")throw Error(xe(284));if(!r._owner)throw Error(xe(290,t))}return t}function Bf(t,e){throw t=Object.prototype.toString.call(e),Error(xe(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function y_(t){var e=t._init;return e(t._payload)}function u4(t){function e(b,p){if(t){var d=b.deletions;d===null?(b.deletions=[p],b.flags|=16):d.push(p)}}function r(b,p){if(!t)return null;for(;p!==null;)e(b,p),p=p.sibling;return null}function n(b,p){for(b=new Map;p!==null;)p.key!==null?b.set(p.key,p):b.set(p.index,p),p=p.sibling;return b}function i(b,p){return b=Va(b,p),b.index=0,b.sibling=null,b}function a(b,p,d){return b.index=d,t?(d=b.alternate,d!==null?(d=d.index,d<p?(b.flags|=2,p):d):(b.flags|=2,p)):(b.flags|=1048576,p)}function o(b){return t&&b.alternate===null&&(b.flags|=2),b}function l(b,p,d,m){return p===null||p.tag!==6?(p=bv(d,b.mode,m),p.return=b,p):(p=i(p,d),p.return=b,p)}function u(b,p,d,m){var y=d.type;return y===Fl?v(b,p,d.props.children,m,d.key):p!==null&&(p.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===Ta&&y_(y)===p.type)?(m=i(p,d.props),m.ref=du(b,p,d),m.return=b,m):(m=pd(d.type,d.key,d.props,null,b.mode,m),m.ref=du(b,p,d),m.return=b,m)}function f(b,p,d,m){return p===null||p.tag!==4||p.stateNode.containerInfo!==d.containerInfo||p.stateNode.implementation!==d.implementation?(p=_v(d,b.mode,m),p.return=b,p):(p=i(p,d.children||[]),p.return=b,p)}function v(b,p,d,m,y){return p===null||p.tag!==7?(p=jo(d,b.mode,m,y),p.return=b,p):(p=i(p,d),p.return=b,p)}function _(b,p,d){if(typeof p=="string"&&p!==""||typeof p=="number")return p=bv(""+p,b.mode,d),p.return=b,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Tf:return d=pd(p.type,p.key,p.props,null,b.mode,d),d.ref=du(b,null,p),d.return=b,d;case Dl:return p=_v(p,b.mode,d),p.return=b,p;case Ta:var m=p._init;return _(b,m(p._payload),d)}if(bu(p)||lu(p))return p=jo(p,b.mode,d,null),p.return=b,p;Bf(b,p)}return null}function g(b,p,d,m){var y=p!==null?p.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return y!==null?null:l(b,p,""+d,m);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Tf:return d.key===y?u(b,p,d,m):null;case Dl:return d.key===y?f(b,p,d,m):null;case Ta:return y=d._init,g(b,p,y(d._payload),m)}if(bu(d)||lu(d))return y!==null?null:v(b,p,d,m,null);Bf(b,d)}return null}function h(b,p,d,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return b=b.get(d)||null,l(p,b,""+m,y);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Tf:return b=b.get(m.key===null?d:m.key)||null,u(p,b,m,y);case Dl:return b=b.get(m.key===null?d:m.key)||null,f(p,b,m,y);case Ta:var x=m._init;return h(b,p,d,x(m._payload),y)}if(bu(m)||lu(m))return b=b.get(d)||null,v(p,b,m,y,null);Bf(p,m)}return null}function w(b,p,d,m){for(var y=null,x=null,P=p,O=p=0,N=null;P!==null&&O<d.length;O++){P.index>O?(N=P,P=null):N=P.sibling;var T=g(b,P,d[O],m);if(T===null){P===null&&(P=N);break}t&&P&&T.alternate===null&&e(b,P),p=a(T,p,O),x===null?y=T:x.sibling=T,x=T,P=N}if(O===d.length)return r(b,P),Ut&&To(b,O),y;if(P===null){for(;O<d.length;O++)P=_(b,d[O],m),P!==null&&(p=a(P,p,O),x===null?y=P:x.sibling=P,x=P);return Ut&&To(b,O),y}for(P=n(b,P);O<d.length;O++)N=h(P,b,O,d[O],m),N!==null&&(t&&N.alternate!==null&&P.delete(N.key===null?O:N.key),p=a(N,p,O),x===null?y=N:x.sibling=N,x=N);return t&&P.forEach(function(R){return e(b,R)}),Ut&&To(b,O),y}function E(b,p,d,m){var y=lu(d);if(typeof y!="function")throw Error(xe(150));if(d=y.call(d),d==null)throw Error(xe(151));for(var x=y=null,P=p,O=p=0,N=null,T=d.next();P!==null&&!T.done;O++,T=d.next()){P.index>O?(N=P,P=null):N=P.sibling;var R=g(b,P,T.value,m);if(R===null){P===null&&(P=N);break}t&&P&&R.alternate===null&&e(b,P),p=a(R,p,O),x===null?y=R:x.sibling=R,x=R,P=N}if(T.done)return r(b,P),Ut&&To(b,O),y;if(P===null){for(;!T.done;O++,T=d.next())T=_(b,T.value,m),T!==null&&(p=a(T,p,O),x===null?y=T:x.sibling=T,x=T);return Ut&&To(b,O),y}for(P=n(b,P);!T.done;O++,T=d.next())T=h(P,b,O,T.value,m),T!==null&&(t&&T.alternate!==null&&P.delete(T.key===null?O:T.key),p=a(T,p,O),x===null?y=T:x.sibling=T,x=T);return t&&P.forEach(function(M){return e(b,M)}),Ut&&To(b,O),y}function S(b,p,d,m){if(typeof d=="object"&&d!==null&&d.type===Fl&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case Tf:e:{for(var y=d.key,x=p;x!==null;){if(x.key===y){if(y=d.type,y===Fl){if(x.tag===7){r(b,x.sibling),p=i(x,d.props.children),p.return=b,b=p;break e}}else if(x.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===Ta&&y_(y)===x.type){r(b,x.sibling),p=i(x,d.props),p.ref=du(b,x,d),p.return=b,b=p;break e}r(b,x);break}else e(b,x);x=x.sibling}d.type===Fl?(p=jo(d.props.children,b.mode,m,d.key),p.return=b,b=p):(m=pd(d.type,d.key,d.props,null,b.mode,m),m.ref=du(b,p,d),m.return=b,b=m)}return o(b);case Dl: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(b,p.sibling),p=i(p,d.children||[]),p.return=b,b=p;break e}else{r(b,p);break}else e(b,p);p=p.sibling}p=_v(d,b.mode,m),p.return=b,b=p}return o(b);case Ta:return x=d._init,S(b,p,x(d._payload),m)}if(bu(d))return w(b,p,d,m);if(lu(d))return E(b,p,d,m);Bf(b,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,p!==null&&p.tag===6?(r(b,p.sibling),p=i(p,d),p.return=b,b=p):(r(b,p),p=bv(d,b.mode,m),p.return=b,b=p),o(b)):r(b,p)}return S}var ss=u4(!0),c4=u4(!1),pc={},Ai=eo(pc),Yu=eo(pc),Ku=eo(pc);function Mo(t){if(t===pc)throw Error(xe(174));return t}function by(t,e){switch(Rt(Ku,e),Rt(Yu,t),Rt(Ai,pc),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:F0(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=F0(e,t)}jt(Ai),Rt(Ai,e)}function us(){jt(Ai),jt(Yu),jt(Ku)}function f4(t){Mo(Ku.current);var e=Mo(Ai.current),r=F0(e,t.type);e!==r&&(Rt(Yu,t),Rt(Ai,r))}function _y(t){Yu.current===t&&(jt(Ai),jt(Yu))}var qt=eo(0);function jd(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 hv=[];function wy(){for(var t=0;t<hv.length;t++)hv[t]._workInProgressVersionPrimary=null;hv.length=0}var ud=la.ReactCurrentDispatcher,pv=la.ReactCurrentBatchConfig,Uo=0,$t=null,lr=null,vr=null,Dd=!1,Tu=!1,Xu=0,Cx=0;function Mr(){throw Error(xe(321))}function Sy(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!oi(t[r],e[r]))return!1;return!0}function Ey(t,e,r,n,i,a){if(Uo=a,$t=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ud.current=t===null||t.memoizedState===null?Lx:Ix,t=r(n,i),Tu){a=0;do{if(Tu=!1,Xu=0,25<=a)throw Error(xe(301));a+=1,vr=lr=null,e.updateQueue=null,ud.current=jx,t=r(n,i)}while(Tu)}if(ud.current=Fd,e=lr!==null&&lr.next!==null,Uo=0,vr=lr=$t=null,Dd=!1,e)throw Error(xe(300));return t}function Oy(){var t=Xu!==0;return Xu=0,t}function Si(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vr===null?$t.memoizedState=vr=t:vr=vr.next=t,vr}function Un(){if(lr===null){var t=$t.alternate;t=t!==null?t.memoizedState:null}else t=lr.next;var e=vr===null?$t.memoizedState:vr.next;if(e!==null)vr=e,lr=t;else{if(t===null)throw Error(xe(310));lr=t,t={memoizedState:lr.memoizedState,baseState:lr.baseState,baseQueue:lr.baseQueue,queue:lr.queue,next:null},vr===null?$t.memoizedState=vr=t:vr=vr.next=t}return vr}function Qu(t,e){return typeof e=="function"?e(t):e}function gv(t){var e=Un(),r=e.queue;if(r===null)throw Error(xe(311));r.lastRenderedReducer=t;var n=lr,i=n.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}n.baseQueue=i=a,r.pending=null}if(i!==null){a=i.next,n=n.baseState;var l=o=null,u=null,f=a;do{var v=f.lane;if((Uo&v)===v)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),n=f.hasEagerState?f.eagerState:t(n,f.action);else{var _={lane:v,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=_,o=n):u=u.next=_,$t.lanes|=v,Go|=v}f=f.next}while(f!==null&&f!==a);u===null?o=n:u.next=l,oi(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,$t.lanes|=a,Go|=a,i=i.next;while(i!==t)}else i===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function vv(t){var e=Un(),r=e.queue;if(r===null)throw Error(xe(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);oi(a,e.memoizedState)||(rn=!0),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),r.lastRenderedState=a}return[a,n]}function d4(){}function h4(t,e){var r=$t,n=Un(),i=e(),a=!oi(n.memoizedState,i);if(a&&(n.memoizedState=i,rn=!0),n=n.queue,xy(v4.bind(null,r,n,t),[t]),n.getSnapshot!==e||a||vr!==null&&vr.memoizedState.tag&1){if(r.flags|=2048,Zu(9,g4.bind(null,r,n,i,e),void 0,null),yr===null)throw Error(xe(349));Uo&30||p4(r,e,i)}return i}function p4(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=$t.updateQueue,e===null?(e={lastEffect:null,stores:null},$t.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function g4(t,e,r,n){e.value=r,e.getSnapshot=n,m4(e)&&y4(t)}function v4(t,e,r){return r(function(){m4(e)&&y4(t)})}function m4(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!oi(t,r)}catch{return!0}}function y4(t){var e=ra(t,1);e!==null&&ti(e,t,1,-1)}function b_(t){var e=Si();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qu,lastRenderedState:t},e.queue=t,t=t.dispatch=Mx.bind(null,$t,t),[e.memoizedState,t]}function Zu(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=$t.updateQueue,e===null?(e={lastEffect:null,stores:null},$t.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 b4(){return Un().memoizedState}function cd(t,e,r,n){var i=Si();$t.flags|=t,i.memoizedState=Zu(1|e,r,void 0,n===void 0?null:n)}function mh(t,e,r,n){var i=Un();n=n===void 0?null:n;var a=void 0;if(lr!==null){var o=lr.memoizedState;if(a=o.destroy,n!==null&&Sy(n,o.deps)){i.memoizedState=Zu(e,r,a,n);return}}$t.flags|=t,i.memoizedState=Zu(1|e,r,a,n)}function __(t,e){return cd(8390656,8,t,e)}function xy(t,e){return mh(2048,8,t,e)}function _4(t,e){return mh(4,2,t,e)}function w4(t,e){return mh(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 E4(t,e,r){return r=r!=null?r.concat([t]):null,mh(4,4,S4.bind(null,e,t),r)}function Py(){}function O4(t,e){var r=Un();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&Sy(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function x4(t,e){var r=Un();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&Sy(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function P4(t,e,r){return Uo&21?(oi(r,e)||(r=T5(),$t.lanes|=r,Go|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,rn=!0),t.memoizedState=r)}function Rx(t,e){var r=Et;Et=r!==0&&4>r?r:4,t(!0);var n=pv.transition;pv.transition={};try{t(!1),e()}finally{Et=r,pv.transition=n}}function k4(){return Un().memoizedState}function Nx(t,e,r){var n=Ha(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},A4(t))T4(e,r);else if(r=a4(t,e,r,n),r!==null){var i=Hr();ti(r,t,n,i),C4(r,e,n)}}function Mx(t,e,r){var n=Ha(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(A4(t))T4(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,oi(l,o)){var u=e.interleaved;u===null?(i.next=i,my(e)):(i.next=u.next,u.next=i),e.interleaved=i;return}}catch{}finally{}r=a4(t,e,i,n),r!==null&&(i=Hr(),ti(r,t,n,i),C4(r,e,n))}}function A4(t){var e=t.alternate;return t===$t||e!==null&&e===$t}function T4(t,e){Tu=Dd=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function C4(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,ny(t,r)}}var Fd={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},Lx={readContext:Bn,useCallback:function(t,e){return Si().memoizedState=[t,e===void 0?null:e],t},useContext:Bn,useEffect:__,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,cd(4194308,4,S4.bind(null,e,t),r)},useLayoutEffect:function(t,e){return cd(4194308,4,t,e)},useInsertionEffect:function(t,e){return cd(4,2,t,e)},useMemo:function(t,e){var r=Si();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Si();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=Nx.bind(null,$t,t),[n.memoizedState,t]},useRef:function(t){var e=Si();return t={current:t},e.memoizedState=t},useState:b_,useDebugValue:Py,useDeferredValue:function(t){return Si().memoizedState=t},useTransition:function(){var t=b_(!1),e=t[0];return t=Rx.bind(null,t[1]),Si().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=$t,i=Si();if(Ut){if(r===void 0)throw Error(xe(407));r=r()}else{if(r=e(),yr===null)throw Error(xe(349));Uo&30||p4(n,e,r)}i.memoizedState=r;var a={value:r,getSnapshot:e};return i.queue=a,__(v4.bind(null,n,a,t),[t]),n.flags|=2048,Zu(9,g4.bind(null,n,a,r,e),void 0,null),r},useId:function(){var t=Si(),e=yr.identifierPrefix;if(Ut){var r=Yi,n=Wi;r=(n&~(1<<32-ei(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Xu++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=Cx++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Ix={readContext:Bn,useCallback:O4,useContext:Bn,useEffect:xy,useImperativeHandle:E4,useInsertionEffect:_4,useLayoutEffect:w4,useMemo:x4,useReducer:gv,useRef:b4,useState:function(){return gv(Qu)},useDebugValue:Py,useDeferredValue:function(t){var e=Un();return P4(e,lr.memoizedState,t)},useTransition:function(){var t=gv(Qu)[0],e=Un().memoizedState;return[t,e]},useMutableSource:d4,useSyncExternalStore:h4,useId:k4,unstable_isNewReconciler:!1},jx={readContext:Bn,useCallback:O4,useContext:Bn,useEffect:xy,useImperativeHandle:E4,useInsertionEffect:_4,useLayoutEffect:w4,useMemo:x4,useReducer:vv,useRef:b4,useState:function(){return vv(Qu)},useDebugValue:Py,useDeferredValue:function(t){var e=Un();return lr===null?e.memoizedState=t:P4(e,lr.memoizedState,t)},useTransition:function(){var t=vv(Qu)[0],e=Un().memoizedState;return[t,e]},useMutableSource:d4,useSyncExternalStore:h4,useId:k4,unstable_isNewReconciler:!1};function cs(t,e){try{var r="",n=e;do r+=cO(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 mv(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function lm(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var Dx=typeof WeakMap=="function"?WeakMap:Map;function R4(t,e,r){r=Ki(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){Bd||(Bd=!0,mm=n),lm(t,e)},r}function N4(t,e,r){r=Ki(-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(){lm(t,e)}}var a=t.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){lm(t,e),typeof n!="function"&&(Ga===null?Ga=new Set([this]):Ga.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function w_(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new Dx;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=Qx.bind(null,t,e,r),e.then(t,t))}function S_(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 E_(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=Ki(-1,1),e.tag=2,Ua(r,e,1))),r.lanes|=1),t)}var Fx=la.ReactCurrentOwner,rn=!1;function Gr(t,e,r,n){e.child=t===null?c4(e,null,r,n):ss(e,t.child,r,n)}function O_(t,e,r,n,i){r=r.render;var a=e.ref;return rs(e,i),n=Ey(t,e,r,n,a,i),r=Oy(),t!==null&&!rn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,na(t,e,i)):(Ut&&r&&fy(e),e.flags|=1,Gr(t,e,n,i),e.child)}function x_(t,e,r,n,i){if(t===null){var a=r.type;return typeof a=="function"&&!Ly(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=a,M4(t,e,a,n,i)):(t=pd(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:Vu,r(o,n)&&t.ref===e.ref)return na(t,e,i)}return e.flags|=1,t=Va(a,n),t.ref=e.ref,t.return=e,e.child=t}function M4(t,e,r,n,i){if(t!==null){var a=t.memoizedProps;if(Vu(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,na(t,e,i)}return sm(t,e,r,n,i)}function L4(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(Yl,pn),pn|=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(Yl,pn),pn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Rt(Yl,pn),pn|=n}else a!==null?(n=a.baseLanes|r,e.memoizedState=null):n=r,Rt(Yl,pn),pn|=n;return Gr(t,e,i,r),e.child}function I4(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function sm(t,e,r,n,i){var a=ln(r)?zo:jr.current;return a=os(e,a),rs(e,i),r=Ey(t,e,r,n,a,i),n=Oy(),t!==null&&!rn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,na(t,e,i)):(Ut&&n&&fy(e),e.flags|=1,Gr(t,e,r,i),e.child)}function P_(t,e,r,n,i){if(ln(r)){var a=!0;Cd(e)}else a=!1;if(rs(e,i),e.stateNode===null)fd(t,e),s4(e,r,n),om(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)?zo:jr.current,f=os(e,f));var v=r.getDerivedStateFromProps,_=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function";_||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||u!==f)&&m_(e,o,n,f),Ca=!1;var g=e.memoizedState;o.state=g,Id(e,n,o,i),u=e.memoizedState,l!==n||g!==u||on.current||Ca?(typeof v=="function"&&(am(e,r,v,n),u=e.memoizedState),(l=Ca||v_(e,r,l,n,g,u,f))?(_||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,o4(t,e),l=e.memoizedProps,f=e.type===e.elementType?l:Qn(e.type,l),o.props=f,_=e.pendingProps,g=o.context,u=r.contextType,typeof u=="object"&&u!==null?u=Bn(u):(u=ln(r)?zo:jr.current,u=os(e,u));var h=r.getDerivedStateFromProps;(v=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==_||g!==u)&&m_(e,o,n,u),Ca=!1,g=e.memoizedState,o.state=g,Id(e,n,o,i);var w=e.memoizedState;l!==_||g!==w||on.current||Ca?(typeof h=="function"&&(am(e,r,h,n),w=e.memoizedState),(f=Ca||v_(e,r,f,n,g,w,u)||!1)?(v||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&&g===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&g===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&&g===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),n=!1)}return um(t,e,r,n,a,i)}function um(t,e,r,n,i,a){I4(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&f_(e,r,!1),na(t,e,a);n=e.stateNode,Fx.current=e;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=ss(e,t.child,null,a),e.child=ss(e,null,l,a)):Gr(t,e,l,a),e.memoizedState=n.state,i&&f_(e,r,!0),e.child}function j4(t){var e=t.stateNode;e.pendingContext?c_(t,e.pendingContext,e.pendingContext!==e.context):e.context&&c_(t,e.context,!1),by(t,e.containerInfo)}function k_(t,e,r,n,i){return ls(),hy(i),e.flags|=256,Gr(t,e,r,n),e.child}var cm={dehydrated:null,treeContext:null,retryLane:0};function fm(t){return{baseLanes:t,cachePool:null,transitions:null}}function D4(t,e,r){var n=e.pendingProps,i=qt.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(qt,i&1),t===null)return nm(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=_h(o,n,0,null),t=jo(t,n,r,null),a.return=e,t.return=e,a.sibling=t,e.child=a,e.child.memoizedState=fm(r),e.memoizedState=cm,t):ky(e,o));if(i=t.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return zx(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=Va(i,u),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Va(l,a):(a=jo(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?fm(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=t.childLanes&~r,e.memoizedState=cm,n}return a=t.child,t=a.sibling,n=Va(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 ky(t,e){return e=_h({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Uf(t,e,r,n){return n!==null&&hy(n),ss(e,t.child,null,r),t=ky(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function zx(t,e,r,n,i,a,o){if(r)return e.flags&256?(e.flags&=-257,n=mv(Error(xe(422))),Uf(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(a=n.fallback,i=e.mode,n=_h({mode:"visible",children:n.children},i,0,null),a=jo(a,i,o,null),a.flags|=2,n.return=e,a.return=e,n.sibling=a,e.child=n,e.mode&1&&ss(e,t.child,null,o),e.child.memoizedState=fm(o),e.memoizedState=cm,a);if(!(e.mode&1))return Uf(t,e,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(xe(419)),n=mv(a,n,void 0),Uf(t,e,o,n)}if(l=(o&t.childLanes)!==0,rn||l){if(n=yr,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,ra(t,i),ti(n,t,i,-1))}return My(),n=mv(Error(xe(421))),Uf(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=Zx.bind(null,t),i._reactRetry=e,null):(t=a.treeContext,vn=Ba(i.nextSibling),mn=e,Ut=!0,Jn=null,t!==null&&(Mn[Ln++]=Wi,Mn[Ln++]=Yi,Mn[Ln++]=Bo,Wi=t.id,Yi=t.overflow,Bo=e),e=ky(e,n.children),e.flags|=4096,e)}function A_(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),im(t.return,e,r)}function yv(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 F4(t,e,r){var n=e.pendingProps,i=n.revealOrder,a=n.tail;if(Gr(t,e,n.children,r),n=qt.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&&A_(t,r,e);else if(t.tag===19)A_(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(qt,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&&jd(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),yv(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&&jd(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}yv(e,!0,r,null,a);break;case"together":yv(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function fd(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function na(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Go|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(xe(153));if(e.child!==null){for(t=e.child,r=Va(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Va(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function Bx(t,e,r){switch(e.tag){case 3:j4(e),ls();break;case 5:f4(e);break;case 1:ln(e.type)&&Cd(e);break;case 4:by(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;Rt(Md,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(Rt(qt,qt.current&1),e.flags|=128,null):r&e.child.childLanes?D4(t,e,r):(Rt(qt,qt.current&1),t=na(t,e,r),t!==null?t.sibling:null);Rt(qt,qt.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return F4(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Rt(qt,qt.current),n)break;return null;case 22:case 23:return e.lanes=0,L4(t,e,r)}return na(t,e,r)}var z4,dm,B4,U4;z4=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}};dm=function(){};B4=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,Mo(Ai.current);var a=null;switch(r){case"input":i=L0(t,i),n=L0(t,n),a=[];break;case"select":i=Wt({},i,{value:void 0}),n=Wt({},n,{value:void 0}),a=[];break;case"textarea":i=D0(t,i),n=D0(t,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Ad)}z0(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"&&(Du.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"&&(Du.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)}};U4=function(t,e,r,n){r!==n&&(e.flags|=4)};function hu(t,e){if(!Ut)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 Lr(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 Ux(t,e,r){var n=e.pendingProps;switch(dy(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lr(e),null;case 1:return ln(e.type)&&Td(),Lr(e),null;case 3:return n=e.stateNode,us(),jt(on),jt(jr),wy(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(zf(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Jn!==null&&(_m(Jn),Jn=null))),dm(t,e),Lr(e),null;case 5:_y(e);var i=Mo(Ku.current);if(r=e.type,t!==null&&e.stateNode!=null)B4(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(xe(166));return Lr(e),null}if(t=Mo(Ai.current),zf(e)){n=e.stateNode,r=e.type;var a=e.memoizedProps;switch(n[Ei]=e,n[Wu]=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<wu.length;i++)It(wu[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":Db(n,a),It("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},It("invalid",n);break;case"textarea":zb(n,a),It("invalid",n)}z0(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&&Ff(n.textContent,l,t),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Ff(n.textContent,l,t),i=["children",""+l]):Du.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&It("scroll",n)}switch(r){case"input":Cf(n),Fb(n,a,!0);break;case"textarea":Cf(n),Bb(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=Ad)}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=p5(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[Ei]=e,t[Wu]=n,z4(t,e,!1,!1),e.stateNode=t;e:{switch(o=B0(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<wu.length;i++)It(wu[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":Db(t,n),i=L0(t,n),It("invalid",t);break;case"option":i=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},i=Wt({},n,{value:void 0}),It("invalid",t);break;case"textarea":zb(t,n),i=D0(t,n),It("invalid",t);break;default:i=n}z0(r,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var u=l[a];a==="style"?m5(t,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&g5(t,u)):a==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Fu(t,u):typeof u=="number"&&Fu(t,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Du.hasOwnProperty(a)?u!=null&&a==="onScroll"&&It("scroll",t):u!=null&&Qm(t,a,u,o))}switch(r){case"input":Cf(t),Fb(t,n,!1);break;case"textarea":Cf(t),Bb(t);break;case"option":n.value!=null&&t.setAttribute("value",""+Wa(n.value));break;case"select":t.multiple=!!n.multiple,a=n.value,a!=null?Zl(t,!!n.multiple,a,!1):n.defaultValue!=null&&Zl(t,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Ad)}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 Lr(e),null;case 6:if(t&&e.stateNode!=null)U4(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(xe(166));if(r=Mo(Ku.current),Mo(Ai.current),zf(e)){if(n=e.stateNode,r=e.memoizedProps,n[Ei]=e,(a=n.nodeValue!==r)&&(t=mn,t!==null))switch(t.tag){case 3:Ff(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Ff(n.nodeValue,r,(t.mode&1)!==0)}a&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Ei]=e,e.stateNode=n}return Lr(e),null;case 13:if(jt(qt),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Ut&&vn!==null&&e.mode&1&&!(e.flags&128))i4(),ls(),e.flags|=98560,a=!1;else if(a=zf(e),n!==null&&n.dehydrated!==null){if(t===null){if(!a)throw Error(xe(318));if(a=e.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(xe(317));a[Ei]=e}else ls(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Lr(e),a=!1}else Jn!==null&&(_m(Jn),Jn=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||qt.current&1?ur===0&&(ur=3):My())),e.updateQueue!==null&&(e.flags|=4),Lr(e),null);case 4:return us(),dm(t,e),t===null&&qu(e.stateNode.containerInfo),Lr(e),null;case 10:return vy(e.type._context),Lr(e),null;case 17:return ln(e.type)&&Td(),Lr(e),null;case 19:if(jt(qt),a=e.memoizedState,a===null)return Lr(e),null;if(n=(e.flags&128)!==0,o=a.rendering,o===null)if(n)hu(a,!1);else{if(ur!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=jd(t),o!==null){for(e.flags|=128,hu(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(qt,qt.current&1|2),e.child}t=t.sibling}a.tail!==null&&Jt()>fs&&(e.flags|=128,n=!0,hu(a,!1),e.lanes=4194304)}else{if(!n)if(t=jd(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),hu(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Ut)return Lr(e),null}else 2*Jt()-a.renderingStartTime>fs&&r!==1073741824&&(e.flags|=128,n=!0,hu(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=Jt(),e.sibling=null,r=qt.current,Rt(qt,n?r&1|2:r&1),e):(Lr(e),null);case 22:case 23:return Ny(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?pn&1073741824&&(Lr(e),e.subtreeFlags&6&&(e.flags|=8192)):Lr(e),null;case 24:return null;case 25:return null}throw Error(xe(156,e.tag))}function Gx(t,e){switch(dy(e),e.tag){case 1:return ln(e.type)&&Td(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return us(),jt(on),jt(jr),wy(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return _y(e),null;case 13:if(jt(qt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(xe(340));ls()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return jt(qt),null;case 4:return us(),null;case 10:return vy(e.type._context),null;case 22:case 23:return Ny(),null;case 24:return null;default:return null}}var Gf=!1,Ir=!1,Hx=typeof WeakSet=="function"?WeakSet:Set,ze=null;function Wl(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Kt(t,e,n)}else r.current=null}function hm(t,e,r){try{r()}catch(n){Kt(t,e,n)}}var T_=!1;function Vx(t,e){if(X0=xd,t=q5(),cy(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,v=0,_=t,g=null;t:for(;;){for(var h;_!==r||i!==0&&_.nodeType!==3||(l=o+i),_!==a||n!==0&&_.nodeType!==3||(u=o+n),_.nodeType===3&&(o+=_.nodeValue.length),(h=_.firstChild)!==null;)g=_,_=h;for(;;){if(_===t)break t;if(g===r&&++f===i&&(l=o),g===a&&++v===n&&(u=o),(h=_.nextSibling)!==null)break;_=g,g=_.parentNode}_=h}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Q0={focusedElem:t,selectionRange:r},xd=!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,b=e.stateNode,p=b.getSnapshotBeforeUpdate(e.elementType===e.type?E:Qn(e.type,E),S);b.__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(xe(163))}}catch(m){Kt(e,e.return,m)}if(t=e.sibling,t!==null){t.return=e.return,ze=t;break}ze=e.return}return w=T_,T_=!1,w}function Cu(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&&hm(e,r,a)}i=i.next}while(i!==n)}}function yh(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 pm(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 G4(t){var e=t.alternate;e!==null&&(t.alternate=null,G4(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Ei],delete e[Wu],delete e[em],delete e[Px],delete e[kx])),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 H4(t){return t.tag===5||t.tag===3||t.tag===4}function C_(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||H4(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 gm(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=Ad));else if(n!==4&&(t=t.child,t!==null))for(gm(t,e,r),t=t.sibling;t!==null;)gm(t,e,r),t=t.sibling}function vm(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(vm(t,e,r),t=t.sibling;t!==null;)vm(t,e,r),t=t.sibling}var Sr=null,Zn=!1;function ka(t,e,r){for(r=r.child;r!==null;)V4(t,e,r),r=r.sibling}function V4(t,e,r){if(ki&&typeof ki.onCommitFiberUnmount=="function")try{ki.onCommitFiberUnmount(ch,r)}catch{}switch(r.tag){case 5:Ir||Wl(r,e);case 6:var n=Sr,i=Zn;Sr=null,ka(t,e,r),Sr=n,Zn=i,Sr!==null&&(Zn?(t=Sr,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Sr.removeChild(r.stateNode));break;case 18:Sr!==null&&(Zn?(t=Sr,r=r.stateNode,t.nodeType===8?fv(t.parentNode,r):t.nodeType===1&&fv(t,r),Gu(t)):fv(Sr,r.stateNode));break;case 4:n=Sr,i=Zn,Sr=r.stateNode.containerInfo,Zn=!0,ka(t,e,r),Sr=n,Zn=i;break;case 0:case 11:case 14:case 15:if(!Ir&&(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)&&hm(r,e,o),i=i.next}while(i!==n)}ka(t,e,r);break;case 1:if(!Ir&&(Wl(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Kt(r,e,l)}ka(t,e,r);break;case 21:ka(t,e,r);break;case 22:r.mode&1?(Ir=(n=Ir)||r.memoizedState!==null,ka(t,e,r),Ir=n):ka(t,e,r);break;default:ka(t,e,r)}}function R_(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Hx),e.forEach(function(n){var i=Jx.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Kn(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,Zn=!1;break e;case 3:Sr=l.stateNode.containerInfo,Zn=!0;break e;case 4:Sr=l.stateNode.containerInfo,Zn=!0;break e}l=l.return}if(Sr===null)throw Error(xe(160));V4(a,o,i),Sr=null,Zn=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(f){Kt(i,e,f)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)q4(e,t),e=e.sibling}function q4(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Kn(e,t),_i(t),n&4){try{Cu(3,t,t.return),yh(3,t)}catch(E){Kt(t,t.return,E)}try{Cu(5,t,t.return)}catch(E){Kt(t,t.return,E)}}break;case 1:Kn(e,t),_i(t),n&512&&r!==null&&Wl(r,r.return);break;case 5:if(Kn(e,t),_i(t),n&512&&r!==null&&Wl(r,r.return),t.flags&32){var i=t.stateNode;try{Fu(i,"")}catch(E){Kt(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&&d5(i,a),B0(l,o);var f=B0(l,a);for(o=0;o<u.length;o+=2){var v=u[o],_=u[o+1];v==="style"?m5(i,_):v==="dangerouslySetInnerHTML"?g5(i,_):v==="children"?Fu(i,_):Qm(i,v,_,f)}switch(l){case"input":I0(i,a);break;case"textarea":h5(i,a);break;case"select":var g=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var h=a.value;h!=null?Zl(i,!!a.multiple,h,!1):g!==!!a.multiple&&(a.defaultValue!=null?Zl(i,!!a.multiple,a.defaultValue,!0):Zl(i,!!a.multiple,a.multiple?[]:"",!1))}i[Wu]=a}catch(E){Kt(t,t.return,E)}}break;case 6:if(Kn(e,t),_i(t),n&4){if(t.stateNode===null)throw Error(xe(162));i=t.stateNode,a=t.memoizedProps;try{i.nodeValue=a}catch(E){Kt(t,t.return,E)}}break;case 3:if(Kn(e,t),_i(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Gu(e.containerInfo)}catch(E){Kt(t,t.return,E)}break;case 4:Kn(e,t),_i(t);break;case 13:Kn(e,t),_i(t),i=t.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(Cy=Jt())),n&4&&R_(t);break;case 22:if(v=r!==null&&r.memoizedState!==null,t.mode&1?(Ir=(f=Ir)||v,Kn(e,t),Ir=f):Kn(e,t),_i(t),n&8192){if(f=t.memoizedState!==null,(t.stateNode.isHidden=f)&&!v&&t.mode&1)for(ze=t,v=t.child;v!==null;){for(_=ze=v;ze!==null;){switch(g=ze,h=g.child,g.tag){case 0:case 11:case 14:case 15:Cu(4,g,g.return);break;case 1:Wl(g,g.return);var w=g.stateNode;if(typeof w.componentWillUnmount=="function"){n=g,r=g.return;try{e=n,w.props=e.memoizedProps,w.state=e.memoizedState,w.componentWillUnmount()}catch(E){Kt(n,r,E)}}break;case 5:Wl(g,g.return);break;case 22:if(g.memoizedState!==null){M_(_);continue}}h!==null?(h.return=g,ze=h):M_(_)}v=v.sibling}e:for(v=null,_=t;;){if(_.tag===5){if(v===null){v=_;try{i=_.stateNode,f?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=_.stateNode,u=_.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=v5("display",o))}catch(E){Kt(t,t.return,E)}}}else if(_.tag===6){if(v===null)try{_.stateNode.nodeValue=f?"":_.memoizedProps}catch(E){Kt(t,t.return,E)}}else if((_.tag!==22&&_.tag!==23||_.memoizedState===null||_===t)&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===t)break e;for(;_.sibling===null;){if(_.return===null||_.return===t)break e;v===_&&(v=null),_=_.return}v===_&&(v=null),_.sibling.return=_.return,_=_.sibling}}break;case 19:Kn(e,t),_i(t),n&4&&R_(t);break;case 21:break;default:Kn(e,t),_i(t)}}function _i(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(H4(r)){var n=r;break e}r=r.return}throw Error(xe(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(Fu(i,""),n.flags&=-33);var a=C_(t);vm(t,a,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=C_(t);gm(t,l,o);break;default:throw Error(xe(161))}}catch(u){Kt(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function qx(t,e,r){ze=t,$4(t)}function $4(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||Gf;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||Ir;l=Gf;var f=Ir;if(Gf=o,(Ir=u)&&!f)for(ze=i;ze!==null;)o=ze,u=o.child,o.tag===22&&o.memoizedState!==null?L_(i):u!==null?(u.return=o,ze=u):L_(i);for(;a!==null;)ze=a,$4(a),a=a.sibling;ze=i,Gf=l,Ir=f}N_(t)}else i.subtreeFlags&8772&&a!==null?(a.return=i,ze=a):N_(t)}}function N_(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:Ir||yh(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!Ir)if(r===null)n.componentDidMount();else{var i=e.elementType===e.type?r.memoizedProps:Qn(e.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=e.updateQueue;a!==null&&g_(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}g_(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 v=f.memoizedState;if(v!==null){var _=v.dehydrated;_!==null&&Gu(_)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(xe(163))}Ir||e.flags&512&&pm(e)}catch(g){Kt(e,e.return,g)}}if(e===t){ze=null;break}if(r=e.sibling,r!==null){r.return=e.return,ze=r;break}ze=e.return}}function M_(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 L_(t){for(;ze!==null;){var e=ze;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{yh(4,e)}catch(u){Kt(e,r,u)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var i=e.return;try{n.componentDidMount()}catch(u){Kt(e,i,u)}}var a=e.return;try{pm(e)}catch(u){Kt(e,a,u)}break;case 5:var o=e.return;try{pm(e)}catch(u){Kt(e,o,u)}}}catch(u){Kt(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 $x=Math.ceil,zd=la.ReactCurrentDispatcher,Ay=la.ReactCurrentOwner,Fn=la.ReactCurrentBatchConfig,gt=0,yr=null,rr=null,Or=0,pn=0,Yl=eo(0),ur=0,Ju=null,Go=0,bh=0,Ty=0,Ru=null,tn=null,Cy=0,fs=1/0,qi=null,Bd=!1,mm=null,Ga=null,Hf=!1,Ia=null,Ud=0,Nu=0,ym=null,dd=-1,hd=0;function Hr(){return gt&6?Jt():dd!==-1?dd:dd=Jt()}function Ha(t){return t.mode&1?gt&2&&Or!==0?Or&-Or:Tx.transition!==null?(hd===0&&(hd=T5()),hd):(t=Et,t!==0||(t=window.event,t=t===void 0?16:j5(t.type)),t):1}function ti(t,e,r,n){if(50<Nu)throw Nu=0,ym=null,Error(xe(185));fc(t,r,n),(!(gt&2)||t!==yr)&&(t===yr&&(!(gt&2)&&(bh|=r),ur===4&&Na(t,Or)),sn(t,n),r===1&>===0&&!(e.mode&1)&&(fs=Jt()+500,gh&&to()))}function sn(t,e){var r=t.callbackNode;TO(t,e);var n=Od(t,t===yr?Or:0);if(n===0)r!==null&&Hb(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&Hb(r),e===1)t.tag===0?Ax(I_.bind(null,t)):t4(I_.bind(null,t)),Ox(function(){!(gt&6)&&to()}),r=null;else{switch(C5(n)){case 1:r=ry;break;case 4:r=k5;break;case 16:r=Ed;break;case 536870912:r=A5;break;default:r=Ed}r=eS(r,W4.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function W4(t,e){if(dd=-1,hd=0,gt&6)throw Error(xe(327));var r=t.callbackNode;if(ns()&&t.callbackNode!==r)return null;var n=Od(t,t===yr?Or:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=Gd(t,n);else{e=n;var i=gt;gt|=2;var a=K4();(yr!==t||Or!==e)&&(qi=null,fs=Jt()+500,Io(t,e));do try{Kx();break}catch(l){Y4(t,l)}while(1);gy(),zd.current=a,gt=i,rr!==null?e=0:(yr=null,Or=0,e=ur)}if(e!==0){if(e===2&&(i=q0(t),i!==0&&(n=i,e=bm(t,i))),e===1)throw r=Ju,Io(t,0),Na(t,n),sn(t,Jt()),r;if(e===6)Na(t,n);else{if(i=t.current.alternate,!(n&30)&&!Wx(i)&&(e=Gd(t,n),e===2&&(a=q0(t),a!==0&&(n=a,e=bm(t,a))),e===1))throw r=Ju,Io(t,0),Na(t,n),sn(t,Jt()),r;switch(t.finishedWork=i,t.finishedLanes=n,e){case 0:case 1:throw Error(xe(345));case 2:Co(t,tn,qi);break;case 3:if(Na(t,n),(n&130023424)===n&&(e=Cy+500-Jt(),10<e)){if(Od(t,0)!==0)break;if(i=t.suspendedLanes,(i&n)!==n){Hr(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=J0(Co.bind(null,t,tn,qi),e);break}Co(t,tn,qi);break;case 4:if(Na(t,n),(n&4194240)===n)break;for(e=t.eventTimes,i=-1;0<n;){var o=31-ei(n);a=1<<o,o=e[o],o>i&&(i=o),n&=~a}if(n=i,n=Jt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*$x(n/1960))-n,10<n){t.timeoutHandle=J0(Co.bind(null,t,tn,qi),n);break}Co(t,tn,qi);break;case 5:Co(t,tn,qi);break;default:throw Error(xe(329))}}}return sn(t,Jt()),t.callbackNode===r?W4.bind(null,t):null}function bm(t,e){var r=Ru;return t.current.memoizedState.isDehydrated&&(Io(t,e).flags|=256),t=Gd(t,e),t!==2&&(e=tn,tn=r,e!==null&&_m(e)),t}function _m(t){tn===null?tn=t:tn.push.apply(tn,t)}function Wx(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(!oi(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 Na(t,e){for(e&=~Ty,e&=~bh,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-ei(e),n=1<<r;t[r]=-1,e&=~n}}function I_(t){if(gt&6)throw Error(xe(327));ns();var e=Od(t,0);if(!(e&1))return sn(t,Jt()),null;var r=Gd(t,e);if(t.tag!==0&&r===2){var n=q0(t);n!==0&&(e=n,r=bm(t,n))}if(r===1)throw r=Ju,Io(t,0),Na(t,e),sn(t,Jt()),r;if(r===6)throw Error(xe(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Co(t,tn,qi),sn(t,Jt()),null}function Ry(t,e){var r=gt;gt|=1;try{return t(e)}finally{gt=r,gt===0&&(fs=Jt()+500,gh&&to())}}function Ho(t){Ia!==null&&Ia.tag===0&&!(gt&6)&&ns();var e=gt;gt|=1;var r=Fn.transition,n=Et;try{if(Fn.transition=null,Et=1,t)return t()}finally{Et=n,Fn.transition=r,gt=e,!(gt&6)&&to()}}function Ny(){pn=Yl.current,jt(Yl)}function Io(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,Ex(r)),rr!==null)for(r=rr.return;r!==null;){var n=r;switch(dy(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Td();break;case 3:us(),jt(on),jt(jr),wy();break;case 5:_y(n);break;case 4:us();break;case 13:jt(qt);break;case 19:jt(qt);break;case 10:vy(n.type._context);break;case 22:case 23:Ny()}r=r.return}if(yr=t,rr=t=Va(t.current,null),Or=pn=e,ur=0,Ju=null,Ty=bh=Go=0,tn=Ru=null,No!==null){for(e=0;e<No.length;e++)if(r=No[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}No=null}return t}function Y4(t,e){do{var r=rr;try{if(gy(),ud.current=Fd,Dd){for(var n=$t.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Dd=!1}if(Uo=0,vr=lr=$t=null,Tu=!1,Xu=0,Ay.current=null,r===null||r.return===null){ur=1,Ju=e,rr=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,v=l,_=v.tag;if(!(v.mode&1)&&(_===0||_===11||_===15)){var g=v.alternate;g?(v.updateQueue=g.updateQueue,v.memoizedState=g.memoizedState,v.lanes=g.lanes):(v.updateQueue=null,v.memoizedState=null)}var h=S_(o);if(h!==null){h.flags&=-257,E_(h,o,l,a,e),h.mode&1&&w_(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)){w_(a,f,e),My();break e}u=Error(xe(426))}}else if(Ut&&l.mode&1){var S=S_(o);if(S!==null){!(S.flags&65536)&&(S.flags|=256),E_(S,o,l,a,e),hy(cs(u,l));break e}}a=u=cs(u,l),ur!==4&&(ur=2),Ru===null?Ru=[a]:Ru.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,e&=-e,a.lanes|=e;var b=R4(a,u,e);p_(a,b);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"&&(Ga===null||!Ga.has(d)))){a.flags|=65536,e&=-e,a.lanes|=e;var m=N4(a,l,e);p_(a,m);break e}}a=a.return}while(a!==null)}Q4(r)}catch(y){e=y,rr===r&&r!==null&&(rr=r=r.return);continue}break}while(1)}function K4(){var t=zd.current;return zd.current=Fd,t===null?Fd:t}function My(){(ur===0||ur===3||ur===2)&&(ur=4),yr===null||!(Go&268435455)&&!(bh&268435455)||Na(yr,Or)}function Gd(t,e){var r=gt;gt|=2;var n=K4();(yr!==t||Or!==e)&&(qi=null,Io(t,e));do try{Yx();break}catch(i){Y4(t,i)}while(1);if(gy(),gt=r,zd.current=n,rr!==null)throw Error(xe(261));return yr=null,Or=0,ur}function Yx(){for(;rr!==null;)X4(rr)}function Kx(){for(;rr!==null&&!_O();)X4(rr)}function X4(t){var e=J4(t.alternate,t,pn);t.memoizedProps=t.pendingProps,e===null?Q4(t):rr=e,Ay.current=null}function Q4(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=Gx(r,e),r!==null){r.flags&=32767,rr=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{ur=6,rr=null;return}}else if(r=Ux(r,e,pn),r!==null){rr=r;return}if(e=e.sibling,e!==null){rr=e;return}rr=e=t}while(e!==null);ur===0&&(ur=5)}function Co(t,e,r){var n=Et,i=Fn.transition;try{Fn.transition=null,Et=1,Xx(t,e,r,n)}finally{Fn.transition=i,Et=n}return null}function Xx(t,e,r,n){do ns();while(Ia!==null);if(gt&6)throw Error(xe(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(xe(177));t.callbackNode=null,t.callbackPriority=0;var a=r.lanes|r.childLanes;if(CO(t,a),t===yr&&(rr=yr=null,Or=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Hf||(Hf=!0,eS(Ed,function(){return ns(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=Fn.transition,Fn.transition=null;var o=Et;Et=1;var l=gt;gt|=4,Ay.current=null,Vx(t,r),q4(r,t),vx(Q0),xd=!!X0,Q0=X0=null,t.current=r,qx(r),wO(),gt=l,Et=o,Fn.transition=a}else t.current=r;if(Hf&&(Hf=!1,Ia=t,Ud=i),a=t.pendingLanes,a===0&&(Ga=null),OO(r.stateNode),sn(t,Jt()),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(Bd)throw Bd=!1,t=mm,mm=null,t;return Ud&1&&t.tag!==0&&ns(),a=t.pendingLanes,a&1?t===ym?Nu++:(Nu=0,ym=t):Nu=0,to(),null}function ns(){if(Ia!==null){var t=C5(Ud),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,Ud=0,gt&6)throw Error(xe(331));var i=gt;for(gt|=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 v=ze;switch(v.tag){case 0:case 11:case 15:Cu(8,v,a)}var _=v.child;if(_!==null)_.return=v,ze=_;else for(;ze!==null;){v=ze;var g=v.sibling,h=v.return;if(G4(v),v===f){ze=null;break}if(g!==null){g.return=h,ze=g;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:Cu(9,a,a.return)}var b=a.sibling;if(b!==null){b.return=a.return,ze=b;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:yh(9,l)}}catch(y){Kt(l,l.return,y)}if(l===o){ze=null;break e}var m=l.sibling;if(m!==null){m.return=l.return,ze=m;break e}ze=l.return}}if(gt=i,to(),ki&&typeof ki.onPostCommitFiberRoot=="function")try{ki.onPostCommitFiberRoot(ch,t)}catch{}n=!0}return n}finally{Et=r,Fn.transition=e}}return!1}function j_(t,e,r){e=cs(r,e),e=R4(t,e,1),t=Ua(t,e,1),e=Hr(),t!==null&&(fc(t,1,e),sn(t,e))}function Kt(t,e,r){if(t.tag===3)j_(t,t,r);else for(;e!==null;){if(e.tag===3){j_(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ga===null||!Ga.has(n))){t=cs(r,t),t=N4(e,t,1),e=Ua(e,t,1),t=Hr(),e!==null&&(fc(e,1,t),sn(e,t));break}}e=e.return}}function Qx(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=Hr(),t.pingedLanes|=t.suspendedLanes&r,yr===t&&(Or&r)===r&&(ur===4||ur===3&&(Or&130023424)===Or&&500>Jt()-Cy?Io(t,0):Ty|=r),sn(t,e)}function Z4(t,e){e===0&&(t.mode&1?(e=Mf,Mf<<=1,!(Mf&130023424)&&(Mf=4194304)):e=1);var r=Hr();t=ra(t,e),t!==null&&(fc(t,e,r),sn(t,r))}function Zx(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),Z4(t,r)}function Jx(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(xe(314))}n!==null&&n.delete(e),Z4(t,r)}var J4;J4=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,Bx(t,e,r);rn=!!(t.flags&131072)}else rn=!1,Ut&&e.flags&1048576&&r4(e,Nd,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;fd(t,e),t=e.pendingProps;var i=os(e,jr.current);rs(e,r),i=Ey(null,e,n,t,i,r);var a=Oy();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,Cd(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,yy(e),i.updater=vh,e.stateNode=i,i._reactInternals=e,om(e,n,t,r),e=um(null,e,n,!0,a,r)):(e.tag=0,Ut&&a&&fy(e),Gr(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(fd(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=tP(n),t=Qn(n,t),i){case 0:e=sm(null,e,n,t,r);break e;case 1:e=P_(null,e,n,t,r);break e;case 11:e=O_(null,e,n,t,r);break e;case 14:e=x_(null,e,n,Qn(n.type,t),r);break e}throw Error(xe(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qn(n,i),sm(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qn(n,i),P_(t,e,n,i,r);case 3:e:{if(j4(e),t===null)throw Error(xe(387));n=e.pendingProps,a=e.memoizedState,i=a.element,o4(t,e),Id(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=cs(Error(xe(423)),e),e=k_(t,e,n,r,i);break e}else if(n!==i){i=cs(Error(xe(424)),e),e=k_(t,e,n,r,i);break e}else for(vn=Ba(e.stateNode.containerInfo.firstChild),mn=e,Ut=!0,Jn=null,r=c4(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ls(),n===i){e=na(t,e,r);break e}Gr(t,e,n,r)}e=e.child}return e;case 5:return f4(e),t===null&&nm(e),n=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,o=i.children,Z0(n,i)?o=null:a!==null&&Z0(n,a)&&(e.flags|=32),I4(t,e),Gr(t,e,o,r),e.child;case 6:return t===null&&nm(e),null;case 13:return D4(t,e,r);case 4:return by(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=ss(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:Qn(n,i),O_(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(Md,n._currentValue),n._currentValue=o,a!==null)if(oi(a.value,o)){if(a.children===i.children&&!on.current){e=na(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=Ki(-1,r&-r),u.tag=2;var f=a.updateQueue;if(f!==null){f=f.shared;var v=f.pending;v===null?u.next=u:(u.next=v.next,v.next=u),f.pending=u}}a.lanes|=r,u=a.alternate,u!==null&&(u.lanes|=r),im(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(xe(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),im(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,rs(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=Qn(n,e.pendingProps),i=Qn(n.type,i),x_(t,e,n,i,r);case 15:return M4(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qn(n,i),fd(t,e),e.tag=1,ln(n)?(t=!0,Cd(e)):t=!1,rs(e,r),s4(e,n,i),om(e,n,i,r),um(null,e,n,!0,t,r);case 19:return F4(t,e,r);case 22:return L4(t,e,r)}throw Error(xe(156,e.tag))};function eS(t,e){return P5(t,e)}function eP(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 eP(t,e,r,n)}function Ly(t){return t=t.prototype,!(!t||!t.isReactComponent)}function tP(t){if(typeof t=="function")return Ly(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Jm)return 11;if(t===ey)return 14}return 2}function Va(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 pd(t,e,r,n,i,a){var o=2;if(n=t,typeof t=="function")Ly(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Fl:return jo(r.children,i,a,e);case Zm:o=8,i|=8;break;case C0:return t=Dn(12,r,e,i|2),t.elementType=C0,t.lanes=a,t;case R0:return t=Dn(13,r,e,i),t.elementType=R0,t.lanes=a,t;case N0:return t=Dn(19,r,e,i),t.elementType=N0,t.lanes=a,t;case u5:return _h(r,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case l5:o=10;break e;case s5:o=9;break e;case Jm:o=11;break e;case ey:o=14;break e;case Ta:o=16,n=null;break e}throw Error(xe(130,t==null?t:typeof t,""))}return e=Dn(o,r,e,i),e.elementType=t,e.type=n,e.lanes=a,e}function jo(t,e,r,n){return t=Dn(7,t,n,e),t.lanes=r,t}function _h(t,e,r,n){return t=Dn(22,t,n,e),t.elementType=u5,t.lanes=r,t.stateNode={isHidden:!1},t}function bv(t,e,r){return t=Dn(6,t,null,e),t.lanes=r,t}function _v(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 rP(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=ev(0),this.expirationTimes=ev(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ev(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Iy(t,e,r,n,i,a,o,l,u){return t=new rP(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},yy(a),t}function nP(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Dl,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function tS(t){if(!t)return Ya;t=t._reactInternals;e:{if(Zo(t)!==t||t.tag!==1)throw Error(xe(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(xe(171))}if(t.tag===1){var r=t.type;if(ln(r))return e4(t,r,e)}return e}function rS(t,e,r,n,i,a,o,l,u){return t=Iy(r,n,!0,t,i,a,o,l,u),t.context=tS(null),r=t.current,n=Hr(),i=Ha(r),a=Ki(n,i),a.callback=e??null,Ua(r,a,i),t.current.lanes=i,fc(t,i,n),sn(t,n),t}function wh(t,e,r,n){var i=e.current,a=Hr(),o=Ha(i);return r=tS(r),e.context===null?e.context=r:e.pendingContext=r,e=Ki(a,o),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=Ua(i,e,o),t!==null&&(ti(t,i,o,a),sd(t,i,o)),o}function Hd(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 D_(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function jy(t,e){D_(t,e),(t=t.alternate)&&D_(t,e)}function iP(){return null}var nS=typeof reportError=="function"?reportError:function(t){console.error(t)};function Dy(t){this._internalRoot=t}Sh.prototype.render=Dy.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(xe(409));wh(t,e,null,null)};Sh.prototype.unmount=Dy.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Ho(function(){wh(null,t,null,null)}),e[ta]=null}};function Sh(t){this._internalRoot=t}Sh.prototype.unstable_scheduleHydration=function(t){if(t){var e=M5();t={blockedOn:null,target:t,priority:e};for(var r=0;r<Ra.length&&e!==0&&e<Ra[r].priority;r++);Ra.splice(r,0,t),r===0&&I5(t)}};function Fy(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Eh(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function F_(){}function aP(t,e,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var f=Hd(o);a.call(f)}}var o=rS(e,n,t,0,null,!1,!1,"",F_);return t._reactRootContainer=o,t[ta]=o.current,qu(t.nodeType===8?t.parentNode:t),Ho(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var f=Hd(u);l.call(f)}}var u=Iy(t,0,!1,null,null,!1,!1,"",F_);return t._reactRootContainer=u,t[ta]=u.current,qu(t.nodeType===8?t.parentNode:t),Ho(function(){wh(e,u,r,n)}),u}function Oh(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=Hd(o);l.call(u)}}wh(e,o,t,i)}else o=aP(r,e,t,i,n);return Hd(o)}R5=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=_u(e.pendingLanes);r!==0&&(ny(e,r|1),sn(e,Jt()),!(gt&6)&&(fs=Jt()+500,to()))}break;case 13:Ho(function(){var n=ra(t,1);if(n!==null){var i=Hr();ti(n,t,1,i)}}),jy(t,1)}};iy=function(t){if(t.tag===13){var e=ra(t,134217728);if(e!==null){var r=Hr();ti(e,t,134217728,r)}jy(t,134217728)}};N5=function(t){if(t.tag===13){var e=Ha(t),r=ra(t,e);if(r!==null){var n=Hr();ti(r,t,e,n)}jy(t,e)}};M5=function(){return Et};L5=function(t,e){var r=Et;try{return Et=t,e()}finally{Et=r}};G0=function(t,e,r){switch(e){case"input":if(I0(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=ph(n);if(!i)throw Error(xe(90));f5(n),I0(n,i)}}}break;case"textarea":h5(t,r);break;case"select":e=r.value,e!=null&&Zl(t,!!r.multiple,e,!1)}};_5=Ry;w5=Ho;var oP={usingClientEntryPoint:!1,Events:[hc,Gl,ph,y5,b5,Ry]},pu={findFiberByHostInstance:Ro,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},lP={bundleType:pu.bundleType,version:pu.version,rendererPackageName:pu.rendererPackageName,rendererConfig:pu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:la.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=O5(t),t===null?null:t.stateNode},findFiberByHostInstance:pu.findFiberByHostInstance||iP,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 Vf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vf.isDisabled&&Vf.supportsFiber)try{ch=Vf.inject(lP),ki=Vf}catch{}}wn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oP;wn.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Fy(e))throw Error(xe(200));return nP(t,e,null,r)};wn.createRoot=function(t,e){if(!Fy(t))throw Error(xe(299));var r=!1,n="",i=nS;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Iy(t,1,!1,null,null,r,!1,n,i),t[ta]=e.current,qu(t.nodeType===8?t.parentNode:t),new Dy(e)};wn.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(xe(188)):(t=Object.keys(t).join(","),Error(xe(268,t)));return t=O5(e),t=t===null?null:t.stateNode,t};wn.flushSync=function(t){return Ho(t)};wn.hydrate=function(t,e,r){if(!Eh(e))throw Error(xe(200));return Oh(null,t,e,!0,r)};wn.hydrateRoot=function(t,e,r){if(!Fy(t))throw Error(xe(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",o=nS;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),e=rS(e,null,t,1,r??null,i,!1,a,o),t[ta]=e.current,qu(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 Sh(e)};wn.render=function(t,e,r){if(!Eh(e))throw Error(xe(200));return Oh(null,t,e,!1,r)};wn.unmountComponentAtNode=function(t){if(!Eh(t))throw Error(xe(40));return t._reactRootContainer?(Ho(function(){Oh(null,null,t,!1,function(){t._reactRootContainer=null,t[ta]=null})}),!0):!1};wn.unstable_batchedUpdates=Ry;wn.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!Eh(r))throw Error(xe(200));if(t==null||t._reactInternals===void 0)throw Error(xe(38));return Oh(t,e,r,!1,n)};wn.version="18.2.0-next-9e3b772b8-20220608";function iS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iS)}catch(t){console.error(t)}}iS(),r5.exports=wn;var aS=r5.exports,z_=aS;bd.createRoot=z_.createRoot,bd.hydrateRoot=z_.hydrateRoot;var oS={};function Je(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 sP={};function zy(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:sP}var lS=Object.assign,Vd=Object.getOwnPropertyDescriptor,Ti=Object.defineProperty,gc=Object.prototype,wm=[];Object.freeze(wm);var By={};Object.freeze(By);var uP=typeof Proxy<"u",cP=Object.toString();function sS(){uP||Je("Proxy not available")}function uS(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var Kl=function(){};function bn(t){return typeof t=="function"}function Vo(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function xh(t){return t!==null&&typeof t=="object"}function ia(t){if(!xh(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()===cP}function cS(t){var e=t==null?void 0:t.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function vc(t,e,r){Ti(t,e,{enumerable:!1,writable:!0,configurable:!0,value:r})}function fS(t,e,r){Ti(t,e,{enumerable:!1,writable:!1,configurable:!0,value:r})}function ro(t,e){var r="isMobX"+t;return e.prototype[r]=!0,function(n){return xh(n)&&n[r]===!0}}function Cs(t){return t instanceof Map}function mc(t){return t instanceof Set}var dS=typeof Object.getOwnPropertySymbols<"u";function fP(t){var e=Object.keys(t);if(!dS)return e;var r=Object.getOwnPropertySymbols(t);return r.length?[].concat(e,r.filter(function(n){return gc.propertyIsEnumerable.call(t,n)})):e}var ds=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:dS?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function hS(t){return t===null?null:typeof t=="object"?""+t:t}function Xi(t,e){return gc.hasOwnProperty.call(t,e)}var dP=Object.getOwnPropertyDescriptors||function(e){var r={};return ds(e).forEach(function(n){r[n]=Vd(e,n)}),r};function B_(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,gP(n.key),n)}}function Uy(t,e,r){return e&&B_(t.prototype,e),r&&B_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ka(){return Ka=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},Ka.apply(this,arguments)}function pS(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Sm(t,e)}function Sm(t,e){return Sm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Sm(t,e)}function wv(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function hP(t,e){if(t){if(typeof t=="string")return U_(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 U_(t,e)}}function U_(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 Xl(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=hP(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 pP(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 gP(t){var e=pP(t,"string");return typeof e=="symbol"?e:String(e)}var Pi=Symbol("mobx-stored-annotations");function ri(t){function e(r,n){if(yc(n))return t.decorate_20223_(r,n);Rs(r,n,t)}return Object.assign(e,t)}function Rs(t,e,r){Xi(t,Pi)||vc(t,Pi,Ka({},t[Pi])),OP(r)||(t[Pi][e]=r)}function vP(t){return Xi(t,Pi)||vc(t,Pi,Ka({},t[Pi])),t[Pi]}function yc(t){return typeof t=="object"&&typeof t.kind=="string"}var Ve=Symbol("mobx administration"),bc=function(){function t(r){r===void 0&&(r="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=_t.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}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 IS(this)},e.reportChanged=function(){nn(),jS(this),an()},e.toString=function(){return this.name_},t}(),Gy=ro("Atom",bc);function ec(t,e,r){e===void 0&&(e=Kl),r===void 0&&(r=Kl);var n=new bc(t);return e!==Kl&&qS(n,e),r!==Kl&&Yy(n,r),n}function mP(t,e){return t===e}function yP(t,e){return i1(t,e)}function bP(t,e){return i1(t,e,1)}function _P(t,e){return Object.is?Object.is(t,e):t===e?t!==0||1/t===1/e:t!==t&&e!==e}var qo={identity:mP,structural:yP,default:_P,shallow:bP};function $o(t,e,r){return Mh(t)?t:Array.isArray(t)?kt.array(t,{name:r}):ia(t)?kt.object(t,void 0,{name:r}):Cs(t)?kt.map(t,{name:r}):mc(t)?kt.set(t,{name:r}):typeof t=="function"&&!wc(t)&&!ms(t)?cS(t)?Yo(t):gs(r,t):t}function wP(t,e,r){if(t==null||br(t)||Wr(t)||Pr(t)||Vr(t))return t;if(Array.isArray(t))return kt.array(t,{name:r,deep:!1});if(ia(t))return kt.object(t,void 0,{name:r,deep:!1});if(Cs(t))return kt.map(t,{name:r,deep:!1});if(mc(t))return kt.set(t,{name:r,deep:!1})}function Ph(t){return t}function SP(t,e){return i1(t,e)?e:t}var gS="override",EP=ri({annotationType_:gS,make_:xP,extend_:PP,decorate_20223_:kP});function OP(t){return t.annotationType_===gS}function xP(t,e){return 0}function PP(t,e,r,n){Je("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function kP(t,e){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function _c(t,e){return{annotationType_:t,options_:e,make_:AP,extend_:TP,decorate_20223_:CP}}function AP(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(wc(r.value))return 1;var a=vS(t,this,e,r,!1);return Ti(n,e,a),2}function TP(t,e,r,n){var i=vS(t,this,e,r);return t.defineProperty_(e,i,n)}function CP(t,e){var r=e.kind,n=e.name,i=e.addInitializer,a=this,o=function(f){var v,_,g,h;return Xa((v=(_=a.options_)==null?void 0:_.name)!=null?v:n.toString(),f,(g=(h=a.options_)==null?void 0:h.autoAction)!=null?g:!1)};if(r=="field"){i(function(){Rs(this,n,a)});return}if(r=="method"){var l;return wc(t)||(t=o(t)),(l=this.options_)!=null&&l.bound&&i(function(){var u=this,f=u[n].bind(u);f.isMobxAction=!0,u[n]=f}),t}Je("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
|
|
34
|
+
'`+a.annotationType_+"' can only be used on properties with a function value."))}function RP(t,e,r,n){e.annotationType_,n.value}function vS(t,e,r,n,i){var a,o,l,u,f,v,_;i===void 0&&(i=ke.safeDescriptors),RP(t,e,r,n);var g=n.value;if((a=e.options_)!=null&&a.bound){var h;g=g.bind((h=t.proxy_)!=null?h:t.target_)}return{value:Xa((o=(l=e.options_)==null?void 0:l.name)!=null?o:r.toString(),g,(u=(f=e.options_)==null?void 0:f.autoAction)!=null?u:!1,(v=e.options_)!=null&&v.bound?(_=t.proxy_)!=null?_:t.target_:void 0),configurable:i?t.isPlainObject_:!0,enumerable:!1,writable:!i}}function mS(t,e){return{annotationType_:t,options_:e,make_:NP,extend_:MP,decorate_20223_:LP}}function NP(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&&(!Xi(t.target_,e)||!ms(t.target_[e]))&&this.extend_(t,e,r,!1)===null)return 0;if(ms(r.value))return 1;var a=yS(t,this,e,r,!1,!1);return Ti(n,e,a),2}function MP(t,e,r,n){var i,a=yS(t,this,e,r,(i=this.options_)==null?void 0:i.bound);return t.defineProperty_(e,a,n)}function LP(t,e){var r,n=e.name,i=e.addInitializer;return ms(t)||(t=Yo(t)),(r=this.options_)!=null&&r.bound&&i(function(){var a=this,o=a[n].bind(a);o.isMobXFlow=!0,a[n]=o}),t}function IP(t,e,r,n){e.annotationType_,n.value}function yS(t,e,r,n,i,a){a===void 0&&(a=ke.safeDescriptors),IP(t,e,r,n);var o=n.value;if(ms(o)||(o=Yo(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 Hy(t,e){return{annotationType_:t,options_:e,make_:jP,extend_:DP,decorate_20223_:FP}}function jP(t,e,r){return this.extend_(t,e,r,!1)===null?0:1}function DP(t,e,r,n){return zP(t,this,e,r),t.defineComputedProperty_(e,Ka({},this.options_,{get:r.get,set:r.set}),n)}function FP(t,e){var r=this,n=e.name,i=e.addInitializer;return i(function(){var a=tl(this)[Ve],o=Ka({},r.options_,{get:t,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new hs(o))}),function(){return this[Ve].getObservablePropValue_(n)}}function zP(t,e,r,n){e.annotationType_,n.get}function kh(t,e){return{annotationType_:t,options_:e,make_:BP,extend_:UP,decorate_20223_:GP}}function BP(t,e,r){return this.extend_(t,e,r,!1)===null?0:1}function UP(t,e,r,n){var i,a;return HP(t,this),t.defineObservableProperty_(e,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:$o,n)}function GP(t,e){var r=this,n=e.kind,i=e.name,a=new WeakSet;function o(l,u){var f,v,_=tl(l)[Ve],g=new qa(u,(f=(v=r.options_)==null?void 0:v.enhancer)!=null?f:$o,"ObservableObject."+i.toString(),!1);_.values_.set(i,g),a.add(l)}if(n=="accessor")return{get:function(){return a.has(this)||o(this,t.get.call(this)),this[Ve].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[Ve].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function HP(t,e,r,n){e.annotationType_}var VP="true",qP=bS();function bS(t){return{annotationType_:VP,options_:t,make_:$P,extend_:WP,decorate_20223_:YP}}function $P(t,e,r,n){var i,a;if(r.get)return Jo.make_(t,e,r,n);if(r.set){var o=Xa(e.toString(),r.set);return n===t.target_?t.defineProperty_(e,{configurable:ke.safeDescriptors?t.isPlainObject_:!0,set:o})===null?0:2:(Ti(n,e,{configurable:!0,set:o}),2)}if(n!==t.target_&&typeof r.value=="function"){var l;if(cS(r.value)){var u,f=(u=this.options_)!=null&&u.autoBind?Yo.bound:Yo;return f.make_(t,e,r,n)}var v=(l=this.options_)!=null&&l.autoBind?gs.bound:gs;return v.make_(t,e,r,n)}var _=((i=this.options_)==null?void 0:i.deep)===!1?kt.ref:kt;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var g;r.value=r.value.bind((g=t.proxy_)!=null?g:t.target_)}return _.make_(t,e,r,n)}function WP(t,e,r,n){var i,a;if(r.get)return Jo.extend_(t,e,r,n);if(r.set)return t.defineProperty_(e,{configurable:ke.safeDescriptors?t.isPlainObject_:!0,set:Xa(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?kt.ref:kt;return l.extend_(t,e,r,n)}function YP(t,e){Je("'"+this.annotationType_+"' cannot be used as a decorator")}var KP="observable",XP="observable.ref",QP="observable.shallow",ZP="observable.struct",_S={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(_S);function qf(t){return t||_S}var Em=kh(KP),JP=kh(XP,{enhancer:Ph}),e7=kh(QP,{enhancer:wP}),t7=kh(ZP,{enhancer:SP}),wS=ri(Em);function $f(t){return t.deep===!0?$o:t.deep===!1?Ph:n7(t.defaultDecorator)}function r7(t){var e;return t?(e=t.defaultDecorator)!=null?e:bS(t):void 0}function n7(t){var e,r;return t&&(e=(r=t.options_)==null?void 0:r.enhancer)!=null?e:$o}function SS(t,e,r){if(yc(e))return Em.decorate_20223_(t,e);if(Vo(e)){Rs(t,e,Em);return}return Mh(t)?t:ia(t)?kt.object(t,e,r):Array.isArray(t)?kt.array(t,e):Cs(t)?kt.map(t,e):mc(t)?kt.set(t,e):typeof t=="object"&&t!==null?t:kt.box(t,e)}lS(SS,wS);var i7={box:function(e,r){var n=qf(r);return new qa(e,$f(n),n.name,!0,n.equals)},array:function(e,r){var n=qf(r);return(ke.useProxies===!1||n.proxy===!1?ck:ek)(e,$f(n),n.name)},map:function(e,r){var n=qf(r);return new Ih(e,$f(n),n.name)},set:function(e,r){var n=qf(r);return new r1(e,$f(n),n.name)},object:function(e,r,n){return no(function(){return Ky(ke.useProxies===!1||(n==null?void 0:n.proxy)===!1?tl({},n):X7({},n),e,r)})},ref:ri(JP),shallow:ri(e7),deep:wS,struct:ri(t7)},kt=lS(SS,i7),ES="computed",a7="computed.struct",Om=Hy(ES),o7=Hy(a7,{equals:qo.structural}),Jo=function(e,r){if(yc(r))return Om.decorate_20223_(e,r);if(Vo(r))return Rs(e,r,Om);if(ia(e))return ri(Hy(ES,e));var n=ia(r)?r:{};return n.get=e,n.name||(n.name=e.name||""),new hs(n)};Object.assign(Jo,Om);Jo.struct=ri(o7);var G_,H_,qd=0,l7=1,s7=(G_=(H_=Vd(function(){},"name"))==null?void 0:H_.configurable)!=null?G_:!1,V_={value:"action",configurable:!0,writable:!1,enumerable:!1};function Xa(t,e,r,n){r===void 0&&(r=!1);function i(){return OS(t,r,e,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return e.toString()},s7&&(V_.value=t,Ti(i,"name",V_)),i}function OS(t,e,r,n,i){var a=xS(t,e);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{PS(a)}}function xS(t,e,r,n){var i=!1,a=0,o=ke.trackingDerivation,l=!e||!o;nn();var u=ke.allowStateChanges;l&&(el(),u=Ah(!0));var f=Ch(!0),v={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:f,notifySpy_:i,startTime_:a,actionId_:l7++,parentActionId_:qd};return qd=v.actionId_,v}function PS(t){qd!==t.actionId_&&Je(30),qd=t.parentActionId_,t.error_!==void 0&&(ke.suppressReactionErrors=!0),Th(t.prevAllowStateChanges_),is(t.prevAllowStateReads_),an(),t.runAsAction_&&Qi(t.prevDerivation_),ke.suppressReactionErrors=!1}function Vy(t,e){var r=Ah(t);try{return e()}finally{Th(r)}}function Ah(t){var e=ke.allowStateChanges;return ke.allowStateChanges=t,e}function Th(t){ke.allowStateChanges=t}var kS;kS=Symbol.toPrimitive;var qa=function(t){pS(e,t);function e(n,i,a,o,l){var u;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=qo.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!==ke.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(In(this)){var a=jn(this,{object:this,type:Ci,newValue:i});if(!a)return ke.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?ke.UNCHANGED:i},r.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),ni(this)&&ii(this,{type:Ci,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Sc(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Ci,newValue:this.value_,oldValue:void 0}),Ec(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 hS(this.get())},r[kS]=function(){return this.valueOf()},e}(bc),qy=ro("ObservableValue",qa),AS;AS=Symbol.toPrimitive;var hs=function(){function t(r){this.dependenciesState_=_t.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_=_t.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Wd(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_=$d.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||Je(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=Xa("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?qo.structural:qo.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){y7(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_&&Je(32,this.name_,this.derivation),ke.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)xm(this)&&(this.warnAboutUntrackedRead_(),nn(),this.value_=this.computeValue_(!1),an());else if(IS(this),xm(this)){var n=ke.trackingContext;this.keepAlive_&&!n&&(ke.trackingContext=this),this.trackAndCompute()&&m7(this),ke.trackingContext=n}var i=this.value_;if(gd(i))throw i.cause;return i},e.set=function(n){if(this.setter_){this.isRunningSetter_&&Je(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter_=!1}}else Je(34,this.name_)},e.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===_t.NOT_TRACKING_,a=this.computeValue_(!0),o=i||gd(n)||gd(a)||!this.equals_(n,a);return o&&(this.value_=a),o},e.computeValue_=function(n){this.isComputing_=!0;var i=Ah(!1),a;if(n)a=TS(this,this.derivation,this.scope_);else if(ke.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new Wd(o)}return Th(i),this.isComputing_=!1,a},e.suspend_=function(){this.keepAlive_||(Pm(this),this.value_=void 0)},e.observe_=function(n,i){var a=this,o=!0,l=void 0;return Wy(function(){var u=a.get();if(!o||i){var f=el();n({observableKind:"computed",debugObjectName:a.name_,type:Ci,object:a,newValue:u,oldValue:l}),Qi(f)}o=!1,l=u})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return hS(this.get())},e[AS]=function(){return this.valueOf()},t}(),Wo=ro("ComputedValue",hs),_t;(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_"})(_t||(_t={}));var $d;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})($d||($d={}));var Wd=function(e){this.cause=void 0,this.cause=e};function gd(t){return t instanceof Wd}function xm(t){switch(t.dependenciesState_){case _t.UP_TO_DATE_:return!1;case _t.NOT_TRACKING_:case _t.STALE_:return!0;case _t.POSSIBLY_STALE_:{for(var e=Ch(!0),r=el(),n=t.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if(Wo(o)){if(ke.disableErrorBoundaries)o.get();else try{o.get()}catch{return Qi(r),is(e),!0}if(t.dependenciesState_===_t.STALE_)return Qi(r),is(e),!0}}return CS(t),Qi(r),is(e),!1}}}function u7(){return ke.trackingDerivation!==null}function TS(t,e,r){var n=Ch(!0);CS(t),t.newObserving_=new Array(t.observing_.length+100),t.unboundDepsCount_=0,t.runId_=++ke.runId;var i=ke.trackingDerivation;ke.trackingDerivation=t,ke.inBatch++;var a;if(ke.disableErrorBoundaries===!0)a=e.call(r);else try{a=e.call(r)}catch(o){a=new Wd(o)}return ke.inBatch--,ke.trackingDerivation=i,c7(t),is(n),a}function c7(t){for(var e=t.observing_,r=t.observing_=t.newObserving_,n=_t.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&&MS(u,t),u.diffValue_=0}for(;i--;){var f=r[i];f.diffValue_===1&&(f.diffValue_=0,v7(f,t))}n!==_t.UP_TO_DATE_&&(t.dependenciesState_=n,t.onBecomeStale_())}function Pm(t){var e=t.observing_;t.observing_=[];for(var r=e.length;r--;)MS(e[r],t);t.dependenciesState_=_t.NOT_TRACKING_}function $y(t){var e=el();try{return t()}finally{Qi(e)}}function el(){var t=ke.trackingDerivation;return ke.trackingDerivation=null,t}function Qi(t){ke.trackingDerivation=t}function Ch(t){var e=ke.allowStateReads;return ke.allowStateReads=t,e}function is(t){ke.allowStateReads=t}function CS(t){if(t.dependenciesState_!==_t.UP_TO_DATE_){t.dependenciesState_=_t.UP_TO_DATE_;for(var e=t.observing_,r=e.length;r--;)e[r].lowestObserverState_=_t.UP_TO_DATE_}}var f7=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],Mu=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},vd=!0,RS=!1,ke=function(){var t=zy();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(vd=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new Mu().version&&(vd=!1),vd?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Mu):(setTimeout(function(){RS||Je(35)},1),new Mu)}();function d7(){if((ke.pendingReactions.length||ke.inBatch||ke.isRunningReactions)&&Je(36),RS=!0,vd){var t=zy();--t.__mobxInstanceCount===0&&(t.__mobxGlobals=void 0),ke=new Mu}}function NS(){return ke}function h7(){var t=new Mu;for(var e in t)f7.indexOf(e)===-1&&(ke[e]=t[e]);ke.allowStateChanges=!ke.enforceActions}function p7(t){return t.observers_&&t.observers_.size>0}function g7(t){return t.observers_}function v7(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function MS(t,e){t.observers_.delete(e),t.observers_.size===0&&LS(t)}function LS(t){t.isPendingUnobservation_===!1&&(t.isPendingUnobservation_=!0,ke.pendingUnobservations.push(t))}function nn(){ke.inBatch++}function an(){if(--ke.inBatch===0){DS();for(var t=ke.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 hs&&r.suspend_())}ke.pendingUnobservations=[]}}function IS(t){var e=ke.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved_&&ke.trackingContext&&(t.isBeingObserved_=!0,t.onBO())),t.isBeingObserved_):(t.observers_.size===0&&ke.inBatch>0&&LS(t),!1)}function jS(t){t.lowestObserverState_!==_t.STALE_&&(t.lowestObserverState_=_t.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===_t.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=_t.STALE_}))}function m7(t){t.lowestObserverState_!==_t.STALE_&&(t.lowestObserverState_=_t.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===_t.POSSIBLY_STALE_?e.dependenciesState_=_t.STALE_:e.dependenciesState_===_t.UP_TO_DATE_&&(t.lowestObserverState_=_t.UP_TO_DATE_)}))}function y7(t){t.lowestObserverState_===_t.UP_TO_DATE_&&(t.lowestObserverState_=_t.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===_t.UP_TO_DATE_&&(e.dependenciesState_=_t.POSSIBLY_STALE_,e.onBecomeStale_())}))}var ps=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_=_t.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_=$d.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,ke.pendingReactions.push(this),DS())},e.isScheduled=function(){return this.isScheduled_},e.runReaction_=function(){if(!this.isDisposed_){nn(),this.isScheduled_=!1;var n=ke.trackingContext;if(ke.trackingContext=this,xm(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}ke.trackingContext=n,an()}},e.track=function(n){if(!this.isDisposed_){nn(),this.isRunning_=!0;var i=ke.trackingContext;ke.trackingContext=this;var a=TS(this,n,void 0);ke.trackingContext=i,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Pm(this),gd(a)&&this.reportExceptionInDerivation_(a.cause),an()}},e.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(ke.disableErrorBoundaries)throw n;var a="[mobx] uncaught error in '"+this+"'";ke.suppressReactionErrors||console.error(a,n),ke.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},e.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(nn(),Pm(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[Ve]=this,a},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(n){},t}();function b7(t){return ke.globalReactionErrorHandlers.push(t),function(){var e=ke.globalReactionErrorHandlers.indexOf(t);e>=0&&ke.globalReactionErrorHandlers.splice(e,1)}}var _7=100,km=function(e){return e()};function DS(){ke.inBatch>0||ke.isRunningReactions||km(w7)}function w7(){ke.isRunningReactions=!0;for(var t=ke.pendingReactions,e=0;t.length>0;){++e===_7&&(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_()}ke.isRunningReactions=!1}var Yd=ro("Reaction",ps);function S7(t){var e=km;km=function(n){return t(function(){return e(n)})}}function Lu(){return!1}function FS(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var zS="action",E7="action.bound",BS="autoAction",O7="autoAction.bound",US="<unnamed action>",Am=_c(zS),x7=_c(E7,{bound:!0}),Tm=_c(BS,{autoAction:!0}),P7=_c(O7,{autoAction:!0,bound:!0});function GS(t){var e=function(n,i){if(bn(n))return Xa(n.name||US,n,t);if(bn(i))return Xa(n,i,t);if(yc(i))return(t?Tm:Am).decorate_20223_(n,i);if(Vo(i))return Rs(n,i,t?Tm:Am);if(Vo(n))return ri(_c(t?BS:zS,{name:n,autoAction:t}))};return e}var nr=GS(!1);Object.assign(nr,Am);var gs=GS(!0);Object.assign(gs,Tm);nr.bound=ri(x7);gs.bound=ri(P7);function vs(t){return OS(t.name||US,!1,t,this,void 0)}function wc(t){return bn(t)&&t.isMobxAction===!0}function Wy(t,e){var r,n,i,a,o;e===void 0&&(e=By);var l=(r=(n=e)==null?void 0:n.name)!=null?r:"Autorun",u=!e.scheduler&&!e.delay,f;if(u)f=new ps(l,function(){this.track(g)},e.onError,e.requiresObservable);else{var v=HS(e),_=!1;f=new ps(l,function(){_||(_=!0,v(function(){_=!1,f.isDisposed_||f.track(g)}))},e.onError,e.requiresObservable)}function g(){t(f)}return(i=e)!=null&&(a=i.signal)!=null&&a.aborted||f.schedule_(),f.getDisposer_((o=e)==null?void 0:o.signal)}var k7=function(e){return e()};function HS(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:k7}function VS(t,e,r){var n,i,a,o;r===void 0&&(r=By);var l=(n=r.name)!=null?n:"Reaction",u=nr(l,r.onError?A7(r.onError,e):e),f=!r.scheduler&&!r.delay,v=HS(r),_=!0,g=!1,h,w,E=r.compareStructural?qo.structural:r.equals||qo.default,S=new ps(l,function(){_||f?b():g||(g=!0,v(b))},r.onError,r.requiresObservable);function b(){if(g=!1,!S.isDisposed_){var p=!1;S.track(function(){var d=Vy(!1,function(){return t(S)});p=_||!E(h,d),w=h,h=d}),(_&&r.fireImmediately||!_&&p)&&u(h,w,S),_=!1}}return(i=r)!=null&&(a=i.signal)!=null&&a.aborted||S.schedule_(),S.getDisposer_((o=r)==null?void 0:o.signal)}function A7(t,e){return function(){try{return e.apply(this,arguments)}catch(r){t.call(this,r)}}}var T7="onBO",C7="onBUO";function qS(t,e,r){return $S(T7,t,e,r)}function Yy(t,e,r){return $S(C7,t,e,r)}function $S(t,e,r,n){var i=typeof n=="function"?Ri(e,r):Ri(e),a=bn(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 R7="never",Wf="always",N7="observed";function WS(t){t.isolateGlobalState===!0&&d7();var e=t.useProxies,r=t.enforceActions;if(e!==void 0&&(ke.useProxies=e===Wf?!0:e===R7?!1:typeof Proxy<"u"),e==="ifavailable"&&(ke.verifyProxies=!0),r!==void 0){var n=r===Wf?Wf:r===N7;ke.enforceActions=n,ke.allowStateChanges=!(n===!0||n===Wf)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in t&&(ke[i]=!!t[i])}),ke.allowStateReads=!ke.observableRequiresReaction,t.reactionScheduler&&S7(t.reactionScheduler)}function Ky(t,e,r,n){var i=dP(e);return no(function(){var a=tl(t,n)[Ve];ds(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),t}function YS(t,e){return KS(Ri(t,e))}function KS(t){var e={name:t.name_};return t.observing_&&t.observing_.length>0&&(e.dependencies=L7(t.observing_).map(KS)),e}function M7(t,e){return XS(Ri(t,e))}function XS(t){var e={name:t.name_};return p7(t)&&(e.observers=Array.from(g7(t)).map(XS)),e}function L7(t){return Array.from(new Set(t))}var I7=0;function Rh(){this.message="FLOW_CANCELLED"}Rh.prototype=Object.create(Error.prototype);function j7(t){return t instanceof Rh}var Sv=mS("flow"),D7=mS("flow.bound",{bound:!0}),Yo=Object.assign(function(e,r){if(yc(r))return Sv.decorate_20223_(e,r);if(Vo(r))return Rs(e,r,Sv);var n=e,i=n.name||"<unnamed flow>",a=function(){var l=this,u=arguments,f=++I7,v=nr(i+" - runid: "+f+" - init",n).apply(l,u),_,g=void 0,h=new Promise(function(w,E){var S=0;_=E;function b(m){g=void 0;var y;try{y=nr(i+" - runid: "+f+" - yield "+S++,v.next).call(v,m)}catch(x){return E(x)}d(y)}function p(m){g=void 0;var y;try{y=nr(i+" - runid: "+f+" - yield "+S++,v.throw).call(v,m)}catch(x){return E(x)}d(y)}function d(m){if(bn(m==null?void 0:m.then)){m.then(d,E);return}return m.done?w(m.value):(g=Promise.resolve(m.value),g.then(b,p))}b(void 0)});return h.cancel=nr(i+" - runid: "+f+" - cancel",function(){try{g&&q_(g);var w=v.return(void 0),E=Promise.resolve(w.value);E.then(Kl,Kl),q_(E),_(new Rh)}catch(S){_(S)}}),h};return a.isMobXFlow=!0,a},Sv);Yo.bound=ri(D7);function q_(t){bn(t.cancel)&&t.cancel()}function F7(t){return t}function ms(t){return(t==null?void 0:t.isMobXFlow)===!0}function Xy(t,e,r){var n;return Pr(t)||Wr(t)||qy(t)?n=li(t):br(t)&&(n=li(t,e)),n.dehancer=typeof e=="function"?e:r,function(){n.dehancer=void 0}}function Nh(t,e,r){return bn(r)?B7(t,e,r):z7(t,e)}function z7(t,e){return li(t).intercept_(e)}function B7(t,e,r){return li(t,e).intercept_(r)}function QS(t,e){if(e===void 0)return Wo(t);if(br(t)===!1||!t[Ve].values_.has(e))return!1;var r=Ri(t,e);return Wo(r)}function U7(t){return QS(t)}function ZS(t,e){return QS(t,e)}function JS(t,e){return t?e!==void 0?br(t)?t[Ve].values_.has(e):!1:br(t)||!!t[Ve]||Gy(t)||Yd(t)||Wo(t):!1}function Mh(t){return JS(t)}function e6(t,e){return JS(t,e)}function tc(t){if(br(t))return t[Ve].keys_();if(Pr(t)||Vr(t))return Array.from(t.keys());if(Wr(t))return t.map(function(e,r){return r});Je(5)}function Qy(t){if(br(t))return tc(t).map(function(e){return t[e]});if(Pr(t))return tc(t).map(function(e){return t.get(e)});if(Vr(t))return Array.from(t.values());if(Wr(t))return t.slice();Je(6)}function t6(t){if(br(t))return tc(t).map(function(e){return[e,t[e]]});if(Pr(t))return tc(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]});Je(7)}function Zy(t,e,r){if(arguments.length===2&&!Vr(t)){nn();var n=e;try{for(var i in n)Zy(t,i,n[i])}finally{an()}return}br(t)?t[Ve].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&&Je("Invalid index: '"+e+"'"),nn(),e>=t.length&&(t.length=e+1),t[e]=r,an()):Je(8)}function G7(t,e){br(t)?t[Ve].delete_(e):Pr(t)||Vr(t)?t.delete(e):Wr(t)?(typeof e!="number"&&(e=parseInt(e,10)),t.splice(e,1)):Je(9)}function r6(t,e){if(br(t))return t[Ve].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;Je(10)}function H7(t,e){if(r6(t,e)){if(br(t))return t[Ve].get_(e);if(Pr(t))return t.get(e);if(Wr(t))return t[e];Je(11)}}function Jy(t,e,r){if(br(t))return t[Ve].defineProperty_(e,r);Je(39)}function n6(t){if(br(t))return t[Ve].ownKeys_();Je(38)}function Lh(t,e,r,n){return bn(r)?q7(t,e,r,n):V7(t,e,r)}function V7(t,e,r){return li(t).observe_(e,r)}function q7(t,e,r,n){return li(t,e).observe_(r,n)}function Yf(t,e,r){return t.set(e,r),r}function jl(t,e){if(t==null||typeof t!="object"||t instanceof Date||!Mh(t))return t;if(qy(t)||Wo(t))return jl(t.get(),e);if(e.has(t))return e.get(t);if(Wr(t)){var r=Yf(e,t,new Array(t.length));return t.forEach(function(o,l){r[l]=jl(o,e)}),r}if(Vr(t)){var n=Yf(e,t,new Set);return t.forEach(function(o){n.add(jl(o,e))}),n}if(Pr(t)){var i=Yf(e,t,new Map);return t.forEach(function(o,l){i.set(l,jl(o,e))}),i}else{var a=Yf(e,t,{});return n6(t).forEach(function(o){gc.propertyIsEnumerable.call(t,o)&&(a[o]=jl(t[o],e))}),a}}function $7(t,e){return jl(t,new Map)}function W7(){}function Oi(t,e){e===void 0&&(e=void 0),nn();try{return t.apply(e)}finally{an()}}function Cm(t,e,r){return arguments.length===1||e&&typeof e=="object"?Y7(t,e):i6(t,e,r||{})}function i6(t,e,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[Ve].isDisposed_)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=Xa("When-effect",e),o=Wy(function(l){var u=Vy(!1,t);u&&(l.dispose(),n&&clearTimeout(n),a())},r);return o}function Y7(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=i6(t,o,Ka({},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 Nl(t){return t[Ve]}var K7={has:function(e,r){return Nl(e).has_(r)},get:function(e,r){return Nl(e).get_(r)},set:function(e,r,n){var i;return Vo(r)?(i=Nl(e).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(e,r){var n;return Vo(r)?(n=Nl(e).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(e,r,n){var i;return(i=Nl(e).defineProperty_(r,n))!=null?i:!0},ownKeys:function(e){return Nl(e).ownKeys_()},preventExtensions:function(e){Je(13)}};function X7(t,e){var r,n;return sS(),t=tl(t,e),(n=(r=t[Ve]).proxy_)!=null?n:r.proxy_=new Proxy(t,K7)}function In(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function Sc(t,e){var r=t.interceptors_||(t.interceptors_=[]);return r.push(e),uS(function(){var n=r.indexOf(e);n!==-1&&r.splice(n,1)})}function jn(t,e){var r=el();try{for(var n=[].concat(t.interceptors_||[]),i=0,a=n.length;i<a&&(e=n[i](e),e&&!e.type&&Je(14),!!e);i++);return e}finally{Qi(r)}}function ni(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function Ec(t,e){var r=t.changeListeners_||(t.changeListeners_=[]);return r.push(e),uS(function(){var n=r.indexOf(e);n!==-1&&r.splice(n,1)})}function ii(t,e){var r=el(),n=t.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](e);Qi(r)}}function e1(t,e,r){return no(function(){var n,i=tl(t,r)[Ve];(n=e)!=null||(e=vP(t)),ds(e).forEach(function(a){return i.make_(a,e[a])})}),t}var Ev=Symbol("mobx-keys");function Q7(t,e,r){return ia(t)?Ky(t,t,e,r):(no(function(){var n=tl(t,r)[Ve];if(!t[Ev]){var i=Object.getPrototypeOf(t),a=new Set([].concat(ds(t),ds(i)));a.delete("constructor"),a.delete(Ve),vc(i,Ev,a)}t[Ev].forEach(function(o){return n.make_(o,e&&o in e?e[o]:!0)})}),t)}var $_="splice",Ci="update",Z7=1e4,J7={get:function(e,r){var n=e[Ve];return r===Ve?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):Xi(Kd,r)?Kd[r]:e[r]},set:function(e,r,n){var i=e[Ve];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?e[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){Je(15)}},t1=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 bc(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 Sc(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}),Ec(this,n)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&Je("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_&&Je(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&h6(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=wm),In(this)){var u=jn(this,{object:this.proxy_,type:$_,index:n,removedCount:i,added:a});if(!u)return wm;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(_){return o.enhancer_(_,void 0)}),this.legacyMode_){var f=a.length-i;this.updateArrayLength_(l,f)}var v=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,v),this.dehanceValues_(v)},e.spliceItemsIntoValues_=function(n,i,a){if(a.length<Z7){var o;return(o=this.values_).splice.apply(o,[n,i].concat(a))}else{var l=this.values_.slice(n,n+i),u=this.values_.slice(n+i);this.values_.length+=a.length-i;for(var f=0;f<a.length;f++)this.values_[n+f]=a[f];for(var v=0;v<u.length;v++)this.values_[n+a.length+v]=u[v];return l}},e.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&Lu(),l=ni(this),u=l||o?{observableKind:"array",object:this.proxy_,type:Ci,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&ii(this,u)},e.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&Lu(),l=ni(this),u=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:$_,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&ii(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&&Je(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(In(this)){var l=jn(this,{type:Ci,object:this.proxy_,index:n,newValue:i});if(!l)return;i=l.newValue}i=this.enhancer_(i,o);var u=i!==o;u&&(a[n]=i,this.notifyArrayChildUpdate_(n,i,o))}else{for(var f=new Array(n+1-a.length),v=0;v<f.length-1;v++)f[v]=void 0;f[f.length-1]=i,this.spliceWithArray_(a.length,0,f)}},t}();function ek(t,e,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),sS(),no(function(){var i=new t1(r,e,n,!1);fS(i.values_,Ve,i);var a=new Proxy(i.values_,J7);return i.proxy_=a,t&&t.length&&i.spliceWithArray_(0,0,t),a})}var Kd={clear:function(){return this.splice(0)},replace:function(e){var r=this[Ve];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[Ve];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[Ve].spliceWithArray_(e,r,n)},push:function(){for(var e=this[Ve],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[Ve].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[Ve],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 ke.trackingDerivation&&Je(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){ke.trackingDerivation&&Je(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var r=this[Ve],n=r.dehanceValues_(r.values_).indexOf(e);return n>-1?(this.splice(n,1),!0):!1}};Nt("at",En);Nt("concat",En);Nt("flat",En);Nt("includes",En);Nt("indexOf",En);Nt("join",En);Nt("lastIndexOf",En);Nt("slice",En);Nt("toString",En);Nt("toLocaleString",En);Nt("toSorted",En);Nt("toSpliced",En);Nt("with",En);Nt("every",si);Nt("filter",si);Nt("find",si);Nt("findIndex",si);Nt("findLast",si);Nt("findLastIndex",si);Nt("flatMap",si);Nt("forEach",si);Nt("map",si);Nt("some",si);Nt("toReversed",si);Nt("reduce",a6);Nt("reduceRight",a6);function Nt(t,e){typeof Array.prototype[t]=="function"&&(Kd[t]=e(t))}function En(t){return function(){var e=this[Ve];e.atom_.reportObserved();var r=e.dehanceValues_(e.values_);return r[t].apply(r,arguments)}}function si(t){return function(e,r){var n=this,i=this[Ve];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[t](function(o,l){return e.call(r,o,l,n)})}}function a6(t){return function(){var e=this,r=this[Ve];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 tk=ro("ObservableArrayAdministration",t1);function Wr(t){return xh(t)&&tk(t[Ve])}var o6,l6,rk={},ja="add",Xd="delete";o6=Symbol.iterator;l6=Symbol.toStringTag;var Ih=function(){function t(r,n,i){var a=this;n===void 0&&(n=$o),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ve]=rk,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,bn(Map)||Je(18),no(function(){a.keysAtom_=ec("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(!ke.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var o=a=new qa(this.has_(n),Ph,"ObservableMap.key?",!1);this.hasMap_.set(n,o),Yy(o,function(){return i.hasMap_.delete(n)})}return a.get()},e.set=function(n,i){var a=this.has_(n);if(In(this)){var o=jn(this,{type:a?Ci:ja,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_,In(this)){var a=jn(this,{type:Xd,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=Lu(),l=ni(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Xd,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return Oi(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var v=i.data_.get(n);v.setNewValue_(void 0),i.data_.delete(n)}),l&&ii(this,u),!0}return!1},e.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==ke.UNCHANGED){var o=Lu(),l=ni(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Ci,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&ii(this,u)}},e.addValue_=function(n,i){var a=this;this.keysAtom_,Oi(function(){var f,v=new qa(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,v),i=v.value_,(f=a.hasMap_.get(n))==null||f.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Lu(),l=ni(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:ja,object:this,name:n,newValue:i}:null;l&&ii(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 rc({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 rc({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:[u,n.get(u)]}}})},e[o6]=function(){return this.entries()},e.forEach=function(n,i){for(var a=Xl(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)),Oi(function(){ia(n)?fP(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)}):Cs(n)?(n.constructor!==Map&&Je(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&Je(20,n)}),this},e.clear=function(){var n=this;Oi(function(){$y(function(){for(var i=Xl(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},e.replace=function(n){var i=this;return Oi(function(){for(var a=nk(n),o=new Map,l=!1,u=Xl(i.data_.keys()),f;!(f=u()).done;){var v=f.value;if(!a.has(v)){var _=i.delete(v);if(_)l=!0;else{var g=i.data_.get(v);o.set(v,g)}}}for(var h=Xl(a.entries()),w;!(w=h()).done;){var E=w.value,S=E[0],b=E[1],p=i.data_.has(S);if(i.set(S,b),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 m=i.data_.keys(),y=o.keys(),x=m.next(),P=y.next();!x.done;){if(x.value!==P.value){i.keysAtom_.reportChanged();break}x=m.next(),P=y.next()}i.data_=o}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(n,i){return Ec(this,n)},e.intercept_=function(n){return Sc(this,n)},Uy(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:l6,get:function(){return"Map"}}]),t}(),Pr=ro("ObservableMap",Ih);function nk(t){if(Cs(t)||Pr(t))return t;if(Array.isArray(t))return new Map(t);if(ia(t)){var e=new Map;for(var r in t)e.set(r,t[r]);return e}else return Je(21,t)}var s6,u6,ik={};s6=Symbol.iterator;u6=Symbol.toStringTag;var r1=function(){function t(r,n,i){var a=this;n===void 0&&(n=$o),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Ve]=ik,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,bn(Set)||Je(22),this.enhancer_=function(o,l){return n(o,l,i)},no(function(){a.atom_=ec(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;Oi(function(){$y(function(){for(var i=Xl(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},e.forEach=function(n,i){for(var a=Xl(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_,In(this)){var a=jn(this,{type:ja,object:this,newValue:n});if(!a)return this}if(!this.has(n)){Oi(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,l=ni(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:ja,object:this,newValue:n}:null;l&&ii(this,u)}return this},e.delete=function(n){var i=this;if(In(this)){var a=jn(this,{type:Xd,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,l=ni(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:Xd,object:this,oldValue:n}:null;return Oi(function(){i.atom_.reportChanged(),i.data_.delete(n)}),l&&ii(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 rc({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 rc({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)),Oi(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):mc(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&Je("Cannot initialize set from "+n)}),this},e.observe_=function(n,i){return Ec(this,n)},e.intercept_=function(n){return Sc(this,n)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[s6]=function(){return this.values()},Uy(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:u6,get:function(){return"Set"}}]),t}(),Vr=ro("ObservableSet",r1),W_=Object.create(null),Y_="remove",c6=function(){function t(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=qP),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 bc("ObservableObject.keys"),this.isPlainObject_=ia(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 hs)return a.set(i),!0;if(In(this)){var o=jn(this,{type:Ci,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==ke.UNCHANGED){var l=ni(this),u=!1,f=l||u?{type:Ci,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&ii(this,f)}return!0},e.get_=function(n){return ke.trackingDerivation&&!Xi(this.target_,n)&&this.has_(n),this.target_[n]},e.set_=function(n,i,a){return a===void 0&&(a=!1),Xi(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(!ke.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new qa(n in this.target_,Ph,"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_[Pi])!=null&&a[n])return;Je(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==gc;){var l=Vd(o,n);if(l){var u=i.make_(this,n,l,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}X_(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&&X_(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(In(this)){var l=jn(this,{object:this.proxy_||this.target_,name:n,type:ja,newValue:i.value});if(!l)return null;var u=l.newValue;i.value!==u&&(i=Ka({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Ti(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(In(this)){var u=jn(this,{object:this.proxy_||this.target_,name:n,type:ja,newValue:i});if(!u)return null;i=u.newValue}var f=K_(n),v={configurable:ke.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(o){if(!Reflect.defineProperty(this.target_,n,v))return!1}else Ti(this.target_,n,v);var _=new qa(i,a,"ObservableObject.key",!1);this.values_.set(n,_),this.notifyPropertyAddition_(n,_.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(In(this)){var l=jn(this,{object:this.proxy_||this.target_,name:n,type:ja,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=K_(n),f={configurable:ke.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,n,f))return!1}else Ti(this.target_,n,f);this.values_.set(n,new hs(i)),this.notifyPropertyAddition_(n,void 0)}finally{an()}return!0},e.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!Xi(this.target_,n))return!0;if(In(this)){var a=jn(this,{object:this.proxy_||this.target_,name:n,type:Y_});if(!a)return null}try{var o,l;nn();var u=ni(this),f=!1,v=this.values_.get(n),_=void 0;if(!v&&(u||f)){var g;_=(g=Vd(this.target_,n))==null?void 0:g.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(v&&(this.values_.delete(n),v instanceof qa&&(_=v.value_),jS(v)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(l=o.get(n))==null||l.set(n in this.target_),u||f){var h={type:Y_,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:_,name:n};u&&ii(this,h)}}finally{an()}return!0},e.observe_=function(n,i){return Ec(this,n)},e.intercept_=function(n){return Sc(this,n)},e.notifyPropertyAddition_=function(n,i){var a,o,l=ni(this),u=!1;if(l||u){var f=l||u?{type:ja,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;l&&ii(this,f)}(a=this.pendingKeys_)==null||(o=a.get(n))==null||o.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),ds(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function tl(t,e){var r;if(Xi(t,Ve))return t;var n=(r=e==null?void 0:e.name)!=null?r:"ObservableObject",i=new c6(t,new Map,String(n),r7(e));return vc(t,Ve,i),t}var ak=ro("ObservableObjectAdministration",c6);function K_(t){return W_[t]||(W_[t]={get:function(){return this[Ve].getObservablePropValue_(t)},set:function(r){return this[Ve].setObservablePropValue_(t,r)}})}function br(t){return xh(t)?ak(t[Ve]):!1}function X_(t,e,r){var n;(n=t.target_[Pi])==null||delete n[r]}var ok=d6(0),lk=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1}(),Ov=0,f6=function(){};function sk(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):t.prototype.__proto__!==void 0?t.prototype.__proto__=e:t.prototype=e}sk(f6,Array.prototype);var n1=function(t,e,r){pS(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,no(function(){var v=new t1(l,o,u,!0);v.proxy_=wv(f),fS(wv(f),Ve,v),a&&a.length&&f.spliceWithArray(0,0,a),lk&&Object.defineProperty(wv(f),"0",ok)}),f}var i=n.prototype;return i.concat=function(){this[Ve].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 rc({next:function(){return o<a.length?{value:a[o++],done:!1}:{done:!0,value:void 0}}})},Uy(n,[{key:"length",get:function(){return this[Ve].getArrayLength_()},set:function(o){this[Ve].setArrayLength_(o)}},{key:e,get:function(){return"Array"}}]),n}(f6,Symbol.toStringTag,Symbol.iterator);Object.entries(Kd).forEach(function(t){var e=t[0],r=t[1];e!=="concat"&&vc(n1.prototype,e,r)});function d6(t){return{enumerable:!1,configurable:!0,get:function(){return this[Ve].get_(t)},set:function(r){this[Ve].set_(t,r)}}}function uk(t){Ti(n1.prototype,""+t,d6(t))}function h6(t){if(t>Ov){for(var e=Ov;e<t+100;e++)uk(e);Ov=t}}h6(1e3);function ck(t,e,r){return new n1(t,e,r)}function Ri(t,e){if(typeof t=="object"&&t!==null){if(Wr(t))return e!==void 0&&Je(23),t[Ve].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||Je(25,e,Qd(t)),r}if(br(t)){if(!e)return Je(26);var n=t[Ve].values_.get(e);return n||Je(27,e,Qd(t)),n}if(Gy(t)||Wo(t)||Yd(t))return t}else if(bn(t)&&Yd(t[Ve]))return t[Ve];Je(28)}function li(t,e){if(t||Je(29),e!==void 0)return li(Ri(t,e));if(Gy(t)||Wo(t)||Yd(t)||Pr(t)||Vr(t))return t;if(t[Ve])return t[Ve];Je(24,t)}function Qd(t,e){var r;if(e!==void 0)r=Ri(t,e);else{if(wc(t))return t.name;br(t)||Pr(t)||Vr(t)?r=li(t):r=Ri(t)}return r.name_}function no(t){var e=el(),r=Ah(!0);nn();try{return t()}finally{an(),Th(r),Qi(e)}}var Q_=gc.toString;function i1(t,e,r){return r===void 0&&(r=-1),Rm(t,e,r)}function Rm(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=Q_.call(t);if(o!==Q_.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=Z_(t),e=Z_(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&&!(bn(u)&&u instanceof u&&bn(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 v=n.length;v--;)if(n[v]===t)return i[v]===e;if(n.push(t),i.push(e),l){if(v=t.length,v!==e.length)return!1;for(;v--;)if(!Rm(t[v],e[v],r-1,n,i))return!1}else{var _=Object.keys(t),g;if(v=_.length,Object.keys(e).length!==v)return!1;for(;v--;)if(g=_[v],!(Xi(e,g)&&Rm(t[g],e[g],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function Z_(t){return Wr(t)?t.slice():Cs(t)||Pr(t)||mc(t)||Vr(t)?Array.from(t.entries()):t}function rc(t){return t[Symbol.iterator]=fk,t}function fk(){return this}["Symbol","Map","Set"].forEach(function(t){var e=zy();typeof e[t]>"u"&&Je("MobX requires global '"+t+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:FS,extras:{getDebugName:Qd},$mobx:Ve});const dk=Object.freeze(Object.defineProperty({__proto__:null,$mobx:Ve,FlowCancellationError:Rh,ObservableMap:Ih,ObservableSet:r1,Reaction:ps,_allowStateChanges:Vy,_allowStateChangesInsideComputed:vs,_allowStateReadsEnd:is,_allowStateReadsStart:Ch,_autoAction:gs,_endAction:PS,_getAdministration:li,_getGlobalState:NS,_interceptReads:Xy,_isComputingDerivation:u7,_resetGlobalState:h7,_startAction:xS,action:nr,autorun:Wy,comparer:qo,computed:Jo,configure:WS,createAtom:ec,defineProperty:Jy,entries:t6,extendObservable:Ky,flow:Yo,flowResult:F7,get:H7,getAtom:Ri,getDebugName:Qd,getDependencyTree:YS,getObserverTree:M7,has:r6,intercept:Nh,isAction:wc,isBoxedObservable:qy,isComputed:U7,isComputedProp:ZS,isFlow:ms,isFlowCancellationError:j7,isObservable:Mh,isObservableArray:Wr,isObservableMap:Pr,isObservableObject:br,isObservableProp:e6,isObservableSet:Vr,keys:tc,makeAutoObservable:Q7,makeObservable:e1,observable:kt,observe:Lh,onBecomeObserved:qS,onBecomeUnobserved:Yy,onReactionError:b7,override:EP,ownKeys:n6,reaction:VS,remove:G7,runInAction:vs,set:Zy,spy:FS,toJS:$7,trace:W7,transaction:Oi,untracked:$y,values:Qy,when:Cm},Symbol.toStringTag,{value:"Module"}));if(!at.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!e1)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function hk(t){t()}function p6(t){t||(t=hk),WS({reactionScheduler:t})}var pk=function(){return!0};function gk(t){return YS(t)}var g6=!1;function v6(t){g6=t}function a1(){return g6}var vk=1e4,mk=1e4,yk=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=vk),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,mk))}}),t}(),bk=typeof FinalizationRegistry<"u"?FinalizationRegistry:yk,Zd=new bk(function(t){var e;(e=t.reaction)===null||e===void 0||e.dispose(),t.reaction=null}),m6={exports:{}},y6={};/**
|
|
35
|
+
* @license React
|
|
36
|
+
* use-sync-external-store-shim.production.min.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var ys=at;function _k(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var wk=typeof Object.is=="function"?Object.is:_k,Sk=ys.useState,Ek=ys.useEffect,Ok=ys.useLayoutEffect,xk=ys.useDebugValue;function Pk(t,e){var r=e(),n=Sk({inst:{value:r,getSnapshot:e}}),i=n[0].inst,a=n[1];return Ok(function(){i.value=r,i.getSnapshot=e,xv(i)&&a({inst:i})},[t,r,e]),Ek(function(){return xv(i)&&a({inst:i}),t(function(){xv(i)&&a({inst:i})})},[t]),xk(r),r}function xv(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!wk(t,r)}catch{return!0}}function kk(t,e){return e()}var Ak=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?kk:Pk;y6.useSyncExternalStore=ys.useSyncExternalStore!==void 0?ys.useSyncExternalStore:Ak;m6.exports=y6;var Tk=m6.exports,Ck=function(){};function J_(t){t.reaction=new ps("observer".concat(t.name),function(){var e;t.stateVersion=Symbol(),(e=t.onStoreChange)===null||e===void 0||e.call(t)})}function o1(t,e){if(e===void 0&&(e="observed"),a1())return t();var r=ft.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:e,subscribe:function(l){return Zd.unregister(n),n.onStoreChange=l,n.reaction||(J_(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||(J_(i),Zd.register(r,i,i)),ft.useDebugValue(i.reaction,gk),Tk.useSyncExternalStore(i.subscribe,i.getSnapshot,Ck);var a,o;if(i.reaction.track(function(){try{a=t()}catch(l){o=l}}),o)throw o;return a}var b6=typeof Symbol=="function"&&Symbol.for,ew=b6?Symbol.for("react.forward_ref"):typeof at.forwardRef=="function"&&at.forwardRef(function(t){return null}).$$typeof,tw=b6?Symbol.for("react.memo"):typeof at.memo=="function"&&at.memo(function(t){return null}).$$typeof;function Rk(t,e){var r;if(tw&&t.$$typeof===tw)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(a1())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(ew&&t.$$typeof===ew&&(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 o1(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),Mk(t,o),o}var Nk={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function Mk(t,e){Object.keys(t).forEach(function(r){Nk[r]||Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}function _6(t){var e=t.children,r=t.render,n=e||r;return typeof n!="function"?null:o1(n)}_6.displayName="Observer";function Lk(t,e){return at.useState(function(){return kt(t(),e,{autoBind:!0})})[0]}var Ik=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 w6(t){var e=Ik(at.useState(function(){return kt(t,{},{deep:!1})}),1),r=e[0];return vs(function(){Object.assign(r,t)}),r}function jk(t,e){var r=e&&w6(e);return at.useState(function(){return kt(t(r),void 0,{autoBind:!0})})[0]}var Pv;p6(aS.unstable_batchedUpdates);var Dk=(Pv=Zd.finalizeAllImmediately)!==null&&Pv!==void 0?Pv:function(){};function Fk(t,e){return e===void 0&&(e="observed"),o1(t,e)}function zk(t){v6(t)}const Bk=Object.freeze(Object.defineProperty({__proto__:null,Observer:_6,_observerFinalizationRegistry:Zd,clearTimers:Dk,enableStaticRendering:v6,isObserverBatched:pk,isUsingStaticRendering:a1,observer:Rk,observerBatching:p6,useAsObservableSource:w6,useLocalObservable:Lk,useLocalStore:jk,useObserver:Fk,useStaticRendering:zk},Symbol.toStringTag,{value:"Module"})),Ni=Za(Bk);var S6={};const sa=Za(dk);var l1={exports:{}},jh={},Jd={},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 me<"u"?me:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},t.Konva={_global:t.glob,version:"9.2.3",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 Yt={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Util=t.Transform=void 0;const e=lt;class r{constructor(m=[1,0,0,1,0,0]){this.dirty=!1,this.m=m&&m.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new r(this.m)}copyInto(m){m.m[0]=this.m[0],m.m[1]=this.m[1],m.m[2]=this.m[2],m.m[3]=this.m[3],m.m[4]=this.m[4],m.m[5]=this.m[5]}point(m){var y=this.m;return{x:y[0]*m.x+y[2]*m.y+y[4],y:y[1]*m.x+y[3]*m.y+y[5]}}translate(m,y){return this.m[4]+=this.m[0]*m+this.m[2]*y,this.m[5]+=this.m[1]*m+this.m[3]*y,this}scale(m,y){return this.m[0]*=m,this.m[1]*=m,this.m[2]*=y,this.m[3]*=y,this}rotate(m){var y=Math.cos(m),x=Math.sin(m),P=this.m[0]*y+this.m[2]*x,O=this.m[1]*y+this.m[3]*x,N=this.m[0]*-x+this.m[2]*y,T=this.m[1]*-x+this.m[3]*y;return this.m[0]=P,this.m[1]=O,this.m[2]=N,this.m[3]=T,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(m,y){var x=this.m[0]+this.m[2]*y,P=this.m[1]+this.m[3]*y,O=this.m[2]+this.m[0]*m,N=this.m[3]+this.m[1]*m;return this.m[0]=x,this.m[1]=P,this.m[2]=O,this.m[3]=N,this}multiply(m){var y=this.m[0]*m.m[0]+this.m[2]*m.m[1],x=this.m[1]*m.m[0]+this.m[3]*m.m[1],P=this.m[0]*m.m[2]+this.m[2]*m.m[3],O=this.m[1]*m.m[2]+this.m[3]*m.m[3],N=this.m[0]*m.m[4]+this.m[2]*m.m[5]+this.m[4],T=this.m[1]*m.m[4]+this.m[3]*m.m[5]+this.m[5];return this.m[0]=y,this.m[1]=x,this.m[2]=P,this.m[3]=O,this.m[4]=N,this.m[5]=T,this}invert(){var m=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),y=this.m[3]*m,x=-this.m[1]*m,P=-this.m[2]*m,O=this.m[0]*m,N=m*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),T=m*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=y,this.m[1]=x,this.m[2]=P,this.m[3]=O,this.m[4]=N,this.m[5]=T,this}getMatrix(){return this.m}decompose(){var m=this.m[0],y=this.m[1],x=this.m[2],P=this.m[3],O=this.m[4],N=this.m[5],T=m*P-y*x;let R={x:O,y:N,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(m!=0||y!=0){var M=Math.sqrt(m*m+y*y);R.rotation=y>0?Math.acos(m/M):-Math.acos(m/M),R.scaleX=M,R.scaleY=T/M,R.skewX=(m*x+y*P)/T,R.skewY=0}else if(x!=0||P!=0){var D=Math.sqrt(x*x+P*P);R.rotation=Math.PI/2-(P>0?Math.acos(-x/D):-Math.acos(x/D)),R.scaleX=T/D,R.scaleY=D,R.skewX=0,R.skewY=(m*x+y*P)/T}return R.rotation=t.Util._getRotation(R.rotation),R}}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="#",v="",_="0",g="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})\)/,b=[];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 m=d[0];return m==="#"||m==="."||m===m.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){b.push(d),b.length===1&&p(function(){const m=b;b=[],m.forEach(function(y){y()})})},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,m){var y=t.Util.createImageElement();y.onload=function(){m(y)},y.src=d},_rgbToHex(d,m,y){return((1<<24)+(d<<16)+(m<<8)+y).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,v);var m=parseInt(d,16);return{r:m>>16&255,g:m>>8&255,b:m&255}},getRandomColor(){for(var d=(Math.random()*16777215<<0).toString(16);d.length<6;)d=_+d;return f+d},getRGB(d){var m;return d in E?(m=E[d],{r:m[0],g:m[1],b:m[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===w?(m=S.exec(d.replace(/ /g,"")),{r:parseInt(m[1],10),g:parseInt(m[2],10),b:parseInt(m[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 m=E[d.toLowerCase()];return m?{r:m[0],g:m[1],b:m[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];var m=d.split(/ *, */).map(Number);return{r:m[0],g:m[1],b:m[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];var m=d.split(/ *, */).map((y,x)=>y.slice(-1)==="%"?x===3?parseInt(y)/100:parseInt(y)/100*255:Number(y));return{r:m[0],g:m[1],b:m[2],a:m[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[m,...y]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),x=Number(y[0])/360,P=Number(y[1])/100,O=Number(y[2])/100;let N,T,R;if(P===0)return R=O*255,{r:Math.round(R),g:Math.round(R),b:Math.round(R),a:1};O<.5?N=O*(1+P):N=O+P-O*P;const M=2*O-N,D=[0,0,0];for(let G=0;G<3;G++)T=x+1/3*-(G-1),T<0&&T++,T>1&&T--,6*T<1?R=M+(N-M)*6*T:2*T<1?R=N:3*T<2?R=M+(N-M)*(2/3-T)*6:R=M,D[G]=R*255;return{r:Math.round(D[0]),g:Math.round(D[1]),b:Math.round(D[2]),a:1}}},haveIntersection(d,m){return!(m.x>d.x+d.width||m.x+m.width<d.x||m.y>d.y+d.height||m.y+m.height<d.y)},cloneObject(d){var m={};for(var y in d)this._isPlainObject(d[y])?m[y]=this.cloneObject(d[y]):this._isArray(d[y])?m[y]=this.cloneArray(d[y]):m[y]=d[y];return m},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(g+d)},each(d,m){for(var y in d)m(y,d[y])},_inRange(d,m,y){return m<=d&&d<y},_getProjectionToSegment(d,m,y,x,P,O){var N,T,R,M=(d-y)*(d-y)+(m-x)*(m-x);if(M==0)N=d,T=m,R=(P-y)*(P-y)+(O-x)*(O-x);else{var D=((P-d)*(y-d)+(O-m)*(x-m))/M;D<0?(N=d,T=m,R=(d-P)*(d-P)+(m-O)*(m-O)):D>1?(N=y,T=x,R=(y-P)*(y-P)+(x-O)*(x-O)):(N=d+D*(y-d),T=m+D*(x-m),R=(N-P)*(N-P)+(T-O)*(T-O))}return[N,T,R]},_getProjectionToLine(d,m,y){var x=t.Util.cloneObject(d),P=Number.MAX_VALUE;return m.forEach(function(O,N){if(!(!y&&N===m.length-1)){var T=m[(N+1)%m.length],R=t.Util._getProjectionToSegment(O.x,O.y,T.x,T.y,d.x,d.y),M=R[0],D=R[1],G=R[2];G<P&&(x.x=M,x.y=D,P=G)}}),x},_prepareArrayForTween(d,m,y){var x,P=[],O=[];if(d.length>m.length){var N=m;m=d,d=N}for(x=0;x<d.length;x+=2)P.push({x:d[x],y:d[x+1]});for(x=0;x<m.length;x+=2)O.push({x:m[x],y:m[x+1]});var T=[];return O.forEach(function(R){var M=t.Util._getProjectionToLine(R,P,y);T.push(M.x),T.push(M.y)}),T},_prepareToStringify(d){var m;d.visitedByCircularReferenceRemoval=!0;for(var y in d)if(d.hasOwnProperty(y)&&d[y]&&typeof d[y]=="object"){if(m=Object.getOwnPropertyDescriptor(d,y),d[y].visitedByCircularReferenceRemoval||t.Util._isElement(d[y]))if(m.configurable)delete d[y];else return null;else if(t.Util._prepareToStringify(d[y])===null)if(m.configurable)delete d[y];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,m){for(var y in m)d[y]=m[y];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){e.Konva.releaseCanvasOnDestroy&&d.forEach(m=>{m.width=0,m.height=0})},drawRoundedRectPath(d,m,y,x){let P=0,O=0,N=0,T=0;typeof x=="number"?P=O=N=T=Math.min(x,m/2,y/2):(P=Math.min(x[0]||0,m/2,y/2),O=Math.min(x[1]||0,m/2,y/2),T=Math.min(x[2]||0,m/2,y/2),N=Math.min(x[3]||0,m/2,y/2)),d.moveTo(P,0),d.lineTo(m-O,0),d.arc(m-O,O,O,Math.PI*3/2,0,!1),d.lineTo(m,y-T),d.arc(m-T,y-T,T,0,Math.PI/2,!1),d.lineTo(N,y),d.arc(N,y-N,N,Math.PI/2,Math.PI,!1),d.lineTo(0,P),d.arc(P,P,P,Math.PI,Math.PI*3/2,!1)}}})(Yt);var Gt={},st={},He={};Object.defineProperty(He,"__esModule",{value:!0});He.getComponentValidator=He.getBooleanValidator=He.getNumberArrayValidator=He.getFunctionValidator=He.getStringOrGradientValidator=He.getStringValidator=He.getNumberOrAutoValidator=He.getNumberOrArrayOfNumbersValidator=He.getNumberValidator=He.alphaComponent=He.RGBComponent=void 0;const ua=lt,Xt=Yt;function ca(t){return Xt.Util._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||Xt.Util._isBoolean(t)?t:Object.prototype.toString.call(t)}function Uk(t){return t>255?255:t<0?0:Math.round(t)}He.RGBComponent=Uk;function Gk(t){return t>1?1:t<1e-4?1e-4:t}He.alphaComponent=Gk;function Hk(){if(ua.Konva.isUnminified)return function(t,e){return Xt.Util._isNumber(t)||Xt.Util.warn(ca(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}He.getNumberValidator=Hk;function Vk(t){if(ua.Konva.isUnminified)return function(e,r){let n=Xt.Util._isNumber(e),i=Xt.Util._isArray(e)&&e.length==t;return!n&&!i&&Xt.Util.warn(ca(e)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+t+")"),e}}He.getNumberOrArrayOfNumbersValidator=Vk;function qk(){if(ua.Konva.isUnminified)return function(t,e){var r=Xt.Util._isNumber(t),n=t==="auto";return r||n||Xt.Util.warn(ca(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}He.getNumberOrAutoValidator=qk;function $k(){if(ua.Konva.isUnminified)return function(t,e){return Xt.Util._isString(t)||Xt.Util.warn(ca(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}He.getStringValidator=$k;function Wk(){if(ua.Konva.isUnminified)return function(t,e){const r=Xt.Util._isString(t),n=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return r||n||Xt.Util.warn(ca(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}He.getStringOrGradientValidator=Wk;function Yk(){if(ua.Konva.isUnminified)return function(t,e){return Xt.Util._isFunction(t)||Xt.Util.warn(ca(t)+' is a not valid value for "'+e+'" attribute. The value should be a function.'),t}}He.getFunctionValidator=Yk;function Kk(){if(ua.Konva.isUnminified)return function(t,e){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&t instanceof r||(Xt.Util._isArray(t)?t.forEach(function(n){Xt.Util._isNumber(n)||Xt.Util.warn('"'+e+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):Xt.Util.warn(ca(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}He.getNumberArrayValidator=Kk;function Xk(){if(ua.Konva.isUnminified)return function(t,e){var r=t===!0||t===!1;return r||Xt.Util.warn(ca(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}He.getBooleanValidator=Xk;function Qk(t){if(ua.Konva.isUnminified)return function(e,r){return e==null||Xt.Util.isObject(e)||Xt.Util.warn(ca(e)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+t),e}}He.getComponentValidator=Qk;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Factory=void 0;const e=Yt,r=He;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(v){return l&&v!==void 0&&v!==null&&(v=l.call(this,v,o)),this._setAttr(o,v),u&&u.call(this),this}},addComponentsGetterSetter(a,o,l,u,f){var v=l.length,_=e.Util._capitalize,g=n+_(o),h=i+_(o),w,E;a.prototype[g]=function(){var b={};for(w=0;w<v;w++)E=l[w],b[E]=this.getAttr(o+_(E));return b};var S=(0,r.getComponentValidator)(l);a.prototype[h]=function(b){var p=this.attrs[o],d;u&&(b=u.call(this,b)),S&&S.call(this,b,o);for(d in b)b.hasOwnProperty(d)&&this._setAttr(o+_(d),b[d]);return b||l.forEach(m=>{this._setAttr(o+_(m),void 0)}),this._fireChangeEvent(o,p,b),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),v=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[f]=function(){e.Util.error(v);var _=this.attrs[o];return _===void 0?l:_},t.Factory.addSetter(a,o,u,function(){e.Util.error(v)}),t.Factory.addOverloadedGetterSetter(a,o)},backCompat(a,o){e.Util.each(o,function(l,u){var f=a.prototype[u],v=n+e.Util._capitalize(l),_=i+e.Util._capitalize(l);function g(){f.apply(this,arguments),e.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}a.prototype[l]=g,a.prototype[v]=g,a.prototype[_]=g})},afterSetFilter(){this._filterUpToDate=!1}}})(st);var ai={},Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.HitContext=Zi.SceneContext=Zi.Context=void 0;const E6=Yt,Zk=lt;function Jk(t){var e=[],r=t.length,n=E6.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 rw=",",eA="(",tA=")",rA="([",nA="])",iA=";",aA="()",oA="=",nw=["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"],lA=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const sA=100;class Dh{constructor(e){this.canvas=e,Zk.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+=aA:E6.Util._isArray(f[0])?a+=rA+f.join(rw)+nA:(r&&(f=f.map(v=>typeof v=="number"?Math.floor(v):v)),a+=eA+f.join(rw)+tA)):(a+=l.property,e||(a+=oA+l.val)),a+=iA;return a}clearTrace(){this.traceArr=[]}_trace(e){var r=this.traceArr,n;r.push(e),n=r.length,n>=sA&&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 v=arguments,_=this._context;v.length===3?_.drawImage(e,r,n):v.length===5?_.drawImage(e,r,n,i,a):v.length===9&&_.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=nw.length,n=this.setAttr,i,a,o=function(l){var u=e[l],f;e[l]=function(){return a=Jk(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(nw[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)}}Zi.Context=Dh;lA.forEach(function(t){Object.defineProperty(Dh.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class uA extends Dh{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(),v=u.x*f,_=u.y*f;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(v),Math.abs(_))),this.setAttr("shadowOffsetX",l.x*v),this.setAttr("shadowOffsetY",l.y*_)}}Zi.SceneContext=uA;class cA extends Dh{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()}}}Zi.HitContext=cA;Object.defineProperty(ai,"__esModule",{value:!0});ai.HitCanvas=ai.SceneCanvas=ai.Canvas=void 0;const eh=Yt,O6=Zi,x6=lt,fA=st,dA=He;var Kf;function hA(){if(Kf)return Kf;var t=eh.Util.createCanvasElement(),e=t.getContext("2d");return Kf=function(){var r=x6.Konva._global.devicePixelRatio||1,n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return r/n}(),eh.Util.releaseCanvas(t),Kf}class Fh{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var r=e||{},n=r.pixelRatio||x6.Konva.pixelRatio||hA();this.pixelRatio=n,this._canvas=eh.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 eh.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}ai.Canvas=Fh;fA.Factory.addGetterSetter(Fh,"pixelRatio",void 0,(0,dA.getNumberValidator)());class pA extends Fh{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new O6.SceneContext(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}ai.SceneCanvas=pA;class gA extends Fh{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new O6.HitContext(this),this.setSize(e.width,e.height)}}ai.HitCanvas=gA;var zh={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DD=void 0;const e=lt,r=Yt;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(g=>g.id===a.pointerId);if(f){if(a.dragStatus!=="dragging"){var v=l.dragDistance(),_=Math.max(Math.abs(f.x-a.startPointerPos.x),Math.abs(f.y-a.startPointerPos.y));if(_<v||(l.startDrag({evt:n}),!l.isDragging()))return}l._setDragPosition(n,a),i.push(l)}}),i.forEach(a=>{a.fire("dragmove",{type:"dragmove",target:a,evt:n},!0)})},_endDragBefore(n){const i=[];t.DD._dragElements.forEach(a=>{const{node:o}=a,l=o.getStage();if(n&&l.setPointersPositions(n),!l._changedPointerPositions.find(v=>v.id===a.pointerId))return;(a.dragStatus==="dragging"||a.dragStatus==="stopped")&&(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))})(zh);Object.defineProperty(Gt,"__esModule",{value:!0});Gt.Node=void 0;const ct=Yt,Oc=st,Xf=ai,xo=lt,Nn=zh,er=He;var md="absoluteOpacity",Qf="allEventListeners",Vi="absoluteTransform",iw="absoluteScale",Po="canvas",vA="Change",mA="children",yA="konva",Nm="listening",aw="mouseenter",ow="mouseleave",lw="set",sw="Shape",yd=" ",uw="stage",Aa="transform",bA="Stage",Mm="visible",_A=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(yd);let wA=1,it=class Lm{constructor(e){this._id=wA++,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===Vi)&&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===Vi,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(yd);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(Po)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===Vi&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Po)){const{scene:e,filter:r,hit:n}=this._cache.get(Po);ct.Util.releaseCanvas(e,r,n),this._cache.delete(Po)}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,v=r.drawBorder||!1,_=r.hitCanvasPixelRatio||1;if(!i||!a){ct.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 g=new Xf.SceneCanvas({pixelRatio:o,width:i,height:a}),h=new Xf.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),w=new Xf.HitCanvas({pixelRatio:_,width:i,height:a}),E=g.getContext(),S=w.getContext();return w.isCache=!0,g.isCache=!0,this._cache.delete(Po),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(g.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(md),this._clearSelfAndDescendantCache(iw),this.drawScene(g,this),this.drawHit(w,this),this._isUnderCache=!1,E.restore(),S.restore(),v&&(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(Po,{scene:g,filter:h,hit:w,x:l,y:u}),this._requestDraw(),this}isCached(){return this._cache.has(Po)}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 v=u.point(f);i===void 0&&(i=o=v.x,a=l=v.y),i=Math.min(i,v.x),a=Math.min(a,v.y),o=Math.max(o,v.x),l=Math.max(l,v.y)}),{x:i,y:a,width:o-i,height:l-a}}_drawCachedSceneCanvas(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 v=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()/v,n.getHeight()/v),l=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++){if(f=e[u],typeof f!="function"){ct.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(_){ct.Util.error("Unable to apply filter. "+_.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(Qf),arguments.length===3)return this._delegate.apply(this,arguments);var n=e.split(yd),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(yd),i=n.length,a,o,l,u,f,v;if(this._cache&&this._cache.delete(Qf),!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],v=u[1],f)this.eventListeners[f]&&this._off(f,v,r);else for(o in this.eventListeners)this._off(o,v,r);return this}dispatchEvent(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=ct.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(Vi),this._clearSelfAndDescendantCache(md),this._clearSelfAndDescendantCache(iw),this._clearSelfAndDescendantCache(uw),this._clearSelfAndDescendantCache(Mm),this._clearSelfAndDescendantCache(Nm)}_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"+ct.Util._capitalize(e);return ct.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!==mA&&(n=lw+ct.Util._capitalize(r),ct.Util._isFunction(this[n])?this[n](e[r]):this._setAttr(r,e[r]))}),this}isListening(){return this._getCache(Nm,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(Mm,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&&!xo.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(v){for(i=[],a=v.length,o=0;o<a;o++)l=v[o],n++,l.nodeType!==sw&&(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!==bA&&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(Vi)),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 ct.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(Vi),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 ct.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 ct.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 ct.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 ct.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 ct.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&ct.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(md,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=ct.Util.isObject(i)&&!ct.Util._isPlainObject(i)&&!ct.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(),ct.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],ct.Util.isValidSelector(a)||(ct.Util.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),ct.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),ct.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(uw,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(Vi,this._getAbsoluteTransform)}_getAbsoluteTransform(e){var r;if(e)return r=new ct.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(Vi)||new ct.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 ct.Transform;n.reset();var i=this.x(),a=this.y(),o=xo.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,v=this.attrs.skewY||0,_=this.attrs.offsetX||0,g=this.attrs.offsetY||0;return(i!==0||a!==0)&&n.translate(i,a),o!==0&&n.rotate(o),(f!==0||v!==0)&&n.skew(f,v),(l!==1||u!==1)&&n.scale(l,u),(_!==0||g!==0)&&n.translate(-1*_,-1*g),n.dirty=!1,n}clone(e){var r=ct.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(yA)<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 Xf.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,ct.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():xo.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+vA,{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[lw+ct.Util._capitalize(e)];return ct.Util._isFunction(n)?n.call(this,r):this._setAttr(e,r),this}_requestDraw(){if(xo.Konva.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,r){var n=this.attrs[e];n===r&&!ct.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===sw&&(r.target=this);var i=(e===aw||e===ow)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n);if(!i){this._fire(e,r);var a=(e===aw||e===ow)&&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(Qf))!==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(Qf,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:ct.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||xo.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 ct.Util.haveIntersection(n,this.getClientRect())}static create(e,r){return ct.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,r)}static _createNode(e,r){var n=Lm.prototype.getClassName.call(e),i=e.children,a,o,l;r&&(e.attrs.container=r),xo.Konva[n]||(ct.Util.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=xo.Konva[n];if(a=new u(e.attrs),i)for(o=i.length,l=0;l<o;l++)a.add(Lm._createNode(i[l]));return a}};Gt.Node=it;it.prototype.nodeType="Node";it.prototype._attrsAffectingSize=[];it.prototype.eventListeners={};it.prototype.on.call(it.prototype,_A,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Aa),this._clearSelfAndDescendantCache(Vi)});it.prototype.on.call(it.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(Mm)});it.prototype.on.call(it.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(Nm)});it.prototype.on.call(it.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(md)});const Tt=Oc.Factory.addGetterSetter;Tt(it,"zIndex");Tt(it,"absolutePosition");Tt(it,"position");Tt(it,"x",0,(0,er.getNumberValidator)());Tt(it,"y",0,(0,er.getNumberValidator)());Tt(it,"globalCompositeOperation","source-over",(0,er.getStringValidator)());Tt(it,"opacity",1,(0,er.getNumberValidator)());Tt(it,"name","",(0,er.getStringValidator)());Tt(it,"id","",(0,er.getStringValidator)());Tt(it,"rotation",0,(0,er.getNumberValidator)());Oc.Factory.addComponentsGetterSetter(it,"scale",["x","y"]);Tt(it,"scaleX",1,(0,er.getNumberValidator)());Tt(it,"scaleY",1,(0,er.getNumberValidator)());Oc.Factory.addComponentsGetterSetter(it,"skew",["x","y"]);Tt(it,"skewX",0,(0,er.getNumberValidator)());Tt(it,"skewY",0,(0,er.getNumberValidator)());Oc.Factory.addComponentsGetterSetter(it,"offset",["x","y"]);Tt(it,"offsetX",0,(0,er.getNumberValidator)());Tt(it,"offsetY",0,(0,er.getNumberValidator)());Tt(it,"dragDistance",null,(0,er.getNumberValidator)());Tt(it,"width",0,(0,er.getNumberValidator)());Tt(it,"height",0,(0,er.getNumberValidator)());Tt(it,"listening",!0,(0,er.getBooleanValidator)());Tt(it,"preventDefault",!0,(0,er.getBooleanValidator)());Tt(it,"filters",null,function(t){return this._filterUpToDate=!1,t});Tt(it,"visible",!0,(0,er.getBooleanValidator)());Tt(it,"transformsEnabled","all",(0,er.getStringValidator)());Tt(it,"size");Tt(it,"dragBoundFunc");Tt(it,"draggable",!1,(0,er.getBooleanValidator)());Oc.Factory.backCompat(it,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var rl={};Object.defineProperty(rl,"__esModule",{value:!0});rl.Container=void 0;const Ns=st,kv=Gt,Bh=He;class nl extends kv.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=kv.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=kv.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 v=n===this;if(f){a.save();var _=this.getAbsoluteTransform(n),g=_.getMatrix();a.transform(g[0],g[1],g[2],g[3],g[4],g[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),g=_.copy().invert().getMatrix(),a.transform(g[0],g[1],g[2],g[3],g[4],g[5])}var E=!v&&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},v=this;(r=this.children)===null||r===void 0||r.forEach(function(E){if(E.visible()){var S=E.getClientRect({relativeTo:v,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 _=this.find("Shape"),g=!1,h=0;h<_.length;h++){var w=_[h];if(w._isVisible(this)){g=!0;break}}return g&&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)}}rl.Container=nl;Ns.Factory.addComponentsGetterSetter(nl,"clip",["x","y","width","height"]);Ns.Factory.addGetterSetter(nl,"clipX",void 0,(0,Bh.getNumberValidator)());Ns.Factory.addGetterSetter(nl,"clipY",void 0,(0,Bh.getNumberValidator)());Ns.Factory.addGetterSetter(nl,"clipWidth",void 0,(0,Bh.getNumberValidator)());Ns.Factory.addGetterSetter(nl,"clipHeight",void 0,(0,Bh.getNumberValidator)());Ns.Factory.addGetterSetter(nl,"clipFunc");var P6={},gn={};Object.defineProperty(gn,"__esModule",{value:!0});gn.releaseCapture=gn.setPointerCapture=gn.hasPointerCapture=gn.createEvent=gn.getCapturedShape=void 0;const SA=lt,nc=new Map,k6=SA.Konva._global.PointerEvent!==void 0;function EA(t){return nc.get(t)}gn.getCapturedShape=EA;function s1(t){return{evt:t,pointerId:t.pointerId}}gn.createEvent=s1;function OA(t,e){return nc.get(t)===e}gn.hasPointerCapture=OA;function xA(t,e){A6(t),e.getStage()&&(nc.set(t,e),k6&&e._fire("gotpointercapture",s1(new PointerEvent("gotpointercapture"))))}gn.setPointerCapture=xA;function A6(t,e){const r=nc.get(t);if(!r)return;const n=r.getStage();n&&n.content,nc.delete(t),k6&&r._fire("lostpointercapture",s1(new PointerEvent("lostpointercapture")))}gn.releaseCapture=A6;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Stage=t.stages=void 0;const e=Yt,r=st,n=rl,i=lt,a=ai,o=zh,l=lt,u=gn;var f="Stage",v="string",_="px",g="mouseout",h="mouseleave",w="mouseover",E="mouseenter",S="mousemove",b="mousedown",p="mouseup",d="pointermove",m="pointerdown",y="pointerup",x="pointercancel",P="lostpointercapture",O="pointerout",N="pointerleave",T="pointerover",R="pointerenter",M="contextmenu",D="touchstart",G="touchend",F="touchmove",K="touchcancel",B="wheel",$=5,W=[[E,"_pointerenter"],[b,"_pointerdown"],[S,"_pointermove"],[p,"_pointerup"],[h,"_pointerleave"],[D,"_pointerdown"],[F,"_pointermove"],[G,"_pointerup"],[K,"_pointercancel"],[w,"_pointerover"],[B,"_wheel"],[M,"_contextmenu"],[m,"_pointerdown"],[d,"_pointermove"],[y,"_pointerup"],[x,"_pointercancel"],[P,"_lostpointercapture"]];const C={mouse:{[O]:g,[N]:h,[T]:w,[R]:E,[d]:S,[m]:b,[y]:p,[x]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[O]:"touchout",[N]:"touchleave",[T]:"touchover",[R]:"touchenter",[d]:F,[m]:D,[y]:G,[x]:K,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[O]:O,[N]:N,[T]:T,[R]:R,[d]:d,[m]:m,[y]:y,[x]:x,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},A=q=>q.indexOf("pointer")>=0?"pointer":q.indexOf("touch")>=0?"touch":"mouse",j=q=>{const U=A(q);if(U==="pointer")return i.Konva.pointerEventsEnabled&&C.pointer;if(U==="touch")return C.touch;if(U==="mouse")return C.mouse};function z(q={}){return(q.clipFunc||q.clipWidth||q.clipHeight)&&e.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),q}const H="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 Y extends n.Container{constructor(U){super(z(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",()=>{z(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===v){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(H),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,Z=this.children;return(U.x||U.y)&&Q.translate(-1*U.x,-1*U.y),Z.forEach(function(re){if(re.isVisible()){var ee=re._toKonvaCanvas(U);Q.drawImage(ee._canvas,U.x,U.y,ee.getWidth()/ee.getPixelRatio(),ee.getHeight()/ee.getPixelRatio())}}),X}getIntersection(U){if(!U)return null;var X=this.children,Q=X.length,Z=Q-1,re;for(re=Z;re>=0;re--){const ee=X[re].getIntersection(U);if(ee)return ee}return null}_resizeDOM(){var U=this.width(),X=this.height();this.content&&(this.content.style.width=U+_,this.content.style.height=X+_),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 Z=this.children.length;return Z>$&&e.Util.warn("The stage has "+Z+" 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&&W.forEach(([U,X])=>{this.content.addEventListener(U,Q=>{this[X](Q)},{passive:!1})})}_pointerenter(U){this.setPointersPositions(U);const X=j(U.type);X&&this._fire(X.pointerenter,{evt:U,target:this,currentTarget:this})}_pointerover(U){this.setPointersPositions(U);const X=j(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=j(U.type),Q=A(U.type);if(X){this.setPointersPositions(U);var Z=this._getTargetShape(Q),re=!o.DD.isDragging||i.Konva.hitOnDragEnabled;Z&&re?(Z._fireAndBubble(X.pointerout,{evt:U}),Z._fireAndBubble(X.pointerleave,{evt:U}),this._fire(X.pointerleave,{evt:U,target:this,currentTarget:this}),this[Q+"targetShape"]=null):re&&(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=j(U.type),Q=A(U.type);if(X){this.setPointersPositions(U);var Z=!1;this._changedPointerPositions.forEach(re=>{var ee=this.getIntersection(re);if(o.DD.justDragged=!1,i.Konva["_"+Q+"ListenClick"]=!0,!ee||!ee.isListening())return;i.Konva.capturePointerEventsEnabled&&ee.setPointerCapture(re.id),this[Q+"ClickStartShape"]=ee,ee._fireAndBubble(X.pointerdown,{evt:U,pointerId:re.id}),Z=!0;const le=U.type.indexOf("touch")>=0;ee.preventDefault()&&U.cancelable&&le&&U.preventDefault()}),Z||this._fire(X.pointerdown,{evt:U,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(U){const X=j(U.type),Q=A(U.type);if(!X)return;o.DD.isDragging&&o.DD.node.preventDefault()&&U.cancelable&&U.preventDefault(),this.setPointersPositions(U);var Z=!o.DD.isDragging||i.Konva.hitOnDragEnabled;if(!Z)return;var re={};let ee=!1;var le=this._getTargetShape(Q);this._changedPointerPositions.forEach(ce=>{const _e=u.getCapturedShape(ce.id)||this.getIntersection(ce),Le=ce.id,Oe={evt:U,pointerId:Le};var ae=le!==_e;if(ae&&le&&(le._fireAndBubble(X.pointerout,{...Oe},_e),le._fireAndBubble(X.pointerleave,{...Oe},_e)),_e){if(re[_e._id])return;re[_e._id]=!0}_e&&_e.isListening()?(ee=!0,ae&&(_e._fireAndBubble(X.pointerover,{...Oe},le),_e._fireAndBubble(X.pointerenter,{...Oe},le),this[Q+"targetShape"]=_e),_e._fireAndBubble(X.pointermove,{...Oe})):le&&(this._fire(X.pointerover,{evt:U,target:this,currentTarget:this,pointerId:Le}),this[Q+"targetShape"]=null)}),ee||this._fire(X.pointermove,{evt:U,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(U){const X=j(U.type),Q=A(U.type);if(!X)return;this.setPointersPositions(U);const Z=this[Q+"ClickStartShape"],re=this[Q+"ClickEndShape"];var ee={};let le=!1;this._changedPointerPositions.forEach(ce=>{const _e=u.getCapturedShape(ce.id)||this.getIntersection(ce);if(_e){if(_e.releaseCapture(ce.id),ee[_e._id])return;ee[_e._id]=!0}const Le=ce.id,Oe={evt:U,pointerId:Le};let ae=!1;i.Konva["_"+Q+"InDblClickWindow"]?(ae=!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),_e&&_e.isListening()?(le=!0,this[Q+"ClickEndShape"]=_e,_e._fireAndBubble(X.pointerup,{...Oe}),i.Konva["_"+Q+"ListenClick"]&&Z&&Z===_e&&(_e._fireAndBubble(X.pointerclick,{...Oe}),ae&&re&&re===_e&&_e._fireAndBubble(X.pointerdblclick,{...Oe}))):(this[Q+"ClickEndShape"]=null,i.Konva["_"+Q+"ListenClick"]&&this._fire(X.pointerclick,{evt:U,target:this,currentTarget:this,pointerId:Le}),ae&&this._fire(X.pointerdblclick,{evt:U,target:this,currentTarget:this,pointerId:Le}))}),le||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(M,{evt:U}):this._fire(M,{evt:U,target:this,currentTarget:this})}_wheel(U){this.setPointersPositions(U);var X=this.getIntersection(this.getPointerPosition());X&&X.isListening()?X._fireAndBubble(B,{evt:U}):this._fire(B,{evt:U,target:this,currentTarget:this})}_pointercancel(U){this.setPointersPositions(U);const X=u.getCapturedShape(U.pointerId)||this.getIntersection(this.getPointerPosition());X&&X._fireAndBubble(y,u.createEvent(U)),u.releaseCapture(U.pointerId)}_lostpointercapture(U){u.releaseCapture(U.pointerId)}setPointersPositions(U){var X=this._getContentPosition(),Q=null,Z=null;U=U||window.event,U.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(U.touches,re=>{this._pointerPositions.push({id:re.identifier,x:(re.clientX-X.left)/X.scaleX,y:(re.clientY-X.top)/X.scaleY})}),Array.prototype.forEach.call(U.changedTouches||U.touches,re=>{this._changedPointerPositions.push({id:re.identifier,x:(re.clientX-X.left)/X.scaleX,y:(re.clientY-X.top)/X.scaleY})})):(Q=(U.clientX-X.left)/X.scaleX,Z=(U.clientY-X.top)/X.scaleY,this.pointerPos={x:Q,y:Z},this._pointerPositions=[{x:Q,y:Z,id:e.Util._getFirstPointerId(U)}],this._changedPointerPositions=[{x:Q,y:Z,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=Y,Y.prototype.nodeType=f,(0,l._registerNode)(Y),r.Factory.addGetterSetter(Y,"container")})(P6);var xc={},cr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.shapes=void 0;const e=lt,r=Yt,n=st,i=Gt,a=He,o=lt,l=gn;var u="hasShadow",f="shadowRGBA",v="patternImage",_="linearGradient",g="radialGradient";let h;function w(){return h||(h=r.Util.createCanvasElement().getContext("2d"),h)}t.shapes={};function E(N){const T=this.attrs.fillRule;T?N.fill(T):N.fill()}function S(N){N.stroke()}function b(N){N.fill()}function p(N){N.stroke()}function d(){this._clearCache(u)}function m(){this._clearCache(f)}function y(){this._clearCache(v)}function x(){this._clearCache(_)}function P(){this._clearCache(g)}class O extends i.Node{constructor(T){super(T);let R;for(;R=r.Util.getRandomColor(),!(R&&!(R in t.shapes)););this.colorKey=R,t.shapes[R]=this}getContext(){return r.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return r.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(u,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(v,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var T=w();const R=T.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(R&&R.setTransform){const M=new r.Transform;M.translate(this.fillPatternX(),this.fillPatternY()),M.rotate(e.Konva.getAngle(this.fillPatternRotation())),M.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),M.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const D=M.getMatrix(),G=typeof DOMMatrix>"u"?{a:D[0],b:D[1],c:D[2],d:D[3],e:D[4],f:D[5]}:new DOMMatrix(D);R.setTransform(G)}return R}}_getLinearGradient(){return this._getCache(_,this.__getLinearGradient)}__getLinearGradient(){var T=this.fillLinearGradientColorStops();if(T){for(var R=w(),M=this.fillLinearGradientStartPoint(),D=this.fillLinearGradientEndPoint(),G=R.createLinearGradient(M.x,M.y,D.x,D.y),F=0;F<T.length;F+=2)G.addColorStop(T[F],T[F+1]);return G}}_getRadialGradient(){return this._getCache(g,this.__getRadialGradient)}__getRadialGradient(){var T=this.fillRadialGradientColorStops();if(T){for(var R=w(),M=this.fillRadialGradientStartPoint(),D=this.fillRadialGradientEndPoint(),G=R.createRadialGradient(M.x,M.y,this.fillRadialGradientStartRadius(),D.x,D.y,this.fillRadialGradientEndRadius()),F=0;F<T.length;F+=2)G.addColorStop(T[F],T[F+1]);return G}}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 R=this.getStage();if(!R)return!1;const M=R.bufferHitCanvas;return M.getContext().clear(),this.drawHit(M,void 0,!0),M.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 R;if(!this.getStage()||!((R=this.attrs.perfectDrawEnabled)!==null&&R!==void 0?R:!0))return!1;const D=T||this.hasFill(),G=this.hasStroke(),F=this.getAbsoluteOpacity()!==1;if(D&&G&&F)return!0;const K=this.hasShadow(),B=this.shadowForStrokeEnabled();return!!(D&&G&&K&&B)}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 R=T.skipTransform,M=T.relativeTo,D=this.getSelfRect(),F=!T.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,K=D.width+F,B=D.height+F,$=!T.skipShadow&&this.hasShadow(),W=$?this.shadowOffsetX():0,C=$?this.shadowOffsetY():0,A=K+Math.abs(W),j=B+Math.abs(C),z=$&&this.shadowBlur()||0,H=A+z*2,Y=j+z*2,q={width:H,height:Y,x:-(F/2+z)+Math.min(W,0)+D.x,y:-(F/2+z)+Math.min(C,0)+D.y};return R?q:this._transformedRect(q,M)}drawScene(T,R){var M=this.getLayer(),D=T||M.getCanvas(),G=D.getContext(),F=this._getCanvasCache(),K=this.getSceneFunc(),B=this.hasShadow(),$,W,C,A=D.isCache,j=R===this;if(!this.isVisible()&&!j)return this;if(F){G.save();var z=this.getAbsoluteTransform(R).getMatrix();return G.transform(z[0],z[1],z[2],z[3],z[4],z[5]),this._drawCachedSceneCanvas(G),G.restore(),this}if(!K)return this;if(G.save(),this._useBufferCanvas()&&!A){$=this.getStage(),W=$.bufferCanvas,C=W.getContext(),C.clear(),C.save(),C._applyLineJoin(this);var H=this.getAbsoluteTransform(R).getMatrix();C.transform(H[0],H[1],H[2],H[3],H[4],H[5]),K.call(this,C,this),C.restore();var Y=W.pixelRatio;B&&G._applyShadow(this),G._applyOpacity(this),G._applyGlobalCompositeOperation(this),G.drawImage(W._canvas,0,0,W.width/Y,W.height/Y)}else{if(G._applyLineJoin(this),!j){var H=this.getAbsoluteTransform(R).getMatrix();G.transform(H[0],H[1],H[2],H[3],H[4],H[5]),G._applyOpacity(this),G._applyGlobalCompositeOperation(this)}B&&G._applyShadow(this),K.call(this,G,this)}return G.restore(),this}drawHit(T,R,M=!1){if(!this.shouldDrawHit(R,M))return this;var D=this.getLayer(),G=T||D.hitCanvas,F=G&&G.getContext(),K=this.hitFunc()||this.sceneFunc(),B=this._getCanvasCache(),$=B&&B.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()"),$){F.save();var W=this.getAbsoluteTransform(R).getMatrix();return F.transform(W[0],W[1],W[2],W[3],W[4],W[5]),this._drawCachedHitCanvas(F),F.restore(),this}if(!K)return this;if(F.save(),F._applyLineJoin(this),!(this===R)){var A=this.getAbsoluteTransform(R).getMatrix();F.transform(A[0],A[1],A[2],A[3],A[4],A[5])}return K.call(this,F,this),F.restore(),this}drawHitFromCache(T=0){var R=this._getCanvasCache(),M=this._getCachedSceneCanvas(),D=R.hit,G=D.getContext(),F=D.getWidth(),K=D.getHeight(),B,$,W,C,A,j;G.clear(),G.drawImage(M._canvas,0,0,F,K);try{for(B=G.getImageData(0,0,F,K),$=B.data,W=$.length,C=r.Util._hexToRgb(this.colorKey),A=0;A<W;A+=4)j=$[A+3],j>T?($[A]=C.r,$[A+1]=C.g,$[A+2]=C.b,$[A+3]=255):$[A+3]=0;G.putImageData(B,0,0)}catch(z){r.Util.error("Unable to draw hit graph from cached scene canvas. "+z.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=b,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",m),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",y),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"})})(cr);Object.defineProperty(xc,"__esModule",{value:!0});xc.Layer=void 0;const Hi=Yt,Av=rl,Ml=Gt,u1=st,cw=ai,PA=He,kA=cr,AA=lt;var TA="#",CA="beforeDraw",RA="draw",T6=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],NA=T6.length;let Ms=class extends Av.Container{constructor(e){super(e),this.canvas=new cw.SceneCanvas,this.hitCanvas=new cw.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(){Ml.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=Ml.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(Ml.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(Ml.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 Ml.Node.prototype.remove.call(this),e&&e.parentNode&&Hi.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"&&Hi.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(),Ml.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(){Hi.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Hi.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Hi.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<NA;i++){const a=T6[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=Hi.Util._rgbToHex(n[0],n[1],n[2]),o=kA.shapes[TA+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(CA,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Av.Container.prototype.drawScene.call(this,i,r),this._fire(RA,{node:this}),this}drawHit(e,r){var n=this.getLayer(),i=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),Av.Container.prototype.drawHit.call(this,i,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){Hi.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return Hi.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 Hi.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};xc.Layer=Ms;Ms.prototype.nodeType="Layer";(0,AA._registerNode)(Ms);u1.Factory.addGetterSetter(Ms,"imageSmoothingEnabled",!0);u1.Factory.addGetterSetter(Ms,"clearBeforeDraw",!0);u1.Factory.addGetterSetter(Ms,"hitGraphEnabled",!0,(0,PA.getBooleanValidator)());var Uh={};Object.defineProperty(Uh,"__esModule",{value:!0});Uh.FastLayer=void 0;const MA=Yt,LA=xc,IA=lt;let c1=class extends LA.Layer{constructor(e){super(e),this.listening(!1),MA.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};Uh.FastLayer=c1;c1.prototype.nodeType="FastLayer";(0,IA._registerNode)(c1);var Ls={};Object.defineProperty(Ls,"__esModule",{value:!0});Ls.Group=void 0;const jA=Yt,DA=rl,FA=lt;let f1=class extends DA.Container{_validateAdd(e){var r=e.getType();r!=="Group"&&r!=="Shape"&&jA.Util.throw("You may only add groups and shapes to groups.")}};Ls.Group=f1;f1.prototype.nodeType="Group";(0,FA._registerNode)(f1);var Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.Animation=void 0;const Tv=lt,fw=Yt,Cv=function(){return Tv.glob.performance&&Tv.glob.performance.now?function(){return Tv.glob.performance.now()}:function(){return new Date().getTime()}}();class xi{constructor(e,r){this.id=xi.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Cv(),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=xi.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=Cv(),xi._addAnimation(this),this}stop(){return xi._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(Cv());const l=a.length;let u;if(o?u=o.call(i,i.frame)!==!1:u=!0,!!u)for(let f=0;f<l;f++){const v=a[f];v._id!==void 0&&(e[v._id]=v)}}for(let n in e)e.hasOwnProperty(n)&&e[n].batchDraw()}static _animationLoop(){const e=xi;e.animations.length?(e._runFrames(),fw.Util.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,fw.Util.requestAnimFrame(this._animationLoop))}}Is.Animation=xi;xi.animations=[];xi.animIdCounter=0;xi.animRunning=!1;var C6={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Easings=t.Tween=void 0;const e=Yt,r=Is,n=Gt,i=lt;var a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,f=0,v=["fill","stroke","shadowColor"];class _{constructor(w,E,S,b,p,d,m){this.prop=w,this.propFunc=E,this.begin=b,this._pos=b,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=m,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 g{constructor(w){var E=this,S=w.node,b=S._id,p,d=w.easing||t.Easings.Linear,m=!!w.yoyo,y;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 _(y,function(P){E._tweenFunc(P)},d,0,1,p*1e3,m),this._addListeners(),g.attrs[b]||(g.attrs[b]={}),g.attrs[b][this._id]||(g.attrs[b][this._id]={}),g.tweens[b]||(g.tweens[b]={});for(y in w)a[y]===void 0&&this._addAttr(y,w[y]);this.reset(),this.onFinish=w.onFinish,this.onReset=w.onReset,this.onUpdate=w.onUpdate}_addAttr(w,E){var S=this.node,b=S._id,p,d,m,y,x,P,O,N;if(m=g.tweens[b][w],m&&delete g.attrs[b][m][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(y=0;y<x;y++)if(y%2===0)d.push(E[y]-p[y]);else{var T=e.Util.colorToRGBA(p[y]);N=e.Util.colorToRGBA(E[y]),p[y]=T,d.push({r:N.r-T.r,g:N.g-T.g,b:N.b-T.b,a:N.a-T.a})}else for(y=0;y<x;y++)d.push(E[y]-p[y]);else v.indexOf(w)!==-1?(p=e.Util.colorToRGBA(p),N=e.Util.colorToRGBA(E),d={r:N.r-p.r,g:N.g-p.g,b:N.b-p.b,a:N.a-p.a}):d=E-p;g.attrs[b][this._id][w]={start:p,diff:d,end:E,trueEnd:P,trueStart:O},g.tweens[b][w]=this._id}_tweenFunc(w){var E=this.node,S=g.attrs[E._id][this._id],b,p,d,m,y,x,P,O;for(b in S){if(p=S[b],d=p.start,m=p.diff,O=p.end,e.Util._isArray(d))if(y=[],P=Math.max(d.length,O.length),b.indexOf("fill")===0)for(x=0;x<P;x++)x%2===0?y.push((d[x]||0)+m[x]*w):y.push("rgba("+Math.round(d[x].r+m[x].r*w)+","+Math.round(d[x].g+m[x].g*w)+","+Math.round(d[x].b+m[x].b*w)+","+(d[x].a+m[x].a*w)+")");else for(x=0;x<P;x++)y.push((d[x]||0)+m[x]*w);else v.indexOf(b)!==-1?y="rgba("+Math.round(d.r+m.r*w)+","+Math.round(d.g+m.g*w)+","+Math.round(d.b+m.b*w)+","+(d.a+m.a*w)+")":y=d+m*w;E.setAttr(b,y)}}_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=g.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=g.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=g.tweens[w],b;this.pause();for(b in S)delete g.tweens[w][b];delete g.attrs[w][E]}}t.Tween=g,g.attrs={},g.tweens={},n.Node.prototype.to=function(h){var w=h.onFinish;h.node=this,h.onFinish=function(){this.destroy(),w&&w()};var E=new g(h);E.play()},t.Easings={BackEaseIn(h,w,E,S){var b=1.70158;return E*(h/=S)*h*((b+1)*h-b)+w},BackEaseOut(h,w,E,S){var b=1.70158;return E*((h=h/S-1)*h*((b+1)*h+b)+1)+w},BackEaseInOut(h,w,E,S){var b=1.70158;return(h/=S/2)<1?E/2*(h*h*(((b*=1.525)+1)*h-b))+w:E/2*((h-=2)*h*(((b*=1.525)+1)*h+b)+2)+w},ElasticEaseIn(h,w,E,S,b,p){var d=0;return h===0?w:(h/=S)===1?w+E:(p||(p=S*.3),!b||b<Math.abs(E)?(b=E,d=p/4):d=p/(2*Math.PI)*Math.asin(E/b),-(b*Math.pow(2,10*(h-=1))*Math.sin((h*S-d)*(2*Math.PI)/p))+w)},ElasticEaseOut(h,w,E,S,b,p){var d=0;return h===0?w:(h/=S)===1?w+E:(p||(p=S*.3),!b||b<Math.abs(E)?(b=E,d=p/4):d=p/(2*Math.PI)*Math.asin(E/b),b*Math.pow(2,-10*h)*Math.sin((h*S-d)*(2*Math.PI)/p)+E+w)},ElasticEaseInOut(h,w,E,S,b,p){var d=0;return h===0?w:(h/=S/2)===2?w+E:(p||(p=S*(.3*1.5)),!b||b<Math.abs(E)?(b=E,d=p/4):d=p/(2*Math.PI)*Math.asin(E/b),h<1?-.5*(b*Math.pow(2,10*(h-=1))*Math.sin((h*S-d)*(2*Math.PI)/p))+w:b*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}}})(C6);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;const e=lt,r=Yt,n=Gt,i=rl,a=P6,o=xc,l=Uh,u=Ls,f=zh,v=cr,_=Is,g=C6,h=Zi,w=ai;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:v.Shape,shapes:v.shapes,Animation:_.Animation,Tween:g.Tween,Easings:g.Easings,Context:h.Context,Canvas:w.Canvas}),t.default=t.Konva})(Jd);var Gh={};Object.defineProperty(Gh,"__esModule",{value:!0});Gh.Arc=void 0;const Hh=st,zA=cr,dw=lt,Vh=He,BA=lt;let fa=class extends zA.Shape{_sceneFunc(e){var r=dw.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=dw.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),v=o*r,_=l*(l>0?e:r),g=u*(u>0?r:e);return{x:f,y:n?-1*g:_,width:v-f,height:g-_}}};Gh.Arc=fa;fa.prototype._centroid=!0;fa.prototype.className="Arc";fa.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,BA._registerNode)(fa);Hh.Factory.addGetterSetter(fa,"innerRadius",0,(0,Vh.getNumberValidator)());Hh.Factory.addGetterSetter(fa,"outerRadius",0,(0,Vh.getNumberValidator)());Hh.Factory.addGetterSetter(fa,"angle",0,(0,Vh.getNumberValidator)());Hh.Factory.addGetterSetter(fa,"clockwise",!1,(0,Vh.getBooleanValidator)());var qh={},Pc={};Object.defineProperty(Pc,"__esModule",{value:!0});Pc.Line=void 0;const $h=st,UA=cr,R6=He,GA=lt;function Im(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),v=o*u/(l+u),_=r-f*(i-t),g=n-f*(a-e),h=r+v*(i-t),w=n+v*(a-e);return[_,g,h,w]}function hw(t,e){var r=t.length,n=[],i,a;for(i=2;i<r-2;i+=2)a=Im(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 io=class extends UA.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():hw(this.points(),this.tension())}_getTensionPointsClosed(){var e=this.points(),r=e.length,n=this.tension(),i=Im(e[r-2],e[r-1],e[0],e[1],e[2],e[3],n),a=Im(e[r-4],e[r-3],e[r-2],e[r-1],e[0],e[1],n),o=hw(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}}};Pc.Line=io;io.prototype.className="Line";io.prototype._attrsAffectingSize=["points","bezier","tension"];(0,GA._registerNode)(io);$h.Factory.addGetterSetter(io,"closed",!1);$h.Factory.addGetterSetter(io,"bezier",!1);$h.Factory.addGetterSetter(io,"tension",0,(0,R6.getNumberValidator)());$h.Factory.addGetterSetter(io,"points",[],(0,R6.getNumberArrayValidator)());var js={},N6={};(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,v,_;f=u/2,v=0;for(let h=0;h<20;h++)_=f*t.tValues[20][h]+f,v+=t.cValues[20][h]*n(o,l,_);return f*v};t.getCubicArcLength=e;const r=(o,l,u)=>{u===void 0&&(u=1);const f=o[0]-2*o[1]+o[2],v=l[0]-2*l[1]+l[2],_=2*o[1]-2*o[0],g=2*l[1]-2*l[0],h=4*(f*f+v*v),w=4*(f*_+v*g),E=_*_+g*g;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),b=E/h,p=u+S,d=b-S*S,m=p*p+d>0?Math.sqrt(p*p+d):0,y=S*S+d>0?Math.sqrt(S*S+d):0,x=S+Math.sqrt(S*S+d)!==0?d*Math.log(Math.abs((p+m)/(S+y))):0;return Math.sqrt(h)/2*(p*m-S*y+x)};t.getQuadraticArcLength=r;function n(o,l,u){const f=i(1,u,o),v=i(1,u,l),_=f*f+v*v;return Math.sqrt(_)}const i=(o,l,u)=>{const f=u.length-1;let v,_;if(f===0)return 0;if(o===0){_=0;for(let g=0;g<=f;g++)_+=t.binomialCoefficients[f][g]*Math.pow(1-l,f-g)*Math.pow(l,g)*u[g];return _}else{v=new Array(f);for(let g=0;g<f;g++)v[g]=f*(u[g+1]-u[g]);return i(o-1,l,v)}},a=(o,l,u)=>{let f=1,v=o/l,_=(o-u(v))/l,g=0;for(;f>.001;){const h=u(v+_),w=Math.abs(o-h)/l;if(w<f)f=w,v+=_;else{const E=u(v-_),S=Math.abs(o-E)/l;S<f?(f=S,v-=_):_/=2}if(g++,g>500)break}return v};t.t2length=a})(N6);Object.defineProperty(js,"__esModule",{value:!0});js.Path=void 0;const HA=st,VA=cr,qA=lt,Ll=N6;let kc=class en extends VA.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],v=o[3],_=o[4],g=o[5],h=o[6],w=o[7],E=f>v?f:v,S=f>v?1:f/v,b=f>v?v/f:1;e.translate(l,u),e.rotate(h),e.scale(S,b),e.arc(0,0,E,_,_+g,1-w),e.scale(1/S,1/b),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 v=f.points[4],_=f.points[5],g=f.points[4]+_,h=Math.PI/180;if(Math.abs(v-g)<h&&(h=Math.abs(v-g)),_<0)for(let w=v-h;w>g;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=v+h;w<g;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,Ll.t2length)(e,en.getPathLength(r),E=>(0,Ll.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,Ll.t2length)(e,en.getPathLength(r),E=>(0,Ll.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],v=l[2],_=l[3],g=l[4],h=l[5],w=l[6];return g+=h*e/o.pathLength,en.getPointOnEllipticalArc(u,f,v,_,g,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 v=u*f,_;if(i===r)_={x:o,y:l+v};else if((l-n)/(o-r+1e-8)===u)_={x:o+f,y:l+v};else{var g,h,w=this.getLineLength(r,n,i,a),E=(o-r)*(i-r)+(l-n)*(a-n);E=E/(w*w),g=r+E*(i-r),h=n+E*(a-n);var S=this.getLineLength(o,l,g,h),b=Math.sqrt(e*e-S*S);f=Math.sqrt(b*b/(1+u*u)),i<r&&(f*=-1),v=u*f,_={x:g+f,y:h+v}}return _}static getPointOnCubicBezier(e,r,n,i,a,o,l,u,f){function v(S){return S*S*S}function _(S){return 3*S*S*(1-S)}function g(S){return 3*S*(1-S)*(1-S)}function h(S){return(1-S)*(1-S)*(1-S)}var w=u*v(e)+o*_(e)+i*g(e)+r*h(e),E=f*v(e)+l*_(e)+a*g(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 v(h){return(1-h)*(1-h)}var _=o*u(e)+i*f(e)+r*v(e),g=l*u(e)+a*f(e)+n*v(e);return{x:_,y:g}}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,v=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,_;for(i=1;i<a.length;i++){var g=a[i],h=g.charAt(0);for(g=g.slice(1),l.length=0;_=v.exec(g);)l.push(_[0]);for(var w=[],E=0,S=l.length;E<S;E++){if(l[E]==="00"){w.push(0,0);continue}var b=parseFloat(l[E]);isNaN(b)?w.push(0):w.push(b)}for(;w.length>0&&!isNaN(w[0]);){var p="",d=[],m=u,y=f,x,P,O,N,T,R,M,D,G,F;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 K=w.shift(),B=w.shift();if(u+=K,f+=B,p="M",o.length>2&&o[o.length-1].command==="z"){for(var $=o.length-2;$>=0;$--)if(o[$].command==="M"){u=o[$].points[0]+K,f=o[$].points[1]+B;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":N=w.shift(),T=w.shift(),R=w.shift(),M=w.shift(),D=w.shift(),G=u,F=f,u=w.shift(),f=w.shift(),p="A",d=this.convertEndpointToCenterParameterization(G,F,u,f,M,D,N,T,R);break;case"a":N=w.shift(),T=w.shift(),R=w.shift(),M=w.shift(),D=w.shift(),G=u,F=f,u+=w.shift(),f+=w.shift(),p="A",d=this.convertEndpointToCenterParameterization(G,F,u,f,M,D,N,T,R);break}o.push({command:p||h,points:d,start:{x:m,y},pathLength:this.calcLength(m,y,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,Ll.getCubicArcLength)([e,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return(0,Ll.getQuadraticArcLength)([e,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;var v=i[4],_=i[5],g=i[4]+_,h=Math.PI/180;if(Math.abs(v-g)<h&&(h=Math.abs(v-g)),o=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],v,0),_<0)for(u=v-h;u>g;u-=h)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;else for(u=v+h;u<g;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],g,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 v=f*(Math.PI/180),_=Math.cos(v)*(e-n)/2+Math.sin(v)*(r-i)/2,g=-1*Math.sin(v)*(e-n)/2+Math.cos(v)*(r-i)/2,h=_*_/(l*l)+g*g/(u*u);h>1&&(l*=Math.sqrt(h),u*=Math.sqrt(h));var w=Math.sqrt((l*l*(u*u)-l*l*(g*g)-u*u*(_*_))/(l*l*(g*g)+u*u*(_*_)));a===o&&(w*=-1),isNaN(w)&&(w=0);var E=w*l*g/u,S=w*-u*_/l,b=(e+n)/2+Math.cos(v)*E-Math.sin(v)*S,p=(r+i)/2+Math.sin(v)*E+Math.cos(v)*S,d=function(T){return Math.sqrt(T[0]*T[0]+T[1]*T[1])},m=function(T,R){return(T[0]*R[0]+T[1]*R[1])/(d(T)*d(R))},y=function(T,R){return(T[0]*R[1]<T[1]*R[0]?-1:1)*Math.acos(m(T,R))},x=y([1,0],[(_-E)/l,(g-S)/u]),P=[(_-E)/l,(g-S)/u],O=[(-1*_-E)/l,(-1*g-S)/u],N=y(P,O);return m(P,O)<=-1&&(N=Math.PI),m(P,O)>=1&&(N=0),o===0&&N>0&&(N=N-2*Math.PI),o===1&&N<0&&(N=N+2*Math.PI),[b,p,l,u,x,N,v,o]}};js.Path=kc;kc.prototype.className="Path";kc.prototype._attrsAffectingSize=["data"];(0,qA._registerNode)(kc);HA.Factory.addGetterSetter(kc,"data");Object.defineProperty(qh,"__esModule",{value:!0});qh.Arrow=void 0;const Wh=st,$A=Pc,M6=He,WA=lt,pw=js;let il=class extends $A.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 g=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],n[l-2],n[l-1]],h=pw.Path.calcLength(i[i.length-4],i[i.length-3],"C",g),w=pw.Path.getPointOnQuadraticBezier(Math.min(1,1-o/h),g[0],g[1],g[2],g[3],g[4],g[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 v=(Math.atan2(f,u)+r)%r,_=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[l-2],n[l-1]),e.rotate(v),e.moveTo(0,0),e.lineTo(-o,_/2),e.lineTo(-o,-_/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,_/2),e.lineTo(-o,-_/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}}};qh.Arrow=il;il.prototype.className="Arrow";(0,WA._registerNode)(il);Wh.Factory.addGetterSetter(il,"pointerLength",10,(0,M6.getNumberValidator)());Wh.Factory.addGetterSetter(il,"pointerWidth",10,(0,M6.getNumberValidator)());Wh.Factory.addGetterSetter(il,"pointerAtBeginning",!1);Wh.Factory.addGetterSetter(il,"pointerAtEnding",!0);var Yh={};Object.defineProperty(Yh,"__esModule",{value:!0});Yh.Circle=void 0;const YA=st,KA=cr,XA=He,QA=lt;let Ds=class extends KA.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)}};Yh.Circle=Ds;Ds.prototype._centroid=!0;Ds.prototype.className="Circle";Ds.prototype._attrsAffectingSize=["radius"];(0,QA._registerNode)(Ds);YA.Factory.addGetterSetter(Ds,"radius",0,(0,XA.getNumberValidator)());var Kh={};Object.defineProperty(Kh,"__esModule",{value:!0});Kh.Ellipse=void 0;const d1=st,ZA=cr,L6=He,JA=lt;let ao=class extends ZA.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)}};Kh.Ellipse=ao;ao.prototype.className="Ellipse";ao.prototype._centroid=!0;ao.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,JA._registerNode)(ao);d1.Factory.addComponentsGetterSetter(ao,"radius",["x","y"]);d1.Factory.addGetterSetter(ao,"radiusX",0,(0,L6.getNumberValidator)());d1.Factory.addGetterSetter(ao,"radiusY",0,(0,L6.getNumberValidator)());var Xh={};Object.defineProperty(Xh,"__esModule",{value:!0});Xh.Image=void 0;const Rv=Yt,al=st,eT=cr,tT=lt,Ac=He;let Mi=class I6 extends eT.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?Rv.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?Rv.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=Rv.Util.createImageElement();i.onload=function(){var a=new I6({image:i});r(a)},i.onerror=n,i.crossOrigin="Anonymous",i.src=e}};Xh.Image=Mi;Mi.prototype.className="Image";(0,tT._registerNode)(Mi);al.Factory.addGetterSetter(Mi,"cornerRadius",0,(0,Ac.getNumberOrArrayOfNumbersValidator)(4));al.Factory.addGetterSetter(Mi,"image");al.Factory.addComponentsGetterSetter(Mi,"crop",["x","y","width","height"]);al.Factory.addGetterSetter(Mi,"cropX",0,(0,Ac.getNumberValidator)());al.Factory.addGetterSetter(Mi,"cropY",0,(0,Ac.getNumberValidator)());al.Factory.addGetterSetter(Mi,"cropWidth",0,(0,Ac.getNumberValidator)());al.Factory.addGetterSetter(Mi,"cropHeight",0,(0,Ac.getNumberValidator)());var bs={};Object.defineProperty(bs,"__esModule",{value:!0});bs.Tag=bs.Label=void 0;const Qh=st,rT=cr,nT=Ls,h1=He,j6=lt;var D6=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],iT="Change.konva",aT="none",jm="up",Dm="right",Fm="down",zm="left",oT=D6.length;let p1=class extends nT.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<oT;n++)e.on(D6[n]+iT,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 jm:l=n/2,u=-1*f;break;case Dm:l=n+o,u=i/2;break;case Fm:l=n/2,u=i+f;break;case zm: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})}}};bs.Label=p1;p1.prototype.className="Label";(0,j6._registerNode)(p1);let ol=class extends rT.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,v=0,_=0;typeof l=="number"?u=f=v=_=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),_=Math.min(l[2]||0,r/2,n/2),v=Math.min(l[3]||0,r/2,n/2)),e.beginPath(),e.moveTo(u,0),i===jm&&(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===Dm&&(e.lineTo(r,(n-o)/2),e.lineTo(r+a,n/2),e.lineTo(r,(n+o)/2)),e.lineTo(r,n-_),e.arc(r-_,n-_,_,0,Math.PI/2,!1),i===Fm&&(e.lineTo((r+a)/2,n),e.lineTo(r/2,n+o),e.lineTo((r-a)/2,n)),e.lineTo(v,n),e.arc(v,n-v,v,Math.PI/2,Math.PI,!1),i===zm&&(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===jm?(r-=i,l+=i):a===Fm?l+=i:a===zm?(e-=n*1.5,o+=n):a===Dm&&(o+=n*1.5),{x:e,y:r,width:o,height:l}}};bs.Tag=ol;ol.prototype.className="Tag";(0,j6._registerNode)(ol);Qh.Factory.addGetterSetter(ol,"pointerDirection",aT);Qh.Factory.addGetterSetter(ol,"pointerWidth",0,(0,h1.getNumberValidator)());Qh.Factory.addGetterSetter(ol,"pointerHeight",0,(0,h1.getNumberValidator)());Qh.Factory.addGetterSetter(ol,"cornerRadius",0,(0,h1.getNumberOrArrayOfNumbersValidator)(4));var Tc={};Object.defineProperty(Tc,"__esModule",{value:!0});Tc.Rect=void 0;const lT=st,sT=cr,uT=lt,cT=Yt,fT=He;let Zh=class extends sT.Shape{_sceneFunc(e){var r=this.cornerRadius(),n=this.width(),i=this.height();e.beginPath(),r?cT.Util.drawRoundedRectPath(e,n,i,r):e.rect(0,0,n,i),e.closePath(),e.fillStrokeShape(this)}};Tc.Rect=Zh;Zh.prototype.className="Rect";(0,uT._registerNode)(Zh);lT.Factory.addGetterSetter(Zh,"cornerRadius",0,(0,fT.getNumberOrArrayOfNumbersValidator)(4));var Jh={};Object.defineProperty(Jh,"__esModule",{value:!0});Jh.RegularPolygon=void 0;const F6=st,dT=cr,z6=He,hT=lt;let ll=class extends dT.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)}};Jh.RegularPolygon=ll;ll.prototype.className="RegularPolygon";ll.prototype._centroid=!0;ll.prototype._attrsAffectingSize=["radius"];(0,hT._registerNode)(ll);F6.Factory.addGetterSetter(ll,"radius",0,(0,z6.getNumberValidator)());F6.Factory.addGetterSetter(ll,"sides",0,(0,z6.getNumberValidator)());var ep={};Object.defineProperty(ep,"__esModule",{value:!0});ep.Ring=void 0;const B6=st,pT=cr,U6=He,gT=lt;var gw=Math.PI*2;let sl=class extends pT.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,gw,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),gw,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)}};ep.Ring=sl;sl.prototype.className="Ring";sl.prototype._centroid=!0;sl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,gT._registerNode)(sl);B6.Factory.addGetterSetter(sl,"innerRadius",0,(0,U6.getNumberValidator)());B6.Factory.addGetterSetter(sl,"outerRadius",0,(0,U6.getNumberValidator)());var tp={};Object.defineProperty(tp,"__esModule",{value:!0});tp.Sprite=void 0;const ul=st,vT=cr,mT=Is,G6=He,yT=lt;let Li=class extends vT.Shape{constructor(e){super(e),this._updated=!0,this.anim=new mT.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],v=a[i+3],_=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,f,v),e.closePath(),e.fillStrokeShape(this)),_)if(o){var g=o[r],h=n*2;e.drawImage(_,l,u,f,v,g[h+0],g[h+1],f,v)}else e.drawImage(_,l,u,f,v,0,0,f,v)}_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],v=n*2;e.rect(f[v+0],f[v+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)}};tp.Sprite=Li;Li.prototype.className="Sprite";(0,yT._registerNode)(Li);ul.Factory.addGetterSetter(Li,"animation");ul.Factory.addGetterSetter(Li,"animations");ul.Factory.addGetterSetter(Li,"frameOffsets");ul.Factory.addGetterSetter(Li,"image");ul.Factory.addGetterSetter(Li,"frameIndex",0,(0,G6.getNumberValidator)());ul.Factory.addGetterSetter(Li,"frameRate",17,(0,G6.getNumberValidator)());ul.Factory.backCompat(Li,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var rp={};Object.defineProperty(rp,"__esModule",{value:!0});rp.Star=void 0;const g1=st,bT=cr,v1=He,_T=lt;let oo=class extends bT.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)}};rp.Star=oo;oo.prototype.className="Star";oo.prototype._centroid=!0;oo.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,_T._registerNode)(oo);g1.Factory.addGetterSetter(oo,"numPoints",5,(0,v1.getNumberValidator)());g1.Factory.addGetterSetter(oo,"innerRadius",0,(0,v1.getNumberValidator)());g1.Factory.addGetterSetter(oo,"outerRadius",0,(0,v1.getNumberValidator)());var Ko={};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.Text=Ko.stringToArray=void 0;const Bm=Yt,Fr=st,wT=cr,lo=He,ST=lt;function H6(t){return Array.from(t)}Ko.stringToArray=H6;var Il="auto",ET="center",V6="inherit",gu="justify",OT="Change.konva",xT="2d",vw="-",q6="left",PT="text",kT="Text",AT="top",TT="bottom",mw="middle",$6="normal",CT="px ",Zf=" ",RT="right",yw="rtl",NT="word",MT="char",bw="none",Nv="…",W6=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],LT=W6.length;function IT(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 Jf;function Mv(){return Jf||(Jf=Bm.Util.createCanvasElement().getContext(xT),Jf)}function jT(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function DT(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function FT(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let Qt=class extends wT.Shape{constructor(e){super(FT(e)),this._partialTextX=0,this._partialTextY=0;for(var r=0;r<LT;r++)this.on(W6[r]+OT,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,v=this.align(),_=this.getWidth(),g=this.letterSpacing(),h=this.fill(),w=this.textDecoration(),E=w.indexOf("underline")!==-1,S=w.indexOf("line-through")!==-1,b;u=u===V6?e.direction:u;var p=0,p=o/2,d=0,m=0;for(u===yw&&e.setAttr("direction",u),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",mw),e.setAttr("textAlign",q6),l===mw?f=(this.getHeight()-n*o-i*2)/2:l===TT&&(f=this.getHeight()-n*o-i*2),e.translate(i,f+i),b=0;b<n;b++){var d=0,m=0,y=r[b],x=y.text,P=y.width,O=y.lastInParagraph,N,T,R;if(e.save(),v===RT?d+=_-P-i*2:v===ET&&(d+=(_-P-i*2)/2),E){e.save(),e.beginPath(),e.moveTo(d,p+m+Math.round(a/2)),N=x.split(" ").length-1,T=N===0,R=v===gu&&!O?_-i*2:P,e.lineTo(d+Math.round(R),p+m+Math.round(a/2)),e.lineWidth=a/15;const B=this._getLinearGradient();e.strokeStyle=B||h,e.stroke(),e.restore()}if(S){e.save(),e.beginPath(),e.moveTo(d,p+m),N=x.split(" ").length-1,T=N===0,R=v===gu&&O&&!T?_-i*2:P,e.lineTo(d+Math.round(R),p+m),e.lineWidth=a/15;const B=this._getLinearGradient();e.strokeStyle=B||h,e.stroke(),e.restore()}if(u!==yw&&(g!==0||v===gu)){N=x.split(" ").length-1;for(var M=H6(x),D=0;D<M.length;D++){var G=M[D];G===" "&&!O&&v===gu&&(d+=(_-i*2-P)/N),this._partialTextX=d,this._partialTextY=p+m,this._partialText=G,e.fillStrokeShape(this),d+=this.measureSize(G).width+g}}else g!==0&&e.setAttr("letterSpacing",`${g}px`),this._partialTextX=d,this._partialTextY=p+m,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=Bm.Util._isString(e)?e:e==null?"":e+"";return this._setAttr(PT,r),this}getWidth(){var e=this.attrs.width===Il||this.attrs.width===void 0;return e?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var e=this.attrs.height===Il||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 Bm.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=Mv(),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()+Zf+this.fontVariant()+Zf+(this.fontSize()+CT)+IT(this.fontFamily())}_addTextLine(e){this.align()===gu&&(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 Mv().measureText(e).width+(n?r*(n-1):0)}_setTextData(){var e=this.text().split(`
|
|
43
|
+
`),r=+this.fontSize(),n=0,i=this.lineHeight()*r,a=this.attrs.width,o=this.attrs.height,l=a!==Il&&a!==void 0,u=o!==Il&&o!==void 0,f=this.padding(),v=a-f*2,_=o-f*2,g=0,h=this.wrap(),w=h!==bw,E=h!==MT&&w,S=this.ellipsis();this.textArr=[],Mv().font=this._getContextFont();for(var b=S?this._getTextWidth(Nv):0,p=0,d=e.length;p<d;++p){var m=e[p],y=this._getTextWidth(m);if(l&&y>v)for(;m.length>0;){for(var x=0,P=m.length,O="",N=0;x<P;){var T=x+P>>>1,R=m.slice(0,T+1),M=this._getTextWidth(R)+b;M<=v?(x=T+1,O=R,N=M):P=T}if(O){if(E){var D,G=m[O.length],F=G===Zf||G===vw;F&&N<=v?D=O.length:D=Math.max(O.lastIndexOf(Zf),O.lastIndexOf(vw))+1,D>0&&(x=D,O=O.slice(0,x),N=this._getTextWidth(O))}O=O.trimRight(),this._addTextLine(O),n=Math.max(n,N),g+=i;var K=this._shouldHandleEllipsis(g);if(K){this._tryToAddEllipsisToLastLine();break}if(m=m.slice(x),m=m.trimLeft(),m.length>0&&(y=this._getTextWidth(m),y<=v)){this._addTextLine(m),g+=i,n=Math.max(n,y);break}}else break}else this._addTextLine(m),g+=i,n=Math.max(n,y),this._shouldHandleEllipsis(g)&&p<d-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&g+i>_)break}this.textHeight=r,this.textWidth=n}_shouldHandleEllipsis(e){var r=+this.fontSize(),n=this.lineHeight()*r,i=this.attrs.height,a=i!==Il&&i!==void 0,o=this.padding(),l=i-o*2,u=this.wrap(),f=u!==bw;return!f||a&&e+n>l}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,r=e!==Il&&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+Nv)<i;l||(o.text=o.text.slice(0,o.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+Nv)}}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()}};Ko.Text=Qt;Qt.prototype._fillFunc=jT;Qt.prototype._strokeFunc=DT;Qt.prototype.className=kT;Qt.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,ST._registerNode)(Qt);Fr.Factory.overWriteSetter(Qt,"width",(0,lo.getNumberOrAutoValidator)());Fr.Factory.overWriteSetter(Qt,"height",(0,lo.getNumberOrAutoValidator)());Fr.Factory.addGetterSetter(Qt,"direction",V6);Fr.Factory.addGetterSetter(Qt,"fontFamily","Arial");Fr.Factory.addGetterSetter(Qt,"fontSize",12,(0,lo.getNumberValidator)());Fr.Factory.addGetterSetter(Qt,"fontStyle",$6);Fr.Factory.addGetterSetter(Qt,"fontVariant",$6);Fr.Factory.addGetterSetter(Qt,"padding",0,(0,lo.getNumberValidator)());Fr.Factory.addGetterSetter(Qt,"align",q6);Fr.Factory.addGetterSetter(Qt,"verticalAlign",AT);Fr.Factory.addGetterSetter(Qt,"lineHeight",1,(0,lo.getNumberValidator)());Fr.Factory.addGetterSetter(Qt,"wrap",NT);Fr.Factory.addGetterSetter(Qt,"ellipsis",!1,(0,lo.getBooleanValidator)());Fr.Factory.addGetterSetter(Qt,"letterSpacing",0,(0,lo.getNumberValidator)());Fr.Factory.addGetterSetter(Qt,"text","",(0,lo.getStringValidator)());Fr.Factory.addGetterSetter(Qt,"textDecoration","");var np={};Object.defineProperty(np,"__esModule",{value:!0});np.TextPath=void 0;const Lv=Yt,ui=st,zT=cr,vu=js,Iv=Ko,Y6=He,BT=lt;var UT="",K6="normal";function X6(t){t.fillText(this.partialText,0,0)}function Q6(t){t.strokeText(this.partialText,0,0)}let fr=class extends zT.Shape{constructor(e){super(e),this.dummyCanvas=Lv.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 vu.Path.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const r=this.pathLength;return e-1>r?null:vu.Path.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=vu.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 Lv.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 Iv.Text.prototype.setText.call(this,e)}_getContextFont(){return Iv.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,Iv.stringToArray)(this.text());let f=l;for(var v=0;v<u.length;v++){const _=this._getPointAtLength(f);if(!_)return;let g=this._getTextSize(u[v]).width+n;if(u[v]===" "&&i==="justify"){const p=this.text().split(" ").length-1;g+=(this.pathLength-o)/p}const h=this._getPointAtLength(f+g);if(!h)return;const w=vu.Path.getLineLength(_.x,_.y,h.x,h.y);let E=0;if(a)try{E=a(u[v-1],u[v])*this.fontSize()}catch{E=0}_.x+=E,h.x+=E,this.textWidth+=E;const S=vu.Path.getPointOnLine(E+w/2,_.x,_.y,h.x,h.y),b=Math.atan2(h.y-_.y,h.x-_.x);this.glyphInfo.push({transposeX:S.x,transposeY:S.y,text:u[v],rotation:b,p0:_,p1:h}),f+=g}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var e=[];this.glyphInfo.forEach(function(v){e.push(v.p0.x),e.push(v.p0.y),e.push(v.p1.x),e.push(v.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 Lv.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};np.TextPath=fr;fr.prototype._fillFunc=X6;fr.prototype._strokeFunc=Q6;fr.prototype._fillFuncHit=X6;fr.prototype._strokeFuncHit=Q6;fr.prototype.className="TextPath";fr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,BT._registerNode)(fr);ui.Factory.addGetterSetter(fr,"data");ui.Factory.addGetterSetter(fr,"fontFamily","Arial");ui.Factory.addGetterSetter(fr,"fontSize",12,(0,Y6.getNumberValidator)());ui.Factory.addGetterSetter(fr,"fontStyle",K6);ui.Factory.addGetterSetter(fr,"align","left");ui.Factory.addGetterSetter(fr,"letterSpacing",0,(0,Y6.getNumberValidator)());ui.Factory.addGetterSetter(fr,"textBaseline","middle");ui.Factory.addGetterSetter(fr,"fontVariant",K6);ui.Factory.addGetterSetter(fr,"text",UT);ui.Factory.addGetterSetter(fr,"textDecoration",null);ui.Factory.addGetterSetter(fr,"kerningFunc",null);var ip={};Object.defineProperty(ip,"__esModule",{value:!0});ip.Transformer=void 0;const Pt=Yt,St=st,_w=Gt,GT=cr,HT=Tc,ww=Ls,Xn=lt,so=He,VT=lt;var Z6="tr-konva",qT=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${Z6}`).join(" "),Sw="nodesRect",$T=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],WT={"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 YT="ontouchstart"in Xn.Konva._global;function KT(t,e,r){if(t==="rotater")return r;e+=Pt.Util.degToRad(WT[t]||0);var n=(Pt.Util.radToDeg(e)%360+360)%360;return Pt.Util._inRange(n,315+22.5,360)||Pt.Util._inRange(n,0,22.5)?"ns-resize":Pt.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":Pt.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":Pt.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":Pt.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":Pt.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":Pt.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":Pt.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(Pt.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var th=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],Ew=1e8;function XT(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 J6(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 QT(t,e){const r=XT(t);return J6(t,e,r)}function ZT(t,e,r){let n=e;for(let i=0;i<t.length;i++){const a=Xn.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 vt=class extends ww.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(qT,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return Pt.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 Z6+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const r=e.filter(i=>i.isAncestorOf(this)?(Pt.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($T.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(Sw),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(Sw,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=(Xn.Konva.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),v={x:o.x+l*Math.cos(f)+u*Math.sin(-f),y:o.y+u*Math.cos(f)+l*Math.sin(f),width:i.width*a.x,height:i.height*a.y,rotation:f};return J6(v,-Xn.Konva.getAngle(r),{x:0,y:0})}__getNodeRect(){var e=this.getNode();if(!e)return{x:-Ew,y:-Ew,width:0,height:0,rotation:0};const r=[];this.nodes().map(f=>{const v=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var _=[{x:v.x,y:v.y},{x:v.x+v.width,y:v.y},{x:v.x+v.width,y:v.y+v.height},{x:v.x,y:v.y+v.height}],g=f.getAbsoluteTransform();_.forEach(function(h){var w=g.point(h);r.push(w)})});const n=new Pt.Transform;n.rotate(-Xn.Konva.getAngle(this.rotation()));var i=1/0,a=1/0,o=-1/0,l=-1/0;r.forEach(function(f){var v=n.point(f);i===void 0&&(i=o=v.x,a=l=v.y),i=Math.min(i,v.x),a=Math.min(a,v.y),o=Math.max(o,v.x),l=Math.max(l,v.y)}),n.invert();const u=n.point({x:i,y:a});return{x:u.x,y:u.y,width:o-i,height:l-a,rotation:Xn.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(),th.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater")}_createAnchor(e){var r=new HT.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:YT?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=Xn.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=KT(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 GT.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()*Pt.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 v=a.getAbsolutePosition();if(!(f.x===v.x&&f.y===v.y)){if(this._movingAnchorName==="rotater"){var _=this._getNodeRect();r=a.x()-_.width/2,n=-a.y()+_.height/2;let D=Math.atan2(-n,r)+Math.PI/2;_.height<0&&(D-=Math.PI);var g=Xn.Konva.getAngle(this.rotation());const G=g+D,F=Xn.Konva.getAngle(this.rotationSnapTolerance()),B=ZT(this.rotationSnaps(),G,F)-_.rotation,$=QT(_,B);this._fitNodesInto($,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,b=this.findOne(".top-left").y()>E.y?-1:1;r=i*this.cos*S,n=i*this.sin*b,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,b=this.findOne(".top-right").y()>E.y?-1:1;r=i*this.cos*S,n=i*this.sin*b,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,b=a.y()<E.y?-1:1;r=i*this.cos*S,n=i*this.sin*b,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,b=this.findOne(".bottom-right").y()<E.y?-1:1;r=i*this.cos*S,n=i*this.sin*b,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 m=this.findOne(".top-left"),y=this.findOne(".bottom-right"),x=m.x(),P=m.y(),O=this.getWidth()-y.x(),N=this.getHeight()-y.y();y.move({x:-x,y:-P}),m.move({x:O,y:N})}var T=this.findOne(".top-left").getAbsolutePosition();r=T.x,n=T.y;var R=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),M=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:r,y:n,width:R,height:M,rotation:Xn.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(Pt.Util._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(Pt.Util._inRange(e.height,-this.padding()*2-i,i)){this.update();return}var a=new Pt.Transform;if(a.rotate(Xn.Konva.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const g=a.point({x:-this.padding()*2,y:0});e.x+=g.x,e.y+=g.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const g=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const g=a.point({x:0,y:-this.padding()*2});e.x+=g.x,e.y+=g.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const g=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const g=this.boundBoxFunc()(n,e);g?e=g:Pt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,l=new Pt.Transform;l.translate(n.x,n.y),l.rotate(n.rotation),l.scale(n.width/o,n.height/o);const u=new Pt.Transform,f=e.width/o,v=e.height/o;this.flipEnabled()===!1?(u.translate(e.x,e.y),u.rotate(e.rotation),u.translate(e.width<0?e.width:0,e.height<0?e.height:0),u.scale(Math.abs(f),Math.abs(v))):(u.translate(e.x,e.y),u.rotate(e.rotation),u.scale(f,v));const _=u.multiply(l.invert());this._nodes.forEach(g=>{var h;const w=g.getParent().getAbsoluteTransform(),E=g.getTransform().copy();E.translate(g.offsetX(),g.offsetY());const S=new Pt.Transform;S.multiply(w.copy().invert()).multiply(_).multiply(w).multiply(E);const b=S.decompose();g.setAttrs(b),this._fire("transform",{evt:r,target:g}),g._fire("transform",{evt:r,target:g}),(h=g.getLayer())===null||h===void 0||h.batchDraw()}),this.rotation(Pt.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(Pt.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(_=>{_.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()*Pt.Util._sign(i)-l,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const v=this.anchorStyleFunc();v&&f.forEach(_=>{v(_)}),(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=""),ww.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return _w.Node.prototype.toObject.call(this)}clone(e){var r=_w.Node.prototype.clone.call(this,e);return r}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};ip.Transformer=vt;function JT(t){return t instanceof Array||Pt.Util.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){th.indexOf(e)===-1&&Pt.Util.warn("Unknown anchor name: "+e+". Available names are: "+th.join(", "))}),t||[]}vt.prototype.className="Transformer";(0,VT._registerNode)(vt);St.Factory.addGetterSetter(vt,"enabledAnchors",th,JT);St.Factory.addGetterSetter(vt,"flipEnabled",!0,(0,so.getBooleanValidator)());St.Factory.addGetterSetter(vt,"resizeEnabled",!0);St.Factory.addGetterSetter(vt,"anchorSize",10,(0,so.getNumberValidator)());St.Factory.addGetterSetter(vt,"rotateEnabled",!0);St.Factory.addGetterSetter(vt,"rotationSnaps",[]);St.Factory.addGetterSetter(vt,"rotateAnchorOffset",50,(0,so.getNumberValidator)());St.Factory.addGetterSetter(vt,"rotateAnchorCursor","crosshair");St.Factory.addGetterSetter(vt,"rotationSnapTolerance",5,(0,so.getNumberValidator)());St.Factory.addGetterSetter(vt,"borderEnabled",!0);St.Factory.addGetterSetter(vt,"anchorStroke","rgb(0, 161, 255)");St.Factory.addGetterSetter(vt,"anchorStrokeWidth",1,(0,so.getNumberValidator)());St.Factory.addGetterSetter(vt,"anchorFill","white");St.Factory.addGetterSetter(vt,"anchorCornerRadius",0,(0,so.getNumberValidator)());St.Factory.addGetterSetter(vt,"borderStroke","rgb(0, 161, 255)");St.Factory.addGetterSetter(vt,"borderStrokeWidth",1,(0,so.getNumberValidator)());St.Factory.addGetterSetter(vt,"borderDash");St.Factory.addGetterSetter(vt,"keepRatio",!0);St.Factory.addGetterSetter(vt,"shiftBehavior","default");St.Factory.addGetterSetter(vt,"centeredScaling",!1);St.Factory.addGetterSetter(vt,"ignoreStroke",!1);St.Factory.addGetterSetter(vt,"padding",0,(0,so.getNumberValidator)());St.Factory.addGetterSetter(vt,"node");St.Factory.addGetterSetter(vt,"nodes");St.Factory.addGetterSetter(vt,"boundBoxFunc");St.Factory.addGetterSetter(vt,"anchorDragBoundFunc");St.Factory.addGetterSetter(vt,"anchorStyleFunc");St.Factory.addGetterSetter(vt,"shouldOverdrawWholeArea",!1);St.Factory.addGetterSetter(vt,"useSingleNodeRotation",!0);St.Factory.backCompat(vt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var ap={};Object.defineProperty(ap,"__esModule",{value:!0});ap.Wedge=void 0;const op=st,eC=cr,tC=lt,e8=He,rC=lt;let da=class extends eC.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,tC.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)}};ap.Wedge=da;da.prototype.className="Wedge";da.prototype._centroid=!0;da.prototype._attrsAffectingSize=["radius"];(0,rC._registerNode)(da);op.Factory.addGetterSetter(da,"radius",0,(0,e8.getNumberValidator)());op.Factory.addGetterSetter(da,"angle",0,(0,e8.getNumberValidator)());op.Factory.addGetterSetter(da,"clockwise",!1);op.Factory.backCompat(da,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var lp={};Object.defineProperty(lp,"__esModule",{value:!0});lp.Blur=void 0;const Ow=st,nC=Gt,iC=He;function xw(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var aC=[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],oC=[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 lC(t,e){var r=t.data,n=t.width,i=t.height,a,o,l,u,f,v,_,g,h,w,E,S,b,p,d,m,y,x,P,O,N,T,R,M,D=e+e+1,G=n-1,F=i-1,K=e+1,B=K*(K+1)/2,$=new xw,W=null,C=$,A=null,j=null,z=aC[e],H=oC[e];for(l=1;l<D;l++)C=C.next=new xw,l===K&&(W=C);for(C.next=$,_=v=0,o=0;o<i;o++){for(m=y=x=P=g=h=w=E=0,S=K*(O=r[v]),b=K*(N=r[v+1]),p=K*(T=r[v+2]),d=K*(R=r[v+3]),g+=B*O,h+=B*N,w+=B*T,E+=B*R,C=$,l=0;l<K;l++)C.r=O,C.g=N,C.b=T,C.a=R,C=C.next;for(l=1;l<K;l++)u=v+((G<l?G:l)<<2),g+=(C.r=O=r[u])*(M=K-l),h+=(C.g=N=r[u+1])*M,w+=(C.b=T=r[u+2])*M,E+=(C.a=R=r[u+3])*M,m+=O,y+=N,x+=T,P+=R,C=C.next;for(A=$,j=W,a=0;a<n;a++)r[v+3]=R=E*z>>H,R!==0?(R=255/R,r[v]=(g*z>>H)*R,r[v+1]=(h*z>>H)*R,r[v+2]=(w*z>>H)*R):r[v]=r[v+1]=r[v+2]=0,g-=S,h-=b,w-=p,E-=d,S-=A.r,b-=A.g,p-=A.b,d-=A.a,u=_+((u=a+e+1)<G?u:G)<<2,m+=A.r=r[u],y+=A.g=r[u+1],x+=A.b=r[u+2],P+=A.a=r[u+3],g+=m,h+=y,w+=x,E+=P,A=A.next,S+=O=j.r,b+=N=j.g,p+=T=j.b,d+=R=j.a,m-=O,y-=N,x-=T,P-=R,j=j.next,v+=4;_+=n}for(a=0;a<n;a++){for(y=x=P=m=h=w=E=g=0,v=a<<2,S=K*(O=r[v]),b=K*(N=r[v+1]),p=K*(T=r[v+2]),d=K*(R=r[v+3]),g+=B*O,h+=B*N,w+=B*T,E+=B*R,C=$,l=0;l<K;l++)C.r=O,C.g=N,C.b=T,C.a=R,C=C.next;for(f=n,l=1;l<=e;l++)v=f+a<<2,g+=(C.r=O=r[v])*(M=K-l),h+=(C.g=N=r[v+1])*M,w+=(C.b=T=r[v+2])*M,E+=(C.a=R=r[v+3])*M,m+=O,y+=N,x+=T,P+=R,C=C.next,l<F&&(f+=n);for(v=a,A=$,j=W,o=0;o<i;o++)u=v<<2,r[u+3]=R=E*z>>H,R>0?(R=255/R,r[u]=(g*z>>H)*R,r[u+1]=(h*z>>H)*R,r[u+2]=(w*z>>H)*R):r[u]=r[u+1]=r[u+2]=0,g-=S,h-=b,w-=p,E-=d,S-=A.r,b-=A.g,p-=A.b,d-=A.a,u=a+((u=o+K)<F?u:F)*n<<2,g+=m+=A.r=r[u],h+=y+=A.g=r[u+1],w+=x+=A.b=r[u+2],E+=P+=A.a=r[u+3],A=A.next,S+=O=j.r,b+=N=j.g,p+=T=j.b,d+=R=j.a,m-=O,y-=N,x-=T,P-=R,j=j.next,v+=n}}const sC=function(e){var r=Math.round(this.blurRadius());r>0&&lC(e,r)};lp.Blur=sC;Ow.Factory.addGetterSetter(nC.Node,"blurRadius",0,(0,iC.getNumberValidator)(),Ow.Factory.afterSetFilter);var sp={};Object.defineProperty(sp,"__esModule",{value:!0});sp.Brighten=void 0;const Pw=st,uC=Gt,cC=He,fC=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};sp.Brighten=fC;Pw.Factory.addGetterSetter(uC.Node,"brightness",0,(0,cC.getNumberValidator)(),Pw.Factory.afterSetFilter);var up={};Object.defineProperty(up,"__esModule",{value:!0});up.Contrast=void 0;const kw=st,dC=Gt,hC=He,pC=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};up.Contrast=pC;kw.Factory.addGetterSetter(dC.Node,"contrast",0,(0,hC.getNumberValidator)(),kw.Factory.afterSetFilter);var cp={};Object.defineProperty(cp,"__esModule",{value:!0});cp.Emboss=void 0;const Qa=st,fp=Gt,gC=Yt,t8=He,vC=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,v=u*4,_=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:gC.Util.error("Unknown emboss direction: "+n)}do{var g=(_-1)*v,h=a;_+h<1&&(h=0),_+h>f&&(h=0);var w=(_-1+h)*u*4,E=u;do{var S=g+(E-1)*4,b=o;E+b<1&&(b=0),E+b>u&&(b=0);var p=w+(E-1+b)*4,d=l[S]-l[p],m=l[S+1]-l[p+1],y=l[S+2]-l[p+2],x=d,P=x>0?x:-x,O=m>0?m:-m,N=y>0?y:-y;if(O>P&&(x=m),N>P&&(x=y),x*=e,i){var T=l[S]+x,R=l[S+1]+x,M=l[S+2]+x;l[S]=T>255?255:T<0?0:T,l[S+1]=R>255?255:R<0?0:R,l[S+2]=M>255?255:M<0?0:M}else{var D=r-x;D<0?D=0:D>255&&(D=255),l[S]=l[S+1]=l[S+2]=D}}while(--E)}while(--_)};cp.Emboss=vC;Qa.Factory.addGetterSetter(fp.Node,"embossStrength",.5,(0,t8.getNumberValidator)(),Qa.Factory.afterSetFilter);Qa.Factory.addGetterSetter(fp.Node,"embossWhiteLevel",.5,(0,t8.getNumberValidator)(),Qa.Factory.afterSetFilter);Qa.Factory.addGetterSetter(fp.Node,"embossDirection","top-left",null,Qa.Factory.afterSetFilter);Qa.Factory.addGetterSetter(fp.Node,"embossBlend",!1,null,Qa.Factory.afterSetFilter);var dp={};Object.defineProperty(dp,"__esModule",{value:!0});dp.Enhance=void 0;const Aw=st,mC=Gt,yC=He;function jv(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 bC=function(t){var e=t.data,r=e.length,n=e[0],i=n,a,o=e[1],l=o,u,f=e[2],v=f,_,g,h=this.enhance();if(h!==0){for(g=0;g<r;g+=4)a=e[g+0],a<n?n=a:a>i&&(i=a),u=e[g+1],u<o?o=u:u>l&&(l=u),_=e[g+2],_<f?f=_:_>v&&(v=_);i===n&&(i=255,n=0),l===o&&(l=255,o=0),v===f&&(v=255,f=0);var w,E,S,b,p,d,m,y,x;for(h>0?(E=i+h*(255-i),S=n-h*(n-0),p=l+h*(255-l),d=o-h*(o-0),y=v+h*(255-v),x=f-h*(f-0)):(w=(i+n)*.5,E=i+h*(i-w),S=n+h*(n-w),b=(l+o)*.5,p=l+h*(l-b),d=o+h*(o-b),m=(v+f)*.5,y=v+h*(v-m),x=f+h*(f-m)),g=0;g<r;g+=4)e[g+0]=jv(e[g+0],n,i,S,E),e[g+1]=jv(e[g+1],o,l,d,p),e[g+2]=jv(e[g+2],f,v,x,y)}};dp.Enhance=bC;Aw.Factory.addGetterSetter(mC.Node,"enhance",0,(0,yC.getNumberValidator)(),Aw.Factory.afterSetFilter);var hp={};Object.defineProperty(hp,"__esModule",{value:!0});hp.Grayscale=void 0;const _C=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};hp.Grayscale=_C;var pp={};Object.defineProperty(pp,"__esModule",{value:!0});pp.HSL=void 0;const _s=st,m1=Gt,y1=He;_s.Factory.addGetterSetter(m1.Node,"hue",0,(0,y1.getNumberValidator)(),_s.Factory.afterSetFilter);_s.Factory.addGetterSetter(m1.Node,"saturation",0,(0,y1.getNumberValidator)(),_s.Factory.afterSetFilter);_s.Factory.addGetterSetter(m1.Node,"luminance",0,(0,y1.getNumberValidator)(),_s.Factory.afterSetFilter);const wC=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),v=.299*n+.701*u+.167*f,_=.587*n-.587*u+.33*f,g=.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,b=.587*n-.586*u-1.05*f,p=.114*n+.886*u-.2*f,d,m,y,x;for(l=0;l<r;l+=4)d=e[l+0],m=e[l+1],y=e[l+2],x=e[l+3],e[l+0]=v*d+_*m+g*y+o,e[l+1]=h*d+w*m+E*y+o,e[l+2]=S*d+b*m+p*y+o,e[l+3]=x};pp.HSL=wC;var gp={};Object.defineProperty(gp,"__esModule",{value:!0});gp.HSV=void 0;const ws=st,b1=Gt,_1=He,SC=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,v=.587*n-.587*l+.33*u,_=.114*n-.114*l-.497*u,g=.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,b=.114*n+.886*l-.2*u,p,d,m,y;for(o=0;o<r;o+=4)p=e[o+0],d=e[o+1],m=e[o+2],y=e[o+3],e[o+0]=f*p+v*d+_*m,e[o+1]=g*p+h*d+w*m,e[o+2]=E*p+S*d+b*m,e[o+3]=y};gp.HSV=SC;ws.Factory.addGetterSetter(b1.Node,"hue",0,(0,_1.getNumberValidator)(),ws.Factory.afterSetFilter);ws.Factory.addGetterSetter(b1.Node,"saturation",0,(0,_1.getNumberValidator)(),ws.Factory.afterSetFilter);ws.Factory.addGetterSetter(b1.Node,"value",0,(0,_1.getNumberValidator)(),ws.Factory.afterSetFilter);var vp={};Object.defineProperty(vp,"__esModule",{value:!0});vp.Invert=void 0;const EC=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]};vp.Invert=EC;var mp={};Object.defineProperty(mp,"__esModule",{value:!0});mp.Kaleidoscope=void 0;const rh=st,r8=Gt,Tw=Yt,n8=He;var OC=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,v,_,g=0,h=0,w=0,E=0,S,b=Math.sqrt(l*l+u*u);v=a-l,_=o-u,S=Math.sqrt(v*v+_*_),b=S>b?S:b;var p=o,d=a,m,y,x=360/d*Math.PI/180,P,O;for(y=0;y<d;y+=1)for(P=Math.sin(y*x),O=Math.cos(y*x),m=0;m<p;m+=1)v=Math.floor(l+b*m/p*O),_=Math.floor(u+b*m/p*P),f=(_*a+v)*4,g=n[f+0],h=n[f+1],w=n[f+2],E=n[f+3],f=(y+m*a)*4,i[f+0]=g,i[f+1]=h,i[f+2]=w,i[f+3]=E},xC=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,v,_,g,h,w=0,E=0,S=0,b=0,p,d=Math.sqrt(l*l+u*u);v=a-l,_=o-u,p=Math.sqrt(v*v+_*_),d=p>d?p:d;var m=o,y=a,x,P,O=r.polarRotation||0,N,T;for(v=0;v<a;v+=1)for(_=0;_<o;_+=1)g=v-l,h=_-u,x=Math.sqrt(g*g+h*h)*m/d,P=(Math.atan2(h,g)*180/Math.PI+360+O)%360,P=P*y/360,N=Math.floor(P),T=Math.floor(x),f=(T*a+N)*4,w=n[f+0],E=n[f+1],S=n[f+2],b=n[f+3],f=(_*a+v)*4,i[f+0]=w,i[f+1]=E,i[f+2]=S,i[f+3]=b};const PC=function(t){var e=t.width,r=t.height,n,i,a,o,l,u,f,v,_,g,h=Math.round(this.kaleidoscopePower()),w=Math.round(this.kaleidoscopeAngle()),E=Math.floor(e*(w%360)/360);if(!(h<1)){var S=Tw.Util.createCanvasElement();S.width=e,S.height=r;var b=S.getContext("2d").getImageData(0,0,e,r);Tw.Util.releaseCanvas(S),OC(t,b,{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,m=0,y=d,x=1;for(E+p>e&&(m=d,y=0,x=-1),i=0;i<r;i+=1)for(n=m;n!==y;n+=x)a=Math.round(n+E)%e,_=(e*i+a)*4,l=b.data[_+0],u=b.data[_+1],f=b.data[_+2],v=b.data[_+3],g=(e*i+n)*4,b.data[g+0]=l,b.data[g+1]=u,b.data[g+2]=f,b.data[g+3]=v;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)_=(e*i+n)*4,l=b.data[_+0],u=b.data[_+1],f=b.data[_+2],v=b.data[_+3],g=(e*i+d*2-n-1)*4,b.data[g+0]=l,b.data[g+1]=u,b.data[g+2]=f,b.data[g+3]=v;d*=2}xC(b,t,{polarRotation:0})}};mp.Kaleidoscope=PC;rh.Factory.addGetterSetter(r8.Node,"kaleidoscopePower",2,(0,n8.getNumberValidator)(),rh.Factory.afterSetFilter);rh.Factory.addGetterSetter(r8.Node,"kaleidoscopeAngle",0,(0,n8.getNumberValidator)(),rh.Factory.afterSetFilter);var yp={};Object.defineProperty(yp,"__esModule",{value:!0});yp.Mask=void 0;const Cw=st,kC=Gt,AC=He;function ed(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 mu(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 TC(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 CC(t,e){var r=ed(t,0,0),n=ed(t,t.width-1,0),i=ed(t,0,t.height-1),a=ed(t,t.width-1,t.height-1),o=e||10;if(mu(r,n)<o&&mu(n,a)<o&&mu(a,i)<o&&mu(i,r)<o){for(var l=TC([n,r,a,i]),u=[],f=0;f<t.width*t.height;f++){var v=mu(l,[t.data[f*4],t.data[f*4+1],t.data[f*4+2]]);u[f]=v<o?0:255}return u}}function RC(t,e){for(var r=0;r<t.width*t.height;r++)t.data[4*r+3]=e[r]}function NC(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,v=0,_=0;_<i;_++)for(var g=0;g<i;g++){var h=l+_-a,w=u+g-a;if(h>=0&&h<r&&w>=0&&w<e){var E=h*e+w,S=n[_*i+g];v+=t[E]*S}}o[f]=v===255*8?255:0}return o}function MC(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,v=0,_=0;_<i;_++)for(var g=0;g<i;g++){var h=l+_-a,w=u+g-a;if(h>=0&&h<r&&w>=0&&w<e){var E=h*e+w,S=n[_*i+g];v+=t[E]*S}}o[f]=v>=255*4?255:0}return o}function LC(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,v=0,_=0;_<i;_++)for(var g=0;g<i;g++){var h=l+_-a,w=u+g-a;if(h>=0&&h<r&&w>=0&&w<e){var E=h*e+w,S=n[_*i+g];v+=t[E]*S}}o[f]=v}return o}const IC=function(t){var e=this.threshold(),r=CC(t,e);return r&&(r=NC(r,t.width,t.height),r=MC(r,t.width,t.height),r=LC(r,t.width,t.height),RC(t,r)),t};yp.Mask=IC;Cw.Factory.addGetterSetter(kC.Node,"threshold",0,(0,AC.getNumberValidator)(),Cw.Factory.afterSetFilter);var bp={};Object.defineProperty(bp,"__esModule",{value:!0});bp.Noise=void 0;const Rw=st,jC=Gt,DC=He,FC=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()};bp.Noise=FC;Rw.Factory.addGetterSetter(jC.Node,"noise",.2,(0,DC.getNumberValidator)(),Rw.Factory.afterSetFilter);var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.Pixelate=void 0;const Nw=st,zC=Yt,BC=Gt,UC=He,GC=function(t){var e=Math.ceil(this.pixelSize()),r=t.width,n=t.height,i,a,o,l,u,f,v,_=Math.ceil(r/e),g=Math.ceil(n/e),h,w,E,S,b,p,d,m=t.data;if(e<=0){zC.Util.error("pixelSize value can not be <= 0");return}for(b=0;b<_;b+=1)for(p=0;p<g;p+=1){for(l=0,u=0,f=0,v=0,h=b*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+=m[o+0],u+=m[o+1],f+=m[o+2],v+=m[o+3],d+=1);for(l=l/d,u=u/d,f=f/d,v=v/d,i=h;i<w;i+=1)if(!(i>=r))for(a=E;a<S;a+=1)a>=n||(o=(r*a+i)*4,m[o+0]=l,m[o+1]=u,m[o+2]=f,m[o+3]=v)}};_p.Pixelate=GC;Nw.Factory.addGetterSetter(BC.Node,"pixelSize",8,(0,UC.getNumberValidator)(),Nw.Factory.afterSetFilter);var wp={};Object.defineProperty(wp,"__esModule",{value:!0});wp.Posterize=void 0;const Mw=st,HC=Gt,VC=He,qC=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};wp.Posterize=qC;Mw.Factory.addGetterSetter(HC.Node,"levels",.5,(0,VC.getNumberValidator)(),Mw.Factory.afterSetFilter);var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});Sp.RGB=void 0;const nh=st,w1=Gt,$C=He,WC=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]};Sp.RGB=WC;nh.Factory.addGetterSetter(w1.Node,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});nh.Factory.addGetterSetter(w1.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});nh.Factory.addGetterSetter(w1.Node,"blue",0,$C.RGBComponent,nh.Factory.afterSetFilter);var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.RGBA=void 0;const ic=st,Op=Gt,YC=He,KC=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};Ep.RGBA=KC;ic.Factory.addGetterSetter(Op.Node,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});ic.Factory.addGetterSetter(Op.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});ic.Factory.addGetterSetter(Op.Node,"blue",0,YC.RGBComponent,ic.Factory.afterSetFilter);ic.Factory.addGetterSetter(Op.Node,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});var xp={};Object.defineProperty(xp,"__esModule",{value:!0});xp.Sepia=void 0;const XC=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)};xp.Sepia=XC;var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});Pp.Solarize=void 0;const QC=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],v=e[u+1],_=e[u+2];f>127&&(f=255-f),v>127&&(v=255-v),_>127&&(_=255-_),e[u]=f,e[u+1]=v,e[u+2]=_}while(--l)}while(--a)};Pp.Solarize=QC;var kp={};Object.defineProperty(kp,"__esModule",{value:!0});kp.Threshold=void 0;const Lw=st,ZC=Gt,JC=He,eR=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};kp.Threshold=eR;Lw.Factory.addGetterSetter(ZC.Node,"threshold",.5,(0,JC.getNumberValidator)(),Lw.Factory.afterSetFilter);Object.defineProperty(jh,"__esModule",{value:!0});jh.Konva=void 0;const Iw=Jd,tR=Gh,rR=qh,nR=Yh,iR=Kh,aR=Xh,jw=bs,oR=Pc,lR=js,sR=Tc,uR=Jh,cR=ep,fR=tp,dR=rp,hR=Ko,pR=np,gR=ip,vR=ap,mR=lp,yR=sp,bR=up,_R=cp,wR=dp,SR=hp,ER=pp,OR=gp,xR=vp,PR=mp,kR=yp,AR=bp,TR=_p,CR=wp,RR=Sp,NR=Ep,MR=xp,LR=Pp,IR=kp;jh.Konva=Iw.Konva.Util._assign(Iw.Konva,{Arc:tR.Arc,Arrow:rR.Arrow,Circle:nR.Circle,Ellipse:iR.Ellipse,Image:aR.Image,Label:jw.Label,Tag:jw.Tag,Line:oR.Line,Path:lR.Path,Rect:sR.Rect,RegularPolygon:uR.RegularPolygon,Ring:cR.Ring,Sprite:fR.Sprite,Star:dR.Star,Text:hR.Text,TextPath:pR.TextPath,Transformer:gR.Transformer,Wedge:vR.Wedge,Filters:{Blur:mR.Blur,Brighten:yR.Brighten,Contrast:bR.Contrast,Emboss:_R.Emboss,Enhance:wR.Enhance,Grayscale:SR.Grayscale,HSL:ER.HSL,HSV:OR.HSV,Invert:xR.Invert,Kaleidoscope:PR.Kaleidoscope,Mask:kR.Mask,Noise:AR.Noise,Pixelate:TR.Pixelate,Posterize:CR.Posterize,RGB:RR.RGB,RGBA:NR.RGBA,Sepia:MR.Sepia,Solarize:LR.Solarize,Threshold:IR.Threshold}});var jR=l1.exports;Object.defineProperty(jR,"__esModule",{value:!0});const DR=jh;l1.exports=DR.Konva;var ci=l1.exports,Um={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;var r=Jd;Object.defineProperty(e,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=Jd;t.exports=n.Konva})(Um,Um.exports);var FR=Um.exports;const ac=uh(FR);var i8={exports:{}};/**
|
|
44
|
+
* @license React
|
|
45
|
+
* react-reconciler.production.min.js
|
|
46
|
+
*
|
|
47
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the MIT license found in the
|
|
50
|
+
* LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/var zR=function(e){var r={},n=at,i=Eu,a=Object.assign;function o(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,k=1;k<arguments.length;k++)c+="&args[]="+encodeURIComponent(arguments[k]);return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),f=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),g=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"),b=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),y=Symbol.iterator;function x(s){return s===null||typeof s!="object"?null:(s=y&&s[y]||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 v:return"Fragment";case f:return"Portal";case g:return"Profiler";case _:return"StrictMode";case S:return"Suspense";case b: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===_?"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 N(s){var c=s,k=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,c.flags&4098&&(k=c.return),s=c.return;while(s)}return c.tag===3?k:null}function T(s){if(N(s)!==s)throw Error(o(188))}function R(s){var c=s.alternate;if(!c){if(c=N(s),c===null)throw Error(o(188));return c!==s?null:s}for(var k=s,L=c;;){var I=k.return;if(I===null)break;var V=I.alternate;if(V===null){if(L=I.return,L!==null){k=L;continue}break}if(I.child===V.child){for(V=I.child;V;){if(V===k)return T(I),s;if(V===L)return T(I),c;V=V.sibling}throw Error(o(188))}if(k.return!==L.return)k=I,L=V;else{for(var J=!1,ie=I.child;ie;){if(ie===k){J=!0,k=I,L=V;break}if(ie===L){J=!0,L=I,k=V;break}ie=ie.sibling}if(!J){for(ie=V.child;ie;){if(ie===k){J=!0,k=V,L=I;break}if(ie===L){J=!0,L=V,k=I;break}ie=ie.sibling}if(!J)throw Error(o(189))}}if(k.alternate!==L)throw Error(o(190))}if(k.tag!==3)throw Error(o(188));return k.stateNode.current===k?s:c}function M(s){return s=R(s),s!==null?D(s):null}function D(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=D(s);if(c!==null)return c;s=s.sibling}return null}function G(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){if(s.tag!==4){var c=G(s);if(c!==null)return c}s=s.sibling}return null}var F=Array.isArray,K=e.getPublicInstance,B=e.getRootHostContext,$=e.getChildHostContext,W=e.prepareForCommit,C=e.resetAfterCommit,A=e.createInstance,j=e.appendInitialChild,z=e.finalizeInitialChildren,H=e.prepareUpdate,Y=e.shouldSetTextContent,q=e.createTextInstance,U=e.scheduleTimeout,X=e.cancelTimeout,Q=e.noTimeout,Z=e.isPrimaryRenderer,re=e.supportsMutation,ee=e.supportsPersistence,le=e.supportsHydration,ce=e.getInstanceFromNode,_e=e.preparePortalMount,Le=e.getCurrentEventPriority,Oe=e.detachDeletedInstance,ae=e.supportsMicrotasks,de=e.scheduleMicrotask,ye=e.supportsTestSelectors,we=e.findFiberRoot,te=e.getBoundingRect,ue=e.getTextContent,fe=e.isHiddenSubtree,be=e.matchAccessibilityRole,Te=e.setFocusIfFocusable,Ye=e.setupIntersectionObserver,Ke=e.appendChild,Ce=e.appendChildToContainer,Be=e.commitTextUpdate,et=e.commitMount,Xe=e.commitUpdate,se=e.insertBefore,ne=e.insertInContainerBefore,Ae=e.removeChild,Me=e.removeChildFromContainer,ve=e.resetTextContent,Re=e.hideInstance,Se=e.hideTextInstance,$e=e.unhideInstance,xt=e.unhideTextInstance,Ee=e.clearContainer,qe=e.cloneInstance,Ze=e.createContainerChildSet,pt=e.appendChildToContainerChildSet,Ne=e.finalizeContainerChildren,Qe=e.replaceContainerChildren,ht=e.cloneHiddenInstance,wt=e.cloneHiddenTextInstance,Ft=e.canHydrateInstance,zr=e.canHydrateTextInstance,Br=e.canHydrateSuspenseInstance,ir=e.isSuspenseInstancePending,fn=e.isSuspenseInstanceFallback,Gn=e.getSuspenseInstanceFallbackErrorDetails,fi=e.registerSuspenseInstanceRetry,kr=e.getNextHydratableSibling,po=e.getFirstHydratableChild,ga=e.getFirstHydratableChildWithinContainer,Us=e.getFirstHydratableChildWithinSuspenseInstance,Ii=e.hydrateInstance,va=e.hydrateTextInstance,vl=e.hydrateSuspenseInstance,jp=e.getNextHydratableInstanceAfterSuspenseInstance,Ic=e.commitHydratedContainer,WE=e.commitHydratedSuspenseInstance,YE=e.clearSuspenseBoundary,KE=e.clearSuspenseBoundaryFromContainer,XE=e.shouldDeleteUnhydratedTailInstances,QE=e.didNotMatchHydratedContainerTextInstance,ZE=e.didNotMatchHydratedTextInstance,Dp;function Gs(s){if(Dp===void 0)try{throw Error()}catch(k){var c=k.stack.trim().match(/\n( *(at )?)/);Dp=c&&c[1]||""}return`
|
|
52
|
+
`+Dp+s}var Fp=!1;function zp(s,c){if(!s||Fp)return"";Fp=!0;var k=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(Pe){var L=Pe}Reflect.construct(s,[],c)}else{try{c.call()}catch(Pe){L=Pe}s.call(c.prototype)}else{try{throw Error()}catch(Pe){L=Pe}s()}}catch(Pe){if(Pe&&L&&typeof Pe.stack=="string"){for(var I=Pe.stack.split(`
|
|
53
|
+
`),V=L.stack.split(`
|
|
54
|
+
`),J=I.length-1,ie=V.length-1;1<=J&&0<=ie&&I[J]!==V[ie];)ie--;for(;1<=J&&0<=ie;J--,ie--)if(I[J]!==V[ie]){if(J!==1||ie!==1)do if(J--,ie--,0>ie||I[J]!==V[ie]){var pe=`
|
|
55
|
+
`+I[J].replace(" at new "," at ");return s.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",s.displayName)),pe}while(1<=J&&0<=ie);break}}}finally{Fp=!1,Error.prepareStackTrace=k}return(s=s?s.displayName||s.name:"")?Gs(s):""}var JE=Object.prototype.hasOwnProperty,Bp=[],ml=-1;function ma(s){return{current:s}}function Mt(s){0>ml||(s.current=Bp[ml],Bp[ml]=null,ml--)}function Ct(s,c){ml++,Bp[ml]=s.current,s.current=c}var ya={},Ar=ma(ya),Yr=ma(!1),go=ya;function yl(s,c){var k=s.type.contextTypes;if(!k)return ya;var L=s.stateNode;if(L&&L.__reactInternalMemoizedUnmaskedChildContext===c)return L.__reactInternalMemoizedMaskedChildContext;var I={},V;for(V in k)I[V]=c[V];return L&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=I),I}function Kr(s){return s=s.childContextTypes,s!=null}function jc(){Mt(Yr),Mt(Ar)}function K1(s,c,k){if(Ar.current!==ya)throw Error(o(168));Ct(Ar,c),Ct(Yr,k)}function X1(s,c,k){var L=s.stateNode;if(c=c.childContextTypes,typeof L.getChildContext!="function")return k;L=L.getChildContext();for(var I in L)if(!(I in c))throw Error(o(108,O(s)||"Unknown",I));return a({},k,L)}function Dc(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ya,go=Ar.current,Ct(Ar,s),Ct(Yr,Yr.current),!0}function Q1(s,c,k){var L=s.stateNode;if(!L)throw Error(o(169));k?(s=X1(s,c,go),L.__reactInternalMemoizedMergedChildContext=s,Mt(Yr),Mt(Ar),Ct(Ar,s)):Mt(Yr),Ct(Yr,k)}var Hn=Math.clz32?Math.clz32:r9,e9=Math.log,t9=Math.LN2;function r9(s){return s>>>=0,s===0?32:31-(e9(s)/t9|0)|0}var Fc=64,zc=4194304;function Hs(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 Bc(s,c){var k=s.pendingLanes;if(k===0)return 0;var L=0,I=s.suspendedLanes,V=s.pingedLanes,J=k&268435455;if(J!==0){var ie=J&~I;ie!==0?L=Hs(ie):(V&=J,V!==0&&(L=Hs(V)))}else J=k&~I,J!==0?L=Hs(J):V!==0&&(L=Hs(V));if(L===0)return 0;if(c!==0&&c!==L&&!(c&I)&&(I=L&-L,V=c&-c,I>=V||I===16&&(V&4194240)!==0))return c;if(L&4&&(L|=k&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=L;0<c;)k=31-Hn(c),I=1<<k,L|=s[k],c&=~I;return L}function n9(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 i9(s,c){for(var k=s.suspendedLanes,L=s.pingedLanes,I=s.expirationTimes,V=s.pendingLanes;0<V;){var J=31-Hn(V),ie=1<<J,pe=I[J];pe===-1?(!(ie&k)||ie&L)&&(I[J]=n9(ie,c)):pe<=c&&(s.expiredLanes|=ie),V&=~ie}}function Up(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function Z1(){var s=Fc;return Fc<<=1,!(Fc&4194240)&&(Fc=64),s}function Gp(s){for(var c=[],k=0;31>k;k++)c.push(s);return c}function Vs(s,c,k){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-Hn(c),s[c]=k}function a9(s,c){var k=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 L=s.eventTimes;for(s=s.expirationTimes;0<k;){var I=31-Hn(k),V=1<<I;c[I]=0,L[I]=-1,s[I]=-1,k&=~V}}function Hp(s,c){var k=s.entangledLanes|=c;for(s=s.entanglements;k;){var L=31-Hn(k),I=1<<L;I&c|s[L]&c&&(s[L]|=c),k&=~I}}var mt=0;function J1(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var Vp=i.unstable_scheduleCallback,e2=i.unstable_cancelCallback,o9=i.unstable_shouldYield,l9=i.unstable_requestPaint,dr=i.unstable_now,qp=i.unstable_ImmediatePriority,s9=i.unstable_UserBlockingPriority,$p=i.unstable_NormalPriority,u9=i.unstable_IdlePriority,Uc=null,di=null;function c9(s){if(di&&typeof di.onCommitFiberRoot=="function")try{di.onCommitFiberRoot(Uc,s,void 0,(s.current.flags&128)===128)}catch{}}function f9(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var Vn=typeof Object.is=="function"?Object.is:f9,ji=null,Gc=!1,Wp=!1;function t2(s){ji===null?ji=[s]:ji.push(s)}function d9(s){Gc=!0,t2(s)}function hi(){if(!Wp&&ji!==null){Wp=!0;var s=0,c=mt;try{var k=ji;for(mt=1;s<k.length;s++){var L=k[s];do L=L(!0);while(L!==null)}ji=null,Gc=!1}catch(I){throw ji!==null&&(ji=ji.slice(s+1)),Vp(qp,hi),I}finally{mt=c,Wp=!1}}return null}var bl=[],_l=0,Hc=null,Vc=0,On=[],xn=0,vo=null,Di=1,Fi="";function mo(s,c){bl[_l++]=Vc,bl[_l++]=Hc,Hc=s,Vc=c}function r2(s,c,k){On[xn++]=Di,On[xn++]=Fi,On[xn++]=vo,vo=s;var L=Di;s=Fi;var I=32-Hn(L)-1;L&=~(1<<I),k+=1;var V=32-Hn(c)+I;if(30<V){var J=I-I%5;V=(L&(1<<J)-1).toString(32),L>>=J,I-=J,Di=1<<32-Hn(c)+I|k<<I|L,Fi=V+s}else Di=1<<V|k<<I|L,Fi=s}function Yp(s){s.return!==null&&(mo(s,1),r2(s,1,0))}function Kp(s){for(;s===Hc;)Hc=bl[--_l],bl[_l]=null,Vc=bl[--_l],bl[_l]=null;for(;s===vo;)vo=On[--xn],On[xn]=null,Fi=On[--xn],On[xn]=null,Di=On[--xn],On[xn]=null}var dn=null,Pn=null,zt=!1,qs=!1,qn=null;function n2(s,c){var k=Rn(5,null,null,0);k.elementType="DELETED",k.stateNode=c,k.return=s,c=s.deletions,c===null?(s.deletions=[k],s.flags|=16):c.push(k)}function i2(s,c){switch(s.tag){case 5:return c=Ft(c,s.type,s.pendingProps),c!==null?(s.stateNode=c,dn=s,Pn=po(c),!0):!1;case 6:return c=zr(c,s.pendingProps),c!==null?(s.stateNode=c,dn=s,Pn=null,!0):!1;case 13:if(c=Br(c),c!==null){var k=vo!==null?{id:Di,overflow:Fi}:null;return s.memoizedState={dehydrated:c,treeContext:k,retryLane:1073741824},k=Rn(18,null,null,0),k.stateNode=c,k.return=s,s.child=k,dn=s,Pn=null,!0}return!1;default:return!1}}function Xp(s){return(s.mode&1)!==0&&(s.flags&128)===0}function Qp(s){if(zt){var c=Pn;if(c){var k=c;if(!i2(s,c)){if(Xp(s))throw Error(o(418));c=kr(k);var L=dn;c&&i2(s,c)?n2(L,k):(s.flags=s.flags&-4097|2,zt=!1,dn=s)}}else{if(Xp(s))throw Error(o(418));s.flags=s.flags&-4097|2,zt=!1,dn=s}}}function a2(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;dn=s}function qc(s){if(!le||s!==dn)return!1;if(!zt)return a2(s),zt=!0,!1;if(s.tag!==3&&(s.tag!==5||XE(s.type)&&!Y(s.type,s.memoizedProps))){var c=Pn;if(c){if(Xp(s))throw o2(),Error(o(418));for(;c;)n2(s,c),c=kr(c)}}if(a2(s),s.tag===13){if(!le)throw Error(o(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));Pn=jp(s)}else Pn=dn?kr(s.stateNode):null;return!0}function o2(){for(var s=Pn;s;)s=kr(s)}function wl(){le&&(Pn=dn=null,qs=zt=!1)}function Zp(s){qn===null?qn=[s]:qn.push(s)}var h9=l.ReactCurrentBatchConfig;function $c(s,c){if(Vn(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var k=Object.keys(s),L=Object.keys(c);if(k.length!==L.length)return!1;for(L=0;L<k.length;L++){var I=k[L];if(!JE.call(c,I)||!Vn(s[I],c[I]))return!1}return!0}function p9(s){switch(s.tag){case 5:return Gs(s.type);case 16:return Gs("Lazy");case 13:return Gs("Suspense");case 19:return Gs("SuspenseList");case 0:case 2:case 15:return s=zp(s.type,!1),s;case 11:return s=zp(s.type.render,!1),s;case 1:return s=zp(s.type,!0),s;default:return""}}function $n(s,c){if(s&&s.defaultProps){c=a({},c),s=s.defaultProps;for(var k in s)c[k]===void 0&&(c[k]=s[k]);return c}return c}var Wc=ma(null),Yc=null,Sl=null,Jp=null;function eg(){Jp=Sl=Yc=null}function l2(s,c,k){Z?(Ct(Wc,c._currentValue),c._currentValue=k):(Ct(Wc,c._currentValue2),c._currentValue2=k)}function tg(s){var c=Wc.current;Mt(Wc),Z?s._currentValue=c:s._currentValue2=c}function rg(s,c,k){for(;s!==null;){var L=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,L!==null&&(L.childLanes|=c)):L!==null&&(L.childLanes&c)!==c&&(L.childLanes|=c),s===k)break;s=s.return}}function El(s,c){Yc=s,Jp=Sl=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&c&&(Xr=!0),s.firstContext=null)}function kn(s){var c=Z?s._currentValue:s._currentValue2;if(Jp!==s)if(s={context:s,memoizedValue:c,next:null},Sl===null){if(Yc===null)throw Error(o(308));Sl=s,Yc.dependencies={lanes:0,firstContext:s}}else Sl=Sl.next=s;return c}var yo=null;function ng(s){yo===null?yo=[s]:yo.push(s)}function s2(s,c,k,L){var I=c.interleaved;return I===null?(k.next=k,ng(c)):(k.next=I.next,I.next=k),c.interleaved=k,pi(s,L)}function pi(s,c){s.lanes|=c;var k=s.alternate;for(k!==null&&(k.lanes|=c),k=s,s=s.return;s!==null;)s.childLanes|=c,k=s.alternate,k!==null&&(k.childLanes|=c),k=s,s=s.return;return k.tag===3?k.stateNode:null}var ba=!1;function ig(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function u2(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 zi(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function _a(s,c,k){var L=s.updateQueue;if(L===null)return null;if(L=L.shared,ut&2){var I=L.pending;return I===null?c.next=c:(c.next=I.next,I.next=c),L.pending=c,pi(s,k)}return I=L.interleaved,I===null?(c.next=c,ng(L)):(c.next=I.next,I.next=c),L.interleaved=c,pi(s,k)}function Kc(s,c,k){if(c=c.updateQueue,c!==null&&(c=c.shared,(k&4194240)!==0)){var L=c.lanes;L&=s.pendingLanes,k|=L,c.lanes=k,Hp(s,k)}}function c2(s,c){var k=s.updateQueue,L=s.alternate;if(L!==null&&(L=L.updateQueue,k===L)){var I=null,V=null;if(k=k.firstBaseUpdate,k!==null){do{var J={eventTime:k.eventTime,lane:k.lane,tag:k.tag,payload:k.payload,callback:k.callback,next:null};V===null?I=V=J:V=V.next=J,k=k.next}while(k!==null);V===null?I=V=c:V=V.next=c}else I=V=c;k={baseState:L.baseState,firstBaseUpdate:I,lastBaseUpdate:V,shared:L.shared,effects:L.effects},s.updateQueue=k;return}s=k.lastBaseUpdate,s===null?k.firstBaseUpdate=c:s.next=c,k.lastBaseUpdate=c}function Xc(s,c,k,L){var I=s.updateQueue;ba=!1;var V=I.firstBaseUpdate,J=I.lastBaseUpdate,ie=I.shared.pending;if(ie!==null){I.shared.pending=null;var pe=ie,Pe=pe.next;pe.next=null,J===null?V=Pe:J.next=Pe,J=pe;var Ue=s.alternate;Ue!==null&&(Ue=Ue.updateQueue,ie=Ue.lastBaseUpdate,ie!==J&&(ie===null?Ue.firstBaseUpdate=Pe:ie.next=Pe,Ue.lastBaseUpdate=pe))}if(V!==null){var tt=I.baseState;J=0,Ue=Pe=pe=null,ie=V;do{var Ie=ie.lane,Lt=ie.eventTime;if((L&Ie)===Ie){Ue!==null&&(Ue=Ue.next={eventTime:Lt,lane:0,tag:ie.tag,payload:ie.payload,callback:ie.callback,next:null});e:{var At=s,Jr=ie;switch(Ie=c,Lt=k,Jr.tag){case 1:if(At=Jr.payload,typeof At=="function"){tt=At.call(Lt,tt,Ie);break e}tt=At;break e;case 3:At.flags=At.flags&-65537|128;case 0:if(At=Jr.payload,Ie=typeof At=="function"?At.call(Lt,tt,Ie):At,Ie==null)break e;tt=a({},tt,Ie);break e;case 2:ba=!0}}ie.callback!==null&&ie.lane!==0&&(s.flags|=64,Ie=I.effects,Ie===null?I.effects=[ie]:Ie.push(ie))}else Lt={eventTime:Lt,lane:Ie,tag:ie.tag,payload:ie.payload,callback:ie.callback,next:null},Ue===null?(Pe=Ue=Lt,pe=tt):Ue=Ue.next=Lt,J|=Ie;if(ie=ie.next,ie===null){if(ie=I.shared.pending,ie===null)break;Ie=ie,ie=Ie.next,Ie.next=null,I.lastBaseUpdate=Ie,I.shared.pending=null}}while(1);if(Ue===null&&(pe=tt),I.baseState=pe,I.firstBaseUpdate=Pe,I.lastBaseUpdate=Ue,c=I.shared.interleaved,c!==null){I=c;do J|=I.lane,I=I.next;while(I!==c)}else V===null&&(I.shared.lanes=0);_o|=J,s.lanes=J,s.memoizedState=tt}}function f2(s,c,k){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var L=s[c],I=L.callback;if(I!==null){if(L.callback=null,L=k,typeof I!="function")throw Error(o(191,I));I.call(L)}}}var d2=new n.Component().refs;function ag(s,c,k,L){c=s.memoizedState,k=k(L,c),k=k==null?c:a({},c,k),s.memoizedState=k,s.lanes===0&&(s.updateQueue.baseState=k)}var Qc={isMounted:function(s){return(s=s._reactInternals)?N(s)===s:!1},enqueueSetState:function(s,c,k){s=s._reactInternals;var L=Nr(),I=Ea(s),V=zi(L,I);V.payload=c,k!=null&&(V.callback=k),c=_a(s,V,I),c!==null&&(Cn(c,s,I,L),Kc(c,s,I))},enqueueReplaceState:function(s,c,k){s=s._reactInternals;var L=Nr(),I=Ea(s),V=zi(L,I);V.tag=1,V.payload=c,k!=null&&(V.callback=k),c=_a(s,V,I),c!==null&&(Cn(c,s,I,L),Kc(c,s,I))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var k=Nr(),L=Ea(s),I=zi(k,L);I.tag=2,c!=null&&(I.callback=c),c=_a(s,I,L),c!==null&&(Cn(c,s,L,k),Kc(c,s,L))}};function h2(s,c,k,L,I,V,J){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(L,V,J):c.prototype&&c.prototype.isPureReactComponent?!$c(k,L)||!$c(I,V):!0}function p2(s,c,k){var L=!1,I=ya,V=c.contextType;return typeof V=="object"&&V!==null?V=kn(V):(I=Kr(c)?go:Ar.current,L=c.contextTypes,V=(L=L!=null)?yl(s,I):ya),c=new c(k,V),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Qc,s.stateNode=c,c._reactInternals=s,L&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=I,s.__reactInternalMemoizedMaskedChildContext=V),c}function g2(s,c,k,L){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(k,L),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(k,L),c.state!==s&&Qc.enqueueReplaceState(c,c.state,null)}function og(s,c,k,L){var I=s.stateNode;I.props=k,I.state=s.memoizedState,I.refs=d2,ig(s);var V=c.contextType;typeof V=="object"&&V!==null?I.context=kn(V):(V=Kr(c)?go:Ar.current,I.context=yl(s,V)),I.state=s.memoizedState,V=c.getDerivedStateFromProps,typeof V=="function"&&(ag(s,c,V,k),I.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof I.getSnapshotBeforeUpdate=="function"||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(c=I.state,typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount(),c!==I.state&&Qc.enqueueReplaceState(I,I.state,null),Xc(s,k,I,L),I.state=s.memoizedState),typeof I.componentDidMount=="function"&&(s.flags|=4194308)}function $s(s,c,k){if(s=k.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(k._owner){if(k=k._owner,k){if(k.tag!==1)throw Error(o(309));var L=k.stateNode}if(!L)throw Error(o(147,s));var I=L,V=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===V?c.ref:(c=function(J){var ie=I.refs;ie===d2&&(ie=I.refs={}),J===null?delete ie[V]:ie[V]=J},c._stringRef=V,c)}if(typeof s!="string")throw Error(o(284));if(!k._owner)throw Error(o(290,s))}return s}function Zc(s,c){throw s=Object.prototype.toString.call(c),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function v2(s){var c=s._init;return c(s._payload)}function m2(s){function c(he,oe){if(s){var ge=he.deletions;ge===null?(he.deletions=[oe],he.flags|=16):ge.push(oe)}}function k(he,oe){if(!s)return null;for(;oe!==null;)c(he,oe),oe=oe.sibling;return null}function L(he,oe){for(he=new Map;oe!==null;)oe.key!==null?he.set(oe.key,oe):he.set(oe.index,oe),oe=oe.sibling;return he}function I(he,oe){return he=xa(he,oe),he.index=0,he.sibling=null,he}function V(he,oe,ge){return he.index=ge,s?(ge=he.alternate,ge!==null?(ge=ge.index,ge<oe?(he.flags|=2,oe):ge):(he.flags|=2,oe)):(he.flags|=1048576,oe)}function J(he){return s&&he.alternate===null&&(he.flags|=2),he}function ie(he,oe,ge,je){return oe===null||oe.tag!==6?(oe=Wg(ge,he.mode,je),oe.return=he,oe):(oe=I(oe,ge),oe.return=he,oe)}function pe(he,oe,ge,je){var We=ge.type;return We===v?Ue(he,oe,ge.props.children,je,ge.key):oe!==null&&(oe.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===d&&v2(We)===oe.type)?(je=I(oe,ge.props),je.ref=$s(he,oe,ge),je.return=he,je):(je=xf(ge.type,ge.key,ge.props,null,he.mode,je),je.ref=$s(he,oe,ge),je.return=he,je)}function Pe(he,oe,ge,je){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==ge.containerInfo||oe.stateNode.implementation!==ge.implementation?(oe=Yg(ge,he.mode,je),oe.return=he,oe):(oe=I(oe,ge.children||[]),oe.return=he,oe)}function Ue(he,oe,ge,je,We){return oe===null||oe.tag!==7?(oe=Oo(ge,he.mode,je,We),oe.return=he,oe):(oe=I(oe,ge),oe.return=he,oe)}function tt(he,oe,ge){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return oe=Wg(""+oe,he.mode,ge),oe.return=he,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case u:return ge=xf(oe.type,oe.key,oe.props,null,he.mode,ge),ge.ref=$s(he,null,oe),ge.return=he,ge;case f:return oe=Yg(oe,he.mode,ge),oe.return=he,oe;case d:var je=oe._init;return tt(he,je(oe._payload),ge)}if(F(oe)||x(oe))return oe=Oo(oe,he.mode,ge,null),oe.return=he,oe;Zc(he,oe)}return null}function Ie(he,oe,ge,je){var We=oe!==null?oe.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number")return We!==null?null:ie(he,oe,""+ge,je);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case u:return ge.key===We?pe(he,oe,ge,je):null;case f:return ge.key===We?Pe(he,oe,ge,je):null;case d:return We=ge._init,Ie(he,oe,We(ge._payload),je)}if(F(ge)||x(ge))return We!==null?null:Ue(he,oe,ge,je,null);Zc(he,ge)}return null}function Lt(he,oe,ge,je,We){if(typeof je=="string"&&je!==""||typeof je=="number")return he=he.get(ge)||null,ie(oe,he,""+je,We);if(typeof je=="object"&&je!==null){switch(je.$$typeof){case u:return he=he.get(je.key===null?ge:je.key)||null,pe(oe,he,je,We);case f:return he=he.get(je.key===null?ge:je.key)||null,Pe(oe,he,je,We);case d:var ot=je._init;return Lt(he,oe,ge,ot(je._payload),We)}if(F(je)||x(je))return he=he.get(ge)||null,Ue(oe,he,je,We,null);Zc(oe,je)}return null}function At(he,oe,ge,je){for(var We=null,ot=null,rt=oe,yt=oe=0,gr=null;rt!==null&&yt<ge.length;yt++){rt.index>yt?(gr=rt,rt=null):gr=rt.sibling;var bt=Ie(he,rt,ge[yt],je);if(bt===null){rt===null&&(rt=gr);break}s&&rt&&bt.alternate===null&&c(he,rt),oe=V(bt,oe,yt),ot===null?We=bt:ot.sibling=bt,ot=bt,rt=gr}if(yt===ge.length)return k(he,rt),zt&&mo(he,yt),We;if(rt===null){for(;yt<ge.length;yt++)rt=tt(he,ge[yt],je),rt!==null&&(oe=V(rt,oe,yt),ot===null?We=rt:ot.sibling=rt,ot=rt);return zt&&mo(he,yt),We}for(rt=L(he,rt);yt<ge.length;yt++)gr=Lt(rt,he,yt,ge[yt],je),gr!==null&&(s&&gr.alternate!==null&&rt.delete(gr.key===null?yt:gr.key),oe=V(gr,oe,yt),ot===null?We=gr:ot.sibling=gr,ot=gr);return s&&rt.forEach(function(Pa){return c(he,Pa)}),zt&&mo(he,yt),We}function Jr(he,oe,ge,je){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,rt=oe,yt=oe=0,gr=null,bt=ge.next();rt!==null&&!bt.done;yt++,bt=ge.next()){rt.index>yt?(gr=rt,rt=null):gr=rt.sibling;var Pa=Ie(he,rt,bt.value,je);if(Pa===null){rt===null&&(rt=gr);break}s&&rt&&Pa.alternate===null&&c(he,rt),oe=V(Pa,oe,yt),ot===null?We=Pa:ot.sibling=Pa,ot=Pa,rt=gr}if(bt.done)return k(he,rt),zt&&mo(he,yt),We;if(rt===null){for(;!bt.done;yt++,bt=ge.next())bt=tt(he,bt.value,je),bt!==null&&(oe=V(bt,oe,yt),ot===null?We=bt:ot.sibling=bt,ot=bt);return zt&&mo(he,yt),We}for(rt=L(he,rt);!bt.done;yt++,bt=ge.next())bt=Lt(rt,he,yt,bt.value,je),bt!==null&&(s&&bt.alternate!==null&&rt.delete(bt.key===null?yt:bt.key),oe=V(bt,oe,yt),ot===null?We=bt:ot.sibling=bt,ot=bt);return s&&rt.forEach(function(V9){return c(he,V9)}),zt&&mo(he,yt),We}function Gi(he,oe,ge,je){if(typeof ge=="object"&&ge!==null&&ge.type===v&&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===v){if(ot.tag===7){k(he,ot.sibling),oe=I(ot,ge.props.children),oe.return=he,he=oe;break e}}else if(ot.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===d&&v2(We)===ot.type){k(he,ot.sibling),oe=I(ot,ge.props),oe.ref=$s(he,ot,ge),oe.return=he,he=oe;break e}k(he,ot);break}else c(he,ot);ot=ot.sibling}ge.type===v?(oe=Oo(ge.props.children,he.mode,je,ge.key),oe.return=he,he=oe):(je=xf(ge.type,ge.key,ge.props,null,he.mode,je),je.ref=$s(he,oe,ge),je.return=he,he=je)}return J(he);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){k(he,oe.sibling),oe=I(oe,ge.children||[]),oe.return=he,he=oe;break e}else{k(he,oe);break}else c(he,oe);oe=oe.sibling}oe=Yg(ge,he.mode,je),oe.return=he,he=oe}return J(he);case d:return ot=ge._init,Gi(he,oe,ot(ge._payload),je)}if(F(ge))return At(he,oe,ge,je);if(x(ge))return Jr(he,oe,ge,je);Zc(he,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,oe!==null&&oe.tag===6?(k(he,oe.sibling),oe=I(oe,ge),oe.return=he,he=oe):(k(he,oe),oe=Wg(ge,he.mode,je),oe.return=he,he=oe),J(he)):k(he,oe)}return Gi}var Ol=m2(!0),y2=m2(!1),Ws={},An=ma(Ws),Ys=ma(Ws),xl=ma(Ws);function gi(s){if(s===Ws)throw Error(o(174));return s}function lg(s,c){Ct(xl,c),Ct(Ys,s),Ct(An,Ws),s=B(c),Mt(An),Ct(An,s)}function Pl(){Mt(An),Mt(Ys),Mt(xl)}function b2(s){var c=gi(xl.current),k=gi(An.current);c=$(k,s.type,c),k!==c&&(Ct(Ys,s),Ct(An,c))}function sg(s){Ys.current===s&&(Mt(An),Mt(Ys))}var Ht=ma(0);function Jc(s){for(var c=s;c!==null;){if(c.tag===13){var k=c.memoizedState;if(k!==null&&(k=k.dehydrated,k===null||ir(k)||fn(k)))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 ug=[];function cg(){for(var s=0;s<ug.length;s++){var c=ug[s];Z?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}ug.length=0}var ef=l.ReactCurrentDispatcher,fg=l.ReactCurrentBatchConfig,bo=0,Vt=null,ar=null,hr=null,tf=!1,Ks=!1,Xs=0,g9=0;function Tr(){throw Error(o(321))}function dg(s,c){if(c===null)return!1;for(var k=0;k<c.length&&k<s.length;k++)if(!Vn(s[k],c[k]))return!1;return!0}function hg(s,c,k,L,I,V){if(bo=V,Vt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,ef.current=s===null||s.memoizedState===null?b9:_9,s=k(L,I),Ks){V=0;do{if(Ks=!1,Xs=0,25<=V)throw Error(o(301));V+=1,hr=ar=null,c.updateQueue=null,ef.current=w9,s=k(L,I)}while(Ks)}if(ef.current=af,c=ar!==null&&ar.next!==null,bo=0,hr=ar=Vt=null,tf=!1,c)throw Error(o(300));return s}function pg(){var s=Xs!==0;return Xs=0,s}function vi(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return hr===null?Vt.memoizedState=hr=s:hr=hr.next=s,hr}function Tn(){if(ar===null){var s=Vt.alternate;s=s!==null?s.memoizedState:null}else s=ar.next;var c=hr===null?Vt.memoizedState:hr.next;if(c!==null)hr=c,ar=s;else{if(s===null)throw Error(o(310));ar=s,s={memoizedState:ar.memoizedState,baseState:ar.baseState,baseQueue:ar.baseQueue,queue:ar.queue,next:null},hr===null?Vt.memoizedState=hr=s:hr=hr.next=s}return hr}function Qs(s,c){return typeof c=="function"?c(s):c}function gg(s){var c=Tn(),k=c.queue;if(k===null)throw Error(o(311));k.lastRenderedReducer=s;var L=ar,I=L.baseQueue,V=k.pending;if(V!==null){if(I!==null){var J=I.next;I.next=V.next,V.next=J}L.baseQueue=I=V,k.pending=null}if(I!==null){V=I.next,L=L.baseState;var ie=J=null,pe=null,Pe=V;do{var Ue=Pe.lane;if((bo&Ue)===Ue)pe!==null&&(pe=pe.next={lane:0,action:Pe.action,hasEagerState:Pe.hasEagerState,eagerState:Pe.eagerState,next:null}),L=Pe.hasEagerState?Pe.eagerState:s(L,Pe.action);else{var tt={lane:Ue,action:Pe.action,hasEagerState:Pe.hasEagerState,eagerState:Pe.eagerState,next:null};pe===null?(ie=pe=tt,J=L):pe=pe.next=tt,Vt.lanes|=Ue,_o|=Ue}Pe=Pe.next}while(Pe!==null&&Pe!==V);pe===null?J=L:pe.next=ie,Vn(L,c.memoizedState)||(Xr=!0),c.memoizedState=L,c.baseState=J,c.baseQueue=pe,k.lastRenderedState=L}if(s=k.interleaved,s!==null){I=s;do V=I.lane,Vt.lanes|=V,_o|=V,I=I.next;while(I!==s)}else I===null&&(k.lanes=0);return[c.memoizedState,k.dispatch]}function vg(s){var c=Tn(),k=c.queue;if(k===null)throw Error(o(311));k.lastRenderedReducer=s;var L=k.dispatch,I=k.pending,V=c.memoizedState;if(I!==null){k.pending=null;var J=I=I.next;do V=s(V,J.action),J=J.next;while(J!==I);Vn(V,c.memoizedState)||(Xr=!0),c.memoizedState=V,c.baseQueue===null&&(c.baseState=V),k.lastRenderedState=V}return[V,L]}function _2(){}function w2(s,c){var k=Vt,L=Tn(),I=c(),V=!Vn(L.memoizedState,I);if(V&&(L.memoizedState=I,Xr=!0),L=L.queue,mg(O2.bind(null,k,L,s),[s]),L.getSnapshot!==c||V||hr!==null&&hr.memoizedState.tag&1){if(k.flags|=2048,Zs(9,E2.bind(null,k,L,I,c),void 0,null),pr===null)throw Error(o(349));bo&30||S2(k,c,I)}return I}function S2(s,c,k){s.flags|=16384,s={getSnapshot:c,value:k},c=Vt.updateQueue,c===null?(c={lastEffect:null,stores:null},Vt.updateQueue=c,c.stores=[s]):(k=c.stores,k===null?c.stores=[s]:k.push(s))}function E2(s,c,k,L){c.value=k,c.getSnapshot=L,x2(c)&&P2(s)}function O2(s,c,k){return k(function(){x2(c)&&P2(s)})}function x2(s){var c=s.getSnapshot;s=s.value;try{var k=c();return!Vn(s,k)}catch{return!0}}function P2(s){var c=pi(s,1);c!==null&&Cn(c,s,1,-1)}function k2(s){var c=vi();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qs,lastRenderedState:s},c.queue=s,s=s.dispatch=y9.bind(null,Vt,s),[c.memoizedState,s]}function Zs(s,c,k,L){return s={tag:s,create:c,destroy:k,deps:L,next:null},c=Vt.updateQueue,c===null?(c={lastEffect:null,stores:null},Vt.updateQueue=c,c.lastEffect=s.next=s):(k=c.lastEffect,k===null?c.lastEffect=s.next=s:(L=k.next,k.next=s,s.next=L,c.lastEffect=s)),s}function A2(){return Tn().memoizedState}function rf(s,c,k,L){var I=vi();Vt.flags|=s,I.memoizedState=Zs(1|c,k,void 0,L===void 0?null:L)}function nf(s,c,k,L){var I=Tn();L=L===void 0?null:L;var V=void 0;if(ar!==null){var J=ar.memoizedState;if(V=J.destroy,L!==null&&dg(L,J.deps)){I.memoizedState=Zs(c,k,V,L);return}}Vt.flags|=s,I.memoizedState=Zs(1|c,k,V,L)}function T2(s,c){return rf(8390656,8,s,c)}function mg(s,c){return nf(2048,8,s,c)}function C2(s,c){return nf(4,2,s,c)}function R2(s,c){return nf(4,4,s,c)}function N2(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 M2(s,c,k){return k=k!=null?k.concat([s]):null,nf(4,4,N2.bind(null,c,s),k)}function yg(){}function L2(s,c){var k=Tn();c=c===void 0?null:c;var L=k.memoizedState;return L!==null&&c!==null&&dg(c,L[1])?L[0]:(k.memoizedState=[s,c],s)}function I2(s,c){var k=Tn();c=c===void 0?null:c;var L=k.memoizedState;return L!==null&&c!==null&&dg(c,L[1])?L[0]:(s=s(),k.memoizedState=[s,c],s)}function j2(s,c,k){return bo&21?(Vn(k,c)||(k=Z1(),Vt.lanes|=k,_o|=k,s.baseState=!0),c):(s.baseState&&(s.baseState=!1,Xr=!0),s.memoizedState=k)}function v9(s,c){var k=mt;mt=k!==0&&4>k?k:4,s(!0);var L=fg.transition;fg.transition={};try{s(!1),c()}finally{mt=k,fg.transition=L}}function D2(){return Tn().memoizedState}function m9(s,c,k){var L=Ea(s);if(k={lane:L,action:k,hasEagerState:!1,eagerState:null,next:null},F2(s))z2(c,k);else if(k=s2(s,c,k,L),k!==null){var I=Nr();Cn(k,s,L,I),B2(k,c,L)}}function y9(s,c,k){var L=Ea(s),I={lane:L,action:k,hasEagerState:!1,eagerState:null,next:null};if(F2(s))z2(c,I);else{var V=s.alternate;if(s.lanes===0&&(V===null||V.lanes===0)&&(V=c.lastRenderedReducer,V!==null))try{var J=c.lastRenderedState,ie=V(J,k);if(I.hasEagerState=!0,I.eagerState=ie,Vn(ie,J)){var pe=c.interleaved;pe===null?(I.next=I,ng(c)):(I.next=pe.next,pe.next=I),c.interleaved=I;return}}catch{}finally{}k=s2(s,c,I,L),k!==null&&(I=Nr(),Cn(k,s,L,I),B2(k,c,L))}}function F2(s){var c=s.alternate;return s===Vt||c!==null&&c===Vt}function z2(s,c){Ks=tf=!0;var k=s.pending;k===null?c.next=c:(c.next=k.next,k.next=c),s.pending=c}function B2(s,c,k){if(k&4194240){var L=c.lanes;L&=s.pendingLanes,k|=L,c.lanes=k,Hp(s,k)}}var af={readContext:kn,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},b9={readContext:kn,useCallback:function(s,c){return vi().memoizedState=[s,c===void 0?null:c],s},useContext:kn,useEffect:T2,useImperativeHandle:function(s,c,k){return k=k!=null?k.concat([s]):null,rf(4194308,4,N2.bind(null,c,s),k)},useLayoutEffect:function(s,c){return rf(4194308,4,s,c)},useInsertionEffect:function(s,c){return rf(4,2,s,c)},useMemo:function(s,c){var k=vi();return c=c===void 0?null:c,s=s(),k.memoizedState=[s,c],s},useReducer:function(s,c,k){var L=vi();return c=k!==void 0?k(c):c,L.memoizedState=L.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},L.queue=s,s=s.dispatch=m9.bind(null,Vt,s),[L.memoizedState,s]},useRef:function(s){var c=vi();return s={current:s},c.memoizedState=s},useState:k2,useDebugValue:yg,useDeferredValue:function(s){return vi().memoizedState=s},useTransition:function(){var s=k2(!1),c=s[0];return s=v9.bind(null,s[1]),vi().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,k){var L=Vt,I=vi();if(zt){if(k===void 0)throw Error(o(407));k=k()}else{if(k=c(),pr===null)throw Error(o(349));bo&30||S2(L,c,k)}I.memoizedState=k;var V={value:k,getSnapshot:c};return I.queue=V,T2(O2.bind(null,L,V,s),[s]),L.flags|=2048,Zs(9,E2.bind(null,L,V,k,c),void 0,null),k},useId:function(){var s=vi(),c=pr.identifierPrefix;if(zt){var k=Fi,L=Di;k=(L&~(1<<32-Hn(L)-1)).toString(32)+k,c=":"+c+"R"+k,k=Xs++,0<k&&(c+="H"+k.toString(32)),c+=":"}else k=g9++,c=":"+c+"r"+k.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},_9={readContext:kn,useCallback:L2,useContext:kn,useEffect:mg,useImperativeHandle:M2,useInsertionEffect:C2,useLayoutEffect:R2,useMemo:I2,useReducer:gg,useRef:A2,useState:function(){return gg(Qs)},useDebugValue:yg,useDeferredValue:function(s){var c=Tn();return j2(c,ar.memoizedState,s)},useTransition:function(){var s=gg(Qs)[0],c=Tn().memoizedState;return[s,c]},useMutableSource:_2,useSyncExternalStore:w2,useId:D2,unstable_isNewReconciler:!1},w9={readContext:kn,useCallback:L2,useContext:kn,useEffect:mg,useImperativeHandle:M2,useInsertionEffect:C2,useLayoutEffect:R2,useMemo:I2,useReducer:vg,useRef:A2,useState:function(){return vg(Qs)},useDebugValue:yg,useDeferredValue:function(s){var c=Tn();return ar===null?c.memoizedState=s:j2(c,ar.memoizedState,s)},useTransition:function(){var s=vg(Qs)[0],c=Tn().memoizedState;return[s,c]},useMutableSource:_2,useSyncExternalStore:w2,useId:D2,unstable_isNewReconciler:!1};function kl(s,c){try{var k="",L=c;do k+=p9(L),L=L.return;while(L);var I=k}catch(V){I=`
|
|
56
|
+
Error generating stack: `+V.message+`
|
|
57
|
+
`+V.stack}return{value:s,source:c,stack:I,digest:null}}function bg(s,c,k){return{value:s,source:null,stack:k??null,digest:c??null}}function _g(s,c){try{console.error(c.value)}catch(k){setTimeout(function(){throw k})}}var S9=typeof WeakMap=="function"?WeakMap:Map;function U2(s,c,k){k=zi(-1,k),k.tag=3,k.payload={element:null};var L=c.value;return k.callback=function(){bf||(bf=!0,Bg=L),_g(s,c)},k}function G2(s,c,k){k=zi(-1,k),k.tag=3;var L=s.type.getDerivedStateFromError;if(typeof L=="function"){var I=c.value;k.payload=function(){return L(I)},k.callback=function(){_g(s,c)}}var V=s.stateNode;return V!==null&&typeof V.componentDidCatch=="function"&&(k.callback=function(){_g(s,c),typeof L!="function"&&(wa===null?wa=new Set([this]):wa.add(this));var J=c.stack;this.componentDidCatch(c.value,{componentStack:J!==null?J:""})}),k}function H2(s,c,k){var L=s.pingCache;if(L===null){L=s.pingCache=new S9;var I=new Set;L.set(c,I)}else I=L.get(c),I===void 0&&(I=new Set,L.set(c,I));I.has(k)||(I.add(k),s=j9.bind(null,s,c,k),c.then(s,s))}function V2(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 q2(s,c,k,L,I){return s.mode&1?(s.flags|=65536,s.lanes=I,s):(s===c?s.flags|=65536:(s.flags|=128,k.flags|=131072,k.flags&=-52805,k.tag===1&&(k.alternate===null?k.tag=17:(c=zi(-1,1),c.tag=2,_a(k,c,1))),k.lanes|=1),s)}var E9=l.ReactCurrentOwner,Xr=!1;function Ur(s,c,k,L){c.child=s===null?y2(c,null,k,L):Ol(c,s.child,k,L)}function $2(s,c,k,L,I){k=k.render;var V=c.ref;return El(c,I),L=hg(s,c,k,L,V,I),k=pg(),s!==null&&!Xr?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~I,Bi(s,c,I)):(zt&&k&&Yp(c),c.flags|=1,Ur(s,c,L,I),c.child)}function W2(s,c,k,L,I){if(s===null){var V=k.type;return typeof V=="function"&&!$g(V)&&V.defaultProps===void 0&&k.compare===null&&k.defaultProps===void 0?(c.tag=15,c.type=V,Y2(s,c,V,L,I)):(s=xf(k.type,null,L,c,c.mode,I),s.ref=c.ref,s.return=c,c.child=s)}if(V=s.child,!(s.lanes&I)){var J=V.memoizedProps;if(k=k.compare,k=k!==null?k:$c,k(J,L)&&s.ref===c.ref)return Bi(s,c,I)}return c.flags|=1,s=xa(V,L),s.ref=c.ref,s.return=c,c.child=s}function Y2(s,c,k,L,I){if(s!==null){var V=s.memoizedProps;if($c(V,L)&&s.ref===c.ref)if(Xr=!1,c.pendingProps=L=V,(s.lanes&I)!==0)s.flags&131072&&(Xr=!0);else return c.lanes=s.lanes,Bi(s,c,I)}return wg(s,c,k,L,I)}function K2(s,c,k){var L=c.pendingProps,I=L.children,V=s!==null?s.memoizedState:null;if(L.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ct(Tl,hn),hn|=k;else{if(!(k&1073741824))return s=V!==null?V.baseLanes|k:k,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Ct(Tl,hn),hn|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},L=V!==null?V.baseLanes:k,Ct(Tl,hn),hn|=L}else V!==null?(L=V.baseLanes|k,c.memoizedState=null):L=k,Ct(Tl,hn),hn|=L;return Ur(s,c,I,k),c.child}function X2(s,c){var k=c.ref;(s===null&&k!==null||s!==null&&s.ref!==k)&&(c.flags|=512,c.flags|=2097152)}function wg(s,c,k,L,I){var V=Kr(k)?go:Ar.current;return V=yl(c,V),El(c,I),k=hg(s,c,k,L,V,I),L=pg(),s!==null&&!Xr?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~I,Bi(s,c,I)):(zt&&L&&Yp(c),c.flags|=1,Ur(s,c,k,I),c.child)}function Q2(s,c,k,L,I){if(Kr(k)){var V=!0;Dc(c)}else V=!1;if(El(c,I),c.stateNode===null)lf(s,c),p2(c,k,L),og(c,k,L,I),L=!0;else if(s===null){var J=c.stateNode,ie=c.memoizedProps;J.props=ie;var pe=J.context,Pe=k.contextType;typeof Pe=="object"&&Pe!==null?Pe=kn(Pe):(Pe=Kr(k)?go:Ar.current,Pe=yl(c,Pe));var Ue=k.getDerivedStateFromProps,tt=typeof Ue=="function"||typeof J.getSnapshotBeforeUpdate=="function";tt||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(ie!==L||pe!==Pe)&&g2(c,J,L,Pe),ba=!1;var Ie=c.memoizedState;J.state=Ie,Xc(c,L,J,I),pe=c.memoizedState,ie!==L||Ie!==pe||Yr.current||ba?(typeof Ue=="function"&&(ag(c,k,Ue,L),pe=c.memoizedState),(ie=ba||h2(c,k,ie,L,Ie,pe,Pe))?(tt||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=L,c.memoizedState=pe),J.props=L,J.state=pe,J.context=Pe,L=ie):(typeof J.componentDidMount=="function"&&(c.flags|=4194308),L=!1)}else{J=c.stateNode,u2(s,c),ie=c.memoizedProps,Pe=c.type===c.elementType?ie:$n(c.type,ie),J.props=Pe,tt=c.pendingProps,Ie=J.context,pe=k.contextType,typeof pe=="object"&&pe!==null?pe=kn(pe):(pe=Kr(k)?go:Ar.current,pe=yl(c,pe));var Lt=k.getDerivedStateFromProps;(Ue=typeof Lt=="function"||typeof J.getSnapshotBeforeUpdate=="function")||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(ie!==tt||Ie!==pe)&&g2(c,J,L,pe),ba=!1,Ie=c.memoizedState,J.state=Ie,Xc(c,L,J,I);var At=c.memoizedState;ie!==tt||Ie!==At||Yr.current||ba?(typeof Lt=="function"&&(ag(c,k,Lt,L),At=c.memoizedState),(Pe=ba||h2(c,k,Pe,L,Ie,At,pe)||!1)?(Ue||typeof J.UNSAFE_componentWillUpdate!="function"&&typeof J.componentWillUpdate!="function"||(typeof J.componentWillUpdate=="function"&&J.componentWillUpdate(L,At,pe),typeof J.UNSAFE_componentWillUpdate=="function"&&J.UNSAFE_componentWillUpdate(L,At,pe)),typeof J.componentDidUpdate=="function"&&(c.flags|=4),typeof J.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof J.componentDidUpdate!="function"||ie===s.memoizedProps&&Ie===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||ie===s.memoizedProps&&Ie===s.memoizedState||(c.flags|=1024),c.memoizedProps=L,c.memoizedState=At),J.props=L,J.state=At,J.context=pe,L=Pe):(typeof J.componentDidUpdate!="function"||ie===s.memoizedProps&&Ie===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||ie===s.memoizedProps&&Ie===s.memoizedState||(c.flags|=1024),L=!1)}return Sg(s,c,k,L,V,I)}function Sg(s,c,k,L,I,V){X2(s,c);var J=(c.flags&128)!==0;if(!L&&!J)return I&&Q1(c,k,!1),Bi(s,c,V);L=c.stateNode,E9.current=c;var ie=J&&typeof k.getDerivedStateFromError!="function"?null:L.render();return c.flags|=1,s!==null&&J?(c.child=Ol(c,s.child,null,V),c.child=Ol(c,null,ie,V)):Ur(s,c,ie,V),c.memoizedState=L.state,I&&Q1(c,k,!0),c.child}function Z2(s){var c=s.stateNode;c.pendingContext?K1(s,c.pendingContext,c.pendingContext!==c.context):c.context&&K1(s,c.context,!1),lg(s,c.containerInfo)}function J2(s,c,k,L,I){return wl(),Zp(I),c.flags|=256,Ur(s,c,k,L),c.child}var Eg={dehydrated:null,treeContext:null,retryLane:0};function Og(s){return{baseLanes:s,cachePool:null,transitions:null}}function eb(s,c,k){var L=c.pendingProps,I=Ht.current,V=!1,J=(c.flags&128)!==0,ie;if((ie=J)||(ie=s!==null&&s.memoizedState===null?!1:(I&2)!==0),ie?(V=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(I|=1),Ct(Ht,I&1),s===null)return Qp(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(c.mode&1?fn(s)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(J=L.children,s=L.fallback,V?(L=c.mode,V=c.child,J={mode:"hidden",children:J},!(L&1)&&V!==null?(V.childLanes=0,V.pendingProps=J):V=Pf(J,L,0,null),s=Oo(s,L,k,null),V.return=c,s.return=c,V.sibling=s,c.child=V,c.child.memoizedState=Og(k),c.memoizedState=Eg,s):xg(c,J));if(I=s.memoizedState,I!==null&&(ie=I.dehydrated,ie!==null))return O9(s,c,J,L,ie,I,k);if(V){V=L.fallback,J=c.mode,I=s.child,ie=I.sibling;var pe={mode:"hidden",children:L.children};return!(J&1)&&c.child!==I?(L=c.child,L.childLanes=0,L.pendingProps=pe,c.deletions=null):(L=xa(I,pe),L.subtreeFlags=I.subtreeFlags&14680064),ie!==null?V=xa(ie,V):(V=Oo(V,J,k,null),V.flags|=2),V.return=c,L.return=c,L.sibling=V,c.child=L,L=V,V=c.child,J=s.child.memoizedState,J=J===null?Og(k):{baseLanes:J.baseLanes|k,cachePool:null,transitions:J.transitions},V.memoizedState=J,V.childLanes=s.childLanes&~k,c.memoizedState=Eg,L}return V=s.child,s=V.sibling,L=xa(V,{mode:"visible",children:L.children}),!(c.mode&1)&&(L.lanes=k),L.return=c,L.sibling=null,s!==null&&(k=c.deletions,k===null?(c.deletions=[s],c.flags|=16):k.push(s)),c.child=L,c.memoizedState=null,L}function xg(s,c){return c=Pf({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function of(s,c,k,L){return L!==null&&Zp(L),Ol(c,s.child,null,k),s=xg(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function O9(s,c,k,L,I,V,J){if(k)return c.flags&256?(c.flags&=-257,L=bg(Error(o(422))),of(s,c,J,L)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(V=L.fallback,I=c.mode,L=Pf({mode:"visible",children:L.children},I,0,null),V=Oo(V,I,J,null),V.flags|=2,L.return=c,V.return=c,L.sibling=V,c.child=L,c.mode&1&&Ol(c,s.child,null,J),c.child.memoizedState=Og(J),c.memoizedState=Eg,V);if(!(c.mode&1))return of(s,c,J,null);if(fn(I))return L=Gn(I).digest,V=Error(o(419)),L=bg(V,L,void 0),of(s,c,J,L);if(k=(J&s.childLanes)!==0,Xr||k){if(L=pr,L!==null){switch(J&-J){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&(L.suspendedLanes|J)?0:I,I!==0&&I!==V.retryLane&&(V.retryLane=I,pi(s,I),Cn(L,s,I,-1))}return qg(),L=bg(Error(o(421))),of(s,c,J,L)}return ir(I)?(c.flags|=128,c.child=s.child,c=D9.bind(null,s),fi(I,c),null):(s=V.treeContext,le&&(Pn=Us(I),dn=c,zt=!0,qn=null,qs=!1,s!==null&&(On[xn++]=Di,On[xn++]=Fi,On[xn++]=vo,Di=s.id,Fi=s.overflow,vo=c)),c=xg(c,L.children),c.flags|=4096,c)}function tb(s,c,k){s.lanes|=c;var L=s.alternate;L!==null&&(L.lanes|=c),rg(s.return,c,k)}function Pg(s,c,k,L,I){var V=s.memoizedState;V===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:L,tail:k,tailMode:I}:(V.isBackwards=c,V.rendering=null,V.renderingStartTime=0,V.last=L,V.tail=k,V.tailMode=I)}function rb(s,c,k){var L=c.pendingProps,I=L.revealOrder,V=L.tail;if(Ur(s,c,L.children,k),L=Ht.current,L&2)L=L&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&&tb(s,k,c);else if(s.tag===19)tb(s,k,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}L&=1}if(Ct(Ht,L),!(c.mode&1))c.memoizedState=null;else switch(I){case"forwards":for(k=c.child,I=null;k!==null;)s=k.alternate,s!==null&&Jc(s)===null&&(I=k),k=k.sibling;k=I,k===null?(I=c.child,c.child=null):(I=k.sibling,k.sibling=null),Pg(c,!1,I,k,V);break;case"backwards":for(k=null,I=c.child,c.child=null;I!==null;){if(s=I.alternate,s!==null&&Jc(s)===null){c.child=I;break}s=I.sibling,I.sibling=k,k=I,I=s}Pg(c,!0,k,null,V);break;case"together":Pg(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function lf(s,c){!(c.mode&1)&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function Bi(s,c,k){if(s!==null&&(c.dependencies=s.dependencies),_o|=c.lanes,!(k&c.childLanes))return null;if(s!==null&&c.child!==s.child)throw Error(o(153));if(c.child!==null){for(s=c.child,k=xa(s,s.pendingProps),c.child=k,k.return=c;s.sibling!==null;)s=s.sibling,k=k.sibling=xa(s,s.pendingProps),k.return=c;k.sibling=null}return c.child}function x9(s,c,k){switch(c.tag){case 3:Z2(c),wl();break;case 5:b2(c);break;case 1:Kr(c.type)&&Dc(c);break;case 4:lg(c,c.stateNode.containerInfo);break;case 10:l2(c,c.type._context,c.memoizedProps.value);break;case 13:var L=c.memoizedState;if(L!==null)return L.dehydrated!==null?(Ct(Ht,Ht.current&1),c.flags|=128,null):k&c.child.childLanes?eb(s,c,k):(Ct(Ht,Ht.current&1),s=Bi(s,c,k),s!==null?s.sibling:null);Ct(Ht,Ht.current&1);break;case 19:if(L=(k&c.childLanes)!==0,s.flags&128){if(L)return rb(s,c,k);c.flags|=128}var I=c.memoizedState;if(I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),Ct(Ht,Ht.current),L)break;return null;case 22:case 23:return c.lanes=0,K2(s,c,k)}return Bi(s,c,k)}function mi(s){s.flags|=4}function nb(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 Js,eu,sf,uf;if(re)Js=function(s,c){for(var k=c.child;k!==null;){if(k.tag===5||k.tag===6)j(s,k.stateNode);else if(k.tag!==4&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===c)break;for(;k.sibling===null;){if(k.return===null||k.return===c)return;k=k.return}k.sibling.return=k.return,k=k.sibling}},eu=function(){},sf=function(s,c,k,L,I){if(s=s.memoizedProps,s!==L){var V=c.stateNode,J=gi(An.current);k=H(V,k,s,L,I,J),(c.updateQueue=k)&&mi(c)}},uf=function(s,c,k,L){k!==L&&mi(c)};else if(ee){Js=function(s,c,k,L){for(var I=c.child;I!==null;){if(I.tag===5){var V=I.stateNode;k&&L&&(V=ht(V,I.type,I.memoizedProps,I)),j(s,V)}else if(I.tag===6)V=I.stateNode,k&&L&&(V=wt(V,I.memoizedProps,I)),j(s,V);else if(I.tag!==4){if(I.tag===22&&I.memoizedState!==null)V=I.child,V!==null&&(V.return=I),Js(s,I,!0,!0);else if(I.child!==null){I.child.return=I,I=I.child;continue}}if(I===c)break;for(;I.sibling===null;){if(I.return===null||I.return===c)return;I=I.return}I.sibling.return=I.return,I=I.sibling}};var ib=function(s,c,k,L){for(var I=c.child;I!==null;){if(I.tag===5){var V=I.stateNode;k&&L&&(V=ht(V,I.type,I.memoizedProps,I)),pt(s,V)}else if(I.tag===6)V=I.stateNode,k&&L&&(V=wt(V,I.memoizedProps,I)),pt(s,V);else if(I.tag!==4){if(I.tag===22&&I.memoizedState!==null)V=I.child,V!==null&&(V.return=I),ib(s,I,!0,!0);else if(I.child!==null){I.child.return=I,I=I.child;continue}}if(I===c)break;for(;I.sibling===null;){if(I.return===null||I.return===c)return;I=I.return}I.sibling.return=I.return,I=I.sibling}};eu=function(s,c){var k=c.stateNode;if(!nb(s,c)){s=k.containerInfo;var L=Ze(s);ib(L,c,!1,!1),k.pendingChildren=L,mi(c),Ne(s,L)}},sf=function(s,c,k,L,I){var V=s.stateNode,J=s.memoizedProps;if((s=nb(s,c))&&J===L)c.stateNode=V;else{var ie=c.stateNode,pe=gi(An.current),Pe=null;J!==L&&(Pe=H(ie,k,J,L,I,pe)),s&&Pe===null?c.stateNode=V:(V=qe(V,Pe,k,J,L,c,s,ie),z(V,k,L,I,pe)&&mi(c),c.stateNode=V,s?mi(c):Js(V,c,!1,!1))}},uf=function(s,c,k,L){k!==L?(s=gi(xl.current),k=gi(An.current),c.stateNode=q(L,s,k,c),mi(c)):c.stateNode=s.stateNode}}else eu=function(){},sf=function(){},uf=function(){};function tu(s,c){if(!zt)switch(s.tailMode){case"hidden":c=s.tail;for(var k=null;c!==null;)c.alternate!==null&&(k=c),c=c.sibling;k===null?s.tail=null:k.sibling=null;break;case"collapsed":k=s.tail;for(var L=null;k!==null;)k.alternate!==null&&(L=k),k=k.sibling;L===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:L.sibling=null}}function Cr(s){var c=s.alternate!==null&&s.alternate.child===s.child,k=0,L=0;if(c)for(var I=s.child;I!==null;)k|=I.lanes|I.childLanes,L|=I.subtreeFlags&14680064,L|=I.flags&14680064,I.return=s,I=I.sibling;else for(I=s.child;I!==null;)k|=I.lanes|I.childLanes,L|=I.subtreeFlags,L|=I.flags,I.return=s,I=I.sibling;return s.subtreeFlags|=L,s.childLanes=k,c}function P9(s,c,k){var L=c.pendingProps;switch(Kp(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)&&jc(),Cr(c),null;case 3:return k=c.stateNode,Pl(),Mt(Yr),Mt(Ar),cg(),k.pendingContext&&(k.context=k.pendingContext,k.pendingContext=null),(s===null||s.child===null)&&(qc(c)?mi(c):s===null||s.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,qn!==null&&(Hg(qn),qn=null))),eu(s,c),Cr(c),null;case 5:sg(c),k=gi(xl.current);var I=c.type;if(s!==null&&c.stateNode!=null)sf(s,c,I,L,k),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!L){if(c.stateNode===null)throw Error(o(166));return Cr(c),null}if(s=gi(An.current),qc(c)){if(!le)throw Error(o(175));s=Ii(c.stateNode,c.type,c.memoizedProps,k,s,c,!qs),c.updateQueue=s,s!==null&&mi(c)}else{var V=A(I,L,k,s,c);Js(V,c,!1,!1),c.stateNode=V,z(V,I,L,k,s)&&mi(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Cr(c),null;case 6:if(s&&c.stateNode!=null)uf(s,c,s.memoizedProps,L);else{if(typeof L!="string"&&c.stateNode===null)throw Error(o(166));if(s=gi(xl.current),k=gi(An.current),qc(c)){if(!le)throw Error(o(176));if(s=c.stateNode,k=c.memoizedProps,(L=va(s,k,c,!qs))&&(I=dn,I!==null))switch(I.tag){case 3:QE(I.stateNode.containerInfo,s,k,(I.mode&1)!==0);break;case 5:ZE(I.type,I.memoizedProps,I.stateNode,s,k,(I.mode&1)!==0)}L&&mi(c)}else c.stateNode=q(L,s,k,c)}return Cr(c),null;case 13:if(Mt(Ht),L=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(zt&&Pn!==null&&c.mode&1&&!(c.flags&128))o2(),wl(),c.flags|=98560,I=!1;else if(I=qc(c),L!==null&&L.dehydrated!==null){if(s===null){if(!I)throw Error(o(318));if(!le)throw Error(o(344));if(I=c.memoizedState,I=I!==null?I.dehydrated:null,!I)throw Error(o(317));vl(I,c)}else wl(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Cr(c),I=!1}else qn!==null&&(Hg(qn),qn=null),I=!0;if(!I)return c.flags&65536?c:null}return c.flags&128?(c.lanes=k,c):(k=L!==null,k!==(s!==null&&s.memoizedState!==null)&&k&&(c.child.flags|=8192,c.mode&1&&(s===null||Ht.current&1?or===0&&(or=3):qg())),c.updateQueue!==null&&(c.flags|=4),Cr(c),null);case 4:return Pl(),eu(s,c),s===null&&_e(c.stateNode.containerInfo),Cr(c),null;case 10:return tg(c.type._context),Cr(c),null;case 17:return Kr(c.type)&&jc(),Cr(c),null;case 19:if(Mt(Ht),I=c.memoizedState,I===null)return Cr(c),null;if(L=(c.flags&128)!==0,V=I.rendering,V===null)if(L)tu(I,!1);else{if(or!==0||s!==null&&s.flags&128)for(s=c.child;s!==null;){if(V=Jc(s),V!==null){for(c.flags|=128,tu(I,!1),s=V.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),c.subtreeFlags=0,s=k,k=c.child;k!==null;)L=k,I=s,L.flags&=14680066,V=L.alternate,V===null?(L.childLanes=0,L.lanes=I,L.child=null,L.subtreeFlags=0,L.memoizedProps=null,L.memoizedState=null,L.updateQueue=null,L.dependencies=null,L.stateNode=null):(L.childLanes=V.childLanes,L.lanes=V.lanes,L.child=V.child,L.subtreeFlags=0,L.deletions=null,L.memoizedProps=V.memoizedProps,L.memoizedState=V.memoizedState,L.updateQueue=V.updateQueue,L.type=V.type,I=V.dependencies,L.dependencies=I===null?null:{lanes:I.lanes,firstContext:I.firstContext}),k=k.sibling;return Ct(Ht,Ht.current&1|2),c.child}s=s.sibling}I.tail!==null&&dr()>zg&&(c.flags|=128,L=!0,tu(I,!1),c.lanes=4194304)}else{if(!L)if(s=Jc(V),s!==null){if(c.flags|=128,L=!0,s=s.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),tu(I,!0),I.tail===null&&I.tailMode==="hidden"&&!V.alternate&&!zt)return Cr(c),null}else 2*dr()-I.renderingStartTime>zg&&k!==1073741824&&(c.flags|=128,L=!0,tu(I,!1),c.lanes=4194304);I.isBackwards?(V.sibling=c.child,c.child=V):(s=I.last,s!==null?s.sibling=V:c.child=V,I.last=V)}return I.tail!==null?(c=I.tail,I.rendering=c,I.tail=c.sibling,I.renderingStartTime=dr(),c.sibling=null,s=Ht.current,Ct(Ht,L?s&1|2:s&1),c):(Cr(c),null);case 22:case 23:return Vg(),k=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==k&&(c.flags|=8192),k&&c.mode&1?hn&1073741824&&(Cr(c),re&&c.subtreeFlags&6&&(c.flags|=8192)):Cr(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}function k9(s,c){switch(Kp(c),c.tag){case 1:return Kr(c.type)&&jc(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Pl(),Mt(Yr),Mt(Ar),cg(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return sg(c),null;case 13:if(Mt(Ht),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(o(340));wl()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return Mt(Ht),null;case 4:return Pl(),null;case 10:return tg(c.type._context),null;case 22:case 23:return Vg(),null;case 24:return null;default:return null}}var cf=!1,Rr=!1,A9=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function Al(s,c){var k=s.ref;if(k!==null)if(typeof k=="function")try{k(null)}catch(L){Bt(s,c,L)}else k.current=null}function kg(s,c,k){try{k()}catch(L){Bt(s,c,L)}}var ab=!1;function T9(s,c){for(W(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 k=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var L=k.memoizedProps,I=k.memoizedState,V=s.stateNode,J=V.getSnapshotBeforeUpdate(s.elementType===s.type?L:$n(s.type,L),I);V.__reactInternalSnapshotBeforeUpdate=J}break;case 3:re&&Ee(s.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(ie){Bt(s,s.return,ie)}if(c=s.sibling,c!==null){c.return=s.return,Fe=c;break}Fe=s.return}return k=ab,ab=!1,k}function ru(s,c,k){var L=c.updateQueue;if(L=L!==null?L.lastEffect:null,L!==null){var I=L=L.next;do{if((I.tag&s)===s){var V=I.destroy;I.destroy=void 0,V!==void 0&&kg(c,k,V)}I=I.next}while(I!==L)}}function ff(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var k=c=c.next;do{if((k.tag&s)===s){var L=k.create;k.destroy=L()}k=k.next}while(k!==c)}}function Ag(s){var c=s.ref;if(c!==null){var k=s.stateNode;switch(s.tag){case 5:s=K(k);break;default:s=k}typeof c=="function"?c(s):c.current=s}}function ob(s){var c=s.alternate;c!==null&&(s.alternate=null,ob(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&Oe(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 lb(s){return s.tag===5||s.tag===3||s.tag===4}function sb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||lb(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 Tg(s,c,k){var L=s.tag;if(L===5||L===6)s=s.stateNode,c?ne(k,s,c):Ce(k,s);else if(L!==4&&(s=s.child,s!==null))for(Tg(s,c,k),s=s.sibling;s!==null;)Tg(s,c,k),s=s.sibling}function Cg(s,c,k){var L=s.tag;if(L===5||L===6)s=s.stateNode,c?se(k,s,c):Ke(k,s);else if(L!==4&&(s=s.child,s!==null))for(Cg(s,c,k),s=s.sibling;s!==null;)Cg(s,c,k),s=s.sibling}var _r=null,Wn=!1;function yi(s,c,k){for(k=k.child;k!==null;)Rg(s,c,k),k=k.sibling}function Rg(s,c,k){if(di&&typeof di.onCommitFiberUnmount=="function")try{di.onCommitFiberUnmount(Uc,k)}catch{}switch(k.tag){case 5:Rr||Al(k,c);case 6:if(re){var L=_r,I=Wn;_r=null,yi(s,c,k),_r=L,Wn=I,_r!==null&&(Wn?Me(_r,k.stateNode):Ae(_r,k.stateNode))}else yi(s,c,k);break;case 18:re&&_r!==null&&(Wn?KE(_r,k.stateNode):YE(_r,k.stateNode));break;case 4:re?(L=_r,I=Wn,_r=k.stateNode.containerInfo,Wn=!0,yi(s,c,k),_r=L,Wn=I):(ee&&(L=k.stateNode.containerInfo,I=Ze(L),Qe(L,I)),yi(s,c,k));break;case 0:case 11:case 14:case 15:if(!Rr&&(L=k.updateQueue,L!==null&&(L=L.lastEffect,L!==null))){I=L=L.next;do{var V=I,J=V.destroy;V=V.tag,J!==void 0&&(V&2||V&4)&&kg(k,c,J),I=I.next}while(I!==L)}yi(s,c,k);break;case 1:if(!Rr&&(Al(k,c),L=k.stateNode,typeof L.componentWillUnmount=="function"))try{L.props=k.memoizedProps,L.state=k.memoizedState,L.componentWillUnmount()}catch(ie){Bt(k,c,ie)}yi(s,c,k);break;case 21:yi(s,c,k);break;case 22:k.mode&1?(Rr=(L=Rr)||k.memoizedState!==null,yi(s,c,k),Rr=L):yi(s,c,k);break;default:yi(s,c,k)}}function ub(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var k=s.stateNode;k===null&&(k=s.stateNode=new A9),c.forEach(function(L){var I=F9.bind(null,s,L);k.has(L)||(k.add(L),L.then(I,I))})}}function Yn(s,c){var k=c.deletions;if(k!==null)for(var L=0;L<k.length;L++){var I=k[L];try{var V=s,J=c;if(re){var ie=J;e:for(;ie!==null;){switch(ie.tag){case 5:_r=ie.stateNode,Wn=!1;break e;case 3:_r=ie.stateNode.containerInfo,Wn=!0;break e;case 4:_r=ie.stateNode.containerInfo,Wn=!0;break e}ie=ie.return}if(_r===null)throw Error(o(160));Rg(V,J,I),_r=null,Wn=!1}else Rg(V,J,I);var pe=I.alternate;pe!==null&&(pe.return=null),I.return=null}catch(Pe){Bt(I,c,Pe)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)cb(c,s),c=c.sibling}function cb(s,c){var k=s.alternate,L=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Yn(c,s),bi(s),L&4){try{ru(3,s,s.return),ff(3,s)}catch(Ie){Bt(s,s.return,Ie)}try{ru(5,s,s.return)}catch(Ie){Bt(s,s.return,Ie)}}break;case 1:Yn(c,s),bi(s),L&512&&k!==null&&Al(k,k.return);break;case 5:if(Yn(c,s),bi(s),L&512&&k!==null&&Al(k,k.return),re){if(s.flags&32){var I=s.stateNode;try{ve(I)}catch(Ie){Bt(s,s.return,Ie)}}if(L&4&&(I=s.stateNode,I!=null)){var V=s.memoizedProps;if(k=k!==null?k.memoizedProps:V,L=s.type,c=s.updateQueue,s.updateQueue=null,c!==null)try{Xe(I,c,L,k,V,s)}catch(Ie){Bt(s,s.return,Ie)}}}break;case 6:if(Yn(c,s),bi(s),L&4&&re){if(s.stateNode===null)throw Error(o(162));I=s.stateNode,V=s.memoizedProps,k=k!==null?k.memoizedProps:V;try{Be(I,k,V)}catch(Ie){Bt(s,s.return,Ie)}}break;case 3:if(Yn(c,s),bi(s),L&4){if(re&&le&&k!==null&&k.memoizedState.isDehydrated)try{Ic(c.containerInfo)}catch(Ie){Bt(s,s.return,Ie)}if(ee){I=c.containerInfo,V=c.pendingChildren;try{Qe(I,V)}catch(Ie){Bt(s,s.return,Ie)}}}break;case 4:if(Yn(c,s),bi(s),L&4&&ee){V=s.stateNode,I=V.containerInfo,V=V.pendingChildren;try{Qe(I,V)}catch(Ie){Bt(s,s.return,Ie)}}break;case 13:Yn(c,s),bi(s),I=s.child,I.flags&8192&&(V=I.memoizedState!==null,I.stateNode.isHidden=V,!V||I.alternate!==null&&I.alternate.memoizedState!==null||(Fg=dr())),L&4&&ub(s);break;case 22:var J=k!==null&&k.memoizedState!==null;if(s.mode&1?(Rr=(k=Rr)||J,Yn(c,s),Rr=k):Yn(c,s),bi(s),L&8192){if(k=s.memoizedState!==null,(s.stateNode.isHidden=k)&&!J&&s.mode&1)for(Fe=s,L=s.child;L!==null;){for(c=Fe=L;Fe!==null;){J=Fe;var ie=J.child;switch(J.tag){case 0:case 11:case 14:case 15:ru(4,J,J.return);break;case 1:Al(J,J.return);var pe=J.stateNode;if(typeof pe.componentWillUnmount=="function"){var Pe=J,Ue=J.return;try{var tt=Pe;pe.props=tt.memoizedProps,pe.state=tt.memoizedState,pe.componentWillUnmount()}catch(Ie){Bt(Pe,Ue,Ie)}}break;case 5:Al(J,J.return);break;case 22:if(J.memoizedState!==null){hb(c);continue}}ie!==null?(ie.return=J,Fe=ie):hb(c)}L=L.sibling}if(re){e:if(L=null,re)for(c=s;;){if(c.tag===5){if(L===null){L=c;try{I=c.stateNode,k?Re(I):$e(c.stateNode,c.memoizedProps)}catch(Ie){Bt(s,s.return,Ie)}}}else if(c.tag===6){if(L===null)try{V=c.stateNode,k?Se(V):xt(V,c.memoizedProps)}catch(Ie){Bt(s,s.return,Ie)}}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;L===c&&(L=null),c=c.return}L===c&&(L=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:Yn(c,s),bi(s),L&4&&ub(s);break;case 21:break;default:Yn(c,s),bi(s)}}function bi(s){var c=s.flags;if(c&2){try{if(re){e:{for(var k=s.return;k!==null;){if(lb(k)){var L=k;break e}k=k.return}throw Error(o(160))}switch(L.tag){case 5:var I=L.stateNode;L.flags&32&&(ve(I),L.flags&=-33);var V=sb(s);Cg(s,V,I);break;case 3:case 4:var J=L.stateNode.containerInfo,ie=sb(s);Tg(s,ie,J);break;default:throw Error(o(161))}}}catch(pe){Bt(s,s.return,pe)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function C9(s,c,k){Fe=s,fb(s)}function fb(s,c,k){for(var L=(s.mode&1)!==0;Fe!==null;){var I=Fe,V=I.child;if(I.tag===22&&L){var J=I.memoizedState!==null||cf;if(!J){var ie=I.alternate,pe=ie!==null&&ie.memoizedState!==null||Rr;ie=cf;var Pe=Rr;if(cf=J,(Rr=pe)&&!Pe)for(Fe=I;Fe!==null;)J=Fe,pe=J.child,J.tag===22&&J.memoizedState!==null?pb(I):pe!==null?(pe.return=J,Fe=pe):pb(I);for(;V!==null;)Fe=V,fb(V),V=V.sibling;Fe=I,cf=ie,Rr=Pe}db(s)}else I.subtreeFlags&8772&&V!==null?(V.return=I,Fe=V):db(s)}}function db(s){for(;Fe!==null;){var c=Fe;if(c.flags&8772){var k=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:Rr||ff(5,c);break;case 1:var L=c.stateNode;if(c.flags&4&&!Rr)if(k===null)L.componentDidMount();else{var I=c.elementType===c.type?k.memoizedProps:$n(c.type,k.memoizedProps);L.componentDidUpdate(I,k.memoizedState,L.__reactInternalSnapshotBeforeUpdate)}var V=c.updateQueue;V!==null&&f2(c,V,L);break;case 3:var J=c.updateQueue;if(J!==null){if(k=null,c.child!==null)switch(c.child.tag){case 5:k=K(c.child.stateNode);break;case 1:k=c.child.stateNode}f2(c,J,k)}break;case 5:var ie=c.stateNode;k===null&&c.flags&4&&et(ie,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(le&&c.memoizedState===null){var pe=c.alternate;if(pe!==null){var Pe=pe.memoizedState;if(Pe!==null){var Ue=Pe.dehydrated;Ue!==null&&WE(Ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Rr||c.flags&512&&Ag(c)}catch(tt){Bt(c,c.return,tt)}}if(c===s){Fe=null;break}if(k=c.sibling,k!==null){k.return=c.return,Fe=k;break}Fe=c.return}}function hb(s){for(;Fe!==null;){var c=Fe;if(c===s){Fe=null;break}var k=c.sibling;if(k!==null){k.return=c.return,Fe=k;break}Fe=c.return}}function pb(s){for(;Fe!==null;){var c=Fe;try{switch(c.tag){case 0:case 11:case 15:var k=c.return;try{ff(4,c)}catch(pe){Bt(c,k,pe)}break;case 1:var L=c.stateNode;if(typeof L.componentDidMount=="function"){var I=c.return;try{L.componentDidMount()}catch(pe){Bt(c,I,pe)}}var V=c.return;try{Ag(c)}catch(pe){Bt(c,V,pe)}break;case 5:var J=c.return;try{Ag(c)}catch(pe){Bt(c,J,pe)}}}catch(pe){Bt(c,c.return,pe)}if(c===s){Fe=null;break}var ie=c.sibling;if(ie!==null){ie.return=c.return,Fe=ie;break}Fe=c.return}}var df=0,hf=1,pf=2,gf=3,vf=4;if(typeof Symbol=="function"&&Symbol.for){var nu=Symbol.for;df=nu("selector.component"),hf=nu("selector.has_pseudo_class"),pf=nu("selector.role"),gf=nu("selector.test_id"),vf=nu("selector.text")}function Ng(s){var c=ce(s);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(o(364));return c}if(s=we(s),s===null)throw Error(o(362));return s.stateNode.current}function Mg(s,c){switch(c.$$typeof){case df:if(s.type===c.value)return!0;break;case hf:e:{c=c.value,s=[s,0];for(var k=0;k<s.length;){var L=s[k++],I=s[k++],V=c[I];if(L.tag!==5||!fe(L)){for(;V!=null&&Mg(L,V);)I++,V=c[I];if(I===c.length){c=!0;break e}else for(L=L.child;L!==null;)s.push(L,I),L=L.sibling}}c=!1}return c;case pf:if(s.tag===5&&be(s.stateNode,c.value))return!0;break;case vf:if((s.tag===5||s.tag===6)&&(s=ue(s),s!==null&&0<=s.indexOf(c.value)))return!0;break;case gf: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 Lg(s){switch(s.$$typeof){case df:return"<"+(P(s.value)||"Unknown")+">";case hf:return":has("+(Lg(s)||"")+")";case pf:return'[role="'+s.value+'"]';case vf:return'"'+s.value+'"';case gf:return'[data-testname="'+s.value+'"]';default:throw Error(o(365))}}function gb(s,c){var k=[];s=[s,0];for(var L=0;L<s.length;){var I=s[L++],V=s[L++],J=c[V];if(I.tag!==5||!fe(I)){for(;J!=null&&Mg(I,J);)V++,J=c[V];if(V===c.length)k.push(I);else for(I=I.child;I!==null;)s.push(I,V),I=I.sibling}}return k}function Ig(s,c){if(!ye)throw Error(o(363));s=Ng(s),s=gb(s,c),c=[],s=Array.from(s);for(var k=0;k<s.length;){var L=s[k++];if(L.tag===5)fe(L)||c.push(L.stateNode);else for(L=L.child;L!==null;)s.push(L),L=L.sibling}return c}var R9=Math.ceil,mf=l.ReactCurrentDispatcher,jg=l.ReactCurrentOwner,Zt=l.ReactCurrentBatchConfig,ut=0,pr=null,tr=null,wr=0,hn=0,Tl=ma(0),or=0,iu=null,_o=0,yf=0,Dg=0,au=null,Qr=null,Fg=0,zg=1/0,Ui=null;function Cl(){zg=dr()+500}var bf=!1,Bg=null,wa=null,_f=!1,Sa=null,wf=0,ou=0,Ug=null,Sf=-1,Ef=0;function Nr(){return ut&6?dr():Sf!==-1?Sf:Sf=dr()}function Ea(s){return s.mode&1?ut&2&&wr!==0?wr&-wr:h9.transition!==null?(Ef===0&&(Ef=Z1()),Ef):(s=mt,s!==0?s:Le()):1}function Cn(s,c,k,L){if(50<ou)throw ou=0,Ug=null,Error(o(185));Vs(s,k,L),(!(ut&2)||s!==pr)&&(s===pr&&(!(ut&2)&&(yf|=k),or===4&&Oa(s,wr)),Zr(s,L),k===1&&ut===0&&!(c.mode&1)&&(Cl(),Gc&&hi()))}function Zr(s,c){var k=s.callbackNode;i9(s,c);var L=Bc(s,s===pr?wr:0);if(L===0)k!==null&&e2(k),s.callbackNode=null,s.callbackPriority=0;else if(c=L&-L,s.callbackPriority!==c){if(k!=null&&e2(k),c===1)s.tag===0?d9(mb.bind(null,s)):t2(mb.bind(null,s)),ae?de(function(){!(ut&6)&&hi()}):Vp(qp,hi),k=null;else{switch(J1(L)){case 1:k=qp;break;case 4:k=s9;break;case 16:k=$p;break;case 536870912:k=u9;break;default:k=$p}k=Pb(k,vb.bind(null,s))}s.callbackPriority=c,s.callbackNode=k}}function vb(s,c){if(Sf=-1,Ef=0,ut&6)throw Error(o(327));var k=s.callbackNode;if(Eo()&&s.callbackNode!==k)return null;var L=Bc(s,s===pr?wr:0);if(L===0)return null;if(L&30||L&s.expiredLanes||c)c=Of(s,L);else{c=L;var I=ut;ut|=2;var V=_b();(pr!==s||wr!==c)&&(Ui=null,Cl(),wo(s,c));do try{L9();break}catch(ie){bb(s,ie)}while(1);eg(),mf.current=V,ut=I,tr!==null?c=0:(pr=null,wr=0,c=or)}if(c!==0){if(c===2&&(I=Up(s),I!==0&&(L=I,c=Gg(s,I))),c===1)throw k=iu,wo(s,0),Oa(s,L),Zr(s,dr()),k;if(c===6)Oa(s,L);else{if(I=s.current.alternate,!(L&30)&&!N9(I)&&(c=Of(s,L),c===2&&(V=Up(s),V!==0&&(L=V,c=Gg(s,V))),c===1))throw k=iu,wo(s,0),Oa(s,L),Zr(s,dr()),k;switch(s.finishedWork=I,s.finishedLanes=L,c){case 0:case 1:throw Error(o(345));case 2:So(s,Qr,Ui);break;case 3:if(Oa(s,L),(L&130023424)===L&&(c=Fg+500-dr(),10<c)){if(Bc(s,0)!==0)break;if(I=s.suspendedLanes,(I&L)!==L){Nr(),s.pingedLanes|=s.suspendedLanes&I;break}s.timeoutHandle=U(So.bind(null,s,Qr,Ui),c);break}So(s,Qr,Ui);break;case 4:if(Oa(s,L),(L&4194240)===L)break;for(c=s.eventTimes,I=-1;0<L;){var J=31-Hn(L);V=1<<J,J=c[J],J>I&&(I=J),L&=~V}if(L=I,L=dr()-L,L=(120>L?120:480>L?480:1080>L?1080:1920>L?1920:3e3>L?3e3:4320>L?4320:1960*R9(L/1960))-L,10<L){s.timeoutHandle=U(So.bind(null,s,Qr,Ui),L);break}So(s,Qr,Ui);break;case 5:So(s,Qr,Ui);break;default:throw Error(o(329))}}}return Zr(s,dr()),s.callbackNode===k?vb.bind(null,s):null}function Gg(s,c){var k=au;return s.current.memoizedState.isDehydrated&&(wo(s,c).flags|=256),s=Of(s,c),s!==2&&(c=Qr,Qr=k,c!==null&&Hg(c)),s}function Hg(s){Qr===null?Qr=s:Qr.push.apply(Qr,s)}function N9(s){for(var c=s;;){if(c.flags&16384){var k=c.updateQueue;if(k!==null&&(k=k.stores,k!==null))for(var L=0;L<k.length;L++){var I=k[L],V=I.getSnapshot;I=I.value;try{if(!Vn(V(),I))return!1}catch{return!1}}}if(k=c.child,c.subtreeFlags&16384&&k!==null)k.return=c,c=k;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 Oa(s,c){for(c&=~Dg,c&=~yf,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var k=31-Hn(c),L=1<<k;s[k]=-1,c&=~L}}function mb(s){if(ut&6)throw Error(o(327));Eo();var c=Bc(s,0);if(!(c&1))return Zr(s,dr()),null;var k=Of(s,c);if(s.tag!==0&&k===2){var L=Up(s);L!==0&&(c=L,k=Gg(s,L))}if(k===1)throw k=iu,wo(s,0),Oa(s,c),Zr(s,dr()),k;if(k===6)throw Error(o(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,So(s,Qr,Ui),Zr(s,dr()),null}function yb(s){Sa!==null&&Sa.tag===0&&!(ut&6)&&Eo();var c=ut;ut|=1;var k=Zt.transition,L=mt;try{if(Zt.transition=null,mt=1,s)return s()}finally{mt=L,Zt.transition=k,ut=c,!(ut&6)&&hi()}}function Vg(){hn=Tl.current,Mt(Tl)}function wo(s,c){s.finishedWork=null,s.finishedLanes=0;var k=s.timeoutHandle;if(k!==Q&&(s.timeoutHandle=Q,X(k)),tr!==null)for(k=tr.return;k!==null;){var L=k;switch(Kp(L),L.tag){case 1:L=L.type.childContextTypes,L!=null&&jc();break;case 3:Pl(),Mt(Yr),Mt(Ar),cg();break;case 5:sg(L);break;case 4:Pl();break;case 13:Mt(Ht);break;case 19:Mt(Ht);break;case 10:tg(L.type._context);break;case 22:case 23:Vg()}k=k.return}if(pr=s,tr=s=xa(s.current,null),wr=hn=c,or=0,iu=null,Dg=yf=_o=0,Qr=au=null,yo!==null){for(c=0;c<yo.length;c++)if(k=yo[c],L=k.interleaved,L!==null){k.interleaved=null;var I=L.next,V=k.pending;if(V!==null){var J=V.next;V.next=I,L.next=J}k.pending=L}yo=null}return s}function bb(s,c){do{var k=tr;try{if(eg(),ef.current=af,tf){for(var L=Vt.memoizedState;L!==null;){var I=L.queue;I!==null&&(I.pending=null),L=L.next}tf=!1}if(bo=0,hr=ar=Vt=null,Ks=!1,Xs=0,jg.current=null,k===null||k.return===null){or=1,iu=c,tr=null;break}e:{var V=s,J=k.return,ie=k,pe=c;if(c=wr,ie.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Pe=pe,Ue=ie,tt=Ue.tag;if(!(Ue.mode&1)&&(tt===0||tt===11||tt===15)){var Ie=Ue.alternate;Ie?(Ue.updateQueue=Ie.updateQueue,Ue.memoizedState=Ie.memoizedState,Ue.lanes=Ie.lanes):(Ue.updateQueue=null,Ue.memoizedState=null)}var Lt=V2(J);if(Lt!==null){Lt.flags&=-257,q2(Lt,J,ie,V,c),Lt.mode&1&&H2(V,Pe,c),c=Lt,pe=Pe;var At=c.updateQueue;if(At===null){var Jr=new Set;Jr.add(pe),c.updateQueue=Jr}else At.add(pe);break e}else{if(!(c&1)){H2(V,Pe,c),qg();break e}pe=Error(o(426))}}else if(zt&&ie.mode&1){var Gi=V2(J);if(Gi!==null){!(Gi.flags&65536)&&(Gi.flags|=256),q2(Gi,J,ie,V,c),Zp(kl(pe,ie));break e}}V=pe=kl(pe,ie),or!==4&&(or=2),au===null?au=[V]:au.push(V),V=J;do{switch(V.tag){case 3:V.flags|=65536,c&=-c,V.lanes|=c;var he=U2(V,pe,c);c2(V,he);break e;case 1:ie=pe;var oe=V.type,ge=V.stateNode;if(!(V.flags&128)&&(typeof oe.getDerivedStateFromError=="function"||ge!==null&&typeof ge.componentDidCatch=="function"&&(wa===null||!wa.has(ge)))){V.flags|=65536,c&=-c,V.lanes|=c;var je=G2(V,ie,c);c2(V,je);break e}}V=V.return}while(V!==null)}Sb(k)}catch(We){c=We,tr===k&&k!==null&&(tr=k=k.return);continue}break}while(1)}function _b(){var s=mf.current;return mf.current=af,s===null?af:s}function qg(){(or===0||or===3||or===2)&&(or=4),pr===null||!(_o&268435455)&&!(yf&268435455)||Oa(pr,wr)}function Of(s,c){var k=ut;ut|=2;var L=_b();(pr!==s||wr!==c)&&(Ui=null,wo(s,c));do try{M9();break}catch(I){bb(s,I)}while(1);if(eg(),ut=k,mf.current=L,tr!==null)throw Error(o(261));return pr=null,wr=0,or}function M9(){for(;tr!==null;)wb(tr)}function L9(){for(;tr!==null&&!o9();)wb(tr)}function wb(s){var c=xb(s.alternate,s,hn);s.memoizedProps=s.pendingProps,c===null?Sb(s):tr=c,jg.current=null}function Sb(s){var c=s;do{var k=c.alternate;if(s=c.return,c.flags&32768){if(k=k9(k,c),k!==null){k.flags&=32767,tr=k;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{or=6,tr=null;return}}else if(k=P9(k,c,hn),k!==null){tr=k;return}if(c=c.sibling,c!==null){tr=c;return}tr=c=s}while(c!==null);or===0&&(or=5)}function So(s,c,k){var L=mt,I=Zt.transition;try{Zt.transition=null,mt=1,I9(s,c,k,L)}finally{Zt.transition=I,mt=L}return null}function I9(s,c,k,L){do Eo();while(Sa!==null);if(ut&6)throw Error(o(327));k=s.finishedWork;var I=s.finishedLanes;if(k===null)return null;if(s.finishedWork=null,s.finishedLanes=0,k===s.current)throw Error(o(177));s.callbackNode=null,s.callbackPriority=0;var V=k.lanes|k.childLanes;if(a9(s,V),s===pr&&(tr=pr=null,wr=0),!(k.subtreeFlags&2064)&&!(k.flags&2064)||_f||(_f=!0,Pb($p,function(){return Eo(),null})),V=(k.flags&15990)!==0,k.subtreeFlags&15990||V){V=Zt.transition,Zt.transition=null;var J=mt;mt=1;var ie=ut;ut|=4,jg.current=null,T9(s,k),cb(k,s),C(s.containerInfo),s.current=k,C9(k),l9(),ut=ie,mt=J,Zt.transition=V}else s.current=k;if(_f&&(_f=!1,Sa=s,wf=I),V=s.pendingLanes,V===0&&(wa=null),c9(k.stateNode),Zr(s,dr()),c!==null)for(L=s.onRecoverableError,k=0;k<c.length;k++)I=c[k],L(I.value,{componentStack:I.stack,digest:I.digest});if(bf)throw bf=!1,s=Bg,Bg=null,s;return wf&1&&s.tag!==0&&Eo(),V=s.pendingLanes,V&1?s===Ug?ou++:(ou=0,Ug=s):ou=0,hi(),null}function Eo(){if(Sa!==null){var s=J1(wf),c=Zt.transition,k=mt;try{if(Zt.transition=null,mt=16>s?16:s,Sa===null)var L=!1;else{if(s=Sa,Sa=null,wf=0,ut&6)throw Error(o(331));var I=ut;for(ut|=4,Fe=s.current;Fe!==null;){var V=Fe,J=V.child;if(Fe.flags&16){var ie=V.deletions;if(ie!==null){for(var pe=0;pe<ie.length;pe++){var Pe=ie[pe];for(Fe=Pe;Fe!==null;){var Ue=Fe;switch(Ue.tag){case 0:case 11:case 15:ru(8,Ue,V)}var tt=Ue.child;if(tt!==null)tt.return=Ue,Fe=tt;else for(;Fe!==null;){Ue=Fe;var Ie=Ue.sibling,Lt=Ue.return;if(ob(Ue),Ue===Pe){Fe=null;break}if(Ie!==null){Ie.return=Lt,Fe=Ie;break}Fe=Lt}}}var At=V.alternate;if(At!==null){var Jr=At.child;if(Jr!==null){At.child=null;do{var Gi=Jr.sibling;Jr.sibling=null,Jr=Gi}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:ru(9,V,V.return)}var he=V.sibling;if(he!==null){he.return=V.return,Fe=he;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(ie=Fe,ie.flags&2048)try{switch(ie.tag){case 0:case 11:case 15:ff(9,ie)}}catch(We){Bt(ie,ie.return,We)}if(ie===J){Fe=null;break e}var je=ie.sibling;if(je!==null){je.return=ie.return,Fe=je;break e}Fe=ie.return}}if(ut=I,hi(),di&&typeof di.onPostCommitFiberRoot=="function")try{di.onPostCommitFiberRoot(Uc,s)}catch{}L=!0}return L}finally{mt=k,Zt.transition=c}}return!1}function Eb(s,c,k){c=kl(k,c),c=U2(s,c,1),s=_a(s,c,1),c=Nr(),s!==null&&(Vs(s,1,c),Zr(s,c))}function Bt(s,c,k){if(s.tag===3)Eb(s,s,k);else for(;c!==null;){if(c.tag===3){Eb(c,s,k);break}else if(c.tag===1){var L=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof L.componentDidCatch=="function"&&(wa===null||!wa.has(L))){s=kl(k,s),s=G2(c,s,1),c=_a(c,s,1),s=Nr(),c!==null&&(Vs(c,1,s),Zr(c,s));break}}c=c.return}}function j9(s,c,k){var L=s.pingCache;L!==null&&L.delete(c),c=Nr(),s.pingedLanes|=s.suspendedLanes&k,pr===s&&(wr&k)===k&&(or===4||or===3&&(wr&130023424)===wr&&500>dr()-Fg?wo(s,0):Dg|=k),Zr(s,c)}function Ob(s,c){c===0&&(s.mode&1?(c=zc,zc<<=1,!(zc&130023424)&&(zc=4194304)):c=1);var k=Nr();s=pi(s,c),s!==null&&(Vs(s,c,k),Zr(s,k))}function D9(s){var c=s.memoizedState,k=0;c!==null&&(k=c.retryLane),Ob(s,k)}function F9(s,c){var k=0;switch(s.tag){case 13:var L=s.stateNode,I=s.memoizedState;I!==null&&(k=I.retryLane);break;case 19:L=s.stateNode;break;default:throw Error(o(314))}L!==null&&L.delete(c),Ob(s,k)}var xb;xb=function(s,c,k){if(s!==null)if(s.memoizedProps!==c.pendingProps||Yr.current)Xr=!0;else{if(!(s.lanes&k)&&!(c.flags&128))return Xr=!1,x9(s,c,k);Xr=!!(s.flags&131072)}else Xr=!1,zt&&c.flags&1048576&&r2(c,Vc,c.index);switch(c.lanes=0,c.tag){case 2:var L=c.type;lf(s,c),s=c.pendingProps;var I=yl(c,Ar.current);El(c,k),I=hg(null,c,L,s,I,k);var V=pg();return c.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Kr(L)?(V=!0,Dc(c)):V=!1,c.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,ig(c),I.updater=Qc,c.stateNode=I,I._reactInternals=c,og(c,L,s,k),c=Sg(null,c,L,!0,V,k)):(c.tag=0,zt&&V&&Yp(c),Ur(null,c,I,k),c=c.child),c;case 16:L=c.elementType;e:{switch(lf(s,c),s=c.pendingProps,I=L._init,L=I(L._payload),c.type=L,I=c.tag=B9(L),s=$n(L,s),I){case 0:c=wg(null,c,L,s,k);break e;case 1:c=Q2(null,c,L,s,k);break e;case 11:c=$2(null,c,L,s,k);break e;case 14:c=W2(null,c,L,$n(L.type,s),k);break e}throw Error(o(306,L,""))}return c;case 0:return L=c.type,I=c.pendingProps,I=c.elementType===L?I:$n(L,I),wg(s,c,L,I,k);case 1:return L=c.type,I=c.pendingProps,I=c.elementType===L?I:$n(L,I),Q2(s,c,L,I,k);case 3:e:{if(Z2(c),s===null)throw Error(o(387));L=c.pendingProps,V=c.memoizedState,I=V.element,u2(s,c),Xc(c,L,null,k);var J=c.memoizedState;if(L=J.element,le&&V.isDehydrated)if(V={element:L,isDehydrated:!1,cache:J.cache,pendingSuspenseBoundaries:J.pendingSuspenseBoundaries,transitions:J.transitions},c.updateQueue.baseState=V,c.memoizedState=V,c.flags&256){I=kl(Error(o(423)),c),c=J2(s,c,L,k,I);break e}else if(L!==I){I=kl(Error(o(424)),c),c=J2(s,c,L,k,I);break e}else for(le&&(Pn=ga(c.stateNode.containerInfo),dn=c,zt=!0,qn=null,qs=!1),k=y2(c,null,L,k),c.child=k;k;)k.flags=k.flags&-3|4096,k=k.sibling;else{if(wl(),L===I){c=Bi(s,c,k);break e}Ur(s,c,L,k)}c=c.child}return c;case 5:return b2(c),s===null&&Qp(c),L=c.type,I=c.pendingProps,V=s!==null?s.memoizedProps:null,J=I.children,Y(L,I)?J=null:V!==null&&Y(L,V)&&(c.flags|=32),X2(s,c),Ur(s,c,J,k),c.child;case 6:return s===null&&Qp(c),null;case 13:return eb(s,c,k);case 4:return lg(c,c.stateNode.containerInfo),L=c.pendingProps,s===null?c.child=Ol(c,null,L,k):Ur(s,c,L,k),c.child;case 11:return L=c.type,I=c.pendingProps,I=c.elementType===L?I:$n(L,I),$2(s,c,L,I,k);case 7:return Ur(s,c,c.pendingProps,k),c.child;case 8:return Ur(s,c,c.pendingProps.children,k),c.child;case 12:return Ur(s,c,c.pendingProps.children,k),c.child;case 10:e:{if(L=c.type._context,I=c.pendingProps,V=c.memoizedProps,J=I.value,l2(c,L,J),V!==null)if(Vn(V.value,J)){if(V.children===I.children&&!Yr.current){c=Bi(s,c,k);break e}}else for(V=c.child,V!==null&&(V.return=c);V!==null;){var ie=V.dependencies;if(ie!==null){J=V.child;for(var pe=ie.firstContext;pe!==null;){if(pe.context===L){if(V.tag===1){pe=zi(-1,k&-k),pe.tag=2;var Pe=V.updateQueue;if(Pe!==null){Pe=Pe.shared;var Ue=Pe.pending;Ue===null?pe.next=pe:(pe.next=Ue.next,Ue.next=pe),Pe.pending=pe}}V.lanes|=k,pe=V.alternate,pe!==null&&(pe.lanes|=k),rg(V.return,k,c),ie.lanes|=k;break}pe=pe.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|=k,ie=J.alternate,ie!==null&&(ie.lanes|=k),rg(J,k,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,I.children,k),c=c.child}return c;case 9:return I=c.type,L=c.pendingProps.children,El(c,k),I=kn(I),L=L(I),c.flags|=1,Ur(s,c,L,k),c.child;case 14:return L=c.type,I=$n(L,c.pendingProps),I=$n(L.type,I),W2(s,c,L,I,k);case 15:return Y2(s,c,c.type,c.pendingProps,k);case 17:return L=c.type,I=c.pendingProps,I=c.elementType===L?I:$n(L,I),lf(s,c),c.tag=1,Kr(L)?(s=!0,Dc(c)):s=!1,El(c,k),p2(c,L,I),og(c,L,I,k),Sg(null,c,L,!0,s,k);case 19:return rb(s,c,k);case 22:return K2(s,c,k)}throw Error(o(156,c.tag))};function Pb(s,c){return Vp(s,c)}function z9(s,c,k,L){this.tag=s,this.key=k,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=L,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rn(s,c,k,L){return new z9(s,c,k,L)}function $g(s){return s=s.prototype,!(!s||!s.isReactComponent)}function B9(s){if(typeof s=="function")return $g(s)?1:0;if(s!=null){if(s=s.$$typeof,s===E)return 11;if(s===p)return 14}return 2}function xa(s,c){var k=s.alternate;return k===null?(k=Rn(s.tag,c,s.key,s.mode),k.elementType=s.elementType,k.type=s.type,k.stateNode=s.stateNode,k.alternate=s,s.alternate=k):(k.pendingProps=c,k.type=s.type,k.flags=0,k.subtreeFlags=0,k.deletions=null),k.flags=s.flags&14680064,k.childLanes=s.childLanes,k.lanes=s.lanes,k.child=s.child,k.memoizedProps=s.memoizedProps,k.memoizedState=s.memoizedState,k.updateQueue=s.updateQueue,c=s.dependencies,k.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},k.sibling=s.sibling,k.index=s.index,k.ref=s.ref,k}function xf(s,c,k,L,I,V){var J=2;if(L=s,typeof s=="function")$g(s)&&(J=1);else if(typeof s=="string")J=5;else e:switch(s){case v:return Oo(k.children,I,V,c);case _:J=8,I|=8;break;case g:return s=Rn(12,k,c,I|2),s.elementType=g,s.lanes=V,s;case S:return s=Rn(13,k,c,I),s.elementType=S,s.lanes=V,s;case b:return s=Rn(19,k,c,I),s.elementType=b,s.lanes=V,s;case m:return Pf(k,I,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,L=null;break e}throw Error(o(130,s==null?s:typeof s,""))}return c=Rn(J,k,c,I),c.elementType=s,c.type=L,c.lanes=V,c}function Oo(s,c,k,L){return s=Rn(7,s,L,c),s.lanes=k,s}function Pf(s,c,k,L){return s=Rn(22,s,L,c),s.elementType=m,s.lanes=k,s.stateNode={isHidden:!1},s}function Wg(s,c,k){return s=Rn(6,s,null,c),s.lanes=k,s}function Yg(s,c,k){return c=Rn(4,s.children!==null?s.children:[],s.key,c),c.lanes=k,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function U9(s,c,k,L,I){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=Gp(0),this.expirationTimes=Gp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gp(0),this.identifierPrefix=L,this.onRecoverableError=I,le&&(this.mutableSourceEagerHydrationData=null)}function kb(s,c,k,L,I,V,J,ie,pe){return s=new U9(s,c,k,ie,pe),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:L,isDehydrated:k,cache:null,transitions:null,pendingSuspenseBoundaries:null},ig(V),s}function Ab(s){if(!s)return ya;s=s._reactInternals;e:{if(N(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 k=s.type;if(Kr(k))return X1(s,k,c)}return c}function Tb(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=M(c),s===null?null:s.stateNode}function Cb(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var k=s.retryLane;s.retryLane=k!==0&&k<c?k:c}}function kf(s,c){Cb(s,c),(s=s.alternate)&&Cb(s,c)}function G9(s){return s=M(s),s===null?null:s.stateNode}function H9(){return null}return r.attemptContinuousHydration=function(s){if(s.tag===13){var c=pi(s,134217728);if(c!==null){var k=Nr();Cn(c,s,134217728,k)}kf(s,134217728)}},r.attemptDiscreteHydration=function(s){if(s.tag===13){var c=pi(s,1);if(c!==null){var k=Nr();Cn(c,s,1,k)}kf(s,1)}},r.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var c=Ea(s),k=pi(s,c);if(k!==null){var L=Nr();Cn(k,s,c,L)}kf(s,c)}},r.attemptSynchronousHydration=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var k=Hs(c.pendingLanes);k!==0&&(Hp(c,k|1),Zr(c,dr()),!(ut&6)&&(Cl(),hi()))}break;case 13:yb(function(){var L=pi(s,1);if(L!==null){var I=Nr();Cn(L,s,1,I)}}),kf(s,1)}},r.batchedUpdates=function(s,c){var k=ut;ut|=1;try{return s(c)}finally{ut=k,ut===0&&(Cl(),Gc&&hi())}},r.createComponentSelector=function(s){return{$$typeof:df,value:s}},r.createContainer=function(s,c,k,L,I,V,J){return kb(s,c,!1,null,k,L,I,V,J)},r.createHasPseudoClassSelector=function(s){return{$$typeof:hf,value:s}},r.createHydrationContainer=function(s,c,k,L,I,V,J,ie,pe){return s=kb(k,L,!0,s,I,V,J,ie,pe),s.context=Ab(null),k=s.current,L=Nr(),I=Ea(k),V=zi(L,I),V.callback=c??null,_a(k,V,I),s.current.lanes=I,Vs(s,I,L),Zr(s,L),s},r.createPortal=function(s,c,k){var L=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:L==null?null:""+L,children:s,containerInfo:c,implementation:k}},r.createRoleSelector=function(s){return{$$typeof:pf,value:s}},r.createTestNameSelector=function(s){return{$$typeof:gf,value:s}},r.createTextSelector=function(s){return{$$typeof:vf,value:s}},r.deferredUpdates=function(s){var c=mt,k=Zt.transition;try{return Zt.transition=null,mt=16,s()}finally{mt=c,Zt.transition=k}},r.discreteUpdates=function(s,c,k,L,I){var V=mt,J=Zt.transition;try{return Zt.transition=null,mt=1,s(c,k,L,I)}finally{mt=V,Zt.transition=J,ut===0&&Cl()}},r.findAllNodes=Ig,r.findBoundingRects=function(s,c){if(!ye)throw Error(o(363));c=Ig(s,c),s=[];for(var k=0;k<c.length;k++)s.push(te(c[k]));for(c=s.length-1;0<c;c--){k=s[c];for(var L=k.x,I=L+k.width,V=k.y,J=V+k.height,ie=c-1;0<=ie;ie--)if(c!==ie){var pe=s[ie],Pe=pe.x,Ue=Pe+pe.width,tt=pe.y,Ie=tt+pe.height;if(L>=Pe&&V>=tt&&I<=Ue&&J<=Ie){s.splice(c,1);break}else if(L!==Pe||k.width!==pe.width||Ie<V||tt>J){if(!(V!==tt||k.height!==pe.height||Ue<L||Pe>I)){Pe>L&&(pe.width+=Pe-L,pe.x=L),Ue<I&&(pe.width=I-Pe),s.splice(c,1);break}}else{tt>V&&(pe.height+=tt-V,pe.y=V),Ie<J&&(pe.height=J-tt),s.splice(c,1);break}}}return s},r.findHostInstance=Tb,r.findHostInstanceWithNoPortals=function(s){return s=R(s),s=s!==null?G(s):null,s===null?null:s.stateNode},r.findHostInstanceWithWarning=function(s){return Tb(s)},r.flushControlled=function(s){var c=ut;ut|=1;var k=Zt.transition,L=mt;try{Zt.transition=null,mt=1,s()}finally{mt=L,Zt.transition=k,ut=c,ut===0&&(Cl(),hi())}},r.flushPassiveEffects=Eo,r.flushSync=yb,r.focusWithin=function(s,c){if(!ye)throw Error(o(363));for(s=Ng(s),c=gb(s,c),c=Array.from(c),s=0;s<c.length;){var k=c[s++];if(!fe(k)){if(k.tag===5&&Te(k.stateNode))return!0;for(k=k.child;k!==null;)c.push(k),k=k.sibling}}return!1},r.getCurrentUpdatePriority=function(){return mt},r.getFindAllNodesFailureDescription=function(s,c){if(!ye)throw Error(o(363));var k=0,L=[];s=[Ng(s),0];for(var I=0;I<s.length;){var V=s[I++],J=s[I++],ie=c[J];if((V.tag!==5||!fe(V))&&(Mg(V,ie)&&(L.push(Lg(ie)),J++,J>k&&(k=J)),J<c.length))for(V=V.child;V!==null;)s.push(V,J),V=V.sibling}if(k<c.length){for(s=[];k<c.length;k++)s.push(Lg(c[k]));return`findAllNodes was able to match part of the selector:
|
|
58
|
+
`+(L.join(" > ")+`
|
|
59
|
+
|
|
60
|
+
No matching component was found for:
|
|
61
|
+
`)+s.join(" > ")}return null},r.getPublicRootInstance=function(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return K(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:G9,findFiberByHostInstance:s.findFiberByHostInstance||H9,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{Uc=c.inject(s),di=c}catch{}s=!!c.checkDCE}}return s},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(s,c,k,L){if(!ye)throw Error(o(363));s=Ig(s,c);var I=Ye(s,k,L).disconnect;return{disconnect:function(){I()}}},r.registerMutableSourceForHydration=function(s,c){var k=c._getVersion;k=k(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,k]:s.mutableSourceEagerHydrationData.push(c,k)},r.runWithPriority=function(s,c){var k=mt;try{return mt=s,c()}finally{mt=k}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(s,c,k,L){var I=c.current,V=Nr(),J=Ea(I);return k=Ab(k),c.context===null?c.context=k:c.pendingContext=k,c=zi(V,J),c.payload={element:s},L=L===void 0?null:L,L!==null&&(c.callback=L),s=_a(I,c,J),s!==null&&(Cn(s,I,J,V),Kc(s,I,J)),J},r};i8.exports=zR;var BR=i8.exports;const UR=uh(BR);var a8={exports:{}},cl={};/**
|
|
62
|
+
* @license React
|
|
63
|
+
* react-reconciler-constants.production.min.js
|
|
64
|
+
*
|
|
65
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the MIT license found in the
|
|
68
|
+
* LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/cl.ConcurrentRoot=1;cl.ContinuousEventPriority=4;cl.DefaultEventPriority=16;cl.DiscreteEventPriority=1;cl.IdleEventPriority=536870912;cl.LegacyRoot=0;a8.exports=cl;var o8=a8.exports;const Dw={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let Fw=!1,zw=!1;const S1=".react-konva-event";let l8=!1;function GR(t){l8=t}const HR=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
|
|
70
|
+
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
|
|
71
|
+
Consider to add onDragMove or onDragEnd events.
|
|
72
|
+
For more info see: https://github.com/konvajs/react-konva/issues/256
|
|
73
|
+
`,VR=`ReactKonva: You are using "zIndex" attribute for a Konva node.
|
|
74
|
+
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
|
|
75
|
+
For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
76
|
+
`,qR={};function Ap(t,e,r=qR){if(!Fw&&"zIndex"in e&&(console.warn(VR),Fw=!0),!zw&&e.draggable){var n=e.x!==void 0||e.y!==void 0,i=e.onDragEnd||e.onDragMove;n&&!i&&(console.warn(HR),zw=!0)}for(var a in r)if(!Dw[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 v=l8||e._useStrictMode,_={},g=!1;const h={};for(var a in e)if(!Dw[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]||v&&e[a]!==t.getAttr(a))&&(g=!0,_[a]=e[a])}g&&(t.setAttrs(_),uo(t));for(var u in h)t.on(u+S1,h[u])}function uo(t){if(!lt.Konva.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}const s8={},$R={};ac.Node.prototype._applyProps=Ap;function WR(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),uo(t)}function YR(t,e,r){let n=ac[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=ac.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 Ap(u,a),u}function KR(t,e,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function XR(t,e,r){return!1}function QR(t){return t}function ZR(){return null}function JR(){return null}function eN(t,e,r,n){return $R}function tN(){}function rN(t){}function nN(t,e){return!1}function iN(){return s8}function aN(){return s8}const oN=setTimeout,lN=clearTimeout,sN=-1;function uN(t,e){return!1}const cN=!1,fN=!0,dN=!0;function hN(t,e){e.parent===t?e.moveToTop():t.add(e),uo(t)}function pN(t,e){e.parent===t?e.moveToTop():t.add(e),uo(t)}function u8(t,e,r){e._remove(),t.add(e),e.setZIndex(r.getZIndex()),uo(t)}function gN(t,e,r){u8(t,e,r)}function vN(t,e){e.destroy(),e.off(S1),uo(t)}function mN(t,e){e.destroy(),e.off(S1),uo(t)}function yN(t,e,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function bN(t,e,r){}function _N(t,e,r,n,i){Ap(t,i,n)}function wN(t){t.hide(),uo(t)}function SN(t){}function EN(t,e){(e.visible==null||e.visible)&&t.show()}function ON(t,e){}function xN(t){}function PN(){}const kN=()=>o8.DefaultEventPriority,AN=Object.freeze(Object.defineProperty({__proto__:null,appendChild:hN,appendChildToContainer:pN,appendInitialChild:WR,cancelTimeout:lN,clearContainer:xN,commitMount:bN,commitTextUpdate:yN,commitUpdate:_N,createInstance:YR,createTextInstance:KR,detachDeletedInstance:PN,finalizeInitialChildren:XR,getChildHostContext:aN,getCurrentEventPriority:kN,getPublicInstance:QR,getRootHostContext:iN,hideInstance:wN,hideTextInstance:SN,idlePriority:Eu.unstable_IdlePriority,insertBefore:u8,insertInContainerBefore:gN,isPrimaryRenderer:cN,noTimeout:sN,now:Eu.unstable_now,prepareForCommit:ZR,preparePortalMount:JR,prepareUpdate:eN,removeChild:vN,removeChildFromContainer:mN,resetAfterCommit:tN,resetTextContent:rN,run:Eu.unstable_runWithPriority,scheduleTimeout:oN,shouldDeprioritizeSubtree:nN,shouldSetTextContent:uN,supportsMutation:dN,unhideInstance:EN,unhideTextInstance:ON,warnsIfNotActing:fN},Symbol.toStringTag,{value:"Module"}));var TN=Object.defineProperty,CN=Object.defineProperties,RN=Object.getOwnPropertyDescriptors,Bw=Object.getOwnPropertySymbols,NN=Object.prototype.hasOwnProperty,MN=Object.prototype.propertyIsEnumerable,Uw=(t,e,r)=>e in t?TN(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Gw=(t,e)=>{for(var r in e||(e={}))NN.call(e,r)&&Uw(t,r,e[r]);if(Bw)for(var r of Bw(e))MN.call(e,r)&&Uw(t,r,e[r]);return t},LN=(t,e)=>CN(t,RN(e));function c8(t,e,r){if(!t)return;if(r(t)===!0)return t;let n=e?t.return:t.child;for(;n;){const i=c8(n,e,r);if(i)return i;n=e?null:n.sibling}}function f8(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const E1=f8(at.createContext(null));class d8 extends at.Component{render(){return at.createElement(E1.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:Hw,ReactCurrentDispatcher:Vw}=at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function IN(){const t=at.useContext(E1);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[Hw==null?void 0:Hw.current,t,t==null?void 0:t.alternate]){if(!n)continue;const i=c8(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 jN(){var t,e;const r=IN(),[n]=at.useState(()=>new Map);n.clear();let i=r;for(;i;){const a=(t=i.type)==null?void 0:t._context;a&&a!==E1&&!n.has(a)&&n.set(a,(e=Vw==null?void 0:Vw.current)==null?void 0:e.readContext(f8(a))),i=i.return}return n}function DN(){const t=jN();return at.useMemo(()=>Array.from(t.keys()).reduce((e,r)=>n=>at.createElement(e,null,at.createElement(r.Provider,LN(Gw({},n),{value:t.get(r)}))),e=>at.createElement(d8,Gw({},e))),[t])}function FN(t){const e=ft.useRef({});return ft.useLayoutEffect(()=>{e.current=t}),ft.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const zN=t=>{const e=ft.useRef(),r=ft.useRef(),n=ft.useRef(),i=FN(t),a=DN(),o=l=>{const{forwardedRef:u}=t;u&&(typeof u=="function"?u(l):u.current=l)};return ft.useLayoutEffect(()=>(r.current=new ac.Stage({width:t.width,height:t.height,container:e.current}),o(r.current),n.current=Ql.createContainer(r.current,o8.LegacyRoot,!1,null),Ql.updateContainer(ft.createElement(a,{},t.children),n.current),()=>{ac.isBrowser&&(o(null),Ql.updateContainer(null,n.current,null),r.current.destroy())}),[]),ft.useLayoutEffect(()=>{o(r.current),Ap(r.current,t,i),Ql.updateContainer(ft.createElement(a,{},t.children),n.current,null)}),ft.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})},BN="Layer",UN="FastLayer",ih="Group",GN="Label",HN="Rect",VN="Circle",qN="Ellipse",$N="Wedge",WN="Line",YN="Sprite",KN="Image",XN="Text",QN="TextPath",ZN="Star",JN="Ring",eM="Arc",tM="Tag",rM="Path",nM="RegularPolygon",iM="Arrow",aM="Shape",oM="Transformer",Ql=UR(AN);Ql.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:ft.version,rendererPackageName:"react-konva"});const lM=ft.forwardRef((t,e)=>ft.createElement(d8,{},ft.createElement(zN,{...t,forwardedRef:e}))),sM=GR,uM=Object.freeze(Object.defineProperty({__proto__:null,Arc:eM,Arrow:iM,Circle:VN,Ellipse:qN,FastLayer:UN,Group:ih,Image:KN,KonvaRenderer:Ql,Label:GN,Layer:BN,Line:WN,Path:rM,Rect:HN,RegularPolygon:nM,Ring:JN,Shape:aM,Sprite:YN,Stage:lM,Star:ZN,Tag:tM,Text:XN,TextPath:QN,Transformer:oM,Wedge:$N,useStrictMode:sM},Symbol.toStringTag,{value:"Module"})),co=Za(uM);var ko=at,Tp=function(e,r,n){const i=ko.useRef("loading"),a=ko.useRef(),[o,l]=ko.useState(0),u=ko.useRef(),f=ko.useRef(),v=ko.useRef();return(u.current!==e||f.current!==r||v.current!==n)&&(i.current="loading",a.current=void 0,u.current=e,f.current=r,v.current=n),ko.useLayoutEffect(function(){if(!e)return;var _=document.createElement("img");function g(){i.current="loaded",a.current=_,l(Math.random())}function h(){i.current="failed",a.current=void 0,l(Math.random())}return _.addEventListener("load",g),_.addEventListener("error",h),r&&(_.crossOrigin=r),n&&(_.referrerPolicy=n),_.src=e,function(){_.removeEventListener("load",g),_.removeEventListener("error",h)}},[e,r,n]),[a.current,i.current]};const cM=uh(Tp);var h8={},O1={},fM=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 dM=t=>{const e=window.getComputedStyle(t).position;return!(e==="absolute"||e==="relative")};function p8(t=()=>{}){const e=ft.useRef(t);return e.current=t,ft.useCallback((...r)=>e.current.apply(null,r),[])}const hM=({children:t,groupProps:e,divProps:r,transform:n,transformFunc:i})=>{const a=ft.useRef(null);ft.useRef();const[o]=ft.useState(()=>document.createElement("div")),l=ft.useMemo(()=>bd.createRoot(o),[o]),u=n??!0,f=p8(()=>{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 v=r||{},{style:_}=v,g=fM(v,["style"]);Object.assign(o.style,_),Object.assign(o,g)});return ft.useLayoutEffect(()=>{var v;const _=a.current;if(!_)return;const g=(v=_.getStage())===null||v===void 0?void 0:v.container();if(g)return g.appendChild(o),u&&dM(g)&&(g.style.position="relative"),_.on("absoluteTransformChange",f),f(),()=>{var h;_.off("absoluteTransformChange",f),(h=o.parentNode)===null||h===void 0||h.removeChild(o)}},[u]),ft.useLayoutEffect(()=>{f()},[r,i]),ft.useLayoutEffect(()=>{l.render(t)}),ft.useLayoutEffect(()=>()=>{setTimeout(()=>{l.unmount()})},[]),ft.createElement(ih,Object.assign({ref:a},e))},pM=({selector:t,enabled:e,children:r})=>{const n=ft.useRef(null),i=ft.useRef(null),a=ft.useRef(),o=e??!0;return ft.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 v=u.getLayer();if(!v)return;v.batchDraw()}},[t,o]),ft.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.destroy()},[]),ft.createElement(ih,{name:"_outer_portal",ref:n},ft.createElement(ih,{name:"_inner_portal",ref:i},r))},gM=Object.freeze(Object.defineProperty({__proto__:null,Html:hM,Portal:pM,useEvent:p8,useImage:cM},Symbol.toStringTag,{value:"Module"})),Cc=Za(gM);function vM(t,e){return Object.keys(t.values).forEach(r=>t.values[r]=t.values[r]&&parseFloat(t.values[r].toFixed(e))),t}function g8(t,e,r){const n=e-1,i=r[m8(n,r.length)];return i.marker!=="Z"?i:g8(t,n,r)}function v8(t,e,r){const n=e+1,i=r[m8(n,r.length)];return i.marker==="Z"?v8(t,n,r):i}function mM(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 yM(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 m8(t,e){return(t%e+e)%e}function bM(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 Gm(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,Gm(t,e-1)),t[e].marker==="Z"&&Gm(t,e-1)}function _M(t,e,r){const n=$w(t.values,r.values),i=$w(e.values,t.values);return Math.min(i,n)}function qw(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}function $w(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 Ww(t,e){return Math.sin(t)*e}function Yw(t,e){return Math.cos(t)*e}function Kw(t,e){const r=e/Math.tan(t);return r===1/0||r===-1/0||isNaN(r)?e:r}function wM(t,e){return e*Math.tan(t)}function SM(t,e){let r,n=0,i=t*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=Kw(t/2,-e):(r=Kw(t/2,e),n=1,r===1/0&&(r=e)),{offset:r,sweepFlag:n}}function EM(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 y8(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 yM(n.marker,a)}).map(mM)}function b8(t,e,r){let n=[],i=[];return r&&t.forEach(a=>vM(a,r)),t.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(bM),Gm(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(l=>!l.overlap).map((l,u,f)=>{const _=g8(l,u,f),g=v8(l,u,f),h=qw(l.values,_.values),w=qw(l.values,g.values),E=w-h,S=E*(180/Math.PI),b=_M(l,_,g),p=Math.abs(wM(E/2,b/2)),d=Math.min(e,p),m=SM(E,d),y=m.offset,x=m.sweepFlag,P=(u==0||u==f.length-1)&&!o;switch(l.marker){case"M":case"L":const O=[l.values.x+Ww(h,y),l.values.y+Yw(h,y)],N=[l.values.x+Ww(w,y),l.values.y+Yw(w,y)];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&&(g.marker==="L"||g.marker==="M")&&i.push({marker:"A",radius:d,values:{radiusX:d,radiusY:d,rotation:S,largeArc:0,sweep:x,x:parseFloat(N[0].toFixed(3)),y:parseFloat(N[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:EM(i),commands:i}}function OM(t,e,r){return b8([...y8(t)],e,r)}const xM=Object.freeze(Object.defineProperty({__proto__:null,parsePath:y8,roundCommands:b8,roundCorners:OM},Symbol.toStringTag,{value:"Module"})),PM=Za(xM);var aa={},fl={};(function(t){var e=me&&me.__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(ci);let i=!1;const a=(u=!i)=>{i=u};t.toggleFadeInAnimation=a;const o=()=>i;function l(u,f){const v=r.default.useRef();r.default.useLayoutEffect(()=>{v.current&&v.current.destroy()},[f]),r.default.useLayoutEffect(()=>{if(!i)return;const _=u.current.opacity();return _?(u.current.opacity(0),v.current=new n.default.Tween({node:u.current,opacity:_,onFinish:()=>{var g;(g=v.current)===null||g===void 0||g.destroy()}}),v.current.play(),()=>{var g;(g=v.current)===null||g===void 0||g.destroy()}):void 0},[])}t.isAnimationUsed=o,t.useFadeIn=l})(fl);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.triggerLoadError=t.onLoadError=t.whenLoaded=t.decrementLoader=t.incrementLoader=t.setAssetLoadTimeout=void 0;const e=fl;let r=0,n=[],i=3e4;const a=h=>{i=h};function o(h){r+=1;let w=!1;const E=setTimeout(()=>{w||(g(`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 v=[];function _(h){v.push(h)}function g(h){v.forEach(w=>w(h))}t.onLoadError=_,t.triggerLoadError=g})(aa);var Rc={};(function(t){var e=me&&me.__createBinding||(Object.create?function(M,D,G,F){F===void 0&&(F=G);var K=Object.getOwnPropertyDescriptor(D,G);K&&!("get"in K?!D.__esModule:K.writable||K.configurable)||(K={enumerable:!0,get:function(){return D[G]}}),Object.defineProperty(M,F,K)}:function(M,D,G,F){F===void 0&&(F=G),M[F]=D[G]}),r=me&&me.__setModuleDefault||(Object.create?function(M,D){Object.defineProperty(M,"default",{enumerable:!0,value:D})}:function(M,D){M.default=D}),n=me&&me.__importStar||function(M){if(M&&M.__esModule)return M;var D={};if(M!=null)for(var G in M)G!=="default"&&Object.prototype.hasOwnProperty.call(M,G)&&e(D,M,G);return r(D,M),D};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(sa),a=aa;let o=i.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),l=i.observable({value:!1});function u(){return l.value}function f(M){M!=="default"?(l.value=!0,o.splice(0,o.length),o.push(...M)):l.value=!1}function v(){return o}function _(M){t.globalFonts.push(M)}function g(M){const D=t.globalFonts.findIndex(G=>G.fontFamily===M);D!==-1&&t.globalFonts.splice(D,1)}function h(M){t.globalFonts.replace(M)}t.isGoogleFontChanged=u,t.setGoogleFonts=f,t.getFontsList=v,t.globalFonts=i.observable([]),t.addGlobalFont=_,t.removeGlobalFont=g,t.replaceGlobalFonts=h;var w="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",E=document.createElement("canvas");function S(){return p("Arial")}function b(){return p("Times","Times")}function p(M,D="Arial"){var G=E.getContext("2d");return G.font=`normal 40px '${M}', ${D}`,G.measureText(w).width}const d={Arial:!0},m=M=>!!d[M];async function y(M){var D;if(d[M])return;const G=!!(!((D=document.fonts)===null||D===void 0)&&D.load),F=S();if(G)try{await document.fonts.load(`16px '${M}'`);const $=p(M);if(F!==$)return void(d[M]=!0)}catch{}const K=b(),B=p(M);for(let $=0;$<100;$++){const W=p(M,"Arial"),C=p(M,"Times");if(W!==B||W!==F||C!==K)return void(d[M]=!0);await new Promise(A=>setTimeout(A,60))}console.warn(`Timeout for loading font "${M}". Looks like polotno can't load it. Is it a correct font family?`),(0,a.triggerLoadError)(`Timeout for loading font "${M}"`)}t.isFontLoaded=m,t.loadFont=y;const x={};let P="400,400italic,700,700italic";function O(M){P=M}function N(M){if(x[M])return;const D=`https://fonts.googleapis.com/css?family=${M.replace(/ /g,"+")}:${P}`,G=document.createElement("link");G.type="text/css",G.href=D,G.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(G),x[M]=!0}t.setGoogleFontsVariants=O,t.injectGoogleFont=N;const T={};function R(M){const D=M.fontFamily;if(T[D]||!M.url&&!M.styles)return;const G=document.createElement("style");G.type="text/css";const F=M.styles||(M.url?[{src:`url("${M.url}")`}]:[]);let K="";F.forEach(B=>{K+=`
|
|
77
|
+
@font-face {
|
|
78
|
+
font-family: '${D}';
|
|
79
|
+
src: ${B.src};
|
|
80
|
+
font-style: ${B.fontStyle||"normal"};
|
|
81
|
+
font-weight: ${B.fontWeight||"normal"};
|
|
82
|
+
}
|
|
83
|
+
`}),G.innerHTML=K,document.getElementsByTagName("head")[0].appendChild(G),T[M.fontFamily]=!0}t.injectCustomFont=R})(Rc);var zn={};(function(t){var e=me&&me.__createBinding||(Object.create?function(h,w,E,S){S===void 0&&(S=E);var b=Object.getOwnPropertyDescriptor(w,E);b&&!("get"in b?!w.__esModule:b.writable||b.configurable)||(b={enumerable:!0,get:function(){return w[E]}}),Object.defineProperty(h,S,b)}:function(h,w,E,S){S===void 0&&(S=E),h[S]=w[E]}),r=me&&me.__setModuleDefault||(Object.create?function(h,w){Object.defineProperty(h,"default",{enumerable:!0,value:w})}:function(h,w){h.default=w}),n=me&&me.__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(sa);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 v(h){console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),t.flags.textOverflow="change-font-size"}function _(h){t.flags.textOverflow=h}function g(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=v,t.setTextOverflow=_,t.setAnimationsEnabled=g})(zn);var x1={};(function(t){function e(r=""){return(r=r.replace(/<\/p>/gi,`
|
|
84
|
+
`)).replace(/(<([^>]+)>)/gi,"")}Object.defineProperty(t,"__esModule",{value:!0}),t.removeTags=void 0,t.removeTags=e})(x1);var P1={},k1={},dl=dl||{};dl.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 dl=dl||{};dl.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(B){var $=new Error(e+": "+B);throw $.source=e,$}function n(){var B=i();return e.length>0&&r("Invalid input not EOF"),B}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,_)||o("repeating-radial-gradient",t.repeatingRadialGradient,_)}function o(B,$,W){return l($,function(C){var A=W();return A&&(F(t.comma)||r("Missing comma before color stops")),{type:B,orientation:A,colorStops:d(m)}})}function l(B,$){var W=F(B);if(W){F(t.startCall)||r("Missing (");var C=$(W);return F(t.endCall)||r("Missing )"),C}}function u(){return f()||v()}function f(){return G("directional",t.sideOrCorner,1)}function v(){return G("angular",t.angleValue,1)}function _(){var B,$=g(),W;return $&&(B=[],B.push($),W=e,F(t.comma)&&($=g(),$?B.push($):e=W)),B}function g(){var B=h()||w();if(B)B.at=S();else{var $=E();if($){B=$;var W=S();W&&(B.at=W)}else{var C=b();C&&(B={type:"default-radial",at:C})}}return B}function h(){var B=G("shape",/^(circle)/i,0);return B&&(B.style=D()||E()),B}function w(){var B=G("shape",/^(ellipse)/i,0);return B&&(B.style=R()||E()),B}function E(){return G("extent-keyword",t.extentKeywords,1)}function S(){if(G("position",/^at/,0)){var B=b();return B||r("Missing positioning value"),B}}function b(){var B=p();if(B.x||B.y)return{type:"position",value:B}}function p(){return{x:R(),y:R()}}function d(B){var $=B(),W=[];if($)for(W.push($);F(t.comma);)$=B(),$?W.push($):r("One extra comma");return W}function m(){var B=y();return B||r("Expected color definition"),B.length=R(),B}function y(){return P()||N()||O()||x()}function x(){return G("literal",t.literalColor,0)}function P(){return G("hex",t.hexColor,1)}function O(){return l(t.rgbColor,function(){return{type:"rgb",value:d(T)}})}function N(){return l(t.rgbaColor,function(){return{type:"rgba",value:d(T)}})}function T(){return F(t.number)[1]}function R(){return G("%",t.percentageValue,1)||M()||D()}function M(){return G("position-keyword",t.positionKeywords,1)}function D(){return G("px",t.pixelValue,1)||G("em",t.emValue,1)}function G(B,$,W){var C=F($);if(C)return{type:B,value:C[W]}}function F(B){var $,W;return W=/^[\n\r\t\s]+/.exec(e),W&&K(W[0].length),$=B.exec(e),$&&K($[0].length),$}function K(B){e=e.substr(B)}return function(B){return e=B.toString(),n()}}();k1.parse=dl.parse;k1.stringify=dl.stringify;(function(t){var e=me&&me.__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(k1),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})(P1);var Nc={};(function(t){var e=me&&me.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.applyFilter=void 0;const r=e(ci);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})(Nc);var Fs={};(function(t){var e=me&&me.__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=Ni,i=co,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)))})(Fs);var hl={};(function(t){var e=me&&me.__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=>`
|
|
85
|
+
@media (max-width: ${t.MOBILE_BREAKPOINT}px) {
|
|
86
|
+
${o}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.polotno-mobile & {
|
|
90
|
+
${o}
|
|
91
|
+
}
|
|
92
|
+
`;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})(hl);(function(t){var e=me&&me.__createBinding||(Object.create?function(C,A,j,z){z===void 0&&(z=j);var H=Object.getOwnPropertyDescriptor(A,j);H&&!("get"in H?!A.__esModule:H.writable||H.configurable)||(H={enumerable:!0,get:function(){return A[j]}}),Object.defineProperty(C,z,H)}:function(C,A,j,z){z===void 0&&(z=j),C[z]=A[j]}),r=me&&me.__setModuleDefault||(Object.create?function(C,A){Object.defineProperty(C,"default",{enumerable:!0,value:A})}:function(C,A){C.default=A}),n=me&&me.__importStar||function(C){if(C&&C.__esModule)return C;var A={};if(C!=null)for(var j in C)j!=="default"&&Object.prototype.hasOwnProperty.call(C,j)&&e(A,C,j);return r(A,C),A},i=me&&me.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};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=Ni,l=co,u=Cc,f=sa,v=i(ci),_=PM,g=aa,h=Rc,w=zn,E=x1,S=n(P1),b=Nc,p=fl,d=Fs,m=hl,y=document.createElement("style");y.type="text/css",document.head.appendChild(y);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(C){var A="֑-߿יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+A+"]*?["+A+"]").test(C)}function O(C){C=C.replace(/\s/g,"");let A=0;for(var j=0;j<C.length;j++)P(C[j])&&(A+=1);return A>C.length/2}function N(C){return O(C)?"rtl":"ltr"}t.isRTLText=O,t.getDir=N;const T=(0,o.observer)(({textNodeRef:C,element:A,onBlur:j,selectAll:z,cursorPosition:H})=>{const[Y,q]=a.default.useState(x),U=C.current;a.default.useLayoutEffect(()=>{const ee={};ee.width=U.width()-2*U.padding()+"px",ee.height=U.height()-2*U.padding()+10+"px",ee.fontSize=U.fontSize()+"px",ee.lineHeight=U.lineHeight()+.01,ee.fontFamily=U.fontFamily(),ee.textAlign=U.align(),ee.color=U.fill(),ee.fontWeight=A.fontWeight,ee.fontStyle=A.fontStyle,ee.letterSpacing=A.letterSpacing+"em";const le=`
|
|
93
|
+
.polotno-input::placeholder {
|
|
94
|
+
color: ${Y.color};
|
|
95
|
+
opacity: 0.6;
|
|
96
|
+
}
|
|
97
|
+
`;y.innerHTML="",y.appendChild(document.createTextNode(le)),JSON.stringify(ee)!==JSON.stringify(Y)&&q(ee)});const X=a.default.useRef(null);a.default.useEffect(()=>{const ee=setTimeout(()=>{var le;const ce=X.current;if(!ce)return;(le=X.current)===null||le===void 0||le.focus();const _e=H||ce.value.length;ce.selectionStart=ce.selectionEnd=_e,z&&(ce==null||ce.select(),document.execCommand("selectAll",!1,null))});return()=>{clearTimeout(ee)}},[]);let Q=0;const Z=U.textArr.length*U.lineHeight()*U.fontSize();A.verticalAlign==="middle"&&(Q=(A.a.height-Z)/2),A.verticalAlign==="bottom"&&(Q=A.a.height-Z);const re=(0,E.removeTags)(A.text);return a.default.createElement(u.Html,null,a.default.createElement("textarea",{className:"polotno-input",ref:X,dir:N(re),style:Object.assign(Object.assign(Object.assign({},x),Y),{paddingTop:Q+"px"}),value:re,onChange:ee=>{A.set({text:ee.target.value})},placeholder:A.placeholder,onBlur:j}))}),R=C=>{const[A,j]=a.default.useState(!1),z=a.default.useRef(!1);return a.default.useEffect(()=>{var H=!0;return setTimeout(()=>{H&&(C._editModeEnabled&&(z.current=!0),j(!0),setTimeout(()=>{z.current=!1},50))},50),()=>{H=!1}},[]),{editorEnabled:A&&C._editModeEnabled,selectAll:z.current}},M=(C,A)=>{const[j,z]=a.default.useReducer(Y=>Y+1,0),H=a.default.useRef((0,h.isFontLoaded)(A));return a.default.useLayoutEffect(()=>{if(H.current=(0,h.isFontLoaded)(A),H.current)return;let Y=!0;return(async()=>{H.current=!1,z();const q=(0,g.incrementLoader)(`text ${A}`);await C.loadFont(A),v.default.Util.requestAnimFrame(q),Y&&(H.current=!0,z())})(),()=>{Y=!1}},[A]),[H.current]};t.useFontLoader=M;const D=({fontLoaded:C,fontFamily:A,fontSize:j,lineHeight:z})=>a.default.useMemo(()=>{if(typeof z=="number")return z;const H=document.createElement("div");H.style.fontFamily=A,H.style.fontSize=j+"px",H.style.lineHeight=z,H.innerText="Test text",document.body.appendChild(H);const Y=H.offsetHeight;return document.body.removeChild(H),Y/j},[C,A,j,z]);function G(C){var A=C.getAbsoluteTransform().copy();A.invert();var j=C.getStage().getPointerPosition();return A.point(j)}function F(C){var A;const j=C.target,z=G(j),H=j.textArr,Y=Math.floor(z.y/(j.fontSize()*j.lineHeight())),q=H.slice(0,Y).reduce((Q,Z)=>Q+Z.text.length,Y),U=(A=H[Y])!==null&&A!==void 0?A:H[0];let X=0;return j.align()==="right"?X=j.width()-U.width:j.align()==="center"&&(X=j.width()/2-U.width/2),q+Math.round((z.x-X)/U.width*U.text.length)}function K(C){const A=a.default.useRef(C),j=a.default.useRef(C);return a.default.useMemo(()=>{j.current=A.current,A.current=C},[C]),j.current}function B(C,A){const j=C.fontSize(),z=C.height(),H=(0,E.removeTags)(A.text);let Y=A.a.fontSize;C.height(void 0);const q=Math.round(2*A.a.fontSize)-1;for(let U=1;U<q;U++){const X=A.a.height&&C.height()>A.a.height,Q=H.split(`
|
|
98
|
+
`).join(" ").split(/[\s-]+/);let Z=C.textArr.map(ee=>ee.text).join(";");const re=Q.find(ee=>!Z.includes(ee)||(Z=Z.replace(ee,""),!1));if(!(X||re))break;Y-=.5,C.fontSize(Y)}return C.fontSize(j),C.height(z),Y}function $({lines:C,lineHeight:A,width:j,align:z="left",padding:H=0,cornerRadius:Y=0}){var q;C.forEach((Z,re)=>{Z.cx=j/2,z==="right"?Z.cx=j-Z.width/2:z==="left"&&(Z.cx=Z.width/2),z!=="justify"||Z.lastInParagraph||(Z.width=j),z==="justify"&&(Z.cx=Z.width/2)});let U=`M ${(q=C[0])===null||q===void 0?void 0:q.cx} ${-H}`;C.forEach((Z,re)=>{const{cx:ee}=Z,le=C[re-1];le&&le.width>Z.width?U+=` L ${ee+Z.width/2+H} ${re*A+H}`:U+=` L ${ee+Z.width/2+H} ${re*A-H}`;const ce=C[re+1];ce&&ce.width>Z.width?U+=` L ${ee+Z.width/2+H} ${(re+1)*A-H}`:U+=` L ${ee+Z.width/2+H} ${(re+1)*A+H}`});for(var X=C.length-1;X>=0;X--){const Z=C[X],{cx:re}=Z,ee=C[X+1];ee&&ee.width>Z.width?U+=` L ${re-Z.width/2-H} ${(X+1)*A-H}`:U+=` L ${re-Z.width/2-H} ${(X+1)*A+H}`;const le=C[X-1];le&&le.width>Z.width?U+=` L ${re-Z.width/2-H} ${X*A+H}`:U+=` L ${re-Z.width/2-H} ${X*A-H}`}U+=" Z";const Q=(0,_.parsePath)(U);return(0,_.roundCommands)(Q,Y).path}t.getLineHeight=D,t.usePrevious=K;const W=C=>a.default.useMemo(()=>{if(!S.isGradient(C.fill))return{fill:C.fill};const{stops:A,rotation:j}=S.parseColor(C.fill),z={x:C.a.width/2,y:C.a.height/2},H=Math.sqrt(Math.pow(z.x,2)+Math.pow(z.y,2)),Y=v.default.Util.degToRad(j)-Math.PI/2,q=[];return A.forEach(({offset:U,color:X})=>{q.push(U,X)}),{fillLinearGradientStartPointX:z.x-H*Math.cos(Y),fillLinearGradientStartPointY:z.y-H*Math.sin(Y),fillLinearGradientColorStops:q,fillLinearGradientEndPointX:z.x+H*Math.cos(Y),fillLinearGradientEndPointY:z.y+H*Math.sin(Y),fill:A[1].color,fillPriority:"linear-gradient"}},[C.fill]);t.useTextColor=W,t.TextElement=(0,o.observer)(({element:C,store:A})=>{const j=a.default.useRef(null),z=a.default.useRef(null),{editorEnabled:H,selectAll:Y}=R(C),[q,U]=a.default.useState(!1),[X,Q]=a.default.useState(!1),Z=a.default.useRef(C.a.height),re=A.selectedElements.indexOf(C)>=0,{textVerticalResizeEnabled:ee}=w.flags,le=K(C.fontFamily),[ce,_e]=a.default.useState([]);a.default.useEffect(()=>{var Ce,Be;const et=(Be=(Ce=j.current)===null||Ce===void 0?void 0:Ce.textArr)!==null&&Be!==void 0?Be:[];JSON.stringify(et)!==JSON.stringify(ce)&&_e(et)}),a.default.useEffect(()=>{if(C.a.width)return;const Ce=j.current;Ce.width(600),C.set({width:1.4*Ce.getTextWidth()})},[]),a.default.useLayoutEffect(()=>(0,f.autorun)(()=>{const Ce=j.current;(0,b.applyFilter)(Ce,C)}));const[Le]=(0,t.useFontLoader)(A,C.fontFamily),Oe=(0,E.removeTags)(C.text),ae=()=>{const Ce=j.current.clone({height:void 0}),Be=Math.ceil(Ce.fontSize()*Ce.lineHeight()*Ce.textArr.length+1);return Ce.destroy(),Be};a.default.useLayoutEffect(()=>{if(!Le)return;const{textOverflow:Ce}=w.flags;if(C.a.height)if(Ce!=="change-font-size"||X||A.isPlaying){if(Ce==="resize"){const Be=ae();ee&&C.a.height<Be&&A.history.ignore(()=>{C.set({height:Be}),j.current.height(Be)},!1,!0),ee||C.a.height===Be||A.history.ignore(()=>{C.set({height:Be}),j.current.height(Be)},!1,!0)}}else{const Be=B(j.current,C);if(Be!==C.a.fontSize)return void A.history.ignore(()=>{C.set({fontSize:Be})},!1,!0);const et=ae();C.a.height===et||ee||A.history.ignore(()=>{C.set({height:et})},!1,!0)}else{const Be=ae();A.history.ignore(()=>{C.set({height:Be})},!1,!0)}}),a.default.useLayoutEffect(()=>{const Ce=j.current;Ce&&(Ce.width(Ce.width()+1e-8),Ce._setTextData(),(0,b.applyFilter)(Ce,C))},[Le]);const de=a.default.useRef(null),ye=a.default.useRef(0),we=Ce=>{Ce.evt.preventDefault(),A.selectedShapes.find(et=>et===C)&&C.contentEditable&&(ye.current=F(Ce),C.toggleEditMode())},te=!Oe&&C.placeholder?.6:C.a.opacity;(0,p.useFadeIn)(j,te);const ue=(0,t.getLineHeight)({fontLoaded:Le,fontFamily:C.fontFamily,fontSize:C.a.fontSize,lineHeight:C.lineHeight}),fe=C.selectable||A.role==="admin",be=(0,t.useTextColor)(C),Te=a.default.useMemo(()=>C.backgroundEnabled?$({lines:JSON.parse(JSON.stringify(ce)),cornerRadius:C.backgroundCornerRadius*(C.a.fontSize*ue*.5),lineHeight:ue*C.a.fontSize,padding:C.backgroundPadding*(C.a.fontSize*ue*.5),width:C.a.width,align:C.align}):"",[C.backgroundEnabled,C.backgroundCornerRadius,C.a.fontSize,ue,C.backgroundPadding,C.a.width,C.align,ce]),Ye=(0,m.useMobile)();let Ke=0;return C.verticalAlign==="middle"?Ke=(C.a.height-ce.length*ue*C.a.fontSize)/2:C.verticalAlign==="bottom"&&(Ke=C.a.height-ce.length*ue*C.a.fontSize),a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Path,{ref:z,x:C.a.x,y:C.a.y,rotation:C.a.rotation,hideInExport:!C.showInExport||!Oe,listening:!1,visible:C.backgroundEnabled,opacity:C.backgroundOpacity,data:Te,fill:C.backgroundColor,offsetY:-Ke}),a.default.createElement(l.Text,Object.assign({ref:j,id:C.id,name:"element",hideInExport:!C.showInExport||!Oe,editModeEnabled:C._editModeEnabled,x:C.a.x,y:C.a.y,rotation:C.a.rotation,width:C.a.width,height:C.a.height,text:Oe||C.placeholder},be,{stroke:C.stroke,lineJoin:"round",strokeWidth:C.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:C.a.fontSize,fontFamily:`"${C.fontFamily}", "${le}"`,fontStyle:C.fontStyle+" "+C.fontWeight,textDecoration:C.textDecoration,align:C.align,verticalAlign:C.verticalAlign,draggable:Ye?C.draggable&&re:C.draggable,preventDefault:!Ye||re,opacity:te,visible:!C._editModeEnabled,ellipsis:w.flags.textOverflow==="ellipsis",shadowEnabled:C.shadowEnabled,shadowBlur:C.shadowBlur,shadowOffsetX:C.shadowOffsetX,shadowOffsetY:C.shadowOffsetY,shadowColor:C.shadowColor,shadowOpacity:C.shadowOpacity,lineHeight:ue,letterSpacing:C.letterSpacing*C.a.fontSize,listening:fe,onDragMove:Ce=>{C.set({x:Ce.target.x(),y:Ce.target.y()})},onDragEnd:Ce=>{C.set({x:Ce.target.x(),y:Ce.target.y()})},onMouseEnter:()=>{U(!0)},onMouseLeave:()=>{U(!1)},onClick:we,onTap:we,onTransformStart:()=>{Q(!0),Z.current=j.current.height()},onTransform:Ce=>{var Be,et;const Xe=Ce.target;(Be=z.current)===null||Be===void 0||Be.setAttrs({x:Xe.x(),y:Xe.y(),rotation:Xe.rotation(),scale:Xe.scale()});const se=((et=Xe.getStage())===null||et===void 0?void 0:et.findOne("Transformer")).getActiveAnchor();if(se==="middle-left"||se==="middle-right"){const ne=Xe.scaleX(),Ae=Xe.width()*ne,Me=C.a.fontSize;let ve=Ae;Ae<Me&&(ve=Me,de.current&&Xe.position(de.current)),Xe.width(ve),Xe.scaleX(1),Xe.scaleY(1);const Re=ae();if(w.flags.textOverflow!=="ellipsis"){const Se=Math.max(Re,Z.current);Xe.height(Se),C.set({height:Xe.height()})}C.set({x:Xe.x(),y:Xe.y(),width:Xe.width(),rotation:Xe.rotation()}),(0,b.applyFilter)(Xe,C)}if(se==="top-center"||se==="bottom-center"){let ne=w.flags.textOverflow==="resize"?ae():ue*C.a.fontSize;Ce.target.height(Math.max(ne,Ce.target.height()*Ce.target.scaleY())),Ce.target.scaleY(1)}Ce.target.strokeWidth(C.strokeWidth/Ce.target.scaleX()),de.current=Ce.target.position()},onTransformEnd:Ce=>{var Be;const et=Ce.target.scaleX();Ce.target.scaleX(1),Ce.target.scaleY(1),Ce.target.strokeWidth(C.strokeWidth),C.set({fontSize:Math.round(C.a.fontSize*et),width:Math.ceil(Ce.target.width()*et),x:Ce.target.x(),y:Ce.target.y(),rotation:Ce.target.rotation(),height:Ce.target.height()*et}),(Be=z.current)===null||Be===void 0||Be.setAttrs({scaleX:1,scaleY:1}),Q(!1)}})),H&&a.default.createElement(l.Group,{x:C.a.x,y:C.a.y,rotation:C.a.rotation},a.default.createElement(T,{textNodeRef:j,element:C,selectAll:Y,cursorPosition:ye.current,onBlur:()=>{C.toggleEditMode(!1)}})),!X&&(q||re)&&a.default.createElement(d.Highlighter,{element:C}))})})(O1);var A1={},zs={};(function(t){var e=me&&me.__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(ci),n=e(at),i=P1;function a(d){for(;d.parentNode;){if(d.nodeName==="defs")return!0;d=d.parentNode}return!1}function o(d){const m={fill:"",stroke:""};return d.getAttribute("fill")&&d.getAttribute("fill")!=="none"&&(m.fill=d.getAttribute("fill")),!m.fill&&d.style.fill&&d.style.fill!=="none"&&(m.fill=d.style.fill),d.getAttribute("stroke")&&(m.stroke=d.getAttribute("stroke")),!m.stroke&&d.style.stroke&&(m.stroke=d.style.stroke),m.stroke||m.fill||(m.fill="black"),m}const l=["path","rect","circle"];function u(d){for(var m=[],y=d.getElementsByTagName("*"),x=0,P=y.length;x<P;x++){const O=y[x];a(O)||(O.getAttribute("fill")!==null&&m.push(O),(O.getAttribute("stroke")!==null||O.style&&O.style.fill||l.indexOf(O.nodeName)>=0)&&m.push(O))}return m}async function f(d){const m=await fetch(d);return g(await m.text())}async function v(d){return await(await fetch(d,{mode:"cors"})).text()}function _(d){const m=u(new DOMParser().parseFromString(d,"image/svg+xml")),y=[];return m.forEach(x=>{const{fill:P,stroke:O}=o(x);[P,O].forEach(N=>{N&&r.default.Util.colorToRGBA(N)&&y.indexOf(N)===-1&&y.push(N)})}),y}function g(d){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(d)))}async function h(d){const m=await v(d),y=new DOMParser().parseFromString(m,"image/svg+xml").documentElement.getAttribute("viewBox"),[x,P,O,N]=(y==null?void 0:y.split(" "))||[];return{width:parseFloat(O),height:parseFloat(N)}}function w(d){var m=new DOMParser().parseFromString(d,"image/svg+xml");const y=m.documentElement.getAttribute("viewBox"),[x,P,O,N]=(y==null?void 0:y.split(" "))||[],T=m.documentElement.getAttribute("width");!T&&m.documentElement.setAttribute("width",O+"px");const R=m.documentElement.getAttribute("height");if((!R||R.indexOf("%")>=0)&&m.documentElement.setAttribute("height",N+"px"),T&&T.indexOf("%")>=0&&R&&R.indexOf("%")===-1){const M=parseFloat(R)/parseFloat(N);m.documentElement.setAttribute("width",M*parseFloat(O)+"px")}if(R&&R.indexOf("%")>=0&&T&&T.indexOf("%")===-1){const M=parseFloat(T)/parseFloat(O);m.documentElement.setAttribute("height",M*parseFloat(N)+"px")}return new XMLSerializer().serializeToString(m)}t.urlToBase64=f,t.urlToString=v,t.getColors=_,t.svgToURL=g,t.getSvgSize=h,t.fixSize=w;const E=(d,m)=>{if(!d||!m)return!1;const y=r.default.Util.colorToRGBA(d),x=r.default.Util.colorToRGBA(m);return y&&x?y.r===x.r&&y.g===x.g&&y.b===x.b&&y.a===x.a:void 0};function S(d,m,y,x){var P=d.namespaceURI,O=document.createElementNS(P,"linearGradient");const N=r.default.Util.degToRad(y+90),T=(Math.cos(N)+1)/2,R=(Math.sin(N)+1)/2,M=(Math.cos(N+Math.PI)+1)/2,D=(Math.sin(N+Math.PI)+1)/2;O.setAttribute("x1",100*T+"%"),O.setAttribute("y1",100*R+"%"),O.setAttribute("x2",100*M+"%"),O.setAttribute("y2",100*D+"%"),O.setAttribute("gradientUnits","userSpaceOnUse"),O.setAttribute("id",m);for(var G=0;G<x.length;G++){var F=x[G],K=document.createElementNS(P,"stop");for(var B in F)F.hasOwnProperty(B)&&K.setAttribute(B,F[B]);O.appendChild(K)}return(d.querySelector("defs")||d.insertBefore(document.createElementNS(P,"defs"),d.firstChild)).appendChild(O)}function b(d,m){var y=new DOMParser().parseFromString(d,"image/svg+xml");const x=u(y),P=Array.from(m.keys());return x.forEach(O=>{const{fill:N,stroke:T}=o(O);[{prop:"fill",color:N},{prop:"stroke",color:T}].forEach(({prop:R,color:M})=>{const D=P.find(G=>(0,t.sameColors)(G,M));if(D){const G=m.get(D);if((0,i.isGradient)(G)){const{rotation:F,stops:K}=(0,i.parseColor)(G),B=K.map(W=>({offset:100*W.offset+"%","stop-color":W.color})),$="color"+Math.round(1e8*Math.random());S(y.children[0],$,F,B),O.style[R]=null,O.setAttribute(R,`url('#${$}')`)}else O.style[R]=m.get(D)}})}),g(new XMLSerializer().serializeToString(y))}t.sameColors=E,t.replaceColors=b;const p=d=>{const[m,y]=n.default.useState([]);return n.default.useEffect(()=>{let x=!1;return(async()=>{y([]);const P=_(await v(d));x||y(P)})(),()=>{x=!0}},[d]),m};t.useSvgColors=p})(zs);(function(t){var e=me&&me.__createBinding||(Object.create?function(A,j,z,H){H===void 0&&(H=z);var Y=Object.getOwnPropertyDescriptor(j,z);Y&&!("get"in Y?!j.__esModule:Y.writable||Y.configurable)||(Y={enumerable:!0,get:function(){return j[z]}}),Object.defineProperty(A,H,Y)}:function(A,j,z,H){H===void 0&&(H=z),A[H]=j[z]}),r=me&&me.__setModuleDefault||(Object.create?function(A,j){Object.defineProperty(A,"default",{enumerable:!0,value:j})}:function(A,j){A.default=j}),n=me&&me.__importStar||function(A){if(A&&A.__esModule)return A;var j={};if(A!=null)for(var z in A)z!=="default"&&Object.prototype.hasOwnProperty.call(A,z)&&e(j,A,z);return r(j,A),j},i=me&&me.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(t,"__esModule",{value:!0}),t.ImageElement=t.useImageLoader=t.setImageLoaderHook=void 0;const a=i(at),o=Ni,l=sa,u=co,f=i(Tp),v=i(ci),_=Cc,g=Fs,h=aa,w=n(zs),E=zn,S=Nc,b=fl,p=hl;function d(){return document.createElement("canvas")}async function m(A){if(!(A.indexOf("data:image/svg+xml")>=0||A.indexOf(".svg")>=0))return A;const j=await w.urlToString(A),z=w.fixSize(j);return w.svgToURL(z)}const y=A=>{const[j,z]=a.default.useState(A);return a.default.useEffect(()=>{(async()=>{const H=await m(A);H!==j&&z(H)})()},[A]),j},x=(A,j,z)=>{const H=a.default.useMemo(()=>{var Y,q;const{flipX:U,flipY:X}=A,Q=A.type==="svg"||A.src.indexOf("data:image/svg+xml")>=0||A.src.indexOf(".svg")>=0,Z=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&Q||A.maskSrc;if(!U&&!X&&!Z)return j;if(!j||!j.width||!j.height)return null;const re=d();let ee=1;A.type==="svg"&&(ee=Math.max(A.a.width/j.width*z,A.a.height/j.height*z)),re.width=Math.max(j.width*ee,1),re.height=Math.max(j.height*ee,1);let le=U?-re.width:0,ce=X?-re.height:0;return(Y=re.getContext("2d"))===null||Y===void 0||Y.scale(U?-1:1,X?-1:1),(q=re.getContext("2d"))===null||q===void 0||q.drawImage(j,le,ce,re.width,re.height),re},[A.maskSrc,A.flipX,A.flipY,j,A.a.width,A.a.height,z]);return a.default.useEffect(()=>()=>{H&&H.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(H)},[H]),H};function P(A,j){const z=j.width/j.height;let H,Y;return z>=A.width/A.height?(H=A.width,Y=A.width/z):(H=A.height*z,Y=A.height),{x:(A.width-H)/2,y:(A.height-Y)/2,width:H,height:Y}}function O(A,j,z,H,Y,q,U){for(var X=new ImageData(j,z),Q=new Int32Array(A.data.buffer),Z=A.width,re=new Int32Array(X.data.buffer),ee=X.width,le=j/q,ce=z/U,_e=Math.round(1/le),Le=Math.round(1/ce),Oe=_e*Le,ae=0;ae<X.height;ae++)for(var de=0;de<ee;de++){for(var ye=H+Math.round(de/le)+(Y+Math.round(ae/ce))*Z,we=0,te=0,ue=0,fe=0,be=0;be<Le;be++)for(var Te=0;Te<_e;Te++){var Ye=Q[ye+Te+be*Z];we+=Ye<<24>>>24,te+=Ye<<16>>>24,ue+=Ye<<8>>>24,fe+=Ye>>>24}we=Math.round(we/Oe),te=Math.round(te/Oe),ue=Math.round(ue/Oe),fe=Math.round(fe/Oe),re[de+ae*ee]=fe<<24|ue<<16|te<<8|we}return X}function N(A,j){var z,H;const Y=d();Y.width=A.width,Y.height=A.height,(z=Y.getContext("2d"))===null||z===void 0||z.drawImage(A,0,0,Y.width,Y.height);const q=O(Y.getContext("2d").getImageData(0,0,Y.width,Y.height),Math.floor(Y.width*j),Math.floor(Y.height*j),0,0,Y.width,Y.height);return Y.width=Math.floor(Y.width*j),Y.height=Math.floor(Y.height*j),(H=Y.getContext("2d"))===null||H===void 0||H.putImageData(q,0,0),Y}const T=(A,j)=>{const[z,H]=K(A.maskSrc,"anonymous"),Y=A.maskSrc?H:"loaded";return(0,t.useImageLoader)(Y,A.id+"-mask"),a.default.useMemo(()=>{if(!z||!j||!j.width||!j.height)return j;const q=d();q.width=Math.max(j.width,1),q.height=Math.max(j.height,1);const U=q.getContext("2d");if(!U)return j;U.drawImage(j,0,0),U.globalCompositeOperation="source-in";const X=P(z,A);return U.drawImage(z,X.x,X.y,X.width,X.height,0,0,j.width,j.height),q},[j,z,A.a.width,A.a.height])},R=(A,j,z,H,Y=0,q=!1)=>{const U=Math.floor(Math.max(A.a.width*H,1)),X=Math.floor(Math.max(A.a.height*H,1)),Q=Math.min(Y*H,U/2,X/2),Z=Math.max(A.a.width/z.width,A.a.height/z.height)*H,re=A.page._exporting&&E.flags.imageDownScalingEnabled&&Z<1&&!q,ee=z.x===0&&z.y===0&&z.width===(j==null?void 0:j.width)&&z.height===(j==null?void 0:j.height),le=a.default.useMemo(()=>{if(!(!j||!j.width||!j.height))return ee&&Q===0&&!re?void 0:d()},[j,Q,re,ee]);return a.default.useLayoutEffect(()=>{if(!le||!j)return;le.width=U,le.height=X;const ce=le.getContext("2d");if(!ce)return;Q&&(ce.beginPath(),ce.moveTo(Q,0),ce.lineTo(U-Q,0),ce.arc(U-Q,Q,Q,3*Math.PI/2,0,!1),ce.lineTo(U,X-Q),ce.arc(U-Q,X-Q,Q,0,Math.PI/2,!1),ce.lineTo(Q,X),ce.arc(Q,X-Q,Q,Math.PI/2,Math.PI,!1),ce.lineTo(0,Q),ce.arc(Q,Q,Q,Math.PI,3*Math.PI/2,!1),ce.clip());const _e=re?N(j,Z):j,Le=re?{x:Math.floor(z.x*Z),y:Math.floor(z.y*Z),width:Math.floor(z.width*Z),height:Math.floor(z.height*Z)}:z;ce.drawImage(_e,Le.x,Le.y,Le.width,Le.height,0,0,le.width,le.height)},[le,A.a.width,A.a.height,z.x,z.y,z.width,z.height,Y,H,q,A.page._exporting,re]),a.default.useEffect(()=>()=>{le&&le.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(le)},[le]),le||j},M=(A,j,z,H)=>{const Y=y(A.clipSrc||""),[q,U]=K(Y,"anonymous"),X=A.clipSrc?U:"loaded";(0,t.useImageLoader)(X,A.id+"-clip");const Q=a.default.useMemo(()=>{if(j&&q)return d()},[j,q]);return a.default.useLayoutEffect(()=>{var Z;if(!q||!j||!j.width||!j.height||!q||!q.width||!q.height||!Q)return;const re=d(),ee=Math.max(A.a.width/q.width*z,A.a.height/q.height*z);re.width=q.width*ee,re.height=q.height*ee,(Z=re.getContext("2d"))===null||Z===void 0||Z.drawImage(q,0,0,re.width,re.height),Q.width=Math.max(j.width,1),Q.height=Math.max(j.height,1);const le=Q.getContext("2d");le&&(le.save(),le.drawImage(re,0,0,j.width,j.height),v.default.Util.releaseCanvas(re),le.globalCompositeOperation="source-in",le.drawImage(j,0,0,Q.width,Q.height),le.restore())},[Q,j,q,A.a.width,A.a.height,z,...H]),A.clipSrc&&q?Q:j},D=d(),G=(0,o.observer)(({element:A})=>{const j=Math.min(30,A.a.width/4,A.a.height/4),z=a.default.useRef(null);return a.default.useEffect(()=>{const H=z.current;if(!H)return;const Y=new v.default.Animation(q=>{H.rotate(((q==null?void 0:q.timeDiff)||0)/2)},H.getLayer());return Y.start(),()=>{Y.stop()}}),a.default.createElement(u.Group,{x:A.x,y:A.y,rotation:A.rotation,listening:!1,opacity:A.a.opacity,hideInExport:!A.showInExport},a.default.createElement(u.Rect,{width:A.a.width,height:A.a.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:z,x:A.a.width/2,y:A.a.height/2,fill:"white",outerRadius:Math.abs(j),innerRadius:Math.max(1,j-5),angle:270}))}),F=(0,o.observer)(({element:A})=>{const j="Can not load the image...",z=Math.max(10,Math.min(30,A.a.width/25));return a.default.createElement(u.Group,{x:A.x,y:A.y,rotation:A.rotation,listening:!1,opacity:A.a.opacity,hideInExport:!A.showInExport},a.default.createElement(u.Rect,{width:A.a.width,height:A.a.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:j,fontSize:z,width:A.a.width,height:A.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let K=f.default;const B=A=>{K=A};t.setImageLoaderHook=B;const $=(A,j)=>{const z=a.default.useRef(),H=()=>{var Y;(Y=z.current)===null||Y===void 0||Y.call(z),z.current=void 0};a.default.useEffect(()=>H,[]),a.default.useLayoutEffect(()=>{A!=="loading"||z.current||(z.current=(0,h.incrementLoader)(`image ${j}`)),A!=="loading"&&H(),A==="failed"&&(0,h.triggerLoadError)(`image ${j}`)},[A])};t.useImageLoader=$;const W=({image:A,status:j,type:z})=>{const H=a.default.useRef();return a.default.useEffect(()=>{H.current=A||H.current},[A]),j!=="failed"||j!=="failed"&&z==="svg"?H.current:void 0},C=A=>{const[j,z]=a.default.useReducer(U=>U+1,0),H=a.default.useRef("loading"),Y=a.default.useRef(A.src),q=a.default.useRef(A.src);return q.current!==A.src&&(q.current=A.src,H.current="loading"),a.default.useEffect(()=>{if(A.type!=="svg"||!A.src)return;let U=!1;return(async()=>{H.current="loading",z();const X=await w.urlToString(A.src),Q=w.fixSize(X),Z=w.replaceColors(Q,A.colorsReplace);U||(Y.current=Z,H.current="loaded",z())})(),()=>{U=!0}},[A.src,JSON.stringify(A.colorsReplace)]),A.type!=="svg"?[A.src,"loaded"]:[Y.current,H.current]};t.ImageElement=(0,o.observer)(({element:A,store:j})=>{var z;const[H,Y]=a.default.useState(!1),q=a.default.useRef(null),U=a.default.useRef(null),[X,Q]=a.default.useState(!1),Z=j.selectedElements.indexOf(A)>=0,[re,ee]=C(A),[le,ce]=K(re,"anonymous"),_e=A.type!=="svg"||ee==="loaded"?ce:"loading";(0,t.useImageLoader)(_e,A.id);const Le=W({image:le,status:ce,type:A.type}),Oe=T(A,x(A,le||Le,j._elementsPixelRatio))||D;let{cropX:ae,cropY:de,cropWidth:ye,cropHeight:we}=A;ce!=="loaded"&&(ae=de=0,ye=we=1);const te=Oe.width*ye,ue=Oe.height*we,fe=A.a.width/A.a.height;let be,Te;const Ye=te/ue,Ke=A.type==="svg";Ke?(be=te,Te=ue):fe>=Ye?(be=te,Te=te/fe):(be=ue*fe,Te=ue);const Ce={x:Oe.width*ae,y:Oe.height*de,width:be,height:Te},Be=(z=A.cornerRadius)!==null&&z!==void 0?z:0;let et=M(A,R(A,Oe,Ce,j._elementsPixelRatio,Be,H||A._cropModeEnabled||A.type==="svg"),j._elementsPixelRatio,[Ce,Be,j._elementsPixelRatio]);const Xe=Math.max(A.a.width/be,A.a.height/Te);a.default.useEffect(()=>{var Ne;if(!A._cropModeEnabled)return;const Qe=(Ne=q.current)===null||Ne===void 0?void 0:Ne.getStage();function ht(Ft){A._cropModeEnabled&&Ft.target!==U.current&&A.toggleCropMode(!1)}function wt(Ft){A._cropModeEnabled&&Ft.target.nodeName!=="CANVAS"&&A.toggleCropMode(!1)}return document.body.addEventListener("click",wt),Qe==null||Qe.on("click",ht),Qe==null||Qe.on("tap",ht),()=>{document.body.removeEventListener("click",wt),document.body.removeEventListener("touchstart",wt),Qe==null||Qe.off("click",ht),Qe==null||Qe.off("click",ht)}},[A._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(H||A._cropModeEnabled))return(0,S.applyFilter)(q.current,A),(0,l.autorun)(()=>{(0,S.applyFilter)(q.current,A)},{delay:100})},[Oe,H,ye,we,A._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Ne;H||A._cropModeEnabled?(Ne=q.current)===null||Ne===void 0||Ne.clearCache():(0,S.applyFilter)(q.current,A)},[H,A.a.width,A.a.height,A._cropModeEnabled]),a.default.useEffect(()=>{(0,S.applyFilter)(q.current,A)},[A.shadowEnabled,A.shadowBlur,A.cornerRadius,A.shadowColor,A.shadowOffsetX,A.shadowOffsetY,A.shadowOpacity]);const se=a.default.useRef(null),ne=a.default.useRef(null),Ae=a.default.useRef(null);a.default.useLayoutEffect(()=>{A._cropModeEnabled&&(ne.current.nodes([se.current]),Ae.current.nodes([U.current]))},[A._cropModeEnabled]);const Me=Ne=>{Math.round(Ne.target.x())>0&&(Ne.target.x(0),Ne.target.scaleX(1)),Math.round(Ne.target.y())>0&&(Ne.target.y(0),Ne.target.scaleY(1));const Qe=Ne.target.width()*Ne.target.scaleX(),ht=Ne.target.height()*Ne.target.scaleY(),wt=Math.min(1,be/Qe),Ft=Math.min(1,Te/ht),zr=1-wt,Br=Math.min(zr,Math.max(0,Math.round(-Ne.target.x())/Qe)),ir=1-Ft,fn=Math.min(ir,Math.max(0,Math.round(-Ne.target.y())/ht));Ne.target.setAttrs({x:-Br*Oe.width,y:-fn*Oe.height,scaleX:1,scaleY:1}),A.set({cropX:Br,cropY:fn,cropWidth:wt,cropHeight:Ft})},ve=()=>{A.type!=="svg"&&A.contentEditable&&setTimeout(()=>{A.toggleCropMode(!0)})},Re=A.type==="svg"&&Le,Se=ce==="loading"&&!Re,$e=ce==="failed",xt=!Se&&!$e,Ee=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),qe=xt?A.a.opacity:0;(0,b.useFadeIn)(q,qe);const Ze=A.selectable||j.role==="admin",pt=(0,p.useMobile)();return a.default.createElement(a.default.Fragment,null,Se&&a.default.createElement(G,{element:A}),$e&&a.default.createElement(F,{element:A}),a.default.createElement(u.Image,{ref:q,name:"element",id:A.id,image:et,x:A.a.x,y:A.a.y,width:A.a.width||1,height:A.a.height||1,rotation:A.rotation,opacity:qe,shadowEnabled:A.shadowEnabled,shadowBlur:A.shadowBlur,shadowOffsetX:A.shadowOffsetX,shadowOffsetY:A.shadowOffsetY,shadowColor:A.shadowColor,shadowOpacity:A.shadowOpacity,customCrop:Ce,listening:Ze,draggable:pt?A.draggable&&Z:A.draggable,preventDefault:!pt||Z,hideInExport:!A.showInExport,onMouseEnter:()=>{Q(!0)},onMouseLeave:()=>{Q(!1)},onDragMove:Ne=>{A.set({x:Ne.target.x(),y:Ne.target.y()})},onDragEnd:Ne=>{A.set({x:Ne.target.x(),y:Ne.target.y()})},onDblClick:ve,onDblTap:ve,onTransformStart:()=>{Y(!0),Ee.current={cropX:A.cropX,cropY:A.cropY,cropWidth:A.cropWidth,cropHeight:A.cropHeight}},onTransform:Ne=>{var Qe;const ht=Ne.currentTarget,wt=Math.abs(ht.scaleX()-1)<1e-7?1:ht.scaleX(),Ft=Math.abs(ht.scaleY()-1)<1e-7?1:ht.scaleY();ht.scaleX(1),ht.scaleY(1);const zr=(Qe=Ne.target.getStage())===null||Qe===void 0?void 0:Qe.findOne("Transformer"),Br=1-be/Oe.width,ir=Math.min(Br,Math.max(0,A.cropX)),fn=1-Te/Oe.height,Gn=Math.min(fn,Math.max(0,A.cropY)),fi=zr.getActiveAnchor(),kr=!(fi.indexOf("middle")>=0||fi.indexOf("center")>=0),po=!kr&&wt<1&&Ee.current.cropHeight>Te/Oe.height;let ga=kr?A.cropWidth:A.cropWidth*wt;po&&(ga=A.cropWidth);const Us=!kr&&Ft<1&&Ee.current.cropWidth>be/Oe.width;let Ii=kr?A.cropHeight:A.cropHeight*Ft;Us&&(Ii=A.cropHeight),Ke&&(ga=A.cropWidth,Ii=A.cropHeight),A.set({cropX:ir,cropY:Gn,x:ht.x(),y:ht.y(),width:ht.width()*wt,height:ht.height()*Ft,rotation:Ne.target.rotation(),cropWidth:Math.min(ga,1-ir),cropHeight:Math.min(Ii,1-Gn)})},onTransformEnd:Ne=>{const Qe=Ne.currentTarget;A.set({width:Qe.width(),height:Qe.height(),x:Qe.x(),y:Qe.y(),rotation:Ne.target.rotation(),cropWidth:be/Oe.width,cropHeight:Te/Oe.height}),Y(!1)}}),a.default.createElement(u.Rect,{x:A.x,y:A.y,width:Math.max(A.a.width-A.borderSize,0),height:Math.max(A.a.height-A.borderSize,0),opacity:qe,offsetX:-A.borderSize/2,offsetY:-A.borderSize/2,stroke:A.borderColor,strokeWidth:A.borderSize,listening:!1,visible:!!A.borderSize,rotation:A.rotation,cornerRadius:Math.max(0,Be-A.borderSize),hideInExport:!A.showInExport}),A._cropModeEnabled&&a.default.createElement(_.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/j.scale,y:-window.innerWidth/j.scale,width:window.innerWidth/j.scale*3,height:window.innerWidth/j.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:et,x:A.x,y:A.y,width:A.a.width,height:A.a.height,rotation:A.rotation,shadowEnabled:A.shadowEnabled,shadowBlur:A.shadowBlur}),a.default.createElement(u.Group,{x:A.x,y:A.y,rotation:A.rotation,scaleX:Xe,scaleY:Xe},a.default.createElement(u.Image,{image:Oe,ref:U,opacity:.4,draggable:!0,x:-A.cropX*Oe.width,y:-A.cropY*Oe.height,onDragMove:Me,onTransform:Me}),a.default.createElement(u.Transformer,{ref:Ae,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ne,Qe)=>Qe.width<5||Qe.height<5?Ne:Qe,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:be,height:Te,ref:se,listening:!1,onTransform:Ne=>{Ne.target.x()<-A.cropX*Oe.width-1e-9&&(Ne.target.x(-A.cropX*Oe.width),Ne.target.scaleX(1)),Ne.target.y()<-A.cropY*Oe.height-1e-9&&(Ne.target.y(-A.cropY*Oe.height),Ne.target.scaleY(1));const Qe=Math.min(1,Math.max(0,A.cropX+Ne.target.x()/Oe.width)),ht=Math.min(1,Math.max(0,Ne.target.y()/Oe.height+A.cropY)),wt=Ne.target.width()*Ne.target.scaleX(),Ft=Ne.target.height()*Ne.target.scaleY(),zr=Math.min(1-Qe,wt/Oe.width),Br=Math.min(1-ht,Ft/Oe.height),ir=Ne.target.getAbsolutePosition(Ne.target.getParent().getParent());Ne.target.scale({x:1,y:1}),Ne.target.position({x:0,y:0}),A.set({x:ir.x,y:ir.y,cropX:Qe,cropY:ht,cropWidth:zr,cropHeight:Br,width:Math.min(wt*Xe,Oe.width*(1-Qe)*Xe),height:Math.min(Ft*Xe,Oe.height*(1-ht)*Xe)})}}),a.default.createElement(u.Transformer,{ref:ne,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ne,Qe)=>Qe.width<5||Qe.height<5?Ne:Qe,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(X||Z)&&a.default.createElement(g.Highlighter,{element:A}))})})(A1);var _8={},w8={exports:{}};/*!
|
|
99
|
+
* Quill Editor v1.3.7
|
|
100
|
+
* https://quilljs.com/
|
|
101
|
+
* Copyright (c) 2014, Jason Chen
|
|
102
|
+
* Copyright (c) 2013, salesforce.com
|
|
103
|
+
*/(function(t,e){(function(n,i){t.exports=i()})(typeof self<"u"?self:me,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,l){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:l})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(18),l=i(19),u=i(45),f=i(46),v=i(47),_=i(48),g=i(49),h=i(12),w=i(32),E=i(33),S=i(31),b=i(1),p={Scope:b.Scope,create:b.create,find:b.find,query:b.query,register:b.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:_.default,Scroll:u.default,Block:v.default,Inline:f.default,Text:g.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(b,p){b.__proto__=p}||function(b,p){for(var d in p)p.hasOwnProperty(d)&&(b[d]=p[d])};return function(b,p){S(b,p);function d(){this.constructor=b}b.prototype=p===null?Object.create(p):(d.prototype=p.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(S){a(b,S);function b(p){var d=this;return p="[Parchment] "+p,d=S.call(this,p)||this,d.message=p,d.name=d.constructor.name,d}return b}(Error);n.ParchmentError=o;var l={},u={},f={},v={};n.DATA_KEY="__blot";var _;(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"})(_=n.Scope||(n.Scope={}));function g(S,b){var p=w(S);if(p==null)throw new o("Unable to create "+S+" blot");var d=p,m=S instanceof Node||S.nodeType===Node.TEXT_NODE?S:d.create(b);return new d(m,b)}n.create=g;function h(S,b){return b===void 0&&(b=!1),S==null?null:S[n.DATA_KEY]!=null?S[n.DATA_KEY].blot:b?h(S.parentNode,b):null}n.find=h;function w(S,b){b===void 0&&(b=_.ANY);var p;if(typeof S=="string")p=v[S]||l[S];else if(S instanceof Text||S.nodeType===Node.TEXT_NODE)p=v.text;else if(typeof S=="number")S&_.LEVEL&_.BLOCK?p=v.block:S&_.LEVEL&_.INLINE&&(p=v.inline);else if(S instanceof HTMLElement){var d=(S.getAttribute("class")||"").split(/\s+/);for(var m in d)if(p=u[d[m]],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=[],b=0;b<arguments.length;b++)S[b]=arguments[b];if(S.length>1)return S.map(function(m){return E(m)});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(v[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(m){return m.toUpperCase()}):p.tagName=p.tagName.toUpperCase();var d=Array.isArray(p.tagName)?p.tagName:[p.tagName];d.forEach(function(m){(f[m]==null||p.className==null)&&(f[m]=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),v=function(_){Array.isArray(_)?this.ops=_:_!=null&&Array.isArray(_.ops)?this.ops=_.ops:this.ops=[]};v.prototype.insert=function(_,g){var h={};return _.length===0?this:(h.insert=_,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(h.attributes=g),this.push(h))},v.prototype.delete=function(_){return _<=0?this:this.push({delete:_})},v.prototype.retain=function(_,g){if(_<=0)return this;var h={retain:_};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(h.attributes=g),this.push(h)},v.prototype.push=function(_){var g=this.ops.length,h=this.ops[g-1];if(_=l(!0,{},_),typeof h=="object"){if(typeof _.delete=="number"&&typeof h.delete=="number")return this.ops[g-1]={delete:h.delete+_.delete},this;if(typeof h.delete=="number"&&_.insert!=null&&(g-=1,h=this.ops[g-1],typeof h!="object"))return this.ops.unshift(_),this;if(o(_.attributes,h.attributes)){if(typeof _.insert=="string"&&typeof h.insert=="string")return this.ops[g-1]={insert:h.insert+_.insert},typeof _.attributes=="object"&&(this.ops[g-1].attributes=_.attributes),this;if(typeof _.retain=="number"&&typeof h.retain=="number")return this.ops[g-1]={retain:h.retain+_.retain},typeof _.attributes=="object"&&(this.ops[g-1].attributes=_.attributes),this}}return g===this.ops.length?this.ops.push(_):this.ops.splice(g,0,_),this},v.prototype.chop=function(){var _=this.ops[this.ops.length-1];return _&&_.retain&&!_.attributes&&this.ops.pop(),this},v.prototype.filter=function(_){return this.ops.filter(_)},v.prototype.forEach=function(_){this.ops.forEach(_)},v.prototype.map=function(_){return this.ops.map(_)},v.prototype.partition=function(_){var g=[],h=[];return this.forEach(function(w){var E=_(w)?g:h;E.push(w)}),[g,h]},v.prototype.reduce=function(_,g){return this.ops.reduce(_,g)},v.prototype.changeLength=function(){return this.reduce(function(_,g){return g.insert?_+u.length(g):g.delete?_-g.delete:_},0)},v.prototype.length=function(){return this.reduce(function(_,g){return _+u.length(g)},0)},v.prototype.slice=function(_,g){_=_||0,typeof g!="number"&&(g=1/0);for(var h=[],w=u.iterator(this.ops),E=0;E<g&&w.hasNext();){var S;E<_?S=w.next(_-E):(S=w.next(g-E),h.push(S)),E+=u.length(S)}return new v(h)},v.prototype.compose=function(_){var g=u.iterator(this.ops),h=u.iterator(_.ops),w=[],E=h.peek();if(E!=null&&typeof E.retain=="number"&&E.attributes==null){for(var S=E.retain;g.peekType()==="insert"&&g.peekLength()<=S;)S-=g.peekLength(),w.push(g.next());E.retain-S>0&&h.next(E.retain-S)}for(var b=new v(w);g.hasNext()||h.hasNext();)if(h.peekType()==="insert")b.push(h.next());else if(g.peekType()==="delete")b.push(g.next());else{var p=Math.min(g.peekLength(),h.peekLength()),d=g.next(p),m=h.next(p);if(typeof m.retain=="number"){var y={};typeof d.retain=="number"?y.retain=p:y.insert=d.insert;var x=u.attributes.compose(d.attributes,m.attributes,typeof d.retain=="number");if(x&&(y.attributes=x),b.push(y),!h.hasNext()&&o(b.ops[b.ops.length-1],y)){var P=new v(g.rest());return b.concat(P).chop()}}else typeof m.delete=="number"&&typeof d.retain=="number"&&b.push(m)}return b.chop()},v.prototype.concat=function(_){var g=new v(this.ops.slice());return _.ops.length>0&&(g.push(_.ops[0]),g.ops=g.ops.concat(_.ops.slice(1))),g},v.prototype.diff=function(_,g){if(this.ops===_.ops)return new v;var h=[this,_].map(function(p){return p.map(function(d){if(d.insert!=null)return typeof d.insert=="string"?d.insert:f;var m=p===_?"on":"with";throw new Error("diff() called "+m+" non-document")}).join("")}),w=new v,E=a(h[0],h[1],g),S=u.iterator(this.ops),b=u.iterator(_.ops);return E.forEach(function(p){for(var d=p[1].length;d>0;){var m=0;switch(p[0]){case a.INSERT:m=Math.min(b.peekLength(),d),w.push(b.next(m));break;case a.DELETE:m=Math.min(d,S.peekLength()),S.next(m),w.delete(m);break;case a.EQUAL:m=Math.min(S.peekLength(),b.peekLength(),d);var y=S.next(m),x=b.next(m);o(y.insert,x.insert)?w.retain(m,u.attributes.diff(y.attributes,x.attributes)):w.push(x).delete(m);break}d-=m}}),w.chop()},v.prototype.eachLine=function(_,g){g=g||`
|
|
104
|
+
`;for(var h=u.iterator(this.ops),w=new v,E=0;h.hasNext();){if(h.peekType()!=="insert")return;var S=h.peek(),b=u.length(S)-h.peekLength(),p=typeof S.insert=="string"?S.insert.indexOf(g,b)-b:-1;if(p<0)w.push(h.next());else if(p>0)w.push(h.next(p));else{if(_(w,h.next(1).attributes||{},E)===!1)return;E+=1,w=new v}}w.length()>0&&_(w,{},E)},v.prototype.transform=function(_,g){if(g=!!g,typeof _=="number")return this.transformPosition(_,g);for(var h=u.iterator(this.ops),w=u.iterator(_.ops),E=new v;h.hasNext()||w.hasNext();)if(h.peekType()==="insert"&&(g||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()),b=h.next(S),p=w.next(S);if(b.delete)continue;p.delete?E.push(p):E.retain(S,u.attributes.transform(b.attributes,p.attributes,g))}return E.chop()},v.prototype.transformPosition=function(_,g){g=!!g;for(var h=u.iterator(this.ops),w=0;h.hasNext()&&w<=_;){var E=h.peekLength(),S=h.peekType();if(h.next(),S==="delete"){_-=Math.min(E,_-w);continue}else S==="insert"&&(w<_||!g)&&(_+=E);w+=E}return _},r.exports=v},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(h){return typeof Array.isArray=="function"?Array.isArray(h):a.call(h)==="[object Array]"},f=function(h){if(!h||a.call(h)!=="[object Object]")return!1;var 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)},v=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},_=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 g(){var h,w,E,S,b,p,d=arguments[0],m=1,y=arguments.length,x=!1;for(typeof d=="boolean"&&(x=d,d=arguments[1]||{},m=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});m<y;++m)if(h=arguments[m],h!=null)for(w in h)E=_(d,w),S=_(h,w),d!==S&&(x&&S&&(f(S)||(b=u(S)))?(b?(b=!1,p=E&&u(E)?E:[]):p=E&&f(E)?E:{},v(d,{name:w,newValue:g(x,p,S)})):typeof S<"u"&&v(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 R(M,D){for(var G=0;G<D.length;G++){var F=D[G];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(M,F.key,F)}}return function(M,D,G){return D&&R(M.prototype,D),G&&R(M,G),M}}(),o=function R(M,D,G){M===null&&(M=Function.prototype);var F=Object.getOwnPropertyDescriptor(M,D);if(F===void 0){var K=Object.getPrototypeOf(M);return K===null?void 0:R(K,D,G)}else{if("value"in F)return F.value;var B=F.get;return B===void 0?void 0:B.call(G)}},l=i(3),u=d(l),f=i(2),v=d(f),_=i(0),g=d(_),h=i(16),w=d(h),E=i(6),S=d(E),b=i(7),p=d(b);function d(R){return R&&R.__esModule?R:{default:R}}function m(R,M){if(!(R instanceof M))throw new TypeError("Cannot call a class as a function")}function y(R,M){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:R}function x(R,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);R.prototype=Object.create(M&&M.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(R,M):R.__proto__=M)}var P=1,O=function(R){x(M,R);function M(){return m(this,M),y(this,(M.__proto__||Object.getPrototypeOf(M)).apply(this,arguments))}return a(M,[{key:"attach",value:function(){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"attach",this).call(this),this.attributes=new g.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new v.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(G,F){var K=g.default.query(G,g.default.Scope.BLOCK_ATTRIBUTE);K!=null&&this.attributes.attribute(K,F)}},{key:"formatAt",value:function(G,F,K,B){this.format(K,B)}},{key:"insertAt",value:function(G,F,K){if(typeof F=="string"&&F.endsWith(`
|
|
105
|
+
`)){var B=g.default.create(N.blotName);this.parent.insertBefore(B,G===0?this:this.next),B.insertAt(0,F.slice(0,-1))}else o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertAt",this).call(this,G,F,K)}}]),M}(g.default.Embed);O.scope=g.default.Scope.BLOCK_BLOT;var N=function(R){x(M,R);function M(D){m(this,M);var G=y(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,D));return G.cache={},G}return a(M,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(g.default.Leaf).reduce(function(G,F){return F.length()===0?G:G.insert(F.value(),T(F))},new v.default).insert(`
|
|
106
|
+
`,T(this))),this.cache.delta}},{key:"deleteAt",value:function(G,F){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"deleteAt",this).call(this,G,F),this.cache={}}},{key:"formatAt",value:function(G,F,K,B){F<=0||(g.default.query(K,g.default.Scope.BLOCK)?G+F===this.length()&&this.format(K,B):o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"formatAt",this).call(this,G,Math.min(F,this.length()-G-1),K,B),this.cache={})}},{key:"insertAt",value:function(G,F,K){if(K!=null)return o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertAt",this).call(this,G,F,K);if(F.length!==0){var B=F.split(`
|
|
107
|
+
`),$=B.shift();$.length>0&&(G<this.length()-1||this.children.tail==null?o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertAt",this).call(this,Math.min(G,this.length()-1),$):this.children.tail.insertAt(this.children.tail.length(),$),this.cache={});var W=this;B.reduce(function(C,A){return W=W.split(C,!0),W.insertAt(0,A),A.length},G+$.length)}}},{key:"insertBefore",value:function(G,F){var K=this.children.head;o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertBefore",this).call(this,G,F),K instanceof w.default&&K.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"length",this).call(this)+P),this.cache.length}},{key:"moveChildren",value:function(G,F){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"moveChildren",this).call(this,G,F),this.cache={}}},{key:"optimize",value:function(G){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"optimize",this).call(this,G),this.cache={}}},{key:"path",value:function(G){return o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"path",this).call(this,G,!0)}},{key:"removeChild",value:function(G){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"removeChild",this).call(this,G),this.cache={}}},{key:"split",value:function(G){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(F&&(G===0||G>=this.length()-P)){var K=this.clone();return G===0?(this.parent.insertBefore(K,this),this):(this.parent.insertBefore(K,this.next),K)}else{var B=o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"split",this).call(this,G,F);return this.cache={},B}}}]),M}(g.default.Block);N.blotName="block",N.tagName="P",N.defaultChild="break",N.allowedChildren=[S.default,g.default.Embed,p.default];function T(R){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R==null||(typeof R.formats=="function"&&(M=(0,u.default)(M,R.formats())),R.parent==null||R.parent.blotName=="scroll"||R.parent.statics.scope!==R.statics.scope)?M:T(R.parent,M)}n.bubbleFormats=T,n.BlockEmbed=O,n.default=N},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(W){return typeof W}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W},o=function(){function W(C,A){var j=[],z=!0,H=!1,Y=void 0;try{for(var q=C[Symbol.iterator](),U;!(z=(U=q.next()).done)&&(j.push(U.value),!(A&&j.length===A));z=!0);}catch(X){H=!0,Y=X}finally{try{!z&&q.return&&q.return()}finally{if(H)throw Y}}return j}return function(C,A){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return W(C,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function W(C,A){for(var j=0;j<A.length;j++){var z=A[j];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(C,z.key,z)}}return function(C,A,j){return A&&W(C.prototype,A),j&&W(C,j),C}}();i(50);var u=i(2),f=T(u),v=i(14),_=T(v),g=i(8),h=T(g),w=i(9),E=T(w),S=i(0),b=T(S),p=i(15),d=T(p),m=i(3),y=T(m),x=i(10),P=T(x),O=i(34),N=T(O);function T(W){return W&&W.__esModule?W:{default:W}}function R(W,C,A){return C in W?Object.defineProperty(W,C,{value:A,enumerable:!0,configurable:!0,writable:!0}):W[C]=A,W}function M(W,C){if(!(W instanceof C))throw new TypeError("Cannot call a class as a function")}var D=(0,P.default)("quill"),G=function(){l(W,null,[{key:"debug",value:function(A){A===!0&&(A="log"),P.default.level(A)}},{key:"find",value:function(A){return A.__quill||b.default.find(A)}},{key:"import",value:function(A){return this.imports[A]==null&&D.error("Cannot import "+A+". Are you sure it was registered?"),this.imports[A]}},{key:"register",value:function(A,j){var z=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof A!="string"){var Y=A.attrName||A.blotName;typeof Y=="string"?this.register("formats/"+Y,A,j):Object.keys(A).forEach(function(q){z.register(q,A[q],j)})}else this.imports[A]!=null&&!H&&D.warn("Overwriting "+A+" with",j),this.imports[A]=j,(A.startsWith("blots/")||A.startsWith("formats/"))&&j.blotName!=="abstract"?b.default.register(j):A.startsWith("modules")&&typeof j.register=="function"&&j.register()}}]);function W(C){var A=this,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(M(this,W),this.options=F(C,j),this.container=this.options.container,this.container==null)return D.error("Invalid Quill container",C);this.options.debug&&W.debug(this.options.debug);var z=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=b.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new _.default(this.scroll),this.selection=new d.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(h.default.events.EDITOR_CHANGE,function(Y){Y===h.default.events.TEXT_CHANGE&&A.root.classList.toggle("ql-blank",A.editor.isBlank())}),this.emitter.on(h.default.events.SCROLL_UPDATE,function(Y,q){var U=A.selection.lastRange,X=U&&U.length===0?U.index:void 0;K.call(A,function(){return A.editor.update(null,q,X)},Y)});var H=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+z+"<p><br></p></div>");this.setContents(H),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(W,[{key:"addContainer",value:function(A){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof A=="string"){var z=A;A=document.createElement("div"),A.classList.add(z)}return this.container.insertBefore(A,j),A}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(A,j,z){var H=this,Y=B(A,j,z),q=o(Y,4);return A=q[0],j=q[1],z=q[3],K.call(this,function(){return H.editor.deleteText(A,j)},z,A,-1*j)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(A),this.container.classList.toggle("ql-disabled",!A)}},{key:"focus",value:function(){var A=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=A,this.scrollIntoView()}},{key:"format",value:function(A,j){var z=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h.default.sources.API;return K.call(this,function(){var Y=z.getSelection(!0),q=new f.default;if(Y==null)return q;if(b.default.query(A,b.default.Scope.BLOCK))q=z.editor.formatLine(Y.index,Y.length,R({},A,j));else{if(Y.length===0)return z.selection.format(A,j),q;q=z.editor.formatText(Y.index,Y.length,R({},A,j))}return z.setSelection(Y,h.default.sources.SILENT),q},H)}},{key:"formatLine",value:function(A,j,z,H,Y){var q=this,U=void 0,X=B(A,j,z,H,Y),Q=o(X,4);return A=Q[0],j=Q[1],U=Q[2],Y=Q[3],K.call(this,function(){return q.editor.formatLine(A,j,U)},Y,A,0)}},{key:"formatText",value:function(A,j,z,H,Y){var q=this,U=void 0,X=B(A,j,z,H,Y),Q=o(X,4);return A=Q[0],j=Q[1],U=Q[2],Y=Q[3],K.call(this,function(){return q.editor.formatText(A,j,U)},Y,A,0)}},{key:"getBounds",value:function(A){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,z=void 0;typeof A=="number"?z=this.selection.getBounds(A,j):z=this.selection.getBounds(A.index,A.length);var H=this.container.getBoundingClientRect();return{bottom:z.bottom-H.top,height:z.height,left:z.left-H.left,right:z.right-H.left,top:z.top-H.top,width:z.width}}},{key:"getContents",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-A,z=B(A,j),H=o(z,2);return A=H[0],j=H[1],this.editor.getContents(A,j)}},{key:"getFormat",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof A=="number"?this.editor.getFormat(A,j):this.editor.getFormat(A.index,A.length)}},{key:"getIndex",value:function(A){return A.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(A){return this.scroll.leaf(A)}},{key:"getLine",value:function(A){return this.scroll.line(A)}},{key:"getLines",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof A!="number"?this.scroll.lines(A.index,A.length):this.scroll.lines(A,j)}},{key:"getModule",value:function(A){return this.theme.modules[A]}},{key:"getSelection",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return A&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-A,z=B(A,j),H=o(z,2);return A=H[0],j=H[1],this.editor.getText(A,j)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(A,j,z){var H=this,Y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:W.sources.API;return K.call(this,function(){return H.editor.insertEmbed(A,j,z)},Y,A)}},{key:"insertText",value:function(A,j,z,H,Y){var q=this,U=void 0,X=B(A,0,z,H,Y),Q=o(X,4);return A=Q[0],U=Q[2],Y=Q[3],K.call(this,function(){return q.editor.insertText(A,j,U)},Y,A,j.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(A,j,z){this.clipboard.dangerouslyPasteHTML(A,j,z)}},{key:"removeFormat",value:function(A,j,z){var H=this,Y=B(A,j,z),q=o(Y,4);return A=q[0],j=q[1],z=q[3],K.call(this,function(){return H.editor.removeFormat(A,j)},z,A)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(A){var j=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API;return K.call(this,function(){A=new f.default(A);var H=j.getLength(),Y=j.editor.deleteText(0,H),q=j.editor.applyDelta(A),U=q.ops[q.ops.length-1];U!=null&&typeof U.insert=="string"&&U.insert[U.insert.length-1]===`
|
|
108
|
+
`&&(j.editor.deleteText(j.getLength()-1,1),q.delete(1));var X=Y.compose(q);return X},z)}},{key:"setSelection",value:function(A,j,z){if(A==null)this.selection.setRange(null,j||W.sources.API);else{var H=B(A,j,z),Y=o(H,4);A=Y[0],j=Y[1],z=Y[3],this.selection.setRange(new p.Range(A,j),z),z!==h.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(A){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API,z=new f.default().insert(A);return this.setContents(z,j)}},{key:"update",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h.default.sources.USER,j=this.scroll.update(A);return this.selection.update(A),j}},{key:"updateContents",value:function(A){var j=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API;return K.call(this,function(){return A=new f.default(A),j.editor.applyDelta(A,z)},z,!0)}}]),W}();G.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},G.events=h.default.events,G.sources=h.default.sources,G.version="1.3.7",G.imports={delta:f.default,parchment:b.default,"core/module":E.default,"core/theme":N.default};function F(W,C){if(C=(0,y.default)(!0,{container:W,modules:{clipboard:!0,keyboard:!0,history:!0}},C),!C.theme||C.theme===G.DEFAULTS.theme)C.theme=N.default;else if(C.theme=G.import("themes/"+C.theme),C.theme==null)throw new Error("Invalid theme "+C.theme+". Did you register it?");var A=(0,y.default)(!0,{},C.theme.DEFAULTS);[A,C].forEach(function(H){H.modules=H.modules||{},Object.keys(H.modules).forEach(function(Y){H.modules[Y]===!0&&(H.modules[Y]={})})});var j=Object.keys(A.modules).concat(Object.keys(C.modules)),z=j.reduce(function(H,Y){var q=G.import("modules/"+Y);return q==null?D.error("Cannot load "+Y+" module. Are you sure you registered it?"):H[Y]=q.DEFAULTS||{},H},{});return C.modules!=null&&C.modules.toolbar&&C.modules.toolbar.constructor!==Object&&(C.modules.toolbar={container:C.modules.toolbar}),C=(0,y.default)(!0,{},G.DEFAULTS,{modules:z},A,C),["bounds","container","scrollingContainer"].forEach(function(H){typeof C[H]=="string"&&(C[H]=document.querySelector(C[H]))}),C.modules=Object.keys(C.modules).reduce(function(H,Y){return C.modules[Y]&&(H[Y]=C.modules[Y]),H},{}),C}function K(W,C,A,j){if(this.options.strict&&!this.isEnabled()&&C===h.default.sources.USER)return new f.default;var z=A==null?null:this.getSelection(),H=this.editor.delta,Y=W();if(z!=null&&(A===!0&&(A=z.index),j==null?z=$(z,Y,C):j!==0&&(z=$(z,A,j,C)),this.setSelection(z,h.default.sources.SILENT)),Y.length()>0){var q,U=[h.default.events.TEXT_CHANGE,Y,H,C];if((q=this.emitter).emit.apply(q,[h.default.events.EDITOR_CHANGE].concat(U)),C!==h.default.sources.SILENT){var X;(X=this.emitter).emit.apply(X,U)}}return Y}function B(W,C,A,j,z){var H={};return typeof W.index=="number"&&typeof W.length=="number"?typeof C!="number"?(z=j,j=A,A=C,C=W.length,W=W.index):(C=W.length,W=W.index):typeof C!="number"&&(z=j,j=A,A=C,C=0),(typeof A>"u"?"undefined":a(A))==="object"?(H=A,z=j):typeof A=="string"&&(j!=null?H[A]=j:z=A),z=z||h.default.sources.API,[W,C,H,z]}function $(W,C,A,j){if(W==null)return null;var z=void 0,H=void 0;if(C instanceof f.default){var Y=[W.index,W.index+W.length].map(function(Q){return C.transformPosition(Q,j!==h.default.sources.USER)}),q=o(Y,2);z=q[0],H=q[1]}else{var U=[W.index,W.index+W.length].map(function(Q){return Q<C||Q===C&&j===h.default.sources.USER?Q:A>=0?Q+A:Math.max(C,Q+A)}),X=o(U,2);z=X[0],H=X[1]}return new p.Range(z,H-z)}n.expandConfig=F,n.overload=B,n.default=G},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,p){for(var d=0;d<p.length;d++){var m=p[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,p,d){return p&&S(b.prototype,p),d&&S(b,d),b}}(),o=function S(b,p,d){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,p);if(m===void 0){var y=Object.getPrototypeOf(b);return y===null?void 0:S(y,p,d)}else{if("value"in m)return m.value;var x=m.get;return x===void 0?void 0:x.call(d)}},l=i(7),u=_(l),f=i(0),v=_(f);function _(S){return S&&S.__esModule?S:{default:S}}function g(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function h(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function w(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var E=function(S){w(b,S);function b(){return g(this,b),h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"formatAt",value:function(d,m,y,x){if(b.compare(this.statics.blotName,y)<0&&v.default.query(y,v.default.Scope.BLOT)){var P=this.isolate(d,m);x&&P.wrap(y,x)}else o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"formatAt",this).call(this,d,m,y,x)}},{key:"optimize",value:function(d){if(o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,d),this.parent instanceof b&&b.compare(this.statics.blotName,this.parent.statics.blotName)>0){var m=this.parent.isolate(this.offset(),this.length());this.moveChildren(m),m.wrap(this)}}}],[{key:"compare",value:function(d,m){var y=b.order.indexOf(d),x=b.order.indexOf(m);return y>=0||x>=0?y-x:d===m?0:d<m?-1:1}}]),b}(v.default.Inline);E.allowedChildren=[E,v.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(g){return g&&g.__esModule?g:{default:g}}function u(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function f(g,h){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:g}function v(g,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);g.prototype=Object.create(h&&h.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(g,h):g.__proto__=h)}var _=function(g){v(h,g);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default.Text);n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(d,m){for(var y=0;y<m.length;y++){var x=m[y];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(d,x.key,x)}}return function(d,m,y){return m&&p(d.prototype,m),y&&p(d,y),d}}(),o=function p(d,m,y){d===null&&(d=Function.prototype);var x=Object.getOwnPropertyDescriptor(d,m);if(x===void 0){var P=Object.getPrototypeOf(d);return P===null?void 0:p(P,m,y)}else{if("value"in x)return x.value;var O=x.get;return O===void 0?void 0:O.call(y)}},l=i(54),u=_(l),f=i(10),v=_(f);function _(p){return p&&p.__esModule?p:{default:p}}function g(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,v.default)("quill:events"),S=["selectionchange","mousedown","mouseup","click"];S.forEach(function(p){document.addEventListener(p,function(){for(var d=arguments.length,m=Array(d),y=0;y<d;y++)m[y]=arguments[y];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(x){if(x.__quill&&x.__quill.emitter){var P;(P=x.__quill.emitter).handleDOM.apply(P,m)}})})});var b=function(p){w(d,p);function d(){g(this,d);var m=h(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return m.listeners={},m.on("error",E.error),m}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(y){for(var x=arguments.length,P=Array(x>1?x-1:0),O=1;O<x;O++)P[O-1]=arguments[O];(this.listeners[y.type]||[]).forEach(function(N){var T=N.node,R=N.handler;(y.target===T||T.contains(y.target))&&R.apply(void 0,[y].concat(P))})}},{key:"listenDOM",value:function(y,x,P){this.listeners[y]||(this.listeners[y]=[]),this.listeners[y].push({node:x,handler:P})}}]),d}(u.default);b.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"},b.sources={API:"api",SILENT:"silent",USER:"user"},n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function a(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function l(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,l),this.quill=u,this.options=f};o.DEFAULTS={},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=["error","warn","log","info"],o="warn";function l(f){if(a.indexOf(f)<=a.indexOf(o)){for(var v,_=arguments.length,g=Array(_>1?_-1:0),h=1;h<_;h++)g[h-1]=arguments[h];(v=console)[f].apply(v,g)}}function u(f){return a.reduce(function(v,_){return v[_]=l.bind(console,_,f),v},{})}l.level=u.level=function(f){o=f},n.default=u},function(r,n,i){var a=Array.prototype.slice,o=i(52),l=i(53),u=r.exports=function(g,h,w){return w||(w={}),g===h?!0:g instanceof Date&&h instanceof Date?g.getTime()===h.getTime():!g||!h||typeof g!="object"&&typeof h!="object"?w.strict?g===h:g==h:_(g,h,w)};function f(g){return g==null}function v(g){return!(!g||typeof g!="object"||typeof g.length!="number"||typeof g.copy!="function"||typeof g.slice!="function"||g.length>0&&typeof g[0]!="number")}function _(g,h,w){var E,S;if(f(g)||f(h)||g.prototype!==h.prototype)return!1;if(l(g))return l(h)?(g=a.call(g),h=a.call(h),u(g,h,w)):!1;if(v(g)){if(!v(h)||g.length!==h.length)return!1;for(E=0;E<g.length;E++)if(g[E]!==h[E])return!1;return!0}try{var b=o(g),p=o(h)}catch{return!1}if(b.length!=p.length)return!1;for(b.sort(),p.sort(),E=b.length-1;E>=0;E--)if(b[E]!=p[E])return!1;for(E=b.length-1;E>=0;E--)if(S=b[E],!u(g[S],h[S],w))return!1;return typeof g==typeof h}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u,f,v){v===void 0&&(v={}),this.attrName=u,this.keyName=f;var _=a.Scope.TYPE&a.Scope.ATTRIBUTE;v.scope!=null?this.scope=v.scope&a.Scope.LEVEL|_:this.scope=a.Scope.ATTRIBUTE,v.whitelist!=null&&(this.whitelist=v.whitelist)}return l.keys=function(u){return[].map.call(u.attributes,function(f){return f.name})},l.prototype.add=function(u,f){return this.canAdd(u,f)?(u.setAttribute(this.keyName,f),!0):!1},l.prototype.canAdd=function(u,f){var v=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return v==null?!1:this.whitelist==null?!0:typeof f=="string"?this.whitelist.indexOf(f.replace(/["']/g,""))>-1:this.whitelist.indexOf(f)>-1},l.prototype.remove=function(u){u.removeAttribute(this.keyName)},l.prototype.value=function(u){var f=u.getAttribute(this.keyName);return this.canAdd(u,f)&&f?f:""},l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var a=function(){function O(N,T){var R=[],M=!0,D=!1,G=void 0;try{for(var F=N[Symbol.iterator](),K;!(M=(K=F.next()).done)&&(R.push(K.value),!(T&&R.length===T));M=!0);}catch(B){D=!0,G=B}finally{try{!M&&F.return&&F.return()}finally{if(D)throw G}}return R}return function(N,T){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return O(N,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function O(N,T){for(var R=0;R<T.length;R++){var M=T[R];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(N,M.key,M)}}return function(N,T,R){return T&&O(N.prototype,T),R&&O(N,R),N}}(),l=function O(N,T,R){N===null&&(N=Function.prototype);var M=Object.getOwnPropertyDescriptor(N,T);if(M===void 0){var D=Object.getPrototypeOf(N);return D===null?void 0:O(D,T,R)}else{if("value"in M)return M.value;var G=M.get;return G===void 0?void 0:G.call(R)}},u=i(2),f=p(u),v=i(0),_=p(v),g=i(4),h=p(g),w=i(6),E=p(w),S=i(7),b=p(S);function p(O){return O&&O.__esModule?O:{default:O}}function d(O,N){if(!(O instanceof N))throw new TypeError("Cannot call a class as a function")}function m(O,N){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:O}function y(O,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);O.prototype=Object.create(N&&N.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(O,N):O.__proto__=N)}var x=function(O){y(N,O);function N(){return d(this,N),m(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return N}(E.default);x.blotName="code",x.tagName="CODE";var P=function(O){y(N,O);function N(){return d(this,N),m(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return o(N,[{key:"delta",value:function(){var R=this,M=this.domNode.textContent;return M.endsWith(`
|
|
109
|
+
`)&&(M=M.slice(0,-1)),M.split(`
|
|
110
|
+
`).reduce(function(D,G){return D.insert(G).insert(`
|
|
111
|
+
`,R.formats())},new f.default)}},{key:"format",value:function(R,M){if(!(R===this.statics.blotName&&M)){var D=this.descendant(b.default,this.length()-1),G=a(D,1),F=G[0];F!=null&&F.deleteAt(F.length()-1,1),l(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"format",this).call(this,R,M)}}},{key:"formatAt",value:function(R,M,D,G){if(M!==0&&!(_.default.query(D,_.default.Scope.BLOCK)==null||D===this.statics.blotName&&G===this.statics.formats(this.domNode))){var F=this.newlineIndex(R);if(!(F<0||F>=R+M)){var K=this.newlineIndex(R,!0)+1,B=F-K+1,$=this.isolate(K,B),W=$.next;$.format(D,G),W instanceof N&&W.formatAt(0,R-K+M-B,D,G)}}}},{key:"insertAt",value:function(R,M,D){if(D==null){var G=this.descendant(b.default,R),F=a(G,2),K=F[0],B=F[1];K.insertAt(B,M)}}},{key:"length",value:function(){var R=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
|
112
|
+
`)?R:R+1}},{key:"newlineIndex",value:function(R){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(M)return this.domNode.textContent.slice(0,R).lastIndexOf(`
|
|
113
|
+
`);var D=this.domNode.textContent.slice(R).indexOf(`
|
|
114
|
+
`);return D>-1?R+D:-1}},{key:"optimize",value:function(R){this.domNode.textContent.endsWith(`
|
|
115
|
+
`)||this.appendChild(_.default.create("text",`
|
|
116
|
+
`)),l(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"optimize",this).call(this,R);var M=this.next;M!=null&&M.prev===this&&M.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===M.statics.formats(M.domNode)&&(M.optimize(R),M.moveChildren(this),M.remove())}},{key:"replace",value:function(R){l(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"replace",this).call(this,R),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(M){var D=_.default.find(M);D==null?M.parentNode.removeChild(M):D instanceof _.default.Embed?D.remove():D.unwrap()})}}],[{key:"create",value:function(R){var M=l(N.__proto__||Object.getPrototypeOf(N),"create",this).call(this,R);return M.setAttribute("spellcheck",!1),M}},{key:"formats",value:function(){return!0}}]),N}(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(W){return typeof W}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W},o=function(){function W(C,A){var j=[],z=!0,H=!1,Y=void 0;try{for(var q=C[Symbol.iterator](),U;!(z=(U=q.next()).done)&&(j.push(U.value),!(A&&j.length===A));z=!0);}catch(X){H=!0,Y=X}finally{try{!z&&q.return&&q.return()}finally{if(H)throw Y}}return j}return function(C,A){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return W(C,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function W(C,A){for(var j=0;j<A.length;j++){var z=A[j];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(C,z.key,z)}}return function(C,A,j){return A&&W(C.prototype,A),j&&W(C,j),C}}(),u=i(2),f=M(u),v=i(20),_=M(v),g=i(0),h=M(g),w=i(13),E=M(w),S=i(24),b=M(S),p=i(4),d=M(p),m=i(16),y=M(m),x=i(21),P=M(x),O=i(11),N=M(O),T=i(3),R=M(T);function M(W){return W&&W.__esModule?W:{default:W}}function D(W,C,A){return C in W?Object.defineProperty(W,C,{value:A,enumerable:!0,configurable:!0,writable:!0}):W[C]=A,W}function G(W,C){if(!(W instanceof C))throw new TypeError("Cannot call a class as a function")}var F=/^[ -~]*$/,K=function(){function W(C){G(this,W),this.scroll=C,this.delta=this.getDelta()}return l(W,[{key:"applyDelta",value:function(A){var j=this,z=!1;this.scroll.update();var H=this.scroll.length();return this.scroll.batchStart(),A=$(A),A.reduce(function(Y,q){var U=q.retain||q.delete||q.insert.length||1,X=q.attributes||{};if(q.insert!=null){if(typeof q.insert=="string"){var Q=q.insert;Q.endsWith(`
|
|
117
|
+
`)&&z&&(z=!1,Q=Q.slice(0,-1)),Y>=H&&!Q.endsWith(`
|
|
118
|
+
`)&&(z=!0),j.scroll.insertAt(Y,Q);var Z=j.scroll.line(Y),re=o(Z,2),ee=re[0],le=re[1],ce=(0,R.default)({},(0,p.bubbleFormats)(ee));if(ee instanceof d.default){var _e=ee.descendant(h.default.Leaf,le),Le=o(_e,1),Oe=Le[0];ce=(0,R.default)(ce,(0,p.bubbleFormats)(Oe))}X=_.default.attributes.diff(ce,X)||{}}else if(a(q.insert)==="object"){var ae=Object.keys(q.insert)[0];if(ae==null)return Y;j.scroll.insertAt(Y,ae,q.insert[ae])}H+=U}return Object.keys(X).forEach(function(de){j.scroll.formatAt(Y,U,de,X[de])}),Y+U},0),A.reduce(function(Y,q){return typeof q.delete=="number"?(j.scroll.deleteAt(Y,q.delete),Y):Y+(q.retain||q.insert.length||1)},0),this.scroll.batchEnd(),this.update(A)}},{key:"deleteText",value:function(A,j){return this.scroll.deleteAt(A,j),this.update(new f.default().retain(A).delete(j))}},{key:"formatLine",value:function(A,j){var z=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(H).forEach(function(Y){if(!(z.scroll.whitelist!=null&&!z.scroll.whitelist[Y])){var q=z.scroll.lines(A,Math.max(j,1)),U=j;q.forEach(function(X){var Q=X.length();if(!(X instanceof E.default))X.format(Y,H[Y]);else{var Z=A-X.offset(z.scroll),re=X.newlineIndex(Z+U)-Z+1;X.formatAt(Z,re,Y,H[Y])}U-=Q})}}),this.scroll.optimize(),this.update(new f.default().retain(A).retain(j,(0,P.default)(H)))}},{key:"formatText",value:function(A,j){var z=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(H).forEach(function(Y){z.scroll.formatAt(A,j,Y,H[Y])}),this.update(new f.default().retain(A).retain(j,(0,P.default)(H)))}},{key:"getContents",value:function(A,j){return this.delta.slice(A,A+j)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(A,j){return A.concat(j.delta())},new f.default)}},{key:"getFormat",value:function(A){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,z=[],H=[];j===0?this.scroll.path(A).forEach(function(q){var U=o(q,1),X=U[0];X instanceof d.default?z.push(X):X instanceof h.default.Leaf&&H.push(X)}):(z=this.scroll.lines(A,j),H=this.scroll.descendants(h.default.Leaf,A,j));var Y=[z,H].map(function(q){if(q.length===0)return{};for(var U=(0,p.bubbleFormats)(q.shift());Object.keys(U).length>0;){var X=q.shift();if(X==null)return U;U=B((0,p.bubbleFormats)(X),U)}return U});return R.default.apply(R.default,Y)}},{key:"getText",value:function(A,j){return this.getContents(A,j).filter(function(z){return typeof z.insert=="string"}).map(function(z){return z.insert}).join("")}},{key:"insertEmbed",value:function(A,j,z){return this.scroll.insertAt(A,j,z),this.update(new f.default().retain(A).insert(D({},j,z)))}},{key:"insertText",value:function(A,j){var z=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return j=j.replace(/\r\n/g,`
|
|
119
|
+
`).replace(/\r/g,`
|
|
120
|
+
`),this.scroll.insertAt(A,j),Object.keys(H).forEach(function(Y){z.scroll.formatAt(A,j.length,Y,H[Y])}),this.update(new f.default().retain(A).insert(j,(0,P.default)(H)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var A=this.scroll.children.head;return A.statics.blotName!==d.default.blotName||A.children.length>1?!1:A.children.head instanceof y.default}},{key:"removeFormat",value:function(A,j){var z=this.getText(A,j),H=this.scroll.line(A+j),Y=o(H,2),q=Y[0],U=Y[1],X=0,Q=new f.default;q!=null&&(q instanceof E.default?X=q.newlineIndex(U)-U+1:X=q.length()-U,Q=q.delta().slice(U,U+X-1).insert(`
|
|
121
|
+
`));var Z=this.getContents(A,j+X),re=Z.diff(new f.default().insert(z).concat(Q)),ee=new f.default().retain(A).concat(re);return this.applyDelta(ee)}},{key:"update",value:function(A){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,H=this.delta;if(j.length===1&&j[0].type==="characterData"&&j[0].target.data.match(F)&&h.default.find(j[0].target)){var Y=h.default.find(j[0].target),q=(0,p.bubbleFormats)(Y),U=Y.offset(this.scroll),X=j[0].oldValue.replace(b.default.CONTENTS,""),Q=new f.default().insert(X),Z=new f.default().insert(Y.value()),re=new f.default().retain(U).concat(Q.diff(Z,z));A=re.reduce(function(ee,le){return le.insert?ee.insert(le.insert,q):ee.push(le)},new f.default),this.delta=H.compose(A)}else this.delta=this.getDelta(),(!A||!(0,N.default)(H.compose(A),this.delta))&&(A=H.diff(this.delta,z));return A}}]),W}();function B(W,C){return Object.keys(C).reduce(function(A,j){return W[j]==null||(C[j]===W[j]?A[j]=C[j]:Array.isArray(C[j])?C[j].indexOf(W[j])<0&&(A[j]=C[j].concat([W[j]])):A[j]=[C[j],W[j]]),A},{})}function $(W){return W.reduce(function(C,A){if(A.insert===1){var j=(0,P.default)(A.attributes);return delete j.image,C.insert({image:A.attributes.image},j)}if(A.attributes!=null&&(A.attributes.list===!0||A.attributes.bullet===!0)&&(A=(0,P.default)(A),A.attributes.list?A.attributes.list="ordered":(A.attributes.list="bullet",delete A.attributes.bullet)),typeof A.insert=="string"){var z=A.insert.replace(/\r\n/g,`
|
|
122
|
+
`).replace(/\r/g,`
|
|
123
|
+
`);return C.insert(z,A.attributes)}return C.push(A)},new f.default)}n.default=K},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function O(N,T){var R=[],M=!0,D=!1,G=void 0;try{for(var F=N[Symbol.iterator](),K;!(M=(K=F.next()).done)&&(R.push(K.value),!(T&&R.length===T));M=!0);}catch(B){D=!0,G=B}finally{try{!M&&F.return&&F.return()}finally{if(D)throw G}}return R}return function(N,T){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return O(N,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function O(N,T){for(var R=0;R<T.length;R++){var M=T[R];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(N,M.key,M)}}return function(N,T,R){return T&&O(N.prototype,T),R&&O(N,R),N}}(),l=i(0),u=b(l),f=i(21),v=b(f),_=i(11),g=b(_),h=i(8),w=b(h),E=i(10),S=b(E);function b(O){return O&&O.__esModule?O:{default:O}}function p(O){if(Array.isArray(O)){for(var N=0,T=Array(O.length);N<O.length;N++)T[N]=O[N];return T}else return Array.from(O)}function d(O,N){if(!(O instanceof N))throw new TypeError("Cannot call a class as a function")}var m=(0,S.default)("quill:selection"),y=function O(N){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,O),this.index=N,this.length=T},x=function(){function O(N,T){var R=this;d(this,O),this.emitter=T,this.scroll=N,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new y(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){R.mouseDown||setTimeout(R.update.bind(R,w.default.sources.USER),1)}),this.emitter.on(w.default.events.EDITOR_CHANGE,function(M,D){M===w.default.events.TEXT_CHANGE&&D.length()>0&&R.update(w.default.sources.SILENT)}),this.emitter.on(w.default.events.SCROLL_BEFORE_UPDATE,function(){if(R.hasFocus()){var M=R.getNativeRange();M!=null&&M.start.node!==R.cursor.textNode&&R.emitter.once(w.default.events.SCROLL_UPDATE,function(){try{R.setNativeRange(M.start.node,M.start.offset,M.end.node,M.end.offset)}catch{}})}}),this.emitter.on(w.default.events.SCROLL_OPTIMIZE,function(M,D){if(D.range){var G=D.range,F=G.startNode,K=G.startOffset,B=G.endNode,$=G.endOffset;R.setNativeRange(F,K,B,$)}}),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 R=T.cursor.restore();if(!R)return;setTimeout(function(){T.setNativeRange(R.startNode,R.startOffset,R.endNode,R.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,R){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[T])){this.scroll.update();var M=this.getNativeRange();if(!(M==null||!M.native.collapsed||u.default.query(T,u.default.Scope.BLOCK))){if(M.start.node!==this.cursor.textNode){var D=u.default.find(M.start.node,!1);if(D==null)return;if(D instanceof u.default.Leaf){var G=D.split(M.start.offset);D.parent.insertBefore(this.cursor,G)}else D.insertBefore(this.cursor,M.start.node);this.cursor.attach()}this.cursor.format(T,R),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(T){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,M=this.scroll.length();T=Math.min(T,M-1),R=Math.min(T+R,M-1)-T;var D=void 0,G=this.scroll.leaf(T),F=a(G,2),K=F[0],B=F[1];if(K==null)return null;var $=K.position(B,!0),W=a($,2);D=W[0],B=W[1];var C=document.createRange();if(R>0){C.setStart(D,B);var A=this.scroll.leaf(T+R),j=a(A,2);if(K=j[0],B=j[1],K==null)return null;var z=K.position(B,!0),H=a(z,2);return D=H[0],B=H[1],C.setEnd(D,B),C.getBoundingClientRect()}else{var Y="left",q=void 0;return D instanceof Text?(B<D.data.length?(C.setStart(D,B),C.setEnd(D,B+1)):(C.setStart(D,B-1),C.setEnd(D,B),Y="right"),q=C.getBoundingClientRect()):(q=K.domNode.getBoundingClientRect(),B>0&&(Y="right")),{bottom:q.top+q.height,height:q.height,left:q[Y],right:q[Y],top:q.top,width:0}}}},{key:"getNativeRange",value:function(){var T=document.getSelection();if(T==null||T.rangeCount<=0)return null;var R=T.getRangeAt(0);if(R==null)return null;var M=this.normalizeNative(R);return m.info("getNativeRange",M),M}},{key:"getRange",value:function(){var T=this.getNativeRange();if(T==null)return[null,null];var R=this.normalizedToRange(T);return[R,T]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(T){var R=this,M=[[T.start.node,T.start.offset]];T.native.collapsed||M.push([T.end.node,T.end.offset]);var D=M.map(function(K){var B=a(K,2),$=B[0],W=B[1],C=u.default.find($,!0),A=C.offset(R.scroll);return W===0?A:C instanceof u.default.Container?A+C.length():A+C.index($,W)}),G=Math.min(Math.max.apply(Math,p(D)),this.scroll.length()-1),F=Math.min.apply(Math,[G].concat(p(D)));return new y(F,G-F)}},{key:"normalizeNative",value:function(T){if(!P(this.root,T.startContainer)||!T.collapsed&&!P(this.root,T.endContainer))return null;var R={start:{node:T.startContainer,offset:T.startOffset},end:{node:T.endContainer,offset:T.endOffset},native:T};return[R.start,R.end].forEach(function(M){for(var D=M.node,G=M.offset;!(D instanceof Text)&&D.childNodes.length>0;)if(D.childNodes.length>G)D=D.childNodes[G],G=0;else if(D.childNodes.length===G)D=D.lastChild,G=D instanceof Text?D.data.length:D.childNodes.length+1;else break;M.node=D,M.offset=G}),R}},{key:"rangeToNative",value:function(T){var R=this,M=T.collapsed?[T.index]:[T.index,T.index+T.length],D=[],G=this.scroll.length();return M.forEach(function(F,K){F=Math.min(G-1,F);var B=void 0,$=R.scroll.leaf(F),W=a($,2),C=W[0],A=W[1],j=C.position(A,K!==0),z=a(j,2);B=z[0],A=z[1],D.push(B,A)}),D.length<2&&(D=D.concat(D)),D}},{key:"scrollIntoView",value:function(T){var R=this.lastRange;if(R!=null){var M=this.getBounds(R.index,R.length);if(M!=null){var D=this.scroll.length()-1,G=this.scroll.line(Math.min(R.index,D)),F=a(G,1),K=F[0],B=K;if(R.length>0){var $=this.scroll.line(Math.min(R.index+R.length,D)),W=a($,1);B=W[0]}if(!(K==null||B==null)){var C=T.getBoundingClientRect();M.top<C.top?T.scrollTop-=C.top-M.top:M.bottom>C.bottom&&(T.scrollTop+=M.bottom-C.bottom)}}}}},{key:"setNativeRange",value:function(T,R){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:T,D=arguments.length>3&&arguments[3]!==void 0?arguments[3]:R,G=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(m.info("setNativeRange",T,R,M,D),!(T!=null&&(this.root.parentNode==null||T.parentNode==null||M.parentNode==null))){var F=document.getSelection();if(F!=null)if(T!=null){this.hasFocus()||this.root.focus();var K=(this.getNativeRange()||{}).native;if(K==null||G||T!==K.startContainer||R!==K.startOffset||M!==K.endContainer||D!==K.endOffset){T.tagName=="BR"&&(R=[].indexOf.call(T.parentNode.childNodes,T),T=T.parentNode),M.tagName=="BR"&&(D=[].indexOf.call(M.parentNode.childNodes,M),M=M.parentNode);var B=document.createRange();B.setStart(T,R),B.setEnd(M,D),F.removeAllRanges(),F.addRange(B)}}else F.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(T){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:w.default.sources.API;if(typeof R=="string"&&(M=R,R=!1),m.info("setRange",T),T!=null){var D=this.rangeToNative(T);this.setNativeRange.apply(this,p(D).concat([R]))}else this.setNativeRange(null);this.update(M)}},{key:"update",value:function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w.default.sources.USER,R=this.lastRange,M=this.getRange(),D=a(M,2),G=D[0],F=D[1];if(this.lastRange=G,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,g.default)(R,this.lastRange)){var K;!this.composing&&F!=null&&F.native.collapsed&&F.start.node!==this.cursor.textNode&&this.cursor.restore();var B=[w.default.events.SELECTION_CHANGE,(0,v.default)(this.lastRange),(0,v.default)(R),T];if((K=this.emitter).emit.apply(K,[w.default.events.EDITOR_CHANGE].concat(B)),T!==w.default.sources.SILENT){var $;($=this.emitter).emit.apply($,B)}}}}]),O}();function P(O,N){try{N.parentNode}catch{return!1}return N instanceof Text&&(N=N.parentNode),O.contains(N)}n.Range=y,n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function w(E,S){for(var b=0;b<S.length;b++){var p=S[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,p.key,p)}}return function(E,S,b){return S&&w(E.prototype,S),b&&w(E,b),E}}(),o=function w(E,S,b){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,b)}else{if("value"in p)return p.value;var m=p.get;return m===void 0?void 0:m.call(b)}},l=i(0),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function v(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function _(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 g(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){g(E,w);function E(){return v(this,E),_(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,[{key:"insertInto",value:function(b,p){b.children.length===0?o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertInto",this).call(this,b,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 _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,h){g.__proto__=h}||function(g,h){for(var w in h)h.hasOwnProperty(w)&&(g[w]=h[w])};return function(g,h){_(g,h);function w(){this.constructor=g}g.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(_){a(g,_);function g(h){var w=_.call(this,h)||this;return w.build(),w}return g.prototype.appendChild=function(h){this.insertBefore(h)},g.prototype.attach=function(){_.prototype.attach.call(this),this.children.forEach(function(h){h.attach()})},g.prototype.build=function(){var h=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(w){try{var E=v(w);h.insertBefore(E,h.children.head||void 0)}catch(S){if(S instanceof u.ParchmentError)return;throw S}})},g.prototype.deleteAt=function(h,w){if(h===0&&w===this.length())return this.remove();this.children.forEachAt(h,w,function(E,S,b){E.deleteAt(S,b)})},g.prototype.descendant=function(h,w){var E=this.children.find(w),S=E[0],b=E[1];return h.blotName==null&&h(S)||h.blotName!=null&&S instanceof h?[S,b]:S instanceof g?S.descendant(h,b):[null,-1]},g.prototype.descendants=function(h,w,E){w===void 0&&(w=0),E===void 0&&(E=Number.MAX_VALUE);var S=[],b=E;return this.children.forEachAt(w,E,function(p,d,m){(h.blotName==null&&h(p)||h.blotName!=null&&p instanceof h)&&S.push(p),p instanceof g&&(S=S.concat(p.descendants(h,d,b))),b-=m}),S},g.prototype.detach=function(){this.children.forEach(function(h){h.detach()}),_.prototype.detach.call(this)},g.prototype.formatAt=function(h,w,E,S){this.children.forEachAt(h,w,function(b,p,d){b.formatAt(p,d,E,S)})},g.prototype.insertAt=function(h,w,E){var S=this.children.find(h),b=S[0],p=S[1];if(b)b.insertAt(p,w,E);else{var d=E==null?u.create("text",w):u.create(w,E);this.appendChild(d)}},g.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)},g.prototype.length=function(){return this.children.reduce(function(h,w){return h+w.length()},0)},g.prototype.moveChildren=function(h,w){this.children.forEach(function(E){h.insertBefore(E,w)})},g.prototype.optimize=function(h){if(_.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()},g.prototype.path=function(h,w){w===void 0&&(w=!1);var E=this.children.find(h,w),S=E[0],b=E[1],p=[[this,h]];return S instanceof g?p.concat(S.path(b,w)):(S!=null&&p.push([S,b]),p)},g.prototype.removeChild=function(h){this.children.remove(h)},g.prototype.replace=function(h){h instanceof g&&h.moveChildren(this),_.prototype.replace.call(this,h)},g.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,b,p){S=S.split(b,w),E.appendChild(S)}),E},g.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},g.prototype.update=function(h,w){var E=this,S=[],b=[];h.forEach(function(p){p.target===E.domNode&&p.type==="childList"&&(S.push.apply(S,p.addedNodes),b.push.apply(b,p.removedNodes))}),b.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 m=v(p);(m.next!=d||m.next==null)&&(m.parent!=null&&m.parent.removeChild(E),E.insertBefore(m,d||void 0))})},g}(l.default);function v(_){var g=u.find(_);if(g==null)try{g=u.create(_)}catch{g=u.create(u.Scope.INLINE),[].slice.call(_.childNodes).forEach(function(w){g.domNode.appendChild(w)}),_.parentNode&&_.parentNode.replaceChild(g.domNode,_),g.attach()}return g}n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,h){g.__proto__=h}||function(g,h){for(var w in h)h.hasOwnProperty(w)&&(g[w]=h[w])};return function(g,h){_(g,h);function w(){this.constructor=g}g.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),v=function(_){a(g,_);function g(h){var w=_.call(this,h)||this;return w.attributes=new l.default(w.domNode),w}return g.formats=function(h){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return h.tagName.toLowerCase()},g.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)},g.prototype.formats=function(){var h=this.attributes.values(),w=this.statics.formats(this.domNode);return w!=null&&(h[this.statics.blotName]=w),h},g.prototype.replaceWith=function(h,w){var E=_.prototype.replaceWith.call(this,h,w);return this.attributes.copy(E),E},g.prototype.update=function(h,w){var E=this;_.prototype.update.call(this,h,w),h.some(function(S){return S.target===E.domNode&&S.type==="attributes"})&&this.attributes.build()},g.prototype.wrap=function(h,w){var E=_.prototype.wrap.call(this,h,w);return E instanceof g&&E.statics.scope===this.statics.scope&&this.attributes.move(E),E},g}(u.default);n.default=v},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,_){v.__proto__=_}||function(v,_){for(var g in _)_.hasOwnProperty(g)&&(v[g]=_[g])};return function(v,_){f(v,_);function g(){this.constructor=v}v.prototype=_===null?Object.create(_):(g.prototype=_.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),l=i(1),u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.value=function(_){return!0},v.prototype.index=function(_,g){return this.domNode===_||this.domNode.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(g,1):-1},v.prototype.position=function(_,g){var h=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return _>0&&(h+=1),[this.parent.domNode,h]},v.prototype.value=function(){var _;return _={},_[this.statics.blotName]=this.statics.value(this.domNode)||!0,_},v.scope=l.Scope.INLINE_BLOT,v}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),l={attributes:{compose:function(f,v,_){typeof f!="object"&&(f={}),typeof v!="object"&&(v={});var g=o(!0,{},v);_||(g=Object.keys(g).reduce(function(w,E){return g[E]!=null&&(w[E]=g[E]),w},{}));for(var h in f)f[h]!==void 0&&v[h]===void 0&&(g[h]=f[h]);return Object.keys(g).length>0?g:void 0},diff:function(f,v){typeof f!="object"&&(f={}),typeof v!="object"&&(v={});var _=Object.keys(f).concat(Object.keys(v)).reduce(function(g,h){return a(f[h],v[h])||(g[h]=v[h]===void 0?null:v[h]),g},{});return Object.keys(_).length>0?_:void 0},transform:function(f,v,_){if(typeof f!="object")return v;if(typeof v=="object"){if(!_)return v;var g=Object.keys(v).reduce(function(h,w){return f[w]===void 0&&(h[w]=v[w]),h},{});return Object.keys(g).length>0?g:void 0}}},iterator:function(f){return new u(f)},length:function(f){return typeof f.delete=="number"?f.delete:typeof f.retain=="number"?f.retain:typeof f.insert=="string"?f.insert.length:1}};function u(f){this.ops=f,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(f){f||(f=1/0);var v=this.ops[this.index];if(v){var _=this.offset,g=l.length(v);if(f>=g-_?(f=g-_,this.index+=1,this.offset=0):this.offset+=f,typeof v.delete=="number")return{delete:f};var h={};return v.attributes&&(h.attributes=v.attributes),typeof v.retain=="number"?h.retain=f:typeof v.insert=="string"?h.insert=v.insert.substr(_,f):h.insert=v.insert,h}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var f=this.offset,v=this.index,_=this.next(),g=this.ops.slice(this.index);return this.offset=f,this.index=v,[_].concat(g)}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,b,p,d){typeof S=="object"&&(b=S.depth,p=S.prototype,d=S.includeNonEnumerable,S=S.circular);var m=[],y=[],x=typeof Buffer<"u";typeof S>"u"&&(S=!0),typeof b>"u"&&(b=1/0);function P(O,N){if(O===null)return null;if(N===0)return O;var T,R;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(C,A){O.then(function(j){C(P(j,N-1))},function(j){A(P(j,N-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"?(R=Object.getPrototypeOf(O),T=Object.create(R)):(T=Object.create(p),R=p)}if(S){var M=m.indexOf(O);if(M!=-1)return y[M];m.push(O),y.push(T)}a(O,o)&&O.forEach(function(C,A){var j=P(A,N-1),z=P(C,N-1);T.set(j,z)}),a(O,l)&&O.forEach(function(C){var A=P(C,N-1);T.add(A)});for(var D in O){var G;R&&(G=Object.getOwnPropertyDescriptor(R,D)),!(G&&G.set==null)&&(T[D]=P(O[D],N-1))}if(Object.getOwnPropertySymbols)for(var F=Object.getOwnPropertySymbols(O),D=0;D<F.length;D++){var K=F[D],B=Object.getOwnPropertyDescriptor(O,K);B&&!B.enumerable&&!d||(T[K]=P(O[K],N-1),B.enumerable||Object.defineProperty(T,K,{enumerable:!1}))}if(d)for(var $=Object.getOwnPropertyNames(O),D=0;D<$.length;D++){var W=$[D],B=Object.getOwnPropertyDescriptor(O,W);B&&B.enumerable||(T[W]=P(O[W],N-1),Object.defineProperty(T,W,{enumerable:!1}))}return T}return P(E,b)}f.clonePrototype=function(S){if(S===null)return null;var b=function(){};return b.prototype=S,new b};function v(E){return Object.prototype.toString.call(E)}f.__objToStr=v;function _(E){return typeof E=="object"&&v(E)==="[object Date]"}f.__isDate=_;function g(E){return typeof E=="object"&&v(E)==="[object Array]"}f.__isArray=g;function h(E){return typeof E=="object"&&v(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(R,M){var D=[],G=!0,F=!1,K=void 0;try{for(var B=R[Symbol.iterator](),$;!(G=($=B.next()).done)&&(D.push($.value),!(M&&D.length===M));G=!0);}catch(W){F=!0,K=W}finally{try{!G&&B.return&&B.return()}finally{if(F)throw K}}return D}return function(R,M){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return T(R,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function T(R,M){for(var D=0;D<M.length;D++){var G=M[D];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(R,G.key,G)}}return function(R,M,D){return M&&T(R.prototype,M),D&&T(R,D),R}}(),l=function T(R,M,D){R===null&&(R=Function.prototype);var G=Object.getOwnPropertyDescriptor(R,M);if(G===void 0){var F=Object.getPrototypeOf(R);return F===null?void 0:T(F,M,D)}else{if("value"in G)return G.value;var K=G.get;return K===void 0?void 0:K.call(D)}},u=i(0),f=m(u),v=i(8),_=m(v),g=i(4),h=m(g),w=i(16),E=m(w),S=i(13),b=m(S),p=i(25),d=m(p);function m(T){return T&&T.__esModule?T:{default:T}}function y(T,R){if(!(T instanceof R))throw new TypeError("Cannot call a class as a function")}function x(T,R){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:T}function P(T,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);T.prototype=Object.create(R&&R.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(T,R):T.__proto__=R)}function O(T){return T instanceof h.default||T instanceof g.BlockEmbed}var N=function(T){P(R,T);function R(M,D){y(this,R);var G=x(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,M));return G.emitter=D.emitter,Array.isArray(D.whitelist)&&(G.whitelist=D.whitelist.reduce(function(F,K){return F[K]=!0,F},{})),G.domNode.addEventListener("DOMNodeInserted",function(){}),G.optimize(),G.enable(),G}return o(R,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(D,G){var F=this.line(D),K=a(F,2),B=K[0],$=K[1],W=this.line(D+G),C=a(W,1),A=C[0];if(l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"deleteAt",this).call(this,D,G),A!=null&&B!==A&&$>0){if(B instanceof g.BlockEmbed||A instanceof g.BlockEmbed){this.optimize();return}if(B instanceof b.default){var j=B.newlineIndex(B.length(),!0);if(j>-1&&(B=B.split(j+1),B===A)){this.optimize();return}}else if(A instanceof b.default){var z=A.newlineIndex(0);z>-1&&A.split(z+1)}var H=A.children.head instanceof E.default?null:A.children.head;B.moveChildren(A,H),B.remove()}this.optimize()}},{key:"enable",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",D)}},{key:"formatAt",value:function(D,G,F,K){this.whitelist!=null&&!this.whitelist[F]||(l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"formatAt",this).call(this,D,G,F,K),this.optimize())}},{key:"insertAt",value:function(D,G,F){if(!(F!=null&&this.whitelist!=null&&!this.whitelist[G])){if(D>=this.length())if(F==null||f.default.query(G,f.default.Scope.BLOCK)==null){var K=f.default.create(this.statics.defaultChild);this.appendChild(K),F==null&&G.endsWith(`
|
|
124
|
+
`)&&(G=G.slice(0,-1)),K.insertAt(0,G,F)}else{var B=f.default.create(G,F);this.appendChild(B)}else l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,D,G,F);this.optimize()}}},{key:"insertBefore",value:function(D,G){if(D.statics.scope===f.default.Scope.INLINE_BLOT){var F=f.default.create(this.statics.defaultChild);F.appendChild(D),D=F}l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertBefore",this).call(this,D,G)}},{key:"leaf",value:function(D){return this.path(D).pop()||[null,-1]}},{key:"line",value:function(D){return D===this.length()?this.line(D-1):this.descendant(O,D)}},{key:"lines",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,F=function K(B,$,W){var C=[],A=W;return B.children.forEachAt($,W,function(j,z,H){O(j)?C.push(j):j instanceof f.default.Container&&(C=C.concat(K(j,z,A))),A-=H}),C};return F(this,D,G)}},{key:"optimize",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"optimize",this).call(this,D,G),D.length>0&&this.emitter.emit(_.default.events.SCROLL_OPTIMIZE,D,G))}},{key:"path",value:function(D){return l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"path",this).call(this,D).slice(1)}},{key:"update",value:function(D){if(this.batch!==!0){var G=_.default.sources.USER;typeof D=="string"&&(G=D),Array.isArray(D)||(D=this.observer.takeRecords()),D.length>0&&this.emitter.emit(_.default.events.SCROLL_BEFORE_UPDATE,G,D),l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"update",this).call(this,D.concat([])),D.length>0&&this.emitter.emit(_.default.events.SCROLL_UPDATE,G,D)}}}]),R}(f.default.Scroll);N.blotName="scroll",N.className="ql-editor",N.tagName="DIV",N.defaultChild="block",N.allowedChildren=[h.default,g.BlockEmbed,d.default],n.default=N},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},o=function(){function q(U,X){var Q=[],Z=!0,re=!1,ee=void 0;try{for(var le=U[Symbol.iterator](),ce;!(Z=(ce=le.next()).done)&&(Q.push(ce.value),!(X&&Q.length===X));Z=!0);}catch(_e){re=!0,ee=_e}finally{try{!Z&&le.return&&le.return()}finally{if(re)throw ee}}return Q}return function(U,X){if(Array.isArray(U))return U;if(Symbol.iterator in Object(U))return q(U,X);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function q(U,X){for(var Q=0;Q<X.length;Q++){var Z=X[Q];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(U,Z.key,Z)}}return function(U,X,Q){return X&&q(U.prototype,X),Q&&q(U,Q),U}}(),u=i(21),f=T(u),v=i(11),_=T(v),g=i(3),h=T(g),w=i(2),E=T(w),S=i(20),b=T(S),p=i(0),d=T(p),m=i(5),y=T(m),x=i(10),P=T(x),O=i(9),N=T(O);function T(q){return q&&q.__esModule?q:{default:q}}function R(q,U,X){return U in q?Object.defineProperty(q,U,{value:X,enumerable:!0,configurable:!0,writable:!0}):q[U]=X,q}function M(q,U){if(!(q instanceof U))throw new TypeError("Cannot call a class as a function")}function D(q,U){if(!q)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:q}function G(q,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);q.prototype=Object.create(U&&U.prototype,{constructor:{value:q,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(q,U):q.__proto__=U)}var F=(0,P.default)("quill:keyboard"),K=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",B=function(q){G(U,q),l(U,null,[{key:"match",value:function(Q,Z){return Z=Y(Z),["altKey","ctrlKey","metaKey","shiftKey"].some(function(re){return!!Z[re]!==Q[re]&&Z[re]!==null})?!1:Z.key===(Q.which||Q.keyCode)}}]);function U(X,Q){M(this,U);var Z=D(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,X,Q));return Z.bindings={},Object.keys(Z.options.bindings).forEach(function(re){re==="list autofill"&&X.scroll.whitelist!=null&&!X.scroll.whitelist.list||Z.options.bindings[re]&&Z.addBinding(Z.options.bindings[re])}),Z.addBinding({key:U.keys.ENTER,shiftKey:null},j),Z.addBinding({key:U.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(Z.addBinding({key:U.keys.BACKSPACE},{collapsed:!0},W),Z.addBinding({key:U.keys.DELETE},{collapsed:!0},C)):(Z.addBinding({key:U.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},W),Z.addBinding({key:U.keys.DELETE},{collapsed:!0,suffix:/^.?$/},C)),Z.addBinding({key:U.keys.BACKSPACE},{collapsed:!1},A),Z.addBinding({key:U.keys.DELETE},{collapsed:!1},A),Z.addBinding({key:U.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},W),Z.listen(),Z}return l(U,[{key:"addBinding",value:function(Q){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ee=Y(Q);if(ee==null||ee.key==null)return F.warn("Attempted to add invalid keyboard binding",ee);typeof Z=="function"&&(Z={handler:Z}),typeof re=="function"&&(re={handler:re}),ee=(0,h.default)(ee,Z,re),this.bindings[ee.key]=this.bindings[ee.key]||[],this.bindings[ee.key].push(ee)}},{key:"listen",value:function(){var Q=this;this.quill.root.addEventListener("keydown",function(Z){if(!Z.defaultPrevented){var re=Z.which||Z.keyCode,ee=(Q.bindings[re]||[]).filter(function(Be){return U.match(Z,Be)});if(ee.length!==0){var le=Q.quill.getSelection();if(!(le==null||!Q.quill.hasFocus())){var ce=Q.quill.getLine(le.index),_e=o(ce,2),Le=_e[0],Oe=_e[1],ae=Q.quill.getLeaf(le.index),de=o(ae,2),ye=de[0],we=de[1],te=le.length===0?[ye,we]:Q.quill.getLeaf(le.index+le.length),ue=o(te,2),fe=ue[0],be=ue[1],Te=ye instanceof d.default.Text?ye.value().slice(0,we):"",Ye=fe instanceof d.default.Text?fe.value().slice(be):"",Ke={collapsed:le.length===0,empty:le.length===0&&Le.length()<=1,format:Q.quill.getFormat(le),offset:Oe,prefix:Te,suffix:Ye},Ce=ee.some(function(Be){if(Be.collapsed!=null&&Be.collapsed!==Ke.collapsed||Be.empty!=null&&Be.empty!==Ke.empty||Be.offset!=null&&Be.offset!==Ke.offset)return!1;if(Array.isArray(Be.format)){if(Be.format.every(function(et){return Ke.format[et]==null}))return!1}else if(a(Be.format)==="object"&&!Object.keys(Be.format).every(function(et){return Be.format[et]===!0?Ke.format[et]!=null:Be.format[et]===!1?Ke.format[et]==null:(0,_.default)(Be.format[et],Ke.format[et])}))return!1;return Be.prefix!=null&&!Be.prefix.test(Ke.prefix)||Be.suffix!=null&&!Be.suffix.test(Ke.suffix)?!1:Be.handler.call(Q,le,Ke)!==!0});Ce&&Z.preventDefault()}}}})}}]),U}(N.default);B.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},B.DEFAULTS={bindings:{bold:H("bold"),italic:H("italic"),underline:H("underline"),indent:{key:B.keys.TAB,format:["blockquote","indent","list"],handler:function(U,X){if(X.collapsed&&X.offset!==0)return!0;this.quill.format("indent","+1",y.default.sources.USER)}},outdent:{key:B.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",y.default.sources.USER)}},"outdent backspace":{key:B.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",y.default.sources.USER):X.format.list!=null&&this.quill.format("list",!1,y.default.sources.USER)}},"indent code-block":z(!0),"outdent code-block":z(!1),"remove tab":{key:B.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(U){this.quill.deleteText(U.index-1,1,y.default.sources.USER)}},tab:{key:B.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,y.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(U.index+1,y.default.sources.SILENT)}},"list empty enter":{key:B.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(U,X){this.quill.format("list",!1,y.default.sources.USER),X.format.indent&&this.quill.format("indent",!1,y.default.sources.USER)}},"checklist enter":{key:B.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(U){var X=this.quill.getLine(U.index),Q=o(X,2),Z=Q[0],re=Q[1],ee=(0,h.default)({},Z.formats(),{list:"checked"}),le=new E.default().retain(U.index).insert(`
|
|
125
|
+
`,ee).retain(Z.length()-re-1).retain(1,{list:"unchecked"});this.quill.updateContents(le,y.default.sources.USER),this.quill.setSelection(U.index+1,y.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:B.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(U,X){var Q=this.quill.getLine(U.index),Z=o(Q,2),re=Z[0],ee=Z[1],le=new E.default().retain(U.index).insert(`
|
|
126
|
+
`,X.format).retain(re.length()-ee-1).retain(1,{header:null});this.quill.updateContents(le,y.default.sources.USER),this.quill.setSelection(U.index+1,y.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,Z=this.quill.getLine(U.index),re=o(Z,2),ee=re[0],le=re[1];if(le>Q)return!0;var ce=void 0;switch(X.prefix.trim()){case"[]":case"[ ]":ce="unchecked";break;case"[x]":ce="checked";break;case"-":case"*":ce="bullet";break;default:ce="ordered"}this.quill.insertText(U.index," ",y.default.sources.USER),this.quill.history.cutoff();var _e=new E.default().retain(U.index-le).delete(Q+1).retain(ee.length()-2-le).retain(1,{list:ce});this.quill.updateContents(_e,y.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(U.index-Q,y.default.sources.SILENT)}},"code exit":{key:B.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),Z=Q[0],re=Q[1],ee=new E.default().retain(U.index+Z.length()-re-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(ee,y.default.sources.USER)}},"embed left":$(B.keys.LEFT,!1),"embed left shift":$(B.keys.LEFT,!0),"embed right":$(B.keys.RIGHT,!1),"embed right shift":$(B.keys.RIGHT,!0)}};function $(q,U){var X,Q=q===B.keys.LEFT?"prefix":"suffix";return X={key:q,shiftKey:U,altKey:null},R(X,Q,/^$/),R(X,"handler",function(re){var ee=re.index;q===B.keys.RIGHT&&(ee+=re.length+1);var le=this.quill.getLeaf(ee),ce=o(le,1),_e=ce[0];return _e instanceof d.default.Embed?(q===B.keys.LEFT?U?this.quill.setSelection(re.index-1,re.length+1,y.default.sources.USER):this.quill.setSelection(re.index-1,y.default.sources.USER):U?this.quill.setSelection(re.index,re.length+1,y.default.sources.USER):this.quill.setSelection(re.index+re.length+1,y.default.sources.USER),!1):!0}),X}function W(q,U){if(!(q.index===0||this.quill.getLength()<=1)){var X=this.quill.getLine(q.index),Q=o(X,1),Z=Q[0],re={};if(U.offset===0){var ee=this.quill.getLine(q.index-1),le=o(ee,1),ce=le[0];if(ce!=null&&ce.length()>1){var _e=Z.formats(),Le=this.quill.getFormat(q.index-1,1);re=b.default.attributes.diff(_e,Le)||{}}}var Oe=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(U.prefix)?2:1;this.quill.deleteText(q.index-Oe,Oe,y.default.sources.USER),Object.keys(re).length>0&&this.quill.formatLine(q.index-Oe,Oe,re,y.default.sources.USER),this.quill.focus()}}function C(q,U){var X=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(U.suffix)?2:1;if(!(q.index>=this.quill.getLength()-X)){var Q={},Z=0,re=this.quill.getLine(q.index),ee=o(re,1),le=ee[0];if(U.offset>=le.length()-1){var ce=this.quill.getLine(q.index+1),_e=o(ce,1),Le=_e[0];if(Le){var Oe=le.formats(),ae=this.quill.getFormat(q.index,1);Q=b.default.attributes.diff(Oe,ae)||{},Z=Le.length()}}this.quill.deleteText(q.index,X,y.default.sources.USER),Object.keys(Q).length>0&&this.quill.formatLine(q.index+Z-1,X,Q,y.default.sources.USER)}}function A(q){var U=this.quill.getLines(q),X={};if(U.length>1){var Q=U[0].formats(),Z=U[U.length-1].formats();X=b.default.attributes.diff(Z,Q)||{}}this.quill.deleteText(q,y.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine(q.index,1,X,y.default.sources.USER),this.quill.setSelection(q.index,y.default.sources.SILENT),this.quill.focus()}function j(q,U){var X=this;q.length>0&&this.quill.scroll.deleteAt(q.index,q.length);var Q=Object.keys(U.format).reduce(function(Z,re){return d.default.query(re,d.default.Scope.BLOCK)&&!Array.isArray(U.format[re])&&(Z[re]=U.format[re]),Z},{});this.quill.insertText(q.index,`
|
|
127
|
+
`,Q,y.default.sources.USER),this.quill.setSelection(q.index+1,y.default.sources.SILENT),this.quill.focus(),Object.keys(U.format).forEach(function(Z){Q[Z]==null&&(Array.isArray(U.format[Z])||Z!=="link"&&X.quill.format(Z,U.format[Z],y.default.sources.USER))})}function z(q){return{key:B.keys.TAB,shiftKey:!q,format:{"code-block":!0},handler:function(X){var Q=d.default.query("code-block"),Z=X.index,re=X.length,ee=this.quill.scroll.descendant(Q,Z),le=o(ee,2),ce=le[0],_e=le[1];if(ce!=null){var Le=this.quill.getIndex(ce),Oe=ce.newlineIndex(_e,!0)+1,ae=ce.newlineIndex(Le+_e+re),de=ce.domNode.textContent.slice(Oe,ae).split(`
|
|
128
|
+
`);_e=0,de.forEach(function(ye,we){q?(ce.insertAt(Oe+_e,Q.TAB),_e+=Q.TAB.length,we===0?Z+=Q.TAB.length:re+=Q.TAB.length):ye.startsWith(Q.TAB)&&(ce.deleteAt(Oe+_e,Q.TAB.length),_e-=Q.TAB.length,we===0?Z-=Q.TAB.length:re-=Q.TAB.length),_e+=ye.length+1}),this.quill.update(y.default.sources.USER),this.quill.setSelection(Z,re,y.default.sources.SILENT)}}}}function H(q){return{key:q[0].toUpperCase(),shortKey:!0,handler:function(X,Q){this.quill.format(q,!Q.format[q],y.default.sources.USER)}}}function Y(q){if(typeof q=="string"||typeof q=="number")return Y({key:q});if((typeof q>"u"?"undefined":a(q))==="object"&&(q=(0,f.default)(q,!1)),typeof q.key=="string")if(B.keys[q.key.toUpperCase()]!=null)q.key=B.keys[q.key.toUpperCase()];else if(q.key.length===1)q.key=q.key.toUpperCase().charCodeAt(0);else return null;return q.shortKey&&(q[K]=q.shortKey,delete q.shortKey),q}n.default=B,n.SHORTKEY=K},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function b(p,d){var m=[],y=!0,x=!1,P=void 0;try{for(var O=p[Symbol.iterator](),N;!(y=(N=O.next()).done)&&(m.push(N.value),!(d&&m.length===d));y=!0);}catch(T){x=!0,P=T}finally{try{!y&&O.return&&O.return()}finally{if(x)throw P}}return m}return function(p,d){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return b(p,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function b(p,d,m){p===null&&(p=Function.prototype);var y=Object.getOwnPropertyDescriptor(p,d);if(y===void 0){var x=Object.getPrototypeOf(p);return x===null?void 0:b(x,d,m)}else{if("value"in y)return y.value;var P=y.get;return P===void 0?void 0:P.call(m)}},l=function(){function b(p,d){for(var m=0;m<d.length;m++){var y=d[m];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(p,y.key,y)}}return function(p,d,m){return d&&b(p.prototype,d),m&&b(p,m),p}}(),u=i(0),f=g(u),v=i(7),_=g(v);function g(b){return b&&b.__esModule?b:{default:b}}function h(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function w(b,p){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:b}function E(b,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);b.prototype=Object.create(p&&p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(b,p):b.__proto__=p)}var S=function(b){E(p,b),l(p,null,[{key:"value",value:function(){}}]);function p(d,m){h(this,p);var y=w(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,d));return y.selection=m,y.textNode=document.createTextNode(p.CONTENTS),y.domNode.appendChild(y.textNode),y._length=0,y}return l(p,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(m,y){if(this._length!==0)return o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,m,y);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,m,y),this._length=0)}},{key:"index",value:function(m,y){return m===this.textNode?0:o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"index",this).call(this,m,y)}},{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 m=this.textNode,y=this.selection.getNativeRange(),x=void 0,P=void 0,O=void 0;if(y!=null&&y.start.node===m&&y.end.node===m){var N=[m,y.start.offset,y.end.offset];x=N[0],P=N[1],O=N[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 _.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 R=[P,O].map(function(D){return Math.max(0,Math.min(x.data.length,D-1))}),M=a(R,2);return P=M[0],O=M[1],{startNode:x,startOffset:P,endNode:x,endOffset:O}}}}},{key:"update",value:function(m,y){var x=this;if(m.some(function(O){return O.type==="characterData"&&O.target===x.textNode})){var P=this.restore();P&&(y.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 v(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function _(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 g(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){g(E,w);function E(){return v(this,E),_(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(b,p){for(var d=0;d<p.length;d++){var m=p[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,p,d){return p&&S(b.prototype,p),d&&S(b,d),b}}(),o=function S(b,p,d){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,p);if(m===void 0){var y=Object.getPrototypeOf(b);return y===null?void 0:S(y,p,d)}else{if("value"in m)return m.value;var x=m.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 v(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function _(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function g(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var h=function(S){g(b,S);function b(){return v(this,b),_(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"value",value:function(d){var m=o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,d);return m.startsWith("rgb(")?(m=m.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+m.split(",").map(function(y){return("00"+parseInt(y).toString(16)).slice(-2)}).join("")):m}}]),b}(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,b){for(var p=0;p<b.length;p++){var d=b[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(S,d.key,d)}}return function(S,b,p){return b&&E(S.prototype,b),p&&E(S,p),S}}(),o=function E(S,b,p){S===null&&(S=Function.prototype);var d=Object.getOwnPropertyDescriptor(S,b);if(d===void 0){var m=Object.getPrototypeOf(S);return m===null?void 0:E(m,b,p)}else{if("value"in d)return d.value;var y=d.get;return y===void 0?void 0:y.call(p)}},l=i(6),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,S){if(!(E instanceof S))throw new TypeError("Cannot call a class as a function")}function _(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 g(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){g(S,E);function S(){return v(this,S),_(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 b=document.createElement("a");b.href=E;var p=b.href.slice(0,b.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(b,p){for(var d=0;d<p.length;d++){var m=p[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,p,d){return p&&S(b.prototype,p),d&&S(b,d),b}}(),l=i(23),u=_(l),f=i(107),v=_(f);function _(S){return S&&S.__esModule?S:{default:S}}function g(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}var h=0;function w(S,b){S.setAttribute(b,S.getAttribute(b)!=="true")}var E=function(){function S(b){var p=this;g(this,S),this.select=b,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,m=document.createElement("span");return m.tabIndex="0",m.setAttribute("role","button"),m.classList.add("ql-picker-item"),p.hasAttribute("value")&&m.setAttribute("data-value",p.getAttribute("value")),p.textContent&&m.setAttribute("data-label",p.textContent),m.addEventListener("click",function(){d.selectItem(m,!0)}),m.addEventListener("keydown",function(y){switch(y.keyCode){case u.default.keys.ENTER:d.selectItem(m,!0),y.preventDefault();break;case u.default.keys.ESCAPE:d.escape(),y.preventDefault();break}}),m}},{key:"buildLabel",value:function(){var p=document.createElement("span");return p.classList.add("ql-picker-label"),p.innerHTML=v.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(m){var y=p.buildItem(m);d.appendChild(y),m.selected===!0&&p.selectItem(y)}),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,m=this.container.querySelector(".ql-selected");if(p!==m&&(m!=null&&m.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 y=document.createEvent("Event");y.initEvent("change",!0,!0),this.select.dispatchEvent(y)}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 m=p!=null&&p!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",m)}}]),S}();n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=F(a),l=i(5),u=F(l),f=i(4),v=F(f),_=i(16),g=F(_),h=i(25),w=F(h),E=i(24),S=F(E),b=i(35),p=F(b),d=i(6),m=F(d),y=i(22),x=F(y),P=i(7),O=F(P),N=i(55),T=F(N),R=i(42),M=F(R),D=i(23),G=F(D);function F(K){return K&&K.__esModule?K:{default:K}}u.default.register({"blots/block":v.default,"blots/block/embed":f.BlockEmbed,"blots/break":g.default,"blots/container":w.default,"blots/cursor":S.default,"blots/embed":p.default,"blots/inline":m.default,"blots/scroll":x.default,"blots/text":O.default,"modules/clipboard":T.default,"modules/history":M.default,"modules/keyboard":G.default}),o.default.register(v.default,g.default,S.default,m.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 v=this.isolate(u,f);v.remove()},l.prototype.formatAt=function(u,f,v,_){var g=this.isolate(u,f);if(a.query(v,a.Scope.BLOT)!=null&&_)g.wrap(v,_);else if(a.query(v,a.Scope.ATTRIBUTE)!=null){var h=a.create(this.statics.scope);g.wrap(h),h.format(v,_)}},l.prototype.insertAt=function(u,f,v){var _=v==null?a.create("text",f):a.create(f,v),g=this.split(u);this.parent.insertBefore(_,g)},l.prototype.insertInto=function(u,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var v=null;u.children.insertBefore(this,f),f!=null&&(v=f.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=v)&&u.domNode.insertBefore(this.domNode,v),this.parent=u,this.attach()},l.prototype.isolate=function(u,f){var v=this.split(u);return v.split(f),v},l.prototype.length=function(){return 1},l.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},l.prototype.optimize=function(u){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},l.prototype.replaceWith=function(u,f){var v=typeof u=="string"?a.create(u,f):u;return v.replace(this),v},l.prototype.split=function(u,f){return u===0?this:this.next},l.prototype.update=function(u,f){},l.prototype.wrap=function(u,f){var v=typeof u=="string"?a.create(u,f):u;return this.parent!=null&&this.parent.insertBefore(v,this.next),v.appendChild(this),v},l.blotName="abstract",l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(12),o=i(32),l=i(33),u=i(1),f=function(){function v(_){this.attributes={},this.domNode=_,this.build()}return v.prototype.attribute=function(_,g){g?_.add(this.domNode,g)&&(_.value(this.domNode)!=null?this.attributes[_.attrName]=_:delete this.attributes[_.attrName]):(_.remove(this.domNode),delete this.attributes[_.attrName])},v.prototype.build=function(){var _=this;this.attributes={};var g=a.default.keys(this.domNode),h=o.default.keys(this.domNode),w=l.default.keys(this.domNode);g.concat(h).concat(w).forEach(function(E){var S=u.query(E,u.Scope.ATTRIBUTE);S instanceof a.default&&(_.attributes[S.attrName]=S)})},v.prototype.copy=function(_){var g=this;Object.keys(this.attributes).forEach(function(h){var w=g.attributes[h].value(g.domNode);_.format(h,w)})},v.prototype.move=function(_){var g=this;this.copy(_),Object.keys(this.attributes).forEach(function(h){g.attributes[h].remove(g.domNode)}),this.attributes={}},v.prototype.values=function(){var _=this;return Object.keys(this.attributes).reduce(function(g,h){return g[h]=_.attributes[h].value(_.domNode),g},{})},v}();n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,_){v.__proto__=_}||function(v,_){for(var g in _)_.hasOwnProperty(g)&&(v[g]=_[g])};return function(v,_){f(v,_);function g(){this.constructor=v}v.prototype=_===null?Object.create(_):(g.prototype=_.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f,v){var _=f.getAttribute("class")||"";return _.split(/\s+/).filter(function(g){return g.indexOf(v+"-")===0})}var u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.keys=function(_){return(_.getAttribute("class")||"").split(/\s+/).map(function(g){return g.split("-").slice(0,-1).join("-")})},v.prototype.add=function(_,g){return this.canAdd(_,g)?(this.remove(_),_.classList.add(this.keyName+"-"+g),!0):!1},v.prototype.remove=function(_){var g=l(_,this.keyName);g.forEach(function(h){_.classList.remove(h)}),_.classList.length===0&&_.removeAttribute("class")},v.prototype.value=function(_){var g=l(_,this.keyName)[0]||"",h=g.slice(this.keyName.length+1);return this.canAdd(_,h)?h:""},v}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,_){v.__proto__=_}||function(v,_){for(var g in _)_.hasOwnProperty(g)&&(v[g]=_[g])};return function(v,_){f(v,_);function g(){this.constructor=v}v.prototype=_===null?Object.create(_):(g.prototype=_.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f){var v=f.split("-"),_=v.slice(1).map(function(g){return g[0].toUpperCase()+g.slice(1)}).join("");return v[0]+_}var u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.keys=function(_){return(_.getAttribute("style")||"").split(";").map(function(g){var h=g.split(":");return h[0].trim()})},v.prototype.add=function(_,g){return this.canAdd(_,g)?(_.style[l(this.keyName)]=g,!0):!1},v.prototype.remove=function(_){_.style[l(this.keyName)]="",_.getAttribute("style")||_.removeAttribute("style")},v.prototype.value=function(_){var g=_.style[l(this.keyName)];return this.canAdd(_,g)?g:""},v}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,v){for(var _=0;_<v.length;_++){var g=v[_];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(f,g.key,g)}}return function(f,v,_){return v&&u(f.prototype,v),_&&u(f,_),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,v){o(this,u),this.quill=f,this.options=v,this.modules={}}return a(u,[{key:"init",value:function(){var v=this;Object.keys(this.options.modules).forEach(function(_){v.modules[_]==null&&v.addModule(_)})}},{key:"addModule",value:function(v){var _=this.quill.constructor.import("modules/"+v);return this.modules[v]=new _(this.quill,this.options.modules[v]||{}),this.modules[v]}}]),u}();l.DEFAULTS={modules:{}},l.themes={default:l},n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function b(p,d){for(var m=0;m<d.length;m++){var y=d[m];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(p,y.key,y)}}return function(p,d,m){return d&&b(p.prototype,d),m&&b(p,m),p}}(),o=function b(p,d,m){p===null&&(p=Function.prototype);var y=Object.getOwnPropertyDescriptor(p,d);if(y===void 0){var x=Object.getPrototypeOf(p);return x===null?void 0:b(x,d,m)}else{if("value"in y)return y.value;var P=y.get;return P===void 0?void 0:P.call(m)}},l=i(0),u=_(l),f=i(7),v=_(f);function _(b){return b&&b.__esModule?b:{default:b}}function g(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function h(b,p){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:b}function w(b,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);b.prototype=Object.create(p&&p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(b,p):b.__proto__=p)}var E="\uFEFF",S=function(b){w(p,b);function p(d){g(this,p);var m=h(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,d));return m.contentNode=document.createElement("span"),m.contentNode.setAttribute("contenteditable",!1),[].slice.call(m.domNode.childNodes).forEach(function(y){m.contentNode.appendChild(y)}),m.leftGuard=document.createTextNode(E),m.rightGuard=document.createTextNode(E),m.domNode.appendChild(m.leftGuard),m.domNode.appendChild(m.contentNode),m.domNode.appendChild(m.rightGuard),m}return a(p,[{key:"index",value:function(m,y){return m===this.leftGuard?0:m===this.rightGuard?1:o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"index",this).call(this,m,y)}},{key:"restore",value:function(m){var y=void 0,x=void 0,P=m.data.split(E).join("");if(m===this.leftGuard)if(this.prev instanceof v.default){var O=this.prev.length();this.prev.insertAt(O,P),y={startNode:this.prev.domNode,startOffset:O+P.length}}else x=document.createTextNode(P),this.parent.insertBefore(u.default.create(x),this),y={startNode:x,startOffset:P.length};else m===this.rightGuard&&(this.next instanceof v.default?(this.next.insertAt(0,P),y={startNode:this.next.domNode,startOffset:P.length}):(x=document.createTextNode(P),this.parent.insertBefore(u.default.create(x),this.next),y={startNode:x,startOffset:P.length}));return m.data=E,y}},{key:"update",value:function(m,y){var x=this;m.forEach(function(P){if(P.type==="characterData"&&(P.target===x.leftGuard||P.target===x.rightGuard)){var O=x.restore(P.target);O&&(y.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(g){return g&&g.__esModule?g:{default:g}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new o.default.Attributor.Attribute("align","align",u),v=new o.default.Attributor.Class("align","ql-align",u),_=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=f,n.AlignClass=v,n.AlignStyle=_},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(_){return _&&_.__esModule?_:{default:_}}var f=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),v=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var a=i(0),o=l(a);function l(g){return g&&g.__esModule?g:{default:g}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},f=new o.default.Attributor.Attribute("direction","dir",u),v=new o.default.Attributor.Class("direction","ql-direction",u),_=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=f,n.DirectionClass=v,n.DirectionStyle=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function b(p,d){for(var m=0;m<d.length;m++){var y=d[m];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(p,y.key,y)}}return function(p,d,m){return d&&b(p.prototype,d),m&&b(p,m),p}}(),o=function b(p,d,m){p===null&&(p=Function.prototype);var y=Object.getOwnPropertyDescriptor(p,d);if(y===void 0){var x=Object.getPrototypeOf(p);return x===null?void 0:b(x,d,m)}else{if("value"in y)return y.value;var P=y.get;return P===void 0?void 0:P.call(m)}},l=i(0),u=f(l);function f(b){return b&&b.__esModule?b:{default:b}}function v(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function _(b,p){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:b}function g(b,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);b.prototype=Object.create(p&&p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(b,p):b.__proto__=p)}var h={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},w=new u.default.Attributor.Class("font","ql-font",h),E=function(b){g(p,b);function p(){return v(this,p),_(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"value",value:function(m){return o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"value",this).call(this,m).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(v){return v&&v.__esModule?v:{default:v}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=f},function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var a=function(){function d(m,y){for(var x=0;x<y.length;x++){var P=y[x];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(m,P.key,P)}}return function(m,y,x){return y&&d(m.prototype,y),x&&d(m,x),m}}(),o=i(0),l=g(o),u=i(5),f=g(u),v=i(9),_=g(v);function g(d){return d&&d.__esModule?d:{default:d}}function h(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function w(d,m){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:d}function E(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}var S=function(d){E(m,d);function m(y,x){h(this,m);var P=w(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,y,x));return P.lastRecorded=0,P.ignoreChange=!1,P.clear(),P.quill.on(f.default.events.EDITOR_CHANGE,function(O,N,T,R){O!==f.default.events.TEXT_CHANGE||P.ignoreChange||(!P.options.userOnly||R===f.default.sources.USER?P.record(N,T):P.transform(N))}),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(m,[{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 N=p(O[x]);this.quill.setSelection(N)}}},{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),N=Date.now();if(this.lastRecorded+this.options.delay>N&&this.stack.undo.length>0){var T=this.stack.undo.pop();O=O.compose(T.undo),x=T.redo.compose(x)}else this.lastRecorded=N;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")}}]),m}(_.default);S.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function b(d){var m=d.ops[d.ops.length-1];return m==null?!1:m.insert!=null?typeof m.insert=="string"&&m.insert.endsWith(`
|
|
129
|
+
`):m.attributes!=null?Object.keys(m.attributes).some(function(y){return l.default.query(y,l.default.Scope.BLOCK)!=null}):!1}function p(d){var m=d.reduce(function(x,P){return x+=P.delete||0,x},0),y=d.length()-m;return b(d)&&(y-=1),y}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 j(z,H){for(var Y=0;Y<H.length;Y++){var q=H[Y];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(z,q.key,q)}}return function(z,H,Y){return H&&j(z.prototype,H),Y&&j(z,Y),z}}(),o=function j(z,H,Y){z===null&&(z=Function.prototype);var q=Object.getOwnPropertyDescriptor(z,H);if(q===void 0){var U=Object.getPrototypeOf(z);return U===null?void 0:j(U,H,Y)}else{if("value"in q)return q.value;var X=q.get;return X===void 0?void 0:X.call(Y)}},l=i(3),u=N(l),f=i(2),v=N(f),_=i(8),g=N(_),h=i(23),w=N(h),E=i(34),S=N(E),b=i(59),p=N(b),d=i(60),m=N(d),y=i(28),x=N(y),P=i(61),O=N(P);function N(j){return j&&j.__esModule?j:{default:j}}function T(j,z){if(!(j instanceof z))throw new TypeError("Cannot call a class as a function")}function R(j,z){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return z&&(typeof z=="object"||typeof z=="function")?z:j}function M(j,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof z);j.prototype=Object.create(z&&z.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),z&&(Object.setPrototypeOf?Object.setPrototypeOf(j,z):j.__proto__=z)}var D=[!1,"center","right","justify"],G=["#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"],F=[!1,"serif","monospace"],K=["1","2","3",!1],B=["small",!1,"large","huge"],$=function(j){M(z,j);function z(H,Y){T(this,z);var q=R(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,H,Y)),U=function X(Q){if(!document.body.contains(H.root))return document.body.removeEventListener("click",X);q.tooltip!=null&&!q.tooltip.root.contains(Q.target)&&document.activeElement!==q.tooltip.textbox&&!q.quill.hasFocus()&&q.tooltip.hide(),q.pickers!=null&&q.pickers.forEach(function(Z){Z.container.contains(Q.target)||Z.close()})};return H.emitter.listenDOM("click",document.body,U),q}return a(z,[{key:"addModule",value:function(Y){var q=o(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"addModule",this).call(this,Y);return Y==="toolbar"&&this.extendToolbar(q),q}},{key:"buildButtons",value:function(Y,q){Y.forEach(function(U){var X=U.getAttribute("class")||"";X.split(/\s+/).forEach(function(Q){if(Q.startsWith("ql-")&&(Q=Q.slice(3),q[Q]!=null))if(Q==="direction")U.innerHTML=q[Q][""]+q[Q].rtl;else if(typeof q[Q]=="string")U.innerHTML=q[Q];else{var Z=U.value||"";Z!=null&&q[Q][Z]&&(U.innerHTML=q[Q][Z])}})})}},{key:"buildPickers",value:function(Y,q){var U=this;this.pickers=Y.map(function(Q){if(Q.classList.contains("ql-align"))return Q.querySelector("option")==null&&A(Q,D),new m.default(Q,q.align);if(Q.classList.contains("ql-background")||Q.classList.contains("ql-color")){var Z=Q.classList.contains("ql-background")?"background":"color";return Q.querySelector("option")==null&&A(Q,G,Z==="background"?"#ffffff":"#000000"),new p.default(Q,q[Z])}else return Q.querySelector("option")==null&&(Q.classList.contains("ql-font")?A(Q,F):Q.classList.contains("ql-header")?A(Q,K):Q.classList.contains("ql-size")&&A(Q,B)),new x.default(Q)});var X=function(){U.pickers.forEach(function(Z){Z.update()})};this.quill.on(g.default.events.EDITOR_CHANGE,X)}}]),z}(S.default);$.DEFAULTS=(0,u.default)(!0,{},S.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var z=this,H=this.container.querySelector("input.ql-image[type=file]");H==null&&(H=document.createElement("input"),H.setAttribute("type","file"),H.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),H.classList.add("ql-image"),H.addEventListener("change",function(){if(H.files!=null&&H.files[0]!=null){var Y=new FileReader;Y.onload=function(q){var U=z.quill.getSelection(!0);z.quill.updateContents(new v.default().retain(U.index).delete(U.length).insert({image:q.target.result}),g.default.sources.USER),z.quill.setSelection(U.index+1,g.default.sources.SILENT),H.value=""},Y.readAsDataURL(H.files[0])}}),this.container.appendChild(H)),H.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var W=function(j){M(z,j);function z(H,Y){T(this,z);var q=R(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,H,Y));return q.textbox=q.root.querySelector('input[type="text"]'),q.listen(),q}return a(z,[{key:"listen",value:function(){var Y=this;this.textbox.addEventListener("keydown",function(q){w.default.match(q,"enter")?(Y.save(),q.preventDefault()):w.default.match(q,"escape")&&(Y.cancel(),q.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),q!=null?this.textbox.value=q:Y!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+Y)||""),this.root.setAttribute("data-mode",Y)}},{key:"restoreFocus",value:function(){var Y=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=Y}},{key:"save",value:function(){var Y=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var q=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",Y,g.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",Y,g.default.sources.USER)),this.quill.root.scrollTop=q;break}case"video":Y=C(Y);case"formula":{if(!Y)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"),Y,g.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(X+1," ",g.default.sources.USER),this.quill.setSelection(X+2,g.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),z}(O.default);function C(j){var z=j.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||j.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return z?(z[1]||"https")+"://www.youtube.com/embed/"+z[2]+"?showinfo=0":(z=j.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(z[1]||"https")+"://player.vimeo.com/video/"+z[2]+"/":j}function A(j,z){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;z.forEach(function(Y){var q=document.createElement("option");Y===H?q.setAttribute("selected","selected"):q.setAttribute("value",Y),j.appendChild(q)})}n.BaseTooltip=W,n.default=$},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},o.prototype.contains=function(l){for(var u,f=this.iterator();u=f();)if(u===l)return!0;return!1},o.prototype.insertBefore=function(l,u){l&&(l.next=u,u!=null?(l.prev=u.prev,u.prev!=null&&(u.prev.next=l),u.prev=l,u===this.head&&(this.head=l)):this.tail!=null?(this.tail.next=l,l.prev=this.tail,this.tail=l):(l.prev=null,this.head=this.tail=l),this.length+=1)},o.prototype.offset=function(l){for(var u=0,f=this.head;f!=null;){if(f===l)return u;u+=f.length(),f=f.next}return-1},o.prototype.remove=function(l){this.contains(l)&&(l.prev!=null&&(l.prev.next=l.next),l.next!=null&&(l.next.prev=l.prev),l===this.head&&(this.head=l.next),l===this.tail&&(this.tail=l.prev),this.length-=1)},o.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var u=l;return l!=null&&(l=l.next),u}},o.prototype.find=function(l,u){u===void 0&&(u=!1);for(var f,v=this.iterator();f=v();){var _=f.length();if(l<_||u&&l===_&&(f.next==null||f.next.length()!==0))return[f,l];l-=_}return[null,0]},o.prototype.forEach=function(l){for(var u,f=this.iterator();u=f();)l(u)},o.prototype.forEachAt=function(l,u,f){if(!(u<=0))for(var v=this.find(l),_=v[0],g=v[1],h,w=l-g,E=this.iterator(_);(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,v=this.iterator();f=v();)u=l(u,f);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,h){g.__proto__=h}||function(g,h){for(var w in h)h.hasOwnProperty(w)&&(g[w]=h[w])};return function(g,h){_(g,h);function w(){this.constructor=g}g.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,v=function(_){a(g,_);function g(h){var w=_.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 g.prototype.detach=function(){_.prototype.detach.call(this),this.observer.disconnect()},g.prototype.deleteAt=function(h,w){this.update(),h===0&&w===this.length()?this.children.forEach(function(E){E.remove()}):_.prototype.deleteAt.call(this,h,w)},g.prototype.formatAt=function(h,w,E,S){this.update(),_.prototype.formatAt.call(this,h,w,E,S)},g.prototype.insertAt=function(h,w,E){this.update(),_.prototype.insertAt.call(this,h,w,E)},g.prototype.optimize=function(h,w){var E=this;h===void 0&&(h=[]),w===void 0&&(w={}),_.prototype.optimize.call(this,w);for(var S=[].slice.call(this.observer.takeRecords());S.length>0;)h.push(S.pop());for(var b=function(y,x){x===void 0&&(x=!0),!(y==null||y===E)&&y.domNode.parentNode!=null&&(y.domNode[l.DATA_KEY].mutations==null&&(y.domNode[l.DATA_KEY].mutations=[]),x&&b(y.parent))},p=function(y){y.domNode[l.DATA_KEY]==null||y.domNode[l.DATA_KEY].mutations==null||(y instanceof o.default&&y.children.forEach(p),y.optimize(w))},d=h,m=0;d.length>0;m+=1){if(m>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(y){var x=l.find(y.target,!0);x!=null&&(x.domNode===y.target&&(y.type==="childList"?(b(l.find(y.previousSibling,!1)),[].forEach.call(y.addedNodes,function(P){var O=l.find(P,!1);b(O,!1),O instanceof o.default&&O.children.forEach(function(N){b(N,!1)})})):y.type==="attributes"&&b(x.prev)),b(x))}),this.children.forEach(p),d=[].slice.call(this.observer.takeRecords()),S=d.slice();S.length>0;)h.push(S.pop())}},g.prototype.update=function(h,w){var E=this;w===void 0&&(w={}),h=h||this.observer.takeRecords(),h.map(function(S){var b=l.find(S.target,!0);return b==null?null:b.domNode[l.DATA_KEY].mutations==null?(b.domNode[l.DATA_KEY].mutations=[S],b):(b.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&&_.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,w),this.optimize(h,w)},g.blotName="scroll",g.defaultChild="block",g.scope=l.Scope.BLOCK_BLOT,g.tagName="DIV",g}(o.default);n.default=v},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,g){_.__proto__=g}||function(_,g){for(var h in g)g.hasOwnProperty(h)&&(_[h]=g[h])};return function(_,g){v(_,g);function h(){this.constructor=_}_.prototype=g===null?Object.create(g):(h.prototype=g.prototype,new h)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function u(v,_){if(Object.keys(v).length!==Object.keys(_).length)return!1;for(var g in v)if(v[g]!==_[g])return!1;return!0}var f=function(v){a(_,v);function _(){return v!==null&&v.apply(this,arguments)||this}return _.formats=function(g){if(g.tagName!==_.tagName)return v.formats.call(this,g)},_.prototype.format=function(g,h){var w=this;g===this.statics.blotName&&!h?(this.children.forEach(function(E){E instanceof o.default||(E=E.wrap(_.blotName,!0)),w.attributes.copy(E)}),this.unwrap()):v.prototype.format.call(this,g,h)},_.prototype.formatAt=function(g,h,w,E){if(this.formats()[w]!=null||l.query(w,l.Scope.ATTRIBUTE)){var S=this.isolate(g,h);S.format(w,E)}else v.prototype.formatAt.call(this,g,h,w,E)},_.prototype.optimize=function(g){v.prototype.optimize.call(this,g);var h=this.formats();if(Object.keys(h).length===0)return this.unwrap();var w=this.next;w instanceof _&&w.prev===this&&u(h,w.formats())&&(w.moveChildren(this),w.remove())},_.blotName="inline",_.scope=l.Scope.INLINE_BLOT,_.tagName="SPAN",_}(o.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,_){v.__proto__=_}||function(v,_){for(var g in _)_.hasOwnProperty(g)&&(v[g]=_[g])};return function(v,_){f(v,_);function g(){this.constructor=v}v.prototype=_===null?Object.create(_):(g.prototype=_.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1),u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.formats=function(_){var g=l.query(v.blotName).tagName;if(_.tagName!==g)return f.formats.call(this,_)},v.prototype.format=function(_,g){l.query(_,l.Scope.BLOCK)!=null&&(_===this.statics.blotName&&!g?this.replaceWith(v.blotName):f.prototype.format.call(this,_,g))},v.prototype.formatAt=function(_,g,h,w){l.query(h,l.Scope.BLOCK)!=null?this.format(h,w):f.prototype.formatAt.call(this,_,g,h,w)},v.prototype.insertAt=function(_,g,h){if(h==null||l.query(g,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,_,g,h);else{var w=this.split(_),E=l.create(g,h);w.parent.insertBefore(E,w)}},v.prototype.update=function(_,g){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,_,g)},v.blotName="block",v.scope=l.Scope.BLOCK_BLOT,v.tagName="P",v}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var _ in v)v.hasOwnProperty(_)&&(f[_]=v[_])};return function(f,v){u(f,v);function _(){this.constructor=f}f.prototype=v===null?Object.create(v):(_.prototype=v.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=function(u){a(f,u);function f(){return u!==null&&u.apply(this,arguments)||this}return f.formats=function(v){},f.prototype.format=function(v,_){u.prototype.formatAt.call(this,0,this.length(),v,_)},f.prototype.formatAt=function(v,_,g,h){v===0&&_===this.length()?this.format(g,h):u.prototype.formatAt.call(this,v,_,g,h)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f}(o.default);n.default=l},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,_){v.__proto__=_}||function(v,_){for(var g in _)_.hasOwnProperty(g)&&(v[g]=_[g])};return function(v,_){f(v,_);function g(){this.constructor=v}v.prototype=_===null?Object.create(_):(g.prototype=_.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=i(1),u=function(f){a(v,f);function v(_){var g=f.call(this,_)||this;return g.text=g.statics.value(g.domNode),g}return v.create=function(_){return document.createTextNode(_)},v.value=function(_){var g=_.data;return g.normalize&&(g=g.normalize()),g},v.prototype.deleteAt=function(_,g){this.domNode.data=this.text=this.text.slice(0,_)+this.text.slice(_+g)},v.prototype.index=function(_,g){return this.domNode===_?g:-1},v.prototype.insertAt=function(_,g,h){h==null?(this.text=this.text.slice(0,_)+g+this.text.slice(_),this.domNode.data=this.text):f.prototype.insertAt.call(this,_,g,h)},v.prototype.length=function(){return this.text.length},v.prototype.optimize=function(_){f.prototype.optimize.call(this,_),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof v&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},v.prototype.position=function(_,g){return[this.domNode,_]},v.prototype.split=function(_,g){if(g===void 0&&(g=!1),!g){if(_===0)return this;if(_===this.length())return this.next}var h=l.create(this.domNode.splitText(_));return this.parent.insertBefore(h,this.next),this.text=this.statics.value(this.domNode),h},v.prototype.update=function(_,g){var h=this;_.some(function(w){return w.type==="characterData"&&w.target===h.domNode})&&(this.text=this.statics.value(this.domNode))},v.prototype.value=function(){return this.text},v.blotName="text",v.scope=l.Scope.INLINE_BLOT,v}(o.default);n.default=u},function(r,n,i){var a=document.createElement("div");if(a.classList.toggle("test-class",!1),a.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(l,u){return arguments.length>1&&!this.contains(l)==!u?u:o.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,u){return u=u||0,this.substr(u,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,u){var f=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>f.length)&&(u=f.length),u-=l.length;var v=f.indexOf(l,u);return v!==-1&&v===u}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(u){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof u!="function")throw new TypeError("predicate must be a function");for(var f=Object(this),v=f.length>>>0,_=arguments[1],g,h=0;h<v;h++)if(g=f[h],u.call(_,g,h,f))return g}}),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(m,y,x){if(m==y)return m?[[o,m]]:[];(x<0||m.length<x)&&(x=null);var P=_(m,y),O=m.substring(0,P);m=m.substring(P),y=y.substring(P),P=g(m,y);var N=m.substring(m.length-P);m=m.substring(0,m.length-P),y=y.substring(0,y.length-P);var T=u(m,y);return O&&T.unshift([o,O]),N&&T.push([o,N]),w(T),x!=null&&(T=b(T,x)),T=p(T),T}function u(m,y){var x;if(!m)return[[a,y]];if(!y)return[[i,m]];var P=m.length>y.length?m:y,O=m.length>y.length?y:m,N=P.indexOf(O);if(N!=-1)return x=[[a,P.substring(0,N)],[o,O],[a,P.substring(N+O.length)]],m.length>y.length&&(x[0][0]=x[2][0]=i),x;if(O.length==1)return[[i,m],[a,y]];var T=h(m,y);if(T){var R=T[0],M=T[1],D=T[2],G=T[3],F=T[4],K=l(R,D),B=l(M,G);return K.concat([[o,F]],B)}return f(m,y)}function f(m,y){for(var x=m.length,P=y.length,O=Math.ceil((x+P)/2),N=O,T=2*O,R=new Array(T),M=new Array(T),D=0;D<T;D++)R[D]=-1,M[D]=-1;R[N+1]=0,M[N+1]=0;for(var G=x-P,F=G%2!=0,K=0,B=0,$=0,W=0,C=0;C<O;C++){for(var A=-C+K;A<=C-B;A+=2){var j=N+A,z;A==-C||A!=C&&R[j-1]<R[j+1]?z=R[j+1]:z=R[j-1]+1;for(var H=z-A;z<x&&H<P&&m.charAt(z)==y.charAt(H);)z++,H++;if(R[j]=z,z>x)B+=2;else if(H>P)K+=2;else if(F){var Y=N+G-A;if(Y>=0&&Y<T&&M[Y]!=-1){var q=x-M[Y];if(z>=q)return v(m,y,z,H)}}}for(var U=-C+$;U<=C-W;U+=2){var Y=N+U,q;U==-C||U!=C&&M[Y-1]<M[Y+1]?q=M[Y+1]:q=M[Y-1]+1;for(var X=q-U;q<x&&X<P&&m.charAt(x-q-1)==y.charAt(P-X-1);)q++,X++;if(M[Y]=q,q>x)W+=2;else if(X>P)$+=2;else if(!F){var j=N+G-U;if(j>=0&&j<T&&R[j]!=-1){var z=R[j],H=N+z-j;if(q=x-q,z>=q)return v(m,y,z,H)}}}}return[[i,m],[a,y]]}function v(m,y,x,P){var O=m.substring(0,x),N=y.substring(0,P),T=m.substring(x),R=y.substring(P),M=l(O,N),D=l(T,R);return M.concat(D)}function _(m,y){if(!m||!y||m.charAt(0)!=y.charAt(0))return 0;for(var x=0,P=Math.min(m.length,y.length),O=P,N=0;x<O;)m.substring(N,O)==y.substring(N,O)?(x=O,N=x):P=O,O=Math.floor((P-x)/2+x);return O}function g(m,y){if(!m||!y||m.charAt(m.length-1)!=y.charAt(y.length-1))return 0;for(var x=0,P=Math.min(m.length,y.length),O=P,N=0;x<O;)m.substring(m.length-O,m.length-N)==y.substring(y.length-O,y.length-N)?(x=O,N=x):P=O,O=Math.floor((P-x)/2+x);return O}function h(m,y){var x=m.length>y.length?m:y,P=m.length>y.length?y:m;if(x.length<4||P.length*2<x.length)return null;function O(B,$,W){for(var C=B.substring(W,W+Math.floor(B.length/4)),A=-1,j="",z,H,Y,q;(A=$.indexOf(C,A+1))!=-1;){var U=_(B.substring(W),$.substring(A)),X=g(B.substring(0,W),$.substring(0,A));j.length<X+U&&(j=$.substring(A-X,A)+$.substring(A,A+U),z=B.substring(0,W-X),H=B.substring(W+U),Y=$.substring(0,A-X),q=$.substring(A+U))}return j.length*2>=B.length?[z,H,Y,q,j]:null}var N=O(x,P,Math.ceil(x.length/4)),T=O(x,P,Math.ceil(x.length/2)),R;if(!N&&!T)return null;T?N?R=N[4].length>T[4].length?N:T:R=T:R=N;var M,D,G,F;m.length>y.length?(M=R[0],D=R[1],G=R[2],F=R[3]):(G=R[0],F=R[1],M=R[2],D=R[3]);var K=R[4];return[M,D,G,F,K]}function w(m){m.push([o,""]);for(var y=0,x=0,P=0,O="",N="",T;y<m.length;)switch(m[y][0]){case a:P++,N+=m[y][1],y++;break;case i:x++,O+=m[y][1],y++;break;case o:x+P>1?(x!==0&&P!==0&&(T=_(N,O),T!==0&&(y-x-P>0&&m[y-x-P-1][0]==o?m[y-x-P-1][1]+=N.substring(0,T):(m.splice(0,0,[o,N.substring(0,T)]),y++),N=N.substring(T),O=O.substring(T)),T=g(N,O),T!==0&&(m[y][1]=N.substring(N.length-T)+m[y][1],N=N.substring(0,N.length-T),O=O.substring(0,O.length-T))),x===0?m.splice(y-P,x+P,[a,N]):P===0?m.splice(y-x,x+P,[i,O]):m.splice(y-x-P,x+P,[i,O],[a,N]),y=y-x-P+(x?1:0)+(P?1:0)+1):y!==0&&m[y-1][0]==o?(m[y-1][1]+=m[y][1],m.splice(y,1)):y++,P=0,x=0,O="",N="";break}m[m.length-1][1]===""&&m.pop();var R=!1;for(y=1;y<m.length-1;)m[y-1][0]==o&&m[y+1][0]==o&&(m[y][1].substring(m[y][1].length-m[y-1][1].length)==m[y-1][1]?(m[y][1]=m[y-1][1]+m[y][1].substring(0,m[y][1].length-m[y-1][1].length),m[y+1][1]=m[y-1][1]+m[y+1][1],m.splice(y-1,1),R=!0):m[y][1].substring(0,m[y+1][1].length)==m[y+1][1]&&(m[y-1][1]+=m[y+1][1],m[y][1]=m[y][1].substring(m[y+1][1].length)+m[y+1][1],m.splice(y+1,1),R=!0)),y++;R&&w(m)}var E=l;E.INSERT=a,E.DELETE=i,E.EQUAL=o,r.exports=E;function S(m,y){if(y===0)return[o,m];for(var x=0,P=0;P<m.length;P++){var O=m[P];if(O[0]===i||O[0]===o){var N=x+O[1].length;if(y===N)return[P+1,m];if(y<N){m=m.slice();var T=y-x,R=[O[0],O[1].slice(0,T)],M=[O[0],O[1].slice(T)];return m.splice(P,1,R,M),[P+1,m]}else x=N}}throw new Error("cursor_pos is out of bounds!")}function b(m,y){var x=S(m,y),P=x[1],O=x[0],N=P[O],T=P[O+1];if(N==null)return m;if(N[0]!==o)return m;if(T!=null&&N[1]+T[1]===T[1]+N[1])return P.splice(O,2,T,N),d(P,O,2);if(T!=null&&T[1].indexOf(N[1])===0){P.splice(O,2,[T[0],N[1]],[0,N[1]]);var R=T[1].slice(N[1].length);return R.length>0&&P.splice(O+2,0,[T[0],R]),d(P,O,3)}else return m}function p(m){for(var y=!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<m.length;O+=1)m[O-2][0]===o&&P(m[O-2][1])&&m[O-1][0]===i&&x(m[O-1][1])&&m[O][0]===a&&x(m[O][1])&&(y=!0,m[O-1][1]=m[O-2][1].slice(-1)+m[O-1][1],m[O][1]=m[O-2][1].slice(-1)+m[O][1],m[O-2][1]=m[O-2][1].slice(0,-1));if(!y)return m;for(var N=[],O=0;O<m.length;O+=1)m[O][1].length>0&&N.push(m[O]);return N}function d(m,y,x){for(var P=y+x-1;P>=0&&P>=y-1;P--)if(P+1<m.length){var O=m[P],N=m[P+1];O[0]===N[1]&&m.splice(P,2,[O[0],O[1]+N[1]])}return m}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(a){var o=[];for(var l in a)o.push(l);return o}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?a:o,n.supported=a;function a(l){return Object.prototype.toString.call(l)=="[object Arguments]"}n.unsupported=o;function o(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function l(f,v,_){this.fn=f,this.context=v,this.once=_||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var v=[],_,g;if(this._eventsCount===0)return v;for(g in _=this._events)i.call(_,g)&&v.push(a?g.slice(1):g);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(_)):v},u.prototype.listeners=function(v,_){var g=a?a+v:v,h=this._events[g];if(_)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(v,_,g,h,w,E){var S=a?a+v:v;if(!this._events[S])return!1;var b=this._events[S],p=arguments.length,d,m;if(b.fn){switch(b.once&&this.removeListener(v,b.fn,void 0,!0),p){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,_),!0;case 3:return b.fn.call(b.context,_,g),!0;case 4:return b.fn.call(b.context,_,g,h),!0;case 5:return b.fn.call(b.context,_,g,h,w),!0;case 6:return b.fn.call(b.context,_,g,h,w,E),!0}for(m=1,d=new Array(p-1);m<p;m++)d[m-1]=arguments[m];b.fn.apply(b.context,d)}else{var y=b.length,x;for(m=0;m<y;m++)switch(b[m].once&&this.removeListener(v,b[m].fn,void 0,!0),p){case 1:b[m].fn.call(b[m].context);break;case 2:b[m].fn.call(b[m].context,_);break;case 3:b[m].fn.call(b[m].context,_,g);break;case 4:b[m].fn.call(b[m].context,_,g,h);break;default:if(!d)for(x=1,d=new Array(p-1);x<p;x++)d[x-1]=arguments[x];b[m].fn.apply(b[m].context,d)}}return!0},u.prototype.on=function(v,_,g){var h=new l(_,g||this),w=a?a+v:v;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(v,_,g){var h=new l(_,g||this,!0),w=a?a+v:v;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(v,_,g,h){var w=a?a+v:v;if(!this._events[w])return this;if(!_)return--this._eventsCount===0?this._events=new o:delete this._events[w],this;var E=this._events[w];if(E.fn)E.fn===_&&(!h||E.once)&&(!g||E.context===g)&&(--this._eventsCount===0?this._events=new o:delete this._events[w]);else{for(var S=0,b=[],p=E.length;S<p;S++)(E[S].fn!==_||h&&!E[S].once||g&&E[S].context!==g)&&b.push(E[S]);b.length?this._events[w]=b.length===1?b[0]:b:--this._eventsCount===0?this._events=new o:delete this._events[w]}return this},u.prototype.removeAllListeners=function(v){var _;return v?(_=a?a+v:v,this._events[_]&&(--this._eventsCount===0?this._events=new o:delete this._events[_])):(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(ae){return typeof ae}:function(ae){return ae&&typeof Symbol=="function"&&ae.constructor===Symbol&&ae!==Symbol.prototype?"symbol":typeof ae},o=function(){function ae(de,ye){var we=[],te=!0,ue=!1,fe=void 0;try{for(var be=de[Symbol.iterator](),Te;!(te=(Te=be.next()).done)&&(we.push(Te.value),!(ye&&we.length===ye));te=!0);}catch(Ye){ue=!0,fe=Ye}finally{try{!te&&be.return&&be.return()}finally{if(ue)throw fe}}return we}return function(de,ye){if(Array.isArray(de))return de;if(Symbol.iterator in Object(de))return ae(de,ye);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function ae(de,ye){for(var we=0;we<ye.length;we++){var te=ye[we];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(de,te.key,te)}}return function(de,ye,we){return ye&&ae(de.prototype,ye),we&&ae(de,we),de}}(),u=i(3),f=M(u),v=i(2),_=M(v),g=i(0),h=M(g),w=i(5),E=M(w),S=i(10),b=M(S),p=i(9),d=M(p),m=i(36),y=i(37),x=i(13),P=M(x),O=i(26),N=i(38),T=i(39),R=i(40);function M(ae){return ae&&ae.__esModule?ae:{default:ae}}function D(ae,de,ye){return de in ae?Object.defineProperty(ae,de,{value:ye,enumerable:!0,configurable:!0,writable:!0}):ae[de]=ye,ae}function G(ae,de){if(!(ae instanceof de))throw new TypeError("Cannot call a class as a function")}function F(ae,de){if(!ae)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return de&&(typeof de=="object"||typeof de=="function")?de:ae}function K(ae,de){if(typeof de!="function"&&de!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof de);ae.prototype=Object.create(de&&de.prototype,{constructor:{value:ae,enumerable:!1,writable:!0,configurable:!0}}),de&&(Object.setPrototypeOf?Object.setPrototypeOf(ae,de):ae.__proto__=de)}var B=(0,b.default)("quill:clipboard"),$="__ql-matcher",W=[[Node.TEXT_NODE,Oe],[Node.TEXT_NODE,ce],["br",re],[Node.ELEMENT_NODE,ce],[Node.ELEMENT_NODE,Z],[Node.ELEMENT_NODE,_e],[Node.ELEMENT_NODE,Q],[Node.ELEMENT_NODE,Le],["li",le],["b",X.bind(X,"bold")],["i",X.bind(X,"italic")],["style",ee]],C=[m.AlignAttribute,N.DirectionAttribute].reduce(function(ae,de){return ae[de.keyName]=de,ae},{}),A=[m.AlignStyle,y.BackgroundStyle,O.ColorStyle,N.DirectionStyle,T.FontStyle,R.SizeStyle].reduce(function(ae,de){return ae[de.keyName]=de,ae},{}),j=function(ae){K(de,ae);function de(ye,we){G(this,de);var te=F(this,(de.__proto__||Object.getPrototypeOf(de)).call(this,ye,we));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=[],W.concat(te.options.matchers).forEach(function(ue){var fe=o(ue,2),be=fe[0],Te=fe[1];!we.matchVisual&&Te===_e||te.addMatcher(be,Te)}),te}return l(de,[{key:"addMatcher",value:function(we,te){this.matchers.push([we,te])}},{key:"convert",value:function(we){if(typeof we=="string")return this.container.innerHTML=we.replace(/\>\r?\n +\</g,"><"),this.convert();var te=this.quill.getFormat(this.quill.selection.savedRange.index);if(te[P.default.blotName]){var ue=this.container.innerText;return this.container.innerHTML="",new _.default().insert(ue,D({},P.default.blotName,te[P.default.blotName]))}var fe=this.prepareMatching(),be=o(fe,2),Te=be[0],Ye=be[1],Ke=U(this.container,Te,Ye);return Y(Ke,`
|
|
130
|
+
`)&&Ke.ops[Ke.ops.length-1].attributes==null&&(Ke=Ke.compose(new _.default().retain(Ke.length()-1).delete(1))),B.log("convert",this.container.innerHTML,Ke),this.container.innerHTML="",Ke}},{key:"dangerouslyPasteHTML",value:function(we,te){var ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E.default.sources.API;if(typeof we=="string")this.quill.setContents(this.convert(we),te),this.quill.setSelection(0,E.default.sources.SILENT);else{var fe=this.convert(te);this.quill.updateContents(new _.default().retain(we).concat(fe),ue),this.quill.setSelection(we+fe.length(),E.default.sources.SILENT)}}},{key:"onPaste",value:function(we){var te=this;if(!(we.defaultPrevented||!this.quill.isEnabled())){var ue=this.quill.getSelection(),fe=new _.default().retain(ue.index),be=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(E.default.sources.SILENT),setTimeout(function(){fe=fe.concat(te.convert()).delete(ue.length),te.quill.updateContents(fe,E.default.sources.USER),te.quill.setSelection(fe.length()-ue.length,E.default.sources.SILENT),te.quill.scrollingContainer.scrollTop=be,te.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var we=this,te=[],ue=[];return this.matchers.forEach(function(fe){var be=o(fe,2),Te=be[0],Ye=be[1];switch(Te){case Node.TEXT_NODE:ue.push(Ye);break;case Node.ELEMENT_NODE:te.push(Ye);break;default:[].forEach.call(we.container.querySelectorAll(Te),function(Ke){Ke[$]=Ke[$]||[],Ke[$].push(Ye)});break}}),[te,ue]}}]),de}(d.default);j.DEFAULTS={matchers:[],matchVisual:!0};function z(ae,de,ye){return(typeof de>"u"?"undefined":a(de))==="object"?Object.keys(de).reduce(function(we,te){return z(we,te,de[te])},ae):ae.reduce(function(we,te){return te.attributes&&te.attributes[de]?we.push(te):we.insert(te.insert,(0,f.default)({},D({},de,ye),te.attributes))},new _.default)}function H(ae){if(ae.nodeType!==Node.ELEMENT_NODE)return{};var de="__ql-computed-style";return ae[de]||(ae[de]=window.getComputedStyle(ae))}function Y(ae,de){for(var ye="",we=ae.ops.length-1;we>=0&&ye.length<de.length;--we){var te=ae.ops[we];if(typeof te.insert!="string")break;ye=te.insert+ye}return ye.slice(-1*de.length)===de}function q(ae){if(ae.childNodes.length===0)return!1;var de=H(ae);return["block","list-item"].indexOf(de.display)>-1}function U(ae,de,ye){return ae.nodeType===ae.TEXT_NODE?ye.reduce(function(we,te){return te(ae,we)},new _.default):ae.nodeType===ae.ELEMENT_NODE?[].reduce.call(ae.childNodes||[],function(we,te){var ue=U(te,de,ye);return te.nodeType===ae.ELEMENT_NODE&&(ue=de.reduce(function(fe,be){return be(te,fe)},ue),ue=(te[$]||[]).reduce(function(fe,be){return be(te,fe)},ue)),we.concat(ue)},new _.default):new _.default}function X(ae,de,ye){return z(ye,ae,!0)}function Q(ae,de){var ye=h.default.Attributor.Attribute.keys(ae),we=h.default.Attributor.Class.keys(ae),te=h.default.Attributor.Style.keys(ae),ue={};return ye.concat(we).concat(te).forEach(function(fe){var be=h.default.query(fe,h.default.Scope.ATTRIBUTE);be!=null&&(ue[be.attrName]=be.value(ae),ue[be.attrName])||(be=C[fe],be!=null&&(be.attrName===fe||be.keyName===fe)&&(ue[be.attrName]=be.value(ae)||void 0),be=A[fe],be!=null&&(be.attrName===fe||be.keyName===fe)&&(be=A[fe],ue[be.attrName]=be.value(ae)||void 0))}),Object.keys(ue).length>0&&(de=z(de,ue)),de}function Z(ae,de){var ye=h.default.query(ae);if(ye==null)return de;if(ye.prototype instanceof h.default.Embed){var we={},te=ye.value(ae);te!=null&&(we[ye.blotName]=te,de=new _.default().insert(we,ye.formats(ae)))}else typeof ye.formats=="function"&&(de=z(de,ye.blotName,ye.formats(ae)));return de}function re(ae,de){return Y(de,`
|
|
131
|
+
`)||de.insert(`
|
|
132
|
+
`),de}function ee(){return new _.default}function le(ae,de){var ye=h.default.query(ae);if(ye==null||ye.blotName!=="list-item"||!Y(de,`
|
|
133
|
+
`))return de;for(var we=-1,te=ae.parentNode;!te.classList.contains("ql-clipboard");)(h.default.query(te)||{}).blotName==="list"&&(we+=1),te=te.parentNode;return we<=0?de:de.compose(new _.default().retain(de.length()-1).retain(1,{indent:we}))}function ce(ae,de){return Y(de,`
|
|
134
|
+
`)||(q(ae)||de.length()>0&&ae.nextSibling&&q(ae.nextSibling))&&de.insert(`
|
|
135
|
+
`),de}function _e(ae,de){if(q(ae)&&ae.nextElementSibling!=null&&!Y(de,`
|
|
136
|
+
|
|
137
|
+
`)){var ye=ae.offsetHeight+parseFloat(H(ae).marginTop)+parseFloat(H(ae).marginBottom);ae.nextElementSibling.offsetTop>ae.offsetTop+ye*1.5&&de.insert(`
|
|
138
|
+
`)}return de}function Le(ae,de){var ye={},we=ae.style||{};return we.fontStyle&&H(ae).fontStyle==="italic"&&(ye.italic=!0),we.fontWeight&&(H(ae).fontWeight.startsWith("bold")||parseInt(H(ae).fontWeight)>=700)&&(ye.bold=!0),Object.keys(ye).length>0&&(de=z(de,ye)),parseFloat(we.textIndent||0)>0&&(de=new _.default().insert(" ").concat(de)),de}function Oe(ae,de){var ye=ae.data;if(ae.parentNode.tagName==="O:P")return de.insert(ye.trim());if(ye.trim().length===0&&ae.parentNode.classList.contains("ql-clipboard"))return de;if(!H(ae.parentNode).whiteSpace.startsWith("pre")){var we=function(ue,fe){return fe=fe.replace(/[^\u00a0]/g,""),fe.length<1&&ue?" ":fe};ye=ye.replace(/\r\n/g," ").replace(/\n/g," "),ye=ye.replace(/\s\s+/g,we.bind(we,!0)),(ae.previousSibling==null&&q(ae.parentNode)||ae.previousSibling!=null&&q(ae.previousSibling))&&(ye=ye.replace(/^\s+/,we.bind(we,!1))),(ae.nextSibling==null&&q(ae.parentNode)||ae.nextSibling!=null&&q(ae.nextSibling))&&(ye=ye.replace(/\s+$/,we.bind(we,!1)))}return de.insert(ye)}n.default=j,n.matchAttributor=Q,n.matchBlot=Z,n.matchNewline=ce,n.matchSpacing=_e,n.matchText=Oe},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function w(E,S){for(var b=0;b<S.length;b++){var p=S[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,p.key,p)}}return function(E,S,b){return S&&w(E.prototype,S),b&&w(E,b),E}}(),o=function w(E,S,b){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,b)}else{if("value"in p)return p.value;var m=p.get;return m===void 0?void 0:m.call(b)}},l=i(6),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function v(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function _(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 g(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){g(E,w);function E(){return v(this,E),_(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,[{key:"optimize",value:function(b){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"optimize",this).call(this,b),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 R(M,D){var G=[],F=!0,K=!1,B=void 0;try{for(var $=M[Symbol.iterator](),W;!(F=(W=$.next()).done)&&(G.push(W.value),!(D&&G.length===D));F=!0);}catch(C){K=!0,B=C}finally{try{!F&&$.return&&$.return()}finally{if(K)throw B}}return G}return function(M,D){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return R(M,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function R(M,D){for(var G=0;G<D.length;G++){var F=D[G];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(M,F.key,F)}}return function(M,D,G){return D&&R(M.prototype,D),G&&R(M,G),M}}(),l=i(2),u=b(l),f=i(0),v=b(f),_=i(5),g=b(_),h=i(10),w=b(h),E=i(9),S=b(E);function b(R){return R&&R.__esModule?R:{default:R}}function p(R,M,D){return M in R?Object.defineProperty(R,M,{value:D,enumerable:!0,configurable:!0,writable:!0}):R[M]=D,R}function d(R,M){if(!(R instanceof M))throw new TypeError("Cannot call a class as a function")}function m(R,M){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:R}function y(R,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);R.prototype=Object.create(M&&M.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(R,M):R.__proto__=M)}var x=(0,w.default)("quill:toolbar"),P=function(R){y(M,R);function M(D,G){d(this,M);var F=m(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,D,G));if(Array.isArray(F.options.container)){var K=document.createElement("div");N(K,F.options.container),D.container.parentNode.insertBefore(K,D.container),F.container=K}else typeof F.options.container=="string"?F.container=document.querySelector(F.options.container):F.container=F.options.container;if(!(F.container instanceof HTMLElement)){var B;return B=x.error("Container required for toolbar",F.options),m(F,B)}return F.container.classList.add("ql-toolbar"),F.controls=[],F.handlers={},Object.keys(F.options.handlers).forEach(function($){F.addHandler($,F.options.handlers[$])}),[].forEach.call(F.container.querySelectorAll("button, select"),function($){F.attach($)}),F.quill.on(g.default.events.EDITOR_CHANGE,function($,W){$===g.default.events.SELECTION_CHANGE&&F.update(W)}),F.quill.on(g.default.events.SCROLL_OPTIMIZE,function(){var $=F.quill.selection.getRange(),W=a($,1),C=W[0];F.update(C)}),F}return o(M,[{key:"addHandler",value:function(G,F){this.handlers[G]=F}},{key:"attach",value:function(G){var F=this,K=[].find.call(G.classList,function($){return $.indexOf("ql-")===0});if(K){if(K=K.slice(3),G.tagName==="BUTTON"&&G.setAttribute("type","button"),this.handlers[K]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[K]==null){x.warn("ignoring attaching to disabled format",K,G);return}if(v.default.query(K)==null){x.warn("ignoring attaching to nonexistent format",K,G);return}}var B=G.tagName==="SELECT"?"change":"click";G.addEventListener(B,function($){var W=void 0;if(G.tagName==="SELECT"){if(G.selectedIndex<0)return;var C=G.options[G.selectedIndex];C.hasAttribute("selected")?W=!1:W=C.value||!1}else G.classList.contains("ql-active")?W=!1:W=G.value||!G.hasAttribute("value"),$.preventDefault();F.quill.focus();var A=F.quill.selection.getRange(),j=a(A,1),z=j[0];if(F.handlers[K]!=null)F.handlers[K].call(F,W);else if(v.default.query(K).prototype instanceof v.default.Embed){if(W=prompt("Enter "+K),!W)return;F.quill.updateContents(new u.default().retain(z.index).delete(z.length).insert(p({},K,W)),g.default.sources.USER)}else F.quill.format(K,W,g.default.sources.USER);F.update(z)}),this.controls.push([K,G])}}},{key:"update",value:function(G){var F=G==null?{}:this.quill.getFormat(G);this.controls.forEach(function(K){var B=a(K,2),$=B[0],W=B[1];if(W.tagName==="SELECT"){var C=void 0;if(G==null)C=null;else if(F[$]==null)C=W.querySelector("option[selected]");else if(!Array.isArray(F[$])){var A=F[$];typeof A=="string"&&(A=A.replace(/\"/g,'\\"')),C=W.querySelector('option[value="'+A+'"]')}C==null?(W.value="",W.selectedIndex=-1):C.selected=!0}else if(G==null)W.classList.remove("ql-active");else if(W.hasAttribute("value")){var j=F[$]===W.getAttribute("value")||F[$]!=null&&F[$].toString()===W.getAttribute("value")||F[$]==null&&!W.getAttribute("value");W.classList.toggle("ql-active",j)}else W.classList.toggle("ql-active",F[$]!=null)})}}]),M}(S.default);P.DEFAULTS={};function O(R,M,D){var G=document.createElement("button");G.setAttribute("type","button"),G.classList.add("ql-"+M),D!=null&&(G.value=D),R.appendChild(G)}function N(R,M){Array.isArray(M[0])||(M=[M]),M.forEach(function(D){var G=document.createElement("span");G.classList.add("ql-formats"),D.forEach(function(F){if(typeof F=="string")O(G,F);else{var K=Object.keys(F)[0],B=F[K];Array.isArray(B)?T(G,K,B):O(G,K,B)}}),R.appendChild(G)})}function T(R,M,D){var G=document.createElement("select");G.classList.add("ql-"+M),D.forEach(function(F){var K=document.createElement("option");F!==!1?K.setAttribute("value",F):K.setAttribute("selected","selected"),G.appendChild(K)}),R.appendChild(G)}P.DEFAULTS={container:null,handlers:{clean:function(){var M=this,D=this.quill.getSelection();if(D!=null)if(D.length==0){var G=this.quill.getFormat();Object.keys(G).forEach(function(F){v.default.query(F,v.default.Scope.INLINE)!=null&&M.quill.format(F,!1)})}else this.quill.removeFormat(D,g.default.sources.USER)},direction:function(M){var D=this.quill.getFormat().align;M==="rtl"&&D==null?this.quill.format("align","right",g.default.sources.USER):!M&&D==="right"&&this.quill.format("align",!1,g.default.sources.USER),this.quill.format("direction",M,g.default.sources.USER)},indent:function(M){var D=this.quill.getSelection(),G=this.quill.getFormat(D),F=parseInt(G.indent||0);if(M==="+1"||M==="-1"){var K=M==="+1"?1:-1;G.direction==="rtl"&&(K*=-1),this.quill.format("indent",F+K,g.default.sources.USER)}},link:function(M){M===!0&&(M=prompt("Enter link URL:")),this.quill.format("link",M,g.default.sources.USER)},list:function(M){var D=this.quill.getSelection(),G=this.quill.getFormat(D);M==="check"?G.list==="checked"||G.list==="unchecked"?this.quill.format("list",!1,g.default.sources.USER):this.quill.format("list","unchecked",g.default.sources.USER):this.quill.format("list",M,g.default.sources.USER)}}},n.default=P,n.addControls=N},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 b=0;b<S.length;b++){var p=S[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,p.key,p)}}return function(E,S,b){return S&&w(E.prototype,S),b&&w(E,b),E}}(),o=function w(E,S,b){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,b)}else{if("value"in p)return p.value;var m=p.get;return m===void 0?void 0:m.call(b)}},l=i(28),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function v(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function _(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 g(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){g(E,w);function E(S,b){v(this,E);var p=_(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,S));return p.label.innerHTML=b,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(b){var p=o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"buildItem",this).call(this,b);return p.style.backgroundColor=b.getAttribute("value")||"",p}},{key:"selectItem",value:function(b,p){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"selectItem",this).call(this,b,p);var d=this.label.querySelector(".ql-color-label"),m=b&&b.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=m:d.style.fill=m)}}]),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 b=0;b<S.length;b++){var p=S[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,p.key,p)}}return function(E,S,b){return S&&w(E.prototype,S),b&&w(E,b),E}}(),o=function w(E,S,b){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,b)}else{if("value"in p)return p.value;var m=p.get;return m===void 0?void 0:m.call(b)}},l=i(28),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function v(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function _(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 g(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){g(E,w);function E(S,b){v(this,E);var p=_(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=b[d.getAttribute("data-value")||""]}),p.defaultItem=p.container.querySelector(".ql-selected"),p.selectItem(p.defaultItem),p}return a(E,[{key:"selectItem",value:function(b,p){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"selectItem",this).call(this,b,p),b=b||this.defaultItem,this.label.innerHTML=b.innerHTML}}]),E}(u.default);n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,v){for(var _=0;_<v.length;_++){var g=v[_];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(f,g.key,g)}}return function(f,v,_){return v&&u(f.prototype,v),_&&u(f,_),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,v){var _=this;o(this,u),this.quill=f,this.boundsContainer=v||document.body,this.root=f.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){_.root.style.marginTop=-1*_.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(v){var _=v.left+v.width/2-this.root.offsetWidth/2,g=v.bottom+this.quill.root.scrollTop;this.root.style.left=_+"px",this.root.style.top=g+"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=_+E+"px"),w.left<h.left&&(E=h.left-w.left,this.root.style.left=_+E+"px"),w.bottom>h.bottom){var S=w.bottom-w.top,b=v.bottom-v.top+S;this.root.style.top=g-b+"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(R,M){var D=[],G=!0,F=!1,K=void 0;try{for(var B=R[Symbol.iterator](),$;!(G=($=B.next()).done)&&(D.push($.value),!(M&&D.length===M));G=!0);}catch(W){F=!0,K=W}finally{try{!G&&B.return&&B.return()}finally{if(F)throw K}}return D}return function(R,M){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return T(R,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function T(R,M,D){R===null&&(R=Function.prototype);var G=Object.getOwnPropertyDescriptor(R,M);if(G===void 0){var F=Object.getPrototypeOf(R);return F===null?void 0:T(F,M,D)}else{if("value"in G)return G.value;var K=G.get;return K===void 0?void 0:K.call(D)}},l=function(){function T(R,M){for(var D=0;D<M.length;D++){var G=M[D];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(R,G.key,G)}}return function(R,M,D){return M&&T(R.prototype,M),D&&T(R,D),R}}(),u=i(3),f=d(u),v=i(8),_=d(v),g=i(43),h=d(g),w=i(27),E=d(w),S=i(15),b=i(41),p=d(b);function d(T){return T&&T.__esModule?T:{default:T}}function m(T,R){if(!(T instanceof R))throw new TypeError("Cannot call a class as a function")}function y(T,R){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:T}function x(T,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);T.prototype=Object.create(R&&R.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(T,R):T.__proto__=R)}var P=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],O=function(T){x(R,T);function R(M,D){m(this,R),D.modules.toolbar!=null&&D.modules.toolbar.container==null&&(D.modules.toolbar.container=P);var G=y(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,M,D));return G.quill.container.classList.add("ql-snow"),G}return l(R,[{key:"extendToolbar",value:function(D){D.container.classList.add("ql-snow"),this.buildButtons([].slice.call(D.container.querySelectorAll("button")),p.default),this.buildPickers([].slice.call(D.container.querySelectorAll("select")),p.default),this.tooltip=new N(this.quill,this.options.bounds),D.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(G,F){D.handlers.link.call(D,!F.format.link)})}}]),R}(h.default);O.DEFAULTS=(0,f.default)(!0,{},h.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(R){if(R){var M=this.quill.getSelection();if(M==null||M.length==0)return;var D=this.quill.getText(M);/^\S+@\S+\.\S+$/.test(D)&&D.indexOf("mailto:")!==0&&(D="mailto:"+D);var G=this.quill.theme.tooltip;G.edit("link",D)}else this.quill.format("link",!1)}}}}});var N=function(T){x(R,T);function R(M,D){m(this,R);var G=y(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,M,D));return G.preview=G.root.querySelector("a.ql-preview"),G}return l(R,[{key:"listen",value:function(){var D=this;o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(G){D.root.classList.contains("ql-editing")?D.save():D.edit("link",D.preview.textContent),G.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(G){if(D.linkRange!=null){var F=D.linkRange;D.restoreFocus(),D.quill.formatText(F,"link",!1,_.default.sources.USER),delete D.linkRange}G.preventDefault(),D.hide()}),this.quill.on(_.default.events.SELECTION_CHANGE,function(G,F,K){if(G!=null){if(G.length===0&&K===_.default.sources.USER){var B=D.quill.scroll.descendant(E.default,G.index),$=a(B,2),W=$[0],C=$[1];if(W!=null){D.linkRange=new S.Range(G.index-C,W.length());var A=E.default.formats(W.domNode);D.preview.textContent=A,D.preview.setAttribute("href",A),D.show(),D.position(D.quill.getBounds(D.linkRange));return}}else delete D.linkRange;D.hide()}})}},{key:"show",value:function(){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),R}(g.BaseTooltip);N.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),v=i(65),_=te(v),g=i(66),h=te(g),w=i(67),E=te(w),S=i(37),b=i(26),p=i(39),d=i(40),m=i(56),y=te(m),x=i(68),P=te(x),O=i(27),N=te(O),T=i(69),R=te(T),M=i(70),D=te(M),G=i(71),F=te(G),K=i(72),B=te(K),$=i(73),W=te($),C=i(13),A=te(C),j=i(74),z=te(j),H=i(75),Y=te(H),q=i(57),U=te(q),X=i(41),Q=te(X),Z=i(28),re=te(Z),ee=i(59),le=te(ee),ce=i(60),_e=te(ce),Le=i(61),Oe=te(Le),ae=i(108),de=te(ae),ye=i(62),we=te(ye);function te(ue){return ue&&ue.__esModule?ue:{default:ue}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":S.BackgroundClass,"attributors/class/color":b.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":b.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":b.ColorStyle,"formats/font":p.FontClass,"formats/size":d.SizeClass,"formats/blockquote":_.default,"formats/code-block":A.default,"formats/header":h.default,"formats/list":E.default,"formats/bold":y.default,"formats/code":C.Code,"formats/italic":P.default,"formats/link":N.default,"formats/script":R.default,"formats/strike":D.default,"formats/underline":F.default,"formats/image":B.default,"formats/video":W.default,"formats/list/item":w.ListItem,"modules/formula":z.default,"modules/syntax":Y.default,"modules/toolbar":U.default,"themes/bubble":de.default,"themes/snow":we.default,"ui/icons":Q.default,"ui/picker":re.default,"ui/icon-picker":_e.default,"ui/color-picker":le.default,"ui/tooltip":Oe.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,b){for(var p=0;p<b.length;p++){var d=b[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(S,d.key,d)}}return function(S,b,p){return b&&E(S.prototype,b),p&&E(S,p),S}}(),o=function E(S,b,p){S===null&&(S=Function.prototype);var d=Object.getOwnPropertyDescriptor(S,b);if(d===void 0){var m=Object.getPrototypeOf(S);return m===null?void 0:E(m,b,p)}else{if("value"in d)return d.value;var y=d.get;return y===void 0?void 0:y.call(p)}},l=i(0),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,S){if(!(E instanceof S))throw new TypeError("Cannot call a class as a function")}function _(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 g(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){g(S,E);function S(){return v(this,S),_(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,[{key:"add",value:function(p,d){if(d==="+1"||d==="-1"){var m=this.value(p)||0;d=d==="+1"?m+1:m-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(g){return g&&g.__esModule?g:{default:g}}function u(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function f(g,h){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:g}function v(g,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);g.prototype=Object.create(h&&h.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(g,h):g.__proto__=h)}var _=function(g){v(h,g);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);_.blotName="blockquote",_.tagName="blockquote",n.default=_},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 b=E[S];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(w,b.key,b)}}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 v(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 _(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 g=function(h){_(w,h);function w(){return f(this,w),v(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);g.blotName="header",g.tagName=["H1","H2","H3","H4","H5","H6"],n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function m(y,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(y,O.key,O)}}return function(y,x,P){return x&&m(y.prototype,x),P&&m(y,P),y}}(),o=function m(y,x,P){y===null&&(y=Function.prototype);var O=Object.getOwnPropertyDescriptor(y,x);if(O===void 0){var N=Object.getPrototypeOf(y);return N===null?void 0:m(N,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),v=h(f),_=i(25),g=h(_);function h(m){return m&&m.__esModule?m:{default:m}}function w(m,y,x){return y in m?Object.defineProperty(m,y,{value:x,enumerable:!0,configurable:!0,writable:!0}):m[y]=x,m}function E(m,y){if(!(m instanceof y))throw new TypeError("Cannot call a class as a function")}function S(m,y){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:m}function b(m,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);m.prototype=Object.create(y&&y.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(m,y):m.__proto__=y)}var p=function(m){b(y,m);function y(){return E(this,y),S(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"format",value:function(P,O){P===d.blotName&&!O?this.replaceWith(u.default.create(this.statics.scope)):o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,P,O)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(y.prototype.__proto__||Object.getPrototypeOf(y.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(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"replaceWith",this).call(this,P,O))}}],[{key:"formats",value:function(P){return P.tagName===this.tagName?void 0:o(y.__proto__||Object.getPrototypeOf(y),"formats",this).call(this,P)}}]),y}(v.default);p.blotName="list-item",p.tagName="LI";var d=function(m){b(y,m),a(y,null,[{key:"create",value:function(P){var O=P==="ordered"?"OL":"UL",N=o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,O);return(P==="checked"||P==="unchecked")&&N.setAttribute("data-checked",P==="checked"),N}},{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 y(x){E(this,y);var P=S(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,x)),O=function(T){if(T.target.parentNode===x){var R=P.statics.formats(x),M=u.default.find(T.target);R==="checked"?M.format("list","unchecked"):R==="unchecked"&&M.format("list","checked")}};return x.addEventListener("touchstart",O),x.addEventListener("mousedown",O),P}return a(y,[{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(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"insertBefore",this).call(this,P,O);else{var N=O==null?this.length():O.offset(this),T=this.split(N);T.parent.insertBefore(P,T)}}},{key:"optimize",value:function(P){o(y.prototype.__proto__||Object.getPrototypeOf(y.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(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"replace",this).call(this,P)}}]),y}(g.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(g){return g&&g.__esModule?g:{default:g}}function u(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function f(g,h){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:g}function v(g,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);g.prototype=Object.create(h&&h.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(g,h):g.__proto__=h)}var _=function(g){v(h,g);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);_.blotName="italic",_.tagName=["EM","I"],n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function w(E,S){for(var b=0;b<S.length;b++){var p=S[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,p.key,p)}}return function(E,S,b){return S&&w(E.prototype,S),b&&w(E,b),E}}(),o=function w(E,S,b){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,b)}else{if("value"in p)return p.value;var m=p.get;return m===void 0?void 0:m.call(b)}},l=i(6),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function v(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function _(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 g(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){g(E,w);function E(){return v(this,E),_(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,null,[{key:"create",value:function(b){return b==="super"?document.createElement("sup"):b==="sub"?document.createElement("sub"):o(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this,b)}},{key:"formats",value:function(b){if(b.tagName==="SUB")return"sub";if(b.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(g){return g&&g.__esModule?g:{default:g}}function u(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function f(g,h){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:g}function v(g,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);g.prototype=Object.create(h&&h.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(g,h):g.__proto__=h)}var _=function(g){v(h,g);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);_.blotName="strike",_.tagName="S",n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(g){return g&&g.__esModule?g:{default:g}}function u(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function f(g,h){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:g}function v(g,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);g.prototype=Object.create(h&&h.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(g,h):g.__proto__=h)}var _=function(g){v(h,g);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);_.blotName="underline",_.tagName="U",n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,p){for(var d=0;d<p.length;d++){var m=p[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,p,d){return p&&S(b.prototype,p),d&&S(b,d),b}}(),o=function S(b,p,d){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,p);if(m===void 0){var y=Object.getPrototypeOf(b);return y===null?void 0:S(y,p,d)}else{if("value"in m)return m.value;var x=m.get;return x===void 0?void 0:x.call(d)}},l=i(0),u=v(l),f=i(27);function v(S){return S&&S.__esModule?S:{default:S}}function _(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function g(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function h(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var w=["alt","height","width"],E=function(S){h(b,S);function b(){return _(this,b),g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"format",value:function(d,m){w.indexOf(d)>-1?m?this.domNode.setAttribute(d,m):this.domNode.removeAttribute(d):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,d,m)}}],[{key:"create",value:function(d){var m=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,d);return typeof d=="string"&&m.setAttribute("src",this.sanitize(d)),m}},{key:"formats",value:function(d){return w.reduce(function(m,y){return d.hasAttribute(y)&&(m[y]=d.getAttribute(y)),m},{})}},{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")}}]),b}(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(b,p){for(var d=0;d<p.length;d++){var m=p[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,p,d){return p&&S(b.prototype,p),d&&S(b,d),b}}(),o=function S(b,p,d){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,p);if(m===void 0){var y=Object.getPrototypeOf(b);return y===null?void 0:S(y,p,d)}else{if("value"in m)return m.value;var x=m.get;return x===void 0?void 0:x.call(d)}},l=i(4),u=i(27),f=v(u);function v(S){return S&&S.__esModule?S:{default:S}}function _(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function g(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function h(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var w=["height","width"],E=function(S){h(b,S);function b(){return _(this,b),g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"format",value:function(d,m){w.indexOf(d)>-1?m?this.domNode.setAttribute(d,m):this.domNode.removeAttribute(d):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,d,m)}}],[{key:"create",value:function(d){var m=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,d);return m.setAttribute("frameborder","0"),m.setAttribute("allowfullscreen",!0),m.setAttribute("src",this.sanitize(d)),m}},{key:"formats",value:function(d){return w.reduce(function(m,y){return d.hasAttribute(y)&&(m[y]=d.getAttribute(y)),m},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),b}(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(m,y){for(var x=0;x<y.length;x++){var P=y[x];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(m,P.key,P)}}return function(m,y,x){return y&&d(m.prototype,y),x&&d(m,x),m}}(),o=function d(m,y,x){m===null&&(m=Function.prototype);var P=Object.getOwnPropertyDescriptor(m,y);if(P===void 0){var O=Object.getPrototypeOf(m);return O===null?void 0:d(O,y,x)}else{if("value"in P)return P.value;var N=P.get;return N===void 0?void 0:N.call(x)}},l=i(35),u=h(l),f=i(5),v=h(f),_=i(9),g=h(_);function h(d){return d&&d.__esModule?d:{default:d}}function w(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function E(d,m){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:d}function S(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}var b=function(d){S(m,d);function m(){return w(this,m),E(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,null,[{key:"create",value:function(x){var P=o(m.__proto__||Object.getPrototypeOf(m),"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")}}]),m}(u.default);b.blotName="formula",b.className="ql-formula",b.tagName="SPAN";var p=function(d){S(m,d),a(m,null,[{key:"register",value:function(){v.default.register(b,!0)}}]);function m(){w(this,m);var y=E(this,(m.__proto__||Object.getPrototypeOf(m)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return y}return m}(g.default);n.FormulaBlot=b,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 N=0;N<O.length;N++){var T=O[N];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(P,T.key,T)}}return function(P,O,N){return O&&x(P.prototype,O),N&&x(P,N),P}}(),o=function x(P,O,N){P===null&&(P=Function.prototype);var T=Object.getOwnPropertyDescriptor(P,O);if(T===void 0){var R=Object.getPrototypeOf(P);return R===null?void 0:x(R,O,N)}else{if("value"in T)return T.value;var M=T.get;return M===void 0?void 0:M.call(N)}},l=i(0),u=E(l),f=i(5),v=E(f),_=i(9),g=E(_),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 b(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),b(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return a(P,[{key:"replaceWith",value:function(N){this.domNode.textContent=this.domNode.textContent,this.attach(),o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replaceWith",this).call(this,N)}},{key:"highlight",value:function(N){var T=this.domNode.textContent;this.cachedText!==T&&((T.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=N(T),this.domNode.normalize(),this.attach()),this.cachedText=T)}}]),P}(w.default);d.className="ql-syntax";var m=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),y=function(x){p(P,x),a(P,null,[{key:"register",value:function(){v.default.register(m,!0),v.default.register(d,!0)}}]);function P(O,N){S(this,P);var T=b(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,O,N));if(typeof T.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var R=null;return T.quill.on(v.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(R),R=setTimeout(function(){T.highlight(),R=null},T.options.interval)}),T.highlight(),T}return a(P,[{key:"highlight",value:function(){var N=this;if(!this.quill.selection.composing){this.quill.update(v.default.sources.USER);var T=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(R){R.highlight(N.options.highlight)}),this.quill.update(v.default.sources.SILENT),T!=null&&this.quill.setSelection(T,v.default.sources.SILENT)}}}]),P}(g.default);y.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=m,n.default=y},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,N,T){O===null&&(O=Function.prototype);var R=Object.getOwnPropertyDescriptor(O,N);if(R===void 0){var M=Object.getPrototypeOf(O);return M===null?void 0:P(M,N,T)}else{if("value"in R)return R.value;var D=R.get;return D===void 0?void 0:D.call(T)}},o=function(){function P(O,N){for(var T=0;T<N.length;T++){var R=N[T];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(O,R.key,R)}}return function(O,N,T){return N&&P(O.prototype,N),T&&P(O,T),O}}(),l=i(3),u=S(l),f=i(8),v=S(f),_=i(43),g=S(_),h=i(15),w=i(41),E=S(w);function S(P){return P&&P.__esModule?P:{default:P}}function b(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 m=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],y=function(P){d(O,P);function O(N,T){b(this,O),T.modules.toolbar!=null&&T.modules.toolbar.container==null&&(T.modules.toolbar.container=m);var R=p(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,N,T));return R.quill.container.classList.add("ql-bubble"),R}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}(g.default);y.DEFAULTS=(0,u.default)(!0,{},g.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(N,T){b(this,O);var R=p(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,N,T));return R.quill.on(v.default.events.EDITOR_CHANGE,function(M,D,G,F){if(M===v.default.events.SELECTION_CHANGE)if(D!=null&&D.length>0&&F===v.default.sources.USER){R.show(),R.root.style.left="0px",R.root.style.width="",R.root.style.width=R.root.offsetWidth+"px";var K=R.quill.getLines(D.index,D.length);if(K.length===1)R.position(R.quill.getBounds(D));else{var B=K[K.length-1],$=R.quill.getIndex(B),W=Math.min(B.length()-1,D.index+D.length-$),C=R.quill.getBounds(new h.Range($,W));R.position(C)}}else document.activeElement!==R.textbox&&R.quill.hasFocus()&&R.hide()}),R}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(v.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!T.root.classList.contains("ql-hidden")){var R=T.quill.getSelection();R!=null&&T.position(T.quill.getBounds(R))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(T){var R=a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"position",this).call(this,T),M=this.root.querySelector(".ql-tooltip-arrow");if(M.style.marginLeft="",R===0)return R;M.style.marginLeft=-1*R-M.offsetWidth/2+"px"}}]),O}(_.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=y},function(r,n,i){r.exports=i(63)}]).default})})(w8);var kM=w8.exports,S8={},E8={exports:{}},Ao={},Su={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Su.exports;var Xw;function AM(){return Xw||(Xw=1,function(t,e){(function(r){var n=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,a=typeof me=="object"&&me;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,l=2147483647,u=36,f=1,v=26,_=38,g=700,h=72,w=128,E="-",S=/^xn--/,b=/[^\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"},m=u-f,y=Math.floor,x=String.fromCharCode,P;function O(C){throw new RangeError(d[C])}function N(C,A){for(var j=C.length,z=[];j--;)z[j]=A(C[j]);return z}function T(C,A){var j=C.split("@"),z="";j.length>1&&(z=j[0]+"@",C=j[1]),C=C.replace(p,".");var H=C.split("."),Y=N(H,A).join(".");return z+Y}function R(C){for(var A=[],j=0,z=C.length,H,Y;j<z;)H=C.charCodeAt(j++),H>=55296&&H<=56319&&j<z?(Y=C.charCodeAt(j++),(Y&64512)==56320?A.push(((H&1023)<<10)+(Y&1023)+65536):(A.push(H),j--)):A.push(H);return A}function M(C){return N(C,function(A){var j="";return A>65535&&(A-=65536,j+=x(A>>>10&1023|55296),A=56320|A&1023),j+=x(A),j}).join("")}function D(C){return C-48<10?C-22:C-65<26?C-65:C-97<26?C-97:u}function G(C,A){return C+22+75*(C<26)-((A!=0)<<5)}function F(C,A,j){var z=0;for(C=j?y(C/g):C>>1,C+=y(C/A);C>m*v>>1;z+=u)C=y(C/m);return y(z+(m+1)*C/(C+_))}function K(C){var A=[],j=C.length,z,H=0,Y=w,q=h,U,X,Q,Z,re,ee,le,ce,_e;for(U=C.lastIndexOf(E),U<0&&(U=0),X=0;X<U;++X)C.charCodeAt(X)>=128&&O("not-basic"),A.push(C.charCodeAt(X));for(Q=U>0?U+1:0;Q<j;){for(Z=H,re=1,ee=u;Q>=j&&O("invalid-input"),le=D(C.charCodeAt(Q++)),(le>=u||le>y((l-H)/re))&&O("overflow"),H+=le*re,ce=ee<=q?f:ee>=q+v?v:ee-q,!(le<ce);ee+=u)_e=u-ce,re>y(l/_e)&&O("overflow"),re*=_e;z=A.length+1,q=F(H-Z,z,Z==0),y(H/z)>l-Y&&O("overflow"),Y+=y(H/z),H%=z,A.splice(H++,0,Y)}return M(A)}function B(C){var A,j,z,H,Y,q,U,X,Q,Z,re,ee=[],le,ce,_e,Le;for(C=R(C),le=C.length,A=w,j=0,Y=h,q=0;q<le;++q)re=C[q],re<128&&ee.push(x(re));for(z=H=ee.length,H&&ee.push(E);z<le;){for(U=l,q=0;q<le;++q)re=C[q],re>=A&&re<U&&(U=re);for(ce=z+1,U-A>y((l-j)/ce)&&O("overflow"),j+=(U-A)*ce,A=U,q=0;q<le;++q)if(re=C[q],re<A&&++j>l&&O("overflow"),re==A){for(X=j,Q=u;Z=Q<=Y?f:Q>=Y+v?v:Q-Y,!(X<Z);Q+=u)Le=X-Z,_e=u-Z,ee.push(x(G(Z+Le%_e,0))),X=y(Le/_e);ee.push(x(G(X,0))),Y=F(j,ce,z==H),j=0,++z}++j,++A}return ee.join("")}function $(C){return T(C,function(A){return S.test(A)?K(A.slice(4).toLowerCase()):A})}function W(C){return T(C,function(A){return b.test(A)?"xn--"+B(A):A})}if(o={version:"1.4.1",ucs2:{decode:R,encode:M},decode:K,encode:B,toASCII:W,toUnicode:$},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})(me)}(Su,Su.exports)),Su.exports}var Dv,Qw;function TM(){return Qw||(Qw=1,Dv=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}),Dv}var Fv,Zw;function CM(){if(Zw)return Fv;Zw=1;var t=typeof Symbol<"u"&&Symbol,e=TM();return Fv=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Fv}var zv,Jw;function RM(){if(Jw)return zv;Jw=1;var t={foo:{}},e=Object;return zv=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof e)},zv}var Bv,e3;function NM(){if(e3)return Bv;e3=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 v=[],_=0;_<u.length;_+=1)v[_]=u[_];for(var g=0;g<f.length;g+=1)v[g+u.length]=f[g];return v},a=function(u,f){for(var v=[],_=f||0,g=0;_<u.length;_+=1,g+=1)v[g]=u[_];return v},o=function(l,u){for(var f="",v=0;v<l.length;v+=1)f+=l[v],v+1<l.length&&(f+=u);return f};return Bv=function(u){var f=this;if(typeof f!="function"||e.apply(f)!==n)throw new TypeError(t+f);for(var v=a(arguments,1),_,g=function(){if(this instanceof _){var b=f.apply(this,i(v,arguments));return Object(b)===b?b:this}return f.apply(u,i(v,arguments))},h=r(0,f.length-v.length),w=[],E=0;E<h;E++)w[E]="$"+E;if(_=Function("binder","return function ("+o(w,",")+"){ return binder.apply(this,arguments); }")(g),f.prototype){var S=function(){};S.prototype=f.prototype,_.prototype=new S,S.prototype=null}return _},Bv}var Uv,t3;function T1(){if(t3)return Uv;t3=1;var t=NM();return Uv=Function.prototype.bind||t,Uv}var Gv,r3;function MM(){if(r3)return Gv;r3=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=T1();return Gv=r.call(t,e),Gv}var Hv,n3;function pl(){if(n3)return Hv;n3=1;var t,e=SyntaxError,r=Function,n=TypeError,i=function(M){try{return r('"use strict"; return ('+M+").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=CM()(),f=RM()(),v=Object.getPrototypeOf||(f?function(M){return M.__proto__}:null),_={},g=typeof Uint8Array>"u"||!v?t:v(Uint8Array),h={"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":u&&v?v([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":_,"%AsyncGenerator%":_,"%AsyncGeneratorFunction%":_,"%AsyncIteratorPrototype%":_,"%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%":_,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u&&v?v(v([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!u||!v?t:v(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||!v?t:v(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":u&&v?v(""[Symbol.iterator]()):t,"%Symbol%":u?Symbol:t,"%SyntaxError%":e,"%ThrowTypeError%":l,"%TypedArray%":g,"%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(v)try{null.error}catch(M){var w=v(v(M));h["%Error.prototype%"]=w}var E=function M(D){var G;if(D==="%AsyncFunction%")G=i("async function () {}");else if(D==="%GeneratorFunction%")G=i("function* () {}");else if(D==="%AsyncGeneratorFunction%")G=i("async function* () {}");else if(D==="%AsyncGenerator%"){var F=M("%AsyncGeneratorFunction%");F&&(G=F.prototype)}else if(D==="%AsyncIteratorPrototype%"){var K=M("%AsyncGenerator%");K&&v&&(G=v(K.prototype))}return h[D]=G,G},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"]},b=T1(),p=MM(),d=b.call(Function.call,Array.prototype.concat),m=b.call(Function.apply,Array.prototype.splice),y=b.call(Function.call,String.prototype.replace),x=b.call(Function.call,String.prototype.slice),P=b.call(Function.call,RegExp.prototype.exec),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,T=function(D){var G=x(D,0,1),F=x(D,-1);if(G==="%"&&F!=="%")throw new e("invalid intrinsic syntax, expected closing `%`");if(F==="%"&&G!=="%")throw new e("invalid intrinsic syntax, expected opening `%`");var K=[];return y(D,O,function(B,$,W,C){K[K.length]=W?y(C,N,"$1"):$||B}),K},R=function(D,G){var F=D,K;if(p(S,F)&&(K=S[F],F="%"+K[0]+"%"),p(h,F)){var B=h[F];if(B===_&&(B=E(F)),typeof B>"u"&&!G)throw new n("intrinsic "+D+" exists, but is not available. Please file an issue!");return{alias:K,name:F,value:B}}throw new e("intrinsic "+D+" does not exist!")};return Hv=function(D,G){if(typeof D!="string"||D.length===0)throw new n("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof G!="boolean")throw new n('"allowMissing" argument must be a boolean');if(P(/^%?[^%]*%?$/,D)===null)throw new e("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var F=T(D),K=F.length>0?F[0]:"",B=R("%"+K+"%",G),$=B.name,W=B.value,C=!1,A=B.alias;A&&(K=A[0],m(F,d([0,1],A)));for(var j=1,z=!0;j<F.length;j+=1){var H=F[j],Y=x(H,0,1),q=x(H,-1);if((Y==='"'||Y==="'"||Y==="`"||q==='"'||q==="'"||q==="`")&&Y!==q)throw new e("property names with quotes must have matching quotes");if((H==="constructor"||!z)&&(C=!0),K+="."+H,$="%"+K+"%",p(h,$))W=h[$];else if(W!=null){if(!(H in W)){if(!G)throw new n("base intrinsic for "+D+" exists, but the property is not available.");return}if(a&&j+1>=F.length){var U=a(W,H);z=!!U,z&&"get"in U&&!("originalValue"in U.get)?W=U.get:W=W[H]}else z=p(W,H),W=W[H];z&&!C&&(h[$]=W)}}return W},Hv}var Vv={exports:{}},qv,i3;function O8(){if(i3)return qv;i3=1;var t=pl(),e=t("%Object.defineProperty%",!0),r=function(){if(e)try{return e({},"a",{value:1}),!0}catch{return!1}return!1};return r.hasArrayLengthDefineBug=function(){if(!r())return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},qv=r,qv}var $v,a3;function x8(){if(a3)return $v;a3=1;var t=pl(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return $v=e,$v}var Wv,o3;function LM(){if(o3)return Wv;o3=1;var t=O8()(),e=pl(),r=t&&e("%Object.defineProperty%",!0);if(r)try{r({},"a",{value:1})}catch{r=!1}var n=e("%SyntaxError%"),i=e("%TypeError%"),a=x8();return Wv=function(l,u,f){if(!l||typeof l!="object"&&typeof l!="function")throw new i("`obj` must be an object or a function`");if(typeof u!="string"&&typeof u!="symbol")throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new i("`loose`, if provided, must be a boolean");var v=arguments.length>3?arguments[3]:null,_=arguments.length>4?arguments[4]:null,g=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,w=!!a&&a(l,u);if(r)r(l,u,{configurable:g===null&&w?w.configurable:!g,enumerable:v===null&&w?w.enumerable:!v,value:f,writable:_===null&&w?w.writable:!_});else if(h||!v&&!_&&!g)l[u]=f;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Wv}var Yv,l3;function IM(){if(l3)return Yv;l3=1;var t=pl(),e=LM(),r=O8()(),n=x8(),i=t("%TypeError%"),a=t("%Math.floor%");return Yv=function(l,u){if(typeof l!="function")throw new i("`fn` is not a function");if(typeof u!="number"||u<0||u>4294967295||a(u)!==u)throw new i("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],v=!0,_=!0;if("length"in l&&n){var g=n(l,"length");g&&!g.configurable&&(v=!1),g&&!g.writable&&(_=!1)}return(v||_||!f)&&(r?e(l,"length",u,!0,!0):e(l,"length",u)),l},Yv}var s3;function jM(){return s3||(s3=1,function(t){var e=T1(),r=pl(),n=IM(),i=r("%TypeError%"),a=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),l=r("%Reflect.apply%",!0)||e.call(o,a),u=r("%Object.defineProperty%",!0),f=r("%Math.max%");if(u)try{u({},"a",{value:1})}catch{u=null}t.exports=function(g){if(typeof g!="function")throw new i("a function is required");var h=l(e,o,arguments);return n(h,1+f(0,g.length-(arguments.length-1)),!0)};var v=function(){return l(e,a,arguments)};u?u(t.exports,"apply",{value:v}):t.exports.apply=v}(Vv)),Vv.exports}var Kv,u3;function DM(){if(u3)return Kv;u3=1;var t=pl(),e=jM(),r=e(t("String.prototype.indexOf"));return Kv=function(i,a){var o=t(i,!!a);return typeof o=="function"&&r(i,".prototype.")>-1?e(o):o},Kv}const FM={},zM=Object.freeze(Object.defineProperty({__proto__:null,default:FM},Symbol.toStringTag,{value:"Module"})),BM=Za(zM);var Xv,c3;function UM(){if(c3)return Xv;c3=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,v=typeof WeakSet=="function"&&WeakSet.prototype,_=v?WeakSet.prototype.has:null,g=typeof WeakRef=="function"&&WeakRef.prototype,h=g?WeakRef.prototype.deref:null,w=Boolean.prototype.valueOf,E=Object.prototype.toString,S=Function.prototype.toString,b=String.prototype.match,p=String.prototype.slice,d=String.prototype.replace,m=String.prototype.toUpperCase,y=String.prototype.toLowerCase,x=RegExp.prototype.test,P=Array.prototype.concat,O=Array.prototype.join,N=Array.prototype.slice,T=Math.floor,R=typeof BigInt=="function"?BigInt.prototype.valueOf:null,M=Object.getOwnPropertySymbols,D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,G=typeof Symbol=="function"&&typeof Symbol.iterator=="object",F=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===G||"symbol")?Symbol.toStringTag:null,K=Object.prototype.propertyIsEnumerable,B=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(se){return se.__proto__}:null);function $(se,ne){if(se===1/0||se===-1/0||se!==se||se&&se>-1e3&&se<1e3||x.call(/e/,ne))return ne;var Ae=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof se=="number"){var Me=se<0?-T(-se):T(se);if(Me!==se){var ve=String(Me),Re=p.call(ne,ve.length+1);return d.call(ve,Ae,"$&_")+"."+d.call(d.call(Re,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(ne,Ae,"$&_")}var W=BM,C=W.custom,A=re(C)?C:null;Xv=function se(ne,Ae,Me,ve){var Re=Ae||{};if(ce(Re,"quoteStyle")&&Re.quoteStyle!=="single"&&Re.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ce(Re,"maxStringLength")&&(typeof Re.maxStringLength=="number"?Re.maxStringLength<0&&Re.maxStringLength!==1/0:Re.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Se=ce(Re,"customInspect")?Re.customInspect:!0;if(typeof Se!="boolean"&&Se!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ce(Re,"indent")&&Re.indent!==null&&Re.indent!==" "&&!(parseInt(Re.indent,10)===Re.indent&&Re.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ce(Re,"numericSeparator")&&typeof Re.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var $e=Re.numericSeparator;if(typeof ne>"u")return"undefined";if(ne===null)return"null";if(typeof ne=="boolean")return ne?"true":"false";if(typeof ne=="string")return fe(ne,Re);if(typeof ne=="number"){if(ne===0)return 1/0/ne>0?"0":"-0";var xt=String(ne);return $e?$(ne,xt):xt}if(typeof ne=="bigint"){var Ee=String(ne)+"n";return $e?$(ne,Ee):Ee}var qe=typeof Re.depth>"u"?5:Re.depth;if(typeof Me>"u"&&(Me=0),Me>=qe&&qe>0&&typeof ne=="object")return H(ne)?"[Array]":"[Object]";var Ze=Be(Re,Me);if(typeof ve>"u")ve=[];else if(Oe(ve,ne)>=0)return"[Circular]";function pt(va,vl,jp){if(vl&&(ve=N.call(ve),ve.push(vl)),jp){var Ic={depth:Re.depth};return ce(Re,"quoteStyle")&&(Ic.quoteStyle=Re.quoteStyle),se(va,Ic,Me+1,ve)}return se(va,Re,Me+1,ve)}if(typeof ne=="function"&&!q(ne)){var Ne=Le(ne),Qe=Xe(ne,pt);return"[Function"+(Ne?": "+Ne:" (anonymous)")+"]"+(Qe.length>0?" { "+O.call(Qe,", ")+" }":"")}if(re(ne)){var ht=G?d.call(String(ne),/^(Symbol\(.*\))_[^)]*$/,"$1"):D.call(ne);return typeof ne=="object"&&!G?Te(ht):ht}if(ue(ne)){for(var wt="<"+y.call(String(ne.nodeName)),Ft=ne.attributes||[],zr=0;zr<Ft.length;zr++)wt+=" "+Ft[zr].name+"="+j(z(Ft[zr].value),"double",Re);return wt+=">",ne.childNodes&&ne.childNodes.length&&(wt+="..."),wt+="</"+y.call(String(ne.nodeName))+">",wt}if(H(ne)){if(ne.length===0)return"[]";var Br=Xe(ne,pt);return Ze&&!Ce(Br)?"["+et(Br,Ze)+"]":"[ "+O.call(Br,", ")+" ]"}if(U(ne)){var ir=Xe(ne,pt);return!("cause"in Error.prototype)&&"cause"in ne&&!K.call(ne,"cause")?"{ ["+String(ne)+"] "+O.call(P.call("[cause]: "+pt(ne.cause),ir),", ")+" }":ir.length===0?"["+String(ne)+"]":"{ ["+String(ne)+"] "+O.call(ir,", ")+" }"}if(typeof ne=="object"&&Se){if(A&&typeof ne[A]=="function"&&W)return W(ne,{depth:qe-Me});if(Se!=="symbol"&&typeof ne.inspect=="function")return ne.inspect()}if(ae(ne)){var fn=[];return n&&n.call(ne,function(va,vl){fn.push(pt(vl,ne,!0)+" => "+pt(va,ne))}),Ke("Map",r.call(ne),fn,Ze)}if(we(ne)){var Gn=[];return l&&l.call(ne,function(va){Gn.push(pt(va,ne))}),Ke("Set",o.call(ne),Gn,Ze)}if(de(ne))return Ye("WeakMap");if(te(ne))return Ye("WeakSet");if(ye(ne))return Ye("WeakRef");if(Q(ne))return Te(pt(Number(ne)));if(ee(ne))return Te(pt(R.call(ne)));if(Z(ne))return Te(w.call(ne));if(X(ne))return Te(pt(String(ne)));if(typeof window<"u"&&ne===window)return"{ [object Window] }";if(ne===me)return"{ [object globalThis] }";if(!Y(ne)&&!q(ne)){var fi=Xe(ne,pt),kr=B?B(ne)===Object.prototype:ne instanceof Object||ne.constructor===Object,po=ne instanceof Object?"":"null prototype",ga=!kr&&F&&Object(ne)===ne&&F in ne?p.call(_e(ne),8,-1):po?"Object":"",Us=kr||typeof ne.constructor!="function"?"":ne.constructor.name?ne.constructor.name+" ":"",Ii=Us+(ga||po?"["+O.call(P.call([],ga||[],po||[]),": ")+"] ":"");return fi.length===0?Ii+"{}":Ze?Ii+"{"+et(fi,Ze)+"}":Ii+"{ "+O.call(fi,", ")+" }"}return String(ne)};function j(se,ne,Ae){var Me=(Ae.quoteStyle||ne)==="double"?'"':"'";return Me+se+Me}function z(se){return d.call(String(se),/"/g,""")}function H(se){return _e(se)==="[object Array]"&&(!F||!(typeof se=="object"&&F in se))}function Y(se){return _e(se)==="[object Date]"&&(!F||!(typeof se=="object"&&F in se))}function q(se){return _e(se)==="[object RegExp]"&&(!F||!(typeof se=="object"&&F in se))}function U(se){return _e(se)==="[object Error]"&&(!F||!(typeof se=="object"&&F in se))}function X(se){return _e(se)==="[object String]"&&(!F||!(typeof se=="object"&&F in se))}function Q(se){return _e(se)==="[object Number]"&&(!F||!(typeof se=="object"&&F in se))}function Z(se){return _e(se)==="[object Boolean]"&&(!F||!(typeof se=="object"&&F in se))}function re(se){if(G)return se&&typeof se=="object"&&se instanceof Symbol;if(typeof se=="symbol")return!0;if(!se||typeof se!="object"||!D)return!1;try{return D.call(se),!0}catch{}return!1}function ee(se){if(!se||typeof se!="object"||!R)return!1;try{return R.call(se),!0}catch{}return!1}var le=Object.prototype.hasOwnProperty||function(se){return se in this};function ce(se,ne){return le.call(se,ne)}function _e(se){return E.call(se)}function Le(se){if(se.name)return se.name;var ne=b.call(S.call(se),/^function\s*([\w$]+)/);return ne?ne[1]:null}function Oe(se,ne){if(se.indexOf)return se.indexOf(ne);for(var Ae=0,Me=se.length;Ae<Me;Ae++)if(se[Ae]===ne)return Ae;return-1}function ae(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 de(se){if(!f||!se||typeof se!="object")return!1;try{f.call(se,f);try{_.call(se,_)}catch{return!0}return se instanceof WeakMap}catch{}return!1}function ye(se){if(!h||!se||typeof se!="object")return!1;try{return h.call(se),!0}catch{}return!1}function we(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(!_||!se||typeof se!="object")return!1;try{_.call(se,_);try{f.call(se,f)}catch{return!0}return se instanceof WeakSet}catch{}return!1}function ue(se){return!se||typeof se!="object"?!1:typeof HTMLElement<"u"&&se instanceof HTMLElement?!0:typeof se.nodeName=="string"&&typeof se.getAttribute=="function"}function fe(se,ne){if(se.length>ne.maxStringLength){var Ae=se.length-ne.maxStringLength,Me="... "+Ae+" more character"+(Ae>1?"s":"");return fe(p.call(se,0,ne.maxStringLength),ne)+Me}var ve=d.call(d.call(se,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,be);return j(ve,"single",ne)}function be(se){var ne=se.charCodeAt(0),Ae={8:"b",9:"t",10:"n",12:"f",13:"r"}[ne];return Ae?"\\"+Ae:"\\x"+(ne<16?"0":"")+m.call(ne.toString(16))}function Te(se){return"Object("+se+")"}function Ye(se){return se+" { ? }"}function Ke(se,ne,Ae,Me){var ve=Me?et(Ae,Me):O.call(Ae,", ");return se+" ("+ne+") {"+ve+"}"}function Ce(se){for(var ne=0;ne<se.length;ne++)if(Oe(se[ne],`
|
|
139
|
+
`)>=0)return!1;return!0}function Be(se,ne){var Ae;if(se.indent===" ")Ae=" ";else if(typeof se.indent=="number"&&se.indent>0)Ae=O.call(Array(se.indent+1)," ");else return null;return{base:Ae,prev:O.call(Array(ne+1),Ae)}}function et(se,ne){if(se.length===0)return"";var Ae=`
|
|
140
|
+
`+ne.prev+ne.base;return Ae+O.call(se,","+Ae)+`
|
|
141
|
+
`+ne.prev}function Xe(se,ne){var Ae=H(se),Me=[];if(Ae){Me.length=se.length;for(var ve=0;ve<se.length;ve++)Me[ve]=ce(se,ve)?ne(se[ve],se):""}var Re=typeof M=="function"?M(se):[],Se;if(G){Se={};for(var $e=0;$e<Re.length;$e++)Se["$"+Re[$e]]=Re[$e]}for(var xt in se)ce(se,xt)&&(Ae&&String(Number(xt))===xt&&xt<se.length||G&&Se["$"+xt]instanceof Symbol||(x.call(/[^\w$]/,xt)?Me.push(ne(xt,se)+": "+ne(se[xt],se)):Me.push(xt+": "+ne(se[xt],se))));if(typeof M=="function")for(var Ee=0;Ee<Re.length;Ee++)K.call(se,Re[Ee])&&Me.push("["+ne(Re[Ee])+"]: "+ne(se[Re[Ee]],se));return Me}return Xv}var Qv,f3;function GM(){if(f3)return Qv;f3=1;var t=pl(),e=DM(),r=UM(),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),v=e("Map.prototype.set",!0),_=e("Map.prototype.has",!0),g=function(S,b){for(var p=S,d;(d=p.next)!==null;p=d)if(d.key===b)return p.next=d.next,d.next=S.next,S.next=d,d},h=function(S,b){var p=g(S,b);return p&&p.value},w=function(S,b,p){var d=g(S,b);d?d.value=p:S.next={key:b,next:S.next,value:p}},E=function(S,b){return!!g(S,b)};return Qv=function(){var b,p,d,m={assert:function(y){if(!m.has(y))throw new n("Side channel does not contain "+r(y))},get:function(y){if(i&&y&&(typeof y=="object"||typeof y=="function")){if(b)return o(b,y)}else if(a){if(p)return f(p,y)}else if(d)return h(d,y)},has:function(y){if(i&&y&&(typeof y=="object"||typeof y=="function")){if(b)return u(b,y)}else if(a){if(p)return _(p,y)}else if(d)return E(d,y);return!1},set:function(y,x){i&&y&&(typeof y=="object"||typeof y=="function")?(b||(b=new i),l(b,y,x)):a?(p||(p=new a),v(p,y,x)):(d||(d={key:{},next:null}),w(d,y,x))}};return m},Qv}var Zv,d3;function C1(){if(d3)return Zv;d3=1;var t=String.prototype.replace,e=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Zv={default:r.RFC3986,formatters:{RFC1738:function(n){return t.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},Zv}var Jv,h3;function P8(){if(h3)return Jv;h3=1;var t=C1(),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 b=S.pop(),p=b.obj[b.prop];if(r(p)){for(var d=[],m=0;m<p.length;++m)typeof p[m]<"u"&&d.push(p[m]);b.obj[b.prop]=d}}},a=function(S,b){for(var p=b&&b.plainObjects?Object.create(null):{},d=0;d<S.length;++d)typeof S[d]<"u"&&(p[d]=S[d]);return p},o=function E(S,b,p){if(!b)return S;if(typeof b!="object"){if(r(S))S.push(b);else if(S&&typeof S=="object")(p&&(p.plainObjects||p.allowPrototypes)||!e.call(Object.prototype,b))&&(S[b]=!0);else return[S,b];return S}if(!S||typeof S!="object")return[S].concat(b);var d=S;return r(S)&&!r(b)&&(d=a(S,p)),r(S)&&r(b)?(b.forEach(function(m,y){if(e.call(S,y)){var x=S[y];x&&typeof x=="object"&&m&&typeof m=="object"?S[y]=E(x,m,p):S.push(m)}else S[y]=m}),S):Object.keys(b).reduce(function(m,y){var x=b[y];return e.call(m,y)?m[y]=E(m[y],x,p):m[y]=x,m},d)},l=function(S,b){return Object.keys(b).reduce(function(p,d){return p[d]=b[d],p},S)},u=function(E,S,b){var p=E.replace(/\+/g," ");if(b==="iso-8859-1")return p.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(p)}catch{return p}},f=function(S,b,p,d,m){if(S.length===0)return S;var y=S;if(typeof S=="symbol"?y=Symbol.prototype.toString.call(S):typeof S!="string"&&(y=String(S)),p==="iso-8859-1")return escape(y).replace(/%u[0-9a-f]{4}/gi,function(N){return"%26%23"+parseInt(N.slice(2),16)+"%3B"});for(var x="",P=0;P<y.length;++P){var O=y.charCodeAt(P);if(O===45||O===46||O===95||O===126||O>=48&&O<=57||O>=65&&O<=90||O>=97&&O<=122||m===t.RFC1738&&(O===40||O===41)){x+=y.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|y.charCodeAt(P)&1023),x+=n[240|O>>18]+n[128|O>>12&63]+n[128|O>>6&63]+n[128|O&63]}return x},v=function(S){for(var b=[{obj:{o:S},prop:"o"}],p=[],d=0;d<b.length;++d)for(var m=b[d],y=m.obj[m.prop],x=Object.keys(y),P=0;P<x.length;++P){var O=x[P],N=y[O];typeof N=="object"&&N!==null&&p.indexOf(N)===-1&&(b.push({obj:y,prop:O}),p.push(N))}return i(b),S},_=function(S){return Object.prototype.toString.call(S)==="[object RegExp]"},g=function(S){return!S||typeof S!="object"?!1:!!(S.constructor&&S.constructor.isBuffer&&S.constructor.isBuffer(S))},h=function(S,b){return[].concat(S,b)},w=function(S,b){if(r(S)){for(var p=[],d=0;d<S.length;d+=1)p.push(b(S[d]));return p}return b(S)};return Jv={arrayToObject:a,assign:l,combine:h,compact:v,decode:u,encode:f,isBuffer:g,isRegExp:_,maybeMap:w,merge:o},Jv}var e0,p3;function HM(){if(p3)return e0;p3=1;var t=GM(),e=P8(),r=C1(),n=Object.prototype.hasOwnProperty,i={brackets:function(S){return S+"[]"},comma:"comma",indices:function(S,b){return S+"["+b+"]"},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,v={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},_=function(S){return typeof S=="string"||typeof S=="number"||typeof S=="boolean"||typeof S=="symbol"||typeof S=="bigint"},g={},h=function E(S,b,p,d,m,y,x,P,O,N,T,R,M,D,G,F){for(var K=S,B=F,$=0,W=!1;(B=B.get(g))!==void 0&&!W;){var C=B.get(S);if($+=1,typeof C<"u"){if(C===$)throw new RangeError("Cyclic object value");W=!0}typeof B.get(g)>"u"&&($=0)}if(typeof P=="function"?K=P(b,K):K instanceof Date?K=T(K):p==="comma"&&a(K)&&(K=e.maybeMap(K,function(re){return re instanceof Date?T(re):re})),K===null){if(m)return x&&!D?x(b,v.encoder,G,"key",R):b;K=""}if(_(K)||e.isBuffer(K)){if(x){var A=D?b:x(b,v.encoder,G,"key",R);return[M(A)+"="+M(x(K,v.encoder,G,"value",R))]}return[M(b)+"="+M(String(K))]}var j=[];if(typeof K>"u")return j;var z;if(p==="comma"&&a(K))D&&x&&(K=e.maybeMap(K,x)),z=[{value:K.length>0?K.join(",")||null:void 0}];else if(a(P))z=P;else{var H=Object.keys(K);z=O?H.sort(O):H}for(var Y=d&&a(K)&&K.length===1?b+"[]":b,q=0;q<z.length;++q){var U=z[q],X=typeof U=="object"&&typeof U.value<"u"?U.value:K[U];if(!(y&&X===null)){var Q=a(K)?typeof p=="function"?p(Y,U):Y:Y+(N?"."+U:"["+U+"]");F.set(S,$);var Z=t();Z.set(g,F),l(j,E(X,Q,p,d,m,y,p==="comma"&&D&&a(K)?null:x,P,O,N,T,R,M,D,G,Z))}}return j},w=function(S){if(!S)return v;if(S.encoder!==null&&typeof S.encoder<"u"&&typeof S.encoder!="function")throw new TypeError("Encoder has to be a function.");var b=S.charset||v.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],m=v.filter;return(typeof S.filter=="function"||a(S.filter))&&(m=S.filter),{addQueryPrefix:typeof S.addQueryPrefix=="boolean"?S.addQueryPrefix:v.addQueryPrefix,allowDots:typeof S.allowDots>"u"?v.allowDots:!!S.allowDots,charset:b,charsetSentinel:typeof S.charsetSentinel=="boolean"?S.charsetSentinel:v.charsetSentinel,delimiter:typeof S.delimiter>"u"?v.delimiter:S.delimiter,encode:typeof S.encode=="boolean"?S.encode:v.encode,encoder:typeof S.encoder=="function"?S.encoder:v.encoder,encodeValuesOnly:typeof S.encodeValuesOnly=="boolean"?S.encodeValuesOnly:v.encodeValuesOnly,filter:m,format:p,formatter:d,serializeDate:typeof S.serializeDate=="function"?S.serializeDate:v.serializeDate,skipNulls:typeof S.skipNulls=="boolean"?S.skipNulls:v.skipNulls,sort:typeof S.sort=="function"?S.sort:null,strictNullHandling:typeof S.strictNullHandling=="boolean"?S.strictNullHandling:v.strictNullHandling}};return e0=function(E,S){var b=E,p=w(S),d,m;typeof p.filter=="function"?(m=p.filter,b=m("",b)):a(p.filter)&&(m=p.filter,d=m);var y=[];if(typeof b!="object"||b===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(b)),p.sort&&d.sort(p.sort);for(var N=t(),T=0;T<d.length;++T){var R=d[T];p.skipNulls&&b[R]===null||l(y,h(b[R],R,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,N))}var M=y.join(p.delimiter),D=p.addQueryPrefix===!0?"?":"";return p.charsetSentinel&&(p.charset==="iso-8859-1"?D+="utf8=%26%2310003%3B&":D+="utf8=%E2%9C%93&"),M.length>0?D+M:""},e0}var t0,g3;function VM(){if(g3)return t0;g3=1;var t=P8(),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(g){return g.replace(/&#(\d+);/g,function(h,w){return String.fromCharCode(parseInt(w,10))})},a=function(g,h){return g&&typeof g=="string"&&h.comma&&g.indexOf(",")>-1?g.split(","):g},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(h,w){var E={__proto__:null},S=w.ignoreQueryPrefix?h.replace(/^\?/,""):h,b=w.parameterLimit===1/0?void 0:w.parameterLimit,p=S.split(w.delimiter,b),d=-1,m,y=w.charset;if(w.charsetSentinel)for(m=0;m<p.length;++m)p[m].indexOf("utf8=")===0&&(p[m]===l?y="utf-8":p[m]===o&&(y="iso-8859-1"),d=m,m=p.length);for(m=0;m<p.length;++m)if(m!==d){var x=p[m],P=x.indexOf("]="),O=P===-1?x.indexOf("="):P+1,N,T;O===-1?(N=w.decoder(x,n.decoder,y,"key"),T=w.strictNullHandling?null:""):(N=w.decoder(x.slice(0,O),n.decoder,y,"key"),T=t.maybeMap(a(x.slice(O+1),w),function(R){return w.decoder(R,n.decoder,y,"value")})),T&&w.interpretNumericEntities&&y==="iso-8859-1"&&(T=i(T)),x.indexOf("[]=")>-1&&(T=r(T)?[T]:T),e.call(E,N)?E[N]=t.combine(E[N],T):E[N]=T}return E},f=function(g,h,w,E){for(var S=E?h:a(h,w),b=g.length-1;b>=0;--b){var p,d=g[b];if(d==="[]"&&w.parseArrays)p=[].concat(S);else{p=w.plainObjects?Object.create(null):{};var m=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,y=parseInt(m,10);!w.parseArrays&&m===""?p={0:S}:!isNaN(y)&&d!==m&&String(y)===m&&y>=0&&w.parseArrays&&y<=w.arrayLimit?(p=[],p[y]=S):m!=="__proto__"&&(p[m]=S)}S=p}return S},v=function(h,w,E,S){if(h){var b=E.allowDots?h.replace(/\.([^.[]+)/g,"[$1]"):h,p=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,m=E.depth>0&&p.exec(b),y=m?b.slice(0,m.index):b,x=[];if(y){if(!E.plainObjects&&e.call(Object.prototype,y)&&!E.allowPrototypes)return;x.push(y)}for(var P=0;E.depth>0&&(m=d.exec(b))!==null&&P<E.depth;){if(P+=1,!E.plainObjects&&e.call(Object.prototype,m[1].slice(1,-1))&&!E.allowPrototypes)return;x.push(m[1])}return m&&x.push("["+b.slice(m.index)+"]"),f(x,w,E,S)}},_=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 t0=function(g,h){var w=_(h);if(g===""||g===null||typeof g>"u")return w.plainObjects?Object.create(null):{};for(var E=typeof g=="string"?u(g,w):g,S=w.plainObjects?Object.create(null):{},b=Object.keys(E),p=0;p<b.length;++p){var d=b[p],m=v(d,E[d],w,typeof g=="string");S=t.merge(S,m,w)}return w.allowSparse===!0?S:t.compact(S)},t0}var r0,v3;function qM(){if(v3)return r0;v3=1;var t=HM(),e=VM(),r=C1();return r0={formats:r,parse:e,stringify:t},r0}var m3;function k8(){if(m3)return Ao;m3=1;var t=AM();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",`
|
|
142
|
+
`," "],o=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(o),u=["%","/","?",";","#"].concat(l),f=["/","?","#"],v=255,_=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+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=qM();function b(y,x,P){if(y&&typeof y=="object"&&y instanceof e)return y;var O=new e;return O.parse(y,x,P),O}e.prototype.parse=function(y,x,P){if(typeof y!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof y);var O=y.indexOf("?"),N=O!==-1&&O<y.indexOf("#")?"?":"#",T=y.split(N),R=/\\/g;T[0]=T[0].replace(R,"/"),y=T.join(N);var M=y;if(M=M.trim(),!P&&y.split("#").length===1){var D=i.exec(M);if(D)return this.path=M,this.href=M,this.pathname=D[1],D[2]?(this.search=D[2],x?this.query=S.parse(this.search.substr(1)):this.query=this.search.substr(1)):x&&(this.search="",this.query={}),this}var G=r.exec(M);if(G){G=G[0];var F=G.toLowerCase();this.protocol=F,M=M.substr(G.length)}if(P||G||M.match(/^\/\/[^@/]+@[^@/]+/)){var K=M.substr(0,2)==="//";K&&!(G&&w[G])&&(M=M.substr(2),this.slashes=!0)}if(!w[G]&&(K||G&&!E[G])){for(var B=-1,$=0;$<f.length;$++){var W=M.indexOf(f[$]);W!==-1&&(B===-1||W<B)&&(B=W)}var C,A;B===-1?A=M.lastIndexOf("@"):A=M.lastIndexOf("@",B),A!==-1&&(C=M.slice(0,A),M=M.slice(A+1),this.auth=decodeURIComponent(C)),B=-1;for(var $=0;$<u.length;$++){var W=M.indexOf(u[$]);W!==-1&&(B===-1||W<B)&&(B=W)}B===-1&&(B=M.length),this.host=M.slice(0,B),M=M.slice(B),this.parseHost(),this.hostname=this.hostname||"";var j=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!j)for(var z=this.hostname.split(/\./),$=0,H=z.length;$<H;$++){var Y=z[$];if(Y&&!Y.match(_)){for(var q="",U=0,X=Y.length;U<X;U++)Y.charCodeAt(U)>127?q+="x":q+=Y[U];if(!q.match(_)){var Q=z.slice(0,$),Z=z.slice($+1),re=Y.match(g);re&&(Q.push(re[1]),Z.unshift(re[2])),Z.length&&(M="/"+Z.join(".")+M),this.hostname=Q.join(".");break}}}this.hostname.length>v?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=t.toASCII(this.hostname));var ee=this.port?":"+this.port:"",le=this.hostname||"";this.host=le+ee,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),M[0]!=="/"&&(M="/"+M))}if(!h[F])for(var $=0,H=l.length;$<H;$++){var ce=l[$];if(M.indexOf(ce)!==-1){var _e=encodeURIComponent(ce);_e===ce&&(_e=escape(ce)),M=M.split(ce).join(_e)}}var Le=M.indexOf("#");Le!==-1&&(this.hash=M.substr(Le),M=M.slice(0,Le));var Oe=M.indexOf("?");if(Oe!==-1?(this.search=M.substr(Oe),this.query=M.substr(Oe+1),x&&(this.query=S.parse(this.query)),M=M.slice(0,Oe)):x&&(this.search="",this.query={}),M&&(this.pathname=M),E[F]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ee=this.pathname||"",ae=this.search||"";this.path=ee+ae}return this.href=this.format(),this};function p(y){return typeof y=="string"&&(y=b(y)),y instanceof e?y.format():e.prototype.format.call(y)}e.prototype.format=function(){var y=this.auth||"";y&&(y=encodeURIComponent(y),y=y.replace(/%3A/i,":"),y+="@");var x=this.protocol||"",P=this.pathname||"",O=this.hash||"",N=!1,T="";this.host?N=y+this.host:this.hostname&&(N=y+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(N+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(T=S.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var R=this.search||T&&"?"+T||"";return x&&x.substr(-1)!==":"&&(x+=":"),this.slashes||(!x||E[x])&&N!==!1?(N="//"+(N||""),P&&P.charAt(0)!=="/"&&(P="/"+P)):N||(N=""),O&&O.charAt(0)!=="#"&&(O="#"+O),R&&R.charAt(0)!=="?"&&(R="?"+R),P=P.replace(/[?#]/g,function(M){return encodeURIComponent(M)}),R=R.replace("#","%23"),x+N+P+R+O};function d(y,x){return b(y,!1,!0).resolve(x)}e.prototype.resolve=function(y){return this.resolveObject(b(y,!1,!0)).format()};function m(y,x){return y?b(y,!1,!0).resolveObject(x):x}return e.prototype.resolveObject=function(y){if(typeof y=="string"){var x=new e;x.parse(y,!1,!0),y=x}for(var P=new e,O=Object.keys(this),N=0;N<O.length;N++){var T=O[N];P[T]=this[T]}if(P.hash=y.hash,y.href==="")return P.href=P.format(),P;if(y.slashes&&!y.protocol){for(var R=Object.keys(y),M=0;M<R.length;M++){var D=R[M];D!=="protocol"&&(P[D]=y[D])}return E[P.protocol]&&P.hostname&&!P.pathname&&(P.pathname="/",P.path=P.pathname),P.href=P.format(),P}if(y.protocol&&y.protocol!==P.protocol){if(!E[y.protocol]){for(var G=Object.keys(y),F=0;F<G.length;F++){var K=G[F];P[K]=y[K]}return P.href=P.format(),P}if(P.protocol=y.protocol,!y.host&&!w[y.protocol]){for(var H=(y.pathname||"").split("/");H.length&&!(y.host=H.shift()););y.host||(y.host=""),y.hostname||(y.hostname=""),H[0]!==""&&H.unshift(""),H.length<2&&H.unshift(""),P.pathname=H.join("/")}else P.pathname=y.pathname;if(P.search=y.search,P.query=y.query,P.host=y.host||"",P.auth=y.auth,P.hostname=y.hostname||y.host,P.port=y.port,P.pathname||P.search){var B=P.pathname||"",$=P.search||"";P.path=B+$}return P.slashes=P.slashes||y.slashes,P.href=P.format(),P}var W=P.pathname&&P.pathname.charAt(0)==="/",C=y.host||y.pathname&&y.pathname.charAt(0)==="/",A=C||W||P.host&&y.pathname,j=A,z=P.pathname&&P.pathname.split("/")||[],H=y.pathname&&y.pathname.split("/")||[],Y=P.protocol&&!E[P.protocol];if(Y&&(P.hostname="",P.port=null,P.host&&(z[0]===""?z[0]=P.host:z.unshift(P.host)),P.host="",y.protocol&&(y.hostname=null,y.port=null,y.host&&(H[0]===""?H[0]=y.host:H.unshift(y.host)),y.host=null),A=A&&(H[0]===""||z[0]==="")),C)P.host=y.host||y.host===""?y.host:P.host,P.hostname=y.hostname||y.hostname===""?y.hostname:P.hostname,P.search=y.search,P.query=y.query,z=H;else if(H.length)z||(z=[]),z.pop(),z=z.concat(H),P.search=y.search,P.query=y.query;else if(y.search!=null){if(Y){P.host=z.shift(),P.hostname=P.host;var q=P.host&&P.host.indexOf("@")>0?P.host.split("@"):!1;q&&(P.auth=q.shift(),P.hostname=q.shift(),P.host=P.hostname)}return P.search=y.search,P.query=y.query,(P.pathname!==null||P.search!==null)&&(P.path=(P.pathname?P.pathname:"")+(P.search?P.search:"")),P.href=P.format(),P}if(!z.length)return P.pathname=null,P.search?P.path="/"+P.search:P.path=null,P.href=P.format(),P;for(var U=z.slice(-1)[0],X=(P.host||y.host||z.length>1)&&(U==="."||U==="..")||U==="",Q=0,Z=z.length;Z>=0;Z--)U=z[Z],U==="."?z.splice(Z,1):U===".."?(z.splice(Z,1),Q++):Q&&(z.splice(Z,1),Q--);if(!A&&!j)for(;Q--;Q)z.unshift("..");A&&z[0]!==""&&(!z[0]||z[0].charAt(0)!=="/")&&z.unshift(""),X&&z.join("/").substr(-1)!=="/"&&z.push("");var re=z[0]===""||z[0]&&z[0].charAt(0)==="/";if(Y){P.hostname=re?"":z.length?z.shift():"",P.host=P.hostname;var q=P.host&&P.host.indexOf("@")>0?P.host.split("@"):!1;q&&(P.auth=q.shift(),P.hostname=q.shift(),P.host=P.hostname)}return A=A||P.host&&z.length,A&&!re&&z.unshift(""),z.length>0?P.pathname=z.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=y.auth||P.auth,P.slashes=P.slashes||y.slashes,P.href=P.format(),P},e.prototype.parseHost=function(){var y=this.host,x=n.exec(y);x&&(x=x[0],x!==":"&&(this.port=x.substr(1)),y=y.substr(0,y.length-x.length)),y&&(this.hostname=y)},Ao.parse=b,Ao.resolve=d,Ao.resolveObject=m,Ao.format=p,Ao.Url=e,Ao}var n0={exports:{}},y3;function $M(){return y3||(y3=1,function(t){(function(e,r){t.exports?t.exports=r():e.xmlserializer=r()})(me,function(){var e=function(h){return h.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(h){return h.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},n=function(h){return h.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},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 g(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)},v=function(h){return"<!--"+h.data.replace(/-/g,"-")+"-->"},_=function(h){return"<![CDATA["+h.nodeValue+"]]>"},g=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 v(h);if(h.nodeName==="#cdata-section")return _(h)};return{serializeToString:function(h){return e(g(h,{rootNode:!0}))}}})}(n0)),n0.exports}var i0={},b3;function WM(){if(b3)return i0;b3=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[^>]*>(.+?)
|
|
143
|
+
?</div>`),new RegExp(`^(.+)
|
|
144
|
+
`)],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 i0.failOnParseError=function(a){return i(a),a},i0}var a0={},o0={},_3;function Cp(){return _3||(_3=1,function(t){var e=k8();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(v){u.push(v)})})).then(function(){return u})};var r=null,n=function(l,u){return u===!1||u==="none"||u==="repeated"?((r===null||u!=="repeated")&&(r=Date.now()),l+"?_="+r):l};t.ajax=function(l,u){return new Promise(function(f,v){var _=new window.XMLHttpRequest,g=t.joinUrl(u.baseUrl,l),h,w=function(){v({msg:"Unable to load url",url:g})};h=n(g,u.cache),_.addEventListener("load",function(){_.status===200||_.status===0?f(_.response):w()},!1),_.addEventListener("error",w,!1);try{_.open("GET",h,!0),_.overrideMimeType(u.mimeType),_.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(v){for(var _="",g=0;g<v.length;g++)_+=String.fromCharCode(v.charCodeAt(g)&255);return _})};var i=function(l){var u=function(f,v){return f.substring(0,v.length)===v};return u(l,"<?xml")||u(l,"<svg")?"image/svg+xml":"image/png"};t.getDataURIForImageURL=function(l,u){return t.binaryAjax(l,u).then(function(f){var v=btoa(f),_=i(f);return"data:"+_+";base64,"+v})};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 v=Array.prototype.slice.call(arguments),_=u(v),g=o(l),h;return f[g]&&f[g][_]?f[g][_]:(h=l.apply(null,v),f[g]=f[g]||{},f[g][_]=h,h)}}}(o0)),o0}var l0={},w3;function YM(){if(w3)return l0;w3=1;var t=Cp(),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(v){return v},function(v){throw{resourceType:"image",url:v.url,msg:"Unable to load image "+v.url}})},r=function(a){return a.filter(function(o){var l=null;return o.hasAttribute("src")?l=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(l=o.getAttribute("href")),l!==null&&!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 l0.inline=function(a,o){var l=i(a.getElementsByTagName("img")),u=i(a.getElementsByTagName("image")),f=n(a.getElementsByTagName("input"));l=l.concat(u),l=l.concat(f);var v=r(l);return t.collectAndReportErrors(v.map(function(_){return e(_,o).then(function(g){_.attributes.src?_.attributes.src.value=g:_.attributes["xlink:href"]?_.attributes["xlink:href"].value=g:_.attributes.href&&(_.attributes.href.value=g)})}))},l0}var s0={},S3;function KM(){if(S3)return s0;S3=1;var t=Cp(),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(v){throw{resourceType:"script",url:v.url,msg:"Unable to load script "+v.url}})},r=function(a){return a.replace(/<\//g,"<\\/")},n=function(a,o){a.attributes.removeNamedItem("src"),a.textContent=r(o)},i=function(a){var o=a.getElementsByTagName("script");return Array.prototype.filter.call(o,function(l){return!!l.attributes.src})};return s0.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)})}))},s0}var u0={},c0={},E3;function R1(){return E3||(E3=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)}}(c0)),c0}var f0={},O3;function XM(){return O3||(O3=1,function(t){var e=R1(),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*$",v=new RegExp(u,"g"),_,g=[],h=function(w){var E=new RegExp(l,"g"),S=[],b;for(b=E.exec(w);b;)S.push(b[1]),b=E.exec(w);return S};if(a.match(new RegExp(f))){for(_=v.exec(a);_;)g.push(h(_[0])),_=v.exec(a);return g}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(", ")}}(f0)),f0}function td(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 d0={exports:{}},x3;function QM(){return x3||(x3=1,function(t,e){(function(r){t.exports=r()})(function(){return function r(n,i,a){function o(f,v){if(!i[f]){if(!n[f]){var _=typeof td=="function"&&td;if(!v&&_)return _(f,!0);if(l)return l(f,!0);var g=new Error("Cannot find module '"+f+"'");throw g.code="MODULE_NOT_FOUND",g}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 td=="function"&&td,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,f){function v(){this.constructor=u}v.prototype=f.prototype,u.prototype=new v}function o(u,f,v,_){this.message=u,this.expected=f,this.found=v,this.location=_,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,f){var v={literal:function(b){return'"'+g(b.text)+'"'},class:function(b){var p="",d;for(d=0;d<b.parts.length;d++)p+=b.parts[d]instanceof Array?h(b.parts[d][0])+"-"+h(b.parts[d][1]):h(b.parts[d]);return"["+(b.inverted?"^":"")+p+"]"},any:function(b){return"any character"},end:function(b){return"end of input"},other:function(b){return b.description}};function _(b){return b.charCodeAt(0).toString(16).toUpperCase()}function g(b){return b.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"+_(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+_(p)})}function h(b){return b.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"+_(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+_(p)})}function w(b){return v[b.type](b)}function E(b){var p=new Array(b.length),d,m;for(d=0;d<b.length;d++)p[d]=w(b[d]);if(p.sort(),p.length>0){for(d=1,m=1;d<p.length;d++)p[d-1]!==p[d]&&(p[m]=p[d],m++);p.length=m}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(b){return b?'"'+g(b)+'"':"end of input"}return"Expected "+E(u)+" but "+S(f)+" found."};function l(u,f){f=f!==void 0?f:{};var v={},_={start:ee},g=ee,h="",w=function(){return[]},E=",",S=Y(",",!1),b=function(te,ue){return[te].concat(ue)},p=function(te){return[te]},d=function(te,ue){return{url:te,format:ue}},m=function(te){return{url:te}},y="url(",x=Y("url(",!1),P=")",O=Y(")",!1),N=function(te){return te},T="format(",R=Y("format(",!1),M="local(",D=Y("local(",!1),G=function(te){return{local:te}},F=/^[^)]/,K=q([")"],!0,!1),B=function(te){return we.extractValue(te.join(""))},$=/^[ \t\r\n\f]/,W=q([" "," ","\r",`
|
|
145
|
+
`,"\f"],!1,!1),C=0,A=[{line:1,column:1}],j=0,z=[],H;if("startRule"in f){if(!(f.startRule in _))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');g=_[f.startRule]}function Y(te,ue){return{type:"literal",text:te,ignoreCase:ue}}function q(te,ue,fe){return{type:"class",parts:te,inverted:ue,ignoreCase:fe}}function U(){return{type:"end"}}function X(te){var ue=A[te],fe;if(ue)return ue;for(fe=te-1;!A[fe];)fe--;for(ue=A[fe],ue={line:ue.line,column:ue.column};fe<te;)u.charCodeAt(fe)===10?(ue.line++,ue.column=1):ue.column++,fe++;return A[te]=ue,ue}function Q(te,ue){var fe=X(te),be=X(ue);return{start:{offset:te,line:fe.line,column:fe.column},end:{offset:ue,line:be.line,column:be.column}}}function Z(te){C<j||(C>j&&(j=C,z=[]),z.push(te))}function re(te,ue,fe){return new o(o.buildMessage(te,ue),te,ue,fe)}function ee(){var te,ue;return te=le(),te===v&&(te=C,ue=h,ue!==v&&(ue=w()),te=ue),te}function le(){var te,ue,fe,be,Te,Ye;if(te=C,ue=ce(),ue!==v){for(fe=[],be=ye();be!==v;)fe.push(be),be=ye();if(fe!==v)if(u.charCodeAt(C)===44?(be=E,C++):(be=v,Z(S)),be!==v){for(Te=[],Ye=ye();Ye!==v;)Te.push(Ye),Ye=ye();Te!==v?(Ye=le(),Ye!==v?(ue=b(ue,Ye),te=ue):(C=te,te=v)):(C=te,te=v)}else C=te,te=v;else C=te,te=v}else C=te,te=v;return te===v&&(te=C,ue=ce(),ue!==v&&(ue=p(ue)),te=ue),te}function ce(){var te;return te=_e(),te===v&&(te=ae()),te}function _e(){var te,ue,fe,be;if(te=C,ue=Le(),ue!==v){if(fe=[],be=ye(),be!==v)for(;be!==v;)fe.push(be),be=ye();else fe=v;fe!==v?(be=Oe(),be!==v?(ue=d(ue,be),te=ue):(C=te,te=v)):(C=te,te=v)}else C=te,te=v;return te===v&&(te=C,ue=Le(),ue!==v&&(ue=m(ue)),te=ue),te}function Le(){var te,ue,fe,be;return te=C,u.substr(C,4)===y?(ue=y,C+=4):(ue=v,Z(x)),ue!==v?(fe=de(),fe!==v?(u.charCodeAt(C)===41?(be=P,C++):(be=v,Z(O)),be!==v?(ue=N(fe),te=ue):(C=te,te=v)):(C=te,te=v)):(C=te,te=v),te}function Oe(){var te,ue,fe,be;return te=C,u.substr(C,7)===T?(ue=T,C+=7):(ue=v,Z(R)),ue!==v?(fe=de(),fe!==v?(u.charCodeAt(C)===41?(be=P,C++):(be=v,Z(O)),be!==v?(ue=N(fe),te=ue):(C=te,te=v)):(C=te,te=v)):(C=te,te=v),te}function ae(){var te,ue,fe,be;return te=C,u.substr(C,6)===M?(ue=M,C+=6):(ue=v,Z(D)),ue!==v?(fe=de(),fe!==v?(u.charCodeAt(C)===41?(be=P,C++):(be=v,Z(O)),be!==v?(ue=G(fe),te=ue):(C=te,te=v)):(C=te,te=v)):(C=te,te=v),te}function de(){var te,ue,fe;if(te=C,ue=[],F.test(u.charAt(C))?(fe=u.charAt(C),C++):(fe=v,Z(K)),fe!==v)for(;fe!==v;)ue.push(fe),F.test(u.charAt(C))?(fe=u.charAt(C),C++):(fe=v,Z(K));else ue=v;return ue!==v&&(ue=B(ue)),te=ue,te}function ye(){var te;return $.test(u.charAt(C))?(te=u.charAt(C),C++):(te=v,Z(W)),te}var we=r("../util");if(H=g(),H!==v&&C===u.length)return H;throw H!==v&&C<u.length&&Z(U()),re(z,j<u.length?u.charAt(j):null,j<u.length?Q(j,j+1):Q(j,j))}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)})}(d0)),d0.exports}var P3;function ZM(){return P3||(P3=1,function(t){var e=Cp(),r=R1(),n=XM(),i=QM(),a=function(p,d,m){p.style.setProperty(d,m,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(m){m.style.getPropertyValue("background-image")?d.push({property:"background-image",value:m.style.getPropertyValue("background-image"),rule:m}):m.style.getPropertyValue("background")&&d.push({property:"background",value:m.style.getPropertyValue("background"),rule:m})}),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})},v=function(p){var d=[];return p.forEach(function(m,y){m.url&&!e.isDataUri(m.url)&&d.push(y)}),d},_=function(p){var d=[];return p.forEach(function(m,y){m.url&&!e.isDataUri(m.url)&&d.push(y)}),d};t.adjustPathsOfCssResources=function(p,d){var m=o(d),y=l(m),x=!1;return y.forEach(function(P){var O=n.parse(P.value),N=v(O),T;N.length>0&&(N.forEach(function(R){var M=O[R].url,D=e.joinUrl(p,M);O[R].url=D}),T=n.serialize(O),a(P.rule,P.property,T),x=!0)}),u(d).forEach(function(P){var O=P.style.getPropertyValue("src"),N,T;try{N=i.parse(O)}catch{return}T=_(N),T.length>0&&(T.forEach(function(R){var M=N[R].url,D=e.joinUrl(p,M);N[R].url=D}),r.changeFontFaceRuleSrc(d,P,i.serialize(N)),x=!0)}),f(d).forEach(function(P){var O=P.href,N=e.joinUrl(p,O);r.exchangeRule(d,P,"@import url("+N+");"),x=!0}),x};var g=function(p,d,m){var y=p.indexOf(d);p.splice(y,1),m.forEach(function(x,P){p.splice(y+P,0,x)})},h=function(p,d,m,y){var x=d.href,P;return x=r.unquoteString(x),P=e.joinUrl(y.baseUrl,x),m.indexOf(P)>=0?(g(p,d,[]),Promise.resolve([])):(m.push(P),e.ajax(x,y).then(function(O){var N=r.rulesForCssText(O);return t.loadCSSImportsForRules(N,m,y).then(function(T){return t.adjustPathsOfCssResources(x,N),g(p,d,N),T.errors})},function(O){throw{resourceType:"stylesheet",url:O.url,msg:"Unable to load stylesheet "+O.url}}))};t.loadCSSImportsForRules=function(p,d,m){var y=f(p),x=[],P=!1;return Promise.all(y.map(function(O){return h(p,O,d,m).then(function(N){x=x.concat(N),P=!0},function(N){x.push(N)})})).then(function(){return{hasChanges:P,errors:x}})};var w=function(p,d){var m=n.parse(p),y=v(m),x=!1;return e.collectAndReportErrors(y.map(function(P){var O=m[P].url;return e.getDataURIForImageURL(O,d).then(function(N){m[P].url=N,x=!0},function(N){throw{resourceType:"backgroundImage",url:N.url,msg:"Unable to load background-image "+N.url}})})).then(function(P){return{backgroundValue:n.serialize(m),hasChanges:x,errors:P}})},E=function(p,d){var m=o(p),y=l(m),x=[],P=!1;return Promise.all(y.map(function(O){return w(O.value,d).then(function(N){N.hasChanges&&(a(O.rule,O.property,N.backgroundValue),P=!0),x=x.concat(N.errors)})})).then(function(){return{hasChanges:P,errors:x}})},S=function(p,d){var m=!1,y,x;try{y=i.parse(p)}catch{y=[]}return x=_(y),e.collectAndReportErrors(x.map(function(P){var O=y[P],N=O.format||"woff";return e.binaryAjax(O.url,d).then(function(T){var R=btoa(T);O.url="data:font/"+N+";base64,"+R,m=!0},function(T){throw{resourceType:"fontFace",url:T.url,msg:"Unable to load font-face "+T.url}})})).then(function(P){return{srcDeclarationValue:i.serialize(y),hasChanges:m,errors:P}})},b=function(p,d){var m=u(p),y=[],x=!1;return Promise.all(m.map(function(P){var O=P.style.getPropertyValue("src");return S(O,d).then(function(N){N.hasChanges&&(r.changeFontFaceRuleSrc(p,P,N.srcDeclarationValue),x=!0),y=y.concat(N.errors)})})).then(function(){return{hasChanges:x,errors:y}})};t.loadAndInlineCSSResourcesForRules=function(p,d){var m=!1,y=[];return Promise.all([E,b].map(function(x){return x(p,d).then(function(P){m=m||P.hasChanges,y=y.concat(P.errors)})})).then(function(){return{hasChanges:m,errors:y}})}}(u0)),u0}var k3;function JM(){return k3||(k3=1,function(t){var e=Cp(),r=YM(),n=KM(),i=ZM(),a=R1(),o=function(S){return e.joinUrl(S,".")},l=function(S){var b=S.map(function(p,d){return d===S.length-1&&(p={baseUrl:o(p.baseUrl)}),JSON.stringify(p)});return b},u=function(S,b){return b.cache!==!1&&b.cache!=="none"&&b.cacheBucket?e.memoize(S,l,b.cacheBucket):S},f=function(S,b,p){var d=a.rulesForCssText(S);return i.loadCSSImportsForRules(d,b,p).then(function(m){return i.loadAndInlineCSSResourcesForRules(d,p).then(function(y){var x=m.errors.concat(y.errors),P=m.hasChanges||y.hasChanges;return P&&(S=a.cssRulesToText(d)),{hasChanges:P,content:S,errors:x}})})},v=function(S,b,p){var d=S.textContent,m=u(f,b);return m(d,p,b).then(function(y){return y.hasChanges&&(S.childNodes[0].nodeValue=y.content),e.cloneArray(y.errors)})},_=function(S){var b=S.getElementsByTagName("style");return Array.prototype.filter.call(b,function(p){return!p.attributes.type||p.attributes.type.value==="text/css"})};t.loadAndInlineStyles=function(S,b){var p=_(S),d=[],m=[],y;return y=e.clone(b),y.baseUrl=y.baseUrl||e.getDocumentBaseUrl(S),Promise.all(p.map(function(x){return v(x,y,m).then(function(P){d=d.concat(P)})})).then(function(){return d})};var g=function(S,b){var p=S.parentNode,d;b=b.trim(),b&&(d=S.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(S.ownerDocument.createTextNode(b)),p.insertBefore(d,S)),p.removeChild(S)},h=function(S,b){return e.ajax(S,b).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,[],b).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,b).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,b){var p=S.attributes.href.value,d=e.getDocumentBaseUrl(S.ownerDocument),m=e.clone(b);!m.baseUrl&&d&&(m.baseUrl=d);var y=u(h,b);return y(p,m).then(function(x){return{content:x.content,errors:e.cloneArray(x.errors)}})},E=function(S){var b=S.getElementsByTagName("link");return Array.prototype.filter.call(b,function(p){return p.attributes.rel&&p.attributes.rel.value==="stylesheet"&&(!p.attributes.type||p.attributes.type.value==="text/css")})};t.loadAndInlineCssLinks=function(S,b){var p=E(S),d=[];return Promise.all(p.map(function(m){return w(m,b).then(function(y){g(m,y.content+`
|
|
146
|
+
`),d=d.concat(y.errors)},function(y){d.push({resourceType:"stylesheet",url:y.url,msg:"Unable to load stylesheet "+y.url})})})).then(function(){return d})},t.loadAndInlineImages=r.inline,t.loadAndInlineScript=n.inline,t.inlineReferences=function(S,b){var p=[],d=[t.loadAndInlineImages,t.loadAndInlineStyles,t.loadAndInlineCssLinks];return b.inlineScripts!==!1&&d.push(t.loadAndInlineScript),Promise.all(d.map(function(m){return m(S,b).then(function(y){p=p.concat(y)})})).then(function(){return p})}}(a0)),a0}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
|
|
147
|
+
* http://www.github.com/cburgmer/rasterizeHTML.js
|
|
148
|
+
* 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(k8(),$M(),WM(),JM()):e.rasterizeHTML=r(e.url,e.xmlserializer,e.sanedomparsererror,e.inlineresources)})(me,function(e,r,n,i){var a=function(w){var E={},S=[];E.joinUrl=function(d,m){return d?w.resolve(d,m):m},E.getConstantUniqueIdFor=function(d){return S.indexOf(d)<0&&S.push(d),S.indexOf(d)},E.clone=function(d){var m={},y;for(y in d)d.hasOwnProperty(y)&&(m[y]=d[y]);return m};var b=function(d){return typeof d=="object"&&d!==null},p=function(d){return b(d)&&Object.prototype.toString.apply(d).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return E.parseOptionalParameters=function(d){var m={canvas:null,options:{}};return d[0]==null||p(d[0])?(m.canvas=d[0]||null,m.options=E.clone(d[1])):m.options=E.clone(d[0]),m},E}(e),o=function(w){var E={},S=function(b,p,d){var m=b[p];return b[p]=function(){var y=Array.prototype.slice.call(arguments);return d.apply(this,[y,m])},m};return E.baseUrlRespectingXhr=function(b,p){var d=function(){var m=new b;return S(m,"open",function(y,x){var P=y.shift(),O=y.shift(),N=w.joinUrl(p,O);return x.apply(this,[P,N].concat(y))}),m};return d},E.finishNotifyingXhr=function(b){var p=0,d=0,m=!1,y,x=new Promise(function(O){y=function(){var N=p-d;N<=0&&m&&O({totalCount:p})}}),P=function(){var O=new b;return S(O,"send",function(N,T){return p+=1,T.apply(this,arguments)}),O.addEventListener("load",function(){d+=1,y()}),O};return P.waitForRequestsToFinish=function(){return m=!0,y(),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 N=P.parentStyleSheet,T=E(N.cssRules).indexOf(P);N.insertRule(O,T+1),N.deleteRule(T)},b=function(P,O){var N=P.cssText.replace(/^[^\{]+/,""),T=O+" "+N;S(P,T)},p=function(P){return E(P).reduce(function(O,N){return O+N.cssText},"")},d=function(P){P.textContent=p(P.sheet.cssRules)},m=function(P){var O=document.implementation.createHTMLDocument(""),N=document.createElement("style");N.textContent=P.textContent,O.body.appendChild(N),P.sheet=N.sheet},y=function(P){return"((?:^|[^.#:\\w])|(?=\\W))("+P.join("|")+")(?=\\W|$)"},x=function(P,O,N){var T=y(O);E(P.querySelectorAll("style")).forEach(function(R){typeof R.sheet>"u"&&m(R);var M=E(R.sheet.cssRules).filter(function(D){return D.selectorText&&new RegExp(T,"i").test(D.selectorText)});M.length&&(M.forEach(function(D){var G=D.selectorText.replace(new RegExp(T,"gi"),function(F,K,B){return K+N(B)});G!==D.selectorText&&b(D,G)}),d(R))})};return w.rewriteCssSelectorWith=function(P,O,N){x(P,[O],function(){return N})},w.lowercaseCssTypeSelectors=function(P,O){x(P,O,function(N){return N.toLowerCase()})},w.findHtmlOnlyNodeNames=function(P){var O=P.ownerDocument.createTreeWalker(P,NodeFilter.SHOW_ELEMENT),N={},T={},R;do R=O.currentNode.tagName.toLowerCase(),O.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?N[R]=!0:T[R]=!0;while(O.nextNode());return Object.keys(N).filter(function(M){return!T[M]})},w}(),u=function(w){var E={},S=function(p){return Array.prototype.slice.call(p)},b={active:!0,hover:!0,focus:!1,target:!1};return E.fakeUserAction=function(p,d,m){var y=p.querySelector(d),x=":"+m,P="rasterizehtml"+m;y&&(b[m]?w.addClassNameRecursively(y,P):w.addClassName(y,P),w.rewriteCssSelectorWith(p,x,"."+P))},E.persistInputValues=function(p){var d=p.querySelectorAll("input"),m=p.querySelectorAll("textarea"),y=function(x){return x.type==="checkbox"||x.type==="radio"};S(d).filter(y).forEach(function(x){x.checked?x.setAttribute("checked",""):x.removeAttribute("checked")}),S(d).filter(function(x){return!y(x)}).forEach(function(x){x.setAttribute("value",x.value)}),S(m).forEach(function(x){x.textContent=x.value})},E.rewriteTagNameSelectorsToLowerCase=function(p){w.lowercaseCssTypeSelectors(p,w.findHtmlOnlyNodeNames(p))},E}(l),f=function(w,E,S,b){var p={},d=function(B,$,W,C){var A=B.createElement($);return A.style.visibility="hidden",A.style.width=W+"px",A.style.height=C+"px",A.style.position="absolute",A.style.top=-1e4-C+"px",A.style.left=-1e4-W+"px",B.getElementsByTagName("body")[0].appendChild(A),A},m=function(B){return B>0?new Promise(function($){setTimeout($,B)}):Promise.resolve()};p.executeJavascript=function(B,$){return new Promise(function(W){var C=d(b.document,"iframe",$.width,$.height),A=B.outerHTML,j=[],z=$.executeJsTimeout||0,H=function(){b.document.getElementsByTagName("body")[0].removeChild(C)},Y=function(){var Q=C.contentDocument;W({document:Q,errors:j,cleanUp:H})},q=C.contentWindow.XMLHttpRequest,U=E.finishNotifyingXhr(q),X=E.baseUrlRespectingXhr(U,$.baseUrl);C.onload=function(){m(z).then(U.waitForRequestsToFinish).then(Y)},C.contentDocument.open(),C.contentWindow.XMLHttpRequest=X,C.contentWindow.onerror=function(Q){j.push({resourceType:"scriptExecution",msg:Q})},C.contentDocument.write("<!DOCTYPE html>"),C.contentDocument.write(A),C.contentDocument.close()})};var y=function(B,$,W){var C=B.createElement("iframe");return C.style.width=$+"px",C.style.height=W+"px",C.style.visibility="hidden",C.style.position="absolute",C.style.top=-1e4-W+"px",C.style.left=-1e4-$+"px",C.style.borderWidth=0,C.sandbox="allow-same-origin",C.scrolling="no",C},x=function(B,$,W){var C=Math.floor(B/W),A=Math.floor($/W);return y(b.document,C,A)},P=function(B,$,W,C){return{width:Math.max(B.width*C,$),height:Math.max(B.height*C,W)}},O=function(B,$){var W=B.querySelector($);if(W)return W;if(B.ownerDocument.querySelector($)===B)return B;throw{message:"Clipping selector not found"}},N=function(B,$,W,C,A){var j=Math.max(B.scrollWidth,B.clientWidth),z=Math.max(B.scrollHeight,B.clientHeight),H,Y,q,U,X,Q,Z,re;return $?(Q=O(B,$),Z=Q.getBoundingClientRect(),H=Z.top,Y=Z.left,q=Z.width,U=Z.height):(H=0,Y=0,q=j,U=z),re=P({width:q,height:U},W,C,A),X=b.getComputedStyle(B.ownerDocument.documentElement).fontSize,{left:Y,top:H,width:re.width,height:re.height,viewportWidth:j,viewportHeight:z,rootFontSize:X}},T=function(B,$){var W=B.tagName;return $.querySelector(W)},R=function(B){var $=B.tagName.toLowerCase();return $==="html"||$==="body"?B.outerHTML:'<body style="margin: 0;">'+B.outerHTML+"</body>"};p.calculateDocumentContentSize=function(B,$){return new Promise(function(W,C){var A=$.zoom||1,j;j=x($.width,$.height,A),b.document.getElementsByTagName("body")[0].appendChild(j),j.onload=function(){var z=j.contentDocument,H;try{H=N(T(B,z),$.clip,$.width,$.height,A),W(H)}catch(Y){C(Y)}finally{b.document.getElementsByTagName("body")[0].removeChild(j)}},j.contentDocument.open(),j.contentDocument.write("<!DOCTYPE html>"),j.contentDocument.write(R(B)),j.contentDocument.close()})},p.parseHtmlFragment=function(B){var $=b.document.implementation.createHTMLDocument("");$.documentElement.innerHTML=B;var W=$.querySelector("body").firstChild;if(!W)throw"Invalid source";return W};var M=function(B,$){var W=/<html((?:\s+[^>]*)?)>/im.exec($),C=b.document.implementation.createHTMLDocument(""),A,j,z,H;if(W)for(A="<div"+W[1]+"></div>",C.documentElement.innerHTML=A,z=C.querySelector("div"),j=0;j<z.attributes.length;j++)H=z.attributes[j],B.documentElement.setAttribute(H.name,H.value)};p.parseHTML=function(B){var $=b.document.implementation.createHTMLDocument("");return $.documentElement.innerHTML=B,M($,B),$};var D=function(B){try{return S.failOnParseError(B)}catch($){throw{message:"Invalid source",originalError:$}}};p.validateXHTML=function(B){var $=new DOMParser,W=$.parseFromString(B,"application/xml");D(W)};var G=null,F=function(B,$){return $==="none"||$==="repeated"?((G===null||$!=="repeated")&&(G=Date.now()),B+"?_="+G):B},K=function(B,$){return new Promise(function(W,C){var A=new window.XMLHttpRequest,j=w.joinUrl($.baseUrl,B),z=F(j,$.cache),H=function(Y){C({message:"Unable to load page",originalError:Y})};A.addEventListener("load",function(){A.status===200||A.status===0?W(A.responseXML):H(A.statusText)},!1),A.addEventListener("error",function(Y){H(Y)},!1);try{A.open("GET",z,!0),A.responseType="document",A.send(null)}catch(Y){H(Y)}})};return p.loadDocument=function(B,$){return K(B,$).then(function(W){return D(W)})},p}(a,o,n,window),v=function(w){var E={},S=function(T,R){return R?URL.createObjectURL(new Blob([T],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(T)},b=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(R,M){var D=document.createElement("canvas"),G=new Image;G.onload=function(){var F=D.getContext("2d");try{F.drawImage(G,0,0),D.toDataURL("image/png"),R(!0)}catch{R(!1)}},G.onerror=M,G.src=T})},m=function(){var T=S(p,!0);return d(T).then(function(R){return b(T),R?!1:d(S(p,!1)).then(function(M){return M})},function(){return!1})},y=function(){if(w.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},x=function(){return new Promise(function(T,R){y()&&w.URL?m().then(function(M){T(!M)},function(){R()}):T(!1)})},P,O=function(){return P===void 0&&(P=x()),P},N=function(T){return O().then(function(R){return S(T,R)})};return E.renderSvg=function(T){return new Promise(function(R,M){var D,G,F=function(){G.onload=null,G.onerror=null},K=function(){D&&b(D)};G=new Image,G.onload=function(){F(),K(),R(G)},G.onerror=function(){K(),M()},N(T).then(function(B){D=B,G.src=D},M)})},E}(window),_=function(w,E,S,b){var p={},d=function(T,R){var M=R||1,D={width:T.width,height:T.height,"font-size":T.rootFontSize};return M!==1&&(D.style="transform:scale("+M+"); transform-origin: 0 0;"),D},m=function(T){var R,M,D,G;R=Math.round(T.viewportWidth),M=Math.round(T.viewportHeight),D=-T.left,G=-T.top;var F={x:D,y:G,width:R,height:M};return F},y=function(T){var R=T.style||"";T.style=R+"float: left;"},x=function(T){T.externalResourcesRequired=!0},P=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},O=function(T){var R=Object.keys(T);return R.length?" "+R.map(function(M){return M+'="'+T[M]+'"'}).join(" "):""},N=function(T,R,M){var D=b.serializeToString(T);E.validateXHTML(D);var G=m(R);return y(G),x(G),'<svg xmlns="http://www.w3.org/2000/svg"'+O(d(R,M))+">"+P()+"<foreignObject"+O(G)+">"+D+"</foreignObject></svg>"};return p.getSvgForDocument=function(T,R,M){return S.rewriteTagNameSelectorsToLowerCase(T),N(T,R,M)},p.drawDocumentAsSvg=function(T,R){return["hover","active","focus","target"].forEach(function(M){R[M]&&S.fakeUserAction(T,R[M],M)}),E.calculateDocumentContentSize(T,R).then(function(M){return p.getSvgForDocument(T,M,R.zoom)})},p}(a,f,u,r),g=function(w,E,S,b,p,d){var m={},y=function(T){return{message:"Error rendering page",originalError:T}},x=function(T){return p.renderSvg(T).then(function(R){return{image:R,svg:T}},function(R){throw y(R)})},P=function(T,R){try{R.getContext("2d").drawImage(T,0,0)}catch(M){throw y(M)}},O=function(T,R,M){return b.drawDocumentAsSvg(T,M).then(x).then(function(D){return R&&P(D.image,R),D})},N=function(T,R){return E.executeJavascript(T,R).then(function(M){var D=M.document;return S.persistInputValues(D),{document:D,errors:M.errors,cleanUp:M.cleanUp}})};return m.rasterize=function(T,R,M){var D;return D=w.clone(M),D.inlineScripts=M.executeJs===!0,d.inlineReferences(T,D).then(function(G){return M.executeJs?N(T,M).then(function(F){return{element:F.document.documentElement,errors:G.concat(F.errors),cleanUp:F.cleanUp}}):{element:T,errors:G,cleanUp:function(){}}}).then(function(G){return O(G.element,R,M).then(function(F){return G.cleanUp(),{image:F.image,svg:F.svg,errors:G.errors}})})},m}(a,f,u,_,v,i),h=function(w,E,S){var b={},p=function(P,O){var N=300,T=200,R=P?P.width:N,M=P?P.height:T,D=O.width!==void 0?O.width:R,G=O.height!==void 0?O.height:M;return{width:D,height:G}},d=function(P){var O=p(P.canvas,P.options),N;return N=w.clone(P.options),N.width=O.width,N.height=O.height,N};b.drawDocument=function(){var P=arguments[0],O=Array.prototype.slice.call(arguments,1),N=w.parseOptionalParameters(O),T=P.documentElement?P.documentElement:P;return S.rasterize(T,N.canvas,d(N))};var m=function(P,O,N){var T=E.parseHTML(P);return b.drawDocument(T,O,N)};b.drawHTML=function(){var P=arguments[0],O=Array.prototype.slice.call(arguments,1),N=w.parseOptionalParameters(O);return m(P,N.canvas,N.options)};var y=function(P,O,N){var T=document.implementation.createHTMLDocument("");T.replaceChild(P.documentElement,T.documentElement);var R=N?w.clone(N):{};return N.baseUrl||(R.baseUrl=O),{document:T,options:R}},x=function(P,O,N){return E.loadDocument(P,N).then(function(T){var R=y(T,P,N);return b.drawDocument(R.document,O,R.options)})};return b.drawURL=function(){var P=arguments[0],O=Array.prototype.slice.call(arguments,1),N=w.parseOptionalParameters(O);return x(P,N.canvas,N.options)},b}(a,f,g);return h})})(E8);var eL=E8.exports;(function(t){var e=me&&me.__createBinding||(Object.create?function(f,v,_,g){g===void 0&&(g=_);var h=Object.getOwnPropertyDescriptor(v,_);h&&!("get"in h?!v.__esModule:h.writable||h.configurable)||(h={enumerable:!0,get:function(){return v[_]}}),Object.defineProperty(f,g,h)}:function(f,v,_,g){g===void 0&&(g=_),f[g]=v[_]}),r=me&&me.__setModuleDefault||(Object.create?function(f,v){Object.defineProperty(f,"default",{enumerable:!0,value:v})}:function(f,v){f.default=v}),n=me&&me.__importStar||function(f){if(f&&f.__esModule)return f;var v={};if(f!=null)for(var _ in f)_!=="default"&&Object.prototype.hasOwnProperty.call(f,_)&&e(v,f,_);return r(v,f),v};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToCanvas=t.detectSize=void 0;const i=n(eL),a=`
|
|
149
|
+
<style>
|
|
150
|
+
html, body {
|
|
151
|
+
padding: 0;
|
|
152
|
+
margin: 0;
|
|
153
|
+
}
|
|
154
|
+
p {
|
|
155
|
+
margin: 0;
|
|
156
|
+
padding: 0
|
|
157
|
+
}
|
|
158
|
+
ul {
|
|
159
|
+
list-style-position: inside;
|
|
160
|
+
margin: 0;
|
|
161
|
+
}
|
|
162
|
+
</style>
|
|
163
|
+
`,o=document.createElement("div");function l(f){const v=document.createElement("div");v.innerHTML=f,v.style.display="inline-block",v.style.position="fixed",v.style.top="0px",v.style.left="0px",v.style.zIndex="1000",o.appendChild(v);const _=v.getBoundingClientRect();return o.removeChild(v),{width:_.width,height:_.height}}async function u({html:f,width:v,height:_,fontFamily:g,padding:h,font:w,pixelRatio:E}){const S=document.createElement("canvas");g==="Arial"||w||(f+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${g}" rel="stylesheet">`),w&&(f+=`<style>@font-face {font-family: '${w.fontFamily}'; src: url("${w.url}")}</style>`),f+=a;const b=await i.drawHTML(`<div style="padding: ${h}px;">${f}</div>`,S,{width:v+2*h,height:_+2*h});S.width=(v+2*h)*E,S.height=(_+2*h)*E;const p=S.getContext("2d");return p==null||p.drawImage(b.image,0,0,b.image.width*E,b.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>
|
|
164
|
+
#polotno-hidden-do-not-touch p {
|
|
165
|
+
margin: 0;
|
|
166
|
+
padding: 0
|
|
167
|
+
}
|
|
168
|
+
#polotno-hidden-do-not-touch ul {
|
|
169
|
+
list-style-position: inside;
|
|
170
|
+
margin: 0;
|
|
171
|
+
}
|
|
172
|
+
</style>`,t.detectSize=l,t.htmlToCanvas=u})(S8);var N1={},A8={};(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 m=r(d),y=m.data;return m.data="",y},i=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(d,m)=>{let y="",x="",P="";for(let O in d){let N=d[O];O[0]=="@"?O[1]=="i"?y=O+" "+N+";":x+=O[1]=="f"?o(N,O):O+"{"+o(N,O[1]=="k"?"":m)+"}":typeof N=="object"?x+=o(N,m?m.replace(/([^,])+/g,T=>O.replace(/(^:.*)|([^,])+/g,R=>/&/.test(R)?R.replace(/&/g,T):T?T+" "+R:R)):O):N!=null&&(O=O.replace(/[A-Z]/g,"-$&").toLowerCase(),P+=o.p?o.p(O,N):O+":"+N+";")}return y+(m&&P?m+"{"+P+"}":P)+x},l={},u=d=>{if(typeof d=="object"){let m="";for(let y in d)m+=y+u(d[y]);return m}return d},f=(d,m,y,x,P)=>{let O=u(d),N=l[O]||(l[O]=(T=>{let R=0,M=11;for(;R<T.length;)M=101*M+T.charCodeAt(R++)>>>0;return"go"+M})(O));if(!l[N]){let T=O!==d?d:(R=>{let M,D=[{}];for(;M=i.exec(R.replace(a,""));)M[4]?D.shift():M[3]?D.unshift(D[0][M[3]]=D[0][M[3]]||{}):D[0][M[1]]=M[2];return D[0]})(d);l[N]=o(P?{["@keyframes "+N]:T}:T,y?"":"."+N)}return((T,R,M)=>{R.data.indexOf(T)==-1&&(R.data=M?T+R.data:R.data+T)})(l[N],m,x),N},v=(d,m,y)=>d.reduce((x,P,O)=>{let N=m[O];if(N&&N.call){let T=N(y),R=T&&T.props&&T.props.className||/^go/.test(T)&&T;N=R?"."+R:T&&typeof T=="object"?T.props?"":o(T,""):T===!1?"":T}return x+P+(N??"")},"");function _(d){let m=this||{},y=d.call?d(m.p):d;return f(y.unshift?y.raw?v(y,[].slice.call(arguments,1),m.p):y.reduce((x,P)=>Object.assign(x,P&&P.call?P(m.p):P),{}):y,r(m.target),m.g,m.o,m.k)}t.extractCss=n,t.css=_;let g,h,w,E=_.bind({g:1}),S=_.bind({k:1});function b(d,m,y,x){o.p=m,g=d,h=y,w=x}function p(d,m){let y=this||{};return function(){let x=arguments;function P(O,N){let T=Object.assign({},O),R=T.className||P.className;y.p=Object.assign({theme:h&&h()},T),y.o=/ *go\d+/.test(R),T.className=_.apply(y,x)+(R?" "+R:""),m&&(T.ref=N);let M=d;return d[0]&&(M=T.as||d,delete T.as),w&&M[0]&&w(T),g(M,T)}return m?m(P):P}}t.glob=E,t.keyframes=S,t.setup=b,t.styled=p})(A8);var tL=me&&me.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(N1,"__esModule",{value:!0});const rL=tL(at),A3=A8;(0,A3.setup)(rL.default.createElement),N1.default=A3.styled;(function(t){var e=me&&me.__createBinding||(Object.create?function(F,K,B,$){$===void 0&&($=B);var W=Object.getOwnPropertyDescriptor(K,B);W&&!("get"in W?!K.__esModule:W.writable||W.configurable)||(W={enumerable:!0,get:function(){return K[B]}}),Object.defineProperty(F,$,W)}:function(F,K,B,$){$===void 0&&($=B),F[$]=K[B]}),r=me&&me.__setModuleDefault||(Object.create?function(F,K){Object.defineProperty(F,"default",{enumerable:!0,value:K})}:function(F,K){F.default=K}),n=me&&me.__importStar||function(F){if(F&&F.__esModule)return F;var K={};if(F!=null)for(var B in F)B!=="default"&&Object.prototype.hasOwnProperty.call(F,B)&&e(K,F,B);return r(K,F),K},i=me&&me.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLElement=t.quillRef=void 0;const a=i(at),o=Ni,l=co,u=i(kM),f=i(ci),v=n(sa),_=zn,g=Nc,h=O1,w=S8,E=fl,S=Fs,b=Cc,p=i(N1),d=aa,m=x1,y=n(Rc),x=hl;t.quillRef=v.observable({enabled:!1,currentFormat:{},editor:v.observable.object({instance:null},{},{deep:!1})});const P=(0,p.default)("div",a.default.forwardRef)`
|
|
173
|
+
.ql-editor {
|
|
174
|
+
outline: none;
|
|
175
|
+
}
|
|
176
|
+
ul {
|
|
177
|
+
list-style-position: inside;
|
|
178
|
+
margin: 0;
|
|
179
|
+
}
|
|
180
|
+
p {
|
|
181
|
+
line-height: auto;
|
|
182
|
+
margin: 0;
|
|
183
|
+
}
|
|
184
|
+
strong {
|
|
185
|
+
font-weight: 1800;
|
|
186
|
+
}
|
|
187
|
+
.ql-direction-rtl {
|
|
188
|
+
direction: rtl;
|
|
189
|
+
}
|
|
190
|
+
`,O=({html:F,onBlur:K,onChange:B,element:$})=>{const W=a.default.useRef(null);a.default.useEffect(()=>{if(!W.current)return;const A=new u.default(W.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=A,window.__polotnoQuill=A,A.on("text-change",()=>{A.getSelection()&&(t.quillRef.currentFormat=A.getFormat()),setTimeout(()=>{var j;B((j=W.current)===null||j===void 0?void 0:j.childNodes[0].innerHTML)},10)}),A.setSelection(0,0,"api"),A.on("selection-change",j=>{j||K(),j&&(t.quillRef.currentFormat=A.getFormat())}),W.current.childNodes[0].addEventListener("blur",j=>{var z;!((z=j.relatedTarget)===null||z===void 0)&&z.classList.contains("ql-clipboard")||K()}),()=>{t.quillRef.editor.instance=null,t.quillRef.currentFormat={},delete window.__polotnoQuill}},[]),a.default.useEffect(()=>{var A;const j=t.quillRef.editor.instance;if(!j)return;const z=j.getSelection();if(((A=W.current)===null||A===void 0?void 0:A.childNodes[0].innerHTML)!==$.text){var H=j.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+F+"<p><br></p></div>");j.setContents(H),j.history.clear(),z&&(j.setSelection(z.index,z.length),t.quillRef.currentFormat=j.getFormat())}},[$.text]);const C=(0,h.useTextColor)($).fill;return a.default.createElement(P,{ref:W,style:{fontSize:$.fontSize,color:C,width:$.width,fontFamily:$.fontFamily,lineHeight:$.lineHeight,letterSpacing:$.letterSpacing+"rem",textAlign:$.align},dir:(0,h.getDir)((0,m.removeTags)($.text))})};function N(F,K,B){return a.default.useMemo(()=>(0,w.detectSize)(F),[F,K.width,B])}function T(F){const K=F.getContext("2d").getImageData(0,0,F.width,F.height).data;for(let B=0;B<K.length;B+=4)if(K[B+3]!==0)return!0;return!1}function R(F){return!T(F)}function M(F,{fontFamily:K="",color:B="black"}={}){let $=`color: ${B||F.fill}`;return`<div style="white-space: unset; width: ${Math.round(F.width||100)}px; ${$}; font-size: ${F.fontSize}px; font-family: '${K}'; text-decoration: ${F.textDecoration}; text-align: ${F.align}; line-height: ${F.lineHeight}; letter-spacing: ${F.letterSpacing}rem; font-style: ${F.fontStyle}; font-weight: ${F.fontWeight}; -webkit-text-stroke: ${F.strokeWidth}px ${F.stroke};" contentEditable dir="${(0,h.getDir)((0,m.removeTags)(F.text))}">${F.text}</div>`}const D=F=>{let K=F.fontSize;for(let B=1;B<50;B++){const $=M(Object.assign(Object.assign({},F.toJSON()),{fontSize:K}),{fontFamily:F.fontFamily}),{height:W}=(0,w.detectSize)($);if(!(F.height&&W>F.height))break;K-=.5}return K},G=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);t.HTMLElement=(0,o.observer)(({element:F,store:K})=>{const B=a.default.useRef(null),[$,W]=a.default.useState(),[C,A]=a.default.useState(!1),[j,z]=a.default.useState(!0),[H,Y]=a.default.useState(!1),[q,U]=a.default.useState(!1),X=a.default.useRef(F.height),Q=K.selectedElements.indexOf(F)>=0,Z=F.fontSize/3,{textVerticalResizeEnabled:re}=_.flags,ee=(0,h.usePrevious)(F.fontFamily),[le]=(0,h.useFontLoader)(K,F.fontFamily);(0,E.useFadeIn)(B);const ce=le?F.fontFamily:ee!==F.fontFamily?ee:"Arial",_e=(0,h.useTextColor)(F).fill,Le=M(F,{fontFamily:ce,color:_e}),{width:Oe,height:ae}=N(Le,F,le);a.default.useEffect(()=>{if(!le)return;if(!F.height)return void F.set({height:ae});const{textOverflow:fe}=_.flags;if(fe!=="change-font-size"||C)fe==="resize"&&(re&&F.height<ae&&K.history.ignore(()=>{F.set({height:ae})}),re||F.height===ae||K.history.ignore(()=>{F.set({height:ae})}));else{const be=D(F);be!==F.fontSize?K.history.ignore(()=>{F.set({fontSize:be})}):F.height!==ae&&(re&&F.height<ae?K.history.ignore(()=>{F.set({height:ae})}):re||K.history.ignore(()=>{F.set({height:ae})}))}});const de=a.default.useRef(0);a.default.useEffect(()=>{C||H||(async()=>{de.current++;const fe=de.current,be=(0,d.incrementLoader)(`text ${F.id}`);z(!0);let Te=null;const Ye=G?5:1;for(let Ke=0;Ke<Ye;Ke++){if(Te=await(0,w.htmlToCanvas)({html:Le,width:F.width||1,height:F.height||ae||1,fontFamily:ce,padding:Z,pixelRatio:K._elementsPixelRatio,font:K.fonts.find(Ce=>Ce.fontFamily===ce)||y.globalFonts.find(Ce=>Ce.fontFamily===ce)}),fe!==de.current)return void be();R(Te)&&G&&await new Promise(Ce=>setTimeout(Ce,50*(Ke+1)))}Te?(W(Te),z(!1),f.default.Util.requestAnimFrame(be)):be()})()},[Le,C,ae,H,ce,F.height,K._elementsPixelRatio]);const ye=C||j;a.default.useEffect(()=>v.autorun(()=>{const fe=B.current;(0,g.applyFilter)(fe,F)}),[$,ye,F.shadowColor,F.shadowOffsetX,F.shadowOffsetY,F.shadowOpacity]);let we=0;F.verticalAlign==="middle"&&(we=(F.height-ae)/2),F.verticalAlign==="bottom"&&(we=F.height-ae);const te=(0,h.getLineHeight)({fontLoaded:le,fontFamily:F.fontFamily,fontSize:F.fontSize,lineHeight:F.lineHeight}),ue=(0,x.useMobile)();return a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Rect,{x:F.x,y:F.y,offsetX:F.backgroundPadding*(F.fontSize*te*.5),offsetY:F.backgroundPadding*(F.fontSize*te*.5),rotation:F.rotation,hideInExport:!F.showInExport||!F.text,listening:!1,visible:F.backgroundEnabled,opacity:F.backgroundOpacity,fill:F.backgroundColor,width:F.width+F.backgroundPadding*(F.fontSize*te),height:F.height+F.backgroundPadding*(F.fontSize*te),cornerRadius:F.backgroundCornerRadius*(F.fontSize*te*.5)}),a.default.createElement(l.Rect,{ref:B,name:"element",x:F.x,y:F.y,listening:F.selectable,rotation:F.rotation,width:F.width,height:F.height,visible:!ye,draggable:ue?F.draggable&&Q:F.draggable,preventDefault:!ue||Q,opacity:H?0:F.opacity,hideInExport:!F.showInExport,onMouseEnter:()=>{U(!0)},onMouseLeave:()=>{U(!1)},onDragMove:fe=>{F.set({x:fe.target.x(),y:fe.target.y()})},onDragEnd:fe=>{F.set({x:fe.target.x(),y:fe.target.y()})},id:F.id,onDblClick:()=>{F.contentEditable&&Y(!0)},onDblTap:()=>{F.contentEditable&&Y(!0)},onTransformStart:fe=>{A(!0),X.current=F.height},onTransform:fe=>{var be;const Te=fe.target,Ye=((be=Te.getStage())===null||be===void 0?void 0:be.findOne("Transformer")).getActiveAnchor(),Ke=Ye==="middle-left"||Ye==="middle-right",Ce=Ye==="top-center"||Ye==="bottom-center",Be=Te.scaleX();if(Ke){const et=Te.scaleX(),Xe=Math.max(Te.width()*et,F.fontSize);if(Te.width(Xe),Te.scaleX(1),_.flags.textVerticalResizeEnabled){const se=Math.max(ae,X.current);F.set({height:se})}F.set({width:Xe,x:Te.x(),y:Te.y()})}else if(Ce){let et=_.flags.textOverflow==="resize"?ae:F.lineHeight*F.fontSize;const Xe=Math.max(et,fe.target.height()*fe.target.scaleY());Te.scaleY(1),F.set({x:Te.x(),y:Te.y(),height:Xe,rotation:Te.rotation()})}else Te.scaleX(1),Te.scaleY(1),F.set({fontSize:F.fontSize*Be,width:Te.width()*Be,x:Te.x(),y:Te.y(),rotation:Te.rotation(),height:Te.height()*Be})},onTransformEnd:fe=>{A(!1),z(!0);const be=fe.target.scaleX();fe.target.scaleX(1),fe.target.scaleY(1),F.set({fontSize:F.fontSize*be,width:fe.target.width()*be,x:fe.target.x(),y:fe.target.y(),rotation:fe.target.rotation()})}}),a.default.createElement(l.Image,{ref:B,image:$,x:F.x,y:F.y,offsetX:Z,offsetY:Z-we,listening:!1,rotation:F.rotation,width:F.width+2*Z,height:F.height+2*Z,visible:!ye,opacity:H?0:F.opacity,shadowEnabled:F.shadowEnabled,shadowBlur:F.shadowBlur,shadowOffsetX:F.shadowOffsetX,shadowOffsetY:F.shadowOffsetY,shadowColor:F.shadowColor,shadowOpacity:F.shadowOpacity,hideInExport:!F.showInExport}),ye&&a.default.createElement(l.Group,{x:F.x,y:F.y,rotation:F.rotation,offsetY:-we},a.default.createElement(b.Html,{divProps:{style:{pointerEvents:"none"}}},a.default.createElement(P,{dangerouslySetInnerHTML:{__html:Le},style:{pointerEvents:"none",display:"inline-block"}}))),H&&a.default.createElement(l.Group,{x:F.x,y:F.y,rotation:F.rotation,offsetY:-we},a.default.createElement(b.Html,null,a.default.createElement(O,{html:Le,element:F,onChange:fe=>{F.set({text:fe})},onBlur:fe=>{Y(!1)}}))),(Q||q)&&a.default.createElement(S.Highlighter,{element:F}))})})(_8);var T8={},M1={},Rp={};(function(t){var e=me&&me.__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(ci);function n(o,l,u,f,v){const _=Math.sqrt(u*u+f*f);return v+=Math.atan2(f,u),{x:o+_*Math.cos(v),y:l+_*Math.sin(v)}}function i(o){const{x:l,y:u,width:f,height:v}=o,_=r.default.Util.degToRad(o.rotation),g=n(l,u,0,0,_),h=n(l,u,f,0,_),w=n(l,u,f,v,_),E=n(l,u,0,v,_),S=Math.min(g.x,h.x,w.x,E.x),b=Math.min(g.y,h.y,w.y,E.y),p=Math.max(g.x,h.x,w.x,E.x),d=Math.max(g.y,h.y,w.y,E.y);return{x:S,y:b,width:p-S,height:d-b,minX:S,minY:b,maxX:p,maxY:d}}function a(o){const l=o.map(g=>i(g)),u=Math.min(...l.map(g=>g.minX)),f=Math.min(...l.map(g=>g.minY)),v=Math.max(...l.map(g=>g.maxX)),_=Math.max(...l.map(g=>g.maxY));return{x:u,y:f,width:v-u,height:_-f,minX:u,minY:f,maxX:v,maxY:_}}t.getClientRect=i,t.getTotalClientRect=a})(Rp);(function(t){var e=me&&me.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(t,"__esModule",{value:!0}),t.useAnchorSnap=t.useSnap=void 0;const r=e(at),n=e(ci),i=Rp;var a=5;function o(_){const g=_.__getNodeRect(),h=(0,i.getClientRect)(Object.assign(Object.assign({},g),{rotation:n.default.Util.radToDeg(g.rotation)})),w=_.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(_,g){var h=[],w=[];_.vertical.forEach(m=>{g.vertical.forEach(y=>{var x=Math.abs(m-y.guide);x<a&&h.push({lineGuide:m,diff:x,snap:y.snap,offset:y.offset})})}),_.horizontal.forEach(m=>{g.horizontal.forEach(y=>{var x=Math.abs(m-y.guide);x<a&&w.push({lineGuide:m,diff:x,snap:y.snap,offset:y.offset})})});var E=[];const S=h.sort((m,y)=>m.diff-y.diff),b=w.sort((m,y)=>m.diff-y.diff);var p=S[0],d=b[0];return p&&S.filter(m=>Math.abs(m.diff-p.diff)<.1).forEach(m=>{E.push(Object.assign({orientation:"V"},m))}),d&&b.filter(m=>Math.abs(m.diff-d.diff)<.1).forEach(m=>{E.push(Object.assign({orientation:"H"},m))}),E}function u(_){const g=p=>p.hasName("element")||p.hasName("page-background")||p.hasName("elements-area");function h(p){var d;const m=(d=_.current)===null||d===void 0?void 0:d.getStage();var y=[],x=[];return m.find(g).forEach(P=>{if(!(p.indexOf(P)>=0)){var O=P.getClientRect({skipShadow:!0,skipStroke:!0});y.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:y,horizontal:x}}function w(p){var d;const m=(d=_.current)===null||d===void 0?void 0:d.getLayer(),y=m==null?void 0:m.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]});y==null||y.add(P),m.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]}),y==null||y.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 m=p.target.getAbsolutePosition(),y=Object.assign({},m);d.forEach(O=>{switch(O.snap){case"start":case"center":case"end":switch(O.orientation){case"V":y.x=O.lineGuide+O.offset;break;case"H":y.y=O.lineGuide+O.offset}}});const x=y.x-m.x,P=y.y-m.y;p.evt.ctrlKey||p.evt.metaKey||p.target.nodes().forEach(O=>{const N=O.getAbsolutePosition();O.setAbsolutePosition({x:N.x+x,y:N.y+P})})},S=(p,d,m)=>{const y=_.current,x=y.getLayer();if(x.children.find(M=>M.name()==="line-guides").destroyChildren(),y.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(y.nodes()),{vertical:[{guide:d.x,offset:0,snap:"start"}],horizontal:[{guide:d.y,offset:0,snap:"start"}]});if(!P.length||(w(P),m.ctrlKey||m.metaKey))return d;let O=d.x,N=d.x;P.forEach(M=>{switch(M.orientation){case"V":O=M.lineGuide;break;case"H":N=M.lineGuide}});const T=Math.abs(d.x-O)<10,R=Math.abs(d.y-N)<10;return T&&!R?{x:O,y:p.y}:R&&!T?{x:p.x,y:N}:T&&R?{x:O,y:N}:d},b=p=>{if(!p.target)return;const d=p.target.getLayer();d.children.find(m=>m.name()==="line-guides").destroyChildren(),d.batchDraw()};r.default.useEffect(()=>{_.current&&(_.current.anchorDragBoundFunc(S),_.current.on("dragstart",()=>{setTimeout(()=>{const p=[...n.default.DD._dragElements.entries()];p.reverse(),n.default.DD._dragElements.clear(),p.forEach(([d,m])=>{n.default.DD._dragElements.set(d,m)})})}),_.current.on("dragmove",E),_.current.on("dragend",b),_.current.on("transformend",b),_.current.on("transform",p=>{var d,m;p.evt.ctrlKey||p.evt.metaKey?(d=_.current)===null||d===void 0||d.rotationSnapTolerance(0):(m=_.current)===null||m===void 0||m.rotationSnapTolerance(5)}))},[])}function f(_){return{vertical:[{guide:_.absolutePosition().x,offset:0,snap:"center"}],horizontal:[{guide:_.absolutePosition().y,offset:0,snap:"center"}]}}function v(_,g,h){const w=b=>b.hasName("element")||b.hasName("line-anchor")||b.hasName("page-background")||b.hasName("elements-area"),E=b=>{b.target.getLayer().children.find(P=>P.name()==="line-guides").destroyChildren();var p=l(function(P){var O;const N=(O=_.current)===null||O===void 0?void 0:O.getStage();var T=[],R=[];return N.find(w).forEach(M=>{if(!(P.indexOf(M)>=0)){var D=M.getClientRect({skipShadow:!0,skipStroke:!0});M.hasName("line-anchor")&&(D={x:M.absolutePosition().x,y:M.absolutePosition().y,width:0,height:0}),T.push(D.x,D.x+D.width,D.x+D.width/2),R.push(D.y,D.y+D.height,D.y+D.height/2)}}),{vertical:T,horizontal:R}}([b.target,...g.map(P=>P.current)]),f(b.target));if(!p.length)return;(function(P){var O;const N=(O=_.current)===null||O===void 0?void 0:O.getLayer(),T=N==null?void 0:N.children.find(R=>R.name()==="line-guides");P.forEach(R=>{if(R.orientation==="H"){var M=new n.default.Line({points:[-6e3,R.lineGuide,6e3,R.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});T==null||T.add(M),N.batchDraw()}else R.orientation==="V"&&(M=new n.default.Line({points:[R.lineGuide,-6e3,R.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),T==null||T.add(M))})})(p);const d=b.target.getAbsolutePosition(),m=Object.assign({},d);p.forEach(P=>{switch(P.snap){case"start":case"center":case"end":switch(P.orientation){case"V":m.x=P.lineGuide+P.offset;break;case"H":m.y=P.lineGuide+P.offset}}});const y=m.x-d.x,x=m.y-d.y;if(!(b.evt.ctrlKey||b.evt.metaKey)){const P=b.target.getAbsolutePosition();b.target.absolutePosition({x:P.x+y,y:P.y+x})}},S=b=>{if(!b.target)return;const p=b.target.getLayer();p.children.find(d=>d.name()==="line-guides").destroyChildren(),p.batchDraw()};r.default.useEffect(()=>{_.current&&(_.current.on("dragmove",E),_.current.on("dragend",S))},h)}t.useSnap=u,t.useAnchorSnap=v})(M1);(function(t){var e=me&&me.__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=Ni,i=co,a=Cc,o=Fs,l=M1,u=hl;function f(h){const{x:w,y:E,width:S,height:b,rotation:p}=h.a,d=p*Math.PI/180,m={x:w+b/2*Math.cos(d+Math.PI/2),y:E+b/2*Math.sin(d+Math.PI/2)};return{middleLeft:m,middleRight:{x:m.x+S*Math.cos(d),y:m.y+S*Math.sin(d)}}}function v(h,w,E){const S=Math.sqrt(Math.pow(w.x-h.x,2)+Math.pow(w.y-h.y,2)),b=Math.atan2(w.y-h.y,w.x-h.x),p=180*b/Math.PI;return{x:h.x+Math.cos(b-Math.PI/2)*E/2,y:h.y+Math.sin(b-Math.PI/2)*E/2,width:S,height:E,rotation:p}}t.getMiddlePoints=f,t.getLinePositionFromMiddlePoints=v;const _=(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()}}),g=(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),b=r.default.useRef(null),p=h.selectable||w.role==="admin",d=(0,u.useMobile)(),[m,y]=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)(b,[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(N=>N*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:()=>{y(!0)},onMouseLeave:()=>{y(!1)},onDragMove:N=>{h.set({x:N.target.x(),y:N.target.y()})},onDragEnd:N=>{h.set({x:N.target.x(),y:N.target.y()})},onTransform:N=>{const T=N.target.scaleX();N.target.scaleX(1),N.target.scaleY(1),h.set({height:h.height*T,width:h.width*T,x:N.target.x(),y:N.target.y(),rotation:N.target.rotation()})}}),r.default.createElement(i.Group,{x:P.x,y:P.y,rotation:h.rotation},r.default.createElement(g,{element:h,type:h.startHead})),r.default.createElement(i.Group,{x:O.x,y:O.y,rotation:h.rotation+180},r.default.createElement(g,{element:h,type:h.endHead})),m&&!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"},_(w.scale,w),{onDragMove:N=>{const T=v(N.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:b,name:"line-anchor"},_(w.scale,w),{onDragMove:N=>{const T=v(P,N.target.position(),h.height);h.set({x:T.x,y:T.y,width:T.width,rotation:T.rotation})}})))))})})(T8);var C8={};(function(t){var e=me&&me.__createBinding||(Object.create?function(C,A,j,z){z===void 0&&(z=j);var H=Object.getOwnPropertyDescriptor(A,j);H&&!("get"in H?!A.__esModule:H.writable||H.configurable)||(H={enumerable:!0,get:function(){return A[j]}}),Object.defineProperty(C,z,H)}:function(C,A,j,z){z===void 0&&(z=j),C[z]=A[j]}),r=me&&me.__setModuleDefault||(Object.create?function(C,A){Object.defineProperty(C,"default",{enumerable:!0,value:A})}:function(C,A){C.default=A}),n=me&&me.__importStar||function(C){if(C&&C.__esModule)return C;var A={};if(C!=null)for(var j in C)j!=="default"&&Object.prototype.hasOwnProperty.call(C,j)&&e(A,C,j);return r(A,C),A},i=me&&me.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoElement=t.useImageLoader=t.setImageLoaderHook=void 0;const a=i(at),o=Ni,l=sa,u=co,f=i(Tp),v=i(ci),_=Cc,g=Fs,h=aa,w=n(zs),E=zn,S=Nc,b=fl,p=hl;function d(){return document.createElement("canvas")}async function m(C){if(!(C.indexOf("data:image/svg+xml")>=0||C.indexOf(".svg")>=0))return C;const A=await w.urlToString(C),j=w.fixSize(A);return w.svgToURL(j)}const y=C=>{const[A,j]=a.default.useState(C);return a.default.useEffect(()=>{(async()=>{const z=await m(C);z!==A&&j(z)})()},[C]),A},x=new window.Image;x.src=w.svgToURL(`
|
|
191
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
192
|
+
<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"/>
|
|
193
|
+
<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"/>
|
|
194
|
+
</svg>
|
|
195
|
+
`);const P=new window.Image;P.src=w.svgToURL(`
|
|
196
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
197
|
+
<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"/>
|
|
198
|
+
<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"/>
|
|
199
|
+
<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"/>
|
|
200
|
+
<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"/>
|
|
201
|
+
</svg>
|
|
202
|
+
`);function O(C,A,j,z,H,Y,q){for(var U=new ImageData(A,j),X=new Int32Array(C.data.buffer),Q=C.width,Z=new Int32Array(U.data.buffer),re=U.width,ee=A/Y,le=j/q,ce=Math.round(1/ee),_e=Math.round(1/le),Le=ce*_e,Oe=0;Oe<U.height;Oe++)for(var ae=0;ae<re;ae++){for(var de=z+Math.round(ae/ee)+(H+Math.round(Oe/le))*Q,ye=0,we=0,te=0,ue=0,fe=0;fe<_e;fe++)for(var be=0;be<ce;be++){var Te=X[de+be+fe*Q];ye+=Te<<24>>>24,we+=Te<<16>>>24,te+=Te<<8>>>24,ue+=Te>>>24}ye=Math.round(ye/Le),we=Math.round(we/Le),te=Math.round(te/Le),ue=Math.round(ue/Le),Z[ae+Oe*re]=ue<<24|te<<16|we<<8|ye}return U}function N(C,A){var j,z;const H=d();H.width=C.width,H.height=C.height,(j=H.getContext("2d"))===null||j===void 0||j.drawImage(C,0,0,H.width,H.height);const Y=O(H.getContext("2d").getImageData(0,0,H.width,H.height),Math.floor(H.width*A),Math.floor(H.height*A),0,0,H.width,H.height);return H.width=Math.floor(H.width*A),H.height=Math.floor(H.height*A),(z=H.getContext("2d"))===null||z===void 0||z.putImageData(Y,0,0),H}const T=(C,A,j,z,H=0,Y=!1)=>{const q=Math.floor(Math.max(C.width*z,1)),U=Math.floor(Math.max(C.height*z,1)),X=Math.min(H*z,q/2,U/2),Q=Math.max(C.width/j.width,C.height/j.height)*z,Z=C.page._exporting&&E.flags.imageDownScalingEnabled&&Q<1&&!Y,re=j.x===0&&j.y===0&&j.width===(A==null?void 0:A.width)&&j.height===(A==null?void 0:A.height),ee=a.default.useMemo(()=>{if(!(!A||!A.width||!A.height))return re&&X===0&&!Z?void 0:d()},[A,X,Z,re]);return a.default.useLayoutEffect(()=>{if(!ee||!A)return;ee.width=q,ee.height=U;const le=ee.getContext("2d");if(!le)return;X&&(le.beginPath(),le.moveTo(X,0),le.lineTo(q-X,0),le.arc(q-X,X,X,3*Math.PI/2,0,!1),le.lineTo(q,U-X),le.arc(q-X,U-X,X,0,Math.PI/2,!1),le.lineTo(X,U),le.arc(X,U-X,X,Math.PI/2,Math.PI,!1),le.lineTo(0,X),le.arc(X,X,X,Math.PI,3*Math.PI/2,!1),le.clip());const ce=Z?N(A,Q):A,_e=Z?{x:Math.floor(j.x*Q),y:Math.floor(j.y*Q),width:Math.floor(j.width*Q),height:Math.floor(j.height*Q)}:j;le.drawImage(ce,_e.x,_e.y,_e.width,_e.height,0,0,ee.width,ee.height)},[ee,C.width,C.height,j.x,j.y,j.width,j.height,H,z,Y,C.page._exporting,Z]),a.default.useEffect(()=>()=>{ee&&ee.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(ee)},[ee]),ee||A},R=(C,A,j,z)=>{const H=y(C.clipSrc||""),[Y,q]=F(H,"anonymous"),U=C.clipSrc?q:"loaded";(0,t.useImageLoader)(U,C.id+"-clip");const X=a.default.useMemo(()=>{if(A&&Y)return d()},[A,Y]);return a.default.useLayoutEffect(()=>{var Q;if(!Y||!A||!A.width||!A.height||!Y||!Y.width||!Y.height||!X)return;const Z=d(),re=Math.max(C.width/Y.width*j,C.height/Y.height*j);Z.width=Y.width*re,Z.height=Y.height*re,(Q=Z.getContext("2d"))===null||Q===void 0||Q.drawImage(Y,0,0,Z.width,Z.height),X.width=Math.max(A.width,1),X.height=Math.max(A.height,1);const ee=X.getContext("2d");ee&&(ee.save(),ee.drawImage(Z,0,0,A.width,A.height),v.default.Util.releaseCanvas(Z),ee.globalCompositeOperation="source-in",ee.drawImage(A,0,0,X.width,X.height),ee.restore())},[X,A,Y,C.width,C.height,j,...z]),C.clipSrc&&Y?X:A},M=d(),D=(0,o.observer)(({element:C})=>{const A=Math.min(30,C.width/4,C.height/4),j=a.default.useRef(null);return a.default.useEffect(()=>{const z=j.current;if(!z)return;const H=new v.default.Animation(Y=>{z.rotate(((Y==null?void 0:Y.timeDiff)||0)/2)},z.getLayer());return H.start(),()=>{H.stop()}}),a.default.createElement(u.Group,{x:C.x,y:C.y,rotation:C.rotation,listening:!1,opacity:C.a.opacity,hideInExport:!C.showInExport},a.default.createElement(u.Rect,{width:C.width,height:C.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:j,x:C.width/2,y:C.height/2,fill:"white",outerRadius:Math.abs(A),innerRadius:Math.max(1,A-5),angle:270}))}),G=(0,o.observer)(({element:C})=>{const A="Can not load the video...",j=Math.max(10,Math.min(30,C.width/25));return a.default.createElement(u.Group,{x:C.x,y:C.y,rotation:C.rotation,listening:!1,opacity:C.a.opacity,hideInExport:!C.showInExport},a.default.createElement(u.Rect,{width:C.width,height:C.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:A,fontSize:j,width:C.width,height:C.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let F=f.default;const K=C=>{F=C};t.setImageLoaderHook=K;const B=(C,A)=>{const j=a.default.useRef(),z=()=>{var H;(H=j.current)===null||H===void 0||H.call(j),j.current=void 0};a.default.useEffect(()=>z,[]),a.default.useLayoutEffect(()=>{C!=="loading"||j.current||(j.current=(0,h.incrementLoader)(`video ${A}`)),C!=="loading"&&z(),C==="failed"&&(0,h.triggerLoadError)(`video ${A}`)},[C])};t.useImageLoader=B;function $(C,A){for(var j=C.buffered,z=0;z<j.length;z++)if(A>=j.start(z)&&A<=j.end(z))return!0;return!1}function W(C,A,j){const z=a.default.useRef("loading"),H=a.default.useRef(),[Y,q]=a.default.useState(0),U=a.default.useRef(),X=a.default.useRef(),Q=a.default.useRef();return U.current===C&&X.current===A&&Q.current===j||(z.current="loading",H.current=void 0,U.current=C,X.current=A,Q.current=j),a.default.useLayoutEffect(function(){if(C){var Z=document.createElement("video");return Z.addEventListener("canplay",re),Z.addEventListener("error",ee),A&&(Z.crossOrigin=A),j&&(Z.referrerpolicy=j),Z.src=C,function(){Z.removeEventListener("canplay",re),Z.removeEventListener("error",ee)}}function re(){z.current="loaded",H.current=Z,q(Math.random())}function ee(le){z.current="failed",H.current=void 0,q(Math.random())}},[C,A,j]),[H.current,z.current]}t.VideoElement=(0,o.observer)(({element:C,store:A})=>{var j;const[z,H]=a.default.useState(!1),Y=a.default.useRef(null),q=a.default.useRef(null),[U,X]=a.default.useState(!1),Q=A.selectedElements.indexOf(C)>=0,[Z,re]=a.default.useState(!1),[ee,le]=W(C.src,"anonymous");(0,t.useImageLoader)(le,C.id+"-video"),ee&&(ee.muted=!0,ee.width=ee.videoWidth,ee.height=ee.videoHeight);const ce=ee||M;a.default.useEffect(()=>{ee&&A.history.ignore(()=>{C.set({duration:1e3*ee.duration})})},[ee]),a.default.useEffect(()=>{var Ee;if(!ee)return;const qe=A.isPlaying||Z;if(!qe)return void ee.pause();qe&&(ee.currentTime=C.startTime*ee.duration,ee.play());const Ze=new v.default.Animation(()=>{},(Ee=Y.current)===null||Ee===void 0?void 0:Ee.getLayer());Ze.start();const pt=()=>{re(!1),ee.currentTime=C.startTime*ee.duration},Ne=()=>{ee.currentTime>=C.endTime*ee.duration&&(ee.pause(),ee.currentTime=C.startTime*ee.duration,re(!1))};return ee.addEventListener("ended",pt),ee.addEventListener("timeupdate",Ne),()=>{Ze.stop(),ee.removeEventListener("ended",pt),ee.removeEventListener("timeupdate",Ne)}},[ee,Z,A.isPlaying]),a.default.useEffect(()=>(0,l.autorun)(()=>{var Ee,qe;if(ee){const Ze=(A.currentTime-C.page.startTime)%C.duration;ee.currentTime=Ze/1e3,(qe=(Ee=Y.current)===null||Ee===void 0?void 0:Ee.getLayer())===null||qe===void 0||qe.batchDraw()}}),[A,ee]),a.default.useEffect(()=>{if(!ee)return;let Ee=null;const qe=()=>{$(ee,ee.currentTime)||(Ee&&console.error("finish already exists"),Ee=(0,h.incrementLoader)(`video ${C.id}`))},Ze=()=>{Ee&&(Ee(),Ee=null)};return ee.addEventListener("timeupdate",qe),ee.addEventListener("canplay",Ze),()=>{ee.removeEventListener("timeupdate",qe),ee.removeEventListener("canplay",Ze)}},[ee,C.id,h.incrementLoader]);let{cropX:_e,cropY:Le,cropWidth:Oe,cropHeight:ae}=C;le!=="loaded"&&(_e=Le=0,Oe=ae=1);const de=ce.width*Oe,ye=ce.height*ae,we=C.width/C.height;let te,ue;const fe=de/ye,be=C.type==="svg";be?(te=de,ue=ye):we>=fe?(te=de,ue=de/we):(te=ye*we,ue=ye);const Te={x:ce.width*_e,y:ce.height*Le,width:te,height:ue},Ye=(j=C.cornerRadius)!==null&&j!==void 0?j:0;let Ke=R(C,T(C,ce,Te,A._elementsPixelRatio,Ye,z||C._cropModeEnabled||C.type==="svg"),A._elementsPixelRatio,[Te,Ye,A._elementsPixelRatio]);const Ce=Math.max(C.width/te,C.height/ue);a.default.useEffect(()=>{var Ee;if(!C._cropModeEnabled)return;const qe=(Ee=Y.current)===null||Ee===void 0?void 0:Ee.getStage();function Ze(Ne){C._cropModeEnabled&&Ne.target!==q.current&&C.toggleCropMode(!1)}function pt(Ne){C._cropModeEnabled&&Ne.target.nodeName!=="CANVAS"&&C.toggleCropMode(!1)}return document.body.addEventListener("click",pt),qe==null||qe.on("click",Ze),qe==null||qe.on("tap",Ze),()=>{document.body.removeEventListener("click",pt),document.body.removeEventListener("touchstart",pt),qe==null||qe.off("click",Ze),qe==null||qe.off("click",Ze)}},[C._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(z||C._cropModeEnabled))return(0,S.applyFilter)(Y.current,C),(0,l.autorun)(()=>{(0,S.applyFilter)(Y.current,C)},{delay:100})},[ce,z,Oe,ae,C._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Ee;z||C._cropModeEnabled?(Ee=Y.current)===null||Ee===void 0||Ee.clearCache():(0,S.applyFilter)(Y.current,C)},[z,C.width,C.height,C._cropModeEnabled]),a.default.useEffect(()=>{(0,S.applyFilter)(Y.current,C)},[C.shadowEnabled,C.shadowBlur,C.cornerRadius,C.shadowColor,C.shadowOffsetX,C.shadowOffsetY,C.shadowOpacity]);const Be=a.default.useRef(null),et=a.default.useRef(null),Xe=a.default.useRef(null);a.default.useLayoutEffect(()=>{C._cropModeEnabled&&(et.current.nodes([Be.current]),Xe.current.nodes([q.current]))},[C._cropModeEnabled]);const se=Ee=>{Math.round(Ee.target.x())>0&&(Ee.target.x(0),Ee.target.scaleX(1)),Math.round(Ee.target.y())>0&&(Ee.target.y(0),Ee.target.scaleY(1));const qe=Ee.target.width()*Ee.target.scaleX(),Ze=Ee.target.height()*Ee.target.scaleY(),pt=Math.min(1,te/qe),Ne=Math.min(1,ue/Ze),Qe=1-pt,ht=Math.min(Qe,Math.max(0,Math.round(-Ee.target.x())/qe)),wt=1-Ne,Ft=Math.min(wt,Math.max(0,Math.round(-Ee.target.y())/Ze));Ee.target.setAttrs({x:-ht*ce.width,y:-Ft*ce.height,scaleX:1,scaleY:1}),C.set({cropX:ht,cropY:Ft,cropWidth:pt,cropHeight:Ne})},ne=()=>{C.type!=="svg"&&C.contentEditable&&setTimeout(()=>{C.toggleCropMode(!0)})},Ae=le==="loading",Me=le==="failed",ve=!Ae&&!Me,Re=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Se=ve?C.a.opacity:0;(0,b.useFadeIn)(Y,Se);const $e=C.selectable||A.role==="admin",xt=(0,p.useMobile)();return a.default.createElement(a.default.Fragment,null,Ae&&a.default.createElement(D,{element:C}),Me&&a.default.createElement(G,{element:C}),a.default.createElement(u.Image,{ref:Y,name:"element",id:C.id,image:ce,x:C.x,y:C.y,width:C.width||1,height:C.height||1,rotation:C.rotation,opacity:Se,shadowEnabled:C.shadowEnabled,shadowBlur:C.shadowBlur,shadowOffsetX:C.shadowOffsetX,shadowOffsetY:C.shadowOffsetY,shadowColor:C.shadowColor,shadowOpacity:C.shadowOpacity,customCrop:Te,listening:$e,cropX:Te.x,cropY:Te.y,cropWidth:Te.width,cropHeight:Te.height,draggable:xt?C.draggable&&Q:C.draggable,preventDefault:!xt||Q,hideInExport:!C.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:Ee=>{C.set({x:Ee.target.x(),y:Ee.target.y()})},onDragEnd:Ee=>{C.set({x:Ee.target.x(),y:Ee.target.y()})},onDblClick:ne,onDblTap:ne,onTransformStart:()=>{H(!0),Re.current={cropX:C.cropX,cropY:C.cropY,cropWidth:C.cropWidth,cropHeight:C.cropHeight}},onTransform:Ee=>{var qe;const Ze=Ee.currentTarget,pt=Math.abs(Ze.scaleX()-1)<1e-7?1:Ze.scaleX(),Ne=Math.abs(Ze.scaleY()-1)<1e-7?1:Ze.scaleY();Ze.scaleX(1),Ze.scaleY(1);const Qe=(qe=Ee.target.getStage())===null||qe===void 0?void 0:qe.findOne("Transformer"),ht=1-te/ce.width,wt=Math.min(ht,Math.max(0,C.cropX)),Ft=1-ue/ce.height,zr=Math.min(Ft,Math.max(0,C.cropY)),Br=Qe.getActiveAnchor(),ir=!(Br.indexOf("middle")>=0||Br.indexOf("center")>=0),fn=!ir&&pt<1&&Re.current.cropHeight>ue/ce.height;let Gn=ir?C.cropWidth:C.cropWidth*pt;fn&&(Gn=C.cropWidth);const fi=!ir&&Ne<1&&Re.current.cropWidth>te/ce.width;let kr=ir?C.cropHeight:C.cropHeight*Ne;fi&&(kr=C.cropHeight),be&&(Gn=C.cropWidth,kr=C.cropHeight),C.set({cropX:wt,cropY:zr,x:Ze.x(),y:Ze.y(),width:Ze.width()*pt,height:Ze.height()*Ne,rotation:Ee.target.rotation(),cropWidth:Math.min(Gn,1-wt),cropHeight:Math.min(kr,1-zr)})},onTransformEnd:Ee=>{const qe=Ee.currentTarget;C.set({width:qe.width(),height:qe.height(),x:qe.x(),y:qe.y(),rotation:Ee.target.rotation(),cropWidth:te/ce.width,cropHeight:ue/ce.height}),H(!1)}}),a.default.createElement(u.Rect,{x:C.x,y:C.y,width:Math.max(C.width-C.borderSize,0),height:Math.max(C.height-C.borderSize,0),opacity:Se,offsetX:-C.borderSize/2,offsetY:-C.borderSize/2,stroke:C.borderColor,strokeWidth:C.borderSize,listening:!1,visible:!!C.borderSize,rotation:C.rotation,cornerRadius:Math.max(0,Ye-C.borderSize),hideInExport:!C.showInExport}),!Z&&a.default.createElement(u.Image,{image:x,x:C.x+C.width/2-20,y:C.y+C.height/2-20,width:40,height:40,hideInExport:!0,onClick:()=>{re(!0)}}),Z&&a.default.createElement(u.Image,{image:P,x:C.x+C.width/2-20,y:C.y+C.height/2-20,width:40,height:40,hideInExport:!0,onClick:()=>{re(!1)}}),C._cropModeEnabled&&a.default.createElement(_.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/A.scale,y:-window.innerWidth/A.scale,width:window.innerWidth/A.scale*3,height:window.innerWidth/A.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:Ke,x:C.x,y:C.y,width:C.width,height:C.height,rotation:C.rotation,shadowEnabled:C.shadowEnabled,shadowBlur:C.shadowBlur}),a.default.createElement(u.Group,{x:C.x,y:C.y,rotation:C.rotation,scaleX:Ce,scaleY:Ce},a.default.createElement(u.Image,{image:ce,ref:q,opacity:.4,draggable:!0,x:-C.cropX*ce.width,y:-C.cropY*ce.height,onDragMove:se,onTransform:se}),a.default.createElement(u.Transformer,{ref:Xe,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ee,qe)=>qe.width<5||qe.height<5?Ee:qe,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:te,height:ue,ref:Be,listening:!1,onTransform:Ee=>{Ee.target.x()<-C.cropX*ce.width-1e-9&&(Ee.target.x(-C.cropX*ce.width),Ee.target.scaleX(1)),Ee.target.y()<-C.cropY*ce.height-1e-9&&(Ee.target.y(-C.cropY*ce.height),Ee.target.scaleY(1));const qe=Math.min(1,Math.max(0,C.cropX+Ee.target.x()/ce.width)),Ze=Math.min(1,Math.max(0,Ee.target.y()/ce.height+C.cropY)),pt=Ee.target.width()*Ee.target.scaleX(),Ne=Ee.target.height()*Ee.target.scaleY(),Qe=Math.min(1-qe,pt/ce.width),ht=Math.min(1-Ze,Ne/ce.height),wt=Ee.target.getAbsolutePosition(Ee.target.getParent().getParent());Ee.target.scale({x:1,y:1}),Ee.target.position({x:0,y:0}),C.set({x:wt.x,y:wt.y,cropX:qe,cropY:Ze,cropWidth:Qe,cropHeight:ht,width:Math.min(pt*Ce,ce.width*(1-qe)*Ce),height:Math.min(Ne*Ce,ce.height*(1-Ze)*Ce)})}}),a.default.createElement(u.Transformer,{ref:et,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ee,qe)=>qe.width<5||qe.height<5?Ee:qe,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(U||Q)&&a.default.createElement(g.Highlighter,{element:C}))})})(C8);(function(t){var e=me&&me.__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=Ni,i=O1,a=A1,o=_8,l=T8,u=C8,f=co,v=zn,_=(0,n.observer)(E=>{const{element:S,store:b}=E,{children:p}=S,d=S.selectable||b.role==="admin";return r.default.createElement(f.Group,{opacity:S.opacity,listening:d},p.map(m=>r.default.createElement(w,Object.assign({},E,{key:m.id,store:b,element:m}))))}),g={text:i.TextElement,image:a.ImageElement,svg:a.ImageElement,line:l.LineElement,video:u.VideoElement,group:_};function h(E,S){g[E]=S}t.registerShapeComponent=h;const w=(0,n.observer)(E=>{let S=g[E.element.type];return E.element.type==="text"&&v.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})(h8);var R8={};(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})(R8);var h0={},p0={},T3;function nL(){return T3||(T3=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=L1();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.
|
|
203
|
+
For production usage you have to use your own API endpoint.
|
|
204
|
+
https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
|
|
205
|
+
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:m})=>`${t.API}/get-templates?${m}&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,m=" ",y="-",d.replace(new RegExp(m,"g"),y)}.png`;var d,m,y};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 v=()=>`${t.API}/get-text-templates?KEY=${(0,e.getKey)()}`;t.textTemplateList=v;const _=p=>t.URLS.unsplashList(p);t.unsplashList=_;const g=p=>t.URLS.unsplashDownload(p);t.unsplashDownload=g;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 b=(p,d)=>{t.URLS[p]=d};t.setAPI=b}(p0)),p0}var C3;function L1(){return C3||(C3=1,function(t){var e=me&&me.__createBinding||(Object.create?function(x,P,O,N){N===void 0&&(N=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,N,T)}:function(x,P,O,N){N===void 0&&(N=O),x[N]=P[O]}),r=me&&me.__setModuleDefault||(Object.create?function(x,P){Object.defineProperty(x,"default",{enumerable:!0,value:P})}:function(x,P){x.default=P}),n=me&&me.__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(sa),a=nL(),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 v=5,_=3e3,g="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 b=navigator.userAgent.indexOf("Headless")>-1,p=navigator.userAgent.indexOf("Electron")>-1;S==="file://"&&b&&(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 m(x){for(let P=0;P<v;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(g),!1;if(O.status!==200){await new Promise(T=>setTimeout(T,_));continue}const N=await O.json();return N.is_valid||console.warn(h),N.is_paid||console.log(E,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),N.is_domain_valid||console.log(d,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,o.useRemoveBackground)(N.remove_background_enabled),N.is_paid||!1}catch{await new Promise(N=>setTimeout(N,_))}return console.error(w),!0}async function y(x,P){u=x,await m(x)&&!P||l()}t.isKeyPaid=m,t.validateKey=y}(h0)),h0}var Np={};(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})(Np);(function(t){var e=me&&me.__rest||function(B,$){var W={};for(var C in B)Object.prototype.hasOwnProperty.call(B,C)&&$.indexOf(C)<0&&(W[C]=B[C]);if(B!=null&&typeof Object.getOwnPropertySymbols=="function"){var A=0;for(C=Object.getOwnPropertySymbols(B);A<C.length;A++)$.indexOf(C[A])<0&&Object.prototype.propertyIsEnumerable.call(B,C[A])&&(W[C[A]]=B[C[A]])}return W},r=me&&me.__importDefault||function(B){return B&&B.__esModule?B:{default:B}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerNextDomDrop=t.registerTransformerAttrs=t.setTransformerStyle=void 0;const n=r(at),i=Ni,a=sa,o=co,l=r(Tp),u=r(ci),f=r(h8),v=M1,_=A1,g=R8,h=L1(),w=Rp,E=Np,S=zn,b=hl,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}),m={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:B=>{B.hasName("rotater")&&B.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"})}},y=B=>{Object.assign(m,B)};t.setTransformerStyle=y;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(B,$){x[B]=x[B]||$,Object.assign(x[B],$)}t.registerTransformerAttrs=P;const O=B=>n.default.createElement(o.Rect,Object.assign({},B,{preventDefault:!1})),N=B=>{var{url:$}=B,W=e(B,["url"]);const[C,A]=(0,l.default)($,"anonymous"),j=C?(0,g.getCrop)(C,{width:W.width,height:W.height},"center-middle"):{};return(0,_.useImageLoader)(A,"background"),n.default.createElement(o.Image,Object.assign({image:C},W,j))},T=B=>n.default.createElement(o.Rect,Object.assign({},B)),R=B=>{const{background:$,scale:W,borderColor:C}=B,A=e(B,["background","scale","borderColor"]),j=n.default.useMemo(()=>!!u.default.Util.colorToRGBA($),[$]),z=n.default.useMemo(()=>{const H=document.createElement("canvas"),Y=30;H.width=60,H.height=60;const q=H.getContext("2d");return q&&(q.fillStyle="black",q.fillRect(Y,0,Y,Y),q.fillRect(0,Y,Y,Y)),H},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:z},A,{opacity:.1,hideInExport:!0})),j?n.default.createElement(T,Object.assign({fill:$},A)):n.default.createElement(N,Object.assign({url:$},A)))},M=(0,i.observer)(({selection:B})=>B.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(B.x1,B.x2),y:Math.min(B.y1,B.y2),width:Math.abs(B.x1-B.x2),height:Math.abs(B.y1-B.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),D=(0,i.observer)(({x:B,y:$,width:W,height:C,rotation:A,anchor:j,store:z})=>{const H=(0,w.getClientRect)({x:B,y:$,width:W,height:C,rotation:u.default.Util.radToDeg(A)});if(j===void 0)return null;const Y=(C/2+70)*Math.cos(A-Math.PI/2),q=(C/2+70)*Math.sin(A-Math.PI/2),U=(0,E.pxToUnitRounded)({unit:z.unit,dpi:z.dpi,px:W/z.scale,precious:z.unit==="px"?0:1})+" x "+(0,E.pxToUnitRounded)({unit:z.unit,dpi:z.dpi,px:C/z.scale,precious:z.unit==="px"?0:1})+(z.unit==="px"?"":" "+z.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(H.minX+H.maxX)/2+Y,y:(H.minY+H.maxY)/2+q,offsetX:14,offsetY:14,visible:j==="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(A)).toString()+"°"})),n.default.createElement(o.Label,{x:(H.minX+H.maxX)/2,y:H.maxY+20,visible:j!=="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})))}),G=(0,i.observer)(({elements:B,store:$})=>{const W=B.filter(A=>A.alwaysOnTop),C=B.filter(A=>!A.alwaysOnTop).concat(W);return n.default.createElement(n.default.Fragment,null,C.map(A=>n.default.createElement(f.default,{key:A.id,store:$,element:A,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let F=null;const K=B=>{F=B};t.registerNextDomDrop=K,t.default=(0,i.observer)(({store:B,page:$,width:W,height:C,pageControlsEnabled:A,backColor:j,pageBorderColor:z,activePageBorderColor:H,components:Y,bleedColor:q})=>{const U=B.bleedVisible?$.bleed:0,X=$.computedWidth+2*U,Q=$.computedHeight+2*U,Z=(W-X*B.scale)/2,re=(C-Q*B.scale)/2,ee=n.default.useRef(null),le=n.default.useRef(null),ce=n.default.useRef(null),_e=A==null||A,[Le,Oe]=n.default.useState(null),[ae,de]=n.default.useState({}),ye=B.selectedElements.find(ne=>ne._cropModeEnabled),we=B.selectedShapes.filter(ne=>!ne.resizable).length>0,te=B.selectedShapes.filter(ne=>!ne.draggable).length>0,ue=B.selectedElements.filter(ne=>!ne.visible).length>0;n.default.useLayoutEffect(()=>{var ne,Ae,Me;if(!ee.current)return;const ve=ee.current.getStage(),Re=B.selectedShapes.map($e=>$e._cropModeEnabled?null:ve.findOne("#"+$e.id)).filter($e=>$e),Se=B.selectedElements.length===1&&((ne=B.selectedElements[0])===null||ne===void 0?void 0:ne.type)||"many";x[Se]?(ee.current.setAttrs(Object.assign(Object.assign({},m),x[Se])),Se!=="svg"&&Se!=="image"||B.selectedElements[0].keepRatio||ee.current.setAttrs({enabledAnchors:m.enabledAnchors}),Se==="text"&&S.flags.textVerticalResizeEnabled&&ee.current.setAttrs({enabledAnchors:(Ae=x.text.enabledAnchors)===null||Ae===void 0?void 0:Ae.concat(["bottom-center"])})):ee.current.setAttrs(m),we&&ee.current.enabledAnchors([]),te&&ee.current.rotateEnabled(!1),Re.find($e=>$e==null?void 0:$e.isDragging())&&Re.forEach($e=>{$e.isDragging()||$e==null||$e.startDrag()}),ee.current.nodes(Re),(Me=ee.current.getLayer())===null||Me===void 0||Me.batchDraw()},[B.selectedElements,ye,we,ue,te]);const fe=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),be=n.default.useRef(!1),Te=(0,b.useMobile)(),Ye=(0,a.action)(ne=>{var Ae,Me;if(Te)return;be.current=!1;const ve=ne.target.findAncestor(".elements-container"),Re=ne.target.findAncestor("Transformer"),Se=ne.target.findAncestor(".page-abs-container");if(ve||Re||Se)return;const $e=(Ae=ne.target.getStage())===null||Ae===void 0?void 0:Ae.getPointerPosition();$e&&(fe.visible=!0,fe.x1=$e.x,fe.y1=$e.y,fe.x2=$e.x,fe.y2=$e.y,((Me=ne.target.getStage())===null||Me===void 0?void 0:Me.getPointersPositions().length)>=2&&(fe.visible=!1))});n.default.useEffect(()=>{const ne=(0,a.action)(Me=>{var ve,Re;if(!fe.visible)return;(ve=le.current)===null||ve===void 0||ve.setPointersPositions(Me);let Se=((Re=le.current)===null||Re===void 0?void 0:Re.getPointerPosition())||{x:fe.x2,y:fe.y2};fe.x2=Se.x,fe.y2=Se.y}),Ae=(0,a.action)(()=>{if(!fe.visible||!le.current)return;const Me=le.current.findOne(".selection"),ve=Me?Me.getClientRect():{width:0,height:0,x:0,y:0};if(ve.width&&ve.height){const Re=[];le.current.find(".element").forEach(Se=>{const $e=Se.getClientRect(),xt=B.getElementById(Se.id()),Ee=xt==null?void 0:xt.draggable,qe=xt==null?void 0:xt.selectable;u.default.Util.haveIntersection(ve,$e)&&Ee&&qe&&Re.push(Se.id())}),B.selectElements(Re)}fe.visible=!1,be.current=!0});return window.addEventListener("mousemove",ne),window.addEventListener("touchmove",ne),window.addEventListener("mouseup",Ae),window.addEventListener("touchend",Ae),()=>{window.removeEventListener("mousemove",ne),window.removeEventListener("touchmove",ne),window.removeEventListener("mouseup",Ae),window.removeEventListener("touchend",Ae)}},[]);const Ke=ne=>{if(B.activePage!==$&&$.select(),be.current)return;const Ae=ne.evt.ctrlKey||ne.evt.metaKey||ne.evt.shiftKey,Me=ne.target.findAncestor(".elements-container"),ve=ne.target.findAncestor(".page-abs-container"),Re=ne.target.findAncestor("Transformer");if(!(Ae||Me||Re||ve))return void B.selectElements([]);const Se=ne.target.findAncestor(".element",!0),$e=B.getElementById(Se==null?void 0:Se.id()),xt=$e==null?void 0:$e.top,Ee=xt==null?void 0:xt.id,qe=B.selectedElementsIds.indexOf(Ee)>=0;Ee&&Ae&&!qe?B.selectElements(B.selectedElementsIds.concat([Ee])):Ee&&Ae&&qe?B.selectElements(B.selectedElementsIds.filter(Ze=>Ze!==Ee)):!Ee||Ae||qe||B.selectElements([Ee])};(0,v.useSnap)(ee);const Ce=B.activePage===$,Be=Y==null?void 0:Y.PageControls,et=Y==null?void 0:Y.Tooltip,Xe=1/B.scale,se=0/B.scale;return n.default.createElement("div",{ref:ce,onDragOver:ne=>ne.preventDefault(),onDrop:ne=>{if(ne.preventDefault(),!le.current)return;le.current.setPointersPositions(ne);const Ae=le.current.findOne(".elements-container").getRelativePointerPosition(),Me=le.current.getPointerPosition(),ve=le.current.getAllIntersections(Me).map($e=>$e.findAncestor(".element",!0)).filter(Boolean),Re=[...new Set(ve.reverse())].map($e=>B.getElementById($e.id())),Se=Re[0];F&&(F(Ae,Se,{elements:Re,page:$}),F=null)},style:{position:"relative",width:W+"px"},className:"polotno-page-container"+(Ce?" active-page":"")},n.default.createElement(o.Stage,{ref:le,width:Math.min(W,4*window.innerWidth),height:Math.min(C,4*window.innerHeight),onClick:Ke,onTap:Ke,onMouseDown:Ye,onMouseMove:ne=>{if(!ne.evt.altKey&&Le)return void Oe(null);if(!ne.evt.altKey)return;const Ae=ne.target.findAncestor(".element",!0),Me=Ae==null?void 0:Ae.id();if(!B.selectedElements[0]||B.selectedElementsIds.includes(Me))return;const ve=(0,w.getTotalClientRect)(B.selectedElements),Re=Me?B.getElementById(Me):{x:0,y:0,width:$.computedWidth,height:$.computedHeight,rotation:0},Se=(0,w.getClientRect)(Re),$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(Le)!==JSON.stringify($e)&&Oe($e)},onTouchStart:Ye,onDragStart:ne=>{var Ae;const Me=ne.target.findAncestor(".element",!0);if(Me){const ve=B.getElementById(Me==null?void 0:Me.id()),Re=ve==null?void 0:ve.top,Se=Re==null?void 0:Re.id;!(B.selectedElementsIds.indexOf(Se)>=0)&&Se&&(B.selectElements([Se]),ne.target.stopDrag(),ne.target.startDrag(ne),(Ae=ee.current)===null||Ae===void 0||Ae.startDrag(ne))}Le&&Oe(null)},pageId:$.id,style:{position:"relative"}},n.default.createElement(o.Layer,null,n.default.createElement(O,{width:W,height:C,fill:j}),n.default.createElement(o.Group,{x:Z,y:re,scaleX:B.scale,scaleY:B.scale,name:"page-container"},n.default.createElement(o.Group,{name:"page-container-2"},n.default.createElement(o.Group,{name:"page-background-group",x:U,y:U},n.default.createElement(R,{x:-$.bleed,y:-$.bleed,width:$.computedWidth+2*$.bleed,height:$.computedHeight+2*$.bleed,background:$.background,shadowBlur:10,shadowColor:"lightgrey",name:"page-background",preventDefault:!1,scale:B.scale})),n.default.createElement(o.Group,{x:U,y:U,name:"elements-container",listening:!B.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:$.computedWidth,height:$.computedHeight,listening:!1}),n.default.createElement(G,{elements:$.children,store:B})),n.default.createElement(o.Rect,{stroke:q,name:"bleed",strokeWidth:$.bleed,x:$.bleed/2,y:$.bleed/2,width:$.computedWidth+$.bleed,height:$.computedHeight+$.bleed,listening:!1,visible:$.bleed>0&&B.bleedVisible,hideInExport:!0}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,W,0,W,C,0,C,0,0,Z,re,Z,C-re,W-Z,C-re,W-Z,re,Z,re],listening:!1,closed:!0,fill:j}),n.default.createElement(o.Group,{x:Z,y:re,scaleX:B.scale,scaleY:B.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-Xe/2-se,y:-Xe/2-se,width:X+Xe+2*se,height:Q+Xe+2*se,stroke:Ce&&B.pages.length>1?H:z,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:Z+U*B.scale,y:re+U*B.scale,scaleX:B.scale,scaleY:B.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:ee,onDragStart:ne=>{var Ae;!((Ae=ne.evt)===null||Ae===void 0)&&Ae.altKey&&B.selectedElements.forEach(Me=>{const ve=Me.clone({},{skipSelect:!0}),Re=$.children.indexOf(Me);$.setElementZIndex(ve.id,Re)}),B.history.startTransaction()},onDragEnd:()=>{B.history.endTransaction()},onTransformStart:()=>{B.history.startTransaction()},boundBoxFunc:(ne,Ae)=>{const Me=Math.abs(Ae.width)<1||Math.abs(Ae.height)<1,ve=Math.abs(ne.width)<1||Math.abs(ne.height)<1;return Me&&!ve?ne:Ae},onTransform:ne=>{var Ae,Me;const ve=(Ae=ee.current)===null||Ae===void 0?void 0:Ae.__getNodeRect(),Re=(Me=ee.current)===null||Me===void 0?void 0:Me.getActiveAnchor();de({anchor:Re,x:ve.x,y:ve.y,rotation:ve.rotation,width:ve.width,height:ve.height})},onTransformEnd:ne=>{de({}),B.history.endTransaction()},visible:!B.isPlaying}),Le&&Le.map(({points:ne,distance:Ae,box1:Me,box2:ve},Re)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:Re,listening:!1},n.default.createElement(o.Rect,Object.assign({},Me,{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:[ne[0].x,ne[0].y,ne[1].x,ne[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[ne[1].x,ne[1].y,ne[2].x,ne[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(ne[0].x+ne[1].x)/2,y:(ne[0].y+ne[1].y)/2,offsetY:-10,scaleX:1/B.scale,scaleY:1/B.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:B.unit,dpi:B.dpi,px:Ae})})))),$._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"})),et&&n.default.createElement(et,{components:Y,store:B,page:$,stageRef:le})),n.default.createElement(D,Object.assign({},ae,{store:B})),n.default.createElement(M,{selection:fe}),h.shouldShowCredit.value&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:W-170,y:C-18,onMouseEnter:ne=>{ne.target.getStage().container().style.cursor="pointer"},onMouseLeave:ne=>{ne.target.getStage().container().style.cursor=""},onTouchStart:ne=>{ne.cancelBubble=!0},onMouseDown:ne=>{ne.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),_e&&Ce&&Be&&n.default.createElement(Be,{store:B,page:$,xPadding:Z,yPadding:re}))})})(S6);var N8={};(function(t){var e=me&&me.__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=Rp,i=Np,a=Ni,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:v})=>{const _=r.default.useRef(null);if(!u.activePage)return null;const g=u.activePage,h=(u.bleedVisible&&g.bleed,g.computedWidth*u.scale),w=g.computedHeight*u.scale,E=(f-h)/2,S=(b=x=>(0,i.unitToPx)({unitVal:x,dpi:u.dpi,unit:u.unit})*u.scale,o.find(x=>b(x)>30)||1e4);var b;const p=(0,i.unitToPx)({unitVal:S,dpi:u.dpi,unit:u.unit})*u.scale,d=Math.round(h/p)+1,m=Math.round(w/p)+1,y=(0,n.getTotalClientRect)(u.selectedElements);return r.default.createElement("div",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},ref:_},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+y.x*u.scale+"px",height:"14px",width:y.width*u.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),u.pages.map((x,P)=>{var O;const N=x.computedHeight*u.scale,T=(v-N)/2;return r.default.createElement("div",{key:x.id,style:{left:"0px",width:"14px",height:v+"px",position:"sticky",fontSize:"8px",lineHeight:"14px",color:"grey",borderRight:"1px solid grey",backgroundColor:"#e8e8e8",overflow:"hidden"}},[...Array(m)].map((R,M)=>r.default.createElement("div",{key:M,style:{position:"absolute",left:"14px",top:T+M*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*M):(S*M).toFixed(1))),((O=u.selectedElements[0])===null||O===void 0?void 0:O.page)===x&&r.default.createElement("div",{style:{position:"absolute",top:T+y.y*u.scale-14+"px",width:"14px",height:y.height*u.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),t.LeftRules=l})(N8);var M8={};(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,v,_,g,h,w,E,S;if(((f=document.activeElement)===null||f===void 0?void 0:f.tagName)==="INPUT"||((v=document.activeElement)===null||v===void 0?void 0:v.tagName)==="TEXTAREA"||((_=document.activeElement)===null||_===void 0?void 0:_.contentEditable)==="true")return;const b=u.selectedElements.filter(y=>y.removable),p=b.map(y=>y.id);l.keyCode!==46&&l.keyCode!==8||u.deleteElements(p);const d=l.ctrlKey||l.metaKey,m=l.shiftKey;if(d&&!m&&l.code==="KeyZ"&&(l.preventDefault(),u.history.undo()),d&&m&&l.code==="KeyZ"&&(l.preventDefault(),u.history.redo()),d&&l.code==="KeyA"){l.preventDefault();const y=(g=u.activePage)===null||g===void 0?void 0:g.children.filter(P=>P.selectable),x=(y==null?void 0:y.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(y=>y.toJSON()))),d&&l.code==="KeyX"&&(l.preventDefault(),r=(w=u.activePage)===null||w===void 0?void 0:w.id,i(u.selectedElements.map(y=>y.toJSON())),u.deleteElements(b)),d&&l.code==="KeyV"){l.preventDefault();let y=0;r===((E=u.activePage)===null||E===void 0?void 0:E.id)&&(y=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 N;delete O.id,O.x+=y,O.y+=y;const T=(N=u.activePage)===null||N===void 0?void 0:N.addElement(O);T&&x.push(T.id)}),i(P),u.selectElements(x)})}l.code==="ArrowDown"&&(l.preventDefault(),u.selectedElements.forEach(y=>{y.set({y:y.y+1})})),l.code==="ArrowUp"&&(l.preventDefault(),u.selectedElements.forEach(y=>{y.set({y:y.y-1})})),l.code==="ArrowLeft"&&(l.preventDefault(),u.selectedElements.forEach(y=>{y.set({x:y.x-1})})),l.code==="ArrowRight"&&(l.preventDefault(),u.selectedElements.forEach(y=>{y.set({x:y.x+1})}))}t.handleHotkey=o})(M8);var L8={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.t=t.getTranslations=t.setTranslations=void 0;const e=sa,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,v){var _,g=v.split("."),h=f;for(_=0;_<g.length;++_){if(h[g[_]]==null)return;h=h[g[_]]}return h}const i=f=>f&&typeof f=="object";function a(f,v){Object.keys(v).forEach(_=>{const g=f[_],h=v[_];i(h)&&i(g)?a(g,h):f[_]=h})}t.setTranslations=(0,e.action)(f=>{a(r,f)});const o=()=>(0,e.toJS)(r);t.getTranslations=o;const l={},u=f=>{const v=n(r,f);if(v!==void 0)return v;l[f]||(l[f]=!0,console.warn(`Missing translation '${f}'`));const _=f.split("."),g=_[_.length-1]||" ";return g.charAt(0).toUpperCase()+g.slice(1)};t.t=u})(L8);(function(t){var e=me&&me.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceCanvas=void 0;const r=e(at),n=Ni,i=e(S6),a=N8,o=M8,l=L8,u=`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
206
|
+
Width or height of parent elements is equal 0.
|
|
207
|
+
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
208
|
+
For simpler debugging here is the log of the parent element:`,f=(g,h,w,E,S,b)=>{const p=r.default.useRef({width:h,height:w}),d=r.default.useRef({top:0,left:0}),m=r.default.useRef(!1),y=r.default.useRef(S.pages.length);m.current=y.current!==S.pages.length,y.current=S.pages.length,r.default.useEffect(()=>{const x=g.current,P=O=>{d.current={top:x.scrollTop,left:x.scrollLeft}};return x.addEventListener("scroll",P),()=>{x.removeEventListener("scroll",P)}},[]),r.default.useLayoutEffect(()=>{if(!g.current||m.current)return;const x=g.current,P=(d.current.left+x.offsetWidth/2)/p.current.width,O=(d.current.top+x.offsetHeight/2)/p.current.height;b.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])},v=(g,h,w,E,S)=>{const b=r.default.useRef(!1),p=r.default.useRef(null);r.default.useEffect(()=>{const m=g.current,y=()=>{S.current};return m.addEventListener("scroll",y),()=>{m.removeEventListener("scroll",y)}},[]);const d=w.pages.indexOf(w.activePage);return r.default.useLayoutEffect(()=>{if(!w.activePage||!g.current||b.current)return;const m=g.current,y=w.pages.indexOf(w.activePage)*h;Math.abs(y-m.scrollTop)>.5*h&&(S.current=!0,m.scrollTop=y)},[w.activePage,d]),{handleScroll:m=>{if(S.current)return void(S.current=!1);b.current=!0,clearTimeout(p.current),p.current=setTimeout(()=>{b.current=!1},300);const y=m.currentTarget.childNodes[0].offsetHeight,x=m.currentTarget.scrollTop,P=Math.floor((x+E.height/3)/y),O=w.pages[P];O&&O.select()}}},_=({store:g})=>r.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},r.default.createElement("p",null,(0,l.t)("workspace.noPages")),r.default.createElement("button",{onClick:()=>{g.addPage()}},(0,l.t)("workspace.addPage")));t.WorkspaceCanvas=(0,n.observer)(({store:g,pageControlsEnabled:h,backgroundColor:w,pageBorderColor:E,activePageBorderColor:S,bleedColor:b,components:p,onKeyDown:d})=>{const[m,y]=r.default.useState({width:100,height:100}),x=r.default.useRef(m),P=r.default.useRef(null),O=r.default.useRef(null),N=g.bleedVisible?Math.max(0,...g.pages.map(H=>H.bleed)):0,T=Math.max(...g.pages.map(H=>H.computedWidth)),R=Math.max(...g.pages.map(H=>H.computedHeight)),M=T+2*N,D=R+2*N,G=()=>{if(P.current===null)return;const H=P.current.getBoundingClientRect();H.width!==0&&H.height!==0||(console.warn(u),console.log(P.current));const Y=O.current.clientWidth||H.width,q={width:Y,height:H.height};(x.current.width!==q.width||x.current.height!==q.height)&&(y(q),x.current=q);const U=(Y-40)/M,X=(H.height-110)/D,Q=Math.max(Math.min(U,X),.01);g.scaleToFit!==Q&&(g.setScale(Q),g._setScaleToFit(Q))};r.default.useEffect(G,[M,D]),r.default.useEffect(()=>{const H=P.current;if(window.ResizeObserver){const Y=new ResizeObserver(G);return Y.observe(H),()=>Y.unobserve(H)}{const Y=setInterval(G,100);return()=>clearInterval(Y)}},[M,D]);const F=Math.max(20,(m.width-M*g.scale)/2),K=D*g.scale*g.pages.length,B=Math.max(55,(m.height-K)/g.pages.length/2);r.default.useEffect(()=>{const H=Y=>{(d||o.handleHotkey)(Y,g)};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[]),r.default.useEffect(()=>{var H;const Y=q=>{if(q.ctrlKey||q.metaKey){q.preventDefault();const Z=Math.max(2,g.scaleToFit),re=Math.min(.5,g.scaleToFit),ee=(U=q.deltaY<0?1.05*g.scale:g.scale/1.05,X=re,Q=Z,Math.max(X,Math.min(Q,U)));g.setScale(ee)}else var U,X,Q};return(H=O.current)===null||H===void 0||H.addEventListener("wheel",Y),()=>{var q;return(q=O.current)===null||q===void 0?void 0:q.removeEventListener("wheel",Y)}},[]);const $=r.default.useRef(!1);f(O,M*g.scale+2*F,D*g.scale+2*B,g.scale,g,$);const{handleScroll:W}=v(O,D*g.scale+2*B,g,m,$),C=m.width>=M*g.scale+2*F,A=w||"rgba(232, 232, 232, 0.9)",j=g.pages.indexOf(g.activePage),z=(p==null?void 0:p.NoPages)||_;return r.default.createElement("div",{ref:P,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:A},tabIndex:0,className:"polotno-workspace-container"},r.default.createElement("div",{ref:O,onScroll:W,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:C?"hidden":"auto"},className:"polotno-workspace-inner"},g.pages.map((H,Y)=>Math.abs(Y-j)<=1||H._exporting?r.default.createElement(i.default,{key:H.id,page:H,xPadding:F,yPadding:B,width:M*g.scale+2*F,height:D*g.scale+2*B,store:g,pageControlsEnabled:h,backColor:A,pageBorderColor:E||"lightgrey",activePageBorderColor:S||"rgb(0, 161, 255)",bleedColor:b||"rgba(255, 0, 0, 0.1)",components:p}):r.default.createElement("div",{key:H.id,style:{width:M*g.scale+2*F+"px",height:D*g.scale+2*B+"px",backgroundColor:A,paddingLeft:F+"px",paddingRight:F+"px",paddingTop:B+"px",paddingBottom:B+"px"}},r.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}))),g.rulesVisible&&r.default.createElement(a.TopRules,{store:g,xPadding:F,yPadding:B,width:M*g.scale+2*F,height:D*g.scale+2*B}),g.pages.length===0&&r.default.createElement(z,{store:g})))}),t.default=t.WorkspaceCanvas})(oS);var g0={},I8="warn";function j8(t){I8=t}function D8(){return I8}function iL(t){j8(t)}var sr;(function(t){t.afterCreate="afterCreate",t.afterAttach="afterAttach",t.afterCreationFinalization="afterCreationFinalization",t.beforeDetach="beforeDetach",t.beforeDestroy="beforeDestroy"})(sr||(sr={}));/*! *****************************************************************************
|
|
209
|
+
Copyright (c) Microsoft Corporation.
|
|
210
|
+
|
|
211
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
212
|
+
purpose with or without fee is hereby granted.
|
|
213
|
+
|
|
214
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
215
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
216
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
217
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
218
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
219
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
220
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
221
|
+
***************************************************************************** */var Hm=function(t,e){return Hm=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])},Hm(t,e)};function Dt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Hm(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var mr=function(){return mr=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},mr.apply(this,arguments)};function aL(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 F8(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(v){return u([f,v])}}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(v){f=[6,v],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Iu(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 I1(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 fo(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(I1(arguments[e]));return t}function Mc(t){return Ge(t).type}function oL(t,e){return Ge(t).getChildType(e)}function z8(t,e){return Ge(t).onPatch(e)}function lL(t,e){return Ge(t).onSnapshot(e)}function Ss(t,e){Ge(t).applyPatches(H1(e))}function sL(t,e){var r={patches:[],inversePatches:[]},n={},i,a={get recording(){return!!i},get patches(){return n.patches||(n.patches=r.patches.slice()),n.patches},get reversedInversePatches(){return n.reversedInversePatches||(n.reversedInversePatches=r.inversePatches.slice().reverse()),n.reversedInversePatches},get inversePatches(){return n.inversePatches||(n.inversePatches=r.inversePatches.slice()),n.inversePatches},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=z8(t,function(o,l){e&&!e(o,l,z1())||(r.patches.push(o),r.inversePatches.push(l),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){Ss(o||t,r.patches)},undo:function(o){Ss(o||t,r.inversePatches.slice().reverse())}};return a.resume(),a}function uL(t){var e=Ge(t);if(!e.isRoot)throw De("`protect` can only be invoked on root nodes");e.isProtectionEnabled=!0}function cL(t){var e=Ge(t);if(!e.isRoot)throw De("`unprotect` can only be invoked on root nodes");e.isProtectionEnabled=!1}function fL(t){return Ge(t).isProtected}function B8(t,e){return Ge(t).applySnapshot(e)}function j1(t,e){e===void 0&&(e=!0);var r=Ge(t);return e?r.snapshot:r.type.getSnapshot(r,!1)}function dL(t,e){e===void 0&&(e=1);for(var r=Ge(t).parent;r;){if(--e===0)return!0;r=r.parent}return!1}function hL(t,e){e===void 0&&(e=1);for(var r=e,n=Ge(t).parent;n;){if(--r===0)return n.storedValue;n=n.parent}throw De("Failed to find the parent of "+Ge(t)+" at depth "+e)}function pL(t,e){for(var r=Ge(t).parent;r;){if(e.is(r.storedValue))return!0;r=r.parent}return!1}function gL(t,e){for(var r=Ge(t).parent;r;){if(e.is(r.storedValue))return r.storedValue;r=r.parent}throw De("Failed to find the parent of "+Ge(t)+" of a given type")}function U8(t){return Ge(t).root.storedValue}function G8(t){return Ge(t).path}function vL(t){return Ps(Ge(t).path)}function mL(t){return Ge(t).isRoot}function yL(t,e){var r=oE(Ge(t),e);return r?r.value:void 0}function bL(t,e,r){var n=Ge(e).root.identifierCache.resolve(t,Bs(r));return n==null?void 0:n.value}function H8(t){return Ge(t).identifier}function _L(t,e){e===void 0&&(e=!0);try{var r=t();if(r==null)return;if(Ot(r))return e?D1(r)?r:void 0:r;throw De("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof V1)return;throw n}}function wL(t,e){e===void 0&&(e=!0);try{var r=t();if(r==null)return!1;if(Ot(r))return e?D1(r):!0;throw De("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof V1)return!1;throw n}}function V8(t,e){var r=oE(Ge(t),e,!1);if(r!==void 0)try{return r.value}catch{return}}function SL(t,e){return aE(Ge(t),Ge(e))}function EL(t,e){e===void 0&&(e=!0);var r=Ge(t);return r.type.create(r.snapshot,e===!0?r.root.environment:e===!1?void 0:e)}function OL(t){return Ge(t).detach(),t}function xL(t){var e=Ge(t);e.isRoot?e.die():e.parent.removeChild(e.subpath)}function D1(t){return Ge(t).observableIsAlive}function PL(t,e){var r=Ge(t);return r.addDisposer(e),e}function kL(t){var e=Ge(t),r=e.root.environment;return r||Xo}function q8(t,e){var r=Ge(t);r.getChildren().forEach(function(n){Ot(n.storedValue)&&q8(n.storedValue,e)}),e(r.storedValue)}function $8(t){var e;return Ot(t)?e=Mc(t):e=t,{name:e.name,properties:mr({},e.properties)}}function AL(t){var e=Ge(t).type,r=mr(mr({},$8(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){ZS(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):e6(t,i)?r.volatile.push(i):r.views.push(i)}}),r}function TL(t){return t}function CL(t){return t}function RL(t){return t}function NL(t){return Ge(t).nodeId}var W8=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 fE),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=ec("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?$a(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=ec("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(sr.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(sr.beforeDestroy)}}),t}(),oc=function(t){Dt(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 De("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}(W8);oc.prototype.die=nr(oc.prototype.die);var ML=1,LL={onError:function(t){throw t}},_n=function(t){Dt(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:++ML}),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=Jo(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=o,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new eI),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 De("Instance identifier '"+l.identifierAttribute+"' for type '"+l.type.name+"' must be a string or a number");l.identifier=Bs(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=Iu(l),v=f.next();!v.done;v=f.next()){var _=v.value;_.createObservableInstanceIfNeeded(!1)}}catch(E){n={error:E}}finally{try{v&&!v.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}var g=this.type;try{this.storedValue=g.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,g.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=Xo,this.state=Er.CREATED,r){this.fireHook(sr.afterCreate),this.finalizeCreation();try{for(var h=Iu(l.reverse()),w=h.next();!w.done;w=h.next()){var _=w.value;_.fireHook(sr.afterCreate),_.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(sr.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(sr.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"&&(vs?vs(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=D8();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw De(i);case"warn":hI(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&&$a(r.subpath)||"",a=r.actionContext||F1();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var l=a&&a.context&&G8(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(Xo),this._autoUnbox=!1;try{return this._observableInstanceState===2?this.type.getChildren(this):sE(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 De("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=Iu(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(sr.afterCreationFinalization)})}}),Object.defineProperty(e.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw De("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=lc(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=Ps(i.path),o=lE(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=lc(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),Do(this.storedValue,"$treenode",this),Do(this.storedValue,"toJSON",rI)}}),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=cI({},r,{path:n.path.substr(this.path.length)+"/"+r.path}),a=I1(bI(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 De("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 De("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=VS(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},LL);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 fE),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,fo([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}(W8);_n.prototype.createObservableInstance=nr(_n.prototype.createObservableInstance);_n.prototype.detach=nr(_n.prototype.detach);_n.prototype.die=nr(_n.prototype.die);var Y8,nt;(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"})(nt||(nt={}));var K8="cannotDetermine",IL=Symbol("$type"),oa=function(){function t(e){Object.defineProperty(this,Y8,{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 Ji(this,e),this.instantiate(null,"",r,e).value}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){throw De("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=iE(e);if(n){var i=Mc(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 De("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 De("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 De("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 De("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}();Y8=IL;oa.prototype.create=nr(oa.prototype.create);var Es=function(t){Dt(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===Bs(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)&&Ge(n)===r?!0:r.type===this&&uE(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(Mc(n))){var l=Ge(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}(oa);Es.prototype.create=nr(Es.prototype.create);var gl=function(t){Dt(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}(oa);function Dr(t){return typeof t=="object"&&t&&t.isType===!0}var wi=new Map;function jL(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),wi.set(r.id,{call:r,context:a,async:!1});try{var o=n(r);return t.onSuspend(r,a),wi.get(r.id).async===!1&&(wi.delete(r.id),t.onSuccess(r,a,o)),o}catch(u){throw wi.delete(r.id),t.onFail(r,a,u),u}}else return n(r);case"flow_spawn":{var l=wi.get(r.rootId);return l.async=!0,n(r)}case"flow_resume":case"flow_resume_error":{var l=wi.get(r.rootId);t.onResume(r,l.context);try{return n(r)}finally{t.onSuspend(r,l.context)}}case"flow_throw":{var l=wi.get(r.rootId);return wi.delete(r.rootId),t.onFail(r,l.context,r.args[0]),n(r)}case"flow_return":{var l=wi.get(r.rootId);return wi.delete(r.rootId),t.onSuccess(r,l.context,r.args[0]),n(r)}}}}var DL=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 FL(t){var e=new Map;return function(n,i){var a=n.parentActionEvent?e.get(n.parentActionEvent.id):void 0;if(n.type==="action"){var o=mr(mr({},n),{env:a&&a.call.env,parentCall:a&&a.call}),l=!t.filter||t.filter(o),u=l?t:void 0,f=new DL(u,o);e.set(n.id,f);var v=void 0;try{v=i(n)}catch(g){throw e.delete(n.id),f.finish(g),g}return f.hasFlowsPending||(e.delete(n.id),f.finish()),v}else{if(!a)return i(n);switch(n.type){case"flow_spawn":return a.incFlowsPending(),i(n);case"flow_resume":case"flow_resume_error":return i(n);case"flow_throw":{var _=n.args[0];try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(e.delete(n.parentActionEvent.id),a.finish(_))}}case"flow_return":try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(e.delete(n.parentActionEvent.id),a.finish())}}}}}function zL(t,e,r,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(xs(n))return n;if(Ot(n))return rd("[MSTNode: "+Mc(n).name+"]");if(typeof n=="function")return rd("[function]");if(typeof n=="object"&&!Lo(n)&&!G1(n))return rd("[object "+(n&&n.constructor&&n.constructor.name||"Complex Object")+"]");try{return JSON.stringify(n),n}catch(i){return rd(""+i)}}function BL(t,e){return e&&typeof e=="object"&&"$MST_DATE"in e?new Date(e.$MST_DATE):e}function rd(t){return{$MST_UNSERIALIZABLE:!0,type:t}}function X8(t,e){vs(function(){H1(e).forEach(function(r){return UL(t,r)})})}function UL(t,e){var r=V8(t,e.path||"");if(!r)throw De("Invalid action path: "+(e.path||""));var n=Ge(r);if(e.name==="@APPLY_PATCHES")return Ss.call(null,r,e.args[0]);if(e.name==="@APPLY_SNAPSHOT")return B8.call(null,r,e.args[0]);if(typeof r[e.name]!="function")throw De("Action '"+e.name+"' does not exist in '"+n.path+"'");return r[e.name].apply(r,e.args?e.args.map(function(i){return BL(n,i)}):[])}function GL(t,e){var r=[],n=function(o){var l=e?e(o,z1()):!0;l&&r.push(o)},i,a={actions:r,get recording(){return!!i},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=Q8(t,n))},replay:function(o){X8(o,r)}};return a.resume(),a}function Q8(t,e,r){return r===void 0&&(r=!1),eE(t,function(i,a){if(i.type==="action"&&i.id===i.rootId){var o=Ge(i.context),l={name:i.name,path:aE(Ge(t),o),args:i.args.map(function(f,v){return zL(o,i.name,v,f)})};if(r){var u=a(i);return e(l),u}else return e(l),a(i)}else return a(i)})}var HL=1,ju;function F1(){return ju}function Z8(){return HL++}function Vm(t,e){var r=Ge(t.context);t.type==="action"&&r.assertAlive({actionContext:t});var n=r._isRunningAction;r._isRunningAction=!0;var i=ju;ju=t;try{return $L(r,t,e)}finally{ju=i,r._isRunningAction=n}}function J8(t){if(t)return t.type==="action"?t:t.parentActionEvent}function lc(t,e,r){var n=function(){var i=Z8(),a=ju,o=J8(a);return Vm({type:"action",name:e,id:i,args:dE(arguments),context:t,tree:U8(t),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?fo(a.allParentIds,[a.id]):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}function eE(t,e,r){r===void 0&&(r=!0);var n=Ge(t);return n.addMiddleWare(e,r)}function VL(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 qL=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 $L(t,e,r){var n=new qL(t,r);if(n.isEmpty)return nr(r).apply(null,e.args);var i=null;function a(o){var l=n.getNextMiddleware(),u=l&&l.handler;if(!u)return nr(r).apply(null,o.args);if(!l.includeHooks&&sr[o.name])return a(o);function f(_,g){i=a(_),g&&(i=g(i))}function v(_){i=_}return u(o,f,v),i}return a(e)}function z1(){for(var t=F1();t&&t.type!=="action";)t=t.parentActionEvent;return t}function tE(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 WL(t,e){return tE(t,e,!1)}function YL(t,e){return tE(t,e,!0)}function KL(t){try{return JSON.stringify(t)}catch(e){return"<Unserializable: "+e+">"}}function rE(t){return typeof t=="function"?"<function"+(t.name?" "+t.name:"")+">":Ot(t)?"<"+t+">":"`"+KL(t)+"`"}function XL(t){return t.length<280?t:t.substring(0,272)+"......"+t.substring(t.length-8)}function QL(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 "+Ge(e).type.name+":":xs(e)?"value":"snapshot",o=r&&Ot(e)&&r.is(Ge(e).snapshot);return""+i+a+" "+rE(e)+" is not assignable "+(r?"to type: `"+r.name+"`":"")+(t.message?" ("+t.message+")":"")+(r?xE(r)||xs(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 B1(t,e,r){return t.concat([{path:e,type:r}])}function un(){return Os}function cn(t,e,r){return[{context:t,value:e,message:r}]}function Mp(t){return t.reduce(function(e,r){return e.concat(r)},[])}function Ji(t,e){pI()&&nE(t,e)}function nE(t,e){var r=t.validate(e,[{path:"",type:t}]);if(r.length>0)throw De(ZL(t,e,r))}function ZL(t,e,r){if(r.length!==0)return"Error while converting "+XL(rE(e))+" to `"+t.name+`\`:
|
|
222
|
+
|
|
223
|
+
`+r.map(QL).join(`
|
|
224
|
+
`)}var JL=0,eI=function(){function t(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:JL++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:kt.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:kt.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,kt.array([],Lp));var i=this.cache.get(n);if(i.indexOf(e)!==-1)throw De("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;Qy(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 t6(this.cache).forEach(function(a){for(var o=I1(a,2),l=o[0],u=o[1],f=!1,v=u.length-1;v>=0;v--){var _=u[v];(_===e||_.path.indexOf(i)===0)&&(n.addNodeToCache(_,!1),u.splice(v,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 De("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 U1(t,e,r,n,i){var a=iE(i);if(a){if(a.parent)throw De("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 _n(t,e,r,n,i)}function ho(t,e,r,n,i){return new oc(t,e,r,n,i)}function tI(t){return t instanceof oc||t instanceof _n}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 Ge(t){if(!Ot(t))throw De("Value "+t+" is no MST Node");return t.$treenode}function iE(t){return t&&t.$treenode||null}function rI(){return Ge(this).snapshot}var nI=function(t){return".."};function aE(t,e){if(t.root!==e.root)throw De("Cannot calculate relative path: objects '"+t+"' and '"+e+"' are not part of the same object tree");for(var r=Ps(t.path),n=Ps(e.path),i=0;i<r.length&&r[i]===n[i];i++);return r.slice(i).map(nI).join("/")+ah(n.slice(i))}function oE(t,e,r){return r===void 0&&(r=!0),lE(t,Ps(e),r)}function lE(t,e,r){r===void 0&&(r=!0);var n=t;try{for(var 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 oc){var o=n.value;Ot(o)&&(n=Ge(o))}if(n instanceof _n){var l=n.getChildType(a);if(l&&(n=n.getChildNode(a),n))continue}}}throw De("Could not resolve '"+a+"' in path '"+(ah(e.slice(0,i))||"/")+"' while resolving '"+ah(e)+"'")}}catch(u){if(!r)return;throw u}return n}function sE(t){if(!t)return Os;var e=Object.keys(t);if(!e.length)return Os;var r=new Array(e.length);return e.forEach(function(n,i){r[i]=t[n]}),r}function iI(t){return hE(),pE(t)}var aI=Object.toString(),Os=Object.freeze([]),Xo=Object.freeze({}),Lp=NS().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Lp);function De(t){return t===void 0&&(t="Illegal state"),new Error("[mobx-state-tree] "+t)}function oI(t){return t}var lI=Number.isInteger;function sI(t){return Number(t)===t&&t%1!==0}function uI(t){return Number.isFinite(t)}function G1(t){return Array.isArray(t)||Wr(t)}function H1(t){return t?G1(t)?t:[t]:Os}function cI(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 Lo(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())===aI}function uE(t){return t!==null&&typeof t=="object"&&!(t instanceof Date)&&!(t instanceof RegExp)}function xs(t,e){return e===void 0&&(e=!0),t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e&&t instanceof Date}function cE(t){return typeof t!="function"}function fI(t,e,r){br(t)?Jy(t,e,r):Object.defineProperty(t,e,r)}function Do(t,e,r){fI(t,e,{enumerable:!1,writable:!1,configurable:!0,value:r})}var dI=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,fo(e))})}}),t}(),fE=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 dI),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,fo(n))}}),t}();function dE(t){for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=t[r];return e}function v0(t,e){return t.indexOf(e)===0}var hE=function(t,e){};hE.ids={};function hI(t){console.warn(new Error("[mobx-state-tree] "+t))}function pI(){return typeof process<"u"&&process.env&&{}.ENABLE_TYPE_CHECK==="true"}function m0(t){typeof queueMicrotask=="function"?queueMicrotask(t):typeof setImmediate=="function"?setImmediate(t):setTimeout(t,1)}function pE(t){return yI(t.name,t)}function gI(t){return t}function vI(t){return function(){var e,r=[];for(e=0;e<arguments.length;e++)r[e]=arguments[e];return F8(this,function(n){switch(n.label){case 0:return[4,t.apply(void 0,fo(r))];case 1:return[2,n.sent()]}})}}function mI(t){return F8(this,function(e){switch(e.label){case 0:return[4,t];case 1:return[2,e.sent()]}})}function yI(t,e){var r=function(){var i=Z8(),a=F1();if(!a)throw De("a mst flow must always have a parent context");var o=J8(a);if(!o)throw De("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:fo(a.allParentIds,[a.id]),rootId:a.rootId,parentEvent:a,parentActionEvent:o},u=arguments;function f(v,_,g){return v.$mst_middleware=r.$mst_middleware,Vm(mr(mr({},l),{type:_,args:[g]}),v)}return new Promise(function(v,_){var g,h=function(){g=e.apply(null,arguments),w(void 0)};h.$mst_middleware=r.$mst_middleware,Vm(mr(mr({},l),{type:"flow_spawn",args:dE(u)}),h);function w(b){var p;try{var d=f(function(m){p=g.next(m)},"flow_resume",b);d instanceof Error&&(p=g.throw(d))}catch(m){m0(function(){f(function(y){_(m)},"flow_throw",m)});return}S(p)}function E(b){var p;try{f(function(d){p=g.throw(d)},"flow_resume_error",b)}catch(d){m0(function(){f(function(m){_(d)},"flow_throw",d)});return}S(p)}function S(b){if(b.done){m0(function(){f(function(p){v(p)},"flow_return",b.value)});return}if(!b.value||typeof b.value.then!="function")throw De("Only promises can be yielded to `async`, got: "+b);return b.value.then(w,E)}})};return r._isFlowAction=!0,r}function bI(t){if(!("oldValue"in t))throw De("Patches without `oldValue` field cannot be inversed");return[_I(t),wI(t)]}function _I(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 wI(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 SI(t){return typeof t=="number"}function $a(t){return SI(t)===!0?""+t:t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function gE(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function ah(t){if(t.length===0)return"";var e=function(r){return r.map($a).join("/")};return t[0]==="."||t[0]===".."?e(t):"/"+e(t)}function Ps(t){var e=t.split("/").map(gE),r=t===""||t==="."||t===".."||v0(t,"/")||v0(t,"./")||v0(t,"../");if(!r)throw De("a json path must be either rooted, empty or relative, but got '"+t+"'");return e[0]===""&&e.shift(),e}var y0=Symbol("$preProcessorFailed"),EI=function(t){Dt(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|nt.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 y0}}}),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;OI(r.type,this,"create");var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r))},kE(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===y0?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)?j1(r,!1):this.preProcessSnapshotSafe(r);return n===y0?!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 Es))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),e}(oa);function OI(t,e){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=Iu(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 xI(t,e,r){return new EI(t,e,r)}var R3="Map.put can only be used to store complex values that have an identifier type attribute";function vE(t,e){var r,n,i=t.getSubTypes();if(i===K8)return!1;if(i){var a=H1(i);try{for(var o=Iu(a),l=o.next();!l.done;l=o.next()){var u=l.value;if(!vE(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 sc&&e.push(t),!0}var Ma;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.YES=1]="YES",t[t.NO=2]="NO"})(Ma||(Ma={}));var PI=function(t){Dt(e,t);function e(r,n){return t.call(this,r,kt.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 De("Map.put cannot be used to set empty values");if(Ot(r)){var n=Ge(r);if(n.identifier===null)throw De(R3);return this.set(n.identifier,r),r}else if(uE(r)){var i=Ge(this),a=i.type;if(a.identifierMode!==Ma.YES)throw De(R3);var o=a.mapIdentifierAttribute,l=r[o];if(!q1(l)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(j1(u))}var f=Bs(l);return this.set(f,r),this.get(f)}else throw De("Map.put can only be used to store complex values")}}),e}(Ih),oh=function(t){Dt(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:Ma.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:nt.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(),U1(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Ma.UNKNOWN){var r=[];if(vE(this._subType,r)){var n=r.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw De("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=Ma.YES,this.mapIdentifierAttribute=n):this.identifierMode=Ma.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 PI(r,this.name)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Xy(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=lc(n,l,u);Do(n,l,f)})}),Nh(n,this.willChange),Lh(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 Qy(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 De("Not a child "+n);return i}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ge(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;Ji(o,l),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":Ji(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===Ma.YES&&n instanceof _n){var i=n.identifier;if(i!==r)throw De("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=Ge(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:$a(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:$a(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:$a(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){Ji(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 Lo(r)?Mp(Object.keys(r).map(function(a){return i._subType.validate(r[a],B1(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 Xo}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),e}(Es);oh.prototype.applySnapshot=nr(oh.prototype.applySnapshot);function kI(t){return new oh("Map<string, "+t.name+">",t)}function AI(t){return Dr(t)&&(t.flags&nt.Map)>0}var lh=function(t){Dt(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:nt.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 U1(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=mr(mr({},Lp),{name:this.name});return kt.array(sE(r),n)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){li(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=lc(n,l,u);Do(n,l,f)})}),Nh(n,this.willChange),Lh(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 De("Not a child: "+n)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ge(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=N3(n,i,[a[r.index]],[r.newValue],[r.index]);if(!o)return null;r.newValue=o[0]}break;case"splice":{var l=r.index,u=r.removedCount,f=r.added,v=N3(n,i,a.slice(l,l+u),f,f.map(function(g,h){return l+h}));if(!v)return null;r.added=v;for(var _=l+u;_<a.length;_++)a[_].setParent(n,""+(_+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=Ge(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){Ji(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 G1(r)?Mp(r.map(function(a,o){return i._subType.validate(a,B1(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 Os}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),e}(Es);lh.prototype.applySnapshot=nr(lh.prototype.applySnapshot);function TI(t){return new lh(t.name+"[]",t)}function N3(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,v=""+i[o];if(tI(f)&&(f=f.storedValue),!u&&!l)break;if(!l)a=!1,r.splice(o,1),u instanceof _n&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(M3(u,f))r[o]=b0(e,t,v,f,u);else{for(var g=void 0,h=o;h<r.length;h++)if(M3(r[h],f)){g=r.splice(h,1)[0];break}a=!1;var _=b0(e,t,v,f,g);r.splice(o,0,_)}else{if(Ot(f)&&Ge(f).parent===t)throw De("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+"/"+v+"', but it lives already at '"+Ge(f).path+"'");a=!1;var _=b0(e,t,v,f);r.splice(o,0,_)}}return a?null:r}function b0(t,e,r,n,i){Ji(t,n);function a(){if(Ot(n)){var l=Ge(n);if(l.assertAlive(Xo),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 _n&&i.createObservableInstanceIfNeeded(),i.die()),o}function M3(t,e){if(!t.isAlive)return!1;if(Ot(e)){var r=Ge(e);return r.isAlive&&r===t}if(t.snapshot===e)return!0;if(!(t instanceof _n))return!1;var n=t.getReconciliationType();return t.identifier!==null&&t.identifierAttribute&&Lo(e)&&n.is(e)&&n.isMatchingSnapshotId(t,e)}function CI(t){return Dr(t)&&(t.flags&nt.Array)>0}var L3="preProcessSnapshot",I3="postProcessSnapshot";function RI(){return Ge(this).toString()}var j3={name:"AnonymousModel",properties:{},initializers:Os};function NI(t){var e=Object.keys(t),r={};return e.forEach(function(n){if(r[n])throw De(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 sr)throw De("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 De("Getters are not supported as properties. Please use views instead");var f=u.value;if(f==null)throw De("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(xs(f))return Object.assign({},n,(a={},a[i]=Fo(FI(f),f),a));if(f instanceof oh)return Object.assign({},n,(o={},o[i]=Fo(f,{}),o));if(f instanceof lh)return Object.assign({},n,(l={},l[i]=Fo(f,[]),l));if(Dr(f))return n;throw De("Invalid type definition for property '"+i+"', cannot infer a type from a value like '"+f+"' ("+typeof f+")")},t)}var sc=function(t){Dt(e,t);function e(r){var n=t.call(this,r.name||j3.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:nt.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,j3,r),n.properties=NI(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&nt.Identifier){if(r)throw De("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(!Lo(n))throw De("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===L3)throw De("Cannot define action '"+L3+"', it should be defined using 'type.preProcessSnapshot(fn)' instead");if(i===I3)throw De("Cannot define action '"+I3+"', it should be defined using 'type.postProcessSnapshot(fn)' instead");var a=n[i],o=r[i];if(i in sr&&o){var l=a;a=function(){o.apply(null,arguments),l.apply(null,arguments)}}var u=a.$mst_middleware,f=a.bind(n);f._isFlowAction=a._isFlowAction||!1,f.$mst_middleware=u;var v=lc(r,i,f);n[i]=v,Do(r,i,v)})}}),Object.defineProperty(e.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw De("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(!Lo(n))throw De("volatile state initializer should return a plain object containing state");Zy(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,v=aL(o,["actions","views","state"]);for(var _ in v)throw De("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '"+_+"'");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(!Lo(n))throw De("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)Jy(r,i,o),e1(r,(a={},a[i]=Jo,a));else if(typeof o.value=="function")Do(r,i,o.value);else throw De("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 U1(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=mr(mr({},Lp),{name:this.name});return kt.object(r,Xo,n)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Do(n,"toString",RI),this.forAllProps(function(i){Xy(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),Nh(n,this.willChange),Lh(n,this.didChange)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Ge(n.object),a=n.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(Ji(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=Ge(n.object),a=i.type.properties[n.name];if(a){var o=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:$a(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 De("Not a value property: "+n);var a=li(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw De("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=Ri(r.storedValue,o);u.reportObserved()}catch{throw De(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 De("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){Ji(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 Lo(a)?Mp(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],B1(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 Xo}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),e}(Es);sc.prototype.applySnapshot=nr(sc.prototype.applySnapshot);function MI(){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 sc({name:r,properties:n})}function LI(){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 mE(t){return Dr(t)&&(t.flags&nt.Object)>0}var ha=function(t){Dt(e,t);function e(r,n,i,a){a===void 0&&(a=oI);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 ho(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(xs(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}(gl),yE=new ha("string",nt.String,function(t){return typeof t=="string"}),bE=new ha("number",nt.Number,function(t){return typeof t=="number"}),II=new ha("integer",nt.Integer,function(t){return lI(t)}),jI=new ha("float",nt.Float,function(t){return sI(t)}),DI=new ha("finite",nt.Finite,function(t){return uI(t)}),_E=new ha("boolean",nt.Boolean,function(t){return typeof t=="boolean"}),wE=new ha("null",nt.Null,function(t){return t===null}),SE=new ha("undefined",nt.Undefined,function(t){return t===void 0}),EE=new ha("Date",nt.Date,function(t){return typeof t=="number"||t instanceof Date},function(t){return t instanceof Date?t:new Date(t)});EE.getSnapshot=function(t){return t.storedValue.getTime()};var OE=EE;function FI(t){switch(typeof t){case"string":return yE;case"number":return bE;case"boolean":return _E;case"object":if(t instanceof Date)return OE}throw De("Cannot determine primitive type from value "+t)}function xE(t){return Dr(t)&&(t.flags&(nt.String|nt.Number|nt.Integer|nt.Boolean|nt.Date))>0}var zI=function(t){Dt(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:nt.Literal}),n.value=r,n}return Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return ho(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 xs(r)&&r===this.value?un():cn(n,r,"Value is not a literal "+JSON.stringify(this.value))}}),e}(gl);function PE(t){return new zI(t)}function BI(t){return Dr(t)&&(t.flags&nt.Literal)>0}var UI=function(t){Dt(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|nt.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)?Ge(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}(oa);function GI(){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 UI(r,n,i,a)}function HI(t){return(t.flags&nt.Refinement)>0}function VI(t,e){var r=typeof t=="string"?e:t,n=Ip.apply(void 0,fo(r.map(function(i){return PE(""+i)})));return typeof t=="string"&&(n.name=t),n}var qI=function(t){Dt(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=mr({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=nt.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 De("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 De("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(Mp(i))}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),e}(oa);function Ip(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)?fo([t],e):e,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new qI(a,i,n)}function kE(t){return(t.flags&nt.Union)>0}var $I=function(t){Dt(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|nt.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"&&Ji(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}(oa);function WI(t,e){if(typeof e!="function"&&Ot(e))throw De("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Fo(t,e,r){return WI(t,e),new $I(t,e,r||YI)}var YI=[void 0];function KI(t){return Dr(t)&&(t.flags&nt.Optional)>0}var XI=Fo(SE,void 0),QI=Fo(wE,null);function AE(t){return Ip(t,XI)}function ZI(t){return Ip(t,QI)}var JI=function(t){Dt(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)|nt.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 De("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||K8}}),e}(oa);function ej(t,e){var r=typeof t=="string"?t:"late("+t.toString()+")",n=typeof t=="string"?e:t;return new JI(r,n)}function tj(t){return Dr(t)&&(t.flags&nt.Late)>0}function rj(t,e){return new nj(t,e)}var nj=function(t){Dt(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:nt.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:kt.array()}),Cm(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(nr(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=ho(this,r,n,i,a);return this.pendingNodeList.push(l),Cm(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):cE(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}(gl),TE=function(t){Dt(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:nt.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 ho(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return cE(r)?this.subType?this.subType.validate(r,n):un():cn(n,r,"Value is not serializable and cannot be frozen")}}),e}(gl),D3=new TE;function ij(t){return arguments.length===0?D3:Dr(t)?new TE(t):Fo(D3,t)}function aj(t){return Dr(t)&&(t.flags&nt.Frozen)>0}function oj(t){switch(t){case sr.beforeDestroy:return"destroy";case sr.beforeDetach:return"detach";default:return}}var lj=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}),q1(e))this.identifier=e;else if(Ot(e)){var n=Ge(e);if(!n.identifierAttribute)throw De("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw De("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw De("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=Bs(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 V1("[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}(),V1=function(t){Dt(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return e}(Error),CE=function(t){Dt(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:nt.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 q1(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){Ss(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){mE(o.type)?this.replaceRef(void 0):Ss(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=Ge(a),l=function(v,_){var g=oj(_);g&&i.fireInvalidated(g,r,n,o)},u=o.registerHook(sr.beforeDetach,l),f=o.registerHook(sr.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(sr.beforeDestroy,function(){o&&o()});var l=function(u){o&&o();var f=r.parent,v=f&&f.storedValue;if(f&&f.isAlive&&v){var _=void 0;i?_=!!i.get(n,v):_=r.root.identifierCache.has(a.targetType,Bs(n)),_?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===Er.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(sr.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(sr.afterAttach,function(){l(!1)}))}}}),e}(gl),sj=function(t){Dt(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)?H8(a):a,l=new lj(a,this.targetType),u=ho(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}(CE),uj=function(t){Dt(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=ho(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}(CE);function RE(t,e){var r=e||void 0,n=e?e.onInvalidated:void 0;return r&&(r.get||r.set)?new uj(t,{get:r.get,set:r.set},n):new sj(t,n)}function cj(t){return(t.flags&nt.Reference)>0}function fj(t,e){var r=RE(t,mr(mr({},e),{onInvalidated:function(n){e&&e.onInvalidated&&e.onInvalidated(n),n.removeRef()}}));return e&&e.acceptsUndefined===!1?r:AE(r)}var NE=function(t){Dt(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:nt.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 sc))throw De("Identifier types can only be instantiated as direct child of a model type");return ho(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 De("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}(gl),dj=function(t){Dt(e,t);function e(){var r=t.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:nt.Identifier}),r}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),e}(NE),hj=function(t){Dt(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}(NE),pj=new dj,gj=new hj;function vj(t){return Dr(t)&&(t.flags&nt.Identifier)>0}function Bs(t){return""+t}function q1(t){return typeof t=="string"||typeof t=="number"}function mj(t){return new yj(t)}var yj=function(t){Dt(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:nt.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 ho(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}(gl),bj={enumeration:VI,model:MI,compose:LI,custom:mj,reference:RE,safeReference:fj,union:Ip,optional:Fo,literal:PE,maybe:AE,maybeNull:ZI,refinement:GI,string:yE,boolean:_E,number:bE,integer:II,float:jI,finite:DI,Date:OE,map:kI,array:TI,frozen:ij,identifier:pj,identifierNumber:gj,late:ej,lazy:rj,undefined:SE,null:wE,snapshotProcessor:xI};const _j=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:PL,addMiddleware:eE,applyAction:X8,applyPatch:Ss,applySnapshot:B8,cast:TL,castFlowReturn:gI,castToReferenceSnapshot:RL,castToSnapshot:CL,clone:EL,createActionTrackingMiddleware:jL,createActionTrackingMiddleware2:FL,decorate:VL,destroy:xL,detach:OL,escapeJsonPath:$a,flow:pE,getChildType:oL,getEnv:kL,getIdentifier:H8,getLivelinessChecking:D8,getMembers:AL,getNodeId:NL,getParent:hL,getParentOfType:gL,getPath:G8,getPathParts:vL,getPropertyMembers:$8,getRelativePath:SL,getRoot:U8,getRunningActionContext:z1,getSnapshot:j1,getType:Mc,hasParent:dL,hasParentOfType:pL,isActionContextChildOf:WL,isActionContextThisOrChildOf:YL,isAlive:D1,isArrayType:CI,isFrozenType:aj,isIdentifierType:vj,isLateType:tj,isLiteralType:BI,isMapType:AI,isModelType:mE,isOptionalType:KI,isPrimitiveType:xE,isProtected:fL,isReferenceType:cj,isRefinementType:HI,isRoot:mL,isStateTreeNode:Ot,isType:Dr,isUnionType:kE,isValidReference:wL,joinJsonPath:ah,onAction:Q8,onPatch:z8,onSnapshot:lL,process:iI,protect:uL,recordActions:GL,recordPatches:sL,resolveIdentifier:bL,resolvePath:yL,setLivelinessChecking:j8,setLivelynessChecking:iL,splitJsonPath:Ps,toGenerator:mI,toGeneratorFunction:vI,tryReference:_L,tryResolve:V8,typecheck:nE,types:bj,unescapeJsonPath:gE,unprotect:cL,walk:q8},Symbol.toStringTag,{value:"Module"})),pa=Za(_j);var ME={},$1={};(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})($1);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UndoManager=void 0;const e=pa,r=$1;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=0;const v=()=>f>0;function _(){const h=(0,e.getSnapshot)(i);return{pages:h.pages,width:h.width,height:h.height}}function g(h){(0,e.applySnapshot)(i.pages,h.pages),i.setSize(h.width,h.height)}return{startTransaction(){f++},endTransaction(h){f--,h||this.requestAddState(_())},async ignore(h,w=!1,E=!1){E&&await new Promise(m=>setTimeout(m,10)),u&&n.addUndoState();let S=v();n.startTransaction();let b=f;try{await h()}catch(m){setTimeout(()=>{throw m})}const p=b!==f,d=!p;n.endTransaction(d),w||S||n.replaceState(),p||(clearTimeout(u),u=0)},async transaction(h){await n.ignore(h,!0),this.addUndoState()},requestAddState(h){l=h,u||v()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),v()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const h=n.history[n.undoIdx];!(0,r.deepEqual)(l,h)&&(clearTimeout(u),u=0,n.history.splice(n.undoIdx+1),n.history.push(l),n.undoIdx=n.history.length-1)},afterCreate(){if(i=(0,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(_())}),n.history.length===0&&this.requestAddState(_())},clear(){clearTimeout(u),u=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(_())},beforeDestroy(){a()},undo(){u&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,g(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,g(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=_()}}}),t.default=t.UndoManager})(ME);let wj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",LE=t=>crypto.getRandomValues(new Uint8Array(t)),IE=(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}}},Sj=(t,e=21)=>IE(t,e,LE),Ej=(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 Oj=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:Sj,customRandom:IE,nanoid:Ej,random:LE,urlAlphabet:wj},Symbol.toStringTag,{value:"Module"})),W1=Za(Oj);var jE={};(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})(jE);var DE={};(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})(DE);var FE={};(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
|
|
225
|
+
(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]);
|
|
226
|
+
`],{type:"application/javascript"}))})}t.getGIF=r,t.createGIF=n})(FE);var zE={};(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})(zE);var BE={},uc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCrop=t.cropImage=t.loadImage=t.getImageSize=void 0;const e=zs;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=v=>{u(v)},f.crossOrigin="anonymous",f.src=o})}async function i(o,l){const u=await n(o),f=document.createElement("canvas");f.width=2*u.width,f.height=2*u.height,f.getContext("2d").drawImage(u,0,0,f.width,f.height);const v=document.createElement("canvas");v.width=l.width,v.height=l.height;const _=v.getContext("2d");let{cropX:g,cropY:h}=l;const w=f.width*l.cropWidth,E=f.height*l.cropHeight,S=l.width/l.height;let b,p;const d=w/E;return l.type==="svg"?(b=w,p=E):S>=d?(b=w,p=w/S):(b=E*S,p=E),_.drawImage(f,g*f.width,h*f.height,b,p,0,0,v.width,v.height),v.toDataURL("image/png")}function a(o,l){const{width:u,height:f}=o,v=u/f;let _,g;v>=l.width/l.height?(_=l.width,g=l.width/v):(_=l.height*v,g=l.height);const h=(l.width-_)/2,w=(l.height-g)/2;return{cropX:h/l.width,cropY:w/l.height,cropWidth:_/l.width,cropHeight:g/l.height}}t.getImageSize=r,t.loadImage=n,t.cropImage=i,t.getCrop=a})(uc);(function(t){var e=me&&me.__createBinding||(Object.create?function(y,x,P,O){O===void 0&&(O=P);var N=Object.getOwnPropertyDescriptor(x,P);N&&!("get"in N?!x.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return x[P]}}),Object.defineProperty(y,O,N)}:function(y,x,P,O){O===void 0&&(O=P),y[O]=x[P]}),r=me&&me.__setModuleDefault||(Object.create?function(y,x){Object.defineProperty(y,"default",{enumerable:!0,value:x})}:function(y,x){y.default=x}),n=me&&me.__importStar||function(y){if(y&&y.__esModule)return y;var x={};if(y!=null)for(var P in y)P!=="default"&&Object.prototype.hasOwnProperty.call(y,P)&&e(x,y,P);return r(x,y),x};Object.defineProperty(t,"__esModule",{value:!0}),t.jsonToHTML=t.jsonToDOM=t.fixRatio=void 0;const i=uc,a=n(zs),o=uc,l=(y,x,...P)=>({type:y,props:x,children:P||[]});function u(y){var x=new DOMParser().parseFromString(y,"image/svg+xml");return x.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(x)}t.fixRatio=u;const f=async({element:y,page:x,store:P})=>{let{src:O}=y;if(y.type==="svg"){const Y=await a.urlToString(O);O=a.replaceColors(Y,new Map(Object.entries(y.colorsReplace)))}let N="";y.flipX&&(N+="scaleX(-1)"),y.flipY&&(N+="scaleY(-1)");const T={};if(y.clipSrc){const Y=await a.urlToBase64(y.clipSrc);T["clip-path"]=`url(${Y})`}const R=await(0,o.loadImage)(O),M=R.width*y.cropWidth,D=R.height*y.cropHeight,G=y.width/y.height;let F,K;const B=M/D;y.type==="svg"?(F=M,K=D):G>=B?(F=M,K=M/G):(F=D*G,K=D);const $=F/R.width,W=K/R.height,C=F/K>y.width/y.height?y.height/K:y.width/F,A=F*C/$,j=K*C/W,z=y.cropX*C*R.width,H=y.cropY*C*R.height;return l("div",{src:O,style:Object.assign(Object.assign({},T),{width:"100%",height:"100%","border-radius":y.cornerRadius+"px",border:y.borderSize?`${y.borderSize}px solid ${y.borderColor}`:"none",background:`url(${O})`,transform:N,"background-size":`${Math.round(A)}px ${Math.round(j)}px`,"background-position-x":-Math.round(z)+"px","background-position-y":-Math.round(H)+"px"})})},v=async({element:y,page:x,store:P})=>{let O={};y.fill.indexOf("gradient")>=0&&(O=Object.assign(Object.assign({},O),{"background-color":y.fill,"background-image":y.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const N=y.backgroundPadding*(y.fontSize*y.lineHeight),T=l("div",{style:{position:"absolute",top:-N/2+"px",left:-N/2+"px",display:y.backgroundEnabled?"block":"none",width:y.width+N+"px",height:y.height+N+"px","background-color":y.backgroundColor,"border-radius":y.backgroundCornerRadius*(y.fontSize*y.lineHeight*.5)+"px"}}),R=l("div",{style:Object.assign(Object.assign({},O),{position:"absolute",top:0,left:0,width:y.width+"px",color:y.fill,"white-space":"pre-wrap","font-size":y.fontSize+"px","text-align":y.align,"font-family":y.fontFamily,"text-decoration":y.textDecoration||"none","line-height":y.lineHeight,"letter-spacing":y.letterSpacing+"em","font-style":y.fontStyle,"font-weight":y.fontWeight,"-webkit-text-stroke":`${y.strokeWidth}px ${y.stroke}`,"text-stroke":`${y.strokeWidth}px ${y.stroke}`})},y.text.split(`
|
|
227
|
+
`).join("<br />"));return l("div",{style:{position:"relative"}},T,R)},_=({element:y,type:x})=>{const P={"stroke-width":y.height,stroke:y.color,"line-cap":"round","stroke-linejoin":"round",opacity:y.opacity};return x==="arrow"||x==="triangle"?l("polyline",Object.assign({points:`${3*y.height},${2*-y.height} 0,0 ${3*y.height},${2*y.height}`},P)):x==="bar"?l("polyline",Object.assign({points:`0,${2*-y.height} 0,${2*y.height}`},P)):x==="circle"?l("circle",Object.assign({r:y.height},P)):x==="square"?l("polyline",Object.assign({points:`${-y.height},${-y.height} ${-y.height},${y.height} ${y.height},${y.height} ${y.height},${-y.height}`},P)):null},g=async({element:y,page:x,store:P})=>l("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},l("rect",{x:0,y:0,width:y.width,height:y.height,fill:y.color}),l("g",{transform:`translate(0 ${y.height/2})`},_({element:y,type:y.startHead})),l("g",{transform:`translate(${y.width} ${y.height/2}) rotate(180)`},_({element:y,type:y.endHead}))),h=async({element:y,page:x,store:P,elementHook:O})=>{const N=await Promise.all(y.children.map(R=>E({element:R,page:x,store:P,elementHook:O}))),T=l("div",{style:{"transform-origin":"top left",opacity:y.opacity}},...N);return O&&O({dom:T,element:y})||T},w={image:f,svg:f,text:v,line:g,group:h};async function E({element:y,page:x,store:P,elementHook:O}){let N=await w[y.type];N||(N=()=>l("div",{}),console.error(`HTML export does not support ${y.type} type...`));const T=await N({element:y,page:x,store:P}),R=[];y.blurEnabled&&R.push(`blur(${y.blurRadius/2}px)`),y.brightnessEnabled&&R.push(`brightness(${100*y.brightness+100}%)`),y.sepiaEnabled&&R.push("sepia()"),y.grayscaleEnabled&&R.push("grayscale()"),y.shadowEnabled&&R.push(`drop-shadow(${y.shadowOffsetX}px ${y.shadowOffsetY}px ${y.shadowBlur}px ${y.shadowColor})`);const M=l("div",{style:{position:"absolute",left:y.x+"px",top:y.y+"px",width:y.width+"px",height:y.height+"px",transform:`rotate(${y.rotation}deg)`,"transform-origin":"top left",opacity:y.opacity,filter:R.join(" ")}},T);return O&&O({dom:M,element:y})||M}async function S({page:y,store:x,elementHook:P}){const O=await Promise.all(y.children.map(T=>E({element:T,page:y,store:x,elementHook:P})));let N={};if(y.background.indexOf("url")>=0||y.background.indexOf("http")>=0||y.background.indexOf(".jpg")>=0||y.background.indexOf(".png")>=0||y.background.indexOf(".jpeg")>=0){const{width:T,height:R}=await(0,o.loadImage)(y.background),M=await f({element:Object.assign({x:0,y:0,width:x.width,height:x.height,src:y.background,cornerRadius:0},(0,i.getCrop)({width:x.width,height:x.height},{width:T,height:R})),page:y,store:x});O.unshift(M)}else N=Object.assign(Object.assign({},N),{"background-color":y.background});return l("div",{className:"page",style:Object.assign(Object.assign({},N),{width:x.width+"px",height:x.height+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...O)}async function b({json:y,elementHook:x}){const P=await Promise.all(y.pages.map(T=>S({page:T,store:y,elementHook:x}))),O=[];y.pages.forEach(T=>{T.children.forEach(R=>{R.type==="text"&&O.indexOf(R.fontFamily)===-1&&O.push(R.fontFamily)})});const N=O.map(T=>y.fonts.find(R=>R.fontFamily===T)?l("style",{},""):l("link",{href:`https://fonts.googleapis.com/css?family=${T}`,rel:"stylesheet"}));return l("div",{className:"design"},...N,...P)}t.jsonToDOM=b;const p=(y,x)=>typeof x=="object"?`${y}="${Object.keys(x).map(P=>`${P}:${x[P]};`).join(" ")}"`:`${y}="${x}"`,d=({dom:y})=>typeof y=="string"?y:y?`<${y.type} ${Object.keys(y.props).map(x=>p(x,y.props[x])).join(" ")}>${y.children.map(x=>d({dom:x})).join("")}</${y.type}>`:"";async function m({json:y,elementHook:x}){const P=await b({json:y,elementHook:x});return d({dom:P})}t.jsonToHTML=m})(BE);var UE={};(function(t){var e=me&&me.__createBinding||(Object.create?function(x,P,O,N){N===void 0&&(N=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,N,T)}:function(x,P,O,N){N===void 0&&(N=O),x[N]=P[O]}),r=me&&me.__setModuleDefault||(Object.create?function(x,P){Object.defineProperty(x,"default",{enumerable:!0,value:P})}:function(x,P){x.default=P}),n=me&&me.__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=uc,a=n(zs),o=uc,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")},v=async({element:x,page:P,store:O})=>{let{src:N}=x;if(x.type==="svg"){const U=await a.urlToString(N);N=a.replaceColors(U,new Map(Object.entries(x.colorsReplace)))}let T="";x.flipX&&(T+="scaleX(-1)"),x.flipY&&(T+="scaleY(-1)");const R={};if(x.clipSrc){const U=await a.urlToBase64(x.clipSrc);R["clip-path"]=`url(${U})`}const M=await(0,o.loadImage)(N),D=M.width*x.cropWidth,G=M.height*x.cropHeight,F=x.width/x.height;let K,B;const $=D/G;x.type==="svg"?(K=D,B=G):F>=$?(K=D,B=D/F):(K=G*F,B=G);const W=K/M.width,C=B/M.height,A=K/B>x.width/x.height?x.height/B:x.width/K,j=K*A/W,z=B*A/C,H=x.cropX*A*M.width,Y=x.cropY*A*M.height,q=`clip-${Math.random()}`;return l("g",{style:{"clip-path":R["clip-path"],transform:T}},l("defs",{},l("clipPath",{id:q},l("rect",{x:H,y:Y,width:j,height:z}))),l("image",{"xlink:href":await f(N),width:x.width,height:x.height,preserveAspectRatio:"none","clip-path":`url(#${q})`}))},_=async({element:x,page:P,store:O})=>{let N={};x.fill.indexOf("gradient")>=0&&(N=Object.assign(Object.assign({},N),{"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),R=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"}}),M=l("div",{style:Object.assign(Object.assign({},N),{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(`
|
|
228
|
+
`).join("<br />"));return l("foreignObject",{width:x.width,height:x.height},l("div",{style:{position:"relative"},xmlns:"http://www.w3.org/1999/xhtml"},R,M))},g=({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})`},g({element:x,type:x.startHead})),l("g",{transform:`translate(${x.width} ${x.height/2}) rotate(180)`},g({element:x,type:x.endHead}))),w=async({element:x,page:P,store:O,elementHook:N})=>{const T=await Promise.all(x.children.map(M=>S({element:M,page:P,store:O,elementHook:N}))),R=l("g",{opacity:x.opacity,style:{"transform-origin":"top left"}},...T);return N&&N({dom:R,element:x})||R},E={image:v,svg:v,text:_,line:h,group:w};async function S({element:x,page:P,store:O,elementHook:N}){let T=await E[x.type];T||(T=()=>l("div",{}),console.error(`HTML export does not support ${x.type} type...`));const R=await T({element:x,page:P,store:O}),M=[];x.blurEnabled&&M.push(`blur(${x.blurRadius/2}px)`),x.brightnessEnabled&&M.push(`brightness(${100*x.brightness+100}%)`),x.sepiaEnabled&&M.push("sepia()"),x.grayscaleEnabled&&M.push("grayscale()"),x.shadowEnabled&&M.push(`drop-shadow(${x.shadowOffsetX}px ${x.shadowOffsetY}px ${x.shadowBlur}px ${x.shadowColor})`);const D=l("g",{transform:`translate(${x.x}, ${x.y}) rotate(${x.rotation})`,rotation:x.rotation,width:x.width,height:x.height,opacity:x.opacity,style:{"transform-origin":"top left",filter:M.join(" ")}},R);return N&&N({dom:D,element:x})||D}async function b({page:x,store:P,elementHook:O}){const N=await Promise.all(x.children.map(R=>S({element:R,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 R=await(0,o.loadImage)(x.background),M=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:R.width,height:R.height})));T=Object.assign(Object.assign({},T),{"background-image":`url(${M})`})}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}),...N)}async function p({json:x,elementHook:P}){const O=await Promise.all(x.pages.map(R=>b({page:R,store:x,elementHook:P}))),N=[];x.pages.forEach(R=>{R.children.forEach(M=>{M.type==="text"&&N.indexOf(M.fontFamily)===-1&&N.push(M.fontFamily)})});const T=N.map(R=>x.fonts.find(M=>M.fontFamily===R)?l("style",{},""):l("link",{href:`https://fonts.googleapis.com/css?family=${R}`,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}"`,m=({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=>m({dom:P})).join("")}</${x.type}>
|
|
229
|
+
`:"";async function y({json:x,elementHook:P}){const O=await p({json:x,elementHook:P});return m({dom:O})}t.jsonToSVG=y})(UE);var _0={},w0={},S0={},F3;function GE(){return F3||(F3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Node=void 0;const e=pa,r=W1,n=Y1(),i=qE(),a=sh();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={},{skipSelect:u=!1}={}){const f=JSON.parse(JSON.stringify(o.toJSON()));return l.id=l.id||(0,r.nanoid)(10),(0,a.forEveryChild)(f,v=>{v.id=(0,r.nanoid)(10)}),Object.assign(f,l),o.page.addElement(f,{skipSelect:u})},set(l){Object.assign(o,l)},moveUp(){o.page.moveElementsUp([o.id])},moveTop(){o.page.moveElementsTop([o.id])},moveDown(){o.page.moveElementsDown([o.id])},moveBottom(){o.page.moveElementsBottom([o.id])},beforeDestroy(){}}))}(S0)),S0}var E0={},HE={};(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 v=a[f]+l.from[f],_=a[f]+l.to[f];if(o.type==="exit"){const h=v;v=_,_=-h}const g=_-v;u[f]=v+i/o.duration*g}return u},zoom:({dTime:i,element:a,animation:o})=>{const l={},u={x:a.x+a.width/3,y:a.y+a.height/3,width:a.width/3,height:a.height/3,fontSize:a.fontSize/3},f={x:a.x,y:a.y,width:a.width,height:a.height,fontSize:a.fontSize};for(var v in u){let _=u[v],g=f[v];if(o.type==="exit"){const w=_;_=g,g=w}const h=g-_;l[v]=_+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})(HE);var z3;function Lc(){return z3||(z3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.Animation=void 0;const e=pa,r=HE,n=GE();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(_=>_.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 _=l-f.delay,g=(0,r.animate)({element:i,animation:f,dTime:_});Object.assign(o,g)}const v=i.animations.find(_=>_.type==="exit");if(v!=null&&v.enabled&&l>=i.page.duration-v.duration){const _=l-(i.page.duration-v.duration),g=(0,r.animate)({element:i,animation:v,dTime:_});Object.assign(o,g)}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))}}))}(E0)),E0}var O0={},B3;function xj(){return B3||(B3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextElement=void 0;const e=pa,r=Lc();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()}}))}(O0)),O0}var x0={},U3;function VE(){return U3||(U3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageElement=void 0;const e=Lc();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()},beforeDestroy(){r._cropModeEnabled&&r.store.history.endTransaction()}}))}(x0)),x0}var P0={},G3;function Pj(){return G3||(G3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.VideoElement=void 0;const e=VE();t.VideoElement=e.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1})}(P0)),P0}var k0={},H3;function kj(){return H3||(H3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LineElement=void 0;const e=pa,r=Lc();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=>({}))}(k0)),k0}var A0={},V3;function Aj(){return V3||(V3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SVGElement=void 0;const e=pa,r=Lc();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)}}))}(A0)),A0}var q3;function sh(){return q3||(q3=1,function(t){var e=me&&me.__rest||function(w,E){var S={};for(var b in w)Object.prototype.hasOwnProperty.call(w,b)&&E.indexOf(b)<0&&(S[b]=w[b]);if(w!=null&&typeof Object.getOwnPropertySymbols=="function"){var p=0;for(b=Object.getOwnPropertySymbols(w);p<b.length;p++)E.indexOf(b[p])<0&&Object.prototype.propertyIsEnumerable.call(w,b[p])&&(S[b[p]]=w[b[p]])}return S};Object.defineProperty(t,"__esModule",{value:!0}),t.registerShapeModel=t.TYPES_MAP=t.GroupElement=t.ElementTypes=t.forEveryChild=void 0;const r=pa,n=GE(),i=Lc(),a=xj(),o=VE(),l=Pj(),u=kj(),f=Aj(),v=(w,E)=>{w.children&&w.children.forEach(S=>{E(S),(0,t.forEveryChild)(S,E)})};t.forEveryChild=v;const _=[...new Array(20)].map((w,E)=>r.types.late(()=>g[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),..._),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:b,styleEditable:p,resizable:d}=E,m=e(E,["draggable","contentEditable","styleEditable","resizable"]);S!==void 0&&(0,t.forEveryChild)(w,y=>{y.set({draggable:S})}),b!==void 0&&(0,t.forEveryChild)(w,y=>{y.set({contentEditable:b})}),p!==void 0&&(0,t.forEveryChild)(w,y=>{y.set({styleEditable:p})}),d!==void 0&&(0,t.forEveryChild)(w,y=>{y.set({resizable:d})}),Object.assign(w,m)}}));const g=[];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,g.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}(w0)),w0}var $3;function qE(){return $3||($3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Page=void 0;const e=pa,r=W1,n=sh(),i=Y1(),a=sh();t.Page=e.types.model("Page",{id:e.types.identifier,children:e.types.array(e.types.late(()=>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(v=>({id:v,index:o.children.findIndex(_=>_.id===v)}));f.sort((v,_)=>_.index-v.index);for(const{index:v}of f){if(v==-1)continue;const _=v<o.children.length-1&&o.children[v+1],g=l.indexOf(_==null?void 0:_.id)>=0;v===o.children.length-1||g||u(v)}},_forEachElementDown(l,u){const f=l.map(v=>({id:v,index:o.children.findIndex(_=>_.id===v)}));f.sort((v,_)=>v.index-_.index);for(const{index:v}of f){if(v==-1)continue;const _=v>0&&o.children[v-1],g=l.indexOf(_==null?void 0:_.id)>=0;v===0||g||u(v)}return!1}})).actions(o=>({clone(l={}){const u=o.toJSON();u.children.forEach(g=>{g.id=(0,r.nanoid)(10),(0,a.forEveryChild)(g,h=>{h.id=(0,r.nanoid)(10)})});const f=Object.assign(Object.assign(Object.assign({},u),{id:(0,r.nanoid)(10)}),l),v=o.store.addPage(f),_=o.store.pages.indexOf(o);v.setZIndex(_+1),v.select()},setZIndex(l){o.store.setPageZIndex(o.id,l)},set(l){Object.assign(o,l)},select(){o.store.selectPage(o.id)},addElement(l,{skipSelect:u=!1}={}){const f=a.TYPES_MAP[l.type];if(!f)return void console.error("Can not find model with type "+l.type);l.children&&l.children.forEach(_=>{_.id=(0,r.nanoid)(10)});const v=f.create(Object.assign({id:(0,r.nanoid)(10)},l));return o.children.push(v),v.selectable&&!u&&o.store.selectElements([v.id]),v},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(v=>{l.indexOf(v.id)>=0?u.push(v):f.push(v)}),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(v=>{l.indexOf(v.id)>=0?u.push(v):f.push(v)}),o.children.replace(u.concat(f))},setElementZIndex(l,u){const f=o.children.find(v=>v.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:v}){if(f){const _=l/o.computedWidth,g=u/o.computedHeight,h=Math.min(_,g),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*_,height:S.height*g,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})))})}v||(o.width=l),v||(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])}}))}(_0)),_0}var W3;function Y1(){return W3||(W3=1,function(t){var e=me&&me.__createBinding||(Object.create?function(O,N,T,R){R===void 0&&(R=T);var M=Object.getOwnPropertyDescriptor(N,T);M&&!("get"in M?!N.__esModule:M.writable||M.configurable)||(M={enumerable:!0,get:function(){return N[T]}}),Object.defineProperty(O,R,M)}:function(O,N,T,R){R===void 0&&(R=T),O[R]=N[T]}),r=me&&me.__setModuleDefault||(Object.create?function(O,N){Object.defineProperty(O,"default",{enumerable:!0,value:N})}:function(O,N){O.default=N}),n=me&&me.__importStar||function(O){if(O&&O.__esModule)return O;var N={};if(O!=null)for(var T in O)T!=="default"&&Object.prototype.hasOwnProperty.call(O,T)&&e(N,O,T);return r(N,O),N},i=me&&me.__rest||function(O,N){var T={};for(var R in O)Object.prototype.hasOwnProperty.call(O,R)&&N.indexOf(R)<0&&(T[R]=O[R]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function"){var M=0;for(R=Object.getOwnPropertySymbols(O);M<R.length;M++)N.indexOf(R[M])<0&&Object.prototype.propertyIsEnumerable.call(O,R[M])&&(T[R[M]]=O[R[M]])}return T},a=me&&me.__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=pa,l=ME,u=W1,f=a(ci),v=jE,_=DE,g=FE,h=L1(),w=n(Rc),E=aa,S=Np,b=$1,p=zE,d=BE,m=UE,y=qE(),x=sh();function P({key:O,showCredit:N}={key:"",showCredit:!1}){const T=t.Store.create();return(0,h.validateKey)(O,N),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(y.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(N=>{for(const T of O.pages)for(const R of T.children)if(R.id===N)return R}).filter(N=>!!N)},get children(){return O.pages},get selectedShapes(){const N=[];return O.selectedElementsIds.forEach(T=>{for(const R of O.pages)for(const M of R.children)M.id===T&&M.type!=="group"&&N.push(M),M.type==="group"&&M.id===T&&N.push(...M.children)}),N},get activePage(){return O.pages.slice().find(N=>N.id===O._activePageId)||(O.pages.length?O.pages[0]:null)},get duration(){let N=0;return O.pages.forEach(T=>{N+=T.duration}),N}})).actions(O=>{let N=0;return{afterCreate(){O.history.canUndo},setCurrentTime(T){O.currentTime=T},play({animatedElementsIds:T=[],currentTime:R=0}={}){O.animatedElementsIds=(0,o.cast)(T),O.currentTime=R,O.isPlaying=!0,N=Date.now(),requestAnimationFrame(O.seek)},seek(){if(!O.isPlaying)return;const T=Date.now(),R=T-N;N=T,O.currentTime+=R;let M=0;for(const D of O.pages){if(O.currentTime>=D.startTime&&O.currentTime<D.startTime+D.duration){O.selectPage(D.id);break}M+=D.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:N,dpi:T}){O.unit=N||O.unit,O.dpi=T||O.dpi},setRole(N){O.role=N},find(N){let T;return(0,x.forEveryChild)({children:O.pages},R=>{!T&&N(R)&&(T=R)}),T},getElementById:N=>O.find(T=>T.id===N),addPage(N){const T=y.Page.create(Object.assign({id:(0,u.nanoid)(10)},N));return O.pages.push(T),O._activePageId=T.id,T},selectPage(N){O._activePageId=N},selectElements(N){const T=N.map(R=>O.getElementById(R)).sort((R,M)=>R.page.children.indexOf(R)-R.page.children.indexOf(M)).filter(R=>!!R).map(R=>R.id);O.selectedElementsIds=(0,o.cast)(T)},toggleBleed(N){O.bleedVisible=N??!O.bleedVisible},toggleRulers(N){O.rulesVisible=N??!O.rulesVisible},openSidePanel(N){O.openedSidePanel=N},setScale(N){O.scale=N},_setScaleToFit(N){O.scaleToFit=N},setElementsPixelRatio(N){O._elementsPixelRatio=N},setSize(N,T,R){O.pages.forEach(M=>{M.setSize({width:N,height:T,useMagic:R,softChange:!0})}),O.width=N,O.height=T},setPageZIndex(N,T){const R=O.pages.find(M=>M.id===N);R&&((0,o.detach)(R),O.pages.remove(R),O.pages.splice(T,0,R))},deletePages(N){const T=O.pages.indexOf(O.activePage);N.forEach(D=>{const G=O.pages.find(F=>F.id===D);(0,o.destroy)(G)});const R=Math.min(O.pages.length-1,T),M=O.pages[R];M&&(O._activePageId=M.id),O.selectedElementsIds=(0,o.cast)(O.selectedElementsIds.filter(D=>O.getElementById(D)))},groupElements(N){const T=N.map(D=>O.getElementById(D));T.forEach(D=>{D&&(0,o.detach)(D)});const R=O.activePage,M={id:(0,u.nanoid)(10),children:T,type:"group"};return R.children.push(M),O.selectedElementsIds=(0,o.cast)([M.id]),M},ungroupElements(N){const T=N.map(M=>O.getElementById(M)),R=[];T.forEach(M=>{if(M&&M.type==="group"){const D=M.page,G=D.children.indexOf(M);M.children.forEach(F=>{R.push(F.id)}),M.children.forEach(F=>{(0,o.detach)(F),D.children.push(F)}),D.children.splice(G,1)}}),O.selectedElementsIds=(0,o.cast)(R)},deleteElements(N){N.forEach(T=>{O.pages.forEach(R=>{const M=R.children.find(D=>D.id===T);M&&(0,o.destroy)(M)})}),O.selectedElementsIds=(0,o.cast)(O.selectedElementsIds.filter(T=>O.getElementById(T)))},on(N,T){if(N==="change"){let R=O.toJSON();return(0,o.onSnapshot)(O,M=>{const D=O.toJSON();!(0,b.deepEqual)(R,D)&&(R=D,T(D))})}},async _toCanvas({pixelRatio:N,ignoreBackground:T,pageId:R,mimeType:M,includeBleed:D}={}){var G;const F=N||1;R=R||((G=O.pages[0])===null||G===void 0?void 0:G.id);const K=O.pages.find(ee=>ee.id===R);if(!K)throw new Error(`No page for export with id ${R}`);K==null||K.set({_exporting:!0});const B=await(0,p.waitTillAvailable)(()=>f.default.stages.find(ee=>ee.getAttr("pageId")===R));if(!B)throw new Error(`Export is failed. Can not find stage for page ${R}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const $=!!B.findOne(".page-container");await O.waitLoading();const W=B.findOne(".page-container");if(!W)throw new Error(`Export is failed. Can't find page container. ${$}`);B.find("Transformer").forEach(ee=>ee.visible(!1)),W.find(".page-background").forEach(ee=>ee.shadowEnabled(!1)),W.find(".page-background").forEach(ee=>ee.strokeEnabled(!1)),W.find(".highlighter").forEach(ee=>ee.visible(!1));const C=W.findOne(".page-background-group"),A=C.clip();C.clip({x:null,y:null,width:null,height:null});const j=W.findOne(".elements-container"),z=j.clip();j.clip({x:null,y:null,width:null,height:null});const H=W.find(ee=>ee.getAttr("hideInExport"));H.forEach(ee=>{ee.setAttr("oldVisible",ee.visible()),ee.hide()});const Y=W.find(ee=>!ee.visible()&&ee.getAttr("editModeEnabled"));Y.forEach(ee=>{ee.setAttr("oldVisible",ee.visible()),ee.show()}),T&&W.find(".page-background").forEach(ee=>ee.hide());const q=D?K.bleed:0;let U=q;!O.bleedVisible&&D||(O.bleedVisible||D?O.bleedVisible&&D?U=0:O.bleedVisible&&!D&&(U=-K.bleed):U=0);const X=document.createElement("canvas");X.width=Math.round((K.computedWidth+2*q)*F),X.height=Math.round((K.computedHeight+2*q)*F);const Q=X.getContext("2d");M==="image/jpeg"&&(Q.fillStyle="white",Q.fillRect(0,0,X.width,X.height));const Z=W.scale();W.scale({x:1,y:1});const re=W.toCanvas({x:W.x()-U,y:W.y()-U,width:K.computedWidth+2*q,height:K.computedHeight+2*q,pixelRatio:F});return W.scale(Z),Q.drawImage(re,0,0,X.width,X.height),f.default.Util.releaseCanvas(re),T&&W.find(".page-background").forEach(ee=>ee.show()),H.forEach(ee=>{ee.visible(ee.getAttr("oldVisible"))}),Y.forEach(ee=>{ee.visible(ee.getAttr("oldVisible"))}),W.find(".page-background").forEach(ee=>ee.shadowEnabled(!0)),W.find(".page-background").forEach(ee=>ee.strokeEnabled(!0)),B.find("Transformer").forEach(ee=>ee.visible(!0)),W.find(".highlighter").forEach(ee=>ee.visible(!0)),C.clip(A),j.clip(z),K==null||K.set({_exporting:!1}),X},async toDataURL({pixelRatio:N,ignoreBackground:T,pageId:R,mimeType:M,includeBleed:D,quality:G}={}){const F=await O._toCanvas({pixelRatio:N,ignoreBackground:T,pageId:R,mimeType:M,includeBleed:D}),K=F.toDataURL(M,G);return f.default.Util.releaseCanvas(F),K},async toBlob({pixelRatio:N,ignoreBackground:T,pageId:R,mimeType:M,includeBleed:D,quality:G}={}){const F=await O._toCanvas({pixelRatio:N,ignoreBackground:T,pageId:R,mimeType:M,includeBleed:D}),K=new Promise(B=>{F.toBlob(B,M,G)});return f.default.Util.releaseCanvas(F),K},async saveAsImage(N={}){var{fileName:T}=N,R=i(N,["fileName"]);const M=R.mimeType||"image/png",D=M.split("/")[1];(0,v.downloadFile)(await O.toDataURL(R),T||"polotno."+D,M)},async _toPDF(N){const T=N.dpi||O.dpi,R=N.parallel||1,M=N.unit||(O.unit==="px"?"mm":O.unit),D=N.pixelRatio||1,G=N.pageIds||O.pages.map(q=>q.id),F=O.pages.filter(q=>G.includes(q.id)),K=await(0,_.getJsPDF)(),B=q=>(0,S.pxToUnit)({px:q,unit:M,dpi:T}),$=B(N.cropMarkSize||0),W=F[0]||{},C=N.includeBleed?W.bleed:0,A=B(W.computedWidth+2*C)+2*$,j=B(W.computedHeight+2*C)+2*$;var z=new K({unit:M,orientation:A>j?"landscape":"portrait",format:[A,j],compress:!0,putOnlyUsedFonts:!0});z.deletePage(1);const H=O._elementsPixelRatio;O.setElementsPixelRatio(D),await new Promise(q=>setTimeout(q));const Y=((q,U)=>{for(var X=[],Q=0;Q<q.length;Q+=U)X.push(q.slice(Q,Q+U));return X})(F,R);for(const q of Y){const U=q.map(async X=>{const Q=N.includeBleed?X.bleed:0,Z=B(X.computedWidth+2*Q)+2*$,re=B(X.computedHeight+2*Q)+2*$;let ee=0,le=D;for(;ee<10;){ee+=1,ee===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const ce=await O.toDataURL(Object.assign(Object.assign({},N),{pageId:X.id,pixelRatio:le}));if(ce.length>20)return{url:ce,width:Z,height:re};le*=.8}});(await Promise.all(U)).forEach(({url:X,width:Q,height:Z})=>{z.addPage([Q,Z],Q>Z?"landscape":"portrait"),$&&(z.setLineWidth(B(1)),z.line(2*$,0,2*$,$),z.line(0,2*$,$,2*$),z.line(Q-2*$,0,Q-2*$,$),z.line(Q,2*$,Q-$,2*$),z.line(0,Z-2*$,$,Z-2*$),z.line(2*$,Z,2*$,Z-$),z.line(Q,Z-2*$,Q-$,Z-2*$),z.line(Q-2*$,Z,Q-2*$,Z-$)),z.addImage(X,$,$,Q-2*$,Z-2*$,void 0,"FAST")})}return O.setElementsPixelRatio(H),z},toPDFDataURL:async N=>(await O._toPDF(Object.assign({mimeType:"image/jpeg"},N))).output("datauristring"),async toGIFDataURL(N={}){const T=N.pixelRatio||1,R=await(0,g.createGIF)({width:O.width*T,height:O.height*T}),M=1e3/(N.fps||10),D=O.duration/M;for(let G=0;G<D-1;G++){const F=G*M||1;O.setCurrentTime(F);let K=0,B="";for(const W of O.pages)if(K+=W.duration,W.set({_rendering:K>F}),K>F){B=W.id;break}const $=await O._toCanvas({pixelRatio:T,pageId:B});R.addFrame($.getContext("2d"),{delay:M,copy:!0})}for(const G of O.pages)G.set({_rendering:!1});return O.stop(),R.render(),new Promise(G=>{R.on("finished",function(F){(function(K,B){var $=new FileReader;$.onload=function(W){B(W.target.result)},$.readAsDataURL(K)})(F,G)})})},async saveAsGIF(N={}){var{fileName:T}=N,R=i(N,["fileName"]);const M=await O.toGIFDataURL(R);(0,v.downloadFile)(M,T||"polotno.gif")},async toHTML(){const N=O.toJSON();return(0,d.jsonToHTML)({json:N})},async saveAsHTML({fileName:N}={}){const T=await O.toHTML(),R="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(T)));(0,v.downloadFile)(R,N||"polotno.html")},async toSVG(){const N=O.toJSON();return(0,m.jsonToSVG)({json:N})},async saveAsSVG({fileName:N}={}){const T=await O.toSVG(),R="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(T)));(0,v.downloadFile)(R,N||"polotno.svg")},async saveAsPDF(N={}){var{fileName:T}=N,R=i(N,["fileName"]);(await O._toPDF(Object.assign({mimeType:"image/jpeg"},R))).save(T||"polotno.pdf")},async waitLoading(){await new Promise(N=>setTimeout(N,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(N,T=!1){var R;const M=Object.assign({},N),D=O.pages.indexOf(O.activePage);let G=(R=M.pages[D]||M.pages[0])===null||R===void 0?void 0:R.id;M._activePageId=G;const F=Object.assign({},(0,o.getSnapshot)(O));Object.assign(F,M),F.history=T?O.history.toJSON():{history:[],undoIdx:-1},(0,o.applySnapshot)(O,F)},clear({keepHistory:N=!1}={}){const T=O.pages.map(R=>R.id);O.deletePages(T),N||O.history.clear()},addFont(N){O.removeFont(N.fontFamily),O.fonts.push(N),O.loadFont(N.fontFamily)},removeFont(N){O.fonts.filter(T=>T.fontFamily===N).forEach(T=>(0,o.destroy)(T))},async loadFont(N){const T=O.fonts.find(R=>R.fontFamily===N)||w.globalFonts.find(R=>R.fontFamily===N);T?w.injectCustomFont(T):w.injectGoogleFont(N),await w.loadFont(N)},validate:N=>t.Store.validate(N,[{path:"",type:t.Store}]).map(T=>({path:"store"+T.context.map(R=>R.path).join("."),message:T.message}))})),t.createStore=P,t.default=P}(g0)),g0}var Tj=Y1();fl.toggleFadeInAnimation(!1);zn.setTextOverflow("change-font-size");const Cj=new URLSearchParams(location.search).get("key"),$E=Tj.createStore({key:Cj});window.store=$E;window.config={addGlobalFont:Rc.addGlobalFont,unstable_useHtmlTextRender:zn.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:zn.setTextVerticalResizeEnabled,unstable_setTextOverflow:zn.setTextOverflow,onLoadError:aa.onLoadError,setAssetLoadTimeout:aa.setAssetLoadTimeout};const Rj=bd.createRoot(document.getElementById("root"));Rj.render(ft.createElement(oS.WorkspaceCanvas,{store:$E,components:{PageControls:()=>null,Tooltip:()=>null}}));
|