polotno-node 2.9.26 → 2.9.28
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-BorBURbT.js +288 -0
- package/dist/index.html +1 -1
- package/package.json +6 -6
- package/video-parallel.js +3 -1
- package/dist/assets/index-K6bexdEY.js +0 -281
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Eh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function fo(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var M_={exports:{}},pt={};/**
|
|
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 Ec=Symbol.for("react.element"),OE=Symbol.for("react.portal"),PE=Symbol.for("react.fragment"),xE=Symbol.for("react.strict_mode"),CE=Symbol.for("react.profiler"),TE=Symbol.for("react.provider"),kE=Symbol.for("react.context"),AE=Symbol.for("react.forward_ref"),RE=Symbol.for("react.suspense"),ME=Symbol.for("react.memo"),LE=Symbol.for("react.lazy"),i3=Symbol.iterator;function NE(e){return e===null||typeof e!="object"?null:(e=i3&&e[i3]||e["@@iterator"],typeof e=="function"?e:null)}var L_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N_=Object.assign,I_={};function Ds(e,t,r){this.props=e,this.context=t,this.refs=I_,this.updater=r||L_}Ds.prototype.isReactComponent={};Ds.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ds.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function D_(){}D_.prototype=Ds.prototype;function bm(e,t,r){this.props=e,this.context=t,this.refs=I_,this.updater=r||L_}var _m=bm.prototype=new D_;_m.constructor=bm;N_(_m,Ds.prototype);_m.isPureReactComponent=!0;var a3=Array.isArray,j_=Object.prototype.hasOwnProperty,wm={current:null},F_={key:!0,ref:!0,__self:!0,__source:!0};function z_(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)j_.call(t,n)&&!F_.hasOwnProperty(n)&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){for(var u=Array(l),f=0;f<l;f++)u[f]=arguments[f+2];i.children=u}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return{$$typeof:Ec,type:e,key:a,ref:o,props:i,_owner:wm.current}}function IE(e,t){return{$$typeof:Ec,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Sm(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ec}function DE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var o3=/\/+/g;function c1(e,t){return typeof e=="object"&&e!==null&&e.key!=null?DE(""+e.key):t.toString(36)}function yd(e,t,r,n,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Ec:case OE:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+c1(o,0):n,a3(i)?(r="",e!=null&&(r=e.replace(o3,"$&/")+"/"),yd(i,t,r,"",function(f){return f})):i!=null&&(Sm(i)&&(i=IE(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(o3,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",a3(e))for(var l=0;l<e.length;l++){a=e[l];var u=n+c1(a,l);o+=yd(a,t,r,u,i)}else if(u=NE(e),typeof u=="function")for(e=u.call(e),l=0;!(a=e.next()).done;)a=a.value,u=n+c1(a,l++),o+=yd(a,t,r,u,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Hf(e,t,r){if(e==null)return e;var n=[],i=0;return yd(e,n,"","",function(a){return t.call(r,a,i++)}),n}function jE(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Zr={current:null},bd={transition:null},FE={ReactCurrentDispatcher:Zr,ReactCurrentBatchConfig:bd,ReactCurrentOwner:wm};function B_(){throw Error("act(...) is not supported in production builds of React.")}pt.Children={map:Hf,forEach:function(e,t,r){Hf(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Hf(e,function(){t++}),t},toArray:function(e){return Hf(e,function(t){return t})||[]},only:function(e){if(!Sm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};pt.Component=Ds;pt.Fragment=PE;pt.Profiler=CE;pt.PureComponent=bm;pt.StrictMode=xE;pt.Suspense=RE;pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FE;pt.act=B_;pt.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=N_({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=wm.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)j_.call(t,u)&&!F_.hasOwnProperty(u)&&(n[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)n.children=r;else if(1<u){l=Array(u);for(var f=0;f<u;f++)l[f]=arguments[f+2];n.children=l}return{$$typeof:Ec,type:e.type,key:i,ref:a,props:n,_owner:o}};pt.createContext=function(e){return e={$$typeof:kE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:TE,_context:e},e.Consumer=e};pt.createElement=z_;pt.createFactory=function(e){var t=z_.bind(null,e);return t.type=e,t};pt.createRef=function(){return{current:null}};pt.forwardRef=function(e){return{$$typeof:AE,render:e}};pt.isValidElement=Sm;pt.lazy=function(e){return{$$typeof:LE,_payload:{_status:-1,_result:e},_init:jE}};pt.memo=function(e,t){return{$$typeof:ME,type:e,compare:t===void 0?null:t}};pt.startTransition=function(e){var t=bd.transition;bd.transition={};try{e()}finally{bd.transition=t}};pt.unstable_act=B_;pt.useCallback=function(e,t){return Zr.current.useCallback(e,t)};pt.useContext=function(e){return Zr.current.useContext(e)};pt.useDebugValue=function(){};pt.useDeferredValue=function(e){return Zr.current.useDeferredValue(e)};pt.useEffect=function(e,t){return Zr.current.useEffect(e,t)};pt.useId=function(){return Zr.current.useId()};pt.useImperativeHandle=function(e,t,r){return Zr.current.useImperativeHandle(e,t,r)};pt.useInsertionEffect=function(e,t){return Zr.current.useInsertionEffect(e,t)};pt.useLayoutEffect=function(e,t){return Zr.current.useLayoutEffect(e,t)};pt.useMemo=function(e,t){return Zr.current.useMemo(e,t)};pt.useReducer=function(e,t,r){return Zr.current.useReducer(e,t,r)};pt.useRef=function(e){return Zr.current.useRef(e)};pt.useState=function(e){return Zr.current.useState(e)};pt.useSyncExternalStore=function(e,t,r){return Zr.current.useSyncExternalStore(e,t,r)};pt.useTransition=function(){return Zr.current.useTransition()};pt.version="18.3.1";M_.exports=pt;var et=M_.exports;const ht=Eh(et);var Nd={},U_={exports:{}},An={},H_={exports:{}},$_={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* scheduler.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/(function(e){function t(D,q){var A=D.length;D.push(q);e:for(;0<A;){var L=A-1>>>1,z=D[L];if(0<i(z,q))D[L]=q,D[A]=z,A=L;else break e}}function r(D){return D.length===0?null:D[0]}function n(D){if(D.length===0)return null;var q=D[0],A=D.pop();if(A!==q){D[0]=A;e:for(var L=0,z=D.length,I=z>>>1;L<I;){var H=2*(L+1)-1,W=D[H],V=H+1,U=D[V];if(0>i(W,A))V<z&&0>i(U,W)?(D[L]=U,D[V]=A,L=V):(D[L]=W,D[H]=A,L=H);else if(V<z&&0>i(U,A))D[L]=U,D[V]=A,L=V;else break e}}return q}function i(D,q){var A=D.sortIndex-q.sortIndex;return A!==0?A:D.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],f=[],g=1,S=null,_=3,h=!1,w=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,v=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(D){for(var q=r(f);q!==null;){if(q.callback===null)n(f);else if(q.startTime<=D)n(f),q.sortIndex=q.expirationTime,t(u,q);else break;q=r(f)}}function b(D){if(m=!1,d(D),!w)if(r(u)!==null)w=!0,Z(O);else{var q=r(f);q!==null&&K(b,q.startTime-D)}}function O(D,q){w=!1,m&&(m=!1,p(E),E=-1),h=!0;var A=_;try{for(d(q),S=r(u);S!==null&&(!(S.expirationTime>q)||D&&!k());){var L=S.callback;if(typeof L=="function"){S.callback=null,_=S.priorityLevel;var z=L(S.expirationTime<=q);q=e.unstable_now(),typeof z=="function"?S.callback=z:S===r(u)&&n(u),d(q)}else n(u);S=r(u)}if(S!==null)var I=!0;else{var H=r(f);H!==null&&K(b,H.startTime-q),I=!1}return I}finally{S=null,_=A,h=!1}}var R=!1,T=null,E=-1,P=5,x=-1;function k(){return!(e.unstable_now()-x<P)}function M(){if(T!==null){var D=e.unstable_now();x=D;var q=!0;try{q=T(!0,D)}finally{q?j():(R=!1,T=null)}}else R=!1}var j;if(typeof v=="function")j=function(){v(M)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,$=B.port2;B.port1.onmessage=M,j=function(){$.postMessage(null)}}else j=function(){y(M,0)};function Z(D){T=D,R||(R=!0,j())}function K(D,q){E=y(function(){D(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_continueExecution=function(){w||h||(w=!0,Z(O))},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(D){switch(_){case 1:case 2:case 3:var q=3;break;default:q=_}var A=_;_=q;try{return D()}finally{_=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(D,q){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var A=_;_=D;try{return q()}finally{_=A}},e.unstable_scheduleCallback=function(D,q,A){var L=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?L+A:L):A=L,D){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=A+z,D={id:g++,callback:q,priorityLevel:D,startTime:A,expirationTime:z,sortIndex:-1},A>L?(D.sortIndex=A,t(f,D),r(u)===null&&D===r(f)&&(m?(p(E),E=-1):m=!0,K(b,A-L))):(D.sortIndex=z,t(u,D),w||h||(w=!0,Z(O))),D},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(D){var q=_;return function(){var A=_;_=q;try{return D.apply(this,arguments)}finally{_=A}}}})($_);H_.exports=$_;var Iu=H_.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 zE=et,Tn=Iu;function Pe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var G_=new Set,Yu={};function sl(e,t){ps(e,t),ps(e+"Capture",t)}function ps(e,t){for(Yu[e]=t,e=0;e<t.length;e++)G_.add(t[e])}var pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rv=Object.prototype.hasOwnProperty,BE=/^[: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]*$/,l3={},s3={};function UE(e){return rv.call(s3,e)?!0:rv.call(l3,e)?!1:BE.test(e)?s3[e]=!0:(l3[e]=!0,!1)}function HE(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $E(e,t,r,n){if(t===null||typeof t>"u"||HE(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Qr(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Mr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Mr[e]=new Qr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Mr[t]=new Qr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Mr[e]=new Qr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Mr[e]=new Qr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Mr[e]=new Qr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Mr[e]=new Qr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Mr[e]=new Qr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Mr[e]=new Qr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Mr[e]=new Qr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Em=/[\-:]([a-z])/g;function Om(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Em,Om);Mr[t]=new Qr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Em,Om);Mr[t]=new Qr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Em,Om);Mr[t]=new Qr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Mr[e]=new Qr(e,1,!1,e.toLowerCase(),null,!1,!1)});Mr.xlinkHref=new Qr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Mr[e]=new Qr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Pm(e,t,r,n){var i=Mr.hasOwnProperty(t)?Mr[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&($E(t,r,i,n)&&(r=null),n||i===null?UE(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var _a=zE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$f=Symbol.for("react.element"),ql=Symbol.for("react.portal"),Wl=Symbol.for("react.fragment"),xm=Symbol.for("react.strict_mode"),nv=Symbol.for("react.profiler"),V_=Symbol.for("react.provider"),q_=Symbol.for("react.context"),Cm=Symbol.for("react.forward_ref"),iv=Symbol.for("react.suspense"),av=Symbol.for("react.suspense_list"),Tm=Symbol.for("react.memo"),Ha=Symbol.for("react.lazy"),W_=Symbol.for("react.offscreen"),u3=Symbol.iterator;function yu(e){return e===null||typeof e!="object"?null:(e=u3&&e[u3]||e["@@iterator"],typeof e=="function"?e:null)}var Yt=Object.assign,f1;function Au(e){if(f1===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);f1=t&&t[1]||""}return`
|
|
26
|
+
`+f1+e}var d1=!1;function h1(e,t){if(!e||d1)return"";d1=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var n=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){n=f}e.call(t.prototype)}else{try{throw Error()}catch(f){n=f}e()}}catch(f){if(f&&n&&typeof f.stack=="string"){for(var i=f.stack.split(`
|
|
27
|
+
`),a=n.stack.split(`
|
|
28
|
+
`),o=i.length-1,l=a.length-1;1<=o&&0<=l&&i[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==a[l]){var u=`
|
|
29
|
+
`+i[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=l);break}}}finally{d1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Au(e):""}function GE(e){switch(e.tag){case 5:return Au(e.type);case 16:return Au("Lazy");case 13:return Au("Suspense");case 19:return Au("SuspenseList");case 0:case 2:case 15:return e=h1(e.type,!1),e;case 11:return e=h1(e.type.render,!1),e;case 1:return e=h1(e.type,!0),e;default:return""}}function ov(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Wl:return"Fragment";case ql:return"Portal";case nv:return"Profiler";case xm:return"StrictMode";case iv:return"Suspense";case av:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case q_:return(e.displayName||"Context")+".Consumer";case V_:return(e._context.displayName||"Context")+".Provider";case Cm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Tm:return t=e.displayName||null,t!==null?t:ov(e.type)||"Memo";case Ha:t=e._payload,e=e._init;try{return ov(e(t))}catch{}}return null}function VE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ov(t);case 8:return t===xm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function oo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function K_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qE(e){var t=K_(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gf(e){e._valueTracker||(e._valueTracker=qE(e))}function Y_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=K_(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Id(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function lv(e,t){var r=t.checked;return Yt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function c3(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=oo(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function X_(e,t){t=t.checked,t!=null&&Pm(e,"checked",t,!1)}function sv(e,t){X_(e,t);var r=oo(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?uv(e,t.type,r):t.hasOwnProperty("defaultValue")&&uv(e,t.type,oo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function f3(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function uv(e,t,r){(t!=="number"||Id(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ru=Array.isArray;function ls(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+oo(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function cv(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Pe(91));return Yt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function d3(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Pe(92));if(Ru(r)){if(1<r.length)throw Error(Pe(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:oo(r)}}function Z_(e,t){var r=oo(t.value),n=oo(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function h3(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Q_(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function fv(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Q_(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Vf,J_=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Vf=Vf||document.createElement("div"),Vf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Vf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Du={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},WE=["Webkit","ms","Moz","O"];Object.keys(Du).forEach(function(e){WE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Du[t]=Du[e]})});function e6(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Du.hasOwnProperty(e)&&Du[e]?(""+t).trim():t+"px"}function t6(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=e6(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var KE=Yt({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 dv(e,t){if(t){if(KE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Pe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Pe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Pe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Pe(62))}}function hv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pv=null;function km(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gv=null,ss=null,us=null;function p3(e){if(e=xc(e)){if(typeof gv!="function")throw Error(Pe(280));var t=e.stateNode;t&&(t=Th(t),gv(e.stateNode,e.type,t))}}function r6(e){ss?us?us.push(e):us=[e]:ss=e}function n6(){if(ss){var e=ss,t=us;if(us=ss=null,p3(e),t)for(e=0;e<t.length;e++)p3(t[e])}}function i6(e,t){return e(t)}function a6(){}var p1=!1;function o6(e,t,r){if(p1)return e(t,r);p1=!0;try{return i6(e,t,r)}finally{p1=!1,(ss!==null||us!==null)&&(a6(),n6())}}function Zu(e,t){var r=e.stateNode;if(r===null)return null;var n=Th(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(Pe(231,t,typeof r));return r}var vv=!1;if(pa)try{var bu={};Object.defineProperty(bu,"passive",{get:function(){vv=!0}}),window.addEventListener("test",bu,bu),window.removeEventListener("test",bu,bu)}catch{vv=!1}function YE(e,t,r,n,i,a,o,l,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(g){this.onError(g)}}var ju=!1,Dd=null,jd=!1,mv=null,XE={onError:function(e){ju=!0,Dd=e}};function ZE(e,t,r,n,i,a,o,l,u){ju=!1,Dd=null,YE.apply(XE,arguments)}function QE(e,t,r,n,i,a,o,l,u){if(ZE.apply(this,arguments),ju){if(ju){var f=Dd;ju=!1,Dd=null}else throw Error(Pe(198));jd||(jd=!0,mv=f)}}function ul(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function l6(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g3(e){if(ul(e)!==e)throw Error(Pe(188))}function JE(e){var t=e.alternate;if(!t){if(t=ul(e),t===null)throw Error(Pe(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var a=i.alternate;if(a===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return g3(i),e;if(a===n)return g3(i),t;a=a.sibling}throw Error(Pe(188))}if(r.return!==n.return)r=i,n=a;else{for(var o=!1,l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o)throw Error(Pe(189))}}if(r.alternate!==n)throw Error(Pe(190))}if(r.tag!==3)throw Error(Pe(188));return r.stateNode.current===r?e:t}function s6(e){return e=JE(e),e!==null?u6(e):null}function u6(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=u6(e);if(t!==null)return t;e=e.sibling}return null}var c6=Tn.unstable_scheduleCallback,v3=Tn.unstable_cancelCallback,eO=Tn.unstable_shouldYield,tO=Tn.unstable_requestPaint,tr=Tn.unstable_now,rO=Tn.unstable_getCurrentPriorityLevel,Am=Tn.unstable_ImmediatePriority,f6=Tn.unstable_UserBlockingPriority,Fd=Tn.unstable_NormalPriority,nO=Tn.unstable_LowPriority,d6=Tn.unstable_IdlePriority,Oh=null,Fi=null;function iO(e){if(Fi&&typeof Fi.onCommitFiberRoot=="function")try{Fi.onCommitFiberRoot(Oh,e,void 0,(e.current.flags&128)===128)}catch{}}var ui=Math.clz32?Math.clz32:lO,aO=Math.log,oO=Math.LN2;function lO(e){return e>>>=0,e===0?32:31-(aO(e)/oO|0)|0}var qf=64,Wf=4194304;function Mu(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zd(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~i;l!==0?n=Mu(l):(a&=o,a!==0&&(n=Mu(a)))}else o=r&~i,o!==0?n=Mu(o):a!==0&&(n=Mu(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-ui(t),i=1<<r,n|=e[r],t&=~i;return n}function sO(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function uO(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-ui(a),l=1<<o,u=i[o];u===-1?(!(l&r)||l&n)&&(i[o]=sO(l,t)):u<=t&&(e.expiredLanes|=l),a&=~l}}function yv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function h6(){var e=qf;return qf<<=1,!(qf&4194240)&&(qf=64),e}function g1(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Oc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ui(t),e[t]=r}function cO(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-ui(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function Rm(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-ui(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Pt=0;function p6(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var g6,Mm,v6,m6,y6,bv=!1,Kf=[],Xa=null,Za=null,Qa=null,Qu=new Map,Ju=new Map,Ga=[],fO="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 m3(e,t){switch(e){case"focusin":case"focusout":Xa=null;break;case"dragenter":case"dragleave":Za=null;break;case"mouseover":case"mouseout":Qa=null;break;case"pointerover":case"pointerout":Qu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ju.delete(t.pointerId)}}function _u(e,t,r,n,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},t!==null&&(t=xc(t),t!==null&&Mm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function dO(e,t,r,n,i){switch(t){case"focusin":return Xa=_u(Xa,e,t,r,n,i),!0;case"dragenter":return Za=_u(Za,e,t,r,n,i),!0;case"mouseover":return Qa=_u(Qa,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return Qu.set(a,_u(Qu.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,Ju.set(a,_u(Ju.get(a)||null,e,t,r,n,i)),!0}return!1}function b6(e){var t=$o(e.target);if(t!==null){var r=ul(t);if(r!==null){if(t=r.tag,t===13){if(t=l6(r),t!==null){e.blockedOn=t,y6(e.priority,function(){v6(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function _d(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=_v(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);pv=n,r.target.dispatchEvent(n),pv=null}else return t=xc(r),t!==null&&Mm(t),e.blockedOn=r,!1;t.shift()}return!0}function y3(e,t,r){_d(e)&&r.delete(t)}function hO(){bv=!1,Xa!==null&&_d(Xa)&&(Xa=null),Za!==null&&_d(Za)&&(Za=null),Qa!==null&&_d(Qa)&&(Qa=null),Qu.forEach(y3),Ju.forEach(y3)}function wu(e,t){e.blockedOn===t&&(e.blockedOn=null,bv||(bv=!0,Tn.unstable_scheduleCallback(Tn.unstable_NormalPriority,hO)))}function ec(e){function t(i){return wu(i,e)}if(0<Kf.length){wu(Kf[0],e);for(var r=1;r<Kf.length;r++){var n=Kf[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Xa!==null&&wu(Xa,e),Za!==null&&wu(Za,e),Qa!==null&&wu(Qa,e),Qu.forEach(t),Ju.forEach(t),r=0;r<Ga.length;r++)n=Ga[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Ga.length&&(r=Ga[0],r.blockedOn===null);)b6(r),r.blockedOn===null&&Ga.shift()}var cs=_a.ReactCurrentBatchConfig,Bd=!0;function pO(e,t,r,n){var i=Pt,a=cs.transition;cs.transition=null;try{Pt=1,Lm(e,t,r,n)}finally{Pt=i,cs.transition=a}}function gO(e,t,r,n){var i=Pt,a=cs.transition;cs.transition=null;try{Pt=4,Lm(e,t,r,n)}finally{Pt=i,cs.transition=a}}function Lm(e,t,r,n){if(Bd){var i=_v(e,t,r,n);if(i===null)P1(e,t,n,Ud,r),m3(e,n);else if(dO(i,e,t,r,n))n.stopPropagation();else if(m3(e,n),t&4&&-1<fO.indexOf(e)){for(;i!==null;){var a=xc(i);if(a!==null&&g6(a),a=_v(e,t,r,n),a===null&&P1(e,t,n,Ud,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else P1(e,t,n,null,r)}}var Ud=null;function _v(e,t,r,n){if(Ud=null,e=km(n),e=$o(e),e!==null)if(t=ul(e),t===null)e=null;else if(r=t.tag,r===13){if(e=l6(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ud=e,null}function _6(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(rO()){case Am:return 1;case f6:return 4;case Fd:case nO:return 16;case d6:return 536870912;default:return 16}default:return 16}}var Wa=null,Nm=null,wd=null;function w6(){if(wd)return wd;var e,t=Nm,r=t.length,n,i="value"in Wa?Wa.value:Wa.textContent,a=i.length;for(e=0;e<r&&t[e]===i[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===i[a-n];n++);return wd=i.slice(e,1<n?1-n:void 0)}function Sd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Yf(){return!0}function b3(){return!1}function Rn(e){function t(r,n,i,a,o){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Yf:b3,this.isPropagationStopped=b3,this}return Yt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Yf)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Yf)},persist:function(){},isPersistent:Yf}),t}var js={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Im=Rn(js),Pc=Yt({},js,{view:0,detail:0}),vO=Rn(Pc),v1,m1,Su,Ph=Yt({},Pc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dm,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Su&&(Su&&e.type==="mousemove"?(v1=e.screenX-Su.screenX,m1=e.screenY-Su.screenY):m1=v1=0,Su=e),v1)},movementY:function(e){return"movementY"in e?e.movementY:m1}}),_3=Rn(Ph),mO=Yt({},Ph,{dataTransfer:0}),yO=Rn(mO),bO=Yt({},Pc,{relatedTarget:0}),y1=Rn(bO),_O=Yt({},js,{animationName:0,elapsedTime:0,pseudoElement:0}),wO=Rn(_O),SO=Yt({},js,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),EO=Rn(SO),OO=Yt({},js,{data:0}),w3=Rn(OO),PO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xO={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"},CO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function TO(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=CO[e])?!!t[e]:!1}function Dm(){return TO}var kO=Yt({},Pc,{key:function(e){if(e.key){var t=PO[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Sd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?xO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dm,charCode:function(e){return e.type==="keypress"?Sd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Sd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),AO=Rn(kO),RO=Yt({},Ph,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),S3=Rn(RO),MO=Yt({},Pc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),LO=Rn(MO),NO=Yt({},js,{propertyName:0,elapsedTime:0,pseudoElement:0}),IO=Rn(NO),DO=Yt({},Ph,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),jO=Rn(DO),FO=[9,13,27,32],jm=pa&&"CompositionEvent"in window,Fu=null;pa&&"documentMode"in document&&(Fu=document.documentMode);var zO=pa&&"TextEvent"in window&&!Fu,S6=pa&&(!jm||Fu&&8<Fu&&11>=Fu),E3=" ",O3=!1;function E6(e,t){switch(e){case"keyup":return FO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function O6(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kl=!1;function BO(e,t){switch(e){case"compositionend":return O6(t);case"keypress":return t.which!==32?null:(O3=!0,E3);case"textInput":return e=t.data,e===E3&&O3?null:e;default:return null}}function UO(e,t){if(Kl)return e==="compositionend"||!jm&&E6(e,t)?(e=w6(),wd=Nm=Wa=null,Kl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return S6&&t.locale!=="ko"?null:t.data;default:return null}}var HO={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 P3(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!HO[e.type]:t==="textarea"}function P6(e,t,r,n){r6(n),t=Hd(t,"onChange"),0<t.length&&(r=new Im("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var zu=null,tc=null;function $O(e){D6(e,0)}function xh(e){var t=Zl(e);if(Y_(t))return e}function GO(e,t){if(e==="change")return t}var x6=!1;if(pa){var b1;if(pa){var _1="oninput"in document;if(!_1){var x3=document.createElement("div");x3.setAttribute("oninput","return;"),_1=typeof x3.oninput=="function"}b1=_1}else b1=!1;x6=b1&&(!document.documentMode||9<document.documentMode)}function C3(){zu&&(zu.detachEvent("onpropertychange",C6),tc=zu=null)}function C6(e){if(e.propertyName==="value"&&xh(tc)){var t=[];P6(t,tc,e,km(e)),o6($O,t)}}function VO(e,t,r){e==="focusin"?(C3(),zu=t,tc=r,zu.attachEvent("onpropertychange",C6)):e==="focusout"&&C3()}function qO(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return xh(tc)}function WO(e,t){if(e==="click")return xh(t)}function KO(e,t){if(e==="input"||e==="change")return xh(t)}function YO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gi=typeof Object.is=="function"?Object.is:YO;function rc(e,t){if(gi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!rv.call(t,i)||!gi(e[i],t[i]))return!1}return!0}function T3(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function k3(e,t){var r=T3(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=T3(r)}}function T6(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?T6(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function k6(){for(var e=window,t=Id();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Id(e.document)}return t}function Fm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function XO(e){var t=k6(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&T6(r.ownerDocument.documentElement,r)){if(n!==null&&Fm(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=k3(r,a);var o=k3(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ZO=pa&&"documentMode"in document&&11>=document.documentMode,Yl=null,wv=null,Bu=null,Sv=!1;function A3(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Sv||Yl==null||Yl!==Id(n)||(n=Yl,"selectionStart"in n&&Fm(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}),Bu&&rc(Bu,n)||(Bu=n,n=Hd(wv,"onSelect"),0<n.length&&(t=new Im("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Yl)))}function Xf(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Xl={animationend:Xf("Animation","AnimationEnd"),animationiteration:Xf("Animation","AnimationIteration"),animationstart:Xf("Animation","AnimationStart"),transitionend:Xf("Transition","TransitionEnd")},w1={},A6={};pa&&(A6=document.createElement("div").style,"AnimationEvent"in window||(delete Xl.animationend.animation,delete Xl.animationiteration.animation,delete Xl.animationstart.animation),"TransitionEvent"in window||delete Xl.transitionend.transition);function Ch(e){if(w1[e])return w1[e];if(!Xl[e])return e;var t=Xl[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in A6)return w1[e]=t[r];return e}var R6=Ch("animationend"),M6=Ch("animationiteration"),L6=Ch("animationstart"),N6=Ch("transitionend"),I6=new Map,R3="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 ho(e,t){I6.set(e,t),sl(t,[e])}for(var S1=0;S1<R3.length;S1++){var E1=R3[S1],QO=E1.toLowerCase(),JO=E1[0].toUpperCase()+E1.slice(1);ho(QO,"on"+JO)}ho(R6,"onAnimationEnd");ho(M6,"onAnimationIteration");ho(L6,"onAnimationStart");ho("dblclick","onDoubleClick");ho("focusin","onFocus");ho("focusout","onBlur");ho(N6,"onTransitionEnd");ps("onMouseEnter",["mouseout","mouseover"]);ps("onMouseLeave",["mouseout","mouseover"]);ps("onPointerEnter",["pointerout","pointerover"]);ps("onPointerLeave",["pointerout","pointerover"]);sl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));sl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));sl("onBeforeInput",["compositionend","keypress","textInput","paste"]);sl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));sl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));sl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lu="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(" "),eP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Lu));function M3(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,QE(n,t,void 0,e),e.currentTarget=null}function D6(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],u=l.instance,f=l.currentTarget;if(l=l.listener,u!==a&&i.isPropagationStopped())break e;M3(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;M3(i,l,f),a=u}}}if(jd)throw e=mv,jd=!1,mv=null,e}function zt(e,t){var r=t[Cv];r===void 0&&(r=t[Cv]=new Set);var n=e+"__bubble";r.has(n)||(j6(t,e,2,!1),r.add(n))}function O1(e,t,r){var n=0;t&&(n|=4),j6(r,e,n,t)}var Zf="_reactListening"+Math.random().toString(36).slice(2);function nc(e){if(!e[Zf]){e[Zf]=!0,G_.forEach(function(r){r!=="selectionchange"&&(eP.has(r)||O1(r,!1,e),O1(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zf]||(t[Zf]=!0,O1("selectionchange",!1,t))}}function j6(e,t,r,n){switch(_6(t)){case 1:var i=pO;break;case 4:i=gO;break;default:i=Lm}r=i.bind(null,t,r,e),i=void 0,!vv||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function P1(e,t,r,n,i){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=n.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;o=o.return}for(;l!==null;){if(o=$o(l),o===null)return;if(u=o.tag,u===5||u===6){n=a=o;continue e}l=l.parentNode}}n=n.return}o6(function(){var f=a,g=km(r),S=[];e:{var _=I6.get(e);if(_!==void 0){var h=Im,w=e;switch(e){case"keypress":if(Sd(r)===0)break e;case"keydown":case"keyup":h=AO;break;case"focusin":w="focus",h=y1;break;case"focusout":w="blur",h=y1;break;case"beforeblur":case"afterblur":h=y1;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=_3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=yO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=LO;break;case R6:case M6:case L6:h=wO;break;case N6:h=IO;break;case"scroll":h=vO;break;case"wheel":h=jO;break;case"copy":case"cut":case"paste":h=EO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=S3}var m=(t&4)!==0,y=!m&&e==="scroll",p=m?_!==null?_+"Capture":null:_;m=[];for(var v=f,d;v!==null;){d=v;var b=d.stateNode;if(d.tag===5&&b!==null&&(d=b,p!==null&&(b=Zu(v,p),b!=null&&m.push(ic(v,b,d)))),y)break;v=v.return}0<m.length&&(_=new h(_,w,null,r,g),S.push({event:_,listeners:m}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",_&&r!==pv&&(w=r.relatedTarget||r.fromElement)&&($o(w)||w[ga]))break e;if((h||_)&&(_=g.window===g?g:(_=g.ownerDocument)?_.defaultView||_.parentWindow:window,h?(w=r.relatedTarget||r.toElement,h=f,w=w?$o(w):null,w!==null&&(y=ul(w),w!==y||w.tag!==5&&w.tag!==6)&&(w=null)):(h=null,w=f),h!==w)){if(m=_3,b="onMouseLeave",p="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(m=S3,b="onPointerLeave",p="onPointerEnter",v="pointer"),y=h==null?_:Zl(h),d=w==null?_:Zl(w),_=new m(b,v+"leave",h,r,g),_.target=y,_.relatedTarget=d,b=null,$o(g)===f&&(m=new m(p,v+"enter",w,r,g),m.target=d,m.relatedTarget=y,b=m),y=b,h&&w)t:{for(m=h,p=w,v=0,d=m;d;d=Bl(d))v++;for(d=0,b=p;b;b=Bl(b))d++;for(;0<v-d;)m=Bl(m),v--;for(;0<d-v;)p=Bl(p),d--;for(;v--;){if(m===p||p!==null&&m===p.alternate)break t;m=Bl(m),p=Bl(p)}m=null}else m=null;h!==null&&L3(S,_,h,m,!1),w!==null&&y!==null&&L3(S,y,w,m,!0)}}e:{if(_=f?Zl(f):window,h=_.nodeName&&_.nodeName.toLowerCase(),h==="select"||h==="input"&&_.type==="file")var O=GO;else if(P3(_))if(x6)O=KO;else{O=qO;var R=VO}else(h=_.nodeName)&&h.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(O=WO);if(O&&(O=O(e,f))){P6(S,O,r,g);break e}R&&R(e,_,f),e==="focusout"&&(R=_._wrapperState)&&R.controlled&&_.type==="number"&&uv(_,"number",_.value)}switch(R=f?Zl(f):window,e){case"focusin":(P3(R)||R.contentEditable==="true")&&(Yl=R,wv=f,Bu=null);break;case"focusout":Bu=wv=Yl=null;break;case"mousedown":Sv=!0;break;case"contextmenu":case"mouseup":case"dragend":Sv=!1,A3(S,r,g);break;case"selectionchange":if(ZO)break;case"keydown":case"keyup":A3(S,r,g)}var T;if(jm)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Kl?E6(e,r)&&(E="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(E="onCompositionStart");E&&(S6&&r.locale!=="ko"&&(Kl||E!=="onCompositionStart"?E==="onCompositionEnd"&&Kl&&(T=w6()):(Wa=g,Nm="value"in Wa?Wa.value:Wa.textContent,Kl=!0)),R=Hd(f,E),0<R.length&&(E=new w3(E,e,null,r,g),S.push({event:E,listeners:R}),T?E.data=T:(T=O6(r),T!==null&&(E.data=T)))),(T=zO?BO(e,r):UO(e,r))&&(f=Hd(f,"onBeforeInput"),0<f.length&&(g=new w3("onBeforeInput","beforeinput",null,r,g),S.push({event:g,listeners:f}),g.data=T))}D6(S,t)})}function ic(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Hd(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Zu(e,r),a!=null&&n.unshift(ic(e,a,i)),a=Zu(e,t),a!=null&&n.push(ic(e,a,i))),e=e.return}return n}function Bl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function L3(e,t,r,n,i){for(var a=t._reactName,o=[];r!==null&&r!==n;){var l=r,u=l.alternate,f=l.stateNode;if(u!==null&&u===n)break;l.tag===5&&f!==null&&(l=f,i?(u=Zu(r,a),u!=null&&o.unshift(ic(r,u,l))):i||(u=Zu(r,a),u!=null&&o.push(ic(r,u,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var tP=/\r\n?/g,rP=/\u0000|\uFFFD/g;function N3(e){return(typeof e=="string"?e:""+e).replace(tP,`
|
|
30
|
+
`).replace(rP,"")}function Qf(e,t,r){if(t=N3(t),N3(e)!==t&&r)throw Error(Pe(425))}function $d(){}var Ev=null,Ov=null;function Pv(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var xv=typeof setTimeout=="function"?setTimeout:void 0,nP=typeof clearTimeout=="function"?clearTimeout:void 0,I3=typeof Promise=="function"?Promise:void 0,iP=typeof queueMicrotask=="function"?queueMicrotask:typeof I3<"u"?function(e){return I3.resolve(null).then(e).catch(aP)}:xv;function aP(e){setTimeout(function(){throw e})}function x1(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),ec(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);ec(t)}function Ja(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function D3(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Fs=Math.random().toString(36).slice(2),Ni="__reactFiber$"+Fs,ac="__reactProps$"+Fs,ga="__reactContainer$"+Fs,Cv="__reactEvents$"+Fs,oP="__reactListeners$"+Fs,lP="__reactHandles$"+Fs;function $o(e){var t=e[Ni];if(t)return t;for(var r=e.parentNode;r;){if(t=r[ga]||r[Ni]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=D3(e);e!==null;){if(r=e[Ni])return r;e=D3(e)}return t}e=r,r=e.parentNode}return null}function xc(e){return e=e[Ni]||e[ga],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Zl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Pe(33))}function Th(e){return e[ac]||null}var Tv=[],Ql=-1;function po(e){return{current:e}}function Bt(e){0>Ql||(e.current=Tv[Ql],Tv[Ql]=null,Ql--)}function Nt(e,t){Ql++,Tv[Ql]=e.current,e.current=t}var lo={},Gr=po(lo),hn=po(!1),Zo=lo;function gs(e,t){var r=e.type.contextTypes;if(!r)return lo;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function pn(e){return e=e.childContextTypes,e!=null}function Gd(){Bt(hn),Bt(Gr)}function j3(e,t,r){if(Gr.current!==lo)throw Error(Pe(168));Nt(Gr,t),Nt(hn,r)}function F6(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(Pe(108,VE(e)||"Unknown",i));return Yt({},r,n)}function Vd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||lo,Zo=Gr.current,Nt(Gr,e),Nt(hn,hn.current),!0}function F3(e,t,r){var n=e.stateNode;if(!n)throw Error(Pe(169));r?(e=F6(e,t,Zo),n.__reactInternalMemoizedMergedChildContext=e,Bt(hn),Bt(Gr),Nt(Gr,e)):Bt(hn),Nt(hn,r)}var oa=null,kh=!1,C1=!1;function z6(e){oa===null?oa=[e]:oa.push(e)}function sP(e){kh=!0,z6(e)}function go(){if(!C1&&oa!==null){C1=!0;var e=0,t=Pt;try{var r=oa;for(Pt=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}oa=null,kh=!1}catch(i){throw oa!==null&&(oa=oa.slice(e+1)),c6(Am,go),i}finally{Pt=t,C1=!1}}return null}var Jl=[],es=0,qd=null,Wd=0,Hn=[],$n=0,Qo=null,la=1,sa="";function Uo(e,t){Jl[es++]=Wd,Jl[es++]=qd,qd=e,Wd=t}function B6(e,t,r){Hn[$n++]=la,Hn[$n++]=sa,Hn[$n++]=Qo,Qo=e;var n=la;e=sa;var i=32-ui(n)-1;n&=~(1<<i),r+=1;var a=32-ui(t)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,la=1<<32-ui(t)+i|r<<i|n,sa=a+e}else la=1<<a|r<<i|n,sa=e}function zm(e){e.return!==null&&(Uo(e,1),B6(e,1,0))}function Bm(e){for(;e===qd;)qd=Jl[--es],Jl[es]=null,Wd=Jl[--es],Jl[es]=null;for(;e===Qo;)Qo=Hn[--$n],Hn[$n]=null,sa=Hn[--$n],Hn[$n]=null,la=Hn[--$n],Hn[$n]=null}var Cn=null,xn=null,$t=!1,si=null;function U6(e,t){var r=qn(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function z3(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Cn=e,xn=Ja(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Cn=e,xn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Qo!==null?{id:la,overflow:sa}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=qn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Cn=e,xn=null,!0):!1;default:return!1}}function kv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Av(e){if($t){var t=xn;if(t){var r=t;if(!z3(e,t)){if(kv(e))throw Error(Pe(418));t=Ja(r.nextSibling);var n=Cn;t&&z3(e,t)?U6(n,r):(e.flags=e.flags&-4097|2,$t=!1,Cn=e)}}else{if(kv(e))throw Error(Pe(418));e.flags=e.flags&-4097|2,$t=!1,Cn=e}}}function B3(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Cn=e}function Jf(e){if(e!==Cn)return!1;if(!$t)return B3(e),$t=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Pv(e.type,e.memoizedProps)),t&&(t=xn)){if(kv(e))throw H6(),Error(Pe(418));for(;t;)U6(e,t),t=Ja(t.nextSibling)}if(B3(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Pe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){xn=Ja(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}xn=null}}else xn=Cn?Ja(e.stateNode.nextSibling):null;return!0}function H6(){for(var e=xn;e;)e=Ja(e.nextSibling)}function vs(){xn=Cn=null,$t=!1}function Um(e){si===null?si=[e]:si.push(e)}var uP=_a.ReactCurrentBatchConfig;function Eu(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Pe(309));var n=r.stateNode}if(!n)throw Error(Pe(147,e));var i=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(Pe(284));if(!r._owner)throw Error(Pe(290,e))}return e}function ed(e,t){throw e=Object.prototype.toString.call(t),Error(Pe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function U3(e){var t=e._init;return t(e._payload)}function $6(e){function t(p,v){if(e){var d=p.deletions;d===null?(p.deletions=[v],p.flags|=16):d.push(v)}}function r(p,v){if(!e)return null;for(;v!==null;)t(p,v),v=v.sibling;return null}function n(p,v){for(p=new Map;v!==null;)v.key!==null?p.set(v.key,v):p.set(v.index,v),v=v.sibling;return p}function i(p,v){return p=no(p,v),p.index=0,p.sibling=null,p}function a(p,v,d){return p.index=d,e?(d=p.alternate,d!==null?(d=d.index,d<v?(p.flags|=2,v):d):(p.flags|=2,v)):(p.flags|=1048576,v)}function o(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,v,d,b){return v===null||v.tag!==6?(v=N1(d,p.mode,b),v.return=p,v):(v=i(v,d),v.return=p,v)}function u(p,v,d,b){var O=d.type;return O===Wl?g(p,v,d.props.children,b,d.key):v!==null&&(v.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===Ha&&U3(O)===v.type)?(b=i(v,d.props),b.ref=Eu(p,v,d),b.return=p,b):(b=kd(d.type,d.key,d.props,null,p.mode,b),b.ref=Eu(p,v,d),b.return=p,b)}function f(p,v,d,b){return v===null||v.tag!==4||v.stateNode.containerInfo!==d.containerInfo||v.stateNode.implementation!==d.implementation?(v=I1(d,p.mode,b),v.return=p,v):(v=i(v,d.children||[]),v.return=p,v)}function g(p,v,d,b,O){return v===null||v.tag!==7?(v=Ko(d,p.mode,b,O),v.return=p,v):(v=i(v,d),v.return=p,v)}function S(p,v,d){if(typeof v=="string"&&v!==""||typeof v=="number")return v=N1(""+v,p.mode,d),v.return=p,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case $f:return d=kd(v.type,v.key,v.props,null,p.mode,d),d.ref=Eu(p,null,v),d.return=p,d;case ql:return v=I1(v,p.mode,d),v.return=p,v;case Ha:var b=v._init;return S(p,b(v._payload),d)}if(Ru(v)||yu(v))return v=Ko(v,p.mode,d,null),v.return=p,v;ed(p,v)}return null}function _(p,v,d,b){var O=v!==null?v.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return O!==null?null:l(p,v,""+d,b);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case $f:return d.key===O?u(p,v,d,b):null;case ql:return d.key===O?f(p,v,d,b):null;case Ha:return O=d._init,_(p,v,O(d._payload),b)}if(Ru(d)||yu(d))return O!==null?null:g(p,v,d,b,null);ed(p,d)}return null}function h(p,v,d,b,O){if(typeof b=="string"&&b!==""||typeof b=="number")return p=p.get(d)||null,l(v,p,""+b,O);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case $f:return p=p.get(b.key===null?d:b.key)||null,u(v,p,b,O);case ql:return p=p.get(b.key===null?d:b.key)||null,f(v,p,b,O);case Ha:var R=b._init;return h(p,v,d,R(b._payload),O)}if(Ru(b)||yu(b))return p=p.get(d)||null,g(v,p,b,O,null);ed(v,b)}return null}function w(p,v,d,b){for(var O=null,R=null,T=v,E=v=0,P=null;T!==null&&E<d.length;E++){T.index>E?(P=T,T=null):P=T.sibling;var x=_(p,T,d[E],b);if(x===null){T===null&&(T=P);break}e&&T&&x.alternate===null&&t(p,T),v=a(x,v,E),R===null?O=x:R.sibling=x,R=x,T=P}if(E===d.length)return r(p,T),$t&&Uo(p,E),O;if(T===null){for(;E<d.length;E++)T=S(p,d[E],b),T!==null&&(v=a(T,v,E),R===null?O=T:R.sibling=T,R=T);return $t&&Uo(p,E),O}for(T=n(p,T);E<d.length;E++)P=h(T,p,E,d[E],b),P!==null&&(e&&P.alternate!==null&&T.delete(P.key===null?E:P.key),v=a(P,v,E),R===null?O=P:R.sibling=P,R=P);return e&&T.forEach(function(k){return t(p,k)}),$t&&Uo(p,E),O}function m(p,v,d,b){var O=yu(d);if(typeof O!="function")throw Error(Pe(150));if(d=O.call(d),d==null)throw Error(Pe(151));for(var R=O=null,T=v,E=v=0,P=null,x=d.next();T!==null&&!x.done;E++,x=d.next()){T.index>E?(P=T,T=null):P=T.sibling;var k=_(p,T,x.value,b);if(k===null){T===null&&(T=P);break}e&&T&&k.alternate===null&&t(p,T),v=a(k,v,E),R===null?O=k:R.sibling=k,R=k,T=P}if(x.done)return r(p,T),$t&&Uo(p,E),O;if(T===null){for(;!x.done;E++,x=d.next())x=S(p,x.value,b),x!==null&&(v=a(x,v,E),R===null?O=x:R.sibling=x,R=x);return $t&&Uo(p,E),O}for(T=n(p,T);!x.done;E++,x=d.next())x=h(T,p,E,x.value,b),x!==null&&(e&&x.alternate!==null&&T.delete(x.key===null?E:x.key),v=a(x,v,E),R===null?O=x:R.sibling=x,R=x);return e&&T.forEach(function(M){return t(p,M)}),$t&&Uo(p,E),O}function y(p,v,d,b){if(typeof d=="object"&&d!==null&&d.type===Wl&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case $f:e:{for(var O=d.key,R=v;R!==null;){if(R.key===O){if(O=d.type,O===Wl){if(R.tag===7){r(p,R.sibling),v=i(R,d.props.children),v.return=p,p=v;break e}}else if(R.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===Ha&&U3(O)===R.type){r(p,R.sibling),v=i(R,d.props),v.ref=Eu(p,R,d),v.return=p,p=v;break e}r(p,R);break}else t(p,R);R=R.sibling}d.type===Wl?(v=Ko(d.props.children,p.mode,b,d.key),v.return=p,p=v):(b=kd(d.type,d.key,d.props,null,p.mode,b),b.ref=Eu(p,v,d),b.return=p,p=b)}return o(p);case ql:e:{for(R=d.key;v!==null;){if(v.key===R)if(v.tag===4&&v.stateNode.containerInfo===d.containerInfo&&v.stateNode.implementation===d.implementation){r(p,v.sibling),v=i(v,d.children||[]),v.return=p,p=v;break e}else{r(p,v);break}else t(p,v);v=v.sibling}v=I1(d,p.mode,b),v.return=p,p=v}return o(p);case Ha:return R=d._init,y(p,v,R(d._payload),b)}if(Ru(d))return w(p,v,d,b);if(yu(d))return m(p,v,d,b);ed(p,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,v!==null&&v.tag===6?(r(p,v.sibling),v=i(v,d),v.return=p,p=v):(r(p,v),v=N1(d,p.mode,b),v.return=p,p=v),o(p)):r(p,v)}return y}var ms=$6(!0),G6=$6(!1),Kd=po(null),Yd=null,ts=null,Hm=null;function $m(){Hm=ts=Yd=null}function Gm(e){var t=Kd.current;Bt(Kd),e._currentValue=t}function Rv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function fs(e,t){Yd=e,Hm=ts=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(cn=!0),e.firstContext=null)}function Yn(e){var t=e._currentValue;if(Hm!==e)if(e={context:e,memoizedValue:t,next:null},ts===null){if(Yd===null)throw Error(Pe(308));ts=e,Yd.dependencies={lanes:0,firstContext:e}}else ts=ts.next=e;return t}var Go=null;function Vm(e){Go===null?Go=[e]:Go.push(e)}function V6(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Vm(t)):(r.next=i.next,i.next=r),t.interleaved=r,va(e,n)}function va(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var $a=!1;function qm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function q6(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ua(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function eo(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,bt&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,va(e,r)}return i=n.interleaved,i===null?(t.next=t,Vm(n)):(t.next=i.next,i.next=t),n.interleaved=t,va(e,r)}function Ed(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rm(e,r)}}function H3(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Xd(e,t,r,n){var i=e.updateQueue;$a=!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 g=e.alternate;g!==null&&(g=g.updateQueue,l=g.lastBaseUpdate,l!==o&&(l===null?g.firstBaseUpdate=f:l.next=f,g.lastBaseUpdate=u))}if(a!==null){var S=i.baseState;o=0,g=f=u=null,l=a;do{var _=l.lane,h=l.eventTime;if((n&_)===_){g!==null&&(g=g.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,m=l;switch(_=t,h=r,m.tag){case 1:if(w=m.payload,typeof w=="function"){S=w.call(h,S,_);break e}S=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=m.payload,_=typeof w=="function"?w.call(h,S,_):w,_==null)break e;S=Yt({},S,_);break e;case 2:$a=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,_=i.effects,_===null?i.effects=[l]:_.push(l))}else h={eventTime:h,lane:_,tag:l.tag,payload:l.payload,callback:l.callback,next:null},g===null?(f=g=h,u=S):g=g.next=h,o|=_;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;_=l,l=_.next,_.next=null,i.lastBaseUpdate=_,i.shared.pending=null}}while(!0);if(g===null&&(u=S),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=g,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);el|=o,e.lanes=o,e.memoizedState=S}}function $3(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(Pe(191,i));i.call(n)}}}var Cc={},zi=po(Cc),oc=po(Cc),lc=po(Cc);function Vo(e){if(e===Cc)throw Error(Pe(174));return e}function Wm(e,t){switch(Nt(lc,t),Nt(oc,e),Nt(zi,Cc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fv(t,e)}Bt(zi),Nt(zi,t)}function ys(){Bt(zi),Bt(oc),Bt(lc)}function W6(e){Vo(lc.current);var t=Vo(zi.current),r=fv(t,e.type);t!==r&&(Nt(oc,e),Nt(zi,r))}function Km(e){oc.current===e&&(Bt(zi),Bt(oc))}var Wt=po(0);function Zd(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var T1=[];function Ym(){for(var e=0;e<T1.length;e++)T1[e]._workInProgressVersionPrimary=null;T1.length=0}var Od=_a.ReactCurrentDispatcher,k1=_a.ReactCurrentBatchConfig,Jo=0,Kt=null,ur=null,Sr=null,Qd=!1,Uu=!1,sc=0,cP=0;function Ur(){throw Error(Pe(321))}function Xm(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!gi(e[r],t[r]))return!1;return!0}function Zm(e,t,r,n,i,a){if(Jo=a,Kt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Od.current=e===null||e.memoizedState===null?pP:gP,e=r(n,i),Uu){a=0;do{if(Uu=!1,sc=0,25<=a)throw Error(Pe(301));a+=1,Sr=ur=null,t.updateQueue=null,Od.current=vP,e=r(n,i)}while(Uu)}if(Od.current=Jd,t=ur!==null&&ur.next!==null,Jo=0,Sr=ur=Kt=null,Qd=!1,t)throw Error(Pe(300));return e}function Qm(){var e=sc!==0;return sc=0,e}function Li(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sr===null?Kt.memoizedState=Sr=e:Sr=Sr.next=e,Sr}function Xn(){if(ur===null){var e=Kt.alternate;e=e!==null?e.memoizedState:null}else e=ur.next;var t=Sr===null?Kt.memoizedState:Sr.next;if(t!==null)Sr=t,ur=e;else{if(e===null)throw Error(Pe(310));ur=e,e={memoizedState:ur.memoizedState,baseState:ur.baseState,baseQueue:ur.baseQueue,queue:ur.queue,next:null},Sr===null?Kt.memoizedState=Sr=e:Sr=Sr.next=e}return Sr}function uc(e,t){return typeof t=="function"?t(e):t}function A1(e){var t=Xn(),r=t.queue;if(r===null)throw Error(Pe(311));r.lastRenderedReducer=e;var n=ur,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 g=f.lane;if((Jo&g)===g)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),n=f.hasEagerState?f.eagerState:e(n,f.action);else{var S={lane:g,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=S,o=n):u=u.next=S,Kt.lanes|=g,el|=g}f=f.next}while(f!==null&&f!==a);u===null?o=n:u.next=l,gi(n,t.memoizedState)||(cn=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=u,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do a=i.lane,Kt.lanes|=a,el|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function R1(e){var t=Xn(),r=t.queue;if(r===null)throw Error(Pe(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);gi(a,t.memoizedState)||(cn=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function K6(){}function Y6(e,t){var r=Kt,n=Xn(),i=t(),a=!gi(n.memoizedState,i);if(a&&(n.memoizedState=i,cn=!0),n=n.queue,Jm(Q6.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Sr!==null&&Sr.memoizedState.tag&1){if(r.flags|=2048,cc(9,Z6.bind(null,r,n,i,t),void 0,null),Er===null)throw Error(Pe(349));Jo&30||X6(r,t,i)}return i}function X6(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Kt.updateQueue,t===null?(t={lastEffect:null,stores:null},Kt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Z6(e,t,r,n){t.value=r,t.getSnapshot=n,J6(t)&&ew(e)}function Q6(e,t,r){return r(function(){J6(t)&&ew(e)})}function J6(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!gi(e,r)}catch{return!0}}function ew(e){var t=va(e,1);t!==null&&ci(t,e,1,-1)}function G3(e){var t=Li();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:uc,lastRenderedState:e},t.queue=e,e=e.dispatch=hP.bind(null,Kt,e),[t.memoizedState,e]}function cc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Kt.updateQueue,t===null?(t={lastEffect:null,stores:null},Kt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function tw(){return Xn().memoizedState}function Pd(e,t,r,n){var i=Li();Kt.flags|=e,i.memoizedState=cc(1|t,r,void 0,n===void 0?null:n)}function Ah(e,t,r,n){var i=Xn();n=n===void 0?null:n;var a=void 0;if(ur!==null){var o=ur.memoizedState;if(a=o.destroy,n!==null&&Xm(n,o.deps)){i.memoizedState=cc(t,r,a,n);return}}Kt.flags|=e,i.memoizedState=cc(1|t,r,a,n)}function V3(e,t){return Pd(8390656,8,e,t)}function Jm(e,t){return Ah(2048,8,e,t)}function rw(e,t){return Ah(4,2,e,t)}function nw(e,t){return Ah(4,4,e,t)}function iw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function aw(e,t,r){return r=r!=null?r.concat([e]):null,Ah(4,4,iw.bind(null,t,e),r)}function ey(){}function ow(e,t){var r=Xn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Xm(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function lw(e,t){var r=Xn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Xm(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function sw(e,t,r){return Jo&21?(gi(r,t)||(r=h6(),Kt.lanes|=r,el|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,cn=!0),e.memoizedState=r)}function fP(e,t){var r=Pt;Pt=r!==0&&4>r?r:4,e(!0);var n=k1.transition;k1.transition={};try{e(!1),t()}finally{Pt=r,k1.transition=n}}function uw(){return Xn().memoizedState}function dP(e,t,r){var n=ro(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},cw(e))fw(t,r);else if(r=V6(e,t,r,n),r!==null){var i=Yr();ci(r,e,n,i),dw(r,t,n)}}function hP(e,t,r){var n=ro(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(cw(e))fw(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,r);if(i.hasEagerState=!0,i.eagerState=l,gi(l,o)){var u=t.interleaved;u===null?(i.next=i,Vm(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}r=V6(e,t,i,n),r!==null&&(i=Yr(),ci(r,e,n,i),dw(r,t,n))}}function cw(e){var t=e.alternate;return e===Kt||t!==null&&t===Kt}function fw(e,t){Uu=Qd=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function dw(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rm(e,r)}}var Jd={readContext:Yn,useCallback:Ur,useContext:Ur,useEffect:Ur,useImperativeHandle:Ur,useInsertionEffect:Ur,useLayoutEffect:Ur,useMemo:Ur,useReducer:Ur,useRef:Ur,useState:Ur,useDebugValue:Ur,useDeferredValue:Ur,useTransition:Ur,useMutableSource:Ur,useSyncExternalStore:Ur,useId:Ur,unstable_isNewReconciler:!1},pP={readContext:Yn,useCallback:function(e,t){return Li().memoizedState=[e,t===void 0?null:t],e},useContext:Yn,useEffect:V3,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Pd(4194308,4,iw.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Pd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Pd(4,2,e,t)},useMemo:function(e,t){var r=Li();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Li();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=dP.bind(null,Kt,e),[n.memoizedState,e]},useRef:function(e){var t=Li();return e={current:e},t.memoizedState=e},useState:G3,useDebugValue:ey,useDeferredValue:function(e){return Li().memoizedState=e},useTransition:function(){var e=G3(!1),t=e[0];return e=fP.bind(null,e[1]),Li().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Kt,i=Li();if($t){if(r===void 0)throw Error(Pe(407));r=r()}else{if(r=t(),Er===null)throw Error(Pe(349));Jo&30||X6(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,V3(Q6.bind(null,n,a,e),[e]),n.flags|=2048,cc(9,Z6.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Li(),t=Er.identifierPrefix;if($t){var r=sa,n=la;r=(n&~(1<<32-ui(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=sc++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=cP++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},gP={readContext:Yn,useCallback:ow,useContext:Yn,useEffect:Jm,useImperativeHandle:aw,useInsertionEffect:rw,useLayoutEffect:nw,useMemo:lw,useReducer:A1,useRef:tw,useState:function(){return A1(uc)},useDebugValue:ey,useDeferredValue:function(e){var t=Xn();return sw(t,ur.memoizedState,e)},useTransition:function(){var e=A1(uc)[0],t=Xn().memoizedState;return[e,t]},useMutableSource:K6,useSyncExternalStore:Y6,useId:uw,unstable_isNewReconciler:!1},vP={readContext:Yn,useCallback:ow,useContext:Yn,useEffect:Jm,useImperativeHandle:aw,useInsertionEffect:rw,useLayoutEffect:nw,useMemo:lw,useReducer:R1,useRef:tw,useState:function(){return R1(uc)},useDebugValue:ey,useDeferredValue:function(e){var t=Xn();return ur===null?t.memoizedState=e:sw(t,ur.memoizedState,e)},useTransition:function(){var e=R1(uc)[0],t=Xn().memoizedState;return[e,t]},useMutableSource:K6,useSyncExternalStore:Y6,useId:uw,unstable_isNewReconciler:!1};function oi(e,t){if(e&&e.defaultProps){t=Yt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Mv(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Yt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Rh={isMounted:function(e){return(e=e._reactInternals)?ul(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Yr(),i=ro(e),a=ua(n,i);a.payload=t,r!=null&&(a.callback=r),t=eo(e,a,i),t!==null&&(ci(t,e,i,n),Ed(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Yr(),i=ro(e),a=ua(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=eo(e,a,i),t!==null&&(ci(t,e,i,n),Ed(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Yr(),n=ro(e),i=ua(r,n);i.tag=2,t!=null&&(i.callback=t),t=eo(e,i,n),t!==null&&(ci(t,e,n,r),Ed(t,e,n))}};function q3(e,t,r,n,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,o):t.prototype&&t.prototype.isPureReactComponent?!rc(r,n)||!rc(i,a):!0}function hw(e,t,r){var n=!1,i=lo,a=t.contextType;return typeof a=="object"&&a!==null?a=Yn(a):(i=pn(t)?Zo:Gr.current,n=t.contextTypes,a=(n=n!=null)?gs(e,i):lo),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Rh,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function W3(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Rh.enqueueReplaceState(t,t.state,null)}function Lv(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},qm(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Yn(a):(a=pn(t)?Zo:Gr.current,i.context=gs(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Mv(e,t,a,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Rh.enqueueReplaceState(i,i.state,null),Xd(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function bs(e,t){try{var r="",n=t;do r+=GE(n),n=n.return;while(n);var i=r}catch(a){i=`
|
|
31
|
+
Error generating stack: `+a.message+`
|
|
32
|
+
`+a.stack}return{value:e,source:t,stack:i,digest:null}}function M1(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Nv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var mP=typeof WeakMap=="function"?WeakMap:Map;function pw(e,t,r){r=ua(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){th||(th=!0,Gv=n),Nv(e,t)},r}function gw(e,t,r){r=ua(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){Nv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Nv(e,t),typeof n!="function"&&(to===null?to=new Set([this]):to.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function K3(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new mP;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=RP.bind(null,e,t,r),t.then(e,e))}function Y3(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function X3(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=ua(-1,1),t.tag=2,eo(r,t,1))),r.lanes|=1),e)}var yP=_a.ReactCurrentOwner,cn=!1;function Kr(e,t,r,n){t.child=e===null?G6(t,null,r,n):ms(t,e.child,r,n)}function Z3(e,t,r,n,i){r=r.render;var a=t.ref;return fs(t,i),n=Zm(e,t,r,n,a,i),r=Qm(),e!==null&&!cn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ma(e,t,i)):($t&&r&&zm(t),t.flags|=1,Kr(e,t,n,i),t.child)}function Q3(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!sy(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,vw(e,t,a,n,i)):(e=kd(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:rc,r(o,n)&&e.ref===t.ref)return ma(e,t,i)}return t.flags|=1,e=no(a,n),e.ref=t.ref,e.return=t,t.child=e}function vw(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(rc(a,n)&&e.ref===t.ref)if(cn=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(cn=!0);else return t.lanes=e.lanes,ma(e,t,i)}return Iv(e,t,r,n,i)}function mw(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nt(ns,On),On|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Nt(ns,On),On|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Nt(ns,On),On|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Nt(ns,On),On|=n;return Kr(e,t,i,r),t.child}function yw(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Iv(e,t,r,n,i){var a=pn(r)?Zo:Gr.current;return a=gs(t,a),fs(t,i),r=Zm(e,t,r,n,a,i),n=Qm(),e!==null&&!cn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ma(e,t,i)):($t&&n&&zm(t),t.flags|=1,Kr(e,t,r,i),t.child)}function J3(e,t,r,n,i){if(pn(r)){var a=!0;Vd(t)}else a=!1;if(fs(t,i),t.stateNode===null)xd(e,t),hw(t,r,n),Lv(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var u=o.context,f=r.contextType;typeof f=="object"&&f!==null?f=Yn(f):(f=pn(r)?Zo:Gr.current,f=gs(t,f));var g=r.getDerivedStateFromProps,S=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function";S||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||u!==f)&&W3(t,o,n,f),$a=!1;var _=t.memoizedState;o.state=_,Xd(t,n,o,i),u=t.memoizedState,l!==n||_!==u||hn.current||$a?(typeof g=="function"&&(Mv(t,r,g,n),u=t.memoizedState),(l=$a||q3(t,r,l,n,_,u,f))?(S||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),o.props=n,o.state=u,o.context=f,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,q6(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:oi(t.type,l),o.props=f,S=t.pendingProps,_=o.context,u=r.contextType,typeof u=="object"&&u!==null?u=Yn(u):(u=pn(r)?Zo:Gr.current,u=gs(t,u));var h=r.getDerivedStateFromProps;(g=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==S||_!==u)&&W3(t,o,n,u),$a=!1,_=t.memoizedState,o.state=_,Xd(t,n,o,i);var w=t.memoizedState;l!==S||_!==w||hn.current||$a?(typeof h=="function"&&(Mv(t,r,h,n),w=t.memoizedState),(f=$a||q3(t,r,f,n,_,w,u)||!1)?(g||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"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=w),o.props=n,o.state=w,o.context=u,n=f):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),n=!1)}return Dv(e,t,r,n,a,i)}function Dv(e,t,r,n,i,a){yw(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&F3(t,r,!1),ma(e,t,a);n=t.stateNode,yP.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=ms(t,e.child,null,a),t.child=ms(t,null,l,a)):Kr(e,t,l,a),t.memoizedState=n.state,i&&F3(t,r,!0),t.child}function bw(e){var t=e.stateNode;t.pendingContext?j3(e,t.pendingContext,t.pendingContext!==t.context):t.context&&j3(e,t.context,!1),Wm(e,t.containerInfo)}function e5(e,t,r,n,i){return vs(),Um(i),t.flags|=256,Kr(e,t,r,n),t.child}var jv={dehydrated:null,treeContext:null,retryLane:0};function Fv(e){return{baseLanes:e,cachePool:null,transitions:null}}function _w(e,t,r){var n=t.pendingProps,i=Wt.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Nt(Wt,i&1),e===null)return Av(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,a?(n=t.mode,a=t.child,o={mode:"hidden",children:o},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Nh(o,n,0,null),e=Ko(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Fv(r),t.memoizedState=jv,e):ty(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return bP(e,t,o,n,l,i,r);if(a){a=n.fallback,o=t.mode,i=e.child,l=i.sibling;var u={mode:"hidden",children:n.children};return!(o&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=u,t.deletions=null):(n=no(i,u),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=no(l,a):(a=Ko(a,o,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,o=e.child.memoizedState,o=o===null?Fv(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=jv,n}return a=e.child,e=a.sibling,n=no(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function ty(e,t){return t=Nh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function td(e,t,r,n){return n!==null&&Um(n),ms(t,e.child,null,r),e=ty(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bP(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=M1(Error(Pe(422))),td(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=Nh({mode:"visible",children:n.children},i,0,null),a=Ko(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&ms(t,e.child,null,o),t.child.memoizedState=Fv(o),t.memoizedState=jv,a);if(!(t.mode&1))return td(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(Pe(419)),n=M1(a,n,void 0),td(e,t,o,n)}if(l=(o&e.childLanes)!==0,cn||l){if(n=Er,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,va(e,i),ci(n,e,i,-1))}return ly(),n=M1(Error(Pe(421))),td(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=MP.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,xn=Ja(i.nextSibling),Cn=t,$t=!0,si=null,e!==null&&(Hn[$n++]=la,Hn[$n++]=sa,Hn[$n++]=Qo,la=e.id,sa=e.overflow,Qo=t),t=ty(t,n.children),t.flags|=4096,t)}function t5(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Rv(e.return,t,r)}function L1(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function ww(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Kr(e,t,n.children,r),n=Wt.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&t5(e,r,t);else if(e.tag===19)t5(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Nt(Wt,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&Zd(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),L1(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Zd(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}L1(t,!0,r,null,a);break;case"together":L1(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function xd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ma(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),el|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Pe(153));if(t.child!==null){for(e=t.child,r=no(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=no(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function _P(e,t,r){switch(t.tag){case 3:bw(t),vs();break;case 5:W6(t);break;case 1:pn(t.type)&&Vd(t);break;case 4:Wm(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Nt(Kd,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Nt(Wt,Wt.current&1),t.flags|=128,null):r&t.child.childLanes?_w(e,t,r):(Nt(Wt,Wt.current&1),e=ma(e,t,r),e!==null?e.sibling:null);Nt(Wt,Wt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return ww(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Nt(Wt,Wt.current),n)break;return null;case 22:case 23:return t.lanes=0,mw(e,t,r)}return ma(e,t,r)}var Sw,zv,Ew,Ow;Sw=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};zv=function(){};Ew=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Vo(zi.current);var a=null;switch(r){case"input":i=lv(e,i),n=lv(e,n),a=[];break;case"select":i=Yt({},i,{value:void 0}),n=Yt({},n,{value:void 0}),a=[];break;case"textarea":i=cv(e,i),n=cv(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=$d)}dv(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"&&(Yu.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"&&(Yu.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&zt("scroll",e),a||l===u||(a=[])):(a=a||[]).push(f,u))}r&&(a=a||[]).push("style",r);var f=a;(t.updateQueue=f)&&(t.flags|=4)}};Ow=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ou(e,t){if(!$t)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Hr(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function wP(e,t,r){var n=t.pendingProps;switch(Bm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hr(t),null;case 1:return pn(t.type)&&Gd(),Hr(t),null;case 3:return n=t.stateNode,ys(),Bt(hn),Bt(Gr),Ym(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Jf(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,si!==null&&(Wv(si),si=null))),zv(e,t),Hr(t),null;case 5:Km(t);var i=Vo(lc.current);if(r=t.type,e!==null&&t.stateNode!=null)Ew(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(Pe(166));return Hr(t),null}if(e=Vo(zi.current),Jf(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Ni]=t,n[ac]=a,e=(t.mode&1)!==0,r){case"dialog":zt("cancel",n),zt("close",n);break;case"iframe":case"object":case"embed":zt("load",n);break;case"video":case"audio":for(i=0;i<Lu.length;i++)zt(Lu[i],n);break;case"source":zt("error",n);break;case"img":case"image":case"link":zt("error",n),zt("load",n);break;case"details":zt("toggle",n);break;case"input":c3(n,a),zt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},zt("invalid",n);break;case"textarea":d3(n,a),zt("invalid",n)}dv(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&&Qf(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Qf(n.textContent,l,e),i=["children",""+l]):Yu.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&zt("scroll",n)}switch(r){case"input":Gf(n),f3(n,a,!0);break;case"textarea":Gf(n),h3(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=$d)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Q_(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Ni]=t,e[ac]=n,Sw(e,t,!1,!1),t.stateNode=e;e:{switch(o=hv(r,n),r){case"dialog":zt("cancel",e),zt("close",e),i=n;break;case"iframe":case"object":case"embed":zt("load",e),i=n;break;case"video":case"audio":for(i=0;i<Lu.length;i++)zt(Lu[i],e);i=n;break;case"source":zt("error",e),i=n;break;case"img":case"image":case"link":zt("error",e),zt("load",e),i=n;break;case"details":zt("toggle",e),i=n;break;case"input":c3(e,n),i=lv(e,n),zt("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=Yt({},n,{value:void 0}),zt("invalid",e);break;case"textarea":d3(e,n),i=cv(e,n),zt("invalid",e);break;default:i=n}dv(r,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var u=l[a];a==="style"?t6(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&J_(e,u)):a==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Xu(e,u):typeof u=="number"&&Xu(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Yu.hasOwnProperty(a)?u!=null&&a==="onScroll"&&zt("scroll",e):u!=null&&Pm(e,a,u,o))}switch(r){case"input":Gf(e),f3(e,n,!1);break;case"textarea":Gf(e),h3(e);break;case"option":n.value!=null&&e.setAttribute("value",""+oo(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?ls(e,!!n.multiple,a,!1):n.defaultValue!=null&&ls(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=$d)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Hr(t),null;case 6:if(e&&t.stateNode!=null)Ow(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(Pe(166));if(r=Vo(lc.current),Vo(zi.current),Jf(t)){if(n=t.stateNode,r=t.memoizedProps,n[Ni]=t,(a=n.nodeValue!==r)&&(e=Cn,e!==null))switch(e.tag){case 3:Qf(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Qf(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Ni]=t,t.stateNode=n}return Hr(t),null;case 13:if(Bt(Wt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if($t&&xn!==null&&t.mode&1&&!(t.flags&128))H6(),vs(),t.flags|=98560,a=!1;else if(a=Jf(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(Pe(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Pe(317));a[Ni]=t}else vs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hr(t),a=!1}else si!==null&&(Wv(si),si=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Wt.current&1?fr===0&&(fr=3):ly())),t.updateQueue!==null&&(t.flags|=4),Hr(t),null);case 4:return ys(),zv(e,t),e===null&&nc(t.stateNode.containerInfo),Hr(t),null;case 10:return Gm(t.type._context),Hr(t),null;case 17:return pn(t.type)&&Gd(),Hr(t),null;case 19:if(Bt(Wt),a=t.memoizedState,a===null)return Hr(t),null;if(n=(t.flags&128)!==0,o=a.rendering,o===null)if(n)Ou(a,!1);else{if(fr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Zd(e),o!==null){for(t.flags|=128,Ou(a,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Nt(Wt,Wt.current&1|2),t.child}e=e.sibling}a.tail!==null&&tr()>_s&&(t.flags|=128,n=!0,Ou(a,!1),t.lanes=4194304)}else{if(!n)if(e=Zd(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ou(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!$t)return Hr(t),null}else 2*tr()-a.renderingStartTime>_s&&r!==1073741824&&(t.flags|=128,n=!0,Ou(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=tr(),t.sibling=null,r=Wt.current,Nt(Wt,n?r&1|2:r&1),t):(Hr(t),null);case 22:case 23:return oy(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?On&1073741824&&(Hr(t),t.subtreeFlags&6&&(t.flags|=8192)):Hr(t),null;case 24:return null;case 25:return null}throw Error(Pe(156,t.tag))}function SP(e,t){switch(Bm(t),t.tag){case 1:return pn(t.type)&&Gd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ys(),Bt(hn),Bt(Gr),Ym(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Km(t),null;case 13:if(Bt(Wt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Pe(340));vs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bt(Wt),null;case 4:return ys(),null;case 10:return Gm(t.type._context),null;case 22:case 23:return oy(),null;case 24:return null;default:return null}}var rd=!1,$r=!1,EP=typeof WeakSet=="function"?WeakSet:Set,He=null;function rs(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Zt(e,t,n)}else r.current=null}function Bv(e,t,r){try{r()}catch(n){Zt(e,t,n)}}var r5=!1;function OP(e,t){if(Ev=Bd,e=k6(),Fm(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,l=-1,u=-1,f=0,g=0,S=e,_=null;t:for(;;){for(var h;S!==r||i!==0&&S.nodeType!==3||(l=o+i),S!==a||n!==0&&S.nodeType!==3||(u=o+n),S.nodeType===3&&(o+=S.nodeValue.length),(h=S.firstChild)!==null;)_=S,S=h;for(;;){if(S===e)break t;if(_===r&&++f===i&&(l=o),_===a&&++g===n&&(u=o),(h=S.nextSibling)!==null)break;S=_,_=S.parentNode}S=h}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ov={focusedElem:e,selectionRange:r},Bd=!1,He=t;He!==null;)if(t=He,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,He=e;else for(;He!==null;){t=He;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var m=w.memoizedProps,y=w.memoizedState,p=t.stateNode,v=p.getSnapshotBeforeUpdate(t.elementType===t.type?m:oi(t.type,m),y);p.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Pe(163))}}catch(b){Zt(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,He=e;break}He=t.return}return w=r5,r5=!1,w}function Hu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Bv(t,r,a)}i=i.next}while(i!==n)}}function Mh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Uv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Pw(e){var t=e.alternate;t!==null&&(e.alternate=null,Pw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ni],delete t[ac],delete t[Cv],delete t[oP],delete t[lP])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function xw(e){return e.tag===5||e.tag===3||e.tag===4}function n5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=$d));else if(n!==4&&(e=e.child,e!==null))for(Hv(e,t,r),e=e.sibling;e!==null;)Hv(e,t,r),e=e.sibling}function $v(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for($v(e,t,r),e=e.sibling;e!==null;)$v(e,t,r),e=e.sibling}var kr=null,li=!1;function za(e,t,r){for(r=r.child;r!==null;)Cw(e,t,r),r=r.sibling}function Cw(e,t,r){if(Fi&&typeof Fi.onCommitFiberUnmount=="function")try{Fi.onCommitFiberUnmount(Oh,r)}catch{}switch(r.tag){case 5:$r||rs(r,t);case 6:var n=kr,i=li;kr=null,za(e,t,r),kr=n,li=i,kr!==null&&(li?(e=kr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):kr.removeChild(r.stateNode));break;case 18:kr!==null&&(li?(e=kr,r=r.stateNode,e.nodeType===8?x1(e.parentNode,r):e.nodeType===1&&x1(e,r),ec(e)):x1(kr,r.stateNode));break;case 4:n=kr,i=li,kr=r.stateNode.containerInfo,li=!0,za(e,t,r),kr=n,li=i;break;case 0:case 11:case 14:case 15:if(!$r&&(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)&&Bv(r,t,o),i=i.next}while(i!==n)}za(e,t,r);break;case 1:if(!$r&&(rs(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Zt(r,t,l)}za(e,t,r);break;case 21:za(e,t,r);break;case 22:r.mode&1?($r=(n=$r)||r.memoizedState!==null,za(e,t,r),$r=n):za(e,t,r);break;default:za(e,t,r)}}function i5(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new EP),t.forEach(function(n){var i=LP.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ni(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:kr=l.stateNode,li=!1;break e;case 3:kr=l.stateNode.containerInfo,li=!0;break e;case 4:kr=l.stateNode.containerInfo,li=!0;break e}l=l.return}if(kr===null)throw Error(Pe(160));Cw(a,o,i),kr=null,li=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(f){Zt(i,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Tw(t,e),t=t.sibling}function Tw(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ni(t,e),Ri(e),n&4){try{Hu(3,e,e.return),Mh(3,e)}catch(m){Zt(e,e.return,m)}try{Hu(5,e,e.return)}catch(m){Zt(e,e.return,m)}}break;case 1:ni(t,e),Ri(e),n&512&&r!==null&&rs(r,r.return);break;case 5:if(ni(t,e),Ri(e),n&512&&r!==null&&rs(r,r.return),e.flags&32){var i=e.stateNode;try{Xu(i,"")}catch(m){Zt(e,e.return,m)}}if(n&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=r!==null?r.memoizedProps:a,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&X_(i,a),hv(l,o);var f=hv(l,a);for(o=0;o<u.length;o+=2){var g=u[o],S=u[o+1];g==="style"?t6(i,S):g==="dangerouslySetInnerHTML"?J_(i,S):g==="children"?Xu(i,S):Pm(i,g,S,f)}switch(l){case"input":sv(i,a);break;case"textarea":Z_(i,a);break;case"select":var _=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var h=a.value;h!=null?ls(i,!!a.multiple,h,!1):_!==!!a.multiple&&(a.defaultValue!=null?ls(i,!!a.multiple,a.defaultValue,!0):ls(i,!!a.multiple,a.multiple?[]:"",!1))}i[ac]=a}catch(m){Zt(e,e.return,m)}}break;case 6:if(ni(t,e),Ri(e),n&4){if(e.stateNode===null)throw Error(Pe(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(m){Zt(e,e.return,m)}}break;case 3:if(ni(t,e),Ri(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{ec(t.containerInfo)}catch(m){Zt(e,e.return,m)}break;case 4:ni(t,e),Ri(e);break;case 13:ni(t,e),Ri(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(iy=tr())),n&4&&i5(e);break;case 22:if(g=r!==null&&r.memoizedState!==null,e.mode&1?($r=(f=$r)||g,ni(t,e),$r=f):ni(t,e),Ri(e),n&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!g&&e.mode&1)for(He=e,g=e.child;g!==null;){for(S=He=g;He!==null;){switch(_=He,h=_.child,_.tag){case 0:case 11:case 14:case 15:Hu(4,_,_.return);break;case 1:rs(_,_.return);var w=_.stateNode;if(typeof w.componentWillUnmount=="function"){n=_,r=_.return;try{t=n,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(m){Zt(n,r,m)}}break;case 5:rs(_,_.return);break;case 22:if(_.memoizedState!==null){o5(S);continue}}h!==null?(h.return=_,He=h):o5(S)}g=g.sibling}e:for(g=null,S=e;;){if(S.tag===5){if(g===null){g=S;try{i=S.stateNode,f?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=S.stateNode,u=S.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=e6("display",o))}catch(m){Zt(e,e.return,m)}}}else if(S.tag===6){if(g===null)try{S.stateNode.nodeValue=f?"":S.memoizedProps}catch(m){Zt(e,e.return,m)}}else if((S.tag!==22&&S.tag!==23||S.memoizedState===null||S===e)&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===e)break e;for(;S.sibling===null;){if(S.return===null||S.return===e)break e;g===S&&(g=null),S=S.return}g===S&&(g=null),S.sibling.return=S.return,S=S.sibling}}break;case 19:ni(t,e),Ri(e),n&4&&i5(e);break;case 21:break;default:ni(t,e),Ri(e)}}function Ri(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(xw(r)){var n=r;break e}r=r.return}throw Error(Pe(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(Xu(i,""),n.flags&=-33);var a=n5(e);$v(e,a,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=n5(e);Hv(e,l,o);break;default:throw Error(Pe(161))}}catch(u){Zt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function PP(e,t,r){He=e,kw(e)}function kw(e,t,r){for(var n=(e.mode&1)!==0;He!==null;){var i=He,a=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||rd;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||$r;l=rd;var f=$r;if(rd=o,($r=u)&&!f)for(He=i;He!==null;)o=He,u=o.child,o.tag===22&&o.memoizedState!==null?l5(i):u!==null?(u.return=o,He=u):l5(i);for(;a!==null;)He=a,kw(a),a=a.sibling;He=i,rd=l,$r=f}a5(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,He=a):a5(e)}}function a5(e){for(;He!==null;){var t=He;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:$r||Mh(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!$r)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:oi(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&$3(t,a,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}$3(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var g=f.memoizedState;if(g!==null){var S=g.dehydrated;S!==null&&ec(S)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Pe(163))}$r||t.flags&512&&Uv(t)}catch(_){Zt(t,t.return,_)}}if(t===e){He=null;break}if(r=t.sibling,r!==null){r.return=t.return,He=r;break}He=t.return}}function o5(e){for(;He!==null;){var t=He;if(t===e){He=null;break}var r=t.sibling;if(r!==null){r.return=t.return,He=r;break}He=t.return}}function l5(e){for(;He!==null;){var t=He;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Mh(4,t)}catch(u){Zt(t,r,u)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(u){Zt(t,i,u)}}var a=t.return;try{Uv(t)}catch(u){Zt(t,a,u)}break;case 5:var o=t.return;try{Uv(t)}catch(u){Zt(t,o,u)}}}catch(u){Zt(t,t.return,u)}if(t===e){He=null;break}var l=t.sibling;if(l!==null){l.return=t.return,He=l;break}He=t.return}}var xP=Math.ceil,eh=_a.ReactCurrentDispatcher,ry=_a.ReactCurrentOwner,Wn=_a.ReactCurrentBatchConfig,bt=0,Er=null,ir=null,Rr=0,On=0,ns=po(0),fr=0,fc=null,el=0,Lh=0,ny=0,$u=null,un=null,iy=0,_s=1/0,aa=null,th=!1,Gv=null,to=null,nd=!1,Ka=null,rh=0,Gu=0,Vv=null,Cd=-1,Td=0;function Yr(){return bt&6?tr():Cd!==-1?Cd:Cd=tr()}function ro(e){return e.mode&1?bt&2&&Rr!==0?Rr&-Rr:uP.transition!==null?(Td===0&&(Td=h6()),Td):(e=Pt,e!==0||(e=window.event,e=e===void 0?16:_6(e.type)),e):1}function ci(e,t,r,n){if(50<Gu)throw Gu=0,Vv=null,Error(Pe(185));Oc(e,r,n),(!(bt&2)||e!==Er)&&(e===Er&&(!(bt&2)&&(Lh|=r),fr===4&&Va(e,Rr)),gn(e,n),r===1&&bt===0&&!(t.mode&1)&&(_s=tr()+500,kh&&go()))}function gn(e,t){var r=e.callbackNode;uO(e,t);var n=zd(e,e===Er?Rr:0);if(n===0)r!==null&&v3(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&v3(r),t===1)e.tag===0?sP(s5.bind(null,e)):z6(s5.bind(null,e)),iP(function(){!(bt&6)&&go()}),r=null;else{switch(p6(n)){case 1:r=Am;break;case 4:r=f6;break;case 16:r=Fd;break;case 536870912:r=d6;break;default:r=Fd}r=jw(r,Aw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Aw(e,t){if(Cd=-1,Td=0,bt&6)throw Error(Pe(327));var r=e.callbackNode;if(ds()&&e.callbackNode!==r)return null;var n=zd(e,e===Er?Rr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=nh(e,n);else{t=n;var i=bt;bt|=2;var a=Mw();(Er!==e||Rr!==t)&&(aa=null,_s=tr()+500,Wo(e,t));do try{kP();break}catch(l){Rw(e,l)}while(!0);$m(),eh.current=a,bt=i,ir!==null?t=0:(Er=null,Rr=0,t=fr)}if(t!==0){if(t===2&&(i=yv(e),i!==0&&(n=i,t=qv(e,i))),t===1)throw r=fc,Wo(e,0),Va(e,n),gn(e,tr()),r;if(t===6)Va(e,n);else{if(i=e.current.alternate,!(n&30)&&!CP(i)&&(t=nh(e,n),t===2&&(a=yv(e),a!==0&&(n=a,t=qv(e,a))),t===1))throw r=fc,Wo(e,0),Va(e,n),gn(e,tr()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(Pe(345));case 2:Ho(e,un,aa);break;case 3:if(Va(e,n),(n&130023424)===n&&(t=iy+500-tr(),10<t)){if(zd(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){Yr(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=xv(Ho.bind(null,e,un,aa),t);break}Ho(e,un,aa);break;case 4:if(Va(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-ui(n);a=1<<o,o=t[o],o>i&&(i=o),n&=~a}if(n=i,n=tr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*xP(n/1960))-n,10<n){e.timeoutHandle=xv(Ho.bind(null,e,un,aa),n);break}Ho(e,un,aa);break;case 5:Ho(e,un,aa);break;default:throw Error(Pe(329))}}}return gn(e,tr()),e.callbackNode===r?Aw.bind(null,e):null}function qv(e,t){var r=$u;return e.current.memoizedState.isDehydrated&&(Wo(e,t).flags|=256),e=nh(e,t),e!==2&&(t=un,un=r,t!==null&&Wv(t)),e}function Wv(e){un===null?un=e:un.push.apply(un,e)}function CP(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!gi(a(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Va(e,t){for(t&=~ny,t&=~Lh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-ui(t),n=1<<r;e[r]=-1,t&=~n}}function s5(e){if(bt&6)throw Error(Pe(327));ds();var t=zd(e,0);if(!(t&1))return gn(e,tr()),null;var r=nh(e,t);if(e.tag!==0&&r===2){var n=yv(e);n!==0&&(t=n,r=qv(e,n))}if(r===1)throw r=fc,Wo(e,0),Va(e,t),gn(e,tr()),r;if(r===6)throw Error(Pe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ho(e,un,aa),gn(e,tr()),null}function ay(e,t){var r=bt;bt|=1;try{return e(t)}finally{bt=r,bt===0&&(_s=tr()+500,kh&&go())}}function tl(e){Ka!==null&&Ka.tag===0&&!(bt&6)&&ds();var t=bt;bt|=1;var r=Wn.transition,n=Pt;try{if(Wn.transition=null,Pt=1,e)return e()}finally{Pt=n,Wn.transition=r,bt=t,!(bt&6)&&go()}}function oy(){On=ns.current,Bt(ns)}function Wo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,nP(r)),ir!==null)for(r=ir.return;r!==null;){var n=r;switch(Bm(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Gd();break;case 3:ys(),Bt(hn),Bt(Gr),Ym();break;case 5:Km(n);break;case 4:ys();break;case 13:Bt(Wt);break;case 19:Bt(Wt);break;case 10:Gm(n.type._context);break;case 22:case 23:oy()}r=r.return}if(Er=e,ir=e=no(e.current,null),Rr=On=t,fr=0,fc=null,ny=Lh=el=0,un=$u=null,Go!==null){for(t=0;t<Go.length;t++)if(r=Go[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,a=r.pending;if(a!==null){var o=a.next;a.next=i,n.next=o}r.pending=n}Go=null}return e}function Rw(e,t){do{var r=ir;try{if($m(),Od.current=Jd,Qd){for(var n=Kt.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Qd=!1}if(Jo=0,Sr=ur=Kt=null,Uu=!1,sc=0,ry.current=null,r===null||r.return===null){fr=1,fc=t,ir=null;break}e:{var a=e,o=r.return,l=r,u=t;if(t=Rr,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,g=l,S=g.tag;if(!(g.mode&1)&&(S===0||S===11||S===15)){var _=g.alternate;_?(g.updateQueue=_.updateQueue,g.memoizedState=_.memoizedState,g.lanes=_.lanes):(g.updateQueue=null,g.memoizedState=null)}var h=Y3(o);if(h!==null){h.flags&=-257,X3(h,o,l,a,t),h.mode&1&&K3(a,f,t),t=h,u=f;var w=t.updateQueue;if(w===null){var m=new Set;m.add(u),t.updateQueue=m}else w.add(u);break e}else{if(!(t&1)){K3(a,f,t),ly();break e}u=Error(Pe(426))}}else if($t&&l.mode&1){var y=Y3(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),X3(y,o,l,a,t),Um(bs(u,l));break e}}a=u=bs(u,l),fr!==4&&(fr=2),$u===null?$u=[a]:$u.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var p=pw(a,u,t);H3(a,p);break e;case 1:l=u;var v=a.type,d=a.stateNode;if(!(a.flags&128)&&(typeof v.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(to===null||!to.has(d)))){a.flags|=65536,t&=-t,a.lanes|=t;var b=gw(a,l,t);H3(a,b);break e}}a=a.return}while(a!==null)}Nw(r)}catch(O){t=O,ir===r&&r!==null&&(ir=r=r.return);continue}break}while(!0)}function Mw(){var e=eh.current;return eh.current=Jd,e===null?Jd:e}function ly(){(fr===0||fr===3||fr===2)&&(fr=4),Er===null||!(el&268435455)&&!(Lh&268435455)||Va(Er,Rr)}function nh(e,t){var r=bt;bt|=2;var n=Mw();(Er!==e||Rr!==t)&&(aa=null,Wo(e,t));do try{TP();break}catch(i){Rw(e,i)}while(!0);if($m(),bt=r,eh.current=n,ir!==null)throw Error(Pe(261));return Er=null,Rr=0,fr}function TP(){for(;ir!==null;)Lw(ir)}function kP(){for(;ir!==null&&!eO();)Lw(ir)}function Lw(e){var t=Dw(e.alternate,e,On);e.memoizedProps=e.pendingProps,t===null?Nw(e):ir=t,ry.current=null}function Nw(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=SP(r,t),r!==null){r.flags&=32767,ir=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{fr=6,ir=null;return}}else if(r=wP(r,t,On),r!==null){ir=r;return}if(t=t.sibling,t!==null){ir=t;return}ir=t=e}while(t!==null);fr===0&&(fr=5)}function Ho(e,t,r){var n=Pt,i=Wn.transition;try{Wn.transition=null,Pt=1,AP(e,t,r,n)}finally{Wn.transition=i,Pt=n}return null}function AP(e,t,r,n){do ds();while(Ka!==null);if(bt&6)throw Error(Pe(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Pe(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(cO(e,a),e===Er&&(ir=Er=null,Rr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||nd||(nd=!0,jw(Fd,function(){return ds(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=Wn.transition,Wn.transition=null;var o=Pt;Pt=1;var l=bt;bt|=4,ry.current=null,OP(e,r),Tw(r,e),XO(Ov),Bd=!!Ev,Ov=Ev=null,e.current=r,PP(r),tO(),bt=l,Pt=o,Wn.transition=a}else e.current=r;if(nd&&(nd=!1,Ka=e,rh=i),a=e.pendingLanes,a===0&&(to=null),iO(r.stateNode),gn(e,tr()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(th)throw th=!1,e=Gv,Gv=null,e;return rh&1&&e.tag!==0&&ds(),a=e.pendingLanes,a&1?e===Vv?Gu++:(Gu=0,Vv=e):Gu=0,go(),null}function ds(){if(Ka!==null){var e=p6(rh),t=Wn.transition,r=Pt;try{if(Wn.transition=null,Pt=16>e?16:e,Ka===null)var n=!1;else{if(e=Ka,Ka=null,rh=0,bt&6)throw Error(Pe(331));var i=bt;for(bt|=4,He=e.current;He!==null;){var a=He,o=a.child;if(He.flags&16){var l=a.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for(He=f;He!==null;){var g=He;switch(g.tag){case 0:case 11:case 15:Hu(8,g,a)}var S=g.child;if(S!==null)S.return=g,He=S;else for(;He!==null;){g=He;var _=g.sibling,h=g.return;if(Pw(g),g===f){He=null;break}if(_!==null){_.return=h,He=_;break}He=h}}}var w=a.alternate;if(w!==null){var m=w.child;if(m!==null){w.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(m!==null)}}He=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,He=o;else e:for(;He!==null;){if(a=He,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Hu(9,a,a.return)}var p=a.sibling;if(p!==null){p.return=a.return,He=p;break e}He=a.return}}var v=e.current;for(He=v;He!==null;){o=He;var d=o.child;if(o.subtreeFlags&2064&&d!==null)d.return=o,He=d;else e:for(o=v;He!==null;){if(l=He,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Mh(9,l)}}catch(O){Zt(l,l.return,O)}if(l===o){He=null;break e}var b=l.sibling;if(b!==null){b.return=l.return,He=b;break e}He=l.return}}if(bt=i,go(),Fi&&typeof Fi.onPostCommitFiberRoot=="function")try{Fi.onPostCommitFiberRoot(Oh,e)}catch{}n=!0}return n}finally{Pt=r,Wn.transition=t}}return!1}function u5(e,t,r){t=bs(r,t),t=pw(e,t,1),e=eo(e,t,1),t=Yr(),e!==null&&(Oc(e,1,t),gn(e,t))}function Zt(e,t,r){if(e.tag===3)u5(e,e,r);else for(;t!==null;){if(t.tag===3){u5(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(to===null||!to.has(n))){e=bs(r,e),e=gw(t,e,1),t=eo(t,e,1),e=Yr(),t!==null&&(Oc(t,1,e),gn(t,e));break}}t=t.return}}function RP(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Yr(),e.pingedLanes|=e.suspendedLanes&r,Er===e&&(Rr&r)===r&&(fr===4||fr===3&&(Rr&130023424)===Rr&&500>tr()-iy?Wo(e,0):ny|=r),gn(e,t)}function Iw(e,t){t===0&&(e.mode&1?(t=Wf,Wf<<=1,!(Wf&130023424)&&(Wf=4194304)):t=1);var r=Yr();e=va(e,t),e!==null&&(Oc(e,t,r),gn(e,r))}function MP(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Iw(e,r)}function LP(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Pe(314))}n!==null&&n.delete(t),Iw(e,r)}var Dw;Dw=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||hn.current)cn=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return cn=!1,_P(e,t,r);cn=!!(e.flags&131072)}else cn=!1,$t&&t.flags&1048576&&B6(t,Wd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;xd(e,t),e=t.pendingProps;var i=gs(t,Gr.current);fs(t,r),i=Zm(null,t,n,e,i,r);var a=Qm();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,pn(n)?(a=!0,Vd(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,qm(t),i.updater=Rh,t.stateNode=i,i._reactInternals=t,Lv(t,n,e,r),t=Dv(null,t,n,!0,a,r)):(t.tag=0,$t&&a&&zm(t),Kr(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(xd(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=IP(n),e=oi(n,e),i){case 0:t=Iv(null,t,n,e,r);break e;case 1:t=J3(null,t,n,e,r);break e;case 11:t=Z3(null,t,n,e,r);break e;case 14:t=Q3(null,t,n,oi(n.type,e),r);break e}throw Error(Pe(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:oi(n,i),Iv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:oi(n,i),J3(e,t,n,i,r);case 3:e:{if(bw(t),e===null)throw Error(Pe(387));n=t.pendingProps,a=t.memoizedState,i=a.element,q6(e,t),Xd(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=bs(Error(Pe(423)),t),t=e5(e,t,n,r,i);break e}else if(n!==i){i=bs(Error(Pe(424)),t),t=e5(e,t,n,r,i);break e}else for(xn=Ja(t.stateNode.containerInfo.firstChild),Cn=t,$t=!0,si=null,r=G6(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(vs(),n===i){t=ma(e,t,r);break e}Kr(e,t,n,r)}t=t.child}return t;case 5:return W6(t),e===null&&Av(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Pv(n,i)?o=null:a!==null&&Pv(n,a)&&(t.flags|=32),yw(e,t),Kr(e,t,o,r),t.child;case 6:return e===null&&Av(t),null;case 13:return _w(e,t,r);case 4:return Wm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ms(t,null,n,r):Kr(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:oi(n,i),Z3(e,t,n,i,r);case 7:return Kr(e,t,t.pendingProps,r),t.child;case 8:return Kr(e,t,t.pendingProps.children,r),t.child;case 12:return Kr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Nt(Kd,n._currentValue),n._currentValue=o,a!==null)if(gi(a.value,o)){if(a.children===i.children&&!hn.current){t=ma(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var u=l.firstContext;u!==null;){if(u.context===n){if(a.tag===1){u=ua(-1,r&-r),u.tag=2;var f=a.updateQueue;if(f!==null){f=f.shared;var g=f.pending;g===null?u.next=u:(u.next=g.next,g.next=u),f.pending=u}}a.lanes|=r,u=a.alternate,u!==null&&(u.lanes|=r),Rv(a.return,r,t),l.lanes|=r;break}u=u.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Pe(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Rv(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Kr(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,fs(t,r),i=Yn(i),n=n(i),t.flags|=1,Kr(e,t,n,r),t.child;case 14:return n=t.type,i=oi(n,t.pendingProps),i=oi(n.type,i),Q3(e,t,n,i,r);case 15:return vw(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:oi(n,i),xd(e,t),t.tag=1,pn(n)?(e=!0,Vd(t)):e=!1,fs(t,r),hw(t,n,i),Lv(t,n,i,r),Dv(null,t,n,!0,e,r);case 19:return ww(e,t,r);case 22:return mw(e,t,r)}throw Error(Pe(156,t.tag))};function jw(e,t){return c6(e,t)}function NP(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qn(e,t,r,n){return new NP(e,t,r,n)}function sy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function IP(e){if(typeof e=="function")return sy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Cm)return 11;if(e===Tm)return 14}return 2}function no(e,t){var r=e.alternate;return r===null?(r=qn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function kd(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")sy(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Wl:return Ko(r.children,i,a,t);case xm:o=8,i|=8;break;case nv:return e=qn(12,r,t,i|2),e.elementType=nv,e.lanes=a,e;case iv:return e=qn(13,r,t,i),e.elementType=iv,e.lanes=a,e;case av:return e=qn(19,r,t,i),e.elementType=av,e.lanes=a,e;case W_:return Nh(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case V_:o=10;break e;case q_:o=9;break e;case Cm:o=11;break e;case Tm:o=14;break e;case Ha:o=16,n=null;break e}throw Error(Pe(130,e==null?e:typeof e,""))}return t=qn(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Ko(e,t,r,n){return e=qn(7,e,n,t),e.lanes=r,e}function Nh(e,t,r,n){return e=qn(22,e,n,t),e.elementType=W_,e.lanes=r,e.stateNode={isHidden:!1},e}function N1(e,t,r){return e=qn(6,e,null,t),e.lanes=r,e}function I1(e,t,r){return t=qn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function DP(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=g1(0),this.expirationTimes=g1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=g1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function uy(e,t,r,n,i,a,o,l,u){return e=new DP(e,t,r,l,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=qn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},qm(a),e}function jP(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ql,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Fw(e){if(!e)return lo;e=e._reactInternals;e:{if(ul(e)!==e||e.tag!==1)throw Error(Pe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(pn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Pe(171))}if(e.tag===1){var r=e.type;if(pn(r))return F6(e,r,t)}return t}function zw(e,t,r,n,i,a,o,l,u){return e=uy(r,n,!0,e,i,a,o,l,u),e.context=Fw(null),r=e.current,n=Yr(),i=ro(r),a=ua(n,i),a.callback=t??null,eo(r,a,i),e.current.lanes=i,Oc(e,i,n),gn(e,n),e}function Ih(e,t,r,n){var i=t.current,a=Yr(),o=ro(i);return r=Fw(r),t.context===null?t.context=r:t.pendingContext=r,t=ua(a,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=eo(i,t,o),e!==null&&(ci(e,i,o,a),Ed(e,i,o)),o}function ih(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function c5(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function cy(e,t){c5(e,t),(e=e.alternate)&&c5(e,t)}function FP(){return null}var Bw=typeof reportError=="function"?reportError:function(e){console.error(e)};function fy(e){this._internalRoot=e}Dh.prototype.render=fy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Pe(409));Ih(e,t,null,null)};Dh.prototype.unmount=fy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;tl(function(){Ih(null,e,null,null)}),t[ga]=null}};function Dh(e){this._internalRoot=e}Dh.prototype.unstable_scheduleHydration=function(e){if(e){var t=m6();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Ga.length&&t!==0&&t<Ga[r].priority;r++);Ga.splice(r,0,e),r===0&&b6(e)}};function dy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function jh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function f5(){}function zP(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var f=ih(o);a.call(f)}}var o=zw(t,n,e,0,null,!1,!1,"",f5);return e._reactRootContainer=o,e[ga]=o.current,nc(e.nodeType===8?e.parentNode:e),tl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var f=ih(u);l.call(f)}}var u=uy(e,0,!1,null,null,!1,!1,"",f5);return e._reactRootContainer=u,e[ga]=u.current,nc(e.nodeType===8?e.parentNode:e),tl(function(){Ih(t,u,r,n)}),u}function Fh(e,t,r,n,i){var a=r._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;i=function(){var u=ih(o);l.call(u)}}Ih(t,o,e,i)}else o=zP(r,t,e,i,n);return ih(o)}g6=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Mu(t.pendingLanes);r!==0&&(Rm(t,r|1),gn(t,tr()),!(bt&6)&&(_s=tr()+500,go()))}break;case 13:tl(function(){var n=va(e,1);if(n!==null){var i=Yr();ci(n,e,1,i)}}),cy(e,1)}};Mm=function(e){if(e.tag===13){var t=va(e,134217728);if(t!==null){var r=Yr();ci(t,e,134217728,r)}cy(e,134217728)}};v6=function(e){if(e.tag===13){var t=ro(e),r=va(e,t);if(r!==null){var n=Yr();ci(r,e,t,n)}cy(e,t)}};m6=function(){return Pt};y6=function(e,t){var r=Pt;try{return Pt=e,t()}finally{Pt=r}};gv=function(e,t,r){switch(t){case"input":if(sv(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=Th(n);if(!i)throw Error(Pe(90));Y_(n),sv(n,i)}}}break;case"textarea":Z_(e,r);break;case"select":t=r.value,t!=null&&ls(e,!!r.multiple,t,!1)}};i6=ay;a6=tl;var BP={usingClientEntryPoint:!1,Events:[xc,Zl,Th,r6,n6,ay]},Pu={findFiberByHostInstance:$o,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},UP={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:_a.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=s6(e),e===null?null:e.stateNode},findFiberByHostInstance:Pu.findFiberByHostInstance||FP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var id=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!id.isDisabled&&id.supportsFiber)try{Oh=id.inject(UP),Fi=id}catch{}}An.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=BP;An.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dy(t))throw Error(Pe(200));return jP(e,t,null,r)};An.createRoot=function(e,t){if(!dy(e))throw Error(Pe(299));var r=!1,n="",i=Bw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=uy(e,1,!1,null,null,r,!1,n,i),e[ga]=t.current,nc(e.nodeType===8?e.parentNode:e),new fy(t)};An.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Pe(188)):(e=Object.keys(e).join(","),Error(Pe(268,e)));return e=s6(t),e=e===null?null:e.stateNode,e};An.flushSync=function(e){return tl(e)};An.hydrate=function(e,t,r){if(!jh(t))throw Error(Pe(200));return Fh(null,e,t,!0,r)};An.hydrateRoot=function(e,t,r){if(!dy(e))throw Error(Pe(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",o=Bw;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=zw(t,null,e,1,r??null,i,!1,a,o),e[ga]=t.current,nc(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Dh(t)};An.render=function(e,t,r){if(!jh(t))throw Error(Pe(200));return Fh(null,e,t,!1,r)};An.unmountComponentAtNode=function(e){if(!jh(e))throw Error(Pe(40));return e._reactRootContainer?(tl(function(){Fh(null,null,e,!1,function(){e._reactRootContainer=null,e[ga]=null})}),!0):!1};An.unstable_batchedUpdates=ay;An.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!jh(r))throw Error(Pe(200));if(e==null||e._reactInternals===void 0)throw Error(Pe(38));return Fh(e,t,r,!1,n)};An.version="18.3.1-next-f1338f8080-20240426";function Uw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Uw)}catch(e){console.error(e)}}Uw(),U_.exports=An;var Hw=U_.exports,d5=Hw;Nd.createRoot=d5.createRoot,Nd.hydrateRoot=d5.hydrateRoot;var $w={};function rt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(r.length?" "+r.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var HP={};function hy(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:HP}var Gw=Object.assign,ah=Object.getOwnPropertyDescriptor,Bi=Object.defineProperty,Tc=Object.prototype,Kv=[];Object.freeze(Kv);var py={};Object.freeze(py);var $P=typeof Proxy<"u",GP=Object.toString();function Vw(){$P||rt("Proxy not available")}function qw(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var is=function(){};function kn(e){return typeof e=="function"}function rl(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function zh(e){return e!==null&&typeof e=="object"}function ya(e){if(!zh(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===GP}function Ww(e){var t=e==null?void 0:e.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function kc(e,t,r){Bi(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Kw(e,t,r){Bi(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function vo(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return zh(n)&&n[r]===!0}}function zs(e){return e instanceof Map}function Ac(e){return e instanceof Set}var Yw=typeof Object.getOwnPropertySymbols<"u";function VP(e){var t=Object.keys(e);if(!Yw)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return Tc.propertyIsEnumerable.call(e,n)})):t}var ws=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Yw?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Xw(e){return e===null?null:typeof e=="object"?""+e:e}function ca(e,t){return Tc.hasOwnProperty.call(e,t)}var qP=Object.getOwnPropertyDescriptors||function(t){var r={};return ws(t).forEach(function(n){r[n]=ah(t,n)}),r};function WP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,XP(n.key),n)}}function Bh(e,t,r){return t&&WP(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function so(){return so=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},so.apply(this,arguments)}function Zw(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Yv(e,t)}function Yv(e,t){return Yv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Yv(e,t)}function D1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KP(e,t){if(e){if(typeof e=="string")return h5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h5(e,t)}}function h5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function as(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=KP(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
33
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YP(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function XP(e){var t=YP(e,"string");return typeof t=="symbol"?t:String(t)}var ji=Symbol("mobx-stored-annotations");function fi(e){function t(r,n){if(Rc(n))return e.decorate_20223_(r,n);Bs(r,n,e)}return Object.assign(t,e)}function Bs(e,t,r){ca(e,ji)||kc(e,ji,so({},e[ji])),ax(r)||(e[ji][t]=r)}function ZP(e){return ca(e,ji)||kc(e,ji,so({},e[ji])),e[ji]}function Rc(e){return typeof e=="object"&&typeof e.kind=="string"}var Ke=Symbol("mobx administration"),Mc=function(){function e(r){r===void 0&&(r="Atom"),this.name_=void 0,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Et.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.reportObserved=function(){return y8(this)},t.reportChanged=function(){fn(),b8(this),dn()},t.toString=function(){return this.name_},e}(),gy=vo("Atom",Mc);function dc(e,t,r){t===void 0&&(t=is),r===void 0&&(r=is);var n=new Mc(e);return t!==is&&T8(n,t),r!==is&&wy(n,r),n}function QP(e,t){return e===t}function JP(e,t){return Ry(e,t)}function ex(e,t){return Ry(e,t,1)}function tx(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var nl={identity:QP,structural:JP,default:tx,shallow:ex};function il(e,t,r){return Kh(e)?e:Array.isArray(e)?kt.array(e,{name:r}):ya(e)?kt.object(e,void 0,{name:r}):zs(e)?kt.map(e,{name:r}):Ac(e)?kt.set(e,{name:r}):typeof e=="function"&&!Nc(e)&&!Ps(e)?Ww(e)?ol(e):Es(r,e):e}function rx(e,t,r){if(e==null||Or(e)||Jr(e)||Lr(e)||Xr(e))return e;if(Array.isArray(e))return kt.array(e,{name:r,deep:!1});if(ya(e))return kt.object(e,void 0,{name:r,deep:!1});if(zs(e))return kt.map(e,{name:r,deep:!1});if(Ac(e))return kt.set(e,{name:r,deep:!1})}function Uh(e){return e}function nx(e,t){return Ry(e,t)?t:e}var Qw="override",ix=fi({annotationType_:Qw,make_:ox,extend_:lx,decorate_20223_:sx});function ax(e){return e.annotationType_===Qw}function ox(e,t){return 0}function lx(e,t,r,n){rt("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function sx(e,t){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function Lc(e,t){return{annotationType_:e,options_:t,make_:ux,extend_:cx,decorate_20223_:fx}}function ux(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(Nc(r.value))return 1;var a=Jw(e,this,t,r,!1);return Bi(n,t,a),2}function cx(e,t,r,n){var i=Jw(e,this,t,r);return e.defineProperty_(t,i,n)}function fx(e,t){var r=t.kind,n=t.name,i=t.addInitializer,a=this,o=function(f){var g,S,_,h;return uo((g=(S=a.options_)==null?void 0:S.name)!=null?g:n.toString(),f,(_=(h=a.options_)==null?void 0:h.autoAction)!=null?_:!1)};if(r=="field"){i(function(){Bs(this,n,a)});return}if(r=="method"){var l;return Nc(e)||(e=o(e)),(l=this.options_)!=null&&l.bound&&i(function(){var u=this,f=u[n].bind(u);f.isMobxAction=!0,u[n]=f}),e}rt("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
|
|
34
|
+
'`+a.annotationType_+"' can only be used on properties with a function value."))}function dx(e,t,r,n){t.annotationType_,n.value}function Jw(e,t,r,n,i){var a,o,l,u,f,g,S;i===void 0&&(i=ke.safeDescriptors),dx(e,t,r,n);var _=n.value;if((a=t.options_)!=null&&a.bound){var h;_=_.bind((h=e.proxy_)!=null?h:e.target_)}return{value:uo((o=(l=t.options_)==null?void 0:l.name)!=null?o:r.toString(),_,(u=(f=t.options_)==null?void 0:f.autoAction)!=null?u:!1,(g=t.options_)!=null&&g.bound?(S=e.proxy_)!=null?S:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function e8(e,t){return{annotationType_:e,options_:t,make_:hx,extend_:px,decorate_20223_:gx}}function hx(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!ca(e.target_,t)||!Ps(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(Ps(r.value))return 1;var a=t8(e,this,t,r,!1,!1);return Bi(n,t,a),2}function px(e,t,r,n){var i,a=t8(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,n)}function gx(e,t){var r,n=t.name,i=t.addInitializer;return Ps(e)||(e=ol(e)),(r=this.options_)!=null&&r.bound&&i(function(){var a=this,o=a[n].bind(a);o.isMobXFlow=!0,a[n]=o}),e}function vx(e,t,r,n){t.annotationType_,n.value}function t8(e,t,r,n,i,a){a===void 0&&(a=ke.safeDescriptors),vx(e,t,r,n);var o=n.value;if(Ps(o)||(o=ol(o)),i){var l;o=o.bind((l=e.proxy_)!=null?l:e.target_),o.isMobXFlow=!0}return{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function vy(e,t){return{annotationType_:e,options_:t,make_:mx,extend_:yx,decorate_20223_:bx}}function mx(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function yx(e,t,r,n){return _x(e,this,t,r),e.defineComputedProperty_(t,so({},this.options_,{get:r.get,set:r.set}),n)}function bx(e,t){var r=this,n=t.name,i=t.addInitializer;return i(function(){var a=dl(this)[Ke],o=so({},r.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new $i(o))}),function(){return this[Ke].getObservablePropValue_(n)}}function _x(e,t,r,n){t.annotationType_,n.get}function Hh(e,t){return{annotationType_:e,options_:t,make_:wx,extend_:Sx,decorate_20223_:Ex}}function wx(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function Sx(e,t,r,n){var i,a;return Ox(e,this),e.defineObservableProperty_(t,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:il,n)}function Ex(e,t){var r=this,n=t.kind,i=t.name,a=new WeakSet;function o(l,u){var f,g,S=dl(l)[Ke],_=new io(u,(f=(g=r.options_)==null?void 0:g.enhancer)!=null?f:il,"ObservableObject."+i.toString(),!1);S.values_.set(i,_),a.add(l)}if(n=="accessor")return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[Ke].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[Ke].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function Ox(e,t,r,n){t.annotationType_}var Px="true",xx=r8();function r8(e){return{annotationType_:Px,options_:e,make_:Cx,extend_:Tx,decorate_20223_:kx}}function Cx(e,t,r,n){var i,a;if(r.get)return cl.make_(e,t,r,n);if(r.set){var o=uo(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:ke.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Bi(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var l;if(Ww(r.value)){var u,f=(u=this.options_)!=null&&u.autoBind?ol.bound:ol;return f.make_(e,t,r,n)}var g=(l=this.options_)!=null&&l.autoBind?Es.bound:Es;return g.make_(e,t,r,n)}var S=((i=this.options_)==null?void 0:i.deep)===!1?kt.ref:kt;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var _;r.value=r.value.bind((_=e.proxy_)!=null?_:e.target_)}return S.make_(e,t,r,n)}function Tx(e,t,r,n){var i,a;if(r.get)return cl.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:ke.safeDescriptors?e.isPlainObject_:!0,set:uo(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=e.proxy_)!=null?o:e.target_)}var l=((a=this.options_)==null?void 0:a.deep)===!1?kt.ref:kt;return l.extend_(e,t,r,n)}function kx(e,t){rt("'"+this.annotationType_+"' cannot be used as a decorator")}var Ax="observable",Rx="observable.ref",Mx="observable.shallow",Lx="observable.struct",n8={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(n8);function ad(e){return e||n8}var Xv=Hh(Ax),Nx=Hh(Rx,{enhancer:Uh}),Ix=Hh(Mx,{enhancer:rx}),Dx=Hh(Lx,{enhancer:nx}),i8=fi(Xv);function od(e){return e.deep===!0?il:e.deep===!1?Uh:Fx(e.defaultDecorator)}function jx(e){var t;return e?(t=e.defaultDecorator)!=null?t:r8(e):void 0}function Fx(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:il}function a8(e,t,r){if(Rc(t))return Xv.decorate_20223_(e,t);if(rl(t)){Bs(e,t,Xv);return}return Kh(e)?e:ya(e)?kt.object(e,t,r):Array.isArray(e)?kt.array(e,t):zs(e)?kt.map(e,t):Ac(e)?kt.set(e,t):typeof e=="object"&&e!==null?e:kt.box(e,t)}Gw(a8,i8);var zx={box:function(t,r){var n=ad(r);return new io(t,od(n),n.name,!0,n.equals)},array:function(t,r){var n=ad(r);return(ke.useProxies===!1||n.proxy===!1?VC:IC)(t,od(n),n.name)},map:function(t,r){var n=ad(r);return new Xh(t,od(n),n.name)},set:function(t,r){var n=ad(r);return new ky(t,od(n),n.name)},object:function(t,r,n){return mo(function(){return Sy(ke.useProxies===!1||(n==null?void 0:n.proxy)===!1?dl({},n):RC({},n),t,r)})},ref:fi(Nx),shallow:fi(Ix),deep:i8,struct:fi(Dx)},kt=Gw(a8,zx),o8="computed",Bx="computed.struct",Zv=vy(o8),Ux=vy(Bx,{equals:nl.structural}),cl=function(t,r){if(Rc(r))return Zv.decorate_20223_(t,r);if(rl(r))return Bs(t,r,Zv);if(ya(t))return fi(vy(o8,t));var n=ya(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new $i(n)};Object.assign(cl,Zv);cl.struct=fi(Ux);var p5,g5,oh=0,Hx=1,$x=(p5=(g5=ah(function(){},"name"))==null?void 0:g5.configurable)!=null?p5:!1,v5={value:"action",configurable:!0,writable:!1,enumerable:!1};function uo(e,t,r,n){r===void 0&&(r=!1);function i(){return l8(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},$x&&(v5.value=e,Bi(i,"name",v5)),i}function l8(e,t,r,n,i){var a=s8(e,t);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{u8(a)}}function s8(e,t,r,n){var i=!1,a=0,o=ke.trackingDerivation,l=!t||!o;fn();var u=ke.allowStateChanges;l&&(fl(),u=$h(!0));var f=Vh(!0),g={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:f,notifySpy_:i,startTime_:a,actionId_:Hx++,parentActionId_:oh};return oh=g.actionId_,g}function u8(e){oh!==e.actionId_&&rt(30),oh=e.parentActionId_,e.error_!==void 0&&(ke.suppressReactionErrors=!0),Gh(e.prevAllowStateChanges_),hs(e.prevAllowStateReads_),dn(),e.runAsAction_&&fa(e.prevDerivation_),ke.suppressReactionErrors=!1}function my(e,t){var r=$h(e);try{return t()}finally{Gh(r)}}function $h(e){var t=ke.allowStateChanges;return ke.allowStateChanges=e,t}function Gh(e){ke.allowStateChanges=e}var c8;c8=Symbol.toPrimitive;var io=function(e){Zw(t,e);function t(n,i,a,o,l){var u;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=nl.default),u=e.call(this,a)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=a,u.equals=l,u.value_=i(n,void 0,a),u}var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==ke.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(Gn(this)){var a=Vn(this,{object:this,type:Ui,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(),di(this)&&hi(this,{type:Ui,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Ic(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Ui,newValue:this.value_,oldValue:void 0}),Dc(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 Xw(this.get())},r[c8]=function(){return this.valueOf()},t}(Mc),yy=vo("ObservableValue",io),f8;function ld(e,t){return!!(e&t)}function sd(e,t,r){return r?e|=t:e&=~t,e}f8=Symbol.toPrimitive;var $i=function(){function e(r){this.dependenciesState_=Et.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Et.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new sh(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=lh.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||rt(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=uo("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?nl.structural:nl.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){Jx(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing&&rt(32,this.name_,this.derivation),ke.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Qv(this)&&(this.warnAboutUntrackedRead_(),fn(),this.value_=this.computeValue_(!1),dn());else if(y8(this),Qv(this)){var n=ke.trackingContext;this.keepAlive_&&!n&&(ke.trackingContext=this),this.trackAndCompute()&&Qx(this),ke.trackingContext=n}var i=this.value_;if(Ad(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter&&rt(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else rt(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===Et.NOT_TRACKING_,a=this.computeValue_(!0),o=i||Ad(n)||Ad(a)||!this.equals_(n,a);return o&&(this.value_=a),o},t.computeValue_=function(n){this.isComputing=!0;var i=$h(!1),a;if(n)a=d8(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 sh(o)}return Gh(i),this.isComputing=!1,a},t.suspend_=function(){this.keepAlive_||(Jv(this),this.value_=void 0)},t.observe_=function(n,i){var a=this,o=!0,l=void 0;return _y(function(){var u=a.get();if(!o||i){var f=fl();n({observableKind:"computed",debugObjectName:a.name_,type:Ui,object:a,newValue:u,oldValue:l}),fa(f)}o=!1,l=u})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Xw(this.get())},t[f8]=function(){return this.valueOf()},Bh(e,[{key:"isComputing",get:function(){return ld(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=sd(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return ld(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=sd(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return ld(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=sd(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return ld(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=sd(this.flags_,e.isPendingUnobservationMask_,n)}}]),e}();$i.isComputingMask_=1;$i.isRunningSetterMask_=2;$i.isBeingObservedMask_=4;$i.isPendingUnobservationMask_=8;var al=vo("ComputedValue",$i),Et;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(Et||(Et={}));var lh;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(lh||(lh={}));var sh=function(t){this.cause=void 0,this.cause=t};function Ad(e){return e instanceof sh}function Qv(e){switch(e.dependenciesState_){case Et.UP_TO_DATE_:return!1;case Et.NOT_TRACKING_:case Et.STALE_:return!0;case Et.POSSIBLY_STALE_:{for(var t=Vh(!0),r=fl(),n=e.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if(al(o)){if(ke.disableErrorBoundaries)o.get();else try{o.get()}catch{return fa(r),hs(t),!0}if(e.dependenciesState_===Et.STALE_)return fa(r),hs(t),!0}}return h8(e),fa(r),hs(t),!1}}}function Gx(){return ke.trackingDerivation!==null}function d8(e,t,r){var n=Vh(!0);h8(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++ke.runId;var i=ke.trackingDerivation;ke.trackingDerivation=e,ke.inBatch++;var a;if(ke.disableErrorBoundaries===!0)a=t.call(r);else try{a=t.call(r)}catch(o){a=new sh(o)}return ke.inBatch--,ke.trackingDerivation=i,Vx(e),hs(n),a}function Vx(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=Et.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var l=r[o];l.diffValue_===0&&(l.diffValue_=1,i!==o&&(r[i]=l),i++),l.dependenciesState_>n&&(n=l.dependenciesState_)}for(r.length=i,e.newObserving_=null,a=t.length;a--;){var u=t[a];u.diffValue_===0&&v8(u,e),u.diffValue_=0}for(;i--;){var f=r[i];f.diffValue_===1&&(f.diffValue_=0,Zx(f,e))}n!==Et.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function Jv(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)v8(t[r],e);e.dependenciesState_=Et.NOT_TRACKING_}function by(e){var t=fl();try{return e()}finally{fa(t)}}function fl(){var e=ke.trackingDerivation;return ke.trackingDerivation=null,e}function fa(e){ke.trackingDerivation=e}function Vh(e){var t=ke.allowStateReads;return ke.allowStateReads=e,t}function hs(e){ke.allowStateReads=e}function h8(e){if(e.dependenciesState_!==Et.UP_TO_DATE_){e.dependenciesState_=Et.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=Et.UP_TO_DATE_}}var qx=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],Vu=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},Rd=!0,p8=!1,ke=function(){var e=hy();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Rd=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Vu().version&&(Rd=!1),Rd?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Vu):(setTimeout(function(){p8||rt(35)},1),new Vu)}();function Wx(){if((ke.pendingReactions.length||ke.inBatch||ke.isRunningReactions)&&rt(36),p8=!0,Rd){var e=hy();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),ke=new Vu}}function g8(){return ke}function Kx(){var e=new Vu;for(var t in e)qx.indexOf(t)===-1&&(ke[t]=e[t]);ke.allowStateChanges=!ke.enforceActions}function Yx(e){return e.observers_&&e.observers_.size>0}function Xx(e){return e.observers_}function Zx(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function v8(e,t){e.observers_.delete(t),e.observers_.size===0&&m8(e)}function m8(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,ke.pendingUnobservations.push(e))}function fn(){ke.inBatch++}function dn(){if(--ke.inBatch===0){_8();for(var e=ke.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof $i&&r.suspend_())}ke.pendingUnobservations=[]}}function y8(e){var t=ke.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&ke.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&ke.inBatch>0&&m8(e),!1)}function b8(e){e.lowestObserverState_!==Et.STALE_&&(e.lowestObserverState_=Et.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Et.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=Et.STALE_}))}function Qx(e){e.lowestObserverState_!==Et.STALE_&&(e.lowestObserverState_=Et.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Et.POSSIBLY_STALE_?t.dependenciesState_=Et.STALE_:t.dependenciesState_===Et.UP_TO_DATE_&&(e.lowestObserverState_=Et.UP_TO_DATE_)}))}function Jx(e){e.lowestObserverState_===Et.UP_TO_DATE_&&(e.lowestObserverState_=Et.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Et.UP_TO_DATE_&&(t.dependenciesState_=Et.POSSIBLY_STALE_,t.onBecomeStale_())}))}var Ss=function(){function e(r,n,i,a){r===void 0&&(r="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Et.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_=lh.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=a}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,ke.pendingReactions.push(this),_8())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){fn(),this.isScheduled_=!1;var n=ke.trackingContext;if(ke.trackingContext=this,Qv(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}ke.trackingContext=n,dn()}},t.track=function(n){if(!this.isDisposed_){fn(),this.isRunning_=!0;var i=ke.trackingContext;ke.trackingContext=this;var a=d8(this,n,void 0);ke.trackingContext=i,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Jv(this),Ad(a)&&this.reportExceptionInDerivation_(a.cause),dn()}},t.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)})},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(fn(),Jv(this),dn()))},t.getDisposer_=function(n){var i=this,a=function o(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",a),a[Ke]=this,a},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){},e}();function eC(e){return ke.globalReactionErrorHandlers.push(e),function(){var t=ke.globalReactionErrorHandlers.indexOf(e);t>=0&&ke.globalReactionErrorHandlers.splice(t,1)}}var tC=100,em=function(t){return t()};function _8(){ke.inBatch>0||ke.isRunningReactions||em(rC)}function rC(){ke.isRunningReactions=!0;for(var e=ke.pendingReactions,t=0;e.length>0;){++t===tC&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}ke.isRunningReactions=!1}var uh=vo("Reaction",Ss);function nC(e){var t=em;em=function(n){return e(function(){return t(n)})}}function qu(){return!1}function w8(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var S8="action",iC="action.bound",E8="autoAction",aC="autoAction.bound",O8="<unnamed action>",tm=Lc(S8),oC=Lc(iC,{bound:!0}),rm=Lc(E8,{autoAction:!0}),lC=Lc(aC,{autoAction:!0,bound:!0});function P8(e){var t=function(n,i){if(kn(n))return uo(n.name||O8,n,e);if(kn(i))return uo(n,i,e);if(Rc(i))return(e?rm:tm).decorate_20223_(n,i);if(rl(i))return Bs(n,i,e?rm:tm);if(rl(n))return fi(Lc(e?E8:S8,{name:n,autoAction:e}))};return t}var ar=P8(!1);Object.assign(ar,tm);var Es=P8(!0);Object.assign(Es,rm);ar.bound=fi(oC);Es.bound=fi(lC);function Os(e){return l8(e.name||O8,!1,e,this,void 0)}function Nc(e){return kn(e)&&e.isMobxAction===!0}function _y(e,t){var r,n,i,a,o;t===void 0&&(t=py);var l=(r=(n=t)==null?void 0:n.name)!=null?r:"Autorun",u=!t.scheduler&&!t.delay,f;if(u)f=new Ss(l,function(){this.track(_)},t.onError,t.requiresObservable);else{var g=x8(t),S=!1;f=new Ss(l,function(){S||(S=!0,g(function(){S=!1,f.isDisposed_||f.track(_)}))},t.onError,t.requiresObservable)}function _(){e(f)}return(i=t)!=null&&(a=i.signal)!=null&&a.aborted||f.schedule_(),f.getDisposer_((o=t)==null?void 0:o.signal)}var sC=function(t){return t()};function x8(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:sC}function C8(e,t,r){var n,i,a,o;r===void 0&&(r=py);var l=(n=r.name)!=null?n:"Reaction",u=ar(l,r.onError?uC(r.onError,t):t),f=!r.scheduler&&!r.delay,g=x8(r),S=!0,_=!1,h,w=r.compareStructural?nl.structural:r.equals||nl.default,m=new Ss(l,function(){S||f?y():_||(_=!0,g(y))},r.onError,r.requiresObservable);function y(){if(_=!1,!m.isDisposed_){var p=!1,v=h;m.track(function(){var d=my(!1,function(){return e(m)});p=S||!w(h,d),h=d}),(S&&r.fireImmediately||!S&&p)&&u(h,v,m),S=!1}}return(i=r)!=null&&(a=i.signal)!=null&&a.aborted||m.schedule_(),m.getDisposer_((o=r)==null?void 0:o.signal)}function uC(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var cC="onBO",fC="onBUO";function T8(e,t,r){return k8(cC,e,t,r)}function wy(e,t,r){return k8(fC,e,t,r)}function k8(e,t,r,n){var i=typeof n=="function"?Gi(t,r):Gi(t),a=kn(n)?n:r,o=e+"L";return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var l=i[o];l&&(l.delete(a),l.size===0&&delete i[o])}}var dC="never",ud="always",hC="observed";function A8(e){e.isolateGlobalState===!0&&Wx();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(ke.useProxies=t===ud?!0:t===dC?!1:typeof Proxy<"u"),t==="ifavailable"&&(ke.verifyProxies=!0),r!==void 0){var n=r===ud?ud:r===hC;ke.enforceActions=n,ke.allowStateChanges=!(n===!0||n===ud)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(ke[i]=!!e[i])}),ke.allowStateReads=!ke.observableRequiresReaction,e.reactionScheduler&&nC(e.reactionScheduler)}function Sy(e,t,r,n){var i=qP(t);return mo(function(){var a=dl(e,n)[Ke];ws(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function R8(e,t){return M8(Gi(e,t))}function M8(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=gC(e.observing_).map(M8)),t}function pC(e,t){return L8(Gi(e,t))}function L8(e){var t={name:e.name_};return Yx(e)&&(t.observers=Array.from(Xx(e)).map(L8)),t}function gC(e){return Array.from(new Set(e))}var vC=0;function qh(){this.message="FLOW_CANCELLED"}qh.prototype=Object.create(Error.prototype);function mC(e){return e instanceof qh}var j1=e8("flow"),yC=e8("flow.bound",{bound:!0}),ol=Object.assign(function(t,r){if(Rc(r))return j1.decorate_20223_(t,r);if(rl(r))return Bs(t,r,j1);var n=t,i=n.name||"<unnamed flow>",a=function(){var l=this,u=arguments,f=++vC,g=ar(i+" - runid: "+f+" - init",n).apply(l,u),S,_=void 0,h=new Promise(function(w,m){var y=0;S=m;function p(b){_=void 0;var O;try{O=ar(i+" - runid: "+f+" - yield "+y++,g.next).call(g,b)}catch(R){return m(R)}d(O)}function v(b){_=void 0;var O;try{O=ar(i+" - runid: "+f+" - yield "+y++,g.throw).call(g,b)}catch(R){return m(R)}d(O)}function d(b){if(kn(b==null?void 0:b.then)){b.then(d,m);return}return b.done?w(b.value):(_=Promise.resolve(b.value),_.then(p,v))}p(void 0)});return h.cancel=ar(i+" - runid: "+f+" - cancel",function(){try{_&&m5(_);var w=g.return(void 0),m=Promise.resolve(w.value);m.then(is,is),m5(m),S(new qh)}catch(y){S(y)}}),h};return a.isMobXFlow=!0,a},j1);ol.bound=fi(yC);function m5(e){kn(e.cancel)&&e.cancel()}function bC(e){return e}function Ps(e){return(e==null?void 0:e.isMobXFlow)===!0}function Ey(e,t,r){var n;return Lr(e)||Jr(e)||yy(e)?n=vi(e):Or(e)&&(n=vi(e,t)),n.dehancer=typeof t=="function"?t:r,function(){n.dehancer=void 0}}function Wh(e,t,r){return kn(r)?wC(e,t,r):_C(e,t)}function _C(e,t){return vi(e).intercept_(t)}function wC(e,t,r){return vi(e,t).intercept_(r)}function N8(e,t){if(t===void 0)return al(e);if(Or(e)===!1||!e[Ke].values_.has(t))return!1;var r=Gi(e,t);return al(r)}function SC(e){return N8(e)}function I8(e,t){return N8(e,t)}function D8(e,t){return e?t!==void 0?Or(e)?e[Ke].values_.has(t):!1:Or(e)||!!e[Ke]||gy(e)||uh(e)||al(e):!1}function Kh(e){return D8(e)}function j8(e,t){return D8(e,t)}function hc(e){if(Or(e))return e[Ke].keys_();if(Lr(e)||Xr(e))return Array.from(e.keys());if(Jr(e))return e.map(function(t,r){return r});rt(5)}function Oy(e){if(Or(e))return hc(e).map(function(t){return e[t]});if(Lr(e))return hc(e).map(function(t){return e.get(t)});if(Xr(e))return Array.from(e.values());if(Jr(e))return e.slice();rt(6)}function F8(e){if(Or(e))return hc(e).map(function(t){return[t,e[t]]});if(Lr(e))return hc(e).map(function(t){return[t,e.get(t)]});if(Xr(e))return Array.from(e.entries());if(Jr(e))return e.map(function(t,r){return[r,t]});rt(7)}function Py(e,t,r){if(arguments.length===2&&!Xr(e)){fn();var n=t;try{for(var i in n)Py(e,i,n[i])}finally{dn()}return}Or(e)?e[Ke].set_(t,r):Lr(e)?e.set(t,r):Xr(e)?e.add(t):Jr(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&rt("Invalid index: '"+t+"'"),fn(),t>=e.length&&(e.length=t+1),e[t]=r,dn()):rt(8)}function EC(e,t){Or(e)?e[Ke].delete_(t):Lr(e)||Xr(e)?e.delete(t):Jr(e)?(typeof t!="number"&&(t=parseInt(t,10)),e.splice(t,1)):rt(9)}function z8(e,t){if(Or(e))return e[Ke].has_(t);if(Lr(e))return e.has(t);if(Xr(e))return e.has(t);if(Jr(e))return t>=0&&t<e.length;rt(10)}function OC(e,t){if(z8(e,t)){if(Or(e))return e[Ke].get_(t);if(Lr(e))return e.get(t);if(Jr(e))return e[t];rt(11)}}function xy(e,t,r){if(Or(e))return e[Ke].defineProperty_(t,r);rt(39)}function B8(e){if(Or(e))return e[Ke].ownKeys_();rt(38)}function Yh(e,t,r,n){return kn(r)?xC(e,t,r,n):PC(e,t,r)}function PC(e,t,r){return vi(e).observe_(t,r)}function xC(e,t,r,n){return vi(e,t).observe_(r,n)}function cd(e,t,r){return e.set(t,r),r}function Vl(e,t){if(e==null||typeof e!="object"||e instanceof Date||!Kh(e))return e;if(yy(e)||al(e))return Vl(e.get(),t);if(t.has(e))return t.get(e);if(Jr(e)){var r=cd(t,e,new Array(e.length));return e.forEach(function(o,l){r[l]=Vl(o,t)}),r}if(Xr(e)){var n=cd(t,e,new Set);return e.forEach(function(o){n.add(Vl(o,t))}),n}if(Lr(e)){var i=cd(t,e,new Map);return e.forEach(function(o,l){i.set(l,Vl(o,t))}),i}else{var a=cd(t,e,{});return B8(e).forEach(function(o){Tc.propertyIsEnumerable.call(e,o)&&(a[o]=Vl(e[o],t))}),a}}function CC(e,t){return Vl(e,new Map)}function TC(){}function Ii(e,t){t===void 0&&(t=void 0),fn();try{return e.apply(t)}finally{dn()}}function nm(e,t,r){return arguments.length===1||t&&typeof t=="object"?kC(e,t):U8(e,t,r||{})}function U8(e,t,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[Ke].isDisposed_)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=uo("When-effect",t),o=_y(function(l){var u=my(!1,e);u&&(l.dispose(),n&&clearTimeout(n),a())},r);return o}function kC(e,t){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,i,a=new Promise(function(o,l){var u,f=U8(e,o,so({},t,{onError:l}));n=function(){f(),l(new Error("WHEN_CANCELLED"))},i=function(){f(),l(new Error("WHEN_ABORTED"))},t==null||(u=t.signal)==null||u.addEventListener==null||u.addEventListener("abort",i)}).finally(function(){var o;return t==null||(o=t.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",i)});return a.cancel=n,a}function Ul(e){return e[Ke]}var AC={has:function(t,r){return Ul(t).has_(r)},get:function(t,r){return Ul(t).get_(r)},set:function(t,r,n){var i;return rl(r)?(i=Ul(t).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(t,r){var n;return rl(r)?(n=Ul(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return(i=Ul(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return Ul(t).ownKeys_()},preventExtensions:function(t){rt(13)}};function RC(e,t){var r,n;return Vw(),e=dl(e,t),(n=(r=e[Ke]).proxy_)!=null?n:r.proxy_=new Proxy(e,AC)}function Gn(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Ic(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),qw(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Vn(e,t){var r=fl();try{for(var n=[].concat(e.interceptors_||[]),i=0,a=n.length;i<a&&(t=n[i](t),t&&!t.type&&rt(14),!!t);i++);return t}finally{fa(r)}}function di(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Dc(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),qw(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function hi(e,t){var r=fl(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](t);fa(r)}}function Cy(e,t,r){return mo(function(){var n,i=dl(e,r)[Ke];(n=t)!=null||(t=ZP(e)),ws(t).forEach(function(a){return i.make_(a,t[a])})}),e}var F1=Symbol("mobx-keys");function MC(e,t,r){return ya(e)?Sy(e,e,t,r):(mo(function(){var n=dl(e,r)[Ke];if(!e[F1]){var i=Object.getPrototypeOf(e),a=new Set([].concat(ws(e),ws(i)));a.delete("constructor"),a.delete(Ke),kc(i,F1,a)}e[F1].forEach(function(o){return n.make_(o,t&&o in t?t[o]:!0)})}),e)}var y5="splice",Ui="update",LC=1e4,NC={get:function(t,r){var n=t[Ke];return r===Ke?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):ca(ch,r)?ch[r]:t[r]},set:function(t,r,n){var i=t[Ke];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){rt(15)}},Ty=function(){function e(r,n,i,a){r===void 0&&(r="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new Mc(r),this.enhancer_=function(o,l){return n(o,l,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return Ic(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Dc(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&rt("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var a=new Array(n-i),o=0;o<n-i;o++)a[o]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&rt(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&X8(n+i+1)},t.spliceWithArray_=function(n,i,a){var o=this;this.atom_;var l=this.values_.length;if(n===void 0?n=0:n>l?n=l:n<0&&(n=Math.max(0,l+n)),arguments.length===1?i=l-n:i==null?i=0:i=Math.max(0,Math.min(i,l-n)),a===void 0&&(a=Kv),Gn(this)){var u=Vn(this,{object:this.proxy_,type:y5,index:n,removedCount:i,added:a});if(!u)return Kv;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(S){return o.enhancer_(S,void 0)}),this.legacyMode_){var f=a.length-i;this.updateArrayLength_(l,f)}var g=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,g),this.dehanceValues_(g)},t.spliceItemsIntoValues_=function(n,i,a){if(a.length<LC){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 g=0;g<u.length;g++)this.values_[n+a.length+g]=u[g];return l}},t.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&qu(),l=di(this),u=l||o?{observableKind:"array",object:this.proxy_,type:Ui,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&hi(this,u)},t.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&qu(),l=di(this),u=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:y5,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&hi(this,u)},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx] Out of bounds read: "+n);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var a=this.values_;if(this.legacyMode_&&n>a.length&&rt(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(Gn(this)){var l=Vn(this,{type:Ui,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),g=0;g<f.length-1;g++)f[g]=void 0;f[f.length-1]=i,this.spliceWithArray_(a.length,0,f)}},e}();function IC(e,t,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),Vw(),mo(function(){var i=new Ty(r,t,n,!1);Kw(i.values_,Ke,i);var a=new Proxy(i.values_,NC);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var ch={clear:function(){return this.splice(0)},replace:function(t){var r=this[Ke];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];var o=this[Ke];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,r)}return o.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[Ke].spliceWithArray_(t,r,n)},push:function(){for(var t=this[Ke],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[Ke].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[Ke],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return ke.trackingDerivation&&rt(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){ke.trackingDerivation&&rt(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[Ke],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};It("at",Mn);It("concat",Mn);It("flat",Mn);It("includes",Mn);It("indexOf",Mn);It("join",Mn);It("lastIndexOf",Mn);It("slice",Mn);It("toString",Mn);It("toLocaleString",Mn);It("toSorted",Mn);It("toSpliced",Mn);It("with",Mn);It("every",mi);It("filter",mi);It("find",mi);It("findIndex",mi);It("findLast",mi);It("findLastIndex",mi);It("flatMap",mi);It("forEach",mi);It("map",mi);It("some",mi);It("toReversed",mi);It("reduce",H8);It("reduceRight",H8);function It(e,t){typeof Array.prototype[e]=="function"&&(ch[e]=t(e))}function Mn(e){return function(){var t=this[Ke];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function mi(e){return function(t,r){var n=this,i=this[Ke];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[e](function(o,l){return t.call(r,o,l,n)})}}function H8(e){return function(){var t=this,r=this[Ke];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(a,o,l){return i(a,o,l,t)},n[e].apply(n,arguments)}}var DC=vo("ObservableArrayAdministration",Ty);function Jr(e){return zh(e)&&DC(e[Ke])}var $8,G8,jC={},Ya="add",fh="delete";$8=Symbol.iterator;G8=Symbol.toStringTag;var Xh=function(){function e(r,n,i){var a=this;n===void 0&&(n=il),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ke]=jC,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,kn(Map)||rt(18),mo(function(){a.keysAtom_=dc("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,r&&a.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!ke.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var o=a=new io(this.has_(n),Uh,"ObservableMap.key?",!1);this.hasMap_.set(n,o),wy(o,function(){return i.hasMap_.delete(n)})}return a.get()},t.set=function(n,i){var a=this.has_(n);if(Gn(this)){var o=Vn(this,{type:a?Ui:Ya,object:this,newValue:i,name:n});if(!o)return this;i=o.newValue}return a?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(this.keysAtom_,Gn(this)){var a=Vn(this,{type:fh,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=qu(),l=di(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:fh,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return Ii(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var g=i.data_.get(n);g.setNewValue_(void 0),i.data_.delete(n)}),l&&hi(this,u),!0}return!1},t.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==ke.UNCHANGED){var o=qu(),l=di(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Ui,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&hi(this,u)}},t.addValue_=function(n,i){var a=this;this.keysAtom_,Ii(function(){var f,g=new io(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,g),i=g.value_,(f=a.hasMap_.get(n))==null||f.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=qu(),l=di(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Ya,object:this,name:n,newValue:i}:null;l&&hi(this,u)},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return pc({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:n.get(u)}}})},t.entries=function(){var n=this,i=this.keys();return pc({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:[u,n.get(u)]}}})},t[$8]=function(){return this.entries()},t.forEach=function(n,i){for(var a=as(this),o;!(o=a()).done;){var l=o.value,u=l[0],f=l[1];n.call(i,f,u,this)}},t.merge=function(n){var i=this;return Lr(n)&&(n=new Map(n)),Ii(function(){ya(n)?VP(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)}):zs(n)?(n.constructor!==Map&&rt(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&rt(20,n)}),this},t.clear=function(){var n=this;Ii(function(){by(function(){for(var i=as(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.replace=function(n){var i=this;return Ii(function(){for(var a=FC(n),o=new Map,l=!1,u=as(i.data_.keys()),f;!(f=u()).done;){var g=f.value;if(!a.has(g)){var S=i.delete(g);if(S)l=!0;else{var _=i.data_.get(g);o.set(g,_)}}}for(var h=as(a.entries()),w;!(w=h()).done;){var m=w.value,y=m[0],p=m[1],v=i.data_.has(y);if(i.set(y,p),i.data_.has(y)){var d=i.data_.get(y);o.set(y,d),v||(l=!0)}}if(!l)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var b=i.data_.keys(),O=o.keys(),R=b.next(),T=O.next();!R.done;){if(R.value!==T.value){i.keysAtom_.reportChanged();break}R=b.next(),T=O.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return Dc(this,n)},t.intercept_=function(n){return Ic(this,n)},Bh(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:G8,get:function(){return"Map"}}]),e}(),Lr=vo("ObservableMap",Xh);function FC(e){if(zs(e)||Lr(e))return e;if(Array.isArray(e))return new Map(e);if(ya(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return rt(21,e)}var V8,q8,zC={};V8=Symbol.iterator;q8=Symbol.toStringTag;var ky=function(){function e(r,n,i){var a=this;n===void 0&&(n=il),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Ke]=zC,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,kn(Set)||rt(22),this.enhancer_=function(o,l){return n(o,l,i)},mo(function(){a.atom_=dc(a.name_),r&&a.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;Ii(function(){by(function(){for(var i=as(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.forEach=function(n,i){for(var a=as(this),o;!(o=a()).done;){var l=o.value;n.call(i,l,l,this)}},t.add=function(n){var i=this;if(this.atom_,Gn(this)){var a=Vn(this,{type:Ya,object:this,newValue:n});if(!a)return this}if(!this.has(n)){Ii(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,l=di(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:Ya,object:this,newValue:n}:null;l&&hi(this,u)}return this},t.delete=function(n){var i=this;if(Gn(this)){var a=Vn(this,{type:fh,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,l=di(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:fh,object:this,oldValue:n}:null;return Ii(function(){i.atom_.reportChanged(),i.data_.delete(n)}),l&&hi(this,u),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=0,i=Array.from(this.keys()),a=Array.from(this.values());return pc({next:function(){var l=n;return n+=1,l<a.length?{value:[i[l],a[l]],done:!1}:{done:!0}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=0,a=Array.from(this.data_.values());return pc({next:function(){return i<a.length?{value:n.dehanceValue_(a[i++]),done:!1}:{done:!0}}})},t.replace=function(n){var i=this;return Xr(n)&&(n=new Set(n)),Ii(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):Ac(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&rt("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return Dc(this,n)},t.intercept_=function(n){return Ic(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[V8]=function(){return this.values()},Bh(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:q8,get:function(){return"Set"}}]),e}(),Xr=vo("ObservableSet",ky),b5=Object.create(null),_5="remove",W8=function(){function e(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=xx),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 Mc("ObservableObject.keys"),this.isPlainObject_=ya(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var a=this.values_.get(n);if(a instanceof $i)return a.set(i),!0;if(Gn(this)){var o=Vn(this,{type:Ui,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=di(this),u=!1,f=l||u?{type:Ui,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&hi(this,f)}return!0},t.get_=function(n){return ke.trackingDerivation&&!ca(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,a){return a===void 0&&(a=!1),ca(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):a?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},t.has_=function(n){if(!ke.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new io(n in this.target_,Uh,"ObservableObject.key?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(n in this.target_)){var a;if((a=this.target_[ji])!=null&&a[n])return;rt(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==Tc;){var l=ah(o,n);if(l){var u=i.make_(this,n,l,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}S5(this,i,n)}},t.extend_=function(n,i,a,o){if(o===void 0&&(o=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(n,i,o);var l=a.extend_(this,n,i,o);return l&&S5(this,a,n),l},t.defineProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{fn();var o=this.delete_(n);if(!o)return o;if(Gn(this)){var l=Vn(this,{object:this.proxy_||this.target_,name:n,type:Ya,newValue:i.value});if(!l)return null;var u=l.newValue;i.value!==u&&(i=so({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Bi(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{dn()}return!0},t.defineObservableProperty_=function(n,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{fn();var l=this.delete_(n);if(!l)return l;if(Gn(this)){var u=Vn(this,{object:this.proxy_||this.target_,name:n,type:Ya,newValue:i});if(!u)return null;i=u.newValue}var f=w5(n),g={configurable:ke.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(o){if(!Reflect.defineProperty(this.target_,n,g))return!1}else Bi(this.target_,n,g);var S=new io(i,a,"ObservableObject.key",!1);this.values_.set(n,S),this.notifyPropertyAddition_(n,S.value_)}finally{dn()}return!0},t.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{fn();var o=this.delete_(n);if(!o)return o;if(Gn(this)){var l=Vn(this,{object:this.proxy_||this.target_,name:n,type:Ya,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=w5(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 Bi(this.target_,n,f);this.values_.set(n,new $i(i)),this.notifyPropertyAddition_(n,void 0)}finally{dn()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!ca(this.target_,n))return!0;if(Gn(this)){var a=Vn(this,{object:this.proxy_||this.target_,name:n,type:_5});if(!a)return null}try{var o,l;fn();var u=di(this),f=!1,g=this.values_.get(n),S=void 0;if(!g&&(u||f)){var _;S=(_=ah(this.target_,n))==null?void 0:_.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(g&&(this.values_.delete(n),g instanceof io&&(S=g.value_),b8(g)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(l=o.get(n))==null||l.set(n in this.target_),u||f){var h={type:_5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:S,name:n};u&&hi(this,h)}}finally{dn()}return!0},t.observe_=function(n,i){return Dc(this,n)},t.intercept_=function(n){return Ic(this,n)},t.notifyPropertyAddition_=function(n,i){var a,o,l=di(this),u=!1;if(l||u){var f=l||u?{type:Ya,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;l&&hi(this,f)}(a=this.pendingKeys_)==null||(o=a.get(n))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),ws(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function dl(e,t){var r;if(ca(e,Ke))return e;var n=(r=t==null?void 0:t.name)!=null?r:"ObservableObject",i=new W8(e,new Map,String(n),jx(t));return kc(e,Ke,i),e}var BC=vo("ObservableObjectAdministration",W8);function w5(e){return b5[e]||(b5[e]={get:function(){return this[Ke].getObservablePropValue_(e)},set:function(r){return this[Ke].setObservablePropValue_(e,r)}})}function Or(e){return zh(e)?BC(e[Ke]):!1}function S5(e,t,r){var n;(n=e.target_[ji])==null||delete n[r]}var UC=Y8(0),HC=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),z1=0,K8=function(){};function $C(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}$C(K8,Array.prototype);var Ay=function(e,t,r){Zw(n,e);function n(a,o,l,u){var f;return l===void 0&&(l="ObservableArray"),u===void 0&&(u=!1),f=e.call(this)||this,mo(function(){var g=new Ty(l,o,u,!0);g.proxy_=D1(f),Kw(D1(f),Ke,g),a&&a.length&&f.spliceWithArray(0,0,a),HC&&Object.defineProperty(D1(f),"0",UC)}),f}var i=n.prototype;return i.concat=function(){this[Ke].atom_.reportObserved();for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];return Array.prototype.concat.apply(this.slice(),l.map(function(f){return Jr(f)?f.slice():f}))},i[r]=function(){var a=this,o=0;return pc({next:function(){return o<a.length?{value:a[o++],done:!1}:{done:!0,value:void 0}}})},Bh(n,[{key:"length",get:function(){return this[Ke].getArrayLength_()},set:function(o){this[Ke].setArrayLength_(o)}},{key:t,get:function(){return"Array"}}]),n}(K8,Symbol.toStringTag,Symbol.iterator);Object.entries(ch).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&kc(Ay.prototype,t,r)});function Y8(e){return{enumerable:!1,configurable:!0,get:function(){return this[Ke].get_(e)},set:function(r){this[Ke].set_(e,r)}}}function GC(e){Bi(Ay.prototype,""+e,Y8(e))}function X8(e){if(e>z1){for(var t=z1;t<e+100;t++)GC(t);z1=e}}X8(1e3);function VC(e,t,r){return new Ay(e,t,r)}function Gi(e,t){if(typeof e=="object"&&e!==null){if(Jr(e))return t!==void 0&&rt(23),e[Ke].atom_;if(Xr(e))return e.atom_;if(Lr(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||rt(25,t,dh(e)),r}if(Or(e)){if(!t)return rt(26);var n=e[Ke].values_.get(t);return n||rt(27,t,dh(e)),n}if(gy(e)||al(e)||uh(e))return e}else if(kn(e)&&uh(e[Ke]))return e[Ke];rt(28)}function vi(e,t){if(e||rt(29),t!==void 0)return vi(Gi(e,t));if(gy(e)||al(e)||uh(e)||Lr(e)||Xr(e))return e;if(e[Ke])return e[Ke];rt(24,e)}function dh(e,t){var r;if(t!==void 0)r=Gi(e,t);else{if(Nc(e))return e.name;Or(e)||Lr(e)||Xr(e)?r=vi(e):r=Gi(e)}return r.name_}function mo(e){var t=fl(),r=$h(!0);fn();try{return e()}finally{dn(),Gh(r),fa(t)}}var E5=Tc.toString;function Ry(e,t,r){return r===void 0&&(r=-1),im(e,t,r)}function im(e,t,r,n,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!=="function"&&a!=="object"&&typeof t!="object")return!1;var o=E5.call(e);if(o!==E5.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++;break}e=O5(e),t=O5(t);var l=o==="[object Array]";if(!l){if(typeof e!="object"||typeof t!="object")return!1;var u=e.constructor,f=t.constructor;if(u!==f&&!(kn(u)&&u instanceof u&&kn(f)&&f instanceof f)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var g=n.length;g--;)if(n[g]===e)return i[g]===t;if(n.push(e),i.push(t),l){if(g=e.length,g!==t.length)return!1;for(;g--;)if(!im(e[g],t[g],r-1,n,i))return!1}else{var S=Object.keys(e),_;if(g=S.length,Object.keys(t).length!==g)return!1;for(;g--;)if(_=S[g],!(ca(t,_)&&im(e[_],t[_],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function O5(e){return Jr(e)?e.slice():zs(e)||Lr(e)||Ac(e)||Xr(e)?Array.from(e.entries()):e}function pc(e){return e[Symbol.iterator]=qC,e}function qC(){return this}["Symbol","Map","Set"].forEach(function(e){var t=hy();typeof t[e]>"u"&&rt("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:w8,extras:{getDebugName:dh},$mobx:Ke});const WC=Object.freeze(Object.defineProperty({__proto__:null,$mobx:Ke,FlowCancellationError:qh,ObservableMap:Xh,ObservableSet:ky,Reaction:Ss,_allowStateChanges:my,_allowStateChangesInsideComputed:Os,_allowStateReadsEnd:hs,_allowStateReadsStart:Vh,_autoAction:Es,_endAction:u8,_getAdministration:vi,_getGlobalState:g8,_interceptReads:Ey,_isComputingDerivation:Gx,_resetGlobalState:Kx,_startAction:s8,action:ar,autorun:_y,comparer:nl,computed:cl,configure:A8,createAtom:dc,defineProperty:xy,entries:F8,extendObservable:Sy,flow:ol,flowResult:bC,get:OC,getAtom:Gi,getDebugName:dh,getDependencyTree:R8,getObserverTree:pC,has:z8,intercept:Wh,isAction:Nc,isBoxedObservable:yy,isComputed:SC,isComputedProp:I8,isFlow:Ps,isFlowCancellationError:mC,isObservable:Kh,isObservableArray:Jr,isObservableMap:Lr,isObservableObject:Or,isObservableProp:j8,isObservableSet:Xr,keys:hc,makeAutoObservable:MC,makeObservable:Cy,observable:kt,observe:Yh,onBecomeObserved:T8,onBecomeUnobserved:wy,onReactionError:eC,override:ix,ownKeys:B8,reaction:C8,remove:EC,runInAction:Os,set:Py,spy:w8,toJS:CC,trace:TC,transaction:Ii,untracked:by,values:Oy,when:nm},Symbol.toStringTag,{value:"Module"}));if(!et.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!Cy)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function KC(e){e()}function Z8(e){e||(e=KC),A8({reactionScheduler:e})}var YC=function(){return!0};function XC(e){return R8(e)}var Q8=!1;function J8(e){Q8=e}function My(){return Q8}var ZC=1e4,QC=1e4,JC=function(){function e(t){var r=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=ZC),clearTimeout(r.sweepTimeout),r.sweepTimeout=void 0;var i=Date.now();r.registrations.forEach(function(a,o){i-a.registeredAt>=n&&(r.finalize(a.value),r.registrations.delete(o))}),r.registrations.size>0&&r.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){r.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){this.registrations.set(n,{value:r,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.registrations.delete(t)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,QC))}}),e}(),eT=typeof FinalizationRegistry<"u"?FinalizationRegistry:JC,hh=new eT(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),e9={exports:{}},t9={};/**
|
|
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 xs=et;function tT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rT=typeof Object.is=="function"?Object.is:tT,nT=xs.useState,iT=xs.useEffect,aT=xs.useLayoutEffect,oT=xs.useDebugValue;function lT(e,t){var r=t(),n=nT({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return aT(function(){i.value=r,i.getSnapshot=t,B1(i)&&a({inst:i})},[e,r,t]),iT(function(){return B1(i)&&a({inst:i}),e(function(){B1(i)&&a({inst:i})})},[e]),oT(r),r}function B1(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!rT(e,r)}catch{return!0}}function sT(e,t){return t()}var uT=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?sT:lT;t9.useSyncExternalStore=xs.useSyncExternalStore!==void 0?xs.useSyncExternalStore:uT;e9.exports=t9;var cT=e9.exports;function P5(e){e.reaction=new Ss("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function Ly(e,t){if(t===void 0&&(t="observed"),My())return e();var r=ht.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(l){return hh.unregister(n),n.onStoreChange=l,n.reaction||(P5(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||(P5(i),hh.register(r,i,i)),ht.useDebugValue(i.reaction,XC),cT.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var a,o;if(i.reaction.track(function(){try{a=e()}catch(l){o=l}}),o)throw o;return a}var U1,H1,r9=typeof Symbol=="function"&&Symbol.for,fT=(H1=(U1=Object.getOwnPropertyDescriptor(function(){},"name"))===null||U1===void 0?void 0:U1.configurable)!==null&&H1!==void 0?H1:!1,x5=r9?Symbol.for("react.forward_ref"):typeof et.forwardRef=="function"&&et.forwardRef(function(e){return null}).$$typeof,C5=r9?Symbol.for("react.memo"):typeof et.memo=="function"&&et.memo(function(e){return null}).$$typeof;function dT(e,t){var r;if(C5&&e.$$typeof===C5)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(My())return e;var n=(r=t==null?void 0:t.forwardRef)!==null&&r!==void 0?r:!1,i=e,a=e.displayName||e.name;if(x5&&e.$$typeof===x5&&(n=!0,i=e.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(l,u){return Ly(function(){return i(l,u)},a)};return o.displayName=e.displayName,fT&&Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),n&&(o=et.forwardRef(o)),o=et.memo(o),pT(e,o),o}var hT={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function pT(e,t){Object.keys(e).forEach(function(r){hT[r]||Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}function n9(e){var t=e.children,r=e.render,n=t||r;return typeof n!="function"?null:Ly(n)}n9.displayName="Observer";function gT(e,t){return et.useState(function(){return kt(e(),t,{autoBind:!0})})[0]}function i9(e){var t=et.useState(function(){return kt(e,{},{deep:!1})})[0];return Os(function(){Object.assign(t,e)}),t}function vT(e,t){var r=t&&i9(t);return et.useState(function(){return kt(e(r),void 0,{autoBind:!0})})[0]}var $1;Z8(Hw.unstable_batchedUpdates);var mT=($1=hh.finalizeAllImmediately)!==null&&$1!==void 0?$1:function(){};function yT(e,t){return t===void 0&&(t="observed"),Ly(e,t)}function bT(e){J8(e)}const _T=Object.freeze(Object.defineProperty({__proto__:null,Observer:n9,_observerFinalizationRegistry:hh,clearTimers:mT,enableStaticRendering:J8,isObserverBatched:YC,isUsingStaticRendering:My,observer:dT,observerBatching:Z8,useAsObservableSource:i9,useLocalObservable:gT,useLocalStore:vT,useObserver:yT,useStaticRendering:bT},Symbol.toStringTag,{value:"Module"})),yi=fo(_T);var a9={};const Wi=fo(WC);var Ny={exports:{}},Zh={},ph={},st={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const t=Math.PI/180;function r(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof ye<"u"?ye:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.12",isBrowser:r(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return e.Konva.angleDeg?i*t:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var i;return(i=e.Konva.Transformer)===null||i===void 0?void 0:i.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(i){e.glob.Konva=i}};const n=i=>{e.Konva[i.prototype.getClassName()]=i};e._registerNode=n,e.Konva._injectGlobal(e.Konva)})(st);var Xt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=st;class r{constructor(b=[1,0,0,1,0,0]){this.dirty=!1,this.m=b&&b.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new r(this.m)}copyInto(b){b.m[0]=this.m[0],b.m[1]=this.m[1],b.m[2]=this.m[2],b.m[3]=this.m[3],b.m[4]=this.m[4],b.m[5]=this.m[5]}point(b){var O=this.m;return{x:O[0]*b.x+O[2]*b.y+O[4],y:O[1]*b.x+O[3]*b.y+O[5]}}translate(b,O){return this.m[4]+=this.m[0]*b+this.m[2]*O,this.m[5]+=this.m[1]*b+this.m[3]*O,this}scale(b,O){return this.m[0]*=b,this.m[1]*=b,this.m[2]*=O,this.m[3]*=O,this}rotate(b){var O=Math.cos(b),R=Math.sin(b),T=this.m[0]*O+this.m[2]*R,E=this.m[1]*O+this.m[3]*R,P=this.m[0]*-R+this.m[2]*O,x=this.m[1]*-R+this.m[3]*O;return this.m[0]=T,this.m[1]=E,this.m[2]=P,this.m[3]=x,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(b,O){var R=this.m[0]+this.m[2]*O,T=this.m[1]+this.m[3]*O,E=this.m[2]+this.m[0]*b,P=this.m[3]+this.m[1]*b;return this.m[0]=R,this.m[1]=T,this.m[2]=E,this.m[3]=P,this}multiply(b){var O=this.m[0]*b.m[0]+this.m[2]*b.m[1],R=this.m[1]*b.m[0]+this.m[3]*b.m[1],T=this.m[0]*b.m[2]+this.m[2]*b.m[3],E=this.m[1]*b.m[2]+this.m[3]*b.m[3],P=this.m[0]*b.m[4]+this.m[2]*b.m[5]+this.m[4],x=this.m[1]*b.m[4]+this.m[3]*b.m[5]+this.m[5];return this.m[0]=O,this.m[1]=R,this.m[2]=T,this.m[3]=E,this.m[4]=P,this.m[5]=x,this}invert(){var b=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),O=this.m[3]*b,R=-this.m[1]*b,T=-this.m[2]*b,E=this.m[0]*b,P=b*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),x=b*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=O,this.m[1]=R,this.m[2]=T,this.m[3]=E,this.m[4]=P,this.m[5]=x,this}getMatrix(){return this.m}decompose(){var b=this.m[0],O=this.m[1],R=this.m[2],T=this.m[3],E=this.m[4],P=this.m[5],x=b*T-O*R;let k={x:E,y:P,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(b!=0||O!=0){var M=Math.sqrt(b*b+O*O);k.rotation=O>0?Math.acos(b/M):-Math.acos(b/M),k.scaleX=M,k.scaleY=x/M,k.skewX=(b*R+O*T)/x,k.skewY=0}else if(R!=0||T!=0){var j=Math.sqrt(R*R+T*T);k.rotation=Math.PI/2-(T>0?Math.acos(-R/j):-Math.acos(R/j)),k.scaleX=x/j,k.scaleY=j,k.skewX=0,k.skewY=(b*R+O*T)/x}return k.rotation=e.Util._getRotation(k.rotation),k}}e.Transform=r;var n="[object Array]",i="[object Number]",a="[object String]",o="[object Boolean]",l=Math.PI/180,u=180/Math.PI,f="#",g="",S="0",_="Konva warning: ",h="Konva error: ",w="rgb(",m={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},y=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,p=[];const v=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(d){setTimeout(d,60)};e.Util={_isElement(d){return!!(d&&d.nodeType==1)},_isFunction(d){return!!(d&&d.constructor&&d.call&&d.apply)},_isPlainObject(d){return!!d&&d.constructor===Object},_isArray(d){return Object.prototype.toString.call(d)===n},_isNumber(d){return Object.prototype.toString.call(d)===i&&!isNaN(d)&&isFinite(d)},_isString(d){return Object.prototype.toString.call(d)===a},_isBoolean(d){return Object.prototype.toString.call(d)===o},isObject(d){return d instanceof Object},isValidSelector(d){if(typeof d!="string")return!1;var b=d[0];return b==="#"||b==="."||b===b.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){p.push(d),p.length===1&&v(function(){const b=p;p=[],b.forEach(function(O){O()})})},createCanvasElement(){var d=document.createElement("canvas");try{d.style=d.style||{}}catch{}return d},createImageElement(){return document.createElement("img")},_isInDocument(d){for(;d=d.parentNode;)if(d==document)return!0;return!1},_urlToImage(d,b){var O=e.Util.createImageElement();O.onload=function(){b(O)},O.src=d},_rgbToHex(d,b,O){return((1<<24)+(d<<16)+(b<<8)+O).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,g);var b=parseInt(d,16);return{r:b>>16&255,g:b>>8&255,b:b&255}},getRandomColor(){for(var d=(Math.random()*16777215<<0).toString(16);d.length<6;)d=S+d;return f+d},getRGB(d){var b;return d in m?(b=m[d],{r:b[0],g:b[1],b:b[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===w?(b=y.exec(d.replace(/ /g,"")),{r:parseInt(b[1],10),g:parseInt(b[2],10),b:parseInt(b[3],10)}):{r:0,g:0,b:0}},colorToRGBA(d){return d=d||"black",e.Util._namedColorToRBA(d)||e.Util._hex3ColorToRGBA(d)||e.Util._hex4ColorToRGBA(d)||e.Util._hex6ColorToRGBA(d)||e.Util._hex8ColorToRGBA(d)||e.Util._rgbColorToRGBA(d)||e.Util._rgbaColorToRGBA(d)||e.Util._hslColorToRGBA(d)},_namedColorToRBA(d){var b=m[d.toLowerCase()];return b?{r:b[0],g:b[1],b:b[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];var b=d.split(/ *, */).map(Number);return{r:b[0],g:b[1],b:b[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];var b=d.split(/ *, */).map((O,R)=>O.slice(-1)==="%"?R===3?parseInt(O)/100:parseInt(O)/100*255:Number(O));return{r:b[0],g:b[1],b:b[2],a:b[3]}}},_hex8ColorToRGBA(d){if(d[0]==="#"&&d.length===9)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:parseInt(d.slice(7,9),16)/255}},_hex6ColorToRGBA(d){if(d[0]==="#"&&d.length===7)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:1}},_hex4ColorToRGBA(d){if(d[0]==="#"&&d.length===5)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:parseInt(d[4]+d[4],16)/255}},_hex3ColorToRGBA(d){if(d[0]==="#"&&d.length===4)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:1}},_hslColorToRGBA(d){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(d)){const[b,...O]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),R=Number(O[0])/360,T=Number(O[1])/100,E=Number(O[2])/100;let P,x,k;if(T===0)return k=E*255,{r:Math.round(k),g:Math.round(k),b:Math.round(k),a:1};E<.5?P=E*(1+T):P=E+T-E*T;const M=2*E-P,j=[0,0,0];for(let B=0;B<3;B++)x=R+1/3*-(B-1),x<0&&x++,x>1&&x--,6*x<1?k=M+(P-M)*6*x:2*x<1?k=P:3*x<2?k=M+(P-M)*(2/3-x)*6:k=M,j[B]=k*255;return{r:Math.round(j[0]),g:Math.round(j[1]),b:Math.round(j[2]),a:1}}},haveIntersection(d,b){return!(b.x>d.x+d.width||b.x+b.width<d.x||b.y>d.y+d.height||b.y+b.height<d.y)},cloneObject(d){var b={};for(var O in d)this._isPlainObject(d[O])?b[O]=this.cloneObject(d[O]):this._isArray(d[O])?b[O]=this.cloneArray(d[O]):b[O]=d[O];return b},cloneArray(d){return d.slice(0)},degToRad(d){return d*l},radToDeg(d){return d*u},_degToRad(d){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(d)},_radToDeg(d){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(d)},_getRotation(d){return t.Konva.angleDeg?e.Util.radToDeg(d):d},_capitalize(d){return d.charAt(0).toUpperCase()+d.slice(1)},throw(d){throw new Error(h+d)},error(d){console.error(h+d)},warn(d){t.Konva.showWarnings&&console.warn(_+d)},each(d,b){for(var O in d)b(O,d[O])},_inRange(d,b,O){return b<=d&&d<O},_getProjectionToSegment(d,b,O,R,T,E){var P,x,k,M=(d-O)*(d-O)+(b-R)*(b-R);if(M==0)P=d,x=b,k=(T-O)*(T-O)+(E-R)*(E-R);else{var j=((T-d)*(O-d)+(E-b)*(R-b))/M;j<0?(P=d,x=b,k=(d-T)*(d-T)+(b-E)*(b-E)):j>1?(P=O,x=R,k=(O-T)*(O-T)+(R-E)*(R-E)):(P=d+j*(O-d),x=b+j*(R-b),k=(P-T)*(P-T)+(x-E)*(x-E))}return[P,x,k]},_getProjectionToLine(d,b,O){var R=e.Util.cloneObject(d),T=Number.MAX_VALUE;return b.forEach(function(E,P){if(!(!O&&P===b.length-1)){var x=b[(P+1)%b.length],k=e.Util._getProjectionToSegment(E.x,E.y,x.x,x.y,d.x,d.y),M=k[0],j=k[1],B=k[2];B<T&&(R.x=M,R.y=j,T=B)}}),R},_prepareArrayForTween(d,b,O){var R,T=[],E=[];if(d.length>b.length){var P=b;b=d,d=P}for(R=0;R<d.length;R+=2)T.push({x:d[R],y:d[R+1]});for(R=0;R<b.length;R+=2)E.push({x:b[R],y:b[R+1]});var x=[];return E.forEach(function(k){var M=e.Util._getProjectionToLine(k,T,O);x.push(M.x),x.push(M.y)}),x},_prepareToStringify(d){var b;d.visitedByCircularReferenceRemoval=!0;for(var O in d)if(d.hasOwnProperty(O)&&d[O]&&typeof d[O]=="object"){if(b=Object.getOwnPropertyDescriptor(d,O),d[O].visitedByCircularReferenceRemoval||e.Util._isElement(d[O]))if(b.configurable)delete d[O];else return null;else if(e.Util._prepareToStringify(d[O])===null)if(b.configurable)delete d[O];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,b){for(var O in b)d[O]=b[O];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){t.Konva.releaseCanvasOnDestroy&&d.forEach(b=>{b.width=0,b.height=0})},drawRoundedRectPath(d,b,O,R){let T=0,E=0,P=0,x=0;typeof R=="number"?T=E=P=x=Math.min(R,b/2,O/2):(T=Math.min(R[0]||0,b/2,O/2),E=Math.min(R[1]||0,b/2,O/2),x=Math.min(R[2]||0,b/2,O/2),P=Math.min(R[3]||0,b/2,O/2)),d.moveTo(T,0),d.lineTo(b-E,0),d.arc(b-E,E,E,Math.PI*3/2,0,!1),d.lineTo(b,O-x),d.arc(b-x,O-x,x,0,Math.PI/2,!1),d.lineTo(P,O),d.arc(P,O-P,P,Math.PI/2,Math.PI,!1),d.lineTo(0,T),d.arc(T,T,T,Math.PI,Math.PI*3/2,!1)}}})(Xt);var Gt={},ct={},We={};Object.defineProperty(We,"__esModule",{value:!0});We.getComponentValidator=We.getBooleanValidator=We.getNumberArrayValidator=We.getFunctionValidator=We.getStringOrGradientValidator=We.getStringValidator=We.getNumberOrAutoValidator=We.getNumberOrArrayOfNumbersValidator=We.getNumberValidator=We.alphaComponent=We.RGBComponent=void 0;const wa=st,Qt=Xt;function Sa(e){return Qt.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||Qt.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function wT(e){return e>255?255:e<0?0:Math.round(e)}We.RGBComponent=wT;function ST(e){return e>1?1:e<1e-4?1e-4:e}We.alphaComponent=ST;function ET(){if(wa.Konva.isUnminified)return function(e,t){return Qt.Util._isNumber(e)||Qt.Util.warn(Sa(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}We.getNumberValidator=ET;function OT(e){if(wa.Konva.isUnminified)return function(t,r){let n=Qt.Util._isNumber(t),i=Qt.Util._isArray(t)&&t.length==e;return!n&&!i&&Qt.Util.warn(Sa(t)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+e+")"),t}}We.getNumberOrArrayOfNumbersValidator=OT;function PT(){if(wa.Konva.isUnminified)return function(e,t){var r=Qt.Util._isNumber(e),n=e==="auto";return r||n||Qt.Util.warn(Sa(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}We.getNumberOrAutoValidator=PT;function xT(){if(wa.Konva.isUnminified)return function(e,t){return Qt.Util._isString(e)||Qt.Util.warn(Sa(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}We.getStringValidator=xT;function CT(){if(wa.Konva.isUnminified)return function(e,t){const r=Qt.Util._isString(e),n=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return r||n||Qt.Util.warn(Sa(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}We.getStringOrGradientValidator=CT;function TT(){if(wa.Konva.isUnminified)return function(e,t){return Qt.Util._isFunction(e)||Qt.Util.warn(Sa(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}We.getFunctionValidator=TT;function kT(){if(wa.Konva.isUnminified)return function(e,t){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&e instanceof r||(Qt.Util._isArray(e)?e.forEach(function(n){Qt.Util._isNumber(n)||Qt.Util.warn('"'+t+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):Qt.Util.warn(Sa(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}We.getNumberArrayValidator=kT;function AT(){if(wa.Konva.isUnminified)return function(e,t){var r=e===!0||e===!1;return r||Qt.Util.warn(Sa(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}We.getBooleanValidator=AT;function RT(e){if(wa.Konva.isUnminified)return function(t,r){return t==null||Qt.Util.isObject(t)||Qt.Util.warn(Sa(t)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+e),t}}We.getComponentValidator=RT;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=Xt,r=We;var n="get",i="set";e.Factory={addGetterSetter(a,o,l,u,f){e.Factory.addGetter(a,o,l),e.Factory.addSetter(a,o,u,f),e.Factory.addOverloadedGetterSetter(a,o)},addGetter(a,o,l){var u=n+t.Util._capitalize(o);a.prototype[u]=a.prototype[u]||function(){var f=this.attrs[o];return f===void 0?l:f}},addSetter(a,o,l,u){var f=i+t.Util._capitalize(o);a.prototype[f]||e.Factory.overWriteSetter(a,o,l,u)},overWriteSetter(a,o,l,u){var f=i+t.Util._capitalize(o);a.prototype[f]=function(g){return l&&g!==void 0&&g!==null&&(g=l.call(this,g,o)),this._setAttr(o,g),u&&u.call(this),this}},addComponentsGetterSetter(a,o,l,u,f){var g=l.length,S=t.Util._capitalize,_=n+S(o),h=i+S(o),w,m;a.prototype[_]=function(){var p={};for(w=0;w<g;w++)m=l[w],p[m]=this.getAttr(o+S(m));return p};var y=(0,r.getComponentValidator)(l);a.prototype[h]=function(p){var v=this.attrs[o],d;u&&(p=u.call(this,p)),y&&y.call(this,p,o);for(d in p)p.hasOwnProperty(d)&&this._setAttr(o+S(d),p[d]);return p||l.forEach(b=>{this._setAttr(o+S(b),void 0)}),this._fireChangeEvent(o,v,p),f&&f.call(this),this},e.Factory.addOverloadedGetterSetter(a,o)},addOverloadedGetterSetter(a,o){var l=t.Util._capitalize(o),u=i+l,f=n+l;a.prototype[o]=function(){return arguments.length?(this[u](arguments[0]),this):this[f]()}},addDeprecatedGetterSetter(a,o,l,u){t.Util.error("Adding deprecated "+o);var f=n+t.Util._capitalize(o),g=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[f]=function(){t.Util.error(g);var S=this.attrs[o];return S===void 0?l:S},e.Factory.addSetter(a,o,u,function(){t.Util.error(g)}),e.Factory.addOverloadedGetterSetter(a,o)},backCompat(a,o){t.Util.each(o,function(l,u){var f=a.prototype[u],g=n+t.Util._capitalize(l),S=i+t.Util._capitalize(l);function _(){f.apply(this,arguments),t.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}a.prototype[l]=_,a.prototype[g]=_,a.prototype[S]=_})},afterSetFilter(){this._filterUpToDate=!1}}})(ct);var pi={},da={};Object.defineProperty(da,"__esModule",{value:!0});da.HitContext=da.SceneContext=da.Context=void 0;const o9=Xt,MT=st;function LT(e){var t=[],r=e.length,n=o9.Util,i,a;for(i=0;i<r;i++)a=e[i],n._isNumber(a)?a=Math.round(a*1e3)/1e3:n._isString(a)||(a=a+""),t.push(a);return t}var T5=",",NT="(",IT=")",DT="([",jT="])",FT=";",zT="()",BT="=",k5=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],UT=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const HT=100;class Qh{constructor(t){this.canvas=t,MT.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,r){var n=this.traceArr,i=n.length,a="",o,l,u,f;for(o=0;o<i;o++)l=n[o],u=l.method,u?(f=l.args,a+=u,t?a+=zT:o9.Util._isArray(f[0])?a+=DT+f.join(T5)+jT:(r&&(f=f.map(g=>typeof g=="number"?Math.floor(g):g)),a+=NT+f.join(T5)+IT)):(a+=l.property,t||(a+=BT+l.val)),a+=FT;return a}clearTrace(){this.traceArr=[]}_trace(t){var r=this.traceArr,n;r.push(t),n=r.length,n>=HT&&r.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var r=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,r.getWidth()/r.pixelRatio,r.getHeight()/r.pixelRatio)}_applyLineCap(t){const r=t.attrs.lineCap;r&&this.setAttr("lineCap",r)}_applyOpacity(t){var r=t.getAbsoluteOpacity();r!==1&&this.setAttr("globalAlpha",r)}_applyLineJoin(t){const r=t.attrs.lineJoin;r&&this.setAttr("lineJoin",r)}setAttr(t,r){this._context[t]=r}arc(t,r,n,i,a,o){this._context.arc(t,r,n,i,a,o)}arcTo(t,r,n,i,a){this._context.arcTo(t,r,n,i,a)}beginPath(){this._context.beginPath()}bezierCurveTo(t,r,n,i,a,o){this._context.bezierCurveTo(t,r,n,i,a,o)}clearRect(t,r,n,i){this._context.clearRect(t,r,n,i)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,r){var n=arguments;if(n.length===2)return this._context.createImageData(t,r);if(n.length===1)return this._context.createImageData(t)}createLinearGradient(t,r,n,i){return this._context.createLinearGradient(t,r,n,i)}createPattern(t,r){return this._context.createPattern(t,r)}createRadialGradient(t,r,n,i,a,o){return this._context.createRadialGradient(t,r,n,i,a,o)}drawImage(t,r,n,i,a,o,l,u,f){var g=arguments,S=this._context;g.length===3?S.drawImage(t,r,n):g.length===5?S.drawImage(t,r,n,i,a):g.length===9&&S.drawImage(t,r,n,i,a,o,l,u,f)}ellipse(t,r,n,i,a,o,l,u){this._context.ellipse(t,r,n,i,a,o,l,u)}isPointInPath(t,r,n,i){return n?this._context.isPointInPath(n,t,r,i):this._context.isPointInPath(t,r,i)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,r,n,i){this._context.fillRect(t,r,n,i)}strokeRect(t,r,n,i){this._context.strokeRect(t,r,n,i)}fillText(t,r,n,i){i?this._context.fillText(t,r,n,i):this._context.fillText(t,r,n)}measureText(t){return this._context.measureText(t)}getImageData(t,r,n,i){return this._context.getImageData(t,r,n,i)}lineTo(t,r){this._context.lineTo(t,r)}moveTo(t,r){this._context.moveTo(t,r)}rect(t,r,n,i){this._context.rect(t,r,n,i)}roundRect(t,r,n,i,a){this._context.roundRect(t,r,n,i,a)}putImageData(t,r,n){this._context.putImageData(t,r,n)}quadraticCurveTo(t,r,n,i){this._context.quadraticCurveTo(t,r,n,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,r){this._context.scale(t,r)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,r,n,i,a,o){this._context.setTransform(t,r,n,i,a,o)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,r,n,i){this._context.strokeText(t,r,n,i)}transform(t,r,n,i,a,o){this._context.transform(t,r,n,i,a,o)}translate(t,r){this._context.translate(t,r)}_enableTrace(){var t=this,r=k5.length,n=this.setAttr,i,a,o=function(l){var u=t[l],f;t[l]=function(){return a=LT(Array.prototype.slice.call(arguments,0)),f=u.apply(t,arguments),t._trace({method:l,args:a}),f}};for(i=0;i<r;i++)o(k5[i]);t.setAttr=function(){n.apply(t,arguments);var l=arguments[0],u=arguments[1];(l==="shadowOffsetX"||l==="shadowOffsetY"||l==="shadowBlur")&&(u=u/this.canvas.getPixelRatio()),t._trace({property:l,val:u})}}_applyGlobalCompositeOperation(t){const r=t.attrs.globalCompositeOperation;var n=!r||r==="source-over";n||this.setAttr("globalCompositeOperation",r)}}da.Context=Qh;UT.forEach(function(e){Object.defineProperty(Qh.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class $T extends Qh{constructor(t,{willReadFrequently:r=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:r})}_fillColor(t){var r=t.fill();this.setAttr("fillStyle",r),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var r=t._getLinearGradient();r&&(this.setAttr("fillStyle",r),t._fillFunc(this))}_fillRadialGradient(t){const r=t._getRadialGradient();r&&(this.setAttr("fillStyle",r),t._fillFunc(this))}_fill(t){const r=t.fill(),n=t.getFillPriority();if(r&&n==="color"){this._fillColor(t);return}const i=t.getFillPatternImage();if(i&&n==="pattern"){this._fillPattern(t);return}const a=t.getFillLinearGradientColorStops();if(a&&n==="linear-gradient"){this._fillLinearGradient(t);return}const o=t.getFillRadialGradientColorStops();if(o&&n==="radial-gradient"){this._fillRadialGradient(t);return}r?this._fillColor(t):i?this._fillPattern(t):a?this._fillLinearGradient(t):o&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const r=t.getStrokeLinearGradientStartPoint(),n=t.getStrokeLinearGradientEndPoint(),i=t.getStrokeLinearGradientColorStops(),a=this.createLinearGradient(r.x,r.y,n.x,n.y);if(i){for(var o=0;o<i.length;o+=2)a.addColorStop(i[o],i[o+1]);this.setAttr("strokeStyle",a)}}_stroke(t){var r=t.dash(),n=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!n){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t),r&&t.dashEnabled()&&(this.setLineDash(r),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var a=t.getStrokeLinearGradientColorStops();a?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),n||this.restore()}}_applyShadow(t){var r,n,i,a=(r=t.getShadowRGBA())!==null&&r!==void 0?r:"black",o=(n=t.getShadowBlur())!==null&&n!==void 0?n:5,l=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},u=t.getAbsoluteScale(),f=this.canvas.getPixelRatio(),g=u.x*f,S=u.y*f;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(g),Math.abs(S))),this.setAttr("shadowOffsetX",l.x*g),this.setAttr("shadowOffsetY",l.y*S)}}da.SceneContext=$T;class GT extends Qh{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const a=t.getStrokeScaleEnabled();if(!a){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t);var n=t.hitStrokeWidth(),i=n==="auto"?t.strokeWidth():n;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),a||this.restore()}}}da.HitContext=GT;Object.defineProperty(pi,"__esModule",{value:!0});pi.HitCanvas=pi.SceneCanvas=pi.Canvas=void 0;const gh=Xt,l9=da,s9=st,VT=ct,qT=We;var fd;function WT(){if(fd)return fd;var e=gh.Util.createCanvasElement(),t=e.getContext("2d");return fd=function(){var r=s9.Konva._global.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return r/n}(),gh.Util.releaseCanvas(e),fd}class Jh{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var r=t||{},n=r.pixelRatio||s9.Konva.pixelRatio||WT();this.pixelRatio=n,this._canvas=gh.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var r=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/r,this.getHeight()/r)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var r=this.pixelRatio,n=this.getContext()._context;n.scale(r,r)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var r=this.pixelRatio,n=this.getContext()._context;n.scale(r,r)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,r){this.setWidth(t||0),this.setHeight(r||0)}toDataURL(t,r){try{return this._canvas.toDataURL(t,r)}catch{try{return this._canvas.toDataURL()}catch(i){return gh.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}pi.Canvas=Jh;VT.Factory.addGetterSetter(Jh,"pixelRatio",void 0,(0,qT.getNumberValidator)());class KT extends Jh{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new l9.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}pi.SceneCanvas=KT;class YT extends Jh{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new l9.HitContext(this),this.setSize(t.width,t.height)}}pi.HitCanvas=YT;var ep={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=st,r=Xt;e.DD={get isDragging(){var n=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){var n;return e.DD._dragElements.forEach(i=>{n=i.node}),n},_dragElements:new Map,_drag(n){const i=[];e.DD._dragElements.forEach((a,o)=>{const{node:l}=a,u=l.getStage();u.setPointersPositions(n),a.pointerId===void 0&&(a.pointerId=r.Util._getFirstPointerId(n));const f=u._changedPointerPositions.find(_=>_.id===a.pointerId);if(f){if(a.dragStatus!=="dragging"){var g=l.dragDistance(),S=Math.max(Math.abs(f.x-a.startPointerPos.x),Math.abs(f.y-a.startPointerPos.y));if(S<g||(l.startDrag({evt:n}),!l.isDragging()))return}l._setDragPosition(n,a),i.push(l)}}),i.forEach(a=>{a.fire("dragmove",{type:"dragmove",target:a,evt:n},!0)})},_endDragBefore(n){const i=[];e.DD._dragElements.forEach(a=>{const{node:o}=a,l=o.getStage();if(n&&l.setPointersPositions(n),!l._changedPointerPositions.find(g=>g.id===a.pointerId))return;(a.dragStatus==="dragging"||a.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,a.dragStatus="stopped");const f=a.node.getLayer()||a.node instanceof t.Konva.Stage&&a.node;f&&i.indexOf(f)===-1&&i.push(f)}),i.forEach(a=>{a.draw()})},_endDragAfter(n){e.DD._dragElements.forEach((i,a)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:n},!0),i.dragStatus!=="dragging"&&e.DD._dragElements.delete(a)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(ep);Object.defineProperty(Gt,"__esModule",{value:!0});Gt.Node=void 0;const gt=Xt,jc=ct,xu=pi,Ba=st,Un=ep,rr=We;var Md="absoluteOpacity",dd="allEventListeners",ia="absoluteTransform",A5="absoluteScale",Fo="canvas",XT="Change",ZT="children",QT="konva",am="listening",R5="mouseenter",M5="mouseleave",L5="set",N5="Shape",Ld=" ",I5="stage",Ua="transform",JT="Stage",om="visible",ek=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Ld);let tk=1,ot=class lm{constructor(t){this._id=tk++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===Ua||t===ia)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,r){var n=this._cache.get(t),i=t===Ua||t===ia,a=n===void 0||i&&n.dirty===!0;return a&&(n=r.call(this),this._cache.set(t,n)),n}_calculate(t,r,n){if(!this._attachedDepsListeners.get(t)){const i=r.map(a=>a+"Change.konva").join(Ld);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get(Fo)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===ia&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Fo)){const{scene:t,filter:r,hit:n}=this._cache.get(Fo);gt.Util.releaseCanvas(t,r,n),this._cache.delete(Fo)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var r=t||{},n={};(r.x===void 0||r.y===void 0||r.width===void 0||r.height===void 0)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var i=Math.ceil(r.width||n.width),a=Math.ceil(r.height||n.height),o=r.pixelRatio,l=r.x===void 0?Math.floor(n.x):r.x,u=r.y===void 0?Math.floor(n.y):r.y,f=r.offset||0,g=r.drawBorder||!1,S=r.hitCanvasPixelRatio||1;if(!i||!a){gt.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const _=Math.abs(Math.round(n.x)-l)>.5?1:0,h=Math.abs(Math.round(n.y)-u)>.5?1:0;i+=f*2+_,a+=f*2+h,l-=f,u-=f;var w=new xu.SceneCanvas({pixelRatio:o,width:i,height:a}),m=new xu.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),y=new xu.HitCanvas({pixelRatio:S,width:i,height:a}),p=w.getContext(),v=y.getContext();return y.isCache=!0,w.isCache=!0,this._cache.delete(Fo),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(w.getContext()._context.imageSmoothingEnabled=!1,m.getContext()._context.imageSmoothingEnabled=!1),p.save(),v.save(),p.translate(-l,-u),v.translate(-l,-u),this._isUnderCache=!0,this._clearSelfAndDescendantCache(Md),this._clearSelfAndDescendantCache(A5),this.drawScene(w,this),this.drawHit(y,this),this._isUnderCache=!1,p.restore(),v.restore(),g&&(p.save(),p.beginPath(),p.rect(0,0,i,a),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set(Fo,{scene:w,filter:m,hit:y,x:l,y:u}),this._requestDraw(),this}isCached(){return this._cache.has(Fo)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,r){var n=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i=1/0,a=1/0,o=-1/0,l=-1/0,u=this.getAbsoluteTransform(r);return n.forEach(function(f){var g=u.point(f);i===void 0&&(i=o=g.x,a=l=g.y),i=Math.min(i,g.x),a=Math.min(a,g.y),o=Math.max(o,g.x),l=Math.max(l,g.y)}),{x:i,y:a,width:o-i,height:l-a}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const r=this._getCanvasCache();t.translate(r.x,r.y);var n=this._getCachedSceneCanvas(),i=n.pixelRatio;t.drawImage(n._canvas,0,0,n.width/i,n.height/i),t.restore()}_drawCachedHitCanvas(t){var r=this._getCanvasCache(),n=r.hit;t.save(),t.translate(r.x,r.y),t.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),r=this._getCanvasCache(),n=r.scene,i=r.filter,a=i.getContext(),o,l,u,f;if(t){if(!this._filterUpToDate){var g=n.pixelRatio;i.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio);try{for(o=t.length,a.clear(),a.drawImage(n._canvas,0,0,n.getWidth()/g,n.getHeight()/g),l=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++){if(f=t[u],typeof f!="function"){gt.Util.error("Filter should be type of function, but got "+typeof f+" instead. Please check correct filters");continue}f.call(this,l),a.putImageData(l,0,0)}}catch(S){gt.Util.error("Unable to apply filter. "+S.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return n}on(t,r){if(this._cache&&this._cache.delete(dd),arguments.length===3)return this._delegate.apply(this,arguments);var n=t.split(Ld),i=n.length,a,o,l,u,f;for(a=0;a<i;a++)o=n[a],l=o.split("."),u=l[0],f=l[1]||"",this.eventListeners[u]||(this.eventListeners[u]=[]),this.eventListeners[u].push({name:f,handler:r});return this}off(t,r){var n=(t||"").split(Ld),i=n.length,a,o,l,u,f,g;if(this._cache&&this._cache.delete(dd),!t)for(o in this.eventListeners)this._off(o);for(a=0;a<i;a++)if(l=n[a],u=l.split("."),f=u[0],g=u[1],f)this.eventListeners[f]&&this._off(f,g,r);else for(o in this.eventListeners)this._off(o,g,r);return this}dispatchEvent(t){var r={target:this,type:t.type,evt:t};return this.fire(t.type,r),this}addEventListener(t,r){return this.on(t,function(n){r.call(this,n.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,r,n){var i=this;this.on(t,function(a){for(var o=a.target.findAncestors(r,!0,i),l=0;l<o.length;l++)a=gt.Util.cloneObject(a),a.currentTarget=o[l],n.call(o[l],a)})}remove(){return this.isDragging()&&this.stopDrag(),Un.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(ia),this._clearSelfAndDescendantCache(Md),this._clearSelfAndDescendantCache(A5),this._clearSelfAndDescendantCache(I5),this._clearSelfAndDescendantCache(om),this._clearSelfAndDescendantCache(am)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var r="get"+gt.Util._capitalize(t);return gt.Util._isFunction(this[r])?this[r]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),r=[];t;)r.push(t),t=t.getParent();return r}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var r,n;if(!t)return this;for(r in t)r!==ZT&&(n=L5+gt.Util._capitalize(r),gt.Util._isFunction(this[n])?this[n](t[r]):this._setAttr(r,t[r]))}),this}isListening(){return this._getCache(am,this._isListening)}_isListening(t){if(!this.listening())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isListening(t):!0}isVisible(){return this._getCache(om,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isVisible(t):!0}shouldDrawHit(t,r=!1){if(t)return this._isVisible(t)&&this._isListening(t);var n=this.getLayer(),i=!1;Un.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(i=!0)});var a=!r&&!Ba.Konva.hitOnDragEnabled&&(i||Ba.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!a}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),r=this,n=0,i,a,o,l;function u(g){for(i=[],a=g.length,o=0;o<a;o++)l=g[o],n++,l.nodeType!==N5&&(i=i.concat(l.getChildren().slice())),l._id===r._id&&(o=a);i.length>0&&i[0].getDepth()<=t&&u(i)}const f=this.getStage();return r.nodeType!==JT&&f&&u(f.getChildren()),n}getDepth(){for(var t=0,r=this.parent;r;)t++,r=r.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Ua),this._clearSelfAndDescendantCache(ia)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;var r=t.getPointerPosition();if(!r)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(r)}getAbsolutePosition(t){let r=!1,n=this.parent;for(;n;){if(n.isCached()){r=!0;break}n=n.parent}r&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),a=new gt.Transform,o=this.offset();return a.m=i.slice(),a.translate(o.x,o.y),a.getTranslation()}setAbsolutePosition(t){const{x:r,y:n,...i}=this._clearTransform();this.attrs.x=r,this.attrs.y=n,this._clearCache(Ua);var a=this._getAbsoluteTransform().copy();return a.invert(),a.translate(t.x,t.y),t={x:this.attrs.x+a.getTranslation().x,y:this.attrs.y+a.getTranslation().y},this._setTransform(i),this.setPosition({x:t.x,y:t.y}),this._clearCache(Ua),this._clearSelfAndDescendantCache(ia),this}_setTransform(t){var r;for(r in t)this.attrs[r]=t[r]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var r=t.x,n=t.y,i=this.x(),a=this.y();return r!==void 0&&(i+=r),n!==void 0&&(a+=n),this.setPosition({x:i,y:a}),this}_eachAncestorReverse(t,r){var n=[],i=this.getParent(),a,o;if(!(r&&r._id===this._id)){for(n.unshift(this);i&&(!r||i._id!==r._id);)n.unshift(i),i=i.parent;for(a=n.length,o=0;o<a;o++)t(n[o])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return gt.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index,r=this.parent.getChildren().length;return t<r-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return gt.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,r=this.parent.getChildren().length;return t<r-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return gt.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return gt.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return gt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&>.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var r=this.index;return this.parent.children.splice(r,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Md,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),r=this.getParent();return r&&!r._isUnderCache&&(t*=r.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t=this.getAttrs(),r,n,i,a,o;const l={attrs:{},className:this.getClassName()};for(r in t)n=t[r],o=gt.Util.isObject(n)&&!gt.Util._isPlainObject(n)&&!gt.Util._isArray(n),!o&&(i=typeof this[r]=="function"&&this[r],delete t[r],a=i?i.call(this):null,t[r]=n,a!==n&&(l.attrs[r]=n));return gt.Util._prepareToStringify(l)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,r,n){var i=[];r&&this._isMatch(t)&&i.push(this);for(var a=this.parent;a;){if(a===n)return i;a._isMatch(t)&&i.push(a),a=a.parent}return i}isAncestorOf(t){return!1}findAncestor(t,r,n){return this.findAncestors(t,r,n)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var r=t.replace(/ /g,"").split(","),n=r.length,i,a;for(i=0;i<n;i++)if(a=r[i],gt.Util.isValidSelector(a)||(gt.Util.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),gt.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),gt.Util.warn("Konva is awesome, right?")),a.charAt(0)==="#"){if(this.id()===a.slice(1))return!0}else if(a.charAt(0)==="."){if(this.hasName(a.slice(1)))return!0}else if(this.className===a||this.nodeType===a)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(I5,this._getStage)}_getStage(){var t=this.getParent();return t?t.getStage():null}fire(t,r={},n){return r.target=r.target||this,n?this._fireAndBubble(t,r):this._fire(t,r),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(ia,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var r;if(t)return r=new gt.Transform,this._eachAncestorReverse(function(i){var a=i.transformsEnabled();a==="all"?r.multiply(i.getTransform()):a==="position"&&r.translate(i.x()-i.offsetX(),i.y()-i.offsetY())},t),r;r=this._cache.get(ia)||new gt.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(r):r.reset();var n=this.transformsEnabled();if(n==="all")r.multiply(this.getTransform());else if(n==="position"){const i=this.attrs.x||0,a=this.attrs.y||0,o=this.attrs.offsetX||0,l=this.attrs.offsetY||0;r.translate(i-o,a-l)}return r.dirty=!1,r}getAbsoluteScale(t){for(var r=this;r;)r._isUnderCache&&(t=r),r=r.getParent();const i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(Ua,this._getTransform)}_getTransform(){var t,r,n=this._cache.get(Ua)||new gt.Transform;n.reset();var i=this.x(),a=this.y(),o=Ba.Konva.getAngle(this.rotation()),l=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,u=(r=this.attrs.scaleY)!==null&&r!==void 0?r:1,f=this.attrs.skewX||0,g=this.attrs.skewY||0,S=this.attrs.offsetX||0,_=this.attrs.offsetY||0;return(i!==0||a!==0)&&n.translate(i,a),o!==0&&n.rotate(o),(f!==0||g!==0)&&n.skew(f,g),(l!==1||u!==1)&&n.scale(l,u),(S!==0||_!==0)&&n.translate(-1*S,-1*_),n.dirty=!1,n}clone(t){var r=gt.Util.cloneObject(this.attrs),n,i,a,o,l;for(n in t)r[n]=t[n];var u=new this.constructor(r);for(n in this.eventListeners)for(i=this.eventListeners[n],a=i.length,o=0;o<a;o++)l=i[o],l.name.indexOf(QT)<0&&(u.eventListeners[n]||(u.eventListeners[n]=[]),u.eventListeners[n].push(l));return u}_toKonvaCanvas(t){t=t||{};var r=this.getClientRect(),n=this.getStage(),i=t.x!==void 0?t.x:Math.floor(r.x),a=t.y!==void 0?t.y:Math.floor(r.y),o=t.pixelRatio||1,l=new xu.SceneCanvas({width:t.width||Math.ceil(r.width)||(n?n.width():0),height:t.height||Math.ceil(r.height)||(n?n.height():0),pixelRatio:o}),u=l.getContext();const f=new xu.SceneCanvas({width:l.width/l.pixelRatio+Math.abs(i),height:l.height/l.pixelRatio+Math.abs(a),pixelRatio:l.pixelRatio});return t.imageSmoothingEnabled===!1&&(u._context.imageSmoothingEnabled=!1),u.save(),(i||a)&&u.translate(-1*i,-1*a),this.drawScene(l,void 0,f),u.restore(),l}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var r=t.mimeType||null,n=t.quality||null,i=this._toKonvaCanvas(t).toDataURL(r,n);return t.callback&&t.callback(i),i}toImage(t){return new Promise((r,n)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,gt.Util._urlToImage(this.toDataURL(t),function(a){r(a),i==null||i(a)})}catch(i){n(i)}})}toBlob(t){return new Promise((r,n)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(a=>{r(a),i==null||i(a)},t==null?void 0:t.mimeType,t==null?void 0:t.quality)}catch(i){n(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Ba.Konva.dragDistance}_off(t,r,n){var i=this.eventListeners[t],a,o,l;for(a=0;a<i.length;a++)if(o=i[a].name,l=i[a].handler,(o!=="konva"||r==="konva")&&(!r||o===r)&&(!n||n===l)){if(i.splice(a,1),i.length===0){delete this.eventListeners[t];break}a--}}_fireChangeEvent(t,r,n){this._fire(t+XT,{oldVal:r,newVal:n})}addName(t){if(!this.hasName(t)){var r=this.name(),n=r?r+" "+t:t;this.name(n)}return this}hasName(t){if(!t)return!1;const r=this.name();if(!r)return!1;var n=(r||"").split(/\s/g);return n.indexOf(t)!==-1}removeName(t){var r=(this.name()||"").split(/\s/g),n=r.indexOf(t);return n!==-1&&(r.splice(n,1),this.name(r.join(" "))),this}setAttr(t,r){var n=this[L5+gt.Util._capitalize(t)];return gt.Util._isFunction(n)?n.call(this,r):this._setAttr(t,r),this}_requestDraw(){if(Ba.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,r){var n=this.attrs[t];n===r&&!gt.Util.isObject(r)||(r==null?delete this.attrs[t]:this.attrs[t]=r,this._shouldFireChangeEvents&&this._fireChangeEvent(t,n,r),this._requestDraw())}_setComponentAttr(t,r,n){var i;n!==void 0&&(i=this.attrs[t],i||(this.attrs[t]=this.getAttr(t)),this.attrs[t][r]=n,this._fireChangeEvent(t,i,n))}_fireAndBubble(t,r,n){r&&this.nodeType===N5&&(r.target=this);var i=(t===R5||t===M5)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n);if(!i){this._fire(t,r);var a=(t===R5||t===M5)&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(r&&!r.cancelBubble||!r)&&this.parent&&this.parent.isListening()&&!a&&(n&&n.parent?this._fireAndBubble.call(this.parent,t,r,n):this._fireAndBubble.call(this.parent,t,r))}}_getProtoListeners(t){var r,n,i;const a=(r=this._cache.get(dd))!==null&&r!==void 0?r:{};let o=a==null?void 0:a[t];if(o===void 0){o=[];let l=Object.getPrototypeOf(this);for(;l;){const u=(i=(n=l.eventListeners)===null||n===void 0?void 0:n[t])!==null&&i!==void 0?i:[];o.push(...u),l=Object.getPrototypeOf(l)}a[t]=o,this._cache.set(dd,a)}return o}_fire(t,r){r=r||{},r.currentTarget=this,r.type=t;const n=this._getProtoListeners(t);if(n)for(var i=0;i<n.length;i++)n[i].handler.call(this,r);const a=this.eventListeners[t];if(a)for(var i=0;i<a.length;i++)a[i].handler.call(this,r)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var r=t?t.pointerId:void 0,n=this.getStage(),i=this.getAbsolutePosition();if(n){var a=n._getPointerById(r)||n._changedPointerPositions[0]||i;Un.DD._dragElements.set(this._id,{node:this,startPointerPos:a,offset:{x:a.x-i.x,y:a.y-i.y},dragStatus:"ready",pointerId:r})}}startDrag(t,r=!0){Un.DD._dragElements.has(this._id)||this._createDragElement(t);const n=Un.DD._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},r)}_setDragPosition(t,r){const n=this.getStage()._getPointerById(r.pointerId);if(n){var i={x:n.x-r.offset.x,y:n.y-r.offset.y},a=this.dragBoundFunc();if(a!==void 0){const o=a.call(this,i,t);o?i=o:gt.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}}stopDrag(t){const r=Un.DD._dragElements.get(this._id);r&&(r.dragStatus="stopped"),Un.DD._endDragBefore(t),Un.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=Un.DD._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){var r=t.evt.button!==void 0,n=!r||Ba.Konva.dragButtons.indexOf(t.evt.button)>=0;if(n&&!this.isDragging()){var i=!1;Un.DD._dragElements.forEach(a=>{this.isAncestorOf(a.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const r=Un.DD._dragElements.get(this._id),n=r&&r.dragStatus==="dragging",i=r&&r.dragStatus==="ready";n?this.stopDrag():i&&Un.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const r=this.getStage();if(!r)return!1;const n={x:-t.x,y:-t.y,width:r.width()+2*t.x,height:r.height()+2*t.y};return gt.Util.haveIntersection(n,this.getClientRect())}static create(t,r){return gt.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,r)}static _createNode(t,r){var n=lm.prototype.getClassName.call(t),i=t.children,a,o,l;r&&(t.attrs.container=r),Ba.Konva[n]||(gt.Util.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=Ba.Konva[n];if(a=new u(t.attrs),i)for(o=i.length,l=0;l<o;l++)a.add(lm._createNode(i[l]));return a}};Gt.Node=ot;ot.prototype.nodeType="Node";ot.prototype._attrsAffectingSize=[];ot.prototype.eventListeners={};ot.prototype.on.call(ot.prototype,ek,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Ua),this._clearSelfAndDescendantCache(ia)});ot.prototype.on.call(ot.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(om)});ot.prototype.on.call(ot.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(am)});ot.prototype.on.call(ot.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(Md)});const Rt=jc.Factory.addGetterSetter;Rt(ot,"zIndex");Rt(ot,"absolutePosition");Rt(ot,"position");Rt(ot,"x",0,(0,rr.getNumberValidator)());Rt(ot,"y",0,(0,rr.getNumberValidator)());Rt(ot,"globalCompositeOperation","source-over",(0,rr.getStringValidator)());Rt(ot,"opacity",1,(0,rr.getNumberValidator)());Rt(ot,"name","",(0,rr.getStringValidator)());Rt(ot,"id","",(0,rr.getStringValidator)());Rt(ot,"rotation",0,(0,rr.getNumberValidator)());jc.Factory.addComponentsGetterSetter(ot,"scale",["x","y"]);Rt(ot,"scaleX",1,(0,rr.getNumberValidator)());Rt(ot,"scaleY",1,(0,rr.getNumberValidator)());jc.Factory.addComponentsGetterSetter(ot,"skew",["x","y"]);Rt(ot,"skewX",0,(0,rr.getNumberValidator)());Rt(ot,"skewY",0,(0,rr.getNumberValidator)());jc.Factory.addComponentsGetterSetter(ot,"offset",["x","y"]);Rt(ot,"offsetX",0,(0,rr.getNumberValidator)());Rt(ot,"offsetY",0,(0,rr.getNumberValidator)());Rt(ot,"dragDistance",null,(0,rr.getNumberValidator)());Rt(ot,"width",0,(0,rr.getNumberValidator)());Rt(ot,"height",0,(0,rr.getNumberValidator)());Rt(ot,"listening",!0,(0,rr.getBooleanValidator)());Rt(ot,"preventDefault",!0,(0,rr.getBooleanValidator)());Rt(ot,"filters",null,function(e){return this._filterUpToDate=!1,e});Rt(ot,"visible",!0,(0,rr.getBooleanValidator)());Rt(ot,"transformsEnabled","all",(0,rr.getStringValidator)());Rt(ot,"size");Rt(ot,"dragBoundFunc");Rt(ot,"draggable",!1,(0,rr.getBooleanValidator)());jc.Factory.backCompat(ot,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var hl={};Object.defineProperty(hl,"__esModule",{value:!0});hl.Container=void 0;const Us=ct,G1=Gt,tp=We;class pl extends G1.Node{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const r=this.children||[];var n=[];return r.forEach(function(i){t(i)&&n.push(i)}),n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(var r=0;r<t.length;r++)this.add(t[r]);return this}const n=t[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){var r=this._generalFind(t,!0);return r.length>0?r[0]:void 0}_generalFind(t,r){var n=[];return this._descendants(i=>{const a=i._isMatch(t);return a&&n.push(i),!!(a&&r)}),n}_descendants(t){let r=!1;const n=this.getChildren();for(const i of n){if(r=t(i),r)return!0;if(i.hasChildren()&&(r=i._descendants(t),r))return!0}return!1}toObject(){var t=G1.Node.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(r=>{t.children.push(r.toObject())}),t}isAncestorOf(t){for(var r=t.getParent();r;){if(r._id===this._id)return!0;r=r.getParent()}return!1}clone(t){var r=G1.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(n){r.add(n.clone())}),r}getAllIntersections(t){var r=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(t)&&r.push(n)}),r}_clearSelfAndDescendantCache(t){var r;super._clearSelfAndDescendantCache(t),!this.isCached()&&((r=this.children)===null||r===void 0||r.forEach(function(n){n._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(r,n){r.index=n}),this._requestDraw()}drawScene(t,r,n){var i=this.getLayer(),a=t||i&&i.getCanvas(),o=a&&a.getContext(),l=this._getCanvasCache(),u=l&&l.scene,f=a&&a.isCache;if(!this.isVisible()&&!f)return this;if(u){o.save();var g=this.getAbsoluteTransform(r).getMatrix();o.transform(g[0],g[1],g[2],g[3],g[4],g[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",a,r,n);return this}drawHit(t,r){if(!this.shouldDrawHit(r))return this;var n=this.getLayer(),i=t||n&&n.hitCanvas,a=i&&i.getContext(),o=this._getCanvasCache(),l=o&&o.hit;if(l){a.save();var u=this.getAbsoluteTransform(r).getMatrix();a.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",i,r);return this}_drawChildren(t,r,n,i){var a,o=r&&r.getContext(),l=this.clipWidth(),u=this.clipHeight(),f=this.clipFunc(),g=typeof l=="number"&&typeof u=="number"||f;const S=n===this;if(g){o.save();var _=this.getAbsoluteTransform(n),h=_.getMatrix();o.transform(h[0],h[1],h[2],h[3],h[4],h[5]),o.beginPath();let p;if(f)p=f.call(this,o,this);else{var w=this.clipX(),m=this.clipY();o.rect(w||0,m||0,l,u)}o.clip.apply(o,p),h=_.copy().invert().getMatrix(),o.transform(h[0],h[1],h[2],h[3],h[4],h[5])}var y=!S&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";y&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(p){p[t](r,n,i)}),y&&o.restore(),g&&o.restore()}getClientRect(t={}){var r,n=t.skipTransform,i=t.relativeTo,a,o,l,u,f={x:1/0,y:1/0,width:0,height:0},g=this;(r=this.children)===null||r===void 0||r.forEach(function(m){if(m.visible()){var y=m.getClientRect({relativeTo:g,skipShadow:t.skipShadow,skipStroke:t.skipStroke});y.width===0&&y.height===0||(a===void 0?(a=y.x,o=y.y,l=y.x+y.width,u=y.y+y.height):(a=Math.min(a,y.x),o=Math.min(o,y.y),l=Math.max(l,y.x+y.width),u=Math.max(u,y.y+y.height)))}});for(var S=this.find("Shape"),_=!1,h=0;h<S.length;h++){var w=S[h];if(w._isVisible(this)){_=!0;break}}return _&&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)}}hl.Container=pl;Us.Factory.addComponentsGetterSetter(pl,"clip",["x","y","width","height"]);Us.Factory.addGetterSetter(pl,"clipX",void 0,(0,tp.getNumberValidator)());Us.Factory.addGetterSetter(pl,"clipY",void 0,(0,tp.getNumberValidator)());Us.Factory.addGetterSetter(pl,"clipWidth",void 0,(0,tp.getNumberValidator)());Us.Factory.addGetterSetter(pl,"clipHeight",void 0,(0,tp.getNumberValidator)());Us.Factory.addGetterSetter(pl,"clipFunc");var u9={},Pn={};Object.defineProperty(Pn,"__esModule",{value:!0});Pn.releaseCapture=Pn.setPointerCapture=Pn.hasPointerCapture=Pn.createEvent=Pn.getCapturedShape=void 0;const rk=st,gc=new Map,c9=rk.Konva._global.PointerEvent!==void 0;function nk(e){return gc.get(e)}Pn.getCapturedShape=nk;function Iy(e){return{evt:e,pointerId:e.pointerId}}Pn.createEvent=Iy;function ik(e,t){return gc.get(e)===t}Pn.hasPointerCapture=ik;function ak(e,t){f9(e),t.getStage()&&(gc.set(e,t),c9&&t._fire("gotpointercapture",Iy(new PointerEvent("gotpointercapture"))))}Pn.setPointerCapture=ak;function f9(e,t){const r=gc.get(e);if(!r)return;const n=r.getStage();n&&n.content,gc.delete(e),c9&&r._fire("lostpointercapture",Iy(new PointerEvent("lostpointercapture")))}Pn.releaseCapture=f9;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=Xt,r=ct,n=hl,i=st,a=pi,o=ep,l=st,u=Pn;var f="Stage",g="string",S="px",_="mouseout",h="mouseleave",w="mouseover",m="mouseenter",y="mousemove",p="mousedown",v="mouseup",d="pointermove",b="pointerdown",O="pointerup",R="pointercancel",T="lostpointercapture",E="pointerout",P="pointerleave",x="pointerover",k="pointerenter",M="contextmenu",j="touchstart",B="touchend",$="touchmove",Z="touchcancel",K="wheel",D=5,q=[[m,"_pointerenter"],[p,"_pointerdown"],[y,"_pointermove"],[v,"_pointerup"],[h,"_pointerleave"],[j,"_pointerdown"],[$,"_pointermove"],[B,"_pointerup"],[Z,"_pointercancel"],[w,"_pointerover"],[K,"_wheel"],[M,"_contextmenu"],[b,"_pointerdown"],[d,"_pointermove"],[O,"_pointerup"],[R,"_pointercancel"],[T,"_lostpointercapture"]];const A={mouse:{[E]:_,[P]:h,[x]:w,[k]:m,[d]:y,[b]:p,[O]:v,[R]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[E]:"touchout",[P]:"touchleave",[x]:"touchover",[k]:"touchenter",[d]:$,[b]:j,[O]:B,[R]:Z,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[E]:E,[P]:P,[x]:x,[k]:k,[d]:d,[b]:b,[O]:O,[R]:R,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},L=V=>V.indexOf("pointer")>=0?"pointer":V.indexOf("touch")>=0?"touch":"mouse",z=V=>{const U=L(V);if(U==="pointer")return i.Konva.pointerEventsEnabled&&A.pointer;if(U==="touch")return A.touch;if(U==="mouse")return A.mouse};function I(V={}){return(V.clipFunc||V.clipWidth||V.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),V}const 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);";e.stages=[];class W extends n.Container{constructor(U){super(I(U)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{I(this.attrs)}),this._checkVisibility()}_validateAdd(U){const Y=U.getType()==="Layer",X=U.getType()==="FastLayer";Y||X||t.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===g){if(U.charAt(0)==="."){var Y=U.slice(1);U=document.getElementsByClassName(Y)[0]}else{var X;U.charAt(0)!=="#"?X=U:X=U.slice(1),U=document.getElementById(X)}if(!U)throw"Can not find container in document with id "+X}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,Y=U.length,X;for(X=0;X<Y;X++)U[X].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&&t.Util._isInDocument(U)&&this.container().removeChild(U);var Y=e.stages.indexOf(this);return Y>-1&&e.stages.splice(Y,1),t.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}:(t.Util.warn(H),null)}_getPointerById(U){return this._pointerPositions.find(Y=>Y.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 Y=new a.SceneCanvas({width:U.width,height:U.height,pixelRatio:U.pixelRatio||1}),X=Y.getContext()._context,Q=this.children;return(U.x||U.y)&&X.translate(-1*U.x,-1*U.y),Q.forEach(function(te){if(te.isVisible()){var ee=te._toKonvaCanvas(U);X.drawImage(ee._canvas,U.x,U.y,ee.getWidth()/ee.getPixelRatio(),ee.getHeight()/ee.getPixelRatio())}}),Y}getIntersection(U){if(!U)return null;var Y=this.children,X=Y.length,Q=X-1,te;for(te=Q;te>=0;te--){const ee=Y[te].getIntersection(U);if(ee)return ee}return null}_resizeDOM(){var U=this.width(),Y=this.height();this.content&&(this.content.style.width=U+S,this.content.style.height=Y+S),this.bufferCanvas.setSize(U,Y),this.bufferHitCanvas.setSize(U,Y),this.children.forEach(X=>{X.setSize({width:U,height:Y}),X.draw()})}add(U,...Y){if(arguments.length>1){for(var X=0;X<arguments.length;X++)this.add(arguments[X]);return this}super.add(U);var Q=this.children.length;return Q>D&&t.Util.warn("The stage has "+Q+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),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&&q.forEach(([U,Y])=>{this.content.addEventListener(U,X=>{this[Y](X)},{passive:!1})})}_pointerenter(U){this.setPointersPositions(U);const Y=z(U.type);Y&&this._fire(Y.pointerenter,{evt:U,target:this,currentTarget:this})}_pointerover(U){this.setPointersPositions(U);const Y=z(U.type);Y&&this._fire(Y.pointerover,{evt:U,target:this,currentTarget:this})}_getTargetShape(U){let Y=this[U+"targetShape"];return Y&&!Y.getStage()&&(Y=null),Y}_pointerleave(U){const Y=z(U.type),X=L(U.type);if(Y){this.setPointersPositions(U);var Q=this._getTargetShape(X),te=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;Q&&te?(Q._fireAndBubble(Y.pointerout,{evt:U}),Q._fireAndBubble(Y.pointerleave,{evt:U}),this._fire(Y.pointerleave,{evt:U,target:this,currentTarget:this}),this[X+"targetShape"]=null):te&&(this._fire(Y.pointerleave,{evt:U,target:this,currentTarget:this}),this._fire(Y.pointerout,{evt:U,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(U){const Y=z(U.type),X=L(U.type);if(Y){this.setPointersPositions(U);var Q=!1;this._changedPointerPositions.forEach(te=>{var ee=this.getIntersection(te);if(o.DD.justDragged=!1,i.Konva["_"+X+"ListenClick"]=!0,!ee||!ee.isListening()){this[X+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&ee.setPointerCapture(te.id),this[X+"ClickStartShape"]=ee,ee._fireAndBubble(Y.pointerdown,{evt:U,pointerId:te.id}),Q=!0;const ne=U.type.indexOf("touch")>=0;ee.preventDefault()&&U.cancelable&&ne&&U.preventDefault()}),Q||this._fire(Y.pointerdown,{evt:U,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(U){const Y=z(U.type),X=L(U.type);if(!Y)return;i.Konva.isDragging()&&o.DD.node.preventDefault()&&U.cancelable&&U.preventDefault(),this.setPointersPositions(U);var Q=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;if(!Q)return;var te={};let ee=!1;var ne=this._getTargetShape(X);this._changedPointerPositions.forEach(ie=>{const le=u.getCapturedShape(ie.id)||this.getIntersection(ie),xe=ie.id,Fe={evt:U,pointerId:xe};var oe=ne!==le;if(oe&&ne&&(ne._fireAndBubble(Y.pointerout,{...Fe},le),ne._fireAndBubble(Y.pointerleave,{...Fe},le)),le){if(te[le._id])return;te[le._id]=!0}le&&le.isListening()?(ee=!0,oe&&(le._fireAndBubble(Y.pointerover,{...Fe},ne),le._fireAndBubble(Y.pointerenter,{...Fe},ne),this[X+"targetShape"]=le),le._fireAndBubble(Y.pointermove,{...Fe})):ne&&(this._fire(Y.pointerover,{evt:U,target:this,currentTarget:this,pointerId:xe}),this[X+"targetShape"]=null)}),ee||this._fire(Y.pointermove,{evt:U,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(U){const Y=z(U.type),X=L(U.type);if(!Y)return;this.setPointersPositions(U);const Q=this[X+"ClickStartShape"],te=this[X+"ClickEndShape"];var ee={};let ne=!1;this._changedPointerPositions.forEach(ie=>{const le=u.getCapturedShape(ie.id)||this.getIntersection(ie);if(le){if(le.releaseCapture(ie.id),ee[le._id])return;ee[le._id]=!0}const xe=ie.id,Fe={evt:U,pointerId:xe};let oe=!1;i.Konva["_"+X+"InDblClickWindow"]?(oe=!0,clearTimeout(this[X+"DblTimeout"])):o.DD.justDragged||(i.Konva["_"+X+"InDblClickWindow"]=!0,clearTimeout(this[X+"DblTimeout"])),this[X+"DblTimeout"]=setTimeout(function(){i.Konva["_"+X+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),le&&le.isListening()?(ne=!0,this[X+"ClickEndShape"]=le,le._fireAndBubble(Y.pointerup,{...Fe}),i.Konva["_"+X+"ListenClick"]&&Q&&Q===le&&(le._fireAndBubble(Y.pointerclick,{...Fe}),oe&&te&&te===le&&le._fireAndBubble(Y.pointerdblclick,{...Fe}))):(this[X+"ClickEndShape"]=null,i.Konva["_"+X+"ListenClick"]&&this._fire(Y.pointerclick,{evt:U,target:this,currentTarget:this,pointerId:xe}),oe&&this._fire(Y.pointerdblclick,{evt:U,target:this,currentTarget:this,pointerId:xe}))}),ne||this._fire(Y.pointerup,{evt:U,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+X+"ListenClick"]=!1,U.cancelable&&X!=="touch"&&U.preventDefault()}_contextmenu(U){this.setPointersPositions(U);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(M,{evt:U}):this._fire(M,{evt:U,target:this,currentTarget:this})}_wheel(U){this.setPointersPositions(U);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(K,{evt:U}):this._fire(K,{evt:U,target:this,currentTarget:this})}_pointercancel(U){this.setPointersPositions(U);const Y=u.getCapturedShape(U.pointerId)||this.getIntersection(this.getPointerPosition());Y&&Y._fireAndBubble(O,u.createEvent(U)),u.releaseCapture(U.pointerId)}_lostpointercapture(U){u.releaseCapture(U.pointerId)}setPointersPositions(U){var Y=this._getContentPosition(),X=null,Q=null;U=U||window.event,U.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(U.touches,te=>{this._pointerPositions.push({id:te.identifier,x:(te.clientX-Y.left)/Y.scaleX,y:(te.clientY-Y.top)/Y.scaleY})}),Array.prototype.forEach.call(U.changedTouches||U.touches,te=>{this._changedPointerPositions.push({id:te.identifier,x:(te.clientX-Y.left)/Y.scaleX,y:(te.clientY-Y.top)/Y.scaleY})})):(X=(U.clientX-Y.left)/Y.scaleX,Q=(U.clientY-Y.top)/Y.scaleY,this.pointerPos={x:X,y:Q},this._pointerPositions=[{x:X,y:Q,id:t.Util._getFirstPointerId(U)}],this._changedPointerPositions=[{x:X,y:Q,id:t.Util._getFirstPointerId(U)}])}_setPointerPosition(U){t.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 t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(U){U.batchDraw()}),this}}e.Stage=W,W.prototype.nodeType=f,(0,l._registerNode)(W),r.Factory.addGetterSetter(W,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(V=>{V.batchDraw()})})})(u9);var Fc={},hr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=st,r=Xt,n=ct,i=Gt,a=We,o=st,l=Pn;var u="hasShadow",f="shadowRGBA",g="patternImage",S="linearGradient",_="radialGradient";let h;function w(){return h||(h=r.Util.createCanvasElement().getContext("2d"),h)}e.shapes={};function m(P){const x=this.attrs.fillRule;x?P.fill(x):P.fill()}function y(P){P.stroke()}function p(P){P.fill()}function v(P){P.stroke()}function d(){this._clearCache(u)}function b(){this._clearCache(f)}function O(){this._clearCache(g)}function R(){this._clearCache(S)}function T(){this._clearCache(_)}class E extends i.Node{constructor(x){super(x);let k;for(;k=r.Util.getRandomColor(),!(k&&!(k in e.shapes)););this.colorKey=k,e.shapes[k]=this}getContext(){return r.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return r.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(u,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(g,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var x=w();const k=x.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(k&&k.setTransform){const M=new r.Transform;M.translate(this.fillPatternX(),this.fillPatternY()),M.rotate(t.Konva.getAngle(this.fillPatternRotation())),M.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),M.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const j=M.getMatrix(),B=typeof DOMMatrix>"u"?{a:j[0],b:j[1],c:j[2],d:j[3],e:j[4],f:j[5]}:new DOMMatrix(j);k.setTransform(B)}return k}}_getLinearGradient(){return this._getCache(S,this.__getLinearGradient)}__getLinearGradient(){var x=this.fillLinearGradientColorStops();if(x){for(var k=w(),M=this.fillLinearGradientStartPoint(),j=this.fillLinearGradientEndPoint(),B=k.createLinearGradient(M.x,M.y,j.x,j.y),$=0;$<x.length;$+=2)B.addColorStop(x[$],x[$+1]);return B}}_getRadialGradient(){return this._getCache(_,this.__getRadialGradient)}__getRadialGradient(){var x=this.fillRadialGradientColorStops();if(x){for(var k=w(),M=this.fillRadialGradientStartPoint(),j=this.fillRadialGradientEndPoint(),B=k.createRadialGradient(M.x,M.y,this.fillRadialGradientStartRadius(),j.x,j.y,this.fillRadialGradientEndRadius()),$=0;$<x.length;$+=2)B.addColorStop(x[$],x[$+1]);return B}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var x=r.Util.colorToRGBA(this.shadowColor());if(x)return"rgba("+x.r+","+x.g+","+x.b+","+x.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 x=this.hitStrokeWidth();return x==="auto"?this.hasStroke():this.strokeEnabled()&&!!x}intersects(x){var k=this.getStage();if(!k)return!1;const M=k.bufferHitCanvas;return M.getContext().clear(),this.drawHit(M,void 0,!0),M.context.getImageData(Math.round(x.x),Math.round(x.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(x){var k;if(!((k=this.attrs.perfectDrawEnabled)!==null&&k!==void 0?k:!0))return!1;const j=x||this.hasFill(),B=this.hasStroke(),$=this.getAbsoluteOpacity()!==1;if(j&&B&&$)return!0;const Z=this.hasShadow(),K=this.shadowForStrokeEnabled();return!!(j&&B&&Z&&K)}setStrokeHitEnabled(x){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),x?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var x=this.size();return{x:this._centroid?-x.width/2:0,y:this._centroid?-x.height/2:0,width:x.width,height:x.height}}getClientRect(x={}){let k=!1,M=this.getParent();for(;M;){if(M.isCached()){k=!0;break}M=M.getParent()}const j=x.skipTransform,B=x.relativeTo||k&&this.getStage()||void 0,$=this.getSelfRect(),K=!x.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,D=$.width+K,q=$.height+K,A=!x.skipShadow&&this.hasShadow(),L=A?this.shadowOffsetX():0,z=A?this.shadowOffsetY():0,I=D+Math.abs(L),H=q+Math.abs(z),W=A&&this.shadowBlur()||0,V=I+W*2,U=H+W*2,Y={width:V,height:U,x:-(K/2+W)+Math.min(L,0)+$.x,y:-(K/2+W)+Math.min(z,0)+$.y};return j?Y:this._transformedRect(Y,B)}drawScene(x,k,M){var j=this.getLayer(),B=x||j.getCanvas(),$=B.getContext(),Z=this._getCanvasCache(),K=this.getSceneFunc(),D=this.hasShadow(),q,A,L=B.isCache,z=k===this;if(!this.isVisible()&&!z)return this;if(Z){$.save();var I=this.getAbsoluteTransform(k).getMatrix();return $.transform(I[0],I[1],I[2],I[3],I[4],I[5]),this._drawCachedSceneCanvas($),$.restore(),this}if(!K)return this;if($.save(),this._useBufferCanvas()&&!L){q=this.getStage();const V=M||q.bufferCanvas;A=V.getContext(),A.clear(),A.save(),A._applyLineJoin(this);var H=this.getAbsoluteTransform(k).getMatrix();A.transform(H[0],H[1],H[2],H[3],H[4],H[5]),K.call(this,A,this),A.restore();var W=V.pixelRatio;D&&$._applyShadow(this),$._applyOpacity(this),$._applyGlobalCompositeOperation(this),$.drawImage(V._canvas,0,0,V.width/W,V.height/W)}else{if($._applyLineJoin(this),!z){var H=this.getAbsoluteTransform(k).getMatrix();$.transform(H[0],H[1],H[2],H[3],H[4],H[5]),$._applyOpacity(this),$._applyGlobalCompositeOperation(this)}D&&$._applyShadow(this),K.call(this,$,this)}return $.restore(),this}drawHit(x,k,M=!1){if(!this.shouldDrawHit(k,M))return this;var j=this.getLayer(),B=x||j.hitCanvas,$=B&&B.getContext(),Z=this.hitFunc()||this.sceneFunc(),K=this._getCanvasCache(),D=K&&K.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()"),D){$.save();var q=this.getAbsoluteTransform(k).getMatrix();return $.transform(q[0],q[1],q[2],q[3],q[4],q[5]),this._drawCachedHitCanvas($),$.restore(),this}if(!Z)return this;if($.save(),$._applyLineJoin(this),!(this===k)){var L=this.getAbsoluteTransform(k).getMatrix();$.transform(L[0],L[1],L[2],L[3],L[4],L[5])}return Z.call(this,$,this),$.restore(),this}drawHitFromCache(x=0){var k=this._getCanvasCache(),M=this._getCachedSceneCanvas(),j=k.hit,B=j.getContext(),$=j.getWidth(),Z=j.getHeight(),K,D,q,A,L,z;B.clear(),B.drawImage(M._canvas,0,0,$,Z);try{for(K=B.getImageData(0,0,$,Z),D=K.data,q=D.length,A=r.Util._hexToRgb(this.colorKey),L=0;L<q;L+=4)z=D[L+3],z>x?(D[L]=A.r,D[L+1]=A.g,D[L+2]=A.b,D[L+3]=255):D[L+3]=0;B.putImageData(K,0,0)}catch(I){r.Util.error("Unable to draw hit graph from cached scene canvas. "+I.message)}return this}hasPointerCapture(x){return l.hasPointerCapture(x,this)}setPointerCapture(x){l.setPointerCapture(x,this)}releaseCapture(x){l.releaseCapture(x,this)}}e.Shape=E,E.prototype._fillFunc=m,E.prototype._strokeFunc=y,E.prototype._fillFuncHit=p,E.prototype._strokeFuncHit=v,E.prototype._centroid=!1,E.prototype.nodeType="Shape",(0,o._registerNode)(E),E.prototype.eventListeners={},E.prototype.on.call(E.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),E.prototype.on.call(E.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",b),E.prototype.on.call(E.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",O),E.prototype.on.call(E.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",R),E.prototype.on.call(E.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",T),n.Factory.addGetterSetter(E,"stroke",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(E,"strokeWidth",2,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(E,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(E,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(E,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(E,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(E,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(E,"lineJoin"),n.Factory.addGetterSetter(E,"lineCap"),n.Factory.addGetterSetter(E,"sceneFunc"),n.Factory.addGetterSetter(E,"hitFunc"),n.Factory.addGetterSetter(E,"dash"),n.Factory.addGetterSetter(E,"dashOffset",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(E,"shadowColor",void 0,(0,a.getStringValidator)()),n.Factory.addGetterSetter(E,"shadowBlur",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(E,"shadowOpacity",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(E,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(E,"shadowOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(E,"shadowOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(E,"fillPatternImage"),n.Factory.addGetterSetter(E,"fill",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(E,"fillPatternX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(E,"fillPatternY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(E,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(E,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(E,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(E,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(E,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(E,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(E,"fillEnabled",!0),n.Factory.addGetterSetter(E,"strokeEnabled",!0),n.Factory.addGetterSetter(E,"shadowEnabled",!0),n.Factory.addGetterSetter(E,"dashEnabled",!0),n.Factory.addGetterSetter(E,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(E,"fillPriority","color"),n.Factory.addComponentsGetterSetter(E,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(E,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(E,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(E,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(E,"fillPatternScaleX",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(E,"fillPatternScaleY",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(E,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(E,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(E,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(E,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(E,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(E,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(E,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(E,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(E,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(E,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(E,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(E,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(E,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(E,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(E,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(E,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(E,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(E,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(E,"fillPatternRotation",0),n.Factory.addGetterSetter(E,"fillRule",void 0,(0,a.getStringValidator)()),n.Factory.backCompat(E,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(hr);Object.defineProperty(Fc,"__esModule",{value:!0});Fc.Layer=void 0;const na=Xt,V1=hl,Hl=Gt,Dy=ct,D5=pi,ok=We,lk=hr,sk=st;var uk="#",ck="beforeDraw",fk="draw",d9=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],dk=d9.length;let Hs=class extends V1.Container{constructor(t){super(t),this.canvas=new D5.SceneCanvas,this.hitCanvas=new D5.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var r=this.getStage();return r&&r.content&&(r.content.removeChild(this.getNativeCanvasElement()),t<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[t+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Hl.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var t=Hl.Node.prototype.moveUp.call(this);if(!t)return!1;var r=this.getStage();return!r||!r.content?!1:(r.content.removeChild(this.getNativeCanvasElement()),this.index<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[this.index+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Hl.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var r=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),r[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Hl.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var r=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),r[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return Hl.Node.prototype.remove.call(this),t&&t.parentNode&&na.Util._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:r}){return this.canvas.setSize(t,r),this.hitCanvas.setSize(t,r),this._setSmoothEnabled(),this}_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&na.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t=t||{},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),Hl.Node.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){na.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){na.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,na.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var r=1,n=!1;;){for(let i=0;i<dk;i++){const a=d9[i],o=this._getIntersection({x:t.x+a.x*r,y:t.y+a.y*r}),l=o.shape;if(l)return l;if(n=!!o.antialiased,!o.antialiased)break}if(n)r+=1;else return null}}_getIntersection(t){const r=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(t.x*r),Math.round(t.y*r),1,1).data,i=n[3];if(i===255){const a=na.Util._rgbToHex(n[0],n[1],n[2]),o=lk.shapes[uk+a];return o?{shape:o}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,r){var n=this.getLayer(),i=t||n&&n.getCanvas();return this._fire(ck,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),V1.Container.prototype.drawScene.call(this,i,r),this._fire(fk,{node:this}),this}drawHit(t,r){var n=this.getLayer(),i=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),V1.Container.prototype.drawHit.call(this,i,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){na.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return na.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,r=!!this.hitCanvas._canvas.parentNode;r?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return na.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Fc.Layer=Hs;Hs.prototype.nodeType="Layer";(0,sk._registerNode)(Hs);Dy.Factory.addGetterSetter(Hs,"imageSmoothingEnabled",!0);Dy.Factory.addGetterSetter(Hs,"clearBeforeDraw",!0);Dy.Factory.addGetterSetter(Hs,"hitGraphEnabled",!0,(0,ok.getBooleanValidator)());var rp={};Object.defineProperty(rp,"__esModule",{value:!0});rp.FastLayer=void 0;const hk=Xt,pk=Fc,gk=st;let jy=class extends pk.Layer{constructor(t){super(t),this.listening(!1),hk.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};rp.FastLayer=jy;jy.prototype.nodeType="FastLayer";(0,gk._registerNode)(jy);var $s={};Object.defineProperty($s,"__esModule",{value:!0});$s.Group=void 0;const vk=Xt,mk=hl,yk=st;let Fy=class extends mk.Container{_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&vk.Util.throw("You may only add groups and shapes to groups.")}};$s.Group=Fy;Fy.prototype.nodeType="Group";(0,yk._registerNode)(Fy);var Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.Animation=void 0;const q1=st,j5=Xt,W1=function(){return q1.glob.performance&&q1.glob.performance.now?function(){return q1.glob.performance.now()}:function(){return new Date().getTime()}}();class Di{constructor(t,r){this.id=Di.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:W1(),frameRate:0},this.func=t,this.setLayers(r)}setLayers(t){let r=[];return t&&(r=Array.isArray(t)?t:[t]),this.layers=r,this}getLayers(){return this.layers}addLayer(t){const r=this.layers,n=r.length;for(let i=0;i<n;i++)if(r[i]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const r=Di.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=W1(),Di._addAnimation(this),this}stop(){return Di._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const r=t.id,n=this.animations,i=n.length;for(let a=0;a<i;a++)if(n[a].id===r){this.animations.splice(a,1);break}}static _runFrames(){const t={},r=this.animations;for(let n=0;n<r.length;n++){const i=r[n],a=i.layers,o=i.func;i._updateFrameObject(W1());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 g=a[f];g._id!==void 0&&(t[g._id]=g)}}for(let n in t)t.hasOwnProperty(n)&&t[n].batchDraw()}static _animationLoop(){const t=Di;t.animations.length?(t._runFrames(),j5.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,j5.Util.requestAnimFrame(this._animationLoop))}}Gs.Animation=Di;Di.animations=[];Di.animIdCounter=0;Di.animRunning=!1;var h9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=Xt,r=Gs,n=Gt,i=st;var a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,f=0,g=["fill","stroke","shadowColor"];class S{constructor(w,m,y,p,v,d,b){this.prop=w,this.propFunc=m,this.begin=p,this._pos=p,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=b,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=y,this._change=v-this.begin,this.pause()}fire(w){var m=this[w];m&&m()}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 _{constructor(w){var m=this,y=w.node,p=y._id,v,d=w.easing||e.Easings.Linear,b=!!w.yoyo,O;typeof w.duration>"u"?v=.3:w.duration===0?v=.001:v=w.duration,this.node=y,this._id=f++;var R=y.getLayer()||(y instanceof i.Konva.Stage?y.getLayers():null);R||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new r.Animation(function(){m.tween.onEnterFrame()},R),this.tween=new S(O,function(T){m._tweenFunc(T)},d,0,1,v*1e3,b),this._addListeners(),_.attrs[p]||(_.attrs[p]={}),_.attrs[p][this._id]||(_.attrs[p][this._id]={}),_.tweens[p]||(_.tweens[p]={});for(O in w)a[O]===void 0&&this._addAttr(O,w[O]);this.reset(),this.onFinish=w.onFinish,this.onReset=w.onReset,this.onUpdate=w.onUpdate}_addAttr(w,m){var y=this.node,p=y._id,v,d,b,O,R,T,E,P;if(b=_.tweens[p][w],b&&delete _.attrs[p][b][w],v=y.getAttr(w),t.Util._isArray(m))if(d=[],R=Math.max(m.length,v.length),w==="points"&&m.length!==v.length&&(m.length>v.length?(E=v,v=t.Util._prepareArrayForTween(v,m,y.closed())):(T=m,m=t.Util._prepareArrayForTween(m,v,y.closed()))),w.indexOf("fill")===0)for(O=0;O<R;O++)if(O%2===0)d.push(m[O]-v[O]);else{var x=t.Util.colorToRGBA(v[O]);P=t.Util.colorToRGBA(m[O]),v[O]=x,d.push({r:P.r-x.r,g:P.g-x.g,b:P.b-x.b,a:P.a-x.a})}else for(O=0;O<R;O++)d.push(m[O]-v[O]);else g.indexOf(w)!==-1?(v=t.Util.colorToRGBA(v),P=t.Util.colorToRGBA(m),d={r:P.r-v.r,g:P.g-v.g,b:P.b-v.b,a:P.a-v.a}):d=m-v;_.attrs[p][this._id][w]={start:v,diff:d,end:m,trueEnd:T,trueStart:E},_.tweens[p][w]=this._id}_tweenFunc(w){var m=this.node,y=_.attrs[m._id][this._id],p,v,d,b,O,R,T,E;for(p in y){if(v=y[p],d=v.start,b=v.diff,E=v.end,t.Util._isArray(d))if(O=[],T=Math.max(d.length,E.length),p.indexOf("fill")===0)for(R=0;R<T;R++)R%2===0?O.push((d[R]||0)+b[R]*w):O.push("rgba("+Math.round(d[R].r+b[R].r*w)+","+Math.round(d[R].g+b[R].g*w)+","+Math.round(d[R].b+b[R].b*w)+","+(d[R].a+b[R].a*w)+")");else for(R=0;R<T;R++)O.push((d[R]||0)+b[R]*w);else g.indexOf(p)!==-1?O="rgba("+Math.round(d.r+b.r*w)+","+Math.round(d.g+b.g*w)+","+Math.round(d.b+b.b*w)+","+(d.a+b.a*w)+")":O=d+b*w;m.setAttr(p,O)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var w=this.node,m=_.attrs[w._id][this._id];m.points&&m.points.trueEnd&&w.setAttr("points",m.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var w=this.node,m=_.attrs[w._id][this._id];m.points&&m.points.trueStart&&w.points(m.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(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,m=this._id,y=_.tweens[w],p;this.pause();for(p in y)delete _.tweens[w][p];delete _.attrs[w][m]}}e.Tween=_,_.attrs={},_.tweens={},n.Node.prototype.to=function(h){var w=h.onFinish;h.node=this,h.onFinish=function(){this.destroy(),w&&w()};var m=new _(h);m.play()},e.Easings={BackEaseIn(h,w,m,y){var p=1.70158;return m*(h/=y)*h*((p+1)*h-p)+w},BackEaseOut(h,w,m,y){var p=1.70158;return m*((h=h/y-1)*h*((p+1)*h+p)+1)+w},BackEaseInOut(h,w,m,y){var p=1.70158;return(h/=y/2)<1?m/2*(h*h*(((p*=1.525)+1)*h-p))+w:m/2*((h-=2)*h*(((p*=1.525)+1)*h+p)+2)+w},ElasticEaseIn(h,w,m,y,p,v){var d=0;return h===0?w:(h/=y)===1?w+m:(v||(v=y*.3),!p||p<Math.abs(m)?(p=m,d=v/4):d=v/(2*Math.PI)*Math.asin(m/p),-(p*Math.pow(2,10*(h-=1))*Math.sin((h*y-d)*(2*Math.PI)/v))+w)},ElasticEaseOut(h,w,m,y,p,v){var d=0;return h===0?w:(h/=y)===1?w+m:(v||(v=y*.3),!p||p<Math.abs(m)?(p=m,d=v/4):d=v/(2*Math.PI)*Math.asin(m/p),p*Math.pow(2,-10*h)*Math.sin((h*y-d)*(2*Math.PI)/v)+m+w)},ElasticEaseInOut(h,w,m,y,p,v){var d=0;return h===0?w:(h/=y/2)===2?w+m:(v||(v=y*(.3*1.5)),!p||p<Math.abs(m)?(p=m,d=v/4):d=v/(2*Math.PI)*Math.asin(m/p),h<1?-.5*(p*Math.pow(2,10*(h-=1))*Math.sin((h*y-d)*(2*Math.PI)/v))+w:p*Math.pow(2,-10*(h-=1))*Math.sin((h*y-d)*(2*Math.PI)/v)*.5+m+w)},BounceEaseOut(h,w,m,y){return(h/=y)<1/2.75?m*(7.5625*h*h)+w:h<2/2.75?m*(7.5625*(h-=1.5/2.75)*h+.75)+w:h<2.5/2.75?m*(7.5625*(h-=2.25/2.75)*h+.9375)+w:m*(7.5625*(h-=2.625/2.75)*h+.984375)+w},BounceEaseIn(h,w,m,y){return m-e.Easings.BounceEaseOut(y-h,0,m,y)+w},BounceEaseInOut(h,w,m,y){return h<y/2?e.Easings.BounceEaseIn(h*2,0,m,y)*.5+w:e.Easings.BounceEaseOut(h*2-y,0,m,y)*.5+m*.5+w},EaseIn(h,w,m,y){return m*(h/=y)*h+w},EaseOut(h,w,m,y){return-m*(h/=y)*(h-2)+w},EaseInOut(h,w,m,y){return(h/=y/2)<1?m/2*h*h+w:-m/2*(--h*(h-2)-1)+w},StrongEaseIn(h,w,m,y){return m*(h/=y)*h*h*h*h+w},StrongEaseOut(h,w,m,y){return m*((h=h/y-1)*h*h*h*h+1)+w},StrongEaseInOut(h,w,m,y){return(h/=y/2)<1?m/2*h*h*h*h*h+w:m/2*((h-=2)*h*h*h*h+2)+w},Linear(h,w,m,y){return m*h/y+w}}})(h9);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=st,r=Xt,n=Gt,i=hl,a=u9,o=Fc,l=rp,u=$s,f=ep,g=hr,S=Gs,_=h9,h=da,w=pi;e.Konva=r.Util._assign(t.Konva,{Util:r.Util,Transform:r.Transform,Node:n.Node,Container:i.Container,Stage:a.Stage,stages:a.stages,Layer:o.Layer,FastLayer:l.FastLayer,Group:u.Group,DD:f.DD,Shape:g.Shape,shapes:g.shapes,Animation:S.Animation,Tween:_.Tween,Easings:_.Easings,Context:h.Context,Canvas:w.Canvas}),e.default=e.Konva})(ph);var np={};Object.defineProperty(np,"__esModule",{value:!0});np.Arc=void 0;const ip=ct,bk=hr,F5=st,ap=We,_k=st;let Ea=class extends bk.Shape{_sceneFunc(t){var r=F5.Konva.getAngle(this.angle()),n=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,r,n),t.arc(0,0,this.innerRadius(),r,0,!n),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),r=this.outerRadius(),n=this.clockwise(),i=F5.Konva.getAngle(n?360-this.angle():this.angle()),a=Math.cos(Math.min(i,Math.PI)),o=1,l=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),u=Math.sin(Math.min(i,Math.PI/2)),f=a*(a>0?t:r),g=o*r,S=l*(l>0?t:r),_=u*(u>0?r:t);return{x:f,y:n?-1*_:S,width:g-f,height:_-S}}};np.Arc=Ea;Ea.prototype._centroid=!0;Ea.prototype.className="Arc";Ea.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,_k._registerNode)(Ea);ip.Factory.addGetterSetter(Ea,"innerRadius",0,(0,ap.getNumberValidator)());ip.Factory.addGetterSetter(Ea,"outerRadius",0,(0,ap.getNumberValidator)());ip.Factory.addGetterSetter(Ea,"angle",0,(0,ap.getNumberValidator)());ip.Factory.addGetterSetter(Ea,"clockwise",!1,(0,ap.getBooleanValidator)());var op={},zc={};Object.defineProperty(zc,"__esModule",{value:!0});zc.Line=void 0;const lp=ct,wk=hr,p9=We,Sk=st;function sm(e,t,r,n,i,a,o){var l=Math.sqrt(Math.pow(r-e,2)+Math.pow(n-t,2)),u=Math.sqrt(Math.pow(i-r,2)+Math.pow(a-n,2)),f=o*l/(l+u),g=o*u/(l+u),S=r-f*(i-e),_=n-f*(a-t),h=r+g*(i-e),w=n+g*(a-t);return[S,_,h,w]}function z5(e,t){var r=e.length,n=[],i,a;for(i=2;i<r-2;i+=2)a=sm(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t),!isNaN(a[0])&&(n.push(a[0]),n.push(a[1]),n.push(e[i]),n.push(e[i+1]),n.push(a[2]),n.push(a[3]));return n}let yo=class extends wk.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var r=this.points(),n=r.length,i=this.tension(),a=this.closed(),o=this.bezier(),l,u,f;if(n){if(t.beginPath(),t.moveTo(r[0],r[1]),i!==0&&n>4){for(l=this.getTensionPoints(),u=l.length,f=a?0:4,a||t.quadraticCurveTo(l[0],l[1],l[2],l[3]);f<u-2;)t.bezierCurveTo(l[f++],l[f++],l[f++],l[f++],l[f++],l[f++]);a||t.quadraticCurveTo(l[u-2],l[u-1],r[n-2],r[n-1])}else if(o)for(f=2;f<n;)t.bezierCurveTo(r[f++],r[f++],r[f++],r[f++],r[f++],r[f++]);else for(f=2;f<n;f+=2)t.lineTo(r[f],r[f+1]);a?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():z5(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),r=t.length,n=this.tension(),i=sm(t[r-2],t[r-1],t[0],t[1],t[2],t[3],n),a=sm(t[r-4],t[r-3],t[r-2],t[r-1],t[0],t[1],n),o=z5(t,n),l=[i[2],i[3]].concat(o).concat([a[0],a[1],t[r-2],t[r-1],a[2],a[3],i[0],i[1],t[0],t[1]]);return l}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();for(var r=t[0],n=t[0],i=t[1],a=t[1],o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,l),a=Math.max(a,l);return{x:r,y:i,width:n-r,height:a-i}}};zc.Line=yo;yo.prototype.className="Line";yo.prototype._attrsAffectingSize=["points","bezier","tension"];(0,Sk._registerNode)(yo);lp.Factory.addGetterSetter(yo,"closed",!1);lp.Factory.addGetterSetter(yo,"bezier",!1);lp.Factory.addGetterSetter(yo,"tension",0,(0,p9.getNumberValidator)());lp.Factory.addGetterSetter(yo,"points",[],(0,p9.getNumberArrayValidator)());var Vs={},g9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(o,l,u)=>{let f,g,S;f=u/2,g=0;for(let h=0;h<20;h++)S=f*e.tValues[20][h]+f,g+=e.cValues[20][h]*n(o,l,S);return f*g};e.getCubicArcLength=t;const r=(o,l,u)=>{u===void 0&&(u=1);const f=o[0]-2*o[1]+o[2],g=l[0]-2*l[1]+l[2],S=2*o[1]-2*o[0],_=2*l[1]-2*l[0],h=4*(f*f+g*g),w=4*(f*S+g*_),m=S*S+_*_;if(h===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(l[2]-l[0],2));const y=w/(2*h),p=m/h,v=u+y,d=p-y*y,b=v*v+d>0?Math.sqrt(v*v+d):0,O=y*y+d>0?Math.sqrt(y*y+d):0,R=y+Math.sqrt(y*y+d)!==0?d*Math.log(Math.abs((v+b)/(y+O))):0;return Math.sqrt(h)/2*(v*b-y*O+R)};e.getQuadraticArcLength=r;function n(o,l,u){const f=i(1,u,o),g=i(1,u,l),S=f*f+g*g;return Math.sqrt(S)}const i=(o,l,u)=>{const f=u.length-1;let g,S;if(f===0)return 0;if(o===0){S=0;for(let _=0;_<=f;_++)S+=e.binomialCoefficients[f][_]*Math.pow(1-l,f-_)*Math.pow(l,_)*u[_];return S}else{g=new Array(f);for(let _=0;_<f;_++)g[_]=f*(u[_+1]-u[_]);return i(o-1,l,g)}},a=(o,l,u)=>{let f=1,g=o/l,S=(o-u(g))/l,_=0;for(;f>.001;){const h=u(g+S),w=Math.abs(o-h)/l;if(w<f)f=w,g+=S;else{const m=u(g-S),y=Math.abs(o-m)/l;y<f?(f=y,g-=S):S/=2}if(_++,_>500)break}return g};e.t2length=a})(g9);Object.defineProperty(Vs,"__esModule",{value:!0});Vs.Path=void 0;const Ek=ct,Ok=hr,Pk=st,$l=g9;let Bc=class sn extends Ok.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=sn.parsePathData(this.data()),this.pathLength=sn.getPathLength(this.dataArray)}_sceneFunc(t){var r=this.dataArray;t.beginPath();for(var n=!1,i=0;i<r.length;i++){var a=r[i].command,o=r[i].points;switch(a){case"L":t.lineTo(o[0],o[1]);break;case"M":t.moveTo(o[0],o[1]);break;case"C":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":t.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":var l=o[0],u=o[1],f=o[2],g=o[3],S=o[4],_=o[5],h=o[6],w=o[7],m=f>g?f:g,y=f>g?1:f/g,p=f>g?g/f:1;t.translate(l,u),t.rotate(h),t.scale(y,p),t.arc(0,0,m,S,S+_,1-w),t.scale(1/y,1/p),t.rotate(-h),t.translate(-l,-u);break;case"z":n=!0,t.closePath();break}}!n&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(f){if(f.command==="A"){var g=f.points[4],S=f.points[5],_=f.points[4]+S,h=Math.PI/180;if(Math.abs(g-_)<h&&(h=Math.abs(g-_)),S<0)for(let w=g-h;w>_;w-=h){const m=sn.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],w,0);t.push(m.x,m.y)}else for(let w=g+h;w<_;w+=h){const m=sn.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],w,0);t.push(m.x,m.y)}}else if(f.command==="C")for(let w=0;w<=1;w+=.01){const m=sn.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]);t.push(m.x,m.y)}else t=t.concat(f.points)});for(var r=t[0],n=t[0],i=t[1],a=t[1],o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],isNaN(o)||(r=Math.min(r,o),n=Math.max(n,o)),isNaN(l)||(i=Math.min(i,l),a=Math.max(a,l));return{x:r,y:i,width:n-r,height:a-i}}getLength(){return this.pathLength}getPointAtLength(t){return sn.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,r,n,i){return Math.sqrt((n-t)*(n-t)+(i-r)*(i-r))}static getPathLength(t){let r=0;for(var n=0;n<t.length;++n)r+=t[n].pathLength;return r}static getPointAtLengthOfDataArray(t,r){var n,i=0,a=r.length;if(!a)return null;for(;i<a&&t>r[i].pathLength;)t-=r[i].pathLength,++i;if(i===a)return n=r[i-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=r[i].points.slice(0,2),{x:n[0],y:n[1]};var o=r[i],l=o.points;switch(o.command){case"L":return sn.getPointOnLine(t,o.start.x,o.start.y,l[0],l[1]);case"C":return sn.getPointOnCubicBezier((0,$l.t2length)(t,sn.getPathLength(r),m=>(0,$l.getCubicArcLength)([o.start.x,l[0],l[2],l[4]],[o.start.y,l[1],l[3],l[5]],m)),o.start.x,o.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return sn.getPointOnQuadraticBezier((0,$l.t2length)(t,sn.getPathLength(r),m=>(0,$l.getQuadraticArcLength)([o.start.x,l[0],l[2]],[o.start.y,l[1],l[3]],m)),o.start.x,o.start.y,l[0],l[1],l[2],l[3]);case"A":var u=l[0],f=l[1],g=l[2],S=l[3],_=l[4],h=l[5],w=l[6];return _+=h*t/o.pathLength,sn.getPointOnEllipticalArc(u,f,g,S,_,w)}return null}static getPointOnLine(t,r,n,i,a,o,l){o=o??r,l=l??n;const u=this.getLineLength(r,n,i,a);if(u<1e-10)return{x:r,y:n};if(i===r)return{x:o,y:l+(a>n?t:-t)};const f=(a-n)/(i-r),g=Math.sqrt(t*t/(1+f*f))*(i<r?-1:1),S=f*g;if(Math.abs(l-n-f*(o-r))<1e-10)return{x:o+g,y:l+S};const _=((o-r)*(i-r)+(l-n)*(a-n))/(u*u),h=r+_*(i-r),w=n+_*(a-n),m=this.getLineLength(o,l,h,w),y=Math.sqrt(t*t-m*m),p=Math.sqrt(y*y/(1+f*f))*(i<r?-1:1),v=f*p;return{x:h+p,y:w+v}}static getPointOnCubicBezier(t,r,n,i,a,o,l,u,f){function g(y){return y*y*y}function S(y){return 3*y*y*(1-y)}function _(y){return 3*y*(1-y)*(1-y)}function h(y){return(1-y)*(1-y)*(1-y)}var w=u*g(t)+o*S(t)+i*_(t)+r*h(t),m=f*g(t)+l*S(t)+a*_(t)+n*h(t);return{x:w,y:m}}static getPointOnQuadraticBezier(t,r,n,i,a,o,l){function u(h){return h*h}function f(h){return 2*h*(1-h)}function g(h){return(1-h)*(1-h)}var S=o*u(t)+i*f(t)+r*g(t),_=l*u(t)+a*f(t)+n*g(t);return{x:S,y:_}}static getPointOnEllipticalArc(t,r,n,i,a,o){var l=Math.cos(o),u=Math.sin(o),f={x:n*Math.cos(a),y:i*Math.sin(a)};return{x:t+(f.x*l-f.y*u),y:r+(f.x*u+f.y*l)}}static parsePathData(t){if(!t)return[];var r=t,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];r=r.replace(new RegExp(" ","g"),",");for(var i=0;i<n.length;i++)r=r.replace(new RegExp(n[i],"g"),"|"+n[i]);var a=r.split("|"),o=[],l=[],u=0,f=0,g=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,S;for(i=1;i<a.length;i++){var _=a[i],h=_.charAt(0);for(_=_.slice(1),l.length=0;S=g.exec(_);)l.push(S[0]);for(var w=[],m=0,y=l.length;m<y;m++){if(l[m]==="00"){w.push(0,0);continue}var p=parseFloat(l[m]);isNaN(p)?w.push(0):w.push(p)}for(;w.length>0&&!isNaN(w[0]);){var v="",d=[],b=u,O=f,R,T,E,P,x,k,M,j,B,$;switch(h){case"l":u+=w.shift(),f+=w.shift(),v="L",d.push(u,f);break;case"L":u=w.shift(),f=w.shift(),d.push(u,f);break;case"m":var Z=w.shift(),K=w.shift();if(u+=Z,f+=K,v="M",o.length>2&&o[o.length-1].command==="z"){for(var D=o.length-2;D>=0;D--)if(o[D].command==="M"){u=o[D].points[0]+Z,f=o[D].points[1]+K;break}}d.push(u,f),h="l";break;case"M":u=w.shift(),f=w.shift(),v="M",d.push(u,f),h="L";break;case"h":u+=w.shift(),v="L",d.push(u,f);break;case"H":u=w.shift(),v="L",d.push(u,f);break;case"v":f+=w.shift(),v="L",d.push(u,f);break;case"V":f=w.shift(),v="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(),v="C",d.push(u,f);break;case"S":T=u,E=f,R=o[o.length-1],R.command==="C"&&(T=u+(u-R.points[2]),E=f+(f-R.points[3])),d.push(T,E,w.shift(),w.shift()),u=w.shift(),f=w.shift(),v="C",d.push(u,f);break;case"s":T=u,E=f,R=o[o.length-1],R.command==="C"&&(T=u+(u-R.points[2]),E=f+(f-R.points[3])),d.push(T,E,u+w.shift(),f+w.shift()),u+=w.shift(),f+=w.shift(),v="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(),v="Q",d.push(u,f);break;case"T":T=u,E=f,R=o[o.length-1],R.command==="Q"&&(T=u+(u-R.points[0]),E=f+(f-R.points[1])),u=w.shift(),f=w.shift(),v="Q",d.push(T,E,u,f);break;case"t":T=u,E=f,R=o[o.length-1],R.command==="Q"&&(T=u+(u-R.points[0]),E=f+(f-R.points[1])),u+=w.shift(),f+=w.shift(),v="Q",d.push(T,E,u,f);break;case"A":P=w.shift(),x=w.shift(),k=w.shift(),M=w.shift(),j=w.shift(),B=u,$=f,u=w.shift(),f=w.shift(),v="A",d=this.convertEndpointToCenterParameterization(B,$,u,f,M,j,P,x,k);break;case"a":P=w.shift(),x=w.shift(),k=w.shift(),M=w.shift(),j=w.shift(),B=u,$=f,u+=w.shift(),f+=w.shift(),v="A",d=this.convertEndpointToCenterParameterization(B,$,u,f,M,j,P,x,k);break}o.push({command:v||h,points:d,start:{x:b,y:O},pathLength:this.calcLength(b,O,v||h,d)})}(h==="z"||h==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(t,r,n,i){var a,o,l,u,f=sn;switch(n){case"L":return f.getLineLength(t,r,i[0],i[1]);case"C":return(0,$l.getCubicArcLength)([t,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return(0,$l.getQuadraticArcLength)([t,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;var g=i[4],S=i[5],_=i[4]+S,h=Math.PI/180;if(Math.abs(g-_)<h&&(h=Math.abs(g-_)),o=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],g,0),S<0)for(u=g-h;u>_;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=g+h;u<_;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],_,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),a}return 0}static convertEndpointToCenterParameterization(t,r,n,i,a,o,l,u,f){var g=f*(Math.PI/180),S=Math.cos(g)*(t-n)/2+Math.sin(g)*(r-i)/2,_=-1*Math.sin(g)*(t-n)/2+Math.cos(g)*(r-i)/2,h=S*S/(l*l)+_*_/(u*u);h>1&&(l*=Math.sqrt(h),u*=Math.sqrt(h));var w=Math.sqrt((l*l*(u*u)-l*l*(_*_)-u*u*(S*S))/(l*l*(_*_)+u*u*(S*S)));a===o&&(w*=-1),isNaN(w)&&(w=0);var m=w*l*_/u,y=w*-u*S/l,p=(t+n)/2+Math.cos(g)*m-Math.sin(g)*y,v=(r+i)/2+Math.sin(g)*m+Math.cos(g)*y,d=function(x){return Math.sqrt(x[0]*x[0]+x[1]*x[1])},b=function(x,k){return(x[0]*k[0]+x[1]*k[1])/(d(x)*d(k))},O=function(x,k){return(x[0]*k[1]<x[1]*k[0]?-1:1)*Math.acos(b(x,k))},R=O([1,0],[(S-m)/l,(_-y)/u]),T=[(S-m)/l,(_-y)/u],E=[(-1*S-m)/l,(-1*_-y)/u],P=O(T,E);return b(T,E)<=-1&&(P=Math.PI),b(T,E)>=1&&(P=0),o===0&&P>0&&(P=P-2*Math.PI),o===1&&P<0&&(P=P+2*Math.PI),[p,v,l,u,R,P,g,o]}};Vs.Path=Bc;Bc.prototype.className="Path";Bc.prototype._attrsAffectingSize=["data"];(0,Pk._registerNode)(Bc);Ek.Factory.addGetterSetter(Bc,"data");Object.defineProperty(op,"__esModule",{value:!0});op.Arrow=void 0;const sp=ct,xk=zc,v9=We,Ck=st,B5=Vs;let gl=class extends xk.Line{_sceneFunc(t){super._sceneFunc(t);var r=Math.PI*2,n=this.points(),i=n,a=this.tension()!==0&&n.length>4;a&&(i=this.getTensionPoints());var o=this.pointerLength(),l=n.length,u,f;if(a){const _=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],n[l-2],n[l-1]],h=B5.Path.calcLength(i[i.length-4],i[i.length-3],"C",_),w=B5.Path.getPointOnQuadraticBezier(Math.min(1,1-o/h),_[0],_[1],_[2],_[3],_[4],_[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 g=(Math.atan2(f,u)+r)%r,S=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(n[l-2],n[l-1]),t.rotate(g),t.moveTo(0,0),t.lineTo(-o,S/2),t.lineTo(-o,-S/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(n[0],n[1]),a?(u=(i[0]+i[2])/2-n[0],f=(i[1]+i[3])/2-n[1]):(u=n[2]-n[0],f=n[3]-n[1]),t.rotate((Math.atan2(-f,-u)+r)%r),t.moveTo(0,0),t.lineTo(-o,S/2),t.lineTo(-o,-S/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var r=this.dashEnabled();r&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),r&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),r=this.pointerWidth()/2;return{x:t.x-r,y:t.y-r,width:t.width+r*2,height:t.height+r*2}}};op.Arrow=gl;gl.prototype.className="Arrow";(0,Ck._registerNode)(gl);sp.Factory.addGetterSetter(gl,"pointerLength",10,(0,v9.getNumberValidator)());sp.Factory.addGetterSetter(gl,"pointerWidth",10,(0,v9.getNumberValidator)());sp.Factory.addGetterSetter(gl,"pointerAtBeginning",!1);sp.Factory.addGetterSetter(gl,"pointerAtEnding",!0);var up={};Object.defineProperty(up,"__esModule",{value:!0});up.Circle=void 0;const Tk=ct,kk=hr,Ak=We,Rk=st;let qs=class extends kk.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};up.Circle=qs;qs.prototype._centroid=!0;qs.prototype.className="Circle";qs.prototype._attrsAffectingSize=["radius"];(0,Rk._registerNode)(qs);Tk.Factory.addGetterSetter(qs,"radius",0,(0,Ak.getNumberValidator)());var cp={};Object.defineProperty(cp,"__esModule",{value:!0});cp.Ellipse=void 0;const zy=ct,Mk=hr,m9=We,Lk=st;let bo=class extends Mk.Shape{_sceneFunc(t){var r=this.radiusX(),n=this.radiusY();t.beginPath(),t.save(),r!==n&&t.scale(1,n/r),t.arc(0,0,r,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}};cp.Ellipse=bo;bo.prototype.className="Ellipse";bo.prototype._centroid=!0;bo.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,Lk._registerNode)(bo);zy.Factory.addComponentsGetterSetter(bo,"radius",["x","y"]);zy.Factory.addGetterSetter(bo,"radiusX",0,(0,m9.getNumberValidator)());zy.Factory.addGetterSetter(bo,"radiusY",0,(0,m9.getNumberValidator)());var fp={};Object.defineProperty(fp,"__esModule",{value:!0});fp.Image=void 0;const K1=Xt,vl=ct,Nk=hr,Ik=st,Uc=We;let Ki=class y9 extends Nk.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const r=this.getWidth(),n=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image;let o;if(a){const l=this.attrs.cropWidth,u=this.attrs.cropHeight;l&&u?o=[a,this.cropX(),this.cropY(),l,u,0,0,r,n]:o=[a,0,0,r,n]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?K1.Util.drawRoundedRectPath(t,r,n,i):t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)),a&&(i&&t.clip(),t.drawImage.apply(t,o))}_hitFunc(t){var r=this.width(),n=this.height(),i=this.cornerRadius();t.beginPath(),i?K1.Util.drawRoundedRectPath(t,r,n,i):t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,r;return(t=this.attrs.width)!==null&&t!==void 0?t:(r=this.image())===null||r===void 0?void 0:r.width}getHeight(){var t,r;return(t=this.attrs.height)!==null&&t!==void 0?t:(r=this.image())===null||r===void 0?void 0:r.height}static fromURL(t,r,n=null){var i=K1.Util.createImageElement();i.onload=function(){var a=new y9({image:i});r(a)},i.onerror=n,i.crossOrigin="Anonymous",i.src=t}};fp.Image=Ki;Ki.prototype.className="Image";(0,Ik._registerNode)(Ki);vl.Factory.addGetterSetter(Ki,"cornerRadius",0,(0,Uc.getNumberOrArrayOfNumbersValidator)(4));vl.Factory.addGetterSetter(Ki,"image");vl.Factory.addComponentsGetterSetter(Ki,"crop",["x","y","width","height"]);vl.Factory.addGetterSetter(Ki,"cropX",0,(0,Uc.getNumberValidator)());vl.Factory.addGetterSetter(Ki,"cropY",0,(0,Uc.getNumberValidator)());vl.Factory.addGetterSetter(Ki,"cropWidth",0,(0,Uc.getNumberValidator)());vl.Factory.addGetterSetter(Ki,"cropHeight",0,(0,Uc.getNumberValidator)());var Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});Cs.Tag=Cs.Label=void 0;const dp=ct,Dk=hr,jk=$s,By=We,b9=st;var _9=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Fk="Change.konva",zk="none",um="up",cm="right",fm="down",dm="left",Bk=_9.length;let Uy=class extends jk.Group{constructor(t){super(t),this.on("add.konva",function(r){this._addListeners(r.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var r=this,n,i=function(){r._sync()};for(n=0;n<Bk;n++)t.on(_9[n]+Fk,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),r=this.getTag(),n,i,a,o,l,u,f;if(t&&r){switch(n=t.width(),i=t.height(),a=r.pointerDirection(),o=r.pointerWidth(),f=r.pointerHeight(),l=0,u=0,a){case um:l=n/2,u=-1*f;break;case cm:l=n+o,u=i/2;break;case fm:l=n/2,u=i+f;break;case dm:l=-1*o,u=i/2;break}r.setAttrs({x:-1*l,y:-1*u,width:n,height:i}),t.setAttrs({x:-1*l,y:-1*u})}}};Cs.Label=Uy;Uy.prototype.className="Label";(0,b9._registerNode)(Uy);let ml=class extends Dk.Shape{_sceneFunc(t){var r=this.width(),n=this.height(),i=this.pointerDirection(),a=this.pointerWidth(),o=this.pointerHeight(),l=this.cornerRadius();let u=0,f=0,g=0,S=0;typeof l=="number"?u=f=g=S=Math.min(l,r/2,n/2):(u=Math.min(l[0]||0,r/2,n/2),f=Math.min(l[1]||0,r/2,n/2),S=Math.min(l[2]||0,r/2,n/2),g=Math.min(l[3]||0,r/2,n/2)),t.beginPath(),t.moveTo(u,0),i===um&&(t.lineTo((r-a)/2,0),t.lineTo(r/2,-1*o),t.lineTo((r+a)/2,0)),t.lineTo(r-f,0),t.arc(r-f,f,f,Math.PI*3/2,0,!1),i===cm&&(t.lineTo(r,(n-o)/2),t.lineTo(r+a,n/2),t.lineTo(r,(n+o)/2)),t.lineTo(r,n-S),t.arc(r-S,n-S,S,0,Math.PI/2,!1),i===fm&&(t.lineTo((r+a)/2,n),t.lineTo(r/2,n+o),t.lineTo((r-a)/2,n)),t.lineTo(g,n),t.arc(g,n-g,g,Math.PI/2,Math.PI,!1),i===dm&&(t.lineTo(0,(n+o)/2),t.lineTo(-1*a,n/2),t.lineTo(0,(n-o)/2)),t.lineTo(0,u),t.arc(u,u,u,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){var t=0,r=0,n=this.pointerWidth(),i=this.pointerHeight(),a=this.pointerDirection(),o=this.width(),l=this.height();return a===um?(r-=i,l+=i):a===fm?l+=i:a===dm?(t-=n*1.5,o+=n):a===cm&&(o+=n*1.5),{x:t,y:r,width:o,height:l}}};Cs.Tag=ml;ml.prototype.className="Tag";(0,b9._registerNode)(ml);dp.Factory.addGetterSetter(ml,"pointerDirection",zk);dp.Factory.addGetterSetter(ml,"pointerWidth",0,(0,By.getNumberValidator)());dp.Factory.addGetterSetter(ml,"pointerHeight",0,(0,By.getNumberValidator)());dp.Factory.addGetterSetter(ml,"cornerRadius",0,(0,By.getNumberOrArrayOfNumbersValidator)(4));var Hc={};Object.defineProperty(Hc,"__esModule",{value:!0});Hc.Rect=void 0;const Uk=ct,Hk=hr,$k=st,Gk=Xt,Vk=We;let hp=class extends Hk.Shape{_sceneFunc(t){var r=this.cornerRadius(),n=this.width(),i=this.height();t.beginPath(),r?Gk.Util.drawRoundedRectPath(t,n,i,r):t.rect(0,0,n,i),t.closePath(),t.fillStrokeShape(this)}};Hc.Rect=hp;hp.prototype.className="Rect";(0,$k._registerNode)(hp);Uk.Factory.addGetterSetter(hp,"cornerRadius",0,(0,Vk.getNumberOrArrayOfNumbersValidator)(4));var pp={};Object.defineProperty(pp,"__esModule",{value:!0});pp.RegularPolygon=void 0;const w9=ct,qk=hr,S9=We,Wk=st;let yl=class extends qk.Shape{_sceneFunc(t){const r=this._getPoints();t.beginPath(),t.moveTo(r[0].x,r[0].y);for(var n=1;n<r.length;n++)t.lineTo(r[n].x,r[n].y);t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,r=this.attrs.radius||0,n=[];for(var i=0;i<t;i++)n.push({x:r*Math.sin(i*2*Math.PI/t),y:-1*r*Math.cos(i*2*Math.PI/t)});return n}getSelfRect(){const t=this._getPoints();var r=t[0].x,n=t[0].y,i=t[0].x,a=t[0].y;return t.forEach(o=>{r=Math.min(r,o.x),n=Math.max(n,o.x),i=Math.min(i,o.y),a=Math.max(a,o.y)}),{x:r,y:i,width:n-r,height:a-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}};pp.RegularPolygon=yl;yl.prototype.className="RegularPolygon";yl.prototype._centroid=!0;yl.prototype._attrsAffectingSize=["radius"];(0,Wk._registerNode)(yl);w9.Factory.addGetterSetter(yl,"radius",0,(0,S9.getNumberValidator)());w9.Factory.addGetterSetter(yl,"sides",0,(0,S9.getNumberValidator)());var gp={};Object.defineProperty(gp,"__esModule",{value:!0});gp.Ring=void 0;const E9=ct,Kk=hr,O9=We,Yk=st;var U5=Math.PI*2;let bl=class extends Kk.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,U5,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),U5,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}};gp.Ring=bl;bl.prototype.className="Ring";bl.prototype._centroid=!0;bl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,Yk._registerNode)(bl);E9.Factory.addGetterSetter(bl,"innerRadius",0,(0,O9.getNumberValidator)());E9.Factory.addGetterSetter(bl,"outerRadius",0,(0,O9.getNumberValidator)());var vp={};Object.defineProperty(vp,"__esModule",{value:!0});vp.Sprite=void 0;const _l=ct,Xk=hr,Zk=Gs,P9=We,Qk=st;let Yi=class extends Xk.Shape{constructor(t){super(t),this._updated=!0,this.anim=new Zk.Animation(()=>{var r=this._updated;return this._updated=!1,r}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),l=a[i+0],u=a[i+1],f=a[i+2],g=a[i+3],S=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,f,g),t.closePath(),t.fillStrokeShape(this)),S)if(o){var _=o[r],h=n*2;t.drawImage(S,l,u,f,g,_[h+0],_[h+1],f,g)}else t.drawImage(S,l,u,f,g,0,0,f,g)}_hitFunc(t){var r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),l=a[i+2],u=a[i+3];if(t.beginPath(),o){var f=o[r],g=n*2;t.rect(f[g+0],f[g+1],l,u)}else t.rect(0,0,l,u);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),r=this.animation(),n=this.animations(),i=n[r],a=i.length/4;t<a-1?this.frameIndex(t+1):this.frameIndex(0)}};vp.Sprite=Yi;Yi.prototype.className="Sprite";(0,Qk._registerNode)(Yi);_l.Factory.addGetterSetter(Yi,"animation");_l.Factory.addGetterSetter(Yi,"animations");_l.Factory.addGetterSetter(Yi,"frameOffsets");_l.Factory.addGetterSetter(Yi,"image");_l.Factory.addGetterSetter(Yi,"frameIndex",0,(0,P9.getNumberValidator)());_l.Factory.addGetterSetter(Yi,"frameRate",17,(0,P9.getNumberValidator)());_l.Factory.backCompat(Yi,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var mp={};Object.defineProperty(mp,"__esModule",{value:!0});mp.Star=void 0;const Hy=ct,Jk=hr,$y=We,eA=st;let _o=class extends Jk.Shape{_sceneFunc(t){var r=this.innerRadius(),n=this.outerRadius(),i=this.numPoints();t.beginPath(),t.moveTo(0,0-n);for(var a=1;a<i*2;a++){var o=a%2===0?n:r,l=o*Math.sin(a*Math.PI/i),u=-1*o*Math.cos(a*Math.PI/i);t.lineTo(l,u)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}};mp.Star=_o;_o.prototype.className="Star";_o.prototype._centroid=!0;_o.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,eA._registerNode)(_o);Hy.Factory.addGetterSetter(_o,"numPoints",5,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(_o,"innerRadius",0,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(_o,"outerRadius",0,(0,$y.getNumberValidator)());var ll={};Object.defineProperty(ll,"__esModule",{value:!0});ll.Text=ll.stringToArray=void 0;const hm=Xt,qr=ct,tA=hr,Y1=st,wo=We,rA=st;function x9(e){return Array.from(e)}ll.stringToArray=x9;var Gl="auto",nA="center",C9="inherit",Cu="justify",iA="Change.konva",aA="2d",H5="-",T9="left",oA="text",lA="Text",sA="top",uA="bottom",$5="middle",k9="normal",cA="px ",hd=" ",fA="right",G5="rtl",dA="word",hA="char",V5="none",X1="…",A9=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],pA=A9.length;function gA(e){return e.split(",").map(t=>{t=t.trim();const r=t.indexOf(" ")>=0,n=t.indexOf('"')>=0||t.indexOf("'")>=0;return r&&!n&&(t=`"${t}"`),t}).join(", ")}var pd;function Z1(){return pd||(pd=hm.Util.createCanvasElement().getContext(aA),pd)}function vA(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function mA(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function yA(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let Jt=class extends tA.Shape{constructor(t){super(yA(t)),this._partialTextX=0,this._partialTextY=0;for(var r=0;r<pA;r++)this.on(A9[r]+iA,this._setTextData);this._setTextData()}_sceneFunc(t){var r=this.textArr,n=r.length;if(this.text()){var i=this.padding(),a=this.fontSize(),o=this.lineHeight()*a,l=this.verticalAlign(),u=this.direction(),f=0,g=this.align(),S=this.getWidth(),_=this.letterSpacing(),h=this.fill(),w=this.textDecoration(),m=w.indexOf("underline")!==-1,y=w.indexOf("line-through")!==-1,p;u=u===C9?t.direction:u;var v=o/2,d=$5;if(Y1.Konva._fixTextRendering){var b=this.measureSize("M");d="alphabetic",v=(b.fontBoundingBoxAscent-b.fontBoundingBoxDescent)/2+o/2}var O=0,R=0;for(u===G5&&t.setAttr("direction",u),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",d),t.setAttr("textAlign",T9),l===$5?f=(this.getHeight()-n*o-i*2)/2:l===uA&&(f=this.getHeight()-n*o-i*2),t.translate(i,f+i),p=0;p<n;p++){var O=0,R=0,T=r[p],E=T.text,P=T.width,x=T.lastInParagraph,k,M,j;if(t.save(),g===fA?O+=S-P-i*2:g===nA&&(O+=(S-P-i*2)/2),m){t.save(),t.beginPath();let q=Y1.Konva._fixTextRendering?Math.round(a/4):Math.round(a/2);const A=O,L=v+R+q;t.moveTo(A,L),k=E.split(" ").length-1,M=k===0,j=g===Cu&&!x?S-i*2:P,t.lineTo(A+Math.round(j),L),t.lineWidth=a/15;const z=this._getLinearGradient();t.strokeStyle=z||h,t.stroke(),t.restore()}if(y){t.save(),t.beginPath();let q=Y1.Konva._fixTextRendering?-Math.round(a/4):0;t.moveTo(O,v+R+q),k=E.split(" ").length-1,M=k===0,j=g===Cu&&x&&!M?S-i*2:P,t.lineTo(O+Math.round(j),v+R+q),t.lineWidth=a/15;const A=this._getLinearGradient();t.strokeStyle=A||h,t.stroke(),t.restore()}if(u!==G5&&(_!==0||g===Cu)){k=E.split(" ").length-1;for(var B=x9(E),$=0;$<B.length;$++){var Z=B[$];Z===" "&&!x&&g===Cu&&(O+=(S-i*2-P)/k),this._partialTextX=O,this._partialTextY=v+R,this._partialText=Z,t.fillStrokeShape(this),O+=this.measureSize(Z).width+_}}else _!==0&&t.setAttr("letterSpacing",`${_}px`),this._partialTextX=O,this._partialTextY=v+R,this._partialText=E,t.fillStrokeShape(this);t.restore(),n>1&&(v+=o)}}}_hitFunc(t){var r=this.getWidth(),n=this.getHeight();t.beginPath(),t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)}setText(t){var r=hm.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(oA,r),this}getWidth(){var t=this.attrs.width===Gl||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Gl||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return hm.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var r=Z1(),n=this.fontSize(),i;return r.save(),r.font=this._getContextFont(),i=r.measureText(t),r.restore(),{actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,alphabeticBaseline:i.alphabeticBaseline,emHeightAscent:i.emHeightAscent,emHeightDescent:i.emHeightDescent,fontBoundingBoxAscent:i.fontBoundingBoxAscent,fontBoundingBoxDescent:i.fontBoundingBoxDescent,hangingBaseline:i.hangingBaseline,ideographicBaseline:i.ideographicBaseline,width:i.width,height:n}}_getContextFont(){return this.fontStyle()+hd+this.fontVariant()+hd+(this.fontSize()+cA)+gA(this.fontFamily())}_addTextLine(t){this.align()===Cu&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var r=this.letterSpacing(),n=t.length;return Z1().measureText(t).width+(n?r*(n-1):0)}_setTextData(){var t=this.text().split(`
|
|
43
|
+
`),r=+this.fontSize(),n=0,i=this.lineHeight()*r,a=this.attrs.width,o=this.attrs.height,l=a!==Gl&&a!==void 0,u=o!==Gl&&o!==void 0,f=this.padding(),g=a-f*2,S=o-f*2,_=0,h=this.wrap(),w=h!==V5,m=h!==hA&&w,y=this.ellipsis();this.textArr=[],Z1().font=this._getContextFont();for(var p=y?this._getTextWidth(X1):0,v=0,d=t.length;v<d;++v){var b=t[v],O=this._getTextWidth(b);if(l&&O>g)for(;b.length>0;){for(var R=0,T=b.length,E="",P=0;R<T;){var x=R+T>>>1,k=b.slice(0,x+1),M=this._getTextWidth(k)+p;M<=g?(R=x+1,E=k,P=M):T=x}if(E){if(m){var j,B=b[E.length],$=B===hd||B===H5;$&&P<=g?j=E.length:j=Math.max(E.lastIndexOf(hd),E.lastIndexOf(H5))+1,j>0&&(R=j,E=E.slice(0,R),P=this._getTextWidth(E))}E=E.trimRight(),this._addTextLine(E),n=Math.max(n,P),_+=i;var Z=this._shouldHandleEllipsis(_);if(Z){this._tryToAddEllipsisToLastLine();break}if(b=b.slice(R),b=b.trimLeft(),b.length>0&&(O=this._getTextWidth(b),O<=g)){this._addTextLine(b),_+=i,n=Math.max(n,O);break}}else break}else this._addTextLine(b),_+=i,n=Math.max(n,O),this._shouldHandleEllipsis(_)&&v<d-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&_+i>S)break}this.textHeight=r,this.textWidth=n}_shouldHandleEllipsis(t){var r=+this.fontSize(),n=this.lineHeight()*r,i=this.attrs.height,a=i!==Gl&&i!==void 0,o=this.padding(),l=i-o*2,u=this.wrap(),f=u!==V5;return!f||a&&t+n>l}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,r=t!==Gl&&t!==void 0,n=this.padding(),i=t-n*2,a=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(!(!o||!a)){if(r){var l=this._getTextWidth(o.text+X1)<i;l||(o.text=o.text.slice(0,o.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+X1)}}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,r=this.hasShadow();return t&&r?!0:super._useBufferCanvas()}};ll.Text=Jt;Jt.prototype._fillFunc=vA;Jt.prototype._strokeFunc=mA;Jt.prototype.className=lA;Jt.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,rA._registerNode)(Jt);qr.Factory.overWriteSetter(Jt,"width",(0,wo.getNumberOrAutoValidator)());qr.Factory.overWriteSetter(Jt,"height",(0,wo.getNumberOrAutoValidator)());qr.Factory.addGetterSetter(Jt,"direction",C9);qr.Factory.addGetterSetter(Jt,"fontFamily","Arial");qr.Factory.addGetterSetter(Jt,"fontSize",12,(0,wo.getNumberValidator)());qr.Factory.addGetterSetter(Jt,"fontStyle",k9);qr.Factory.addGetterSetter(Jt,"fontVariant",k9);qr.Factory.addGetterSetter(Jt,"padding",0,(0,wo.getNumberValidator)());qr.Factory.addGetterSetter(Jt,"align",T9);qr.Factory.addGetterSetter(Jt,"verticalAlign",sA);qr.Factory.addGetterSetter(Jt,"lineHeight",1,(0,wo.getNumberValidator)());qr.Factory.addGetterSetter(Jt,"wrap",dA);qr.Factory.addGetterSetter(Jt,"ellipsis",!1,(0,wo.getBooleanValidator)());qr.Factory.addGetterSetter(Jt,"letterSpacing",0,(0,wo.getNumberValidator)());qr.Factory.addGetterSetter(Jt,"text","",(0,wo.getStringValidator)());qr.Factory.addGetterSetter(Jt,"textDecoration","");var yp={};Object.defineProperty(yp,"__esModule",{value:!0});yp.TextPath=void 0;const Q1=Xt,bi=ct,bA=hr,Tu=Vs,J1=ll,R9=We,_A=st;var wA="",M9="normal";function L9(e){e.fillText(this.partialText,0,0)}function N9(e){e.strokeText(this.partialText,0,0)}let pr=class extends bA.Shape{constructor(t){super(t),this.dummyCanvas=Q1.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 Tu.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const r=this.pathLength;return t-1>r?null:Tu.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Tu.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var r=this.textDecoration(),n=this.fill(),i=this.fontSize(),a=this.glyphInfo;r==="underline"&&t.beginPath();for(var o=0;o<a.length;o++){t.save();var l=a[o].p0;t.translate(l.x,l.y),t.rotate(a[o].rotation),this.partialText=a[o].text,t.fillStrokeShape(this),r==="underline"&&(o===0&&t.moveTo(0,i/2+1),t.lineTo(i,i/2+1)),t.restore()}r==="underline"&&(t.strokeStyle=n,t.lineWidth=i/20,t.stroke()),t.restore()}_hitFunc(t){t.beginPath();var r=this.glyphInfo;if(r.length>=1){var n=r[0].p0;t.moveTo(n.x,n.y)}for(var i=0;i<r.length;i++){var a=r[i].p1;t.lineTo(a.x,a.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return Q1.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return J1.Text.prototype.setText.call(this,t)}_getContextFont(){return J1.Text.prototype._getContextFont.call(this)}_getTextSize(t){var r=this.dummyCanvas,n=r.getContext("2d");n.save(),n.font=this._getContextFont();var i=n.measureText(t);return n.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:t,height:r}=this._getTextSize(this.attrs.text);if(this.textWidth=t,this.textHeight=r,this.glyphInfo=[],!this.attrs.data)return null;const n=this.letterSpacing(),i=this.align(),a=this.kerningFunc(),o=Math.max(this.textWidth+((this.attrs.text||"").length-1)*n,0);let l=0;i==="center"&&(l=Math.max(0,this.pathLength/2-o/2)),i==="right"&&(l=Math.max(0,this.pathLength-o));const u=(0,J1.stringToArray)(this.text());let f=l;for(var g=0;g<u.length;g++){const S=this._getPointAtLength(f);if(!S)return;let _=this._getTextSize(u[g]).width+n;if(u[g]===" "&&i==="justify"){const v=this.text().split(" ").length-1;_+=(this.pathLength-o)/v}const h=this._getPointAtLength(f+_);if(!h)return;const w=Tu.Path.getLineLength(S.x,S.y,h.x,h.y);let m=0;if(a)try{m=a(u[g-1],u[g])*this.fontSize()}catch{m=0}S.x+=m,h.x+=m,this.textWidth+=m;const y=Tu.Path.getPointOnLine(m+w/2,S.x,S.y,h.x,h.y),p=Math.atan2(h.y-S.y,h.x-S.x);this.glyphInfo.push({transposeX:y.x,transposeY:y.y,text:u[g],rotation:p,p0:S,p1:h}),f+=_}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(g){t.push(g.p0.x),t.push(g.p0.y),t.push(g.p1.x),t.push(g.p1.y)});for(var r=t[0]||0,n=t[0]||0,i=t[1]||0,a=t[1]||0,o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,l),a=Math.max(a,l);var f=this.fontSize();return{x:r-f/2,y:i-f/2,width:n-r+f,height:a-i+f}}destroy(){return Q1.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};yp.TextPath=pr;pr.prototype._fillFunc=L9;pr.prototype._strokeFunc=N9;pr.prototype._fillFuncHit=L9;pr.prototype._strokeFuncHit=N9;pr.prototype.className="TextPath";pr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,_A._registerNode)(pr);bi.Factory.addGetterSetter(pr,"data");bi.Factory.addGetterSetter(pr,"fontFamily","Arial");bi.Factory.addGetterSetter(pr,"fontSize",12,(0,R9.getNumberValidator)());bi.Factory.addGetterSetter(pr,"fontStyle",M9);bi.Factory.addGetterSetter(pr,"align","left");bi.Factory.addGetterSetter(pr,"letterSpacing",0,(0,R9.getNumberValidator)());bi.Factory.addGetterSetter(pr,"textBaseline","middle");bi.Factory.addGetterSetter(pr,"fontVariant",M9);bi.Factory.addGetterSetter(pr,"text",wA);bi.Factory.addGetterSetter(pr,"textDecoration",null);bi.Factory.addGetterSetter(pr,"kerningFunc",null);var bp={};Object.defineProperty(bp,"__esModule",{value:!0});bp.Transformer=void 0;const Tt=Xt,Ot=ct,q5=Gt,SA=hr,EA=Hc,W5=$s,ii=st,So=We,OA=st;var I9="tr-konva",PA=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${I9}`).join(" "),K5="nodesRect",xA=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],CA={"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 TA="ontouchstart"in ii.Konva._global;function kA(e,t,r){if(e==="rotater")return r;t+=Tt.Util.degToRad(CA[e]||0);var n=(Tt.Util.radToDeg(t)%360+360)%360;return Tt.Util._inRange(n,315+22.5,360)||Tt.Util._inRange(n,0,22.5)?"ns-resize":Tt.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":Tt.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":Tt.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":Tt.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":Tt.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":Tt.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":Tt.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(Tt.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var vh=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],Y5=1e8;function AA(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function D9(e,t,r){const n=r.x+(e.x-r.x)*Math.cos(t)-(e.y-r.y)*Math.sin(t),i=r.y+(e.x-r.x)*Math.sin(t)+(e.y-r.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:n,y:i}}function RA(e,t){const r=AA(e);return D9(e,t,r)}function MA(e,t,r){let n=t;for(let i=0;i<e.length;i++){const a=ii.Konva.getAngle(e[i]),o=Math.abs(a-t)%(Math.PI*2);Math.min(o,Math.PI*2-o)<r&&(n=a)}return n}let pm=0,vt=class extends W5.Group{constructor(t){super(t),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(PA,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return Tt.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return I9+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const r=t.filter(i=>i.isAncestorOf(this)?(Tt.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=r,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const a=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=i._attrsAffectingSize.map(l=>l+"Change."+this._getEventNamespace()).join(" ");i.on(o,a),i.on(xA.map(l=>l+`.${this._getEventNamespace()}`).join(" "),a),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,a),this._proxyDrag(i)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let r;t.on(`dragstart.${this._getEventNamespace()}`,n=>{r=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(n,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!r)return;const i=t.getAbsolutePosition(),a=i.x-r.x,o=i.y-r.y;this.nodes().forEach(l=>{if(l===t||l.isDragging())return;const u=l.getAbsolutePosition();l.setAbsolutePosition({x:u.x+a,y:u.y+o}),l.startDrag(n)}),r=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(K5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(K5,this.__getNodeRect)}__getNodeShape(t,r=this.rotation(),n){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=t.getAbsoluteScale(n),o=t.getAbsolutePosition(n),l=i.x*a.x-t.offsetX()*a.x,u=i.y*a.y-t.offsetY()*a.y;const f=(ii.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),g={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 D9(g,-ii.Konva.getAngle(r),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-Y5,y:-Y5,width:0,height:0,rotation:0};const r=[];this.nodes().map(f=>{const g=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var S=[{x:g.x,y:g.y},{x:g.x+g.width,y:g.y},{x:g.x+g.width,y:g.y+g.height},{x:g.x,y:g.y+g.height}],_=f.getAbsoluteTransform();S.forEach(function(h){var w=_.point(h);r.push(w)})});const n=new Tt.Transform;n.rotate(-ii.Konva.getAngle(this.rotation()));var i=1/0,a=1/0,o=-1/0,l=-1/0;r.forEach(function(f){var g=n.point(f);i===void 0&&(i=o=g.x,a=l=g.y),i=Math.min(i,g.x),a=Math.min(a,g.y),o=Math.max(o,g.x),l=Math.max(l,g.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:ii.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(),vh.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var r=new EA.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:TA?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=ii.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=kA(t,i,a);r.getStage().content&&(r.getStage().content.style.cursor=o),this._cursorChange=!0}),r.on("mouseout",()=>{r.getStage().content&&(r.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(r)}_createBack(){var t=new SA.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(r,n){var i=n.getParent(),a=i.padding();r.beginPath(),r.rect(-a,-a,n.width()+a*2,n.height()+a*2),r.moveTo(n.width()/2,-a),i.rotateEnabled()&&i.rotateLineVisible()&&r.lineTo(n.width()/2,-i.rotateAnchorOffset()*Tt.Util._sign(n.height())-a),r.fillStrokeShape(n)},hitFunc:(r,n)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();r.beginPath(),r.rect(-i,-i,n.width()+i*2,n.height()+i*2),r.fillStrokeShape(n)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",r=>{r.cancelBubble=!0}),t.on("dragmove",r=>{r.cancelBubble=!0}),t.on("dragend",r=>{r.cancelBubble=!0}),this.on("dragmove",r=>{this.update()})}_handleMouseDown(t){if(!this._transforming){this._movingAnchorName=t.target.name().split(" ")[0];var r=this._getNodeRect(),n=r.width,i=r.height,a=Math.sqrt(Math.pow(n,2)+Math.pow(i,2));this.sin=Math.abs(i/a),this.cos=Math.abs(n/a),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var o=t.target.getAbsolutePosition(),l=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:l.x-o.x,y:l.y-o.y},pm++,this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(u=>{u._fire("transformstart",{evt:t.evt,target:u})})}}_handleMouseMove(t){var r,n,i,a=this.findOne("."+this._movingAnchorName),o=a.getStage();o.setPointersPositions(t);const l=o.getPointerPosition();let u={x:l.x-this._anchorDragOffset.x,y:l.y-this._anchorDragOffset.y};const f=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(u=this.anchorDragBoundFunc()(f,u,t)),a.setAbsolutePosition(u);const g=a.getAbsolutePosition();if(!(f.x===g.x&&f.y===g.y)){if(this._movingAnchorName==="rotater"){var S=this._getNodeRect();r=a.x()-S.width/2,n=-a.y()+S.height/2;let j=Math.atan2(-n,r)+Math.PI/2;S.height<0&&(j-=Math.PI);var _=ii.Konva.getAngle(this.rotation());const B=_+j,$=ii.Konva.getAngle(this.rotationSnapTolerance()),K=MA(this.rotationSnaps(),B,$)-S.rotation,D=RA(S,K);this._fitNodesInto(D,t);return}var h=this.shiftBehavior(),w;h==="inverted"?w=this.keepRatio()&&!t.shiftKey:h==="none"?w=this.keepRatio():w=this.keepRatio()||t.shiftKey;var d=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(w){var m=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(m.x-a.x(),2)+Math.pow(m.y-a.y(),2));var y=this.findOne(".top-left").x()>m.x?-1:1,p=this.findOne(".top-left").y()>m.y?-1:1;r=i*this.cos*y,n=i*this.sin*p,this.findOne(".top-left").x(m.x-r),this.findOne(".top-left").y(m.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(w){var m=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(a.x()-m.x,2)+Math.pow(m.y-a.y(),2));var y=this.findOne(".top-right").x()<m.x?-1:1,p=this.findOne(".top-right").y()>m.y?-1:1;r=i*this.cos*y,n=i*this.sin*p,this.findOne(".top-right").x(m.x+r),this.findOne(".top-right").y(m.y-n)}var v=a.position();this.findOne(".top-left").y(v.y),this.findOne(".bottom-right").x(v.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 m=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(m.x-a.x(),2)+Math.pow(a.y()-m.y,2));var y=m.x<a.x()?-1:1,p=a.y()<m.y?-1:1;r=i*this.cos*y,n=i*this.sin*p,a.x(m.x-r),a.y(m.y+n)}v=a.position(),this.findOne(".top-left").x(v.x),this.findOne(".bottom-right").y(v.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(w){var m=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(a.x()-m.x,2)+Math.pow(a.y()-m.y,2));var y=this.findOne(".bottom-right").x()<m.x?-1:1,p=this.findOne(".bottom-right").y()<m.y?-1:1;r=i*this.cos*y,n=i*this.sin*p,this.findOne(".bottom-right").x(m.x+r),this.findOne(".bottom-right").y(m.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var d=this.centeredScaling()||t.altKey;if(d){var b=this.findOne(".top-left"),O=this.findOne(".bottom-right"),R=b.x(),T=b.y(),E=this.getWidth()-O.x(),P=this.getHeight()-O.y();O.move({x:-R,y:-T}),b.move({x:E,y:P})}var x=this.findOne(".top-left").getAbsolutePosition();r=x.x,n=x.y;var k=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:k,height:M,rotation:ii.Konva.getAngle(this.rotation())},t)}}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){var r;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));var n=this.getNode();pm--,this._fire("transformend",{evt:t,target:n}),(r=this.getLayer())===null||r===void 0||r.batchDraw(),n&&this._nodes.forEach(i=>{var a;i._fire("transformend",{evt:t,target:i}),(a=i.getLayer())===null||a===void 0||a.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(t,r){var n=this._getNodeRect();const i=1;if(Tt.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(Tt.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}var a=new Tt.Transform;if(a.rotate(ii.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const _=a.point({x:-this.padding()*2,y:0});t.x+=_.x,t.y+=_.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const _=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const _=a.point({x:0,y:-this.padding()*2});t.x+=_.x,t.y+=_.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const _=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const _=this.boundBoxFunc()(n,t);_?t=_:Tt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,l=new Tt.Transform;l.translate(n.x,n.y),l.rotate(n.rotation),l.scale(n.width/o,n.height/o);const u=new Tt.Transform,f=t.width/o,g=t.height/o;this.flipEnabled()===!1?(u.translate(t.x,t.y),u.rotate(t.rotation),u.translate(t.width<0?t.width:0,t.height<0?t.height:0),u.scale(Math.abs(f),Math.abs(g))):(u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(f,g));const S=u.multiply(l.invert());this._nodes.forEach(_=>{var h;const w=_.getParent().getAbsoluteTransform(),m=_.getTransform().copy();m.translate(_.offsetX(),_.offsetY());const y=new Tt.Transform;y.multiply(w.copy().invert()).multiply(S).multiply(w).multiply(m);const p=y.decompose();_.setAttrs(p),(h=_.getLayer())===null||h===void 0||h.batchDraw()}),this.rotation(Tt.Util._getRotation(t.rotation)),this._nodes.forEach(_=>{this._fire("transform",{evt:r,target:_}),_._fire("transform",{evt:r,target:_})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,r){this.findOne(t).setAttrs(r)}update(){var t,r=this._getNodeRect();this.rotation(Tt.Util._getRotation(r.rotation));var n=r.width,i=r.height,a=this.enabledAnchors(),o=this.resizeEnabled(),l=this.padding(),u=this.anchorSize();const f=this.find("._anchor");f.forEach(S=>{S.setAttrs({width:u,height:u,offsetX:u/2,offsetY:u/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:u/2+l,offsetY:u/2+l,visible:o&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:u/2+l,visible:o&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:u/2-l,offsetY:u/2+l,visible:o&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:u/2+l,visible:o&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:i/2,offsetX:u/2-l,visible:o&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:u/2+l,offsetY:u/2-l,visible:o&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:i,offsetY:u/2-l,visible:o&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:i,offsetX:u/2-l,offsetY:u/2-l,visible:o&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*Tt.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 g=this.anchorStyleFunc();g&&f.forEach(S=>{g(S)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),W5.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return q5.Node.prototype.toObject.call(this)}clone(t){var r=q5.Node.prototype.clone.call(this,t);return r}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};bp.Transformer=vt;vt.isTransforming=()=>pm>0;function LA(e){return e instanceof Array||Tt.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){vh.indexOf(t)===-1&&Tt.Util.warn("Unknown anchor name: "+t+". Available names are: "+vh.join(", "))}),e||[]}vt.prototype.className="Transformer";(0,OA._registerNode)(vt);Ot.Factory.addGetterSetter(vt,"enabledAnchors",vh,LA);Ot.Factory.addGetterSetter(vt,"flipEnabled",!0,(0,So.getBooleanValidator)());Ot.Factory.addGetterSetter(vt,"resizeEnabled",!0);Ot.Factory.addGetterSetter(vt,"anchorSize",10,(0,So.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"rotateEnabled",!0);Ot.Factory.addGetterSetter(vt,"rotateLineVisible",!0);Ot.Factory.addGetterSetter(vt,"rotationSnaps",[]);Ot.Factory.addGetterSetter(vt,"rotateAnchorOffset",50,(0,So.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"rotateAnchorCursor","crosshair");Ot.Factory.addGetterSetter(vt,"rotationSnapTolerance",5,(0,So.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"borderEnabled",!0);Ot.Factory.addGetterSetter(vt,"anchorStroke","rgb(0, 161, 255)");Ot.Factory.addGetterSetter(vt,"anchorStrokeWidth",1,(0,So.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"anchorFill","white");Ot.Factory.addGetterSetter(vt,"anchorCornerRadius",0,(0,So.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"borderStroke","rgb(0, 161, 255)");Ot.Factory.addGetterSetter(vt,"borderStrokeWidth",1,(0,So.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"borderDash");Ot.Factory.addGetterSetter(vt,"keepRatio",!0);Ot.Factory.addGetterSetter(vt,"shiftBehavior","default");Ot.Factory.addGetterSetter(vt,"centeredScaling",!1);Ot.Factory.addGetterSetter(vt,"ignoreStroke",!1);Ot.Factory.addGetterSetter(vt,"padding",0,(0,So.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"node");Ot.Factory.addGetterSetter(vt,"nodes");Ot.Factory.addGetterSetter(vt,"boundBoxFunc");Ot.Factory.addGetterSetter(vt,"anchorDragBoundFunc");Ot.Factory.addGetterSetter(vt,"anchorStyleFunc");Ot.Factory.addGetterSetter(vt,"shouldOverdrawWholeArea",!1);Ot.Factory.addGetterSetter(vt,"useSingleNodeRotation",!0);Ot.Factory.backCompat(vt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.Wedge=void 0;const wp=ct,NA=hr,IA=st,j9=We,DA=st;let Oa=class extends NA.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,IA.Konva.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}};_p.Wedge=Oa;Oa.prototype.className="Wedge";Oa.prototype._centroid=!0;Oa.prototype._attrsAffectingSize=["radius"];(0,DA._registerNode)(Oa);wp.Factory.addGetterSetter(Oa,"radius",0,(0,j9.getNumberValidator)());wp.Factory.addGetterSetter(Oa,"angle",0,(0,j9.getNumberValidator)());wp.Factory.addGetterSetter(Oa,"clockwise",!1);wp.Factory.backCompat(Oa,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});Sp.Blur=void 0;const X5=ct,jA=Gt,FA=We;function Z5(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var zA=[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],BA=[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 UA(e,t){var r=e.data,n=e.width,i=e.height,a,o,l,u,f,g,S,_,h,w,m,y,p,v,d,b,O,R,T,E,P,x,k,M,j=t+t+1,B=n-1,$=i-1,Z=t+1,K=Z*(Z+1)/2,D=new Z5,q=null,A=D,L=null,z=null,I=zA[t],H=BA[t];for(l=1;l<j;l++)A=A.next=new Z5,l===Z&&(q=A);for(A.next=D,S=g=0,o=0;o<i;o++){for(b=O=R=T=_=h=w=m=0,y=Z*(E=r[g]),p=Z*(P=r[g+1]),v=Z*(x=r[g+2]),d=Z*(k=r[g+3]),_+=K*E,h+=K*P,w+=K*x,m+=K*k,A=D,l=0;l<Z;l++)A.r=E,A.g=P,A.b=x,A.a=k,A=A.next;for(l=1;l<Z;l++)u=g+((B<l?B:l)<<2),_+=(A.r=E=r[u])*(M=Z-l),h+=(A.g=P=r[u+1])*M,w+=(A.b=x=r[u+2])*M,m+=(A.a=k=r[u+3])*M,b+=E,O+=P,R+=x,T+=k,A=A.next;for(L=D,z=q,a=0;a<n;a++)r[g+3]=k=m*I>>H,k!==0?(k=255/k,r[g]=(_*I>>H)*k,r[g+1]=(h*I>>H)*k,r[g+2]=(w*I>>H)*k):r[g]=r[g+1]=r[g+2]=0,_-=y,h-=p,w-=v,m-=d,y-=L.r,p-=L.g,v-=L.b,d-=L.a,u=S+((u=a+t+1)<B?u:B)<<2,b+=L.r=r[u],O+=L.g=r[u+1],R+=L.b=r[u+2],T+=L.a=r[u+3],_+=b,h+=O,w+=R,m+=T,L=L.next,y+=E=z.r,p+=P=z.g,v+=x=z.b,d+=k=z.a,b-=E,O-=P,R-=x,T-=k,z=z.next,g+=4;S+=n}for(a=0;a<n;a++){for(O=R=T=b=h=w=m=_=0,g=a<<2,y=Z*(E=r[g]),p=Z*(P=r[g+1]),v=Z*(x=r[g+2]),d=Z*(k=r[g+3]),_+=K*E,h+=K*P,w+=K*x,m+=K*k,A=D,l=0;l<Z;l++)A.r=E,A.g=P,A.b=x,A.a=k,A=A.next;for(f=n,l=1;l<=t;l++)g=f+a<<2,_+=(A.r=E=r[g])*(M=Z-l),h+=(A.g=P=r[g+1])*M,w+=(A.b=x=r[g+2])*M,m+=(A.a=k=r[g+3])*M,b+=E,O+=P,R+=x,T+=k,A=A.next,l<$&&(f+=n);for(g=a,L=D,z=q,o=0;o<i;o++)u=g<<2,r[u+3]=k=m*I>>H,k>0?(k=255/k,r[u]=(_*I>>H)*k,r[u+1]=(h*I>>H)*k,r[u+2]=(w*I>>H)*k):r[u]=r[u+1]=r[u+2]=0,_-=y,h-=p,w-=v,m-=d,y-=L.r,p-=L.g,v-=L.b,d-=L.a,u=a+((u=o+Z)<$?u:$)*n<<2,_+=b+=L.r=r[u],h+=O+=L.g=r[u+1],w+=R+=L.b=r[u+2],m+=T+=L.a=r[u+3],L=L.next,y+=E=z.r,p+=P=z.g,v+=x=z.b,d+=k=z.a,b-=E,O-=P,R-=x,T-=k,z=z.next,g+=n}}const HA=function(t){var r=Math.round(this.blurRadius());r>0&&UA(t,r)};Sp.Blur=HA;X5.Factory.addGetterSetter(jA.Node,"blurRadius",0,(0,FA.getNumberValidator)(),X5.Factory.afterSetFilter);var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Brighten=void 0;const Q5=ct,$A=Gt,GA=We,VA=function(e){var t=this.brightness()*255,r=e.data,n=r.length,i;for(i=0;i<n;i+=4)r[i]+=t,r[i+1]+=t,r[i+2]+=t};Ep.Brighten=VA;Q5.Factory.addGetterSetter($A.Node,"brightness",0,(0,GA.getNumberValidator)(),Q5.Factory.afterSetFilter);var Op={};Object.defineProperty(Op,"__esModule",{value:!0});Op.Contrast=void 0;const J5=ct,qA=Gt,WA=We,KA=function(e){var t=Math.pow((this.contrast()+100)/100,2),r=e.data,n=r.length,i=150,a=150,o=150,l;for(l=0;l<n;l+=4)i=r[l],a=r[l+1],o=r[l+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,r[l]=i,r[l+1]=a,r[l+2]=o};Op.Contrast=KA;J5.Factory.addGetterSetter(qA.Node,"contrast",0,(0,WA.getNumberValidator)(),J5.Factory.afterSetFilter);var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});Pp.Emboss=void 0;const co=ct,xp=Gt,YA=Xt,F9=We,XA=function(e){var t=this.embossStrength()*10,r=this.embossWhiteLevel()*255,n=this.embossDirection(),i=this.embossBlend(),a=0,o=0,l=e.data,u=e.width,f=e.height,g=u*4,S=f;switch(n){case"top-left":a=-1,o=-1;break;case"top":a=-1,o=0;break;case"top-right":a=-1,o=1;break;case"right":a=0,o=1;break;case"bottom-right":a=1,o=1;break;case"bottom":a=1,o=0;break;case"bottom-left":a=1,o=-1;break;case"left":a=0,o=-1;break;default:YA.Util.error("Unknown emboss direction: "+n)}do{var _=(S-1)*g,h=a;S+h<1&&(h=0),S+h>f&&(h=0);var w=(S-1+h)*u*4,m=u;do{var y=_+(m-1)*4,p=o;m+p<1&&(p=0),m+p>u&&(p=0);var v=w+(m-1+p)*4,d=l[y]-l[v],b=l[y+1]-l[v+1],O=l[y+2]-l[v+2],R=d,T=R>0?R:-R,E=b>0?b:-b,P=O>0?O:-O;if(E>T&&(R=b),P>T&&(R=O),R*=t,i){var x=l[y]+R,k=l[y+1]+R,M=l[y+2]+R;l[y]=x>255?255:x<0?0:x,l[y+1]=k>255?255:k<0?0:k,l[y+2]=M>255?255:M<0?0:M}else{var j=r-R;j<0?j=0:j>255&&(j=255),l[y]=l[y+1]=l[y+2]=j}}while(--m)}while(--S)};Pp.Emboss=XA;co.Factory.addGetterSetter(xp.Node,"embossStrength",.5,(0,F9.getNumberValidator)(),co.Factory.afterSetFilter);co.Factory.addGetterSetter(xp.Node,"embossWhiteLevel",.5,(0,F9.getNumberValidator)(),co.Factory.afterSetFilter);co.Factory.addGetterSetter(xp.Node,"embossDirection","top-left",null,co.Factory.afterSetFilter);co.Factory.addGetterSetter(xp.Node,"embossBlend",!1,null,co.Factory.afterSetFilter);var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.Enhance=void 0;const e4=ct,ZA=Gt,QA=We;function eg(e,t,r,n,i){var a=r-t,o=i-n,l;return a===0?n+o/2:o===0?n:(l=(e-t)/a,l=o*l+n,l)}const JA=function(e){var t=e.data,r=t.length,n=t[0],i=n,a,o=t[1],l=o,u,f=t[2],g=f,S,_,h=this.enhance();if(h!==0){for(_=0;_<r;_+=4)a=t[_+0],a<n?n=a:a>i&&(i=a),u=t[_+1],u<o?o=u:u>l&&(l=u),S=t[_+2],S<f?f=S:S>g&&(g=S);i===n&&(i=255,n=0),l===o&&(l=255,o=0),g===f&&(g=255,f=0);var w,m,y,p,v,d,b,O,R;for(h>0?(m=i+h*(255-i),y=n-h*(n-0),v=l+h*(255-l),d=o-h*(o-0),O=g+h*(255-g),R=f-h*(f-0)):(w=(i+n)*.5,m=i+h*(i-w),y=n+h*(n-w),p=(l+o)*.5,v=l+h*(l-p),d=o+h*(o-p),b=(g+f)*.5,O=g+h*(g-b),R=f+h*(f-b)),_=0;_<r;_+=4)t[_+0]=eg(t[_+0],n,i,y,m),t[_+1]=eg(t[_+1],o,l,d,v),t[_+2]=eg(t[_+2],f,g,R,O)}};Cp.Enhance=JA;e4.Factory.addGetterSetter(ZA.Node,"enhance",0,(0,QA.getNumberValidator)(),e4.Factory.afterSetFilter);var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0});Tp.Grayscale=void 0;const eR=function(e){var t=e.data,r=t.length,n,i;for(n=0;n<r;n+=4)i=.34*t[n]+.5*t[n+1]+.16*t[n+2],t[n]=i,t[n+1]=i,t[n+2]=i};Tp.Grayscale=eR;var kp={};Object.defineProperty(kp,"__esModule",{value:!0});kp.HSL=void 0;const Ts=ct,Gy=Gt,Vy=We;Ts.Factory.addGetterSetter(Gy.Node,"hue",0,(0,Vy.getNumberValidator)(),Ts.Factory.afterSetFilter);Ts.Factory.addGetterSetter(Gy.Node,"saturation",0,(0,Vy.getNumberValidator)(),Ts.Factory.afterSetFilter);Ts.Factory.addGetterSetter(Gy.Node,"luminance",0,(0,Vy.getNumberValidator)(),Ts.Factory.afterSetFilter);const tR=function(e){var t=e.data,r=t.length,n=1,i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=this.luminance()*127,l,u=n*i*Math.cos(a*Math.PI/180),f=n*i*Math.sin(a*Math.PI/180),g=.299*n+.701*u+.167*f,S=.587*n-.587*u+.33*f,_=.114*n-.114*u-.497*f,h=.299*n-.299*u-.328*f,w=.587*n+.413*u+.035*f,m=.114*n-.114*u+.293*f,y=.299*n-.3*u+1.25*f,p=.587*n-.586*u-1.05*f,v=.114*n+.886*u-.2*f,d,b,O,R;for(l=0;l<r;l+=4)d=t[l+0],b=t[l+1],O=t[l+2],R=t[l+3],t[l+0]=g*d+S*b+_*O+o,t[l+1]=h*d+w*b+m*O+o,t[l+2]=y*d+p*b+v*O+o,t[l+3]=R};kp.HSL=tR;var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0});Ap.HSV=void 0;const ks=ct,qy=Gt,Wy=We,rR=function(e){var t=e.data,r=t.length,n=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o,l=n*i*Math.cos(a*Math.PI/180),u=n*i*Math.sin(a*Math.PI/180),f=.299*n+.701*l+.167*u,g=.587*n-.587*l+.33*u,S=.114*n-.114*l-.497*u,_=.299*n-.299*l-.328*u,h=.587*n+.413*l+.035*u,w=.114*n-.114*l+.293*u,m=.299*n-.3*l+1.25*u,y=.587*n-.586*l-1.05*u,p=.114*n+.886*l-.2*u,v,d,b,O;for(o=0;o<r;o+=4)v=t[o+0],d=t[o+1],b=t[o+2],O=t[o+3],t[o+0]=f*v+g*d+S*b,t[o+1]=_*v+h*d+w*b,t[o+2]=m*v+y*d+p*b,t[o+3]=O};Ap.HSV=rR;ks.Factory.addGetterSetter(qy.Node,"hue",0,(0,Wy.getNumberValidator)(),ks.Factory.afterSetFilter);ks.Factory.addGetterSetter(qy.Node,"saturation",0,(0,Wy.getNumberValidator)(),ks.Factory.afterSetFilter);ks.Factory.addGetterSetter(qy.Node,"value",0,(0,Wy.getNumberValidator)(),ks.Factory.afterSetFilter);var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.Invert=void 0;const nR=function(e){var t=e.data,r=t.length,n;for(n=0;n<r;n+=4)t[n]=255-t[n],t[n+1]=255-t[n+1],t[n+2]=255-t[n+2]};Rp.Invert=nR;var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});Mp.Kaleidoscope=void 0;const mh=ct,z9=Gt,t4=Xt,B9=We;var iR=function(e,t,r){var n=e.data,i=t.data,a=e.width,o=e.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,g,S,_=0,h=0,w=0,m=0,y,p=Math.sqrt(l*l+u*u);g=a-l,S=o-u,y=Math.sqrt(g*g+S*S),p=y>p?y:p;var v=o,d=a,b,O,R=360/d*Math.PI/180,T,E;for(O=0;O<d;O+=1)for(T=Math.sin(O*R),E=Math.cos(O*R),b=0;b<v;b+=1)g=Math.floor(l+p*b/v*E),S=Math.floor(u+p*b/v*T),f=(S*a+g)*4,_=n[f+0],h=n[f+1],w=n[f+2],m=n[f+3],f=(O+b*a)*4,i[f+0]=_,i[f+1]=h,i[f+2]=w,i[f+3]=m},aR=function(e,t,r){var n=e.data,i=t.data,a=e.width,o=e.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,g,S,_,h,w=0,m=0,y=0,p=0,v,d=Math.sqrt(l*l+u*u);g=a-l,S=o-u,v=Math.sqrt(g*g+S*S),d=v>d?v:d;var b=o,O=a,R,T,E=0,P,x;for(g=0;g<a;g+=1)for(S=0;S<o;S+=1)_=g-l,h=S-u,R=Math.sqrt(_*_+h*h)*b/d,T=(Math.atan2(h,_)*180/Math.PI+360+E)%360,T=T*O/360,P=Math.floor(T),x=Math.floor(R),f=(x*a+P)*4,w=n[f+0],m=n[f+1],y=n[f+2],p=n[f+3],f=(S*a+g)*4,i[f+0]=w,i[f+1]=m,i[f+2]=y,i[f+3]=p};const oR=function(e){var t=e.width,r=e.height,n,i,a,o,l,u,f,g,S,_,h=Math.round(this.kaleidoscopePower()),w=Math.round(this.kaleidoscopeAngle()),m=Math.floor(t*(w%360)/360);if(!(h<1)){var y=t4.Util.createCanvasElement();y.width=t,y.height=r;var p=y.getContext("2d").getImageData(0,0,t,r);t4.Util.releaseCanvas(y),iR(e,p,{polarCenterX:t/2,polarCenterY:r/2});for(var v=t/Math.pow(2,h);v<=8;)v=v*2,h-=1;v=Math.ceil(v);var d=v,b=0,O=d,R=1;for(m+v>t&&(b=d,O=0,R=-1),i=0;i<r;i+=1)for(n=b;n!==O;n+=R)a=Math.round(n+m)%t,S=(t*i+a)*4,l=p.data[S+0],u=p.data[S+1],f=p.data[S+2],g=p.data[S+3],_=(t*i+n)*4,p.data[_+0]=l,p.data[_+1]=u,p.data[_+2]=f,p.data[_+3]=g;for(i=0;i<r;i+=1)for(d=Math.floor(v),o=0;o<h;o+=1){for(n=0;n<d+1;n+=1)S=(t*i+n)*4,l=p.data[S+0],u=p.data[S+1],f=p.data[S+2],g=p.data[S+3],_=(t*i+d*2-n-1)*4,p.data[_+0]=l,p.data[_+1]=u,p.data[_+2]=f,p.data[_+3]=g;d*=2}aR(p,e,{polarRotation:0})}};Mp.Kaleidoscope=oR;mh.Factory.addGetterSetter(z9.Node,"kaleidoscopePower",2,(0,B9.getNumberValidator)(),mh.Factory.afterSetFilter);mh.Factory.addGetterSetter(z9.Node,"kaleidoscopeAngle",0,(0,B9.getNumberValidator)(),mh.Factory.afterSetFilter);var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});Lp.Mask=void 0;const r4=ct,lR=Gt,sR=We;function gd(e,t,r){var n=(r*e.width+t)*4,i=[];return i.push(e.data[n++],e.data[n++],e.data[n++],e.data[n++]),i}function ku(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function uR(e){for(var t=[0,0,0],r=0;r<e.length;r++)t[0]+=e[r][0],t[1]+=e[r][1],t[2]+=e[r][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function cR(e,t){var r=gd(e,0,0),n=gd(e,e.width-1,0),i=gd(e,0,e.height-1),a=gd(e,e.width-1,e.height-1),o=t||10;if(ku(r,n)<o&&ku(n,a)<o&&ku(a,i)<o&&ku(i,r)<o){for(var l=uR([n,r,a,i]),u=[],f=0;f<e.width*e.height;f++){var g=ku(l,[e.data[f*4],e.data[f*4+1],e.data[f*4+2]]);u[f]=g<o?0:255}return u}}function fR(e,t){for(var r=0;r<e.width*e.height;r++)e.data[4*r+3]=t[r]}function dR(e,t,r){for(var n=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,g=0,S=0;S<i;S++)for(var _=0;_<i;_++){var h=l+S-a,w=u+_-a;if(h>=0&&h<r&&w>=0&&w<t){var m=h*t+w,y=n[S*i+_];g+=e[m]*y}}o[f]=g===255*8?255:0}return o}function hR(e,t,r){for(var n=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,g=0,S=0;S<i;S++)for(var _=0;_<i;_++){var h=l+S-a,w=u+_-a;if(h>=0&&h<r&&w>=0&&w<t){var m=h*t+w,y=n[S*i+_];g+=e[m]*y}}o[f]=g>=255*4?255:0}return o}function pR(e,t,r){for(var n=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,g=0,S=0;S<i;S++)for(var _=0;_<i;_++){var h=l+S-a,w=u+_-a;if(h>=0&&h<r&&w>=0&&w<t){var m=h*t+w,y=n[S*i+_];g+=e[m]*y}}o[f]=g}return o}const gR=function(e){var t=this.threshold(),r=cR(e,t);return r&&(r=dR(r,e.width,e.height),r=hR(r,e.width,e.height),r=pR(r,e.width,e.height),fR(e,r)),e};Lp.Mask=gR;r4.Factory.addGetterSetter(lR.Node,"threshold",0,(0,sR.getNumberValidator)(),r4.Factory.afterSetFilter);var Np={};Object.defineProperty(Np,"__esModule",{value:!0});Np.Noise=void 0;const n4=ct,vR=Gt,mR=We,yR=function(e){var t=this.noise()*255,r=e.data,n=r.length,i=t/2,a;for(a=0;a<n;a+=4)r[a+0]+=i-2*i*Math.random(),r[a+1]+=i-2*i*Math.random(),r[a+2]+=i-2*i*Math.random()};Np.Noise=yR;n4.Factory.addGetterSetter(vR.Node,"noise",.2,(0,mR.getNumberValidator)(),n4.Factory.afterSetFilter);var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.Pixelate=void 0;const i4=ct,bR=Xt,_R=Gt,wR=We,SR=function(e){var t=Math.ceil(this.pixelSize()),r=e.width,n=e.height,i,a,o,l,u,f,g,S=Math.ceil(r/t),_=Math.ceil(n/t),h,w,m,y,p,v,d,b=e.data;if(t<=0){bR.Util.error("pixelSize value can not be <= 0");return}for(p=0;p<S;p+=1)for(v=0;v<_;v+=1){for(l=0,u=0,f=0,g=0,h=p*t,w=h+t,m=v*t,y=m+t,d=0,i=h;i<w;i+=1)if(!(i>=r))for(a=m;a<y;a+=1)a>=n||(o=(r*a+i)*4,l+=b[o+0],u+=b[o+1],f+=b[o+2],g+=b[o+3],d+=1);for(l=l/d,u=u/d,f=f/d,g=g/d,i=h;i<w;i+=1)if(!(i>=r))for(a=m;a<y;a+=1)a>=n||(o=(r*a+i)*4,b[o+0]=l,b[o+1]=u,b[o+2]=f,b[o+3]=g)}};Ip.Pixelate=SR;i4.Factory.addGetterSetter(_R.Node,"pixelSize",8,(0,wR.getNumberValidator)(),i4.Factory.afterSetFilter);var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0});Dp.Posterize=void 0;const a4=ct,ER=Gt,OR=We,PR=function(e){var t=Math.round(this.levels()*254)+1,r=e.data,n=r.length,i=255/t,a;for(a=0;a<n;a+=1)r[a]=Math.floor(r[a]/i)*i};Dp.Posterize=PR;a4.Factory.addGetterSetter(ER.Node,"levels",.5,(0,OR.getNumberValidator)(),a4.Factory.afterSetFilter);var jp={};Object.defineProperty(jp,"__esModule",{value:!0});jp.RGB=void 0;const yh=ct,Ky=Gt,xR=We,CR=function(e){var t=e.data,r=t.length,n=this.red(),i=this.green(),a=this.blue(),o,l;for(o=0;o<r;o+=4)l=(.34*t[o]+.5*t[o+1]+.16*t[o+2])/255,t[o]=l*n,t[o+1]=l*i,t[o+2]=l*a,t[o+3]=t[o+3]};jp.RGB=CR;yh.Factory.addGetterSetter(Ky.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});yh.Factory.addGetterSetter(Ky.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});yh.Factory.addGetterSetter(Ky.Node,"blue",0,xR.RGBComponent,yh.Factory.afterSetFilter);var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0});Fp.RGBA=void 0;const vc=ct,zp=Gt,TR=We,kR=function(e){var t=e.data,r=t.length,n=this.red(),i=this.green(),a=this.blue(),o=this.alpha(),l,u;for(l=0;l<r;l+=4)u=1-o,t[l]=n*o+t[l]*u,t[l+1]=i*o+t[l+1]*u,t[l+2]=a*o+t[l+2]*u};Fp.RGBA=kR;vc.Factory.addGetterSetter(zp.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});vc.Factory.addGetterSetter(zp.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});vc.Factory.addGetterSetter(zp.Node,"blue",0,TR.RGBComponent,vc.Factory.afterSetFilter);vc.Factory.addGetterSetter(zp.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0});Bp.Sepia=void 0;const AR=function(e){var t=e.data,r=t.length,n,i,a,o;for(n=0;n<r;n+=4)i=t[n+0],a=t[n+1],o=t[n+2],t[n+0]=Math.min(255,i*.393+a*.769+o*.189),t[n+1]=Math.min(255,i*.349+a*.686+o*.168),t[n+2]=Math.min(255,i*.272+a*.534+o*.131)};Bp.Sepia=AR;var Up={};Object.defineProperty(Up,"__esModule",{value:!0});Up.Solarize=void 0;const RR=function(e){var t=e.data,r=e.width,n=e.height,i=r*4,a=n;do{var o=(a-1)*i,l=r;do{var u=o+(l-1)*4,f=t[u],g=t[u+1],S=t[u+2];f>127&&(f=255-f),g>127&&(g=255-g),S>127&&(S=255-S),t[u]=f,t[u+1]=g,t[u+2]=S}while(--l)}while(--a)};Up.Solarize=RR;var Hp={};Object.defineProperty(Hp,"__esModule",{value:!0});Hp.Threshold=void 0;const o4=ct,MR=Gt,LR=We,NR=function(e){var t=this.threshold()*255,r=e.data,n=r.length,i;for(i=0;i<n;i+=1)r[i]=r[i]<t?0:255};Hp.Threshold=NR;o4.Factory.addGetterSetter(MR.Node,"threshold",.5,(0,LR.getNumberValidator)(),o4.Factory.afterSetFilter);Object.defineProperty(Zh,"__esModule",{value:!0});Zh.Konva=void 0;const l4=ph,IR=np,DR=op,jR=up,FR=cp,zR=fp,s4=Cs,BR=zc,UR=Vs,HR=Hc,$R=pp,GR=gp,VR=vp,qR=mp,WR=ll,KR=yp,YR=bp,XR=_p,ZR=Sp,QR=Ep,JR=Op,eM=Pp,tM=Cp,rM=Tp,nM=kp,iM=Ap,aM=Rp,oM=Mp,lM=Lp,sM=Np,uM=Ip,cM=Dp,fM=jp,dM=Fp,hM=Bp,pM=Up,gM=Hp;Zh.Konva=l4.Konva.Util._assign(l4.Konva,{Arc:IR.Arc,Arrow:DR.Arrow,Circle:jR.Circle,Ellipse:FR.Ellipse,Image:zR.Image,Label:s4.Label,Tag:s4.Tag,Line:BR.Line,Path:UR.Path,Rect:HR.Rect,RegularPolygon:$R.RegularPolygon,Ring:GR.Ring,Sprite:VR.Sprite,Star:qR.Star,Text:WR.Text,TextPath:KR.TextPath,Transformer:YR.Transformer,Wedge:XR.Wedge,Filters:{Blur:ZR.Blur,Brighten:QR.Brighten,Contrast:JR.Contrast,Emboss:eM.Emboss,Enhance:tM.Enhance,Grayscale:rM.Grayscale,HSL:nM.HSL,HSV:iM.HSV,Invert:aM.Invert,Kaleidoscope:oM.Kaleidoscope,Mask:lM.Mask,Noise:sM.Noise,Pixelate:uM.Pixelate,Posterize:cM.Posterize,RGB:fM.RGB,RGBA:dM.RGBA,Sepia:hM.Sepia,Solarize:pM.Solarize,Threshold:gM.Threshold}});var vM=Ny.exports;Object.defineProperty(vM,"__esModule",{value:!0});const mM=Zh;Ny.exports=mM.Konva;var _i=Ny.exports,gm={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=ph;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=ph;e.exports=n.Konva})(gm,gm.exports);var yM=gm.exports;const mc=Eh(yM);var U9={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 bM=function(t){var r={},n=et,i=Iu,a=Object.assign;function o(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,C=1;C<arguments.length;C++)c+="&args[]="+encodeURIComponent(arguments[C]);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"),g=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),w=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),O=Symbol.iterator;function R(s){return s===null||typeof s!="object"?null:(s=O&&s[O]||s["@@iterator"],typeof s=="function"?s:null)}function T(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 g:return"Fragment";case f:return"Portal";case _:return"Profiler";case S:return"StrictMode";case y:return"Suspense";case p: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 m:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case v:return c=s.displayName||null,c!==null?c:T(s.type)||"Memo";case d:c=s._payload,s=s._init;try{return T(s(c))}catch{}}return null}function E(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 T(c);case 8:return c===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function P(s){var c=s,C=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,c.flags&4098&&(C=c.return),s=c.return;while(s)}return c.tag===3?C:null}function x(s){if(P(s)!==s)throw Error(o(188))}function k(s){var c=s.alternate;if(!c){if(c=P(s),c===null)throw Error(o(188));return c!==s?null:s}for(var C=s,N=c;;){var F=C.return;if(F===null)break;var G=F.alternate;if(G===null){if(N=F.return,N!==null){C=N;continue}break}if(F.child===G.child){for(G=F.child;G;){if(G===C)return x(F),s;if(G===N)return x(F),c;G=G.sibling}throw Error(o(188))}if(C.return!==N.return)C=F,N=G;else{for(var J=!1,ae=F.child;ae;){if(ae===C){J=!0,C=F,N=G;break}if(ae===N){J=!0,N=F,C=G;break}ae=ae.sibling}if(!J){for(ae=G.child;ae;){if(ae===C){J=!0,C=G,N=F;break}if(ae===N){J=!0,N=G,C=F;break}ae=ae.sibling}if(!J)throw Error(o(189))}}if(C.alternate!==N)throw Error(o(190))}if(C.tag!==3)throw Error(o(188));return C.stateNode.current===C?s:c}function M(s){return s=k(s),s!==null?j(s):null}function j(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=j(s);if(c!==null)return c;s=s.sibling}return null}function B(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){if(s.tag!==4){var c=B(s);if(c!==null)return c}s=s.sibling}return null}var $=Array.isArray,Z=t.getPublicInstance,K=t.getRootHostContext,D=t.getChildHostContext,q=t.prepareForCommit,A=t.resetAfterCommit,L=t.createInstance,z=t.appendInitialChild,I=t.finalizeInitialChildren,H=t.prepareUpdate,W=t.shouldSetTextContent,V=t.createTextInstance,U=t.scheduleTimeout,Y=t.cancelTimeout,X=t.noTimeout,Q=t.isPrimaryRenderer,te=t.supportsMutation,ee=t.supportsPersistence,ne=t.supportsHydration,ie=t.getInstanceFromNode,le=t.preparePortalMount,xe=t.getCurrentEventPriority,Fe=t.detachDeletedInstance,oe=t.supportsMicrotasks,ue=t.scheduleMicrotask,ve=t.supportsTestSelectors,Ee=t.findFiberRoot,re=t.getBoundingRect,de=t.getTextContent,me=t.isHiddenSubtree,Se=t.matchAccessibilityRole,Te=t.setFocusIfFocusable,ze=t.setupIntersectionObserver,Re=t.appendChild,Ne=t.appendChildToContainer,$e=t.commitTextUpdate,Ge=t.commitMount,ut=t.commitUpdate,ce=t.insertBefore,fe=t.insertInContainerBefore,Ze=t.removeChild,be=t.removeChildFromContainer,Me=t.resetTextContent,Ae=t.hideInstance,_e=t.hideTextInstance,Qe=t.unhideInstance,we=t.unhideTextInstance,Ye=t.clearContainer,Pr=t.cloneInstance,Oe=t.createContainerChildSet,Be=t.appendChildToContainerChildSet,tt=t.finalizeContainerChildren,yt=t.replaceContainerChildren,Ct=t.cloneHiddenInstance,gr=t.cloneHiddenTextInstance,Nr=t.canHydrateInstance,Ir=t.canHydrateTextInstance,bn=t.canHydrateSuspenseInstance,Le=t.isSuspenseInstancePending,Je=t.isSuspenseInstanceFallback,dt=t.getSuspenseInstanceFallbackErrorDetails,Mt=t.registerSuspenseInstanceRetry,mt=t.getNextHydratableSibling,vr=t.getFirstHydratableChild,mr=t.getFirstHydratableChildWithinContainer,or=t.getFirstHydratableChildWithinSuspenseInstance,_n=t.hydrateInstance,xr=t.hydrateTextInstance,en=t.hydrateSuspenseInstance,Si=t.getNextHydratableInstanceAfterSuspenseInstance,Ca=t.commitHydratedContainer,xo=t.commitHydratedSuspenseInstance,Co=t.clearSuspenseBoundary,Ta=t.clearSuspenseBoundaryFromContainer,Kc=t.shouldDeleteUnhydratedTailInstances,Yc=t.didNotMatchHydratedContainerTextInstance,RS=t.didNotMatchHydratedTextInstance,Qp;function Js(s){if(Qp===void 0)try{throw Error()}catch(C){var c=C.stack.trim().match(/\n( *(at )?)/);Qp=c&&c[1]||""}return`
|
|
52
|
+
`+Qp+s}var Jp=!1;function e0(s,c){if(!s||Jp)return"";Jp=!0;var C=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(Ce){var N=Ce}Reflect.construct(s,[],c)}else{try{c.call()}catch(Ce){N=Ce}s.call(c.prototype)}else{try{throw Error()}catch(Ce){N=Ce}s()}}catch(Ce){if(Ce&&N&&typeof Ce.stack=="string"){for(var F=Ce.stack.split(`
|
|
53
|
+
`),G=N.stack.split(`
|
|
54
|
+
`),J=F.length-1,ae=G.length-1;1<=J&&0<=ae&&F[J]!==G[ae];)ae--;for(;1<=J&&0<=ae;J--,ae--)if(F[J]!==G[ae]){if(J!==1||ae!==1)do if(J--,ae--,0>ae||F[J]!==G[ae]){var pe=`
|
|
55
|
+
`+F[J].replace(" at new "," at ");return s.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",s.displayName)),pe}while(1<=J&&0<=ae);break}}}finally{Jp=!1,Error.prepareStackTrace=C}return(s=s?s.displayName||s.name:"")?Js(s):""}var MS=Object.prototype.hasOwnProperty,t0=[],xl=-1;function ka(s){return{current:s}}function jt(s){0>xl||(s.current=t0[xl],t0[xl]=null,xl--)}function Lt(s,c){xl++,t0[xl]=s.current,s.current=c}var Aa={},Dr=ka(Aa),tn=ka(!1),To=Aa;function Cl(s,c){var C=s.type.contextTypes;if(!C)return Aa;var N=s.stateNode;if(N&&N.__reactInternalMemoizedUnmaskedChildContext===c)return N.__reactInternalMemoizedMaskedChildContext;var F={},G;for(G in C)F[G]=c[G];return N&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=F),F}function rn(s){return s=s.childContextTypes,s!=null}function Xc(){jt(tn),jt(Dr)}function E2(s,c,C){if(Dr.current!==Aa)throw Error(o(168));Lt(Dr,c),Lt(tn,C)}function O2(s,c,C){var N=s.stateNode;if(c=c.childContextTypes,typeof N.getChildContext!="function")return C;N=N.getChildContext();for(var F in N)if(!(F in c))throw Error(o(108,E(s)||"Unknown",F));return a({},C,N)}function Zc(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Aa,To=Dr.current,Lt(Dr,s),Lt(tn,tn.current),!0}function P2(s,c,C){var N=s.stateNode;if(!N)throw Error(o(169));C?(s=O2(s,c,To),N.__reactInternalMemoizedMergedChildContext=s,jt(tn),jt(Dr),Lt(Dr,s)):jt(tn),Lt(tn,C)}var Zn=Math.clz32?Math.clz32:IS,LS=Math.log,NS=Math.LN2;function IS(s){return s>>>=0,s===0?32:31-(LS(s)/NS|0)|0}var Qc=64,Jc=4194304;function eu(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 ef(s,c){var C=s.pendingLanes;if(C===0)return 0;var N=0,F=s.suspendedLanes,G=s.pingedLanes,J=C&268435455;if(J!==0){var ae=J&~F;ae!==0?N=eu(ae):(G&=J,G!==0&&(N=eu(G)))}else J=C&~F,J!==0?N=eu(J):G!==0&&(N=eu(G));if(N===0)return 0;if(c!==0&&c!==N&&!(c&F)&&(F=N&-N,G=c&-c,F>=G||F===16&&(G&4194240)!==0))return c;if(N&4&&(N|=C&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=N;0<c;)C=31-Zn(c),F=1<<C,N|=s[C],c&=~F;return N}function DS(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 jS(s,c){for(var C=s.suspendedLanes,N=s.pingedLanes,F=s.expirationTimes,G=s.pendingLanes;0<G;){var J=31-Zn(G),ae=1<<J,pe=F[J];pe===-1?(!(ae&C)||ae&N)&&(F[J]=DS(ae,c)):pe<=c&&(s.expiredLanes|=ae),G&=~ae}}function r0(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function x2(){var s=Qc;return Qc<<=1,!(Qc&4194240)&&(Qc=64),s}function n0(s){for(var c=[],C=0;31>C;C++)c.push(s);return c}function tu(s,c,C){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-Zn(c),s[c]=C}function FS(s,c){var C=s.pendingLanes&~c;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=c,s.mutableReadLanes&=c,s.entangledLanes&=c,c=s.entanglements;var N=s.eventTimes;for(s=s.expirationTimes;0<C;){var F=31-Zn(C),G=1<<F;c[F]=0,N[F]=-1,s[F]=-1,C&=~G}}function i0(s,c){var C=s.entangledLanes|=c;for(s=s.entanglements;C;){var N=31-Zn(C),F=1<<N;F&c|s[N]&c&&(s[N]|=c),C&=~F}}var _t=0;function C2(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var a0=i.unstable_scheduleCallback,T2=i.unstable_cancelCallback,zS=i.unstable_shouldYield,BS=i.unstable_requestPaint,yr=i.unstable_now,o0=i.unstable_ImmediatePriority,US=i.unstable_UserBlockingPriority,l0=i.unstable_NormalPriority,HS=i.unstable_IdlePriority,tf=null,Ei=null;function $S(s){if(Ei&&typeof Ei.onCommitFiberRoot=="function")try{Ei.onCommitFiberRoot(tf,s,void 0,(s.current.flags&128)===128)}catch{}}function GS(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var Qn=typeof Object.is=="function"?Object.is:GS,Xi=null,rf=!1,s0=!1;function k2(s){Xi===null?Xi=[s]:Xi.push(s)}function VS(s){rf=!0,k2(s)}function Oi(){if(!s0&&Xi!==null){s0=!0;var s=0,c=_t;try{var C=Xi;for(_t=1;s<C.length;s++){var N=C[s];do N=N(!0);while(N!==null)}Xi=null,rf=!1}catch(F){throw Xi!==null&&(Xi=Xi.slice(s+1)),a0(o0,Oi),F}finally{_t=c,s0=!1}}return null}var Tl=[],kl=0,nf=null,af=0,Ln=[],Nn=0,ko=null,Zi=1,Qi="";function Ao(s,c){Tl[kl++]=af,Tl[kl++]=nf,nf=s,af=c}function A2(s,c,C){Ln[Nn++]=Zi,Ln[Nn++]=Qi,Ln[Nn++]=ko,ko=s;var N=Zi;s=Qi;var F=32-Zn(N)-1;N&=~(1<<F),C+=1;var G=32-Zn(c)+F;if(30<G){var J=F-F%5;G=(N&(1<<J)-1).toString(32),N>>=J,F-=J,Zi=1<<32-Zn(c)+F|C<<F|N,Qi=G+s}else Zi=1<<G|C<<F|N,Qi=s}function u0(s){s.return!==null&&(Ao(s,1),A2(s,1,0))}function c0(s){for(;s===nf;)nf=Tl[--kl],Tl[kl]=null,af=Tl[--kl],Tl[kl]=null;for(;s===ko;)ko=Ln[--Nn],Ln[Nn]=null,Qi=Ln[--Nn],Ln[Nn]=null,Zi=Ln[--Nn],Ln[Nn]=null}var wn=null,In=null,Ut=!1,ru=!1,Jn=null;function R2(s,c){var C=Bn(5,null,null,0);C.elementType="DELETED",C.stateNode=c,C.return=s,c=s.deletions,c===null?(s.deletions=[C],s.flags|=16):c.push(C)}function M2(s,c){switch(s.tag){case 5:return c=Nr(c,s.type,s.pendingProps),c!==null?(s.stateNode=c,wn=s,In=vr(c),!0):!1;case 6:return c=Ir(c,s.pendingProps),c!==null?(s.stateNode=c,wn=s,In=null,!0):!1;case 13:if(c=bn(c),c!==null){var C=ko!==null?{id:Zi,overflow:Qi}:null;return s.memoizedState={dehydrated:c,treeContext:C,retryLane:1073741824},C=Bn(18,null,null,0),C.stateNode=c,C.return=s,s.child=C,wn=s,In=null,!0}return!1;default:return!1}}function f0(s){return(s.mode&1)!==0&&(s.flags&128)===0}function d0(s){if(Ut){var c=In;if(c){var C=c;if(!M2(s,c)){if(f0(s))throw Error(o(418));c=mt(C);var N=wn;c&&M2(s,c)?R2(N,C):(s.flags=s.flags&-4097|2,Ut=!1,wn=s)}}else{if(f0(s))throw Error(o(418));s.flags=s.flags&-4097|2,Ut=!1,wn=s}}}function L2(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;wn=s}function of(s){if(!ne||s!==wn)return!1;if(!Ut)return L2(s),Ut=!0,!1;if(s.tag!==3&&(s.tag!==5||Kc(s.type)&&!W(s.type,s.memoizedProps))){var c=In;if(c){if(f0(s))throw N2(),Error(o(418));for(;c;)R2(s,c),c=mt(c)}}if(L2(s),s.tag===13){if(!ne)throw Error(o(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));In=Si(s)}else In=wn?mt(s.stateNode):null;return!0}function N2(){for(var s=In;s;)s=mt(s)}function Al(){ne&&(In=wn=null,ru=Ut=!1)}function h0(s){Jn===null?Jn=[s]:Jn.push(s)}var qS=l.ReactCurrentBatchConfig;function lf(s,c){if(Qn(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var C=Object.keys(s),N=Object.keys(c);if(C.length!==N.length)return!1;for(N=0;N<C.length;N++){var F=C[N];if(!MS.call(c,F)||!Qn(s[F],c[F]))return!1}return!0}function WS(s){switch(s.tag){case 5:return Js(s.type);case 16:return Js("Lazy");case 13:return Js("Suspense");case 19:return Js("SuspenseList");case 0:case 2:case 15:return s=e0(s.type,!1),s;case 11:return s=e0(s.type.render,!1),s;case 1:return s=e0(s.type,!0),s;default:return""}}function nu(s,c,C){if(s=C.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(C._owner){if(C=C._owner,C){if(C.tag!==1)throw Error(o(309));var N=C.stateNode}if(!N)throw Error(o(147,s));var F=N,G=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===G?c.ref:(c=function(J){var ae=F.refs;J===null?delete ae[G]:ae[G]=J},c._stringRef=G,c)}if(typeof s!="string")throw Error(o(284));if(!C._owner)throw Error(o(290,s))}return s}function sf(s,c){throw s=Object.prototype.toString.call(c),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function I2(s){var c=s._init;return c(s._payload)}function D2(s){function c(he,se){if(s){var ge=he.deletions;ge===null?(he.deletions=[se],he.flags|=16):ge.push(se)}}function C(he,se){if(!s)return null;for(;se!==null;)c(he,se),se=se.sibling;return null}function N(he,se){for(he=new Map;se!==null;)se.key!==null?he.set(se.key,se):he.set(se.index,se),se=se.sibling;return he}function F(he,se){return he=ja(he,se),he.index=0,he.sibling=null,he}function G(he,se,ge){return he.index=ge,s?(ge=he.alternate,ge!==null?(ge=ge.index,ge<se?(he.flags|=2,se):ge):(he.flags|=2,se)):(he.flags|=1048576,se)}function J(he){return s&&he.alternate===null&&(he.flags|=2),he}function ae(he,se,ge,De){return se===null||se.tag!==6?(se=s1(ge,he.mode,De),se.return=he,se):(se=F(se,ge),se.return=he,se)}function pe(he,se,ge,De){var Xe=ge.type;return Xe===g?Ve(he,se,ge.props.children,De,ge.key):se!==null&&(se.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===d&&I2(Xe)===se.type)?(De=F(se,ge.props),De.ref=nu(he,se,ge),De.return=he,De):(De=zf(ge.type,ge.key,ge.props,null,he.mode,De),De.ref=nu(he,se,ge),De.return=he,De)}function Ce(he,se,ge,De){return se===null||se.tag!==4||se.stateNode.containerInfo!==ge.containerInfo||se.stateNode.implementation!==ge.implementation?(se=u1(ge,he.mode,De),se.return=he,se):(se=F(se,ge.children||[]),se.return=he,se)}function Ve(he,se,ge,De,Xe){return se===null||se.tag!==7?(se=jo(ge,he.mode,De,Xe),se.return=he,se):(se=F(se,ge),se.return=he,se)}function nt(he,se,ge){if(typeof se=="string"&&se!==""||typeof se=="number")return se=s1(""+se,he.mode,ge),se.return=he,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case u:return ge=zf(se.type,se.key,se.props,null,he.mode,ge),ge.ref=nu(he,null,se),ge.return=he,ge;case f:return se=u1(se,he.mode,ge),se.return=he,se;case d:var De=se._init;return nt(he,De(se._payload),ge)}if($(se)||R(se))return se=jo(se,he.mode,ge,null),se.return=he,se;sf(he,se)}return null}function Ie(he,se,ge,De){var Xe=se!==null?se.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number")return Xe!==null?null:ae(he,se,""+ge,De);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case u:return ge.key===Xe?pe(he,se,ge,De):null;case f:return ge.key===Xe?Ce(he,se,ge,De):null;case d:return Xe=ge._init,Ie(he,se,Xe(ge._payload),De)}if($(ge)||R(ge))return Xe!==null?null:Ve(he,se,ge,De,null);sf(he,ge)}return null}function Ft(he,se,ge,De,Xe){if(typeof De=="string"&&De!==""||typeof De=="number")return he=he.get(ge)||null,ae(se,he,""+De,Xe);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case u:return he=he.get(De.key===null?ge:De.key)||null,pe(se,he,De,Xe);case f:return he=he.get(De.key===null?ge:De.key)||null,Ce(se,he,De,Xe);case d:var lt=De._init;return Ft(he,se,ge,lt(De._payload),Xe)}if($(De)||R(De))return he=he.get(ge)||null,Ve(se,he,De,Xe,null);sf(se,De)}return null}function At(he,se,ge,De){for(var Xe=null,lt=null,it=se,wt=se=0,wr=null;it!==null&&wt<ge.length;wt++){it.index>wt?(wr=it,it=null):wr=it.sibling;var St=Ie(he,it,ge[wt],De);if(St===null){it===null&&(it=wr);break}s&&it&&St.alternate===null&&c(he,it),se=G(St,se,wt),lt===null?Xe=St:lt.sibling=St,lt=St,it=wr}if(wt===ge.length)return C(he,it),Ut&&Ao(he,wt),Xe;if(it===null){for(;wt<ge.length;wt++)it=nt(he,ge[wt],De),it!==null&&(se=G(it,se,wt),lt===null?Xe=it:lt.sibling=it,lt=it);return Ut&&Ao(he,wt),Xe}for(it=N(he,it);wt<ge.length;wt++)wr=Ft(it,he,wt,ge[wt],De),wr!==null&&(s&&wr.alternate!==null&&it.delete(wr.key===null?wt:wr.key),se=G(wr,se,wt),lt===null?Xe=wr:lt.sibling=wr,lt=wr);return s&&it.forEach(function(Fa){return c(he,Fa)}),Ut&&Ao(he,wt),Xe}function ln(he,se,ge,De){var Xe=R(ge);if(typeof Xe!="function")throw Error(o(150));if(ge=Xe.call(ge),ge==null)throw Error(o(151));for(var lt=Xe=null,it=se,wt=se=0,wr=null,St=ge.next();it!==null&&!St.done;wt++,St=ge.next()){it.index>wt?(wr=it,it=null):wr=it.sibling;var Fa=Ie(he,it,St.value,De);if(Fa===null){it===null&&(it=wr);break}s&&it&&Fa.alternate===null&&c(he,it),se=G(Fa,se,wt),lt===null?Xe=Fa:lt.sibling=Fa,lt=Fa,it=wr}if(St.done)return C(he,it),Ut&&Ao(he,wt),Xe;if(it===null){for(;!St.done;wt++,St=ge.next())St=nt(he,St.value,De),St!==null&&(se=G(St,se,wt),lt===null?Xe=St:lt.sibling=St,lt=St);return Ut&&Ao(he,wt),Xe}for(it=N(he,it);!St.done;wt++,St=ge.next())St=Ft(it,he,wt,St.value,De),St!==null&&(s&&St.alternate!==null&&it.delete(St.key===null?wt:St.key),se=G(St,se,wt),lt===null?Xe=St:lt.sibling=St,lt=St);return s&&it.forEach(function(EE){return c(he,EE)}),Ut&&Ao(he,wt),Xe}function ra(he,se,ge,De){if(typeof ge=="object"&&ge!==null&&ge.type===g&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case u:e:{for(var Xe=ge.key,lt=se;lt!==null;){if(lt.key===Xe){if(Xe=ge.type,Xe===g){if(lt.tag===7){C(he,lt.sibling),se=F(lt,ge.props.children),se.return=he,he=se;break e}}else if(lt.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===d&&I2(Xe)===lt.type){C(he,lt.sibling),se=F(lt,ge.props),se.ref=nu(he,lt,ge),se.return=he,he=se;break e}C(he,lt);break}else c(he,lt);lt=lt.sibling}ge.type===g?(se=jo(ge.props.children,he.mode,De,ge.key),se.return=he,he=se):(De=zf(ge.type,ge.key,ge.props,null,he.mode,De),De.ref=nu(he,se,ge),De.return=he,he=De)}return J(he);case f:e:{for(lt=ge.key;se!==null;){if(se.key===lt)if(se.tag===4&&se.stateNode.containerInfo===ge.containerInfo&&se.stateNode.implementation===ge.implementation){C(he,se.sibling),se=F(se,ge.children||[]),se.return=he,he=se;break e}else{C(he,se);break}else c(he,se);se=se.sibling}se=u1(ge,he.mode,De),se.return=he,he=se}return J(he);case d:return lt=ge._init,ra(he,se,lt(ge._payload),De)}if($(ge))return At(he,se,ge,De);if(R(ge))return ln(he,se,ge,De);sf(he,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,se!==null&&se.tag===6?(C(he,se.sibling),se=F(se,ge),se.return=he,he=se):(C(he,se),se=s1(ge,he.mode,De),se.return=he,he=se),J(he)):C(he,se)}return ra}var Rl=D2(!0),j2=D2(!1),uf=ka(null),cf=null,Ml=null,p0=null;function g0(){p0=Ml=cf=null}function F2(s,c,C){Q?(Lt(uf,c._currentValue),c._currentValue=C):(Lt(uf,c._currentValue2),c._currentValue2=C)}function v0(s){var c=uf.current;jt(uf),Q?s._currentValue=c:s._currentValue2=c}function m0(s,c,C){for(;s!==null;){var N=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,N!==null&&(N.childLanes|=c)):N!==null&&(N.childLanes&c)!==c&&(N.childLanes|=c),s===C)break;s=s.return}}function Ll(s,c){cf=s,p0=Ml=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&c&&(nn=!0),s.firstContext=null)}function Dn(s){var c=Q?s._currentValue:s._currentValue2;if(p0!==s)if(s={context:s,memoizedValue:c,next:null},Ml===null){if(cf===null)throw Error(o(308));Ml=s,cf.dependencies={lanes:0,firstContext:s}}else Ml=Ml.next=s;return c}var Ro=null;function y0(s){Ro===null?Ro=[s]:Ro.push(s)}function z2(s,c,C,N){var F=c.interleaved;return F===null?(C.next=C,y0(c)):(C.next=F.next,F.next=C),c.interleaved=C,Pi(s,N)}function Pi(s,c){s.lanes|=c;var C=s.alternate;for(C!==null&&(C.lanes|=c),C=s,s=s.return;s!==null;)s.childLanes|=c,C=s.alternate,C!==null&&(C.childLanes|=c),C=s,s=s.return;return C.tag===3?C.stateNode:null}var Ra=!1;function b0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function B2(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 Ji(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function Ma(s,c,C){var N=s.updateQueue;if(N===null)return null;if(N=N.shared,ft&2){var F=N.pending;return F===null?c.next=c:(c.next=F.next,F.next=c),N.pending=c,Pi(s,C)}return F=N.interleaved,F===null?(c.next=c,y0(N)):(c.next=F.next,F.next=c),N.interleaved=c,Pi(s,C)}function ff(s,c,C){if(c=c.updateQueue,c!==null&&(c=c.shared,(C&4194240)!==0)){var N=c.lanes;N&=s.pendingLanes,C|=N,c.lanes=C,i0(s,C)}}function U2(s,c){var C=s.updateQueue,N=s.alternate;if(N!==null&&(N=N.updateQueue,C===N)){var F=null,G=null;if(C=C.firstBaseUpdate,C!==null){do{var J={eventTime:C.eventTime,lane:C.lane,tag:C.tag,payload:C.payload,callback:C.callback,next:null};G===null?F=G=J:G=G.next=J,C=C.next}while(C!==null);G===null?F=G=c:G=G.next=c}else F=G=c;C={baseState:N.baseState,firstBaseUpdate:F,lastBaseUpdate:G,shared:N.shared,effects:N.effects},s.updateQueue=C;return}s=C.lastBaseUpdate,s===null?C.firstBaseUpdate=c:s.next=c,C.lastBaseUpdate=c}function df(s,c,C,N){var F=s.updateQueue;Ra=!1;var G=F.firstBaseUpdate,J=F.lastBaseUpdate,ae=F.shared.pending;if(ae!==null){F.shared.pending=null;var pe=ae,Ce=pe.next;pe.next=null,J===null?G=Ce:J.next=Ce,J=pe;var Ve=s.alternate;Ve!==null&&(Ve=Ve.updateQueue,ae=Ve.lastBaseUpdate,ae!==J&&(ae===null?Ve.firstBaseUpdate=Ce:ae.next=Ce,Ve.lastBaseUpdate=pe))}if(G!==null){var nt=F.baseState;J=0,Ve=Ce=pe=null,ae=G;do{var Ie=ae.lane,Ft=ae.eventTime;if((N&Ie)===Ie){Ve!==null&&(Ve=Ve.next={eventTime:Ft,lane:0,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null});e:{var At=s,ln=ae;switch(Ie=c,Ft=C,ln.tag){case 1:if(At=ln.payload,typeof At=="function"){nt=At.call(Ft,nt,Ie);break e}nt=At;break e;case 3:At.flags=At.flags&-65537|128;case 0:if(At=ln.payload,Ie=typeof At=="function"?At.call(Ft,nt,Ie):At,Ie==null)break e;nt=a({},nt,Ie);break e;case 2:Ra=!0}}ae.callback!==null&&ae.lane!==0&&(s.flags|=64,Ie=F.effects,Ie===null?F.effects=[ae]:Ie.push(ae))}else Ft={eventTime:Ft,lane:Ie,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null},Ve===null?(Ce=Ve=Ft,pe=nt):Ve=Ve.next=Ft,J|=Ie;if(ae=ae.next,ae===null){if(ae=F.shared.pending,ae===null)break;Ie=ae,ae=Ie.next,Ie.next=null,F.lastBaseUpdate=Ie,F.shared.pending=null}}while(!0);if(Ve===null&&(pe=nt),F.baseState=pe,F.firstBaseUpdate=Ce,F.lastBaseUpdate=Ve,c=F.shared.interleaved,c!==null){F=c;do J|=F.lane,F=F.next;while(F!==c)}else G===null&&(F.shared.lanes=0);Lo|=J,s.lanes=J,s.memoizedState=nt}}function H2(s,c,C){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var N=s[c],F=N.callback;if(F!==null){if(N.callback=null,N=C,typeof F!="function")throw Error(o(191,F));F.call(N)}}}var iu={},jn=ka(iu),au=ka(iu),Nl=ka(iu);function xi(s){if(s===iu)throw Error(o(174));return s}function _0(s,c){Lt(Nl,c),Lt(au,s),Lt(jn,iu),s=K(c),jt(jn),Lt(jn,s)}function Il(){jt(jn),jt(au),jt(Nl)}function $2(s){var c=xi(Nl.current),C=xi(jn.current);c=D(C,s.type,c),C!==c&&(Lt(au,s),Lt(jn,c))}function w0(s){au.current===s&&(jt(jn),jt(au))}var Vt=ka(0);function hf(s){for(var c=s;c!==null;){if(c.tag===13){var C=c.memoizedState;if(C!==null&&(C=C.dehydrated,C===null||Le(C)||Je(C)))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 S0=[];function E0(){for(var s=0;s<S0.length;s++){var c=S0[s];Q?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}S0.length=0}var pf=l.ReactCurrentDispatcher,O0=l.ReactCurrentBatchConfig,Mo=0,qt=null,lr=null,br=null,gf=!1,ou=!1,lu=0,KS=0;function jr(){throw Error(o(321))}function P0(s,c){if(c===null)return!1;for(var C=0;C<c.length&&C<s.length;C++)if(!Qn(s[C],c[C]))return!1;return!0}function x0(s,c,C,N,F,G){if(Mo=G,qt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,pf.current=s===null||s.memoizedState===null?QS:JS,s=C(N,F),ou){G=0;do{if(ou=!1,lu=0,25<=G)throw Error(o(301));G+=1,br=lr=null,c.updateQueue=null,pf.current=eE,s=C(N,F)}while(ou)}if(pf.current=yf,c=lr!==null&&lr.next!==null,Mo=0,br=lr=qt=null,gf=!1,c)throw Error(o(300));return s}function C0(){var s=lu!==0;return lu=0,s}function Ci(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return br===null?qt.memoizedState=br=s:br=br.next=s,br}function Fn(){if(lr===null){var s=qt.alternate;s=s!==null?s.memoizedState:null}else s=lr.next;var c=br===null?qt.memoizedState:br.next;if(c!==null)br=c,lr=s;else{if(s===null)throw Error(o(310));lr=s,s={memoizedState:lr.memoizedState,baseState:lr.baseState,baseQueue:lr.baseQueue,queue:lr.queue,next:null},br===null?qt.memoizedState=br=s:br=br.next=s}return br}function su(s,c){return typeof c=="function"?c(s):c}function T0(s){var c=Fn(),C=c.queue;if(C===null)throw Error(o(311));C.lastRenderedReducer=s;var N=lr,F=N.baseQueue,G=C.pending;if(G!==null){if(F!==null){var J=F.next;F.next=G.next,G.next=J}N.baseQueue=F=G,C.pending=null}if(F!==null){G=F.next,N=N.baseState;var ae=J=null,pe=null,Ce=G;do{var Ve=Ce.lane;if((Mo&Ve)===Ve)pe!==null&&(pe=pe.next={lane:0,action:Ce.action,hasEagerState:Ce.hasEagerState,eagerState:Ce.eagerState,next:null}),N=Ce.hasEagerState?Ce.eagerState:s(N,Ce.action);else{var nt={lane:Ve,action:Ce.action,hasEagerState:Ce.hasEagerState,eagerState:Ce.eagerState,next:null};pe===null?(ae=pe=nt,J=N):pe=pe.next=nt,qt.lanes|=Ve,Lo|=Ve}Ce=Ce.next}while(Ce!==null&&Ce!==G);pe===null?J=N:pe.next=ae,Qn(N,c.memoizedState)||(nn=!0),c.memoizedState=N,c.baseState=J,c.baseQueue=pe,C.lastRenderedState=N}if(s=C.interleaved,s!==null){F=s;do G=F.lane,qt.lanes|=G,Lo|=G,F=F.next;while(F!==s)}else F===null&&(C.lanes=0);return[c.memoizedState,C.dispatch]}function k0(s){var c=Fn(),C=c.queue;if(C===null)throw Error(o(311));C.lastRenderedReducer=s;var N=C.dispatch,F=C.pending,G=c.memoizedState;if(F!==null){C.pending=null;var J=F=F.next;do G=s(G,J.action),J=J.next;while(J!==F);Qn(G,c.memoizedState)||(nn=!0),c.memoizedState=G,c.baseQueue===null&&(c.baseState=G),C.lastRenderedState=G}return[G,N]}function G2(){}function V2(s,c){var C=qt,N=Fn(),F=c(),G=!Qn(N.memoizedState,F);if(G&&(N.memoizedState=F,nn=!0),N=N.queue,A0(K2.bind(null,C,N,s),[s]),N.getSnapshot!==c||G||br!==null&&br.memoizedState.tag&1){if(C.flags|=2048,uu(9,W2.bind(null,C,N,F,c),void 0,null),_r===null)throw Error(o(349));Mo&30||q2(C,c,F)}return F}function q2(s,c,C){s.flags|=16384,s={getSnapshot:c,value:C},c=qt.updateQueue,c===null?(c={lastEffect:null,stores:null},qt.updateQueue=c,c.stores=[s]):(C=c.stores,C===null?c.stores=[s]:C.push(s))}function W2(s,c,C,N){c.value=C,c.getSnapshot=N,Y2(c)&&X2(s)}function K2(s,c,C){return C(function(){Y2(c)&&X2(s)})}function Y2(s){var c=s.getSnapshot;s=s.value;try{var C=c();return!Qn(s,C)}catch{return!0}}function X2(s){var c=Pi(s,1);c!==null&&zn(c,s,1,-1)}function Z2(s){var c=Ci();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:su,lastRenderedState:s},c.queue=s,s=s.dispatch=ZS.bind(null,qt,s),[c.memoizedState,s]}function uu(s,c,C,N){return s={tag:s,create:c,destroy:C,deps:N,next:null},c=qt.updateQueue,c===null?(c={lastEffect:null,stores:null},qt.updateQueue=c,c.lastEffect=s.next=s):(C=c.lastEffect,C===null?c.lastEffect=s.next=s:(N=C.next,C.next=s,s.next=N,c.lastEffect=s)),s}function Q2(){return Fn().memoizedState}function vf(s,c,C,N){var F=Ci();qt.flags|=s,F.memoizedState=uu(1|c,C,void 0,N===void 0?null:N)}function mf(s,c,C,N){var F=Fn();N=N===void 0?null:N;var G=void 0;if(lr!==null){var J=lr.memoizedState;if(G=J.destroy,N!==null&&P0(N,J.deps)){F.memoizedState=uu(c,C,G,N);return}}qt.flags|=s,F.memoizedState=uu(1|c,C,G,N)}function J2(s,c){return vf(8390656,8,s,c)}function A0(s,c){return mf(2048,8,s,c)}function eb(s,c){return mf(4,2,s,c)}function tb(s,c){return mf(4,4,s,c)}function rb(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 nb(s,c,C){return C=C!=null?C.concat([s]):null,mf(4,4,rb.bind(null,c,s),C)}function R0(){}function ib(s,c){var C=Fn();c=c===void 0?null:c;var N=C.memoizedState;return N!==null&&c!==null&&P0(c,N[1])?N[0]:(C.memoizedState=[s,c],s)}function ab(s,c){var C=Fn();c=c===void 0?null:c;var N=C.memoizedState;return N!==null&&c!==null&&P0(c,N[1])?N[0]:(s=s(),C.memoizedState=[s,c],s)}function ob(s,c,C){return Mo&21?(Qn(C,c)||(C=x2(),qt.lanes|=C,Lo|=C,s.baseState=!0),c):(s.baseState&&(s.baseState=!1,nn=!0),s.memoizedState=C)}function YS(s,c){var C=_t;_t=C!==0&&4>C?C:4,s(!0);var N=O0.transition;O0.transition={};try{s(!1),c()}finally{_t=C,O0.transition=N}}function lb(){return Fn().memoizedState}function XS(s,c,C){var N=Ia(s);if(C={lane:N,action:C,hasEagerState:!1,eagerState:null,next:null},sb(s))ub(c,C);else if(C=z2(s,c,C,N),C!==null){var F=Br();zn(C,s,N,F),cb(C,c,N)}}function ZS(s,c,C){var N=Ia(s),F={lane:N,action:C,hasEagerState:!1,eagerState:null,next:null};if(sb(s))ub(c,F);else{var G=s.alternate;if(s.lanes===0&&(G===null||G.lanes===0)&&(G=c.lastRenderedReducer,G!==null))try{var J=c.lastRenderedState,ae=G(J,C);if(F.hasEagerState=!0,F.eagerState=ae,Qn(ae,J)){var pe=c.interleaved;pe===null?(F.next=F,y0(c)):(F.next=pe.next,pe.next=F),c.interleaved=F;return}}catch{}finally{}C=z2(s,c,F,N),C!==null&&(F=Br(),zn(C,s,N,F),cb(C,c,N))}}function sb(s){var c=s.alternate;return s===qt||c!==null&&c===qt}function ub(s,c){ou=gf=!0;var C=s.pending;C===null?c.next=c:(c.next=C.next,C.next=c),s.pending=c}function cb(s,c,C){if(C&4194240){var N=c.lanes;N&=s.pendingLanes,C|=N,c.lanes=C,i0(s,C)}}var yf={readContext:Dn,useCallback:jr,useContext:jr,useEffect:jr,useImperativeHandle:jr,useInsertionEffect:jr,useLayoutEffect:jr,useMemo:jr,useReducer:jr,useRef:jr,useState:jr,useDebugValue:jr,useDeferredValue:jr,useTransition:jr,useMutableSource:jr,useSyncExternalStore:jr,useId:jr,unstable_isNewReconciler:!1},QS={readContext:Dn,useCallback:function(s,c){return Ci().memoizedState=[s,c===void 0?null:c],s},useContext:Dn,useEffect:J2,useImperativeHandle:function(s,c,C){return C=C!=null?C.concat([s]):null,vf(4194308,4,rb.bind(null,c,s),C)},useLayoutEffect:function(s,c){return vf(4194308,4,s,c)},useInsertionEffect:function(s,c){return vf(4,2,s,c)},useMemo:function(s,c){var C=Ci();return c=c===void 0?null:c,s=s(),C.memoizedState=[s,c],s},useReducer:function(s,c,C){var N=Ci();return c=C!==void 0?C(c):c,N.memoizedState=N.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},N.queue=s,s=s.dispatch=XS.bind(null,qt,s),[N.memoizedState,s]},useRef:function(s){var c=Ci();return s={current:s},c.memoizedState=s},useState:Z2,useDebugValue:R0,useDeferredValue:function(s){return Ci().memoizedState=s},useTransition:function(){var s=Z2(!1),c=s[0];return s=YS.bind(null,s[1]),Ci().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,C){var N=qt,F=Ci();if(Ut){if(C===void 0)throw Error(o(407));C=C()}else{if(C=c(),_r===null)throw Error(o(349));Mo&30||q2(N,c,C)}F.memoizedState=C;var G={value:C,getSnapshot:c};return F.queue=G,J2(K2.bind(null,N,G,s),[s]),N.flags|=2048,uu(9,W2.bind(null,N,G,C,c),void 0,null),C},useId:function(){var s=Ci(),c=_r.identifierPrefix;if(Ut){var C=Qi,N=Zi;C=(N&~(1<<32-Zn(N)-1)).toString(32)+C,c=":"+c+"R"+C,C=lu++,0<C&&(c+="H"+C.toString(32)),c+=":"}else C=KS++,c=":"+c+"r"+C.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},JS={readContext:Dn,useCallback:ib,useContext:Dn,useEffect:A0,useImperativeHandle:nb,useInsertionEffect:eb,useLayoutEffect:tb,useMemo:ab,useReducer:T0,useRef:Q2,useState:function(){return T0(su)},useDebugValue:R0,useDeferredValue:function(s){var c=Fn();return ob(c,lr.memoizedState,s)},useTransition:function(){var s=T0(su)[0],c=Fn().memoizedState;return[s,c]},useMutableSource:G2,useSyncExternalStore:V2,useId:lb,unstable_isNewReconciler:!1},eE={readContext:Dn,useCallback:ib,useContext:Dn,useEffect:A0,useImperativeHandle:nb,useInsertionEffect:eb,useLayoutEffect:tb,useMemo:ab,useReducer:k0,useRef:Q2,useState:function(){return k0(su)},useDebugValue:R0,useDeferredValue:function(s){var c=Fn();return lr===null?c.memoizedState=s:ob(c,lr.memoizedState,s)},useTransition:function(){var s=k0(su)[0],c=Fn().memoizedState;return[s,c]},useMutableSource:G2,useSyncExternalStore:V2,useId:lb,unstable_isNewReconciler:!1};function ei(s,c){if(s&&s.defaultProps){c=a({},c),s=s.defaultProps;for(var C in s)c[C]===void 0&&(c[C]=s[C]);return c}return c}function M0(s,c,C,N){c=s.memoizedState,C=C(N,c),C=C==null?c:a({},c,C),s.memoizedState=C,s.lanes===0&&(s.updateQueue.baseState=C)}var bf={isMounted:function(s){return(s=s._reactInternals)?P(s)===s:!1},enqueueSetState:function(s,c,C){s=s._reactInternals;var N=Br(),F=Ia(s),G=Ji(N,F);G.payload=c,C!=null&&(G.callback=C),c=Ma(s,G,F),c!==null&&(zn(c,s,F,N),ff(c,s,F))},enqueueReplaceState:function(s,c,C){s=s._reactInternals;var N=Br(),F=Ia(s),G=Ji(N,F);G.tag=1,G.payload=c,C!=null&&(G.callback=C),c=Ma(s,G,F),c!==null&&(zn(c,s,F,N),ff(c,s,F))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var C=Br(),N=Ia(s),F=Ji(C,N);F.tag=2,c!=null&&(F.callback=c),c=Ma(s,F,N),c!==null&&(zn(c,s,N,C),ff(c,s,N))}};function fb(s,c,C,N,F,G,J){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(N,G,J):c.prototype&&c.prototype.isPureReactComponent?!lf(C,N)||!lf(F,G):!0}function db(s,c,C){var N=!1,F=Aa,G=c.contextType;return typeof G=="object"&&G!==null?G=Dn(G):(F=rn(c)?To:Dr.current,N=c.contextTypes,G=(N=N!=null)?Cl(s,F):Aa),c=new c(C,G),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=bf,s.stateNode=c,c._reactInternals=s,N&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=F,s.__reactInternalMemoizedMaskedChildContext=G),c}function hb(s,c,C,N){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(C,N),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(C,N),c.state!==s&&bf.enqueueReplaceState(c,c.state,null)}function L0(s,c,C,N){var F=s.stateNode;F.props=C,F.state=s.memoizedState,F.refs={},b0(s);var G=c.contextType;typeof G=="object"&&G!==null?F.context=Dn(G):(G=rn(c)?To:Dr.current,F.context=Cl(s,G)),F.state=s.memoizedState,G=c.getDerivedStateFromProps,typeof G=="function"&&(M0(s,c,G,C),F.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof F.getSnapshotBeforeUpdate=="function"||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(c=F.state,typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount(),c!==F.state&&bf.enqueueReplaceState(F,F.state,null),df(s,C,F,N),F.state=s.memoizedState),typeof F.componentDidMount=="function"&&(s.flags|=4194308)}function Dl(s,c){try{var C="",N=c;do C+=WS(N),N=N.return;while(N);var F=C}catch(G){F=`
|
|
56
|
+
Error generating stack: `+G.message+`
|
|
57
|
+
`+G.stack}return{value:s,source:c,stack:F,digest:null}}function N0(s,c,C){return{value:s,source:null,stack:C??null,digest:c??null}}function I0(s,c){try{console.error(c.value)}catch(C){setTimeout(function(){throw C})}}var tE=typeof WeakMap=="function"?WeakMap:Map;function pb(s,c,C){C=Ji(-1,C),C.tag=3,C.payload={element:null};var N=c.value;return C.callback=function(){Lf||(Lf=!0,t1=N),I0(s,c)},C}function gb(s,c,C){C=Ji(-1,C),C.tag=3;var N=s.type.getDerivedStateFromError;if(typeof N=="function"){var F=c.value;C.payload=function(){return N(F)},C.callback=function(){I0(s,c)}}var G=s.stateNode;return G!==null&&typeof G.componentDidCatch=="function"&&(C.callback=function(){I0(s,c),typeof N!="function"&&(La===null?La=new Set([this]):La.add(this));var J=c.stack;this.componentDidCatch(c.value,{componentStack:J!==null?J:""})}),C}function vb(s,c,C){var N=s.pingCache;if(N===null){N=s.pingCache=new tE;var F=new Set;N.set(c,F)}else F=N.get(c),F===void 0&&(F=new Set,N.set(c,F));F.has(C)||(F.add(C),s=gE.bind(null,s,c,C),c.then(s,s))}function mb(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 yb(s,c,C,N,F){return s.mode&1?(s.flags|=65536,s.lanes=F,s):(s===c?s.flags|=65536:(s.flags|=128,C.flags|=131072,C.flags&=-52805,C.tag===1&&(C.alternate===null?C.tag=17:(c=Ji(-1,1),c.tag=2,Ma(C,c,1))),C.lanes|=1),s)}var rE=l.ReactCurrentOwner,nn=!1;function Wr(s,c,C,N){c.child=s===null?j2(c,null,C,N):Rl(c,s.child,C,N)}function bb(s,c,C,N,F){C=C.render;var G=c.ref;return Ll(c,F),N=x0(s,c,C,N,G,F),C=C0(),s!==null&&!nn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~F,ea(s,c,F)):(Ut&&C&&u0(c),c.flags|=1,Wr(s,c,N,F),c.child)}function _b(s,c,C,N,F){if(s===null){var G=C.type;return typeof G=="function"&&!l1(G)&&G.defaultProps===void 0&&C.compare===null&&C.defaultProps===void 0?(c.tag=15,c.type=G,wb(s,c,G,N,F)):(s=zf(C.type,null,N,c,c.mode,F),s.ref=c.ref,s.return=c,c.child=s)}if(G=s.child,!(s.lanes&F)){var J=G.memoizedProps;if(C=C.compare,C=C!==null?C:lf,C(J,N)&&s.ref===c.ref)return ea(s,c,F)}return c.flags|=1,s=ja(G,N),s.ref=c.ref,s.return=c,c.child=s}function wb(s,c,C,N,F){if(s!==null){var G=s.memoizedProps;if(lf(G,N)&&s.ref===c.ref)if(nn=!1,c.pendingProps=N=G,(s.lanes&F)!==0)s.flags&131072&&(nn=!0);else return c.lanes=s.lanes,ea(s,c,F)}return D0(s,c,C,N,F)}function Sb(s,c,C){var N=c.pendingProps,F=N.children,G=s!==null?s.memoizedState:null;if(N.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Lt(Fl,Sn),Sn|=C;else{if(!(C&1073741824))return s=G!==null?G.baseLanes|C:C,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Lt(Fl,Sn),Sn|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},N=G!==null?G.baseLanes:C,Lt(Fl,Sn),Sn|=N}else G!==null?(N=G.baseLanes|C,c.memoizedState=null):N=C,Lt(Fl,Sn),Sn|=N;return Wr(s,c,F,C),c.child}function Eb(s,c){var C=c.ref;(s===null&&C!==null||s!==null&&s.ref!==C)&&(c.flags|=512,c.flags|=2097152)}function D0(s,c,C,N,F){var G=rn(C)?To:Dr.current;return G=Cl(c,G),Ll(c,F),C=x0(s,c,C,N,G,F),N=C0(),s!==null&&!nn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~F,ea(s,c,F)):(Ut&&N&&u0(c),c.flags|=1,Wr(s,c,C,F),c.child)}function Ob(s,c,C,N,F){if(rn(C)){var G=!0;Zc(c)}else G=!1;if(Ll(c,F),c.stateNode===null)wf(s,c),db(c,C,N),L0(c,C,N,F),N=!0;else if(s===null){var J=c.stateNode,ae=c.memoizedProps;J.props=ae;var pe=J.context,Ce=C.contextType;typeof Ce=="object"&&Ce!==null?Ce=Dn(Ce):(Ce=rn(C)?To:Dr.current,Ce=Cl(c,Ce));var Ve=C.getDerivedStateFromProps,nt=typeof Ve=="function"||typeof J.getSnapshotBeforeUpdate=="function";nt||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(ae!==N||pe!==Ce)&&hb(c,J,N,Ce),Ra=!1;var Ie=c.memoizedState;J.state=Ie,df(c,N,J,F),pe=c.memoizedState,ae!==N||Ie!==pe||tn.current||Ra?(typeof Ve=="function"&&(M0(c,C,Ve,N),pe=c.memoizedState),(ae=Ra||fb(c,C,ae,N,Ie,pe,Ce))?(nt||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=N,c.memoizedState=pe),J.props=N,J.state=pe,J.context=Ce,N=ae):(typeof J.componentDidMount=="function"&&(c.flags|=4194308),N=!1)}else{J=c.stateNode,B2(s,c),ae=c.memoizedProps,Ce=c.type===c.elementType?ae:ei(c.type,ae),J.props=Ce,nt=c.pendingProps,Ie=J.context,pe=C.contextType,typeof pe=="object"&&pe!==null?pe=Dn(pe):(pe=rn(C)?To:Dr.current,pe=Cl(c,pe));var Ft=C.getDerivedStateFromProps;(Ve=typeof Ft=="function"||typeof J.getSnapshotBeforeUpdate=="function")||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(ae!==nt||Ie!==pe)&&hb(c,J,N,pe),Ra=!1,Ie=c.memoizedState,J.state=Ie,df(c,N,J,F);var At=c.memoizedState;ae!==nt||Ie!==At||tn.current||Ra?(typeof Ft=="function"&&(M0(c,C,Ft,N),At=c.memoizedState),(Ce=Ra||fb(c,C,Ce,N,Ie,At,pe)||!1)?(Ve||typeof J.UNSAFE_componentWillUpdate!="function"&&typeof J.componentWillUpdate!="function"||(typeof J.componentWillUpdate=="function"&&J.componentWillUpdate(N,At,pe),typeof J.UNSAFE_componentWillUpdate=="function"&&J.UNSAFE_componentWillUpdate(N,At,pe)),typeof J.componentDidUpdate=="function"&&(c.flags|=4),typeof J.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof J.componentDidUpdate!="function"||ae===s.memoizedProps&&Ie===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||ae===s.memoizedProps&&Ie===s.memoizedState||(c.flags|=1024),c.memoizedProps=N,c.memoizedState=At),J.props=N,J.state=At,J.context=pe,N=Ce):(typeof J.componentDidUpdate!="function"||ae===s.memoizedProps&&Ie===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||ae===s.memoizedProps&&Ie===s.memoizedState||(c.flags|=1024),N=!1)}return j0(s,c,C,N,G,F)}function j0(s,c,C,N,F,G){Eb(s,c);var J=(c.flags&128)!==0;if(!N&&!J)return F&&P2(c,C,!1),ea(s,c,G);N=c.stateNode,rE.current=c;var ae=J&&typeof C.getDerivedStateFromError!="function"?null:N.render();return c.flags|=1,s!==null&&J?(c.child=Rl(c,s.child,null,G),c.child=Rl(c,null,ae,G)):Wr(s,c,ae,G),c.memoizedState=N.state,F&&P2(c,C,!0),c.child}function Pb(s){var c=s.stateNode;c.pendingContext?E2(s,c.pendingContext,c.pendingContext!==c.context):c.context&&E2(s,c.context,!1),_0(s,c.containerInfo)}function xb(s,c,C,N,F){return Al(),h0(F),c.flags|=256,Wr(s,c,C,N),c.child}var F0={dehydrated:null,treeContext:null,retryLane:0};function z0(s){return{baseLanes:s,cachePool:null,transitions:null}}function Cb(s,c,C){var N=c.pendingProps,F=Vt.current,G=!1,J=(c.flags&128)!==0,ae;if((ae=J)||(ae=s!==null&&s.memoizedState===null?!1:(F&2)!==0),ae?(G=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(F|=1),Lt(Vt,F&1),s===null)return d0(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(c.mode&1?Je(s)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(J=N.children,s=N.fallback,G?(N=c.mode,G=c.child,J={mode:"hidden",children:J},!(N&1)&&G!==null?(G.childLanes=0,G.pendingProps=J):G=Bf(J,N,0,null),s=jo(s,N,C,null),G.return=c,s.return=c,G.sibling=s,c.child=G,c.child.memoizedState=z0(C),c.memoizedState=F0,s):B0(c,J));if(F=s.memoizedState,F!==null&&(ae=F.dehydrated,ae!==null))return nE(s,c,J,N,ae,F,C);if(G){G=N.fallback,J=c.mode,F=s.child,ae=F.sibling;var pe={mode:"hidden",children:N.children};return!(J&1)&&c.child!==F?(N=c.child,N.childLanes=0,N.pendingProps=pe,c.deletions=null):(N=ja(F,pe),N.subtreeFlags=F.subtreeFlags&14680064),ae!==null?G=ja(ae,G):(G=jo(G,J,C,null),G.flags|=2),G.return=c,N.return=c,N.sibling=G,c.child=N,N=G,G=c.child,J=s.child.memoizedState,J=J===null?z0(C):{baseLanes:J.baseLanes|C,cachePool:null,transitions:J.transitions},G.memoizedState=J,G.childLanes=s.childLanes&~C,c.memoizedState=F0,N}return G=s.child,s=G.sibling,N=ja(G,{mode:"visible",children:N.children}),!(c.mode&1)&&(N.lanes=C),N.return=c,N.sibling=null,s!==null&&(C=c.deletions,C===null?(c.deletions=[s],c.flags|=16):C.push(s)),c.child=N,c.memoizedState=null,N}function B0(s,c){return c=Bf({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function _f(s,c,C,N){return N!==null&&h0(N),Rl(c,s.child,null,C),s=B0(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function nE(s,c,C,N,F,G,J){if(C)return c.flags&256?(c.flags&=-257,N=N0(Error(o(422))),_f(s,c,J,N)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(G=N.fallback,F=c.mode,N=Bf({mode:"visible",children:N.children},F,0,null),G=jo(G,F,J,null),G.flags|=2,N.return=c,G.return=c,N.sibling=G,c.child=N,c.mode&1&&Rl(c,s.child,null,J),c.child.memoizedState=z0(J),c.memoizedState=F0,G);if(!(c.mode&1))return _f(s,c,J,null);if(Je(F))return N=dt(F).digest,G=Error(o(419)),N=N0(G,N,void 0),_f(s,c,J,N);if(C=(J&s.childLanes)!==0,nn||C){if(N=_r,N!==null){switch(J&-J){case 4:F=2;break;case 16:F=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:F=32;break;case 536870912:F=268435456;break;default:F=0}F=F&(N.suspendedLanes|J)?0:F,F!==0&&F!==G.retryLane&&(G.retryLane=F,Pi(s,F),zn(N,s,F,-1))}return o1(),N=N0(Error(o(421))),_f(s,c,J,N)}return Le(F)?(c.flags|=128,c.child=s.child,c=vE.bind(null,s),Mt(F,c),null):(s=G.treeContext,ne&&(In=or(F),wn=c,Ut=!0,Jn=null,ru=!1,s!==null&&(Ln[Nn++]=Zi,Ln[Nn++]=Qi,Ln[Nn++]=ko,Zi=s.id,Qi=s.overflow,ko=c)),c=B0(c,N.children),c.flags|=4096,c)}function Tb(s,c,C){s.lanes|=c;var N=s.alternate;N!==null&&(N.lanes|=c),m0(s.return,c,C)}function U0(s,c,C,N,F){var G=s.memoizedState;G===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:N,tail:C,tailMode:F}:(G.isBackwards=c,G.rendering=null,G.renderingStartTime=0,G.last=N,G.tail=C,G.tailMode=F)}function kb(s,c,C){var N=c.pendingProps,F=N.revealOrder,G=N.tail;if(Wr(s,c,N.children,C),N=Vt.current,N&2)N=N&1|2,c.flags|=128;else{if(s!==null&&s.flags&128)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Tb(s,C,c);else if(s.tag===19)Tb(s,C,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}N&=1}if(Lt(Vt,N),!(c.mode&1))c.memoizedState=null;else switch(F){case"forwards":for(C=c.child,F=null;C!==null;)s=C.alternate,s!==null&&hf(s)===null&&(F=C),C=C.sibling;C=F,C===null?(F=c.child,c.child=null):(F=C.sibling,C.sibling=null),U0(c,!1,F,C,G);break;case"backwards":for(C=null,F=c.child,c.child=null;F!==null;){if(s=F.alternate,s!==null&&hf(s)===null){c.child=F;break}s=F.sibling,F.sibling=C,C=F,F=s}U0(c,!0,C,null,G);break;case"together":U0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function wf(s,c){!(c.mode&1)&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function ea(s,c,C){if(s!==null&&(c.dependencies=s.dependencies),Lo|=c.lanes,!(C&c.childLanes))return null;if(s!==null&&c.child!==s.child)throw Error(o(153));if(c.child!==null){for(s=c.child,C=ja(s,s.pendingProps),c.child=C,C.return=c;s.sibling!==null;)s=s.sibling,C=C.sibling=ja(s,s.pendingProps),C.return=c;C.sibling=null}return c.child}function iE(s,c,C){switch(c.tag){case 3:Pb(c),Al();break;case 5:$2(c);break;case 1:rn(c.type)&&Zc(c);break;case 4:_0(c,c.stateNode.containerInfo);break;case 10:F2(c,c.type._context,c.memoizedProps.value);break;case 13:var N=c.memoizedState;if(N!==null)return N.dehydrated!==null?(Lt(Vt,Vt.current&1),c.flags|=128,null):C&c.child.childLanes?Cb(s,c,C):(Lt(Vt,Vt.current&1),s=ea(s,c,C),s!==null?s.sibling:null);Lt(Vt,Vt.current&1);break;case 19:if(N=(C&c.childLanes)!==0,s.flags&128){if(N)return kb(s,c,C);c.flags|=128}var F=c.memoizedState;if(F!==null&&(F.rendering=null,F.tail=null,F.lastEffect=null),Lt(Vt,Vt.current),N)break;return null;case 22:case 23:return c.lanes=0,Sb(s,c,C)}return ea(s,c,C)}function Ti(s){s.flags|=4}function Ab(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 cu,fu,Sf,Ef;if(te)cu=function(s,c){for(var C=c.child;C!==null;){if(C.tag===5||C.tag===6)z(s,C.stateNode);else if(C.tag!==4&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===c)break;for(;C.sibling===null;){if(C.return===null||C.return===c)return;C=C.return}C.sibling.return=C.return,C=C.sibling}},fu=function(){},Sf=function(s,c,C,N,F){if(s=s.memoizedProps,s!==N){var G=c.stateNode,J=xi(jn.current);C=H(G,C,s,N,F,J),(c.updateQueue=C)&&Ti(c)}},Ef=function(s,c,C,N){C!==N&&Ti(c)};else if(ee){cu=function(s,c,C,N){for(var F=c.child;F!==null;){if(F.tag===5){var G=F.stateNode;C&&N&&(G=Ct(G,F.type,F.memoizedProps,F)),z(s,G)}else if(F.tag===6)G=F.stateNode,C&&N&&(G=gr(G,F.memoizedProps,F)),z(s,G);else if(F.tag!==4){if(F.tag===22&&F.memoizedState!==null)G=F.child,G!==null&&(G.return=F),cu(s,F,!0,!0);else if(F.child!==null){F.child.return=F,F=F.child;continue}}if(F===c)break;for(;F.sibling===null;){if(F.return===null||F.return===c)return;F=F.return}F.sibling.return=F.return,F=F.sibling}};var Rb=function(s,c,C,N){for(var F=c.child;F!==null;){if(F.tag===5){var G=F.stateNode;C&&N&&(G=Ct(G,F.type,F.memoizedProps,F)),Be(s,G)}else if(F.tag===6)G=F.stateNode,C&&N&&(G=gr(G,F.memoizedProps,F)),Be(s,G);else if(F.tag!==4){if(F.tag===22&&F.memoizedState!==null)G=F.child,G!==null&&(G.return=F),Rb(s,F,!0,!0);else if(F.child!==null){F.child.return=F,F=F.child;continue}}if(F===c)break;for(;F.sibling===null;){if(F.return===null||F.return===c)return;F=F.return}F.sibling.return=F.return,F=F.sibling}};fu=function(s,c){var C=c.stateNode;if(!Ab(s,c)){s=C.containerInfo;var N=Oe(s);Rb(N,c,!1,!1),C.pendingChildren=N,Ti(c),tt(s,N)}},Sf=function(s,c,C,N,F){var G=s.stateNode,J=s.memoizedProps;if((s=Ab(s,c))&&J===N)c.stateNode=G;else{var ae=c.stateNode,pe=xi(jn.current),Ce=null;J!==N&&(Ce=H(ae,C,J,N,F,pe)),s&&Ce===null?c.stateNode=G:(G=Pr(G,Ce,C,J,N,c,s,ae),I(G,C,N,F,pe)&&Ti(c),c.stateNode=G,s?Ti(c):cu(G,c,!1,!1))}},Ef=function(s,c,C,N){C!==N?(s=xi(Nl.current),C=xi(jn.current),c.stateNode=V(N,s,C,c),Ti(c)):c.stateNode=s.stateNode}}else fu=function(){},Sf=function(){},Ef=function(){};function du(s,c){if(!Ut)switch(s.tailMode){case"hidden":c=s.tail;for(var C=null;c!==null;)c.alternate!==null&&(C=c),c=c.sibling;C===null?s.tail=null:C.sibling=null;break;case"collapsed":C=s.tail;for(var N=null;C!==null;)C.alternate!==null&&(N=C),C=C.sibling;N===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:N.sibling=null}}function Fr(s){var c=s.alternate!==null&&s.alternate.child===s.child,C=0,N=0;if(c)for(var F=s.child;F!==null;)C|=F.lanes|F.childLanes,N|=F.subtreeFlags&14680064,N|=F.flags&14680064,F.return=s,F=F.sibling;else for(F=s.child;F!==null;)C|=F.lanes|F.childLanes,N|=F.subtreeFlags,N|=F.flags,F.return=s,F=F.sibling;return s.subtreeFlags|=N,s.childLanes=C,c}function aE(s,c,C){var N=c.pendingProps;switch(c0(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fr(c),null;case 1:return rn(c.type)&&Xc(),Fr(c),null;case 3:return C=c.stateNode,Il(),jt(tn),jt(Dr),E0(),C.pendingContext&&(C.context=C.pendingContext,C.pendingContext=null),(s===null||s.child===null)&&(of(c)?Ti(c):s===null||s.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,Jn!==null&&(i1(Jn),Jn=null))),fu(s,c),Fr(c),null;case 5:w0(c),C=xi(Nl.current);var F=c.type;if(s!==null&&c.stateNode!=null)Sf(s,c,F,N,C),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!N){if(c.stateNode===null)throw Error(o(166));return Fr(c),null}if(s=xi(jn.current),of(c)){if(!ne)throw Error(o(175));s=_n(c.stateNode,c.type,c.memoizedProps,C,s,c,!ru),c.updateQueue=s,s!==null&&Ti(c)}else{var G=L(F,N,C,s,c);cu(G,c,!1,!1),c.stateNode=G,I(G,F,N,C,s)&&Ti(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Fr(c),null;case 6:if(s&&c.stateNode!=null)Ef(s,c,s.memoizedProps,N);else{if(typeof N!="string"&&c.stateNode===null)throw Error(o(166));if(s=xi(Nl.current),C=xi(jn.current),of(c)){if(!ne)throw Error(o(176));if(s=c.stateNode,C=c.memoizedProps,(N=xr(s,C,c,!ru))&&(F=wn,F!==null))switch(F.tag){case 3:Yc(F.stateNode.containerInfo,s,C,(F.mode&1)!==0);break;case 5:RS(F.type,F.memoizedProps,F.stateNode,s,C,(F.mode&1)!==0)}N&&Ti(c)}else c.stateNode=V(N,s,C,c)}return Fr(c),null;case 13:if(jt(Vt),N=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Ut&&In!==null&&c.mode&1&&!(c.flags&128))N2(),Al(),c.flags|=98560,F=!1;else if(F=of(c),N!==null&&N.dehydrated!==null){if(s===null){if(!F)throw Error(o(318));if(!ne)throw Error(o(344));if(F=c.memoizedState,F=F!==null?F.dehydrated:null,!F)throw Error(o(317));en(F,c)}else Al(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Fr(c),F=!1}else Jn!==null&&(i1(Jn),Jn=null),F=!0;if(!F)return c.flags&65536?c:null}return c.flags&128?(c.lanes=C,c):(C=N!==null,C!==(s!==null&&s.memoizedState!==null)&&C&&(c.child.flags|=8192,c.mode&1&&(s===null||Vt.current&1?sr===0&&(sr=3):o1())),c.updateQueue!==null&&(c.flags|=4),Fr(c),null);case 4:return Il(),fu(s,c),s===null&&le(c.stateNode.containerInfo),Fr(c),null;case 10:return v0(c.type._context),Fr(c),null;case 17:return rn(c.type)&&Xc(),Fr(c),null;case 19:if(jt(Vt),F=c.memoizedState,F===null)return Fr(c),null;if(N=(c.flags&128)!==0,G=F.rendering,G===null)if(N)du(F,!1);else{if(sr!==0||s!==null&&s.flags&128)for(s=c.child;s!==null;){if(G=hf(s),G!==null){for(c.flags|=128,du(F,!1),s=G.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),c.subtreeFlags=0,s=C,C=c.child;C!==null;)N=C,F=s,N.flags&=14680066,G=N.alternate,G===null?(N.childLanes=0,N.lanes=F,N.child=null,N.subtreeFlags=0,N.memoizedProps=null,N.memoizedState=null,N.updateQueue=null,N.dependencies=null,N.stateNode=null):(N.childLanes=G.childLanes,N.lanes=G.lanes,N.child=G.child,N.subtreeFlags=0,N.deletions=null,N.memoizedProps=G.memoizedProps,N.memoizedState=G.memoizedState,N.updateQueue=G.updateQueue,N.type=G.type,F=G.dependencies,N.dependencies=F===null?null:{lanes:F.lanes,firstContext:F.firstContext}),C=C.sibling;return Lt(Vt,Vt.current&1|2),c.child}s=s.sibling}F.tail!==null&&yr()>e1&&(c.flags|=128,N=!0,du(F,!1),c.lanes=4194304)}else{if(!N)if(s=hf(G),s!==null){if(c.flags|=128,N=!0,s=s.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),du(F,!0),F.tail===null&&F.tailMode==="hidden"&&!G.alternate&&!Ut)return Fr(c),null}else 2*yr()-F.renderingStartTime>e1&&C!==1073741824&&(c.flags|=128,N=!0,du(F,!1),c.lanes=4194304);F.isBackwards?(G.sibling=c.child,c.child=G):(s=F.last,s!==null?s.sibling=G:c.child=G,F.last=G)}return F.tail!==null?(c=F.tail,F.rendering=c,F.tail=c.sibling,F.renderingStartTime=yr(),c.sibling=null,s=Vt.current,Lt(Vt,N?s&1|2:s&1),c):(Fr(c),null);case 22:case 23:return a1(),C=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==C&&(c.flags|=8192),C&&c.mode&1?Sn&1073741824&&(Fr(c),te&&c.subtreeFlags&6&&(c.flags|=8192)):Fr(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}function oE(s,c){switch(c0(c),c.tag){case 1:return rn(c.type)&&Xc(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Il(),jt(tn),jt(Dr),E0(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return w0(c),null;case 13:if(jt(Vt),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(o(340));Al()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return jt(Vt),null;case 4:return Il(),null;case 10:return v0(c.type._context),null;case 22:case 23:return a1(),null;case 24:return null;default:return null}}var Of=!1,zr=!1,lE=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function jl(s,c){var C=s.ref;if(C!==null)if(typeof C=="function")try{C(null)}catch(N){Ht(s,c,N)}else C.current=null}function H0(s,c,C){try{C()}catch(N){Ht(s,c,N)}}var Mb=!1;function sE(s,c){for(q(s.containerInfo),Ue=c;Ue!==null;)if(s=Ue,c=s.child,(s.subtreeFlags&1028)!==0&&c!==null)c.return=s,Ue=c;else for(;Ue!==null;){s=Ue;try{var C=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var N=C.memoizedProps,F=C.memoizedState,G=s.stateNode,J=G.getSnapshotBeforeUpdate(s.elementType===s.type?N:ei(s.type,N),F);G.__reactInternalSnapshotBeforeUpdate=J}break;case 3:te&&Ye(s.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(ae){Ht(s,s.return,ae)}if(c=s.sibling,c!==null){c.return=s.return,Ue=c;break}Ue=s.return}return C=Mb,Mb=!1,C}function hu(s,c,C){var N=c.updateQueue;if(N=N!==null?N.lastEffect:null,N!==null){var F=N=N.next;do{if((F.tag&s)===s){var G=F.destroy;F.destroy=void 0,G!==void 0&&H0(c,C,G)}F=F.next}while(F!==N)}}function Pf(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var C=c=c.next;do{if((C.tag&s)===s){var N=C.create;C.destroy=N()}C=C.next}while(C!==c)}}function $0(s){var c=s.ref;if(c!==null){var C=s.stateNode;switch(s.tag){case 5:s=Z(C);break;default:s=C}typeof c=="function"?c(s):c.current=s}}function Lb(s){var c=s.alternate;c!==null&&(s.alternate=null,Lb(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&Fe(c)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Nb(s){return s.tag===5||s.tag===3||s.tag===4}function Ib(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Nb(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 G0(s,c,C){var N=s.tag;if(N===5||N===6)s=s.stateNode,c?fe(C,s,c):Ne(C,s);else if(N!==4&&(s=s.child,s!==null))for(G0(s,c,C),s=s.sibling;s!==null;)G0(s,c,C),s=s.sibling}function V0(s,c,C){var N=s.tag;if(N===5||N===6)s=s.stateNode,c?ce(C,s,c):Re(C,s);else if(N!==4&&(s=s.child,s!==null))for(V0(s,c,C),s=s.sibling;s!==null;)V0(s,c,C),s=s.sibling}var Cr=null,ti=!1;function ki(s,c,C){for(C=C.child;C!==null;)q0(s,c,C),C=C.sibling}function q0(s,c,C){if(Ei&&typeof Ei.onCommitFiberUnmount=="function")try{Ei.onCommitFiberUnmount(tf,C)}catch{}switch(C.tag){case 5:zr||jl(C,c);case 6:if(te){var N=Cr,F=ti;Cr=null,ki(s,c,C),Cr=N,ti=F,Cr!==null&&(ti?be(Cr,C.stateNode):Ze(Cr,C.stateNode))}else ki(s,c,C);break;case 18:te&&Cr!==null&&(ti?Ta(Cr,C.stateNode):Co(Cr,C.stateNode));break;case 4:te?(N=Cr,F=ti,Cr=C.stateNode.containerInfo,ti=!0,ki(s,c,C),Cr=N,ti=F):(ee&&(N=C.stateNode.containerInfo,F=Oe(N),yt(N,F)),ki(s,c,C));break;case 0:case 11:case 14:case 15:if(!zr&&(N=C.updateQueue,N!==null&&(N=N.lastEffect,N!==null))){F=N=N.next;do{var G=F,J=G.destroy;G=G.tag,J!==void 0&&(G&2||G&4)&&H0(C,c,J),F=F.next}while(F!==N)}ki(s,c,C);break;case 1:if(!zr&&(jl(C,c),N=C.stateNode,typeof N.componentWillUnmount=="function"))try{N.props=C.memoizedProps,N.state=C.memoizedState,N.componentWillUnmount()}catch(ae){Ht(C,c,ae)}ki(s,c,C);break;case 21:ki(s,c,C);break;case 22:C.mode&1?(zr=(N=zr)||C.memoizedState!==null,ki(s,c,C),zr=N):ki(s,c,C);break;default:ki(s,c,C)}}function Db(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var C=s.stateNode;C===null&&(C=s.stateNode=new lE),c.forEach(function(N){var F=mE.bind(null,s,N);C.has(N)||(C.add(N),N.then(F,F))})}}function ri(s,c){var C=c.deletions;if(C!==null)for(var N=0;N<C.length;N++){var F=C[N];try{var G=s,J=c;if(te){var ae=J;e:for(;ae!==null;){switch(ae.tag){case 5:Cr=ae.stateNode,ti=!1;break e;case 3:Cr=ae.stateNode.containerInfo,ti=!0;break e;case 4:Cr=ae.stateNode.containerInfo,ti=!0;break e}ae=ae.return}if(Cr===null)throw Error(o(160));q0(G,J,F),Cr=null,ti=!1}else q0(G,J,F);var pe=F.alternate;pe!==null&&(pe.return=null),F.return=null}catch(Ce){Ht(F,c,Ce)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)jb(c,s),c=c.sibling}function jb(s,c){var C=s.alternate,N=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(ri(c,s),Ai(s),N&4){try{hu(3,s,s.return),Pf(3,s)}catch(Ie){Ht(s,s.return,Ie)}try{hu(5,s,s.return)}catch(Ie){Ht(s,s.return,Ie)}}break;case 1:ri(c,s),Ai(s),N&512&&C!==null&&jl(C,C.return);break;case 5:if(ri(c,s),Ai(s),N&512&&C!==null&&jl(C,C.return),te){if(s.flags&32){var F=s.stateNode;try{Me(F)}catch(Ie){Ht(s,s.return,Ie)}}if(N&4&&(F=s.stateNode,F!=null)){var G=s.memoizedProps;if(C=C!==null?C.memoizedProps:G,N=s.type,c=s.updateQueue,s.updateQueue=null,c!==null)try{ut(F,c,N,C,G,s)}catch(Ie){Ht(s,s.return,Ie)}}}break;case 6:if(ri(c,s),Ai(s),N&4&&te){if(s.stateNode===null)throw Error(o(162));F=s.stateNode,G=s.memoizedProps,C=C!==null?C.memoizedProps:G;try{$e(F,C,G)}catch(Ie){Ht(s,s.return,Ie)}}break;case 3:if(ri(c,s),Ai(s),N&4){if(te&&ne&&C!==null&&C.memoizedState.isDehydrated)try{Ca(c.containerInfo)}catch(Ie){Ht(s,s.return,Ie)}if(ee){F=c.containerInfo,G=c.pendingChildren;try{yt(F,G)}catch(Ie){Ht(s,s.return,Ie)}}}break;case 4:if(ri(c,s),Ai(s),N&4&&ee){G=s.stateNode,F=G.containerInfo,G=G.pendingChildren;try{yt(F,G)}catch(Ie){Ht(s,s.return,Ie)}}break;case 13:ri(c,s),Ai(s),F=s.child,F.flags&8192&&(G=F.memoizedState!==null,F.stateNode.isHidden=G,!G||F.alternate!==null&&F.alternate.memoizedState!==null||(J0=yr())),N&4&&Db(s);break;case 22:var J=C!==null&&C.memoizedState!==null;if(s.mode&1?(zr=(C=zr)||J,ri(c,s),zr=C):ri(c,s),Ai(s),N&8192){if(C=s.memoizedState!==null,(s.stateNode.isHidden=C)&&!J&&s.mode&1)for(Ue=s,N=s.child;N!==null;){for(c=Ue=N;Ue!==null;){J=Ue;var ae=J.child;switch(J.tag){case 0:case 11:case 14:case 15:hu(4,J,J.return);break;case 1:jl(J,J.return);var pe=J.stateNode;if(typeof pe.componentWillUnmount=="function"){var Ce=J,Ve=J.return;try{var nt=Ce;pe.props=nt.memoizedProps,pe.state=nt.memoizedState,pe.componentWillUnmount()}catch(Ie){Ht(Ce,Ve,Ie)}}break;case 5:jl(J,J.return);break;case 22:if(J.memoizedState!==null){Bb(c);continue}}ae!==null?(ae.return=J,Ue=ae):Bb(c)}N=N.sibling}if(te){e:if(N=null,te)for(c=s;;){if(c.tag===5){if(N===null){N=c;try{F=c.stateNode,C?Ae(F):Qe(c.stateNode,c.memoizedProps)}catch(Ie){Ht(s,s.return,Ie)}}}else if(c.tag===6){if(N===null)try{G=c.stateNode,C?_e(G):we(G,c.memoizedProps)}catch(Ie){Ht(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;N===c&&(N=null),c=c.return}N===c&&(N=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:ri(c,s),Ai(s),N&4&&Db(s);break;case 21:break;default:ri(c,s),Ai(s)}}function Ai(s){var c=s.flags;if(c&2){try{if(te){e:{for(var C=s.return;C!==null;){if(Nb(C)){var N=C;break e}C=C.return}throw Error(o(160))}switch(N.tag){case 5:var F=N.stateNode;N.flags&32&&(Me(F),N.flags&=-33);var G=Ib(s);V0(s,G,F);break;case 3:case 4:var J=N.stateNode.containerInfo,ae=Ib(s);G0(s,ae,J);break;default:throw Error(o(161))}}}catch(pe){Ht(s,s.return,pe)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function uE(s,c,C){Ue=s,Fb(s)}function Fb(s,c,C){for(var N=(s.mode&1)!==0;Ue!==null;){var F=Ue,G=F.child;if(F.tag===22&&N){var J=F.memoizedState!==null||Of;if(!J){var ae=F.alternate,pe=ae!==null&&ae.memoizedState!==null||zr;ae=Of;var Ce=zr;if(Of=J,(zr=pe)&&!Ce)for(Ue=F;Ue!==null;)J=Ue,pe=J.child,J.tag===22&&J.memoizedState!==null?Ub(F):pe!==null?(pe.return=J,Ue=pe):Ub(F);for(;G!==null;)Ue=G,Fb(G),G=G.sibling;Ue=F,Of=ae,zr=Ce}zb(s)}else F.subtreeFlags&8772&&G!==null?(G.return=F,Ue=G):zb(s)}}function zb(s){for(;Ue!==null;){var c=Ue;if(c.flags&8772){var C=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:zr||Pf(5,c);break;case 1:var N=c.stateNode;if(c.flags&4&&!zr)if(C===null)N.componentDidMount();else{var F=c.elementType===c.type?C.memoizedProps:ei(c.type,C.memoizedProps);N.componentDidUpdate(F,C.memoizedState,N.__reactInternalSnapshotBeforeUpdate)}var G=c.updateQueue;G!==null&&H2(c,G,N);break;case 3:var J=c.updateQueue;if(J!==null){if(C=null,c.child!==null)switch(c.child.tag){case 5:C=Z(c.child.stateNode);break;case 1:C=c.child.stateNode}H2(c,J,C)}break;case 5:var ae=c.stateNode;C===null&&c.flags&4&&Ge(ae,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(ne&&c.memoizedState===null){var pe=c.alternate;if(pe!==null){var Ce=pe.memoizedState;if(Ce!==null){var Ve=Ce.dehydrated;Ve!==null&&xo(Ve)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}zr||c.flags&512&&$0(c)}catch(nt){Ht(c,c.return,nt)}}if(c===s){Ue=null;break}if(C=c.sibling,C!==null){C.return=c.return,Ue=C;break}Ue=c.return}}function Bb(s){for(;Ue!==null;){var c=Ue;if(c===s){Ue=null;break}var C=c.sibling;if(C!==null){C.return=c.return,Ue=C;break}Ue=c.return}}function Ub(s){for(;Ue!==null;){var c=Ue;try{switch(c.tag){case 0:case 11:case 15:var C=c.return;try{Pf(4,c)}catch(pe){Ht(c,C,pe)}break;case 1:var N=c.stateNode;if(typeof N.componentDidMount=="function"){var F=c.return;try{N.componentDidMount()}catch(pe){Ht(c,F,pe)}}var G=c.return;try{$0(c)}catch(pe){Ht(c,G,pe)}break;case 5:var J=c.return;try{$0(c)}catch(pe){Ht(c,J,pe)}}}catch(pe){Ht(c,c.return,pe)}if(c===s){Ue=null;break}var ae=c.sibling;if(ae!==null){ae.return=c.return,Ue=ae;break}Ue=c.return}}var xf=0,Cf=1,Tf=2,kf=3,Af=4;if(typeof Symbol=="function"&&Symbol.for){var pu=Symbol.for;xf=pu("selector.component"),Cf=pu("selector.has_pseudo_class"),Tf=pu("selector.role"),kf=pu("selector.test_id"),Af=pu("selector.text")}function W0(s){var c=ie(s);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(o(364));return c}if(s=Ee(s),s===null)throw Error(o(362));return s.stateNode.current}function K0(s,c){switch(c.$$typeof){case xf:if(s.type===c.value)return!0;break;case Cf:e:{c=c.value,s=[s,0];for(var C=0;C<s.length;){var N=s[C++],F=s[C++],G=c[F];if(N.tag!==5||!me(N)){for(;G!=null&&K0(N,G);)F++,G=c[F];if(F===c.length){c=!0;break e}else for(N=N.child;N!==null;)s.push(N,F),N=N.sibling}}c=!1}return c;case Tf:if(s.tag===5&&Se(s.stateNode,c.value))return!0;break;case Af:if((s.tag===5||s.tag===6)&&(s=de(s),s!==null&&0<=s.indexOf(c.value)))return!0;break;case kf: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 Y0(s){switch(s.$$typeof){case xf:return"<"+(T(s.value)||"Unknown")+">";case Cf:return":has("+(Y0(s)||"")+")";case Tf:return'[role="'+s.value+'"]';case Af:return'"'+s.value+'"';case kf:return'[data-testname="'+s.value+'"]';default:throw Error(o(365))}}function Hb(s,c){var C=[];s=[s,0];for(var N=0;N<s.length;){var F=s[N++],G=s[N++],J=c[G];if(F.tag!==5||!me(F)){for(;J!=null&&K0(F,J);)G++,J=c[G];if(G===c.length)C.push(F);else for(F=F.child;F!==null;)s.push(F,G),F=F.sibling}}return C}function X0(s,c){if(!ve)throw Error(o(363));s=W0(s),s=Hb(s,c),c=[],s=Array.from(s);for(var C=0;C<s.length;){var N=s[C++];if(N.tag===5)me(N)||c.push(N.stateNode);else for(N=N.child;N!==null;)s.push(N),N=N.sibling}return c}var cE=Math.ceil,Rf=l.ReactCurrentDispatcher,Z0=l.ReactCurrentOwner,er=l.ReactCurrentBatchConfig,ft=0,_r=null,nr=null,Tr=0,Sn=0,Fl=ka(0),sr=0,gu=null,Lo=0,Mf=0,Q0=0,vu=null,an=null,J0=0,e1=1/0,ta=null;function zl(){e1=yr()+500}var Lf=!1,t1=null,La=null,Nf=!1,Na=null,If=0,mu=0,r1=null,Df=-1,jf=0;function Br(){return ft&6?yr():Df!==-1?Df:Df=yr()}function Ia(s){return s.mode&1?ft&2&&Tr!==0?Tr&-Tr:qS.transition!==null?(jf===0&&(jf=x2()),jf):(s=_t,s!==0?s:xe()):1}function zn(s,c,C,N){if(50<mu)throw mu=0,r1=null,Error(o(185));tu(s,C,N),(!(ft&2)||s!==_r)&&(s===_r&&(!(ft&2)&&(Mf|=C),sr===4&&Da(s,Tr)),on(s,N),C===1&&ft===0&&!(c.mode&1)&&(zl(),rf&&Oi()))}function on(s,c){var C=s.callbackNode;jS(s,c);var N=ef(s,s===_r?Tr:0);if(N===0)C!==null&&T2(C),s.callbackNode=null,s.callbackPriority=0;else if(c=N&-N,s.callbackPriority!==c){if(C!=null&&T2(C),c===1)s.tag===0?VS(Gb.bind(null,s)):k2(Gb.bind(null,s)),oe?ue(function(){!(ft&6)&&Oi()}):a0(o0,Oi),C=null;else{switch(C2(N)){case 1:C=o0;break;case 4:C=US;break;case 16:C=l0;break;case 536870912:C=HS;break;default:C=l0}C=Jb(C,$b.bind(null,s))}s.callbackPriority=c,s.callbackNode=C}}function $b(s,c){if(Df=-1,jf=0,ft&6)throw Error(o(327));var C=s.callbackNode;if(Do()&&s.callbackNode!==C)return null;var N=ef(s,s===_r?Tr:0);if(N===0)return null;if(N&30||N&s.expiredLanes||c)c=Ff(s,N);else{c=N;var F=ft;ft|=2;var G=Wb();(_r!==s||Tr!==c)&&(ta=null,zl(),No(s,c));do try{hE();break}catch(ae){qb(s,ae)}while(!0);g0(),Rf.current=G,ft=F,nr!==null?c=0:(_r=null,Tr=0,c=sr)}if(c!==0){if(c===2&&(F=r0(s),F!==0&&(N=F,c=n1(s,F))),c===1)throw C=gu,No(s,0),Da(s,N),on(s,yr()),C;if(c===6)Da(s,N);else{if(F=s.current.alternate,!(N&30)&&!fE(F)&&(c=Ff(s,N),c===2&&(G=r0(s),G!==0&&(N=G,c=n1(s,G))),c===1))throw C=gu,No(s,0),Da(s,N),on(s,yr()),C;switch(s.finishedWork=F,s.finishedLanes=N,c){case 0:case 1:throw Error(o(345));case 2:Io(s,an,ta);break;case 3:if(Da(s,N),(N&130023424)===N&&(c=J0+500-yr(),10<c)){if(ef(s,0)!==0)break;if(F=s.suspendedLanes,(F&N)!==N){Br(),s.pingedLanes|=s.suspendedLanes&F;break}s.timeoutHandle=U(Io.bind(null,s,an,ta),c);break}Io(s,an,ta);break;case 4:if(Da(s,N),(N&4194240)===N)break;for(c=s.eventTimes,F=-1;0<N;){var J=31-Zn(N);G=1<<J,J=c[J],J>F&&(F=J),N&=~G}if(N=F,N=yr()-N,N=(120>N?120:480>N?480:1080>N?1080:1920>N?1920:3e3>N?3e3:4320>N?4320:1960*cE(N/1960))-N,10<N){s.timeoutHandle=U(Io.bind(null,s,an,ta),N);break}Io(s,an,ta);break;case 5:Io(s,an,ta);break;default:throw Error(o(329))}}}return on(s,yr()),s.callbackNode===C?$b.bind(null,s):null}function n1(s,c){var C=vu;return s.current.memoizedState.isDehydrated&&(No(s,c).flags|=256),s=Ff(s,c),s!==2&&(c=an,an=C,c!==null&&i1(c)),s}function i1(s){an===null?an=s:an.push.apply(an,s)}function fE(s){for(var c=s;;){if(c.flags&16384){var C=c.updateQueue;if(C!==null&&(C=C.stores,C!==null))for(var N=0;N<C.length;N++){var F=C[N],G=F.getSnapshot;F=F.value;try{if(!Qn(G(),F))return!1}catch{return!1}}}if(C=c.child,c.subtreeFlags&16384&&C!==null)C.return=c,c=C;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 Da(s,c){for(c&=~Q0,c&=~Mf,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var C=31-Zn(c),N=1<<C;s[C]=-1,c&=~N}}function Gb(s){if(ft&6)throw Error(o(327));Do();var c=ef(s,0);if(!(c&1))return on(s,yr()),null;var C=Ff(s,c);if(s.tag!==0&&C===2){var N=r0(s);N!==0&&(c=N,C=n1(s,N))}if(C===1)throw C=gu,No(s,0),Da(s,c),on(s,yr()),C;if(C===6)throw Error(o(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,Io(s,an,ta),on(s,yr()),null}function Vb(s){Na!==null&&Na.tag===0&&!(ft&6)&&Do();var c=ft;ft|=1;var C=er.transition,N=_t;try{if(er.transition=null,_t=1,s)return s()}finally{_t=N,er.transition=C,ft=c,!(ft&6)&&Oi()}}function a1(){Sn=Fl.current,jt(Fl)}function No(s,c){s.finishedWork=null,s.finishedLanes=0;var C=s.timeoutHandle;if(C!==X&&(s.timeoutHandle=X,Y(C)),nr!==null)for(C=nr.return;C!==null;){var N=C;switch(c0(N),N.tag){case 1:N=N.type.childContextTypes,N!=null&&Xc();break;case 3:Il(),jt(tn),jt(Dr),E0();break;case 5:w0(N);break;case 4:Il();break;case 13:jt(Vt);break;case 19:jt(Vt);break;case 10:v0(N.type._context);break;case 22:case 23:a1()}C=C.return}if(_r=s,nr=s=ja(s.current,null),Tr=Sn=c,sr=0,gu=null,Q0=Mf=Lo=0,an=vu=null,Ro!==null){for(c=0;c<Ro.length;c++)if(C=Ro[c],N=C.interleaved,N!==null){C.interleaved=null;var F=N.next,G=C.pending;if(G!==null){var J=G.next;G.next=F,N.next=J}C.pending=N}Ro=null}return s}function qb(s,c){do{var C=nr;try{if(g0(),pf.current=yf,gf){for(var N=qt.memoizedState;N!==null;){var F=N.queue;F!==null&&(F.pending=null),N=N.next}gf=!1}if(Mo=0,br=lr=qt=null,ou=!1,lu=0,Z0.current=null,C===null||C.return===null){sr=1,gu=c,nr=null;break}e:{var G=s,J=C.return,ae=C,pe=c;if(c=Tr,ae.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Ce=pe,Ve=ae,nt=Ve.tag;if(!(Ve.mode&1)&&(nt===0||nt===11||nt===15)){var Ie=Ve.alternate;Ie?(Ve.updateQueue=Ie.updateQueue,Ve.memoizedState=Ie.memoizedState,Ve.lanes=Ie.lanes):(Ve.updateQueue=null,Ve.memoizedState=null)}var Ft=mb(J);if(Ft!==null){Ft.flags&=-257,yb(Ft,J,ae,G,c),Ft.mode&1&&vb(G,Ce,c),c=Ft,pe=Ce;var At=c.updateQueue;if(At===null){var ln=new Set;ln.add(pe),c.updateQueue=ln}else At.add(pe);break e}else{if(!(c&1)){vb(G,Ce,c),o1();break e}pe=Error(o(426))}}else if(Ut&&ae.mode&1){var ra=mb(J);if(ra!==null){!(ra.flags&65536)&&(ra.flags|=256),yb(ra,J,ae,G,c),h0(Dl(pe,ae));break e}}G=pe=Dl(pe,ae),sr!==4&&(sr=2),vu===null?vu=[G]:vu.push(G),G=J;do{switch(G.tag){case 3:G.flags|=65536,c&=-c,G.lanes|=c;var he=pb(G,pe,c);U2(G,he);break e;case 1:ae=pe;var se=G.type,ge=G.stateNode;if(!(G.flags&128)&&(typeof se.getDerivedStateFromError=="function"||ge!==null&&typeof ge.componentDidCatch=="function"&&(La===null||!La.has(ge)))){G.flags|=65536,c&=-c,G.lanes|=c;var De=gb(G,ae,c);U2(G,De);break e}}G=G.return}while(G!==null)}Yb(C)}catch(Xe){c=Xe,nr===C&&C!==null&&(nr=C=C.return);continue}break}while(!0)}function Wb(){var s=Rf.current;return Rf.current=yf,s===null?yf:s}function o1(){(sr===0||sr===3||sr===2)&&(sr=4),_r===null||!(Lo&268435455)&&!(Mf&268435455)||Da(_r,Tr)}function Ff(s,c){var C=ft;ft|=2;var N=Wb();(_r!==s||Tr!==c)&&(ta=null,No(s,c));do try{dE();break}catch(F){qb(s,F)}while(!0);if(g0(),ft=C,Rf.current=N,nr!==null)throw Error(o(261));return _r=null,Tr=0,sr}function dE(){for(;nr!==null;)Kb(nr)}function hE(){for(;nr!==null&&!zS();)Kb(nr)}function Kb(s){var c=Qb(s.alternate,s,Sn);s.memoizedProps=s.pendingProps,c===null?Yb(s):nr=c,Z0.current=null}function Yb(s){var c=s;do{var C=c.alternate;if(s=c.return,c.flags&32768){if(C=oE(C,c),C!==null){C.flags&=32767,nr=C;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{sr=6,nr=null;return}}else if(C=aE(C,c,Sn),C!==null){nr=C;return}if(c=c.sibling,c!==null){nr=c;return}nr=c=s}while(c!==null);sr===0&&(sr=5)}function Io(s,c,C){var N=_t,F=er.transition;try{er.transition=null,_t=1,pE(s,c,C,N)}finally{er.transition=F,_t=N}return null}function pE(s,c,C,N){do Do();while(Na!==null);if(ft&6)throw Error(o(327));C=s.finishedWork;var F=s.finishedLanes;if(C===null)return null;if(s.finishedWork=null,s.finishedLanes=0,C===s.current)throw Error(o(177));s.callbackNode=null,s.callbackPriority=0;var G=C.lanes|C.childLanes;if(FS(s,G),s===_r&&(nr=_r=null,Tr=0),!(C.subtreeFlags&2064)&&!(C.flags&2064)||Nf||(Nf=!0,Jb(l0,function(){return Do(),null})),G=(C.flags&15990)!==0,C.subtreeFlags&15990||G){G=er.transition,er.transition=null;var J=_t;_t=1;var ae=ft;ft|=4,Z0.current=null,sE(s,C),jb(C,s),A(s.containerInfo),s.current=C,uE(C),BS(),ft=ae,_t=J,er.transition=G}else s.current=C;if(Nf&&(Nf=!1,Na=s,If=F),G=s.pendingLanes,G===0&&(La=null),$S(C.stateNode),on(s,yr()),c!==null)for(N=s.onRecoverableError,C=0;C<c.length;C++)F=c[C],N(F.value,{componentStack:F.stack,digest:F.digest});if(Lf)throw Lf=!1,s=t1,t1=null,s;return If&1&&s.tag!==0&&Do(),G=s.pendingLanes,G&1?s===r1?mu++:(mu=0,r1=s):mu=0,Oi(),null}function Do(){if(Na!==null){var s=C2(If),c=er.transition,C=_t;try{if(er.transition=null,_t=16>s?16:s,Na===null)var N=!1;else{if(s=Na,Na=null,If=0,ft&6)throw Error(o(331));var F=ft;for(ft|=4,Ue=s.current;Ue!==null;){var G=Ue,J=G.child;if(Ue.flags&16){var ae=G.deletions;if(ae!==null){for(var pe=0;pe<ae.length;pe++){var Ce=ae[pe];for(Ue=Ce;Ue!==null;){var Ve=Ue;switch(Ve.tag){case 0:case 11:case 15:hu(8,Ve,G)}var nt=Ve.child;if(nt!==null)nt.return=Ve,Ue=nt;else for(;Ue!==null;){Ve=Ue;var Ie=Ve.sibling,Ft=Ve.return;if(Lb(Ve),Ve===Ce){Ue=null;break}if(Ie!==null){Ie.return=Ft,Ue=Ie;break}Ue=Ft}}}var At=G.alternate;if(At!==null){var ln=At.child;if(ln!==null){At.child=null;do{var ra=ln.sibling;ln.sibling=null,ln=ra}while(ln!==null)}}Ue=G}}if(G.subtreeFlags&2064&&J!==null)J.return=G,Ue=J;else e:for(;Ue!==null;){if(G=Ue,G.flags&2048)switch(G.tag){case 0:case 11:case 15:hu(9,G,G.return)}var he=G.sibling;if(he!==null){he.return=G.return,Ue=he;break e}Ue=G.return}}var se=s.current;for(Ue=se;Ue!==null;){J=Ue;var ge=J.child;if(J.subtreeFlags&2064&&ge!==null)ge.return=J,Ue=ge;else e:for(J=se;Ue!==null;){if(ae=Ue,ae.flags&2048)try{switch(ae.tag){case 0:case 11:case 15:Pf(9,ae)}}catch(Xe){Ht(ae,ae.return,Xe)}if(ae===J){Ue=null;break e}var De=ae.sibling;if(De!==null){De.return=ae.return,Ue=De;break e}Ue=ae.return}}if(ft=F,Oi(),Ei&&typeof Ei.onPostCommitFiberRoot=="function")try{Ei.onPostCommitFiberRoot(tf,s)}catch{}N=!0}return N}finally{_t=C,er.transition=c}}return!1}function Xb(s,c,C){c=Dl(C,c),c=pb(s,c,1),s=Ma(s,c,1),c=Br(),s!==null&&(tu(s,1,c),on(s,c))}function Ht(s,c,C){if(s.tag===3)Xb(s,s,C);else for(;c!==null;){if(c.tag===3){Xb(c,s,C);break}else if(c.tag===1){var N=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof N.componentDidCatch=="function"&&(La===null||!La.has(N))){s=Dl(C,s),s=gb(c,s,1),c=Ma(c,s,1),s=Br(),c!==null&&(tu(c,1,s),on(c,s));break}}c=c.return}}function gE(s,c,C){var N=s.pingCache;N!==null&&N.delete(c),c=Br(),s.pingedLanes|=s.suspendedLanes&C,_r===s&&(Tr&C)===C&&(sr===4||sr===3&&(Tr&130023424)===Tr&&500>yr()-J0?No(s,0):Q0|=C),on(s,c)}function Zb(s,c){c===0&&(s.mode&1?(c=Jc,Jc<<=1,!(Jc&130023424)&&(Jc=4194304)):c=1);var C=Br();s=Pi(s,c),s!==null&&(tu(s,c,C),on(s,C))}function vE(s){var c=s.memoizedState,C=0;c!==null&&(C=c.retryLane),Zb(s,C)}function mE(s,c){var C=0;switch(s.tag){case 13:var N=s.stateNode,F=s.memoizedState;F!==null&&(C=F.retryLane);break;case 19:N=s.stateNode;break;default:throw Error(o(314))}N!==null&&N.delete(c),Zb(s,C)}var Qb;Qb=function(s,c,C){if(s!==null)if(s.memoizedProps!==c.pendingProps||tn.current)nn=!0;else{if(!(s.lanes&C)&&!(c.flags&128))return nn=!1,iE(s,c,C);nn=!!(s.flags&131072)}else nn=!1,Ut&&c.flags&1048576&&A2(c,af,c.index);switch(c.lanes=0,c.tag){case 2:var N=c.type;wf(s,c),s=c.pendingProps;var F=Cl(c,Dr.current);Ll(c,C),F=x0(null,c,N,s,F,C);var G=C0();return c.flags|=1,typeof F=="object"&&F!==null&&typeof F.render=="function"&&F.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,rn(N)?(G=!0,Zc(c)):G=!1,c.memoizedState=F.state!==null&&F.state!==void 0?F.state:null,b0(c),F.updater=bf,c.stateNode=F,F._reactInternals=c,L0(c,N,s,C),c=j0(null,c,N,!0,G,C)):(c.tag=0,Ut&&G&&u0(c),Wr(null,c,F,C),c=c.child),c;case 16:N=c.elementType;e:{switch(wf(s,c),s=c.pendingProps,F=N._init,N=F(N._payload),c.type=N,F=c.tag=bE(N),s=ei(N,s),F){case 0:c=D0(null,c,N,s,C);break e;case 1:c=Ob(null,c,N,s,C);break e;case 11:c=bb(null,c,N,s,C);break e;case 14:c=_b(null,c,N,ei(N.type,s),C);break e}throw Error(o(306,N,""))}return c;case 0:return N=c.type,F=c.pendingProps,F=c.elementType===N?F:ei(N,F),D0(s,c,N,F,C);case 1:return N=c.type,F=c.pendingProps,F=c.elementType===N?F:ei(N,F),Ob(s,c,N,F,C);case 3:e:{if(Pb(c),s===null)throw Error(o(387));N=c.pendingProps,G=c.memoizedState,F=G.element,B2(s,c),df(c,N,null,C);var J=c.memoizedState;if(N=J.element,ne&&G.isDehydrated)if(G={element:N,isDehydrated:!1,cache:J.cache,pendingSuspenseBoundaries:J.pendingSuspenseBoundaries,transitions:J.transitions},c.updateQueue.baseState=G,c.memoizedState=G,c.flags&256){F=Dl(Error(o(423)),c),c=xb(s,c,N,C,F);break e}else if(N!==F){F=Dl(Error(o(424)),c),c=xb(s,c,N,C,F);break e}else for(ne&&(In=mr(c.stateNode.containerInfo),wn=c,Ut=!0,Jn=null,ru=!1),C=j2(c,null,N,C),c.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(Al(),N===F){c=ea(s,c,C);break e}Wr(s,c,N,C)}c=c.child}return c;case 5:return $2(c),s===null&&d0(c),N=c.type,F=c.pendingProps,G=s!==null?s.memoizedProps:null,J=F.children,W(N,F)?J=null:G!==null&&W(N,G)&&(c.flags|=32),Eb(s,c),Wr(s,c,J,C),c.child;case 6:return s===null&&d0(c),null;case 13:return Cb(s,c,C);case 4:return _0(c,c.stateNode.containerInfo),N=c.pendingProps,s===null?c.child=Rl(c,null,N,C):Wr(s,c,N,C),c.child;case 11:return N=c.type,F=c.pendingProps,F=c.elementType===N?F:ei(N,F),bb(s,c,N,F,C);case 7:return Wr(s,c,c.pendingProps,C),c.child;case 8:return Wr(s,c,c.pendingProps.children,C),c.child;case 12:return Wr(s,c,c.pendingProps.children,C),c.child;case 10:e:{if(N=c.type._context,F=c.pendingProps,G=c.memoizedProps,J=F.value,F2(c,N,J),G!==null)if(Qn(G.value,J)){if(G.children===F.children&&!tn.current){c=ea(s,c,C);break e}}else for(G=c.child,G!==null&&(G.return=c);G!==null;){var ae=G.dependencies;if(ae!==null){J=G.child;for(var pe=ae.firstContext;pe!==null;){if(pe.context===N){if(G.tag===1){pe=Ji(-1,C&-C),pe.tag=2;var Ce=G.updateQueue;if(Ce!==null){Ce=Ce.shared;var Ve=Ce.pending;Ve===null?pe.next=pe:(pe.next=Ve.next,Ve.next=pe),Ce.pending=pe}}G.lanes|=C,pe=G.alternate,pe!==null&&(pe.lanes|=C),m0(G.return,C,c),ae.lanes|=C;break}pe=pe.next}}else if(G.tag===10)J=G.type===c.type?null:G.child;else if(G.tag===18){if(J=G.return,J===null)throw Error(o(341));J.lanes|=C,ae=J.alternate,ae!==null&&(ae.lanes|=C),m0(J,C,c),J=G.sibling}else J=G.child;if(J!==null)J.return=G;else for(J=G;J!==null;){if(J===c){J=null;break}if(G=J.sibling,G!==null){G.return=J.return,J=G;break}J=J.return}G=J}Wr(s,c,F.children,C),c=c.child}return c;case 9:return F=c.type,N=c.pendingProps.children,Ll(c,C),F=Dn(F),N=N(F),c.flags|=1,Wr(s,c,N,C),c.child;case 14:return N=c.type,F=ei(N,c.pendingProps),F=ei(N.type,F),_b(s,c,N,F,C);case 15:return wb(s,c,c.type,c.pendingProps,C);case 17:return N=c.type,F=c.pendingProps,F=c.elementType===N?F:ei(N,F),wf(s,c),c.tag=1,rn(N)?(s=!0,Zc(c)):s=!1,Ll(c,C),db(c,N,F),L0(c,N,F,C),j0(null,c,N,!0,s,C);case 19:return kb(s,c,C);case 22:return Sb(s,c,C)}throw Error(o(156,c.tag))};function Jb(s,c){return a0(s,c)}function yE(s,c,C,N){this.tag=s,this.key=C,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=N,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bn(s,c,C,N){return new yE(s,c,C,N)}function l1(s){return s=s.prototype,!(!s||!s.isReactComponent)}function bE(s){if(typeof s=="function")return l1(s)?1:0;if(s!=null){if(s=s.$$typeof,s===m)return 11;if(s===v)return 14}return 2}function ja(s,c){var C=s.alternate;return C===null?(C=Bn(s.tag,c,s.key,s.mode),C.elementType=s.elementType,C.type=s.type,C.stateNode=s.stateNode,C.alternate=s,s.alternate=C):(C.pendingProps=c,C.type=s.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=s.flags&14680064,C.childLanes=s.childLanes,C.lanes=s.lanes,C.child=s.child,C.memoizedProps=s.memoizedProps,C.memoizedState=s.memoizedState,C.updateQueue=s.updateQueue,c=s.dependencies,C.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},C.sibling=s.sibling,C.index=s.index,C.ref=s.ref,C}function zf(s,c,C,N,F,G){var J=2;if(N=s,typeof s=="function")l1(s)&&(J=1);else if(typeof s=="string")J=5;else e:switch(s){case g:return jo(C.children,F,G,c);case S:J=8,F|=8;break;case _:return s=Bn(12,C,c,F|2),s.elementType=_,s.lanes=G,s;case y:return s=Bn(13,C,c,F),s.elementType=y,s.lanes=G,s;case p:return s=Bn(19,C,c,F),s.elementType=p,s.lanes=G,s;case b:return Bf(C,F,G,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case h:J=10;break e;case w:J=9;break e;case m:J=11;break e;case v:J=14;break e;case d:J=16,N=null;break e}throw Error(o(130,s==null?s:typeof s,""))}return c=Bn(J,C,c,F),c.elementType=s,c.type=N,c.lanes=G,c}function jo(s,c,C,N){return s=Bn(7,s,N,c),s.lanes=C,s}function Bf(s,c,C,N){return s=Bn(22,s,N,c),s.elementType=b,s.lanes=C,s.stateNode={isHidden:!1},s}function s1(s,c,C){return s=Bn(6,s,null,c),s.lanes=C,s}function u1(s,c,C){return c=Bn(4,s.children!==null?s.children:[],s.key,c),c.lanes=C,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function _E(s,c,C,N,F){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=X,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=n0(0),this.expirationTimes=n0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=n0(0),this.identifierPrefix=N,this.onRecoverableError=F,ne&&(this.mutableSourceEagerHydrationData=null)}function e3(s,c,C,N,F,G,J,ae,pe){return s=new _E(s,c,C,ae,pe),c===1?(c=1,G===!0&&(c|=8)):c=0,G=Bn(3,null,null,c),s.current=G,G.stateNode=s,G.memoizedState={element:N,isDehydrated:C,cache:null,transitions:null,pendingSuspenseBoundaries:null},b0(G),s}function t3(s){if(!s)return Aa;s=s._reactInternals;e:{if(P(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(rn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(o(171))}if(s.tag===1){var C=s.type;if(rn(C))return O2(s,C,c)}return c}function r3(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 n3(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var C=s.retryLane;s.retryLane=C!==0&&C<c?C:c}}function Uf(s,c){n3(s,c),(s=s.alternate)&&n3(s,c)}function wE(s){return s=M(s),s===null?null:s.stateNode}function SE(){return null}return r.attemptContinuousHydration=function(s){if(s.tag===13){var c=Pi(s,134217728);if(c!==null){var C=Br();zn(c,s,134217728,C)}Uf(s,134217728)}},r.attemptDiscreteHydration=function(s){if(s.tag===13){var c=Pi(s,1);if(c!==null){var C=Br();zn(c,s,1,C)}Uf(s,1)}},r.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var c=Ia(s),C=Pi(s,c);if(C!==null){var N=Br();zn(C,s,c,N)}Uf(s,c)}},r.attemptSynchronousHydration=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var C=eu(c.pendingLanes);C!==0&&(i0(c,C|1),on(c,yr()),!(ft&6)&&(zl(),Oi()))}break;case 13:Vb(function(){var N=Pi(s,1);if(N!==null){var F=Br();zn(N,s,1,F)}}),Uf(s,1)}},r.batchedUpdates=function(s,c){var C=ft;ft|=1;try{return s(c)}finally{ft=C,ft===0&&(zl(),rf&&Oi())}},r.createComponentSelector=function(s){return{$$typeof:xf,value:s}},r.createContainer=function(s,c,C,N,F,G,J){return e3(s,c,!1,null,C,N,F,G,J)},r.createHasPseudoClassSelector=function(s){return{$$typeof:Cf,value:s}},r.createHydrationContainer=function(s,c,C,N,F,G,J,ae,pe){return s=e3(C,N,!0,s,F,G,J,ae,pe),s.context=t3(null),C=s.current,N=Br(),F=Ia(C),G=Ji(N,F),G.callback=c??null,Ma(C,G,F),s.current.lanes=F,tu(s,F,N),on(s,N),s},r.createPortal=function(s,c,C){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:N==null?null:""+N,children:s,containerInfo:c,implementation:C}},r.createRoleSelector=function(s){return{$$typeof:Tf,value:s}},r.createTestNameSelector=function(s){return{$$typeof:kf,value:s}},r.createTextSelector=function(s){return{$$typeof:Af,value:s}},r.deferredUpdates=function(s){var c=_t,C=er.transition;try{return er.transition=null,_t=16,s()}finally{_t=c,er.transition=C}},r.discreteUpdates=function(s,c,C,N,F){var G=_t,J=er.transition;try{return er.transition=null,_t=1,s(c,C,N,F)}finally{_t=G,er.transition=J,ft===0&&zl()}},r.findAllNodes=X0,r.findBoundingRects=function(s,c){if(!ve)throw Error(o(363));c=X0(s,c),s=[];for(var C=0;C<c.length;C++)s.push(re(c[C]));for(c=s.length-1;0<c;c--){C=s[c];for(var N=C.x,F=N+C.width,G=C.y,J=G+C.height,ae=c-1;0<=ae;ae--)if(c!==ae){var pe=s[ae],Ce=pe.x,Ve=Ce+pe.width,nt=pe.y,Ie=nt+pe.height;if(N>=Ce&&G>=nt&&F<=Ve&&J<=Ie){s.splice(c,1);break}else if(N!==Ce||C.width!==pe.width||Ie<G||nt>J){if(!(G!==nt||C.height!==pe.height||Ve<N||Ce>F)){Ce>N&&(pe.width+=Ce-N,pe.x=N),Ve<F&&(pe.width=F-Ce),s.splice(c,1);break}}else{nt>G&&(pe.height+=nt-G,pe.y=G),Ie<J&&(pe.height=J-nt),s.splice(c,1);break}}}return s},r.findHostInstance=r3,r.findHostInstanceWithNoPortals=function(s){return s=k(s),s=s!==null?B(s):null,s===null?null:s.stateNode},r.findHostInstanceWithWarning=function(s){return r3(s)},r.flushControlled=function(s){var c=ft;ft|=1;var C=er.transition,N=_t;try{er.transition=null,_t=1,s()}finally{_t=N,er.transition=C,ft=c,ft===0&&(zl(),Oi())}},r.flushPassiveEffects=Do,r.flushSync=Vb,r.focusWithin=function(s,c){if(!ve)throw Error(o(363));for(s=W0(s),c=Hb(s,c),c=Array.from(c),s=0;s<c.length;){var C=c[s++];if(!me(C)){if(C.tag===5&&Te(C.stateNode))return!0;for(C=C.child;C!==null;)c.push(C),C=C.sibling}}return!1},r.getCurrentUpdatePriority=function(){return _t},r.getFindAllNodesFailureDescription=function(s,c){if(!ve)throw Error(o(363));var C=0,N=[];s=[W0(s),0];for(var F=0;F<s.length;){var G=s[F++],J=s[F++],ae=c[J];if((G.tag!==5||!me(G))&&(K0(G,ae)&&(N.push(Y0(ae)),J++,J>C&&(C=J)),J<c.length))for(G=G.child;G!==null;)s.push(G,J),G=G.sibling}if(C<c.length){for(s=[];C<c.length;C++)s.push(Y0(c[C]));return`findAllNodes was able to match part of the selector:
|
|
58
|
+
`+(N.join(" > ")+`
|
|
59
|
+
|
|
60
|
+
No matching component was found for:
|
|
61
|
+
`)+s.join(" > ")}return null},r.getPublicRootInstance=function(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return Z(s.child.stateNode);default:return s.child.stateNode}},r.injectIntoDevTools=function(s){if(s={bundleType:s.bundleType,version:s.version,rendererPackageName:s.rendererPackageName,rendererConfig:s.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:wE,findFiberByHostInstance:s.findFiberByHostInstance||SE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")s=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)s=!0;else{try{tf=c.inject(s),Ei=c}catch{}s=!!c.checkDCE}}return s},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(s,c,C,N){if(!ve)throw Error(o(363));s=X0(s,c);var F=ze(s,C,N).disconnect;return{disconnect:function(){F()}}},r.registerMutableSourceForHydration=function(s,c){var C=c._getVersion;C=C(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,C]:s.mutableSourceEagerHydrationData.push(c,C)},r.runWithPriority=function(s,c){var C=_t;try{return _t=s,c()}finally{_t=C}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(s,c,C,N){var F=c.current,G=Br(),J=Ia(F);return C=t3(C),c.context===null?c.context=C:c.pendingContext=C,c=Ji(G,J),c.payload={element:s},N=N===void 0?null:N,N!==null&&(c.callback=N),s=Ma(F,c,J),s!==null&&(zn(s,F,J,G),ff(s,F,J)),J},r};U9.exports=bM;var _M=U9.exports;const wM=Eh(_M);var H9={exports:{}},wl={};/**
|
|
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
|
+
*/wl.ConcurrentRoot=1;wl.ContinuousEventPriority=4;wl.DefaultEventPriority=16;wl.DiscreteEventPriority=1;wl.IdleEventPriority=536870912;wl.LegacyRoot=0;H9.exports=wl;var $9=H9.exports;const u4={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let c4=!1,f4=!1;const Yy=".react-konva-event";let G9=!1;function SM(e){G9=e}const EM=`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
|
+
`,OM=`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
|
+
`,PM={};function $p(e,t,r=PM){if(!c4&&"zIndex"in t&&(console.warn(OM),c4=!0),!f4&&t.draggable){var n=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;n&&!i&&(console.warn(EM),f4=!0)}for(var a in r)if(!u4[a]){var o=a.slice(0,2)==="on",l=r[a]!==t[a];if(o&&l){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,r[a])}var f=!t.hasOwnProperty(a);f&&e.setAttr(a,void 0)}var g=G9||t._useStrictMode,S={},_=!1;const h={};for(var a in t)if(!u4[a]){var o=a.slice(0,2)==="on",w=r[a]!==t[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)),t[a]&&(h[u]=t[a])}!o&&(t[a]!==r[a]||g&&t[a]!==e.getAttr(a))&&(_=!0,S[a]=t[a])}_&&(e.setAttrs(S),Eo(e));for(var u in h)e.on(u+Yy,h[u])}function Eo(e){if(!st.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const V9={},xM={};mc.Node.prototype._applyProps=$p;function CM(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),Eo(e)}function TM(e,t,r){let n=mc[e];n||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),n=mc.Group);const i={},a={};for(var o in t){var l=o.slice(0,2)==="on";l?a[o]=t[o]:i[o]=t[o]}const u=new n(i);return $p(u,a),u}function kM(e,t,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function AM(e,t,r){return!1}function RM(e){return e}function MM(){return null}function LM(){return null}function NM(e,t,r,n){return xM}function IM(){}function DM(e){}function jM(e,t){return!1}function FM(){return V9}function zM(){return V9}const BM=setTimeout,UM=clearTimeout,HM=-1;function $M(e,t){return!1}const GM=!1,VM=!0,qM=!0;function WM(e,t){t.parent===e?t.moveToTop():e.add(t),Eo(e)}function KM(e,t){t.parent===e?t.moveToTop():e.add(t),Eo(e)}function q9(e,t,r){t._remove(),e.add(t),t.setZIndex(r.getZIndex()),Eo(e)}function YM(e,t,r){q9(e,t,r)}function XM(e,t){t.destroy(),t.off(Yy),Eo(e)}function ZM(e,t){t.destroy(),t.off(Yy),Eo(e)}function QM(e,t,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function JM(e,t,r){}function eL(e,t,r,n,i){$p(e,i,n)}function tL(e){e.hide(),Eo(e)}function rL(e){}function nL(e,t){(t.visible==null||t.visible)&&e.show()}function iL(e,t){}function aL(e){}function oL(){}const lL=()=>$9.DefaultEventPriority,sL=Object.freeze(Object.defineProperty({__proto__:null,appendChild:WM,appendChildToContainer:KM,appendInitialChild:CM,cancelTimeout:UM,clearContainer:aL,commitMount:JM,commitTextUpdate:QM,commitUpdate:eL,createInstance:TM,createTextInstance:kM,detachDeletedInstance:oL,finalizeInitialChildren:AM,getChildHostContext:zM,getCurrentEventPriority:lL,getPublicInstance:RM,getRootHostContext:FM,hideInstance:tL,hideTextInstance:rL,idlePriority:Iu.unstable_IdlePriority,insertBefore:q9,insertInContainerBefore:YM,isPrimaryRenderer:GM,noTimeout:HM,now:Iu.unstable_now,prepareForCommit:MM,preparePortalMount:LM,prepareUpdate:NM,removeChild:XM,removeChildFromContainer:ZM,resetAfterCommit:IM,resetTextContent:DM,run:Iu.unstable_runWithPriority,scheduleTimeout:BM,shouldDeprioritizeSubtree:jM,shouldSetTextContent:$M,supportsMutation:qM,unhideInstance:nL,unhideTextInstance:iL,warnsIfNotActing:VM},Symbol.toStringTag,{value:"Module"}));var uL=Object.defineProperty,cL=Object.defineProperties,fL=Object.getOwnPropertyDescriptors,d4=Object.getOwnPropertySymbols,dL=Object.prototype.hasOwnProperty,hL=Object.prototype.propertyIsEnumerable,h4=(e,t,r)=>t in e?uL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,p4=(e,t)=>{for(var r in t||(t={}))dL.call(t,r)&&h4(e,r,t[r]);if(d4)for(var r of d4(t))hL.call(t,r)&&h4(e,r,t[r]);return e},pL=(e,t)=>cL(e,fL(t)),g4,v4;typeof window<"u"&&((g4=window.document)!=null&&g4.createElement||((v4=window.navigator)==null?void 0:v4.product)==="ReactNative")?et.useLayoutEffect:et.useEffect;function W9(e,t,r){if(!e)return;if(r(e)===!0)return e;let n=e.child;for(;n;){const i=W9(n,t,r);if(i)return i;n=n.sibling}}function K9(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const m4=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=m4;return}return m4.apply(this,arguments)};const Xy=K9(et.createContext(null));class Y9 extends et.Component{render(){return et.createElement(Xy.Provider,{value:this._reactInternals},this.props.children)}}function gL(){const e=et.useContext(Xy);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=et.useId();return et.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const i=W9(n,!1,a=>{let o=a.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}});if(i)return i}},[e,t])}function vL(){const e=gL(),[t]=et.useState(()=>new Map);t.clear();let r=e;for(;r;){if(r.type&&typeof r.type=="object"){const i=r.type._context===void 0&&r.type.Provider===r.type?r.type:r.type._context;i&&i!==Xy&&!t.has(i)&&t.set(i,et.useContext(K9(i)))}r=r.return}return t}function X9(){const e=vL();return et.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>n=>et.createElement(t,null,et.createElement(r.Provider,pL(p4({},n),{value:e.get(r)}))),t=>et.createElement(Y9,p4({},t))),[e])}function mL(e){const t=ht.useRef({});return ht.useLayoutEffect(()=>{t.current=e}),ht.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const yL=e=>{const t=ht.useRef(),r=ht.useRef(),n=ht.useRef(),i=mL(e),a=X9(),o=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return ht.useLayoutEffect(()=>(r.current=new mc.Stage({width:e.width,height:e.height,container:t.current}),o(r.current),n.current=os.createContainer(r.current,$9.LegacyRoot,!1,null),os.updateContainer(ht.createElement(a,{},e.children),n.current),()=>{mc.isBrowser&&(o(null),os.updateContainer(null,n.current,null),r.current.destroy())}),[]),ht.useLayoutEffect(()=>{o(r.current),$p(r.current,e,i),os.updateContainer(ht.createElement(a,{},e.children),n.current,null)}),ht.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},bL="Layer",_L="FastLayer",bh="Group",wL="Label",SL="Rect",EL="Circle",OL="Ellipse",PL="Wedge",xL="Line",CL="Sprite",TL="Image",kL="Text",AL="TextPath",RL="Star",ML="Ring",LL="Arc",NL="Tag",IL="Path",DL="RegularPolygon",jL="Arrow",FL="Shape",zL="Transformer",os=wM(sL);os.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:ht.version,rendererPackageName:"react-konva"});const BL=ht.forwardRef((e,t)=>ht.createElement(Y9,{},ht.createElement(yL,{...e,forwardedRef:t}))),UL=SM,HL=Object.freeze(Object.defineProperty({__proto__:null,Arc:LL,Arrow:jL,Circle:EL,Ellipse:OL,FastLayer:_L,Group:bh,Image:TL,KonvaRenderer:os,Label:wL,Layer:bL,Line:xL,Path:IL,Rect:SL,RegularPolygon:DL,Ring:ML,Shape:FL,Sprite:CL,Stage:BL,Star:RL,Tag:NL,Text:kL,TextPath:AL,Transformer:zL,Wedge:PL,useStrictMode:UL},Symbol.toStringTag,{value:"Module"})),Pa=fo(HL);var zo=et,Gp=function(t,r,n){const i=zo.useRef("loading"),a=zo.useRef(),[o,l]=zo.useState(0),u=zo.useRef(),f=zo.useRef(),g=zo.useRef();return(u.current!==t||f.current!==r||g.current!==n)&&(i.current="loading",a.current=void 0,u.current=t,f.current=r,g.current=n),zo.useLayoutEffect(function(){if(!t)return;var S=document.createElement("img");function _(){i.current="loaded",a.current=S,l(Math.random())}function h(){i.current="failed",a.current=void 0,l(Math.random())}return S.addEventListener("load",_),S.addEventListener("error",h),r&&(S.crossOrigin=r),n&&(S.referrerPolicy=n),S.src=t,function(){S.removeEventListener("load",_),S.removeEventListener("error",h)}},[t,r,n]),[a.current,i.current]};const $L=Eh(Gp);var Z9={},Zy={},GL=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const VL=e=>{const t=window.getComputedStyle(e).position;return!(t==="absolute"||t==="relative")};function Q9(e=()=>{}){const t=ht.useRef(e);return t.current=e,ht.useCallback((...r)=>t.current.apply(null,r),[])}const qL=({children:e,groupProps:t,divProps:r,transform:n,transformFunc:i})=>{const a=X9(),o=ht.useRef(null);ht.useRef();const[l]=ht.useState(()=>document.createElement("div")),u=ht.useMemo(()=>Nd.createRoot(l),[l]),f=n??!0,g=Q9(()=>{if(f&&o.current){let m=o.current.getAbsoluteTransform().decompose();i&&(m=i(m)),l.style.position="absolute",l.style.zIndex="10",l.style.top="0px",l.style.left="0px",l.style.transform=`translate(${m.x}px, ${m.y}px) rotate(${m.rotation}deg) scaleX(${m.scaleX}) scaleY(${m.scaleY})`,l.style.transformOrigin="top left"}else l.style.position="",l.style.zIndex="",l.style.top="",l.style.left="",l.style.transform="",l.style.transformOrigin="";const S=r||{},{style:_}=S,h=GL(S,["style"]);Object.assign(l.style,_),Object.assign(l,h)});return ht.useLayoutEffect(()=>{var S;const _=o.current;if(!_)return;const h=(S=_.getStage())===null||S===void 0?void 0:S.container();if(h)return h.appendChild(l),f&&VL(h)&&(h.style.position="relative"),_.on("absoluteTransformChange",g),g(),()=>{var w;_.off("absoluteTransformChange",g),(w=l.parentNode)===null||w===void 0||w.removeChild(l)}},[f]),ht.useLayoutEffect(()=>{g()},[r,i]),ht.useLayoutEffect(()=>{u.render(ht.createElement(a,null,e))}),ht.useLayoutEffect(()=>()=>{setTimeout(()=>{u.unmount()})},[]),ht.createElement(bh,Object.assign({ref:o},t))},WL=({selector:e,enabled:t,children:r})=>{const n=ht.useRef(null),i=ht.useRef(null),a=ht.useRef(),o=t??!0;return ht.useLayoutEffect(()=>{if(!n.current||!i.current)return;a.current=i.current;const u=n.current.getStage().findOne(e);o&&u?i.current.moveTo(u):i.current.moveTo(n.current);const f=n.current.getLayer();if(f&&(f.batchDraw(),u)){const g=u.getLayer();if(!g)return;g.batchDraw()}},[e,o]),ht.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.destroy()},[]),ht.createElement(bh,{name:"_outer_portal",ref:n},ht.createElement(bh,{name:"_inner_portal",ref:i},r))},KL=Object.freeze(Object.defineProperty({__proto__:null,Html:qL,Portal:WL,useEvent:Q9,useImage:$L},Symbol.toStringTag,{value:"Module"})),$c=fo(KL);function YL(e,t){return Object.keys(e.values).forEach(r=>e.values[r]=e.values[r]&&parseFloat(e.values[r].toFixed(t))),e}function J9(e,t,r){const n=t-1,i=r[t7(n,r.length)];return i.marker!=="Z"?i:J9(e,n,r)}function e7(e,t,r){const n=t+1,i=r[t7(n,r.length)];return i.marker==="Z"?e7(e,n,r):i}function XL(e,t,r){let n=r[t-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"L":case"A":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"H":e.marker="L",e.values.x+=n.values.x,e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x,e.values.y+=n.values.y;break;case"C":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"S":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"Q":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y;break;case"T":e.values.x+=n.values.x,e.values.y+=n.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x;break}if(e.marker==="Z"){let a=function(l,u){return l[u].marker==="M"?l[u]:a(l,u-1)};var i=a;let o=a(r,t);e.values.x=o.values.x,e.values.y=o.values.y}return e}function ZL(e,t){const r=[];switch(e.toUpperCase()){case"M":for(let n=0;n<t.length;n+=2){let i;e===e.toUpperCase()?i=n===0?"M":"L":i=n===0?"m":"l",r.push({marker:i,values:{x:t[n],y:t[n+1]}})}break;case"L":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"H":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:t[n],y:0}});break;case"V":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:0,y:t[n]}});break;case"C":for(let n=0;n<t.length;n+=6)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x2:t[n+2],y2:t[n+3],x:t[n+4],y:t[n+5]}});break;case"S":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x2:t[n],y2:t[n+1],x:t[n+2],y:t[n+3]}});break;case"Q":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x:t[n+2],y:t[n+3]}});break;case"T":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"A":for(let n=0;n<t.length;n+=7)r.push({marker:e,values:{radiusX:t[n],radiusY:t[n+1],rotation:t[n+2],largeArc:t[n+3],sweep:t[n+4],x:t[n+5],y:t[n+6]}});break;case"Z":r.push({marker:e,values:{x:0,y:0}});break}return r}function t7(e,t){return(e%t+t)%t}function QL(e,t,r){if(t!==0&&e.marker==="L"){let n=r[t-1];["x","y"].every(a=>Math.round(Math.abs(n.values[a]-e.values[a]))===0)&&(e.overlap=!0)}return e}function vm(e,t){const r=["x","y"].every(n=>Math.round(Math.abs(e[t].values[n]-e[0].values[n]))===0);e[t].marker==="L"&&r&&(e[t].overlap=!0,vm(e,t-1)),e[t].marker==="Z"&&vm(e,t-1)}function JL(e,t,r){const n=b4(e.values,r.values),i=b4(t.values,e.values);return Math.min(i,n)}function y4(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function b4(e,t){const r=e.x-t.x,n=e.y-t.y;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2))}function _4(e,t){return Math.sin(e)*t}function w4(e,t){return Math.cos(e)*t}function S4(e,t){const r=t/Math.tan(e);return r===1/0||r===-1/0||isNaN(r)?t:r}function eN(e,t){return t*Math.tan(e)}function tN(e,t){let r,n=0,i=e*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=S4(e/2,-t):(r=S4(e/2,t),n=1,r===1/0&&(r=t)),{offset:r,sweepFlag:n}}function rN(e){const t=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(r=>{let n="";if(r.marker!=="Z"){const i=Object.keys(r.values);n=t.filter(a=>i.indexOf(a)!==-1).map(a=>r.values[a]).join()}return`${r.marker}${n}`}).join("").trim()}function r7(e){const t=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,r=/-?[0-9]*\.?\d+/g;return[...e.matchAll(t)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,i)=>{const a=e.substring(i.index,n.length?n[n.length-1].index:e.length);return n.concat([{marker:i.marker,index:i.index,chunk:a.length>0?a.substr(1,a.length-1):a}])},[]).reverse().flatMap(n=>{const i=n.chunk.match(r),a=i?i.map(parseFloat):[];return ZL(n.marker,a)}).map(XL)}function n7(e,t,r){let n=[],i=[];return r&&e.forEach(a=>YL(a,r)),e.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(QL),vm(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(l=>!l.overlap).map((l,u,f)=>{const S=J9(l,u,f),_=e7(l,u,f),h=y4(l.values,S.values),w=y4(l.values,_.values),m=w-h,y=m*(180/Math.PI),p=JL(l,S,_),v=Math.abs(eN(m/2,p/2)),d=Math.min(t,v),b=tN(m,d),O=b.offset,R=b.sweepFlag,T=(u==0||u==f.length-1)&&!o;switch(l.marker){case"M":case"L":const E=[l.values.x+_4(h,O),l.values.y+w4(h,O)],P=[l.values.x+_4(w,O),l.values.y+w4(w,O)];T?i.push({marker:l.marker,values:l.values}):i.push({marker:l.marker,values:{x:parseFloat(E[0].toFixed(3)),y:parseFloat(E[1].toFixed(3))}}),!T&&(_.marker==="L"||_.marker==="M")&&i.push({marker:"A",radius:d,values:{radiusX:parseFloat(d.toFixed(3)),radiusY:parseFloat(d.toFixed(3)),rotation:y,largeArc:0,sweep:R,x:parseFloat(P[0].toFixed(3)),y:parseFloat(P[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:rN(i),commands:i}}function nN(e,t,r){return n7([...r7(e)],t,r)}const iN=Object.freeze(Object.defineProperty({__proto__:null,parsePath:r7,roundCommands:n7,roundCorners:nN},Symbol.toStringTag,{value:"Module"})),aN=fo(iN);var Gc={},Qy={},Jy={},Sl=Sl||{};Sl.stringify=function(){var e={"visit_linear-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return e.visit_gradient(t)},"visit_radial-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return e.visit_gradient(t)},visit_gradient:function(t){var r=e.visit(t.orientation);return r&&(r+=", "),t.type+"("+r+e.visit(t.colorStops)+")"},visit_shape:function(t){var r=t.value,n=e.visit(t.at),i=e.visit(t.style);return i&&(r+=" "+i),n&&(r+=" at "+n),r},"visit_default-radial":function(t){var r="",n=e.visit(t.at);return n&&(r+=n),r},"visit_extent-keyword":function(t){var r=t.value,n=e.visit(t.at);return n&&(r+=" at "+n),r},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return e.visit(t.value.x)+" "+e.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_literal:function(t){return e.visit_color(t.value,t)},visit_hex:function(t){return e.visit_color("#"+t.value,t)},visit_rgb:function(t){return e.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return e.visit_color("rgba("+t.value.join(", ")+")",t)},visit_color:function(t,r){var n=t,i=e.visit(r.length);return i&&(n+=" "+i),n},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var r="",n=t.length;return t.forEach(function(i,a){r+=e.visit(i),a<n-1&&(r+=", ")}),r},visit:function(t){if(!t)return"";var r="";if(t instanceof Array)return e.visit_array(t,r);if(t.type){var n=e["visit_"+t.type];if(n)return n(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return e.visit(t)}}();var Sl=Sl||{};Sl.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function r(K){var D=new Error(t+": "+K);throw D.source=t,D}function n(){var K=i();return t.length>0&&r("Invalid input not EOF"),K}function i(){return d(a)}function a(){return o("linear-gradient",e.linearGradient,u)||o("repeating-linear-gradient",e.repeatingLinearGradient,u)||o("radial-gradient",e.radialGradient,S)||o("repeating-radial-gradient",e.repeatingRadialGradient,S)}function o(K,D,q){return l(D,function(A){var L=q();return L&&($(e.comma)||r("Missing comma before color stops")),{type:K,orientation:L,colorStops:d(b)}})}function l(K,D){var q=$(K);if(q){$(e.startCall)||r("Missing (");var A=D(q);return $(e.endCall)||r("Missing )"),A}}function u(){return f()||g()}function f(){return B("directional",e.sideOrCorner,1)}function g(){return B("angular",e.angleValue,1)}function S(){var K,D=_(),q;return D&&(K=[],K.push(D),q=t,$(e.comma)&&(D=_(),D?K.push(D):t=q)),K}function _(){var K=h()||w();if(K)K.at=y();else{var D=m();if(D){K=D;var q=y();q&&(K.at=q)}else{var A=p();A&&(K={type:"default-radial",at:A})}}return K}function h(){var K=B("shape",/^(circle)/i,0);return K&&(K.style=j()||m()),K}function w(){var K=B("shape",/^(ellipse)/i,0);return K&&(K.style=k()||m()),K}function m(){return B("extent-keyword",e.extentKeywords,1)}function y(){if(B("position",/^at/,0)){var K=p();return K||r("Missing positioning value"),K}}function p(){var K=v();if(K.x||K.y)return{type:"position",value:K}}function v(){return{x:k(),y:k()}}function d(K){var D=K(),q=[];if(D)for(q.push(D);$(e.comma);)D=K(),D?q.push(D):r("One extra comma");return q}function b(){var K=O();return K||r("Expected color definition"),K.length=k(),K}function O(){return T()||P()||E()||R()}function R(){return B("literal",e.literalColor,0)}function T(){return B("hex",e.hexColor,1)}function E(){return l(e.rgbColor,function(){return{type:"rgb",value:d(x)}})}function P(){return l(e.rgbaColor,function(){return{type:"rgba",value:d(x)}})}function x(){return $(e.number)[1]}function k(){return B("%",e.percentageValue,1)||M()||j()}function M(){return B("position-keyword",e.positionKeywords,1)}function j(){return B("px",e.pixelValue,1)||B("em",e.emValue,1)}function B(K,D,q){var A=$(D);if(A)return{type:K,value:A[q]}}function $(K){var D,q;return q=/^[\n\r\t\s]+/.exec(t),q&&Z(q[0].length),D=K.exec(t),D&&Z(D[0].length),D}function Z(K){t=t.substr(K)}return function(K){return t=K.toString(),n()}}();Jy.parse=Sl.parse;Jy.stringify=Sl.stringify;(function(e){var t=ye&&ye.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.isGradient=void 0;const r=t(Jy),n=o=>o.indexOf("linear-gradient")>=0;e.isGradient=n;const i=o=>o.type==="hex"?"#"+o.value:o.type==="literal"?o.value:`${o.type}(${o.value.join(",")})`,a=o=>{if(!(0,e.isGradient)(o))return{rotation:0,stops:[{offset:0,color:o},{offset:1,color:o}]};const l=r.default.parse(o)[0];return{rotation:parseFloat(l.orientation.value),stops:l.colorStops.map((u,f)=>({color:i(u),offset:u.length?parseFloat(u.length.value)/100:f/(l.colorStops.length-1)}))}};e.parseColor=a})(Qy);(function(e){var t=ye&&ye.__createBinding||(Object.create?function(f,g,S,_){_===void 0&&(_=S);var h=Object.getOwnPropertyDescriptor(g,S);h&&!("get"in h?!g.__esModule:h.writable||h.configurable)||(h={enumerable:!0,get:function(){return g[S]}}),Object.defineProperty(f,_,h)}:function(f,g,S,_){_===void 0&&(_=S),f[_]=g[S]}),r=ye&&ye.__setModuleDefault||(Object.create?function(f,g){Object.defineProperty(f,"default",{enumerable:!0,value:g})}:function(f,g){f.default=g}),n=ye&&ye.__importStar||function(f){if(f&&f.__esModule)return f;var g={};if(f!=null)for(var S in f)S!=="default"&&Object.prototype.hasOwnProperty.call(f,S)&&t(g,f,S);return r(g,f),g},i=ye&&ye.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const a=i(et),o=n(Qy),l=i(_i),u=(f,g=f.fill,S="fill")=>a.default.useMemo(()=>{if(!o.isGradient(g))return{[S]:g};const{stops:_,rotation:h}=o.parseColor(g),w={x:f.a.width/2,y:f.a.height/2},m=Math.sqrt(Math.pow(w.x,2)+Math.pow(w.y,2)),y=l.default.Util.degToRad(h)-Math.PI/2,p=[];return _.forEach(({offset:v,color:d})=>{p.push(v,d)}),S==="fill"?{fillLinearGradientStartPointX:w.x-m*Math.cos(y),fillLinearGradientStartPointY:w.y-m*Math.sin(y),fillLinearGradientColorStops:p,fillLinearGradientEndPointX:w.x+m*Math.cos(y),fillLinearGradientEndPointY:w.y+m*Math.sin(y),fill:_[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:w.x-m*Math.cos(y),strokeLinearGradientStartPointY:w.y-m*Math.sin(y),strokeLinearGradientColorStops:p,strokeLinearGradientEndPointX:w.x+m*Math.cos(y),strokeLinearGradientEndPointY:w.y+m*Math.sin(y)}},[g,f.width,f.height]);e.useColor=u})(Gc);var Hi={},El={};(function(e){var t=ye&&ye.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.useFadeIn=e.isAnimationUsed=e.toggleFadeInAnimation=void 0;const r=t(et),n=t(_i);let i=!1;const a=(u=!i)=>{i=u};e.toggleFadeInAnimation=a;const o=()=>i;function l(u,f){const g=r.default.useRef();r.default.useLayoutEffect(()=>{g.current&&g.current.destroy()},[f]),r.default.useLayoutEffect(()=>{if(!i)return;const S=u.current.opacity();return S?(u.current.opacity(0),g.current=new n.default.Tween({node:u.current,opacity:S,onFinish:()=>{var _;(_=g.current)===null||_===void 0||_.destroy()}}),g.current.play(),()=>{var _;(_=g.current)===null||_===void 0||_.destroy()}):void 0},[])}e.isAnimationUsed=o,e.useFadeIn=l})(El);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.triggerLoadError=e.onLoadError=e.whenLoaded=e.decrementLoader=e.incrementLoader=e.getFontLoadTimeout=e.setFontLoadTimeout=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0;const t=El;let r=0,n=[],i=3e4;const a=p=>{i=p};e.setAssetLoadTimeout=a;const o=()=>i;e.getAssetLoadTimeout=o;let l=6e3;const u=p=>{l=p};e.setFontLoadTimeout=u;const f=()=>l;function g(p){r+=1;let v=!1;const d=setTimeout(()=>{v||(y(`Timeout loading asset ${p}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",p),v=!0,S())},i);return()=>{v||(clearTimeout(d),S())}}function S(){r-=1,r===0&&(n.forEach(p=>p()),n=[])}function _(p){r===0?p():n.push(p)}function h(){return new Promise(p=>_(()=>{(0,t.isAnimationUsed)()?setTimeout(p,300):p(!0)}))}e.getFontLoadTimeout=f,e.incrementLoader=g,e.decrementLoader=S,e.whenLoaded=h;let w=[];function m(p){w.push(p)}function y(p){w.forEach(v=>v(p))}e.onLoadError=m,e.triggerLoadError=y})(Hi);var Ws={};(function(e){var t=ye&&ye.__createBinding||(Object.create?function(j,B,$,Z){Z===void 0&&(Z=$);var K=Object.getOwnPropertyDescriptor(B,$);K&&!("get"in K?!B.__esModule:K.writable||K.configurable)||(K={enumerable:!0,get:function(){return B[$]}}),Object.defineProperty(j,Z,K)}:function(j,B,$,Z){Z===void 0&&(Z=$),j[Z]=B[$]}),r=ye&&ye.__setModuleDefault||(Object.create?function(j,B){Object.defineProperty(j,"default",{enumerable:!0,value:B})}:function(j,B){j.default=B}),n=ye&&ye.__importStar||function(j){if(j&&j.__esModule)return j;var B={};if(j!=null)for(var $ in j)$!=="default"&&Object.prototype.hasOwnProperty.call(j,$)&&t(B,j,$);return r(B,j),B};Object.defineProperty(e,"__esModule",{value:!0}),e.injectCustomFont=e.injectGoogleFont=e.getGoogleFontsVariants=e.setGoogleFontsVariants=e.loadFont=e.isFontLoaded=e.replaceGlobalFonts=e.removeGlobalFont=e.addGlobalFont=e.globalFonts=e.getFontsList=e.setGoogleFonts=e.isGoogleFontChanged=void 0;const i=n(Wi),a=Hi;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(j){j!=="default"?(l.value=!0,o.splice(0,o.length),o.push(...j)):l.value=!1}function g(){return o}function S(j){e.globalFonts.push(j)}function _(j){const B=e.globalFonts.findIndex($=>$.fontFamily===j);B!==-1&&e.globalFonts.splice(B,1)}function h(j){e.globalFonts.replace(j)}e.isGoogleFontChanged=u,e.setGoogleFonts=f,e.getFontsList=g,e.globalFonts=i.observable([]),e.addGlobalFont=S,e.removeGlobalFont=_,e.replaceGlobalFonts=h;var w="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",m=document.createElement("canvas");function y(){return v("Arial")}function p(){return v("Times","Times")}function v(j,B="Arial"){var $=m.getContext("2d");return $.font=`normal 40px '${j}', ${B}`,$.measureText(w).width}const d={Arial:!0},b=j=>!!d[j];async function O(j){var B;if(d[j])return;const $=!!(!((B=document.fonts)===null||B===void 0)&&B.load),Z=y();if($)try{await document.fonts.load(`16px '${j}'`);const A=v(j);if(Z!==A)return void(d[j]=!0)}catch{}const K=p(),D=v(j),q=Math.min(6e3,(0,a.getFontLoadTimeout)())/60;for(let A=0;A<q;A++){const L=v(j,"Arial"),z=v(j,"Times");if(L!==D||L!==Z||z!==K)return void(d[j]=!0);await new Promise(I=>setTimeout(I,60))}console.warn(`Timeout for loading font "${j}". Looks like polotno can't load it. Is it a correct font family?`),(0,a.triggerLoadError)(`Timeout for loading font "${j}"`)}e.isFontLoaded=b,e.loadFont=O;const R={};let T="400,400italic,700,700italic";function E(j){T=j}function P(){return T}function x(j){if(R[j])return;const B=`https://fonts.googleapis.com/css?family=${j.replace(/ /g,"+")}:${T}`,$=document.createElement("link");$.type="text/css",$.href=B,$.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild($),R[j]=!0}e.setGoogleFontsVariants=E,e.getGoogleFontsVariants=P,e.injectGoogleFont=x;const k={};function M(j){const B=j.fontFamily;if(k[B]||!j.url&&!j.styles)return;const $=document.createElement("style");$.type="text/css";const Z=j.styles||(j.url?[{src:`url("${j.url}")`}]:[]);let K="";Z.forEach(D=>{K+=`
|
|
77
|
+
@font-face {
|
|
78
|
+
font-family: '${B}';
|
|
79
|
+
src: ${D.src};
|
|
80
|
+
font-style: ${D.fontStyle||"normal"};
|
|
81
|
+
font-weight: ${D.fontWeight||"normal"};
|
|
82
|
+
}
|
|
83
|
+
`}),$.innerHTML=K,document.getElementsByTagName("head")[0].appendChild($),k[j.fontFamily]=!0}e.injectCustomFont=M})(Ws);var Kn={};(function(e){var t=ye&&ye.__createBinding||(Object.create?function(a,o,l,u){u===void 0&&(u=l);var f=Object.getOwnPropertyDescriptor(o,l);f&&!("get"in f?!o.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return o[l]}}),Object.defineProperty(a,u,f)}:function(a,o,l,u){u===void 0&&(u=l),a[u]=o[l]}),r=ye&&ye.__setModuleDefault||(Object.create?function(a,o){Object.defineProperty(a,"default",{enumerable:!0,value:o})}:function(a,o){a.default=o}),n=ye&&ye.__importStar||function(a){if(a&&a.__esModule)return a;var o={};if(a!=null)for(var l in a)l!=="default"&&Object.prototype.hasOwnProperty.call(a,l)&&t(o,a,l);return r(o,a),o};Object.defineProperty(e,"__esModule",{value:!0}),e.setAnimationsEnabled=e.setTextOverflow=e.setForceTextFit=e.useDownScaling=e.setDownScalingEnabled=e.useHtmlTextRender=e.useRemoveBackground=e.setTextVerticalResizeEnabled=e.flags=void 0;const i=n(Wi);e.flags=i.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",animationsEnabled:!1}),e.setTextVerticalResizeEnabled=i.action(a=>{e.flags.textVerticalResizeEnabled=a}),e.useRemoveBackground=i.action(a=>{e.flags.removeBackgroundEnabled=a}),e.useHtmlTextRender=i.action(a=>{e.flags.htmlRenderEnabled=a}),e.setDownScalingEnabled=i.action(a=>{e.flags.imageDownScalingEnabled=a}),e.useDownScaling=i.action(a=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,e.setDownScalingEnabled)(a)}),e.setForceTextFit=i.action(a=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}),e.setTextOverflow=i.action(a=>{e.flags.textOverflow=a}),e.setAnimationsEnabled=i.action(a=>{e.flags.animationsEnabled=a})})(Kn);var e2={};(function(e){function t(r=""){return(r=r.replace(/<\/p>/gi,`
|
|
84
|
+
`)).replace(/(<([^>]+)>)/gi,"")}Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=void 0,e.removeTags=t})(e2);var Vc={};(function(e){var t=ye&&ye.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=void 0;const r=t(_i);function n(i,a){var o;const l={filters:[]};a.brightnessEnabled&&(l.filters.push(r.default.Filters.Brighten),l.brightness=a.brightness),a.blurEnabled&&(l.filters.push(r.default.Filters.Blur),l.blurRadius=a.blurRadius),a.sepiaEnabled&&l.filters.push(r.default.Filters.Sepia),a.grayscaleEnabled&&l.filters.push(r.default.Filters.Grayscale),i.setAttrs(l),l.filters.length?i.cache({pixelRatio:a.store._elementsPixelRatio}):i.clearCache(),(o=i.getLayer())===null||o===void 0||o.batchDraw()}e.applyFilter=n})(Vc);var Ol={};(function(e){var t=ye&&ye.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.Highlighter=e.setHighlighterStyle=void 0;const r=t(et),n=yi,i=Pa,a={stroke:"rgb(0, 161, 255)",strokeWidth:2},o=l=>{Object.assign(a,l)};e.setHighlighterStyle=o,e.Highlighter=(0,n.observer)(({element:l})=>r.default.createElement(i.Rect,Object.assign({name:"highlighter",x:l.a.x,y:l.a.y,rotation:l.a.rotation,width:l.a.width,height:l.a.height,listening:!1,strokeScaleEnabled:!1},a)))})(Ol);var Oo={};(function(e){var t=ye&&ye.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.isTouchDevice=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const r=t(et);e.MOBILE_BREAKPOINT=800;const n=()=>window.innerWidth<=e.MOBILE_BREAKPOINT;e.isMobile=n;const i=l=>`
|
|
85
|
+
@media (max-width: ${e.MOBILE_BREAKPOINT}px) {
|
|
86
|
+
${l}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.polotno-mobile & {
|
|
90
|
+
${l}
|
|
91
|
+
}
|
|
92
|
+
`;e.mobileStyle=i;const a=()=>"ontouchstart"in window||navigator.maxTouchPoints>0;e.isTouchDevice=a;const o=()=>{const[l,u]=r.default.useState((0,e.isMobile)());return r.default.useEffect(()=>{const f=()=>{u((0,e.isMobile)())};return window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[]),l};e.useMobile=o})(Oo);var E4={},i7="warn";function a7(e){i7=e}function o7(){return i7}function oN(e){a7(e)}var cr;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(cr||(cr={}));var mm=function(e,t){return mm=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])},mm(e,t)};function Dt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mm(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var dr=function(){return dr=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},dr.apply(this,arguments)};function lN(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function l7(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(f){return function(g){return u([f,g])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,f[0]&&(r=0)),r;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){r.label=f[1];break}if(f[0]===6&&r.label<a[1]){r.label=a[1],a=f;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(f);break}a[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(g){f=[6,g],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Wu(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Vi(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function qi(e,t,r){if(arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function qc(e){return qe(e).type}function sN(e,t){return qe(e).getChildType(t)}function s7(e,t){return qe(e).onPatch(t)}function uN(e,t){return qe(e).onSnapshot(t)}function As(e,t){qe(e).applyPatches(s2(t))}function cN(e,t){var r={patches:[],inversePatches:[]},n={},i,a={get recording(){return!!i},get patches(){return n.patches||(n.patches=r.patches.slice()),n.patches},get reversedInversePatches(){return n.reversedInversePatches||(n.reversedInversePatches=r.inversePatches.slice().reverse()),n.reversedInversePatches},get inversePatches(){return n.inversePatches||(n.inversePatches=r.inversePatches.slice()),n.inversePatches},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=s7(e,function(o,l){t&&!t(o,l,i2())||(r.patches.push(o),r.inversePatches.push(l),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){As(o||e,r.patches)},undo:function(o){As(o||e,r.inversePatches.slice().reverse())}};return a.resume(),a}function fN(e){var t=qe(e);if(!t.isRoot)throw new je("`protect` can only be invoked on root nodes");t.isProtectionEnabled=!0}function dN(e){var t=qe(e);if(!t.isRoot)throw new je("`unprotect` can only be invoked on root nodes");t.isProtectionEnabled=!1}function hN(e){return qe(e).isProtected}function u7(e,t){return qe(e).applySnapshot(t)}function t2(e,t){t===void 0&&(t=!0);var r=qe(e);return t?r.snapshot:r.type.getSnapshot(r,!1)}function pN(e,t){t===void 0&&(t=1);for(var r=qe(e).parent;r;){if(--t===0)return!0;r=r.parent}return!1}function gN(e,t){t===void 0&&(t=1);for(var r=t,n=qe(e).parent;n;){if(--r===0)return n.storedValue;n=n.parent}throw new je("Failed to find the parent of ".concat(qe(e)," at depth ").concat(t))}function vN(e,t){for(var r=qe(e).parent;r;){if(t.is(r.storedValue))return!0;r=r.parent}return!1}function mN(e,t){for(var r=qe(e).parent;r;){if(t.is(r.storedValue))return r.storedValue;r=r.parent}throw new je("Failed to find the parent of ".concat(qe(e)," of a given type"))}function c7(e){return qe(e).root.storedValue}function f7(e){return qe(e).path}function yN(e){return Is(qe(e).path)}function bN(e){return qe(e).isRoot}function _N(e,t){var r=k7(qe(e),t);return r?r.value:void 0}function wN(e,t,r){var n=qe(t).root.identifierCache.resolve(e,Ks(r));return n==null?void 0:n.value}function d7(e){return qe(e).identifier}function SN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return;if(xt(r))return t?r2(r)?r:void 0:r;throw new je("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof u2)return;throw n}}function EN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return!1;if(xt(r))return t?r2(r):!0;throw new je("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof u2)return!1;throw n}}function h7(e,t){var r=k7(qe(e),t,!1);if(r!==void 0)try{return r.value}catch{return}}function ON(e,t){return T7(qe(e),qe(t))}function PN(e,t){t===void 0&&(t=!0);var r=qe(e);return r.type.create(r.snapshot,t===!0?r.root.environment:t===!1?void 0:t)}function xN(e){return qe(e).detach(),e}function CN(e){var t=qe(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function r2(e){return qe(e).observableIsAlive}function TN(e,t){var r=qe(e);return r.addDisposer(t),t}function kN(e){var t=qe(e),r=t.root.environment;if(!r)throw new je("Failed to find the environment of ".concat(t," ").concat(t.path));return r}function AN(e){var t=qe(e),r=t.root.environment;return!!r}function p7(e,t){var r=qe(e);r.getChildren().forEach(function(n){xt(n.storedValue)&&p7(n.storedValue,t)}),t(r.storedValue)}function g7(e){var t;return xt(e)?t=qc(e):t=e,{name:t.name,properties:dr({},t.properties)}}function RN(e){var t=qe(e).type,r=dr(dr({},g7(t)),{actions:[],volatile:[],views:[],flowActions:[]}),n=Object.getOwnPropertyNames(e);return n.forEach(function(i){if(!(i in r.properties)){var a=Object.getOwnPropertyDescriptor(e,i);if(a.get){I8(e,i)?r.views.push(i):r.volatile.push(i);return}a.value._isFlowAction===!0&&r.flowActions.push(i),a.value._isMSTAction===!0?r.actions.push(i):j8(e,i)?r.volatile.push(i):r.views.push(i)}}),r}function MN(e){return e}function LN(e){return e}function NN(e){return e}function IN(e){return qe(e).nodeId}var v7=function(){function e(t,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:Ar.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(t){var r=this.isAlive;this._state=t;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._hookSubscribers&&this._hookSubscribers.emit(t,this,t)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._hookSubscribers||(this._hookSubscribers=new N7),this._hookSubscribers.register(t,r)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this._parent=t,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.pathAtom||(this.pathAtom=dc("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?ao(this._subpath):""),this.parent.getEscapedPath(t)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==Ar.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Ar.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=dc("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===Ar.CREATED){if(this.parent){if(this.parent.state!==Ar.FINALIZED)return;this.fireHook(cr.afterAttach)}this.state=Ar.FINALIZED,t&&t()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=Ar.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(cr.beforeDestroy)}}),e}(),yc=function(e){Dt(t,e);function t(r,n,i,a,o){var l=e.call(this,r,n,i,a)||this;try{l.storedValue=r.createNewInstance(o)}catch(u){throw l.state=Ar.DEAD,u}return l.state=Ar.CREATED,l.finalizeCreation(),l}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw new je("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,a=this.subpath!==n;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Ar.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),t}(v7);yc.prototype.die=ar(yc.prototype.die);var DN=1,ai;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(ai||(ai={}));var En;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(En||(En={}));var jN={onError:function(e){throw e}},vn=function(e){Dt(t,e);function t(r,n,i,a,o){var l=e.call(this,r,n,i,a)||this;if(Object.defineProperty(l,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++DN}),Object.defineProperty(l,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:ai.UNINITIALIZED}),Object.defineProperty(l,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),l._snapshotComputed=cl(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=o,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new nI),l._childNodes=r.initializeChildNodes(l,l._initialSnapshot),l.identifier=null,l.unnormalizedIdentifier=null,l.identifierAttribute&&l._initialSnapshot){var u=l._initialSnapshot[l.identifierAttribute];if(u===void 0){var f=l._childNodes[l.identifierAttribute];f&&(u=f.value)}if(typeof u!="string"&&typeof u!="number")throw new je("Instance identifier '".concat(l.identifierAttribute,"' for type '").concat(l.type.name,"' must be a string or a number"));l.identifier=Ks(u),l.unnormalizedIdentifier=u}return n?n.root.identifierCache.addNodeToCache(l):l.identifierCache.addNodeToCache(l),l}return Object.defineProperty(t.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(t.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===ai.UNINITIALIZED&&this.createObservableInstance(r)}}),Object.defineProperty(t.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n,i,a,o;r===void 0&&(r=!0),this._observableInstanceState=ai.CREATING;for(var l=[],u=this.parent;u&&u._observableInstanceState===ai.UNINITIALIZED;)l.unshift(u),u=u.parent;try{for(var f=Wu(l),g=f.next();!g.done;g=f.next()){var S=g.value;S.createObservableInstanceIfNeeded(!1)}}catch(m){n={error:m}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}var _=this.type;try{this.storedValue=_.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,_.finalizeNewInstance(this,this.storedValue)}catch(m){throw this.state=Ar.DEAD,m}finally{this._isRunningAction=!1}if(this._observableInstanceState=ai.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Ls,this.state=Ar.CREATED,r){this.fireHook(cr.afterCreate),this.finalizeCreation();try{for(var h=Wu(l.reverse()),w=h.next();!w.done;w=h.next()){var S=w.value;S.fireHook(cr.afterCreate),S.finalizeCreation()}}catch(m){a={error:m}}finally{try{w&&!w.done&&(o=h.return)&&o.call(h)}finally{if(a)throw a.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(cr.beforeDetach);var r=this.state;this.state=Ar.DETACHING;var n=this.root,i=n.environment,a=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=r}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,a=n!==this.subpath;!i&&!a||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(cr.afterAttach)):a&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(Os?Os(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===ai.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var r=this.type,n=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=r.processInitialSnapshot(n,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=o7();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw new je(i);case"warn":vI(i)}}}}),Object.defineProperty(t.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&ao(r.subpath)||"",a=r.actionContext||n2();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var l=a&&a.context&&f7(a.context)||n;o="".concat(l,".").concat(a.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(n,"', Subpath: '").concat(i,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===ai.CREATED?this.type.getChildNode(this,r):this._childNodes[r]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(Ls),this._autoUnbox=!1;try{return this._observableInstanceState===ai.CREATED?this.type.getChildren(this):R7(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw new je("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(t.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.assertAlive({subpath:r.subpath||r.subpathUponDeath}),this._autoUnbox?r.value:r)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(r).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var a=Wu(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(cr.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new je("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=bc(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=Is(i.path),o=A7(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=bc(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),Yo(this.storedValue,"$treenode",this),Yo(this.storedValue,"toJSON",aI)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Ar.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==ai.UNINITIALIZED&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(En.Dispose),this._internalEventsClear(En.Dispose))}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var r=this.snapshot;this._snapshotUponDeath=r,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister(En.Snapshot,r)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit(En.Snapshot,r)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister(En.Patch,r)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers(En.Patch)){var i=n.path.substr(this.path.length)+(r.path?"/"+r.path:""),a=hI({},r,{path:i}),o=Vi(SI(a),2),l=o[0],u=o[1];this._internalEventsEmit(En.Patch,l,u)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas(En.Dispose,r)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister(En.Dispose,r,!0);return}throw new je("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas(En.Dispose,r))throw new je("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(En.Dispose,r)}}),Object.defineProperty(t.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.middlewares){var n=this.middlewares.indexOf(r);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(t.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={handler:r,includeHooks:n};return this.middlewares?this.middlewares.push(a):this.middlewares=[a],function(){i.removeMiddleware(a)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this.assertWritable({subpath:r}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,r,n)}}),Object.defineProperty(t.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=C8(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},jN);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(t.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new N7),this._internalEvents.register(r,n,i)}}),Object.defineProperty(t.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var n,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];this._internalEvents&&(n=this._internalEvents).emit.apply(n,qi([r],Vi(i),!1))}}),Object.defineProperty(t.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(t.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t}(v7);vn.prototype.createObservableInstance=ar(vn.prototype.createObservableInstance);vn.prototype.detach=ar(vn.prototype.detach);vn.prototype.die=ar(vn.prototype.die);var m7,at;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(at||(at={}));var y7="cannotDetermine",FN=Symbol("$type"),ba=function(){function e(t){Object.defineProperty(this,m7,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return ha(this,t),this.instantiate(null,"",r,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){throw new je("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=C7(t);if(n){var i=qc(t);return this.isAssignableFrom(i)?mn():yn(r,t)}return this.isValidSnapshot(t,r)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.validate(t,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new je("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new je("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new je("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new je("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();m7=FN;ba.prototype.create=ar(ba.prototype.create);var Rs=function(e){Dt(t,e);function t(r){var n=e.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),e.prototype.create.call(this,r,n)}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===Ks(n[r.identifierAttribute])}}),Object.defineProperty(t.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||xt(n)&&qe(n)===r?!0:r.type===this&&M7(n)&&!xt(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.tryToReconcileNode(r,n);if(o)return r.setParent(i,a),r;if(r.die(),xt(n)&&this.isAssignableFrom(qc(n))){var l=qe(n);return l.setParent(i,a),l}return this.instantiate(i,a,void 0,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(ba);Rs.prototype.create=ar(Rs.prototype.create);var Pl=function(e){Dt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this&&r.storedValue===n)return r;var o=this.instantiate(i,a,void 0,n);return r.die(),o}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(ba);function Vr(e){return typeof e=="object"&&e&&e.isType===!0}var Mi=new Map;function zN(e){return function(r,n,i){switch(r.type){case"action":if(!e.filter||e.filter(r)===!0){var a=e.onStart(r);e.onResume(r,a),Mi.set(r.id,{call:r,context:a,async:!1});try{var o=n(r);return e.onSuspend(r,a),Mi.get(r.id).async===!1&&(Mi.delete(r.id),e.onSuccess(r,a,o)),o}catch(u){throw Mi.delete(r.id),e.onFail(r,a,u),u}}else return n(r);case"flow_spawn":{var l=Mi.get(r.rootId);return l.async=!0,n(r)}case"flow_resume":case"flow_resume_error":{var l=Mi.get(r.rootId);e.onResume(r,l.context);try{return n(r)}finally{e.onSuspend(r,l.context)}}case"flow_throw":{var l=Mi.get(r.rootId);return Mi.delete(r.rootId),e.onFail(r,l.context,r.args[0]),n(r)}case"flow_return":{var l=Mi.get(r.rootId);return Mi.delete(r.rootId),e.onSuccess(r,l.context,r.args[0]),n(r)}}}}var BN=function(){function e(t,r){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),t&&t.onStart(r)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,t))}}),Object.defineProperty(e.prototype,"incFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(e.prototype,"decFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(e.prototype,"hasFlowsPending",{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),e}();function UN(e){var t=new Map;return function(n,i){var a=n.parentActionEvent?t.get(n.parentActionEvent.id):void 0;if(n.type==="action"){var o=dr(dr({},n),{env:a&&a.call.env,parentCall:a&&a.call}),l=!e.filter||e.filter(o),u=l?e:void 0,f=new BN(u,o);t.set(n.id,f);var g=void 0;try{g=i(n)}catch(_){throw t.delete(n.id),f.finish(_),_}return f.hasFlowsPending||(t.delete(n.id),f.finish()),g}else{if(!a)return i(n);switch(n.type){case"flow_spawn":return a.incFlowsPending(),i(n);case"flow_resume":case"flow_resume_error":return i(n);case"flow_throw":{var S=n.args[0];try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish(S))}}case"flow_return":try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish())}}}}}function HN(e,t,r,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(Ns(n))return n;if(xt(n))return vd("[MSTNode: ".concat(qc(n).name,"]"));if(typeof n=="function")return vd("[function]");if(typeof n=="object"&&!qo(n)&&!l2(n))return vd("[object ".concat(n&&n.constructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(i){return vd(""+i)}}function $N(e,t){return t&&typeof t=="object"&&"$MST_DATE"in t?new Date(t.$MST_DATE):t}function vd(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function b7(e,t){Os(function(){s2(t).forEach(function(r){return GN(e,r)})})}function GN(e,t){var r=h7(e,t.path||"");if(!r)throw new je("Invalid action path: ".concat(t.path||""));var n=qe(r);if(t.name==="@APPLY_PATCHES")return As.call(null,r,t.args[0]);if(t.name==="@APPLY_SNAPSHOT")return u7.call(null,r,t.args[0]);if(typeof r[t.name]!="function")throw new je("Action '".concat(t.name,"' does not exist in '").concat(n.path,"'"));return r[t.name].apply(r,t.args?t.args.map(function(i){return $N(n,i)}):[])}function VN(e,t){var r=[],n=function(o){var l=t?t(o,i2()):!0;l&&r.push(o)},i,a={actions:r,get recording(){return!!i},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=_7(e,n))},replay:function(o){b7(o,r)}};return a.resume(),a}function _7(e,t,r){return r===void 0&&(r=!1),E7(e,function(i,a){if(i.type==="action"&&i.id===i.rootId){var o=qe(i.context),l={name:i.name,path:T7(qe(e),o),args:i.args.map(function(f,g){return HN(o,i.name,g,f)})};if(r){var u=a(i);return t(l),u}else return t(l),a(i)}else return a(i)})}var qN=1,Ku;function n2(){return Ku}function w7(){return qN++}function ym(e,t){var r=qe(e.context);e.type==="action"&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=Ku;Ku=e;try{return YN(r,e,t)}finally{Ku=i,r._isRunningAction=n}}function S7(e){if(e)return e.type==="action"?e:e.parentActionEvent}function bc(e,t,r){var n=function(){var i=w7(),a=Ku,o=S7(a);return ym({type:"action",name:t,id:i,args:I7(arguments),context:e,tree:c7(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?qi(qi([],Vi(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}function E7(e,t,r){r===void 0&&(r=!0);var n=qe(e);return n.addMiddleWare(t,r)}function WN(e,t,r){r===void 0&&(r=!0);var n={handler:e,includeHooks:r};return t.$mst_middleware=t.$mst_middleware||[],t.$mst_middleware.push(n),t}var KN=function(){function e(t,r){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),r.$mst_middleware&&this.middlewares.push(r.$mst_middleware);for(var n=t;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.middlewares[this.arrayIndex];if(t){var r=t[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function YN(e,t,r){var n=new KN(e,r);if(n.isEmpty)return ar(r).apply(null,t.args);var i=null;function a(o){var l=n.getNextMiddleware(),u=l&&l.handler;if(!u)return ar(r).apply(null,o.args);if(!l.includeHooks&&cr[o.name])return a(o);function f(S,_){i=a(S),_&&(i=_(i))}function g(S){i=S}return u(o,f,g),i}return a(t)}function i2(){for(var e=n2();e&&e.type!=="action";)e=e.parentActionEvent;return e}function O7(e,t,r){for(var n=typeof t=="number"?t:t.id,i=r?e:e.parentActionEvent;i;){if(i.id===n)return!0;i=i.parentActionEvent}return!1}function XN(e,t){return O7(e,t,!1)}function ZN(e,t){return O7(e,t,!0)}function QN(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: ".concat(t,">")}}function P7(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):xt(e)?"<".concat(e,">"):"`".concat(QN(e),"`")}function JN(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function eI(e){var t=e.value,r=e.context[e.context.length-1].type,n=e.context.map(function(l){var u=l.path;return u}).filter(function(l){return l.length>0}).join("/"),i=n.length>0?'at path "/'.concat(n,'" '):"",a=xt(t)?"value of type ".concat(qe(t).type.name,":"):Ns(t)?"value":"snapshot",o=r&&xt(t)&&r.is(qe(t).snapshot);return"".concat(i).concat(a," ").concat(P7(t)," is not assignable ").concat(r?"to type: `".concat(r.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(r?K7(r)||Ns(t)?".":", expected an instance of `".concat(r.name,"` or a snapshot like `").concat(r.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function a2(e,t,r){return e.concat([{path:t,type:r}])}function mn(){return Ms}function yn(e,t,r){return[{context:e,value:t,message:r}]}function Vp(e){return e.reduce(function(t,r){return t.concat(r)},[])}function ha(e,t){mI()&&x7(e,t)}function x7(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw new je(tI(e,t,r))}function tI(e,t,r){if(r.length!==0)return"Error while converting ".concat(JN(P7(t))," to `").concat(e.name,`\`:
|
|
93
|
+
|
|
94
|
+
`)+r.map(eI).join(`
|
|
95
|
+
`)}var rI=0,nI=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:rI++}),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(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t);this.lastCacheModificationPerId.set(t,r===void 0?1:r+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t)||0;return"".concat(this.cacheId,"-").concat(r)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(r===void 0&&(r=!0),t.identifierAttribute){var n=t.identifier;this.cache.has(n)||this.cache.set(n,kt.array([],qp));var i=this.cache.get(n);if(i.indexOf(t)!==-1)throw new je("Already registered");i.push(t),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;Oy(t.identifierCache.cache).forEach(function(n){return n.forEach(function(i){r.addNodeToCache(i)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.identifierAttribute){var r=t.identifier,n=this.cache.get(r);n&&(n.remove(t),n.length||this.cache.delete(r),this.updateLastCacheModificationPerId(t.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,n=new e,i=t.path+"/";return F8(this.cache).forEach(function(a){for(var o=Vi(a,2),l=o[0],u=o[1],f=!1,g=u.length-1;g>=0;g--){var S=u[g];(S===t||S.path.indexOf(i)===0)&&(n.addNodeToCache(S,!1),u.splice(g,1),u.length||r.cache.delete(l),f=!0)}f&&r.updateLastCacheModificationPerId(l)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);return n?n.some(function(i){return t.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(a){return t.isAssignableFrom(a.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw new je("Cannot resolve a reference to type '".concat(t.name,"' with id: '").concat(r,"' unambigously, there are multiple candidates: ").concat(i.map(function(a){return a.path}).join(", ")))}}}),e}();function o2(e,t,r,n,i){var a=C7(i);if(a){if(a.parent)throw new je("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(t?t.path:"","/").concat(r,"', but it lives already at '").concat(a.path,"'"));return t&&a.setParent(t,r),a}return new vn(e,t,r,n,i)}function Po(e,t,r,n,i){return new yc(e,t,r,n,i)}function iI(e){return e instanceof yc||e instanceof vn}var Ar;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(Ar||(Ar={}));function xt(e){return!!(e&&e.$treenode)}function qe(e){if(!xt(e))throw new je("Value ".concat(e," is no MST Node"));return e.$treenode}function C7(e){return e&&e.$treenode||null}function aI(){return qe(this).snapshot}var oI=function(e){return".."};function T7(e,t){if(e.root!==t.root)throw new je("Cannot calculate relative path: objects '".concat(e,"' and '").concat(t,"' are not part of the same object tree"));for(var r=Is(e.path),n=Is(t.path),i=0;i<r.length&&r[i]===n[i];i++);return r.slice(i).map(oI).join("/")+_h(n.slice(i))}function k7(e,t,r){return r===void 0&&(r=!0),A7(e,Is(t),r)}function A7(e,t,r){r===void 0&&(r=!0);var n=e;try{for(var i=0;i<t.length;i++){var a=t[i];if(a===".."){if(n=n.parent,n)continue}else{if(a===".")continue;if(n){if(n instanceof yc){var o=n.value;xt(o)&&(n=qe(o))}if(n instanceof vn){var l=n.getChildType(a);if(l&&(n=n.getChildNode(a),n))continue}}}throw new je("Could not resolve '".concat(a,"' in path '").concat(_h(t.slice(0,i))||"/","' while resolving '").concat(_h(t),"'"))}}catch(u){if(!r)return;throw u}return n}function R7(e){if(!e)return Ms;var t=Object.keys(e);if(!t.length)return Ms;var r=new Array(t.length);return t.forEach(function(n,i){r[i]=e[n]}),r}function lI(e){return D7(),j7(e)}var sI=Object.toString(),Ms=Object.freeze([]),Ls=Object.freeze({}),qp=g8().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(qp);var je=function(e){Dt(t,e);function t(r){return r===void 0&&(r="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(r))||this}return t}(Error);function uI(e){return e}var cI=Number.isInteger;function fI(e){return Number(e)===e&&e%1!==0}function dI(e){return Number.isFinite(e)}function l2(e){return Array.isArray(e)||Jr(e)}function s2(e){return e?l2(e)?e:[e]:Ms}function hI(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n];for(var a in i)e[a]=i[a]}return e}function qo(e){var t;if(e===null||typeof e!="object")return!1;var r=Object.getPrototypeOf(e);return r==null?!0:((t=r.constructor)===null||t===void 0?void 0:t.toString())===sI}function M7(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function Ns(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function L7(e){return typeof e!="function"}function pI(e,t,r){Or(e)?xy(e,t,r):Object.defineProperty(e,t,r)}function Yo(e,t,r){pI(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}var gI=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this;return r===void 0&&(r=!1),r?this.handlers.unshift(t):this.handlers.push(t),function(){n.unregister(t)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.handlers.indexOf(t)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.handlers.indexOf(t);r>=0&&this.handlers.splice(r,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this.handlers.slice();n.forEach(function(i){return i.apply(void 0,qi([],Vi(t),!1))})}}),e}(),N7=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.eventHandlers&&this.eventHandlers[t];return!!r&&r.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[t];return i||(i=this.eventHandlers[t]=new gI),i.register(r,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];return!!n&&n.has(r)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];n&&n.unregister(r)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.eventHandlers&&delete this.eventHandlers[t]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this.eventHandlers&&this.eventHandlers[t];a&&(r=a).emit.apply(r,qi([],Vi(n),!1))}}),e}();function I7(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}function tg(e,t){return e.indexOf(t)===0}var D7=function(e,t){};D7.ids={};function vI(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function mI(){return typeof process<"u"&&E4&&E4.ENABLE_TYPE_CHECK==="true"}function rg(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function j7(e){return wI(e.name,e)}function yI(e){return e}function bI(e){return function(){var t,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];return l7(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,qi([],Vi(r),!1))];case 1:return[2,n.sent()]}})}}function _I(e){return l7(this,function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent()]}})}function wI(e,t){var r=function(){var i=w7(),a=n2();if(!a)throw new je("a mst flow must always have a parent context");var o=S7(a);if(!o)throw new je("a mst flow must always have a parent action context");var l={name:e,id:i,tree:a.tree,context:a.context,parentId:a.id,allParentIds:qi(qi([],Vi(a.allParentIds),!1),[a.id],!1),rootId:a.rootId,parentEvent:a,parentActionEvent:o},u=arguments;function f(g,S,_){return g.$mst_middleware=r.$mst_middleware,ym(dr(dr({},l),{type:S,args:[_]}),g)}return new Promise(function(g,S){var _,h=function(){_=t.apply(null,arguments),w(void 0)};h.$mst_middleware=r.$mst_middleware,ym(dr(dr({},l),{type:"flow_spawn",args:I7(u)}),h);function w(p){var v;try{var d=f(function(b){v=_.next(b)},"flow_resume",p);d instanceof Error&&(v=_.throw(d))}catch(b){rg(function(){f(function(O){S(b)},"flow_throw",b)});return}y(v)}function m(p){var v;try{f(function(d){v=_.throw(d)},"flow_resume_error",p)}catch(d){rg(function(){f(function(b){S(d)},"flow_throw",d)});return}y(v)}function y(p){if(p.done){rg(function(){f(function(v){g(v)},"flow_return",p.value)});return}if(!p.value||typeof p.value.then!="function")throw new je("Only promises can be yielded to `async`, got: "+p);return p.value.then(w,m)}})};return r._isFlowAction=!0,r}function SI(e){if(!("oldValue"in e))throw new je("Patches without `oldValue` field cannot be inversed");return[EI(e),OI(e)]}function EI(e){switch(e.op){case"add":return{op:"add",path:e.path,value:e.value};case"remove":return{op:"remove",path:e.path};case"replace":return{op:"replace",path:e.path,value:e.value}}}function OI(e){switch(e.op){case"add":return{op:"remove",path:e.path};case"remove":return{op:"add",path:e.path,value:e.oldValue};case"replace":return{op:"replace",path:e.path,value:e.oldValue}}}function PI(e){return typeof e=="number"}function ao(e){return PI(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function F7(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function _h(e){if(e.length===0)return"";var t=function(r){return r.map(ao).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function Is(e){var t=e.split("/").map(F7),r=e===""||e==="."||e===".."||tg(e,"/")||tg(e,"./")||tg(e,"../");if(!r)throw new je("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return t[0]===""&&t.shift(),t}var ng=Symbol("$preProcessorFailed"),xI=function(e){Dt(t,e);function t(r,n,i){var a=e.call(this,i||r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|at.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(t.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.preProcessor?this._processors.preProcessor.call(null,r):r}}),Object.defineProperty(t.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(r){try{return this.preProcessSnapshot(r)}catch{return ng}}}),Object.defineProperty(t.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,r,n.storedValue):r}}),Object.defineProperty(t.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;CI(r.type,this,"create"),r instanceof vn&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},X7(this._subtype)||(r.getReconciliationType=function(){return n})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=xt(a)?a:this.preProcessSnapshot(a),l=this._subtype.instantiate(r,n,i,o);return this._fixNode(l),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this._subtype.reconcile(r,xt(n)?n:this.preProcessSnapshot(n),i,a);return o!==r&&this._fixNode(o),o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=!0);var i=this._subtype.getSnapshot(r);return n?this.postProcessSnapshot(i,r):i}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.preProcessSnapshotSafe(r);return i===ng?yn(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Vr(r)?this._subtype:xt(r)?t2(r,!1):this.preProcessSnapshotSafe(r);return n===ng?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!(this._subtype instanceof Rs))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(ba);function CI(e,t){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=Wu(i),l=o.next();!l.done;l=o.next()){var u=l.value;e[u]=t[u].bind(t)}}catch(f){r={error:f}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}function TI(e,t,r){return new xI(e,t,r)}var O4="Map.put can only be used to store complex values that have an identifier type attribute";function z7(e,t){var r,n,i=e.getSubTypes();if(i===y7)return!1;if(i){var a=s2(i);try{for(var o=Wu(a),l=o.next();!l.done;l=o.next()){var u=l.value;if(!z7(u,t))return!1}}catch(f){r={error:f}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}return e instanceof _c&&t.push(e),!0}var qa;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(qa||(qa={}));var kI=function(e){Dt(t,e);function t(r,n){return e.call(this,r,kt.ref.enhancer,n)||this}return Object.defineProperty(t.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.get.call(this,""+r)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.has.call(this,""+r)}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.delete.call(this,""+r)}}),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return e.prototype.set.call(this,""+r,n)}}),Object.defineProperty(t.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!r)throw new je("Map.put cannot be used to set empty values");if(xt(r)){var n=qe(r);if(n.identifier===null)throw new je(O4);return this.set(n.identifier,r),r}else if(M7(r)){var i=qe(this),a=i.type;if(a.identifierMode!==qa.YES)throw new je(O4);var o=a.mapIdentifierAttribute,l=r[o];if(!c2(l)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(t2(u))}var f=Ks(l);return this.set(f,r),this.get(f)}else throw new je("Map.put can only be used to store complex values")}}),t}(Xh),wh=function(e){Dt(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:qa.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:at.Map}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a._determineIdentifierMode(),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._determineIdentifierMode(),o2(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===qa.UNKNOWN){var r=[];if(z7(this._subType,r)){var n=r.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw new je("The objects in a map should all have the same identifier attribute, expected '".concat(i,"', but child of type '").concat(a.name,"' declared attribute '").concat(a.identifierAttribute,"' as identifier"));return a.identifierAttribute},void 0);n?(this.identifierMode=qa.YES,this.mapIdentifierAttribute=n):this.identifierMode=qa.NO}}}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type._subType,a={};return Object.keys(n).forEach(function(o){a[o]=i.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new kI(r,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Ey(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=bc(n,l,u);Yo(n,l,f)})}),Wh(n,this.willChange),Yh(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return Oy(r.storedValue)}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r.storedValue.get(""+n);if(!i)throw new je("Not a child "+n);return i}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=qe(r.object),i=r.name;n.assertWritable({subpath:i});var a=n.type,o=a._subType;switch(r.type){case"update":{var l=r.newValue,u=r.object.get(i);if(l===u)return null;ha(o,l),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":ha(o,r.newValue),r.newValue=o.instantiate(n,i,void 0,r.newValue),a.processIdentifier(i,r.newValue);break}return r}}),Object.defineProperty(t.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.identifierMode===qa.YES&&n instanceof vn){var i=n.identifier;if(i!==r)throw new je("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(i,"', but expected: '").concat(r,"'"))}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return r.getChildren().forEach(function(i){n[i.subpath]=i.snapshot}),n}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=qe(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:ao(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:ao(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:ao(r.name),oldValue:i},n)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue;switch(i.op){case"add":case"replace":a.set(n,i.value);break;case"remove":a.delete(n);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ha(this,n);var i=r.storedValue,a={};if(Array.from(i.keys()).forEach(function(l){a[l]=!1}),n)for(var o in n)i.set(o,n[o]),a[""+o]=!0;Object.keys(a).forEach(function(l){a[l]===!1&&i.delete(l)})}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return qo(r)?Vp(Object.keys(r).map(function(a){return i._subType.validate(r[a],a2(n,a,i._subType))})):yn(n,r,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ls}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(Rs);wh.prototype.applySnapshot=ar(wh.prototype.applySnapshot);function AI(e){return new wh("Map<string, ".concat(e.name,">"),e)}function RI(e){return Vr(e)&&(e.flags&at.Map)>0}var Sh=function(e){Dt(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:at.Array}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return o2(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=[]);var i=r.type._subType,a={};return n.forEach(function(o,l){var u=""+l;a[u]=i.instantiate(r,u,void 0,o)}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=dr(dr({},qp),{name:this.name});return kt.array(R7(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){vi(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=bc(n,l,u);Yo(n,l,f)})}),Wh(n,this.willChange),Yh(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue.slice()}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=Number(n);if(i<r.storedValue.length)return r.storedValue[i];throw new je("Not a child: "+n)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=qe(r.object);n.assertWritable({subpath:""+r.index});var i=n.type._subType,a=n.getChildren();switch(r.type){case"update":{if(r.newValue===r.object[r.index])return null;var o=P4(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,g=P4(n,i,a.slice(l,l+u),f,f.map(function(_,h){return l+h}));if(!g)return null;r.added=g;for(var S=l+u;S<a.length;S++)a[S].setParent(n,""+(S+f.length-u))}break}return r}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=[];return Object.keys(r).forEach(function(i){n.push(r[i].getSnapshot())}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=qe(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:""+r.index,value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"splice":if(r.removedCount&&r.addedCount===r.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:r.removed.map(function(a){return a.snapshot})},n);for(var i=r.removedCount-1;i>=0;i--)n.emitPatch({op:"remove",path:""+(r.index+i),oldValue:r.removed[i].snapshot},n);for(var i=0;i<r.addedCount;i++)n.emitPatch({op:"add",path:""+(r.index+i),value:r.added[i].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue,o=n==="-"?a.length:Number(n);switch(i.op){case"replace":a[o]=i.value;break;case"add":a.splice(o,0,i.value);break;case"remove":a.splice(o,1);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ha(this,n);var i=r.storedValue;i.replace(n)}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return l2(r)?Vp(r.map(function(a,o){return i._subType.validate(a,a2(n,""+o,i._subType))})):yn(n,r,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ms}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(Rs);Sh.prototype.applySnapshot=ar(Sh.prototype.applySnapshot);function MI(e){return new Sh("".concat(e.name,"[]"),e)}function P4(e,t,r,n,i){for(var a=!0,o=0;;o++){var l=o<=n.length-1,u=r[o],f=l?n[o]:void 0,g=""+i[o];if(iI(f)&&(f=f.storedValue),!u&&!l)break;if(!l)a=!1,r.splice(o,1),u instanceof vn&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(x4(u,f))r[o]=ig(t,e,g,f,u);else{for(var _=void 0,h=o;h<r.length;h++)if(x4(r[h],f)){_=r.splice(h,1)[0];break}a=!1;var S=ig(t,e,g,f,_);r.splice(o,0,S)}else{if(xt(f)&&qe(f).parent===e)throw new je("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(g,"', but it lives already at '").concat(qe(f).path,"'"));a=!1;var S=ig(t,e,g,f);r.splice(o,0,S)}}return a?null:r}function ig(e,t,r,n,i){ha(e,n);function a(){if(xt(n)){var l=qe(n);if(l.assertAlive(Ls),l.parent!==null&&l.parent===t)return l.setParent(t,r),l}return i?e.reconcile(i,n,t,r):e.instantiate(t,r,void 0,n)}var o=a();return i&&i!==o&&(i instanceof vn&&i.createObservableInstanceIfNeeded(),i.die()),o}function x4(e,t){if(!e.isAlive)return!1;if(xt(t)){var r=qe(t);return r.isAlive&&r===e}if(e.snapshot===t)return!0;if(!(e instanceof vn))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&qo(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}function LI(e){return Vr(e)&&(e.flags&at.Array)>0}var C4="preProcessSnapshot",T4="postProcessSnapshot";function NI(){return qe(this).toString()}var k4={name:"AnonymousModel",properties:{},initializers:Ms};function II(e){var t=Object.keys(e),r=new Set;return t.forEach(function(n){if(r.has(n))throw new je("".concat(n," is declared twice in the model. Model should not contain the same keys"));r.add(n)}),t.reduce(function(n,i){if(i in cr)throw new je("Hook '".concat(i,"' was defined as property. Hooks should be defined as part of the actions"));var a=Object.getOwnPropertyDescriptor(e,i);if("get"in a)throw new je("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw new je("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(Ns(o))n[i]=Xo(UI(o),o);else if(o instanceof wh)n[i]=Xo(o,{});else if(o instanceof Sh)n[i]=Xo(o,[]);else if(!Vr(o))throw new je("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return n},dr({},e))}var _c=function(e){Dt(t,e);function t(r){var n=e.call(this,r.name||k4.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:at.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,k4,r),n.properties=II(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(t.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=void 0;return this.forAllProps(function(n,i){if(i.flags&at.Identifier){if(r)throw new je("Cannot define property '".concat(n,"' as object identifier, property '").concat(r,"' is already defined as identifier property"));r=n}}),r}}),Object.defineProperty(t.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new t({name:r.name||this.name,properties:Object.assign({},this.properties,r.properties),initializers:this.initializers.concat(r.initializers||[]),preProcessor:r.preProcessor||this.preProcessor,postProcessor:r.postProcessor||this.postProcessor})}}),Object.defineProperty(t.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateActions(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!qo(n))throw new je("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===C4)throw new je("Cannot define action '".concat(C4,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===T4)throw new je("Cannot define action '".concat(T4,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var a=n[i],o=r[i];if(i in cr&&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 g=bc(r,i,f);n[i]=g,Yo(r,i,g)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw new je("You passed an ".concat(typeof r," to volatile state as an argument, when function is expected"));var i=function(a){return n.instantiateVolatileState(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!qo(n))throw new je("volatile state initializer should return a plain object containing state");Py(r,n)}}),Object.defineProperty(t.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){var o=r(a),l=o.actions,u=o.views,f=o.state,g=lN(o,["actions","views","state"]);for(var S in g)throw new je("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(S,"'"));return f&&n.instantiateVolatileState(a,f),u&&n.instantiateViews(a,u),l&&n.instantiateActions(a,l),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateViews(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!qo(n))throw new je("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(i){var a,o=Object.getOwnPropertyDescriptor(n,i);if("get"in o)xy(r,i,o),Cy(r,(a={},a[i]=cl,a));else if(typeof o.value=="function")Yo(r,i,o.value);else throw new je("A view member should either be a function or getter based property")})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=xt(a)?a:this.applySnapshotPreProcessor(a);return o2(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type,a={};return i.forAllProps(function(o,l){a[o]=l.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=dr(dr({},qp),{name:this.name});return kt.object(r,Ls,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Yo(n,"toString",NI),this.forAllProps(function(i){Ey(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),Wh(n,this.willChange),Yh(n,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=qe(n.object),a=n.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(ha(o,n.newValue),n.newValue=o.reconcile(i.getChildNode(a),n.newValue,i,a)),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=qe(n.object),a=i.type.properties[n.name];if(a){var o=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:ao(n.name),value:n.newValue.snapshot,oldValue:o},i)}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=[];return this.forAllProps(function(a){i.push(n.getChildNode(r,a))}),i}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i;if(!(n in this.properties))throw new je("Not a value property: "+n);var a=vi(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw new je("Node not available for property "+n);return o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={};return this.forAllProps(function(o,l){try{var u=Gi(r.storedValue,o);u.reportObserved()}catch{throw new je("".concat(o," property is declared twice"))}a[o]=i.getChildNode(r,o).snapshot}),n?this.applySnapshotPostProcessor(a):a}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){if(!(i.op==="replace"||i.op==="add"))throw new je("object does not support operation ".concat(i.op));r.storedValue[n]=i.value}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ha(this,n);var i=this.applySnapshotPreProcessor(n);this.forAllProps(function(a){r.storedValue[a]=i[a]})}}),Object.defineProperty(t.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.preProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.postProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.properties[r]}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.applySnapshotPreProcessor(r);return qo(a)?Vp(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],a2(n,o,i.properties[o]))})):yn(n,a,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.propertyNames.forEach(function(i){return r(i,n.properties[i])})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return"{ "+this.propertyNames.map(function(n){return n+": "+r.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ls}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(Rs);_c.prototype.applySnapshot=ar(_c.prototype.applySnapshot);function DI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new _c({name:r,properties:n})}function jI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string",n=r?e[0]:"AnonymousModel";return r&&e.shift(),e.reduce(function(i,a){return i.cloneAndEnhance({name:i.name+"_"+a.name,properties:a.properties,initializers:a.initializers,preProcessor:function(o){return a.applySnapshotPreProcessor(i.applySnapshotPreProcessor(o))},postProcessor:function(o){return a.applySnapshotPostProcessor(i.applySnapshotPostProcessor(o))}})}).named(n)}function B7(e){return Vr(e)&&(e.flags&at.Object)>0}var xa=function(e){Dt(t,e);function t(r,n,i,a){a===void 0&&(a=uI);var o=e.call(this,r)||this;return Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:a}),o.flags=n,o}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Po(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.initializer(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(Ns(r)&&this.checker(r))return mn();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return yn(n,r,"Value is not a ".concat(i))}}),t}(Pl),U7=new xa("string",at.String,function(e){return typeof e=="string"}),H7=new xa("number",at.Number,function(e){return typeof e=="number"}),FI=new xa("integer",at.Integer,function(e){return cI(e)}),zI=new xa("float",at.Float,function(e){return fI(e)}),BI=new xa("finite",at.Finite,function(e){return dI(e)}),$7=new xa("boolean",at.Boolean,function(e){return typeof e=="boolean"}),G7=new xa("null",at.Null,function(e){return e===null}),V7=new xa("undefined",at.Undefined,function(e){return e===void 0}),q7=new xa("Date",at.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});q7.getSnapshot=function(e){return e.storedValue.getTime()};var W7=q7;function UI(e){switch(typeof e){case"string":return U7;case"number":return H7;case"boolean":return $7;case"object":if(e instanceof Date)return W7}throw new je("Cannot determine primitive type from value "+e)}function K7(e){return Vr(e)&&(e.flags&(at.String|at.Number|at.Integer|at.Boolean|at.Date))>0}var HI=function(e){Dt(t,e);function t(r){var n=e.call(this,JSON.stringify(r))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:at.Literal}),n.value=r,n}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Po(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return Ns(r)&&r===this.value?mn():yn(n,r,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),t}(Pl);function Y7(e){return new HI(e)}function $I(e){return Vr(e)&&(e.flags&at.Literal)>0}var GI=function(e){Dt(t,e);function t(r,n,i,a){var o=e.call(this,r)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_message",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|at.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this._subtype.validate(r,n);if(i.length>0)return i;var a=xt(r)?qe(r).snapshot:r;return this._predicate(a)?mn():yn(n,r,this._message(r))}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(ba);function VI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():Vr(e[0])?e[0].name:null,n=e[0],i=e[1],a=e[2]?e[2]:function(o){return"Value does not respect the refinement predicate"};return new GI(r,n,i,a)}function qI(e){return(e.flags&at.Refinement)>0}function WI(e,t){var r=typeof e=="string"?t:e,n=Wp.apply(void 0,qi([],Vi(r.map(function(i){return Y7(""+i)})),!1));return typeof e=="string"&&(n.name=e),n}var KI=function(e){Dt(t,e);function t(r,n,i){var a=e.call(this,r)||this;return Object.defineProperty(a,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=dr({eager:!0,dispatcher:void 0},i),a._dispatcher=i.dispatcher,i.eager||(a._eager=!1),a}return Object.defineProperty(t.prototype,"flags",{get:function(){var r=at.Union;return this._types.forEach(function(n){r|=n.flags}),r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._types.some(function(n){return n.isAssignableFrom(r)})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(r){return r.describe()}).join(" | ")+")"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(a,void 0);if(!o)throw new je("No matching type for union "+this.describe());return o.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(n,r.getReconciliationType());if(!o)throw new je("No matching type for union "+this.describe());return o.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._dispatcher?this._dispatcher(r):n?n.is(r)?n:this._types.filter(function(i){return i!==n}).find(function(i){return i.is(r)}):this._types.find(function(i){return i.is(r)})}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._dispatcher)return this._dispatcher(r).validate(r,n);for(var i=[],a=0,o=0;o<this._types.length;o++){var l=this._types[o],u=l.validate(r,n);if(u.length===0){if(this._eager)return mn();a++}else i.push(u)}return a===1?mn():yn(n,r,"No type is applicable for the union").concat(Vp(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(ba);function Wp(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=Vr(e)?void 0:e,i=Vr(e)?qi([e],Vi(t),!1):t,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new KI(a,i,n)}function X7(e){return(e.flags&at.Union)>0}var YI=function(e){Dt(t,e);function t(r,n,i){var a=e.call(this,r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|at.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(this.optionalValues.indexOf(a)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(r,n,i,o)}return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),i,a)}}),Object.defineProperty(t.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&ha(this,r),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?mn():this._subtype.validate(r,n)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(ba);function XI(e,t){if(typeof t!="function"&&xt(t))throw new je("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Xo(e,t,r){return XI(e,t),new YI(e,t,r||ZI)}var ZI=[void 0];function QI(e){return Vr(e)&&(e.flags&at.Optional)>0}var JI=Xo(V7,void 0),eD=Xo(G7,null);function Z7(e){return Wp(e,JI)}function tD(e){return Wp(e,eD)}var rD=function(e){Dt(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|at.Late},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._subType){var n=void 0;try{n=this._definition()}catch(i){if(i instanceof ReferenceError)n=void 0;else throw i}if(r&&n===void 0)throw new je("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):mn()}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||y7}}),t}(ba);function nD(e,t){var r=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?t:e;return new rD(r,n)}function iD(e){return Vr(e)&&(e.flags&at.Late)>0}function aD(e,t){return new oD(e,t)}var oD=function(e){Dt(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:at.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()}),nm(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(ar(function(a){i.loadedType=a,i.pendingNodeList.forEach(function(o){o.parent&&i.loadedType&&o.parent.applyPatches([{op:"replace",path:"/".concat(o.subpath),value:o.snapshot}])})}))}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this;if(this.loadedType)return this.loadedType.instantiate(r,n,i,a);var l=Po(this,r,n,i,a);return this.pendingNodeList.push(l),nm(function(){return!l.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(l),1)}),l}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.loadedType?this.loadedType.validate(r,n):L7(r)?mn():yn(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.loadedType?(r.die(),this.loadedType.instantiate(i,a,i.environment,n)):e.prototype.reconcile.call(this,r,n,i,a)}}),t}(Pl),Q7=function(e){Dt(t,e);function t(r){var n=e.call(this,r?"frozen(".concat(r.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:at.Frozen}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Po(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return L7(r)?this.subType?this.subType.validate(r,n):mn():yn(n,r,"Value is not serializable and cannot be frozen")}}),t}(Pl),A4=new Q7;function lD(e){return arguments.length===0?A4:Vr(e)?new Q7(e):Xo(A4,e)}function sD(e){return Vr(e)&&(e.flags&at.Frozen)>0}function uD(e){switch(e){case cr.beforeDestroy:return"destroy";case cr.beforeDetach:return"detach";default:return}}var cD=function(){function e(t,r){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),c2(t))this.identifier=t;else if(xt(t)){var n=qe(t);if(!n.identifierAttribute)throw new je("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw new je("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new je("Can only store references to tree nodes or identifiers, got: '".concat(t,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=Ks(this.identifier),n=t.root,i=n.identifierCache.getLastCacheModificationPerId(r);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var a=this.targetType,o=n.identifierCache.resolve(a,r);if(!o)throw new u2("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(t.path,")"));this.resolvedReference={node:o,lastCacheModification:i}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),u2=function(e){Dt(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return t}(Error),J7=function(e){Dt(t,e);function t(r,n){var i=e.call(this,"reference(".concat(r.name,")"))||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:at.Reference}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.targetType.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return c2(r)?mn():yn(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(t.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=n.parent;if(!(!o||!o.isAlive)){var l=o.storedValue;l&&this.onInvalidated({cause:r,parent:l,invalidTarget:a?a.storedValue:void 0,invalidId:i,replaceRef:function(u){As(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){B7(o.type)?this.replaceRef(void 0):As(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(t.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.getValue(r);if(a){var o=qe(a),l=function(g,S){var _=uD(S);_&&i.fireInvalidated(_,r,n,o)},u=o.registerHook(cr.beforeDetach,l),f=o.registerHook(cr.beforeDestroy,l);return function(){u(),f()}}}}),Object.defineProperty(t.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=this;if(this.onInvalidated){var o;r.registerHook(cr.beforeDestroy,function(){o&&o()});var l=function(u){o&&o();var f=r.parent,g=f&&f.storedValue;if(f&&f.isAlive&&g){var S=void 0;i?S=!!i.get(n,g):S=r.root.identifierCache.has(a.targetType,Ks(n)),S?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===Ar.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(cr.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(cr.afterAttach,function(){l(!1)}))}}}),t}(Pl),fD=function(e){Dt(t,e);function t(r,n){return e.call(this,r,n)||this}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=r.storedValue;return n.resolvedValue}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r.storedValue;return n.identifier}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=xt(a)?d7(a):a,l=new cD(a,this.targetType),u=Po(this,r,n,i,l);return l.node=u,this.watchTargetNodeForInvalidations(u,o,void 0),u}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this){var o=xt(n),l=r.storedValue;if(!o&&l.identifier===n||o&&l.resolvedValue===n)return r.setParent(i,a),r}var u=this.instantiate(i,a,void 0,n);return r.die(),u}}),t}(J7),dD=function(e){Dt(t,e);function t(r,n,i){var a=e.call(this,r,i)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=this.options.get(r.storedValue,r.parent?r.parent.storedValue:null);return n}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=xt(a)?this.options.set(a,r?r.storedValue:null):a,l=Po(this,r,n,i,o);return this.watchTargetNodeForInvalidations(l,o,this.options),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=xt(n)?this.options.set(n,r?r.storedValue:null):n;if(!r.isDetaching&&r.type===this&&r.storedValue===o)return r.setParent(i,a),r;var l=this.instantiate(i,a,void 0,o);return r.die(),l}}),t}(J7);function eS(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new dD(e,{get:r.get,set:r.set},n):new fD(e,n)}function hD(e){return(e.flags&at.Reference)>0}function pD(e,t){var r=eS(e,dr(dr({},t),{onInvalidated:function(n){t&&t.onInvalidated&&t.onInvalidated(n),n.removeRef()}}));return t&&t.acceptsUndefined===!1?r:Z7(r)}var tS=function(e){Dt(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:at.Identifier}),i}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r||!(r.type instanceof _c))throw new je("Identifier types can only be instantiated as direct child of a model type");return Po(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(r.storedValue!==n)throw new je("Tried to change identifier from '".concat(r.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return r.setParent(i,a),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?yn(n,r,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):mn()}}),t}(Pl),gD=function(e){Dt(t,e);function t(){var r=e.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:at.Identifier}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(tS),vD=function(e){Dt(t,e);function t(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),t}(tS),mD=new gD,yD=new vD;function bD(e){return Vr(e)&&(e.flags&at.Identifier)>0}function Ks(e){return""+e}function c2(e){return typeof e=="string"||typeof e=="number"}function _D(e){return new wD(e)}var wD=function(e){Dt(t,e);function t(r){var n=e.call(this,r.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:at.Custom}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return mn();var i=this.options.getValidationMessage(r);return i?yn(n,r,"Invalid value for type '".concat(this.name,"': ").concat(i)):mn()}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.options.isTargetType(a)?a:this.options.fromSnapshot(a,r&&r.root.environment);return Po(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=!this.options.isTargetType(n);if(!r.isDetaching){var l=r.type===this&&(o?n===r.snapshot:n===r.storedValue);if(l)return r.setParent(i,a),r}var u=o?this.options.fromSnapshot(n,i.root.environment):n,f=this.instantiate(i,a,void 0,u);return r.die(),f}}),t}(Pl),R4={enumeration:WI,model:DI,compose:jI,custom:_D,reference:eS,safeReference:pD,union:Wp,optional:Xo,literal:Y7,maybe:Z7,maybeNull:tD,refinement:VI,string:U7,boolean:$7,number:H7,integer:FI,float:zI,finite:BI,Date:W7,map:AI,array:MI,frozen:lD,identifier:mD,identifierNumber:yD,late:nD,lazy:aD,undefined:V7,null:G7,snapshotProcessor:TI};const SD=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:TN,addMiddleware:E7,applyAction:b7,applyPatch:As,applySnapshot:u7,cast:MN,castFlowReturn:yI,castToReferenceSnapshot:NN,castToSnapshot:LN,clone:PN,createActionTrackingMiddleware:zN,createActionTrackingMiddleware2:UN,decorate:WN,destroy:CN,detach:xN,escapeJsonPath:ao,flow:j7,getChildType:sN,getEnv:kN,getIdentifier:d7,getLivelinessChecking:o7,getMembers:RN,getNodeId:IN,getParent:gN,getParentOfType:mN,getPath:f7,getPathParts:yN,getPropertyMembers:g7,getRelativePath:ON,getRoot:c7,getRunningActionContext:i2,getSnapshot:t2,getType:qc,hasEnv:AN,hasParent:pN,hasParentOfType:vN,isActionContextChildOf:XN,isActionContextThisOrChildOf:ZN,isAlive:r2,isArrayType:LI,isFrozenType:sD,isIdentifierType:bD,isLateType:iD,isLiteralType:$I,isMapType:RI,isModelType:B7,isOptionalType:QI,isPrimitiveType:K7,isProtected:hN,isReferenceType:hD,isRefinementType:qI,isRoot:bN,isStateTreeNode:xt,isType:Vr,isUnionType:X7,isValidReference:EN,joinJsonPath:_h,onAction:_7,onPatch:s7,onSnapshot:uN,process:lI,protect:fN,recordActions:VN,recordPatches:cN,resolveIdentifier:wN,resolvePath:_N,setLivelinessChecking:a7,setLivelynessChecking:oN,splitJsonPath:Is,t:R4,toGenerator:_I,toGeneratorFunction:bI,tryReference:SN,tryResolve:h7,typecheck:x7,types:R4,unescapeJsonPath:F7,unprotect:dN,walk:p7},Symbol.toStringTag,{value:"Module"})),wi=fo(SD);var f2={};(function(e){function t({oldText:r,newText:n,element:i}){if(!(n.length/Math.max(20,r.length)>=4))return i.fontSize;const a=i.width*i.page.computedHeight/n.length,o=1.5*Math.sqrt(a),l=i.fontSize;return Math.min(l,Math.max(5,Math.round(o)))}Object.defineProperty(e,"__esModule",{value:!0}),e.getLimitedFontSize=void 0,e.getLimitedFontSize=t})(f2);(function(e){var t=ye&&ye.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.usePrevious=e.getLineHeight=e.useFontLoader=e.getDir=e.isRTLText=void 0;const r=t(et),n=yi,i=Pa,a=$c,o=Wi,l=t(_i),u=aN,f=Gc,g=Hi,S=Ws,_=Kn,h=e2,w=Vc,m=El,y=Ol,p=Oo,v=wi,d=f2;l.default._fixTextRendering=!0;const b=document.createElement("style");b.type="text/css",document.head.appendChild(b);const O={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function R(A){var L="֑-߿יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+L+"]*?["+L+"]").test(A)}function T(A){A=A.replace(/\s/g,"");let L=0;for(var z=0;z<A.length;z++)R(A[z])&&(L+=1);return L>A.length/2}function E(A){return T(A)?"rtl":"ltr"}e.isRTLText=T,e.getDir=E;const P=(0,n.observer)(({textNodeRef:A,element:L,onBlur:z,selectAll:I,cursorPosition:H})=>{const[W,V]=r.default.useState(O),U=A.current;r.default.useLayoutEffect(()=>{const ee={};ee.width=U.width()-2*U.padding()+"px",ee.height=U.height()-2*U.padding()+U.fontSize()*U.lineHeight()+"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=L.fontWeight,ee.fontStyle=L.fontStyle,ee.letterSpacing=L.letterSpacing+"em";const ne=`
|
|
96
|
+
.polotno-input::placeholder {
|
|
97
|
+
color: ${W.color};
|
|
98
|
+
opacity: 0.6;
|
|
99
|
+
}
|
|
100
|
+
`;b.innerHTML="",b.appendChild(document.createTextNode(ne)),JSON.stringify(ee)!==JSON.stringify(W)&&V(ee)});const Y=r.default.useRef(null);r.default.useLayoutEffect(()=>{var ee;const ne=Y.current;if(!ne)return;(ee=Y.current)===null||ee===void 0||ee.focus();const ie=H||ne.value.length;ne.selectionStart=ne.selectionEnd=ie,I&&(ne==null||ne.select(),document.execCommand("selectAll",!1,null))},[]),r.default.useEffect(()=>{window.addEventListener("blur",z);const ee=ne=>{var ie;!((ie=Y.current)===null||ie===void 0)&&ie.contains(ne.target)||z()};return window.addEventListener("touchstart",ee),()=>{window.removeEventListener("blur",z),window.removeEventListener("touchstart",ee)}},[]);let X=0;const Q=U.textArr.length*U.lineHeight()*U.fontSize();L.verticalAlign==="middle"&&(X=(L.a.height-Q)/2),L.verticalAlign==="bottom"&&(X=L.a.height-Q);const te=(0,h.removeTags)(L.text);return r.default.createElement("textarea",{className:"polotno-input",ref:Y,dir:E(te),style:Object.assign(Object.assign(Object.assign({},O),W),{paddingTop:X+"px"}),value:te,onChange:ee=>{const ne=(0,d.getLimitedFontSize)({oldText:L.text,newText:ee.target.value,element:L});L.set({text:ee.target.value,fontSize:ne})},placeholder:L.placeholder,onBlur:z})}),x=A=>r.default.createElement(a.Html,null,r.default.createElement(P,Object.assign({},A))),k=A=>{const[L,z]=r.default.useState(!1),I=r.default.useRef(!1);return r.default.useEffect(()=>{var H=!0;return setTimeout(()=>{H&&(A._editModeEnabled&&(I.current=!0),z(!0),setTimeout(()=>{I.current=!1},50))},50),()=>{H=!1}},[]),{editorEnabled:L&&A._editModeEnabled,selectAll:I.current}},M=(A,L)=>{const[z,I]=r.default.useReducer(W=>W+1,0),H=r.default.useRef((0,S.isFontLoaded)(L));return r.default.useLayoutEffect(()=>{if(H.current=(0,S.isFontLoaded)(L),H.current)return;let W=!0;return(async()=>{H.current=!1,I();const V=(0,g.incrementLoader)(`text ${L}`);await A.loadFont(L),setTimeout(V,100),W&&(H.current=!0,I())})(),()=>{W=!1}},[L]),[H.current]};e.useFontLoader=M;const j=({fontLoaded:A,fontFamily:L,fontSize:z,lineHeight:I})=>r.default.useMemo(()=>{if(typeof I=="number")return I;const H=document.createElement("div");H.style.fontFamily=L,H.style.fontSize=z+"px",H.style.lineHeight=I,H.innerText="Test text",document.body.appendChild(H);const W=H.offsetHeight;return document.body.removeChild(H),W/z},[A,L,z,I]);function B(A){var L=A.getAbsoluteTransform().copy();L.invert();var z=A.getStage().getPointerPosition();return L.point(z)}function $(A){var L;const z=A.target,I=B(z),H=z.textArr,W=Math.floor(I.y/(z.fontSize()*z.lineHeight())),V=H.slice(0,W).reduce((X,Q)=>X+Q.text.length,W),U=(L=H[W])!==null&&L!==void 0?L:H[0];let Y=0;return z.align()==="right"?Y=z.width()-U.width:z.align()==="center"&&(Y=z.width()/2-U.width/2),V+Math.round((I.x-Y)/U.width*U.text.length)}function Z(A){const L=r.default.useRef(A),z=r.default.useRef(A);return r.default.useMemo(()=>{z.current=L.current,L.current=A},[A]),z.current}function K(A){return/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(A)}function D(A,L){const z=A.fontSize(),I=A.height(),H=(0,h.removeTags)(L.text);let W=L.a.fontSize;A.height(void 0);const V=Math.round(2*L.a.fontSize)-1;for(let U=1;U<V;U++){const Y=L.a.height&&A.height()>L.a.height;let X=H.split(`
|
|
101
|
+
`).join(" ").split(/[\s-]+/).reduce((ee,ne)=>K(ne)?ee.concat(ne.split("")):ee.concat(ne),[]),Q=A.textArr.map(ee=>ee.text).join(";");const te=X.find(ee=>!Q.includes(ee)||(Q=Q.replace(ee,""),!1));if(!(Y||te))break;W-=.5,A.fontSize(W)}return A.fontSize(z),A.height(I),W}function q({lines:A,lineHeight:L,width:z,align:I="left",padding:H=0,cornerRadius:W=0}){var V;A.forEach((Q,te)=>{Q.cx=z/2,I==="right"?Q.cx=z-Q.width/2:I==="left"&&(Q.cx=Q.width/2),I!=="justify"||Q.lastInParagraph||(Q.width=z),I==="justify"&&(Q.cx=Q.width/2)});let U=`M ${(V=A[0])===null||V===void 0?void 0:V.cx} ${-H}`;A.forEach((Q,te)=>{const{cx:ee}=Q,ne=A[te-1];ne&&ne.width>Q.width?U+=` L ${ee+Q.width/2+H} ${te*L+H}`:U+=` L ${ee+Q.width/2+H} ${te*L-H}`;const ie=A[te+1];ie&&ie.width>Q.width?U+=` L ${ee+Q.width/2+H} ${(te+1)*L-H}`:U+=` L ${ee+Q.width/2+H} ${(te+1)*L+H}`});for(var Y=A.length-1;Y>=0;Y--){const Q=A[Y],{cx:te}=Q,ee=A[Y+1];ee&&ee.width>Q.width?U+=` L ${te-Q.width/2-H} ${(Y+1)*L-H}`:U+=` L ${te-Q.width/2-H} ${(Y+1)*L+H}`;const ne=A[Y-1];ne&&ne.width>Q.width?U+=` L ${te-Q.width/2-H} ${Y*L+H}`:U+=` L ${te-Q.width/2-H} ${Y*L-H}`}U+=" Z";const X=(0,u.parsePath)(U);return(0,u.roundCommands)(X,W).path}e.getLineHeight=j,e.usePrevious=Z,e.TextElement=(0,n.observer)(({element:A,store:L})=>{const z=r.default.useRef(null),I=r.default.useRef(null),{editorEnabled:H,selectAll:W}=k(A),[V,U]=r.default.useState(!1),[Y,X]=r.default.useState(!1),Q=r.default.useRef(A.a.height),te=L.selectedElements.indexOf(A)>=0,{textVerticalResizeEnabled:ee}=_.flags,ne=Z(A.fontFamily),[ie,le]=r.default.useState([]);r.default.useEffect(()=>{var Ne,$e;const Ge=($e=(Ne=z.current)===null||Ne===void 0?void 0:Ne.textArr)!==null&&$e!==void 0?$e:[];JSON.stringify(Ge)!==JSON.stringify(ie)&&le(Ge)}),r.default.useEffect(()=>{if(A.a.width)return;const Ne=z.current;Ne.width(600),A.set({width:1.4*Ne.getTextWidth()})},[]),r.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const Ne=z.current;(0,w.applyFilter)(Ne,A)}));const[xe]=(0,e.useFontLoader)(L,A.fontFamily),Fe=(0,h.removeTags)(A.text),oe=()=>{const Ne=z.current.clone({height:void 0}),$e=Math.ceil(Ne.fontSize()*Ne.lineHeight()*Ne.textArr.length+1);return Ne.destroy(),$e};r.default.useLayoutEffect(()=>{if(!xe)return;const{textOverflow:Ne}=_.flags;if(A.a.height)if(Ne!=="change-font-size"||Y||L.isPlaying){if(Ne==="resize"){const $e=oe();ee&&A.a.height<$e&&L.history.ignore(()=>{var Ge;(0,v.isAlive)(A)&&A.set({height:$e}),(Ge=z.current)===null||Ge===void 0||Ge.height($e)},!1,!0),ee||A.a.height===$e||L.history.ignore(()=>{var Ge;(0,v.isAlive)(A)&&A.set({height:$e}),(Ge=z.current)===null||Ge===void 0||Ge.height($e)},!1,!0)}}else{const $e=D(z.current,A);if($e!==A.a.fontSize)return void L.history.ignore(()=>{A.set({fontSize:$e})},!1,!0);const Ge=oe();A.a.height===Ge||ee||L.history.ignore(()=>{A.set({height:Ge})},!1,!0)}else{const $e=oe();L.history.ignore(()=>{A.set({height:$e})},!1,!0)}}),r.default.useLayoutEffect(()=>{const Ne=z.current;Ne&&(Ne.width(Ne.width()+1e-8),Ne._setTextData(),(0,w.applyFilter)(Ne,A))},[xe]);const ue=r.default.useRef(null),ve=r.default.useRef(0),Ee=Ne=>{Ne.evt.preventDefault(),L.selectedShapes.find(Ge=>Ge===A)&&A.contentEditable&&(ve.current=$(Ne),A.toggleEditMode())},re=!Fe&&A.placeholder?.6:A.a.opacity;(0,m.useFadeIn)(z,re);const de=(0,e.getLineHeight)({fontLoaded:xe,fontFamily:A.fontFamily,fontSize:A.a.fontSize,lineHeight:A.lineHeight}),me=A.selectable||L.role==="admin",Se=(0,f.useColor)(A),Te=r.default.useMemo(()=>A.backgroundEnabled?q({lines:JSON.parse(JSON.stringify(ie)),cornerRadius:A.backgroundCornerRadius*(A.a.fontSize*de*.5),lineHeight:de*A.a.fontSize,padding:A.backgroundPadding*(A.a.fontSize*de*.5),width:A.a.width,align:A.align}):"",[A.backgroundEnabled,A.backgroundCornerRadius,A.a.fontSize,de,A.backgroundPadding,A.a.width,A.align,ie]),ze=(0,p.isTouchDevice)();let Re=0;return A.verticalAlign==="middle"?Re=(A.a.height-ie.length*de*A.a.fontSize)/2:A.verticalAlign==="bottom"&&(Re=A.a.height-ie.length*de*A.a.fontSize),r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Path,{ref:I,x:A.a.x,y:A.a.y,rotation:A.a.rotation,hideInExport:!A.showInExport,listening:!1,visible:A.backgroundEnabled,opacity:A.backgroundOpacity*re,data:Te,fill:A.backgroundColor,offsetY:-Re}),r.default.createElement(i.Text,Object.assign({ref:z,id:A.id,name:"element",hideInExport:!A.showInExport,editModeEnabled:A._editModeEnabled,x:A.a.x,y:A.a.y,rotation:A.a.rotation,width:A.a.width,height:A.a.height,text:Fe||A.placeholder},Se,{stroke:A.stroke,lineJoin:"round",strokeWidth:A.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:A.a.fontSize,fontFamily:`"${A.fontFamily}", "${ne}"`,fontStyle:A.fontStyle+" "+A.fontWeight,textDecoration:A.textDecoration,align:A.align,verticalAlign:A.verticalAlign,draggable:ze?A.draggable&&te:A.draggable,preventDefault:!ze||te,opacity:re,visible:!A._editModeEnabled,ellipsis:_.flags.textOverflow==="ellipsis",shadowEnabled:A.shadowEnabled,shadowBlur:A.shadowBlur,shadowOffsetX:A.shadowOffsetX,shadowOffsetY:A.shadowOffsetY,shadowColor:A.shadowColor,shadowOpacity:A.shadowOpacity,lineHeight:de,letterSpacing:A.letterSpacing*A.a.fontSize,listening:me,onDragMove:Ne=>{A.set({x:Ne.target.x(),y:Ne.target.y()})},onDragEnd:Ne=>{A.set({x:Ne.target.x(),y:Ne.target.y()})},onMouseEnter:()=>{U(!0)},onMouseLeave:()=>{U(!1)},onClick:Ee,onTap:Ee,onTransformStart:()=>{X(!0),Q.current=z.current.height()},onTransform:Ne=>{var $e,Ge;const ut=Ne.target;($e=I.current)===null||$e===void 0||$e.setAttrs({x:ut.x(),y:ut.y(),rotation:ut.rotation(),scale:ut.scale()});const ce=((Ge=ut.getStage())===null||Ge===void 0?void 0:Ge.findOne("Transformer")).getActiveAnchor();if(ce==="middle-left"||ce==="middle-right"){const fe=ut.scaleX(),Ze=ut.width()*fe,be=A.a.fontSize;let Me=Ze;Ze<be&&(Me=be,ue.current&&ut.position(ue.current)),ut.width(Me),ut.scaleX(1),ut.scaleY(1);const Ae=oe();if(_.flags.textOverflow!=="ellipsis"){const _e=Math.max(Ae,Q.current);ut.height(_e),A.set({height:ut.height()})}A.set({x:ut.x(),y:ut.y(),width:ut.width(),rotation:ut.rotation()}),(0,w.applyFilter)(ut,A)}if(ce==="top-center"||ce==="bottom-center"){let fe=_.flags.textOverflow==="resize"?oe():de*A.a.fontSize;Ne.target.height(Math.max(fe,Ne.target.height()*Ne.target.scaleY())),Ne.target.scaleY(1)}ue.current=Ne.target.position()},onTransformEnd:Ne=>{var $e;const Ge=Ne.target.scaleX();Ne.target.scaleX(1),Ne.target.scaleY(1),A.set({fontSize:Math.round(A.a.fontSize*Ge),width:Math.ceil(Ne.target.width()*Ge),x:Ne.target.x(),y:Ne.target.y(),rotation:Ne.target.rotation(),height:Ne.target.height()*Ge,shadowBlur:A.shadowBlur*Ge,shadowOffsetX:A.shadowOffsetX*Ge,shadowOffsetY:A.shadowOffsetY*Ge,strokeWidth:A.strokeWidth*Ge}),($e=I.current)===null||$e===void 0||$e.setAttrs({scaleX:1,scaleY:1}),X(!1)}})),H&&r.default.createElement(i.Group,{x:A.a.x,y:A.a.y,rotation:A.a.rotation},r.default.createElement(x,{textNodeRef:z,element:A,selectAll:W,cursorPosition:ve.current,onBlur:()=>{A.toggleEditMode(!1)}})),!Y&&(V||te)&&r.default.createElement(y.Highlighter,{element:A}))})})(Zy);var d2={},Ys={};(function(e){var t=ye&&ye.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSvgColors=e.replaceColors=e.sameColors=e.fixSize=e.getSvgSize=e.svgToURL=e.getColors=e.urlToString=e.urlToBase64=void 0;const r=t(_i),n=t(et),i=Qy;function a(d){for(;d.parentNode;){if(d.nodeName==="defs")return!0;d=d.parentNode}return!1}function o(d){const b={fill:"",stroke:""};if(d.getAttribute("fill")&&d.getAttribute("fill")!=="none"&&(b.fill=d.getAttribute("fill")),!b.fill&&d.style.fill&&d.style.fill!=="none"&&(b.fill=d.style.fill),d.getAttribute("stroke")&&(b.stroke=d.getAttribute("stroke")),!b.stroke&&d.style.stroke&&(b.stroke=d.style.stroke),!b.stroke&&!b.fill){const O=d.ownerSVGElement,R=O&&O!==d&&o(O);(R==null?void 0:R.fill)==="currentColor"||(R==null?void 0:R.stroke)==="currentColor"||(b.fill="black")}return b}const l=["path","rect","circle"];function u(d){for(var b=[],O=d.getElementsByTagName("*"),R=0,T=O.length;R<T;R++){const E=O[R];a(E)||(E.getAttribute("fill")!==null&&b.push(E),(E.getAttribute("stroke")!==null||E.style&&E.style.fill||l.indexOf(E.nodeName)>=0)&&b.push(E))}return b}async function f(d){const b=await fetch(d);return _(await b.text())}async function g(d){return await(await fetch(d,{mode:"cors"})).text()}function S(d){const b=u(new DOMParser().parseFromString(d,"image/svg+xml")),O=[];return b.forEach(R=>{const{fill:T,stroke:E}=o(R);[T,E].forEach(P=>{P&&(P==="currentColor"&&(P="black"),r.default.Util.colorToRGBA(P)&&O.indexOf(P)===-1&&O.push(P))})}),O}function _(d){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(d)))}async function h(d){const b=await g(d),O=new DOMParser().parseFromString(b,"image/svg+xml").documentElement.getAttribute("viewBox"),[R,T,E,P]=(O==null?void 0:O.split(" "))||[];return{width:parseFloat(E),height:parseFloat(P)}}function w(d){var b=new DOMParser().parseFromString(d,"image/svg+xml");const O=b.documentElement.getAttribute("viewBox"),[R,T,E,P]=(O==null?void 0:O.split(" "))||[],x=b.documentElement.getAttribute("width");!x&&b.documentElement.setAttribute("width",E+"px");const k=b.documentElement.getAttribute("height");if((!k||k.indexOf("%")>=0)&&b.documentElement.setAttribute("height",P+"px"),x&&x.indexOf("%")>=0&&k&&k.indexOf("%")===-1){const M=parseFloat(k)/parseFloat(P);b.documentElement.setAttribute("width",M*parseFloat(E)+"px")}if(k&&k.indexOf("%")>=0&&x&&x.indexOf("%")===-1){const M=parseFloat(x)/parseFloat(E);b.documentElement.setAttribute("height",M*parseFloat(P)+"px")}return x==="100%"&&k==="100%"&&(b.documentElement.setAttribute("width",E+"px"),b.documentElement.setAttribute("height",P+"px")),new XMLSerializer().serializeToString(b)}e.urlToBase64=f,e.urlToString=g,e.getColors=S,e.svgToURL=_,e.getSvgSize=h,e.fixSize=w;const m=(d,b)=>{if(!d||!b)return!1;if(b==="currentColor"&&d==="black")return!0;const O=r.default.Util.colorToRGBA(d),R=r.default.Util.colorToRGBA(b);return O&&R?O.r===R.r&&O.g===R.g&&O.b===R.b&&O.a===R.a:void 0};function y(d,b,O,R){var T=d.namespaceURI,E=document.createElementNS(T,"linearGradient");const P=r.default.Util.degToRad(O+90),x=(Math.cos(P)+1)/2,k=(Math.sin(P)+1)/2,M=(Math.cos(P+Math.PI)+1)/2,j=(Math.sin(P+Math.PI)+1)/2;E.setAttribute("x1",100*x+"%"),E.setAttribute("y1",100*k+"%"),E.setAttribute("x2",100*M+"%"),E.setAttribute("y2",100*j+"%"),E.setAttribute("gradientUnits","userSpaceOnUse"),E.setAttribute("id",b);for(var B=0;B<R.length;B++){var $=R[B],Z=document.createElementNS(T,"stop");for(var K in $)$.hasOwnProperty(K)&&Z.setAttribute(K,$[K]);E.appendChild(Z)}return(d.querySelector("defs")||d.insertBefore(document.createElementNS(T,"defs"),d.firstChild)).appendChild(E)}function p(d,b){var O=new DOMParser().parseFromString(d,"image/svg+xml");const R=u(O),T=Array.from(b.keys());return R.forEach(E=>{const{fill:P,stroke:x}=o(E);[{prop:"fill",color:P},{prop:"stroke",color:x}].forEach(({prop:k,color:M})=>{const j=T.find(B=>(0,e.sameColors)(B,M));if(j){const B=b.get(j);if((0,i.isGradient)(B)){const{rotation:$,stops:Z}=(0,i.parseColor)(B),K=Z.map(q=>({offset:100*q.offset+"%","stop-color":q.color})),D="color"+Math.round(1e8*Math.random());y(O.children[0],D,$,K),E.style[k]=null,E.setAttribute(k,`url('#${D}')`)}else E.style[k]=b.get(j)}})}),_(new XMLSerializer().serializeToString(O))}e.sameColors=m,e.replaceColors=p;const v=d=>{const[b,O]=n.default.useState([]);return n.default.useEffect(()=>{let R=!1;return(async()=>{O([]);const T=S(await g(d));R||O(T)})(),()=>{R=!0}},[d]),b};e.useSvgColors=v})(Ys);(function(e){var t=ye&&ye.__createBinding||(Object.create?function(I,H,W,V){V===void 0&&(V=W);var U=Object.getOwnPropertyDescriptor(H,W);U&&!("get"in U?!H.__esModule:U.writable||U.configurable)||(U={enumerable:!0,get:function(){return H[W]}}),Object.defineProperty(I,V,U)}:function(I,H,W,V){V===void 0&&(V=W),I[V]=H[W]}),r=ye&&ye.__setModuleDefault||(Object.create?function(I,H){Object.defineProperty(I,"default",{enumerable:!0,value:H})}:function(I,H){I.default=H}),n=ye&&ye.__importStar||function(I){if(I&&I.__esModule)return I;var H={};if(I!=null)for(var W in I)W!=="default"&&Object.prototype.hasOwnProperty.call(I,W)&&t(H,I,W);return r(H,I),H},i=ye&&ye.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(et),o=yi,l=Wi,u=Pa,f=i(Gp),g=i(_i),S=$c,_=Ol,h=Hi,w=n(Ys),m=Kn,y=Vc,p=El,v=Oo;function d(){return document.createElement("canvas")}async function b(I){if(!(I.indexOf("data:image/svg+xml")>=0||I.indexOf(".svg")>=0))return I;const H=await w.urlToString(I),W=w.fixSize(H);return w.svgToURL(W)}const O=I=>{const[H,W]=a.default.useState(I);return a.default.useEffect(()=>{(async()=>{const V=await b(I);V!==H&&W(V)})()},[I]),H};function R(I,H){return Math.sqrt(Math.pow(H.x-I.x,2)+Math.pow(H.y-I.y,2))}function T(I,H){return{x:(I.x+H.x)/2,y:(I.y+H.y)/2}}const E=(I,H,W)=>{const V=a.default.useMemo(()=>{var U,Y;const{flipX:X,flipY:Q}=I,te=I.type==="svg"||I.src.indexOf("data:image/svg+xml")>=0||I.src.indexOf(".svg")>=0,ee=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&te||I.maskSrc;if(!X&&!Q&&!ee)return H;if(!H||!H.width||!H.height)return null;const ne=d();let ie=1;I.type==="svg"&&(ie=Math.max(I.a.width/H.width*W,I.a.height/H.height*W)),ne.width=Math.max(H.width*ie,1),ne.height=Math.max(H.height*ie,1);let le=X?-ne.width:0,xe=Q?-ne.height:0;return(U=ne.getContext("2d"))===null||U===void 0||U.scale(X?-1:1,Q?-1:1),(Y=ne.getContext("2d"))===null||Y===void 0||Y.drawImage(H,le,xe,ne.width,ne.height),ne},[I.maskSrc,I.flipX,I.flipY,H,I.a.width,I.a.height,W]);return a.default.useEffect(()=>()=>{V&&V.nodeName==="CANVAS"&&g.default.Util.releaseCanvas(V)},[V]),V};function P(I,H){const W=H.width/H.height;let V,U;return W>=I.width/I.height?(V=I.width,U=I.width/W):(V=I.height*W,U=I.height),{x:(I.width-V)/2,y:(I.height-U)/2,width:V,height:U}}function x(I,H,W,V,U,Y,X){for(var Q=new ImageData(H,W),te=new Int32Array(I.data.buffer),ee=I.width,ne=new Int32Array(Q.data.buffer),ie=Q.width,le=H/Y,xe=W/X,Fe=Math.round(1/le),oe=Math.round(1/xe),ue=Fe*oe,ve=0;ve<Q.height;ve++)for(var Ee=0;Ee<ie;Ee++){for(var re=V+Math.round(Ee/le)+(U+Math.round(ve/xe))*ee,de=0,me=0,Se=0,Te=0,ze=0;ze<oe;ze++)for(var Re=0;Re<Fe;Re++){var Ne=te[re+Re+ze*ee];de+=Ne<<24>>>24,me+=Ne<<16>>>24,Se+=Ne<<8>>>24,Te+=Ne>>>24}de=Math.round(de/ue),me=Math.round(me/ue),Se=Math.round(Se/ue),Te=Math.round(Te/ue),ne[Ee+ve*ie]=Te<<24|Se<<16|me<<8|de}return Q}function k(I,H){var W,V;const U=d();U.width=I.width,U.height=I.height;const Y=Math.max(1,Math.floor(U.width*H)),X=Math.max(1,Math.floor(U.height*H));(W=U.getContext("2d"))===null||W===void 0||W.drawImage(I,0,0,U.width,U.height);const Q=x(U.getContext("2d").getImageData(0,0,U.width,U.height),Y,X,0,0,U.width,U.height);return U.width=Y,U.height=X,(V=U.getContext("2d"))===null||V===void 0||V.putImageData(Q,0,0),U}const M=(I,H)=>{const[W,V]=D(I.maskSrc,"anonymous"),U=I.maskSrc?V:"loaded";return(0,e.useImageLoader)(U,I.id+"-mask"),a.default.useMemo(()=>{if(!W||!H||!H.width||!H.height)return H;const Y=d();Y.width=Math.max(H.width,1),Y.height=Math.max(H.height,1);const X=Y.getContext("2d");if(!X)return H;X.drawImage(H,0,0),X.globalCompositeOperation="source-in";const Q=P(W,I);return X.drawImage(W,Q.x,Q.y,Q.width,Q.height,0,0,H.width,H.height),Y},[H,W,I.a.width,I.a.height])},j=(I,H,W,V,U=0,Y=!1)=>{const X=Math.floor(Math.max(I.a.width*V,1)),Q=Math.floor(Math.max(I.a.height*V,1)),te=Math.min(U*V,X/2,Q/2),ee=Math.max(I.a.width/W.width,I.a.height/W.height)*V,ne=I.page._exportingOrRendering&&m.flags.imageDownScalingEnabled&&ee<1&&!Y,ie=W.x===0&&W.y===0&&W.width===(H==null?void 0:H.width)&&W.height===(H==null?void 0:H.height),le=a.default.useMemo(()=>{if(!(!H||!H.width||!H.height))return ie&&te===0&&!ne?void 0:d()},[H,te,ne,ie]);return a.default.useLayoutEffect(()=>{if(!le||!H)return;le.width=X,le.height=Q;const xe=le.getContext("2d");if(!xe)return;te&&(xe.beginPath(),xe.moveTo(te,0),xe.lineTo(X-te,0),xe.arc(X-te,te,te,3*Math.PI/2,0,!1),xe.lineTo(X,Q-te),xe.arc(X-te,Q-te,te,0,Math.PI/2,!1),xe.lineTo(te,Q),xe.arc(te,Q-te,te,Math.PI/2,Math.PI,!1),xe.lineTo(0,te),xe.arc(te,te,te,Math.PI,3*Math.PI/2,!1),xe.clip());const Fe=ne?k(H,ee):H,oe=ne?{x:Math.floor(W.x*ee),y:Math.floor(W.y*ee),width:Math.floor(W.width*ee),height:Math.floor(W.height*ee)}:W;xe.drawImage(Fe,oe.x,oe.y,oe.width,oe.height,0,0,le.width,le.height)},[le,I.a.width,I.a.height,W.x,W.y,W.width,W.height,U,V,Y,I.page._exportingOrRendering,ne]),a.default.useEffect(()=>()=>{le&&le.nodeName==="CANVAS"&&g.default.Util.releaseCanvas(le)},[le]),le||H},B=(I,H,W,V)=>{const U=O(I.clipSrc||""),[Y,X]=D(U,"anonymous"),Q=I.clipSrc?X:"loaded";(0,e.useImageLoader)(Q,I.id+"-clip");const te=a.default.useMemo(()=>{if(H&&Y)return d()},[H,Y]);return a.default.useLayoutEffect(()=>{var ee;if(!Y||!H||!H.width||!H.height||!Y||!Y.width||!Y.height||!te)return;const ne=d(),ie=Math.max(I.a.width/Y.width*W,I.a.height/Y.height*W);ne.width=Y.width*ie,ne.height=Y.height*ie,(ee=ne.getContext("2d"))===null||ee===void 0||ee.drawImage(Y,0,0,ne.width,ne.height),te.width=Math.max(H.width,1),te.height=Math.max(H.height,1);const le=te.getContext("2d");le&&(le.save(),le.drawImage(ne,0,0,H.width,H.height),g.default.Util.releaseCanvas(ne),le.globalCompositeOperation="source-in",le.drawImage(H,0,0,te.width,te.height),le.restore())},[te,H,Y,I.a.width,I.a.height,W,...V]),I.clipSrc&&Y?te:H},$=d(),Z=(0,o.observer)(({element:I})=>{const H=Math.min(30,I.a.width/4,I.a.height/4),W=a.default.useRef(null);return a.default.useEffect(()=>{const V=W.current;if(!V)return;const U=new g.default.Animation(Y=>{V.rotate(((Y==null?void 0:Y.timeDiff)||0)/2)},V.getLayer());return U.start(),()=>{U.stop()}}),a.default.createElement(u.Group,{x:I.x,y:I.y,rotation:I.rotation,listening:!1,opacity:I.a.opacity,hideInExport:!I.showInExport},a.default.createElement(u.Rect,{width:I.a.width,height:I.a.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:W,x:I.a.width/2,y:I.a.height/2,fill:"white",outerRadius:Math.abs(H),innerRadius:Math.max(1,H-5),angle:270}))}),K=(0,o.observer)(({element:I})=>{const H="Can not load the image...",W=Math.max(10,Math.min(30,I.a.width/25));return a.default.createElement(u.Group,{x:I.x,y:I.y,rotation:I.rotation,listening:!1,opacity:I.a.opacity,hideInExport:!I.showInExport},a.default.createElement(u.Rect,{width:I.a.width,height:I.a.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:H,fontSize:W,width:I.a.width,height:I.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let D=f.default;const q=I=>{D=I};e.setImageLoaderHook=q;const A=(I,H)=>{const W=a.default.useRef(),V=()=>{var U;(U=W.current)===null||U===void 0||U.call(W),W.current=void 0};a.default.useEffect(()=>V,[]),a.default.useLayoutEffect(()=>{I!=="loading"||W.current||(W.current=(0,h.incrementLoader)(`image ${H}`)),I!=="loading"&&V(),I==="failed"&&(0,h.triggerLoadError)(`image ${H}`)},[I])};e.useImageLoader=A;const L=({image:I,status:H,type:W})=>{const V=a.default.useRef();return a.default.useEffect(()=>{V.current=I||V.current},[I]),H!=="failed"||H!=="failed"&&W==="svg"?V.current:void 0},z=I=>{const[H,W]=a.default.useReducer(X=>X+1,0),V=a.default.useRef("loading"),U=a.default.useRef(I.src),Y=a.default.useRef(I.src);return Y.current!==I.src&&(Y.current=I.src,V.current="loading"),a.default.useEffect(()=>{if(I.type!=="svg"||!I.src)return;let X=!1;return(async()=>{V.current="loading",W();const Q=await w.urlToString(I.src),te=w.fixSize(Q),ee=w.replaceColors(te,I.colorsReplace);X||(U.current=ee,V.current="loaded",W())})(),()=>{X=!0}},[I.src,JSON.stringify(I.colorsReplace)]),I.type!=="svg"?[I.src,"loaded"]:[U.current,V.current]};e.ImageElement=(0,o.observer)(({element:I,store:H})=>{var W;const[V,U]=a.default.useState(!1),Y=a.default.useRef(null),X=a.default.useRef(null),[Q,te]=a.default.useState(!1),ee=H.selectedElements.indexOf(I)>=0,[ne,ie]=z(I),[le,xe]=D(ne,"anonymous"),Fe=I.type!=="svg"||ie==="loaded"?xe:"loading";(0,e.useImageLoader)(Fe,I.id);const oe=L({image:le,status:xe,type:I.type}),ue=M(I,E(I,le||oe,H._elementsPixelRatio))||$;let{cropX:ve,cropY:Ee,cropWidth:re,cropHeight:de}=I;xe!=="loaded"&&(ve=Ee=0,re=de=1);const me=ue.width*re,Se=ue.height*de,Te=I.a.width/I.a.height;let ze,Re;const Ne=me/Se,$e=I.type==="svg";$e?(ze=me,Re=Se):Te>=Ne?(ze=me,Re=me/Te):(ze=Se*Te,Re=Se);const Ge={x:ue.width*ve,y:ue.height*Ee,width:ze,height:Re},ut=(W=I.cornerRadius)!==null&&W!==void 0?W:0,ce=I.page._exportingOrRendering?1:Math.min(2,H.scale),fe=H._elementsPixelRatio*ce;let Ze=B(I,j(I,ue,Ge,fe,ut,V||I._cropModeEnabled||I.type==="svg"),fe,[Ge,ut,fe]);const be=Math.max(I.a.width/ze,I.a.height/Re);a.default.useEffect(()=>{var Le;if(!I._cropModeEnabled)return;const Je=(Le=Y.current)===null||Le===void 0?void 0:Le.getStage();function dt(mt){I._cropModeEnabled&&mt.target!==X.current&&I.toggleCropMode(!1)}function Mt(mt){I._cropModeEnabled&&mt.target.parentNode!==Je.content&&I.toggleCropMode(!1)}return document.body.addEventListener("click",Mt),Je==null||Je.on("click",dt),Je==null||Je.on("tap",dt),()=>{document.body.removeEventListener("click",Mt),document.body.removeEventListener("touchstart",Mt),Je==null||Je.off("click",dt),Je==null||Je.off("click",dt)}},[I._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(V||I._cropModeEnabled))return(0,y.applyFilter)(Y.current,I),(0,l.autorun)(()=>{(0,y.applyFilter)(Y.current,I)},{delay:100})},[Ze,I.page._exportingOrRendering,V,re,de,I._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Le;V||I._cropModeEnabled?(Le=Y.current)===null||Le===void 0||Le.clearCache():(0,y.applyFilter)(Y.current,I)},[V,I.a.width,I.a.height,I._cropModeEnabled]),a.default.useEffect(()=>{(0,y.applyFilter)(Y.current,I)},[I.shadowEnabled,I.shadowBlur,I.cornerRadius,I.shadowColor,I.shadowOffsetX,I.shadowOffsetY,I.shadowOpacity]);const Me=a.default.useRef(null),Ae=a.default.useRef(null),_e=a.default.useRef(null);a.default.useLayoutEffect(()=>{I._cropModeEnabled&&(Ae.current.nodes([Me.current]),_e.current.nodes([X.current]))},[I._cropModeEnabled]);var Qe=a.default.useRef(null),we=a.default.useRef(0),Ye=a.default.useRef(!1);const Pr=Le=>{var Je;((Je=Le.evt.touches)===null||Je===void 0?void 0:Je.length)>2&&Le.target.stopDrag(),Math.round(Le.target.x())>0&&(Le.target.x(0),Le.target.scaleX(1)),Math.round(Le.target.y())>0&&(Le.target.y(0),Le.target.scaleY(1));const dt=Le.target.width()*Le.target.scaleX(),Mt=Le.target.height()*Le.target.scaleY(),mt=Math.min(1,ze/dt),vr=Math.min(1,Re/Mt),mr=1-mt,or=Math.min(mr,Math.max(0,Math.round(-Le.target.x())/dt)),_n=1-vr,xr=Math.min(_n,Math.max(0,Math.round(-Le.target.y())/Mt));Le.target.setAttrs({x:-or*ue.width,y:-xr*ue.height,scaleX:1,scaleY:1}),I.set({cropX:or,cropY:xr,cropWidth:mt,cropHeight:vr})},Oe=()=>{I.type!=="svg"&&I.contentEditable&&setTimeout(()=>{I.toggleCropMode(!0)})},Be=I.type==="svg"&&oe,tt=xe==="loading"&&!Be,yt=xe==="failed",Ct=!tt&&!yt,gr=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Nr=Ct?I.a.opacity:0;(0,p.useFadeIn)(Y,Nr);const Ir=I.selectable||H.role==="admin",bn=(0,v.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,tt&&a.default.createElement(Z,{element:I}),yt&&a.default.createElement(K,{element:I}),a.default.createElement(u.Image,{ref:Y,name:"element",id:I.id,image:Ze,x:I.a.x,y:I.a.y,width:I.a.width||1,height:I.a.height||1,rotation:I.a.rotation,opacity:Nr,shadowEnabled:I.shadowEnabled,shadowBlur:I.shadowBlur,shadowOffsetX:I.shadowOffsetX,shadowOffsetY:I.shadowOffsetY,shadowColor:I.shadowColor,shadowOpacity:I.shadowOpacity,customCrop:Ge,listening:Ir,draggable:bn?I.draggable&&ee:I.draggable,preventDefault:!bn||ee,hideInExport:!I.showInExport,onMouseEnter:()=>{te(!0)},onMouseLeave:()=>{te(!1)},onDragMove:Le=>{I.set({x:Le.target.x(),y:Le.target.y()})},onDragEnd:Le=>{I.set({x:Le.target.x(),y:Le.target.y()})},onDblClick:Oe,onDblTap:Oe,onTransformStart:()=>{U(!0),gr.current={cropX:I.cropX,cropY:I.cropY,cropWidth:I.cropWidth,cropHeight:I.cropHeight}},onTransform:Le=>{var Je;const dt=Le.currentTarget,Mt=Math.abs(dt.scaleX()-1)<1e-7?1:dt.scaleX(),mt=Math.abs(dt.scaleY()-1)<1e-7?1:dt.scaleY();dt.scaleX(1),dt.scaleY(1);const vr=(Je=Le.target.getStage())===null||Je===void 0?void 0:Je.findOne("Transformer"),mr=1-ze/ue.width,or=Math.min(mr,Math.max(0,I.cropX)),_n=1-Re/ue.height,xr=Math.min(_n,Math.max(0,I.cropY)),en=vr.getActiveAnchor(),Si=!(en.indexOf("middle")>=0||en.indexOf("center")>=0),Ca=!Si&&Mt<1&&gr.current.cropHeight>Re/ue.height;let xo=Si?I.cropWidth:I.cropWidth*Mt;Ca&&(xo=I.cropWidth);const Co=!Si&&mt<1&&gr.current.cropWidth>ze/ue.width;let Ta=Si?I.cropHeight:I.cropHeight*mt;Co&&(Ta=I.cropHeight),$e&&(xo=I.cropWidth,Ta=I.cropHeight),I.set({cropX:or,cropY:xr,x:dt.x(),y:dt.y(),width:dt.width()*Mt,height:dt.height()*mt,rotation:Le.target.rotation(),cropWidth:Math.min(xo,1-or),cropHeight:Math.min(Ta,1-xr)})},onTransformEnd:Le=>{const Je=Le.currentTarget;I.set({width:Je.width(),height:Je.height(),x:Je.x(),y:Je.y(),rotation:Le.target.rotation(),cropWidth:ze/ue.width,cropHeight:Re/ue.height}),U(!1)}}),a.default.createElement(u.Rect,{x:I.x,y:I.y,width:Math.max(I.a.width-I.borderSize,0),height:Math.max(I.a.height-I.borderSize,0),opacity:Nr,offsetX:-I.borderSize/2,offsetY:-I.borderSize/2,stroke:I.borderColor,strokeWidth:I.borderSize,listening:!1,visible:!!I.borderSize,rotation:I.rotation,cornerRadius:Math.max(0,ut-I.borderSize),hideInExport:!I.showInExport}),I._cropModeEnabled&&a.default.createElement(S.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/H.scale,y:-window.innerWidth/H.scale,width:window.innerWidth/H.scale*3,height:window.innerWidth/H.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:Ze,x:I.x,y:I.y,width:I.a.width,height:I.a.height,rotation:I.rotation,shadowEnabled:I.shadowEnabled,shadowBlur:I.shadowBlur}),a.default.createElement(u.Group,{x:I.x,y:I.y,rotation:I.rotation,scaleX:be,scaleY:be},a.default.createElement(u.Image,{image:ue,ref:X,opacity:.4,draggable:!0,x:-I.cropX*ue.width,y:-I.cropY*ue.height,onDragMove:Pr,onTransform:Pr,onTouchMove:Le=>{Le.evt.preventDefault();const Je=Le.target.getStage().getPointersPositions();var dt=Je[0],Mt=Je[1];const mt=Le.target;if(dt&&!Mt&&!mt.isDragging()&&Ye.current&&(mt.startDrag(),Ye.current=!1),dt&&Mt){g.default.hitOnDragEnabled=!0,mt.isDragging()&&(Ye.current=!0,mt.stopDrag());const Co=Le.target.getAbsoluteTransform().copy();Co.invert();var vr={x:dt.x,y:dt.y},mr={x:Mt.x,y:Mt.y};if(!Qe.current)return void(Qe.current=T(vr,mr));var or=T(vr,mr),_n=R(vr,mr);we.current||(we.current=_n);const Ta=mt.position();var xr={x:or.x-Ta.x,y:or.y-Ta.y},en=_n/we.current;mt.scaleX(en),mt.scaleY(en);const Kc=Co.point(or),Yc=Co.point(Qe.current);var Si=Kc.x-Yc.x,Ca=Kc.y-Yc.y,xo={x:Math.min(0,or.x-xr.x*en+Si),y:Math.min(0,or.y-xr.y*en+Ca)};mt.position(xo),we.current=_n,Qe.current=or,Pr(Le)}},onTouchEnd:Le=>{we.current=0,Qe.current=null,g.default.hitOnDragEnabled=!1}}),a.default.createElement(u.Transformer,{ref:_e,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Le,Je)=>Je.width<5||Je.height<5?Le:Je,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:ze,height:Re,ref:Me,listening:!1,onTransform:Le=>{Le.target.x()<-I.cropX*ue.width-1e-9&&(Le.target.x(-I.cropX*ue.width),Le.target.scaleX(1)),Le.target.y()<-I.cropY*ue.height-1e-9&&(Le.target.y(-I.cropY*ue.height),Le.target.scaleY(1));const Je=Math.min(1,Math.max(0,I.cropX+Le.target.x()/ue.width)),dt=Math.min(1,Math.max(0,Le.target.y()/ue.height+I.cropY)),Mt=Le.target.width()*Le.target.scaleX(),mt=Le.target.height()*Le.target.scaleY(),vr=Math.min(1-Je,Mt/ue.width),mr=Math.min(1-dt,mt/ue.height),or=Le.target.getAbsolutePosition(Le.target.getParent().getParent());Le.target.scale({x:1,y:1}),Le.target.position({x:0,y:0}),I.set({x:or.x,y:or.y,cropX:Je,cropY:dt,cropWidth:vr,cropHeight:mr,width:Math.min(Mt*be,ue.width*(1-Je)*be),height:Math.min(mt*be,ue.height*(1-dt)*be)})}}),a.default.createElement(u.Transformer,{ref:Ae,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Le,Je)=>Je.width<5||Je.height<5?Le:Je,visible:I.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(Q||ee)&&a.default.createElement(_.Highlighter,{element:I}))})})(d2);var rS={},nS={exports:{}};/*!
|
|
102
|
+
* Quill Editor v1.3.7
|
|
103
|
+
* https://quilljs.com/
|
|
104
|
+
* Copyright (c) 2014, Jason Chen
|
|
105
|
+
* Copyright (c) 2013, salesforce.com
|
|
106
|
+
*/(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:ye,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,l){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:l})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(18),l=i(19),u=i(45),f=i(46),g=i(47),S=i(48),_=i(49),h=i(12),w=i(32),m=i(33),y=i(31),p=i(1),v={Scope:p.Scope,create:p.create,find:p.find,query:p.query,register:p.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:S.default,Scroll:u.default,Block:g.default,Inline:f.default,Text:_.default,Attributor:{Attribute:h.default,Class:w.default,Style:m.default,Store:y.default}};n.default=v},function(r,n,i){var a=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,v){p.__proto__=v}||function(p,v){for(var d in v)v.hasOwnProperty(d)&&(p[d]=v[d])};return function(p,v){y(p,v);function d(){this.constructor=p}p.prototype=v===null?Object.create(v):(d.prototype=v.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(y){a(p,y);function p(v){var d=this;return v="[Parchment] "+v,d=y.call(this,v)||this,d.message=v,d.name=d.constructor.name,d}return p}(Error);n.ParchmentError=o;var l={},u={},f={},g={};n.DATA_KEY="__blot";var S;(function(y){y[y.TYPE=3]="TYPE",y[y.LEVEL=12]="LEVEL",y[y.ATTRIBUTE=13]="ATTRIBUTE",y[y.BLOT=14]="BLOT",y[y.INLINE=7]="INLINE",y[y.BLOCK=11]="BLOCK",y[y.BLOCK_BLOT=10]="BLOCK_BLOT",y[y.INLINE_BLOT=6]="INLINE_BLOT",y[y.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",y[y.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",y[y.ANY=15]="ANY"})(S=n.Scope||(n.Scope={}));function _(y,p){var v=w(y);if(v==null)throw new o("Unable to create "+y+" blot");var d=v,b=y instanceof Node||y.nodeType===Node.TEXT_NODE?y:d.create(p);return new d(b,p)}n.create=_;function h(y,p){return p===void 0&&(p=!1),y==null?null:y[n.DATA_KEY]!=null?y[n.DATA_KEY].blot:p?h(y.parentNode,p):null}n.find=h;function w(y,p){p===void 0&&(p=S.ANY);var v;if(typeof y=="string")v=g[y]||l[y];else if(y instanceof Text||y.nodeType===Node.TEXT_NODE)v=g.text;else if(typeof y=="number")y&S.LEVEL&S.BLOCK?v=g.block:y&S.LEVEL&S.INLINE&&(v=g.inline);else if(y instanceof HTMLElement){var d=(y.getAttribute("class")||"").split(/\s+/);for(var b in d)if(v=u[d[b]],v)break;v=v||f[y.tagName]}return v==null?null:p&S.LEVEL&v.scope&&p&S.TYPE&v.scope?v:null}n.query=w;function m(){for(var y=[],p=0;p<arguments.length;p++)y[p]=arguments[p];if(y.length>1)return y.map(function(b){return m(b)});var v=y[0];if(typeof v.blotName!="string"&&typeof v.attrName!="string")throw new o("Invalid definition");if(v.blotName==="abstract")throw new o("Cannot register abstract class");if(g[v.blotName||v.attrName]=v,typeof v.keyName=="string")l[v.keyName]=v;else if(v.className!=null&&(u[v.className]=v),v.tagName!=null){Array.isArray(v.tagName)?v.tagName=v.tagName.map(function(b){return b.toUpperCase()}):v.tagName=v.tagName.toUpperCase();var d=Array.isArray(v.tagName)?v.tagName:[v.tagName];d.forEach(function(b){(f[b]==null||v.className==null)&&(f[b]=v)})}return v}n.register=m},function(r,n,i){var a=i(51),o=i(11),l=i(3),u=i(20),f="\0",g=function(S){Array.isArray(S)?this.ops=S:S!=null&&Array.isArray(S.ops)?this.ops=S.ops:this.ops=[]};g.prototype.insert=function(S,_){var h={};return S.length===0?this:(h.insert=S,_!=null&&typeof _=="object"&&Object.keys(_).length>0&&(h.attributes=_),this.push(h))},g.prototype.delete=function(S){return S<=0?this:this.push({delete:S})},g.prototype.retain=function(S,_){if(S<=0)return this;var h={retain:S};return _!=null&&typeof _=="object"&&Object.keys(_).length>0&&(h.attributes=_),this.push(h)},g.prototype.push=function(S){var _=this.ops.length,h=this.ops[_-1];if(S=l(!0,{},S),typeof h=="object"){if(typeof S.delete=="number"&&typeof h.delete=="number")return this.ops[_-1]={delete:h.delete+S.delete},this;if(typeof h.delete=="number"&&S.insert!=null&&(_-=1,h=this.ops[_-1],typeof h!="object"))return this.ops.unshift(S),this;if(o(S.attributes,h.attributes)){if(typeof S.insert=="string"&&typeof h.insert=="string")return this.ops[_-1]={insert:h.insert+S.insert},typeof S.attributes=="object"&&(this.ops[_-1].attributes=S.attributes),this;if(typeof S.retain=="number"&&typeof h.retain=="number")return this.ops[_-1]={retain:h.retain+S.retain},typeof S.attributes=="object"&&(this.ops[_-1].attributes=S.attributes),this}}return _===this.ops.length?this.ops.push(S):this.ops.splice(_,0,S),this},g.prototype.chop=function(){var S=this.ops[this.ops.length-1];return S&&S.retain&&!S.attributes&&this.ops.pop(),this},g.prototype.filter=function(S){return this.ops.filter(S)},g.prototype.forEach=function(S){this.ops.forEach(S)},g.prototype.map=function(S){return this.ops.map(S)},g.prototype.partition=function(S){var _=[],h=[];return this.forEach(function(w){var m=S(w)?_:h;m.push(w)}),[_,h]},g.prototype.reduce=function(S,_){return this.ops.reduce(S,_)},g.prototype.changeLength=function(){return this.reduce(function(S,_){return _.insert?S+u.length(_):_.delete?S-_.delete:S},0)},g.prototype.length=function(){return this.reduce(function(S,_){return S+u.length(_)},0)},g.prototype.slice=function(S,_){S=S||0,typeof _!="number"&&(_=1/0);for(var h=[],w=u.iterator(this.ops),m=0;m<_&&w.hasNext();){var y;m<S?y=w.next(S-m):(y=w.next(_-m),h.push(y)),m+=u.length(y)}return new g(h)},g.prototype.compose=function(S){var _=u.iterator(this.ops),h=u.iterator(S.ops),w=[],m=h.peek();if(m!=null&&typeof m.retain=="number"&&m.attributes==null){for(var y=m.retain;_.peekType()==="insert"&&_.peekLength()<=y;)y-=_.peekLength(),w.push(_.next());m.retain-y>0&&h.next(m.retain-y)}for(var p=new g(w);_.hasNext()||h.hasNext();)if(h.peekType()==="insert")p.push(h.next());else if(_.peekType()==="delete")p.push(_.next());else{var v=Math.min(_.peekLength(),h.peekLength()),d=_.next(v),b=h.next(v);if(typeof b.retain=="number"){var O={};typeof d.retain=="number"?O.retain=v:O.insert=d.insert;var R=u.attributes.compose(d.attributes,b.attributes,typeof d.retain=="number");if(R&&(O.attributes=R),p.push(O),!h.hasNext()&&o(p.ops[p.ops.length-1],O)){var T=new g(_.rest());return p.concat(T).chop()}}else typeof b.delete=="number"&&typeof d.retain=="number"&&p.push(b)}return p.chop()},g.prototype.concat=function(S){var _=new g(this.ops.slice());return S.ops.length>0&&(_.push(S.ops[0]),_.ops=_.ops.concat(S.ops.slice(1))),_},g.prototype.diff=function(S,_){if(this.ops===S.ops)return new g;var h=[this,S].map(function(v){return v.map(function(d){if(d.insert!=null)return typeof d.insert=="string"?d.insert:f;var b=v===S?"on":"with";throw new Error("diff() called "+b+" non-document")}).join("")}),w=new g,m=a(h[0],h[1],_),y=u.iterator(this.ops),p=u.iterator(S.ops);return m.forEach(function(v){for(var d=v[1].length;d>0;){var b=0;switch(v[0]){case a.INSERT:b=Math.min(p.peekLength(),d),w.push(p.next(b));break;case a.DELETE:b=Math.min(d,y.peekLength()),y.next(b),w.delete(b);break;case a.EQUAL:b=Math.min(y.peekLength(),p.peekLength(),d);var O=y.next(b),R=p.next(b);o(O.insert,R.insert)?w.retain(b,u.attributes.diff(O.attributes,R.attributes)):w.push(R).delete(b);break}d-=b}}),w.chop()},g.prototype.eachLine=function(S,_){_=_||`
|
|
107
|
+
`;for(var h=u.iterator(this.ops),w=new g,m=0;h.hasNext();){if(h.peekType()!=="insert")return;var y=h.peek(),p=u.length(y)-h.peekLength(),v=typeof y.insert=="string"?y.insert.indexOf(_,p)-p:-1;if(v<0)w.push(h.next());else if(v>0)w.push(h.next(v));else{if(S(w,h.next(1).attributes||{},m)===!1)return;m+=1,w=new g}}w.length()>0&&S(w,{},m)},g.prototype.transform=function(S,_){if(_=!!_,typeof S=="number")return this.transformPosition(S,_);for(var h=u.iterator(this.ops),w=u.iterator(S.ops),m=new g;h.hasNext()||w.hasNext();)if(h.peekType()==="insert"&&(_||w.peekType()!=="insert"))m.retain(u.length(h.next()));else if(w.peekType()==="insert")m.push(w.next());else{var y=Math.min(h.peekLength(),w.peekLength()),p=h.next(y),v=w.next(y);if(p.delete)continue;v.delete?m.push(v):m.retain(y,u.attributes.transform(p.attributes,v.attributes,_))}return m.chop()},g.prototype.transformPosition=function(S,_){_=!!_;for(var h=u.iterator(this.ops),w=0;h.hasNext()&&w<=S;){var m=h.peekLength(),y=h.peekType();if(h.next(),y==="delete"){S-=Math.min(m,S-w);continue}else y==="insert"&&(w<S||!_)&&(S+=m);w+=m}return S},r.exports=g},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"),m=h.constructor&&h.constructor.prototype&&i.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!w&&!m)return!1;var y;for(y in h);return typeof y>"u"||i.call(h,y)},g=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},S=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 _(){var h,w,m,y,p,v,d=arguments[0],b=1,O=arguments.length,R=!1;for(typeof d=="boolean"&&(R=d,d=arguments[1]||{},b=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});b<O;++b)if(h=arguments[b],h!=null)for(w in h)m=S(d,w),y=S(h,w),d!==y&&(R&&y&&(f(y)||(p=u(y)))?(p?(p=!1,v=m&&u(m)?m:[]):v=m&&f(m)?m:{},g(d,{name:w,newValue:_(R,v,y)})):typeof y<"u"&&g(d,{name:w,newValue:y}));return d}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=function(){function k(M,j){for(var B=0;B<j.length;B++){var $=j[B];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(M,$.key,$)}}return function(M,j,B){return j&&k(M.prototype,j),B&&k(M,B),M}}(),o=function k(M,j,B){M===null&&(M=Function.prototype);var $=Object.getOwnPropertyDescriptor(M,j);if($===void 0){var Z=Object.getPrototypeOf(M);return Z===null?void 0:k(Z,j,B)}else{if("value"in $)return $.value;var K=$.get;return K===void 0?void 0:K.call(B)}},l=i(3),u=d(l),f=i(2),g=d(f),S=i(0),_=d(S),h=i(16),w=d(h),m=i(6),y=d(m),p=i(7),v=d(p);function d(k){return k&&k.__esModule?k:{default:k}}function b(k,M){if(!(k instanceof M))throw new TypeError("Cannot call a class as a function")}function O(k,M){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:k}function R(k,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);k.prototype=Object.create(M&&M.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(k,M):k.__proto__=M)}var T=1,E=function(k){R(M,k);function M(){return b(this,M),O(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 _.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new g.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(B,$){var Z=_.default.query(B,_.default.Scope.BLOCK_ATTRIBUTE);Z!=null&&this.attributes.attribute(Z,$)}},{key:"formatAt",value:function(B,$,Z,K){this.format(Z,K)}},{key:"insertAt",value:function(B,$,Z){if(typeof $=="string"&&$.endsWith(`
|
|
108
|
+
`)){var K=_.default.create(P.blotName);this.parent.insertBefore(K,B===0?this:this.next),K.insertAt(0,$.slice(0,-1))}else o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertAt",this).call(this,B,$,Z)}}]),M}(_.default.Embed);E.scope=_.default.Scope.BLOCK_BLOT;var P=function(k){R(M,k);function M(j){b(this,M);var B=O(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,j));return B.cache={},B}return a(M,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(_.default.Leaf).reduce(function(B,$){return $.length()===0?B:B.insert($.value(),x($))},new g.default).insert(`
|
|
109
|
+
`,x(this))),this.cache.delta}},{key:"deleteAt",value:function(B,$){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"deleteAt",this).call(this,B,$),this.cache={}}},{key:"formatAt",value:function(B,$,Z,K){$<=0||(_.default.query(Z,_.default.Scope.BLOCK)?B+$===this.length()&&this.format(Z,K):o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"formatAt",this).call(this,B,Math.min($,this.length()-B-1),Z,K),this.cache={})}},{key:"insertAt",value:function(B,$,Z){if(Z!=null)return o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertAt",this).call(this,B,$,Z);if($.length!==0){var K=$.split(`
|
|
110
|
+
`),D=K.shift();D.length>0&&(B<this.length()-1||this.children.tail==null?o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertAt",this).call(this,Math.min(B,this.length()-1),D):this.children.tail.insertAt(this.children.tail.length(),D),this.cache={});var q=this;K.reduce(function(A,L){return q=q.split(A,!0),q.insertAt(0,L),L.length},B+D.length)}}},{key:"insertBefore",value:function(B,$){var Z=this.children.head;o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertBefore",this).call(this,B,$),Z instanceof w.default&&Z.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)+T),this.cache.length}},{key:"moveChildren",value:function(B,$){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"moveChildren",this).call(this,B,$),this.cache={}}},{key:"optimize",value:function(B){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"optimize",this).call(this,B),this.cache={}}},{key:"path",value:function(B){return o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"path",this).call(this,B,!0)}},{key:"removeChild",value:function(B){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"removeChild",this).call(this,B),this.cache={}}},{key:"split",value:function(B){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if($&&(B===0||B>=this.length()-T)){var Z=this.clone();return B===0?(this.parent.insertBefore(Z,this),this):(this.parent.insertBefore(Z,this.next),Z)}else{var K=o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"split",this).call(this,B,$);return this.cache={},K}}}]),M}(_.default.Block);P.blotName="block",P.tagName="P",P.defaultChild="break",P.allowedChildren=[y.default,_.default.Embed,v.default];function x(k){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return k==null||(typeof k.formats=="function"&&(M=(0,u.default)(M,k.formats())),k.parent==null||k.parent.blotName=="scroll"||k.parent.statics.scope!==k.statics.scope)?M:x(k.parent,M)}n.bubbleFormats=x,n.BlockEmbed=E,n.default=P},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},o=function(){function q(A,L){var z=[],I=!0,H=!1,W=void 0;try{for(var V=A[Symbol.iterator](),U;!(I=(U=V.next()).done)&&(z.push(U.value),!(L&&z.length===L));I=!0);}catch(Y){H=!0,W=Y}finally{try{!I&&V.return&&V.return()}finally{if(H)throw W}}return z}return function(A,L){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return q(A,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function q(A,L){for(var z=0;z<L.length;z++){var I=L[z];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(A,I.key,I)}}return function(A,L,z){return L&&q(A.prototype,L),z&&q(A,z),A}}();i(50);var u=i(2),f=x(u),g=i(14),S=x(g),_=i(8),h=x(_),w=i(9),m=x(w),y=i(0),p=x(y),v=i(15),d=x(v),b=i(3),O=x(b),R=i(10),T=x(R),E=i(34),P=x(E);function x(q){return q&&q.__esModule?q:{default:q}}function k(q,A,L){return A in q?Object.defineProperty(q,A,{value:L,enumerable:!0,configurable:!0,writable:!0}):q[A]=L,q}function M(q,A){if(!(q instanceof A))throw new TypeError("Cannot call a class as a function")}var j=(0,T.default)("quill"),B=function(){l(q,null,[{key:"debug",value:function(L){L===!0&&(L="log"),T.default.level(L)}},{key:"find",value:function(L){return L.__quill||p.default.find(L)}},{key:"import",value:function(L){return this.imports[L]==null&&j.error("Cannot import "+L+". Are you sure it was registered?"),this.imports[L]}},{key:"register",value:function(L,z){var I=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof L!="string"){var W=L.attrName||L.blotName;typeof W=="string"?this.register("formats/"+W,L,z):Object.keys(L).forEach(function(V){I.register(V,L[V],z)})}else this.imports[L]!=null&&!H&&j.warn("Overwriting "+L+" with",z),this.imports[L]=z,(L.startsWith("blots/")||L.startsWith("formats/"))&&z.blotName!=="abstract"?p.default.register(z):L.startsWith("modules")&&typeof z.register=="function"&&z.register()}}]);function q(A){var L=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(M(this,q),this.options=$(A,z),this.container=this.options.container,this.container==null)return j.error("Invalid Quill container",A);this.options.debug&&q.debug(this.options.debug);var I=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new h.default,this.scroll=p.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new S.default(this.scroll),this.selection=new d.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(h.default.events.EDITOR_CHANGE,function(W){W===h.default.events.TEXT_CHANGE&&L.root.classList.toggle("ql-blank",L.editor.isBlank())}),this.emitter.on(h.default.events.SCROLL_UPDATE,function(W,V){var U=L.selection.lastRange,Y=U&&U.length===0?U.index:void 0;Z.call(L,function(){return L.editor.update(null,V,Y)},W)});var H=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+I+"<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(q,[{key:"addContainer",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof L=="string"){var I=L;L=document.createElement("div"),L.classList.add(I)}return this.container.insertBefore(L,z),L}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(L,z,I){var H=this,W=K(L,z,I),V=o(W,4);return L=V[0],z=V[1],I=V[3],Z.call(this,function(){return H.editor.deleteText(L,z)},I,L,-1*z)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(L),this.container.classList.toggle("ql-disabled",!L)}},{key:"focus",value:function(){var L=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=L,this.scrollIntoView()}},{key:"format",value:function(L,z){var I=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h.default.sources.API;return Z.call(this,function(){var W=I.getSelection(!0),V=new f.default;if(W==null)return V;if(p.default.query(L,p.default.Scope.BLOCK))V=I.editor.formatLine(W.index,W.length,k({},L,z));else{if(W.length===0)return I.selection.format(L,z),V;V=I.editor.formatText(W.index,W.length,k({},L,z))}return I.setSelection(W,h.default.sources.SILENT),V},H)}},{key:"formatLine",value:function(L,z,I,H,W){var V=this,U=void 0,Y=K(L,z,I,H,W),X=o(Y,4);return L=X[0],z=X[1],U=X[2],W=X[3],Z.call(this,function(){return V.editor.formatLine(L,z,U)},W,L,0)}},{key:"formatText",value:function(L,z,I,H,W){var V=this,U=void 0,Y=K(L,z,I,H,W),X=o(Y,4);return L=X[0],z=X[1],U=X[2],W=X[3],Z.call(this,function(){return V.editor.formatText(L,z,U)},W,L,0)}},{key:"getBounds",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,I=void 0;typeof L=="number"?I=this.selection.getBounds(L,z):I=this.selection.getBounds(L.index,L.length);var H=this.container.getBoundingClientRect();return{bottom:I.bottom-H.top,height:I.height,left:I.left-H.left,right:I.right-H.left,top:I.top-H.top,width:I.width}}},{key:"getContents",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-L,I=K(L,z),H=o(I,2);return L=H[0],z=H[1],this.editor.getContents(L,z)}},{key:"getFormat",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof L=="number"?this.editor.getFormat(L,z):this.editor.getFormat(L.index,L.length)}},{key:"getIndex",value:function(L){return L.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(L){return this.scroll.leaf(L)}},{key:"getLine",value:function(L){return this.scroll.line(L)}},{key:"getLines",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof L!="number"?this.scroll.lines(L.index,L.length):this.scroll.lines(L,z)}},{key:"getModule",value:function(L){return this.theme.modules[L]}},{key:"getSelection",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return L&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-L,I=K(L,z),H=o(I,2);return L=H[0],z=H[1],this.editor.getText(L,z)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(L,z,I){var H=this,W=arguments.length>3&&arguments[3]!==void 0?arguments[3]:q.sources.API;return Z.call(this,function(){return H.editor.insertEmbed(L,z,I)},W,L)}},{key:"insertText",value:function(L,z,I,H,W){var V=this,U=void 0,Y=K(L,0,I,H,W),X=o(Y,4);return L=X[0],U=X[2],W=X[3],Z.call(this,function(){return V.editor.insertText(L,z,U)},W,L,z.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(L,z,I){this.clipboard.dangerouslyPasteHTML(L,z,I)}},{key:"removeFormat",value:function(L,z,I){var H=this,W=K(L,z,I),V=o(W,4);return L=V[0],z=V[1],I=V[3],Z.call(this,function(){return H.editor.removeFormat(L,z)},I,L)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(L){var z=this,I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API;return Z.call(this,function(){L=new f.default(L);var H=z.getLength(),W=z.editor.deleteText(0,H),V=z.editor.applyDelta(L),U=V.ops[V.ops.length-1];U!=null&&typeof U.insert=="string"&&U.insert[U.insert.length-1]===`
|
|
111
|
+
`&&(z.editor.deleteText(z.getLength()-1,1),V.delete(1));var Y=W.compose(V);return Y},I)}},{key:"setSelection",value:function(L,z,I){if(L==null)this.selection.setRange(null,z||q.sources.API);else{var H=K(L,z,I),W=o(H,4);L=W[0],z=W[1],I=W[3],this.selection.setRange(new v.Range(L,z),I),I!==h.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API,I=new f.default().insert(L);return this.setContents(I,z)}},{key:"update",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h.default.sources.USER,z=this.scroll.update(L);return this.selection.update(L),z}},{key:"updateContents",value:function(L){var z=this,I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API;return Z.call(this,function(){return L=new f.default(L),z.editor.applyDelta(L,I)},I,!0)}}]),q}();B.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},B.events=h.default.events,B.sources=h.default.sources,B.version="1.3.7",B.imports={delta:f.default,parchment:p.default,"core/module":m.default,"core/theme":P.default};function $(q,A){if(A=(0,O.default)(!0,{container:q,modules:{clipboard:!0,keyboard:!0,history:!0}},A),!A.theme||A.theme===B.DEFAULTS.theme)A.theme=P.default;else if(A.theme=B.import("themes/"+A.theme),A.theme==null)throw new Error("Invalid theme "+A.theme+". Did you register it?");var L=(0,O.default)(!0,{},A.theme.DEFAULTS);[L,A].forEach(function(H){H.modules=H.modules||{},Object.keys(H.modules).forEach(function(W){H.modules[W]===!0&&(H.modules[W]={})})});var z=Object.keys(L.modules).concat(Object.keys(A.modules)),I=z.reduce(function(H,W){var V=B.import("modules/"+W);return V==null?j.error("Cannot load "+W+" module. Are you sure you registered it?"):H[W]=V.DEFAULTS||{},H},{});return A.modules!=null&&A.modules.toolbar&&A.modules.toolbar.constructor!==Object&&(A.modules.toolbar={container:A.modules.toolbar}),A=(0,O.default)(!0,{},B.DEFAULTS,{modules:I},L,A),["bounds","container","scrollingContainer"].forEach(function(H){typeof A[H]=="string"&&(A[H]=document.querySelector(A[H]))}),A.modules=Object.keys(A.modules).reduce(function(H,W){return A.modules[W]&&(H[W]=A.modules[W]),H},{}),A}function Z(q,A,L,z){if(this.options.strict&&!this.isEnabled()&&A===h.default.sources.USER)return new f.default;var I=L==null?null:this.getSelection(),H=this.editor.delta,W=q();if(I!=null&&(L===!0&&(L=I.index),z==null?I=D(I,W,A):z!==0&&(I=D(I,L,z,A)),this.setSelection(I,h.default.sources.SILENT)),W.length()>0){var V,U=[h.default.events.TEXT_CHANGE,W,H,A];if((V=this.emitter).emit.apply(V,[h.default.events.EDITOR_CHANGE].concat(U)),A!==h.default.sources.SILENT){var Y;(Y=this.emitter).emit.apply(Y,U)}}return W}function K(q,A,L,z,I){var H={};return typeof q.index=="number"&&typeof q.length=="number"?typeof A!="number"?(I=z,z=L,L=A,A=q.length,q=q.index):(A=q.length,q=q.index):typeof A!="number"&&(I=z,z=L,L=A,A=0),(typeof L>"u"?"undefined":a(L))==="object"?(H=L,I=z):typeof L=="string"&&(z!=null?H[L]=z:I=L),I=I||h.default.sources.API,[q,A,H,I]}function D(q,A,L,z){if(q==null)return null;var I=void 0,H=void 0;if(A instanceof f.default){var W=[q.index,q.index+q.length].map(function(X){return A.transformPosition(X,z!==h.default.sources.USER)}),V=o(W,2);I=V[0],H=V[1]}else{var U=[q.index,q.index+q.length].map(function(X){return X<A||X===A&&z===h.default.sources.USER?X:L>=0?X+L:Math.max(A,X+L)}),Y=o(U,2);I=Y[0],H=Y[1]}return new v.Range(I,H-I)}n.expandConfig=$,n.overload=K,n.default=B},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(p,v){for(var d=0;d<v.length;d++){var b=v[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(p,b.key,b)}}return function(p,v,d){return v&&y(p.prototype,v),d&&y(p,d),p}}(),o=function y(p,v,d){p===null&&(p=Function.prototype);var b=Object.getOwnPropertyDescriptor(p,v);if(b===void 0){var O=Object.getPrototypeOf(p);return O===null?void 0:y(O,v,d)}else{if("value"in b)return b.value;var R=b.get;return R===void 0?void 0:R.call(d)}},l=i(7),u=S(l),f=i(0),g=S(f);function S(y){return y&&y.__esModule?y:{default:y}}function _(y,p){if(!(y instanceof p))throw new TypeError("Cannot call a class as a function")}function h(y,p){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:y}function w(y,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);y.prototype=Object.create(p&&p.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(y,p):y.__proto__=p)}var m=function(y){w(p,y);function p(){return _(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"formatAt",value:function(d,b,O,R){if(p.compare(this.statics.blotName,O)<0&&g.default.query(O,g.default.Scope.BLOT)){var T=this.isolate(d,b);R&&T.wrap(O,R)}else o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"formatAt",this).call(this,d,b,O,R)}},{key:"optimize",value:function(d){if(o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"optimize",this).call(this,d),this.parent instanceof p&&p.compare(this.statics.blotName,this.parent.statics.blotName)>0){var b=this.parent.isolate(this.offset(),this.length());this.moveChildren(b),b.wrap(this)}}}],[{key:"compare",value:function(d,b){var O=p.order.indexOf(d),R=p.order.indexOf(b);return O>=0||R>=0?O-R:d===b?0:d<b?-1:1}}]),p}(g.default.Inline);m.allowedChildren=[m,g.default.Embed,u.default],m.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}function u(_,h){if(!(_ instanceof h))throw new TypeError("Cannot call a class as a function")}function f(_,h){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:_}function g(_,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);_.prototype=Object.create(h&&h.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(_,h):_.__proto__=h)}var S=function(_){g(h,_);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default.Text);n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(d,b){for(var O=0;O<b.length;O++){var R=b[O];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(d,R.key,R)}}return function(d,b,O){return b&&v(d.prototype,b),O&&v(d,O),d}}(),o=function v(d,b,O){d===null&&(d=Function.prototype);var R=Object.getOwnPropertyDescriptor(d,b);if(R===void 0){var T=Object.getPrototypeOf(d);return T===null?void 0:v(T,b,O)}else{if("value"in R)return R.value;var E=R.get;return E===void 0?void 0:E.call(O)}},l=i(54),u=S(l),f=i(10),g=S(f);function S(v){return v&&v.__esModule?v:{default:v}}function _(v,d){if(!(v instanceof d))throw new TypeError("Cannot call a class as a function")}function h(v,d){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:v}function w(v,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);v.prototype=Object.create(d&&d.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(v,d):v.__proto__=d)}var m=(0,g.default)("quill:events"),y=["selectionchange","mousedown","mouseup","click"];y.forEach(function(v){document.addEventListener(v,function(){for(var d=arguments.length,b=Array(d),O=0;O<d;O++)b[O]=arguments[O];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(R){if(R.__quill&&R.__quill.emitter){var T;(T=R.__quill.emitter).handleDOM.apply(T,b)}})})});var p=function(v){w(d,v);function d(){_(this,d);var b=h(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return b.listeners={},b.on("error",m.error),b}return a(d,[{key:"emit",value:function(){m.log.apply(m,arguments),o(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(O){for(var R=arguments.length,T=Array(R>1?R-1:0),E=1;E<R;E++)T[E-1]=arguments[E];(this.listeners[O.type]||[]).forEach(function(P){var x=P.node,k=P.handler;(O.target===x||x.contains(O.target))&&k.apply(void 0,[O].concat(T))})}},{key:"listenDOM",value:function(O,R,T){this.listeners[O]||(this.listeners[O]=[]),this.listeners[O].push({node:R,handler:T})}}]),d}(u.default);p.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},p.sources={API:"api",SILENT:"silent",USER:"user"},n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function a(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function l(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,l),this.quill=u,this.options=f};o.DEFAULTS={},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=["error","warn","log","info"],o="warn";function l(f){if(a.indexOf(f)<=a.indexOf(o)){for(var g,S=arguments.length,_=Array(S>1?S-1:0),h=1;h<S;h++)_[h-1]=arguments[h];(g=console)[f].apply(g,_)}}function u(f){return a.reduce(function(g,S){return g[S]=l.bind(console,S,f),g},{})}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(_,h,w){return w||(w={}),_===h?!0:_ instanceof Date&&h instanceof Date?_.getTime()===h.getTime():!_||!h||typeof _!="object"&&typeof h!="object"?w.strict?_===h:_==h:S(_,h,w)};function f(_){return _==null}function g(_){return!(!_||typeof _!="object"||typeof _.length!="number"||typeof _.copy!="function"||typeof _.slice!="function"||_.length>0&&typeof _[0]!="number")}function S(_,h,w){var m,y;if(f(_)||f(h)||_.prototype!==h.prototype)return!1;if(l(_))return l(h)?(_=a.call(_),h=a.call(h),u(_,h,w)):!1;if(g(_)){if(!g(h)||_.length!==h.length)return!1;for(m=0;m<_.length;m++)if(_[m]!==h[m])return!1;return!0}try{var p=o(_),v=o(h)}catch{return!1}if(p.length!=v.length)return!1;for(p.sort(),v.sort(),m=p.length-1;m>=0;m--)if(p[m]!=v[m])return!1;for(m=p.length-1;m>=0;m--)if(y=p[m],!u(_[y],h[y],w))return!1;return typeof _==typeof h}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u,f,g){g===void 0&&(g={}),this.attrName=u,this.keyName=f;var S=a.Scope.TYPE&a.Scope.ATTRIBUTE;g.scope!=null?this.scope=g.scope&a.Scope.LEVEL|S:this.scope=a.Scope.ATTRIBUTE,g.whitelist!=null&&(this.whitelist=g.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 g=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return g==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 E(P,x){var k=[],M=!0,j=!1,B=void 0;try{for(var $=P[Symbol.iterator](),Z;!(M=(Z=$.next()).done)&&(k.push(Z.value),!(x&&k.length===x));M=!0);}catch(K){j=!0,B=K}finally{try{!M&&$.return&&$.return()}finally{if(j)throw B}}return k}return function(P,x){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return E(P,x);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function E(P,x){for(var k=0;k<x.length;k++){var M=x[k];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(P,M.key,M)}}return function(P,x,k){return x&&E(P.prototype,x),k&&E(P,k),P}}(),l=function E(P,x,k){P===null&&(P=Function.prototype);var M=Object.getOwnPropertyDescriptor(P,x);if(M===void 0){var j=Object.getPrototypeOf(P);return j===null?void 0:E(j,x,k)}else{if("value"in M)return M.value;var B=M.get;return B===void 0?void 0:B.call(k)}},u=i(2),f=v(u),g=i(0),S=v(g),_=i(4),h=v(_),w=i(6),m=v(w),y=i(7),p=v(y);function v(E){return E&&E.__esModule?E:{default:E}}function d(E,P){if(!(E instanceof P))throw new TypeError("Cannot call a class as a function")}function b(E,P){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:E}function O(E,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);E.prototype=Object.create(P&&P.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(E,P):E.__proto__=P)}var R=function(E){O(P,E);function P(){return d(this,P),b(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return P}(m.default);R.blotName="code",R.tagName="CODE";var T=function(E){O(P,E);function P(){return d(this,P),b(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return o(P,[{key:"delta",value:function(){var k=this,M=this.domNode.textContent;return M.endsWith(`
|
|
112
|
+
`)&&(M=M.slice(0,-1)),M.split(`
|
|
113
|
+
`).reduce(function(j,B){return j.insert(B).insert(`
|
|
114
|
+
`,k.formats())},new f.default)}},{key:"format",value:function(k,M){if(!(k===this.statics.blotName&&M)){var j=this.descendant(p.default,this.length()-1),B=a(j,1),$=B[0];$!=null&&$.deleteAt($.length()-1,1),l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,k,M)}}},{key:"formatAt",value:function(k,M,j,B){if(M!==0&&!(S.default.query(j,S.default.Scope.BLOCK)==null||j===this.statics.blotName&&B===this.statics.formats(this.domNode))){var $=this.newlineIndex(k);if(!($<0||$>=k+M)){var Z=this.newlineIndex(k,!0)+1,K=$-Z+1,D=this.isolate(Z,K),q=D.next;D.format(j,B),q instanceof P&&q.formatAt(0,k-Z+M-K,j,B)}}}},{key:"insertAt",value:function(k,M,j){if(j==null){var B=this.descendant(p.default,k),$=a(B,2),Z=$[0],K=$[1];Z.insertAt(K,M)}}},{key:"length",value:function(){var k=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
|
115
|
+
`)?k:k+1}},{key:"newlineIndex",value:function(k){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(M)return this.domNode.textContent.slice(0,k).lastIndexOf(`
|
|
116
|
+
`);var j=this.domNode.textContent.slice(k).indexOf(`
|
|
117
|
+
`);return j>-1?k+j:-1}},{key:"optimize",value:function(k){this.domNode.textContent.endsWith(`
|
|
118
|
+
`)||this.appendChild(S.default.create("text",`
|
|
119
|
+
`)),l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,k);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(k),M.moveChildren(this),M.remove())}},{key:"replace",value:function(k){l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replace",this).call(this,k),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(M){var j=S.default.find(M);j==null?M.parentNode.removeChild(M):j instanceof S.default.Embed?j.remove():j.unwrap()})}}],[{key:"create",value:function(k){var M=l(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,k);return M.setAttribute("spellcheck",!1),M}},{key:"formats",value:function(){return!0}}]),P}(h.default);T.blotName="code-block",T.tagName="PRE",T.TAB=" ",n.Code=R,n.default=T},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},o=function(){function q(A,L){var z=[],I=!0,H=!1,W=void 0;try{for(var V=A[Symbol.iterator](),U;!(I=(U=V.next()).done)&&(z.push(U.value),!(L&&z.length===L));I=!0);}catch(Y){H=!0,W=Y}finally{try{!I&&V.return&&V.return()}finally{if(H)throw W}}return z}return function(A,L){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return q(A,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function q(A,L){for(var z=0;z<L.length;z++){var I=L[z];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(A,I.key,I)}}return function(A,L,z){return L&&q(A.prototype,L),z&&q(A,z),A}}(),u=i(2),f=M(u),g=i(20),S=M(g),_=i(0),h=M(_),w=i(13),m=M(w),y=i(24),p=M(y),v=i(4),d=M(v),b=i(16),O=M(b),R=i(21),T=M(R),E=i(11),P=M(E),x=i(3),k=M(x);function M(q){return q&&q.__esModule?q:{default:q}}function j(q,A,L){return A in q?Object.defineProperty(q,A,{value:L,enumerable:!0,configurable:!0,writable:!0}):q[A]=L,q}function B(q,A){if(!(q instanceof A))throw new TypeError("Cannot call a class as a function")}var $=/^[ -~]*$/,Z=function(){function q(A){B(this,q),this.scroll=A,this.delta=this.getDelta()}return l(q,[{key:"applyDelta",value:function(L){var z=this,I=!1;this.scroll.update();var H=this.scroll.length();return this.scroll.batchStart(),L=D(L),L.reduce(function(W,V){var U=V.retain||V.delete||V.insert.length||1,Y=V.attributes||{};if(V.insert!=null){if(typeof V.insert=="string"){var X=V.insert;X.endsWith(`
|
|
120
|
+
`)&&I&&(I=!1,X=X.slice(0,-1)),W>=H&&!X.endsWith(`
|
|
121
|
+
`)&&(I=!0),z.scroll.insertAt(W,X);var Q=z.scroll.line(W),te=o(Q,2),ee=te[0],ne=te[1],ie=(0,k.default)({},(0,v.bubbleFormats)(ee));if(ee instanceof d.default){var le=ee.descendant(h.default.Leaf,ne),xe=o(le,1),Fe=xe[0];ie=(0,k.default)(ie,(0,v.bubbleFormats)(Fe))}Y=S.default.attributes.diff(ie,Y)||{}}else if(a(V.insert)==="object"){var oe=Object.keys(V.insert)[0];if(oe==null)return W;z.scroll.insertAt(W,oe,V.insert[oe])}H+=U}return Object.keys(Y).forEach(function(ue){z.scroll.formatAt(W,U,ue,Y[ue])}),W+U},0),L.reduce(function(W,V){return typeof V.delete=="number"?(z.scroll.deleteAt(W,V.delete),W):W+(V.retain||V.insert.length||1)},0),this.scroll.batchEnd(),this.update(L)}},{key:"deleteText",value:function(L,z){return this.scroll.deleteAt(L,z),this.update(new f.default().retain(L).delete(z))}},{key:"formatLine",value:function(L,z){var I=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(H).forEach(function(W){if(!(I.scroll.whitelist!=null&&!I.scroll.whitelist[W])){var V=I.scroll.lines(L,Math.max(z,1)),U=z;V.forEach(function(Y){var X=Y.length();if(!(Y instanceof m.default))Y.format(W,H[W]);else{var Q=L-Y.offset(I.scroll),te=Y.newlineIndex(Q+U)-Q+1;Y.formatAt(Q,te,W,H[W])}U-=X})}}),this.scroll.optimize(),this.update(new f.default().retain(L).retain(z,(0,T.default)(H)))}},{key:"formatText",value:function(L,z){var I=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(H).forEach(function(W){I.scroll.formatAt(L,z,W,H[W])}),this.update(new f.default().retain(L).retain(z,(0,T.default)(H)))}},{key:"getContents",value:function(L,z){return this.delta.slice(L,L+z)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(L,z){return L.concat(z.delta())},new f.default)}},{key:"getFormat",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,I=[],H=[];z===0?this.scroll.path(L).forEach(function(V){var U=o(V,1),Y=U[0];Y instanceof d.default?I.push(Y):Y instanceof h.default.Leaf&&H.push(Y)}):(I=this.scroll.lines(L,z),H=this.scroll.descendants(h.default.Leaf,L,z));var W=[I,H].map(function(V){if(V.length===0)return{};for(var U=(0,v.bubbleFormats)(V.shift());Object.keys(U).length>0;){var Y=V.shift();if(Y==null)return U;U=K((0,v.bubbleFormats)(Y),U)}return U});return k.default.apply(k.default,W)}},{key:"getText",value:function(L,z){return this.getContents(L,z).filter(function(I){return typeof I.insert=="string"}).map(function(I){return I.insert}).join("")}},{key:"insertEmbed",value:function(L,z,I){return this.scroll.insertAt(L,z,I),this.update(new f.default().retain(L).insert(j({},z,I)))}},{key:"insertText",value:function(L,z){var I=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return z=z.replace(/\r\n/g,`
|
|
122
|
+
`).replace(/\r/g,`
|
|
123
|
+
`),this.scroll.insertAt(L,z),Object.keys(H).forEach(function(W){I.scroll.formatAt(L,z.length,W,H[W])}),this.update(new f.default().retain(L).insert(z,(0,T.default)(H)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var L=this.scroll.children.head;return L.statics.blotName!==d.default.blotName||L.children.length>1?!1:L.children.head instanceof O.default}},{key:"removeFormat",value:function(L,z){var I=this.getText(L,z),H=this.scroll.line(L+z),W=o(H,2),V=W[0],U=W[1],Y=0,X=new f.default;V!=null&&(V instanceof m.default?Y=V.newlineIndex(U)-U+1:Y=V.length()-U,X=V.delta().slice(U,U+Y-1).insert(`
|
|
124
|
+
`));var Q=this.getContents(L,z+Y),te=Q.diff(new f.default().insert(I).concat(X)),ee=new f.default().retain(L).concat(te);return this.applyDelta(ee)}},{key:"update",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,H=this.delta;if(z.length===1&&z[0].type==="characterData"&&z[0].target.data.match($)&&h.default.find(z[0].target)){var W=h.default.find(z[0].target),V=(0,v.bubbleFormats)(W),U=W.offset(this.scroll),Y=z[0].oldValue.replace(p.default.CONTENTS,""),X=new f.default().insert(Y),Q=new f.default().insert(W.value()),te=new f.default().retain(U).concat(X.diff(Q,I));L=te.reduce(function(ee,ne){return ne.insert?ee.insert(ne.insert,V):ee.push(ne)},new f.default),this.delta=H.compose(L)}else this.delta=this.getDelta(),(!L||!(0,P.default)(H.compose(L),this.delta))&&(L=H.diff(this.delta,I));return L}}]),q}();function K(q,A){return Object.keys(A).reduce(function(L,z){return q[z]==null||(A[z]===q[z]?L[z]=A[z]:Array.isArray(A[z])?A[z].indexOf(q[z])<0&&(L[z]=A[z].concat([q[z]])):L[z]=[A[z],q[z]]),L},{})}function D(q){return q.reduce(function(A,L){if(L.insert===1){var z=(0,T.default)(L.attributes);return delete z.image,A.insert({image:L.attributes.image},z)}if(L.attributes!=null&&(L.attributes.list===!0||L.attributes.bullet===!0)&&(L=(0,T.default)(L),L.attributes.list?L.attributes.list="ordered":(L.attributes.list="bullet",delete L.attributes.bullet)),typeof L.insert=="string"){var I=L.insert.replace(/\r\n/g,`
|
|
125
|
+
`).replace(/\r/g,`
|
|
126
|
+
`);return A.insert(I,L.attributes)}return A.push(L)},new f.default)}n.default=Z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function E(P,x){var k=[],M=!0,j=!1,B=void 0;try{for(var $=P[Symbol.iterator](),Z;!(M=(Z=$.next()).done)&&(k.push(Z.value),!(x&&k.length===x));M=!0);}catch(K){j=!0,B=K}finally{try{!M&&$.return&&$.return()}finally{if(j)throw B}}return k}return function(P,x){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return E(P,x);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function E(P,x){for(var k=0;k<x.length;k++){var M=x[k];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(P,M.key,M)}}return function(P,x,k){return x&&E(P.prototype,x),k&&E(P,k),P}}(),l=i(0),u=p(l),f=i(21),g=p(f),S=i(11),_=p(S),h=i(8),w=p(h),m=i(10),y=p(m);function p(E){return E&&E.__esModule?E:{default:E}}function v(E){if(Array.isArray(E)){for(var P=0,x=Array(E.length);P<E.length;P++)x[P]=E[P];return x}else return Array.from(E)}function d(E,P){if(!(E instanceof P))throw new TypeError("Cannot call a class as a function")}var b=(0,y.default)("quill:selection"),O=function E(P){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,E),this.index=P,this.length=x},R=function(){function E(P,x){var k=this;d(this,E),this.emitter=x,this.scroll=P,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new O(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){k.mouseDown||setTimeout(k.update.bind(k,w.default.sources.USER),1)}),this.emitter.on(w.default.events.EDITOR_CHANGE,function(M,j){M===w.default.events.TEXT_CHANGE&&j.length()>0&&k.update(w.default.sources.SILENT)}),this.emitter.on(w.default.events.SCROLL_BEFORE_UPDATE,function(){if(k.hasFocus()){var M=k.getNativeRange();M!=null&&M.start.node!==k.cursor.textNode&&k.emitter.once(w.default.events.SCROLL_UPDATE,function(){try{k.setNativeRange(M.start.node,M.start.offset,M.end.node,M.end.offset)}catch{}})}}),this.emitter.on(w.default.events.SCROLL_OPTIMIZE,function(M,j){if(j.range){var B=j.range,$=B.startNode,Z=B.startOffset,K=B.endNode,D=B.endOffset;k.setNativeRange($,Z,K,D)}}),this.update(w.default.sources.SILENT)}return o(E,[{key:"handleComposition",value:function(){var x=this;this.root.addEventListener("compositionstart",function(){x.composing=!0}),this.root.addEventListener("compositionend",function(){if(x.composing=!1,x.cursor.parent){var k=x.cursor.restore();if(!k)return;setTimeout(function(){x.setNativeRange(k.startNode,k.startOffset,k.endNode,k.endOffset)},1)}})}},{key:"handleDragging",value:function(){var x=this;this.emitter.listenDOM("mousedown",document.body,function(){x.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){x.mouseDown=!1,x.update(w.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(x,k){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[x])){this.scroll.update();var M=this.getNativeRange();if(!(M==null||!M.native.collapsed||u.default.query(x,u.default.Scope.BLOCK))){if(M.start.node!==this.cursor.textNode){var j=u.default.find(M.start.node,!1);if(j==null)return;if(j instanceof u.default.Leaf){var B=j.split(M.start.offset);j.parent.insertBefore(this.cursor,B)}else j.insertBefore(this.cursor,M.start.node);this.cursor.attach()}this.cursor.format(x,k),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(x){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,M=this.scroll.length();x=Math.min(x,M-1),k=Math.min(x+k,M-1)-x;var j=void 0,B=this.scroll.leaf(x),$=a(B,2),Z=$[0],K=$[1];if(Z==null)return null;var D=Z.position(K,!0),q=a(D,2);j=q[0],K=q[1];var A=document.createRange();if(k>0){A.setStart(j,K);var L=this.scroll.leaf(x+k),z=a(L,2);if(Z=z[0],K=z[1],Z==null)return null;var I=Z.position(K,!0),H=a(I,2);return j=H[0],K=H[1],A.setEnd(j,K),A.getBoundingClientRect()}else{var W="left",V=void 0;return j instanceof Text?(K<j.data.length?(A.setStart(j,K),A.setEnd(j,K+1)):(A.setStart(j,K-1),A.setEnd(j,K),W="right"),V=A.getBoundingClientRect()):(V=Z.domNode.getBoundingClientRect(),K>0&&(W="right")),{bottom:V.top+V.height,height:V.height,left:V[W],right:V[W],top:V.top,width:0}}}},{key:"getNativeRange",value:function(){var x=document.getSelection();if(x==null||x.rangeCount<=0)return null;var k=x.getRangeAt(0);if(k==null)return null;var M=this.normalizeNative(k);return b.info("getNativeRange",M),M}},{key:"getRange",value:function(){var x=this.getNativeRange();if(x==null)return[null,null];var k=this.normalizedToRange(x);return[k,x]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(x){var k=this,M=[[x.start.node,x.start.offset]];x.native.collapsed||M.push([x.end.node,x.end.offset]);var j=M.map(function(Z){var K=a(Z,2),D=K[0],q=K[1],A=u.default.find(D,!0),L=A.offset(k.scroll);return q===0?L:A instanceof u.default.Container?L+A.length():L+A.index(D,q)}),B=Math.min(Math.max.apply(Math,v(j)),this.scroll.length()-1),$=Math.min.apply(Math,[B].concat(v(j)));return new O($,B-$)}},{key:"normalizeNative",value:function(x){if(!T(this.root,x.startContainer)||!x.collapsed&&!T(this.root,x.endContainer))return null;var k={start:{node:x.startContainer,offset:x.startOffset},end:{node:x.endContainer,offset:x.endOffset},native:x};return[k.start,k.end].forEach(function(M){for(var j=M.node,B=M.offset;!(j instanceof Text)&&j.childNodes.length>0;)if(j.childNodes.length>B)j=j.childNodes[B],B=0;else if(j.childNodes.length===B)j=j.lastChild,B=j instanceof Text?j.data.length:j.childNodes.length+1;else break;M.node=j,M.offset=B}),k}},{key:"rangeToNative",value:function(x){var k=this,M=x.collapsed?[x.index]:[x.index,x.index+x.length],j=[],B=this.scroll.length();return M.forEach(function($,Z){$=Math.min(B-1,$);var K=void 0,D=k.scroll.leaf($),q=a(D,2),A=q[0],L=q[1],z=A.position(L,Z!==0),I=a(z,2);K=I[0],L=I[1],j.push(K,L)}),j.length<2&&(j=j.concat(j)),j}},{key:"scrollIntoView",value:function(x){var k=this.lastRange;if(k!=null){var M=this.getBounds(k.index,k.length);if(M!=null){var j=this.scroll.length()-1,B=this.scroll.line(Math.min(k.index,j)),$=a(B,1),Z=$[0],K=Z;if(k.length>0){var D=this.scroll.line(Math.min(k.index+k.length,j)),q=a(D,1);K=q[0]}if(!(Z==null||K==null)){var A=x.getBoundingClientRect();M.top<A.top?x.scrollTop-=A.top-M.top:M.bottom>A.bottom&&(x.scrollTop+=M.bottom-A.bottom)}}}}},{key:"setNativeRange",value:function(x,k){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:x,j=arguments.length>3&&arguments[3]!==void 0?arguments[3]:k,B=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(b.info("setNativeRange",x,k,M,j),!(x!=null&&(this.root.parentNode==null||x.parentNode==null||M.parentNode==null))){var $=document.getSelection();if($!=null)if(x!=null){this.hasFocus()||this.root.focus();var Z=(this.getNativeRange()||{}).native;if(Z==null||B||x!==Z.startContainer||k!==Z.startOffset||M!==Z.endContainer||j!==Z.endOffset){x.tagName=="BR"&&(k=[].indexOf.call(x.parentNode.childNodes,x),x=x.parentNode),M.tagName=="BR"&&(j=[].indexOf.call(M.parentNode.childNodes,M),M=M.parentNode);var K=document.createRange();K.setStart(x,k),K.setEnd(M,j),$.removeAllRanges(),$.addRange(K)}}else $.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(x){var k=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 k=="string"&&(M=k,k=!1),b.info("setRange",x),x!=null){var j=this.rangeToNative(x);this.setNativeRange.apply(this,v(j).concat([k]))}else this.setNativeRange(null);this.update(M)}},{key:"update",value:function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w.default.sources.USER,k=this.lastRange,M=this.getRange(),j=a(M,2),B=j[0],$=j[1];if(this.lastRange=B,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,_.default)(k,this.lastRange)){var Z;!this.composing&&$!=null&&$.native.collapsed&&$.start.node!==this.cursor.textNode&&this.cursor.restore();var K=[w.default.events.SELECTION_CHANGE,(0,g.default)(this.lastRange),(0,g.default)(k),x];if((Z=this.emitter).emit.apply(Z,[w.default.events.EDITOR_CHANGE].concat(K)),x!==w.default.sources.SILENT){var D;(D=this.emitter).emit.apply(D,K)}}}}]),E}();function T(E,P){try{P.parentNode}catch{return!1}return P instanceof Text&&(P=P.parentNode),E.contains(P)}n.Range=O,n.default=R},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function w(m,y){for(var p=0;p<y.length;p++){var v=y[p];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(m,v.key,v)}}return function(m,y,p){return y&&w(m.prototype,y),p&&w(m,p),m}}(),o=function w(m,y,p){m===null&&(m=Function.prototype);var v=Object.getOwnPropertyDescriptor(m,y);if(v===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:w(d,y,p)}else{if("value"in v)return v.value;var b=v.get;return b===void 0?void 0:b.call(p)}},l=i(0),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function g(w,m){if(!(w instanceof m))throw new TypeError("Cannot call a class as a function")}function S(w,m){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:w}function _(w,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);w.prototype=Object.create(m&&m.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(w,m):w.__proto__=m)}var h=function(w){_(m,w);function m(){return g(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"insertInto",value:function(p,v){p.children.length===0?o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"insertInto",this).call(this,p,v):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),m}(u.default.Embed);h.blotName="break",h.tagName="BR",n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,h){_.__proto__=h}||function(_,h){for(var w in h)h.hasOwnProperty(w)&&(_[w]=h[w])};return function(_,h){S(_,h);function w(){this.constructor=_}_.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(S){a(_,S);function _(h){var w=S.call(this,h)||this;return w.build(),w}return _.prototype.appendChild=function(h){this.insertBefore(h)},_.prototype.attach=function(){S.prototype.attach.call(this),this.children.forEach(function(h){h.attach()})},_.prototype.build=function(){var h=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(w){try{var m=g(w);h.insertBefore(m,h.children.head||void 0)}catch(y){if(y instanceof u.ParchmentError)return;throw y}})},_.prototype.deleteAt=function(h,w){if(h===0&&w===this.length())return this.remove();this.children.forEachAt(h,w,function(m,y,p){m.deleteAt(y,p)})},_.prototype.descendant=function(h,w){var m=this.children.find(w),y=m[0],p=m[1];return h.blotName==null&&h(y)||h.blotName!=null&&y instanceof h?[y,p]:y instanceof _?y.descendant(h,p):[null,-1]},_.prototype.descendants=function(h,w,m){w===void 0&&(w=0),m===void 0&&(m=Number.MAX_VALUE);var y=[],p=m;return this.children.forEachAt(w,m,function(v,d,b){(h.blotName==null&&h(v)||h.blotName!=null&&v instanceof h)&&y.push(v),v instanceof _&&(y=y.concat(v.descendants(h,d,p))),p-=b}),y},_.prototype.detach=function(){this.children.forEach(function(h){h.detach()}),S.prototype.detach.call(this)},_.prototype.formatAt=function(h,w,m,y){this.children.forEachAt(h,w,function(p,v,d){p.formatAt(v,d,m,y)})},_.prototype.insertAt=function(h,w,m){var y=this.children.find(h),p=y[0],v=y[1];if(p)p.insertAt(v,w,m);else{var d=m==null?u.create("text",w):u.create(w,m);this.appendChild(d)}},_.prototype.insertBefore=function(h,w){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(m){return h instanceof m}))throw new u.ParchmentError("Cannot insert "+h.statics.blotName+" into "+this.statics.blotName);h.insertInto(this,w)},_.prototype.length=function(){return this.children.reduce(function(h,w){return h+w.length()},0)},_.prototype.moveChildren=function(h,w){this.children.forEach(function(m){h.insertBefore(m,w)})},_.prototype.optimize=function(h){if(S.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()},_.prototype.path=function(h,w){w===void 0&&(w=!1);var m=this.children.find(h,w),y=m[0],p=m[1],v=[[this,h]];return y instanceof _?v.concat(y.path(p,w)):(y!=null&&v.push([y,p]),v)},_.prototype.removeChild=function(h){this.children.remove(h)},_.prototype.replace=function(h){h instanceof _&&h.moveChildren(this),S.prototype.replace.call(this,h)},_.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 m=this.clone();return this.parent.insertBefore(m,this.next),this.children.forEachAt(h,this.length(),function(y,p,v){y=y.split(p,w),m.appendChild(y)}),m},_.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},_.prototype.update=function(h,w){var m=this,y=[],p=[];h.forEach(function(v){v.target===m.domNode&&v.type==="childList"&&(y.push.apply(y,v.addedNodes),p.push.apply(p,v.removedNodes))}),p.forEach(function(v){if(!(v.parentNode!=null&&v.tagName!=="IFRAME"&&document.body.compareDocumentPosition(v)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var d=u.find(v);d!=null&&(d.domNode.parentNode==null||d.domNode.parentNode===m.domNode)&&d.detach()}}),y.filter(function(v){return v.parentNode==m.domNode}).sort(function(v,d){return v===d?0:v.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(v){var d=null;v.nextSibling!=null&&(d=u.find(v.nextSibling));var b=g(v);(b.next!=d||b.next==null)&&(b.parent!=null&&b.parent.removeChild(m),m.insertBefore(b,d||void 0))})},_}(l.default);function g(S){var _=u.find(S);if(_==null)try{_=u.create(S)}catch{_=u.create(u.Scope.INLINE),[].slice.call(S.childNodes).forEach(function(w){_.domNode.appendChild(w)}),S.parentNode&&S.parentNode.replaceChild(_.domNode,S),_.attach()}return _}n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,h){_.__proto__=h}||function(_,h){for(var w in h)h.hasOwnProperty(w)&&(_[w]=h[w])};return function(_,h){S(_,h);function w(){this.constructor=_}_.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),g=function(S){a(_,S);function _(h){var w=S.call(this,h)||this;return w.attributes=new l.default(w.domNode),w}return _.formats=function(h){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return h.tagName.toLowerCase()},_.prototype.format=function(h,w){var m=f.query(h);m instanceof o.default?this.attributes.attribute(m,w):w&&m!=null&&(h!==this.statics.blotName||this.formats()[h]!==w)&&this.replaceWith(h,w)},_.prototype.formats=function(){var h=this.attributes.values(),w=this.statics.formats(this.domNode);return w!=null&&(h[this.statics.blotName]=w),h},_.prototype.replaceWith=function(h,w){var m=S.prototype.replaceWith.call(this,h,w);return this.attributes.copy(m),m},_.prototype.update=function(h,w){var m=this;S.prototype.update.call(this,h,w),h.some(function(y){return y.target===m.domNode&&y.type==="attributes"})&&this.attributes.build()},_.prototype.wrap=function(h,w){var m=S.prototype.wrap.call(this,h,w);return m instanceof _&&m.statics.scope===this.statics.scope&&this.attributes.move(m),m},_}(u.default);n.default=g},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var _ in S)S.hasOwnProperty(_)&&(g[_]=S[_])};return function(g,S){f(g,S);function _(){this.constructor=g}g.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),l=i(1),u=function(f){a(g,f);function g(){return f!==null&&f.apply(this,arguments)||this}return g.value=function(S){return!0},g.prototype.index=function(S,_){return this.domNode===S||this.domNode.compareDocumentPosition(S)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(_,1):-1},g.prototype.position=function(S,_){var h=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return S>0&&(h+=1),[this.parent.domNode,h]},g.prototype.value=function(){var S;return S={},S[this.statics.blotName]=this.statics.value(this.domNode)||!0,S},g.scope=l.Scope.INLINE_BLOT,g}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),l={attributes:{compose:function(f,g,S){typeof f!="object"&&(f={}),typeof g!="object"&&(g={});var _=o(!0,{},g);S||(_=Object.keys(_).reduce(function(w,m){return _[m]!=null&&(w[m]=_[m]),w},{}));for(var h in f)f[h]!==void 0&&g[h]===void 0&&(_[h]=f[h]);return Object.keys(_).length>0?_:void 0},diff:function(f,g){typeof f!="object"&&(f={}),typeof g!="object"&&(g={});var S=Object.keys(f).concat(Object.keys(g)).reduce(function(_,h){return a(f[h],g[h])||(_[h]=g[h]===void 0?null:g[h]),_},{});return Object.keys(S).length>0?S:void 0},transform:function(f,g,S){if(typeof f!="object")return g;if(typeof g=="object"){if(!S)return g;var _=Object.keys(g).reduce(function(h,w){return f[w]===void 0&&(h[w]=g[w]),h},{});return Object.keys(_).length>0?_: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 g=this.ops[this.index];if(g){var S=this.offset,_=l.length(g);if(f>=_-S?(f=_-S,this.index+=1,this.offset=0):this.offset+=f,typeof g.delete=="number")return{delete:f};var h={};return g.attributes&&(h.attributes=g.attributes),typeof g.retain=="number"?h.retain=f:typeof g.insert=="string"?h.insert=g.insert.substr(S,f):h.insert=g.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,g=this.index,S=this.next(),_=this.ops.slice(this.index);return this.offset=f,this.index=g,[S].concat(_)}else return[]},r.exports=l},function(r,n){var i=function(){function a(m,y){return y!=null&&m instanceof y}var o;try{o=Map}catch{o=function(){}}var l;try{l=Set}catch{l=function(){}}var u;try{u=Promise}catch{u=function(){}}function f(m,y,p,v,d){typeof y=="object"&&(p=y.depth,v=y.prototype,d=y.includeNonEnumerable,y=y.circular);var b=[],O=[],R=typeof Buffer<"u";typeof y>"u"&&(y=!0),typeof p>"u"&&(p=1/0);function T(E,P){if(E===null)return null;if(P===0)return E;var x,k;if(typeof E!="object")return E;if(a(E,o))x=new o;else if(a(E,l))x=new l;else if(a(E,u))x=new u(function(A,L){E.then(function(z){A(T(z,P-1))},function(z){L(T(z,P-1))})});else if(f.__isArray(E))x=[];else if(f.__isRegExp(E))x=new RegExp(E.source,w(E)),E.lastIndex&&(x.lastIndex=E.lastIndex);else if(f.__isDate(E))x=new Date(E.getTime());else{if(R&&Buffer.isBuffer(E))return Buffer.allocUnsafe?x=Buffer.allocUnsafe(E.length):x=new Buffer(E.length),E.copy(x),x;a(E,Error)?x=Object.create(E):typeof v>"u"?(k=Object.getPrototypeOf(E),x=Object.create(k)):(x=Object.create(v),k=v)}if(y){var M=b.indexOf(E);if(M!=-1)return O[M];b.push(E),O.push(x)}a(E,o)&&E.forEach(function(A,L){var z=T(L,P-1),I=T(A,P-1);x.set(z,I)}),a(E,l)&&E.forEach(function(A){var L=T(A,P-1);x.add(L)});for(var j in E){var B;k&&(B=Object.getOwnPropertyDescriptor(k,j)),!(B&&B.set==null)&&(x[j]=T(E[j],P-1))}if(Object.getOwnPropertySymbols)for(var $=Object.getOwnPropertySymbols(E),j=0;j<$.length;j++){var Z=$[j],K=Object.getOwnPropertyDescriptor(E,Z);K&&!K.enumerable&&!d||(x[Z]=T(E[Z],P-1),K.enumerable||Object.defineProperty(x,Z,{enumerable:!1}))}if(d)for(var D=Object.getOwnPropertyNames(E),j=0;j<D.length;j++){var q=D[j],K=Object.getOwnPropertyDescriptor(E,q);K&&K.enumerable||(x[q]=T(E[q],P-1),Object.defineProperty(x,q,{enumerable:!1}))}return x}return T(m,p)}f.clonePrototype=function(y){if(y===null)return null;var p=function(){};return p.prototype=y,new p};function g(m){return Object.prototype.toString.call(m)}f.__objToStr=g;function S(m){return typeof m=="object"&&g(m)==="[object Date]"}f.__isDate=S;function _(m){return typeof m=="object"&&g(m)==="[object Array]"}f.__isArray=_;function h(m){return typeof m=="object"&&g(m)==="[object RegExp]"}f.__isRegExp=h;function w(m){var y="";return m.global&&(y+="g"),m.ignoreCase&&(y+="i"),m.multiline&&(y+="m"),y}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 x(k,M){var j=[],B=!0,$=!1,Z=void 0;try{for(var K=k[Symbol.iterator](),D;!(B=(D=K.next()).done)&&(j.push(D.value),!(M&&j.length===M));B=!0);}catch(q){$=!0,Z=q}finally{try{!B&&K.return&&K.return()}finally{if($)throw Z}}return j}return function(k,M){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return x(k,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function x(k,M){for(var j=0;j<M.length;j++){var B=M[j];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(k,B.key,B)}}return function(k,M,j){return M&&x(k.prototype,M),j&&x(k,j),k}}(),l=function x(k,M,j){k===null&&(k=Function.prototype);var B=Object.getOwnPropertyDescriptor(k,M);if(B===void 0){var $=Object.getPrototypeOf(k);return $===null?void 0:x($,M,j)}else{if("value"in B)return B.value;var Z=B.get;return Z===void 0?void 0:Z.call(j)}},u=i(0),f=b(u),g=i(8),S=b(g),_=i(4),h=b(_),w=i(16),m=b(w),y=i(13),p=b(y),v=i(25),d=b(v);function b(x){return x&&x.__esModule?x:{default:x}}function O(x,k){if(!(x instanceof k))throw new TypeError("Cannot call a class as a function")}function R(x,k){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:x}function T(x,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);x.prototype=Object.create(k&&k.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(x,k):x.__proto__=k)}function E(x){return x instanceof h.default||x instanceof _.BlockEmbed}var P=function(x){T(k,x);function k(M,j){O(this,k);var B=R(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,M));return B.emitter=j.emitter,Array.isArray(j.whitelist)&&(B.whitelist=j.whitelist.reduce(function($,Z){return $[Z]=!0,$},{})),B.domNode.addEventListener("DOMNodeInserted",function(){}),B.optimize(),B.enable(),B}return o(k,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(j,B){var $=this.line(j),Z=a($,2),K=Z[0],D=Z[1],q=this.line(j+B),A=a(q,1),L=A[0];if(l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"deleteAt",this).call(this,j,B),L!=null&&K!==L&&D>0){if(K instanceof _.BlockEmbed||L instanceof _.BlockEmbed){this.optimize();return}if(K instanceof p.default){var z=K.newlineIndex(K.length(),!0);if(z>-1&&(K=K.split(z+1),K===L)){this.optimize();return}}else if(L instanceof p.default){var I=L.newlineIndex(0);I>-1&&L.split(I+1)}var H=L.children.head instanceof m.default?null:L.children.head;K.moveChildren(L,H),K.remove()}this.optimize()}},{key:"enable",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",j)}},{key:"formatAt",value:function(j,B,$,Z){this.whitelist!=null&&!this.whitelist[$]||(l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"formatAt",this).call(this,j,B,$,Z),this.optimize())}},{key:"insertAt",value:function(j,B,$){if(!($!=null&&this.whitelist!=null&&!this.whitelist[B])){if(j>=this.length())if($==null||f.default.query(B,f.default.Scope.BLOCK)==null){var Z=f.default.create(this.statics.defaultChild);this.appendChild(Z),$==null&&B.endsWith(`
|
|
127
|
+
`)&&(B=B.slice(0,-1)),Z.insertAt(0,B,$)}else{var K=f.default.create(B,$);this.appendChild(K)}else l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertAt",this).call(this,j,B,$);this.optimize()}}},{key:"insertBefore",value:function(j,B){if(j.statics.scope===f.default.Scope.INLINE_BLOT){var $=f.default.create(this.statics.defaultChild);$.appendChild(j),j=$}l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertBefore",this).call(this,j,B)}},{key:"leaf",value:function(j){return this.path(j).pop()||[null,-1]}},{key:"line",value:function(j){return j===this.length()?this.line(j-1):this.descendant(E,j)}},{key:"lines",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,$=function Z(K,D,q){var A=[],L=q;return K.children.forEachAt(D,q,function(z,I,H){E(z)?A.push(z):z instanceof f.default.Container&&(A=A.concat(Z(z,I,L))),L-=H}),A};return $(this,j,B)}},{key:"optimize",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"optimize",this).call(this,j,B),j.length>0&&this.emitter.emit(S.default.events.SCROLL_OPTIMIZE,j,B))}},{key:"path",value:function(j){return l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"path",this).call(this,j).slice(1)}},{key:"update",value:function(j){if(this.batch!==!0){var B=S.default.sources.USER;typeof j=="string"&&(B=j),Array.isArray(j)||(j=this.observer.takeRecords()),j.length>0&&this.emitter.emit(S.default.events.SCROLL_BEFORE_UPDATE,B,j),l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"update",this).call(this,j.concat([])),j.length>0&&this.emitter.emit(S.default.events.SCROLL_UPDATE,B,j)}}}]),k}(f.default.Scroll);P.blotName="scroll",P.className="ql-editor",P.tagName="DIV",P.defaultChild="block",P.allowedChildren=[h.default,_.BlockEmbed,d.default],n.default=P},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},o=function(){function V(U,Y){var X=[],Q=!0,te=!1,ee=void 0;try{for(var ne=U[Symbol.iterator](),ie;!(Q=(ie=ne.next()).done)&&(X.push(ie.value),!(Y&&X.length===Y));Q=!0);}catch(le){te=!0,ee=le}finally{try{!Q&&ne.return&&ne.return()}finally{if(te)throw ee}}return X}return function(U,Y){if(Array.isArray(U))return U;if(Symbol.iterator in Object(U))return V(U,Y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function V(U,Y){for(var X=0;X<Y.length;X++){var Q=Y[X];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(U,Q.key,Q)}}return function(U,Y,X){return Y&&V(U.prototype,Y),X&&V(U,X),U}}(),u=i(21),f=x(u),g=i(11),S=x(g),_=i(3),h=x(_),w=i(2),m=x(w),y=i(20),p=x(y),v=i(0),d=x(v),b=i(5),O=x(b),R=i(10),T=x(R),E=i(9),P=x(E);function x(V){return V&&V.__esModule?V:{default:V}}function k(V,U,Y){return U in V?Object.defineProperty(V,U,{value:Y,enumerable:!0,configurable:!0,writable:!0}):V[U]=Y,V}function M(V,U){if(!(V instanceof U))throw new TypeError("Cannot call a class as a function")}function j(V,U){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:V}function B(V,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);V.prototype=Object.create(U&&U.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(V,U):V.__proto__=U)}var $=(0,T.default)("quill:keyboard"),Z=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",K=function(V){B(U,V),l(U,null,[{key:"match",value:function(X,Q){return Q=W(Q),["altKey","ctrlKey","metaKey","shiftKey"].some(function(te){return!!Q[te]!==X[te]&&Q[te]!==null})?!1:Q.key===(X.which||X.keyCode)}}]);function U(Y,X){M(this,U);var Q=j(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,Y,X));return Q.bindings={},Object.keys(Q.options.bindings).forEach(function(te){te==="list autofill"&&Y.scroll.whitelist!=null&&!Y.scroll.whitelist.list||Q.options.bindings[te]&&Q.addBinding(Q.options.bindings[te])}),Q.addBinding({key:U.keys.ENTER,shiftKey:null},z),Q.addBinding({key:U.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(Q.addBinding({key:U.keys.BACKSPACE},{collapsed:!0},q),Q.addBinding({key:U.keys.DELETE},{collapsed:!0},A)):(Q.addBinding({key:U.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},q),Q.addBinding({key:U.keys.DELETE},{collapsed:!0,suffix:/^.?$/},A)),Q.addBinding({key:U.keys.BACKSPACE},{collapsed:!1},L),Q.addBinding({key:U.keys.DELETE},{collapsed:!1},L),Q.addBinding({key:U.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},q),Q.listen(),Q}return l(U,[{key:"addBinding",value:function(X){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ee=W(X);if(ee==null||ee.key==null)return $.warn("Attempted to add invalid keyboard binding",ee);typeof Q=="function"&&(Q={handler:Q}),typeof te=="function"&&(te={handler:te}),ee=(0,h.default)(ee,Q,te),this.bindings[ee.key]=this.bindings[ee.key]||[],this.bindings[ee.key].push(ee)}},{key:"listen",value:function(){var X=this;this.quill.root.addEventListener("keydown",function(Q){if(!Q.defaultPrevented){var te=Q.which||Q.keyCode,ee=(X.bindings[te]||[]).filter(function($e){return U.match(Q,$e)});if(ee.length!==0){var ne=X.quill.getSelection();if(!(ne==null||!X.quill.hasFocus())){var ie=X.quill.getLine(ne.index),le=o(ie,2),xe=le[0],Fe=le[1],oe=X.quill.getLeaf(ne.index),ue=o(oe,2),ve=ue[0],Ee=ue[1],re=ne.length===0?[ve,Ee]:X.quill.getLeaf(ne.index+ne.length),de=o(re,2),me=de[0],Se=de[1],Te=ve instanceof d.default.Text?ve.value().slice(0,Ee):"",ze=me instanceof d.default.Text?me.value().slice(Se):"",Re={collapsed:ne.length===0,empty:ne.length===0&&xe.length()<=1,format:X.quill.getFormat(ne),offset:Fe,prefix:Te,suffix:ze},Ne=ee.some(function($e){if($e.collapsed!=null&&$e.collapsed!==Re.collapsed||$e.empty!=null&&$e.empty!==Re.empty||$e.offset!=null&&$e.offset!==Re.offset)return!1;if(Array.isArray($e.format)){if($e.format.every(function(Ge){return Re.format[Ge]==null}))return!1}else if(a($e.format)==="object"&&!Object.keys($e.format).every(function(Ge){return $e.format[Ge]===!0?Re.format[Ge]!=null:$e.format[Ge]===!1?Re.format[Ge]==null:(0,S.default)($e.format[Ge],Re.format[Ge])}))return!1;return $e.prefix!=null&&!$e.prefix.test(Re.prefix)||$e.suffix!=null&&!$e.suffix.test(Re.suffix)?!1:$e.handler.call(X,ne,Re)!==!0});Ne&&Q.preventDefault()}}}})}}]),U}(P.default);K.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},K.DEFAULTS={bindings:{bold:H("bold"),italic:H("italic"),underline:H("underline"),indent:{key:K.keys.TAB,format:["blockquote","indent","list"],handler:function(U,Y){if(Y.collapsed&&Y.offset!==0)return!0;this.quill.format("indent","+1",O.default.sources.USER)}},outdent:{key:K.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(U,Y){if(Y.collapsed&&Y.offset!==0)return!0;this.quill.format("indent","-1",O.default.sources.USER)}},"outdent backspace":{key:K.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(U,Y){Y.format.indent!=null?this.quill.format("indent","-1",O.default.sources.USER):Y.format.list!=null&&this.quill.format("list",!1,O.default.sources.USER)}},"indent code-block":I(!0),"outdent code-block":I(!1),"remove tab":{key:K.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(U){this.quill.deleteText(U.index-1,1,O.default.sources.USER)}},tab:{key:K.keys.TAB,handler:function(U){this.quill.history.cutoff();var Y=new m.default().retain(U.index).delete(U.length).insert(" ");this.quill.updateContents(Y,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(U.index+1,O.default.sources.SILENT)}},"list empty enter":{key:K.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(U,Y){this.quill.format("list",!1,O.default.sources.USER),Y.format.indent&&this.quill.format("indent",!1,O.default.sources.USER)}},"checklist enter":{key:K.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(U){var Y=this.quill.getLine(U.index),X=o(Y,2),Q=X[0],te=X[1],ee=(0,h.default)({},Q.formats(),{list:"checked"}),ne=new m.default().retain(U.index).insert(`
|
|
128
|
+
`,ee).retain(Q.length()-te-1).retain(1,{list:"unchecked"});this.quill.updateContents(ne,O.default.sources.USER),this.quill.setSelection(U.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:K.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(U,Y){var X=this.quill.getLine(U.index),Q=o(X,2),te=Q[0],ee=Q[1],ne=new m.default().retain(U.index).insert(`
|
|
129
|
+
`,Y.format).retain(te.length()-ee-1).retain(1,{header:null});this.quill.updateContents(ne,O.default.sources.USER),this.quill.setSelection(U.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(U,Y){var X=Y.prefix.length,Q=this.quill.getLine(U.index),te=o(Q,2),ee=te[0],ne=te[1];if(ne>X)return!0;var ie=void 0;switch(Y.prefix.trim()){case"[]":case"[ ]":ie="unchecked";break;case"[x]":ie="checked";break;case"-":case"*":ie="bullet";break;default:ie="ordered"}this.quill.insertText(U.index," ",O.default.sources.USER),this.quill.history.cutoff();var le=new m.default().retain(U.index-ne).delete(X+1).retain(ee.length()-2-ne).retain(1,{list:ie});this.quill.updateContents(le,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(U.index-X,O.default.sources.SILENT)}},"code exit":{key:K.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(U){var Y=this.quill.getLine(U.index),X=o(Y,2),Q=X[0],te=X[1],ee=new m.default().retain(U.index+Q.length()-te-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(ee,O.default.sources.USER)}},"embed left":D(K.keys.LEFT,!1),"embed left shift":D(K.keys.LEFT,!0),"embed right":D(K.keys.RIGHT,!1),"embed right shift":D(K.keys.RIGHT,!0)}};function D(V,U){var Y,X=V===K.keys.LEFT?"prefix":"suffix";return Y={key:V,shiftKey:U,altKey:null},k(Y,X,/^$/),k(Y,"handler",function(te){var ee=te.index;V===K.keys.RIGHT&&(ee+=te.length+1);var ne=this.quill.getLeaf(ee),ie=o(ne,1),le=ie[0];return le instanceof d.default.Embed?(V===K.keys.LEFT?U?this.quill.setSelection(te.index-1,te.length+1,O.default.sources.USER):this.quill.setSelection(te.index-1,O.default.sources.USER):U?this.quill.setSelection(te.index,te.length+1,O.default.sources.USER):this.quill.setSelection(te.index+te.length+1,O.default.sources.USER),!1):!0}),Y}function q(V,U){if(!(V.index===0||this.quill.getLength()<=1)){var Y=this.quill.getLine(V.index),X=o(Y,1),Q=X[0],te={};if(U.offset===0){var ee=this.quill.getLine(V.index-1),ne=o(ee,1),ie=ne[0];if(ie!=null&&ie.length()>1){var le=Q.formats(),xe=this.quill.getFormat(V.index-1,1);te=p.default.attributes.diff(le,xe)||{}}}var Fe=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(U.prefix)?2:1;this.quill.deleteText(V.index-Fe,Fe,O.default.sources.USER),Object.keys(te).length>0&&this.quill.formatLine(V.index-Fe,Fe,te,O.default.sources.USER),this.quill.focus()}}function A(V,U){var Y=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(U.suffix)?2:1;if(!(V.index>=this.quill.getLength()-Y)){var X={},Q=0,te=this.quill.getLine(V.index),ee=o(te,1),ne=ee[0];if(U.offset>=ne.length()-1){var ie=this.quill.getLine(V.index+1),le=o(ie,1),xe=le[0];if(xe){var Fe=ne.formats(),oe=this.quill.getFormat(V.index,1);X=p.default.attributes.diff(Fe,oe)||{},Q=xe.length()}}this.quill.deleteText(V.index,Y,O.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine(V.index+Q-1,Y,X,O.default.sources.USER)}}function L(V){var U=this.quill.getLines(V),Y={};if(U.length>1){var X=U[0].formats(),Q=U[U.length-1].formats();Y=p.default.attributes.diff(Q,X)||{}}this.quill.deleteText(V,O.default.sources.USER),Object.keys(Y).length>0&&this.quill.formatLine(V.index,1,Y,O.default.sources.USER),this.quill.setSelection(V.index,O.default.sources.SILENT),this.quill.focus()}function z(V,U){var Y=this;V.length>0&&this.quill.scroll.deleteAt(V.index,V.length);var X=Object.keys(U.format).reduce(function(Q,te){return d.default.query(te,d.default.Scope.BLOCK)&&!Array.isArray(U.format[te])&&(Q[te]=U.format[te]),Q},{});this.quill.insertText(V.index,`
|
|
130
|
+
`,X,O.default.sources.USER),this.quill.setSelection(V.index+1,O.default.sources.SILENT),this.quill.focus(),Object.keys(U.format).forEach(function(Q){X[Q]==null&&(Array.isArray(U.format[Q])||Q!=="link"&&Y.quill.format(Q,U.format[Q],O.default.sources.USER))})}function I(V){return{key:K.keys.TAB,shiftKey:!V,format:{"code-block":!0},handler:function(Y){var X=d.default.query("code-block"),Q=Y.index,te=Y.length,ee=this.quill.scroll.descendant(X,Q),ne=o(ee,2),ie=ne[0],le=ne[1];if(ie!=null){var xe=this.quill.getIndex(ie),Fe=ie.newlineIndex(le,!0)+1,oe=ie.newlineIndex(xe+le+te),ue=ie.domNode.textContent.slice(Fe,oe).split(`
|
|
131
|
+
`);le=0,ue.forEach(function(ve,Ee){V?(ie.insertAt(Fe+le,X.TAB),le+=X.TAB.length,Ee===0?Q+=X.TAB.length:te+=X.TAB.length):ve.startsWith(X.TAB)&&(ie.deleteAt(Fe+le,X.TAB.length),le-=X.TAB.length,Ee===0?Q-=X.TAB.length:te-=X.TAB.length),le+=ve.length+1}),this.quill.update(O.default.sources.USER),this.quill.setSelection(Q,te,O.default.sources.SILENT)}}}}function H(V){return{key:V[0].toUpperCase(),shortKey:!0,handler:function(Y,X){this.quill.format(V,!X.format[V],O.default.sources.USER)}}}function W(V){if(typeof V=="string"||typeof V=="number")return W({key:V});if((typeof V>"u"?"undefined":a(V))==="object"&&(V=(0,f.default)(V,!1)),typeof V.key=="string")if(K.keys[V.key.toUpperCase()]!=null)V.key=K.keys[V.key.toUpperCase()];else if(V.key.length===1)V.key=V.key.toUpperCase().charCodeAt(0);else return null;return V.shortKey&&(V[Z]=V.shortKey,delete V.shortKey),V}n.default=K,n.SHORTKEY=Z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(v,d){var b=[],O=!0,R=!1,T=void 0;try{for(var E=v[Symbol.iterator](),P;!(O=(P=E.next()).done)&&(b.push(P.value),!(d&&b.length===d));O=!0);}catch(x){R=!0,T=x}finally{try{!O&&E.return&&E.return()}finally{if(R)throw T}}return b}return function(v,d){if(Array.isArray(v))return v;if(Symbol.iterator in Object(v))return p(v,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function p(v,d,b){v===null&&(v=Function.prototype);var O=Object.getOwnPropertyDescriptor(v,d);if(O===void 0){var R=Object.getPrototypeOf(v);return R===null?void 0:p(R,d,b)}else{if("value"in O)return O.value;var T=O.get;return T===void 0?void 0:T.call(b)}},l=function(){function p(v,d){for(var b=0;b<d.length;b++){var O=d[b];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(v,O.key,O)}}return function(v,d,b){return d&&p(v.prototype,d),b&&p(v,b),v}}(),u=i(0),f=_(u),g=i(7),S=_(g);function _(p){return p&&p.__esModule?p:{default:p}}function h(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function w(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function m(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var y=function(p){m(v,p),l(v,null,[{key:"value",value:function(){}}]);function v(d,b){h(this,v);var O=w(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,d));return O.selection=b,O.textNode=document.createTextNode(v.CONTENTS),O.domNode.appendChild(O.textNode),O._length=0,O}return l(v,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(b,O){if(this._length!==0)return o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,b,O);for(var R=this,T=0;R!=null&&R.statics.scope!==f.default.Scope.BLOCK_BLOT;)T+=R.offset(R.parent),R=R.parent;R!=null&&(this._length=v.CONTENTS.length,R.optimize(),R.formatAt(T,v.CONTENTS.length,b,O),this._length=0)}},{key:"index",value:function(b,O){return b===this.textNode?0:o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"index",this).call(this,b,O)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var b=this.textNode,O=this.selection.getNativeRange(),R=void 0,T=void 0,E=void 0;if(O!=null&&O.start.node===b&&O.end.node===b){var P=[b,O.start.offset,O.end.offset];R=P[0],T=P[1],E=P[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==v.CONTENTS){var x=this.textNode.data.split(v.CONTENTS).join("");this.next instanceof S.default?(R=this.next.domNode,this.next.insertAt(0,x),this.textNode.data=v.CONTENTS):(this.textNode.data=x,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(v.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),T!=null){var k=[T,E].map(function(j){return Math.max(0,Math.min(R.data.length,j-1))}),M=a(k,2);return T=M[0],E=M[1],{startNode:R,startOffset:T,endNode:R,endOffset:E}}}}},{key:"update",value:function(b,O){var R=this;if(b.some(function(E){return E.type==="characterData"&&E.target===R.textNode})){var T=this.restore();T&&(O.range=T)}}},{key:"value",value:function(){return""}}]),v}(f.default.Embed);y.blotName="cursor",y.className="ql-cursor",y.tagName="span",y.CONTENTS="\uFEFF",n.default=y},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 g(w,m){if(!(w instanceof m))throw new TypeError("Cannot call a class as a function")}function S(w,m){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:w}function _(w,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);w.prototype=Object.create(m&&m.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(w,m):w.__proto__=m)}var h=function(w){_(m,w);function m(){return g(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(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 y(p,v){for(var d=0;d<v.length;d++){var b=v[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(p,b.key,b)}}return function(p,v,d){return v&&y(p.prototype,v),d&&y(p,d),p}}(),o=function y(p,v,d){p===null&&(p=Function.prototype);var b=Object.getOwnPropertyDescriptor(p,v);if(b===void 0){var O=Object.getPrototypeOf(p);return O===null?void 0:y(O,v,d)}else{if("value"in b)return b.value;var R=b.get;return R===void 0?void 0:R.call(d)}},l=i(0),u=f(l);function f(y){return y&&y.__esModule?y:{default:y}}function g(y,p){if(!(y instanceof p))throw new TypeError("Cannot call a class as a function")}function S(y,p){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:y}function _(y,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);y.prototype=Object.create(p&&p.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(y,p):y.__proto__=p)}var h=function(y){_(p,y);function p(){return g(this,p),S(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"value",value:function(d){var b=o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"value",this).call(this,d);return b.startsWith("rgb(")?(b=b.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+b.split(",").map(function(O){return("00"+parseInt(O).toString(16)).slice(-2)}).join("")):b}}]),p}(u.default.Attributor.Style),w=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),m=new h("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=h,n.ColorClass=w,n.ColorStyle=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function m(y,p){for(var v=0;v<p.length;v++){var d=p[v];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(y,d.key,d)}}return function(y,p,v){return p&&m(y.prototype,p),v&&m(y,v),y}}(),o=function m(y,p,v){y===null&&(y=Function.prototype);var d=Object.getOwnPropertyDescriptor(y,p);if(d===void 0){var b=Object.getPrototypeOf(y);return b===null?void 0:m(b,p,v)}else{if("value"in d)return d.value;var O=d.get;return O===void 0?void 0:O.call(v)}},l=i(6),u=f(l);function f(m){return m&&m.__esModule?m:{default:m}}function g(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 _(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 h=function(m){_(y,m);function y(){return g(this,y),S(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"format",value:function(v,d){if(v!==this.statics.blotName||!d)return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,v,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(v){var d=o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,v);return v=this.sanitize(v),d.setAttribute("href",v),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("target","_blank"),d}},{key:"formats",value:function(v){return v.getAttribute("href")}},{key:"sanitize",value:function(v){return w(v,this.PROTOCOL_WHITELIST)?v:this.SANITIZED_URL}}]),y}(u.default);h.blotName="link",h.tagName="A",h.SANITIZED_URL="about:blank",h.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function w(m,y){var p=document.createElement("a");p.href=m;var v=p.href.slice(0,p.href.indexOf(":"));return y.indexOf(v)>-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(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},o=function(){function y(p,v){for(var d=0;d<v.length;d++){var b=v[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(p,b.key,b)}}return function(p,v,d){return v&&y(p.prototype,v),d&&y(p,d),p}}(),l=i(23),u=S(l),f=i(107),g=S(f);function S(y){return y&&y.__esModule?y:{default:y}}function _(y,p){if(!(y instanceof p))throw new TypeError("Cannot call a class as a function")}var h=0;function w(y,p){y.setAttribute(p,y.getAttribute(p)!=="true")}var m=function(){function y(p){var v=this;_(this,y),this.select=p,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){v.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case u.default.keys.ENTER:v.togglePicker();break;case u.default.keys.ESCAPE:v.escape(),d.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(y,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),w(this.label,"aria-expanded"),w(this.options,"aria-hidden")}},{key:"buildItem",value:function(v){var d=this,b=document.createElement("span");return b.tabIndex="0",b.setAttribute("role","button"),b.classList.add("ql-picker-item"),v.hasAttribute("value")&&b.setAttribute("data-value",v.getAttribute("value")),v.textContent&&b.setAttribute("data-label",v.textContent),b.addEventListener("click",function(){d.selectItem(b,!0)}),b.addEventListener("keydown",function(O){switch(O.keyCode){case u.default.keys.ENTER:d.selectItem(b,!0),O.preventDefault();break;case u.default.keys.ESCAPE:d.escape(),O.preventDefault();break}}),b}},{key:"buildLabel",value:function(){var v=document.createElement("span");return v.classList.add("ql-picker-label"),v.innerHTML=g.default,v.tabIndex="0",v.setAttribute("role","button"),v.setAttribute("aria-expanded","false"),this.container.appendChild(v),v}},{key:"buildOptions",value:function(){var v=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(b){var O=v.buildItem(b);d.appendChild(O),b.selected===!0&&v.selectItem(O)}),this.container.appendChild(d)}},{key:"buildPicker",value:function(){var v=this;[].slice.call(this.select.attributes).forEach(function(d){v.container.setAttribute(d.name,d.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var v=this;this.close(),setTimeout(function(){return v.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(v){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,b=this.container.querySelector(".ql-selected");if(v!==b&&(b!=null&&b.classList.remove("ql-selected"),v!=null&&(v.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(v.parentNode.children,v),v.hasAttribute("data-value")?this.label.setAttribute("data-value",v.getAttribute("data-value")):this.label.removeAttribute("data-value"),v.hasAttribute("data-label")?this.label.setAttribute("data-label",v.getAttribute("data-label")):this.label.removeAttribute("data-label"),d))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":a(Event))==="object"){var O=document.createEvent("Event");O.initEvent("change",!0,!0),this.select.dispatchEvent(O)}this.close()}}},{key:"update",value:function(){var v=void 0;if(this.select.selectedIndex>-1){var d=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];v=this.select.options[this.select.selectedIndex],this.selectItem(d)}else this.selectItem(null);var b=v!=null&&v!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",b)}}]),y}();n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=$(a),l=i(5),u=$(l),f=i(4),g=$(f),S=i(16),_=$(S),h=i(25),w=$(h),m=i(24),y=$(m),p=i(35),v=$(p),d=i(6),b=$(d),O=i(22),R=$(O),T=i(7),E=$(T),P=i(55),x=$(P),k=i(42),M=$(k),j=i(23),B=$(j);function $(Z){return Z&&Z.__esModule?Z:{default:Z}}u.default.register({"blots/block":g.default,"blots/block/embed":f.BlockEmbed,"blots/break":_.default,"blots/container":w.default,"blots/cursor":y.default,"blots/embed":v.default,"blots/inline":b.default,"blots/scroll":R.default,"blots/text":E.default,"modules/clipboard":x.default,"modules/history":M.default,"modules/keyboard":B.default}),o.default.register(g.default,_.default,y.default,b.default,R.default,E.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 g=this.isolate(u,f);g.remove()},l.prototype.formatAt=function(u,f,g,S){var _=this.isolate(u,f);if(a.query(g,a.Scope.BLOT)!=null&&S)_.wrap(g,S);else if(a.query(g,a.Scope.ATTRIBUTE)!=null){var h=a.create(this.statics.scope);_.wrap(h),h.format(g,S)}},l.prototype.insertAt=function(u,f,g){var S=g==null?a.create("text",f):a.create(f,g),_=this.split(u);this.parent.insertBefore(S,_)},l.prototype.insertInto=function(u,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var g=null;u.children.insertBefore(this,f),f!=null&&(g=f.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=g)&&u.domNode.insertBefore(this.domNode,g),this.parent=u,this.attach()},l.prototype.isolate=function(u,f){var g=this.split(u);return g.split(f),g},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 g=typeof u=="string"?a.create(u,f):u;return g.replace(this),g},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 g=typeof u=="string"?a.create(u,f):u;return this.parent!=null&&this.parent.insertBefore(g,this.next),g.appendChild(this),g},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 g(S){this.attributes={},this.domNode=S,this.build()}return g.prototype.attribute=function(S,_){_?S.add(this.domNode,_)&&(S.value(this.domNode)!=null?this.attributes[S.attrName]=S:delete this.attributes[S.attrName]):(S.remove(this.domNode),delete this.attributes[S.attrName])},g.prototype.build=function(){var S=this;this.attributes={};var _=a.default.keys(this.domNode),h=o.default.keys(this.domNode),w=l.default.keys(this.domNode);_.concat(h).concat(w).forEach(function(m){var y=u.query(m,u.Scope.ATTRIBUTE);y instanceof a.default&&(S.attributes[y.attrName]=y)})},g.prototype.copy=function(S){var _=this;Object.keys(this.attributes).forEach(function(h){var w=_.attributes[h].value(_.domNode);S.format(h,w)})},g.prototype.move=function(S){var _=this;this.copy(S),Object.keys(this.attributes).forEach(function(h){_.attributes[h].remove(_.domNode)}),this.attributes={}},g.prototype.values=function(){var S=this;return Object.keys(this.attributes).reduce(function(_,h){return _[h]=S.attributes[h].value(S.domNode),_},{})},g}();n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var _ in S)S.hasOwnProperty(_)&&(g[_]=S[_])};return function(g,S){f(g,S);function _(){this.constructor=g}g.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f,g){var S=f.getAttribute("class")||"";return S.split(/\s+/).filter(function(_){return _.indexOf(g+"-")===0})}var u=function(f){a(g,f);function g(){return f!==null&&f.apply(this,arguments)||this}return g.keys=function(S){return(S.getAttribute("class")||"").split(/\s+/).map(function(_){return _.split("-").slice(0,-1).join("-")})},g.prototype.add=function(S,_){return this.canAdd(S,_)?(this.remove(S),S.classList.add(this.keyName+"-"+_),!0):!1},g.prototype.remove=function(S){var _=l(S,this.keyName);_.forEach(function(h){S.classList.remove(h)}),S.classList.length===0&&S.removeAttribute("class")},g.prototype.value=function(S){var _=l(S,this.keyName)[0]||"",h=_.slice(this.keyName.length+1);return this.canAdd(S,h)?h:""},g}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var _ in S)S.hasOwnProperty(_)&&(g[_]=S[_])};return function(g,S){f(g,S);function _(){this.constructor=g}g.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f){var g=f.split("-"),S=g.slice(1).map(function(_){return _[0].toUpperCase()+_.slice(1)}).join("");return g[0]+S}var u=function(f){a(g,f);function g(){return f!==null&&f.apply(this,arguments)||this}return g.keys=function(S){return(S.getAttribute("style")||"").split(";").map(function(_){var h=_.split(":");return h[0].trim()})},g.prototype.add=function(S,_){return this.canAdd(S,_)?(S.style[l(this.keyName)]=_,!0):!1},g.prototype.remove=function(S){S.style[l(this.keyName)]="",S.getAttribute("style")||S.removeAttribute("style")},g.prototype.value=function(S){var _=S.style[l(this.keyName)];return this.canAdd(S,_)?_:""},g}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,g){for(var S=0;S<g.length;S++){var _=g[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(f,_.key,_)}}return function(f,g,S){return g&&u(f.prototype,g),S&&u(f,S),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,g){o(this,u),this.quill=f,this.options=g,this.modules={}}return a(u,[{key:"init",value:function(){var g=this;Object.keys(this.options.modules).forEach(function(S){g.modules[S]==null&&g.addModule(S)})}},{key:"addModule",value:function(g){var S=this.quill.constructor.import("modules/"+g);return this.modules[g]=new S(this.quill,this.options.modules[g]||{}),this.modules[g]}}]),u}();l.DEFAULTS={modules:{}},l.themes={default:l},n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(v,d){for(var b=0;b<d.length;b++){var O=d[b];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(v,O.key,O)}}return function(v,d,b){return d&&p(v.prototype,d),b&&p(v,b),v}}(),o=function p(v,d,b){v===null&&(v=Function.prototype);var O=Object.getOwnPropertyDescriptor(v,d);if(O===void 0){var R=Object.getPrototypeOf(v);return R===null?void 0:p(R,d,b)}else{if("value"in O)return O.value;var T=O.get;return T===void 0?void 0:T.call(b)}},l=i(0),u=S(l),f=i(7),g=S(f);function S(p){return p&&p.__esModule?p:{default:p}}function _(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function h(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function w(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var m="\uFEFF",y=function(p){w(v,p);function v(d){_(this,v);var b=h(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,d));return b.contentNode=document.createElement("span"),b.contentNode.setAttribute("contenteditable",!1),[].slice.call(b.domNode.childNodes).forEach(function(O){b.contentNode.appendChild(O)}),b.leftGuard=document.createTextNode(m),b.rightGuard=document.createTextNode(m),b.domNode.appendChild(b.leftGuard),b.domNode.appendChild(b.contentNode),b.domNode.appendChild(b.rightGuard),b}return a(v,[{key:"index",value:function(b,O){return b===this.leftGuard?0:b===this.rightGuard?1:o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"index",this).call(this,b,O)}},{key:"restore",value:function(b){var O=void 0,R=void 0,T=b.data.split(m).join("");if(b===this.leftGuard)if(this.prev instanceof g.default){var E=this.prev.length();this.prev.insertAt(E,T),O={startNode:this.prev.domNode,startOffset:E+T.length}}else R=document.createTextNode(T),this.parent.insertBefore(u.default.create(R),this),O={startNode:R,startOffset:T.length};else b===this.rightGuard&&(this.next instanceof g.default?(this.next.insertAt(0,T),O={startNode:this.next.domNode,startOffset:T.length}):(R=document.createTextNode(T),this.parent.insertBefore(u.default.create(R),this.next),O={startNode:R,startOffset:T.length}));return b.data=m,O}},{key:"update",value:function(b,O){var R=this;b.forEach(function(T){if(T.type==="characterData"&&(T.target===R.leftGuard||T.target===R.rightGuard)){var E=R.restore(T.target);E&&(O.range=E)}})}}]),v}(u.default.Embed);n.default=y},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(_){return _&&_.__esModule?_:{default:_}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new o.default.Attributor.Attribute("align","align",u),g=new o.default.Attributor.Class("align","ql-align",u),S=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=f,n.AlignClass=g,n.AlignStyle=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var a=i(0),o=u(a),l=i(26);function u(S){return S&&S.__esModule?S:{default:S}}var f=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),g=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=g},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(_){return _&&_.__esModule?_:{default:_}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},f=new o.default.Attributor.Attribute("direction","dir",u),g=new o.default.Attributor.Class("direction","ql-direction",u),S=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=f,n.DirectionClass=g,n.DirectionStyle=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function p(v,d){for(var b=0;b<d.length;b++){var O=d[b];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(v,O.key,O)}}return function(v,d,b){return d&&p(v.prototype,d),b&&p(v,b),v}}(),o=function p(v,d,b){v===null&&(v=Function.prototype);var O=Object.getOwnPropertyDescriptor(v,d);if(O===void 0){var R=Object.getPrototypeOf(v);return R===null?void 0:p(R,d,b)}else{if("value"in O)return O.value;var T=O.get;return T===void 0?void 0:T.call(b)}},l=i(0),u=f(l);function f(p){return p&&p.__esModule?p:{default:p}}function g(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function S(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function _(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var h={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},w=new u.default.Attributor.Class("font","ql-font",h),m=function(p){_(v,p);function v(){return g(this,v),S(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"value",value:function(b){return o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"value",this).call(this,b).replace(/["']/g,"")}}]),v}(u.default.Attributor.Style),y=new m("font","font-family",h);n.FontStyle=y,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(g){return g&&g.__esModule?g:{default:g}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=f},function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var a=function(){function d(b,O){for(var R=0;R<O.length;R++){var T=O[R];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,O,R){return O&&d(b.prototype,O),R&&d(b,R),b}}(),o=i(0),l=_(o),u=i(5),f=_(u),g=i(9),S=_(g);function _(d){return d&&d.__esModule?d:{default:d}}function h(d,b){if(!(d instanceof b))throw new TypeError("Cannot call a class as a function")}function w(d,b){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:d}function m(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);d.prototype=Object.create(b&&b.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(d,b):d.__proto__=b)}var y=function(d){m(b,d);function b(O,R){h(this,b);var T=w(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,O,R));return T.lastRecorded=0,T.ignoreChange=!1,T.clear(),T.quill.on(f.default.events.EDITOR_CHANGE,function(E,P,x,k){E!==f.default.events.TEXT_CHANGE||T.ignoreChange||(!T.options.userOnly||k===f.default.sources.USER?T.record(P,x):T.transform(P))}),T.quill.keyboard.addBinding({key:"Z",shortKey:!0},T.undo.bind(T)),T.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},T.redo.bind(T)),/Win/i.test(navigator.platform)&&T.quill.keyboard.addBinding({key:"Y",shortKey:!0},T.redo.bind(T)),T}return a(b,[{key:"change",value:function(R,T){if(this.stack[R].length!==0){var E=this.stack[R].pop();this.stack[T].push(E),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(E[R],f.default.sources.USER),this.ignoreChange=!1;var P=v(E[R]);this.quill.setSelection(P)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(R,T){if(R.ops.length!==0){this.stack.redo=[];var E=this.quill.getContents().diff(T),P=Date.now();if(this.lastRecorded+this.options.delay>P&&this.stack.undo.length>0){var x=this.stack.undo.pop();E=E.compose(x.undo),R=x.redo.compose(R)}else this.lastRecorded=P;this.stack.undo.push({redo:R,undo:E}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(R){this.stack.undo.forEach(function(T){T.undo=R.transform(T.undo,!0),T.redo=R.transform(T.redo,!0)}),this.stack.redo.forEach(function(T){T.undo=R.transform(T.undo,!0),T.redo=R.transform(T.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),b}(S.default);y.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function p(d){var b=d.ops[d.ops.length-1];return b==null?!1:b.insert!=null?typeof b.insert=="string"&&b.insert.endsWith(`
|
|
132
|
+
`):b.attributes!=null?Object.keys(b.attributes).some(function(O){return l.default.query(O,l.default.Scope.BLOCK)!=null}):!1}function v(d){var b=d.reduce(function(R,T){return R+=T.delete||0,R},0),O=d.length()-b;return p(d)&&(O-=1),O}n.default=y,n.getLastChangeIndex=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function z(I,H){for(var W=0;W<H.length;W++){var V=H[W];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(I,V.key,V)}}return function(I,H,W){return H&&z(I.prototype,H),W&&z(I,W),I}}(),o=function z(I,H,W){I===null&&(I=Function.prototype);var V=Object.getOwnPropertyDescriptor(I,H);if(V===void 0){var U=Object.getPrototypeOf(I);return U===null?void 0:z(U,H,W)}else{if("value"in V)return V.value;var Y=V.get;return Y===void 0?void 0:Y.call(W)}},l=i(3),u=P(l),f=i(2),g=P(f),S=i(8),_=P(S),h=i(23),w=P(h),m=i(34),y=P(m),p=i(59),v=P(p),d=i(60),b=P(d),O=i(28),R=P(O),T=i(61),E=P(T);function P(z){return z&&z.__esModule?z:{default:z}}function x(z,I){if(!(z instanceof I))throw new TypeError("Cannot call a class as a function")}function k(z,I){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:z}function M(z,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);z.prototype=Object.create(I&&I.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(z,I):z.__proto__=I)}var j=[!1,"center","right","justify"],B=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],$=[!1,"serif","monospace"],Z=["1","2","3",!1],K=["small",!1,"large","huge"],D=function(z){M(I,z);function I(H,W){x(this,I);var V=k(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,H,W)),U=function Y(X){if(!document.body.contains(H.root))return document.body.removeEventListener("click",Y);V.tooltip!=null&&!V.tooltip.root.contains(X.target)&&document.activeElement!==V.tooltip.textbox&&!V.quill.hasFocus()&&V.tooltip.hide(),V.pickers!=null&&V.pickers.forEach(function(Q){Q.container.contains(X.target)||Q.close()})};return H.emitter.listenDOM("click",document.body,U),V}return a(I,[{key:"addModule",value:function(W){var V=o(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"addModule",this).call(this,W);return W==="toolbar"&&this.extendToolbar(V),V}},{key:"buildButtons",value:function(W,V){W.forEach(function(U){var Y=U.getAttribute("class")||"";Y.split(/\s+/).forEach(function(X){if(X.startsWith("ql-")&&(X=X.slice(3),V[X]!=null))if(X==="direction")U.innerHTML=V[X][""]+V[X].rtl;else if(typeof V[X]=="string")U.innerHTML=V[X];else{var Q=U.value||"";Q!=null&&V[X][Q]&&(U.innerHTML=V[X][Q])}})})}},{key:"buildPickers",value:function(W,V){var U=this;this.pickers=W.map(function(X){if(X.classList.contains("ql-align"))return X.querySelector("option")==null&&L(X,j),new b.default(X,V.align);if(X.classList.contains("ql-background")||X.classList.contains("ql-color")){var Q=X.classList.contains("ql-background")?"background":"color";return X.querySelector("option")==null&&L(X,B,Q==="background"?"#ffffff":"#000000"),new v.default(X,V[Q])}else return X.querySelector("option")==null&&(X.classList.contains("ql-font")?L(X,$):X.classList.contains("ql-header")?L(X,Z):X.classList.contains("ql-size")&&L(X,K)),new R.default(X)});var Y=function(){U.pickers.forEach(function(Q){Q.update()})};this.quill.on(_.default.events.EDITOR_CHANGE,Y)}}]),I}(y.default);D.DEFAULTS=(0,u.default)(!0,{},y.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var I=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 W=new FileReader;W.onload=function(V){var U=I.quill.getSelection(!0);I.quill.updateContents(new g.default().retain(U.index).delete(U.length).insert({image:V.target.result}),_.default.sources.USER),I.quill.setSelection(U.index+1,_.default.sources.SILENT),H.value=""},W.readAsDataURL(H.files[0])}}),this.container.appendChild(H)),H.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var q=function(z){M(I,z);function I(H,W){x(this,I);var V=k(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,H,W));return V.textbox=V.root.querySelector('input[type="text"]'),V.listen(),V}return a(I,[{key:"listen",value:function(){var W=this;this.textbox.addEventListener("keydown",function(V){w.default.match(V,"enter")?(W.save(),V.preventDefault()):w.default.match(V,"escape")&&(W.cancel(),V.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),V!=null?this.textbox.value=V:W!==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-"+W)||""),this.root.setAttribute("data-mode",W)}},{key:"restoreFocus",value:function(){var W=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=W}},{key:"save",value:function(){var W=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var V=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",W,_.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",W,_.default.sources.USER)),this.quill.root.scrollTop=V;break}case"video":W=A(W);case"formula":{if(!W)break;var U=this.quill.getSelection(!0);if(U!=null){var Y=U.index+U.length;this.quill.insertEmbed(Y,this.root.getAttribute("data-mode"),W,_.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(Y+1," ",_.default.sources.USER),this.quill.setSelection(Y+2,_.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),I}(E.default);function A(z){var I=z.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||z.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return I?(I[1]||"https")+"://www.youtube.com/embed/"+I[2]+"?showinfo=0":(I=z.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(I[1]||"https")+"://player.vimeo.com/video/"+I[2]+"/":z}function L(z,I){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;I.forEach(function(W){var V=document.createElement("option");W===H?V.setAttribute("selected","selected"):V.setAttribute("value",W),z.appendChild(V)})}n.BaseTooltip=q,n.default=D},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,g=this.iterator();f=g();){var S=f.length();if(l<S||u&&l===S&&(f.next==null||f.next.length()!==0))return[f,l];l-=S}return[null,0]},o.prototype.forEach=function(l){for(var u,f=this.iterator();u=f();)l(u)},o.prototype.forEachAt=function(l,u,f){if(!(u<=0))for(var g=this.find(l),S=g[0],_=g[1],h,w=l-_,m=this.iterator(S);(h=m())&&w<l+u;){var y=h.length();l>w?f(h,l-w,Math.min(u,w+y-l)):f(h,0,Math.min(y,l+u-w)),w+=y}},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,g=this.iterator();f=g();)u=l(u,f);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,h){_.__proto__=h}||function(_,h){for(var w in h)h.hasOwnProperty(w)&&(_[w]=h[w])};return function(_,h){S(_,h);function w(){this.constructor=_}_.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,g=function(S){a(_,S);function _(h){var w=S.call(this,h)||this;return w.scroll=w,w.observer=new MutationObserver(function(m){w.update(m)}),w.observer.observe(w.domNode,u),w.attach(),w}return _.prototype.detach=function(){S.prototype.detach.call(this),this.observer.disconnect()},_.prototype.deleteAt=function(h,w){this.update(),h===0&&w===this.length()?this.children.forEach(function(m){m.remove()}):S.prototype.deleteAt.call(this,h,w)},_.prototype.formatAt=function(h,w,m,y){this.update(),S.prototype.formatAt.call(this,h,w,m,y)},_.prototype.insertAt=function(h,w,m){this.update(),S.prototype.insertAt.call(this,h,w,m)},_.prototype.optimize=function(h,w){var m=this;h===void 0&&(h=[]),w===void 0&&(w={}),S.prototype.optimize.call(this,w);for(var y=[].slice.call(this.observer.takeRecords());y.length>0;)h.push(y.pop());for(var p=function(O,R){R===void 0&&(R=!0),!(O==null||O===m)&&O.domNode.parentNode!=null&&(O.domNode[l.DATA_KEY].mutations==null&&(O.domNode[l.DATA_KEY].mutations=[]),R&&p(O.parent))},v=function(O){O.domNode[l.DATA_KEY]==null||O.domNode[l.DATA_KEY].mutations==null||(O instanceof o.default&&O.children.forEach(v),O.optimize(w))},d=h,b=0;d.length>0;b+=1){if(b>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(O){var R=l.find(O.target,!0);R!=null&&(R.domNode===O.target&&(O.type==="childList"?(p(l.find(O.previousSibling,!1)),[].forEach.call(O.addedNodes,function(T){var E=l.find(T,!1);p(E,!1),E instanceof o.default&&E.children.forEach(function(P){p(P,!1)})})):O.type==="attributes"&&p(R.prev)),p(R))}),this.children.forEach(v),d=[].slice.call(this.observer.takeRecords()),y=d.slice();y.length>0;)h.push(y.pop())}},_.prototype.update=function(h,w){var m=this;w===void 0&&(w={}),h=h||this.observer.takeRecords(),h.map(function(y){var p=l.find(y.target,!0);return p==null?null:p.domNode[l.DATA_KEY].mutations==null?(p.domNode[l.DATA_KEY].mutations=[y],p):(p.domNode[l.DATA_KEY].mutations.push(y),null)}).forEach(function(y){y==null||y===m||y.domNode[l.DATA_KEY]==null||y.update(y.domNode[l.DATA_KEY].mutations||[],w)}),this.domNode[l.DATA_KEY].mutations!=null&&S.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,w),this.optimize(h,w)},_.blotName="scroll",_.defaultChild="block",_.scope=l.Scope.BLOCK_BLOT,_.tagName="DIV",_}(o.default);n.default=g},function(r,n,i){var a=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,_){S.__proto__=_}||function(S,_){for(var h in _)_.hasOwnProperty(h)&&(S[h]=_[h])};return function(S,_){g(S,_);function h(){this.constructor=S}S.prototype=_===null?Object.create(_):(h.prototype=_.prototype,new h)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function u(g,S){if(Object.keys(g).length!==Object.keys(S).length)return!1;for(var _ in g)if(g[_]!==S[_])return!1;return!0}var f=function(g){a(S,g);function S(){return g!==null&&g.apply(this,arguments)||this}return S.formats=function(_){if(_.tagName!==S.tagName)return g.formats.call(this,_)},S.prototype.format=function(_,h){var w=this;_===this.statics.blotName&&!h?(this.children.forEach(function(m){m instanceof o.default||(m=m.wrap(S.blotName,!0)),w.attributes.copy(m)}),this.unwrap()):g.prototype.format.call(this,_,h)},S.prototype.formatAt=function(_,h,w,m){if(this.formats()[w]!=null||l.query(w,l.Scope.ATTRIBUTE)){var y=this.isolate(_,h);y.format(w,m)}else g.prototype.formatAt.call(this,_,h,w,m)},S.prototype.optimize=function(_){g.prototype.optimize.call(this,_);var h=this.formats();if(Object.keys(h).length===0)return this.unwrap();var w=this.next;w instanceof S&&w.prev===this&&u(h,w.formats())&&(w.moveChildren(this),w.remove())},S.blotName="inline",S.scope=l.Scope.INLINE_BLOT,S.tagName="SPAN",S}(o.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var _ in S)S.hasOwnProperty(_)&&(g[_]=S[_])};return function(g,S){f(g,S);function _(){this.constructor=g}g.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1),u=function(f){a(g,f);function g(){return f!==null&&f.apply(this,arguments)||this}return g.formats=function(S){var _=l.query(g.blotName).tagName;if(S.tagName!==_)return f.formats.call(this,S)},g.prototype.format=function(S,_){l.query(S,l.Scope.BLOCK)!=null&&(S===this.statics.blotName&&!_?this.replaceWith(g.blotName):f.prototype.format.call(this,S,_))},g.prototype.formatAt=function(S,_,h,w){l.query(h,l.Scope.BLOCK)!=null?this.format(h,w):f.prototype.formatAt.call(this,S,_,h,w)},g.prototype.insertAt=function(S,_,h){if(h==null||l.query(_,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,S,_,h);else{var w=this.split(S),m=l.create(_,h);w.parent.insertBefore(m,w)}},g.prototype.update=function(S,_){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,S,_)},g.blotName="block",g.scope=l.Scope.BLOCK_BLOT,g.tagName="P",g}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var S in g)g.hasOwnProperty(S)&&(f[S]=g[S])};return function(f,g){u(f,g);function S(){this.constructor=f}f.prototype=g===null?Object.create(g):(S.prototype=g.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=function(u){a(f,u);function f(){return u!==null&&u.apply(this,arguments)||this}return f.formats=function(g){},f.prototype.format=function(g,S){u.prototype.formatAt.call(this,0,this.length(),g,S)},f.prototype.formatAt=function(g,S,_,h){g===0&&S===this.length()?this.format(_,h):u.prototype.formatAt.call(this,g,S,_,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(g,S){g.__proto__=S}||function(g,S){for(var _ in S)S.hasOwnProperty(_)&&(g[_]=S[_])};return function(g,S){f(g,S);function _(){this.constructor=g}g.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=i(1),u=function(f){a(g,f);function g(S){var _=f.call(this,S)||this;return _.text=_.statics.value(_.domNode),_}return g.create=function(S){return document.createTextNode(S)},g.value=function(S){var _=S.data;return _.normalize&&(_=_.normalize()),_},g.prototype.deleteAt=function(S,_){this.domNode.data=this.text=this.text.slice(0,S)+this.text.slice(S+_)},g.prototype.index=function(S,_){return this.domNode===S?_:-1},g.prototype.insertAt=function(S,_,h){h==null?(this.text=this.text.slice(0,S)+_+this.text.slice(S),this.domNode.data=this.text):f.prototype.insertAt.call(this,S,_,h)},g.prototype.length=function(){return this.text.length},g.prototype.optimize=function(S){f.prototype.optimize.call(this,S),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof g&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},g.prototype.position=function(S,_){return[this.domNode,S]},g.prototype.split=function(S,_){if(_===void 0&&(_=!1),!_){if(S===0)return this;if(S===this.length())return this.next}var h=l.create(this.domNode.splitText(S));return this.parent.insertBefore(h,this.next),this.text=this.statics.value(this.domNode),h},g.prototype.update=function(S,_){var h=this;S.some(function(w){return w.type==="characterData"&&w.target===h.domNode})&&(this.text=this.statics.value(this.domNode))},g.prototype.value=function(){return this.text},g.blotName="text",g.scope=l.Scope.INLINE_BLOT,g}(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 g=f.indexOf(l,u);return g!==-1&&g===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),g=f.length>>>0,S=arguments[1],_,h=0;h<g;h++)if(_=f[h],u.call(S,_,h,f))return _}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,a=1,o=0;function l(b,O,R){if(b==O)return b?[[o,b]]:[];(R<0||b.length<R)&&(R=null);var T=S(b,O),E=b.substring(0,T);b=b.substring(T),O=O.substring(T),T=_(b,O);var P=b.substring(b.length-T);b=b.substring(0,b.length-T),O=O.substring(0,O.length-T);var x=u(b,O);return E&&x.unshift([o,E]),P&&x.push([o,P]),w(x),R!=null&&(x=p(x,R)),x=v(x),x}function u(b,O){var R;if(!b)return[[a,O]];if(!O)return[[i,b]];var T=b.length>O.length?b:O,E=b.length>O.length?O:b,P=T.indexOf(E);if(P!=-1)return R=[[a,T.substring(0,P)],[o,E],[a,T.substring(P+E.length)]],b.length>O.length&&(R[0][0]=R[2][0]=i),R;if(E.length==1)return[[i,b],[a,O]];var x=h(b,O);if(x){var k=x[0],M=x[1],j=x[2],B=x[3],$=x[4],Z=l(k,j),K=l(M,B);return Z.concat([[o,$]],K)}return f(b,O)}function f(b,O){for(var R=b.length,T=O.length,E=Math.ceil((R+T)/2),P=E,x=2*E,k=new Array(x),M=new Array(x),j=0;j<x;j++)k[j]=-1,M[j]=-1;k[P+1]=0,M[P+1]=0;for(var B=R-T,$=B%2!=0,Z=0,K=0,D=0,q=0,A=0;A<E;A++){for(var L=-A+Z;L<=A-K;L+=2){var z=P+L,I;L==-A||L!=A&&k[z-1]<k[z+1]?I=k[z+1]:I=k[z-1]+1;for(var H=I-L;I<R&&H<T&&b.charAt(I)==O.charAt(H);)I++,H++;if(k[z]=I,I>R)K+=2;else if(H>T)Z+=2;else if($){var W=P+B-L;if(W>=0&&W<x&&M[W]!=-1){var V=R-M[W];if(I>=V)return g(b,O,I,H)}}}for(var U=-A+D;U<=A-q;U+=2){var W=P+U,V;U==-A||U!=A&&M[W-1]<M[W+1]?V=M[W+1]:V=M[W-1]+1;for(var Y=V-U;V<R&&Y<T&&b.charAt(R-V-1)==O.charAt(T-Y-1);)V++,Y++;if(M[W]=V,V>R)q+=2;else if(Y>T)D+=2;else if(!$){var z=P+B-U;if(z>=0&&z<x&&k[z]!=-1){var I=k[z],H=P+I-z;if(V=R-V,I>=V)return g(b,O,I,H)}}}}return[[i,b],[a,O]]}function g(b,O,R,T){var E=b.substring(0,R),P=O.substring(0,T),x=b.substring(R),k=O.substring(T),M=l(E,P),j=l(x,k);return M.concat(j)}function S(b,O){if(!b||!O||b.charAt(0)!=O.charAt(0))return 0;for(var R=0,T=Math.min(b.length,O.length),E=T,P=0;R<E;)b.substring(P,E)==O.substring(P,E)?(R=E,P=R):T=E,E=Math.floor((T-R)/2+R);return E}function _(b,O){if(!b||!O||b.charAt(b.length-1)!=O.charAt(O.length-1))return 0;for(var R=0,T=Math.min(b.length,O.length),E=T,P=0;R<E;)b.substring(b.length-E,b.length-P)==O.substring(O.length-E,O.length-P)?(R=E,P=R):T=E,E=Math.floor((T-R)/2+R);return E}function h(b,O){var R=b.length>O.length?b:O,T=b.length>O.length?O:b;if(R.length<4||T.length*2<R.length)return null;function E(K,D,q){for(var A=K.substring(q,q+Math.floor(K.length/4)),L=-1,z="",I,H,W,V;(L=D.indexOf(A,L+1))!=-1;){var U=S(K.substring(q),D.substring(L)),Y=_(K.substring(0,q),D.substring(0,L));z.length<Y+U&&(z=D.substring(L-Y,L)+D.substring(L,L+U),I=K.substring(0,q-Y),H=K.substring(q+U),W=D.substring(0,L-Y),V=D.substring(L+U))}return z.length*2>=K.length?[I,H,W,V,z]:null}var P=E(R,T,Math.ceil(R.length/4)),x=E(R,T,Math.ceil(R.length/2)),k;if(!P&&!x)return null;x?P?k=P[4].length>x[4].length?P:x:k=x:k=P;var M,j,B,$;b.length>O.length?(M=k[0],j=k[1],B=k[2],$=k[3]):(B=k[0],$=k[1],M=k[2],j=k[3]);var Z=k[4];return[M,j,B,$,Z]}function w(b){b.push([o,""]);for(var O=0,R=0,T=0,E="",P="",x;O<b.length;)switch(b[O][0]){case a:T++,P+=b[O][1],O++;break;case i:R++,E+=b[O][1],O++;break;case o:R+T>1?(R!==0&&T!==0&&(x=S(P,E),x!==0&&(O-R-T>0&&b[O-R-T-1][0]==o?b[O-R-T-1][1]+=P.substring(0,x):(b.splice(0,0,[o,P.substring(0,x)]),O++),P=P.substring(x),E=E.substring(x)),x=_(P,E),x!==0&&(b[O][1]=P.substring(P.length-x)+b[O][1],P=P.substring(0,P.length-x),E=E.substring(0,E.length-x))),R===0?b.splice(O-T,R+T,[a,P]):T===0?b.splice(O-R,R+T,[i,E]):b.splice(O-R-T,R+T,[i,E],[a,P]),O=O-R-T+(R?1:0)+(T?1:0)+1):O!==0&&b[O-1][0]==o?(b[O-1][1]+=b[O][1],b.splice(O,1)):O++,T=0,R=0,E="",P="";break}b[b.length-1][1]===""&&b.pop();var k=!1;for(O=1;O<b.length-1;)b[O-1][0]==o&&b[O+1][0]==o&&(b[O][1].substring(b[O][1].length-b[O-1][1].length)==b[O-1][1]?(b[O][1]=b[O-1][1]+b[O][1].substring(0,b[O][1].length-b[O-1][1].length),b[O+1][1]=b[O-1][1]+b[O+1][1],b.splice(O-1,1),k=!0):b[O][1].substring(0,b[O+1][1].length)==b[O+1][1]&&(b[O-1][1]+=b[O+1][1],b[O][1]=b[O][1].substring(b[O+1][1].length)+b[O+1][1],b.splice(O+1,1),k=!0)),O++;k&&w(b)}var m=l;m.INSERT=a,m.DELETE=i,m.EQUAL=o,r.exports=m;function y(b,O){if(O===0)return[o,b];for(var R=0,T=0;T<b.length;T++){var E=b[T];if(E[0]===i||E[0]===o){var P=R+E[1].length;if(O===P)return[T+1,b];if(O<P){b=b.slice();var x=O-R,k=[E[0],E[1].slice(0,x)],M=[E[0],E[1].slice(x)];return b.splice(T,1,k,M),[T+1,b]}else R=P}}throw new Error("cursor_pos is out of bounds!")}function p(b,O){var R=y(b,O),T=R[1],E=R[0],P=T[E],x=T[E+1];if(P==null)return b;if(P[0]!==o)return b;if(x!=null&&P[1]+x[1]===x[1]+P[1])return T.splice(E,2,x,P),d(T,E,2);if(x!=null&&x[1].indexOf(P[1])===0){T.splice(E,2,[x[0],P[1]],[0,P[1]]);var k=x[1].slice(P[1].length);return k.length>0&&T.splice(E+2,0,[x[0],k]),d(T,E,3)}else return b}function v(b){for(var O=!1,R=function(x){return x.charCodeAt(0)>=56320&&x.charCodeAt(0)<=57343},T=function(x){return x.charCodeAt(x.length-1)>=55296&&x.charCodeAt(x.length-1)<=56319},E=2;E<b.length;E+=1)b[E-2][0]===o&&T(b[E-2][1])&&b[E-1][0]===i&&R(b[E-1][1])&&b[E][0]===a&&R(b[E][1])&&(O=!0,b[E-1][1]=b[E-2][1].slice(-1)+b[E-1][1],b[E][1]=b[E-2][1].slice(-1)+b[E][1],b[E-2][1]=b[E-2][1].slice(0,-1));if(!O)return b;for(var P=[],E=0;E<b.length;E+=1)b[E][1].length>0&&P.push(b[E]);return P}function d(b,O,R){for(var T=O+R-1;T>=0&&T>=O-1;T--)if(T+1<b.length){var E=b[T],P=b[T+1];E[0]===P[1]&&b.splice(T,2,[E[0],E[1]+P[1]])}return b}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(a){var o=[];for(var l in a)o.push(l);return o}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?a:o,n.supported=a;function a(l){return Object.prototype.toString.call(l)=="[object Arguments]"}n.unsupported=o;function o(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function l(f,g,S){this.fn=f,this.context=g,this.once=S||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var g=[],S,_;if(this._eventsCount===0)return g;for(_ in S=this._events)i.call(S,_)&&g.push(a?_.slice(1):_);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(S)):g},u.prototype.listeners=function(g,S){var _=a?a+g:g,h=this._events[_];if(S)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var w=0,m=h.length,y=new Array(m);w<m;w++)y[w]=h[w].fn;return y},u.prototype.emit=function(g,S,_,h,w,m){var y=a?a+g:g;if(!this._events[y])return!1;var p=this._events[y],v=arguments.length,d,b;if(p.fn){switch(p.once&&this.removeListener(g,p.fn,void 0,!0),v){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,S),!0;case 3:return p.fn.call(p.context,S,_),!0;case 4:return p.fn.call(p.context,S,_,h),!0;case 5:return p.fn.call(p.context,S,_,h,w),!0;case 6:return p.fn.call(p.context,S,_,h,w,m),!0}for(b=1,d=new Array(v-1);b<v;b++)d[b-1]=arguments[b];p.fn.apply(p.context,d)}else{var O=p.length,R;for(b=0;b<O;b++)switch(p[b].once&&this.removeListener(g,p[b].fn,void 0,!0),v){case 1:p[b].fn.call(p[b].context);break;case 2:p[b].fn.call(p[b].context,S);break;case 3:p[b].fn.call(p[b].context,S,_);break;case 4:p[b].fn.call(p[b].context,S,_,h);break;default:if(!d)for(R=1,d=new Array(v-1);R<v;R++)d[R-1]=arguments[R];p[b].fn.apply(p[b].context,d)}}return!0},u.prototype.on=function(g,S,_){var h=new l(S,_||this),w=a?a+g:g;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(g,S,_){var h=new l(S,_||this,!0),w=a?a+g:g;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(g,S,_,h){var w=a?a+g:g;if(!this._events[w])return this;if(!S)return--this._eventsCount===0?this._events=new o:delete this._events[w],this;var m=this._events[w];if(m.fn)m.fn===S&&(!h||m.once)&&(!_||m.context===_)&&(--this._eventsCount===0?this._events=new o:delete this._events[w]);else{for(var y=0,p=[],v=m.length;y<v;y++)(m[y].fn!==S||h&&!m[y].once||_&&m[y].context!==_)&&p.push(m[y]);p.length?this._events[w]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new o:delete this._events[w]}return this},u.prototype.removeAllListeners=function(g){var S;return g?(S=a?a+g:g,this._events[S]&&(--this._eventsCount===0?this._events=new o:delete this._events[S])):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prototype.setMaxListeners=function(){return this},u.prefixed=a,u.EventEmitter=u,typeof r<"u"&&(r.exports=u)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(oe){return typeof oe}:function(oe){return oe&&typeof Symbol=="function"&&oe.constructor===Symbol&&oe!==Symbol.prototype?"symbol":typeof oe},o=function(){function oe(ue,ve){var Ee=[],re=!0,de=!1,me=void 0;try{for(var Se=ue[Symbol.iterator](),Te;!(re=(Te=Se.next()).done)&&(Ee.push(Te.value),!(ve&&Ee.length===ve));re=!0);}catch(ze){de=!0,me=ze}finally{try{!re&&Se.return&&Se.return()}finally{if(de)throw me}}return Ee}return function(ue,ve){if(Array.isArray(ue))return ue;if(Symbol.iterator in Object(ue))return oe(ue,ve);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function oe(ue,ve){for(var Ee=0;Ee<ve.length;Ee++){var re=ve[Ee];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(ue,re.key,re)}}return function(ue,ve,Ee){return ve&&oe(ue.prototype,ve),Ee&&oe(ue,Ee),ue}}(),u=i(3),f=M(u),g=i(2),S=M(g),_=i(0),h=M(_),w=i(5),m=M(w),y=i(10),p=M(y),v=i(9),d=M(v),b=i(36),O=i(37),R=i(13),T=M(R),E=i(26),P=i(38),x=i(39),k=i(40);function M(oe){return oe&&oe.__esModule?oe:{default:oe}}function j(oe,ue,ve){return ue in oe?Object.defineProperty(oe,ue,{value:ve,enumerable:!0,configurable:!0,writable:!0}):oe[ue]=ve,oe}function B(oe,ue){if(!(oe instanceof ue))throw new TypeError("Cannot call a class as a function")}function $(oe,ue){if(!oe)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ue&&(typeof ue=="object"||typeof ue=="function")?ue:oe}function Z(oe,ue){if(typeof ue!="function"&&ue!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ue);oe.prototype=Object.create(ue&&ue.prototype,{constructor:{value:oe,enumerable:!1,writable:!0,configurable:!0}}),ue&&(Object.setPrototypeOf?Object.setPrototypeOf(oe,ue):oe.__proto__=ue)}var K=(0,p.default)("quill:clipboard"),D="__ql-matcher",q=[[Node.TEXT_NODE,Fe],[Node.TEXT_NODE,ie],["br",te],[Node.ELEMENT_NODE,ie],[Node.ELEMENT_NODE,Q],[Node.ELEMENT_NODE,le],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,xe],["li",ne],["b",Y.bind(Y,"bold")],["i",Y.bind(Y,"italic")],["style",ee]],A=[b.AlignAttribute,P.DirectionAttribute].reduce(function(oe,ue){return oe[ue.keyName]=ue,oe},{}),L=[b.AlignStyle,O.BackgroundStyle,E.ColorStyle,P.DirectionStyle,x.FontStyle,k.SizeStyle].reduce(function(oe,ue){return oe[ue.keyName]=ue,oe},{}),z=function(oe){Z(ue,oe);function ue(ve,Ee){B(this,ue);var re=$(this,(ue.__proto__||Object.getPrototypeOf(ue)).call(this,ve,Ee));return re.quill.root.addEventListener("paste",re.onPaste.bind(re)),re.container=re.quill.addContainer("ql-clipboard"),re.container.setAttribute("contenteditable",!0),re.container.setAttribute("tabindex",-1),re.matchers=[],q.concat(re.options.matchers).forEach(function(de){var me=o(de,2),Se=me[0],Te=me[1];!Ee.matchVisual&&Te===le||re.addMatcher(Se,Te)}),re}return l(ue,[{key:"addMatcher",value:function(Ee,re){this.matchers.push([Ee,re])}},{key:"convert",value:function(Ee){if(typeof Ee=="string")return this.container.innerHTML=Ee.replace(/\>\r?\n +\</g,"><"),this.convert();var re=this.quill.getFormat(this.quill.selection.savedRange.index);if(re[T.default.blotName]){var de=this.container.innerText;return this.container.innerHTML="",new S.default().insert(de,j({},T.default.blotName,re[T.default.blotName]))}var me=this.prepareMatching(),Se=o(me,2),Te=Se[0],ze=Se[1],Re=U(this.container,Te,ze);return W(Re,`
|
|
133
|
+
`)&&Re.ops[Re.ops.length-1].attributes==null&&(Re=Re.compose(new S.default().retain(Re.length()-1).delete(1))),K.log("convert",this.container.innerHTML,Re),this.container.innerHTML="",Re}},{key:"dangerouslyPasteHTML",value:function(Ee,re){var de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.default.sources.API;if(typeof Ee=="string")this.quill.setContents(this.convert(Ee),re),this.quill.setSelection(0,m.default.sources.SILENT);else{var me=this.convert(re);this.quill.updateContents(new S.default().retain(Ee).concat(me),de),this.quill.setSelection(Ee+me.length(),m.default.sources.SILENT)}}},{key:"onPaste",value:function(Ee){var re=this;if(!(Ee.defaultPrevented||!this.quill.isEnabled())){var de=this.quill.getSelection(),me=new S.default().retain(de.index),Se=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(m.default.sources.SILENT),setTimeout(function(){me=me.concat(re.convert()).delete(de.length),re.quill.updateContents(me,m.default.sources.USER),re.quill.setSelection(me.length()-de.length,m.default.sources.SILENT),re.quill.scrollingContainer.scrollTop=Se,re.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Ee=this,re=[],de=[];return this.matchers.forEach(function(me){var Se=o(me,2),Te=Se[0],ze=Se[1];switch(Te){case Node.TEXT_NODE:de.push(ze);break;case Node.ELEMENT_NODE:re.push(ze);break;default:[].forEach.call(Ee.container.querySelectorAll(Te),function(Re){Re[D]=Re[D]||[],Re[D].push(ze)});break}}),[re,de]}}]),ue}(d.default);z.DEFAULTS={matchers:[],matchVisual:!0};function I(oe,ue,ve){return(typeof ue>"u"?"undefined":a(ue))==="object"?Object.keys(ue).reduce(function(Ee,re){return I(Ee,re,ue[re])},oe):oe.reduce(function(Ee,re){return re.attributes&&re.attributes[ue]?Ee.push(re):Ee.insert(re.insert,(0,f.default)({},j({},ue,ve),re.attributes))},new S.default)}function H(oe){if(oe.nodeType!==Node.ELEMENT_NODE)return{};var ue="__ql-computed-style";return oe[ue]||(oe[ue]=window.getComputedStyle(oe))}function W(oe,ue){for(var ve="",Ee=oe.ops.length-1;Ee>=0&&ve.length<ue.length;--Ee){var re=oe.ops[Ee];if(typeof re.insert!="string")break;ve=re.insert+ve}return ve.slice(-1*ue.length)===ue}function V(oe){if(oe.childNodes.length===0)return!1;var ue=H(oe);return["block","list-item"].indexOf(ue.display)>-1}function U(oe,ue,ve){return oe.nodeType===oe.TEXT_NODE?ve.reduce(function(Ee,re){return re(oe,Ee)},new S.default):oe.nodeType===oe.ELEMENT_NODE?[].reduce.call(oe.childNodes||[],function(Ee,re){var de=U(re,ue,ve);return re.nodeType===oe.ELEMENT_NODE&&(de=ue.reduce(function(me,Se){return Se(re,me)},de),de=(re[D]||[]).reduce(function(me,Se){return Se(re,me)},de)),Ee.concat(de)},new S.default):new S.default}function Y(oe,ue,ve){return I(ve,oe,!0)}function X(oe,ue){var ve=h.default.Attributor.Attribute.keys(oe),Ee=h.default.Attributor.Class.keys(oe),re=h.default.Attributor.Style.keys(oe),de={};return ve.concat(Ee).concat(re).forEach(function(me){var Se=h.default.query(me,h.default.Scope.ATTRIBUTE);Se!=null&&(de[Se.attrName]=Se.value(oe),de[Se.attrName])||(Se=A[me],Se!=null&&(Se.attrName===me||Se.keyName===me)&&(de[Se.attrName]=Se.value(oe)||void 0),Se=L[me],Se!=null&&(Se.attrName===me||Se.keyName===me)&&(Se=L[me],de[Se.attrName]=Se.value(oe)||void 0))}),Object.keys(de).length>0&&(ue=I(ue,de)),ue}function Q(oe,ue){var ve=h.default.query(oe);if(ve==null)return ue;if(ve.prototype instanceof h.default.Embed){var Ee={},re=ve.value(oe);re!=null&&(Ee[ve.blotName]=re,ue=new S.default().insert(Ee,ve.formats(oe)))}else typeof ve.formats=="function"&&(ue=I(ue,ve.blotName,ve.formats(oe)));return ue}function te(oe,ue){return W(ue,`
|
|
134
|
+
`)||ue.insert(`
|
|
135
|
+
`),ue}function ee(){return new S.default}function ne(oe,ue){var ve=h.default.query(oe);if(ve==null||ve.blotName!=="list-item"||!W(ue,`
|
|
136
|
+
`))return ue;for(var Ee=-1,re=oe.parentNode;!re.classList.contains("ql-clipboard");)(h.default.query(re)||{}).blotName==="list"&&(Ee+=1),re=re.parentNode;return Ee<=0?ue:ue.compose(new S.default().retain(ue.length()-1).retain(1,{indent:Ee}))}function ie(oe,ue){return W(ue,`
|
|
137
|
+
`)||(V(oe)||ue.length()>0&&oe.nextSibling&&V(oe.nextSibling))&&ue.insert(`
|
|
138
|
+
`),ue}function le(oe,ue){if(V(oe)&&oe.nextElementSibling!=null&&!W(ue,`
|
|
139
|
+
|
|
140
|
+
`)){var ve=oe.offsetHeight+parseFloat(H(oe).marginTop)+parseFloat(H(oe).marginBottom);oe.nextElementSibling.offsetTop>oe.offsetTop+ve*1.5&&ue.insert(`
|
|
141
|
+
`)}return ue}function xe(oe,ue){var ve={},Ee=oe.style||{};return Ee.fontStyle&&H(oe).fontStyle==="italic"&&(ve.italic=!0),Ee.fontWeight&&(H(oe).fontWeight.startsWith("bold")||parseInt(H(oe).fontWeight)>=700)&&(ve.bold=!0),Object.keys(ve).length>0&&(ue=I(ue,ve)),parseFloat(Ee.textIndent||0)>0&&(ue=new S.default().insert(" ").concat(ue)),ue}function Fe(oe,ue){var ve=oe.data;if(oe.parentNode.tagName==="O:P")return ue.insert(ve.trim());if(ve.trim().length===0&&oe.parentNode.classList.contains("ql-clipboard"))return ue;if(!H(oe.parentNode).whiteSpace.startsWith("pre")){var Ee=function(de,me){return me=me.replace(/[^\u00a0]/g,""),me.length<1&&de?" ":me};ve=ve.replace(/\r\n/g," ").replace(/\n/g," "),ve=ve.replace(/\s\s+/g,Ee.bind(Ee,!0)),(oe.previousSibling==null&&V(oe.parentNode)||oe.previousSibling!=null&&V(oe.previousSibling))&&(ve=ve.replace(/^\s+/,Ee.bind(Ee,!1))),(oe.nextSibling==null&&V(oe.parentNode)||oe.nextSibling!=null&&V(oe.nextSibling))&&(ve=ve.replace(/\s+$/,Ee.bind(Ee,!1)))}return ue.insert(ve)}n.default=z,n.matchAttributor=X,n.matchBlot=Q,n.matchNewline=ie,n.matchSpacing=le,n.matchText=Fe},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function w(m,y){for(var p=0;p<y.length;p++){var v=y[p];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(m,v.key,v)}}return function(m,y,p){return y&&w(m.prototype,y),p&&w(m,p),m}}(),o=function w(m,y,p){m===null&&(m=Function.prototype);var v=Object.getOwnPropertyDescriptor(m,y);if(v===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:w(d,y,p)}else{if("value"in v)return v.value;var b=v.get;return b===void 0?void 0:b.call(p)}},l=i(6),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function g(w,m){if(!(w instanceof m))throw new TypeError("Cannot call a class as a function")}function S(w,m){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:w}function _(w,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);w.prototype=Object.create(m&&m.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(w,m):w.__proto__=m)}var h=function(w){_(m,w);function m(){return g(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"optimize",value:function(p){o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"optimize",this).call(this,p),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),m}(u.default);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 k(M,j){var B=[],$=!0,Z=!1,K=void 0;try{for(var D=M[Symbol.iterator](),q;!($=(q=D.next()).done)&&(B.push(q.value),!(j&&B.length===j));$=!0);}catch(A){Z=!0,K=A}finally{try{!$&&D.return&&D.return()}finally{if(Z)throw K}}return B}return function(M,j){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return k(M,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function k(M,j){for(var B=0;B<j.length;B++){var $=j[B];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(M,$.key,$)}}return function(M,j,B){return j&&k(M.prototype,j),B&&k(M,B),M}}(),l=i(2),u=p(l),f=i(0),g=p(f),S=i(5),_=p(S),h=i(10),w=p(h),m=i(9),y=p(m);function p(k){return k&&k.__esModule?k:{default:k}}function v(k,M,j){return M in k?Object.defineProperty(k,M,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[M]=j,k}function d(k,M){if(!(k instanceof M))throw new TypeError("Cannot call a class as a function")}function b(k,M){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:k}function O(k,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);k.prototype=Object.create(M&&M.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(k,M):k.__proto__=M)}var R=(0,w.default)("quill:toolbar"),T=function(k){O(M,k);function M(j,B){d(this,M);var $=b(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,j,B));if(Array.isArray($.options.container)){var Z=document.createElement("div");P(Z,$.options.container),j.container.parentNode.insertBefore(Z,j.container),$.container=Z}else typeof $.options.container=="string"?$.container=document.querySelector($.options.container):$.container=$.options.container;if(!($.container instanceof HTMLElement)){var K;return K=R.error("Container required for toolbar",$.options),b($,K)}return $.container.classList.add("ql-toolbar"),$.controls=[],$.handlers={},Object.keys($.options.handlers).forEach(function(D){$.addHandler(D,$.options.handlers[D])}),[].forEach.call($.container.querySelectorAll("button, select"),function(D){$.attach(D)}),$.quill.on(_.default.events.EDITOR_CHANGE,function(D,q){D===_.default.events.SELECTION_CHANGE&&$.update(q)}),$.quill.on(_.default.events.SCROLL_OPTIMIZE,function(){var D=$.quill.selection.getRange(),q=a(D,1),A=q[0];$.update(A)}),$}return o(M,[{key:"addHandler",value:function(B,$){this.handlers[B]=$}},{key:"attach",value:function(B){var $=this,Z=[].find.call(B.classList,function(D){return D.indexOf("ql-")===0});if(Z){if(Z=Z.slice(3),B.tagName==="BUTTON"&&B.setAttribute("type","button"),this.handlers[Z]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[Z]==null){R.warn("ignoring attaching to disabled format",Z,B);return}if(g.default.query(Z)==null){R.warn("ignoring attaching to nonexistent format",Z,B);return}}var K=B.tagName==="SELECT"?"change":"click";B.addEventListener(K,function(D){var q=void 0;if(B.tagName==="SELECT"){if(B.selectedIndex<0)return;var A=B.options[B.selectedIndex];A.hasAttribute("selected")?q=!1:q=A.value||!1}else B.classList.contains("ql-active")?q=!1:q=B.value||!B.hasAttribute("value"),D.preventDefault();$.quill.focus();var L=$.quill.selection.getRange(),z=a(L,1),I=z[0];if($.handlers[Z]!=null)$.handlers[Z].call($,q);else if(g.default.query(Z).prototype instanceof g.default.Embed){if(q=prompt("Enter "+Z),!q)return;$.quill.updateContents(new u.default().retain(I.index).delete(I.length).insert(v({},Z,q)),_.default.sources.USER)}else $.quill.format(Z,q,_.default.sources.USER);$.update(I)}),this.controls.push([Z,B])}}},{key:"update",value:function(B){var $=B==null?{}:this.quill.getFormat(B);this.controls.forEach(function(Z){var K=a(Z,2),D=K[0],q=K[1];if(q.tagName==="SELECT"){var A=void 0;if(B==null)A=null;else if($[D]==null)A=q.querySelector("option[selected]");else if(!Array.isArray($[D])){var L=$[D];typeof L=="string"&&(L=L.replace(/\"/g,'\\"')),A=q.querySelector('option[value="'+L+'"]')}A==null?(q.value="",q.selectedIndex=-1):A.selected=!0}else if(B==null)q.classList.remove("ql-active");else if(q.hasAttribute("value")){var z=$[D]===q.getAttribute("value")||$[D]!=null&&$[D].toString()===q.getAttribute("value")||$[D]==null&&!q.getAttribute("value");q.classList.toggle("ql-active",z)}else q.classList.toggle("ql-active",$[D]!=null)})}}]),M}(y.default);T.DEFAULTS={};function E(k,M,j){var B=document.createElement("button");B.setAttribute("type","button"),B.classList.add("ql-"+M),j!=null&&(B.value=j),k.appendChild(B)}function P(k,M){Array.isArray(M[0])||(M=[M]),M.forEach(function(j){var B=document.createElement("span");B.classList.add("ql-formats"),j.forEach(function($){if(typeof $=="string")E(B,$);else{var Z=Object.keys($)[0],K=$[Z];Array.isArray(K)?x(B,Z,K):E(B,Z,K)}}),k.appendChild(B)})}function x(k,M,j){var B=document.createElement("select");B.classList.add("ql-"+M),j.forEach(function($){var Z=document.createElement("option");$!==!1?Z.setAttribute("value",$):Z.setAttribute("selected","selected"),B.appendChild(Z)}),k.appendChild(B)}T.DEFAULTS={container:null,handlers:{clean:function(){var M=this,j=this.quill.getSelection();if(j!=null)if(j.length==0){var B=this.quill.getFormat();Object.keys(B).forEach(function($){g.default.query($,g.default.Scope.INLINE)!=null&&M.quill.format($,!1)})}else this.quill.removeFormat(j,_.default.sources.USER)},direction:function(M){var j=this.quill.getFormat().align;M==="rtl"&&j==null?this.quill.format("align","right",_.default.sources.USER):!M&&j==="right"&&this.quill.format("align",!1,_.default.sources.USER),this.quill.format("direction",M,_.default.sources.USER)},indent:function(M){var j=this.quill.getSelection(),B=this.quill.getFormat(j),$=parseInt(B.indent||0);if(M==="+1"||M==="-1"){var Z=M==="+1"?1:-1;B.direction==="rtl"&&(Z*=-1),this.quill.format("indent",$+Z,_.default.sources.USER)}},link:function(M){M===!0&&(M=prompt("Enter link URL:")),this.quill.format("link",M,_.default.sources.USER)},list:function(M){var j=this.quill.getSelection(),B=this.quill.getFormat(j);M==="check"?B.list==="checked"||B.list==="unchecked"?this.quill.format("list",!1,_.default.sources.USER):this.quill.format("list","unchecked",_.default.sources.USER):this.quill.format("list",M,_.default.sources.USER)}}},n.default=T,n.addControls=P},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(m,y){for(var p=0;p<y.length;p++){var v=y[p];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(m,v.key,v)}}return function(m,y,p){return y&&w(m.prototype,y),p&&w(m,p),m}}(),o=function w(m,y,p){m===null&&(m=Function.prototype);var v=Object.getOwnPropertyDescriptor(m,y);if(v===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:w(d,y,p)}else{if("value"in v)return v.value;var b=v.get;return b===void 0?void 0:b.call(p)}},l=i(28),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function g(w,m){if(!(w instanceof m))throw new TypeError("Cannot call a class as a function")}function S(w,m){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:w}function _(w,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);w.prototype=Object.create(m&&m.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(w,m):w.__proto__=m)}var h=function(w){_(m,w);function m(y,p){g(this,m);var v=S(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,y));return v.label.innerHTML=p,v.container.classList.add("ql-color-picker"),[].slice.call(v.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(d){d.classList.add("ql-primary")}),v}return a(m,[{key:"buildItem",value:function(p){var v=o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"buildItem",this).call(this,p);return v.style.backgroundColor=p.getAttribute("value")||"",v}},{key:"selectItem",value:function(p,v){o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"selectItem",this).call(this,p,v);var d=this.label.querySelector(".ql-color-label"),b=p&&p.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=b:d.style.fill=b)}}]),m}(u.default);n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function w(m,y){for(var p=0;p<y.length;p++){var v=y[p];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(m,v.key,v)}}return function(m,y,p){return y&&w(m.prototype,y),p&&w(m,p),m}}(),o=function w(m,y,p){m===null&&(m=Function.prototype);var v=Object.getOwnPropertyDescriptor(m,y);if(v===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:w(d,y,p)}else{if("value"in v)return v.value;var b=v.get;return b===void 0?void 0:b.call(p)}},l=i(28),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function g(w,m){if(!(w instanceof m))throw new TypeError("Cannot call a class as a function")}function S(w,m){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:w}function _(w,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);w.prototype=Object.create(m&&m.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(w,m):w.__proto__=m)}var h=function(w){_(m,w);function m(y,p){g(this,m);var v=S(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,y));return v.container.classList.add("ql-icon-picker"),[].forEach.call(v.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=p[d.getAttribute("data-value")||""]}),v.defaultItem=v.container.querySelector(".ql-selected"),v.selectItem(v.defaultItem),v}return a(m,[{key:"selectItem",value:function(p,v){o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"selectItem",this).call(this,p,v),p=p||this.defaultItem,this.label.innerHTML=p.innerHTML}}]),m}(u.default);n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,g){for(var S=0;S<g.length;S++){var _=g[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(f,_.key,_)}}return function(f,g,S){return g&&u(f.prototype,g),S&&u(f,S),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,g){var S=this;o(this,u),this.quill=f,this.boundsContainer=g||document.body,this.root=f.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){S.root.style.marginTop=-1*S.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(g){var S=g.left+g.width/2-this.root.offsetWidth/2,_=g.bottom+this.quill.root.scrollTop;this.root.style.left=S+"px",this.root.style.top=_+"px",this.root.classList.remove("ql-flip");var h=this.boundsContainer.getBoundingClientRect(),w=this.root.getBoundingClientRect(),m=0;if(w.right>h.right&&(m=h.right-w.right,this.root.style.left=S+m+"px"),w.left<h.left&&(m=h.left-w.left,this.root.style.left=S+m+"px"),w.bottom>h.bottom){var y=w.bottom-w.top,p=g.bottom-g.top+y;this.root.style.top=_-p+"px",this.root.classList.add("ql-flip")}return m}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(k,M){var j=[],B=!0,$=!1,Z=void 0;try{for(var K=k[Symbol.iterator](),D;!(B=(D=K.next()).done)&&(j.push(D.value),!(M&&j.length===M));B=!0);}catch(q){$=!0,Z=q}finally{try{!B&&K.return&&K.return()}finally{if($)throw Z}}return j}return function(k,M){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return x(k,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function x(k,M,j){k===null&&(k=Function.prototype);var B=Object.getOwnPropertyDescriptor(k,M);if(B===void 0){var $=Object.getPrototypeOf(k);return $===null?void 0:x($,M,j)}else{if("value"in B)return B.value;var Z=B.get;return Z===void 0?void 0:Z.call(j)}},l=function(){function x(k,M){for(var j=0;j<M.length;j++){var B=M[j];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(k,B.key,B)}}return function(k,M,j){return M&&x(k.prototype,M),j&&x(k,j),k}}(),u=i(3),f=d(u),g=i(8),S=d(g),_=i(43),h=d(_),w=i(27),m=d(w),y=i(15),p=i(41),v=d(p);function d(x){return x&&x.__esModule?x:{default:x}}function b(x,k){if(!(x instanceof k))throw new TypeError("Cannot call a class as a function")}function O(x,k){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:x}function R(x,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);x.prototype=Object.create(k&&k.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(x,k):x.__proto__=k)}var T=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],E=function(x){R(k,x);function k(M,j){b(this,k),j.modules.toolbar!=null&&j.modules.toolbar.container==null&&(j.modules.toolbar.container=T);var B=O(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,M,j));return B.quill.container.classList.add("ql-snow"),B}return l(k,[{key:"extendToolbar",value:function(j){j.container.classList.add("ql-snow"),this.buildButtons([].slice.call(j.container.querySelectorAll("button")),v.default),this.buildPickers([].slice.call(j.container.querySelectorAll("select")),v.default),this.tooltip=new P(this.quill,this.options.bounds),j.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(B,$){j.handlers.link.call(j,!$.format.link)})}}]),k}(h.default);E.DEFAULTS=(0,f.default)(!0,{},h.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(k){if(k){var M=this.quill.getSelection();if(M==null||M.length==0)return;var j=this.quill.getText(M);/^\S+@\S+\.\S+$/.test(j)&&j.indexOf("mailto:")!==0&&(j="mailto:"+j);var B=this.quill.theme.tooltip;B.edit("link",j)}else this.quill.format("link",!1)}}}}});var P=function(x){R(k,x);function k(M,j){b(this,k);var B=O(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,M,j));return B.preview=B.root.querySelector("a.ql-preview"),B}return l(k,[{key:"listen",value:function(){var j=this;o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(B){j.root.classList.contains("ql-editing")?j.save():j.edit("link",j.preview.textContent),B.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(B){if(j.linkRange!=null){var $=j.linkRange;j.restoreFocus(),j.quill.formatText($,"link",!1,S.default.sources.USER),delete j.linkRange}B.preventDefault(),j.hide()}),this.quill.on(S.default.events.SELECTION_CHANGE,function(B,$,Z){if(B!=null){if(B.length===0&&Z===S.default.sources.USER){var K=j.quill.scroll.descendant(m.default,B.index),D=a(K,2),q=D[0],A=D[1];if(q!=null){j.linkRange=new y.Range(B.index-A,q.length());var L=m.default.formats(q.domNode);j.preview.textContent=L,j.preview.setAttribute("href",L),j.show(),j.position(j.quill.getBounds(j.linkRange));return}}else delete j.linkRange;j.hide()}})}},{key:"show",value:function(){o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),k}(_.BaseTooltip);P.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=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(29),o=re(a),l=i(36),u=i(38),f=i(64),g=i(65),S=re(g),_=i(66),h=re(_),w=i(67),m=re(w),y=i(37),p=i(26),v=i(39),d=i(40),b=i(56),O=re(b),R=i(68),T=re(R),E=i(27),P=re(E),x=i(69),k=re(x),M=i(70),j=re(M),B=i(71),$=re(B),Z=i(72),K=re(Z),D=i(73),q=re(D),A=i(13),L=re(A),z=i(74),I=re(z),H=i(75),W=re(H),V=i(57),U=re(V),Y=i(41),X=re(Y),Q=i(28),te=re(Q),ee=i(59),ne=re(ee),ie=i(60),le=re(ie),xe=i(61),Fe=re(xe),oe=i(108),ue=re(oe),ve=i(62),Ee=re(ve);function re(de){return de&&de.__esModule?de:{default:de}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":y.BackgroundClass,"attributors/class/color":p.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":v.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":y.BackgroundStyle,"attributors/style/color":p.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":v.FontStyle,"attributors/style/size":d.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":f.IndentClass,"formats/background":y.BackgroundStyle,"formats/color":p.ColorStyle,"formats/font":v.FontClass,"formats/size":d.SizeClass,"formats/blockquote":S.default,"formats/code-block":L.default,"formats/header":h.default,"formats/list":m.default,"formats/bold":O.default,"formats/code":A.Code,"formats/italic":T.default,"formats/link":P.default,"formats/script":k.default,"formats/strike":j.default,"formats/underline":$.default,"formats/image":K.default,"formats/video":q.default,"formats/list/item":w.ListItem,"modules/formula":I.default,"modules/syntax":W.default,"modules/toolbar":U.default,"themes/bubble":ue.default,"themes/snow":Ee.default,"ui/icons":X.default,"ui/picker":te.default,"ui/icon-picker":le.default,"ui/color-picker":ne.default,"ui/tooltip":Fe.default},!0),n.default=o.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=function(){function m(y,p){for(var v=0;v<p.length;v++){var d=p[v];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(y,d.key,d)}}return function(y,p,v){return p&&m(y.prototype,p),v&&m(y,v),y}}(),o=function m(y,p,v){y===null&&(y=Function.prototype);var d=Object.getOwnPropertyDescriptor(y,p);if(d===void 0){var b=Object.getPrototypeOf(y);return b===null?void 0:m(b,p,v)}else{if("value"in d)return d.value;var O=d.get;return O===void 0?void 0:O.call(v)}},l=i(0),u=f(l);function f(m){return m&&m.__esModule?m:{default:m}}function g(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 _(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 h=function(m){_(y,m);function y(){return g(this,y),S(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"add",value:function(v,d){if(d==="+1"||d==="-1"){var b=this.value(v)||0;d=d==="+1"?b+1:b-1}return d===0?(this.remove(v),!0):o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"add",this).call(this,v,d)}},{key:"canAdd",value:function(v,d){return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"canAdd",this).call(this,v,d)||o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"canAdd",this).call(this,v,parseInt(d))}},{key:"value",value:function(v){return parseInt(o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,v))||void 0}}]),y}(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(_){return _&&_.__esModule?_:{default:_}}function u(_,h){if(!(_ instanceof h))throw new TypeError("Cannot call a class as a function")}function f(_,h){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:_}function g(_,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);_.prototype=Object.create(h&&h.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(_,h):_.__proto__=h)}var S=function(_){g(h,_);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);S.blotName="blockquote",S.tagName="blockquote",n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function h(w,m){for(var y=0;y<m.length;y++){var p=m[y];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(w,p.key,p)}}return function(w,m,y){return m&&h(w.prototype,m),y&&h(w,y),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 g(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 S(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 _=function(h){S(w,h);function w(){return f(this,w),g(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return a(w,null,[{key:"formats",value:function(y){return this.tagName.indexOf(y.tagName)+1}}]),w}(l.default);_.blotName="header",_.tagName=["H1","H2","H3","H4","H5","H6"],n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function b(O,R){for(var T=0;T<R.length;T++){var E=R[T];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(O,E.key,E)}}return function(O,R,T){return R&&b(O.prototype,R),T&&b(O,T),O}}(),o=function b(O,R,T){O===null&&(O=Function.prototype);var E=Object.getOwnPropertyDescriptor(O,R);if(E===void 0){var P=Object.getPrototypeOf(O);return P===null?void 0:b(P,R,T)}else{if("value"in E)return E.value;var x=E.get;return x===void 0?void 0:x.call(T)}},l=i(0),u=h(l),f=i(4),g=h(f),S=i(25),_=h(S);function h(b){return b&&b.__esModule?b:{default:b}}function w(b,O,R){return O in b?Object.defineProperty(b,O,{value:R,enumerable:!0,configurable:!0,writable:!0}):b[O]=R,b}function m(b,O){if(!(b instanceof O))throw new TypeError("Cannot call a class as a function")}function y(b,O){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:b}function p(b,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);b.prototype=Object.create(O&&O.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(b,O):b.__proto__=O)}var v=function(b){p(O,b);function O(){return m(this,O),y(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return a(O,[{key:"format",value:function(T,E){T===d.blotName&&!E?this.replaceWith(u.default.create(this.statics.scope)):o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"format",this).call(this,T,E)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(T,E){return this.parent.isolate(this.offset(this.parent),this.length()),T===this.parent.statics.blotName?(this.parent.replaceWith(T,E),this):(this.parent.unwrap(),o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,T,E))}}],[{key:"formats",value:function(T){return T.tagName===this.tagName?void 0:o(O.__proto__||Object.getPrototypeOf(O),"formats",this).call(this,T)}}]),O}(g.default);v.blotName="list-item",v.tagName="LI";var d=function(b){p(O,b),a(O,null,[{key:"create",value:function(T){var E=T==="ordered"?"OL":"UL",P=o(O.__proto__||Object.getPrototypeOf(O),"create",this).call(this,E);return(T==="checked"||T==="unchecked")&&P.setAttribute("data-checked",T==="checked"),P}},{key:"formats",value:function(T){if(T.tagName==="OL")return"ordered";if(T.tagName==="UL")return T.hasAttribute("data-checked")?T.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function O(R){m(this,O);var T=y(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,R)),E=function(x){if(x.target.parentNode===R){var k=T.statics.formats(R),M=u.default.find(x.target);k==="checked"?M.format("list","unchecked"):k==="unchecked"&&M.format("list","checked")}};return R.addEventListener("touchstart",E),R.addEventListener("mousedown",E),T}return a(O,[{key:"format",value:function(T,E){this.children.length>0&&this.children.tail.format(T,E)}},{key:"formats",value:function(){return w({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(T,E){if(T instanceof v)o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,T,E);else{var P=E==null?this.length():E.offset(this),x=this.split(P);x.parent.insertBefore(T,x)}}},{key:"optimize",value:function(T){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,T);var E=this.next;E!=null&&E.prev===this&&E.statics.blotName===this.statics.blotName&&E.domNode.tagName===this.domNode.tagName&&E.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(E.moveChildren(this),E.remove())}},{key:"replace",value:function(T){if(T.statics.blotName!==this.statics.blotName){var E=u.default.create(this.statics.defaultChild);T.moveChildren(E),this.appendChild(E)}o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replace",this).call(this,T)}}]),O}(_.default);d.blotName="list",d.scope=u.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[v],n.ListItem=v,n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}function u(_,h){if(!(_ instanceof h))throw new TypeError("Cannot call a class as a function")}function f(_,h){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:_}function g(_,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);_.prototype=Object.create(h&&h.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(_,h):_.__proto__=h)}var S=function(_){g(h,_);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);S.blotName="italic",S.tagName=["EM","I"],n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function w(m,y){for(var p=0;p<y.length;p++){var v=y[p];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(m,v.key,v)}}return function(m,y,p){return y&&w(m.prototype,y),p&&w(m,p),m}}(),o=function w(m,y,p){m===null&&(m=Function.prototype);var v=Object.getOwnPropertyDescriptor(m,y);if(v===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:w(d,y,p)}else{if("value"in v)return v.value;var b=v.get;return b===void 0?void 0:b.call(p)}},l=i(6),u=f(l);function f(w){return w&&w.__esModule?w:{default:w}}function g(w,m){if(!(w instanceof m))throw new TypeError("Cannot call a class as a function")}function S(w,m){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:w}function _(w,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);w.prototype=Object.create(m&&m.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(w,m):w.__proto__=m)}var h=function(w){_(m,w);function m(){return g(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,null,[{key:"create",value:function(p){return p==="super"?document.createElement("sup"):p==="sub"?document.createElement("sub"):o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,p)}},{key:"formats",value:function(p){if(p.tagName==="SUB")return"sub";if(p.tagName==="SUP")return"super"}}]),m}(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(_){return _&&_.__esModule?_:{default:_}}function u(_,h){if(!(_ instanceof h))throw new TypeError("Cannot call a class as a function")}function f(_,h){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:_}function g(_,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);_.prototype=Object.create(h&&h.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(_,h):_.__proto__=h)}var S=function(_){g(h,_);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);S.blotName="strike",S.tagName="S",n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}function u(_,h){if(!(_ instanceof h))throw new TypeError("Cannot call a class as a function")}function f(_,h){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:_}function g(_,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);_.prototype=Object.create(h&&h.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(_,h):_.__proto__=h)}var S=function(_){g(h,_);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);S.blotName="underline",S.tagName="U",n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(p,v){for(var d=0;d<v.length;d++){var b=v[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(p,b.key,b)}}return function(p,v,d){return v&&y(p.prototype,v),d&&y(p,d),p}}(),o=function y(p,v,d){p===null&&(p=Function.prototype);var b=Object.getOwnPropertyDescriptor(p,v);if(b===void 0){var O=Object.getPrototypeOf(p);return O===null?void 0:y(O,v,d)}else{if("value"in b)return b.value;var R=b.get;return R===void 0?void 0:R.call(d)}},l=i(0),u=g(l),f=i(27);function g(y){return y&&y.__esModule?y:{default:y}}function S(y,p){if(!(y instanceof p))throw new TypeError("Cannot call a class as a function")}function _(y,p){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:y}function h(y,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);y.prototype=Object.create(p&&p.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(y,p):y.__proto__=p)}var w=["alt","height","width"],m=function(y){h(p,y);function p(){return S(this,p),_(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"format",value:function(d,b){w.indexOf(d)>-1?b?this.domNode.setAttribute(d,b):this.domNode.removeAttribute(d):o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,d,b)}}],[{key:"create",value:function(d){var b=o(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,d);return typeof d=="string"&&b.setAttribute("src",this.sanitize(d)),b}},{key:"formats",value:function(d){return w.reduce(function(b,O){return d.hasAttribute(O)&&(b[O]=d.getAttribute(O)),b},{})}},{key:"match",value:function(d){return/\.(jpe?g|gif|png)$/.test(d)||/^data:image\/.+;base64/.test(d)}},{key:"sanitize",value:function(d){return(0,f.sanitize)(d,["http","https","data"])?d:"//:0"}},{key:"value",value:function(d){return d.getAttribute("src")}}]),p}(u.default.Embed);m.blotName="image",m.tagName="IMG",n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(p,v){for(var d=0;d<v.length;d++){var b=v[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(p,b.key,b)}}return function(p,v,d){return v&&y(p.prototype,v),d&&y(p,d),p}}(),o=function y(p,v,d){p===null&&(p=Function.prototype);var b=Object.getOwnPropertyDescriptor(p,v);if(b===void 0){var O=Object.getPrototypeOf(p);return O===null?void 0:y(O,v,d)}else{if("value"in b)return b.value;var R=b.get;return R===void 0?void 0:R.call(d)}},l=i(4),u=i(27),f=g(u);function g(y){return y&&y.__esModule?y:{default:y}}function S(y,p){if(!(y instanceof p))throw new TypeError("Cannot call a class as a function")}function _(y,p){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:y}function h(y,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);y.prototype=Object.create(p&&p.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(y,p):y.__proto__=p)}var w=["height","width"],m=function(y){h(p,y);function p(){return S(this,p),_(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"format",value:function(d,b){w.indexOf(d)>-1?b?this.domNode.setAttribute(d,b):this.domNode.removeAttribute(d):o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,d,b)}}],[{key:"create",value:function(d){var b=o(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,d);return b.setAttribute("frameborder","0"),b.setAttribute("allowfullscreen",!0),b.setAttribute("src",this.sanitize(d)),b}},{key:"formats",value:function(d){return w.reduce(function(b,O){return d.hasAttribute(O)&&(b[O]=d.getAttribute(O)),b},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),p}(l.BlockEmbed);m.blotName="video",m.className="ql-video",m.tagName="IFRAME",n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var a=function(){function d(b,O){for(var R=0;R<O.length;R++){var T=O[R];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,O,R){return O&&d(b.prototype,O),R&&d(b,R),b}}(),o=function d(b,O,R){b===null&&(b=Function.prototype);var T=Object.getOwnPropertyDescriptor(b,O);if(T===void 0){var E=Object.getPrototypeOf(b);return E===null?void 0:d(E,O,R)}else{if("value"in T)return T.value;var P=T.get;return P===void 0?void 0:P.call(R)}},l=i(35),u=h(l),f=i(5),g=h(f),S=i(9),_=h(S);function h(d){return d&&d.__esModule?d:{default:d}}function w(d,b){if(!(d instanceof b))throw new TypeError("Cannot call a class as a function")}function m(d,b){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:d}function y(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);d.prototype=Object.create(b&&b.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(d,b):d.__proto__=b)}var p=function(d){y(b,d);function b(){return w(this,b),m(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,null,[{key:"create",value:function(R){var T=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,R);return typeof R=="string"&&(window.katex.render(R,T,{throwOnError:!1,errorColor:"#f00"}),T.setAttribute("data-value",R)),T}},{key:"value",value:function(R){return R.getAttribute("data-value")}}]),b}(u.default);p.blotName="formula",p.className="ql-formula",p.tagName="SPAN";var v=function(d){y(b,d),a(b,null,[{key:"register",value:function(){g.default.register(p,!0)}}]);function b(){w(this,b);var O=m(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return O}return b}(_.default);n.FormulaBlot=p,n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function R(T,E){for(var P=0;P<E.length;P++){var x=E[P];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(T,x.key,x)}}return function(T,E,P){return E&&R(T.prototype,E),P&&R(T,P),T}}(),o=function R(T,E,P){T===null&&(T=Function.prototype);var x=Object.getOwnPropertyDescriptor(T,E);if(x===void 0){var k=Object.getPrototypeOf(T);return k===null?void 0:R(k,E,P)}else{if("value"in x)return x.value;var M=x.get;return M===void 0?void 0:M.call(P)}},l=i(0),u=m(l),f=i(5),g=m(f),S=i(9),_=m(S),h=i(13),w=m(h);function m(R){return R&&R.__esModule?R:{default:R}}function y(R,T){if(!(R instanceof T))throw new TypeError("Cannot call a class as a function")}function p(R,T){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:R}function v(R,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);R.prototype=Object.create(T&&T.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(R,T):R.__proto__=T)}var d=function(R){v(T,R);function T(){return y(this,T),p(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}return a(T,[{key:"replaceWith",value:function(P){this.domNode.textContent=this.domNode.textContent,this.attach(),o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"replaceWith",this).call(this,P)}},{key:"highlight",value:function(P){var x=this.domNode.textContent;this.cachedText!==x&&((x.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=P(x),this.domNode.normalize(),this.attach()),this.cachedText=x)}}]),T}(w.default);d.className="ql-syntax";var b=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),O=function(R){v(T,R),a(T,null,[{key:"register",value:function(){g.default.register(b,!0),g.default.register(d,!0)}}]);function T(E,P){y(this,T);var x=p(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,E,P));if(typeof x.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var k=null;return x.quill.on(g.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(k),k=setTimeout(function(){x.highlight(),k=null},x.options.interval)}),x.highlight(),x}return a(T,[{key:"highlight",value:function(){var P=this;if(!this.quill.selection.composing){this.quill.update(g.default.sources.USER);var x=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(k){k.highlight(P.options.highlight)}),this.quill.update(g.default.sources.SILENT),x!=null&&this.quill.setSelection(x,g.default.sources.SILENT)}}}]),T}(_.default);O.DEFAULTS={highlight:function(){return window.hljs==null?null:function(R){var T=window.hljs.highlightAuto(R);return T.value}}(),interval:1e3},n.CodeBlock=d,n.CodeToken=b,n.default=O},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var a=function T(E,P,x){E===null&&(E=Function.prototype);var k=Object.getOwnPropertyDescriptor(E,P);if(k===void 0){var M=Object.getPrototypeOf(E);return M===null?void 0:T(M,P,x)}else{if("value"in k)return k.value;var j=k.get;return j===void 0?void 0:j.call(x)}},o=function(){function T(E,P){for(var x=0;x<P.length;x++){var k=P[x];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(E,k.key,k)}}return function(E,P,x){return P&&T(E.prototype,P),x&&T(E,x),E}}(),l=i(3),u=y(l),f=i(8),g=y(f),S=i(43),_=y(S),h=i(15),w=i(41),m=y(w);function y(T){return T&&T.__esModule?T:{default:T}}function p(T,E){if(!(T instanceof E))throw new TypeError("Cannot call a class as a function")}function v(T,E){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:T}function d(T,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);T.prototype=Object.create(E&&E.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(T,E):T.__proto__=E)}var b=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],O=function(T){d(E,T);function E(P,x){p(this,E),x.modules.toolbar!=null&&x.modules.toolbar.container==null&&(x.modules.toolbar.container=b);var k=v(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,P,x));return k.quill.container.classList.add("ql-bubble"),k}return o(E,[{key:"extendToolbar",value:function(x){this.tooltip=new R(this.quill,this.options.bounds),this.tooltip.root.appendChild(x.container),this.buildButtons([].slice.call(x.container.querySelectorAll("button")),m.default),this.buildPickers([].slice.call(x.container.querySelectorAll("select")),m.default)}}]),E}(_.default);O.DEFAULTS=(0,u.default)(!0,{},_.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(E){E?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var R=function(T){d(E,T);function E(P,x){p(this,E);var k=v(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,P,x));return k.quill.on(g.default.events.EDITOR_CHANGE,function(M,j,B,$){if(M===g.default.events.SELECTION_CHANGE)if(j!=null&&j.length>0&&$===g.default.sources.USER){k.show(),k.root.style.left="0px",k.root.style.width="",k.root.style.width=k.root.offsetWidth+"px";var Z=k.quill.getLines(j.index,j.length);if(Z.length===1)k.position(k.quill.getBounds(j));else{var K=Z[Z.length-1],D=k.quill.getIndex(K),q=Math.min(K.length()-1,j.index+j.length-D),A=k.quill.getBounds(new h.Range(D,q));k.position(A)}}else document.activeElement!==k.textbox&&k.quill.hasFocus()&&k.hide()}),k}return o(E,[{key:"listen",value:function(){var x=this;a(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){x.root.classList.remove("ql-editing")}),this.quill.on(g.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!x.root.classList.contains("ql-hidden")){var k=x.quill.getSelection();k!=null&&x.position(x.quill.getBounds(k))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(x){var k=a(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"position",this).call(this,x),M=this.root.querySelector(".ql-tooltip-arrow");if(M.style.marginLeft="",k===0)return k;M.style.marginLeft=-1*k-M.offsetWidth/2+"px"}}]),E}(S.BaseTooltip);R.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=R,n.default=O},function(r,n,i){r.exports=i(63)}]).default})})(nS);var ED=nS.exports,iS={},aS={exports:{}},Bo={},Nu={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Nu.exports;var M4;function OD(){return M4||(M4=1,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof ye=="object"&&ye;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,l=2147483647,u=36,f=1,g=26,S=38,_=700,h=72,w=128,m="-",y=/^xn--/,p=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=u-f,O=Math.floor,R=String.fromCharCode,T;function E(A){throw new RangeError(d[A])}function P(A,L){for(var z=A.length,I=[];z--;)I[z]=L(A[z]);return I}function x(A,L){var z=A.split("@"),I="";z.length>1&&(I=z[0]+"@",A=z[1]),A=A.replace(v,".");var H=A.split("."),W=P(H,L).join(".");return I+W}function k(A){for(var L=[],z=0,I=A.length,H,W;z<I;)H=A.charCodeAt(z++),H>=55296&&H<=56319&&z<I?(W=A.charCodeAt(z++),(W&64512)==56320?L.push(((H&1023)<<10)+(W&1023)+65536):(L.push(H),z--)):L.push(H);return L}function M(A){return P(A,function(L){var z="";return L>65535&&(L-=65536,z+=R(L>>>10&1023|55296),L=56320|L&1023),z+=R(L),z}).join("")}function j(A){return A-48<10?A-22:A-65<26?A-65:A-97<26?A-97:u}function B(A,L){return A+22+75*(A<26)-((L!=0)<<5)}function $(A,L,z){var I=0;for(A=z?O(A/_):A>>1,A+=O(A/L);A>b*g>>1;I+=u)A=O(A/b);return O(I+(b+1)*A/(A+S))}function Z(A){var L=[],z=A.length,I,H=0,W=w,V=h,U,Y,X,Q,te,ee,ne,ie,le;for(U=A.lastIndexOf(m),U<0&&(U=0),Y=0;Y<U;++Y)A.charCodeAt(Y)>=128&&E("not-basic"),L.push(A.charCodeAt(Y));for(X=U>0?U+1:0;X<z;){for(Q=H,te=1,ee=u;X>=z&&E("invalid-input"),ne=j(A.charCodeAt(X++)),(ne>=u||ne>O((l-H)/te))&&E("overflow"),H+=ne*te,ie=ee<=V?f:ee>=V+g?g:ee-V,!(ne<ie);ee+=u)le=u-ie,te>O(l/le)&&E("overflow"),te*=le;I=L.length+1,V=$(H-Q,I,Q==0),O(H/I)>l-W&&E("overflow"),W+=O(H/I),H%=I,L.splice(H++,0,W)}return M(L)}function K(A){var L,z,I,H,W,V,U,Y,X,Q,te,ee=[],ne,ie,le,xe;for(A=k(A),ne=A.length,L=w,z=0,W=h,V=0;V<ne;++V)te=A[V],te<128&&ee.push(R(te));for(I=H=ee.length,H&&ee.push(m);I<ne;){for(U=l,V=0;V<ne;++V)te=A[V],te>=L&&te<U&&(U=te);for(ie=I+1,U-L>O((l-z)/ie)&&E("overflow"),z+=(U-L)*ie,L=U,V=0;V<ne;++V)if(te=A[V],te<L&&++z>l&&E("overflow"),te==L){for(Y=z,X=u;Q=X<=W?f:X>=W+g?g:X-W,!(Y<Q);X+=u)xe=Y-Q,le=u-Q,ee.push(R(B(Q+xe%le,0))),Y=O(xe/le);ee.push(R(B(Y,0))),W=$(z,ie,I==H),z=0,++I}++z,++L}return ee.join("")}function D(A){return x(A,function(L){return y.test(L)?Z(L.slice(4).toLowerCase()):L})}function q(A){return x(A,function(L){return p.test(L)?"xn--"+K(L):L})}if(o={version:"1.4.1",ucs2:{decode:k,encode:M},decode:Z,encode:K,toASCII:q,toUnicode:D},n&&i)if(e.exports==n)i.exports=o;else for(T in o)o.hasOwnProperty(T)&&(n[T]=o[T]);else r.punycode=o})(ye)}(Nu,Nu.exports)),Nu.exports}var ag,L4;function PD(){return L4||(L4=1,ag=Error),ag}var og,N4;function xD(){return N4||(N4=1,og=EvalError),og}var lg,I4;function CD(){return I4||(I4=1,lg=RangeError),lg}var sg,D4;function TD(){return D4||(D4=1,sg=ReferenceError),sg}var ug,j4;function oS(){return j4||(j4=1,ug=SyntaxError),ug}var cg,F4;function Wc(){return F4||(F4=1,cg=TypeError),cg}var fg,z4;function kD(){return z4||(z4=1,fg=URIError),fg}var dg,B4;function AD(){return B4||(B4=1,dg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0}),dg}var hg,U4;function RD(){if(U4)return hg;U4=1;var e=typeof Symbol<"u"&&Symbol,t=AD();return hg=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},hg}var pg,H4;function MD(){if(H4)return pg;H4=1;var e={__proto__:null,foo:{}},t=Object;return pg=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)},pg}var gg,$4;function LD(){if($4)return gg;$4=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(u,f){for(var g=[],S=0;S<u.length;S+=1)g[S]=u[S];for(var _=0;_<f.length;_+=1)g[_+u.length]=f[_];return g},a=function(u,f){for(var g=[],S=f,_=0;S<u.length;S+=1,_+=1)g[_]=u[S];return g},o=function(l,u){for(var f="",g=0;g<l.length;g+=1)f+=l[g],g+1<l.length&&(f+=u);return f};return gg=function(u){var f=this;if(typeof f!="function"||t.apply(f)!==n)throw new TypeError(e+f);for(var g=a(arguments,1),S,_=function(){if(this instanceof S){var p=f.apply(this,i(g,arguments));return Object(p)===p?p:this}return f.apply(u,i(g,arguments))},h=r(0,f.length-g.length),w=[],m=0;m<h;m++)w[m]="$"+m;if(S=Function("binder","return function ("+o(w,",")+"){ return binder.apply(this,arguments); }")(_),f.prototype){var y=function(){};y.prototype=f.prototype,S.prototype=new y,y.prototype=null}return S},gg}var vg,G4;function h2(){if(G4)return vg;G4=1;var e=LD();return vg=Function.prototype.bind||e,vg}var mg,V4;function ND(){if(V4)return mg;V4=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=h2();return mg=r.call(e,t),mg}var yg,q4;function Xs(){if(q4)return yg;q4=1;var e,t=PD(),r=xD(),n=CD(),i=TD(),a=oS(),o=Wc(),l=kD(),u=Function,f=function(K){try{return u('"use strict"; return ('+K+").constructor;")()}catch{}},g=Object.getOwnPropertyDescriptor;if(g)try{g({},"")}catch{g=null}var S=function(){throw new o},_=g?function(){try{return arguments.callee,S}catch{try{return g(arguments,"callee").get}catch{return S}}}():S,h=RD()(),w=MD()(),m=Object.getPrototypeOf||(w?function(K){return K.__proto__}:null),y={},p=typeof Uint8Array>"u"||!m?e:m(Uint8Array),v={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":h&&m?m([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":y,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&m?m(m([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!h||!m?e:m(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!h||!m?e:m(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&m?m(""[Symbol.iterator]()):e,"%Symbol%":h?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":_,"%TypedArray%":p,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(m)try{null.error}catch(K){var d=m(m(K));v["%Error.prototype%"]=d}var b=function K(D){var q;if(D==="%AsyncFunction%")q=f("async function () {}");else if(D==="%GeneratorFunction%")q=f("function* () {}");else if(D==="%AsyncGeneratorFunction%")q=f("async function* () {}");else if(D==="%AsyncGenerator%"){var A=K("%AsyncGeneratorFunction%");A&&(q=A.prototype)}else if(D==="%AsyncIteratorPrototype%"){var L=K("%AsyncGenerator%");L&&m&&(q=m(L.prototype))}return v[D]=q,q},O={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=h2(),T=ND(),E=R.call(Function.call,Array.prototype.concat),P=R.call(Function.apply,Array.prototype.splice),x=R.call(Function.call,String.prototype.replace),k=R.call(Function.call,String.prototype.slice),M=R.call(Function.call,RegExp.prototype.exec),j=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,B=/\\(\\)?/g,$=function(D){var q=k(D,0,1),A=k(D,-1);if(q==="%"&&A!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(A==="%"&&q!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var L=[];return x(D,j,function(z,I,H,W){L[L.length]=H?x(W,B,"$1"):I||z}),L},Z=function(D,q){var A=D,L;if(T(O,A)&&(L=O[A],A="%"+L[0]+"%"),T(v,A)){var z=v[A];if(z===y&&(z=b(A)),typeof z>"u"&&!q)throw new o("intrinsic "+D+" exists, but is not available. Please file an issue!");return{alias:L,name:A,value:z}}throw new a("intrinsic "+D+" does not exist!")};return yg=function(D,q){if(typeof D!="string"||D.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof q!="boolean")throw new o('"allowMissing" argument must be a boolean');if(M(/^%?[^%]*%?$/,D)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var A=$(D),L=A.length>0?A[0]:"",z=Z("%"+L+"%",q),I=z.name,H=z.value,W=!1,V=z.alias;V&&(L=V[0],P(A,E([0,1],V)));for(var U=1,Y=!0;U<A.length;U+=1){var X=A[U],Q=k(X,0,1),te=k(X,-1);if((Q==='"'||Q==="'"||Q==="`"||te==='"'||te==="'"||te==="`")&&Q!==te)throw new a("property names with quotes must have matching quotes");if((X==="constructor"||!Y)&&(W=!0),L+="."+X,I="%"+L+"%",T(v,I))H=v[I];else if(H!=null){if(!(X in H)){if(!q)throw new o("base intrinsic for "+D+" exists, but the property is not available.");return}if(g&&U+1>=A.length){var ee=g(H,X);Y=!!ee,Y&&"get"in ee&&!("originalValue"in ee.get)?H=ee.get:H=H[X]}else Y=T(H,X),H=H[X];Y&&!W&&(v[I]=H)}}return H},yg}var bg={exports:{}},_g,W4;function p2(){if(W4)return _g;W4=1;var e=Xs(),t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return _g=t,_g}var wg,K4;function lS(){if(K4)return wg;K4=1;var e=Xs(),t=e("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return wg=t,wg}var Sg,Y4;function ID(){if(Y4)return Sg;Y4=1;var e=p2(),t=oS(),r=Wc(),n=lS();return Sg=function(a,o,l){if(!a||typeof a!="object"&&typeof a!="function")throw new r("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,g=arguments.length>5?arguments[5]:null,S=arguments.length>6?arguments[6]:!1,_=!!n&&n(a,o);if(e)e(a,o,{configurable:g===null&&_?_.configurable:!g,enumerable:u===null&&_?_.enumerable:!u,value:l,writable:f===null&&_?_.writable:!f});else if(S||!u&&!f&&!g)a[o]=l;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Sg}var Eg,X4;function DD(){if(X4)return Eg;X4=1;var e=p2(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Eg=t,Eg}var Og,Z4;function jD(){if(Z4)return Og;Z4=1;var e=Xs(),t=ID(),r=DD()(),n=lS(),i=Wc(),a=e("%Math.floor%");return Og=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],g=!0,S=!0;if("length"in l&&n){var _=n(l,"length");_&&!_.configurable&&(g=!1),_&&!_.writable&&(S=!1)}return(g||S||!f)&&(r?t(l,"length",u,!0,!0):t(l,"length",u)),l},Og}var Q4;function FD(){return Q4||(Q4=1,function(e){var t=h2(),r=Xs(),n=jD(),i=Wc(),a=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),l=r("%Reflect.apply%",!0)||t.call(o,a),u=p2(),f=r("%Math.max%");e.exports=function(_){if(typeof _!="function")throw new i("a function is required");var h=l(t,o,arguments);return n(h,1+f(0,_.length-(arguments.length-1)),!0)};var g=function(){return l(t,a,arguments)};u?u(e.exports,"apply",{value:g}):e.exports.apply=g}(bg)),bg.exports}var Pg,J4;function zD(){if(J4)return Pg;J4=1;var e=Xs(),t=FD(),r=t(e("String.prototype.indexOf"));return Pg=function(i,a){var o=e(i,!!a);return typeof o=="function"&&r(i,".prototype.")>-1?t(o):o},Pg}const BD={},UD=Object.freeze(Object.defineProperty({__proto__:null,default:BD},Symbol.toStringTag,{value:"Module"})),HD=fo(UD);var xg,e_;function $D(){if(e_)return xg;e_=1;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,n=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&a&&typeof a.get=="function"?a.get:null,l=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,f=u?WeakMap.prototype.has:null,g=typeof WeakSet=="function"&&WeakSet.prototype,S=g?WeakSet.prototype.has:null,_=typeof WeakRef=="function"&&WeakRef.prototype,h=_?WeakRef.prototype.deref:null,w=Boolean.prototype.valueOf,m=Object.prototype.toString,y=Function.prototype.toString,p=String.prototype.match,v=String.prototype.slice,d=String.prototype.replace,b=String.prototype.toUpperCase,O=String.prototype.toLowerCase,R=RegExp.prototype.test,T=Array.prototype.concat,E=Array.prototype.join,P=Array.prototype.slice,x=Math.floor,k=typeof BigInt=="function"?BigInt.prototype.valueOf:null,M=Object.getOwnPropertySymbols,j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,B=typeof Symbol=="function"&&typeof Symbol.iterator=="object",$=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===B||!0)?Symbol.toStringTag:null,Z=Object.prototype.propertyIsEnumerable,K=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(ce){return ce.__proto__}:null);function D(ce,fe){if(ce===1/0||ce===-1/0||ce!==ce||ce&&ce>-1e3&&ce<1e3||R.call(/e/,fe))return fe;var Ze=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ce=="number"){var be=ce<0?-x(-ce):x(ce);if(be!==ce){var Me=String(be),Ae=v.call(fe,Me.length+1);return d.call(Me,Ze,"$&_")+"."+d.call(d.call(Ae,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(fe,Ze,"$&_")}var q=HD,A=q.custom,L=te(A)?A:null;xg=function ce(fe,Ze,be,Me){var Ae=Ze||{};if(ie(Ae,"quoteStyle")&&Ae.quoteStyle!=="single"&&Ae.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ie(Ae,"maxStringLength")&&(typeof Ae.maxStringLength=="number"?Ae.maxStringLength<0&&Ae.maxStringLength!==1/0:Ae.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var _e=ie(Ae,"customInspect")?Ae.customInspect:!0;if(typeof _e!="boolean"&&_e!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ie(Ae,"indent")&&Ae.indent!==null&&Ae.indent!==" "&&!(parseInt(Ae.indent,10)===Ae.indent&&Ae.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ie(Ae,"numericSeparator")&&typeof Ae.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Qe=Ae.numericSeparator;if(typeof fe>"u")return"undefined";if(fe===null)return"null";if(typeof fe=="boolean")return fe?"true":"false";if(typeof fe=="string")return me(fe,Ae);if(typeof fe=="number"){if(fe===0)return 1/0/fe>0?"0":"-0";var we=String(fe);return Qe?D(fe,we):we}if(typeof fe=="bigint"){var Ye=String(fe)+"n";return Qe?D(fe,Ye):Ye}var Pr=typeof Ae.depth>"u"?5:Ae.depth;if(typeof be>"u"&&(be=0),be>=Pr&&Pr>0&&typeof fe=="object")return H(fe)?"[Array]":"[Object]";var Oe=$e(Ae,be);if(typeof Me>"u")Me=[];else if(Fe(Me,fe)>=0)return"[Circular]";function Be(xr,en,Si){if(en&&(Me=P.call(Me),Me.push(en)),Si){var Ca={depth:Ae.depth};return ie(Ae,"quoteStyle")&&(Ca.quoteStyle=Ae.quoteStyle),ce(xr,Ca,be+1,Me)}return ce(xr,Ae,be+1,Me)}if(typeof fe=="function"&&!V(fe)){var tt=xe(fe),yt=ut(fe,Be);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(yt.length>0?" { "+E.call(yt,", ")+" }":"")}if(te(fe)){var Ct=B?d.call(String(fe),/^(Symbol\(.*\))_[^)]*$/,"$1"):j.call(fe);return typeof fe=="object"&&!B?Te(Ct):Ct}if(de(fe)){for(var gr="<"+O.call(String(fe.nodeName)),Nr=fe.attributes||[],Ir=0;Ir<Nr.length;Ir++)gr+=" "+Nr[Ir].name+"="+z(I(Nr[Ir].value),"double",Ae);return gr+=">",fe.childNodes&&fe.childNodes.length&&(gr+="..."),gr+="</"+O.call(String(fe.nodeName))+">",gr}if(H(fe)){if(fe.length===0)return"[]";var bn=ut(fe,Be);return Oe&&!Ne(bn)?"["+Ge(bn,Oe)+"]":"[ "+E.call(bn,", ")+" ]"}if(U(fe)){var Le=ut(fe,Be);return!("cause"in Error.prototype)&&"cause"in fe&&!Z.call(fe,"cause")?"{ ["+String(fe)+"] "+E.call(T.call("[cause]: "+Be(fe.cause),Le),", ")+" }":Le.length===0?"["+String(fe)+"]":"{ ["+String(fe)+"] "+E.call(Le,", ")+" }"}if(typeof fe=="object"&&_e){if(L&&typeof fe[L]=="function"&&q)return q(fe,{depth:Pr-be});if(_e!=="symbol"&&typeof fe.inspect=="function")return fe.inspect()}if(oe(fe)){var Je=[];return n&&n.call(fe,function(xr,en){Je.push(Be(en,fe,!0)+" => "+Be(xr,fe))}),Re("Map",r.call(fe),Je,Oe)}if(Ee(fe)){var dt=[];return l&&l.call(fe,function(xr){dt.push(Be(xr,fe))}),Re("Set",o.call(fe),dt,Oe)}if(ue(fe))return ze("WeakMap");if(re(fe))return ze("WeakSet");if(ve(fe))return ze("WeakRef");if(X(fe))return Te(Be(Number(fe)));if(ee(fe))return Te(Be(k.call(fe)));if(Q(fe))return Te(w.call(fe));if(Y(fe))return Te(Be(String(fe)));if(typeof window<"u"&&fe===window)return"{ [object Window] }";if(typeof globalThis<"u"&&fe===globalThis||typeof ye<"u"&&fe===ye)return"{ [object globalThis] }";if(!W(fe)&&!V(fe)){var Mt=ut(fe,Be),mt=K?K(fe)===Object.prototype:fe instanceof Object||fe.constructor===Object,vr=fe instanceof Object?"":"null prototype",mr=!mt&&$&&Object(fe)===fe&&$ in fe?v.call(le(fe),8,-1):vr?"Object":"",or=mt||typeof fe.constructor!="function"?"":fe.constructor.name?fe.constructor.name+" ":"",_n=or+(mr||vr?"["+E.call(T.call([],mr||[],vr||[]),": ")+"] ":"");return Mt.length===0?_n+"{}":Oe?_n+"{"+Ge(Mt,Oe)+"}":_n+"{ "+E.call(Mt,", ")+" }"}return String(fe)};function z(ce,fe,Ze){var be=(Ze.quoteStyle||fe)==="double"?'"':"'";return be+ce+be}function I(ce){return d.call(String(ce),/"/g,""")}function H(ce){return le(ce)==="[object Array]"&&(!$||!(typeof ce=="object"&&$ in ce))}function W(ce){return le(ce)==="[object Date]"&&(!$||!(typeof ce=="object"&&$ in ce))}function V(ce){return le(ce)==="[object RegExp]"&&(!$||!(typeof ce=="object"&&$ in ce))}function U(ce){return le(ce)==="[object Error]"&&(!$||!(typeof ce=="object"&&$ in ce))}function Y(ce){return le(ce)==="[object String]"&&(!$||!(typeof ce=="object"&&$ in ce))}function X(ce){return le(ce)==="[object Number]"&&(!$||!(typeof ce=="object"&&$ in ce))}function Q(ce){return le(ce)==="[object Boolean]"&&(!$||!(typeof ce=="object"&&$ in ce))}function te(ce){if(B)return ce&&typeof ce=="object"&&ce instanceof Symbol;if(typeof ce=="symbol")return!0;if(!ce||typeof ce!="object"||!j)return!1;try{return j.call(ce),!0}catch{}return!1}function ee(ce){if(!ce||typeof ce!="object"||!k)return!1;try{return k.call(ce),!0}catch{}return!1}var ne=Object.prototype.hasOwnProperty||function(ce){return ce in this};function ie(ce,fe){return ne.call(ce,fe)}function le(ce){return m.call(ce)}function xe(ce){if(ce.name)return ce.name;var fe=p.call(y.call(ce),/^function\s*([\w$]+)/);return fe?fe[1]:null}function Fe(ce,fe){if(ce.indexOf)return ce.indexOf(fe);for(var Ze=0,be=ce.length;Ze<be;Ze++)if(ce[Ze]===fe)return Ze;return-1}function oe(ce){if(!r||!ce||typeof ce!="object")return!1;try{r.call(ce);try{o.call(ce)}catch{return!0}return ce instanceof Map}catch{}return!1}function ue(ce){if(!f||!ce||typeof ce!="object")return!1;try{f.call(ce,f);try{S.call(ce,S)}catch{return!0}return ce instanceof WeakMap}catch{}return!1}function ve(ce){if(!h||!ce||typeof ce!="object")return!1;try{return h.call(ce),!0}catch{}return!1}function Ee(ce){if(!o||!ce||typeof ce!="object")return!1;try{o.call(ce);try{r.call(ce)}catch{return!0}return ce instanceof Set}catch{}return!1}function re(ce){if(!S||!ce||typeof ce!="object")return!1;try{S.call(ce,S);try{f.call(ce,f)}catch{return!0}return ce instanceof WeakSet}catch{}return!1}function de(ce){return!ce||typeof ce!="object"?!1:typeof HTMLElement<"u"&&ce instanceof HTMLElement?!0:typeof ce.nodeName=="string"&&typeof ce.getAttribute=="function"}function me(ce,fe){if(ce.length>fe.maxStringLength){var Ze=ce.length-fe.maxStringLength,be="... "+Ze+" more character"+(Ze>1?"s":"");return me(v.call(ce,0,fe.maxStringLength),fe)+be}var Me=d.call(d.call(ce,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Se);return z(Me,"single",fe)}function Se(ce){var fe=ce.charCodeAt(0),Ze={8:"b",9:"t",10:"n",12:"f",13:"r"}[fe];return Ze?"\\"+Ze:"\\x"+(fe<16?"0":"")+b.call(fe.toString(16))}function Te(ce){return"Object("+ce+")"}function ze(ce){return ce+" { ? }"}function Re(ce,fe,Ze,be){var Me=be?Ge(Ze,be):E.call(Ze,", ");return ce+" ("+fe+") {"+Me+"}"}function Ne(ce){for(var fe=0;fe<ce.length;fe++)if(Fe(ce[fe],`
|
|
142
|
+
`)>=0)return!1;return!0}function $e(ce,fe){var Ze;if(ce.indent===" ")Ze=" ";else if(typeof ce.indent=="number"&&ce.indent>0)Ze=E.call(Array(ce.indent+1)," ");else return null;return{base:Ze,prev:E.call(Array(fe+1),Ze)}}function Ge(ce,fe){if(ce.length===0)return"";var Ze=`
|
|
143
|
+
`+fe.prev+fe.base;return Ze+E.call(ce,","+Ze)+`
|
|
144
|
+
`+fe.prev}function ut(ce,fe){var Ze=H(ce),be=[];if(Ze){be.length=ce.length;for(var Me=0;Me<ce.length;Me++)be[Me]=ie(ce,Me)?fe(ce[Me],ce):""}var Ae=typeof M=="function"?M(ce):[],_e;if(B){_e={};for(var Qe=0;Qe<Ae.length;Qe++)_e["$"+Ae[Qe]]=Ae[Qe]}for(var we in ce)ie(ce,we)&&(Ze&&String(Number(we))===we&&we<ce.length||B&&_e["$"+we]instanceof Symbol||(R.call(/[^\w$]/,we)?be.push(fe(we,ce)+": "+fe(ce[we],ce)):be.push(we+": "+fe(ce[we],ce))));if(typeof M=="function")for(var Ye=0;Ye<Ae.length;Ye++)Z.call(ce,Ae[Ye])&&be.push("["+fe(Ae[Ye])+"]: "+fe(ce[Ae[Ye]],ce));return be}return xg}var Cg,t_;function GD(){if(t_)return Cg;t_=1;var e=Xs(),t=zD(),r=$D(),n=Wc(),i=e("%WeakMap%",!0),a=e("%Map%",!0),o=t("WeakMap.prototype.get",!0),l=t("WeakMap.prototype.set",!0),u=t("WeakMap.prototype.has",!0),f=t("Map.prototype.get",!0),g=t("Map.prototype.set",!0),S=t("Map.prototype.has",!0),_=function(y,p){for(var v=y,d;(d=v.next)!==null;v=d)if(d.key===p)return v.next=d.next,d.next=y.next,y.next=d,d},h=function(y,p){var v=_(y,p);return v&&v.value},w=function(y,p,v){var d=_(y,p);d?d.value=v:y.next={key:p,next:y.next,value:v}},m=function(y,p){return!!_(y,p)};return Cg=function(){var p,v,d,b={assert:function(O){if(!b.has(O))throw new n("Side channel does not contain "+r(O))},get:function(O){if(i&&O&&(typeof O=="object"||typeof O=="function")){if(p)return o(p,O)}else if(a){if(v)return f(v,O)}else if(d)return h(d,O)},has:function(O){if(i&&O&&(typeof O=="object"||typeof O=="function")){if(p)return u(p,O)}else if(a){if(v)return S(v,O)}else if(d)return m(d,O);return!1},set:function(O,R){i&&O&&(typeof O=="object"||typeof O=="function")?(p||(p=new i),l(p,O,R)):a?(v||(v=new a),g(v,O,R)):(d||(d={key:{},next:null}),w(d,O,R))}};return b},Cg}var Tg,r_;function g2(){if(r_)return Tg;r_=1;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Tg={default:r.RFC3986,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},Tg}var kg,n_;function sS(){if(n_)return kg;n_=1;var e=g2(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var y=[],p=0;p<256;++p)y.push("%"+((p<16?"0":"")+p.toString(16)).toUpperCase());return y}(),i=function(p){for(;p.length>1;){var v=p.pop(),d=v.obj[v.prop];if(r(d)){for(var b=[],O=0;O<d.length;++O)typeof d[O]<"u"&&b.push(d[O]);v.obj[v.prop]=b}}},a=function(p,v){for(var d=v&&v.plainObjects?Object.create(null):{},b=0;b<p.length;++b)typeof p[b]<"u"&&(d[b]=p[b]);return d},o=function y(p,v,d){if(!v)return p;if(typeof v!="object"){if(r(p))p.push(v);else if(p&&typeof p=="object")(d&&(d.plainObjects||d.allowPrototypes)||!t.call(Object.prototype,v))&&(p[v]=!0);else return[p,v];return p}if(!p||typeof p!="object")return[p].concat(v);var b=p;return r(p)&&!r(v)&&(b=a(p,d)),r(p)&&r(v)?(v.forEach(function(O,R){if(t.call(p,R)){var T=p[R];T&&typeof T=="object"&&O&&typeof O=="object"?p[R]=y(T,O,d):p.push(O)}else p[R]=O}),p):Object.keys(v).reduce(function(O,R){var T=v[R];return t.call(O,R)?O[R]=y(O[R],T,d):O[R]=T,O},b)},l=function(p,v){return Object.keys(v).reduce(function(d,b){return d[b]=v[b],d},p)},u=function(y,p,v){var d=y.replace(/\+/g," ");if(v==="iso-8859-1")return d.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(d)}catch{return d}},f=1024,g=function(p,v,d,b,O){if(p.length===0)return p;var R=p;if(typeof p=="symbol"?R=Symbol.prototype.toString.call(p):typeof p!="string"&&(R=String(p)),d==="iso-8859-1")return escape(R).replace(/%u[0-9a-f]{4}/gi,function(j){return"%26%23"+parseInt(j.slice(2),16)+"%3B"});for(var T="",E=0;E<R.length;E+=f){for(var P=R.length>=f?R.slice(E,E+f):R,x=[],k=0;k<P.length;++k){var M=P.charCodeAt(k);if(M===45||M===46||M===95||M===126||M>=48&&M<=57||M>=65&&M<=90||M>=97&&M<=122||O===e.RFC1738&&(M===40||M===41)){x[x.length]=P.charAt(k);continue}if(M<128){x[x.length]=n[M];continue}if(M<2048){x[x.length]=n[192|M>>6]+n[128|M&63];continue}if(M<55296||M>=57344){x[x.length]=n[224|M>>12]+n[128|M>>6&63]+n[128|M&63];continue}k+=1,M=65536+((M&1023)<<10|P.charCodeAt(k)&1023),x[x.length]=n[240|M>>18]+n[128|M>>12&63]+n[128|M>>6&63]+n[128|M&63]}T+=x.join("")}return T},S=function(p){for(var v=[{obj:{o:p},prop:"o"}],d=[],b=0;b<v.length;++b)for(var O=v[b],R=O.obj[O.prop],T=Object.keys(R),E=0;E<T.length;++E){var P=T[E],x=R[P];typeof x=="object"&&x!==null&&d.indexOf(x)===-1&&(v.push({obj:R,prop:P}),d.push(x))}return i(v),p},_=function(p){return Object.prototype.toString.call(p)==="[object RegExp]"},h=function(p){return!p||typeof p!="object"?!1:!!(p.constructor&&p.constructor.isBuffer&&p.constructor.isBuffer(p))},w=function(p,v){return[].concat(p,v)},m=function(p,v){if(r(p)){for(var d=[],b=0;b<p.length;b+=1)d.push(v(p[b]));return d}return v(p)};return kg={arrayToObject:a,assign:l,combine:w,compact:S,decode:u,encode:g,isBuffer:h,isRegExp:_,maybeMap:m,merge:o},kg}var Ag,i_;function VD(){if(i_)return Ag;i_=1;var e=GD(),t=sS(),r=g2(),n=Object.prototype.hasOwnProperty,i={brackets:function(y){return y+"[]"},comma:"comma",indices:function(y,p){return y+"["+p+"]"},repeat:function(y){return y}},a=Array.isArray,o=Array.prototype.push,l=function(m,y){o.apply(m,a(y)?y:[y])},u=Date.prototype.toISOString,f=r.default,g={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:f,formatter:r.formatters[f],indices:!1,serializeDate:function(y){return u.call(y)},skipNulls:!1,strictNullHandling:!1},S=function(y){return typeof y=="string"||typeof y=="number"||typeof y=="boolean"||typeof y=="symbol"||typeof y=="bigint"},_={},h=function m(y,p,v,d,b,O,R,T,E,P,x,k,M,j,B,$,Z,K){for(var D=y,q=K,A=0,L=!1;(q=q.get(_))!==void 0&&!L;){var z=q.get(y);if(A+=1,typeof z<"u"){if(z===A)throw new RangeError("Cyclic object value");L=!0}typeof q.get(_)>"u"&&(A=0)}if(typeof P=="function"?D=P(p,D):D instanceof Date?D=M(D):v==="comma"&&a(D)&&(D=t.maybeMap(D,function(le){return le instanceof Date?M(le):le})),D===null){if(O)return E&&!$?E(p,g.encoder,Z,"key",j):p;D=""}if(S(D)||t.isBuffer(D)){if(E){var I=$?p:E(p,g.encoder,Z,"key",j);return[B(I)+"="+B(E(D,g.encoder,Z,"value",j))]}return[B(p)+"="+B(String(D))]}var H=[];if(typeof D>"u")return H;var W;if(v==="comma"&&a(D))$&&E&&(D=t.maybeMap(D,E)),W=[{value:D.length>0?D.join(",")||null:void 0}];else if(a(P))W=P;else{var V=Object.keys(D);W=x?V.sort(x):V}var U=T?p.replace(/\./g,"%2E"):p,Y=d&&a(D)&&D.length===1?U+"[]":U;if(b&&a(D)&&D.length===0)return Y+"[]";for(var X=0;X<W.length;++X){var Q=W[X],te=typeof Q=="object"&&typeof Q.value<"u"?Q.value:D[Q];if(!(R&&te===null)){var ee=k&&T?Q.replace(/\./g,"%2E"):Q,ne=a(D)?typeof v=="function"?v(Y,ee):Y:Y+(k?"."+ee:"["+ee+"]");K.set(y,A);var ie=e();ie.set(_,K),l(H,m(te,ne,v,d,b,O,R,T,v==="comma"&&$&&a(D)?null:E,P,x,k,M,j,B,$,Z,ie))}}return H},w=function(y){if(!y)return g;if(typeof y.allowEmptyArrays<"u"&&typeof y.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof y.encodeDotInKeys<"u"&&typeof y.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(y.encoder!==null&&typeof y.encoder<"u"&&typeof y.encoder!="function")throw new TypeError("Encoder has to be a function.");var p=y.charset||g.charset;if(typeof y.charset<"u"&&y.charset!=="utf-8"&&y.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var v=r.default;if(typeof y.format<"u"){if(!n.call(r.formatters,y.format))throw new TypeError("Unknown format option provided.");v=y.format}var d=r.formatters[v],b=g.filter;(typeof y.filter=="function"||a(y.filter))&&(b=y.filter);var O;if(y.arrayFormat in i?O=y.arrayFormat:"indices"in y?O=y.indices?"indices":"repeat":O=g.arrayFormat,"commaRoundTrip"in y&&typeof y.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var R=typeof y.allowDots>"u"?y.encodeDotInKeys===!0?!0:g.allowDots:!!y.allowDots;return{addQueryPrefix:typeof y.addQueryPrefix=="boolean"?y.addQueryPrefix:g.addQueryPrefix,allowDots:R,allowEmptyArrays:typeof y.allowEmptyArrays=="boolean"?!!y.allowEmptyArrays:g.allowEmptyArrays,arrayFormat:O,charset:p,charsetSentinel:typeof y.charsetSentinel=="boolean"?y.charsetSentinel:g.charsetSentinel,commaRoundTrip:y.commaRoundTrip,delimiter:typeof y.delimiter>"u"?g.delimiter:y.delimiter,encode:typeof y.encode=="boolean"?y.encode:g.encode,encodeDotInKeys:typeof y.encodeDotInKeys=="boolean"?y.encodeDotInKeys:g.encodeDotInKeys,encoder:typeof y.encoder=="function"?y.encoder:g.encoder,encodeValuesOnly:typeof y.encodeValuesOnly=="boolean"?y.encodeValuesOnly:g.encodeValuesOnly,filter:b,format:v,formatter:d,serializeDate:typeof y.serializeDate=="function"?y.serializeDate:g.serializeDate,skipNulls:typeof y.skipNulls=="boolean"?y.skipNulls:g.skipNulls,sort:typeof y.sort=="function"?y.sort:null,strictNullHandling:typeof y.strictNullHandling=="boolean"?y.strictNullHandling:g.strictNullHandling}};return Ag=function(m,y){var p=m,v=w(y),d,b;typeof v.filter=="function"?(b=v.filter,p=b("",p)):a(v.filter)&&(b=v.filter,d=b);var O=[];if(typeof p!="object"||p===null)return"";var R=i[v.arrayFormat],T=R==="comma"&&v.commaRoundTrip;d||(d=Object.keys(p)),v.sort&&d.sort(v.sort);for(var E=e(),P=0;P<d.length;++P){var x=d[P];v.skipNulls&&p[x]===null||l(O,h(p[x],x,R,T,v.allowEmptyArrays,v.strictNullHandling,v.skipNulls,v.encodeDotInKeys,v.encode?v.encoder:null,v.filter,v.sort,v.allowDots,v.serializeDate,v.format,v.formatter,v.encodeValuesOnly,v.charset,E))}var k=O.join(v.delimiter),M=v.addQueryPrefix===!0?"?":"";return v.charsetSentinel&&(v.charset==="iso-8859-1"?M+="utf8=%26%2310003%3B&":M+="utf8=%E2%9C%93&"),k.length>0?M+k:""},Ag}var Rg,a_;function qD(){if(a_)return Rg;a_=1;var e=sS(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(_){return _.replace(/&#(\d+);/g,function(h,w){return String.fromCharCode(parseInt(w,10))})},a=function(_,h){return _&&typeof _=="string"&&h.comma&&_.indexOf(",")>-1?_.split(","):_},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(h,w){var m={__proto__:null},y=w.ignoreQueryPrefix?h.replace(/^\?/,""):h;y=y.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var p=w.parameterLimit===1/0?void 0:w.parameterLimit,v=y.split(w.delimiter,p),d=-1,b,O=w.charset;if(w.charsetSentinel)for(b=0;b<v.length;++b)v[b].indexOf("utf8=")===0&&(v[b]===l?O="utf-8":v[b]===o&&(O="iso-8859-1"),d=b,b=v.length);for(b=0;b<v.length;++b)if(b!==d){var R=v[b],T=R.indexOf("]="),E=T===-1?R.indexOf("="):T+1,P,x;E===-1?(P=w.decoder(R,n.decoder,O,"key"),x=w.strictNullHandling?null:""):(P=w.decoder(R.slice(0,E),n.decoder,O,"key"),x=e.maybeMap(a(R.slice(E+1),w),function(M){return w.decoder(M,n.decoder,O,"value")})),x&&w.interpretNumericEntities&&O==="iso-8859-1"&&(x=i(x)),R.indexOf("[]=")>-1&&(x=r(x)?[x]:x);var k=t.call(m,P);k&&w.duplicates==="combine"?m[P]=e.combine(m[P],x):(!k||w.duplicates==="last")&&(m[P]=x)}return m},f=function(_,h,w,m){for(var y=m?h:a(h,w),p=_.length-1;p>=0;--p){var v,d=_[p];if(d==="[]"&&w.parseArrays)v=w.allowEmptyArrays&&y===""?[]:[].concat(y);else{v=w.plainObjects?Object.create(null):{};var b=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,O=w.decodeDotInKeys?b.replace(/%2E/g,"."):b,R=parseInt(O,10);!w.parseArrays&&O===""?v={0:y}:!isNaN(R)&&d!==O&&String(R)===O&&R>=0&&w.parseArrays&&R<=w.arrayLimit?(v=[],v[R]=y):O!=="__proto__"&&(v[O]=y)}y=v}return y},g=function(h,w,m,y){if(h){var p=m.allowDots?h.replace(/\.([^.[]+)/g,"[$1]"):h,v=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,b=m.depth>0&&v.exec(p),O=b?p.slice(0,b.index):p,R=[];if(O){if(!m.plainObjects&&t.call(Object.prototype,O)&&!m.allowPrototypes)return;R.push(O)}for(var T=0;m.depth>0&&(b=d.exec(p))!==null&&T<m.depth;){if(T+=1,!m.plainObjects&&t.call(Object.prototype,b[1].slice(1,-1))&&!m.allowPrototypes)return;R.push(b[1])}return b&&R.push("["+p.slice(b.index)+"]"),f(R,w,m,y)}},S=function(h){if(!h)return n;if(typeof h.allowEmptyArrays<"u"&&typeof h.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof h.decodeDotInKeys<"u"&&typeof h.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(h.decoder!==null&&typeof h.decoder<"u"&&typeof h.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof h.charset<"u"&&h.charset!=="utf-8"&&h.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var w=typeof h.charset>"u"?n.charset:h.charset,m=typeof h.duplicates>"u"?n.duplicates:h.duplicates;if(m!=="combine"&&m!=="first"&&m!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var y=typeof h.allowDots>"u"?h.decodeDotInKeys===!0?!0:n.allowDots:!!h.allowDots;return{allowDots:y,allowEmptyArrays:typeof h.allowEmptyArrays=="boolean"?!!h.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof h.allowPrototypes=="boolean"?h.allowPrototypes:n.allowPrototypes,allowSparse:typeof h.allowSparse=="boolean"?h.allowSparse:n.allowSparse,arrayLimit:typeof h.arrayLimit=="number"?h.arrayLimit:n.arrayLimit,charset:w,charsetSentinel:typeof h.charsetSentinel=="boolean"?h.charsetSentinel:n.charsetSentinel,comma:typeof h.comma=="boolean"?h.comma:n.comma,decodeDotInKeys:typeof h.decodeDotInKeys=="boolean"?h.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof h.decoder=="function"?h.decoder:n.decoder,delimiter:typeof h.delimiter=="string"||e.isRegExp(h.delimiter)?h.delimiter:n.delimiter,depth:typeof h.depth=="number"||h.depth===!1?+h.depth:n.depth,duplicates:m,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 Rg=function(_,h){var w=S(h);if(_===""||_===null||typeof _>"u")return w.plainObjects?Object.create(null):{};for(var m=typeof _=="string"?u(_,w):_,y=w.plainObjects?Object.create(null):{},p=Object.keys(m),v=0;v<p.length;++v){var d=p[v],b=g(d,m[d],w,typeof _=="string");y=e.merge(y,b,w)}return w.allowSparse===!0?y:e.compact(y)},Rg}var Mg,o_;function WD(){if(o_)return Mg;o_=1;var e=VD(),t=qD(),r=g2();return Mg={formats:r,parse:t,stringify:e},Mg}var l_;function uS(){if(l_)return Bo;l_=1;var e=OD();function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
|
|
145
|
+
`," "],o=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(o),u=["%","/","?",";","#"].concat(l),f=["/","?","#"],g=255,S=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=WD();function p(O,R,T){if(O&&typeof O=="object"&&O instanceof t)return O;var E=new t;return E.parse(O,R,T),E}t.prototype.parse=function(O,R,T){if(typeof O!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof O);var E=O.indexOf("?"),P=E!==-1&&E<O.indexOf("#")?"?":"#",x=O.split(P),k=/\\/g;x[0]=x[0].replace(k,"/"),O=x.join(P);var M=O;if(M=M.trim(),!T&&O.split("#").length===1){var j=i.exec(M);if(j)return this.path=M,this.href=M,this.pathname=j[1],j[2]?(this.search=j[2],R?this.query=y.parse(this.search.substr(1)):this.query=this.search.substr(1)):R&&(this.search="",this.query={}),this}var B=r.exec(M);if(B){B=B[0];var $=B.toLowerCase();this.protocol=$,M=M.substr(B.length)}if(T||B||M.match(/^\/\/[^@/]+@[^@/]+/)){var Z=M.substr(0,2)==="//";Z&&!(B&&w[B])&&(M=M.substr(2),this.slashes=!0)}if(!w[B]&&(Z||B&&!m[B])){for(var K=-1,D=0;D<f.length;D++){var q=M.indexOf(f[D]);q!==-1&&(K===-1||q<K)&&(K=q)}var A,L;K===-1?L=M.lastIndexOf("@"):L=M.lastIndexOf("@",K),L!==-1&&(A=M.slice(0,L),M=M.slice(L+1),this.auth=decodeURIComponent(A)),K=-1;for(var D=0;D<u.length;D++){var q=M.indexOf(u[D]);q!==-1&&(K===-1||q<K)&&(K=q)}K===-1&&(K=M.length),this.host=M.slice(0,K),M=M.slice(K),this.parseHost(),this.hostname=this.hostname||"";var z=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!z)for(var I=this.hostname.split(/\./),D=0,H=I.length;D<H;D++){var W=I[D];if(W&&!W.match(S)){for(var V="",U=0,Y=W.length;U<Y;U++)W.charCodeAt(U)>127?V+="x":V+=W[U];if(!V.match(S)){var X=I.slice(0,D),Q=I.slice(D+1),te=W.match(_);te&&(X.push(te[1]),Q.unshift(te[2])),Q.length&&(M="/"+Q.join(".")+M),this.hostname=X.join(".");break}}}this.hostname.length>g?this.hostname="":this.hostname=this.hostname.toLowerCase(),z||(this.hostname=e.toASCII(this.hostname));var ee=this.port?":"+this.port:"",ne=this.hostname||"";this.host=ne+ee,this.href+=this.host,z&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),M[0]!=="/"&&(M="/"+M))}if(!h[$])for(var D=0,H=l.length;D<H;D++){var ie=l[D];if(M.indexOf(ie)!==-1){var le=encodeURIComponent(ie);le===ie&&(le=escape(ie)),M=M.split(ie).join(le)}}var xe=M.indexOf("#");xe!==-1&&(this.hash=M.substr(xe),M=M.slice(0,xe));var Fe=M.indexOf("?");if(Fe!==-1?(this.search=M.substr(Fe),this.query=M.substr(Fe+1),R&&(this.query=y.parse(this.query)),M=M.slice(0,Fe)):R&&(this.search="",this.query={}),M&&(this.pathname=M),m[$]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ee=this.pathname||"",oe=this.search||"";this.path=ee+oe}return this.href=this.format(),this};function v(O){return typeof O=="string"&&(O=p(O)),O instanceof t?O.format():t.prototype.format.call(O)}t.prototype.format=function(){var O=this.auth||"";O&&(O=encodeURIComponent(O),O=O.replace(/%3A/i,":"),O+="@");var R=this.protocol||"",T=this.pathname||"",E=this.hash||"",P=!1,x="";this.host?P=O+this.host:this.hostname&&(P=O+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(P+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(x=y.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var k=this.search||x&&"?"+x||"";return R&&R.substr(-1)!==":"&&(R+=":"),this.slashes||(!R||m[R])&&P!==!1?(P="//"+(P||""),T&&T.charAt(0)!=="/"&&(T="/"+T)):P||(P=""),E&&E.charAt(0)!=="#"&&(E="#"+E),k&&k.charAt(0)!=="?"&&(k="?"+k),T=T.replace(/[?#]/g,function(M){return encodeURIComponent(M)}),k=k.replace("#","%23"),R+P+T+k+E};function d(O,R){return p(O,!1,!0).resolve(R)}t.prototype.resolve=function(O){return this.resolveObject(p(O,!1,!0)).format()};function b(O,R){return O?p(O,!1,!0).resolveObject(R):R}return t.prototype.resolveObject=function(O){if(typeof O=="string"){var R=new t;R.parse(O,!1,!0),O=R}for(var T=new t,E=Object.keys(this),P=0;P<E.length;P++){var x=E[P];T[x]=this[x]}if(T.hash=O.hash,O.href==="")return T.href=T.format(),T;if(O.slashes&&!O.protocol){for(var k=Object.keys(O),M=0;M<k.length;M++){var j=k[M];j!=="protocol"&&(T[j]=O[j])}return m[T.protocol]&&T.hostname&&!T.pathname&&(T.pathname="/",T.path=T.pathname),T.href=T.format(),T}if(O.protocol&&O.protocol!==T.protocol){if(!m[O.protocol]){for(var B=Object.keys(O),$=0;$<B.length;$++){var Z=B[$];T[Z]=O[Z]}return T.href=T.format(),T}if(T.protocol=O.protocol,!O.host&&!w[O.protocol]){for(var H=(O.pathname||"").split("/");H.length&&!(O.host=H.shift()););O.host||(O.host=""),O.hostname||(O.hostname=""),H[0]!==""&&H.unshift(""),H.length<2&&H.unshift(""),T.pathname=H.join("/")}else T.pathname=O.pathname;if(T.search=O.search,T.query=O.query,T.host=O.host||"",T.auth=O.auth,T.hostname=O.hostname||O.host,T.port=O.port,T.pathname||T.search){var K=T.pathname||"",D=T.search||"";T.path=K+D}return T.slashes=T.slashes||O.slashes,T.href=T.format(),T}var q=T.pathname&&T.pathname.charAt(0)==="/",A=O.host||O.pathname&&O.pathname.charAt(0)==="/",L=A||q||T.host&&O.pathname,z=L,I=T.pathname&&T.pathname.split("/")||[],H=O.pathname&&O.pathname.split("/")||[],W=T.protocol&&!m[T.protocol];if(W&&(T.hostname="",T.port=null,T.host&&(I[0]===""?I[0]=T.host:I.unshift(T.host)),T.host="",O.protocol&&(O.hostname=null,O.port=null,O.host&&(H[0]===""?H[0]=O.host:H.unshift(O.host)),O.host=null),L=L&&(H[0]===""||I[0]==="")),A)T.host=O.host||O.host===""?O.host:T.host,T.hostname=O.hostname||O.hostname===""?O.hostname:T.hostname,T.search=O.search,T.query=O.query,I=H;else if(H.length)I||(I=[]),I.pop(),I=I.concat(H),T.search=O.search,T.query=O.query;else if(O.search!=null){if(W){T.host=I.shift(),T.hostname=T.host;var V=T.host&&T.host.indexOf("@")>0?T.host.split("@"):!1;V&&(T.auth=V.shift(),T.hostname=V.shift(),T.host=T.hostname)}return T.search=O.search,T.query=O.query,(T.pathname!==null||T.search!==null)&&(T.path=(T.pathname?T.pathname:"")+(T.search?T.search:"")),T.href=T.format(),T}if(!I.length)return T.pathname=null,T.search?T.path="/"+T.search:T.path=null,T.href=T.format(),T;for(var U=I.slice(-1)[0],Y=(T.host||O.host||I.length>1)&&(U==="."||U==="..")||U==="",X=0,Q=I.length;Q>=0;Q--)U=I[Q],U==="."?I.splice(Q,1):U===".."?(I.splice(Q,1),X++):X&&(I.splice(Q,1),X--);if(!L&&!z)for(;X--;X)I.unshift("..");L&&I[0]!==""&&(!I[0]||I[0].charAt(0)!=="/")&&I.unshift(""),Y&&I.join("/").substr(-1)!=="/"&&I.push("");var te=I[0]===""||I[0]&&I[0].charAt(0)==="/";if(W){T.hostname=te?"":I.length?I.shift():"",T.host=T.hostname;var V=T.host&&T.host.indexOf("@")>0?T.host.split("@"):!1;V&&(T.auth=V.shift(),T.hostname=V.shift(),T.host=T.hostname)}return L=L||T.host&&I.length,L&&!te&&I.unshift(""),I.length>0?T.pathname=I.join("/"):(T.pathname=null,T.path=null),(T.pathname!==null||T.search!==null)&&(T.path=(T.pathname?T.pathname:"")+(T.search?T.search:"")),T.auth=O.auth||T.auth,T.slashes=T.slashes||O.slashes,T.href=T.format(),T},t.prototype.parseHost=function(){var O=this.host,R=n.exec(O);R&&(R=R[0],R!==":"&&(this.port=R.substr(1)),O=O.substr(0,O.length-R.length)),O&&(this.hostname=O)},Bo.parse=p,Bo.resolve=d,Bo.resolveObject=b,Bo.format=v,Bo.Url=t,Bo}var Lg={exports:{}},s_;function KD(){return s_||(s_=1,function(e){(function(t,r){e.exports?e.exports=r():t.xmlserializer=r()})(ye,function(){var t=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 m=Array.prototype.map.call(h.attributes||h.attrs,function(y){return y.name}).indexOf("xmlns")>=0;return!m&&(w||h.namespaceURI!==h.parentNode.namespaceURI)?' xmlns="'+h.namespaceURI+'"':""},l=function(h){return Array.prototype.map.call(h.childNodes,function(w){return _(w)}).join("")},u=function(h,w){var m="<"+a(h);return m+=o(h,w),Array.prototype.forEach.call(h.attributes||h.attrs,function(y){m+=i(y)}),h.childNodes.length>0?(m+=">",m+=l(h),m+="</"+a(h)+">"):m+="/>",m},f=function(h){var w=h.nodeValue||h.value||"";return n(w)},g=function(h){return"<!--"+h.data.replace(/-/g,"-")+"-->"},S=function(h){return"<![CDATA["+h.nodeValue+"]]>"},_=function(h,w){var m=w&&w.rootNode;if(h.nodeName==="#document"||h.nodeName==="#document-fragment")return l(h);if(h.tagName)return u(h,m);if(h.nodeName==="#text")return f(h);if(h.nodeName==="#comment")return g(h);if(h.nodeName==="#cdata-section")return S(h)};return{serializeToString:function(h){return t(_(h,{rootNode:!0}))}}})}(Lg)),Lg.exports}var Ng={},u_;function YD(){if(u_)return Ng;u_=1;var e=function(a){var o=new XMLSerializer;return Array.prototype.map.call(a.childNodes,function(l){return o.serializeToString(l)}).join("")},t=function(a){if(a.documentElement.tagName==="parsererror"&&a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return a.documentElement;if((a.documentElement.tagName==="xml"||a.documentElement.tagName==="html")&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0];if(a.documentElement.tagName==="html"&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="body"&&a.documentElement.childNodes[0].childNodes&&a.documentElement.childNodes[0].childNodes.length&&a.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0].childNodes[0]},r=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
|
|
146
|
+
?</div>`),new RegExp(`^(.+)
|
|
147
|
+
`)],n=function(a){var o=e(a),l,u;for(l=0;l<r.length;l++)if(u=r[l].exec(o),u)return u[1]},i=function(a){var o;if(a===null)throw new Error("Parse error");var l=t(a);if(l!==void 0)throw o=n(l)||"Parse error",new Error(o)};return Ng.failOnParseError=function(a){return i(a),a},Ng}var Ig={},Dg={},c_;function Kp(){return c_||(c_=1,function(e){var t=uS();e.getDocumentBaseUrl=function(l){return l.baseURI!=="about:blank"?l.baseURI:null},e.clone=function(l){var u={},f;for(f in l)l.hasOwnProperty(f)&&(u[f]=l[f]);return u},e.cloneArray=function(l){return Array.prototype.slice.apply(l,[0])},e.joinUrl=function(l,u){return l?t.resolve(l,u):u},e.isDataUri=function(l){return/^data:/.test(l)},e.collectAndReportErrors=function(l){var u=[];return Promise.all(l.map(function(f){return f.catch(function(g){u.push(g)})})).then(function(){return u})};var r=null,n=function(l,u){return u===!1||u==="none"||u==="repeated"?((r===null||u!=="repeated")&&(r=Date.now()),l+"?_="+r):l};e.ajax=function(l,u){return new Promise(function(f,g){var S=new window.XMLHttpRequest,_=e.joinUrl(u.baseUrl,l),h,w=function(){g({msg:"Unable to load url",url:_})};h=n(_,u.cache),S.addEventListener("load",function(){S.status===200||S.status===0?f(S.response):w()},!1),S.addEventListener("error",w,!1);try{S.open("GET",h,!0),S.overrideMimeType(u.mimeType),S.send(null)}catch{w()}})},e.binaryAjax=function(l,u){var f=e.clone(u);return f.mimeType="text/plain; charset=x-user-defined",e.ajax(l,f).then(function(g){for(var S="",_=0;_<g.length;_++)S+=String.fromCharCode(g.charCodeAt(_)&255);return S})};var i=function(l){var u=function(f,g){return f.substring(0,g.length)===g};return u(l,"<?xml")||u(l,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(l,u){return e.binaryAjax(l,u).then(function(f){var g=btoa(f),S=i(f);return"data:"+S+";base64,"+g})};var a=[],o=function(l){return a.indexOf(l)<0&&a.push(l),a.indexOf(l)};e.memoize=function(l,u,f){if(typeof f!="object")throw new Error("cacheBucket is not an object");return function(){var g=Array.prototype.slice.call(arguments),S=u(g),_=o(l),h;return f[_]&&f[_][S]?f[_][S]:(h=l.apply(null,g),f[_]=f[_]||{},f[_][S]=h,h)}}}(Dg)),Dg}var jg={},f_;function XD(){if(f_)return jg;f_=1;var e=Kp(),t=function(a,o){var l=null;a.hasAttribute("src")?l=a.getAttribute("src"):a.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=a.getAttributeNS("http://www.w3.org/1999/xlink","href"):a.hasAttribute("href")&&(l=a.getAttribute("href"));var u=e.getDocumentBaseUrl(a.ownerDocument),f=e.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),e.getDataURIForImageURL(l,f).then(function(g){return g},function(g){throw{resourceType:"image",url:g.url,msg:"Unable to load image "+g.url}})},r=function(a){return a.filter(function(o){var l=null;return o.hasAttribute("src")?l=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(l=o.getAttribute("href")),l!==null&&!e.isDataUri(l)})},n=function(a){return Array.prototype.filter.call(a,function(o){return o.type==="image"})},i=function(a){return Array.prototype.slice.call(a)};return jg.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 g=r(l);return e.collectAndReportErrors(g.map(function(S){return t(S,o).then(function(_){S.attributes.src?S.attributes.src.value=_:S.attributes["xlink:href"]?S.attributes["xlink:href"].value=_:S.attributes.href&&(S.attributes.href.value=_)})}))},jg}var Fg={},d_;function ZD(){if(d_)return Fg;d_=1;var e=Kp(),t=function(a,o){var l=a.attributes.src.value,u=e.getDocumentBaseUrl(a.ownerDocument),f=e.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),e.ajax(l,f).catch(function(g){throw{resourceType:"script",url:g.url,msg:"Unable to load script "+g.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 Fg.inline=function(a,o){var l=i(a);return e.collectAndReportErrors(l.map(function(u){return t(u,o).then(function(f){n(u,f)})}))},Fg}var zg={},Bg={},h_;function v2(){return h_||(h_=1,function(e){e.unquoteString=function(t){var r=/^"(.*)"$/,n=/^'(.*)'$/;return r.test(t)?t.replace(r,"$1"):n.test(t)?t.replace(n,"$1"):t},e.rulesForCssText=function(t){var r=document.implementation.createHTMLDocument(""),n=document.createElement("style"),i;return n.textContent=t,r.body.appendChild(n),i=n.sheet.cssRules,Array.prototype.slice.call(i)},e.cssRulesToText=function(t){return t.reduce(function(r,n){return r+n.cssText},"")},e.exchangeRule=function(t,r,n){var i=t.indexOf(r);t[i]=e.rulesForCssText(n)[0]},e.changeFontFaceRuleSrc=function(t,r,n){var i="@font-face { font-family: "+r.style.getPropertyValue("font-family")+"; ";r.style.getPropertyValue("font-style")&&(i+="font-style: "+r.style.getPropertyValue("font-style")+"; "),r.style.getPropertyValue("font-weight")&&(i+="font-weight: "+r.style.getPropertyValue("font-weight")+"; "),r.style.getPropertyValue("unicode-range")&&(i+="unicode-range: "+r.style.getPropertyValue("unicode-range")+"; "),i+="src: "+n+"}",e.exchangeRule(t,r,i)}}(Bg)),Bg}var Ug={},p_;function QD(){return p_||(p_=1,function(e){var t=v2(),r=function(a){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return a.replace(o,"$1")};e.extractCssUrl=function(a){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,l;if(!o.test(a))throw new Error("Invalid url");return l=o.exec(a)[1],t.unquoteString(r(l))};var n=function(a){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,l="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+l+")+",f="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",g=new RegExp(u,"g"),S,_=[],h=function(w){var m=new RegExp(l,"g"),y=[],p;for(p=m.exec(w);p;)y.push(p[1]),p=m.exec(w);return y};if(a.match(new RegExp(f))){for(S=g.exec(a);S;)_.push(h(S[0])),S=g.exec(a);return _}return[]},i=function(a){var o,l;for(o=0;o<a.length;o++)try{return l=e.extractCssUrl(a[o]),{url:l,idx:o}}catch{}};e.parse=function(a){var o=n(a);return o.map(function(l){var u=i(l);return u?{preUrl:l.slice(0,u.idx),url:u.url,postUrl:l.slice(u.idx+1)}:{preUrl:l}})},e.serialize=function(a){var o=a.map(function(l){var u=[].concat(l.preUrl);return l.url&&u.push('url("'+l.url+'")'),l.postUrl&&(u=u.concat(l.postUrl)),u.join(" ")});return o.join(", ")}}(Ug)),Ug}function md(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Hg={exports:{}},g_;function JD(){return g_||(g_=1,function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,a){function o(f,g){if(!i[f]){if(!n[f]){var S=typeof md=="function"&&md;if(!g&&S)return S(f,!0);if(l)return l(f,!0);var _=new Error("Cannot find module '"+f+"'");throw _.code="MODULE_NOT_FOUND",_}var h=i[f]={exports:{}};n[f][0].call(h.exports,function(w){var m=n[f][1][w];return o(m||w)},h,h.exports,r,n,i,a)}return i[f].exports}for(var l=typeof md=="function"&&md,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,f){function g(){this.constructor=u}g.prototype=f.prototype,u.prototype=new g}function o(u,f,g,S){this.message=u,this.expected=f,this.found=g,this.location=S,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,f){var g={literal:function(p){return'"'+_(p.text)+'"'},class:function(p){var v="",d;for(d=0;d<p.parts.length;d++)v+=p.parts[d]instanceof Array?h(p.parts[d][0])+"-"+h(p.parts[d][1]):h(p.parts[d]);return"["+(p.inverted?"^":"")+v+"]"},any:function(p){return"any character"},end:function(p){return"end of input"},other:function(p){return p.description}};function S(p){return p.charCodeAt(0).toString(16).toUpperCase()}function _(p){return p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+S(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+S(v)})}function h(p){return p.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+S(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+S(v)})}function w(p){return g[p.type](p)}function m(p){var v=new Array(p.length),d,b;for(d=0;d<p.length;d++)v[d]=w(p[d]);if(v.sort(),v.length>0){for(d=1,b=1;d<v.length;d++)v[d-1]!==v[d]&&(v[b]=v[d],b++);v.length=b}switch(v.length){case 1:return v[0];case 2:return v[0]+" or "+v[1];default:return v.slice(0,-1).join(", ")+", or "+v[v.length-1]}}function y(p){return p?'"'+_(p)+'"':"end of input"}return"Expected "+m(u)+" but "+y(f)+" found."};function l(u,f){f=f!==void 0?f:{};var g={},S={start:ee},_=ee,h="",w=function(){return[]},m=",",y=W(",",!1),p=function(re,de){return[re].concat(de)},v=function(re){return[re]},d=function(re,de){return{url:re,format:de}},b=function(re){return{url:re}},O="url(",R=W("url(",!1),T=")",E=W(")",!1),P=function(re){return re},x="format(",k=W("format(",!1),M="local(",j=W("local(",!1),B=function(re){return{local:re}},$=/^[^)]/,Z=V([")"],!0,!1),K=function(re){return Ee.extractValue(re.join(""))},D=/^[ \t\r\n\f]/,q=V([" "," ","\r",`
|
|
148
|
+
`,"\f"],!1,!1),A=0,L=[{line:1,column:1}],z=0,I=[],H;if("startRule"in f){if(!(f.startRule in S))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');_=S[f.startRule]}function W(re,de){return{type:"literal",text:re,ignoreCase:de}}function V(re,de,me){return{type:"class",parts:re,inverted:de,ignoreCase:me}}function U(){return{type:"end"}}function Y(re){var de=L[re],me;if(de)return de;for(me=re-1;!L[me];)me--;for(de=L[me],de={line:de.line,column:de.column};me<re;)u.charCodeAt(me)===10?(de.line++,de.column=1):de.column++,me++;return L[re]=de,de}function X(re,de){var me=Y(re),Se=Y(de);return{start:{offset:re,line:me.line,column:me.column},end:{offset:de,line:Se.line,column:Se.column}}}function Q(re){A<z||(A>z&&(z=A,I=[]),I.push(re))}function te(re,de,me){return new o(o.buildMessage(re,de),re,de,me)}function ee(){var re,de;return re=ne(),re===g&&(re=A,de=h,de!==g&&(de=w()),re=de),re}function ne(){var re,de,me,Se,Te,ze;if(re=A,de=ie(),de!==g){for(me=[],Se=ve();Se!==g;)me.push(Se),Se=ve();if(me!==g)if(u.charCodeAt(A)===44?(Se=m,A++):(Se=g,Q(y)),Se!==g){for(Te=[],ze=ve();ze!==g;)Te.push(ze),ze=ve();Te!==g?(ze=ne(),ze!==g?(de=p(de,ze),re=de):(A=re,re=g)):(A=re,re=g)}else A=re,re=g;else A=re,re=g}else A=re,re=g;return re===g&&(re=A,de=ie(),de!==g&&(de=v(de)),re=de),re}function ie(){var re;return re=le(),re===g&&(re=oe()),re}function le(){var re,de,me,Se;if(re=A,de=xe(),de!==g){if(me=[],Se=ve(),Se!==g)for(;Se!==g;)me.push(Se),Se=ve();else me=g;me!==g?(Se=Fe(),Se!==g?(de=d(de,Se),re=de):(A=re,re=g)):(A=re,re=g)}else A=re,re=g;return re===g&&(re=A,de=xe(),de!==g&&(de=b(de)),re=de),re}function xe(){var re,de,me,Se;return re=A,u.substr(A,4)===O?(de=O,A+=4):(de=g,Q(R)),de!==g?(me=ue(),me!==g?(u.charCodeAt(A)===41?(Se=T,A++):(Se=g,Q(E)),Se!==g?(de=P(me),re=de):(A=re,re=g)):(A=re,re=g)):(A=re,re=g),re}function Fe(){var re,de,me,Se;return re=A,u.substr(A,7)===x?(de=x,A+=7):(de=g,Q(k)),de!==g?(me=ue(),me!==g?(u.charCodeAt(A)===41?(Se=T,A++):(Se=g,Q(E)),Se!==g?(de=P(me),re=de):(A=re,re=g)):(A=re,re=g)):(A=re,re=g),re}function oe(){var re,de,me,Se;return re=A,u.substr(A,6)===M?(de=M,A+=6):(de=g,Q(j)),de!==g?(me=ue(),me!==g?(u.charCodeAt(A)===41?(Se=T,A++):(Se=g,Q(E)),Se!==g?(de=B(me),re=de):(A=re,re=g)):(A=re,re=g)):(A=re,re=g),re}function ue(){var re,de,me;if(re=A,de=[],$.test(u.charAt(A))?(me=u.charAt(A),A++):(me=g,Q(Z)),me!==g)for(;me!==g;)de.push(me),$.test(u.charAt(A))?(me=u.charAt(A),A++):(me=g,Q(Z));else de=g;return de!==g&&(de=K(de)),re=de,re}function ve(){var re;return D.test(u.charAt(A))?(re=u.charAt(A),A++):(re=g,Q(q)),re}var Ee=r("../util");if(H=_(),H!==g&&A===u.length)return H;throw H!==g&&A<u.length&&Q(U()),te(I,z<u.length?u.charAt(z):null,z<u.length?X(z,z+1):X(z,z))}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)})}(Hg)),Hg.exports}var v_;function ej(){return v_||(v_=1,function(e){var t=Kp(),r=v2(),n=QD(),i=JD(),a=function(v,d,b){v.style.setProperty(d,b,v.style.getPropertyPriority(d))},o=function(v){return v.filter(function(d){return d.type===window.CSSRule.STYLE_RULE&&(d.style.getPropertyValue("background-image")||d.style.getPropertyValue("background"))})},l=function(v){var d=[];return v.forEach(function(b){b.style.getPropertyValue("background-image")?d.push({property:"background-image",value:b.style.getPropertyValue("background-image"),rule:b}):b.style.getPropertyValue("background")&&d.push({property:"background",value:b.style.getPropertyValue("background"),rule:b})}),d},u=function(v){return v.filter(function(d){return d.type===window.CSSRule.FONT_FACE_RULE&&d.style.getPropertyValue("src")})},f=function(v){return v.filter(function(d){return d.type===window.CSSRule.IMPORT_RULE&&d.href})},g=function(v){var d=[];return v.forEach(function(b,O){b.url&&!t.isDataUri(b.url)&&d.push(O)}),d},S=function(v){var d=[];return v.forEach(function(b,O){b.url&&!t.isDataUri(b.url)&&d.push(O)}),d};e.adjustPathsOfCssResources=function(v,d){var b=o(d),O=l(b),R=!1;return O.forEach(function(T){var E=n.parse(T.value),P=g(E),x;P.length>0&&(P.forEach(function(k){var M=E[k].url,j=t.joinUrl(v,M);E[k].url=j}),x=n.serialize(E),a(T.rule,T.property,x),R=!0)}),u(d).forEach(function(T){var E=T.style.getPropertyValue("src"),P,x;try{P=i.parse(E)}catch{return}x=S(P),x.length>0&&(x.forEach(function(k){var M=P[k].url,j=t.joinUrl(v,M);P[k].url=j}),r.changeFontFaceRuleSrc(d,T,i.serialize(P)),R=!0)}),f(d).forEach(function(T){var E=T.href,P=t.joinUrl(v,E);r.exchangeRule(d,T,"@import url("+P+");"),R=!0}),R};var _=function(v,d,b){var O=v.indexOf(d);v.splice(O,1),b.forEach(function(R,T){v.splice(O+T,0,R)})},h=function(v,d,b,O){var R=d.href,T;return R=r.unquoteString(R),T=t.joinUrl(O.baseUrl,R),b.indexOf(T)>=0?(_(v,d,[]),Promise.resolve([])):(b.push(T),t.ajax(R,O).then(function(E){var P=r.rulesForCssText(E);return e.loadCSSImportsForRules(P,b,O).then(function(x){return e.adjustPathsOfCssResources(R,P),_(v,d,P),x.errors})},function(E){throw{resourceType:"stylesheet",url:E.url,msg:"Unable to load stylesheet "+E.url}}))};e.loadCSSImportsForRules=function(v,d,b){var O=f(v),R=[],T=!1;return Promise.all(O.map(function(E){return h(v,E,d,b).then(function(P){R=R.concat(P),T=!0},function(P){R.push(P)})})).then(function(){return{hasChanges:T,errors:R}})};var w=function(v,d){var b=n.parse(v),O=g(b),R=!1;return t.collectAndReportErrors(O.map(function(T){var E=b[T].url;return t.getDataURIForImageURL(E,d).then(function(P){b[T].url=P,R=!0},function(P){throw{resourceType:"backgroundImage",url:P.url,msg:"Unable to load background-image "+P.url}})})).then(function(T){return{backgroundValue:n.serialize(b),hasChanges:R,errors:T}})},m=function(v,d){var b=o(v),O=l(b),R=[],T=!1;return Promise.all(O.map(function(E){return w(E.value,d).then(function(P){P.hasChanges&&(a(E.rule,E.property,P.backgroundValue),T=!0),R=R.concat(P.errors)})})).then(function(){return{hasChanges:T,errors:R}})},y=function(v,d){var b=!1,O,R;try{O=i.parse(v)}catch{O=[]}return R=S(O),t.collectAndReportErrors(R.map(function(T){var E=O[T],P=E.format||"woff";return t.binaryAjax(E.url,d).then(function(x){var k=btoa(x);E.url="data:font/"+P+";base64,"+k,b=!0},function(x){throw{resourceType:"fontFace",url:x.url,msg:"Unable to load font-face "+x.url}})})).then(function(T){return{srcDeclarationValue:i.serialize(O),hasChanges:b,errors:T}})},p=function(v,d){var b=u(v),O=[],R=!1;return Promise.all(b.map(function(T){var E=T.style.getPropertyValue("src");return y(E,d).then(function(P){P.hasChanges&&(r.changeFontFaceRuleSrc(v,T,P.srcDeclarationValue),R=!0),O=O.concat(P.errors)})})).then(function(){return{hasChanges:R,errors:O}})};e.loadAndInlineCSSResourcesForRules=function(v,d){var b=!1,O=[];return Promise.all([m,p].map(function(R){return R(v,d).then(function(T){b=b||T.hasChanges,O=O.concat(T.errors)})})).then(function(){return{hasChanges:b,errors:O}})}}(zg)),zg}var m_;function tj(){return m_||(m_=1,function(e){var t=Kp(),r=XD(),n=ZD(),i=ej(),a=v2(),o=function(y){return t.joinUrl(y,".")},l=function(y){var p=y.map(function(v,d){return d===y.length-1&&(v={baseUrl:o(v.baseUrl)}),JSON.stringify(v)});return p},u=function(y,p){return p.cache!==!1&&p.cache!=="none"&&p.cacheBucket?t.memoize(y,l,p.cacheBucket):y},f=function(y,p,v){var d=a.rulesForCssText(y);return i.loadCSSImportsForRules(d,p,v).then(function(b){return i.loadAndInlineCSSResourcesForRules(d,v).then(function(O){var R=b.errors.concat(O.errors),T=b.hasChanges||O.hasChanges;return T&&(y=a.cssRulesToText(d)),{hasChanges:T,content:y,errors:R}})})},g=function(y,p,v){var d=y.textContent,b=u(f,p);return b(d,v,p).then(function(O){return O.hasChanges&&(y.childNodes[0].nodeValue=O.content),t.cloneArray(O.errors)})},S=function(y){var p=y.getElementsByTagName("style");return Array.prototype.filter.call(p,function(v){return!v.attributes.type||v.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(y,p){var v=S(y),d=[],b=[],O;return O=t.clone(p),O.baseUrl=O.baseUrl||t.getDocumentBaseUrl(y),Promise.all(v.map(function(R){return g(R,O,b).then(function(T){d=d.concat(T)})})).then(function(){return d})};var _=function(y,p){var v=y.parentNode,d;p=p.trim(),p&&(d=y.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(y.ownerDocument.createTextNode(p)),v.insertBefore(d,y)),v.removeChild(y)},h=function(y,p){return t.ajax(y,p).then(function(v){var d=a.rulesForCssText(v);return{content:v,cssRules:d}}).then(function(v){var d=i.adjustPathsOfCssResources(y,v.cssRules);return{content:v.content,cssRules:v.cssRules,hasChanges:d}}).then(function(v){return i.loadCSSImportsForRules(v.cssRules,[],p).then(function(d){return{content:v.content,cssRules:v.cssRules,hasChanges:v.hasChanges||d.hasChanges,errors:d.errors}})}).then(function(v){return i.loadAndInlineCSSResourcesForRules(v.cssRules,p).then(function(d){return{content:v.content,cssRules:v.cssRules,hasChanges:v.hasChanges||d.hasChanges,errors:v.errors.concat(d.errors)}})}).then(function(v){var d=v.content;return v.hasChanges&&(d=a.cssRulesToText(v.cssRules)),{content:d,errors:v.errors}})},w=function(y,p){var v=y.attributes.href.value,d=t.getDocumentBaseUrl(y.ownerDocument),b=t.clone(p);!b.baseUrl&&d&&(b.baseUrl=d);var O=u(h,p);return O(v,b).then(function(R){return{content:R.content,errors:t.cloneArray(R.errors)}})},m=function(y){var p=y.getElementsByTagName("link");return Array.prototype.filter.call(p,function(v){return v.attributes.rel&&v.attributes.rel.value==="stylesheet"&&(!v.attributes.type||v.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(y,p){var v=m(y),d=[];return Promise.all(v.map(function(b){return w(b,p).then(function(O){_(b,O.content+`
|
|
149
|
+
`),d=d.concat(O.errors)},function(O){d.push({resourceType:"stylesheet",url:O.url,msg:"Unable to load stylesheet "+O.url})})})).then(function(){return d})},e.loadAndInlineImages=r.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(y,p){var v=[],d=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return p.inlineScripts!==!1&&d.push(e.loadAndInlineScript),Promise.all(d.map(function(b){return b(y,p).then(function(O){v=v.concat(O)})})).then(function(){return v})}}(Ig)),Ig}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
|
|
150
|
+
* http://www.github.com/cburgmer/rasterizeHTML.js
|
|
151
|
+
* Copyright (c) 2022 Christoph Burgmer; Licensed MIT */(function(e){(function(t,r){t===void 0&&window!==void 0&&(t=window),e.exports?e.exports=r(uS(),KD(),YD(),tj()):t.rasterizeHTML=r(t.url,t.xmlserializer,t.sanedomparsererror,t.inlineresources)})(ye,function(t,r,n,i){var a=function(w){var m={},y=[];m.joinUrl=function(d,b){return d?w.resolve(d,b):b},m.getConstantUniqueIdFor=function(d){return y.indexOf(d)<0&&y.push(d),y.indexOf(d)},m.clone=function(d){var b={},O;for(O in d)d.hasOwnProperty(O)&&(b[O]=d[O]);return b};var p=function(d){return typeof d=="object"&&d!==null},v=function(d){return p(d)&&Object.prototype.toString.apply(d).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return m.parseOptionalParameters=function(d){var b={canvas:null,options:{}};return d[0]==null||v(d[0])?(b.canvas=d[0]||null,b.options=m.clone(d[1])):b.options=m.clone(d[0]),b},m}(t),o=function(w){var m={},y=function(p,v,d){var b=p[v];return p[v]=function(){var O=Array.prototype.slice.call(arguments);return d.apply(this,[O,b])},b};return m.baseUrlRespectingXhr=function(p,v){var d=function(){var b=new p;return y(b,"open",function(O,R){var T=O.shift(),E=O.shift(),P=w.joinUrl(v,E);return R.apply(this,[T,P].concat(O))}),b};return d},m.finishNotifyingXhr=function(p){var v=0,d=0,b=!1,O,R=new Promise(function(E){O=function(){var P=v-d;P<=0&&b&&E({totalCount:v})}}),T=function(){var E=new p;return y(E,"send",function(P,x){return v+=1,x.apply(this,arguments)}),E.addEventListener("load",function(){d+=1,O()}),E};return T.waitForRequestsToFinish=function(){return b=!0,O(),R},T},m}(a),l=function(){var w={},m=function(T){return Array.prototype.slice.call(T)};w.addClassName=function(T,E){T.className+=" "+E},w.addClassNameRecursively=function(T,E){w.addClassName(T,E),T.parentNode!==T.ownerDocument&&w.addClassNameRecursively(T.parentNode,E)};var y=function(T,E){var P=T.parentStyleSheet,x=m(P.cssRules).indexOf(T);P.insertRule(E,x+1),P.deleteRule(x)},p=function(T,E){var P=T.cssText.replace(/^[^\{]+/,""),x=E+" "+P;y(T,x)},v=function(T){return m(T).reduce(function(E,P){return E+P.cssText},"")},d=function(T){T.textContent=v(T.sheet.cssRules)},b=function(T){var E=document.implementation.createHTMLDocument(""),P=document.createElement("style");P.textContent=T.textContent,E.body.appendChild(P),T.sheet=P.sheet},O=function(T){return"((?:^|[^.#:\\w])|(?=\\W))("+T.join("|")+")(?=\\W|$)"},R=function(T,E,P){var x=O(E);m(T.querySelectorAll("style")).forEach(function(k){typeof k.sheet>"u"&&b(k);var M=m(k.sheet.cssRules).filter(function(j){return j.selectorText&&new RegExp(x,"i").test(j.selectorText)});M.length&&(M.forEach(function(j){var B=j.selectorText.replace(new RegExp(x,"gi"),function($,Z,K){return Z+P(K)});B!==j.selectorText&&p(j,B)}),d(k))})};return w.rewriteCssSelectorWith=function(T,E,P){R(T,[E],function(){return P})},w.lowercaseCssTypeSelectors=function(T,E){R(T,E,function(P){return P.toLowerCase()})},w.findHtmlOnlyNodeNames=function(T){var E=T.ownerDocument.createTreeWalker(T,NodeFilter.SHOW_ELEMENT),P={},x={},k;do k=E.currentNode.tagName.toLowerCase(),E.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?P[k]=!0:x[k]=!0;while(E.nextNode());return Object.keys(P).filter(function(M){return!x[M]})},w}(),u=function(w){var m={},y=function(v){return Array.prototype.slice.call(v)},p={active:!0,hover:!0,focus:!1,target:!1};return m.fakeUserAction=function(v,d,b){var O=v.querySelector(d),R=":"+b,T="rasterizehtml"+b;O&&(p[b]?w.addClassNameRecursively(O,T):w.addClassName(O,T),w.rewriteCssSelectorWith(v,R,"."+T))},m.persistInputValues=function(v){var d=v.querySelectorAll("input"),b=v.querySelectorAll("textarea"),O=function(R){return R.type==="checkbox"||R.type==="radio"};y(d).filter(O).forEach(function(R){R.checked?R.setAttribute("checked",""):R.removeAttribute("checked")}),y(d).filter(function(R){return!O(R)}).forEach(function(R){R.setAttribute("value",R.value)}),y(b).forEach(function(R){R.textContent=R.value})},m.rewriteTagNameSelectorsToLowerCase=function(v){w.lowercaseCssTypeSelectors(v,w.findHtmlOnlyNodeNames(v))},m}(l),f=function(w,m,y,p){var v={},d=function(K,D,q,A){var L=K.createElement(D);return L.style.visibility="hidden",L.style.width=q+"px",L.style.height=A+"px",L.style.position="absolute",L.style.top=-1e4-A+"px",L.style.left=-1e4-q+"px",K.getElementsByTagName("body")[0].appendChild(L),L},b=function(K){return K>0?new Promise(function(D){setTimeout(D,K)}):Promise.resolve()};v.executeJavascript=function(K,D){return new Promise(function(q){var A=d(p.document,"iframe",D.width,D.height),L=K.outerHTML,z=[],I=D.executeJsTimeout||0,H=function(){p.document.getElementsByTagName("body")[0].removeChild(A)},W=function(){var X=A.contentDocument;q({document:X,errors:z,cleanUp:H})},V=A.contentWindow.XMLHttpRequest,U=m.finishNotifyingXhr(V),Y=m.baseUrlRespectingXhr(U,D.baseUrl);A.onload=function(){b(I).then(U.waitForRequestsToFinish).then(W)},A.contentDocument.open(),A.contentWindow.XMLHttpRequest=Y,A.contentWindow.onerror=function(X){z.push({resourceType:"scriptExecution",msg:X})},A.contentDocument.write("<!DOCTYPE html>"),A.contentDocument.write(L),A.contentDocument.close()})};var O=function(K,D,q){var A=K.createElement("iframe");return A.style.width=D+"px",A.style.height=q+"px",A.style.visibility="hidden",A.style.position="absolute",A.style.top=-1e4-q+"px",A.style.left=-1e4-D+"px",A.style.borderWidth=0,A.sandbox="allow-same-origin",A.scrolling="no",A},R=function(K,D,q){var A=Math.floor(K/q),L=Math.floor(D/q);return O(p.document,A,L)},T=function(K,D,q,A){return{width:Math.max(K.width*A,D),height:Math.max(K.height*A,q)}},E=function(K,D){var q=K.querySelector(D);if(q)return q;if(K.ownerDocument.querySelector(D)===K)return K;throw{message:"Clipping selector not found"}},P=function(K,D,q,A,L){var z=Math.max(K.scrollWidth,K.clientWidth),I=Math.max(K.scrollHeight,K.clientHeight),H,W,V,U,Y,X,Q,te;return D?(X=E(K,D),Q=X.getBoundingClientRect(),H=Q.top,W=Q.left,V=Q.width,U=Q.height):(H=0,W=0,V=z,U=I),te=T({width:V,height:U},q,A,L),Y=p.getComputedStyle(K.ownerDocument.documentElement).fontSize,{left:W,top:H,width:te.width,height:te.height,viewportWidth:z,viewportHeight:I,rootFontSize:Y}},x=function(K,D){var q=K.tagName;return D.querySelector(q)},k=function(K){var D=K.tagName.toLowerCase();return D==="html"||D==="body"?K.outerHTML:'<body style="margin: 0;">'+K.outerHTML+"</body>"};v.calculateDocumentContentSize=function(K,D){return new Promise(function(q,A){var L=D.zoom||1,z;z=R(D.width,D.height,L),p.document.getElementsByTagName("body")[0].appendChild(z),z.onload=function(){var I=z.contentDocument,H;try{H=P(x(K,I),D.clip,D.width,D.height,L),q(H)}catch(W){A(W)}finally{p.document.getElementsByTagName("body")[0].removeChild(z)}},z.contentDocument.open(),z.contentDocument.write("<!DOCTYPE html>"),z.contentDocument.write(k(K)),z.contentDocument.close()})},v.parseHtmlFragment=function(K){var D=p.document.implementation.createHTMLDocument("");D.documentElement.innerHTML=K;var q=D.querySelector("body").firstChild;if(!q)throw"Invalid source";return q};var M=function(K,D){var q=/<html((?:\s+[^>]*)?)>/im.exec(D),A=p.document.implementation.createHTMLDocument(""),L,z,I,H;if(q)for(L="<div"+q[1]+"></div>",A.documentElement.innerHTML=L,I=A.querySelector("div"),z=0;z<I.attributes.length;z++)H=I.attributes[z],K.documentElement.setAttribute(H.name,H.value)};v.parseHTML=function(K){var D=p.document.implementation.createHTMLDocument("");return D.documentElement.innerHTML=K,M(D,K),D};var j=function(K){try{return y.failOnParseError(K)}catch(D){throw{message:"Invalid source",originalError:D}}};v.validateXHTML=function(K){var D=new DOMParser,q=D.parseFromString(K,"application/xml");j(q)};var B=null,$=function(K,D){return D==="none"||D==="repeated"?((B===null||D!=="repeated")&&(B=Date.now()),K+"?_="+B):K},Z=function(K,D){return new Promise(function(q,A){var L=new window.XMLHttpRequest,z=w.joinUrl(D.baseUrl,K),I=$(z,D.cache),H=function(W){A({message:"Unable to load page",originalError:W})};L.addEventListener("load",function(){L.status===200||L.status===0?q(L.responseXML):H(L.statusText)},!1),L.addEventListener("error",function(W){H(W)},!1);try{L.open("GET",I,!0),L.responseType="document",L.send(null)}catch(W){H(W)}})};return v.loadDocument=function(K,D){return Z(K,D).then(function(q){return j(q)})},v}(a,o,n,window),g=function(w){var m={},y=function(x,k){return k?URL.createObjectURL(new Blob([x],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(x)},p=function(x){x instanceof Blob&&URL.revokeObjectURL(x)},v='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',d=function(x){return new Promise(function(k,M){var j=document.createElement("canvas"),B=new Image;B.onload=function(){var $=j.getContext("2d");try{$.drawImage(B,0,0),j.toDataURL("image/png"),k(!0)}catch{k(!1)}},B.onerror=M,B.src=x})},b=function(){var x=y(v,!0);return d(x).then(function(k){return p(x),k?!1:d(y(v,!1)).then(function(M){return M})},function(){return!1})},O=function(){if(w.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},R=function(){return new Promise(function(x,k){O()&&w.URL?b().then(function(M){x(!M)},function(){k()}):x(!1)})},T,E=function(){return T===void 0&&(T=R()),T},P=function(x){return E().then(function(k){return y(x,k)})};return m.renderSvg=function(x){return new Promise(function(k,M){var j,B,$=function(){B.onload=null,B.onerror=null},Z=function(){j&&p(j)};B=new Image,B.onload=function(){$(),Z(),k(B)},B.onerror=function(){Z(),M()},P(x).then(function(K){j=K,B.src=j},M)})},m}(window),S=function(w,m,y,p){var v={},d=function(x,k){var M=k||1,j={width:x.width,height:x.height,"font-size":x.rootFontSize};return M!==1&&(j.style="transform:scale("+M+"); transform-origin: 0 0;"),j},b=function(x){var k,M,j,B;k=Math.round(x.viewportWidth),M=Math.round(x.viewportHeight),j=-x.left,B=-x.top;var $={x:j,y:B,width:k,height:M};return $},O=function(x){var k=x.style||"";x.style=k+"float: left;"},R=function(x){x.externalResourcesRequired=!0},T=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},E=function(x){var k=Object.keys(x);return k.length?" "+k.map(function(M){return M+'="'+x[M]+'"'}).join(" "):""},P=function(x,k,M){var j=p.serializeToString(x);m.validateXHTML(j);var B=b(k);return O(B),R(B),'<svg xmlns="http://www.w3.org/2000/svg"'+E(d(k,M))+">"+T()+"<foreignObject"+E(B)+">"+j+"</foreignObject></svg>"};return v.getSvgForDocument=function(x,k,M){return y.rewriteTagNameSelectorsToLowerCase(x),P(x,k,M)},v.drawDocumentAsSvg=function(x,k){return["hover","active","focus","target"].forEach(function(M){k[M]&&y.fakeUserAction(x,k[M],M)}),m.calculateDocumentContentSize(x,k).then(function(M){return v.getSvgForDocument(x,M,k.zoom)})},v}(a,f,u,r),_=function(w,m,y,p,v,d){var b={},O=function(x){return{message:"Error rendering page",originalError:x}},R=function(x){return v.renderSvg(x).then(function(k){return{image:k,svg:x}},function(k){throw O(k)})},T=function(x,k){try{k.getContext("2d").drawImage(x,0,0)}catch(M){throw O(M)}},E=function(x,k,M){return p.drawDocumentAsSvg(x,M).then(R).then(function(j){return k&&T(j.image,k),j})},P=function(x,k){return m.executeJavascript(x,k).then(function(M){var j=M.document;return y.persistInputValues(j),{document:j,errors:M.errors,cleanUp:M.cleanUp}})};return b.rasterize=function(x,k,M){var j;return j=w.clone(M),j.inlineScripts=M.executeJs===!0,d.inlineReferences(x,j).then(function(B){return M.executeJs?P(x,M).then(function($){return{element:$.document.documentElement,errors:B.concat($.errors),cleanUp:$.cleanUp}}):{element:x,errors:B,cleanUp:function(){}}}).then(function(B){return E(B.element,k,M).then(function($){return B.cleanUp(),{image:$.image,svg:$.svg,errors:B.errors}})})},b}(a,f,u,S,g,i),h=function(w,m,y){var p={},v=function(T,E){var P=300,x=200,k=T?T.width:P,M=T?T.height:x,j=E.width!==void 0?E.width:k,B=E.height!==void 0?E.height:M;return{width:j,height:B}},d=function(T){var E=v(T.canvas,T.options),P;return P=w.clone(T.options),P.width=E.width,P.height=E.height,P};p.drawDocument=function(){var T=arguments[0],E=Array.prototype.slice.call(arguments,1),P=w.parseOptionalParameters(E),x=T.documentElement?T.documentElement:T;return y.rasterize(x,P.canvas,d(P))};var b=function(T,E,P){var x=m.parseHTML(T);return p.drawDocument(x,E,P)};p.drawHTML=function(){var T=arguments[0],E=Array.prototype.slice.call(arguments,1),P=w.parseOptionalParameters(E);return b(T,P.canvas,P.options)};var O=function(T,E,P){var x=document.implementation.createHTMLDocument("");x.replaceChild(T.documentElement,x.documentElement);var k=P?w.clone(P):{};return P.baseUrl||(k.baseUrl=E),{document:x,options:k}},R=function(T,E,P){return m.loadDocument(T,P).then(function(x){var k=O(x,T,P);return p.drawDocument(k.document,E,k.options)})};return p.drawURL=function(){var T=arguments[0],E=Array.prototype.slice.call(arguments,1),P=w.parseOptionalParameters(E);return R(T,P.canvas,P.options)},p}(a,f,_);return h})})(aS);var rj=aS.exports;(function(e){var t=ye&&ye.__createBinding||(Object.create?function(S,_,h,w){w===void 0&&(w=h);var m=Object.getOwnPropertyDescriptor(_,h);m&&!("get"in m?!_.__esModule:m.writable||m.configurable)||(m={enumerable:!0,get:function(){return _[h]}}),Object.defineProperty(S,w,m)}:function(S,_,h,w){w===void 0&&(w=h),S[w]=_[h]}),r=ye&&ye.__setModuleDefault||(Object.create?function(S,_){Object.defineProperty(S,"default",{enumerable:!0,value:_})}:function(S,_){S.default=_}),n=ye&&ye.__importStar||function(S){if(S&&S.__esModule)return S;var _={};if(S!=null)for(var h in S)h!=="default"&&Object.prototype.hasOwnProperty.call(S,h)&&t(_,S,h);return r(_,S),_};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToCanvas=e.detectSize=e.resetStyleContent=void 0;const i=n(rj),a=Ws;e.resetStyleContent=`
|
|
152
|
+
p {
|
|
153
|
+
margin: 0;
|
|
154
|
+
padding: 0;
|
|
155
|
+
word-wrap: break-word; /* Required for Firefox */
|
|
156
|
+
}
|
|
157
|
+
ul, ol {
|
|
158
|
+
list-style-position: outside;
|
|
159
|
+
margin: 0;
|
|
160
|
+
padding: 0;
|
|
161
|
+
display: inline-block;
|
|
162
|
+
text-align: left;
|
|
163
|
+
}
|
|
164
|
+
li {
|
|
165
|
+
margin-left: 1.7em;
|
|
166
|
+
padding-left: 0.5em; /* This should match the margin-left value */
|
|
167
|
+
}
|
|
168
|
+
/* Add resets */
|
|
169
|
+
ul {
|
|
170
|
+
list-style-type: disc;
|
|
171
|
+
}
|
|
172
|
+
ol {
|
|
173
|
+
list-style-type: decimal;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
`;const o=`
|
|
177
|
+
<style>
|
|
178
|
+
html, body {
|
|
179
|
+
padding: 0;
|
|
180
|
+
margin: 0;
|
|
181
|
+
}
|
|
182
|
+
${e.resetStyleContent}
|
|
183
|
+
</style>
|
|
184
|
+
`;let l;const u=()=>(l||(l=document.createElement("div"),l.id="polotno-hidden-do-not-touch",l.style.overflow="hidden",l.style.position="relative",document.body.appendChild(l),l.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),l);function f(S){const _=document.createElement("div");_.innerHTML=S,_.style.display="inline-block",_.style.position="fixed",_.style.top="0px",_.style.left="0px",_.style.zIndex="1000";const h=u();h.appendChild(_);const w=_.getBoundingClientRect();return h.removeChild(_),{width:w.width,height:w.height}}async function g({html:S,width:_,height:h,fontFamily:w,padding:m,font:y,pixelRatio:p}){const v=document.createElement("canvas");if(w!=="Arial"&&!y){const O=(0,a.getGoogleFontsVariants)();S+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${w}:${O}" rel="stylesheet">`}if(y){const O=y.styles||(y.url?[{src:`url("${y.url}")`}]:[]);S+="<style>",O.forEach(R=>{S+=`
|
|
185
|
+
@font-face {
|
|
186
|
+
font-family: '${w}';
|
|
187
|
+
src: ${R.src};
|
|
188
|
+
font-style: ${R.fontStyle||"normal"};
|
|
189
|
+
font-weight: ${R.fontWeight||"normal"};
|
|
190
|
+
}
|
|
191
|
+
`}),S+="</style>"}S+=o;const d=await i.drawHTML(`<div style="padding: ${m}px;">${S}</div>`,v,{width:_+2*m,height:h+2*m});v.width=(_+2*m)*p,v.height=(h+2*m)*p;const b=v.getContext("2d");return b==null||b.drawImage(d.image,0,0,d.image.width*p,d.image.height*p),v}e.detectSize=f,e.htmlToCanvas=g})(iS);var m2={},y2={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.styled=e.setup=e.keyframes=e.glob=e.extractCss=e.css=void 0;let t={data:""},r=d=>typeof window=="object"?((d?d.querySelector("#_goober"):window._goober)||Object.assign((d||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:d||t,n=d=>{let b=r(d),O=b.data;return b.data="",O},i=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(d,b)=>{let O="",R="",T="";for(let E in d){let P=d[E];E[0]=="@"?E[1]=="i"?O=E+" "+P+";":R+=E[1]=="f"?o(P,E):E+"{"+o(P,E[1]=="k"?"":b)+"}":typeof P=="object"?R+=o(P,b?b.replace(/([^,])+/g,x=>E.replace(/(^:.*)|([^,])+/g,k=>/&/.test(k)?k.replace(/&/g,x):x?x+" "+k:k)):E):P!=null&&(E=E.replace(/[A-Z]/g,"-$&").toLowerCase(),T+=o.p?o.p(E,P):E+":"+P+";")}return O+(b&&T?b+"{"+T+"}":T)+R},l={},u=d=>{if(typeof d=="object"){let b="";for(let O in d)b+=O+u(d[O]);return b}return d},f=(d,b,O,R,T)=>{let E=u(d),P=l[E]||(l[E]=(x=>{let k=0,M=11;for(;k<x.length;)M=101*M+x.charCodeAt(k++)>>>0;return"go"+M})(E));if(!l[P]){let x=E!==d?d:(k=>{let M,j=[{}];for(;M=i.exec(k.replace(a,""));)M[4]?j.shift():M[3]?j.unshift(j[0][M[3]]=j[0][M[3]]||{}):j[0][M[1]]=M[2];return j[0]})(d);l[P]=o(T?{["@keyframes "+P]:x}:x,O?"":"."+P)}return((x,k,M)=>{k.data.indexOf(x)==-1&&(k.data=M?x+k.data:k.data+x)})(l[P],b,R),P},g=(d,b,O)=>d.reduce((R,T,E)=>{let P=b[E];if(P&&P.call){let x=P(O),k=x&&x.props&&x.props.className||/^go/.test(x)&&x;P=k?"."+k:x&&typeof x=="object"?x.props?"":o(x,""):x===!1?"":x}return R+T+(P??"")},"");function S(d){let b=this||{},O=d.call?d(b.p):d;return f(O.unshift?O.raw?g(O,[].slice.call(arguments,1),b.p):O.reduce((R,T)=>Object.assign(R,T&&T.call?T(b.p):T),{}):O,r(b.target),b.g,b.o,b.k)}e.extractCss=n,e.css=S;let _,h,w,m=S.bind({g:1}),y=S.bind({k:1});function p(d,b,O,R){o.p=b,_=d,h=O,w=R}function v(d,b){let O=this||{};return function(){let R=arguments;function T(E,P){let x=Object.assign({},E),k=x.className||T.className;O.p=Object.assign({theme:h&&h()},x),O.o=/ *go\d+/.test(k),x.className=S.apply(O,R)+(k?" "+k:""),b&&(x.ref=P);let M=d;return d[0]&&(M=x.as||d,delete x.as),w&&M[0]&&w(x),_(M,x)}return b?b(T):T}}e.glob=m,e.keyframes=y,e.setup=p,e.styled=v})(y2);var nj=ye&&ye.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(m2,"__esModule",{value:!0});const ij=nj(et),y_=y2;(0,y_.setup)(ij.default.createElement),m2.default=y_.styled;(function(e){var t=ye&&ye.__createBinding||(Object.create?function(D,q,A,L){L===void 0&&(L=A);var z=Object.getOwnPropertyDescriptor(q,A);z&&!("get"in z?!q.__esModule:z.writable||z.configurable)||(z={enumerable:!0,get:function(){return q[A]}}),Object.defineProperty(D,L,z)}:function(D,q,A,L){L===void 0&&(L=A),D[L]=q[A]}),r=ye&&ye.__setModuleDefault||(Object.create?function(D,q){Object.defineProperty(D,"default",{enumerable:!0,value:q})}:function(D,q){D.default=q}),n=ye&&ye.__importStar||function(D){if(D&&D.__esModule)return D;var q={};if(D!=null)for(var A in D)A!=="default"&&Object.prototype.hasOwnProperty.call(D,A)&&t(q,D,A);return r(q,D),q},i=ye&&ye.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.createQuill=e.quillRef=void 0;const a=i(et),o=yi,l=Pa,u=i(ED),f=i(_i),g=n(Wi),S=Kn,_=Vc,h=Zy,w=Gc,m=iS,y=El,p=Ol,v=$c,d=i(m2),b=Hi,O=e2,R=n(Ws),T=Oo,E=f2;e.quillRef=g.observable({enabled:!1,currentFormat:{},editor:g.observable.object({instance:null},{},{deep:!1})});const P=(0,d.default)("div",a.default.forwardRef)`
|
|
192
|
+
.ql-editor {
|
|
193
|
+
outline: none;
|
|
194
|
+
}
|
|
195
|
+
${m.resetStyleContent}
|
|
196
|
+
strong {
|
|
197
|
+
font-weight: 700;
|
|
198
|
+
}
|
|
199
|
+
.ql-direction-rtl {
|
|
200
|
+
direction: rtl;
|
|
201
|
+
}
|
|
202
|
+
`,x=D=>new u.default(D,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:["bold","color","font","italic","size","strike","underline","indent","list","direction"]});e.createQuill=x;const k=({html:D,onBlur:q,onChange:A,element:L})=>{const z=a.default.useRef(null);a.default.useEffect(()=>{if(!z.current)return;const H=(0,e.createQuill)(z.current);return g.runInAction(()=>{e.quillRef.editor.instance=H}),window.__polotnoQuill=H,H.on("text-change",()=>{H.getSelection()&&g.runInAction(()=>{e.quillRef.currentFormat=H.getFormat()}),setTimeout(()=>{var W;A((W=z.current)===null||W===void 0?void 0:W.childNodes[0].innerHTML)},10)}),H.setSelection(0,0,"api"),H.on("selection-change",W=>{W||q(),W&&g.runInAction(()=>{e.quillRef.currentFormat=H.getFormat()})}),z.current.childNodes[0].addEventListener("blur",W=>{var V;!((V=W.relatedTarget)===null||V===void 0)&&V.classList.contains("ql-clipboard")||q()}),()=>{g.runInAction(()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),a.default.useEffect(()=>{var H;const W=e.quillRef.editor.instance;if(!W)return;const V=W.getSelection();if(((H=z.current)===null||H===void 0?void 0:H.childNodes[0].innerHTML)!==L.text){var U=W.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+D+"<p><br></p></div>");W.setContents(U),W.history.clear(),V&&(W.setSelection(V.index,V.length),g.runInAction(()=>{e.quillRef.currentFormat=W.getFormat()}))}},[L.text]);const I={color:L.fill};return L.fill.indexOf("gradient")>=0&&(I["background-color"]=L.fill,I["background-image"]=L.fill,I["background-size"]="100% 100%",I["background-repeat"]="repeat",I["-webkit-background-clip"]="text",I["-moz-background-clip"]="text",I["-webkit-text-fill-color"]="transparent",I["-moz-text-fill-color"]="transparent"),a.default.createElement(P,{ref:z,style:Object.assign(Object.assign({},I),{fontSize:L.fontSize,width:L.a.width,fontFamily:L.fontFamily,lineHeight:L.lineHeight,letterSpacing:L.letterSpacing+"rem",textAlign:L.align}),dir:(0,h.getDir)((0,O.removeTags)(L.text))})};function M(D,q,A){return a.default.useMemo(()=>(0,m.detectSize)(D),[D,q.width,A])}function j(D){const q=D.getContext("2d").getImageData(0,0,D.width,D.height).data;for(let A=0;A<q.length;A+=4)if(q[A+3]!==0)return!0;return!1}function B(D){return!j(D)}function $(D,{fontFamily:q="",color:A="black"}={}){let L=`color: ${A||D.fill}`;return D.fill.indexOf("gradient")>=0&&(L=`
|
|
203
|
+
background-color: ${A};
|
|
204
|
+
background-image: ${D.fill};
|
|
205
|
+
background-size: 100% 100%;
|
|
206
|
+
background-repeat: repeat;
|
|
207
|
+
-webkit-background-clip: text;
|
|
208
|
+
-moz-background-clip: text;
|
|
209
|
+
-webkit-text-fill-color: transparent;
|
|
210
|
+
-moz-text-fill-color: transparent;
|
|
211
|
+
`),`<div style="white-space: unset; width: ${Math.round(D.width||100)}px; ${L}; font-size: ${D.fontSize}px; font-family: '${q}'; text-decoration: ${D.textDecoration}; text-align: ${D.align}; line-height: ${D.lineHeight}; letter-spacing: ${D.letterSpacing}rem; font-style: ${D.fontStyle}; font-weight: ${D.fontWeight}; -webkit-text-stroke: ${D.strokeWidth}px ${D.stroke};" contentEditable dir="${(0,h.getDir)((0,O.removeTags)(D.text))}">${D.text.replaceAll(`
|
|
212
|
+
`,"</br>")}</div>`}const Z=D=>{let q=D.fontSize;for(let A=1;A<50;A++){const L=$(Object.assign(Object.assign({},D.toJSON()),{fontSize:q}),{fontFamily:D.fontFamily}),{height:z}=(0,m.detectSize)(L);if(!(D.height&&z>D.height))break;q-=.5}return q},K=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,o.observer)(({element:D,store:q})=>{const A=a.default.useRef(null),[L,z]=a.default.useState(),[I,H]=a.default.useState(!1),[W,V]=a.default.useState(!0),[U,Y]=a.default.useState(!1),X=a.default.useRef(D.height),Q=q.selectedElements.indexOf(D)>=0,te=D.fontSize/3,{textVerticalResizeEnabled:ee}=S.flags,ne=(0,h.usePrevious)(D.fontFamily),[ie]=(0,h.useFontLoader)(q,D.fontFamily),le=D._editModeEnabled;(0,y.useFadeIn)(A);const xe=ie?D.fontFamily:ne!==D.fontFamily?ne:"Arial",Fe=(0,w.useColor)(D).fill,oe=$(D,{fontFamily:xe,color:Fe}),{width:ue,height:ve}=M(oe,D,ie);a.default.useEffect(()=>{if(!ie)return;if(!D.height)return void D.set({height:ve});const{textOverflow:Te}=S.flags;if(Te!=="change-font-size"||I)Te==="resize"&&(ee&&D.height<ve&&q.history.ignore(()=>{D.set({height:ve})}),ee||D.height===ve||q.history.ignore(()=>{D.set({height:ve})}));else{const ze=Z(D);ze!==D.fontSize?q.history.ignore(()=>{D.set({fontSize:ze})}):D.height!==ve&&(ee&&D.height<ve?q.history.ignore(()=>{D.set({height:ve})}):ee||q.history.ignore(()=>{D.set({height:ve})}))}});const Ee=a.default.useRef(0);a.default.useEffect(()=>{I||le||(async()=>{Ee.current++;const Te=Ee.current,ze=(0,b.incrementLoader)(`text ${D.id}`);V(!0);let Re=null;const Ne=K?5:1;for(let $e=0;$e<Ne;$e++){if(Re=await(0,m.htmlToCanvas)({html:oe,width:D.width||1,height:D.height||ve||1,fontFamily:xe,padding:te,pixelRatio:q._elementsPixelRatio,font:q.fonts.find(Ge=>Ge.fontFamily===xe)||R.globalFonts.find(Ge=>Ge.fontFamily===xe)}),Te!==Ee.current)return void ze();B(Re)&&K&&await new Promise(Ge=>setTimeout(Ge,50*($e+1)))}Re?(z(Re),V(!1),f.default.Util.requestAnimFrame(ze)):ze()})()},[oe,I,ve,le,xe,D.height,q._elementsPixelRatio]);const re=I||W;a.default.useEffect(()=>g.autorun(()=>{const Te=A.current;(0,_.applyFilter)(Te,D)}),[L,re,D.shadowColor,D.shadowOffsetX,D.shadowOffsetY,D.shadowOpacity]);let de=0;D.verticalAlign==="middle"&&(de=(D.height-ve)/2),D.verticalAlign==="bottom"&&(de=D.height-ve);const me=(0,h.getLineHeight)({fontLoaded:ie,fontFamily:D.fontFamily,fontSize:D.fontSize,lineHeight:D.lineHeight}),Se=(0,T.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Rect,{x:D.a.x,y:D.a.y,offsetX:D.backgroundPadding*(D.fontSize*me*.5),offsetY:D.backgroundPadding*(D.fontSize*me*.5),rotation:D.a.rotation,hideInExport:!D.showInExport,listening:!1,visible:D.backgroundEnabled,opacity:D.backgroundOpacity*D.a.opacity,fill:D.backgroundColor,width:D.a.width+D.backgroundPadding*(D.fontSize*me),height:D.a.height+D.backgroundPadding*(D.fontSize*me),cornerRadius:D.backgroundCornerRadius*(D.fontSize*me*.5)}),a.default.createElement(l.Rect,{ref:A,name:"element",x:D.a.x,y:D.a.y,listening:D.selectable,rotation:D.a.rotation,width:D.a.width,height:D.a.height,visible:!re,draggable:Se?D.draggable&&Q:D.draggable,preventDefault:!Se||Q,opacity:le?0:D.a.opacity,hideInExport:!D.showInExport,onMouseEnter:()=>{Y(!0)},onMouseLeave:()=>{Y(!1)},onDragMove:Te=>{D.set({x:Te.target.x(),y:Te.target.y()})},onDragEnd:Te=>{D.set({x:Te.target.x(),y:Te.target.y()})},id:D.id,onDblClick:()=>{D.contentEditable&&D.toggleEditMode(!0)},onDblTap:()=>{D.contentEditable&&D.toggleEditMode(!0)},onTransformStart:Te=>{H(!0),X.current=D.height},onTransform:Te=>{var ze;const Re=Te.target,Ne=((ze=Re.getStage())===null||ze===void 0?void 0:ze.findOne("Transformer")).getActiveAnchor(),$e=Ne==="middle-left"||Ne==="middle-right",Ge=Ne==="top-center"||Ne==="bottom-center",ut=Re.scaleX();if($e){const ce=Re.scaleX(),fe=Math.max(Re.width()*ce,D.fontSize);if(Re.width(fe),Re.scaleX(1),S.flags.textVerticalResizeEnabled){const Ze=Math.max(ve,X.current);D.set({height:Ze})}D.set({width:fe,x:Re.x(),y:Re.y()})}else if(Ge){let ce=S.flags.textOverflow==="resize"?ve:D.lineHeight*D.fontSize;const fe=Math.max(ce,Te.target.height()*Te.target.scaleY());Re.scaleY(1),D.set({x:Re.x(),y:Re.y(),height:fe,rotation:Re.rotation()})}else Re.scaleX(1),Re.scaleY(1),D.set({fontSize:D.fontSize*ut,width:Re.width()*ut,x:Re.x(),y:Re.y(),rotation:Re.rotation(),height:Re.height()*ut})},onTransformEnd:Te=>{H(!1),V(!0);const ze=Te.target.scaleX();Te.target.scaleX(1),Te.target.scaleY(1),D.set({fontSize:D.fontSize*ze,width:Te.target.width()*ze,x:Te.target.x(),y:Te.target.y(),rotation:Te.target.rotation(),shadowBlur:D.shadowBlur*ze,shadowOffsetX:D.shadowOffsetX*ze,shadowOffsetY:D.shadowOffsetY*ze,strokeWidth:D.strokeWidth*ze})}}),a.default.createElement(l.Image,{ref:A,image:L,x:D.a.x,y:D.a.y,offsetX:te,offsetY:te-de,listening:!1,rotation:D.rotation,width:D.a.width+2*te,height:D.a.height+2*te,visible:!re,opacity:le?0:D.a.opacity,shadowEnabled:D.shadowEnabled,shadowBlur:D.shadowBlur,shadowOffsetX:D.shadowOffsetX,shadowOffsetY:D.shadowOffsetY,shadowColor:D.shadowColor,shadowOpacity:D.shadowOpacity,hideInExport:!D.showInExport}),re&&a.default.createElement(l.Group,{x:D.a.x,y:D.a.y,rotation:D.rotation,offsetY:-de},a.default.createElement(v.Html,{divProps:{style:{pointerEvents:"none"}}},a.default.createElement(P,{dangerouslySetInnerHTML:{__html:oe},style:{pointerEvents:"none",display:"inline-block"}}))),le&&a.default.createElement(l.Group,{x:D.a.x,y:D.a.y,rotation:D.rotation,offsetY:-de},a.default.createElement(v.Html,null,a.default.createElement(k,{html:oe,element:D,onChange:Te=>{const ze=(0,E.getLimitedFontSize)({oldText:(0,O.removeTags)(D.text),newText:(0,O.removeTags)(Te),element:D});D.set({text:Te,fontSize:ze})},onBlur:Te=>{D.toggleEditMode(!1)}}))),(Q||U)&&a.default.createElement(p.Highlighter,{element:D}))})})(rS);var cS={},b2={},Zs={};(function(e){function t(u){return u/180*Math.PI}function r(u,f,g,S,_){const h=Math.sqrt(g*g+S*S);return _+=Math.atan2(S,g),{x:u+h*Math.cos(_),y:f+h*Math.sin(_)}}function n(u){const{x:f,y:g,width:S,height:_}=u,h=t(u.rotation),w=r(f,g,0,0,h),m=r(f,g,S,0,h),y=r(f,g,S,_,h),p=r(f,g,0,_,h),v=Math.min(w.x,m.x,y.x,p.x),d=Math.min(w.y,m.y,y.y,p.y),b=Math.max(w.x,m.x,y.x,p.x),O=Math.max(w.y,m.y,y.y,p.y);return{x:v,y:d,width:b-v,height:O-d,minX:v,minY:d,maxX:b,maxY:O}}function i(u){const f=u.map(w=>n(w)),g=Math.min(...f.map(w=>w.minX)),S=Math.min(...f.map(w=>w.minY)),_=Math.max(...f.map(w=>w.maxX)),h=Math.max(...f.map(w=>w.maxY));return{x:g,y:S,width:_-g,height:h-S,minX:g,minY:S,maxX:_,maxY:h}}function a(u){const f=t(u.rotation||0);return{x:u.x+u.width/2*Math.cos(f)+u.height/2*Math.sin(-f),y:u.y+u.height/2*Math.cos(f)+u.width/2*Math.sin(f)}}function o(u,f,g){const S=t(f),_=g.x+(u.x-g.x)*Math.cos(S)-(u.y-g.y)*Math.sin(S),h=g.y+(u.x-g.x)*Math.sin(S)+(u.y-g.y)*Math.cos(S);return Object.assign(Object.assign({},u),{rotation:u.rotation+f,x:_,y:h})}function l(u,f){return o(u,f,a(u))}Object.defineProperty(e,"__esModule",{value:!0}),e.rotateAroundCenter=e.rotateAroundPoint=e.getCenter=e.getTotalClientRect=e.getClientRect=e.degToRad=void 0,e.degToRad=t,e.getClientRect=n,e.getTotalClientRect=i,e.getCenter=a,e.rotateAroundPoint=o,e.rotateAroundCenter=l})(Zs);(function(e){var t=ye&&ye.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.useAnchorSnap=e.useSnap=void 0;const r=t(et),n=t(_i),i=Zs;var a=5;function o(S){const _=S.__getNodeRect(),h=(0,i.getClientRect)(Object.assign(Object.assign({},_),{rotation:n.default.Util.radToDeg(_.rotation)})),w=S.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(S,_){var h=[],w=[];S.vertical.forEach(b=>{_.vertical.forEach(O=>{var R=Math.abs(b-O.guide);R<a&&h.push({lineGuide:b,diff:R,snap:O.snap,offset:O.offset})})}),S.horizontal.forEach(b=>{_.horizontal.forEach(O=>{var R=Math.abs(b-O.guide);R<a&&w.push({lineGuide:b,diff:R,snap:O.snap,offset:O.offset})})});var m=[];const y=h.sort((b,O)=>b.diff-O.diff),p=w.sort((b,O)=>b.diff-O.diff);var v=y[0],d=p[0];return v&&y.filter(b=>Math.abs(b.diff-v.diff)<.1).forEach(b=>{m.push(Object.assign({orientation:"V"},b))}),d&&p.filter(b=>Math.abs(b.diff-d.diff)<.1).forEach(b=>{m.push(Object.assign({orientation:"H"},b))}),m}function u(S,_){const h=r.default.useRef(),w=O=>O.hasName("element")||O.hasName("page-background")||!h.current&&O.hasName("elements-area");function m(O){var R;const T=(R=S.current)===null||R===void 0?void 0:R.getStage();var E=[],P=[];return T.find(w).forEach(x=>{if(!(O.indexOf(x)>=0)){var k=x.getClientRect({skipShadow:!0,skipStroke:!0});E.push(k.x,k.x+k.width,k.x+k.width/2),P.push(k.y,k.y+k.height,k.y+k.height/2)}}),{vertical:E,horizontal:P}}function y(O){var R;const T=(R=S.current)===null||R===void 0?void 0:R.getLayer(),E=T==null?void 0:T.children.find(P=>P.name()==="line-guides");O.forEach(P=>{if(P.orientation==="H"){var x=new n.default.Line({points:[-6e3,P.lineGuide,6e3,P.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});E==null||E.add(x),T.batchDraw()}else P.orientation==="V"&&(x=new n.default.Line({points:[P.lineGuide,-6e3,P.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),E==null||E.add(x))})}const p=O=>{O.target.getLayer().children.find(k=>k.name()==="line-guides").destroyChildren();var R=l(m(O.target.nodes()),o(O.target));if(!R.length)return;y(R);const T=O.target.getAbsolutePosition(),E=Object.assign({},T);R.forEach(k=>{switch(k.snap){case"start":case"center":case"end":switch(k.orientation){case"V":E.x=k.lineGuide+k.offset;break;case"H":E.y=k.lineGuide+k.offset}}});const P=E.x-T.x,x=E.y-T.y;O.evt.ctrlKey||O.evt.metaKey||O.target.nodes().forEach(k=>{const M=k.getAbsolutePosition();k.setAbsolutePosition({x:M.x+P,y:M.y+x})})},v=(O,R,T)=>{const E=S.current,P=E.getLayer();if(P.children.find($=>$.name()==="line-guides").destroyChildren(),E.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(R.x-O.x,2)+Math.pow(R.y-O.y,2))>50||!P)return R;var x=l(m(E.nodes()),{vertical:[{guide:R.x,offset:0,snap:"start"}],horizontal:[{guide:R.y,offset:0,snap:"start"}]});if(!x.length||(y(x),T.ctrlKey||T.metaKey))return R;let k=R.x,M=R.x;x.forEach($=>{switch($.orientation){case"V":k=$.lineGuide;break;case"H":M=$.lineGuide}});const j=Math.abs(R.x-k)<10,B=Math.abs(R.y-M)<10;return j&&!B?{x:k,y:O.y}:B&&!j?{x:O.x,y:M}:j&&B?{x:k,y:M}:R},d=O=>{if(h.current=!1,!O.target)return;const R=O.target.getLayer();R.children.find(T=>T.name()==="line-guides").destroyChildren(),R.batchDraw()},b=()=>{const O=S.current.nodes().map(T=>T.id()),R=_.getElementById(O[0]);h.current=(R==null?void 0:R.type)==="image"};r.default.useEffect(()=>{S.current&&(S.current.anchorDragBoundFunc(v),S.current.on("dragstart",()=>{setTimeout(()=>{const O=[...n.default.DD._dragElements.entries()];O.reverse(),n.default.DD._dragElements.clear(),O.forEach(([R,T])=>{n.default.DD._dragElements.set(R,T)})}),b()}),S.current.on("dragmove",p),S.current.on("dragend",d),S.current.on("transformstart",()=>{b()}),S.current.on("transformend",d),S.current.on("transform",O=>{var R,T;O.evt.ctrlKey||O.evt.metaKey?(R=S.current)===null||R===void 0||R.rotationSnapTolerance(0):(T=S.current)===null||T===void 0||T.rotationSnapTolerance(5)}))},[])}function f(S){return{vertical:[{guide:S.absolutePosition().x,offset:0,snap:"center"}],horizontal:[{guide:S.absolutePosition().y,offset:0,snap:"center"}]}}function g(S,_,h){const w=p=>p.hasName("element")||p.hasName("line-anchor")||p.hasName("page-background")||p.hasName("elements-area"),m=p=>{p.target.getLayer().children.find(T=>T.name()==="line-guides").destroyChildren();var v=l(function(T){var E;const P=(E=S.current)===null||E===void 0?void 0:E.getStage();var x=[],k=[];return P.find(w).forEach(M=>{if(!(T.indexOf(M)>=0)){var j=M.getClientRect({skipShadow:!0,skipStroke:!0});M.hasName("line-anchor")&&(j={x:M.absolutePosition().x,y:M.absolutePosition().y,width:0,height:0}),x.push(j.x,j.x+j.width,j.x+j.width/2),k.push(j.y,j.y+j.height,j.y+j.height/2)}}),{vertical:x,horizontal:k}}([p.target,..._.map(T=>T.current)]),f(p.target));if(!v.length)return;(function(T){var E;const P=(E=S.current)===null||E===void 0?void 0:E.getLayer(),x=P==null?void 0:P.children.find(k=>k.name()==="line-guides");T.forEach(k=>{if(k.orientation==="H"){var M=new n.default.Line({points:[-6e3,k.lineGuide,6e3,k.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});x==null||x.add(M),P.batchDraw()}else k.orientation==="V"&&(M=new n.default.Line({points:[k.lineGuide,-6e3,k.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),x==null||x.add(M))})})(v);const d=p.target.getAbsolutePosition(),b=Object.assign({},d);v.forEach(T=>{switch(T.snap){case"start":case"center":case"end":switch(T.orientation){case"V":b.x=T.lineGuide+T.offset;break;case"H":b.y=T.lineGuide+T.offset}}});const O=b.x-d.x,R=b.y-d.y;if(!(p.evt.ctrlKey||p.evt.metaKey)){const T=p.target.getAbsolutePosition();p.target.absolutePosition({x:T.x+O,y:T.y+R})}},y=p=>{if(!p.target)return;const v=p.target.getLayer();v.children.find(d=>d.name()==="line-guides").destroyChildren(),v.batchDraw()};r.default.useEffect(()=>{S.current&&(S.current.on("dragmove",m),S.current.on("dragend",y))},h)}e.useSnap=u,e.useAnchorSnap=g})(b2);(function(e){var t=ye&&ye.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=e.getLinePositionFromMiddlePoints=e.getMiddlePoints=void 0;const r=t(et),n=yi,i=Pa,a=Gc,o=$c,l=Ol,u=b2,f=Oo;function g(w){const{x:m,y,width:p,height:v,rotation:d}=w.a,b=d*Math.PI/180,O={x:m+v/2*Math.cos(b+Math.PI/2),y:y+v/2*Math.sin(b+Math.PI/2)};return{middleLeft:O,middleRight:{x:O.x+p*Math.cos(b),y:O.y+p*Math.sin(b)}}}function S(w,m,y){const p=Math.sqrt(Math.pow(m.x-w.x,2)+Math.pow(m.y-w.y,2)),v=Math.atan2(m.y-w.y,m.x-w.x),d=180*v/Math.PI;return{x:w.x+Math.cos(v-Math.PI/2)*y/2,y:w.y+Math.sin(v-Math.PI/2)*y/2,width:p,height:y,rotation:d}}e.getMiddlePoints=g,e.getLinePositionFromMiddlePoints=S;const _=(w,m)=>({offsetX:5/w,offsetY:5/w,width:10/w,height:10/w,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:y=>{y.target.getStage().container().style.cursor="crosshair"},onMouseLeave:y=>{y.target.getStage().container().style.cursor=""},onDragStart:y=>{m.history.startTransaction()},onDragEnd:y=>{m.history.endTransaction()}}),h=(0,n.observer)(({element:w,type:m})=>{const y=(0,a.useColor)(w,w.a.color,"fill"),p=(0,a.useColor)(w,w.a.color,"stroke"),v=Object.assign(Object.assign(Object.assign({strokeWidth:w.height,lineCap:"round",lineJoin:"round"},p),y),{opacity:w.a.opacity,hideInExport:!w.showInExport});return r.default.createElement(r.default.Fragment,null,m==="arrow"&&r.default.createElement(i.Line,Object.assign({points:[3*w.height,2*-w.height,0,0,3*w.height,2*w.height]},v)),m==="triangle"&&r.default.createElement(i.Line,Object.assign({points:[3*w.height,2*-w.height,0,0,3*w.height,2*w.height],closed:!0},v)),m==="bar"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-w.height,0,2*w.height],closed:!0},v)),m==="square"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-w.height,4*w.height,2*-w.height,4*w.height,2*w.height,0,2*w.height],closed:!0},v)),m==="circle"&&r.default.createElement(i.Circle,Object.assign({x:2*w.height,y:0,radius:2*w.height},v)))});e.LineElement=(0,n.observer)(({element:w,store:m})=>{const y=r.default.useRef(null),p=r.default.useRef(null),v=r.default.useRef(null),d=w.selectable||m.role==="admin",b=(0,f.isTouchDevice)(),[O,R]=r.default.useState(!1),T=m.selectedElements.indexOf(w)>=0&&m.selectedElements.length===1,{middleLeft:E,middleRight:P}=g(w);(0,u.useAnchorSnap)(p,[y],[T]),(0,u.useAnchorSnap)(v,[y],[T]);const x=(0,a.useColor)(w,w.a.color,"stroke");return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Line,Object.assign({ref:y,name:"element",id:w.id,x:w.a.x,y:w.a.y,points:[0,0,w.a.width,0],offsetY:-w.a.height/2,strokeWidth:w.a.height,hitStrokeWidth:Math.max(w.a.height,20),dash:w.dash.map(k=>k*w.a.height)},x,{rotation:w.a.rotation,opacity:w.animated("opacity"),shadowEnabled:w.shadowEnabled,shadowBlur:w.shadowBlur,shadowOffsetX:w.shadowOffsetX,shadowOffsetY:w.shadowOffsetY,shadowColor:w.shadowColor,shadowOpacity:w.shadowOpacity,listening:d,draggable:b?w.draggable&&T:w.draggable,preventDefault:!b||T,hideInExport:!w.showInExport,onMouseEnter:()=>{R(!0)},onMouseLeave:()=>{R(!1)},onDragMove:k=>{w.set({x:k.target.x(),y:k.target.y()})},onDragEnd:k=>{w.set({x:k.target.x(),y:k.target.y()})},onTransform:k=>{const M=k.target.scaleX();k.target.scaleX(1),k.target.scaleY(1),w.set({height:w.height*M,width:w.width*M,x:k.target.x(),y:k.target.y(),rotation:k.target.rotation()})}})),r.default.createElement(i.Group,{x:E.x,y:E.y,rotation:w.rotation,hideInExport:!w.showInExport},r.default.createElement(h,{element:w,type:w.startHead})),r.default.createElement(i.Group,{x:P.x,y:P.y,rotation:w.rotation+180},r.default.createElement(h,{element:w,type:w.endHead})),O&&!T&&r.default.createElement(l.Highlighter,{element:w}),T&&w.resizable&&r.default.createElement(o.Portal,{selector:".page-abs-container",enabled:!0},r.default.createElement(i.Group,{visible:T},r.default.createElement(i.Rect,Object.assign({x:E.x,y:E.y,ref:p,name:"line-anchor"},_(m.scale,m),{onDragMove:k=>{const M=S(k.target.position(),P,w.height);w.set({x:M.x,y:M.y,width:M.width,rotation:M.rotation})}})),r.default.createElement(i.Rect,Object.assign({x:P.x,y:P.y,ref:v,name:"line-anchor"},_(m.scale,m),{onDragMove:k=>{const M=S(E,k.target.position(),w.height);w.set({x:M.x,y:M.y,width:M.width,rotation:M.rotation})}})))))})})(cS);var fS={};(function(e){var t=ye&&ye.__createBinding||(Object.create?function(A,L,z,I){I===void 0&&(I=z);var H=Object.getOwnPropertyDescriptor(L,z);H&&!("get"in H?!L.__esModule:H.writable||H.configurable)||(H={enumerable:!0,get:function(){return L[z]}}),Object.defineProperty(A,I,H)}:function(A,L,z,I){I===void 0&&(I=z),A[I]=L[z]}),r=ye&&ye.__setModuleDefault||(Object.create?function(A,L){Object.defineProperty(A,"default",{enumerable:!0,value:L})}:function(A,L){A.default=L}),n=ye&&ye.__importStar||function(A){if(A&&A.__esModule)return A;var L={};if(A!=null)for(var z in A)z!=="default"&&Object.prototype.hasOwnProperty.call(A,z)&&t(L,A,z);return r(L,A),L},i=ye&&ye.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(et),o=yi,l=Wi,u=Pa,f=i(Gp),g=i(_i),S=$c,_=Ol,h=Hi,w=n(Ys),m=Kn,y=Vc,p=El,v=Oo;function d(){return document.createElement("canvas")}async function b(A){if(!(A.indexOf("data:image/svg+xml")>=0||A.indexOf(".svg")>=0))return A;const L=await w.urlToString(A),z=w.fixSize(L);return w.svgToURL(z)}const O=A=>{const[L,z]=a.default.useState(A);return a.default.useEffect(()=>{(async()=>{const I=await b(A);I!==L&&z(I)})()},[A]),L},R=new window.Image;R.src=w.svgToURL(`
|
|
213
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
214
|
+
<path opacity="0.6" d="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"/>
|
|
215
|
+
<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"/>
|
|
216
|
+
</svg>
|
|
217
|
+
`);const T=new window.Image;T.src=w.svgToURL(`
|
|
218
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
219
|
+
<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"/>
|
|
220
|
+
<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"/>
|
|
221
|
+
<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"/>
|
|
222
|
+
<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"/>
|
|
223
|
+
</svg>
|
|
224
|
+
`);function E(A,L,z,I,H,W,V){for(var U=new ImageData(L,z),Y=new Int32Array(A.data.buffer),X=A.width,Q=new Int32Array(U.data.buffer),te=U.width,ee=L/W,ne=z/V,ie=Math.round(1/ee),le=Math.round(1/ne),xe=ie*le,Fe=0;Fe<U.height;Fe++)for(var oe=0;oe<te;oe++){for(var ue=I+Math.round(oe/ee)+(H+Math.round(Fe/ne))*X,ve=0,Ee=0,re=0,de=0,me=0;me<le;me++)for(var Se=0;Se<ie;Se++){var Te=Y[ue+Se+me*X];ve+=Te<<24>>>24,Ee+=Te<<16>>>24,re+=Te<<8>>>24,de+=Te>>>24}ve=Math.round(ve/xe),Ee=Math.round(Ee/xe),re=Math.round(re/xe),de=Math.round(de/xe),Q[oe+Fe*te]=de<<24|re<<16|Ee<<8|ve}return U}function P(A,L){var z,I;const H=d();H.width=A.width,H.height=A.height,(z=H.getContext("2d"))===null||z===void 0||z.drawImage(A,0,0,H.width,H.height);const W=E(H.getContext("2d").getImageData(0,0,H.width,H.height),Math.floor(H.width*L),Math.floor(H.height*L),0,0,H.width,H.height);return H.width=Math.floor(H.width*L),H.height=Math.floor(H.height*L),(I=H.getContext("2d"))===null||I===void 0||I.putImageData(W,0,0),H}const x=(A,L,z,I,H=0,W=!1)=>{const V=Math.floor(Math.max(A.width*I,1)),U=Math.floor(Math.max(A.height*I,1)),Y=Math.min(H*I,V/2,U/2),X=Math.max(A.width/z.width,A.height/z.height)*I,Q=A.page._exportingOrRendering&&m.flags.imageDownScalingEnabled&&X<1&&!W,te=z.x===0&&z.y===0&&z.width===(L==null?void 0:L.width)&&z.height===(L==null?void 0:L.height),ee=a.default.useMemo(()=>{if(!(!L||!L.width||!L.height))return te&&Y===0&&!Q?void 0:d()},[L,Y,Q,te]);return a.default.useLayoutEffect(()=>{if(!ee||!L)return;ee.width=V,ee.height=U;const ne=ee.getContext("2d");if(!ne)return;Y&&(ne.beginPath(),ne.moveTo(Y,0),ne.lineTo(V-Y,0),ne.arc(V-Y,Y,Y,3*Math.PI/2,0,!1),ne.lineTo(V,U-Y),ne.arc(V-Y,U-Y,Y,0,Math.PI/2,!1),ne.lineTo(Y,U),ne.arc(Y,U-Y,Y,Math.PI/2,Math.PI,!1),ne.lineTo(0,Y),ne.arc(Y,Y,Y,Math.PI,3*Math.PI/2,!1),ne.clip());const ie=Q?P(L,X):L,le=Q?{x:Math.floor(z.x*X),y:Math.floor(z.y*X),width:Math.floor(z.width*X),height:Math.floor(z.height*X)}:z;ne.drawImage(ie,le.x,le.y,le.width,le.height,0,0,ee.width,ee.height)},[ee,A.width,A.height,z.x,z.y,z.width,z.height,H,I,W,A.page._exportingOrRendering,Q]),a.default.useEffect(()=>()=>{ee&&ee.nodeName==="CANVAS"&&g.default.Util.releaseCanvas(ee)},[ee]),ee||L},k=(A,L,z,I)=>{const H=O(A.clipSrc||""),[W,V]=$(H,"anonymous"),U=A.clipSrc?V:"loaded";(0,e.useImageLoader)(U,A.id+"-clip");const Y=a.default.useMemo(()=>{if(L&&W)return d()},[L,W]);return a.default.useLayoutEffect(()=>{var X;if(!W||!L||!L.width||!L.height||!W||!W.width||!W.height||!Y)return;const Q=d(),te=Math.max(A.width/W.width*z,A.height/W.height*z);Q.width=W.width*te,Q.height=W.height*te,(X=Q.getContext("2d"))===null||X===void 0||X.drawImage(W,0,0,Q.width,Q.height),Y.width=Math.max(L.width,1),Y.height=Math.max(L.height,1);const ee=Y.getContext("2d");ee&&(ee.save(),ee.drawImage(Q,0,0,L.width,L.height),g.default.Util.releaseCanvas(Q),ee.globalCompositeOperation="source-in",ee.drawImage(L,0,0,Y.width,Y.height),ee.restore())},[Y,L,W,A.width,A.height,z,...I]),A.clipSrc&&W?Y:L},M=d(),j=(0,o.observer)(({element:A})=>{const L=Math.min(30,A.width/4,A.height/4),z=a.default.useRef(null);return a.default.useEffect(()=>{const I=z.current;if(!I)return;const H=new g.default.Animation(W=>{I.rotate(((W==null?void 0:W.timeDiff)||0)/2)},I.getLayer());return H.start(),()=>{H.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.width,height:A.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:z,x:A.width/2,y:A.height/2,fill:"white",outerRadius:Math.abs(L),innerRadius:Math.max(1,L-5),angle:270}))}),B=(0,o.observer)(({element:A})=>{const L="Can not load the video...",z=Math.max(10,Math.min(30,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.width,height:A.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:L,fontSize:z,width:A.width,height:A.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let $=f.default;const Z=A=>{$=A};e.setImageLoaderHook=Z;const K=(A,L)=>{const z=a.default.useRef(),I=()=>{var H;(H=z.current)===null||H===void 0||H.call(z),z.current=void 0};a.default.useEffect(()=>I,[]),a.default.useLayoutEffect(()=>{A!=="loading"||z.current||(z.current=(0,h.incrementLoader)(`video ${L}`)),A!=="loading"&&I(),A==="failed"&&(0,h.triggerLoadError)(`video ${L}`)},[A])};e.useImageLoader=K;function D(A,L){for(var z=A.buffered,I=0;I<z.length;I++)if(L>=z.start(I)&&L<=z.end(I))return!0;return!1}function q(A,L,z){const I=a.default.useRef("loading"),H=a.default.useRef(),[W,V]=a.default.useState(0),U=a.default.useRef(),Y=a.default.useRef(),X=a.default.useRef();return U.current===A&&Y.current===L&&X.current===z||(I.current="loading",H.current=void 0,U.current=A,Y.current=L,X.current=z),a.default.useLayoutEffect(function(){if(A){var Q=document.createElement("video");return Q.addEventListener("canplay",te),Q.addEventListener("error",ee),Q.crossOrigin=L,Q.src=A,function(){Q.removeEventListener("canplay",te),Q.removeEventListener("error",ee)}}function te(){I.current="loaded",H.current=Q,H.current.currentTime=0,V(Math.random()),H.current.removeEventListener("canplay",te)}function ee(ne){I.current="failed",H.current=void 0,V(Math.random())}},[A,L,z]),[H.current,I.current]}e.VideoElement=(0,o.observer)(({element:A,store:L})=>{var z;const[I,H]=a.default.useState(!1),W=a.default.useRef(null),V=a.default.useRef(null),[U,Y]=a.default.useState(!1),X=L.selectedElements.indexOf(A)>=0,[Q,te]=a.default.useState(!1),[ee,ne]=q(A.src,"anonymous"),ie=L.activePage===A.page;(0,e.useImageLoader)(ne,A.id+"-video"),ee&&(ee.width=ee.videoWidth,ee.height=ee.videoHeight);const le=ee||M;a.default.useEffect(()=>{ee&&L.history.ignore(()=>{A.set({duration:1e3*ee.duration})})},[ee]),a.default.useEffect(()=>{var Oe;if(!ee)return;const Be=ie&&(L.isPlaying||Q);if(!Be)return void ee.pause();Be&&(ee.currentTime=A.startTime*ee.duration,ee.play());const tt=new g.default.Animation(()=>{},(Oe=W.current)===null||Oe===void 0?void 0:Oe.getLayer());tt.start();const yt=()=>{te(!1),ee.currentTime=A.startTime*ee.duration},Ct=()=>{ee.currentTime>=A.endTime*ee.duration&&(ee.pause(),ee.currentTime=A.startTime*ee.duration,te(!1))};return ee.addEventListener("ended",yt),ee.addEventListener("timeupdate",Ct),()=>{tt.stop(),ee.removeEventListener("ended",yt),ee.removeEventListener("timeupdate",Ct)}},[ee,Q,L.isPlaying,ie]);const xe=a.default.useRef();a.default.useEffect(()=>{const Oe=(0,l.autorun)(()=>{var Be,tt;if(ee){const yt=(L.currentTime-A.page.startTime)%A.duration;(Math.abs(1e3*ee.currentTime-yt)>500||!L.isPlaying)&&(ee.currentTime=yt/1e3,L.isPlaying||ee.currentTime===0||(xe.current=(0,h.incrementLoader)(`video ${A.id}`))),(tt=(Be=W.current)===null||Be===void 0?void 0:Be.getLayer())===null||tt===void 0||tt.batchDraw()}});return()=>{Oe(),xe.current&&(xe.current(),xe.current=null)}},[L,ee]),a.default.useEffect(()=>{if(!ee)return;let Oe=null;const Be=()=>{var yt,Ct;xe.current&&((Ct=(yt=W.current)===null||yt===void 0?void 0:yt.getLayer())===null||Ct===void 0||Ct.batchDraw(),xe.current(),xe.current=null),D(ee,ee.currentTime)||(Oe&&(console.error("finish already exists"),Oe()),Oe=(0,h.incrementLoader)(`video ${A.id}`))},tt=()=>{Oe&&(Oe(),Oe=null)};return ee.addEventListener("timeupdate",Be),ee.addEventListener("canplay",tt),()=>{ee.removeEventListener("timeupdate",Be),ee.removeEventListener("canplay",tt)}},[ee,A.id,h.incrementLoader]);let{cropX:Fe,cropY:oe,cropWidth:ue,cropHeight:ve}=A;ne!=="loaded"&&(Fe=oe=0,ue=ve=1);const Ee=le.width*ue,re=le.height*ve,de=A.width/A.height;let me,Se;const Te=Ee/re,ze=A.type==="svg";ze?(me=Ee,Se=re):de>=Te?(me=Ee,Se=Ee/de):(me=re*de,Se=re);const Re={x:le.width*Fe,y:le.height*oe,width:me,height:Se},Ne=(z=A.cornerRadius)!==null&&z!==void 0?z:0;let $e=k(A,x(A,le,Re,L._elementsPixelRatio,Ne,I||A._cropModeEnabled||A.type==="svg"),L._elementsPixelRatio,[Re,Ne,L._elementsPixelRatio]);const Ge=Math.max(A.width/me,A.height/Se);a.default.useEffect(()=>{var Oe;if(!A._cropModeEnabled)return;const Be=(Oe=W.current)===null||Oe===void 0?void 0:Oe.getStage();function tt(Ct){A._cropModeEnabled&&Ct.target!==V.current&&A.toggleCropMode(!1)}function yt(Ct){A._cropModeEnabled&&Ct.target.parentNode!==Be.content&&A.toggleCropMode(!1)}return document.body.addEventListener("click",yt),Be==null||Be.on("click",tt),Be==null||Be.on("tap",tt),()=>{document.body.removeEventListener("click",yt),document.body.removeEventListener("touchstart",yt),Be==null||Be.off("click",tt),Be==null||Be.off("click",tt)}},[A._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(I||A._cropModeEnabled))return(0,y.applyFilter)(W.current,A),(0,l.autorun)(()=>{(0,y.applyFilter)(W.current,A)},{delay:100})},[le,I,ue,ve,A._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Oe;I||A._cropModeEnabled?(Oe=W.current)===null||Oe===void 0||Oe.clearCache():(0,y.applyFilter)(W.current,A)},[I,A.width,A.height,A._cropModeEnabled]),a.default.useEffect(()=>{(0,y.applyFilter)(W.current,A)},[A.shadowEnabled,A.shadowBlur,A.cornerRadius,A.shadowColor,A.shadowOffsetX,A.shadowOffsetY,A.shadowOpacity]);const ut=a.default.useRef(null),ce=a.default.useRef(null),fe=a.default.useRef(null);a.default.useLayoutEffect(()=>{A._cropModeEnabled&&(ce.current.nodes([ut.current]),fe.current.nodes([V.current]))},[A._cropModeEnabled]);const Ze=Oe=>{Math.round(Oe.target.x())>0&&(Oe.target.x(0),Oe.target.scaleX(1)),Math.round(Oe.target.y())>0&&(Oe.target.y(0),Oe.target.scaleY(1));const Be=Oe.target.width()*Oe.target.scaleX(),tt=Oe.target.height()*Oe.target.scaleY(),yt=Math.min(1,me/Be),Ct=Math.min(1,Se/tt),gr=1-yt,Nr=Math.min(gr,Math.max(0,Math.round(-Oe.target.x())/Be)),Ir=1-Ct,bn=Math.min(Ir,Math.max(0,Math.round(-Oe.target.y())/tt));Oe.target.setAttrs({x:-Nr*le.width,y:-bn*le.height,scaleX:1,scaleY:1}),A.set({cropX:Nr,cropY:bn,cropWidth:yt,cropHeight:Ct})},be=()=>{A.type!=="svg"&&A.contentEditable&&setTimeout(()=>{A.toggleCropMode(!0)})},Me=ne==="loading",Ae=ne==="failed",_e=!Me&&!Ae,Qe=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),we=_e?A.a.opacity:0;(0,p.useFadeIn)(W,we);const Ye=A.selectable||L.role==="admin",Pr=(0,v.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,Me&&a.default.createElement(j,{element:A}),Ae&&a.default.createElement(B,{element:A}),a.default.createElement(u.Image,{ref:W,name:"element",id:A.id,image:le,x:A.x,y:A.y,width:A.width||1,height:A.height||1,rotation:A.rotation,opacity:we,shadowEnabled:A.shadowEnabled,shadowBlur:A.shadowBlur,shadowOffsetX:A.shadowOffsetX,shadowOffsetY:A.shadowOffsetY,shadowColor:A.shadowColor,shadowOpacity:A.shadowOpacity,customCrop:Re,listening:Ye,cropX:Re.x,cropY:Re.y,cropWidth:Re.width,cropHeight:Re.height,draggable:Pr?A.draggable&&X:A.draggable,preventDefault:!Pr||X,hideInExport:!A.showInExport,onMouseEnter:()=>{Y(!0)},onMouseLeave:()=>{Y(!1)},onDragMove:Oe=>{A.set({x:Oe.target.x(),y:Oe.target.y()})},onDragEnd:Oe=>{A.set({x:Oe.target.x(),y:Oe.target.y()})},onDblClick:be,onDblTap:be,onTransformStart:()=>{H(!0),Qe.current={cropX:A.cropX,cropY:A.cropY,cropWidth:A.cropWidth,cropHeight:A.cropHeight}},onTransform:Oe=>{var Be;const tt=Oe.currentTarget,yt=Math.abs(tt.scaleX()-1)<1e-7?1:tt.scaleX(),Ct=Math.abs(tt.scaleY()-1)<1e-7?1:tt.scaleY();tt.scaleX(1),tt.scaleY(1);const gr=(Be=Oe.target.getStage())===null||Be===void 0?void 0:Be.findOne("Transformer"),Nr=1-me/le.width,Ir=Math.min(Nr,Math.max(0,A.cropX)),bn=1-Se/le.height,Le=Math.min(bn,Math.max(0,A.cropY)),Je=gr.getActiveAnchor(),dt=!(Je.indexOf("middle")>=0||Je.indexOf("center")>=0),Mt=!dt&&yt<1&&Qe.current.cropHeight>Se/le.height;let mt=dt?A.cropWidth:A.cropWidth*yt;Mt&&(mt=A.cropWidth);const vr=!dt&&Ct<1&&Qe.current.cropWidth>me/le.width;let mr=dt?A.cropHeight:A.cropHeight*Ct;vr&&(mr=A.cropHeight),ze&&(mt=A.cropWidth,mr=A.cropHeight),A.set({cropX:Ir,cropY:Le,x:tt.x(),y:tt.y(),width:tt.width()*yt,height:tt.height()*Ct,rotation:Oe.target.rotation(),cropWidth:Math.min(mt,1-Ir),cropHeight:Math.min(mr,1-Le)})},onTransformEnd:Oe=>{const Be=Oe.currentTarget;A.set({width:Be.width(),height:Be.height(),x:Be.x(),y:Be.y(),rotation:Oe.target.rotation(),cropWidth:me/le.width,cropHeight:Se/le.height}),H(!1)}}),a.default.createElement(u.Rect,{x:A.x,y:A.y,width:Math.max(A.width-A.borderSize,0),height:Math.max(A.height-A.borderSize,0),opacity:we,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,Ne-A.borderSize),hideInExport:!A.showInExport}),!Q&&!L.isPlaying&&a.default.createElement(u.Image,{image:R,x:A.x+A.width/2-15/L.scale,y:A.y+A.height/2-15/L.scale,width:30/L.scale,height:30/L.scale,hideInExport:!0,onClick:()=>{te(!0)}}),Q&&!L.isPlaying&&a.default.createElement(u.Image,{image:T,x:A.x+A.width/2-15/L.scale,y:A.y+A.height/2-15/L.scale,width:30/L.scale,height:30/L.scale,hideInExport:!0,onClick:()=>{te(!1)}}),A._cropModeEnabled&&a.default.createElement(S.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/L.scale,y:-window.innerWidth/L.scale,width:window.innerWidth/L.scale*3,height:window.innerWidth/L.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:$e,x:A.x,y:A.y,width:A.width,height: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:Ge,scaleY:Ge},a.default.createElement(u.Image,{image:le,ref:V,opacity:.4,draggable:!0,x:-A.cropX*le.width,y:-A.cropY*le.height,onDragMove:Ze,onTransform:Ze}),a.default.createElement(u.Transformer,{ref:fe,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Oe,Be)=>Be.width<5||Be.height<5?Oe:Be,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:me,height:Se,ref:ut,listening:!1,onTransform:Oe=>{Oe.target.x()<-A.cropX*le.width-1e-9&&(Oe.target.x(-A.cropX*le.width),Oe.target.scaleX(1)),Oe.target.y()<-A.cropY*le.height-1e-9&&(Oe.target.y(-A.cropY*le.height),Oe.target.scaleY(1));const Be=Math.min(1,Math.max(0,A.cropX+Oe.target.x()/le.width)),tt=Math.min(1,Math.max(0,Oe.target.y()/le.height+A.cropY)),yt=Oe.target.width()*Oe.target.scaleX(),Ct=Oe.target.height()*Oe.target.scaleY(),gr=Math.min(1-Be,yt/le.width),Nr=Math.min(1-tt,Ct/le.height),Ir=Oe.target.getAbsolutePosition(Oe.target.getParent().getParent());Oe.target.scale({x:1,y:1}),Oe.target.position({x:0,y:0}),A.set({x:Ir.x,y:Ir.y,cropX:Be,cropY:tt,cropWidth:gr,cropHeight:Nr,width:Math.min(yt*Ge,le.width*(1-Be)*Ge),height:Math.min(Ct*Ge,le.height*(1-tt)*Ge)})}}),a.default.createElement(u.Transformer,{ref:ce,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Oe,Be)=>Be.width<5||Be.height<5?Oe:Be,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(U||X)&&a.default.createElement(_.Highlighter,{element:A}))})})(fS);var dS={},Yp={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.figureToSvg=e.subTypeToPathDataFunc=e.TYPES=e.crossPath=e.speechBubblePath=e.hexagonPath=e.pentagonPath=e.diamondPath=e.starPath=e.circleData=e.rightTriangleData=e.triangleData=e.rectData=void 0;const t=({width:m,height:y,cornerRadius:p})=>{if(p>0){const v=Math.min(p,m/2,y/2);return`M 0 ${v} A ${v} ${v} 0 0 1 ${v} 0 L ${m-v} 0 A ${v} ${v} 0 0 1 ${m} ${v} L ${m} ${y-v} A ${v} ${v} 0 0 1 ${m-v} ${y} L ${v} ${y} A ${v} ${v} 0 0 1 0 ${y-v} Z`}return`M 0 0 L ${m} 0 L ${m} ${y} L 0 ${y} Z`};e.rectData=t;const r=({width:m,height:y})=>`M ${m/2} 0 L ${m} ${y} L 0 ${y} Z`;e.triangleData=r;const n=({width:m,height:y})=>`M 0 0 L ${m} 0 L 0 ${y} Z`;e.rightTriangleData=n;const i=({width:m,height:y})=>`M ${m/2} ${y/2} m -${m/2}, 0 a ${m/2},${y/2} 0 1,0 ${m},0 a ${m/2},${y/2} 0 1,0 -${m},0`;function a({width:m,height:y}){const p=m/2,v=y/2,d=m/2,b=y/2,O=d/2,R=b/2;let T="",E=Math.PI/5;for(let P=0;P<10;P++){const x=P%2==0?b:R,k=p+(P%2==0?d:O)*Math.sin(P*E),M=v-x*Math.cos(P*E);P===0?T=`M ${k} ${M}`:T+=` L ${k} ${M}`}return T+" Z"}function o({width:m,height:y}){const p=m/2,v=y/2;return`M ${p} 0 L ${m} ${v} L ${p} ${y} L 0 ${v} Z`}function l({width:m,height:y}){const p=m/2,v=y/2,d=m/2,b=y/2;let O="",R=2*Math.PI/5;for(let T=0;T<5;T++){const E=b,P=p+d*Math.sin(T*R),x=v-E*Math.cos(T*R);T===0?O=`M ${P} ${x}`:O+=` L ${P} ${x}`}return O+" Z"}function u({width:m,height:y}){const p=m/2,v=y/2,d=m/2,b=y/2;let O="",R=2*Math.PI/6;for(let T=0;T<6;T++){const E=b,P=p+d*Math.sin(T*R),x=v-E*Math.cos(T*R);T===0?O=`M ${P} ${x}`:O+=` L ${P} ${x}`}return O+" Z"}function f({path:m,aspectRatio:y,width:p,height:v}){return{path:m,scaleX:p/y.width,scaleY:v/y.height}}function g({width:m,height:y}){const p=.1*Math.min(m,y),v=.2*m,d=.2*y,b=.5*m;let O=`M ${p},0`;return O+=" H "+(m-p),O+=` A ${p},${p} 0 0 1 ${m},${p}`,O+=" V "+(y-p-d),O+=` A ${p},${p} 0 0 1 ${m-p},${y-d}`,O+=` H ${b+v/2}`,O+=` L ${b},${y}`,O+=` L ${b-v/2},${y-d}`,O+=` H ${p}`,O+=` A ${p},${p} 0 0 1 0,${y-p-d}`,O+=` V ${p}`,O+=` A ${p},${p} 0 0 1 ${p},0`,O+=" Z",O}function S({width:m,height:y}){const p=.3*m,v=.3*y,d=m/2,b=y/2,O=d-p/2,R=d+p/2,T=b-v/2,E=b+v/2;let P=`M ${O},0 `;return P+=`H ${R} `,P+=`V ${T} `,P+=`H ${m} `,P+=`V ${E} `,P+=`H ${R} `,P+=`V ${y} `,P+=`H ${O} `,P+=`V ${E} `,P+="H 0 ",P+=`V ${T} `,P+=`H ${O} `,P+="V 0 ",P+="Z",P}function _(m){return e.TYPES[m]||e.rectData}function h(m,y){const{width:p,height:v,fill:d,stroke:b,strokeWidth:O,dash:R}=m,T=(R||[]).map(M=>M*O);let E=y(m),P=1,x=1;typeof E!="string"&&(P=E.scaleX,x=E.scaleY,E=E.path);const k=`clip-${m.id||Math.random()}`;return`
|
|
225
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${p}" height="${v}">
|
|
226
|
+
<defs>
|
|
227
|
+
<clipPath id="${k}">
|
|
228
|
+
<path d="${E}" />
|
|
229
|
+
</clipPath>
|
|
230
|
+
</defs>
|
|
231
|
+
|
|
232
|
+
<!-- Path for the fill -->
|
|
233
|
+
<path d="${E}" fill="${d}" transform="scale(${P}, ${x})"/>
|
|
234
|
+
|
|
235
|
+
<!-- Path for the stroke, clipped by the star path -->
|
|
236
|
+
<path d="${E}" fill="none" stroke="${b}" stroke-width="${2*O}" clip-path="url(#${k})" transform="scale(${P}, ${x})" stroke-dasharray="${T.join(" ")}"/>
|
|
237
|
+
</svg>
|
|
238
|
+
`}function w(m){const{subType:y}=m,p=_(y);return p?h(m,p):(console.error(`Polotno error: Can not convert ${m.subType} figure to svg.`),(0,e.rectData)(m))}e.circleData=i,e.starPath=a,e.diamondPath=o,e.pentagonPath=l,e.hexagonPath=u,e.speechBubblePath=g,e.crossPath=S,e.TYPES={rect:e.rectData,circle:e.circleData,star:a,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:o,pentagon:l,hexagon:u,speechBubble:g,cross:S,arc:({width:m,height:y})=>f({path:"M234 117C234 85.97 221.673 56.21 199.731 34.269C177.79 12.327 148.03 0 117 0C85.97 0 56.2103 12.327 34.2685 34.268C12.3268 56.21 0 85.97 0 117H117H234Z",aspectRatio:{width:234,height:117},width:m,height:y}),cloud:({width:m,height:y})=>f({path:"M216.41 57.006C216.961 54.084 217.249 51.069 217.249 47.986C217.249 21.4841 195.972 0 169.725 0C153.666 0 139.467 8.043 130.865 20.3575C122.606 13.3566 111.954 9.1402 100.327 9.1402C74.3322 9.1402 53.2123 30.2136 52.8094 56.364H52.8035C23.6407 56.364 0 80.235 0 109.682C0 139.129 23.6407 163 52.8035 163H208.197C237.359 163 261 139.129 261 109.682C261 83.056 241.672 60.99 216.41 57.006Z",aspectRatio:{width:261,height:163},width:m,height:y}),rightArrow:({width:m,height:y})=>{const p=.6*m;return`M 0 ${y/4} L ${p} ${y/4} L ${p} 0 L ${m} ${y/2} L ${p} ${y} L ${p} ${.75*y} L 0 ${.75*y} Z`},leftArrow:({width:m,height:y})=>{const p=.4*m;return`M ${m} ${y/4} L ${p} ${y/4} L ${p} 0 L 0 ${y/2} L ${p} ${y} L ${p} ${.75*y} L ${m} ${.75*y} Z`},downArrow:({width:m,height:y})=>{const p=.6*y;return`M ${m/4} 0 L ${m/4} ${p} L 0 ${p} L ${m/2} ${y} L ${m} ${p} L ${.75*m} ${p} L ${.75*m} 0 Z`},upArrow:({width:m,height:y})=>{const p=.4*y;return`M ${m/4} ${y} L ${m/4} ${p} L 0 ${p} L ${m/2} 0 L ${m} ${p} L ${.75*m} ${p} L ${.75*m} ${y} Z`},asterisk1:({width:m,height:y})=>f({path:"M45.5265 218.498C51.5466 222.87 58.5359 224.98 65.4742 224.98C75.916 224.98 86.221 220.2 92.853 211.217C92.872 211.198 92.89 211.178 92.907 211.157C92.923 211.136 92.939 211.115 92.954 211.094L92.977 211.061C92.993 211.039 93.008 211.017 93.023 210.996L116.491 178.725L139.959 210.996C139.982 211.031 140.006 211.058 140.029 211.088C140.04 211.102 140.05 211.116 140.061 211.132C151.115 226.188 172.355 229.505 187.473 218.515C202.608 207.526 205.992 186.278 195.074 171.104L195.05 171.066C195.03 171.034 195.014 171.01 194.989 170.985L171.572 138.696L209.512 126.346C227.334 120.545 237.129 101.305 231.33 83.476C225.532 65.648 206.315 55.8493 188.476 61.6334L150.537 73.933L150.52 34.0064C150.502 15.2594 135.248 0 116.508 0C97.768 0 82.514 15.2594 82.497 34.0234L82.463 73.916L44.5233 61.6163C44.5083 61.6163 44.49 61.613 44.4716 61.6078C44.4477 61.6014 44.4232 61.5918 44.4041 61.5823C26.5992 55.8664 7.45076 65.665 1.66886 83.46C-4.11314 101.254 5.61427 120.426 23.3511 126.278C23.3675 126.283 23.3822 126.289 23.3963 126.295L23.4588 126.319L23.4873 126.329L61.4098 138.679L37.9929 170.968C37.9844 170.985 37.9718 171.002 37.9591 171.019C37.9462 171.036 37.9336 171.053 37.9251 171.07C26.9903 186.244 30.3915 207.509 45.5265 218.498Z",aspectRatio:{width:233,height:225},width:m,height:y}),asterisk2:({width:m,height:y})=>f({path:"M46.0556 112L0 85.388L33.9456 26.6121L80.028 53.1781L80.054 0H147.946L147.972 53.1781L194.054 26.6121L228 85.388L181.944 112L228 138.612L194.054 197.388L147.972 170.822L147.946 224H80.054L80.028 170.822L33.9456 197.388L0 138.612L46.0556 112Z",aspectRatio:{width:228,height:224},width:m,height:y}),bookmark:({width:m,height:y})=>f({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:m,height:y}),butterfly:({width:m,height:y})=>f({path:"M94.5 100.713C91.935 150.916 50.703 190.909 0 191.493V0C50.703 0.5845 91.935 40.5767 94.5 90.78C97.031 41.2385 137.217 1.6407 187 0.0438004V191.45C137.217 189.853 97.031 150.255 94.5 100.713Z",aspectRatio:{width:187,height:192},width:m,height:y}),cylinder:({width:m,height:y})=>f({path:"M169 36.8497V218.15C169 238.502 131.168 255 84.5 255C37.832 255 0 238.502 0 218.15V36.8497C0 16.4982 37.832 0 84.5 0C131.168 0 169 16.4982 169 36.8497Z",aspectRatio:{width:169,height:255},width:m,height:y}),diamond2:({width:m,height:y})=>f({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:m,height:y}),door:({width:m,height:y})=>f({path:"M140 69.697C140 31.2044 108.66 0 70 0C31.34 0 0 31.2044 0 69.697V207H140V69.697Z",aspectRatio:{width:140,height:207},width:m,height:y}),drop1:({width:m,height:y})=>f({path:"M167 150.687C167 196.328 129.407 234 83.139 234C37.593 234 0 196.328 0 150.687C0 100.7 51.329 36.9474 83.139 0C114.948 39.1207 167 98.526 167 150.687Z",aspectRatio:{width:167,height:234},width:m,height:y}),drop2:({width:m,height:y})=>f({path:"M73 239C53.64 239 35.071 231.315 21.3812 217.634C7.691 203.954 0 185.4 0 166.054C0 136.091 13.8696 113.633 30.768 86.27C43.912 64.9877 58.888 40.7377 70.597 7.6816C71.281 5.7496 72.989 0 72.989 0C72.989 0 72.993 0.0124998 73 0.0363998C73.007 0.0124998 73.011 0 73.011 0C73.011 0 74.719 5.7496 75.403 7.6816C87.112 40.7377 102.088 64.9877 115.232 86.27C132.13 113.633 146 136.091 146 166.054C146 185.4 138.309 203.954 124.619 217.634C111.025 231.218 92.225 239 73 239Z",aspectRatio:{width:146,height:239},width:m,height:y}),explosion:({width:m,height:y})=>f({path:"M165.802 184.465L118.997 260L125.343 182.079L34.9058 219.45L99.164 159.817L0 163.792L78.538 134.373L0 74.7401L86.471 89.052V0L118.997 89.052L165.802 10.3364L149.143 97.798L217.368 29.419L165.802 112.905L245.927 81.101L165.802 143.914H261L165.802 184.465Z",aspectRatio:{width:261,height:260},width:m,height:y}),flag:({width:m,height:y})=>f({path:"M0 142.161C0 142.161 51.9956 118.626 103 137.469C159.992 158.525 206 141.31 206 141.31V11.1373C206 11.1373 160 28.3218 103.016 7.28273C52 -11.553 0 12.0974 0 12.0974V142.161Z",aspectRatio:{width:206,height:148},width:m,height:y}),flower:({width:m,height:y})=>f({path:"M135.351 66.1893C196.683 -5.00591 256.536 100.304 164.908 117.361C256.536 135.16 195.944 239.728 135.351 168.532C166.386 257.526 45.9394 256.785 76.975 168.532C15.643 239.728 -44.2109 135.16 47.4173 117.361C-44.9498 100.304 15.643 -4.26431 76.975 66.1893C45.2005 -22.0631 166.386 -22.0631 135.351 66.1893ZM105.793 104.012C113.183 104.012 119.833 109.945 119.833 117.361C119.833 124.777 113.183 131.452 105.793 131.452C98.404 131.452 92.492 124.777 92.492 117.361C92.492 109.945 98.404 104.012 105.793 104.012Z",aspectRatio:{width:212,height:235},width:m,height:y}),frame:({width:m,height:y})=>f({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:m,height:y}),heart1:({width:m,height:y})=>f({path:"M215.886 56.157C215.886 24.729 191.112 0 160.584 0C135.933 0 115.08 16.983 107.937 39.93C100.788 16.986 79.935 0.591 55.284 0.591C24.75 0.591 0 24.615 0 56.055C0 71.919 6.321 83.127 16.494 95.121L107.988 189.447L199.377 95.121C209.559 83.127 215.886 72.009 215.886 56.157Z",aspectRatio:{width:216,height:190},width:m,height:y}),home:({width:m,height:y})=>f({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:m,height:y}),home2:({width:m,height:y})=>f({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:m,height:y}),hourglass:({width:m,height:y})=>f({path:"M0.392782 0H187.607C193.014 43.3688 140.804 53.797 140.804 97.5C140.804 141.203 193.014 151.631 187.607 195H0.392782C-5.01452 151.631 47.196 141.203 47.196 97.5C47.196 53.797 -5.01452 43.3688 0.392782 0Z",aspectRatio:{width:188,height:195},width:m,height:y}),house:({width:m,height:y})=>f({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:m,height:y}),keyhole:({width:m,height:y})=>f({path:"M115 57.0494C115 25.5387 89.416 0 57.863 0C26.311 0 0.726898 25.5414 0.726898 57.0494C0.726898 78.652 12.759 97.451 30.505 107.136L0 219H114.845L84.448 107.524C102.608 97.962 115 78.959 115 57.0494Z",aspectRatio:{width:115,height:219},width:m,height:y}),kiss:({width:m,height:y})=>f({path:"M124.5 17.1468C80.036 -36.5162 0 52.9218 0 52.9218C0 52.9218 44.4643 120 124.5 120C204.536 120 249 52.9218 249 52.9218C249 52.9218 168.964 -36.5162 124.5 17.1468Z",aspectRatio:{width:249,height:120},width:m,height:y}),leaf:({width:m,height:y})=>f({path:"M204.414 0.0151567C204.414 0.0151567 206.837 93.9509 150.394 150.394C93.9507 206.837 0.0151569 204.413 0.0151569 204.413C0.0151569 204.413 -2.40835 110.478 54.0347 54.0349C110.478 -2.40834 204.414 0.0151567 204.414 0.0151567Z",aspectRatio:{width:205,height:205},width:m,height:y}),lightning1:({width:m,height:y})=>f({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:m,height:y}),lightning2:({width:m,height:y})=>f({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:m,height:y}),magnet:({width:m,height:y})=>f({path:"M88.402 0H0V67.669H88.402C105.271 67.669 118.957 81.308 118.957 98C118.957 114.689 105.271 128.331 88.402 128.331H0V196H88.402C142.747 196 187 152.072 187 98C187 43.9279 142.747 0 88.402 0Z",aspectRatio:{width:187,height:196},width:m,height:y}),mithosis:({width:m,height:y})=>f({path:"M150.996 136.45C137.141 128.926 117.559 128.7 103.532 135.896C93.843 140.867 82.875 143.67 71.2577 143.67C31.9033 143.67 0 111.508 0 71.835C0 32.161 31.9033 0 71.2577 0C83.467 0 94.959 3.0955 105.004 8.5504C118.859 16.0745 138.441 16.3 152.467 9.1038C162.157 4.1328 173.125 1.3303 184.742 1.3303C224.097 1.3303 256 33.492 256 73.165C256 112.839 224.097 145 184.742 145C172.533 145 161.041 141.905 150.996 136.45Z",aspectRatio:{width:256,height:145},width:m,height:y}),orangeRicky:({width:m,height:y})=>f({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:m,height:y}),party:({width:m,height:y})=>f({path:"M134.622 0L144.682 68.2539L174.415 5.9977L163.91 74.1846L210.671 23.4578L180.535 85.519L240.169 50.8289L193.079 101.25L260.29 85.679L200.43 119.98L269.245 124.911L201.934 140.044L266.237 165.04L197.456 159.661L251.535 202.5L187.396 177.086L226.445 233.962L172.646 190.771L193.197 256.631L154.518 199.501L154.743 268.492L134.622 202.5L114.501 268.492L114.727 199.501L76.0482 256.631L96.5985 190.771L42.7992 233.962L81.8489 177.086L17.7091 202.5L71.7885 159.661L3.0072 165.04L67.3112 140.044L0 124.911L68.8149 119.98L8.9545 85.679L76.1658 101.25L29.0753 50.8289L88.7105 85.519L58.5743 23.4578L105.335 74.1846L94.8305 5.9977L124.562 68.2539L134.622 0Z",aspectRatio:{width:270,height:269},width:m,height:y}),pillow:({width:m,height:y})=>f({path:"M176 0.00169945C157.812 16.9062 125.203 28.174 88.001 28.174C50.798 28.174 18.1881 16.9054 0 0V258.421C18.1882 241.516 50.798 230.248 88 230.248C125.202 230.248 157.812 241.516 176 258.421V0.00169945Z",aspectRatio:{width:176,height:259},width:m,height:y}),polygon:({width:m,height:y})=>f({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:m,height:y}),rainbow:({width:m,height:y})=>f({path:"M186.907 141H282C282 63.128 218.872 0 141 0C63.1278 0 0 63.128 0 141H95.093C95.093 115.646 115.646 95.093 141 95.093C166.354 95.093 186.907 115.646 186.907 141Z",aspectRatio:{width:282,height:141},width:m,height:y}),rhodeIsland:({width:m,height:y})=>f({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:m,height:y}),shell:({width:m,height:y})=>f({path:"M109 0C169.199 0 218 48.743 218 108.87C185.392 108.87 158.958 135.273 158.958 167.842C158.958 179.736 158.958 191 158.958 191H59.042C59.042 191 59.042 179.736 59.042 167.842C59.042 135.273 32.6077 108.87 0 108.87C0 48.743 48.8007 0 109 0Z",aspectRatio:{width:218,height:191},width:m,height:y}),shield1:({width:m,height:y})=>f({path:"M203.184 30.7277C142.457 30.7277 102.853 0 102.853 0C102.853 0 63.249 30.7277 3.05098 30.7277C3.05098 30.7277 -3.81372 128.209 3.05098 162.115C9.38758 193.902 102.853 249 102.853 249C102.853 249 196.319 193.902 203.184 162.115C209.52 128.738 203.184 30.7277 203.184 30.7277Z",aspectRatio:{width:206,height:249},width:m,height:y}),shield2:({width:m,height:y})=>f({path:"M0 12.9585C64.624 -4.3195 136.376 -4.3195 201 12.9585C201 51.0564 201 89.154 201 127.252C201 184.396 100.498 240 100.498 240C100.498 240 0 184.406 0 127.252C0 89.154 0 51.0564 0 12.9585Z",aspectRatio:{width:201,height:240},width:m,height:y}),skewedRectangle:({width:m,height:y})=>f({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:m,height:y}),softFlower:({width:m,height:y})=>f({path:"M109 0C80.073 0 56.6234 23.4498 56.6234 52.3766C56.6234 54.722 54.722 56.6234 52.3766 56.6234C23.4498 56.6234 0 80.073 0 109C0 137.927 23.4498 161.377 52.3766 161.377C54.722 161.377 56.6234 163.278 56.6234 165.623C56.6234 194.55 80.073 218 109 218C137.927 218 161.377 194.55 161.377 165.623C161.377 163.278 163.278 161.377 165.623 161.377C194.55 161.377 218 137.927 218 109C218 80.073 194.55 56.6234 165.623 56.6234C163.278 56.6234 161.377 54.722 161.377 52.3766C161.377 23.4498 137.927 0 109 0Z",aspectRatio:{width:218,height:218},width:m,height:y}),softStar:({width:m,height:y})=>f({path:"M130.424 3.17662C130.927 -1.05888 137.073 -1.05888 137.576 3.17662L141.792 38.7086C147.236 84.59 183.41 120.764 229.291 126.208L264.823 130.424C269.059 130.927 269.059 137.073 264.823 137.576L229.291 141.792C183.41 147.236 147.236 183.41 141.792 229.291L137.576 264.823C137.073 269.059 130.927 269.059 130.424 264.823L126.208 229.291C120.764 183.41 84.59 147.236 38.7086 141.792L3.17662 137.576C-1.05888 137.073 -1.05888 130.927 3.17662 130.424L38.7086 126.208C84.59 120.764 120.764 84.59 126.208 38.7086L130.424 3.17662Z",aspectRatio:{width:268,height:268},width:m,height:y}),stairs1:({width:m,height:y})=>f({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:m,height:y}),stairs2:({width:m,height:y})=>f({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:m,height:y}),teewee:({width:m,height:y})=>f({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:m,height:y}),blob1:({width:m,height:y})=>f({path:"M172.979 19.611C191.285 33.0858 204.505 54.442 210.861 78.5949C217.471 103.002 217.471 130.46 205.776 151.816C194.335 173.427 171.454 189.444 147.047 196.054C122.639 202.919 96.7069 200.631 75.3506 190.715C54.2486 180.546 37.7229 163.003 23.4855 142.155C9.5022 121.307 -2.19289 97.4087 0.349524 74.7813C3.14617 52.1538 19.9261 30.7976 40.2654 17.8313C60.6046 4.61077 84.5033 -0.474048 108.148 0.0344341C131.538 0.542916 154.928 6.13621 172.979 19.611Z",aspectRatio:{width:216,height:200},width:m,height:y}),blob10:({width:m,height:y})=>f({path:"M188.684 8.95173C205.601 24.3309 200.988 63.0866 191.453 99.3816C182.225 135.677 168.076 169.511 146.238 175.355C124.399 181.507 94.871 159.668 66.5733 143.059C37.9679 126.449 10.5929 115.068 2.59569 95.0754C-5.4015 75.0824 5.97912 46.1694 24.4342 30.4826C42.8893 14.7958 68.4188 12.0276 100.715 6.79864C132.704 1.5697 171.767 -6.42749 188.684 8.95173Z",aspectRatio:{width:200,height:177},width:m,height:y}),blob11:({width:m,height:y})=>f({path:"M137.368 29.4923C148.97 46.7605 146.542 72.1231 148.161 99.1046C149.779 126.086 155.715 154.956 144.113 174.383C132.781 193.81 103.911 203.793 80.4369 198.666C56.963 193.27 38.6156 173.034 28.3626 153.607C17.8398 134.181 15.4115 115.833 9.47555 91.5498C3.53961 67.2664 -5.63411 37.3169 4.61887 20.0488C15.1417 2.51078 45.0911 -1.80626 72.8821 0.622074C100.673 2.78059 126.036 12.2241 137.368 29.4923Z",aspectRatio:{width:152,height:200},width:m,height:y}),blob12:({width:m,height:y})=>f({path:"M158.391 17.923C172.491 28.5703 180.261 48.1384 187.743 70.5842C194.937 93.3177 202.419 118.641 194.649 138.785C187.167 158.928 164.146 173.317 138.535 184.54C112.923 196.05 84.4347 204.108 58.8235 197.777C33.2123 191.446 10.191 170.439 2.99688 146.267C-4.48504 121.807 3.57241 94.181 10.4788 68.282C17.0974 42.0953 22.565 17.6352 37.8166 7.27563C53.0682 -3.37171 78.1038 0.081487 100.837 2.67138C123.859 5.26127 144.29 7.27563 158.391 17.923Z",aspectRatio:{width:198,height:200},width:m,height:y}),blob13:({width:m,height:y})=>f({path:"M149.668 1.37595C170.663 5.22017 193.728 17.3442 198.755 34.7911C204.078 52.2379 191.363 75.3032 178.943 93.9329C166.819 112.563 154.99 126.757 140.501 145.386C126.011 164.312 108.86 187.673 92.5957 186.194C76.3317 185.011 60.9549 159.285 45.8737 140.655C30.4968 122.321 15.7114 110.788 7.43151 95.1157C-0.848339 79.4432 -2.32688 59.0392 3.5873 41.5924C9.50148 23.8498 23.1041 8.76868 38.7767 3.44592C54.745 -1.87685 73.3746 2.55879 91.7086 2.26308C110.338 2.26308 128.968 -2.17256 149.668 1.37595Z",aspectRatio:{width:200,height:187},width:m,height:y}),blob14:({width:m,height:y})=>f({path:"M137.838 28.6426C150.711 40.5617 165.014 46.5213 178.363 58.2021C191.474 69.8828 203.87 87.0464 198.864 99.6807C193.858 112.315 171.689 120.42 157.862 135.676C144.275 151.171 139.269 173.579 126.873 182.161C114.477 190.505 94.9294 185.022 76.8123 178.109C58.4568 171.196 41.5316 163.091 28.1822 150.456C14.5943 137.822 4.58225 120.42 1.24488 101.826C-2.09248 83.2322 1.00651 62.9697 13.8792 52.4809C26.7519 41.992 49.1598 41.0385 65.6083 30.788C82.0567 20.5376 92.0688 0.990158 103.034 0.0366268C113.762 -0.916905 125.204 16.9618 137.838 28.6426Z",aspectRatio:{width:200,height:187},width:m,height:y}),blob15:({width:m,height:y})=>f({path:"M185.203 1.52939C197.679 7.62217 200 32.2835 200 51.7223C200 71.1612 197.389 85.3777 197.679 100.175C198.259 114.681 201.741 129.768 198.259 143.114C194.778 156.46 184.623 168.356 171.567 173.868C158.801 179.671 143.134 179.091 130.368 174.739C117.312 170.387 106.867 162.263 86.8482 160.812C66.539 159.362 36.9454 164.294 18.9572 155.3C0.968966 146.306 -5.41395 123.095 5.03083 105.977C15.4756 88.5692 42.4579 77.5442 55.5139 59.5559C68.2798 41.8578 67.1192 17.4867 76.9837 9.6531C86.5581 2.10965 107.158 11.3939 128.627 9.6531C150.097 8.20244 172.728 -4.27327 185.203 1.52939Z",aspectRatio:{width:200,height:179},width:m,height:y}),blob16:({width:m,height:y})=>f({path:"M158.441 55.3221C167.253 80.2399 160.264 105.462 147.501 134.938C134.738 164.717 116.81 199.055 97.0576 199.967C77.3057 201.182 55.7305 168.668 34.4592 133.722C13.1879 99.0802 -7.77953 62.3112 2.85612 36.4818C13.4918 10.6523 56.0344 -3.93369 90.0685 0.928322C123.799 6.09421 149.324 30.7081 158.441 55.3221Z",aspectRatio:{width:163,height:200},width:m,height:y}),blob17:({width:m,height:y})=>f({path:"M168.917 36.7587C178.871 53.2457 175.138 76.5764 172.961 106.129C170.472 135.37 169.85 170.832 150.563 187.63C131.276 204.739 93.3252 203.495 65.0173 187.63C36.7095 172.077 18.0449 142.213 7.77943 107.373C-2.79714 72.2213 -4.35252 32.7147 14.312 14.0502C32.9765 -4.3033 72.1721 -1.50361 103.591 4.7179C135.32 10.6283 158.962 20.2717 168.917 36.7587Z",aspectRatio:{width:176,height:200},width:m,height:y}),blob18:({width:m,height:y})=>f({path:"M178.188 21.1464C193.012 36.3069 196.381 62.9219 198.739 88.1893C200.76 113.12 201.771 136.366 190.316 149.168C178.862 162.307 155.279 164.665 135.065 167.697C115.188 170.73 99.0168 174.098 72.4018 177.131C46.1237 180.163 9.40176 182.521 1.65309 168.371C-6.09559 154.221 15.4659 123.564 23.5515 92.9059C31.6371 62.2481 26.2467 31.2534 38.3751 15.4192C50.1665 -0.0781831 79.8136 -1.08888 107.776 0.595609C136.076 1.9432 163.028 5.64909 178.188 21.1464Z",aspectRatio:{width:200,height:180},width:m,height:y}),blob19:({width:m,height:y})=>f({path:"M148.621 13.3857C171.945 24.3818 194.937 41.3756 192.938 60.702C190.605 80.3615 163.282 101.687 149.953 123.346C136.958 145.005 137.958 166.664 128.295 174.661C118.631 182.325 98.3054 175.994 73.6476 181.991C48.9899 187.989 20.0004 205.983 11.0036 197.986C1.67366 189.989 12.6697 156.001 12.3365 131.343C12.0033 106.685 0.340809 91.0243 0.00759636 75.0301C-0.325616 59.0359 10.3372 42.3753 25.3318 28.7135C39.9931 15.0518 58.9863 4.05578 80.3119 1.05687C101.638 -2.27526 124.962 2.38972 148.621 13.3857Z",aspectRatio:{width:194,height:200},width:m,height:y}),blob2:({width:m,height:y})=>f({path:"M140.464 18.6393C156.081 28.3718 169.887 39.9149 178.714 54.853C187.541 69.5649 191.389 87.6717 189.578 104.421C187.768 121.396 180.525 137.239 172.377 153.535C164.455 169.832 155.854 186.58 142.048 194.276C128.241 201.971 109.456 200.613 92.4804 197.671C75.2789 194.502 60.1144 189.749 45.1762 182.733C30.4644 175.716 16.2052 166.21 8.28346 153.083C0.361703 139.729 -1.44898 122.527 1.04072 106.91C3.30408 91.2931 9.64147 76.8076 15.9789 60.5114C22.0899 44.2153 28.201 26.1084 40.6495 14.7916C53.0979 3.24849 71.8838 -1.27823 89.7643 0.306124C107.871 1.66414 124.846 9.13322 140.464 18.6393Z",aspectRatio:{width:191,height:200},width:m,height:y}),blob20:({width:m,height:y})=>f({path:"M150.035 13.2464C157.376 24.9386 153.026 48.323 157.92 65.7254C163.087 83.1277 177.498 94.2761 182.392 108.415C187.287 122.555 182.392 139.957 173.147 156.272C163.63 172.587 149.763 187.814 132.089 195.155C114.414 202.225 93.2053 201.137 73.6276 194.611C54.3219 188.357 36.9196 176.937 25.7712 161.438C14.8947 145.667 10.5441 126.09 5.92163 105.696C1.57105 85.0311 -3.05145 63.5501 2.65869 45.0601C8.64075 26.5701 24.6835 11.0711 43.1735 4.54524C61.6635 -1.98064 82.6007 0.194657 102.722 1.01039C122.844 1.82613 142.421 1.55421 150.035 13.2464Z",aspectRatio:{width:185,height:200},width:m,height:y}),blob21:({width:m,height:y})=>f({path:"M152.611 0.184799C172.596 -0.723643 197.73 1.39606 199.85 13.8114C201.969 26.2268 181.075 48.9379 174.716 68.0151C168.357 87.0924 176.533 102.536 174.11 114.649C171.991 127.064 159.575 136.148 146.252 139.782C132.928 143.719 118.696 141.902 105.977 139.176C93.562 136.451 82.6606 132.212 63.2805 131.909C43.9004 131.606 16.0416 135.24 5.44306 125.853C-5.15543 116.465 1.50648 94.0572 10.2881 76.4939C18.7669 59.2335 29.6682 46.8182 38.7526 35.3112C48.1398 23.5015 56.3158 12.903 66.9143 8.36078C77.5128 4.12138 91.1394 6.24108 104.766 5.63546C118.696 4.72701 132.928 1.09324 152.611 0.184799Z",aspectRatio:{width:200,height:143},width:m,height:y}),blob22:({width:m,height:y})=>f({path:"M195.507 15.5715C206.818 33.1668 193.622 69.3001 190.166 101.663C186.71 134.34 193.308 163.561 181.996 178.014C170.685 192.153 141.464 191.525 114.443 189.326C87.1072 187.44 62.2852 183.67 40.6052 169.531C19.2395 155.077 1.6441 130.255 0.0730908 103.862C-1.18372 77.4694 13.898 49.5054 35.2638 31.91C56.6296 14.0004 84.5936 6.45958 116.328 2.37494C148.063 -1.70969 184.196 -2.3381 195.507 15.5715Z",aspectRatio:{width:200,height:191},width:m,height:y}),blob23:({width:m,height:y})=>f({path:"M135.742 9.14189C157.815 19.2326 179.258 38.4681 176.105 56.7576C172.951 74.7317 145.202 92.0751 127.858 109.734C110.83 127.077 104.523 145.052 87.4953 164.918C70.4672 184.468 42.7177 206.227 27.5816 198.343C12.4455 190.46 9.60747 153.566 6.45411 126.762C2.98542 100.274 -0.798607 84.1917 0.147399 67.1636C0.77807 50.4508 6.76944 32.4767 19.0675 20.8093C31.0503 9.14189 49.6551 3.78119 70.4672 1.2585C90.964 -1.26418 113.668 -0.633508 135.742 9.14189Z",aspectRatio:{width:177,height:200},width:m,height:y}),blob24:({width:m,height:y})=>f({path:"M165.663 24.3715C171.555 44.4059 158.003 76.2254 151.816 96.2598C145.923 116.294 147.691 124.544 148.28 135.445C148.575 146.346 147.396 159.309 140.62 170.8C133.549 181.996 120.88 191.424 104.381 196.432C87.8821 201.441 67.553 202.03 54.8841 192.602C41.9207 183.469 36.6174 164.023 25.1271 143.105C13.3421 122.187 -4.33535 99.7953 0.967891 85.0641C6.27113 70.6275 34.2604 63.8511 56.0626 48.5307C77.5702 33.5048 92.8907 9.93489 113.22 2.56928C133.843 -4.79633 159.77 4.04241 165.663 24.3715Z",aspectRatio:{width:168,height:200},width:m,height:y}),blob25:({width:m,height:y})=>f({path:"M180.115 1.256C192.651 2.1962 189.83 34.163 190.771 58.2947C191.711 82.4265 196.098 98.4099 198.606 117.214C201.113 136.018 201.426 157.642 189.204 165.791C177.294 173.626 153.163 167.671 135.299 163.91C117.749 159.836 106.466 157.956 85.7818 162.97C65.0974 168.298 35.3244 180.521 18.7143 174.253C1.79068 167.985 -1.97012 142.913 0.850478 120.975C3.67107 99.0367 13.0731 79.6059 18.4009 54.8473C23.7287 30.0888 24.9823 -0.310996 40.0254 0.00240332C54.7552 0.00240332 82.9612 31.029 111.167 31.029C139.373 31.029 167.579 0.315802 180.115 1.256Z",aspectRatio:{width:200,height:176},width:m,height:y}),blob26:({width:m,height:y})=>f({path:"M142.571 0.586925C159.976 3.39414 176.258 15.1844 184.96 30.9048C193.662 46.6253 194.224 66.8372 189.171 83.6805C183.837 100.805 172.327 114.56 163.064 129.157C153.8 143.755 146.501 158.914 134.43 173.231C122.359 187.828 105.516 201.303 89.5146 199.899C73.2327 198.776 58.0738 182.775 42.9148 169.862C28.0366 157.23 13.7198 147.685 6.42103 134.491C-0.877729 121.297 -1.15845 103.892 1.64876 88.4528C4.45598 72.7324 10.0704 58.6963 18.4921 47.4674C27.1944 36.2386 38.4233 27.8169 50.4943 22.2025C62.846 16.3073 75.7592 13.5001 91.1989 8.72785C106.919 4.23631 125.166 -1.93957 142.571 0.586925Z",aspectRatio:{width:193,height:200},width:m,height:y}),blob27:({width:m,height:y})=>f({path:"M112.602 54.9337C129.225 71.8646 155.391 78.9448 158.777 89.719C162.471 100.493 143.693 114.654 127.07 135.586C110.447 156.519 96.2866 184.224 71.0442 194.998C46.1096 205.465 10.4008 199.308 2.0893 178.375C-6.22223 157.443 12.5557 121.734 18.4045 92.1817C24.5612 62.6296 17.7889 38.9263 26.4082 21.9954C34.7197 5.06454 58.423 -5.40183 73.5069 2.9097C88.8986 10.9134 95.9788 38.0028 112.602 54.9337Z",aspectRatio:{width:160,height:200},width:m,height:y}),blob28:({width:m,height:y})=>f({path:"M125.281 68.5835C142.15 82.9923 165.344 90.021 181.862 108.998C198.028 127.624 207.516 158.902 192.405 166.634C177.293 174.716 137.581 159.605 112.629 156.442C87.326 152.928 77.1344 161.713 59.9142 165.579C43.0453 169.445 19.1478 168.391 11.7677 157.496C4.73907 146.25 14.2278 124.813 11.4163 94.2382C8.2534 63.6634 -6.85825 23.9514 3.68476 8.48836C14.2278 -7.32615 50.4254 1.10826 73.9715 16.2199C97.5175 31.683 108.412 54.1747 125.281 68.5835Z",aspectRatio:{width:200,height:169},width:m,height:y}),blob29:({width:m,height:y})=>f({path:"M162.987 10.2348C169.16 25.1809 154.864 58.6471 147.066 79.4417C139.268 100.236 138.293 108.359 134.719 114.532C131.47 120.706 125.297 124.93 119.448 143.45C113.6 161.97 107.426 194.461 98.004 199.335C88.5814 204.209 75.5849 181.14 55.7651 167.494C35.6203 153.522 8.65241 148.648 1.8292 135.327C-4.994 122.33 8.65241 100.561 20.0244 82.041C31.3964 63.5208 40.1691 48.2498 53.4906 35.5782C66.8122 22.9065 84.0326 13.159 106.452 6.33584C128.871 -0.812285 156.489 -4.71127 162.987 10.2348Z",aspectRatio:{width:165,height:200},width:m,height:y}),blob3:({width:m,height:y})=>f({path:"M158.095 64.2637C176.543 95.19 192.277 129.1 181.697 155.686C171.117 182.001 133.951 201.533 99.4982 199.905C64.7739 198.549 33.0338 176.032 15.4004 145.377C-2.23296 114.994 -5.75963 76.2002 10.2461 46.6303C26.2518 17.0605 61.5185 -3.557 89.732 0.512241C118.217 4.58149 139.377 33.0662 158.095 64.2637Z",aspectRatio:{width:186,height:200},width:m,height:y}),blob30:({width:m,height:y})=>f({path:"M146.076 34.4585C157.052 54.582 155.833 80.1936 164.675 100.622C173.212 121.355 191.201 136.905 189.372 149.711C187.542 162.212 165.285 171.969 146.99 175.018C129.001 178.372 114.671 174.713 103.39 175.018C92.1083 175.018 83.876 178.982 66.8015 186.299C49.7271 193.617 23.8105 204.288 14.3586 198.19C4.90665 191.787 11.6145 168.615 10.3949 147.882C8.87037 127.148 -0.581561 108.549 0.0282404 89.3407C0.638042 70.1319 11.6145 50.6182 28.384 32.934C44.8487 15.5546 67.4113 0.309578 89.974 0.00467694C112.537 -0.300224 135.099 14.335 146.076 34.4585Z",aspectRatio:{width:190,height:200},width:m,height:y}),blob31:({width:m,height:y})=>f({path:"M134.218 44.0392C153.568 36.4264 184.97 26.9105 195.755 33.2544C206.222 39.9156 195.755 62.1194 181.481 76.3933C166.89 90.35 148.175 96.0596 145.638 116.36C143.1 136.661 156.74 171.235 151.664 183.923C146.589 196.928 123.434 187.413 105.036 178.531C86.6388 169.967 73.3165 161.72 52.0643 158.548C30.812 155.058 1.62986 156.644 0.0438693 145.225C-1.22492 133.806 25.4197 109.382 29.2261 86.8609C32.7152 64.3398 13.6834 44.0392 11.7802 26.9105C9.877 9.46461 24.7853 -4.80928 42.5484 1.53467C59.9942 7.87863 79.9777 34.5232 93.6172 45.308C107.257 56.4099 114.869 51.3347 134.218 44.0392Z",aspectRatio:{width:200,height:191},width:m,height:y}),blob32:({width:m,height:y})=>f({path:"M200 100.339C200 149.831 145.763 197.966 95.5932 197.966C45.7627 197.966 0 149.831 0 100.339C0 50.8475 45.7627 0 95.5932 0C145.763 0 200 50.8475 200 100.339Z",aspectRatio:{width:200,height:198},width:m,height:y}),blob4:({width:m,height:y})=>f({path:"M183.427 38.712C198.21 63.2519 196.141 95.1833 189.341 126.523C182.836 157.863 171.305 188.908 150.609 197.482C130.208 205.76 100.642 192.16 69.8936 177.968C39.4405 164.072 7.80478 150.176 1.30024 128.593C-5.2043 107.01 13.718 77.7393 35.3012 51.7211C56.5888 25.9986 81.1287 3.23272 108.921 0.276112C137.009 -2.38484 168.349 14.4678 183.427 38.712Z",aspectRatio:{width:195,height:200},width:m,height:y}),blob5:({width:m,height:y})=>f({path:"M166.251 30.6913C183.816 48.5185 195.875 71.8512 199.021 98.8542C202.429 125.595 197.186 155.744 179.359 169.115C161.794 182.223 131.645 178.815 103.331 176.979C75.0171 175.144 48.8006 174.882 29.6625 161.512C10.7866 148.141 -0.748681 121.925 0.0378149 96.2326C0.824311 70.8025 14.1947 46.159 33.0706 28.3318C52.2087 10.5045 76.8522 -0.5064 100.971 0.0179307C125.091 0.804426 148.423 12.864 166.251 30.6913Z",aspectRatio:{width:200,height:179},width:m,height:y}),blob6:({width:m,height:y})=>f({path:"M149.146 50.5452C161.911 68.0278 171.901 81.9028 176.619 97.9979C181.336 114.37 180.781 133.241 173.011 149.891C165.519 166.541 151.366 180.693 133.051 189.851C114.736 199.008 92.2586 202.893 71.446 197.621C50.6334 192.348 30.9308 177.918 18.1658 158.216C5.12323 138.791 -0.981801 113.815 0.128204 87.7304C1.51571 61.6453 10.6733 34.1726 29.2658 17.5226C48.1359 1.14999 76.996 -4.40004 98.9186 3.6475C120.841 11.695 136.381 32.7851 149.146 50.5452Z",aspectRatio:{width:180,height:200},width:m,height:y}),blob7:({width:m,height:y})=>f({path:"M158.662 41.8295C178.593 57.8305 204.138 64.5677 213.402 79.7266C222.666 94.6047 215.367 118.466 203.015 135.028C190.383 151.871 172.698 161.977 156.416 168.434C140.134 174.89 124.975 177.697 104.483 185.277C83.9903 192.856 58.1642 205.208 44.9704 197.629C31.4959 190.33 31.2152 163.1 21.9514 138.116C12.9684 112.851 -4.71688 90.1132 1.17822 75.5158C7.35404 61.1991 36.8295 55.5847 58.7256 40.1452C80.9024 24.7056 95.4998 -0.278374 109.816 0.00234533C124.414 0.283064 138.45 25.8285 158.662 41.8295Z",aspectRatio:{width:218,height:200},width:m,height:y}),blob8:({width:m,height:y})=>f({path:"M153.53 11.0108C168.179 18.1858 181.931 29.5461 192.993 44.4939C203.755 59.4417 212.425 78.2759 210.631 96.5122C209.136 114.748 197.477 132.088 182.529 142.252C167.581 152.716 148.747 156.004 128.717 168.262C108.687 180.22 87.1622 201.147 69.8228 199.951C52.7823 198.456 39.6283 174.54 32.4533 153.015C25.2784 131.49 24.0826 112.357 16.6087 91.131C9.13477 70.2041 -4.31825 46.8855 1.36191 31.9377C7.04207 16.691 31.8554 9.51607 52.7823 5.33069C73.4103 0.846349 90.4507 -0.648433 106.594 0.248435C123.037 1.1453 138.882 4.13486 153.53 11.0108Z",aspectRatio:{width:211,height:200},width:m,height:y}),blob9:({width:m,height:y})=>f({path:"M140.289 20.2182C156.96 27.7956 176.661 32.0895 189.29 43.9608C201.667 55.5796 206.718 75.0283 202.424 91.6987C198.131 108.622 184.491 122.766 175.651 140.952C166.81 158.885 162.769 180.607 150.393 191.216C138.016 201.824 117.052 201.572 98.866 197.025C80.6802 192.479 65.2727 183.891 48.3497 175.808C31.4268 167.726 13.2409 160.148 5.1583 146.761C-2.67172 133.122 -0.398493 113.673 4.14797 96.7504C8.69444 80.08 15.5141 65.6828 23.3442 52.296C31.4268 38.6566 40.5197 25.775 52.6436 15.6717C65.0201 5.82101 80.6802 -1.50385 95.3299 0.264221C109.98 1.77971 123.619 12.6407 140.289 20.2182Z",aspectRatio:{width:204,height:200},width:m,height:y})},e.subTypeToPathDataFunc=_,e.figureToSvg=w})(Yp);(function(e){var t=ye&&ye.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=t(et),n=yi,i=Pa,a=Yp,o=Ol,l=Oo,u=Gc,f={};e.FigureElement=(0,n.observer)(({element:g,store:S})=>{const _=g.selectable||S.role==="admin",h=(0,l.isTouchDevice)(),[w,m]=r.default.useState(!1),y=S.selectedElements.indexOf(g)>=0&&S.selectedElements.length===1,p=Math.min(g.strokeWidth,g.width/2,g.height/2),v=Math.max(0,Math.min(g.width/2,g.height/2,g.cornerRadius)),d=(0,u.useColor)(g,g.a.fill,"fill"),b=Object.assign(Object.assign({width:g.a.width,height:g.a.height},d),{cornerRadius:v,opacity:g.animated("opacity"),shadowEnabled:g.shadowEnabled,shadowBlur:g.shadowBlur,shadowOffsetX:g.shadowOffsetX,shadowOffsetY:g.shadowOffsetY,shadowColor:g.shadowColor,shadowOpacity:g.shadowOpacity,listening:_,preventDefault:!h||y,hideInExport:!g.showInExport}),O=(0,u.useColor)(g,g.stroke,"stroke"),R=Object.assign(Object.assign({visible:p>0,x:p/2,y:p/2,width:g.a.width-p,height:g.a.height-p},O),{strokeWidth:p,cornerRadius:Math.max(0,v-p),dash:g.dash.map(x=>x*p),opacity:g.animated("opacity"),hideInExport:!g.showInExport,listening:!1}),T=(E=g.subType,f[E]||(f[E]=(P=(0,a.subTypeToPathDataFunc)(E),(0,n.observer)(({element:x,fillProps:k,strokeProps:M})=>{let j=P({width:x.a.width,height:x.a.height,cornerRadius:x.cornerRadius}),B=1,$=1;typeof j!="string"&&(B=j.scaleX,$=j.scaleY,j=j.path);const Z=r.default.useRef(null);return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Rect,{width:x.width,height:x.height,fill:"transparent"}),r.default.createElement(i.Path,Object.assign({},k,{ref:Z,data:j,scaleX:B,scaleY:$})),r.default.createElement(i.Group,{clipFunc:K=>{const D=Z.current;if(D){var q=D.dataArray;K.beginPath();for(var A=0;A<q.length;A++){var L=q[A].command,z=q[A].points;switch(L){case"L":K.lineTo(z[0],z[1]);break;case"M":K.moveTo(z[0],z[1]);break;case"C":K.bezierCurveTo(z[0],z[1],z[2],z[3],z[4],z[5]);break;case"Q":K.quadraticCurveTo(z[0],z[1],z[2],z[3]);break;case"A":var I=z[0],H=z[1],W=z[2],V=z[3],U=z[4],Y=z[5],X=z[6],Q=z[7],te=W>V?W:V,ee=W>V?1:W/V,ne=W>V?V/W:1;K.translate(I,H),K.rotate(X),K.scale(ee,ne),K.arc(0,0,te,U,U+Y,1-Q),K.scale(1/ee,1/ne),K.rotate(-X),K.translate(-I,-H);break;case"z":K.closePath()}}}},scaleX:B,scaleY:$},r.default.createElement(i.Path,Object.assign({},M,{x:0,y:0,data:j,strokeWidth:2*M.strokeWidth,dash:M.dash.map(K=>K)}))))}))),f[E]||i.Group);var E,P;return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Group,{id:g.id,x:g.a.x,y:g.a.y,rotation:g.a.rotation,opacity:g.a.opacity,draggable:h?g.draggable&&y:g.draggable,name:"element",onMouseEnter:()=>{m(!0)},onMouseLeave:()=>{m(!1)},onDragMove:x=>{g.set({x:x.target.x(),y:x.target.y()})},onDragEnd:x=>{g.set({x:x.target.x(),y:x.target.y()})},onTransform:x=>{const k=x.target.scale();x.target.scaleX(1),x.target.scaleY(1),g.set({width:g.width*k.x,height:g.height*k.y,x:x.target.x(),y:x.target.y(),rotation:x.target.rotation()})}},r.default.createElement(T,{element:g,fillProps:b,strokeProps:R})),w&&!y&&r.default.createElement(o.Highlighter,{element:g}))})})(dS);(function(e){var t=ye&&ye.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=void 0;const r=t(et),n=yi,i=Zy,a=d2,o=rS,l=cS,u=fS,f=dS,g=Pa,S=Kn,_=(0,n.observer)(y=>{const{element:p,store:v}=y,{children:d}=p,b=p.selectable||v.role==="admin";return r.default.createElement(g.Group,{opacity:p.opacity,listening:b,hideInExport:!p.showInExport},d.map(O=>r.default.createElement(m,Object.assign({},y,{key:O.id,store:v,element:O}))))}),h={text:i.TextElement,image:a.ImageElement,svg:a.ImageElement,line:l.LineElement,video:u.VideoElement,figure:f.FigureElement,group:_};function w(y,p){h[y]=p}e.registerShapeComponent=w;const m=(0,n.observer)(y=>{let p=h[y.element.type];return y.element.type==="text"&&S.flags.htmlRenderEnabled&&(p=o.HTMLElement),y.element.visible?p?r.default.createElement(p,Object.assign({},y)):(console.error("Can not find component for "+y.element.type),null):null});e.default=m})(Z9);var hS={};(function(e){function t(r,n,i="scale"){const a=n.width/n.height;let o,l;a>=r.width/r.height?(o=r.width,l=r.width/a):(o=r.height*a,l=r.height);let u=0,f=0;return i==="left-top"?(u=0,f=0):i==="left-middle"?(u=0,f=(r.height-l)/2):i==="left-bottom"?(u=0,f=r.height-l):i==="center-top"?(u=(r.width-o)/2,f=0):i==="center-middle"?(u=(r.width-o)/2,f=(r.height-l)/2):i==="center-bottom"?(u=(r.width-o)/2,f=r.height-l):i==="right-top"?(u=r.width-o,f=0):i==="right-middle"?(u=r.width-o,f=(r.height-l)/2):i==="right-bottom"?(u=r.width-o,f=r.height-l):i==="scale"?(u=0,f=0,o=r.width,l=r.height):console.error(new Error("Unknown clip position property - "+i)),{cropX:u,cropY:f,cropWidth:o,cropHeight:l}}Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=void 0,e.getCrop=t})(hS);var $g={},Gg={},b_;function aj(){return b_||(b_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.setAPI=e.iconscoutDownload=e.iconscoutList=e.svgapiDownload=e.svgapiList=e.unsplashDownload=e.unsplashList=e.textTemplateList=e.templateList=e.removeBackground=e.polotnoShapesList=e.getGoogleFontImage=e.getGoogleFontsListAPI=e.URLS=e.getAPI=e.API=e.URL=void 0;const t=_2();e.URL="https://api.polotno.com",e.API="https://api.polotno.com/api";const r=()=>e.URL+"/api";e.getAPI=r;const n={},i=(d,b)=>{n[d]||(n[d]=!0,console.error(b))},a=`API for iconscout is provided as a demonstration.
|
|
239
|
+
For production usage you have to use your own API endpoint.
|
|
240
|
+
https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
|
|
241
|
+
https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:d,page:b=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${d}&per_page=20&page=${b}&KEY=${(0,t.getKey)()}`,unsplashDownload:d=>`${(0,e.getAPI)()}/download-unsplash?id=${d}&KEY=${(0,t.getKey)()}`,svgapiList:({query:d,page:b=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${d}&page=${b}&per_page=20&KEY=${(0,t.getKey)()}`,svgapiDownload:d=>`${(0,e.getAPI)()}/download-svgapi?path=${d}&KEY=${(0,t.getKey)()}`,iconscoutList:({query:d,page:b=1})=>(i("iconscout",a),`${(0,e.getAPI)()}/get-iconscout?query=${d}&page=${b}&KEY=${(0,t.getKey)()}`),iconscoutDownload:d=>(i("iconscout",a),`${(0,e.getAPI)()}/download-iconscout?uuid=${d}&KEY=${(0,t.getKey)()}`),nounProjectList:({query:d,page:b=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${d}&page=${b}&KEY=${(0,t.getKey)()}`,nounProjectDownload:d=>`${(0,e.getAPI)()}/download-nounproject?id=${d}&KEY=${(0,t.getKey)()}`,templateList:({query:d,page:b=1,sizeQuery:O})=>`${(0,e.getAPI)()}/get-templates?${O}&query=${d}&per_page=30&page=${b}&KEY=${(0,t.getKey)()}`};const o=()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,t.getKey)()}`;e.getGoogleFontsListAPI=o;const l=d=>{return`${e.URL}/google-fonts-previews/black/${b=d,O=" ",R="-",b.replace(new RegExp(O,"g"),R)}.png`;var b,O,R};e.getGoogleFontImage=l;const u=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,t.getKey)()}`;e.polotnoShapesList=u;const f=()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,t.getKey)()}`;e.removeBackground=f;const g=d=>e.URLS.templateList(d);e.templateList=g;const S=()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,t.getKey)()}`;e.textTemplateList=S;const _=d=>e.URLS.unsplashList(d);e.unsplashList=_;const h=d=>e.URLS.unsplashDownload(d);e.unsplashDownload=h;const w=d=>e.URLS.svgapiList(d);e.svgapiList=w;const m=d=>e.URLS.svgapiDownload(d);e.svgapiDownload=m;const y=d=>e.URLS.iconscoutList(d);e.iconscoutList=y;const p=d=>e.URLS.iconscoutDownload(d);e.iconscoutDownload=p;const v=(d,b)=>{e.URLS[d]=b};e.setAPI=v}(Gg)),Gg}var __;function _2(){return __||(__=1,function(e){var t=ye&&ye.__createBinding||(Object.create?function(R,T,E,P){P===void 0&&(P=E);var x=Object.getOwnPropertyDescriptor(T,E);x&&!("get"in x?!T.__esModule:x.writable||x.configurable)||(x={enumerable:!0,get:function(){return T[E]}}),Object.defineProperty(R,P,x)}:function(R,T,E,P){P===void 0&&(P=E),R[P]=T[E]}),r=ye&&ye.__setModuleDefault||(Object.create?function(R,T){Object.defineProperty(R,"default",{enumerable:!0,value:T})}:function(R,T){R.default=T}),n=ye&&ye.__importStar||function(R){if(R&&R.__esModule)return R;var T={};if(R!=null)for(var E in R)E!=="default"&&Object.prototype.hasOwnProperty.call(R,E)&&t(T,R,E);return r(T,R),T};Object.defineProperty(e,"__esModule",{value:!0}),e.validateKey=e.isKeyPaid=e.getKey=e.shouldShowCredit=void 0;const i=n(Wi),a=aj(),o=Kn;e.shouldShowCredit=i.observable({value:!1});const l=i.action(()=>{e.shouldShowCredit.value=!0});let u="";const f=()=>u||"";e.getKey=f;const g=5,S=3e3,_="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.",m="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let y=window.location.origin;const p=navigator.userAgent.indexOf("Headless")>-1,v=navigator.userAgent.indexOf("Electron")>-1;y==="file://"&&p&&(y="headless"),y==="file://"&&v&&(y="electron");const d=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${y}" here: https://polotno.com/cabinet`;async function b(R){for(let T=0;T<g;T++)try{const E=await fetch((0,a.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:R,site:location.host})});if(!R)return console.warn(_),!1;if(E.status!==200){await new Promise(x=>setTimeout(x,S));continue}const P=await E.json();return P.is_valid||console.warn(h),P.is_paid||console.log(m,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),P.is_domain_valid||console.log(d,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,o.useRemoveBackground)(P.remove_background_enabled),P.is_paid||!1}catch{await new Promise(P=>setTimeout(P,S))}return console.error(w),!0}async function O(R,T){u=R,await b(R)&&!T||l()}e.isKeyPaid=b,e.validateKey=O}($g)),$g}var Xp={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pxToUnitString=e.unitToPx=e.pxToUnitRounded=e.pxToUnit=void 0;const t=({px:a,unit:o="px",dpi:l})=>{switch(o){case"pt":default:return a;case"mm":return a/(l/25.4);case"cm":return a/(l/2.54);case"in":return a/l}};e.pxToUnit=t;const r=({px:a,precious:o=2,dpi:l=72,unit:u="px"})=>parseFloat((0,e.pxToUnit)({px:a,dpi:l,unit:u}).toFixed(o));e.pxToUnitRounded=r;const n=({unitVal:a,dpi:o,unit:l})=>a/(0,e.pxToUnit)({px:1,unit:l,dpi:o});e.unitToPx=n;const i=a=>{const o=parseFloat((0,e.pxToUnit)(a).toFixed(1));switch(a.unit){case"pt":return`${Math.round(o)}pt`;case"mm":return`${o}mm`;case"cm":return`${o}cm`;case"in":return`${o}in`;default:return`${Math.round(o)}px`}};e.pxToUnitString=i})(Xp);(function(e){var t=ye&&ye.__rest||function(D,q){var A={};for(var L in D)Object.prototype.hasOwnProperty.call(D,L)&&q.indexOf(L)<0&&(A[L]=D[L]);if(D!=null&&typeof Object.getOwnPropertySymbols=="function"){var z=0;for(L=Object.getOwnPropertySymbols(D);z<L.length;z++)q.indexOf(L[z])<0&&Object.prototype.propertyIsEnumerable.call(D,L[z])&&(A[L[z]]=D[L[z]])}return A},r=ye&&ye.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.registerTransformerAttrs=e.setTransformerStyle=void 0;const n=r(et),i=yi,a=Wi,o=Pa,l=r(Gp),u=r(_i),f=r(Z9),g=b2,S=d2,_=hS,h=_2(),w=Zs,m=Xp,y=Kn,p=Oo,v=u.default.DD._drag;window.removeEventListener("mousemove",v),u.default.DD._drag=function(D){(0,a.runInAction)(()=>{v.call(this,D)})},window.addEventListener("mousemove",u.default.DD._drag);const d=new u.default.Group;d.add(new u.default.Rect({width:20,height:20,fill:"white"})),d.add(new u.default.Path({scaleX:20/24,scaleY:20/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));const b=d.toCanvas({pixelRatio:2,width:20,height:20}),O={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:D=>{D.hasName("rotater")&&D.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:b,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},R=D=>{Object.assign(O,D)};e.setTransformerStyle=R;const T={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 E(D,q){T[D]=T[D]||q,Object.assign(T[D],q)}e.registerTransformerAttrs=E;const P=D=>n.default.createElement(o.Rect,Object.assign({},D,{preventDefault:!1})),x=D=>{var{url:q}=D,A=t(D,["url"]);const[L,z]=(0,l.default)(q,"anonymous"),I=L?(0,_.getCrop)(L,{width:A.width,height:A.height},"center-middle"):{};return(0,S.useImageLoader)(z,"background"),n.default.createElement(o.Image,Object.assign({image:L},A,I))},k=D=>n.default.createElement(o.Rect,Object.assign({},D)),M=D=>{const{background:q,scale:A,borderColor:L}=D,z=t(D,["background","scale","borderColor"]),I=n.default.useMemo(()=>!!u.default.Util.colorToRGBA(q),[q]),H=n.default.useMemo(()=>{const W=document.createElement("canvas"),V=30;W.width=60,W.height=60;const U=W.getContext("2d");return U&&(U.fillStyle="black",U.fillRect(V,0,V,V),U.fillRect(0,V,V,V)),W},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:H},z,{opacity:.1,hideInExport:!0})),I?n.default.createElement(k,Object.assign({fill:q},z)):n.default.createElement(x,Object.assign({url:q},z)))},j=(0,i.observer)(({selection:D})=>D.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(D.x1,D.x2),y:Math.min(D.y1,D.y2),width:Math.abs(D.x1-D.x2),height:Math.abs(D.y1-D.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),B=(0,i.observer)(({x:D,y:q,width:A,height:L,rotation:z,anchor:I,store:H})=>{const W=(0,w.getClientRect)({x:D,y:q,width:A,height:L,rotation:u.default.Util.radToDeg(z)});if(I===void 0)return null;const V=(L/2+70)*Math.cos(z-Math.PI/2),U=(L/2+70)*Math.sin(z-Math.PI/2),Y=(0,m.pxToUnitRounded)({unit:H.unit,dpi:H.dpi,px:A/H.scale,precious:H.unit==="px"?0:1})+" x "+(0,m.pxToUnitRounded)({unit:H.unit,dpi:H.dpi,px:L/H.scale,precious:H.unit==="px"?0:1})+(H.unit==="px"?"":" "+H.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(W.minX+W.maxX)/2+V,y:(W.minY+W.maxY)/2+U,offsetX:14,offsetY:14,visible:I==="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(z)).toString()+"°"})),n.default.createElement(o.Label,{x:(W.minX+W.maxX)/2,y:W.maxY+20,visible:I!=="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:Y})))}),$=(0,i.observer)(({elements:D,store:q})=>{const A=D.filter(z=>z.alwaysOnTop),L=D.filter(z=>!z.alwaysOnTop).concat(A);return n.default.createElement(n.default.Fragment,null,L.map(z=>n.default.createElement(f.default,{key:z.id,store:q,element:z,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let Z=null;const K=D=>{Z=D};e.registerNextDomDrop=K,e.default=(0,i.observer)(({store:D,page:q,width:A,height:L,pageControlsEnabled:z,backColor:I,pageBorderColor:H,activePageBorderColor:W,components:V,bleedColor:U,altCloneEnabled:Y})=>{const X=D.bleedVisible?q.bleed:0,Q=q.computedWidth+2*X,te=q.computedHeight+2*X,ee=(A-Q*D.scale)/2,ne=(L-te*D.scale)/2,ie=n.default.useRef(null),le=n.default.useRef(null),xe=n.default.useRef(null),Fe=z==null||z,[oe,ue]=n.default.useState(null),[ve,Ee]=n.default.useState({}),re=D.selectedElements.find(be=>be._cropModeEnabled),de=D.selectedShapes.filter(be=>!be.resizable).length>0,me=D.selectedShapes.filter(be=>!be.draggable).length>0,Se=D.selectedElements.filter(be=>!be.visible).length>0;n.default.useLayoutEffect(()=>{var be,Me,Ae;if(!ie.current)return;const _e=ie.current.getStage(),Qe=D.selectedShapes.map(Ye=>Ye._cropModeEnabled?null:_e.findOne("#"+Ye.id)).filter(Ye=>Ye),we=D.selectedElements.length===1&&((be=D.selectedElements[0])===null||be===void 0?void 0:be.type)||"many";T[we]?(ie.current.setAttrs(Object.assign(Object.assign({},O),T[we])),we!=="svg"&&we!=="image"||D.selectedElements[0].keepRatio||ie.current.setAttrs({enabledAnchors:O.enabledAnchors}),we==="text"&&y.flags.textVerticalResizeEnabled&&ie.current.setAttrs({enabledAnchors:(Me=T.text.enabledAnchors)===null||Me===void 0?void 0:Me.concat(["bottom-center"])})):ie.current.setAttrs(O),de&&ie.current.enabledAnchors([]),me&&ie.current.rotateEnabled(!1),Qe.find(Ye=>Ye==null?void 0:Ye.isDragging())&&Qe.forEach(Ye=>{Ye.isDragging()||Ye==null||Ye.startDrag()}),ie.current.nodes(Qe),(Ae=ie.current.getLayer())===null||Ae===void 0||Ae.batchDraw()},[D.selectedElements,re,de,Se,me]);const Te=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),ze=n.default.useRef(!1),Re=(0,p.isTouchDevice)(),Ne=(0,a.action)(be=>{var Me,Ae;if(Re)return;ze.current=!1;const _e=be.target.findAncestor(".elements-container"),Qe=be.target.findAncestor("Transformer"),we=be.target.findAncestor(".page-abs-container");if(_e||Qe||we)return;const Ye=(Me=be.target.getStage())===null||Me===void 0?void 0:Me.getPointerPosition();Ye&&(Te.visible=!0,Te.x1=Ye.x,Te.y1=Ye.y,Te.x2=Ye.x,Te.y2=Ye.y,((Ae=be.target.getStage())===null||Ae===void 0?void 0:Ae.getPointersPositions().length)>=2&&(Te.visible=!1))});n.default.useEffect(()=>{const be=(0,a.action)(Ae=>{var _e,Qe;if(!Te.visible)return;(_e=le.current)===null||_e===void 0||_e.setPointersPositions(Ae);let we=((Qe=le.current)===null||Qe===void 0?void 0:Qe.getPointerPosition())||{x:Te.x2,y:Te.y2};Te.x2=we.x,Te.y2=we.y}),Me=(0,a.action)(()=>{if(!Te.visible||!le.current)return;const Ae=le.current.findOne(".selection"),_e=Ae?Ae.getClientRect():{width:0,height:0,x:0,y:0};if(_e.width&&_e.height){const Qe=[];le.current.find(".element").forEach(Ye=>{const Pr=Ye.getClientRect(),Oe=D.getElementById(Ye.id()),Be=Oe==null?void 0:Oe.draggable,tt=Oe==null?void 0:Oe.selectable;u.default.Util.haveIntersection(_e,Pr)&&Be&&tt&&Qe.push(Oe.top.id)});const we=[...new Set(Qe)];D.selectElements(we)}Te.visible=!1,ze.current=!0});return window.addEventListener("mousemove",be),window.addEventListener("touchmove",be),window.addEventListener("mouseup",Me),window.addEventListener("touchend",Me),()=>{window.removeEventListener("mousemove",be),window.removeEventListener("touchmove",be),window.removeEventListener("mouseup",Me),window.removeEventListener("touchend",Me)}},[]);const $e=be=>{if(D.activePage!==q&&q.select(),ze.current)return;const Me=be.evt.ctrlKey||be.evt.metaKey||be.evt.shiftKey,Ae=be.target.findAncestor(".elements-container"),_e=be.target.findAncestor(".page-abs-container"),Qe=be.target.findAncestor("Transformer");if(!(Me||Ae||Qe||_e))return void D.selectElements([]);const we=be.target.findAncestor(".element",!0),Ye=D.getElementById(we==null?void 0:we.id()),Pr=Ye==null?void 0:Ye.top,Oe=Pr==null?void 0:Pr.id,Be=D.selectedElementsIds.indexOf(Oe)>=0;Oe&&Me&&!Be?D.selectElements(D.selectedElementsIds.concat([Oe])):Oe&&Me&&Be?D.selectElements(D.selectedElementsIds.filter(tt=>tt!==Oe)):!Oe||Me||Be||D.selectElements([Oe])};(0,g.useSnap)(ie,D);const Ge=D.activePage===q,ut=V==null?void 0:V.PageControls,ce=V==null?void 0:V.Tooltip,fe=1/D.scale,Ze=0/D.scale;return n.default.createElement("div",{ref:xe,onDragOver:be=>be.preventDefault(),onDrop:be=>{if(be.preventDefault(),!le.current)return;le.current.setPointersPositions(be);const Me=le.current.findOne(".elements-container").getRelativePointerPosition(),Ae=le.current.getPointerPosition(),_e=le.current.getAllIntersections(Ae).map(Ye=>Ye.findAncestor(".element",!0)).filter(Boolean),Qe=[...new Set(_e.reverse())].map(Ye=>D.getElementById(Ye.id())),we=Qe[0];Z&&(Z(Me,we,{elements:Qe,page:q}),Z=null)},style:{position:"relative",width:A+"px"},className:"polotno-page-container"+(Ge?" active-page":"")},n.default.createElement(o.Stage,{ref:le,width:Math.min(A,4*window.innerWidth),height:Math.min(L,4*window.innerHeight),onClick:$e,onTap:$e,onMouseDown:Ne,onMouseMove:be=>{if(!be.evt.altKey&&oe)return void ue(null);if(!be.evt.altKey)return;const Me=be.target.findAncestor(".element",!0),Ae=Me==null?void 0:Me.id();if(!D.selectedElements[0]||D.selectedElementsIds.includes(Ae))return;const _e=(0,w.getTotalClientRect)(D.selectedShapes),Qe=Ae?D.getElementById(Ae):{x:0,y:0,width:q.computedWidth,height:q.computedHeight,rotation:0},we=(0,w.getClientRect)(Qe),Ye=[];_e.minX>we.maxX&&Ye.push({distance:_e.minX-we.maxX,box1:_e,box2:we,points:[{x:_e.minX,y:_e.minY+_e.height/2},{x:we.maxX,y:_e.minY+_e.height/2},{x:we.maxX,y:we.minY+we.height/2}]}),_e.maxX<we.minX&&Ye.push({distance:we.minX-_e.maxX,box1:_e,box2:we,points:[{x:_e.maxX,y:_e.minY+_e.height/2},{x:we.minX,y:_e.minY+_e.height/2},{x:we.minX,y:we.minY+we.height/2}]}),_e.minY>we.maxY&&Ye.push({box1:_e,box2:we,distance:_e.minY-we.maxY,points:[{x:_e.minX+_e.width/2,y:_e.minY},{x:_e.minX+_e.width/2,y:we.maxY},{x:we.minX+we.width/2,y:we.maxY}]}),_e.maxY<we.minY&&Ye.push({box1:_e,box2:we,distance:we.minY-_e.maxY,points:[{x:_e.minX+_e.width/2,y:_e.maxY},{x:_e.minX+_e.width/2,y:we.minY},{x:we.minX+we.width/2,y:we.minY}]}),_e.minX>=we.minX&&_e.maxX<=we.maxX&&_e.minY>=we.minY&&_e.maxY<=we.maxY&&(Ye.push({distance:_e.minX-we.minX,box1:_e,box2:we,points:[{x:_e.minX,y:_e.minY+_e.height/2},{x:we.minX,y:_e.minY+_e.height/2},{x:we.minX,y:we.minY+we.height/2}]}),Ye.push({distance:we.maxX-_e.maxX,box1:_e,box2:we,points:[{x:_e.maxX,y:_e.minY+_e.height/2},{x:we.maxX,y:_e.minY+_e.height/2},{x:we.maxX,y:we.minY+we.height/2}]}),Ye.push({box1:_e,box2:we,distance:_e.minY-we.minY,points:[{x:_e.minX+_e.width/2,y:_e.minY},{x:_e.minX+_e.width/2,y:we.minY},{x:we.minX+we.width/2,y:we.minY}]}),Ye.push({box1:_e,box2:we,distance:we.maxY-_e.maxY,points:[{x:_e.minX+_e.width/2,y:_e.maxY},{x:_e.minX+_e.width/2,y:we.maxY},{x:we.minX+we.width/2,y:we.maxY}]})),JSON.stringify(oe)!==JSON.stringify(Ye)&&ue(Ye)},onDragStart:be=>{var Me;const Ae=be.target.findAncestor(".element",!0);if(Ae){const _e=D.getElementById(Ae==null?void 0:Ae.id()),Qe=_e==null?void 0:_e.top,we=Qe==null?void 0:Qe.id;!(D.selectedElementsIds.indexOf(we)>=0)&&we&&(D.selectElements([we]),be.target.stopDrag(),be.target.startDrag(be),(Me=ie.current)===null||Me===void 0||Me.startDrag(be))}oe&&ue(null)},pageId:q.id,style:{position:"relative"}},n.default.createElement(o.Layer,null,n.default.createElement(P,{width:A,height:L,fill:I}),n.default.createElement(o.Group,{x:ee,y:ne,scaleX:D.scale,scaleY:D.scale,name:"page-container"},n.default.createElement(o.Group,{name:"page-container-2"},n.default.createElement(o.Group,{name:"page-background-group",x:X,y:X},n.default.createElement(M,{x:-q.bleed,y:-q.bleed,width:q.computedWidth+2*q.bleed,height:q.computedHeight+2*q.bleed,background:q.background,name:"page-background",preventDefault:!1,scale:D.scale})),n.default.createElement(o.Group,{x:X,y:X,name:"elements-container",listening:!D.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:q.computedWidth,height:q.computedHeight,listening:!1}),n.default.createElement($,{elements:q.children,store:D})),n.default.createElement(o.Rect,{stroke:U,name:"bleed",strokeWidth:q.bleed,x:q.bleed/2,y:q.bleed/2,width:q.computedWidth+q.bleed,height:q.computedHeight+q.bleed,listening:!1,visible:q.bleed>0&&D.bleedVisible,hideInExport:!0}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,A,0,A,L,0,L,0,0,ee,ne,ee,L-ne,A-ee,L-ne,A-ee,ne,ee,ne],listening:!1,closed:!0,fill:I}),n.default.createElement(o.Group,{x:ee,y:ne,scaleX:D.scale,scaleY:D.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-fe/2-Ze,y:-fe/2-Ze,width:Q+fe+2*Ze,height:te+fe+2*Ze,stroke:Ge&&D.pages.length>1?W:H,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:ee+X*D.scale,y:ne+X*D.scale,scaleX:D.scale,scaleY:D.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:ie,onDragStart:be=>{var Me;!((Me=be.evt)===null||Me===void 0)&&Me.altKey&&Y&&D.selectedElements.forEach(Ae=>{const _e=Ae.clone({},{skipSelect:!0}),Qe=q.children.indexOf(Ae);q.setElementZIndex(_e.id,Qe)}),D.history.startTransaction()},onDragEnd:()=>{D.history.endTransaction()},onTransformStart:()=>{D.history.startTransaction()},boundBoxFunc:(be,Me)=>{const Ae=Math.abs(Me.width)<1||Math.abs(Me.height)<1,_e=Math.abs(be.width)<1||Math.abs(be.height)<1;return Ae&&!_e?be:Me},onTransform:be=>{var Me,Ae;const _e=ie.current.nodes(),Qe=_e[_e.length-1];if(be.target!==Qe)return;const we=(Me=ie.current)===null||Me===void 0?void 0:Me.__getNodeRect(),Ye=(Ae=ie.current)===null||Ae===void 0?void 0:Ae.getActiveAnchor();Ee({anchor:Ye,x:we.x,y:we.y,rotation:we.rotation,width:we.width,height:we.height})},onTransformEnd:be=>{Ee({}),D.history.endTransaction()},visible:!D.isPlaying}),oe&&oe.map(({points:be,distance:Me,box1:Ae,box2:_e},Qe)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:Qe,listening:!1},n.default.createElement(o.Rect,Object.assign({},Ae,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Rect,Object.assign({},_e,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[be[0].x,be[0].y,be[1].x,be[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[be[1].x,be[1].y,be[2].x,be[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(be[0].x+be[1].x)/2,y:(be[0].y+be[1].y)/2,offsetY:-10,scaleX:1/D.scale,scaleY:1/D.scale},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,m.pxToUnitString)({unit:D.unit,dpi:D.dpi,px:Me})})))),q._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:Q,height:te,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:Q,height:te,align:"center",verticalAlign:"middle"})),ce&&n.default.createElement(ce,{components:V,store:D,page:q,stageRef:le})),n.default.createElement(B,Object.assign({},ve,{store:D})),n.default.createElement(j,{selection:Te}),h.shouldShowCredit.value&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:A-170,y:L-18,onMouseEnter:be=>{be.target.getStage().container().style.cursor="pointer"},onMouseLeave:be=>{be.target.getStage().container().style.cursor=""},onTouchStart:be=>{be.cancelBubble=!0},onMouseDown:be=>{be.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),Fe&&Ge&&ut&&n.default.createElement(ut,{store:D,page:q,xPadding:ee,yPadding:ne}))})})(a9);var pS={};(function(e){var t=ye&&ye.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.LeftRules=e.TopRules=void 0;const r=t(et),n=Zs,i=Xp,a=yi,o=y2,l=(0,o.styled)("div",r.default.forwardRef)`
|
|
242
|
+
position: absolute;
|
|
243
|
+
top: 0;
|
|
244
|
+
left: 0;
|
|
245
|
+
pointer-events: none;
|
|
246
|
+
`,u=(0,o.styled)("div",r.default.forwardRef)`
|
|
247
|
+
height: 14px;
|
|
248
|
+
position: sticky;
|
|
249
|
+
font-size: 8px;
|
|
250
|
+
line-height: 14px;
|
|
251
|
+
top: 0;
|
|
252
|
+
left: 0;
|
|
253
|
+
color: grey;
|
|
254
|
+
border-bottom: 1px solid grey;
|
|
255
|
+
background-color: #e8e8e8;
|
|
256
|
+
overflow: hidden;
|
|
257
|
+
`,f=(0,o.styled)("div",r.default.forwardRef)`
|
|
258
|
+
left: 0;
|
|
259
|
+
width: 14px;
|
|
260
|
+
position: sticky;
|
|
261
|
+
font-size: 8px;
|
|
262
|
+
line-height: 14px;
|
|
263
|
+
color: grey;
|
|
264
|
+
border-right: 1px solid grey;
|
|
265
|
+
background-color: #e8e8e8;
|
|
266
|
+
overflow: hidden;
|
|
267
|
+
`,g=(0,o.styled)("div",r.default.forwardRef)`
|
|
268
|
+
position: absolute;
|
|
269
|
+
border-left: 1px solid grey;
|
|
270
|
+
padding-left: 2px;
|
|
271
|
+
`,S=(0,o.styled)("div",r.default.forwardRef)`
|
|
272
|
+
position: absolute;
|
|
273
|
+
left: 14px;
|
|
274
|
+
border-left: 1px solid grey;
|
|
275
|
+
padding-left: 2px;
|
|
276
|
+
transform: rotate(90deg);
|
|
277
|
+
transform-origin: left top;
|
|
278
|
+
overflow: hidden;
|
|
279
|
+
`,_=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];function h(){return r.default.createElement("div",null,r.default.createElement("h1",null,"Top rules"))}e.TopRules=(0,a.observer)(({store:w,width:m,height:y})=>{const p=r.default.useRef(null);if(!w.activePage)return null;const v=w.activePage,d=(w.bleedVisible&&v.bleed,v.computedWidth*w.scale),b=v.computedHeight*w.scale,O=(m-d)/2,R=(T=M=>(0,i.unitToPx)({unitVal:M,dpi:w.dpi,unit:w.unit})*w.scale,_.find(M=>T(M)>30)||1e4);var T;const E=(0,i.unitToPx)({unitVal:R,dpi:w.dpi,unit:w.unit})*w.scale,P=Math.round(d/E)+1,x=Math.round(b/E)+1,k=(0,n.getTotalClientRect)(w.selectedShapes);return r.default.createElement(l,{ref:p,className:"polotno-rulers"},r.default.createElement(u,{style:{width:m+"px"},className:"polotno-x-ruler"},[...Array(P)].map((M,j)=>r.default.createElement(g,{key:j,style:{left:O+j*E+"px",width:E+"px"}},w.unit==="px"||R>=1?Math.round(R*j):(R*j).toFixed(1))),!!w.selectedShapes.length&&r.default.createElement("div",{style:{position:"absolute",left:O+k.x*w.scale+"px",height:"14px",width:k.width*w.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),w.pages.map((M,j)=>{var B;const $=M.computedHeight*w.scale,Z=(y-$)/2;return r.default.createElement(f,{key:M.id,style:{height:y+"px"},className:"polotno-y-ruler"},[...Array(x)].map((K,D)=>r.default.createElement(S,{key:D,style:{top:Z+D*E-14+"px",width:E+"px"}},w.unit==="px"||R>=1?Math.round(R*D):(R*D).toFixed(1))),((B=w.selectedShapes[0])===null||B===void 0?void 0:B.page)===M&&r.default.createElement("div",{style:{position:"absolute",top:Z+k.y*w.scale-14+"px",width:"14px",height:k.height*w.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),e.LeftRules=h})(pS);var gS={},Vg={};let oj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",vS=e=>crypto.getRandomValues(new Uint8Array(e)),mS=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return(a=t)=>{let o="";for(;;){let l=r(i),u=i;for(;u--;)if(o+=e[l[u]&n]||"",o.length===a)return o}}},lj=(e,t=21)=>mS(e,t,vS),sj=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");const uj=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:lj,customRandom:mS,nanoid:sj,random:vS,urlAlphabet:oj},Symbol.toStringTag,{value:"Module"})),Zp=fo(uj);var qg={},Wg={},yS={},w2={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deepEqual=void 0;const t=function(r,n){if(r===n)return!0;if(typeof r=="object"&&r!=null&&typeof n=="object"&&n!=null){if(Object.keys(r).length!=Object.keys(n).length)return!1;for(var i in r)if(!n.hasOwnProperty(i)||!(0,e.deepEqual)(r[i],n[i]))return!1;return!0}return!1};e.deepEqual=t})(w2);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const t=wi,r=w2;Object.assign(t.types),e.UndoManager=t.types.model("UndoManager",{history:t.types.array(t.types.frozen()),undoIdx:-1,targetPath:""}).views(n=>({get canUndo(){return n.undoIdx>0},get canRedo(){return n.undoIdx<n.history.length-1}})).actions(n=>{let i,a,o=!1,l=null,u=0,f=0;const g=()=>f>0;function S(){const h=(0,t.getSnapshot)(i);return{pages:h.pages,width:h.width,height:h.height,custom:h.custom}}function _(h){const w=i.pages.map(y=>y.id),m=h.pages.map(y=>y.id);(0,r.deepEqual)(w,m)?i.pages.forEach((y,p)=>{(0,t.applySnapshot)(y,h.pages[p])}):(0,t.applySnapshot)(i.pages,h.pages),i.setSize(h.width,h.height)}return{startTransaction(){f++},endTransaction(h){f--,h||this.requestAddState(S())},async ignore(h,w=!1,m=!1){m&&await new Promise(b=>setTimeout(b,10)),u&&n.addUndoState();let y=g();n.startTransaction();let p=f;try{await h()}catch(b){setTimeout(()=>{throw b})}const v=p!==f,d=!v;n.endTransaction(d),w||y||n.replaceState(),v||(clearTimeout(u),u=0)},async transaction(h){await n.ignore(h,!0),this.addUndoState()},requestAddState(h){l=h,u||g()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),g()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const h=n.history[n.undoIdx];!(0,r.deepEqual)(l,h)&&(clearTimeout(u),u=0,n.history.splice(n.undoIdx+1),n.history.push(l),n.undoIdx=n.history.length-1)},afterCreate(){if(i=(0,t.resolvePath)(n,".."),!i)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");a=(0,t.onSnapshot)(i,()=>{this.requestAddState(S())}),n.history.length===0&&this.requestAddState(S())},clear(){clearTimeout(u),u=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(S())},beforeDestroy(){a()},undo(){u&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,_(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,_(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=S()}}}),e.default=e.UndoManager})(yS);var bS={};(function(e){async function t(r,n){const i=await(await fetch(r)).blob(),a=document.createElement("a"),o=URL.createObjectURL(i);a.href=o,a.download=n,document.body.appendChild(a),a.click(),setTimeout(function(){document.body.removeChild(a),window.URL.revokeObjectURL(o)},0)}Object.defineProperty(e,"__esModule",{value:!0}),e.downloadFile=void 0,e.downloadFile=t})(bS);var _S={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsPDF=void 0;const t="https://unpkg.com/jspdf@2.2.0/dist/jspdf.umd.min.js";let r;function n(){return r?Promise.resolve(r):new Promise(i=>{var a=document.createElement("script");a.onload=function(){r=window.jspdf.jsPDF,i(r)},a.src=t,document.head.appendChild(a)})}e.getJsPDF=n})(_S);var wS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createGIF=e.getGIF=void 0;const t="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js";function r(){return window.GIF?Promise.resolve(window.GIF):new Promise(i=>{var a=document.createElement("script");a.onload=function(){i(window.GIF)},a.src=t,document.head.appendChild(a)})}async function n({width:i,height:a}){return new(await r())({workers:4,width:i,height:a,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
|
|
280
|
+
(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]);
|
|
281
|
+
`],{type:"application/javascript"}))})}e.getGIF=r,e.createGIF=n})(wS);var SS={};(function(e){async function t(r){for(let n=0;n<30;n++){const i=await r();if(i)return i;await new Promise(a=>setTimeout(a,50))}}Object.defineProperty(e,"__esModule",{value:!0}),e.waitTillAvailable=void 0,e.waitTillAvailable=t})(SS);var ES={},wc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=e.cropImage=e.loadImage=e.getImageSize=void 0;const t=Ys;function r(o){return new Promise(l=>{const u=document.createElement("img");u.onload=async()=>{u.width===0||u.height===0?l(await(0,t.getSvgSize)(o)):l({width:u.width,height:u.height})},u.crossOrigin="anonymous",u.src=o})}function n(o){return new Promise((l,u)=>{const f=document.createElement("img");f.onload=()=>{l(f)},f.onerror=g=>{u(g)},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 g=document.createElement("canvas");g.width=l.width,g.height=l.height;const S=g.getContext("2d");let{cropX:_,cropY:h}=l;const w=f.width*l.cropWidth,m=f.height*l.cropHeight,y=l.width/l.height;let p,v;const d=w/m;return l.type==="svg"?(p=w,v=m):y>=d?(p=w,v=w/y):(p=m*y,v=m),S.drawImage(f,_*f.width,h*f.height,p,v,0,0,g.width,g.height),g.toDataURL("image/png")}function a(o,l){const{width:u,height:f}=o,g=u/f;let S,_;g>=l.width/l.height?(S=l.width,_=l.width/g):(S=l.height*g,_=l.height);const h=(l.width-S)/2,w=(l.height-_)/2;return{cropX:h/l.width,cropY:w/l.height,cropWidth:S/l.width,cropHeight:_/l.height}}e.getImageSize=r,e.loadImage=n,e.cropImage=i,e.getCrop=a})(wc);(function(e){var t=ye&&ye.__createBinding||(Object.create?function(E,P,x,k){k===void 0&&(k=x);var M=Object.getOwnPropertyDescriptor(P,x);M&&!("get"in M?!P.__esModule:M.writable||M.configurable)||(M={enumerable:!0,get:function(){return P[x]}}),Object.defineProperty(E,k,M)}:function(E,P,x,k){k===void 0&&(k=x),E[k]=P[x]}),r=ye&&ye.__setModuleDefault||(Object.create?function(E,P){Object.defineProperty(E,"default",{enumerable:!0,value:P})}:function(E,P){E.default=P}),n=ye&&ye.__importStar||function(E){if(E&&E.__esModule)return E;var P={};if(E!=null)for(var x in E)x!=="default"&&Object.prototype.hasOwnProperty.call(E,x)&&t(P,E,x);return r(P,E),P},i=ye&&ye.__rest||function(E,P){var x={};for(var k in E)Object.prototype.hasOwnProperty.call(E,k)&&P.indexOf(k)<0&&(x[k]=E[k]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function"){var M=0;for(k=Object.getOwnPropertySymbols(E);M<k.length;M++)P.indexOf(k[M])<0&&Object.prototype.propertyIsEnumerable.call(E,k[M])&&(x[k[M]]=E[k[M]])}return x};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToHTML=e.jsonToDOM=e.fixRatio=void 0;const a=wc,o=n(Ys),l=wc,u=Yp,f=(E,P,...x)=>({type:E,props:P,children:x||[]});function g(E){var P=new DOMParser().parseFromString(E,"image/svg+xml");return P.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(P)}e.fixRatio=g;const S=async({element:E,page:P,store:x})=>{let{src:k}=E;if(E.type==="svg"&&Object.keys(E.colorsReplace).length){const Y=await o.urlToString(k);k=o.replaceColors(Y,new Map(Object.entries(E.colorsReplace)))}let M="";E.flipX&&(M+="scaleX(-1)"),E.flipY&&(M+="scaleY(-1)"),M||(M="none");const j={};if(E.clipSrc){const Y=await o.urlToBase64(E.clipSrc);j["clip-path"]=`url(${Y})`}const B=await(0,l.loadImage)(k),$=B.width*E.cropWidth,Z=B.height*E.cropHeight,K=E.width/E.height;let D,q;const A=$/Z;E.type==="svg"?(D=$,q=Z):K>=A?(D=$,q=$/K):(D=Z*K,q=Z);const L=D/B.width,z=q/B.height,I=D/q>E.width/E.height?E.height/q:E.width/D,H=D*I/L,W=q*I/z,V=E.cropX*I*B.width,U=E.cropY*I*B.height;return f("div",{style:Object.assign(Object.assign({},j),{width:"100%",height:"100%","border-radius":E.cornerRadius+"px",border:E.borderSize?`${E.borderSize}px solid ${E.borderColor}`:"none",background:`url(${k})`,transform:M,"background-size":`${Math.round(H)}px ${Math.round(W)}px`,"background-position-x":-Math.round(V)+"px","background-position-y":-Math.round(U)+"px"})})},_=async({element:E,page:P,store:x})=>{let k={top:0,left:0};E.fill.indexOf("gradient")>=0&&(k=Object.assign(Object.assign({},k),{"background-color":E.fill,"background-image":E.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const M=E.backgroundPadding*(E.fontSize*E.lineHeight),j=f("div",{style:{position:"absolute",top:-M/2+"px",left:-M/2+"px",display:E.backgroundEnabled?"block":"none",width:E.width+M+"px",height:E.height+M+"px","background-color":E.backgroundColor,"border-radius":E.backgroundCornerRadius*(E.fontSize*E.lineHeight*.5)+"px"}});E.verticalAlign==="middle"?(k.top="50%",k.transform="translateY(-50%)"):E.verticalAlign==="bottom"&&(k.bottom=0);const B=f("div",{style:Object.assign(Object.assign({},k),{position:"absolute",width:E.width+"px",color:E.fill,"white-space":"pre-wrap","font-size":E.fontSize+"px","text-align":E.align,"font-family":E.fontFamily,"text-decoration":E.textDecoration||"none","line-height":E.lineHeight,"letter-spacing":E.letterSpacing+"em","font-style":E.fontStyle,"font-weight":E.fontWeight,"-webkit-text-stroke":`${E.strokeWidth}px ${E.stroke}`,"text-stroke":`${E.strokeWidth}px ${E.stroke}`})},E.text.split(`
|
|
282
|
+
`).join("<br />"));return f("div",{style:{position:"relative",width:"100%",height:"100%"}},j,B)},h=({element:E,type:P})=>{const x={"stroke-width":E.height,stroke:E.color,"line-cap":"round","stroke-linejoin":"round",opacity:E.opacity};return P==="arrow"||P==="triangle"?f("polyline",Object.assign({points:`${3*E.height},${2*-E.height} 0,0 ${3*E.height},${2*E.height}`},x)):P==="bar"?f("polyline",Object.assign({points:`0,${2*-E.height} 0,${2*E.height}`},x)):P==="circle"?f("circle",Object.assign({r:E.height},x)):P==="square"?f("polyline",Object.assign({points:`${-E.height},${-E.height} ${-E.height},${E.height} ${E.height},${E.height} ${E.height},${-E.height}`},x)):null},w=async({element:E,page:P,store:x})=>f("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},f("rect",{x:0,y:0,width:E.width,height:E.height,fill:E.color}),f("g",{transform:`translate(0 ${E.height/2})`},h({element:E,type:E.startHead})),f("g",{transform:`translate(${E.width} ${E.height/2}) rotate(180)`},h({element:E,type:E.endHead}))),m=async({element:E,page:P,store:x,elementHook:k})=>{const M=await Promise.all(E.children.map(B=>v({element:B,page:P,store:x,elementHook:k}))),j=f("div",{style:{"transform-origin":"top left",opacity:E.opacity}},...M);return k&&k({dom:j,element:E})||j},y=async({element:E,page:P,store:x,elementHook:k})=>{const M=(0,u.figureToSvg)(E),j=f("div",{innerHTML:M});return k&&k({dom:j,element:E})||j},p={image:S,svg:S,text:_,line:w,figure:y,group:m};async function v({element:E,page:P,store:x,elementHook:k}){let M=await p[E.type];M||(M=()=>f("div",{}),console.error(`HTML export does not support ${E.type} type...`));const j=await M({element:E,page:P,store:x}),B=[];E.blurEnabled&&B.push(`blur(${E.blurRadius/2}px)`),E.brightnessEnabled&&B.push(`brightness(${100*E.brightness+100}%)`),E.sepiaEnabled&&B.push("sepia()"),E.grayscaleEnabled&&B.push("grayscale()"),E.shadowEnabled&&B.push(`drop-shadow(${E.shadowOffsetX}px ${E.shadowOffsetY}px ${E.shadowBlur}px ${E.shadowColor})`);const $=f("div",{id:E.id,style:{position:"absolute",left:E.x+"px",top:E.y+"px",width:E.width+"px",height:E.height+"px",transform:`rotate(${E.rotation}deg)`,"transform-origin":"top left",opacity:E.opacity,display:E.visible&&E.showInExport?"block":"none",filter:B.join(" ")||"none"}},j);return k&&k({dom:$,element:E})||$}async function d({page:E,store:P,elementHook:x}){const k=await Promise.all(E.children.map($=>v({element:$,page:E,store:P,elementHook:x}))),M=E.width==="auto"?P.width:E.width,j=E.height==="auto"?P.height:E.height;let B={};if(E.background.indexOf("url")>=0||E.background.indexOf("http")>=0||E.background.indexOf(".jpg")>=0||E.background.indexOf(".png")>=0||E.background.indexOf(".jpeg")>=0){const{width:$,height:Z}=await(0,l.loadImage)(E.background),K=await S({element:Object.assign({x:0,y:0,width:$,height:Z,src:E.background,cornerRadius:0},(0,a.getCrop)({width:$,height:Z},{width:$,height:Z})),page:E,store:P});k.unshift(K)}else B=Object.assign(Object.assign({},B),{"background-color":E.background});return f("div",{className:"page",id:E.id,style:Object.assign(Object.assign({},B),{width:M+"px",height:j+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...k)}async function b({json:E,elementHook:P}){const x=await Promise.all(E.pages.map(j=>d({page:j,store:E,elementHook:P}))),k=[];E.pages.forEach(j=>{j.children.forEach(B=>{B.type==="text"&&k.indexOf(B.fontFamily)===-1&&k.push(B.fontFamily)})});const M=k.map(j=>E.fonts.find(B=>B.fontFamily===j)?f("style",{},""):f("link",{href:`https://fonts.googleapis.com/css?family=${j}`,rel:"stylesheet"}));return f("div",{className:"design"},...M,...x)}e.jsonToDOM=b;const O=(E,P)=>typeof P=="object"?`${E}="${Object.keys(P).map(x=>`${x}:${P[x]};`).join(" ")}"`:`${E}="${P}"`,R=({dom:E})=>{if(typeof E=="string")return E;if(!E)return"";const P=E.props,{innerHTML:x}=P,k=i(P,["innerHTML"]);return`<${E.type} ${Object.keys(k).map(M=>O(M,E.props[M])).join(" ")}>${x||E.children.map(M=>R({dom:M})).join("")}</${E.type}>`};async function T({json:E,elementHook:P}){const x=await b({json:E,elementHook:P});return R({dom:x})}e.jsonToHTML=T})(ES);var OS={};(function(e){var t=ye&&ye.__createBinding||(Object.create?function(P,x,k,M){M===void 0&&(M=k);var j=Object.getOwnPropertyDescriptor(x,k);j&&!("get"in j?!x.__esModule:j.writable||j.configurable)||(j={enumerable:!0,get:function(){return x[k]}}),Object.defineProperty(P,M,j)}:function(P,x,k,M){M===void 0&&(M=k),P[M]=x[k]}),r=ye&&ye.__setModuleDefault||(Object.create?function(P,x){Object.defineProperty(P,"default",{enumerable:!0,value:x})}:function(P,x){P.default=x}),n=ye&&ye.__importStar||function(P){if(P&&P.__esModule)return P;var x={};if(P!=null)for(var k in P)k!=="default"&&Object.prototype.hasOwnProperty.call(P,k)&&t(x,P,k);return r(x,P),x},i=ye&&ye.__rest||function(P,x){var k={};for(var M in P)Object.prototype.hasOwnProperty.call(P,M)&&x.indexOf(M)<0&&(k[M]=P[M]);if(P!=null&&typeof Object.getOwnPropertySymbols=="function"){var j=0;for(M=Object.getOwnPropertySymbols(P);j<M.length;j++)x.indexOf(M[j])<0&&Object.prototype.propertyIsEnumerable.call(P,M[j])&&(k[M[j]]=P[M[j]])}return k};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToSVG=e.jsonToDOM=e.fixRatio=void 0;const a=wc,o=n(Ys),l=wc,u=Yp,f=(P,x,...k)=>({type:P,props:x,children:k||[]});function g(P){var x=new DOMParser().parseFromString(P,"image/svg+xml");return x.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(x)}e.fixRatio=g;const S=async({element:P,page:x,store:k})=>{let{src:M}=P;if(P.type==="svg"){const Q=await o.urlToString(M);M=o.replaceColors(Q,new Map(Object.entries(P.colorsReplace)))}let j="";P.flipX&&(j+="scaleX(-1)"),P.flipY&&(j+="scaleY(-1)"),P.clipSrc&&await o.urlToBase64(P.clipSrc);const B=await(0,l.loadImage)(M),$=B.width*P.cropWidth,Z=B.height*P.cropHeight,K=P.width/P.height;let D,q;const A=$/Z;P.type==="svg"?(D=$,q=Z):K>=A?(D=$,q=$/K):(D=Z*K,q=Z);const L=D/B.width,z=q/B.height,I=D/q>P.width/P.height?P.height/q:P.width/D,H=D*I/L,W=q*I/z,V=P.cropX*B.width*I,U=P.cropY*B.height*I,Y=`clip-${P.id}`,X=M.replace(/&/g,"&");return f("g",{style:{transform:j}},f("defs",{},f("clipPath",{id:Y},f("rect",{x:0,y:0,width:P.width,height:P.height}))),f("image",{"xlink:href":X,x:-V,y:-U,width:H,height:W,preserveAspectRatio:"none","clip-path":`url(#${Y})`}))},_=async({element:P,page:x,store:k})=>{const M=(K,D,q,A,L)=>{const z=document.createElement("canvas").getContext("2d");return z.font=`${L} ${A} ${D}px ${q}`,z.measureText(K).width},j=((K,D,q,A,L,z)=>{const I=[];return K.split(`
|
|
283
|
+
`).forEach(H=>{const W=H.split(" ");let V="";for(let U=0;U<W.length;U++){const Y=V+W[U]+" ";M(Y,q,A,L,z)>D&&U>0?(I.push(V.trim()),V=W[U]+" "):V=Y}I.push(V.trim())}),I})(P.text,P.width,P.fontSize,P.fontFamily,P.fontWeight,P.fontStyle),B=P.fontSize*P.lineHeight,$=P.align==="center"?"middle":P.align==="right"?"end":"start",Z=j.map((K,D)=>f("tspan",{x:P.align==="center"?P.width/2:P.align==="right"?P.width:0,dy:D===0?0:B,innerHTML:K}));return f("g",{},f("text",{fill:P.fill,y:P.fontSize,"font-size":P.fontSize+"px","text-anchor":$,"font-family":P.fontFamily,"font-style":P.fontStyle,"font-weight":P.fontWeight,"text-decoration":P.textDecoration,"line-height":P.lineHeight,"letter-spacing":P.letterSpacing+"em","stroke-width":P.strokeWidth,stroke:P.stroke},...Z))},h=({element:P,type:x})=>{const k={"stroke-width":P.height,stroke:P.color,"line-cap":"round","stroke-linejoin":"round",opacity:P.opacity};return x==="arrow"||x==="triangle"?f("polyline",Object.assign({points:`${3*P.height},${2*-P.height} 0,0 ${3*P.height},${2*P.height}`},k)):x==="bar"?f("polyline",Object.assign({points:`0,${2*-P.height} 0,${2*P.height}`},k)):x==="circle"?f("circle",Object.assign({r:P.height},k)):x==="square"?f("polyline",Object.assign({points:`${-P.height},${-P.height} ${-P.height},${P.height} ${P.height},${P.height} ${P.height},${-P.height}`},k)):null},w=async({element:P,page:x,store:k})=>f("g",{},f("line",{x1:0,y1:P.height/2,x2:P.width,y2:P.height/2,stroke:P.color,"stroke-width":P.height}),f("g",{transform:`translate(0 ${P.height/2})`},h({element:P,type:P.startHead})),f("g",{transform:`translate(${P.width} ${P.height/2}) rotate(180)`},h({element:P,type:P.endHead}))),m=async({element:P,page:x,store:k,elementHook:M})=>{const j=await Promise.all(P.children.map($=>d({element:$,page:x,store:k,elementHook:M}))),B=f("g",{opacity:P.opacity,transform:`translate(${P.x}, ${P.y}) rotate(${P.rotation})`,style:{"transform-origin":"top left"}},...j);return M&&M({dom:B,element:P})||B};function y(P){let x=P.replace(/<svg[^>]*>/,"");return x=x.replace(/<\/svg>/,""),x}const p=async({element:P,page:x,store:k,elementHook:M})=>{const j=y((0,u.figureToSvg)(P)),B=f("g",{innerHTML:j});return M&&M({dom:B,element:P})||B},v={image:S,svg:S,text:_,line:w,figure:p,group:m};async function d({element:P,page:x,store:k,elementHook:M}){let j=await v[P.type];j||(j=()=>f("g",{}),console.error(`SVG export does not support ${P.type} type...`));const B=await j({element:P,page:x,store:k}),$=[];P.blurEnabled&&$.push(`blur(${P.blurRadius/2}px)`),P.brightnessEnabled&&$.push(`brightness(${100*P.brightness+100}%)`),P.sepiaEnabled&&$.push("sepia()"),P.grayscaleEnabled&&$.push("grayscale()"),P.shadowEnabled&&$.push(`drop-shadow(${P.shadowOffsetX}px ${P.shadowOffsetY}px ${P.shadowBlur}px ${P.shadowColor})`);const Z=f("g",{className:"element",id:P.id,transform:`translate(${P.x}, ${P.y}) rotate(${P.rotation})`,display:P.visible?void 0:"none",style:{"transform-origin":"top left",filter:$.join(" ")}},B);return M&&M({dom:Z,element:P})||Z}async function b({page:P,store:x,elementHook:k}){const M=await Promise.all(P.children.map(B=>d({element:B,page:P,store:x,elementHook:k})));let j={};if(P.background.indexOf("url")>=0||P.background.indexOf("http")>=0||P.background.indexOf(".jpg")>=0||P.background.indexOf(".png")>=0||P.background.indexOf(".jpeg")>=0){const B=await(0,l.loadImage)(P.background),$=await(0,l.cropImage)(P.background,Object.assign({width:x.width,height:x.height,x:0,y:0},(0,a.getCrop)({width:x.width,height:x.height},{width:B.width,height:B.height})));j=Object.assign(Object.assign({},j),{"background-image":`url(${$})`})}return f("g",{className:"page",style:Object.assign(Object.assign({},j),{background:P.background})},f("rect",{x:0,y:0,width:x.width,height:x.height,fill:P.background}),...M)}async function O({json:P,elementHook:x}){const k=await Promise.all(P.pages.map(B=>b({page:B,store:P,elementHook:x}))),M=[];P.pages.forEach(B=>{B.children.forEach($=>{$.type==="text"&&M.indexOf($.fontFamily)===-1&&M.push($.fontFamily)})});const j=M.map(B=>P.fonts.find($=>$.fontFamily===B)?f("style",{},""):f("defs",{},f("style",{type:"text/css",innerHTML:`@import url('https://fonts.googleapis.com/css?family=${B}:bi,normal,i,b');`.replace(/&/g,"&")})));return f("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${P.width} ${P.height}`},...j,...k)}e.jsonToDOM=O;const R=(P,x)=>typeof x=="object"?`${P}="${Object.keys(x).map(k=>`${k}:${x[k]};`).join(" ")}"`:x==null||x===""?"":`${P}="${x}"`,T=({dom:P,nestLevel:x=0})=>{if(typeof P=="string")return P;if(!P)return"";const k=P.props,{innerHTML:M}=k,j=i(k,["innerHTML"]),B=" ".repeat(x);return`${B}<${P.type} ${Object.keys(j).map($=>R($,j[$])).join(" ")}>${M||`
|
|
284
|
+
`+P.children.map($=>T({dom:$,nestLevel:x+1})).join("")}${B}</${P.type}>
|
|
285
|
+
`};async function E({json:P,elementHook:x}){const k=await O({json:P,elementHook:x});return T({dom:k})}e.jsonToSVG=E})(OS);var Kg={},w_;function PS(){return w_||(w_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const t=wi,r=Zp,n=Sc(),i=S2(),a=Sc(),o=Zs;e.Page=t.types.model("Page",{id:t.types.identifier,children:t.types.array(t.types.late(()=>n.ElementTypes)),width:t.types.optional(t.types.union(t.types.number,t.types.literal("auto")),"auto"),height:t.types.optional(t.types.union(t.types.number,t.types.literal("auto")),"auto"),background:"white",bleed:0,custom:t.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1}).postProcessSnapshot(l=>{const u=Object.assign({},l),f={};for(var g in u)g[0]!=="_"&&(f[g]=l[g]);return f}).views(l=>({get store(){return(0,t.getParentOfType)(l,i.Store)},get startTime(){let u=0;for(const f of l.store.pages){if(f.id===l.id)return u;u+=f.duration}return u},get _exportingOrRendering(){return l._exporting||l._rendering}})).views(l=>({get computedWidth(){return l.width==="auto"?l.store.width:l.width},get computedHeight(){return l.height==="auto"?l.store.height:l.height}})).actions(l=>({toJSON:()=>JSON.parse(JSON.stringify((0,t.getSnapshot)(l))),_forEachElementUp(u,f){const g=u.map(S=>({id:S,index:l.children.findIndex(_=>_.id===S)}));g.sort((S,_)=>_.index-S.index);for(const{index:S}of g){if(S==-1)continue;const _=S<l.children.length-1&&l.children[S+1],h=u.indexOf(_==null?void 0:_.id)>=0;S===l.children.length-1||h||f(S)}},_forEachElementDown(u,f){const g=u.map(S=>({id:S,index:l.children.findIndex(_=>_.id===S)}));g.sort((S,_)=>S.index-_.index);for(const{index:S}of g){if(S==-1)continue;const _=S>0&&l.children[S-1],h=u.indexOf(_==null?void 0:_.id)>=0;S===0||h||f(S)}return!1}})).actions(l=>({clone(u={}){const f=l.toJSON();f.children.forEach(h=>{h.id=(0,r.nanoid)(10),(0,a.forEveryChild)(h,w=>{w.id=(0,r.nanoid)(10)})});const g=Object.assign(Object.assign(Object.assign({},f),{id:(0,r.nanoid)(10)}),u),S=l.store.addPage(g),_=l.store.pages.indexOf(l);S.setZIndex(_+1),S.select()},setZIndex(u){l.store.setPageZIndex(l.id,u)},set(u){Object.assign(l,u)},select(){l.store.selectPage(l.id)},addElement(u,{skipSelect:f=!1}={}){const g=a.TYPES_MAP[u.type];if(!g)return void console.error("Can not find model with type "+u.type);u.children&&u.children.forEach(_=>{_.id=(0,r.nanoid)(10)});const S=g.create(Object.assign({id:(0,r.nanoid)(10)},u));return l.children.push(S),S.selectable&&!f&&l.store.selectElements([S.id]),S},canMoveElementsUp(u){let f=!1;return l._forEachElementUp(u,()=>{f=f||!0}),f},moveElementsUp(u){l._forEachElementUp(u,f=>{const g=l.children[f];(0,t.detach)(g),l.children.splice(f+1,0,g)})},canMoveElementsTop(u){return this.canMoveElementsUp(u)},moveElementsTop(u){const f=[],g=[];l.children.forEach(S=>{u.indexOf(S.id)>=0?f.push(S):g.push(S)}),l.children.replace(g.concat(f))},canMoveElementsDown(u){let f=!1;return l._forEachElementDown(u,()=>{f=f||!0}),f},moveElementsDown(u){l._forEachElementDown(u,f=>{const g=l.children[f];(0,t.detach)(g),l.children.splice(f-1,0,g)})},canMoveElementsBottom(u){return this.canMoveElementsDown(u)},moveElementsBottom(u){const f=[],g=[];l.children.forEach(S=>{u.indexOf(S.id)>=0?f.push(S):g.push(S)}),l.children.replace(f.concat(g))},setElementZIndex(u,f){const g=l.children.find(S=>S.id===u);g&&((0,t.detach)(g),l.children.remove(g),l.children.splice(f,0,g))},setSize({width:u,height:f,useMagic:g,softChange:S}){if(g){const _=[],h=j=>j.type==="image"&&j.x<1&&j.y<1&&j.width>=l.computedWidth-2&&j.height>=l.computedHeight-2;(0,a.forEveryChild)(l,j=>{j.type!=="group"&&(h(j)||_.push(j))});const w=_.length?(0,o.getTotalClientRect)(_):{x:0,y:0,width:l.computedWidth,height:l.computedHeight},m=0,y=Math.max(0,Math.min(w.x,l.computedWidth-w.x-w.width)),p=l.computedWidth*m,v=Math.max(0,y-p),d=Math.max(0,Math.min(w.y,l.computedHeight-w.y-w.height)),b=l.computedHeight*m,O=Math.max(0,d-b),R=l.computedWidth-2*v,T=l.computedHeight-2*O,E=u/R,P=f/T,x=Math.min(E,P),k=(u-R*x)/2-v*x,M=(f-T*x)/2-O*x;(0,a.forEveryChild)(l,j=>{j.type!=="group"&&(h(j)?j.set({x:j.x*x,y:j.y*x,width:j.width*E,height:j.height*P,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(j.set({x:k+j.x*x,y:M+j.y*x,width:j.width*x,height:j.height*x}),j.type==="text"?j.set({fontSize:j.fontSize*x}):j.type==="figure"&&j.set({strokeWidth:j.strokeWidth*x})))})}S||(l.width=u),S||(l.height=f)}})).actions(l=>({moveElementUp(u){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),l.moveElementsUp([u])},moveElementDown(u){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),l.moveElementsDown([u])},moveElementTop(u){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),l.moveElementsTop([u])},moveElementBottom(u){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),l.moveElementsBottom([u])},play(){l.store.play({startTime:l.startTime,endTime:l.startTime+l.duration})}}))}(Kg)),Kg}var S_;function S2(){return S_||(S_=1,function(e){var t=ye&&ye.__createBinding||(Object.create?function(E,P,x,k){k===void 0&&(k=x);var M=Object.getOwnPropertyDescriptor(P,x);M&&!("get"in M?!P.__esModule:M.writable||M.configurable)||(M={enumerable:!0,get:function(){return P[x]}}),Object.defineProperty(E,k,M)}:function(E,P,x,k){k===void 0&&(k=x),E[k]=P[x]}),r=ye&&ye.__setModuleDefault||(Object.create?function(E,P){Object.defineProperty(E,"default",{enumerable:!0,value:P})}:function(E,P){E.default=P}),n=ye&&ye.__importStar||function(E){if(E&&E.__esModule)return E;var P={};if(E!=null)for(var x in E)x!=="default"&&Object.prototype.hasOwnProperty.call(E,x)&&t(P,E,x);return r(P,E),P},i=ye&&ye.__rest||function(E,P){var x={};for(var k in E)Object.prototype.hasOwnProperty.call(E,k)&&P.indexOf(k)<0&&(x[k]=E[k]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function"){var M=0;for(k=Object.getOwnPropertySymbols(E);M<k.length;M++)P.indexOf(k[M])<0&&Object.prototype.propertyIsEnumerable.call(E,k[M])&&(x[k[M]]=E[k[M]])}return x},a=ye&&ye.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(e,"__esModule",{value:!0}),e.createStore=e.Store=e.Font=void 0;const o=wi,l=yS,u=Zp,f=a(_i),g=bS,S=_S,_=wS,h=_2(),w=n(Ws),m=Hi,y=Xp,p=w2,v=SS,d=ES,b=OS,O=PS(),R=Sc();function T({key:E,showCredit:P}={key:"",showCredit:!1}){const x=e.Store.create();return(0,h.validateKey)(E,P),x}(0,o.setLivelinessChecking)("ignore"),e.Font=o.types.model("Font",{fontFamily:o.types.string,url:o.types.optional(o.types.string,""),styles:o.types.frozen()}).preProcessSnapshot(E=>Object.assign(Object.assign({},E),{fontFamily:E.fontFamily||E.name})),e.Store=o.types.model("Store",{role:"",pages:o.types.array(O.Page),fonts:o.types.array(e.Font),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:o.types.frozen(),selectedElementsIds:o.types.array(o.types.string),animatedElementsIds:o.types.array(o.types.string),history:o.types.optional(l.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:2,_activePageId:""}).views(E=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),E.bleedVisible},get selectedElements(){return E.selectedElementsIds.map(P=>{for(const x of E.pages)for(const k of x.children)if(k.id===P)return k}).filter(P=>!!P)},get children(){return E.pages},get selectedShapes(){const P=[];return(0,R.forEveryChild)({children:E.selectedElements},x=>{x.type!=="group"&&P.push(x)}),P},get activePage(){return E.pages.slice().find(P=>P.id===E._activePageId)||(E.pages.length?E.pages[0]:null)},get duration(){let P=0;return E.pages.forEach(x=>{P+=x.duration}),P},get _hasCroppedImages(){return E.find(P=>P.type==="image"&&P._cropModeEnabled)},find(P){let x;return(0,R.forEveryChild)({children:E.pages},k=>{if(!x&&P(k))return x=k,!0}),x},getElementById:P=>E.find(x=>x.id===P)})).actions(E=>{let P=0,x=null,k=!1;return{afterCreate(){E.history.canUndo},setCurrentTime(M){E.currentTime=M},play({animatedElementsIds:M=[],startTime:j=0,currentTime:B=0,endTime:$=E.duration,repeat:Z=!1}={}){B&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),j=B),E.animatedElementsIds=(0,o.cast)(M),E.currentTime=j,E.isPlaying=!0,P=Date.now(),x=$,k=Z,requestAnimationFrame(E.seek)},checkActivePage(){let M=0;for(const j of E.pages){if(E.currentTime>=j.startTime&&E.currentTime<j.startTime+j.duration){E.selectPage(j.id);break}M+=j.duration}},seek(){if(!E.isPlaying)return;const M=Date.now(),j=M-P;P=M,E.currentTime+=j,E.checkActivePage();const B=x||E.duration;E.isPlaying&&E.currentTime<B?requestAnimationFrame(E.seek):E.isPlaying&&k?(E.currentTime=0,requestAnimationFrame(E.seek)):E.stop()},stop(){E.isPlaying=!1,E.currentTime=0,E.animatedElementsIds=(0,o.cast)([]),E.checkActivePage()}}}).actions(E=>({set(P){Object.assign(E,P)},setUnit({unit:P,dpi:x}){E.unit=P||E.unit,E.dpi=x||E.dpi},setRole(P){E.role=P},addPage(P){const x=O.Page.create(Object.assign({id:(0,u.nanoid)(10)},P));return E.pages.push(x),E._activePageId=x.id,x},selectPage(P){E._activePageId=P},selectElements(P){const x=P.map(k=>E.getElementById(k)).sort((k,M)=>k.page.children.indexOf(k)-k.page.children.indexOf(M)).filter(k=>!!k).map(k=>k.id);E.selectedElementsIds=(0,o.cast)(x)},toggleBleed(P){E.bleedVisible=P??!E.bleedVisible},toggleRulers(P){E.rulesVisible=P??!E.rulesVisible},openSidePanel(P){E.openedSidePanel!==P&&(E.previousOpenedSidePanel=E.openedSidePanel,E.openedSidePanel=P)},setScale(P){E.scale=P},_setScaleToFit(P){E.scaleToFit=P},setElementsPixelRatio(P){E._elementsPixelRatio=P},setSize(P,x,k){E.pages.forEach(M=>{M.setSize({width:P,height:x,useMagic:k,softChange:!0})}),E.width=P,E.height=x},setPageZIndex(P,x){const k=E.pages.find(M=>M.id===P);k&&((0,o.detach)(k),E.pages.remove(k),E.pages.splice(x,0,k))},deletePages(P){const x=E.pages.indexOf(E.activePage);P.forEach(j=>{const B=E.pages.find($=>$.id===j);(0,o.destroy)(B)});const k=Math.min(E.pages.length-1,x),M=E.pages[k];M&&(E._activePageId=M.id),E.selectedElementsIds=(0,o.cast)(E.selectedElementsIds.filter(j=>E.getElementById(j)))},groupElements(P){const x=P.map(j=>E.getElementById(j));x.forEach(j=>{j&&(0,o.detach)(j)});const k=E.activePage,M={id:(0,u.nanoid)(10),children:x,type:"group"};return k.children.push(M),E.selectedElementsIds=(0,o.cast)([M.id]),M},ungroupElements(P){const x=P.map(M=>E.getElementById(M)),k=[];x.forEach(M=>{if(M&&M.type==="group"){const j=M.page,B=j.children.indexOf(M);M.children.forEach($=>{k.push($.id)}),M.children.forEach($=>{(0,o.detach)($),j.children.push($)}),j.children.splice(B,1)}}),E.selectedElementsIds=(0,o.cast)(k)},deleteElements(P){const x=[];E.find(k=>(P.includes(k.id)&&x.push(k),!1)),x.forEach(k=>{(0,o.destroy)(k)}),E.selectedElementsIds=(0,o.cast)(E.selectedElementsIds.filter(k=>E.getElementById(k)))},on(P,x){if(P==="change"){let k=E.toJSON();return(0,o.onSnapshot)(E,M=>{const j=E.toJSON();!(0,p.deepEqual)(k,j)&&(k=j,x(j))})}},async _toCanvas({pixelRatio:P,ignoreBackground:x,pageId:k,mimeType:M,includeBleed:j,_skipTimeout:B}={}){var $;const Z=P||1;k=k||(($=E.pages[0])===null||$===void 0?void 0:$.id);const K=E.pages.find(ie=>ie.id===k);if(!K)throw new Error(`No page for export with id ${k}`);K==null||K.set({_exporting:!0});const D=await(0,v.waitTillAvailable)(()=>f.default.stages.find(ie=>ie.getAttr("pageId")===k));if(!D)throw new Error(`Export is failed. Can not find stage for page ${k}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const q=!!D.findOne(".page-container"),A=E._elementsPixelRatio;Z>E._elementsPixelRatio&&E.setElementsPixelRatio(Z),await E.waitLoading({_skipTimeout:B});const L=D.findOne(".page-container");if(!L)throw E.setElementsPixelRatio(A),new Error(`Export is failed. Can't find page container. ${q}`);D.find("Transformer").forEach(ie=>ie.visible(!1)),L.find(".page-background").forEach(ie=>ie.shadowEnabled(!1)),L.find(".page-background").forEach(ie=>ie.strokeEnabled(!1)),L.find(".highlighter").forEach(ie=>ie.visible(!1));const z=L.findOne(".page-background-group"),I=z.clip();z.clip({x:null,y:null,width:null,height:null});const H=L.findOne(".elements-container"),W=H.clip();H.clip({x:null,y:null,width:null,height:null});const V=L.find(ie=>ie.getAttr("hideInExport"));V.forEach(ie=>{ie.setAttr("oldVisible",ie.visible()),ie.hide()});const U=L.find(ie=>!ie.visible()&&ie.getAttr("editModeEnabled"));U.forEach(ie=>{ie.setAttr("oldVisible",ie.visible()),ie.show()}),x&&L.find(".page-background").forEach(ie=>ie.hide());const Y=j?K.bleed:0;let X=Y;!E.bleedVisible&&j||(E.bleedVisible||j?E.bleedVisible&&j?X=0:E.bleedVisible&&!j&&(X=-K.bleed):X=0);const Q=document.createElement("canvas");Q.width=Math.round((K.computedWidth+2*Y)*Z),Q.height=Math.round((K.computedHeight+2*Y)*Z);const te=Q.getContext("2d");M==="image/jpeg"&&(te.fillStyle="white",te.fillRect(0,0,Q.width,Q.height));const ee=L.scale();L.scale({x:1,y:1});const ne=L.toCanvas({x:L.x()-X,y:L.y()-X,width:K.computedWidth+2*Y,height:K.computedHeight+2*Y,pixelRatio:Z});return L.scale(ee),te.drawImage(ne,0,0,Q.width,Q.height),f.default.Util.releaseCanvas(ne),x&&L.find(".page-background").forEach(ie=>ie.show()),V.forEach(ie=>{ie.visible(ie.getAttr("oldVisible"))}),U.forEach(ie=>{ie.visible(ie.getAttr("oldVisible"))}),L.find(".page-background").forEach(ie=>ie.shadowEnabled(!0)),L.find(".page-background").forEach(ie=>ie.strokeEnabled(!0)),D.find("Transformer").forEach(ie=>ie.visible(!0)),L.find(".highlighter").forEach(ie=>ie.visible(!0)),z.clip(I),H.clip(W),E.setElementsPixelRatio(A),K==null||K.set({_exporting:!1}),Q},async toDataURL(P={}){var{mimeType:x,quality:k}=P,M=i(P,["mimeType","quality"]);const j=await E._toCanvas(Object.assign({mimeType:x},M)),B=j.toDataURL(x,k);return f.default.Util.releaseCanvas(j),B},async toBlob(P={}){var{mimeType:x,quality:k}=P,M=i(P,["mimeType","quality"]);const j=await E._toCanvas(Object.assign({mimeType:x},M)),B=new Promise($=>{j.toBlob($,x,k)});return f.default.Util.releaseCanvas(j),B},async saveAsImage(P={}){var{fileName:x}=P,k=i(P,["fileName"]);const M=k.mimeType||"image/png",j=M.split("/")[1];(0,g.downloadFile)(await E.toDataURL(k),x||"polotno."+j,M)},async _toPDF(P){const x=P.dpi||E.dpi,k=P.parallel||1,M=P.unit||(E.unit==="px"?"mm":E.unit),j=P.pixelRatio||1,B=P.pageIds||E.pages.map(W=>W.id),$=E.pages.filter(W=>B.includes(W.id)),Z=await(0,S.getJsPDF)(),K=W=>(0,y.pxToUnit)({px:W,unit:M,dpi:x}),D=K(P.cropMarkSize||0),q=$[0]||{},A=P.includeBleed?q.bleed:0,L=K(q.computedWidth+2*A)+2*D,z=K(q.computedHeight+2*A)+2*D;var I=new Z({unit:M,orientation:L>z?"landscape":"portrait",format:[L,z],compress:!0,putOnlyUsedFonts:!0});I.deletePage(1);const H=((W,V)=>{for(var U=[],Y=0;Y<W.length;Y+=V)U.push(W.slice(Y,Y+V));return U})($,k);for(const W of H){const V=W.map(async U=>{const Y=P.includeBleed?U.bleed:0,X=K(U.computedWidth+2*Y)+2*D,Q=K(U.computedHeight+2*Y)+2*D;let te=0,ee=j;for(;te<10;){te+=1,te===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const ne=await E.toDataURL(Object.assign(Object.assign({},P),{pageId:U.id,pixelRatio:ee}));if(ne.length>20)return{url:ne,width:X,height:Q};ee*=.8}});(await Promise.all(V)).forEach(({url:U,width:Y,height:X})=>{I.addPage([Y,X],Y>X?"landscape":"portrait"),D&&(I.setLineWidth(K(1)),I.line(2*D,0,2*D,D),I.line(0,2*D,D,2*D),I.line(Y-2*D,0,Y-2*D,D),I.line(Y,2*D,Y-D,2*D),I.line(0,X-2*D,D,X-2*D),I.line(2*D,X,2*D,X-D),I.line(Y,X-2*D,Y-D,X-2*D),I.line(Y-2*D,X,Y-2*D,X-D)),I.addImage(U,D,D,Y-2*D,X-2*D,void 0,"FAST")})}return I},toPDFDataURL:async P=>(await E._toPDF(Object.assign({mimeType:"image/jpeg"},P))).output("datauristring"),async toGIFDataURL(P={}){const x=P.pixelRatio||1,k=await(0,_.createGIF)({width:E.width*x,height:E.height*x}),M=1e3/(P.fps||10),j=E.duration/M;for(let B=0;B<j-1;B++){const $=B*M||1;E.setCurrentTime($);let Z=0,K="";for(const q of E.pages)if(Z+=q.duration,q.set({_rendering:Z>$}),Z>$){K=q.id;break}const D=await E._toCanvas({pixelRatio:x,pageId:K,_skipTimeout:!0});k.addFrame(D.getContext("2d"),{delay:M,copy:!0})}for(const B of E.pages)B.set({_rendering:!1});return E.stop(),k.render(),new Promise(B=>{k.on("finished",function($){(function(Z,K){var D=new FileReader;D.onload=function(q){K(q.target.result)},D.readAsDataURL(Z)})($,B)})})},async saveAsGIF(P={}){var{fileName:x}=P,k=i(P,["fileName"]);const M=await E.toGIFDataURL(k);(0,g.downloadFile)(M,x||"polotno.gif")},async toHTML({elementHook:P}={elementHook:void 0}){const x=E.toJSON();return(0,d.jsonToHTML)({json:x,elementHook:P})},async saveAsHTML({fileName:P}={}){const x=await E.toHTML(),k="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(x)));(0,g.downloadFile)(k,P||"polotno.html")},async toSVG({elementHook:P}={elementHook:void 0}){const x=E.toJSON();return(0,b.jsonToSVG)({json:x,elementHook:P})},async saveAsSVG({fileName:P,elementHook:x}={}){const k=await E.toSVG({elementHook:x}),M="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(k)));(0,g.downloadFile)(M,P||"polotno.svg")},async saveAsPDF(P={}){var{fileName:x}=P,k=i(P,["fileName"]);(await E._toPDF(Object.assign({mimeType:"image/jpeg"},k))).save(x||"polotno.pdf")},async waitLoading({_skipTimeout:P=!1}={}){P||await new Promise(x=>setTimeout(x,50)),await(0,m.whenLoaded)()},toJSON:()=>({width:E.width,height:E.height,fonts:(0,o.getSnapshot)(E.fonts),pages:(0,o.getSnapshot)(E.pages),unit:E.unit,dpi:E.dpi,custom:E.custom}),loadJSON(P,x=!1){var k;const M=Object.assign({},P),j=E.pages.indexOf(E.activePage);let B=(k=M.pages[j]||M.pages[0])===null||k===void 0?void 0:k.id;M._activePageId=B;const $=Object.assign({},(0,o.getSnapshot)(E));Object.assign($,M),$.history=x?E.history.toJSON():{history:[],undoIdx:-1},(0,o.applySnapshot)(E,$)},clear({keepHistory:P=!1}={}){const x=E.pages.map(k=>k.id);E.deletePages(x),P||E.history.clear()},addFont(P){E.removeFont(P.fontFamily),E.fonts.push(P),E.loadFont(P.fontFamily)},removeFont(P){E.fonts.filter(x=>x.fontFamily===P).forEach(x=>(0,o.destroy)(x))},async loadFont(P){const x=E.fonts.find(k=>k.fontFamily===P)||w.globalFonts.find(k=>k.fontFamily===P);x?w.injectCustomFont(x):w.injectGoogleFont(P),await w.loadFont(P)},validate:P=>e.Store.validate(P,[{path:"",type:e.Store}]).map(x=>({path:"store"+x.context.map(k=>k.path).join("."),message:x.message}))})),e.createStore=T,e.default=T}(Wg)),Wg}var E_;function xS(){return E_||(E_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const t=wi,r=Zp,n=S2(),i=PS(),a=Sc();e.Node=t.types.model("Node",{id:t.types.identifier,type:"none",name:"",opacity:1,custom:t.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(o=>{for(var l in o)o[l]===null&&(o[l]=void 0);return o}).postProcessSnapshot(o=>{const l=Object.assign({},o),u={};for(var f in l)f[0]!=="_"&&(u[f]=o[f]);return u}).views(o=>({get locked(){return!(o.draggable||o.contentEditable||o.styleEditable||o.resizable)},get page(){return(0,t.getParentOfType)(o,i.Page)},get store(){return(0,t.getParentOfType)(o,n.Store)},get top(){let l=o;for(;;){if(!(0,t.hasParentOfType)(l,a.GroupElement))return l;l=(0,t.getParentOfType)(l,a.GroupElement)}},get parent(){return(0,t.hasParentOfType)(o,a.GroupElement)?(0,t.getParentOfType)(o,a.GroupElement):(0,t.hasParentOfType)(o,i.Page)?(0,t.getParentOfType)(o,i.Page):(0,t.hasParentOfType)(o,n.Store)?(0,t.getParentOfType)(o,n.Store):null},get zIndex(){return o.parent.children.indexOf(o)}})).actions(o=>({toJSON:()=>Object.assign({},(0,t.getSnapshot)(o))})).actions(o=>({clone(l={},{skipSelect:u=!1}={}){const f=JSON.parse(JSON.stringify(o.toJSON()));return l.id=l.id||(0,r.nanoid)(10),(0,a.forEveryChild)(f,g=>{g.id=(0,r.nanoid)(10)}),Object.assign(f,l),o.page.addElement(f,{skipSelect:u})},set(l){Object.assign(o,l)},moveUp(){o.page.moveElementsUp([o.id])},moveTop(){o.page.moveElementsTop([o.id])},moveDown(){o.page.moveElementsDown([o.id])},moveBottom(){o.page.moveElementsBottom([o.id])},setZIndex(l){o.parent.setElementZIndex(o.id,l)},beforeDestroy(){}}))}(qg)),qg}var Yg={},CS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const t=Zs,r={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}};e.animations={fade:({dTime:a,element:o,animation:l})=>{const u=a/l.duration;return l.type==="enter"?{opacity:u*o.opacity}:{opacity:(1-u)*o.opacity}},rotate:({dTime:a,element:o,animation:l})=>{const u=a/l.duration*360;return(0,t.rotateAroundCenter)({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation},u)},blink:({dTime:a,element:o,animation:l})=>{const u=l.duration,f=a%u/(u/2),g=f<=1?f:2-f;return{opacity:o.opacity*g}},bounce:({dTime:a,element:o,animation:l})=>{const u=l.duration,f=u/2,g={},S={x:o.x+o.width/3,y:o.y+o.height/3,width:o.width/3,height:o.height/3,fontSize:o.fontSize/3},_={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize},h=a%u/f,w=h<=1?h:2-h;for(let m in S){const y=S[m],p=_[m]-y;g[m]=y+w*p}return g},move:({dTime:a,element:o,animation:l})=>{const u=r[l.data.direction]||r.right,f={};for(var g in u.from){let S=u.from[g],_=u.to[g];l.type==="exit"&&(S=u.to[g],_=-u.from[g]);const h=o[g]+S,w=o[g]+_-h;f[g]=h+a/l.duration*w}return f},zoom:({dTime:a,element:o,animation:l})=>{const u={},f={x:o.x+o.width/3,y:o.y+o.height/3,width:o.width/3,height:o.height/3,fontSize:o.fontSize/3},g={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize};for(var S in f){let _=f[S],h=g[S];if(l.type==="exit"){const m=_;_=h,h=m}const w=h-_;u[S]=_+a/l.duration*w}return u}};const n=({element:a,dTime:o,animation:l})=>{const u=e.animations[l.name];return u?u({element:a,dTime:o,animation:l}):(console.error("Can not find animation type: "+l.name),{})};e.animate=n;const i=(a,o)=>{};e.registerAnimation=i})(CS);var O_;function Qs(){return O_||(O_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.Animation=void 0;const t=wi,r=CS,n=Wi,i=xS();e.Animation=t.types.model("Animation",{delay:0,duration:500,enabled:!0,type:t.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:t.types.frozen({})}),e.Shape=i.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:t.types.array(e.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(a=>{const o=Object.assign(Object.assign({},a),{x:a.x||0,y:a.y||0});return"width"in a&&(o.width=o.width||1),"height"in a&&(o.height=o.height||1),a.locked&&(o.draggable=!1,o.contentEditable=!1,o.styleEditable=!1,o.resizable=!1,o.removable=!1),o}).views(a=>{const o=(0,n.observable)({x:a.x,y:a.y,width:a.width,height:a.height,rotation:a.rotation,opacity:a.opacity,color:a.color,fontSize:a.fontSize}),l=(0,n.action)(u=>{Object.assign(o,u)});return{get a(){const{currentTime:u}=a.store;if(l({x:a.x,y:a.y,width:a.width,height:a.height,rotation:a.rotation,opacity:a.opacity,color:a.color,fontSize:a.fontSize}),u===0)return o;const f=u-a.page.startTime;if(f>a.page.duration||f<0)return o;const g=a.store.animatedElementsIds;if(g.length&&!g.includes(a.id))return o;const S=a.animations.find(w=>w.type==="enter");if(S!=null&&S.enabled&&f<S.delay&&l({opacity:0}),S!=null&&S.enabled&&f>=S.delay&&f<=S.delay+S.duration){const w=f-S.delay,m=(0,r.animate)({element:a,animation:S,dTime:w});l(m)}const _=a.animations.find(w=>w.type==="exit");if(_!=null&&_.enabled&&f>=a.page.duration-_.duration-_.delay&&f<=a.page.duration-_.delay){const w=f-(a.page.duration-_.duration),m=(0,r.animate)({element:a,animation:_,dTime:w});l(m)}const h=a.animations.find(w=>w.type==="loop");if(h!=null&&h.enabled){const w=f,m=(0,r.animate)({element:a,animation:h,dTime:w});l(m)}return o},animated:u=>a.a[u]}}).actions(a=>({setAnimation(o,l){const u=a.animations.find(f=>f.type===o);u?Object.assign(u,l):a.animations.push(Object.assign({type:o},l))}}))}(Yg)),Yg}var Xg={},P_;function cj(){return P_||(P_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const t=wi,r=Qs();e.TextElement=r.Shape.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:t.types.optional(t.types.union(t.types.number,t.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(n=>Object.assign({},n)).actions(n=>({toggleEditMode(i){n._editModeEnabled=i??!n._editModeEnabled,n._editModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()}}))}(Xg)),Xg}var Zg={},x_;function TS(){return x_||(x_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const t=Qs();e.ImageElement=t.Shape.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,_cropModeEnabled:!1}).actions(r=>({toggleCropMode(n){r._cropModeEnabled=n??!r._cropModeEnabled,r._cropModeEnabled?r.store.history.startTransaction():r.store.history.endTransaction()},beforeDestroy(){r._cropModeEnabled&&r.store.history.endTransaction()}}))}(Zg)),Zg}var Qg={},C_;function fj(){return C_||(C_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const t=TS();e.VideoElement=t.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1})}(Qg)),Qg}var Jg={},T_;function dj(){return T_||(T_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const t=wi,r=Qs();e.LineElement=r.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:t.types.array(t.types.number),startHead:"",endHead:""}).actions(n=>({}))}(Jg)),Jg}var ev={},k_;function hj(){return k_||(k_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const t=wi,r=Qs();e.SVGElement=r.Shape.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:t.types.map(t.types.string)}).preProcessSnapshot(n=>Object.assign(Object.assign({},n),{src:n.src||n.svgSource})).actions(n=>({replaceColor(i,a){n.colorsReplace.set(i,a)}}))}(ev)),ev}var tv={},A_;function pj(){return A_||(A_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=wi,r=Qs();e.FigureElement=r.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:t.types.array(t.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(tv)),tv}var R_;function Sc(){return R_||(R_=1,function(e){var t=ye&&ye.__rest||function(y,p){var v={};for(var d in y)Object.prototype.hasOwnProperty.call(y,d)&&p.indexOf(d)<0&&(v[d]=y[d]);if(y!=null&&typeof Object.getOwnPropertySymbols=="function"){var b=0;for(d=Object.getOwnPropertySymbols(y);b<d.length;b++)p.indexOf(d[b])<0&&Object.prototype.propertyIsEnumerable.call(y,d[b])&&(v[d[b]]=y[d[b]])}return v};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeModel=e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0;const r=wi,n=Zp,i=xS(),a=Qs(),o=cj(),l=TS(),u=fj(),f=dj(),g=hj(),S=pj(),_=(y,p)=>{if(y.children)for(const v of y.children){if(p(v)===!0)break;(0,e.forEveryChild)(v,p)}};e.forEveryChild=_;const h=[...new Array(20)].map((y,p)=>r.types.late(()=>w[p]));e.ElementTypes=r.types.union({dispatcher:y=>{const p=e.TYPES_MAP[y.type];if(!p)throw new Error(`Unknown element type: "${y.type}"`);return p}},g.SVGElement,o.TextElement,l.ImageElement,f.LineElement,u.VideoElement,S.FigureElement,r.types.late(()=>e.GroupElement),...h),e.GroupElement=i.Node.named("Group").props({type:"group",children:r.types.array(e.ElementTypes)}).views(y=>({get draggable(){let p=!0;return(0,e.forEveryChild)(y,v=>{v.draggable||(p=!1)}),p},get resizable(){let p=!0;return(0,e.forEveryChild)(y,v=>{v.resizable||(p=!1)}),p},get contentEditable(){let p=!0;return(0,e.forEveryChild)(y,v=>{v.contentEditable||(p=!1)}),p},get styleEditable(){let p=!0;return(0,e.forEveryChild)(y,v=>{v.styleEditable||(p=!1)}),p},get locked(){let p=!0;return(0,e.forEveryChild)(y,v=>{v.locked||(p=!1)}),p}})).actions(y=>({set(p){var{draggable:v,contentEditable:d,styleEditable:b,resizable:O}=p,R=t(p,["draggable","contentEditable","styleEditable","resizable"]);v!==void 0&&(0,e.forEveryChild)(y,T=>{T.set({draggable:v})}),d!==void 0&&(0,e.forEveryChild)(y,T=>{T.set({contentEditable:d})}),b!==void 0&&(0,e.forEveryChild)(y,T=>{T.set({styleEditable:b})}),O!==void 0&&(0,e.forEveryChild)(y,T=>{T.set({resizable:O})}),Object.assign(y,R)},addElement(p,{skipSelect:v=!1}={}){const d=e.TYPES_MAP[p.type];if(!d)return void console.error("Can not find model with type "+p.type);p.children&&p.children.forEach(O=>{O.id=(0,n.nanoid)(10)});const b=d.create(Object.assign({id:(0,n.nanoid)(10)},p));return y.children.push(b),b.selectable&&!v&&y.store.selectElements([b.id]),b},setElementZIndex(p,v){const d=y.children.find(b=>b.id===p);d&&((0,r.detach)(d),y.children.remove(d),y.children.splice(v,0,d))}}));const w=[];function m(y,p){const v=y.type;if(!v)throw new Error('You must pass "type" attribute to custom model.');let d=a.Shape.named(v).props(y);p&&(d=p(d)),e.TYPES_MAP[v]=d,w.push(d)}e.TYPES_MAP={svg:g.SVGElement,text:o.TextElement,image:l.ImageElement,group:e.GroupElement,line:f.LineElement,video:u.VideoElement,figure:S.FigureElement},e.registerShapeModel=m}(Vg)),Vg}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=void 0;const t=Sc();let r=[],n="";const i="polotno_clipboard",a=u=>{r=JSON.parse(JSON.stringify(u));try{localStorage.setItem(i,JSON.stringify(u))}catch{}},o=()=>{try{const u=localStorage.getItem(i);if(u)return JSON.parse(u)}catch{}return r};function l(u,f){var g,S,_,h,w,m,y,p;if(((g=document.activeElement)===null||g===void 0?void 0:g.tagName)==="INPUT"||((S=document.activeElement)===null||S===void 0?void 0:S.tagName)==="TEXTAREA"||((_=document.activeElement)===null||_===void 0?void 0:_.contentEditable)==="true")return;const v=f.selectedElements.filter(R=>R.removable),d=v.map(R=>R.id);u.keyCode!==46&&u.keyCode!==8||f.deleteElements(d);const b=u.ctrlKey||u.metaKey,O=u.shiftKey;if(b&&!O&&u.code==="KeyZ"&&(u.preventDefault(),f.history.undo()),b&&O&&u.code==="KeyZ"&&(u.preventDefault(),f.history.redo()),b&&u.code==="KeyA"){u.preventDefault();const R=(h=f.activePage)===null||h===void 0?void 0:h.children.filter(E=>E.selectable),T=(R==null?void 0:R.map(E=>E.id))||[];f.selectElements(T)}if(b&&u.code==="KeyC"&&(u.preventDefault(),n=(w=f.activePage)===null||w===void 0?void 0:w.id,a(f.selectedElements.map(R=>R.toJSON()))),b&&u.code==="KeyX"&&(u.preventDefault(),n=(m=f.activePage)===null||m===void 0?void 0:m.id,a(f.selectedElements.map(R=>R.toJSON())),f.deleteElements(v)),b&&u.code==="KeyV"){u.preventDefault();let R=0;n===((y=f.activePage)===null||y===void 0?void 0:y.id)&&(R=f.width/20),n=(p=f.activePage)===null||p===void 0?void 0:p.id,f.history.transaction(()=>{const T=[],E=o();(0,t.forEveryChild)({children:E},P=>{delete P.id,P.type!=="group"&&(P.x+=R,P.y+=R)}),E.forEach(P=>{var x;const k=(x=f.activePage)===null||x===void 0?void 0:x.addElement(P);k&&T.push(k.id)}),a(E),f.selectElements(T)})}u.code==="ArrowDown"&&(u.preventDefault(),f.selectedElements.forEach(R=>{R.set({y:R.y+1})})),u.code==="ArrowUp"&&(u.preventDefault(),f.selectedElements.forEach(R=>{R.set({y:R.y-1})})),u.code==="ArrowLeft"&&(u.preventDefault(),f.selectedElements.forEach(R=>{R.set({x:R.x-1})})),u.code==="ArrowRight"&&(u.preventDefault(),f.selectedElements.forEach(R=>{R.set({x:R.x+1})}))}e.handleHotkey=l})(gS);var kS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const t=Wi,r=(0,t.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Upload Image",uploadTip:"Do you want to upload your own images?",background:"Background",resize:"Resize",layers:"Layers",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"}});function n(g,S){var _,h=S.split("."),w=g;for(_=0;_<h.length;++_){if(w[h[_]]==null)return;w=w[h[_]]}return w}const i=g=>g&&typeof g=="object";function a(g,S){Object.keys(S).forEach(_=>{const h=g[_],w=S[_];i(w)&&i(h)?a(h,w):g[_]=w})}function o(g,S,_=""){Object.keys(S).forEach(h=>{const w=S[h],m=_?`${_}.${h}`:h;i(w)?i(g[h])?o(g[h],w,m):console.warn(`Missing nested translation object at '${m}'`):g[h]===void 0&&console.warn(`Missing translation '${m}'`)})}e.setTranslations=(0,t.action)((g,{validate:S=!1}={})=>{S&&o(g,r),a(r,g)});const l=()=>(0,t.toJS)(r);e.getTranslations=l;const u={},f=g=>{const S=n(r,g);if(S!==void 0)return S;u[g]||(u[g]=!0,console.warn(`Missing translation '${g}'`));const _=g.split("."),h=_[_.length-1]||" ";return h.charAt(0).toUpperCase()+h.slice(1)};e.t=f})(kS);(function(e){var t=ye&&ye.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const r=t(et),n=yi,i=t(a9),a=pS,o=gS,l=kS,u=`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
286
|
+
Width or height of parent elements is equal 0.
|
|
287
|
+
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
288
|
+
For simpler debugging here is the log of the parent element:`,f=(h,w,m,y,p,v)=>{const d=r.default.useRef({width:w,height:m}),b=r.default.useRef({top:0,left:0}),O=r.default.useRef(!1),R=r.default.useRef(p.pages.length);O.current=R.current!==p.pages.length,R.current=p.pages.length,r.default.useEffect(()=>{const T=h.current,E=P=>{b.current={top:T.scrollTop,left:T.scrollLeft}};return T.addEventListener("scroll",E),()=>{T.removeEventListener("scroll",E)}},[]),r.default.useLayoutEffect(()=>{if(!h.current||O.current)return;const T=h.current,E=(b.current.left+T.offsetWidth/2)/d.current.width,P=(b.current.top+T.offsetHeight/2)/d.current.height;v.current=!0,T.scrollLeft=E*w-T.offsetWidth/2,T.scrollTop=P*m-T.offsetHeight/2,d.current={width:w,height:m}},[y,w,m])},g=(h,w,m,y,p)=>{const v=r.default.useRef(!1),d=r.default.useRef(null);r.default.useEffect(()=>{const O=h.current,R=()=>{p.current};return O.addEventListener("scroll",R),()=>{O.removeEventListener("scroll",R)}},[]);const b=m.pages.indexOf(m.activePage);return r.default.useLayoutEffect(()=>{if(!m.activePage||!h.current||v.current)return;const O=h.current,R=m.pages.indexOf(m.activePage)*w;Math.abs(R-O.scrollTop)>.5*w&&(p.current=!0,O.scrollTop=R)},[m.activePage,b]),{handleScroll:O=>{if(p.current)return void(p.current=!1);v.current=!0,clearTimeout(d.current),d.current=setTimeout(()=>{v.current=!1},300);const R=O.currentTarget.childNodes[0].offsetHeight,T=O.currentTarget.scrollTop,E=Math.floor((T+y.height/3)/R),P=m.pages[E];P&&P.select()}}},S=({store:h})=>r.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},r.default.createElement("p",null,(0,l.t)("workspace.noPages")),r.default.createElement("button",{onClick:()=>{h.addPage()}},(0,l.t)("workspace.addPage"))),_=({width:h,height:w,xPadding:m,yPadding:y,backgroundColor:p})=>r.default.createElement("div",{style:{width:h+"px",height:w+"px",backgroundColor:p,paddingLeft:m+"px",paddingRight:m+"px",paddingTop:y+"px",paddingBottom:y+"px"}},r.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:h,pageControlsEnabled:w,backgroundColor:m,pageBorderColor:y,activePageBorderColor:p,bleedColor:v,components:d,onKeyDown:b,paddingX:O,paddingY:R,altCloneEnabled:T=!0,visiblePagesOffset:E})=>{const P=O??20,x=R??55,[k,M]=r.default.useState({width:100,height:100}),j=r.default.useRef(k),B=r.default.useRef(null),$=r.default.useRef(null),Z=h.bleedVisible?Math.max(0,...h.pages.map(ee=>ee.bleed)):0,K=Math.max(...h.pages.map(ee=>ee.computedWidth)),D=Math.max(...h.pages.map(ee=>ee.computedHeight)),q=K+2*Z,A=D+2*Z,L=async({skipTimeout:ee}={skipTimeout:!1})=>{if(ee||await new Promise(ue=>setTimeout(ue,50)),B.current===null)return;const ne=B.current.getBoundingClientRect();ne.width!==0&&ne.height!==0||(console.warn(u),console.log(B.current));const ie=$.current.clientWidth||ne.width,le={width:ie,height:ne.height};(j.current.width!==le.width||j.current.height!==le.height)&&(M(le),j.current=le);const xe=(ie-2*P)/q,Fe=(ne.height-2*x)/A,oe=Math.max(Math.min(xe,Fe),.01);h.scaleToFit!==oe&&(h.setScale(oe),h._setScaleToFit(oe))};r.default.useLayoutEffect(()=>{L({skipTimeout:!0})},[]),r.default.useEffect(()=>{L()},[q,A]),r.default.useEffect(()=>{const ee=B.current;if(window.ResizeObserver){const ne=new ResizeObserver(()=>{L({skipTimeout:!0})});return ne.observe(ee),()=>ne.unobserve(ee)}{const ne=setInterval(()=>{L({skipTimeout:!0})},100);return()=>clearInterval(ne)}},[q,A]);const z=Math.max(P,(k.width-q*h.scale)/2),I=A*h.scale*h.pages.length,H=Math.max(x,(k.height-I)/h.pages.length/2);r.default.useEffect(()=>{const ee=ne=>{(b||o.handleHotkey)(ne,h)};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[]),r.default.useEffect(()=>{var ee;const ne=ie=>{if(ie.ctrlKey||ie.metaKey){ie.preventDefault();const oe=Math.max(3,h.scaleToFit),ue=Math.min(.1,h.scaleToFit),ve=(le=ie.deltaY<0?1.05*h.scale:h.scale/1.05,xe=ue,Fe=oe,Math.max(xe,Math.min(Fe,le)));h.setScale(ve)}else var le,xe,Fe};return(ee=$.current)===null||ee===void 0||ee.addEventListener("wheel",ne),()=>{var ie;return(ie=$.current)===null||ie===void 0?void 0:ie.removeEventListener("wheel",ne)}},[]);const W=r.default.useRef(!1);f($,q*h.scale+2*z,A*h.scale+2*H,h.scale,h,W);const{handleScroll:V}=g($,A*h.scale+2*H,h,k,W),U=k.width>=q*h.scale+2*z,Y=m||"rgba(232, 232, 232, 0.9)",X=h.pages.indexOf(h.activePage),Q=(d==null?void 0:d.NoPages)||S,te=E??Math.min(3,Math.max(1,Math.ceil(k.height/2/(A*h.scale))));return r.default.createElement("div",{ref:B,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:Y},tabIndex:0,className:"polotno-workspace-container"},r.default.createElement("div",{ref:$,onScroll:V,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:U?"hidden":"auto"},className:"polotno-workspace-inner"},h.pages.map((ee,ne)=>Math.abs(ne-X)<=te||ee._exportingOrRendering?r.default.createElement(i.default,{key:ee.id,page:ee,xPadding:z,yPadding:H,width:q*h.scale+2*z,height:A*h.scale+2*H,store:h,pageControlsEnabled:w,backColor:Y,pageBorderColor:y||"lightgrey",activePageBorderColor:p||"rgb(0, 161, 255)",altCloneEnabled:T,bleedColor:v||"rgba(255, 0, 0, 0.1)",components:d}):r.default.createElement(_,{key:ee.id,width:q*h.scale+2*z,height:A*h.scale+2*H,backgroundColor:Y,xPadding:z,yPadding:H})),h.rulesVisible&&r.default.createElement(a.TopRules,{store:h,xPadding:z,yPadding:H,width:q*h.scale+2*z,height:A*h.scale+2*H}),h.pages.length===0&&r.default.createElement(Q,{store:h})))}),e.default=e.WorkspaceCanvas})($w);var gj=S2();El.toggleFadeInAnimation(!1);Kn.setTextOverflow("change-font-size");const vj=new URLSearchParams(location.search).get("key"),AS=gj.createStore({key:vj});window.store=AS;window.config={addGlobalFont:Ws.addGlobalFont,unstable_useHtmlTextRender:Kn.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:Kn.setTextVerticalResizeEnabled,unstable_setTextOverflow:Kn.setTextOverflow,onLoadError:Hi.onLoadError,setAssetLoadTimeout:Hi.setAssetLoadTimeout,setFontLoadTimeout:Hi.setFontLoadTimeout};const mj=Nd.createRoot(document.getElementById("root"));mj.render(ht.createElement($w.WorkspaceCanvas,{visiblePagesOffset:0,store:AS,components:{PageControls:()=>null,Tooltip:()=>null}}));
|