polotno-node 2.10.1 → 2.10.3
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-DpnZbsrO.js +298 -0
- package/dist/index.html +1 -1
- package/instance.js +19 -1
- package/package.json +7 -8
- package/dist/assets/index-D56TTNQ-.js +0 -298
- package/video.js +0 -161
|
@@ -0,0 +1,298 @@
|
|
|
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 me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ch(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yo(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 I_={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 Ac=Symbol.for("react.element"),xE=Symbol.for("react.portal"),CE=Symbol.for("react.fragment"),kE=Symbol.for("react.strict_mode"),TE=Symbol.for("react.profiler"),AE=Symbol.for("react.provider"),RE=Symbol.for("react.context"),ME=Symbol.for("react.forward_ref"),LE=Symbol.for("react.suspense"),NE=Symbol.for("react.memo"),IE=Symbol.for("react.lazy"),l3=Symbol.iterator;function DE(e){return e===null||typeof e!="object"?null:(e=l3&&e[l3]||e["@@iterator"],typeof e=="function"?e:null)}var D_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j_=Object.assign,F_={};function $s(e,t,r){this.props=e,this.context=t,this.refs=F_,this.updater=r||D_}$s.prototype.isReactComponent={};$s.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")};$s.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function z_(){}z_.prototype=$s.prototype;function bm(e,t,r){this.props=e,this.context=t,this.refs=F_,this.updater=r||D_}var _m=bm.prototype=new z_;_m.constructor=bm;j_(_m,$s.prototype);_m.isPureReactComponent=!0;var s3=Array.isArray,B_=Object.prototype.hasOwnProperty,wm={current:null},U_={key:!0,ref:!0,__self:!0,__source:!0};function H_(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)B_.call(t,n)&&!U_.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:Ac,type:e,key:a,ref:o,props:i,_owner:wm.current}}function jE(e,t){return{$$typeof:Ac,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===Ac}function FE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var u3=/\/+/g;function f1(e,t){return typeof e=="object"&&e!==null&&e.key!=null?FE(""+e.key):t.toString(36)}function Sd(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 Ac:case xE:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+f1(o,0):n,s3(i)?(r="",e!=null&&(r=e.replace(u3,"$&/")+"/"),Sd(i,t,r,"",function(f){return f})):i!=null&&(Sm(i)&&(i=jE(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(u3,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",s3(e))for(var l=0;l<e.length;l++){a=e[l];var u=n+f1(a,l);o+=Sd(a,t,r,u,i)}else if(u=DE(e),typeof u=="function")for(e=u.call(e),l=0;!(a=e.next()).done;)a=a.value,u=n+f1(a,l++),o+=Sd(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 qf(e,t,r){if(e==null)return e;var n=[],i=0;return Sd(e,n,"","",function(a){return t.call(r,a,i++)}),n}function zE(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},Ed={transition:null},BE={ReactCurrentDispatcher:Zr,ReactCurrentBatchConfig:Ed,ReactCurrentOwner:wm};function $_(){throw Error("act(...) is not supported in production builds of React.")}pt.Children={map:qf,forEach:function(e,t,r){qf(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return qf(e,function(){t++}),t},toArray:function(e){return qf(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=$s;pt.Fragment=CE;pt.Profiler=TE;pt.PureComponent=bm;pt.StrictMode=kE;pt.Suspense=LE;pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=BE;pt.act=$_;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=j_({},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)B_.call(t,u)&&!U_.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:Ac,type:e.type,key:i,ref:a,props:n,_owner:o}};pt.createContext=function(e){return e={$$typeof:RE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:AE,_context:e},e.Consumer=e};pt.createElement=H_;pt.createFactory=function(e){var t=H_.bind(null,e);return t.type=e,t};pt.createRef=function(){return{current:null}};pt.forwardRef=function(e){return{$$typeof:ME,render:e}};pt.isValidElement=Sm;pt.lazy=function(e){return{$$typeof:IE,_payload:{_status:-1,_result:e},_init:zE}};pt.memo=function(e,t){return{$$typeof:NE,type:e,compare:t===void 0?null:t}};pt.startTransition=function(e){var t=Ed.transition;Ed.transition={};try{e()}finally{Ed.transition=t}};pt.unstable_act=$_;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";I_.exports=pt;var et=I_.exports;const ht=Ch(et);var Fd={},G_={exports:{}},Rn={},V_={exports:{}},q_={};/**
|
|
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(H,M){var L=H.length;H.push(M);e:for(;0<L;){var D=L-1>>>1,B=H[D];if(0<i(B,M))H[D]=M,H[L]=B,L=D;else break e}}function r(H){return H.length===0?null:H[0]}function n(H){if(H.length===0)return null;var M=H[0],L=H.pop();if(L!==M){H[0]=L;e:for(var D=0,B=H.length,q=B>>>1;D<q;){var K=2*(D+1)-1,z=H[K],$=K+1,F=H[$];if(0>i(z,L))$<B&&0>i(F,z)?(H[D]=F,H[$]=L,D=$):(H[D]=z,H[K]=L,D=K);else if($<B&&0>i(F,L))H[D]=F,H[$]=L,D=$;else break e}}return M}function i(H,M){var L=H.sortIndex-M.sortIndex;return L!==0?L:H.id-M.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=[],h=1,O=null,w=3,b=!1,E=!1,p=!1,v=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=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(H){for(var M=r(f);M!==null;){if(M.callback===null)n(f);else if(M.startTime<=H)n(f),M.sortIndex=M.expirationTime,t(u,M);else break;M=r(f)}}function m(H){if(p=!1,d(H),!E)if(r(u)!==null)E=!0,Z(_);else{var M=r(f);M!==null&&W(m,M.startTime-H)}}function _(H,M){E=!1,p&&(p=!1,g(A),A=-1),b=!0;var L=w;try{for(d(M),O=r(u);O!==null&&(!(O.expirationTime>M)||H&&!C());){var D=O.callback;if(typeof D=="function"){O.callback=null,w=O.priorityLevel;var B=D(O.expirationTime<=M);M=e.unstable_now(),typeof B=="function"?O.callback=B:O===r(u)&&n(u),d(M)}else n(u);O=r(u)}if(O!==null)var q=!0;else{var K=r(f);K!==null&&W(m,K.startTime-M),q=!1}return q}finally{O=null,w=L,b=!1}}var k=!1,x=null,A=-1,S=5,P=-1;function C(){return!(e.unstable_now()-P<S)}function R(){if(x!==null){var H=e.unstable_now();P=H;var M=!0;try{M=x(!0,H)}finally{M?N():(k=!1,x=null)}}else k=!1}var N;if(typeof y=="function")N=function(){y(R)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,G=U.port2;U.port1.onmessage=R,N=function(){G.postMessage(null)}}else N=function(){v(R,0)};function Z(H){x=H,k||(k=!0,N())}function W(H,M){A=v(function(){H(e.unstable_now())},M)}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(H){H.callback=null},e.unstable_continueExecution=function(){E||b||(E=!0,Z(_))},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):S=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(H){switch(w){case 1:case 2:case 3:var M=3;break;default:M=w}var L=w;w=M;try{return H()}finally{w=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(H,M){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var L=w;w=H;try{return M()}finally{w=L}},e.unstable_scheduleCallback=function(H,M,L){var D=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?D+L:D):L=D,H){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=L+B,H={id:h++,callback:M,priorityLevel:H,startTime:L,expirationTime:B,sortIndex:-1},L>D?(H.sortIndex=L,t(f,H),r(u)===null&&H===r(f)&&(p?(g(A),A=-1):p=!0,W(m,L-D))):(H.sortIndex=B,t(u,H),E||b||(E=!0,Z(_))),H},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(H){var M=w;return function(){var L=w;w=M;try{return H.apply(this,arguments)}finally{w=L}}}})(q_);V_.exports=q_;var Hu=V_.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 UE=et,Tn=Hu;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 W_=new Set,rc={};function hl(e,t){ws(e,t),ws(e+"Capture",t)}function ws(e,t){for(rc[e]=t,e=0;e<t.length;e++)W_.add(t[e])}var wa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rv=Object.prototype.hasOwnProperty,HE=/^[: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]*$/,c3={},f3={};function $E(e){return rv.call(f3,e)?!0:rv.call(c3,e)?!1:HE.test(e)?f3[e]=!0:(c3[e]=!0,!1)}function GE(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 VE(e,t,r,n){if(t===null||typeof t>"u"||GE(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 Nr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Nr[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];Nr[t]=new Qr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Nr[e]=new Qr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Nr[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){Nr[e]=new Qr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Nr[e]=new Qr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Nr[e]=new Qr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Nr[e]=new Qr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Nr[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);Nr[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);Nr[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);Nr[t]=new Qr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Nr[e]=new Qr(e,1,!1,e.toLowerCase(),null,!1,!1)});Nr.xlinkHref=new Qr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Nr[e]=new Qr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Pm(e,t,r,n){var i=Nr.hasOwnProperty(t)?Nr[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(VE(t,r,i,n)&&(r=null),n||i===null?$E(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 Ca=UE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Wf=Symbol.for("react.element"),Jl=Symbol.for("react.portal"),es=Symbol.for("react.fragment"),xm=Symbol.for("react.strict_mode"),nv=Symbol.for("react.profiler"),K_=Symbol.for("react.provider"),Y_=Symbol.for("react.context"),Cm=Symbol.for("react.forward_ref"),iv=Symbol.for("react.suspense"),av=Symbol.for("react.suspense_list"),km=Symbol.for("react.memo"),Ka=Symbol.for("react.lazy"),X_=Symbol.for("react.offscreen"),d3=Symbol.iterator;function Pu(e){return e===null||typeof e!="object"?null:(e=d3&&e[d3]||e["@@iterator"],typeof e=="function"?e:null)}var Zt=Object.assign,d1;function ju(e){if(d1===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);d1=t&&t[1]||""}return`
|
|
26
|
+
`+d1+e}var h1=!1;function p1(e,t){if(!e||h1)return"";h1=!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{h1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ju(e):""}function qE(e){switch(e.tag){case 5:return ju(e.type);case 16:return ju("Lazy");case 13:return ju("Suspense");case 19:return ju("SuspenseList");case 0:case 2:case 15:return e=p1(e.type,!1),e;case 11:return e=p1(e.type.render,!1),e;case 1:return e=p1(e.type,!0),e;default:return""}}function 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 es:return"Fragment";case Jl: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 Y_:return(e.displayName||"Context")+".Consumer";case K_: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 km:return t=e.displayName||null,t!==null?t:ov(e.type)||"Memo";case Ka:t=e._payload,e=e._init;try{return ov(e(t))}catch{}}return null}function WE(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 ho(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Z_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function KE(e){var t=Z_(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 Kf(e){e._valueTracker||(e._valueTracker=KE(e))}function Q_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Z_(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function zd(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 Zt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function h3(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ho(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 J_(e,t){t=t.checked,t!=null&&Pm(e,"checked",t,!1)}function sv(e,t){J_(e,t);var r=ho(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,ho(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function p3(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"||zd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Fu=Array.isArray;function ps(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=""+ho(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 Zt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function g3(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(Fu(r)){if(1<r.length)throw Error(Pe(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:ho(r)}}function e6(e,t){var r=ho(t.value),n=ho(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 v3(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function t6(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"?t6(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Yf,r6=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(Yf=Yf||document.createElement("div"),Yf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Yf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function nc(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var $u={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},YE=["Webkit","ms","Moz","O"];Object.keys($u).forEach(function(e){YE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),$u[t]=$u[e]})});function n6(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||$u.hasOwnProperty(e)&&$u[e]?(""+t).trim():t+"px"}function i6(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=n6(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var XE=Zt({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(XE[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 Tm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gv=null,gs=null,vs=null;function m3(e){if(e=Lc(e)){if(typeof gv!="function")throw Error(Pe(280));var t=e.stateNode;t&&(t=Mh(t),gv(e.stateNode,e.type,t))}}function a6(e){gs?vs?vs.push(e):vs=[e]:gs=e}function o6(){if(gs){var e=gs,t=vs;if(vs=gs=null,m3(e),t)for(e=0;e<t.length;e++)m3(t[e])}}function l6(e,t){return e(t)}function s6(){}var g1=!1;function u6(e,t,r){if(g1)return e(t,r);g1=!0;try{return l6(e,t,r)}finally{g1=!1,(gs!==null||vs!==null)&&(s6(),o6())}}function ic(e,t){var r=e.stateNode;if(r===null)return null;var n=Mh(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(wa)try{var xu={};Object.defineProperty(xu,"passive",{get:function(){vv=!0}}),window.addEventListener("test",xu,xu),window.removeEventListener("test",xu,xu)}catch{vv=!1}function ZE(e,t,r,n,i,a,o,l,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(h){this.onError(h)}}var Gu=!1,Bd=null,Ud=!1,mv=null,QE={onError:function(e){Gu=!0,Bd=e}};function JE(e,t,r,n,i,a,o,l,u){Gu=!1,Bd=null,ZE.apply(QE,arguments)}function eO(e,t,r,n,i,a,o,l,u){if(JE.apply(this,arguments),Gu){if(Gu){var f=Bd;Gu=!1,Bd=null}else throw Error(Pe(198));Ud||(Ud=!0,mv=f)}}function pl(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 c6(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 y3(e){if(pl(e)!==e)throw Error(Pe(188))}function tO(e){var t=e.alternate;if(!t){if(t=pl(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 y3(i),e;if(a===n)return y3(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 f6(e){return e=tO(e),e!==null?d6(e):null}function d6(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=d6(e);if(t!==null)return t;e=e.sibling}return null}var h6=Tn.unstable_scheduleCallback,b3=Tn.unstable_cancelCallback,rO=Tn.unstable_shouldYield,nO=Tn.unstable_requestPaint,ir=Tn.unstable_now,iO=Tn.unstable_getCurrentPriorityLevel,Am=Tn.unstable_ImmediatePriority,p6=Tn.unstable_UserBlockingPriority,Hd=Tn.unstable_NormalPriority,aO=Tn.unstable_LowPriority,g6=Tn.unstable_IdlePriority,kh=null,Ui=null;function oO(e){if(Ui&&typeof Ui.onCommitFiberRoot=="function")try{Ui.onCommitFiberRoot(kh,e,void 0,(e.current.flags&128)===128)}catch{}}var hi=Math.clz32?Math.clz32:uO,lO=Math.log,sO=Math.LN2;function uO(e){return e>>>=0,e===0?32:31-(lO(e)/sO|0)|0}var Xf=64,Zf=4194304;function zu(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 $d(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=zu(l):(a&=o,a!==0&&(n=zu(a)))}else o=r&~i,o!==0?n=zu(o):a!==0&&(n=zu(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-hi(t),i=1<<r,n|=e[r],t&=~i;return n}function cO(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 fO(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-hi(a),l=1<<o,u=i[o];u===-1?(!(l&r)||l&n)&&(i[o]=cO(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 v6(){var e=Xf;return Xf<<=1,!(Xf&4194240)&&(Xf=64),e}function v1(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Rc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-hi(t),e[t]=r}function dO(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-hi(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-hi(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var kt=0;function m6(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var y6,Mm,b6,_6,w6,bv=!1,Qf=[],ro=null,no=null,io=null,ac=new Map,oc=new Map,Xa=[],hO="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 _3(e,t){switch(e){case"focusin":case"focusout":ro=null;break;case"dragenter":case"dragleave":no=null;break;case"mouseover":case"mouseout":io=null;break;case"pointerover":case"pointerout":ac.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":oc.delete(t.pointerId)}}function Cu(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=Lc(t),t!==null&&Mm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function pO(e,t,r,n,i){switch(t){case"focusin":return ro=Cu(ro,e,t,r,n,i),!0;case"dragenter":return no=Cu(no,e,t,r,n,i),!0;case"mouseover":return io=Cu(io,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return ac.set(a,Cu(ac.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,oc.set(a,Cu(oc.get(a)||null,e,t,r,n,i)),!0}return!1}function S6(e){var t=Ko(e.target);if(t!==null){var r=pl(t);if(r!==null){if(t=r.tag,t===13){if(t=c6(r),t!==null){e.blockedOn=t,w6(e.priority,function(){b6(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 Od(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=Lc(r),t!==null&&Mm(t),e.blockedOn=r,!1;t.shift()}return!0}function w3(e,t,r){Od(e)&&r.delete(t)}function gO(){bv=!1,ro!==null&&Od(ro)&&(ro=null),no!==null&&Od(no)&&(no=null),io!==null&&Od(io)&&(io=null),ac.forEach(w3),oc.forEach(w3)}function ku(e,t){e.blockedOn===t&&(e.blockedOn=null,bv||(bv=!0,Tn.unstable_scheduleCallback(Tn.unstable_NormalPriority,gO)))}function lc(e){function t(i){return ku(i,e)}if(0<Qf.length){ku(Qf[0],e);for(var r=1;r<Qf.length;r++){var n=Qf[r];n.blockedOn===e&&(n.blockedOn=null)}}for(ro!==null&&ku(ro,e),no!==null&&ku(no,e),io!==null&&ku(io,e),ac.forEach(t),oc.forEach(t),r=0;r<Xa.length;r++)n=Xa[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Xa.length&&(r=Xa[0],r.blockedOn===null);)S6(r),r.blockedOn===null&&Xa.shift()}var ms=Ca.ReactCurrentBatchConfig,Gd=!0;function vO(e,t,r,n){var i=kt,a=ms.transition;ms.transition=null;try{kt=1,Lm(e,t,r,n)}finally{kt=i,ms.transition=a}}function mO(e,t,r,n){var i=kt,a=ms.transition;ms.transition=null;try{kt=4,Lm(e,t,r,n)}finally{kt=i,ms.transition=a}}function Lm(e,t,r,n){if(Gd){var i=_v(e,t,r,n);if(i===null)x1(e,t,n,Vd,r),_3(e,n);else if(pO(i,e,t,r,n))n.stopPropagation();else if(_3(e,n),t&4&&-1<hO.indexOf(e)){for(;i!==null;){var a=Lc(i);if(a!==null&&y6(a),a=_v(e,t,r,n),a===null&&x1(e,t,n,Vd,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else x1(e,t,n,null,r)}}var Vd=null;function _v(e,t,r,n){if(Vd=null,e=Tm(n),e=Ko(e),e!==null)if(t=pl(e),t===null)e=null;else if(r=t.tag,r===13){if(e=c6(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 Vd=e,null}function E6(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(iO()){case Am:return 1;case p6:return 4;case Hd:case aO:return 16;case g6:return 536870912;default:return 16}default:return 16}}var Ja=null,Nm=null,Pd=null;function O6(){if(Pd)return Pd;var e,t=Nm,r=t.length,n,i="value"in Ja?Ja.value:Ja.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 Pd=i.slice(e,1<n?1-n:void 0)}function xd(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 Jf(){return!0}function S3(){return!1}function Mn(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)?Jf:S3,this.isPropagationStopped=S3,this}return Zt(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=Jf)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Jf)},persist:function(){},isPersistent:Jf}),t}var Gs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Im=Mn(Gs),Mc=Zt({},Gs,{view:0,detail:0}),yO=Mn(Mc),m1,y1,Tu,Th=Zt({},Mc,{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!==Tu&&(Tu&&e.type==="mousemove"?(m1=e.screenX-Tu.screenX,y1=e.screenY-Tu.screenY):y1=m1=0,Tu=e),m1)},movementY:function(e){return"movementY"in e?e.movementY:y1}}),E3=Mn(Th),bO=Zt({},Th,{dataTransfer:0}),_O=Mn(bO),wO=Zt({},Mc,{relatedTarget:0}),b1=Mn(wO),SO=Zt({},Gs,{animationName:0,elapsedTime:0,pseudoElement:0}),EO=Mn(SO),OO=Zt({},Gs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),PO=Mn(OO),xO=Zt({},Gs,{data:0}),O3=Mn(xO),CO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kO={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"},TO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AO(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=TO[e])?!!t[e]:!1}function Dm(){return AO}var RO=Zt({},Mc,{key:function(e){if(e.key){var t=CO[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?kO[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"?xd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),MO=Mn(RO),LO=Zt({},Th,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),P3=Mn(LO),NO=Zt({},Mc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),IO=Mn(NO),DO=Zt({},Gs,{propertyName:0,elapsedTime:0,pseudoElement:0}),jO=Mn(DO),FO=Zt({},Th,{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}),zO=Mn(FO),BO=[9,13,27,32],jm=wa&&"CompositionEvent"in window,Vu=null;wa&&"documentMode"in document&&(Vu=document.documentMode);var UO=wa&&"TextEvent"in window&&!Vu,P6=wa&&(!jm||Vu&&8<Vu&&11>=Vu),x3=" ",C3=!1;function x6(e,t){switch(e){case"keyup":return BO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function C6(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ts=!1;function HO(e,t){switch(e){case"compositionend":return C6(t);case"keypress":return t.which!==32?null:(C3=!0,x3);case"textInput":return e=t.data,e===x3&&C3?null:e;default:return null}}function $O(e,t){if(ts)return e==="compositionend"||!jm&&x6(e,t)?(e=O6(),Pd=Nm=Ja=null,ts=!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 P6&&t.locale!=="ko"?null:t.data;default:return null}}var GO={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 k3(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!GO[e.type]:t==="textarea"}function k6(e,t,r,n){a6(n),t=qd(t,"onChange"),0<t.length&&(r=new Im("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var qu=null,sc=null;function VO(e){z6(e,0)}function Ah(e){var t=is(e);if(Q_(t))return e}function qO(e,t){if(e==="change")return t}var T6=!1;if(wa){var _1;if(wa){var w1="oninput"in document;if(!w1){var T3=document.createElement("div");T3.setAttribute("oninput","return;"),w1=typeof T3.oninput=="function"}_1=w1}else _1=!1;T6=_1&&(!document.documentMode||9<document.documentMode)}function A3(){qu&&(qu.detachEvent("onpropertychange",A6),sc=qu=null)}function A6(e){if(e.propertyName==="value"&&Ah(sc)){var t=[];k6(t,sc,e,Tm(e)),u6(VO,t)}}function WO(e,t,r){e==="focusin"?(A3(),qu=t,sc=r,qu.attachEvent("onpropertychange",A6)):e==="focusout"&&A3()}function KO(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ah(sc)}function YO(e,t){if(e==="click")return Ah(t)}function XO(e,t){if(e==="input"||e==="change")return Ah(t)}function ZO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bi=typeof Object.is=="function"?Object.is:ZO;function uc(e,t){if(bi(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)||!bi(e[i],t[i]))return!1}return!0}function R3(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function M3(e,t){var r=R3(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=R3(r)}}function R6(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?R6(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function M6(){for(var e=window,t=zd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=zd(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 QO(e){var t=M6(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&R6(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=M3(r,a);var o=M3(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 JO=wa&&"documentMode"in document&&11>=document.documentMode,rs=null,wv=null,Wu=null,Sv=!1;function L3(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Sv||rs==null||rs!==zd(n)||(n=rs,"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}),Wu&&uc(Wu,n)||(Wu=n,n=qd(wv,"onSelect"),0<n.length&&(t=new Im("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=rs)))}function ed(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var ns={animationend:ed("Animation","AnimationEnd"),animationiteration:ed("Animation","AnimationIteration"),animationstart:ed("Animation","AnimationStart"),transitionend:ed("Transition","TransitionEnd")},S1={},L6={};wa&&(L6=document.createElement("div").style,"AnimationEvent"in window||(delete ns.animationend.animation,delete ns.animationiteration.animation,delete ns.animationstart.animation),"TransitionEvent"in window||delete ns.transitionend.transition);function Rh(e){if(S1[e])return S1[e];if(!ns[e])return e;var t=ns[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in L6)return S1[e]=t[r];return e}var N6=Rh("animationend"),I6=Rh("animationiteration"),D6=Rh("animationstart"),j6=Rh("transitionend"),F6=new Map,N3="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 bo(e,t){F6.set(e,t),hl(t,[e])}for(var E1=0;E1<N3.length;E1++){var O1=N3[E1],eP=O1.toLowerCase(),tP=O1[0].toUpperCase()+O1.slice(1);bo(eP,"on"+tP)}bo(N6,"onAnimationEnd");bo(I6,"onAnimationIteration");bo(D6,"onAnimationStart");bo("dblclick","onDoubleClick");bo("focusin","onFocus");bo("focusout","onBlur");bo(j6,"onTransitionEnd");ws("onMouseEnter",["mouseout","mouseover"]);ws("onMouseLeave",["mouseout","mouseover"]);ws("onPointerEnter",["pointerout","pointerover"]);ws("onPointerLeave",["pointerout","pointerover"]);hl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));hl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));hl("onBeforeInput",["compositionend","keypress","textInput","paste"]);hl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));hl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));hl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bu="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(" "),rP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Bu));function I3(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,eO(n,t,void 0,e),e.currentTarget=null}function z6(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;I3(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;I3(i,l,f),a=u}}}if(Ud)throw e=mv,Ud=!1,mv=null,e}function Ut(e,t){var r=t[Cv];r===void 0&&(r=t[Cv]=new Set);var n=e+"__bubble";r.has(n)||(B6(t,e,2,!1),r.add(n))}function P1(e,t,r){var n=0;t&&(n|=4),B6(r,e,n,t)}var td="_reactListening"+Math.random().toString(36).slice(2);function cc(e){if(!e[td]){e[td]=!0,W_.forEach(function(r){r!=="selectionchange"&&(rP.has(r)||P1(r,!1,e),P1(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[td]||(t[td]=!0,P1("selectionchange",!1,t))}}function B6(e,t,r,n){switch(E6(t)){case 1:var i=vO;break;case 4:i=mO;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 x1(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=Ko(l),o===null)return;if(u=o.tag,u===5||u===6){n=a=o;continue e}l=l.parentNode}}n=n.return}u6(function(){var f=a,h=Tm(r),O=[];e:{var w=F6.get(e);if(w!==void 0){var b=Im,E=e;switch(e){case"keypress":if(xd(r)===0)break e;case"keydown":case"keyup":b=MO;break;case"focusin":E="focus",b=b1;break;case"focusout":E="blur",b=b1;break;case"beforeblur":case"afterblur":b=b1;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":b=E3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":b=_O;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":b=IO;break;case N6:case I6:case D6:b=EO;break;case j6:b=jO;break;case"scroll":b=yO;break;case"wheel":b=zO;break;case"copy":case"cut":case"paste":b=PO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":b=P3}var p=(t&4)!==0,v=!p&&e==="scroll",g=p?w!==null?w+"Capture":null:w;p=[];for(var y=f,d;y!==null;){d=y;var m=d.stateNode;if(d.tag===5&&m!==null&&(d=m,g!==null&&(m=ic(y,g),m!=null&&p.push(fc(y,m,d)))),v)break;y=y.return}0<p.length&&(w=new b(w,E,null,r,h),O.push({event:w,listeners:p}))}}if(!(t&7)){e:{if(w=e==="mouseover"||e==="pointerover",b=e==="mouseout"||e==="pointerout",w&&r!==pv&&(E=r.relatedTarget||r.fromElement)&&(Ko(E)||E[Sa]))break e;if((b||w)&&(w=h.window===h?h:(w=h.ownerDocument)?w.defaultView||w.parentWindow:window,b?(E=r.relatedTarget||r.toElement,b=f,E=E?Ko(E):null,E!==null&&(v=pl(E),E!==v||E.tag!==5&&E.tag!==6)&&(E=null)):(b=null,E=f),b!==E)){if(p=E3,m="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(p=P3,m="onPointerLeave",g="onPointerEnter",y="pointer"),v=b==null?w:is(b),d=E==null?w:is(E),w=new p(m,y+"leave",b,r,h),w.target=v,w.relatedTarget=d,m=null,Ko(h)===f&&(p=new p(g,y+"enter",E,r,h),p.target=d,p.relatedTarget=v,m=p),v=m,b&&E)t:{for(p=b,g=E,y=0,d=p;d;d=Wl(d))y++;for(d=0,m=g;m;m=Wl(m))d++;for(;0<y-d;)p=Wl(p),y--;for(;0<d-y;)g=Wl(g),d--;for(;y--;){if(p===g||g!==null&&p===g.alternate)break t;p=Wl(p),g=Wl(g)}p=null}else p=null;b!==null&&D3(O,w,b,p,!1),E!==null&&v!==null&&D3(O,v,E,p,!0)}}e:{if(w=f?is(f):window,b=w.nodeName&&w.nodeName.toLowerCase(),b==="select"||b==="input"&&w.type==="file")var _=qO;else if(k3(w))if(T6)_=XO;else{_=KO;var k=WO}else(b=w.nodeName)&&b.toLowerCase()==="input"&&(w.type==="checkbox"||w.type==="radio")&&(_=YO);if(_&&(_=_(e,f))){k6(O,_,r,h);break e}k&&k(e,w,f),e==="focusout"&&(k=w._wrapperState)&&k.controlled&&w.type==="number"&&uv(w,"number",w.value)}switch(k=f?is(f):window,e){case"focusin":(k3(k)||k.contentEditable==="true")&&(rs=k,wv=f,Wu=null);break;case"focusout":Wu=wv=rs=null;break;case"mousedown":Sv=!0;break;case"contextmenu":case"mouseup":case"dragend":Sv=!1,L3(O,r,h);break;case"selectionchange":if(JO)break;case"keydown":case"keyup":L3(O,r,h)}var x;if(jm)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else ts?x6(e,r)&&(A="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(A="onCompositionStart");A&&(P6&&r.locale!=="ko"&&(ts||A!=="onCompositionStart"?A==="onCompositionEnd"&&ts&&(x=O6()):(Ja=h,Nm="value"in Ja?Ja.value:Ja.textContent,ts=!0)),k=qd(f,A),0<k.length&&(A=new O3(A,e,null,r,h),O.push({event:A,listeners:k}),x?A.data=x:(x=C6(r),x!==null&&(A.data=x)))),(x=UO?HO(e,r):$O(e,r))&&(f=qd(f,"onBeforeInput"),0<f.length&&(h=new O3("onBeforeInput","beforeinput",null,r,h),O.push({event:h,listeners:f}),h.data=x))}z6(O,t)})}function fc(e,t,r){return{instance:e,listener:t,currentTarget:r}}function qd(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=ic(e,r),a!=null&&n.unshift(fc(e,a,i)),a=ic(e,t),a!=null&&n.push(fc(e,a,i))),e=e.return}return n}function Wl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function D3(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=ic(r,a),u!=null&&o.unshift(fc(r,u,l))):i||(u=ic(r,a),u!=null&&o.push(fc(r,u,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var nP=/\r\n?/g,iP=/\u0000|\uFFFD/g;function j3(e){return(typeof e=="string"?e:""+e).replace(nP,`
|
|
30
|
+
`).replace(iP,"")}function rd(e,t,r){if(t=j3(t),j3(e)!==t&&r)throw Error(Pe(425))}function Wd(){}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,aP=typeof clearTimeout=="function"?clearTimeout:void 0,F3=typeof Promise=="function"?Promise:void 0,oP=typeof queueMicrotask=="function"?queueMicrotask:typeof F3<"u"?function(e){return F3.resolve(null).then(e).catch(lP)}:xv;function lP(e){setTimeout(function(){throw e})}function C1(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),lc(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);lc(t)}function ao(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 z3(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 Vs=Math.random().toString(36).slice(2),ji="__reactFiber$"+Vs,dc="__reactProps$"+Vs,Sa="__reactContainer$"+Vs,Cv="__reactEvents$"+Vs,sP="__reactListeners$"+Vs,uP="__reactHandles$"+Vs;function Ko(e){var t=e[ji];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Sa]||r[ji]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=z3(e);e!==null;){if(r=e[ji])return r;e=z3(e)}return t}e=r,r=e.parentNode}return null}function Lc(e){return e=e[ji]||e[Sa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function is(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Pe(33))}function Mh(e){return e[dc]||null}var kv=[],as=-1;function _o(e){return{current:e}}function Ht(e){0>as||(e.current=kv[as],kv[as]=null,as--)}function Dt(e,t){as++,kv[as]=e.current,e.current=t}var po={},Gr=_o(po),hn=_o(!1),rl=po;function Ss(e,t){var r=e.type.contextTypes;if(!r)return po;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 Kd(){Ht(hn),Ht(Gr)}function B3(e,t,r){if(Gr.current!==po)throw Error(Pe(168));Dt(Gr,t),Dt(hn,r)}function U6(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,WE(e)||"Unknown",i));return Zt({},r,n)}function Yd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||po,rl=Gr.current,Dt(Gr,e),Dt(hn,hn.current),!0}function U3(e,t,r){var n=e.stateNode;if(!n)throw Error(Pe(169));r?(e=U6(e,t,rl),n.__reactInternalMemoizedMergedChildContext=e,Ht(hn),Ht(Gr),Dt(Gr,e)):Ht(hn),Dt(hn,r)}var da=null,Lh=!1,k1=!1;function H6(e){da===null?da=[e]:da.push(e)}function cP(e){Lh=!0,H6(e)}function wo(){if(!k1&&da!==null){k1=!0;var e=0,t=kt;try{var r=da;for(kt=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}da=null,Lh=!1}catch(i){throw da!==null&&(da=da.slice(e+1)),h6(Am,wo),i}finally{kt=t,k1=!1}}return null}var os=[],ls=0,Xd=null,Zd=0,Gn=[],Vn=0,nl=null,pa=1,ga="";function qo(e,t){os[ls++]=Zd,os[ls++]=Xd,Xd=e,Zd=t}function $6(e,t,r){Gn[Vn++]=pa,Gn[Vn++]=ga,Gn[Vn++]=nl,nl=e;var n=pa;e=ga;var i=32-hi(n)-1;n&=~(1<<i),r+=1;var a=32-hi(t)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,pa=1<<32-hi(t)+i|r<<i|n,ga=a+e}else pa=1<<a|r<<i|n,ga=e}function zm(e){e.return!==null&&(qo(e,1),$6(e,1,0))}function Bm(e){for(;e===Xd;)Xd=os[--ls],os[ls]=null,Zd=os[--ls],os[ls]=null;for(;e===nl;)nl=Gn[--Vn],Gn[Vn]=null,ga=Gn[--Vn],Gn[Vn]=null,pa=Gn[--Vn],Gn[Vn]=null}var kn=null,Cn=null,Vt=!1,di=null;function G6(e,t){var r=Kn(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 H3(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,kn=e,Cn=ao(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,kn=e,Cn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=nl!==null?{id:pa,overflow:ga}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Kn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,kn=e,Cn=null,!0):!1;default:return!1}}function Tv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Av(e){if(Vt){var t=Cn;if(t){var r=t;if(!H3(e,t)){if(Tv(e))throw Error(Pe(418));t=ao(r.nextSibling);var n=kn;t&&H3(e,t)?G6(n,r):(e.flags=e.flags&-4097|2,Vt=!1,kn=e)}}else{if(Tv(e))throw Error(Pe(418));e.flags=e.flags&-4097|2,Vt=!1,kn=e}}}function $3(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;kn=e}function nd(e){if(e!==kn)return!1;if(!Vt)return $3(e),Vt=!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=Cn)){if(Tv(e))throw V6(),Error(Pe(418));for(;t;)G6(e,t),t=ao(t.nextSibling)}if($3(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){Cn=ao(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Cn=null}}else Cn=kn?ao(e.stateNode.nextSibling):null;return!0}function V6(){for(var e=Cn;e;)e=ao(e.nextSibling)}function Es(){Cn=kn=null,Vt=!1}function Um(e){di===null?di=[e]:di.push(e)}var fP=Ca.ReactCurrentBatchConfig;function Au(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 id(e,t){throw e=Object.prototype.toString.call(t),Error(Pe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function G3(e){var t=e._init;return t(e._payload)}function q6(e){function t(g,y){if(e){var d=g.deletions;d===null?(g.deletions=[y],g.flags|=16):d.push(y)}}function r(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function n(g,y){for(g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function i(g,y){return g=uo(g,y),g.index=0,g.sibling=null,g}function a(g,y,d){return g.index=d,e?(d=g.alternate,d!==null?(d=d.index,d<y?(g.flags|=2,y):d):(g.flags|=2,y)):(g.flags|=1048576,y)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,y,d,m){return y===null||y.tag!==6?(y=I1(d,g.mode,m),y.return=g,y):(y=i(y,d),y.return=g,y)}function u(g,y,d,m){var _=d.type;return _===es?h(g,y,d.props.children,m,d.key):y!==null&&(y.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Ka&&G3(_)===y.type)?(m=i(y,d.props),m.ref=Au(g,y,d),m.return=g,m):(m=Ld(d.type,d.key,d.props,null,g.mode,m),m.ref=Au(g,y,d),m.return=g,m)}function f(g,y,d,m){return y===null||y.tag!==4||y.stateNode.containerInfo!==d.containerInfo||y.stateNode.implementation!==d.implementation?(y=D1(d,g.mode,m),y.return=g,y):(y=i(y,d.children||[]),y.return=g,y)}function h(g,y,d,m,_){return y===null||y.tag!==7?(y=Jo(d,g.mode,m,_),y.return=g,y):(y=i(y,d),y.return=g,y)}function O(g,y,d){if(typeof y=="string"&&y!==""||typeof y=="number")return y=I1(""+y,g.mode,d),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Wf:return d=Ld(y.type,y.key,y.props,null,g.mode,d),d.ref=Au(g,null,y),d.return=g,d;case Jl:return y=D1(y,g.mode,d),y.return=g,y;case Ka:var m=y._init;return O(g,m(y._payload),d)}if(Fu(y)||Pu(y))return y=Jo(y,g.mode,d,null),y.return=g,y;id(g,y)}return null}function w(g,y,d,m){var _=y!==null?y.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return _!==null?null:l(g,y,""+d,m);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Wf:return d.key===_?u(g,y,d,m):null;case Jl:return d.key===_?f(g,y,d,m):null;case Ka:return _=d._init,w(g,y,_(d._payload),m)}if(Fu(d)||Pu(d))return _!==null?null:h(g,y,d,m,null);id(g,d)}return null}function b(g,y,d,m,_){if(typeof m=="string"&&m!==""||typeof m=="number")return g=g.get(d)||null,l(y,g,""+m,_);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Wf:return g=g.get(m.key===null?d:m.key)||null,u(y,g,m,_);case Jl:return g=g.get(m.key===null?d:m.key)||null,f(y,g,m,_);case Ka:var k=m._init;return b(g,y,d,k(m._payload),_)}if(Fu(m)||Pu(m))return g=g.get(d)||null,h(y,g,m,_,null);id(y,m)}return null}function E(g,y,d,m){for(var _=null,k=null,x=y,A=y=0,S=null;x!==null&&A<d.length;A++){x.index>A?(S=x,x=null):S=x.sibling;var P=w(g,x,d[A],m);if(P===null){x===null&&(x=S);break}e&&x&&P.alternate===null&&t(g,x),y=a(P,y,A),k===null?_=P:k.sibling=P,k=P,x=S}if(A===d.length)return r(g,x),Vt&&qo(g,A),_;if(x===null){for(;A<d.length;A++)x=O(g,d[A],m),x!==null&&(y=a(x,y,A),k===null?_=x:k.sibling=x,k=x);return Vt&&qo(g,A),_}for(x=n(g,x);A<d.length;A++)S=b(x,g,A,d[A],m),S!==null&&(e&&S.alternate!==null&&x.delete(S.key===null?A:S.key),y=a(S,y,A),k===null?_=S:k.sibling=S,k=S);return e&&x.forEach(function(C){return t(g,C)}),Vt&&qo(g,A),_}function p(g,y,d,m){var _=Pu(d);if(typeof _!="function")throw Error(Pe(150));if(d=_.call(d),d==null)throw Error(Pe(151));for(var k=_=null,x=y,A=y=0,S=null,P=d.next();x!==null&&!P.done;A++,P=d.next()){x.index>A?(S=x,x=null):S=x.sibling;var C=w(g,x,P.value,m);if(C===null){x===null&&(x=S);break}e&&x&&C.alternate===null&&t(g,x),y=a(C,y,A),k===null?_=C:k.sibling=C,k=C,x=S}if(P.done)return r(g,x),Vt&&qo(g,A),_;if(x===null){for(;!P.done;A++,P=d.next())P=O(g,P.value,m),P!==null&&(y=a(P,y,A),k===null?_=P:k.sibling=P,k=P);return Vt&&qo(g,A),_}for(x=n(g,x);!P.done;A++,P=d.next())P=b(x,g,A,P.value,m),P!==null&&(e&&P.alternate!==null&&x.delete(P.key===null?A:P.key),y=a(P,y,A),k===null?_=P:k.sibling=P,k=P);return e&&x.forEach(function(R){return t(g,R)}),Vt&&qo(g,A),_}function v(g,y,d,m){if(typeof d=="object"&&d!==null&&d.type===es&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case Wf:e:{for(var _=d.key,k=y;k!==null;){if(k.key===_){if(_=d.type,_===es){if(k.tag===7){r(g,k.sibling),y=i(k,d.props.children),y.return=g,g=y;break e}}else if(k.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Ka&&G3(_)===k.type){r(g,k.sibling),y=i(k,d.props),y.ref=Au(g,k,d),y.return=g,g=y;break e}r(g,k);break}else t(g,k);k=k.sibling}d.type===es?(y=Jo(d.props.children,g.mode,m,d.key),y.return=g,g=y):(m=Ld(d.type,d.key,d.props,null,g.mode,m),m.ref=Au(g,y,d),m.return=g,g=m)}return o(g);case Jl:e:{for(k=d.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===d.containerInfo&&y.stateNode.implementation===d.implementation){r(g,y.sibling),y=i(y,d.children||[]),y.return=g,g=y;break e}else{r(g,y);break}else t(g,y);y=y.sibling}y=D1(d,g.mode,m),y.return=g,g=y}return o(g);case Ka:return k=d._init,v(g,y,k(d._payload),m)}if(Fu(d))return E(g,y,d,m);if(Pu(d))return p(g,y,d,m);id(g,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,y!==null&&y.tag===6?(r(g,y.sibling),y=i(y,d),y.return=g,g=y):(r(g,y),y=I1(d,g.mode,m),y.return=g,g=y),o(g)):r(g,y)}return v}var Os=q6(!0),W6=q6(!1),Qd=_o(null),Jd=null,ss=null,Hm=null;function $m(){Hm=ss=Jd=null}function Gm(e){var t=Qd.current;Ht(Qd),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 ys(e,t){Jd=e,Hm=ss=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(cn=!0),e.firstContext=null)}function Zn(e){var t=e._currentValue;if(Hm!==e)if(e={context:e,memoizedValue:t,next:null},ss===null){if(Jd===null)throw Error(Pe(308));ss=e,Jd.dependencies={lanes:0,firstContext:e}}else ss=ss.next=e;return t}var Yo=null;function Vm(e){Yo===null?Yo=[e]:Yo.push(e)}function K6(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,Ea(e,n)}function Ea(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 Ya=!1;function qm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Y6(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 va(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function oo(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,_t&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Ea(e,r)}return i=n.interleaved,i===null?(t.next=t,Vm(n)):(t.next=i.next,i.next=t),n.interleaved=t,Ea(e,r)}function Cd(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 V3(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 eh(e,t,r,n){var i=e.updateQueue;Ya=!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 h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=f:l.next=f,h.lastBaseUpdate=u))}if(a!==null){var O=i.baseState;o=0,h=f=u=null,l=a;do{var w=l.lane,b=l.eventTime;if((n&w)===w){h!==null&&(h=h.next={eventTime:b,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var E=e,p=l;switch(w=t,b=r,p.tag){case 1:if(E=p.payload,typeof E=="function"){O=E.call(b,O,w);break e}O=E;break e;case 3:E.flags=E.flags&-65537|128;case 0:if(E=p.payload,w=typeof E=="function"?E.call(b,O,w):E,w==null)break e;O=Zt({},O,w);break e;case 2:Ya=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,w=i.effects,w===null?i.effects=[l]:w.push(l))}else b={eventTime:b,lane:w,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(f=h=b,u=O):h=h.next=b,o|=w;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;w=l,l=w.next,w.next=null,i.lastBaseUpdate=w,i.shared.pending=null}}while(!0);if(h===null&&(u=O),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=h,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);al|=o,e.lanes=o,e.memoizedState=O}}function q3(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 Nc={},Hi=_o(Nc),hc=_o(Nc),pc=_o(Nc);function Xo(e){if(e===Nc)throw Error(Pe(174));return e}function Wm(e,t){switch(Dt(pc,t),Dt(hc,e),Dt(Hi,Nc),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)}Ht(Hi),Dt(Hi,t)}function Ps(){Ht(Hi),Ht(hc),Ht(pc)}function X6(e){Xo(pc.current);var t=Xo(Hi.current),r=fv(t,e.type);t!==r&&(Dt(hc,e),Dt(Hi,r))}function Km(e){hc.current===e&&(Ht(Hi),Ht(hc))}var Yt=_o(0);function th(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 kd=Ca.ReactCurrentDispatcher,A1=Ca.ReactCurrentBatchConfig,il=0,Xt=null,hr=null,Pr=null,rh=!1,Ku=!1,gc=0,dP=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(!bi(e[r],t[r]))return!1;return!0}function Zm(e,t,r,n,i,a){if(il=a,Xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,kd.current=e===null||e.memoizedState===null?vP:mP,e=r(n,i),Ku){a=0;do{if(Ku=!1,gc=0,25<=a)throw Error(Pe(301));a+=1,Pr=hr=null,t.updateQueue=null,kd.current=yP,e=r(n,i)}while(Ku)}if(kd.current=nh,t=hr!==null&&hr.next!==null,il=0,Pr=hr=Xt=null,rh=!1,t)throw Error(Pe(300));return e}function Qm(){var e=gc!==0;return gc=0,e}function Di(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pr===null?Xt.memoizedState=Pr=e:Pr=Pr.next=e,Pr}function Qn(){if(hr===null){var e=Xt.alternate;e=e!==null?e.memoizedState:null}else e=hr.next;var t=Pr===null?Xt.memoizedState:Pr.next;if(t!==null)Pr=t,hr=e;else{if(e===null)throw Error(Pe(310));hr=e,e={memoizedState:hr.memoizedState,baseState:hr.baseState,baseQueue:hr.baseQueue,queue:hr.queue,next:null},Pr===null?Xt.memoizedState=Pr=e:Pr=Pr.next=e}return Pr}function vc(e,t){return typeof t=="function"?t(e):t}function R1(e){var t=Qn(),r=t.queue;if(r===null)throw Error(Pe(311));r.lastRenderedReducer=e;var n=hr,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 h=f.lane;if((il&h)===h)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 O={lane:h,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=O,o=n):u=u.next=O,Xt.lanes|=h,al|=h}f=f.next}while(f!==null&&f!==a);u===null?o=n:u.next=l,bi(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,Xt.lanes|=a,al|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function M1(e){var t=Qn(),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);bi(a,t.memoizedState)||(cn=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function Z6(){}function Q6(e,t){var r=Xt,n=Qn(),i=t(),a=!bi(n.memoizedState,i);if(a&&(n.memoizedState=i,cn=!0),n=n.queue,Jm(tw.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Pr!==null&&Pr.memoizedState.tag&1){if(r.flags|=2048,mc(9,ew.bind(null,r,n,i,t),void 0,null),xr===null)throw Error(Pe(349));il&30||J6(r,t,i)}return i}function J6(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Xt.updateQueue,t===null?(t={lastEffect:null,stores:null},Xt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function ew(e,t,r,n){t.value=r,t.getSnapshot=n,rw(t)&&nw(e)}function tw(e,t,r){return r(function(){rw(t)&&nw(e)})}function rw(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!bi(e,r)}catch{return!0}}function nw(e){var t=Ea(e,1);t!==null&&pi(t,e,1,-1)}function W3(e){var t=Di();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:vc,lastRenderedState:e},t.queue=e,e=e.dispatch=gP.bind(null,Xt,e),[t.memoizedState,e]}function mc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Xt.updateQueue,t===null?(t={lastEffect:null,stores:null},Xt.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 iw(){return Qn().memoizedState}function Td(e,t,r,n){var i=Di();Xt.flags|=e,i.memoizedState=mc(1|t,r,void 0,n===void 0?null:n)}function Nh(e,t,r,n){var i=Qn();n=n===void 0?null:n;var a=void 0;if(hr!==null){var o=hr.memoizedState;if(a=o.destroy,n!==null&&Xm(n,o.deps)){i.memoizedState=mc(t,r,a,n);return}}Xt.flags|=e,i.memoizedState=mc(1|t,r,a,n)}function K3(e,t){return Td(8390656,8,e,t)}function Jm(e,t){return Nh(2048,8,e,t)}function aw(e,t){return Nh(4,2,e,t)}function ow(e,t){return Nh(4,4,e,t)}function lw(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 sw(e,t,r){return r=r!=null?r.concat([e]):null,Nh(4,4,lw.bind(null,t,e),r)}function ey(){}function uw(e,t){var r=Qn();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 cw(e,t){var r=Qn();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 fw(e,t,r){return il&21?(bi(r,t)||(r=v6(),Xt.lanes|=r,al|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,cn=!0),e.memoizedState=r)}function hP(e,t){var r=kt;kt=r!==0&&4>r?r:4,e(!0);var n=A1.transition;A1.transition={};try{e(!1),t()}finally{kt=r,A1.transition=n}}function dw(){return Qn().memoizedState}function pP(e,t,r){var n=so(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},hw(e))pw(t,r);else if(r=K6(e,t,r,n),r!==null){var i=Yr();pi(r,e,n,i),gw(r,t,n)}}function gP(e,t,r){var n=so(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(hw(e))pw(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,bi(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=K6(e,t,i,n),r!==null&&(i=Yr(),pi(r,e,n,i),gw(r,t,n))}}function hw(e){var t=e.alternate;return e===Xt||t!==null&&t===Xt}function pw(e,t){Ku=rh=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function gw(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rm(e,r)}}var nh={readContext:Zn,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},vP={readContext:Zn,useCallback:function(e,t){return Di().memoizedState=[e,t===void 0?null:t],e},useContext:Zn,useEffect:K3,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Td(4194308,4,lw.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Td(4194308,4,e,t)},useInsertionEffect:function(e,t){return Td(4,2,e,t)},useMemo:function(e,t){var r=Di();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Di();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=pP.bind(null,Xt,e),[n.memoizedState,e]},useRef:function(e){var t=Di();return e={current:e},t.memoizedState=e},useState:W3,useDebugValue:ey,useDeferredValue:function(e){return Di().memoizedState=e},useTransition:function(){var e=W3(!1),t=e[0];return e=hP.bind(null,e[1]),Di().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Xt,i=Di();if(Vt){if(r===void 0)throw Error(Pe(407));r=r()}else{if(r=t(),xr===null)throw Error(Pe(349));il&30||J6(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,K3(tw.bind(null,n,a,e),[e]),n.flags|=2048,mc(9,ew.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Di(),t=xr.identifierPrefix;if(Vt){var r=ga,n=pa;r=(n&~(1<<32-hi(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=gc++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=dP++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},mP={readContext:Zn,useCallback:uw,useContext:Zn,useEffect:Jm,useImperativeHandle:sw,useInsertionEffect:aw,useLayoutEffect:ow,useMemo:cw,useReducer:R1,useRef:iw,useState:function(){return R1(vc)},useDebugValue:ey,useDeferredValue:function(e){var t=Qn();return fw(t,hr.memoizedState,e)},useTransition:function(){var e=R1(vc)[0],t=Qn().memoizedState;return[e,t]},useMutableSource:Z6,useSyncExternalStore:Q6,useId:dw,unstable_isNewReconciler:!1},yP={readContext:Zn,useCallback:uw,useContext:Zn,useEffect:Jm,useImperativeHandle:sw,useInsertionEffect:aw,useLayoutEffect:ow,useMemo:cw,useReducer:M1,useRef:iw,useState:function(){return M1(vc)},useDebugValue:ey,useDeferredValue:function(e){var t=Qn();return hr===null?t.memoizedState=e:fw(t,hr.memoizedState,e)},useTransition:function(){var e=M1(vc)[0],t=Qn().memoizedState;return[e,t]},useMutableSource:Z6,useSyncExternalStore:Q6,useId:dw,unstable_isNewReconciler:!1};function ci(e,t){if(e&&e.defaultProps){t=Zt({},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:Zt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Ih={isMounted:function(e){return(e=e._reactInternals)?pl(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Yr(),i=so(e),a=va(n,i);a.payload=t,r!=null&&(a.callback=r),t=oo(e,a,i),t!==null&&(pi(t,e,i,n),Cd(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Yr(),i=so(e),a=va(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=oo(e,a,i),t!==null&&(pi(t,e,i,n),Cd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Yr(),n=so(e),i=va(r,n);i.tag=2,t!=null&&(i.callback=t),t=oo(e,i,n),t!==null&&(pi(t,e,n,r),Cd(t,e,n))}};function Y3(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?!uc(r,n)||!uc(i,a):!0}function vw(e,t,r){var n=!1,i=po,a=t.contextType;return typeof a=="object"&&a!==null?a=Zn(a):(i=pn(t)?rl:Gr.current,n=t.contextTypes,a=(n=n!=null)?Ss(e,i):po),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ih,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function X3(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&&Ih.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=Zn(a):(a=pn(t)?rl:Gr.current,i.context=Ss(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&&Ih.enqueueReplaceState(i,i.state,null),eh(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function xs(e,t){try{var r="",n=t;do r+=qE(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 L1(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 bP=typeof WeakMap=="function"?WeakMap:Map;function mw(e,t,r){r=va(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){ah||(ah=!0,Gv=n),Nv(e,t)},r}function yw(e,t,r){r=va(-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"&&(lo===null?lo=new Set([this]):lo.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function Z3(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new bP;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=LP.bind(null,e,t,r),t.then(e,e))}function Q3(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 J3(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=va(-1,1),t.tag=2,oo(r,t,1))),r.lanes|=1),e)}var _P=Ca.ReactCurrentOwner,cn=!1;function Kr(e,t,r,n){t.child=e===null?W6(t,null,r,n):Os(t,e.child,r,n)}function e5(e,t,r,n,i){r=r.render;var a=t.ref;return ys(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,Oa(e,t,i)):(Vt&&r&&zm(t),t.flags|=1,Kr(e,t,n,i),t.child)}function t5(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,bw(e,t,a,n,i)):(e=Ld(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:uc,r(o,n)&&e.ref===t.ref)return Oa(e,t,i)}return t.flags|=1,e=uo(a,n),e.ref=t.ref,e.return=t,t.child=e}function bw(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(uc(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,Oa(e,t,i)}return Iv(e,t,r,n,i)}function _w(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},Dt(cs,Pn),Pn|=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,Dt(cs,Pn),Pn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Dt(cs,Pn),Pn|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Dt(cs,Pn),Pn|=n;return Kr(e,t,i,r),t.child}function ww(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)?rl:Gr.current;return a=Ss(t,a),ys(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,Oa(e,t,i)):(Vt&&n&&zm(t),t.flags|=1,Kr(e,t,r,i),t.child)}function r5(e,t,r,n,i){if(pn(r)){var a=!0;Yd(t)}else a=!1;if(ys(t,i),t.stateNode===null)Ad(e,t),vw(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=Zn(f):(f=pn(r)?rl:Gr.current,f=Ss(t,f));var h=r.getDerivedStateFromProps,O=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";O||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||u!==f)&&X3(t,o,n,f),Ya=!1;var w=t.memoizedState;o.state=w,eh(t,n,o,i),u=t.memoizedState,l!==n||w!==u||hn.current||Ya?(typeof h=="function"&&(Mv(t,r,h,n),u=t.memoizedState),(l=Ya||Y3(t,r,l,n,w,u,f))?(O||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,Y6(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:ci(t.type,l),o.props=f,O=t.pendingProps,w=o.context,u=r.contextType,typeof u=="object"&&u!==null?u=Zn(u):(u=pn(r)?rl:Gr.current,u=Ss(t,u));var b=r.getDerivedStateFromProps;(h=typeof b=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==O||w!==u)&&X3(t,o,n,u),Ya=!1,w=t.memoizedState,o.state=w,eh(t,n,o,i);var E=t.memoizedState;l!==O||w!==E||hn.current||Ya?(typeof b=="function"&&(Mv(t,r,b,n),E=t.memoizedState),(f=Ya||Y3(t,r,f,n,w,E,u)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,E,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,E,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=E),o.props=n,o.state=E,o.context=u,n=f):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),n=!1)}return Dv(e,t,r,n,a,i)}function Dv(e,t,r,n,i,a){ww(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&U3(t,r,!1),Oa(e,t,a);n=t.stateNode,_P.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Os(t,e.child,null,a),t.child=Os(t,null,l,a)):Kr(e,t,l,a),t.memoizedState=n.state,i&&U3(t,r,!0),t.child}function Sw(e){var t=e.stateNode;t.pendingContext?B3(e,t.pendingContext,t.pendingContext!==t.context):t.context&&B3(e,t.context,!1),Wm(e,t.containerInfo)}function n5(e,t,r,n,i){return Es(),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 Ew(e,t,r){var n=t.pendingProps,i=Yt.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),Dt(Yt,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=Fh(o,n,0,null),e=Jo(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 wP(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=uo(i,u),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=uo(l,a):(a=Jo(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=uo(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=Fh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ad(e,t,r,n){return n!==null&&Um(n),Os(t,e.child,null,r),e=ty(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wP(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=L1(Error(Pe(422))),ad(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=Fh({mode:"visible",children:n.children},i,0,null),a=Jo(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&Os(t,e.child,null,o),t.child.memoizedState=Fv(o),t.memoizedState=jv,a);if(!(t.mode&1))return ad(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(Pe(419)),n=L1(a,n,void 0),ad(e,t,o,n)}if(l=(o&e.childLanes)!==0,cn||l){if(n=xr,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,Ea(e,i),pi(n,e,i,-1))}return ly(),n=L1(Error(Pe(421))),ad(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=NP.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Cn=ao(i.nextSibling),kn=t,Vt=!0,di=null,e!==null&&(Gn[Vn++]=pa,Gn[Vn++]=ga,Gn[Vn++]=nl,pa=e.id,ga=e.overflow,nl=t),t=ty(t,n.children),t.flags|=4096,t)}function i5(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Rv(e.return,t,r)}function N1(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 Ow(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Kr(e,t,n.children,r),n=Yt.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&&i5(e,r,t);else if(e.tag===19)i5(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(Dt(Yt,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&&th(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),N1(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&&th(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}N1(t,!0,r,null,a);break;case"together":N1(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ad(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Oa(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),al|=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=uo(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=uo(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function SP(e,t,r){switch(t.tag){case 3:Sw(t),Es();break;case 5:X6(t);break;case 1:pn(t.type)&&Yd(t);break;case 4:Wm(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Dt(Qd,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Dt(Yt,Yt.current&1),t.flags|=128,null):r&t.child.childLanes?Ew(e,t,r):(Dt(Yt,Yt.current&1),e=Oa(e,t,r),e!==null?e.sibling:null);Dt(Yt,Yt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Ow(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Dt(Yt,Yt.current),n)break;return null;case 22:case 23:return t.lanes=0,_w(e,t,r)}return Oa(e,t,r)}var Pw,zv,xw,Cw;Pw=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(){};xw=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Xo(Hi.current);var a=null;switch(r){case"input":i=lv(e,i),n=lv(e,n),a=[];break;case"select":i=Zt({},i,{value:void 0}),n=Zt({},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=Wd)}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"&&(rc.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"&&(rc.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&Ut("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)}};Cw=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ru(e,t){if(!Vt)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 EP(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)&&Kd(),Hr(t),null;case 3:return n=t.stateNode,Ps(),Ht(hn),Ht(Gr),Ym(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(nd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,di!==null&&(Wv(di),di=null))),zv(e,t),Hr(t),null;case 5:Km(t);var i=Xo(pc.current);if(r=t.type,e!==null&&t.stateNode!=null)xw(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=Xo(Hi.current),nd(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[ji]=t,n[dc]=a,e=(t.mode&1)!==0,r){case"dialog":Ut("cancel",n),Ut("close",n);break;case"iframe":case"object":case"embed":Ut("load",n);break;case"video":case"audio":for(i=0;i<Bu.length;i++)Ut(Bu[i],n);break;case"source":Ut("error",n);break;case"img":case"image":case"link":Ut("error",n),Ut("load",n);break;case"details":Ut("toggle",n);break;case"input":h3(n,a),Ut("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},Ut("invalid",n);break;case"textarea":g3(n,a),Ut("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&&rd(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&rd(n.textContent,l,e),i=["children",""+l]):rc.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Ut("scroll",n)}switch(r){case"input":Kf(n),p3(n,a,!0);break;case"textarea":Kf(n),v3(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=Wd)}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=t6(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[ji]=t,e[dc]=n,Pw(e,t,!1,!1),t.stateNode=e;e:{switch(o=hv(r,n),r){case"dialog":Ut("cancel",e),Ut("close",e),i=n;break;case"iframe":case"object":case"embed":Ut("load",e),i=n;break;case"video":case"audio":for(i=0;i<Bu.length;i++)Ut(Bu[i],e);i=n;break;case"source":Ut("error",e),i=n;break;case"img":case"image":case"link":Ut("error",e),Ut("load",e),i=n;break;case"details":Ut("toggle",e),i=n;break;case"input":h3(e,n),i=lv(e,n),Ut("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=Zt({},n,{value:void 0}),Ut("invalid",e);break;case"textarea":g3(e,n),i=cv(e,n),Ut("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"?i6(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&r6(e,u)):a==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&nc(e,u):typeof u=="number"&&nc(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(rc.hasOwnProperty(a)?u!=null&&a==="onScroll"&&Ut("scroll",e):u!=null&&Pm(e,a,u,o))}switch(r){case"input":Kf(e),p3(e,n,!1);break;case"textarea":Kf(e),v3(e);break;case"option":n.value!=null&&e.setAttribute("value",""+ho(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?ps(e,!!n.multiple,a,!1):n.defaultValue!=null&&ps(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Wd)}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)Cw(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(Pe(166));if(r=Xo(pc.current),Xo(Hi.current),nd(t)){if(n=t.stateNode,r=t.memoizedProps,n[ji]=t,(a=n.nodeValue!==r)&&(e=kn,e!==null))switch(e.tag){case 3:rd(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&rd(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[ji]=t,t.stateNode=n}return Hr(t),null;case 13:if(Ht(Yt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Vt&&Cn!==null&&t.mode&1&&!(t.flags&128))V6(),Es(),t.flags|=98560,a=!1;else if(a=nd(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[ji]=t}else Es(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hr(t),a=!1}else di!==null&&(Wv(di),di=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||Yt.current&1?gr===0&&(gr=3):ly())),t.updateQueue!==null&&(t.flags|=4),Hr(t),null);case 4:return Ps(),zv(e,t),e===null&&cc(t.stateNode.containerInfo),Hr(t),null;case 10:return Gm(t.type._context),Hr(t),null;case 17:return pn(t.type)&&Kd(),Hr(t),null;case 19:if(Ht(Yt),a=t.memoizedState,a===null)return Hr(t),null;if(n=(t.flags&128)!==0,o=a.rendering,o===null)if(n)Ru(a,!1);else{if(gr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=th(e),o!==null){for(t.flags|=128,Ru(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 Dt(Yt,Yt.current&1|2),t.child}e=e.sibling}a.tail!==null&&ir()>Cs&&(t.flags|=128,n=!0,Ru(a,!1),t.lanes=4194304)}else{if(!n)if(e=th(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ru(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Vt)return Hr(t),null}else 2*ir()-a.renderingStartTime>Cs&&r!==1073741824&&(t.flags|=128,n=!0,Ru(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=ir(),t.sibling=null,r=Yt.current,Dt(Yt,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?Pn&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 OP(e,t){switch(Bm(t),t.tag){case 1:return pn(t.type)&&Kd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ps(),Ht(hn),Ht(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(Ht(Yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Pe(340));Es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ht(Yt),null;case 4:return Ps(),null;case 10:return Gm(t.type._context),null;case 22:case 23:return oy(),null;case 24:return null;default:return null}}var od=!1,$r=!1,PP=typeof WeakSet=="function"?WeakSet:Set,Be=null;function us(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Jt(e,t,n)}else r.current=null}function Bv(e,t,r){try{r()}catch(n){Jt(e,t,n)}}var a5=!1;function xP(e,t){if(Ev=Gd,e=M6(),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,h=0,O=e,w=null;t:for(;;){for(var b;O!==r||i!==0&&O.nodeType!==3||(l=o+i),O!==a||n!==0&&O.nodeType!==3||(u=o+n),O.nodeType===3&&(o+=O.nodeValue.length),(b=O.firstChild)!==null;)w=O,O=b;for(;;){if(O===e)break t;if(w===r&&++f===i&&(l=o),w===a&&++h===n&&(u=o),(b=O.nextSibling)!==null)break;O=w,w=O.parentNode}O=b}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},Gd=!1,Be=t;Be!==null;)if(t=Be,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Be=e;else for(;Be!==null;){t=Be;try{var E=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(E!==null){var p=E.memoizedProps,v=E.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?p:ci(t.type,p),v);g.__reactInternalSnapshotBeforeUpdate=y}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(m){Jt(t,t.return,m)}if(e=t.sibling,e!==null){e.return=t.return,Be=e;break}Be=t.return}return E=a5,a5=!1,E}function Yu(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 Dh(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 kw(e){var t=e.alternate;t!==null&&(e.alternate=null,kw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ji],delete t[dc],delete t[Cv],delete t[sP],delete t[uP])),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 Tw(e){return e.tag===5||e.tag===3||e.tag===4}function o5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tw(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=Wd));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 Rr=null,fi=!1;function Va(e,t,r){for(r=r.child;r!==null;)Aw(e,t,r),r=r.sibling}function Aw(e,t,r){if(Ui&&typeof Ui.onCommitFiberUnmount=="function")try{Ui.onCommitFiberUnmount(kh,r)}catch{}switch(r.tag){case 5:$r||us(r,t);case 6:var n=Rr,i=fi;Rr=null,Va(e,t,r),Rr=n,fi=i,Rr!==null&&(fi?(e=Rr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Rr.removeChild(r.stateNode));break;case 18:Rr!==null&&(fi?(e=Rr,r=r.stateNode,e.nodeType===8?C1(e.parentNode,r):e.nodeType===1&&C1(e,r),lc(e)):C1(Rr,r.stateNode));break;case 4:n=Rr,i=fi,Rr=r.stateNode.containerInfo,fi=!0,Va(e,t,r),Rr=n,fi=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)}Va(e,t,r);break;case 1:if(!$r&&(us(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Jt(r,t,l)}Va(e,t,r);break;case 21:Va(e,t,r);break;case 22:r.mode&1?($r=(n=$r)||r.memoizedState!==null,Va(e,t,r),$r=n):Va(e,t,r);break;default:Va(e,t,r)}}function l5(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new PP),t.forEach(function(n){var i=IP.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function li(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:Rr=l.stateNode,fi=!1;break e;case 3:Rr=l.stateNode.containerInfo,fi=!0;break e;case 4:Rr=l.stateNode.containerInfo,fi=!0;break e}l=l.return}if(Rr===null)throw Error(Pe(160));Aw(a,o,i),Rr=null,fi=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(f){Jt(i,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Rw(t,e),t=t.sibling}function Rw(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(li(t,e),Ni(e),n&4){try{Yu(3,e,e.return),Dh(3,e)}catch(p){Jt(e,e.return,p)}try{Yu(5,e,e.return)}catch(p){Jt(e,e.return,p)}}break;case 1:li(t,e),Ni(e),n&512&&r!==null&&us(r,r.return);break;case 5:if(li(t,e),Ni(e),n&512&&r!==null&&us(r,r.return),e.flags&32){var i=e.stateNode;try{nc(i,"")}catch(p){Jt(e,e.return,p)}}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&&J_(i,a),hv(l,o);var f=hv(l,a);for(o=0;o<u.length;o+=2){var h=u[o],O=u[o+1];h==="style"?i6(i,O):h==="dangerouslySetInnerHTML"?r6(i,O):h==="children"?nc(i,O):Pm(i,h,O,f)}switch(l){case"input":sv(i,a);break;case"textarea":e6(i,a);break;case"select":var w=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var b=a.value;b!=null?ps(i,!!a.multiple,b,!1):w!==!!a.multiple&&(a.defaultValue!=null?ps(i,!!a.multiple,a.defaultValue,!0):ps(i,!!a.multiple,a.multiple?[]:"",!1))}i[dc]=a}catch(p){Jt(e,e.return,p)}}break;case 6:if(li(t,e),Ni(e),n&4){if(e.stateNode===null)throw Error(Pe(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(p){Jt(e,e.return,p)}}break;case 3:if(li(t,e),Ni(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{lc(t.containerInfo)}catch(p){Jt(e,e.return,p)}break;case 4:li(t,e),Ni(e);break;case 13:li(t,e),Ni(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(iy=ir())),n&4&&l5(e);break;case 22:if(h=r!==null&&r.memoizedState!==null,e.mode&1?($r=(f=$r)||h,li(t,e),$r=f):li(t,e),Ni(e),n&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!h&&e.mode&1)for(Be=e,h=e.child;h!==null;){for(O=Be=h;Be!==null;){switch(w=Be,b=w.child,w.tag){case 0:case 11:case 14:case 15:Yu(4,w,w.return);break;case 1:us(w,w.return);var E=w.stateNode;if(typeof E.componentWillUnmount=="function"){n=w,r=w.return;try{t=n,E.props=t.memoizedProps,E.state=t.memoizedState,E.componentWillUnmount()}catch(p){Jt(n,r,p)}}break;case 5:us(w,w.return);break;case 22:if(w.memoizedState!==null){u5(O);continue}}b!==null?(b.return=w,Be=b):u5(O)}h=h.sibling}e:for(h=null,O=e;;){if(O.tag===5){if(h===null){h=O;try{i=O.stateNode,f?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=O.stateNode,u=O.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=n6("display",o))}catch(p){Jt(e,e.return,p)}}}else if(O.tag===6){if(h===null)try{O.stateNode.nodeValue=f?"":O.memoizedProps}catch(p){Jt(e,e.return,p)}}else if((O.tag!==22&&O.tag!==23||O.memoizedState===null||O===e)&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===e)break e;for(;O.sibling===null;){if(O.return===null||O.return===e)break e;h===O&&(h=null),O=O.return}h===O&&(h=null),O.sibling.return=O.return,O=O.sibling}}break;case 19:li(t,e),Ni(e),n&4&&l5(e);break;case 21:break;default:li(t,e),Ni(e)}}function Ni(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Tw(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&&(nc(i,""),n.flags&=-33);var a=o5(e);$v(e,a,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=o5(e);Hv(e,l,o);break;default:throw Error(Pe(161))}}catch(u){Jt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function CP(e,t,r){Be=e,Mw(e)}function Mw(e,t,r){for(var n=(e.mode&1)!==0;Be!==null;){var i=Be,a=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||od;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||$r;l=od;var f=$r;if(od=o,($r=u)&&!f)for(Be=i;Be!==null;)o=Be,u=o.child,o.tag===22&&o.memoizedState!==null?c5(i):u!==null?(u.return=o,Be=u):c5(i);for(;a!==null;)Be=a,Mw(a),a=a.sibling;Be=i,od=l,$r=f}s5(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Be=a):s5(e)}}function s5(e){for(;Be!==null;){var t=Be;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:$r||Dh(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:ci(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&q3(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}q3(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 h=f.memoizedState;if(h!==null){var O=h.dehydrated;O!==null&&lc(O)}}}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(w){Jt(t,t.return,w)}}if(t===e){Be=null;break}if(r=t.sibling,r!==null){r.return=t.return,Be=r;break}Be=t.return}}function u5(e){for(;Be!==null;){var t=Be;if(t===e){Be=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Be=r;break}Be=t.return}}function c5(e){for(;Be!==null;){var t=Be;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Dh(4,t)}catch(u){Jt(t,r,u)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(u){Jt(t,i,u)}}var a=t.return;try{Uv(t)}catch(u){Jt(t,a,u)}break;case 5:var o=t.return;try{Uv(t)}catch(u){Jt(t,o,u)}}}catch(u){Jt(t,t.return,u)}if(t===e){Be=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Be=l;break}Be=t.return}}var kP=Math.ceil,ih=Ca.ReactCurrentDispatcher,ry=Ca.ReactCurrentOwner,Yn=Ca.ReactCurrentBatchConfig,_t=0,xr=null,sr=null,Lr=0,Pn=0,cs=_o(0),gr=0,yc=null,al=0,jh=0,ny=0,Xu=null,un=null,iy=0,Cs=1/0,fa=null,ah=!1,Gv=null,lo=null,ld=!1,eo=null,oh=0,Zu=0,Vv=null,Rd=-1,Md=0;function Yr(){return _t&6?ir():Rd!==-1?Rd:Rd=ir()}function so(e){return e.mode&1?_t&2&&Lr!==0?Lr&-Lr:fP.transition!==null?(Md===0&&(Md=v6()),Md):(e=kt,e!==0||(e=window.event,e=e===void 0?16:E6(e.type)),e):1}function pi(e,t,r,n){if(50<Zu)throw Zu=0,Vv=null,Error(Pe(185));Rc(e,r,n),(!(_t&2)||e!==xr)&&(e===xr&&(!(_t&2)&&(jh|=r),gr===4&&Za(e,Lr)),gn(e,n),r===1&&_t===0&&!(t.mode&1)&&(Cs=ir()+500,Lh&&wo()))}function gn(e,t){var r=e.callbackNode;fO(e,t);var n=$d(e,e===xr?Lr:0);if(n===0)r!==null&&b3(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&b3(r),t===1)e.tag===0?cP(f5.bind(null,e)):H6(f5.bind(null,e)),oP(function(){!(_t&6)&&wo()}),r=null;else{switch(m6(n)){case 1:r=Am;break;case 4:r=p6;break;case 16:r=Hd;break;case 536870912:r=g6;break;default:r=Hd}r=Bw(r,Lw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Lw(e,t){if(Rd=-1,Md=0,_t&6)throw Error(Pe(327));var r=e.callbackNode;if(bs()&&e.callbackNode!==r)return null;var n=$d(e,e===xr?Lr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=lh(e,n);else{t=n;var i=_t;_t|=2;var a=Iw();(xr!==e||Lr!==t)&&(fa=null,Cs=ir()+500,Qo(e,t));do try{RP();break}catch(l){Nw(e,l)}while(!0);$m(),ih.current=a,_t=i,sr!==null?t=0:(xr=null,Lr=0,t=gr)}if(t!==0){if(t===2&&(i=yv(e),i!==0&&(n=i,t=qv(e,i))),t===1)throw r=yc,Qo(e,0),Za(e,n),gn(e,ir()),r;if(t===6)Za(e,n);else{if(i=e.current.alternate,!(n&30)&&!TP(i)&&(t=lh(e,n),t===2&&(a=yv(e),a!==0&&(n=a,t=qv(e,a))),t===1))throw r=yc,Qo(e,0),Za(e,n),gn(e,ir()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(Pe(345));case 2:Wo(e,un,fa);break;case 3:if(Za(e,n),(n&130023424)===n&&(t=iy+500-ir(),10<t)){if($d(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){Yr(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=xv(Wo.bind(null,e,un,fa),t);break}Wo(e,un,fa);break;case 4:if(Za(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-hi(n);a=1<<o,o=t[o],o>i&&(i=o),n&=~a}if(n=i,n=ir()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*kP(n/1960))-n,10<n){e.timeoutHandle=xv(Wo.bind(null,e,un,fa),n);break}Wo(e,un,fa);break;case 5:Wo(e,un,fa);break;default:throw Error(Pe(329))}}}return gn(e,ir()),e.callbackNode===r?Lw.bind(null,e):null}function qv(e,t){var r=Xu;return e.current.memoizedState.isDehydrated&&(Qo(e,t).flags|=256),e=lh(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 TP(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(!bi(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 Za(e,t){for(t&=~ny,t&=~jh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-hi(t),n=1<<r;e[r]=-1,t&=~n}}function f5(e){if(_t&6)throw Error(Pe(327));bs();var t=$d(e,0);if(!(t&1))return gn(e,ir()),null;var r=lh(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=yc,Qo(e,0),Za(e,t),gn(e,ir()),r;if(r===6)throw Error(Pe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wo(e,un,fa),gn(e,ir()),null}function ay(e,t){var r=_t;_t|=1;try{return e(t)}finally{_t=r,_t===0&&(Cs=ir()+500,Lh&&wo())}}function ol(e){eo!==null&&eo.tag===0&&!(_t&6)&&bs();var t=_t;_t|=1;var r=Yn.transition,n=kt;try{if(Yn.transition=null,kt=1,e)return e()}finally{kt=n,Yn.transition=r,_t=t,!(_t&6)&&wo()}}function oy(){Pn=cs.current,Ht(cs)}function Qo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,aP(r)),sr!==null)for(r=sr.return;r!==null;){var n=r;switch(Bm(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Kd();break;case 3:Ps(),Ht(hn),Ht(Gr),Ym();break;case 5:Km(n);break;case 4:Ps();break;case 13:Ht(Yt);break;case 19:Ht(Yt);break;case 10:Gm(n.type._context);break;case 22:case 23:oy()}r=r.return}if(xr=e,sr=e=uo(e.current,null),Lr=Pn=t,gr=0,yc=null,ny=jh=al=0,un=Xu=null,Yo!==null){for(t=0;t<Yo.length;t++)if(r=Yo[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}Yo=null}return e}function Nw(e,t){do{var r=sr;try{if($m(),kd.current=nh,rh){for(var n=Xt.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}rh=!1}if(il=0,Pr=hr=Xt=null,Ku=!1,gc=0,ry.current=null,r===null||r.return===null){gr=1,yc=t,sr=null;break}e:{var a=e,o=r.return,l=r,u=t;if(t=Lr,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,h=l,O=h.tag;if(!(h.mode&1)&&(O===0||O===11||O===15)){var w=h.alternate;w?(h.updateQueue=w.updateQueue,h.memoizedState=w.memoizedState,h.lanes=w.lanes):(h.updateQueue=null,h.memoizedState=null)}var b=Q3(o);if(b!==null){b.flags&=-257,J3(b,o,l,a,t),b.mode&1&&Z3(a,f,t),t=b,u=f;var E=t.updateQueue;if(E===null){var p=new Set;p.add(u),t.updateQueue=p}else E.add(u);break e}else{if(!(t&1)){Z3(a,f,t),ly();break e}u=Error(Pe(426))}}else if(Vt&&l.mode&1){var v=Q3(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),J3(v,o,l,a,t),Um(xs(u,l));break e}}a=u=xs(u,l),gr!==4&&(gr=2),Xu===null?Xu=[a]:Xu.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=mw(a,u,t);V3(a,g);break e;case 1:l=u;var y=a.type,d=a.stateNode;if(!(a.flags&128)&&(typeof y.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(lo===null||!lo.has(d)))){a.flags|=65536,t&=-t,a.lanes|=t;var m=yw(a,l,t);V3(a,m);break e}}a=a.return}while(a!==null)}jw(r)}catch(_){t=_,sr===r&&r!==null&&(sr=r=r.return);continue}break}while(!0)}function Iw(){var e=ih.current;return ih.current=nh,e===null?nh:e}function ly(){(gr===0||gr===3||gr===2)&&(gr=4),xr===null||!(al&268435455)&&!(jh&268435455)||Za(xr,Lr)}function lh(e,t){var r=_t;_t|=2;var n=Iw();(xr!==e||Lr!==t)&&(fa=null,Qo(e,t));do try{AP();break}catch(i){Nw(e,i)}while(!0);if($m(),_t=r,ih.current=n,sr!==null)throw Error(Pe(261));return xr=null,Lr=0,gr}function AP(){for(;sr!==null;)Dw(sr)}function RP(){for(;sr!==null&&!rO();)Dw(sr)}function Dw(e){var t=zw(e.alternate,e,Pn);e.memoizedProps=e.pendingProps,t===null?jw(e):sr=t,ry.current=null}function jw(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=OP(r,t),r!==null){r.flags&=32767,sr=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{gr=6,sr=null;return}}else if(r=EP(r,t,Pn),r!==null){sr=r;return}if(t=t.sibling,t!==null){sr=t;return}sr=t=e}while(t!==null);gr===0&&(gr=5)}function Wo(e,t,r){var n=kt,i=Yn.transition;try{Yn.transition=null,kt=1,MP(e,t,r,n)}finally{Yn.transition=i,kt=n}return null}function MP(e,t,r,n){do bs();while(eo!==null);if(_t&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(dO(e,a),e===xr&&(sr=xr=null,Lr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||ld||(ld=!0,Bw(Hd,function(){return bs(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=Yn.transition,Yn.transition=null;var o=kt;kt=1;var l=_t;_t|=4,ry.current=null,xP(e,r),Rw(r,e),QO(Ov),Gd=!!Ev,Ov=Ev=null,e.current=r,CP(r),nO(),_t=l,kt=o,Yn.transition=a}else e.current=r;if(ld&&(ld=!1,eo=e,oh=i),a=e.pendingLanes,a===0&&(lo=null),oO(r.stateNode),gn(e,ir()),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(ah)throw ah=!1,e=Gv,Gv=null,e;return oh&1&&e.tag!==0&&bs(),a=e.pendingLanes,a&1?e===Vv?Zu++:(Zu=0,Vv=e):Zu=0,wo(),null}function bs(){if(eo!==null){var e=m6(oh),t=Yn.transition,r=kt;try{if(Yn.transition=null,kt=16>e?16:e,eo===null)var n=!1;else{if(e=eo,eo=null,oh=0,_t&6)throw Error(Pe(331));var i=_t;for(_t|=4,Be=e.current;Be!==null;){var a=Be,o=a.child;if(Be.flags&16){var l=a.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for(Be=f;Be!==null;){var h=Be;switch(h.tag){case 0:case 11:case 15:Yu(8,h,a)}var O=h.child;if(O!==null)O.return=h,Be=O;else for(;Be!==null;){h=Be;var w=h.sibling,b=h.return;if(kw(h),h===f){Be=null;break}if(w!==null){w.return=b,Be=w;break}Be=b}}}var E=a.alternate;if(E!==null){var p=E.child;if(p!==null){E.child=null;do{var v=p.sibling;p.sibling=null,p=v}while(p!==null)}}Be=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,Be=o;else e:for(;Be!==null;){if(a=Be,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Yu(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,Be=g;break e}Be=a.return}}var y=e.current;for(Be=y;Be!==null;){o=Be;var d=o.child;if(o.subtreeFlags&2064&&d!==null)d.return=o,Be=d;else e:for(o=y;Be!==null;){if(l=Be,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Dh(9,l)}}catch(_){Jt(l,l.return,_)}if(l===o){Be=null;break e}var m=l.sibling;if(m!==null){m.return=l.return,Be=m;break e}Be=l.return}}if(_t=i,wo(),Ui&&typeof Ui.onPostCommitFiberRoot=="function")try{Ui.onPostCommitFiberRoot(kh,e)}catch{}n=!0}return n}finally{kt=r,Yn.transition=t}}return!1}function d5(e,t,r){t=xs(r,t),t=mw(e,t,1),e=oo(e,t,1),t=Yr(),e!==null&&(Rc(e,1,t),gn(e,t))}function Jt(e,t,r){if(e.tag===3)d5(e,e,r);else for(;t!==null;){if(t.tag===3){d5(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(lo===null||!lo.has(n))){e=xs(r,e),e=yw(t,e,1),t=oo(t,e,1),e=Yr(),t!==null&&(Rc(t,1,e),gn(t,e));break}}t=t.return}}function LP(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Yr(),e.pingedLanes|=e.suspendedLanes&r,xr===e&&(Lr&r)===r&&(gr===4||gr===3&&(Lr&130023424)===Lr&&500>ir()-iy?Qo(e,0):ny|=r),gn(e,t)}function Fw(e,t){t===0&&(e.mode&1?(t=Zf,Zf<<=1,!(Zf&130023424)&&(Zf=4194304)):t=1);var r=Yr();e=Ea(e,t),e!==null&&(Rc(e,t,r),gn(e,r))}function NP(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Fw(e,r)}function IP(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),Fw(e,r)}var zw;zw=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,SP(e,t,r);cn=!!(e.flags&131072)}else cn=!1,Vt&&t.flags&1048576&&$6(t,Zd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Ad(e,t),e=t.pendingProps;var i=Ss(t,Gr.current);ys(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,Yd(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,qm(t),i.updater=Ih,t.stateNode=i,i._reactInternals=t,Lv(t,n,e,r),t=Dv(null,t,n,!0,a,r)):(t.tag=0,Vt&&a&&zm(t),Kr(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Ad(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=jP(n),e=ci(n,e),i){case 0:t=Iv(null,t,n,e,r);break e;case 1:t=r5(null,t,n,e,r);break e;case 11:t=e5(null,t,n,e,r);break e;case 14:t=t5(null,t,n,ci(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:ci(n,i),Iv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ci(n,i),r5(e,t,n,i,r);case 3:e:{if(Sw(t),e===null)throw Error(Pe(387));n=t.pendingProps,a=t.memoizedState,i=a.element,Y6(e,t),eh(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=xs(Error(Pe(423)),t),t=n5(e,t,n,r,i);break e}else if(n!==i){i=xs(Error(Pe(424)),t),t=n5(e,t,n,r,i);break e}else for(Cn=ao(t.stateNode.containerInfo.firstChild),kn=t,Vt=!0,di=null,r=W6(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Es(),n===i){t=Oa(e,t,r);break e}Kr(e,t,n,r)}t=t.child}return t;case 5:return X6(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),ww(e,t),Kr(e,t,o,r),t.child;case 6:return e===null&&Av(t),null;case 13:return Ew(e,t,r);case 4:return Wm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Os(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:ci(n,i),e5(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,Dt(Qd,n._currentValue),n._currentValue=o,a!==null)if(bi(a.value,o)){if(a.children===i.children&&!hn.current){t=Oa(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=va(-1,r&-r),u.tag=2;var f=a.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?u.next=u:(u.next=h.next,h.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,ys(t,r),i=Zn(i),n=n(i),t.flags|=1,Kr(e,t,n,r),t.child;case 14:return n=t.type,i=ci(n,t.pendingProps),i=ci(n.type,i),t5(e,t,n,i,r);case 15:return bw(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ci(n,i),Ad(e,t),t.tag=1,pn(n)?(e=!0,Yd(t)):e=!1,ys(t,r),vw(t,n,i),Lv(t,n,i,r),Dv(null,t,n,!0,e,r);case 19:return Ow(e,t,r);case 22:return _w(e,t,r)}throw Error(Pe(156,t.tag))};function Bw(e,t){return h6(e,t)}function DP(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 Kn(e,t,r,n){return new DP(e,t,r,n)}function sy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jP(e){if(typeof e=="function")return sy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Cm)return 11;if(e===km)return 14}return 2}function uo(e,t){var r=e.alternate;return r===null?(r=Kn(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 Ld(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 es:return Jo(r.children,i,a,t);case xm:o=8,i|=8;break;case nv:return e=Kn(12,r,t,i|2),e.elementType=nv,e.lanes=a,e;case iv:return e=Kn(13,r,t,i),e.elementType=iv,e.lanes=a,e;case av:return e=Kn(19,r,t,i),e.elementType=av,e.lanes=a,e;case X_:return Fh(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K_:o=10;break e;case Y_:o=9;break e;case Cm:o=11;break e;case km:o=14;break e;case Ka:o=16,n=null;break e}throw Error(Pe(130,e==null?e:typeof e,""))}return t=Kn(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Jo(e,t,r,n){return e=Kn(7,e,n,t),e.lanes=r,e}function Fh(e,t,r,n){return e=Kn(22,e,n,t),e.elementType=X_,e.lanes=r,e.stateNode={isHidden:!1},e}function I1(e,t,r){return e=Kn(6,e,null,t),e.lanes=r,e}function D1(e,t,r){return t=Kn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function FP(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=v1(0),this.expirationTimes=v1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=v1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function uy(e,t,r,n,i,a,o,l,u){return e=new FP(e,t,r,l,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Kn(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 zP(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Jl,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Uw(e){if(!e)return po;e=e._reactInternals;e:{if(pl(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 U6(e,r,t)}return t}function Hw(e,t,r,n,i,a,o,l,u){return e=uy(r,n,!0,e,i,a,o,l,u),e.context=Uw(null),r=e.current,n=Yr(),i=so(r),a=va(n,i),a.callback=t??null,oo(r,a,i),e.current.lanes=i,Rc(e,i,n),gn(e,n),e}function zh(e,t,r,n){var i=t.current,a=Yr(),o=so(i);return r=Uw(r),t.context===null?t.context=r:t.pendingContext=r,t=va(a,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=oo(i,t,o),e!==null&&(pi(e,i,o,a),Cd(e,i,o)),o}function sh(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 h5(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){h5(e,t),(e=e.alternate)&&h5(e,t)}function BP(){return null}var $w=typeof reportError=="function"?reportError:function(e){console.error(e)};function fy(e){this._internalRoot=e}Bh.prototype.render=fy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Pe(409));zh(e,t,null,null)};Bh.prototype.unmount=fy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ol(function(){zh(null,e,null,null)}),t[Sa]=null}};function Bh(e){this._internalRoot=e}Bh.prototype.unstable_scheduleHydration=function(e){if(e){var t=_6();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Xa.length&&t!==0&&t<Xa[r].priority;r++);Xa.splice(r,0,e),r===0&&S6(e)}};function dy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Uh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function p5(){}function UP(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var f=sh(o);a.call(f)}}var o=Hw(t,n,e,0,null,!1,!1,"",p5);return e._reactRootContainer=o,e[Sa]=o.current,cc(e.nodeType===8?e.parentNode:e),ol(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var f=sh(u);l.call(f)}}var u=uy(e,0,!1,null,null,!1,!1,"",p5);return e._reactRootContainer=u,e[Sa]=u.current,cc(e.nodeType===8?e.parentNode:e),ol(function(){zh(t,u,r,n)}),u}function Hh(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=sh(o);l.call(u)}}zh(t,o,e,i)}else o=UP(r,t,e,i,n);return sh(o)}y6=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=zu(t.pendingLanes);r!==0&&(Rm(t,r|1),gn(t,ir()),!(_t&6)&&(Cs=ir()+500,wo()))}break;case 13:ol(function(){var n=Ea(e,1);if(n!==null){var i=Yr();pi(n,e,1,i)}}),cy(e,1)}};Mm=function(e){if(e.tag===13){var t=Ea(e,134217728);if(t!==null){var r=Yr();pi(t,e,134217728,r)}cy(e,134217728)}};b6=function(e){if(e.tag===13){var t=so(e),r=Ea(e,t);if(r!==null){var n=Yr();pi(r,e,t,n)}cy(e,t)}};_6=function(){return kt};w6=function(e,t){var r=kt;try{return kt=e,t()}finally{kt=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=Mh(n);if(!i)throw Error(Pe(90));Q_(n),sv(n,i)}}}break;case"textarea":e6(e,r);break;case"select":t=r.value,t!=null&&ps(e,!!r.multiple,t,!1)}};l6=ay;s6=ol;var HP={usingClientEntryPoint:!1,Events:[Lc,is,Mh,a6,o6,ay]},Mu={findFiberByHostInstance:Ko,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$P={bundleType:Mu.bundleType,version:Mu.version,rendererPackageName:Mu.rendererPackageName,rendererConfig:Mu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ca.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=f6(e),e===null?null:e.stateNode},findFiberByHostInstance:Mu.findFiberByHostInstance||BP,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 sd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sd.isDisabled&&sd.supportsFiber)try{kh=sd.inject($P),Ui=sd}catch{}}Rn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=HP;Rn.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dy(t))throw Error(Pe(200));return zP(e,t,null,r)};Rn.createRoot=function(e,t){if(!dy(e))throw Error(Pe(299));var r=!1,n="",i=$w;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[Sa]=t.current,cc(e.nodeType===8?e.parentNode:e),new fy(t)};Rn.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=f6(t),e=e===null?null:e.stateNode,e};Rn.flushSync=function(e){return ol(e)};Rn.hydrate=function(e,t,r){if(!Uh(t))throw Error(Pe(200));return Hh(null,e,t,!0,r)};Rn.hydrateRoot=function(e,t,r){if(!dy(e))throw Error(Pe(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",o=$w;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=Hw(t,null,e,1,r??null,i,!1,a,o),e[Sa]=t.current,cc(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 Bh(t)};Rn.render=function(e,t,r){if(!Uh(t))throw Error(Pe(200));return Hh(null,e,t,!1,r)};Rn.unmountComponentAtNode=function(e){if(!Uh(e))throw Error(Pe(40));return e._reactRootContainer?(ol(function(){Hh(null,null,e,!1,function(){e._reactRootContainer=null,e[Sa]=null})}),!0):!1};Rn.unstable_batchedUpdates=ay;Rn.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Uh(r))throw Error(Pe(200));if(e==null||e._reactInternals===void 0)throw Error(Pe(38));return Hh(e,t,r,!1,n)};Rn.version="18.3.1-next-f1338f8080-20240426";function Gw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Gw)}catch(e){console.error(e)}}Gw(),G_.exports=Rn;var Vw=G_.exports,g5=Vw;Fd.createRoot=g5.createRoot,Fd.hydrateRoot=g5.hydrateRoot;var qw={};function it(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 GP={};function hy(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:GP}var Ww=Object.assign,uh=Object.getOwnPropertyDescriptor,$i=Object.defineProperty,Ic=Object.prototype,Kv=[];Object.freeze(Kv);var py={};Object.freeze(py);var VP=typeof Proxy<"u",qP=Object.toString();function Kw(){VP||it("Proxy not available")}function Yw(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var fs=function(){};function An(e){return typeof e=="function"}function ll(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function $h(e){return e!==null&&typeof e=="object"}function Pa(e){if(!$h(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()===qP}function Xw(e){var t=e==null?void 0:e.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Dc(e,t,r){$i(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Zw(e,t,r){$i(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function So(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return $h(n)&&n[r]===!0}}function qs(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function WP(e){var t=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t),n=Object.getPrototypeOf(r);return n===null}function ha(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Qw=typeof Object.getOwnPropertySymbols<"u";function KP(e){var t=Object.keys(e);if(!Qw)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return Ic.propertyIsEnumerable.call(e,n)})):t}var ks=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Qw?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Jw(e){return e===null?null:typeof e=="object"?""+e:e}function ma(e,t){return Ic.hasOwnProperty.call(e,t)}var YP=Object.getOwnPropertyDescriptors||function(t){var r={};return ks(t).forEach(function(n){r[n]=uh(t,n)}),r};function v5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function XP(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,QP(n.key),n)}}function Gh(e,t,r){return t&&XP(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ds(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=JP(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 go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},go.apply(null,arguments)}function e8(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(r,n){return r.__proto__=n,r},Yv(e,t)}function ZP(e,t){if(typeof e!="object"||!e)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 QP(e){var t=ZP(e,"string");return typeof t=="symbol"?t:t+""}function JP(e,t){if(e){if(typeof e=="string")return v5(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v5(e,t):void 0}}var Bi=Symbol("mobx-stored-annotations");function gi(e){function t(r,n){if(jc(n))return e.decorate_20223_(r,n);Ws(r,n,e)}return Object.assign(t,e)}function Ws(e,t,r){ma(e,Bi)||Dc(e,Bi,go({},e[Bi])),sx(r)||(e[Bi][t]=r)}function ex(e){return ma(e,Bi)||Dc(e,Bi,go({},e[Bi])),e[Bi]}function jc(e){return typeof e=="object"&&typeof e.kind=="string"}var Ve=Symbol("mobx administration"),Fc=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_=Ot.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 b8(this)},t.reportChanged=function(){fn(),_8(this),dn()},t.toString=function(){return this.name_},e}(),gy=So("Atom",Fc);function bc(e,t,r){t===void 0&&(t=fs),r===void 0&&(r=fs);var n=new Fc(e);return t!==fs&&T8(n,t),r!==fs&&wy(n,r),n}function tx(e,t){return e===t}function rx(e,t){return Ry(e,t)}function nx(e,t){return Ry(e,t,1)}function ix(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var sl={identity:tx,structural:rx,default:ix,shallow:nx};function ul(e,t,r){return Qh(e)?e:Array.isArray(e)?Rt.array(e,{name:r}):Pa(e)?Rt.object(e,void 0,{name:r}):qs(e)?Rt.map(e,{name:r}):ha(e)?Rt.set(e,{name:r}):typeof e=="function"&&!Bc(e)&&!Ms(e)?Xw(e)?fl(e):As(r,e):e}function ax(e,t,r){if(e==null||Cr(e)||Jr(e)||Ir(e)||Xr(e))return e;if(Array.isArray(e))return Rt.array(e,{name:r,deep:!1});if(Pa(e))return Rt.object(e,void 0,{name:r,deep:!1});if(qs(e))return Rt.map(e,{name:r,deep:!1});if(ha(e))return Rt.set(e,{name:r,deep:!1})}function Vh(e){return e}function ox(e,t){return Ry(e,t)?t:e}var t8="override",lx=gi({annotationType_:t8,make_:ux,extend_:cx,decorate_20223_:fx});function sx(e){return e.annotationType_===t8}function ux(e,t){return 0}function cx(e,t,r,n){it("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function fx(e,t){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function zc(e,t){return{annotationType_:e,options_:t,make_:dx,extend_:hx,decorate_20223_:px}}function dx(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(Bc(r.value))return 1;var a=r8(e,this,t,r,!1);return $i(n,t,a),2}function hx(e,t,r,n){var i=r8(e,this,t,r);return e.defineProperty_(t,i,n)}function px(e,t){var r=t.kind,n=t.name,i=t.addInitializer,a=this,o=function(f){var h,O,w,b;return vo((h=(O=a.options_)==null?void 0:O.name)!=null?h:n.toString(),f,(w=(b=a.options_)==null?void 0:b.autoAction)!=null?w:!1)};if(r=="field"){i(function(){Ws(this,n,a)});return}if(r=="method"){var l;return Bc(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}it("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
|
|
34
|
+
'`+a.annotationType_+"' can only be used on properties with a function value."))}function gx(e,t,r,n){t.annotationType_,n.value}function r8(e,t,r,n,i){var a,o,l,u,f,h,O;i===void 0&&(i=Te.safeDescriptors),gx(e,t,r,n);var w=n.value;if((a=t.options_)!=null&&a.bound){var b;w=w.bind((b=e.proxy_)!=null?b:e.target_)}return{value:vo((o=(l=t.options_)==null?void 0:l.name)!=null?o:r.toString(),w,(u=(f=t.options_)==null?void 0:f.autoAction)!=null?u:!1,(h=t.options_)!=null&&h.bound?(O=e.proxy_)!=null?O:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function n8(e,t){return{annotationType_:e,options_:t,make_:vx,extend_:mx,decorate_20223_:yx}}function vx(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&&(!ma(e.target_,t)||!Ms(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(Ms(r.value))return 1;var a=i8(e,this,t,r,!1,!1);return $i(n,t,a),2}function mx(e,t,r,n){var i,a=i8(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,n)}function yx(e,t){var r,n=t.name,i=t.addInitializer;return Ms(e)||(e=fl(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 bx(e,t,r,n){t.annotationType_,n.value}function i8(e,t,r,n,i,a){a===void 0&&(a=Te.safeDescriptors),bx(e,t,r,n);var o=n.value;if(Ms(o)||(o=fl(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_:_x,extend_:wx,decorate_20223_:Sx}}function _x(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function wx(e,t,r,n){return Ex(e,this,t,r),e.defineComputedProperty_(t,go({},this.options_,{get:r.get,set:r.set}),n)}function Sx(e,t){var r=this,n=t.name,i=t.addInitializer;return i(function(){var a=ml(this)[Ve],o=go({},r.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new qi(o))}),function(){return this[Ve].getObservablePropValue_(n)}}function Ex(e,t,r,n){t.annotationType_,n.get}function qh(e,t){return{annotationType_:e,options_:t,make_:Ox,extend_:Px,decorate_20223_:xx}}function Ox(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function Px(e,t,r,n){var i,a;return Cx(e,this),e.defineObservableProperty_(t,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:ul,n)}function xx(e,t){var r=this,n=t.kind,i=t.name,a=new WeakSet;function o(l,u){var f,h,O=ml(l)[Ve],w=new co(u,(f=(h=r.options_)==null?void 0:h.enhancer)!=null?f:ul,"ObservableObject."+i.toString(),!1);O.values_.set(i,w),a.add(l)}if(n=="accessor")return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[Ve].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[Ve].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function Cx(e,t,r,n){t.annotationType_}var kx="true",Tx=a8();function a8(e){return{annotationType_:kx,options_:e,make_:Ax,extend_:Rx,decorate_20223_:Mx}}function Ax(e,t,r,n){var i,a;if(r.get)return gl.make_(e,t,r,n);if(r.set){var o=vo(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:Te.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:($i(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var l;if(Xw(r.value)){var u,f=(u=this.options_)!=null&&u.autoBind?fl.bound:fl;return f.make_(e,t,r,n)}var h=(l=this.options_)!=null&&l.autoBind?As.bound:As;return h.make_(e,t,r,n)}var O=((i=this.options_)==null?void 0:i.deep)===!1?Rt.ref:Rt;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var w;r.value=r.value.bind((w=e.proxy_)!=null?w:e.target_)}return O.make_(e,t,r,n)}function Rx(e,t,r,n){var i,a;if(r.get)return gl.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:Te.safeDescriptors?e.isPlainObject_:!0,set:vo(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?Rt.ref:Rt;return l.extend_(e,t,r,n)}function Mx(e,t){it("'"+this.annotationType_+"' cannot be used as a decorator")}var Lx="observable",Nx="observable.ref",Ix="observable.shallow",Dx="observable.struct",o8={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(o8);function ud(e){return e||o8}var Xv=qh(Lx),jx=qh(Nx,{enhancer:Vh}),Fx=qh(Ix,{enhancer:ax}),zx=qh(Dx,{enhancer:ox}),l8=gi(Xv);function cd(e){return e.deep===!0?ul:e.deep===!1?Vh:Ux(e.defaultDecorator)}function Bx(e){var t;return e?(t=e.defaultDecorator)!=null?t:a8(e):void 0}function Ux(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:ul}function s8(e,t,r){if(jc(t))return Xv.decorate_20223_(e,t);if(ll(t)){Ws(e,t,Xv);return}return Qh(e)?e:Pa(e)?Rt.object(e,t,r):Array.isArray(e)?Rt.array(e,t):qs(e)?Rt.map(e,t):ha(e)?Rt.set(e,t):typeof e=="object"&&e!==null?e:Rt.box(e,t)}Ww(s8,l8);var Hx={box:function(t,r){var n=ud(r);return new co(t,cd(n),n.name,!0,n.equals)},array:function(t,r){var n=ud(r);return(Te.useProxies===!1||n.proxy===!1?KC:FC)(t,cd(n),n.name)},map:function(t,r){var n=ud(r);return new ep(t,cd(n),n.name)},set:function(t,r){var n=ud(r);return new Ty(t,cd(n),n.name)},object:function(t,r,n){return Eo(function(){return Sy(Te.useProxies===!1||(n==null?void 0:n.proxy)===!1?ml({},n):NC({},n),t,r)})},ref:gi(jx),shallow:gi(Fx),deep:l8,struct:gi(zx)},Rt=Ww(s8,Hx),u8="computed",$x="computed.struct",Zv=vy(u8),Gx=vy($x,{equals:sl.structural}),gl=function(t,r){if(jc(r))return Zv.decorate_20223_(t,r);if(ll(r))return Ws(t,r,Zv);if(Pa(t))return gi(vy(u8,t));var n=Pa(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new qi(n)};Object.assign(gl,Zv);gl.struct=gi(Gx);var m5,y5,ch=0,Vx=1,qx=(m5=(y5=uh(function(){},"name"))==null?void 0:y5.configurable)!=null?m5:!1,b5={value:"action",configurable:!0,writable:!1,enumerable:!1};function vo(e,t,r,n){r===void 0&&(r=!1);function i(){return c8(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},qx&&(b5.value=e,$i(i,"name",b5)),i}function c8(e,t,r,n,i){var a=f8(e,t);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{d8(a)}}function f8(e,t,r,n){var i=!1,a=0,o=Te.trackingDerivation,l=!t||!o;fn();var u=Te.allowStateChanges;l&&(vl(),u=Wh(!0));var f=Yh(!0),h={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:f,notifySpy_:i,startTime_:a,actionId_:Vx++,parentActionId_:ch};return ch=h.actionId_,h}function d8(e){ch!==e.actionId_&&it(30),ch=e.parentActionId_,e.error_!==void 0&&(Te.suppressReactionErrors=!0),Kh(e.prevAllowStateChanges_),_s(e.prevAllowStateReads_),dn(),e.runAsAction_&&ya(e.prevDerivation_),Te.suppressReactionErrors=!1}function my(e,t){var r=Wh(e);try{return t()}finally{Kh(r)}}function Wh(e){var t=Te.allowStateChanges;return Te.allowStateChanges=e,t}function Kh(e){Te.allowStateChanges=e}var co=function(e){function t(n,i,a,o,l){var u;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=sl.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}e8(t,e);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!==Te.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(qn(this)){var a=Wn(this,{object:this,type:Gi,newValue:i});if(!a)return Te.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Te.UNCHANGED:i},r.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),vi(this)&&mi(this,{type:Gi,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Uc(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Gi,newValue:this.value_,oldValue:void 0}),Hc(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 Jw(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},t}(Fc),yy=So("ObservableValue",co);function fd(e,t){return!!(e&t)}function dd(e,t,r){return r?e|=t:e&=~t,e}var qi=function(){function e(r){this.dependenciesState_=Ot.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Ot.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new dh(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=fh.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,r.get||it(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=vo("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?sl.structural:sl.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){rC(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&&it(32,this.name_,this.derivation),Te.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Qv(this)&&(this.warnAboutUntrackedRead_(),fn(),this.value_=this.computeValue_(!1),dn());else if(b8(this),Qv(this)){var n=Te.trackingContext;this.keepAlive_&&!n&&(Te.trackingContext=this),this.trackAndCompute()&&tC(this),Te.trackingContext=n}var i=this.value_;if(Nd(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter&&it(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else it(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===Ot.NOT_TRACKING_,a=this.computeValue_(!0),o=i||Nd(n)||Nd(a)||!this.equals_(n,a);return o&&(this.value_=a),o},t.computeValue_=function(n){this.isComputing=!0;var i=Wh(!1),a;if(n)a=h8(this,this.derivation,this.scope_);else if(Te.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new dh(o)}return Kh(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=vl();n({observableKind:"computed",debugObjectName:a.name_,type:Gi,object:a,newValue:u,oldValue:l}),ya(f)}o=!1,l=u})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Jw(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},Gh(e,[{key:"isComputing",get:function(){return fd(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=dd(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return fd(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=dd(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return fd(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=dd(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return fd(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=dd(this.flags_,e.isPendingUnobservationMask_,n)}}])}();qi.isComputingMask_=1;qi.isRunningSetterMask_=2;qi.isBeingObservedMask_=4;qi.isPendingUnobservationMask_=8;var cl=So("ComputedValue",qi),Ot;(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_"})(Ot||(Ot={}));var fh;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(fh||(fh={}));var dh=function(t){this.cause=void 0,this.cause=t};function Nd(e){return e instanceof dh}function Qv(e){switch(e.dependenciesState_){case Ot.UP_TO_DATE_:return!1;case Ot.NOT_TRACKING_:case Ot.STALE_:return!0;case Ot.POSSIBLY_STALE_:{for(var t=Yh(!0),r=vl(),n=e.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if(cl(o)){if(Te.disableErrorBoundaries)o.get();else try{o.get()}catch{return ya(r),_s(t),!0}if(e.dependenciesState_===Ot.STALE_)return ya(r),_s(t),!0}}return p8(e),ya(r),_s(t),!1}}}function Wx(){return Te.trackingDerivation!==null}function h8(e,t,r){var n=Yh(!0);p8(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Te.runId;var i=Te.trackingDerivation;Te.trackingDerivation=e,Te.inBatch++;var a;if(Te.disableErrorBoundaries===!0)a=t.call(r);else try{a=t.call(r)}catch(o){a=new dh(o)}return Te.inBatch--,Te.trackingDerivation=i,Kx(e),_s(n),a}function Kx(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=Ot.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&&m8(u,e),u.diffValue_=0}for(;i--;){var f=r[i];f.diffValue_===1&&(f.diffValue_=0,eC(f,e))}n!==Ot.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function Jv(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)m8(t[r],e);e.dependenciesState_=Ot.NOT_TRACKING_}function by(e){var t=vl();try{return e()}finally{ya(t)}}function vl(){var e=Te.trackingDerivation;return Te.trackingDerivation=null,e}function ya(e){Te.trackingDerivation=e}function Yh(e){var t=Te.allowStateReads;return Te.allowStateReads=e,t}function _s(e){Te.allowStateReads=e}function p8(e){if(e.dependenciesState_!==Ot.UP_TO_DATE_){e.dependenciesState_=Ot.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=Ot.UP_TO_DATE_}}var Yx=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],Qu=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},Id=!0,g8=!1,Te=function(){var e=hy();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Id=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Qu().version&&(Id=!1),Id?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Qu):(setTimeout(function(){g8||it(35)},1),new Qu)}();function Xx(){if((Te.pendingReactions.length||Te.inBatch||Te.isRunningReactions)&&it(36),g8=!0,Id){var e=hy();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Te=new Qu}}function v8(){return Te}function Zx(){var e=new Qu;for(var t in e)Yx.indexOf(t)===-1&&(Te[t]=e[t]);Te.allowStateChanges=!Te.enforceActions}function Qx(e){return e.observers_&&e.observers_.size>0}function Jx(e){return e.observers_}function eC(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function m8(e,t){e.observers_.delete(t),e.observers_.size===0&&y8(e)}function y8(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Te.pendingUnobservations.push(e))}function fn(){Te.inBatch++}function dn(){if(--Te.inBatch===0){w8();for(var e=Te.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 qi&&r.suspend_())}Te.pendingUnobservations=[]}}function b8(e){var t=Te.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&Te.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&Te.inBatch>0&&y8(e),!1)}function _8(e){e.lowestObserverState_!==Ot.STALE_&&(e.lowestObserverState_=Ot.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ot.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=Ot.STALE_}))}function tC(e){e.lowestObserverState_!==Ot.STALE_&&(e.lowestObserverState_=Ot.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ot.POSSIBLY_STALE_?t.dependenciesState_=Ot.STALE_:t.dependenciesState_===Ot.UP_TO_DATE_&&(e.lowestObserverState_=Ot.UP_TO_DATE_)}))}function rC(e){e.lowestObserverState_===Ot.UP_TO_DATE_&&(e.lowestObserverState_=Ot.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ot.UP_TO_DATE_&&(t.dependenciesState_=Ot.POSSIBLY_STALE_,t.onBecomeStale_())}))}var Ts=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_=Ot.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_=fh.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,Te.pendingReactions.push(this),w8())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){fn(),this.isScheduled_=!1;var n=Te.trackingContext;if(Te.trackingContext=this,Qv(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Te.trackingContext=n,dn()}},t.track=function(n){if(!this.isDisposed_){fn(),this.isRunning_=!0;var i=Te.trackingContext;Te.trackingContext=this;var a=h8(this,n,void 0);Te.trackingContext=i,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Jv(this),Nd(a)&&this.reportExceptionInDerivation_(a.cause),dn()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Te.disableErrorBoundaries)throw n;var a="[mobx] uncaught error in '"+this+"'";Te.suppressReactionErrors||console.error(a,n),Te.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[Ve]=this,a},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){},e}();function nC(e){return Te.globalReactionErrorHandlers.push(e),function(){var t=Te.globalReactionErrorHandlers.indexOf(e);t>=0&&Te.globalReactionErrorHandlers.splice(t,1)}}var iC=100,em=function(t){return t()};function w8(){Te.inBatch>0||Te.isRunningReactions||em(aC)}function aC(){Te.isRunningReactions=!0;for(var e=Te.pendingReactions,t=0;e.length>0;){++t===iC&&(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_()}Te.isRunningReactions=!1}var hh=So("Reaction",Ts);function oC(e){var t=em;em=function(n){return e(function(){return t(n)})}}function Ju(){return!1}function S8(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var E8="action",lC="action.bound",O8="autoAction",sC="autoAction.bound",P8="<unnamed action>",tm=zc(E8),uC=zc(lC,{bound:!0}),rm=zc(O8,{autoAction:!0}),cC=zc(sC,{autoAction:!0,bound:!0});function x8(e){var t=function(n,i){if(An(n))return vo(n.name||P8,n,e);if(An(i))return vo(n,i,e);if(jc(i))return(e?rm:tm).decorate_20223_(n,i);if(ll(i))return Ws(n,i,e?rm:tm);if(ll(n))return gi(zc(e?O8:E8,{name:n,autoAction:e}))};return t}var ur=x8(!1);Object.assign(ur,tm);var As=x8(!0);Object.assign(As,rm);ur.bound=gi(uC);As.bound=gi(cC);function Rs(e){return c8(e.name||P8,!1,e,this,void 0)}function Bc(e){return An(e)&&e.isMobxAction===!0}function _y(e,t){var r,n,i,a;t===void 0&&(t=py);var o=(r=(n=t)==null?void 0:n.name)!=null?r:"Autorun",l=!t.scheduler&&!t.delay,u;if(l)u=new Ts(o,function(){this.track(O)},t.onError,t.requiresObservable);else{var f=C8(t),h=!1;u=new Ts(o,function(){h||(h=!0,f(function(){h=!1,u.isDisposed_||u.track(O)}))},t.onError,t.requiresObservable)}function O(){e(u)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||u.schedule_(),u.getDisposer_((a=t)==null?void 0:a.signal)}var fC=function(t){return t()};function C8(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:fC}function k8(e,t,r){var n,i,a;r===void 0&&(r=py);var o=(n=r.name)!=null?n:"Reaction",l=ur(o,r.onError?dC(r.onError,t):t),u=!r.scheduler&&!r.delay,f=C8(r),h=!0,O=!1,w,b=r.compareStructural?sl.structural:r.equals||sl.default,E=new Ts(o,function(){h||u?p():O||(O=!0,f(p))},r.onError,r.requiresObservable);function p(){if(O=!1,!E.isDisposed_){var v=!1,g=w;E.track(function(){var y=my(!1,function(){return e(E)});v=h||!b(w,y),w=y}),(h&&r.fireImmediately||!h&&v)&&l(w,g,E),h=!1}}return(i=r)!=null&&(i=i.signal)!=null&&i.aborted||E.schedule_(),E.getDisposer_((a=r)==null?void 0:a.signal)}function dC(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var hC="onBO",pC="onBUO";function T8(e,t,r){return A8(hC,e,t,r)}function wy(e,t,r){return A8(pC,e,t,r)}function A8(e,t,r,n){var i=typeof n=="function"?Wi(t,r):Wi(t),a=An(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 gC="never",hd="always",vC="observed";function R8(e){e.isolateGlobalState===!0&&Xx();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(Te.useProxies=t===hd?!0:t===gC?!1:typeof Proxy<"u"),t==="ifavailable"&&(Te.verifyProxies=!0),r!==void 0){var n=r===hd?hd:r===vC;Te.enforceActions=n,Te.allowStateChanges=!(n===!0||n===hd)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(Te[i]=!!e[i])}),Te.allowStateReads=!Te.observableRequiresReaction,e.reactionScheduler&&oC(e.reactionScheduler)}function Sy(e,t,r,n){var i=YP(t);return Eo(function(){var a=ml(e,n)[Ve];ks(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function M8(e,t){return L8(Wi(e,t))}function L8(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=yC(e.observing_).map(L8)),t}function mC(e,t){return N8(Wi(e,t))}function N8(e){var t={name:e.name_};return Qx(e)&&(t.observers=Array.from(Jx(e)).map(N8)),t}function yC(e){return Array.from(new Set(e))}var bC=0;function Xh(){this.message="FLOW_CANCELLED"}Xh.prototype=Object.create(Error.prototype);function _C(e){return e instanceof Xh}var j1=n8("flow"),wC=n8("flow.bound",{bound:!0}),fl=Object.assign(function(t,r){if(jc(r))return j1.decorate_20223_(t,r);if(ll(r))return Ws(t,r,j1);var n=t,i=n.name||"<unnamed flow>",a=function(){var l=this,u=arguments,f=++bC,h=ur(i+" - runid: "+f+" - init",n).apply(l,u),O,w=void 0,b=new Promise(function(E,p){var v=0;O=p;function g(m){w=void 0;var _;try{_=ur(i+" - runid: "+f+" - yield "+v++,h.next).call(h,m)}catch(k){return p(k)}d(_)}function y(m){w=void 0;var _;try{_=ur(i+" - runid: "+f+" - yield "+v++,h.throw).call(h,m)}catch(k){return p(k)}d(_)}function d(m){if(An(m==null?void 0:m.then)){m.then(d,p);return}return m.done?E(m.value):(w=Promise.resolve(m.value),w.then(g,y))}g(void 0)});return b.cancel=ur(i+" - runid: "+f+" - cancel",function(){try{w&&_5(w);var E=h.return(void 0),p=Promise.resolve(E.value);p.then(fs,fs),_5(p),O(new Xh)}catch(v){O(v)}}),b};return a.isMobXFlow=!0,a},j1);fl.bound=gi(wC);function _5(e){An(e.cancel)&&e.cancel()}function SC(e){return e}function Ms(e){return(e==null?void 0:e.isMobXFlow)===!0}function Ey(e,t,r){var n;return Ir(e)||Jr(e)||yy(e)?n=_i(e):Cr(e)&&(n=_i(e,t)),n.dehancer=typeof t=="function"?t:r,function(){n.dehancer=void 0}}function Zh(e,t,r){return An(r)?OC(e,t,r):EC(e,t)}function EC(e,t){return _i(e).intercept_(t)}function OC(e,t,r){return _i(e,t).intercept_(r)}function I8(e,t){if(t===void 0)return cl(e);if(Cr(e)===!1||!e[Ve].values_.has(t))return!1;var r=Wi(e,t);return cl(r)}function PC(e){return I8(e)}function D8(e,t){return I8(e,t)}function j8(e,t){return e?t!==void 0?Cr(e)?e[Ve].values_.has(t):!1:Cr(e)||!!e[Ve]||gy(e)||hh(e)||cl(e):!1}function Qh(e){return j8(e)}function F8(e,t){return j8(e,t)}function _c(e){if(Cr(e))return e[Ve].keys_();if(Ir(e)||Xr(e))return Array.from(e.keys());if(Jr(e))return e.map(function(t,r){return r});it(5)}function Oy(e){if(Cr(e))return _c(e).map(function(t){return e[t]});if(Ir(e))return _c(e).map(function(t){return e.get(t)});if(Xr(e))return Array.from(e.values());if(Jr(e))return e.slice();it(6)}function z8(e){if(Cr(e))return _c(e).map(function(t){return[t,e[t]]});if(Ir(e))return _c(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]});it(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}Cr(e)?e[Ve].set_(t,r):Ir(e)?e.set(t,r):Xr(e)?e.add(t):Jr(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&it("Invalid index: '"+t+"'"),fn(),t>=e.length&&(e.length=t+1),e[t]=r,dn()):it(8)}function xC(e,t){Cr(e)?e[Ve].delete_(t):Ir(e)||Xr(e)?e.delete(t):Jr(e)?(typeof t!="number"&&(t=parseInt(t,10)),e.splice(t,1)):it(9)}function B8(e,t){if(Cr(e))return e[Ve].has_(t);if(Ir(e))return e.has(t);if(Xr(e))return e.has(t);if(Jr(e))return t>=0&&t<e.length;it(10)}function CC(e,t){if(B8(e,t)){if(Cr(e))return e[Ve].get_(t);if(Ir(e))return e.get(t);if(Jr(e))return e[t];it(11)}}function xy(e,t,r){if(Cr(e))return e[Ve].defineProperty_(t,r);it(39)}function U8(e){if(Cr(e))return e[Ve].ownKeys_();it(38)}function Jh(e,t,r,n){return An(r)?TC(e,t,r,n):kC(e,t,r)}function kC(e,t,r){return _i(e).observe_(t,r)}function TC(e,t,r,n){return _i(e,t).observe_(r,n)}function pd(e,t,r){return e.set(t,r),r}function Ql(e,t){if(e==null||typeof e!="object"||e instanceof Date||!Qh(e))return e;if(yy(e)||cl(e))return Ql(e.get(),t);if(t.has(e))return t.get(e);if(Jr(e)){var r=pd(t,e,new Array(e.length));return e.forEach(function(o,l){r[l]=Ql(o,t)}),r}if(Xr(e)){var n=pd(t,e,new Set);return e.forEach(function(o){n.add(Ql(o,t))}),n}if(Ir(e)){var i=pd(t,e,new Map);return e.forEach(function(o,l){i.set(l,Ql(o,t))}),i}else{var a=pd(t,e,{});return U8(e).forEach(function(o){Ic.propertyIsEnumerable.call(e,o)&&(a[o]=Ql(e[o],t))}),a}}function AC(e,t){return Ql(e,new Map)}function RC(){}function Fi(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"?MC(e,t):H8(e,t,r||{})}function H8(e,t,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[Ve].isDisposed_)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=vo("When-effect",t),o=_y(function(l){var u=my(!1,e);u&&(l.dispose(),n&&clearTimeout(n),a())},r);return o}function MC(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=H8(e,o,go({},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 Kl(e){return e[Ve]}var LC={has:function(t,r){return Kl(t).has_(r)},get:function(t,r){return Kl(t).get_(r)},set:function(t,r,n){var i;return ll(r)?(i=Kl(t).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(t,r){var n;return ll(r)?(n=Kl(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return(i=Kl(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return Kl(t).ownKeys_()},preventExtensions:function(t){it(13)}};function NC(e,t){var r,n;return Kw(),e=ml(e,t),(n=(r=e[Ve]).proxy_)!=null?n:r.proxy_=new Proxy(e,LC)}function qn(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Uc(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),Yw(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Wn(e,t){var r=vl();try{for(var n=[].concat(e.interceptors_||[]),i=0,a=n.length;i<a&&(t=n[i](t),t&&!t.type&&it(14),!!t);i++);return t}finally{ya(r)}}function vi(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Hc(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),Yw(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function mi(e,t){var r=vl(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](t);ya(r)}}function Cy(e,t,r){return Eo(function(){var n,i=ml(e,r)[Ve];(n=t)!=null||(t=ex(e)),ks(t).forEach(function(a){return i.make_(a,t[a])})}),e}var F1=Symbol("mobx-keys");function IC(e,t,r){return Pa(e)?Sy(e,e,t,r):(Eo(function(){var n=ml(e,r)[Ve];if(!e[F1]){var i=Object.getPrototypeOf(e),a=new Set([].concat(ks(e),ks(i)));a.delete("constructor"),a.delete(Ve),Dc(i,F1,a)}e[F1].forEach(function(o){return n.make_(o,t&&o in t?t[o]:!0)})}),e)}var w5="splice",Gi="update",DC=1e4,jC={get:function(t,r){var n=t[Ve];return r===Ve?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):ma(ph,r)?ph[r]:t[r]},set:function(t,r,n){var i=t[Ve];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){it(15)}},ky=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 Fc(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 Uc(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}),Hc(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&it("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var a=new Array(n-i),o=0;o<n-i;o++)a[o]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&it(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&W8(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),qn(this)){var u=Wn(this,{object:this.proxy_,type:w5,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(O){return o.enhancer_(O,void 0)}),this.legacyMode_){var f=a.length-i;this.updateArrayLength_(l,f)}var h=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,h),this.dehanceValues_(h)},t.spliceItemsIntoValues_=function(n,i,a){if(a.length<DC){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 h=0;h<u.length;h++)this.values_[n+a.length+h]=u[h];return l}},t.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&Ju(),l=vi(this),u=l||o?{observableKind:"array",object:this.proxy_,type:Gi,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&mi(this,u)},t.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&Ju(),l=vi(this),u=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:w5,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&mi(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&&it(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(qn(this)){var l=Wn(this,{type:Gi,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),h=0;h<f.length-1;h++)f[h]=void 0;f[f.length-1]=i,this.spliceWithArray_(a.length,0,f)}},e}();function FC(e,t,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),Kw(),Eo(function(){var i=new ky(r,t,n,!1);Zw(i.values_,Ve,i);var a=new Proxy(i.values_,jC);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var ph={clear:function(){return this.splice(0)},replace:function(t){var r=this[Ve];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[Ve];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[Ve].spliceWithArray_(t,r,n)},push:function(){for(var t=this[Ve],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[Ve].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[Ve],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 Te.trackingDerivation&&it(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Te.trackingDerivation&&it(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[Ve],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};jt("at",Ln);jt("concat",Ln);jt("flat",Ln);jt("includes",Ln);jt("indexOf",Ln);jt("join",Ln);jt("lastIndexOf",Ln);jt("slice",Ln);jt("toString",Ln);jt("toLocaleString",Ln);jt("toSorted",Ln);jt("toSpliced",Ln);jt("with",Ln);jt("every",wi);jt("filter",wi);jt("find",wi);jt("findIndex",wi);jt("findLast",wi);jt("findLastIndex",wi);jt("flatMap",wi);jt("forEach",wi);jt("map",wi);jt("some",wi);jt("toReversed",wi);jt("reduce",$8);jt("reduceRight",$8);function jt(e,t){typeof Array.prototype[e]=="function"&&(ph[e]=t(e))}function Ln(e){return function(){var t=this[Ve];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function wi(e){return function(t,r){var n=this,i=this[Ve];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[e](function(o,l){return t.call(r,o,l,n)})}}function $8(e){return function(){var t=this,r=this[Ve];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(a,o,l){return i(a,o,l,t)},n[e].apply(n,arguments)}}var zC=So("ObservableArrayAdministration",ky);function Jr(e){return $h(e)&&zC(e[Ve])}var BC={},to="add",gh="delete",ep=function(){function e(r,n,i){var a=this;n===void 0&&(n=ul),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ve]=BC,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,An(Map)||it(18),Eo(function(){a.keysAtom_=bc("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,r&&a.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!Te.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var o=a=new co(this.has_(n),Vh,"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(qn(this)){var o=Wn(this,{type:a?Gi:to,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_,qn(this)){var a=Wn(this,{type:gh,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=Ju(),l=vi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:gh,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return Fi(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var h=i.data_.get(n);h.setNewValue_(void 0),i.data_.delete(n)}),l&&mi(this,u),!0}return!1},t.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==Te.UNCHANGED){var o=Ju(),l=vi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Gi,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&mi(this,u)}},t.addValue_=function(n,i){var a=this;this.keysAtom_,Fi(function(){var f,h=new co(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,h),i=h.value_,(f=a.hasMap_.get(n))==null||f.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Ju(),l=vi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:to,object:this,name:n,newValue:i}:null;l&&mi(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 wc({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 wc({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:[u,n.get(u)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(n,i){for(var a=ds(this),o;!(o=a()).done;){var l=o.value,u=l[0],f=l[1];n.call(i,f,u,this)}},t.merge=function(n){var i=this;return Ir(n)&&(n=new Map(n)),Fi(function(){Pa(n)?KP(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)}):qs(n)?(WP(n)||it(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&it(20,n)}),this},t.clear=function(){var n=this;Fi(function(){by(function(){for(var i=ds(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.replace=function(n){var i=this;return Fi(function(){for(var a=UC(n),o=new Map,l=!1,u=ds(i.data_.keys()),f;!(f=u()).done;){var h=f.value;if(!a.has(h)){var O=i.delete(h);if(O)l=!0;else{var w=i.data_.get(h);o.set(h,w)}}}for(var b=ds(a.entries()),E;!(E=b()).done;){var p=E.value,v=p[0],g=p[1],y=i.data_.has(v);if(i.set(v,g),i.data_.has(v)){var d=i.data_.get(v);o.set(v,d),y||(l=!0)}}if(!l)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var m=i.data_.keys(),_=o.keys(),k=m.next(),x=_.next();!k.done;){if(k.value!==x.value){i.keysAtom_.reportChanged();break}k=m.next(),x=_.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return Hc(this,n)},t.intercept_=function(n){return Uc(this,n)},Gh(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Ir=So("ObservableMap",ep);function UC(e){if(qs(e)||Ir(e))return e;if(Array.isArray(e))return new Map(e);if(Pa(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return it(21,e)}var HC={},Ty=function(){function e(r,n,i){var a=this;n===void 0&&(n=ul),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Ve]=HC,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,An(Set)||it(22),this.enhancer_=function(o,l){return n(o,l,i)},Eo(function(){a.atom_=bc(a.name_),r&&a.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;Fi(function(){by(function(){for(var i=ds(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.forEach=function(n,i){for(var a=ds(this),o;!(o=a()).done;){var l=o.value;n.call(i,l,l,this)}},t.add=function(n){var i=this;if(this.atom_,qn(this)){var a=Wn(this,{type:to,object:this,newValue:n});if(!a)return this}if(!this.has(n)){Fi(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,l=vi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:to,object:this,newValue:n}:null;l&&mi(this,u)}return this},t.delete=function(n){var i=this;if(qn(this)){var a=Wn(this,{type:gh,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,l=vi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:gh,object:this,oldValue:n}:null;return Fi(function(){i.atom_.reportChanged(),i.data_.delete(n)}),l&&mi(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 wc({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 wc({next:function(){return i<a.length?{value:n.dehanceValue_(a[i++]),done:!1}:{done:!0}}})},t.intersection=function(n){if(ha(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},t.union=function(n){if(ha(n))return n.union(this);var i=new Set(this);return i.union(n)},t.difference=function(n){return new Set(this).difference(n)},t.symmetricDifference=function(n){if(ha(n))return n.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(n)},t.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},t.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},t.isDisjointFrom=function(n){if(ha(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},t.replace=function(n){var i=this;return Xr(n)&&(n=new Set(n)),Fi(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):ha(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&it("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return Hc(this,n)},t.intercept_=function(n){return Uc(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},Gh(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Xr=So("ObservableSet",Ty),S5=Object.create(null),E5="remove",G8=function(){function e(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=Tx),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 Fc("ObservableObject.keys"),this.isPlainObject_=Pa(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 qi)return a.set(i),!0;if(qn(this)){var o=Wn(this,{type:Gi,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Te.UNCHANGED){var l=vi(this),u=!1,f=l||u?{type:Gi,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&mi(this,f)}return!0},t.get_=function(n){return Te.trackingDerivation&&!ma(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,a){return a===void 0&&(a=!1),ma(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(!Te.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new co(n in this.target_,Vh,"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_[Bi])!=null&&a[n])return;it(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==Ic;){var l=uh(o,n);if(l){var u=i.make_(this,n,l,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}P5(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&&P5(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(qn(this)){var l=Wn(this,{object:this.proxy_||this.target_,name:n,type:to,newValue:i.value});if(!l)return null;var u=l.newValue;i.value!==u&&(i=go({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else $i(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(qn(this)){var u=Wn(this,{object:this.proxy_||this.target_,name:n,type:to,newValue:i});if(!u)return null;i=u.newValue}var f=O5(n),h={configurable:Te.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(o){if(!Reflect.defineProperty(this.target_,n,h))return!1}else $i(this.target_,n,h);var O=new co(i,a,"ObservableObject.key",!1);this.values_.set(n,O),this.notifyPropertyAddition_(n,O.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(qn(this)){var l=Wn(this,{object:this.proxy_||this.target_,name:n,type:to,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=O5(n),f={configurable:Te.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,n,f))return!1}else $i(this.target_,n,f);this.values_.set(n,new qi(i)),this.notifyPropertyAddition_(n,void 0)}finally{dn()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!ma(this.target_,n))return!0;if(qn(this)){var a=Wn(this,{object:this.proxy_||this.target_,name:n,type:E5});if(!a)return null}try{var o;fn();var l=vi(this),u=!1,f=this.values_.get(n),h=void 0;if(!f&&(l||u)){var O;h=(O=uh(this.target_,n))==null?void 0:O.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(f&&(this.values_.delete(n),f instanceof co&&(h=f.value_),_8(f)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(n in this.target_),l||u){var w={type:E5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:h,name:n};l&&mi(this,w)}}finally{dn()}return!0},t.observe_=function(n,i){return Hc(this,n)},t.intercept_=function(n){return Uc(this,n)},t.notifyPropertyAddition_=function(n,i){var a,o=vi(this),l=!1;if(o||l){var u=o||l?{type:to,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;o&&mi(this,u)}(a=this.pendingKeys_)==null||(a=a.get(n))==null||a.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),ks(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function ml(e,t){var r;if(ma(e,Ve))return e;var n=(r=t==null?void 0:t.name)!=null?r:"ObservableObject",i=new G8(e,new Map,String(n),Bx(t));return Dc(e,Ve,i),e}var $C=So("ObservableObjectAdministration",G8);function O5(e){return S5[e]||(S5[e]={get:function(){return this[Ve].getObservablePropValue_(e)},set:function(r){return this[Ve].setObservablePropValue_(e,r)}})}function Cr(e){return $h(e)?$C(e[Ve]):!1}function P5(e,t,r){var n;(n=e.target_[Bi])==null||delete n[r]}var GC=q8(0),VC=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),z1=0,V8=function(){};function qC(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}qC(V8,Array.prototype);var Ay=function(e){function t(n,i,a,o){var l;return a===void 0&&(a="ObservableArray"),o===void 0&&(o=!1),l=e.call(this)||this,Eo(function(){var u=new ky(a,i,o,!0);u.proxy_=l,Zw(l,Ve,u),n&&n.length&&l.spliceWithArray(0,0,n),VC&&Object.defineProperty(l,"0",GC)}),l}e8(t,e);var r=t.prototype;return r.concat=function(){this[Ve].atom_.reportObserved();for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),a.map(function(l){return Jr(l)?l.slice():l}))},r[Symbol.iterator]=function(){var n=this,i=0;return wc({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},Gh(t,[{key:"length",get:function(){return this[Ve].getArrayLength_()},set:function(i){this[Ve].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(V8);Object.entries(ph).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Dc(Ay.prototype,t,r)});function q8(e){return{enumerable:!1,configurable:!0,get:function(){return this[Ve].get_(e)},set:function(r){this[Ve].set_(e,r)}}}function WC(e){$i(Ay.prototype,""+e,q8(e))}function W8(e){if(e>z1){for(var t=z1;t<e+100;t++)WC(t);z1=e}}W8(1e3);function KC(e,t,r){return new Ay(e,t,r)}function Wi(e,t){if(typeof e=="object"&&e!==null){if(Jr(e))return t!==void 0&&it(23),e[Ve].atom_;if(Xr(e))return e.atom_;if(Ir(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||it(25,t,vh(e)),r}if(Cr(e)){if(!t)return it(26);var n=e[Ve].values_.get(t);return n||it(27,t,vh(e)),n}if(gy(e)||cl(e)||hh(e))return e}else if(An(e)&&hh(e[Ve]))return e[Ve];it(28)}function _i(e,t){if(e||it(29),t!==void 0)return _i(Wi(e,t));if(gy(e)||cl(e)||hh(e)||Ir(e)||Xr(e))return e;if(e[Ve])return e[Ve];it(24,e)}function vh(e,t){var r;if(t!==void 0)r=Wi(e,t);else{if(Bc(e))return e.name;Cr(e)||Ir(e)||Xr(e)?r=_i(e):r=Wi(e)}return r.name_}function Eo(e){var t=vl(),r=Wh(!0);fn();try{return e()}finally{dn(),Kh(r),ya(t)}}var x5=Ic.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=x5.call(e);if(o!==x5.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=C5(e),t=C5(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&&!(An(u)&&u instanceof u&&An(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 h=n.length;h--;)if(n[h]===e)return i[h]===t;if(n.push(e),i.push(t),l){if(h=e.length,h!==t.length)return!1;for(;h--;)if(!im(e[h],t[h],r-1,n,i))return!1}else{var O=Object.keys(e),w;if(h=O.length,Object.keys(t).length!==h)return!1;for(;h--;)if(w=O[h],!(ma(t,w)&&im(e[w],t[w],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function C5(e){return Jr(e)?e.slice():qs(e)||Ir(e)||ha(e)||Xr(e)?Array.from(e.entries()):e}function wc(e){return e[Symbol.iterator]=YC,e}function YC(){return this}["Symbol","Map","Set"].forEach(function(e){var t=hy();typeof t[e]>"u"&&it("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:S8,extras:{getDebugName:vh},$mobx:Ve});const XC=Object.freeze(Object.defineProperty({__proto__:null,$mobx:Ve,FlowCancellationError:Xh,ObservableMap:ep,ObservableSet:Ty,Reaction:Ts,_allowStateChanges:my,_allowStateChangesInsideComputed:Rs,_allowStateReadsEnd:_s,_allowStateReadsStart:Yh,_autoAction:As,_endAction:d8,_getAdministration:_i,_getGlobalState:v8,_interceptReads:Ey,_isComputingDerivation:Wx,_resetGlobalState:Zx,_startAction:f8,action:ur,autorun:_y,comparer:sl,computed:gl,configure:R8,createAtom:bc,defineProperty:xy,entries:z8,extendObservable:Sy,flow:fl,flowResult:SC,get:CC,getAtom:Wi,getDebugName:vh,getDependencyTree:M8,getObserverTree:mC,has:B8,intercept:Zh,isAction:Bc,isBoxedObservable:yy,isComputed:PC,isComputedProp:D8,isFlow:Ms,isFlowCancellationError:_C,isObservable:Qh,isObservableArray:Jr,isObservableMap:Ir,isObservableObject:Cr,isObservableProp:F8,isObservableSet:Xr,keys:_c,makeAutoObservable:IC,makeObservable:Cy,observable:Rt,observe:Jh,onBecomeObserved:T8,onBecomeUnobserved:wy,onReactionError:nC,override:lx,ownKeys:U8,reaction:k8,remove:xC,runInAction:Rs,set:Py,spy:S8,toJS:AC,trace:RC,transaction:Fi,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 ZC(e){e()}function K8(e){e||(e=ZC),R8({reactionScheduler:e})}var QC=function(){return!0};function JC(e){return M8(e)}var Y8=!1;function X8(e){Y8=e}function My(){return Y8}var ek=1e4,tk=1e4,rk=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=ek),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,tk))}}),e}(),nk=typeof FinalizationRegistry<"u"?FinalizationRegistry:rk,mh=new nk(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),Z8={exports:{}},Q8={};/**
|
|
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 Ls=et;function ik(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ak=typeof Object.is=="function"?Object.is:ik,ok=Ls.useState,lk=Ls.useEffect,sk=Ls.useLayoutEffect,uk=Ls.useDebugValue;function ck(e,t){var r=t(),n=ok({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return sk(function(){i.value=r,i.getSnapshot=t,B1(i)&&a({inst:i})},[e,r,t]),lk(function(){return B1(i)&&a({inst:i}),e(function(){B1(i)&&a({inst:i})})},[e]),uk(r),r}function B1(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!ak(e,r)}catch{return!0}}function fk(e,t){return t()}var dk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?fk:ck;Q8.useSyncExternalStore=Ls.useSyncExternalStore!==void 0?Ls.useSyncExternalStore:dk;Z8.exports=Q8;var hk=Z8.exports;function k5(e){e.reaction=new Ts("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 mh.unregister(n),n.onStoreChange=l,n.reaction||(k5(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||(k5(i),mh.register(r,i,i)),ht.useDebugValue(i.reaction,JC),hk.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,J8=typeof Symbol=="function"&&Symbol.for,pk=(H1=(U1=Object.getOwnPropertyDescriptor(function(){},"name"))===null||U1===void 0?void 0:U1.configurable)!==null&&H1!==void 0?H1:!1,T5=J8?Symbol.for("react.forward_ref"):typeof et.forwardRef=="function"&&et.forwardRef(function(e){return null}).$$typeof,A5=J8?Symbol.for("react.memo"):typeof et.memo=="function"&&et.memo(function(e){return null}).$$typeof;function gk(e,t){var r;if(A5&&e.$$typeof===A5)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(T5&&e.$$typeof===T5&&(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,pk&&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),mk(e,o),o}var vk={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function mk(e,t){Object.keys(e).forEach(function(r){vk[r]||Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}function e9(e){var t=e.children,r=e.render,n=t||r;return typeof n!="function"?null:Ly(n)}e9.displayName="Observer";function yk(e,t){return et.useState(function(){return Rt(e(),t,{autoBind:!0})})[0]}function t9(e){var t=et.useState(function(){return Rt(e,{},{deep:!1})})[0];return Rs(function(){Object.assign(t,e)}),t}function bk(e,t){var r=t&&t9(t);return et.useState(function(){return Rt(e(r),void 0,{autoBind:!0})})[0]}var $1;K8(Vw.unstable_batchedUpdates);var _k=($1=mh.finalizeAllImmediately)!==null&&$1!==void 0?$1:function(){};function wk(e,t){return t===void 0&&(t="observed"),Ly(e,t)}function Sk(e){X8(e)}const Ek=Object.freeze(Object.defineProperty({__proto__:null,Observer:e9,_observerFinalizationRegistry:mh,clearTimers:_k,enableStaticRendering:X8,isObserverBatched:QC,isUsingStaticRendering:My,observer:gk,observerBatching:K8,useAsObservableSource:t9,useLocalObservable:yk,useLocalStore:bk,useObserver:wk,useStaticRendering:Sk},Symbol.toStringTag,{value:"Module"})),Jn=yo(Ek);var r9={};const Xi=yo(XC);var Ny={exports:{}},tp={},yh={},ct={};(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 me<"u"?me:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.13",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)})(ct);var Qt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=ct;class r{constructor(m=[1,0,0,1,0,0]){this.dirty=!1,this.m=m&&m.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new r(this.m)}copyInto(m){m.m[0]=this.m[0],m.m[1]=this.m[1],m.m[2]=this.m[2],m.m[3]=this.m[3],m.m[4]=this.m[4],m.m[5]=this.m[5]}point(m){var _=this.m;return{x:_[0]*m.x+_[2]*m.y+_[4],y:_[1]*m.x+_[3]*m.y+_[5]}}translate(m,_){return this.m[4]+=this.m[0]*m+this.m[2]*_,this.m[5]+=this.m[1]*m+this.m[3]*_,this}scale(m,_){return this.m[0]*=m,this.m[1]*=m,this.m[2]*=_,this.m[3]*=_,this}rotate(m){var _=Math.cos(m),k=Math.sin(m),x=this.m[0]*_+this.m[2]*k,A=this.m[1]*_+this.m[3]*k,S=this.m[0]*-k+this.m[2]*_,P=this.m[1]*-k+this.m[3]*_;return this.m[0]=x,this.m[1]=A,this.m[2]=S,this.m[3]=P,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(m,_){var k=this.m[0]+this.m[2]*_,x=this.m[1]+this.m[3]*_,A=this.m[2]+this.m[0]*m,S=this.m[3]+this.m[1]*m;return this.m[0]=k,this.m[1]=x,this.m[2]=A,this.m[3]=S,this}multiply(m){var _=this.m[0]*m.m[0]+this.m[2]*m.m[1],k=this.m[1]*m.m[0]+this.m[3]*m.m[1],x=this.m[0]*m.m[2]+this.m[2]*m.m[3],A=this.m[1]*m.m[2]+this.m[3]*m.m[3],S=this.m[0]*m.m[4]+this.m[2]*m.m[5]+this.m[4],P=this.m[1]*m.m[4]+this.m[3]*m.m[5]+this.m[5];return this.m[0]=_,this.m[1]=k,this.m[2]=x,this.m[3]=A,this.m[4]=S,this.m[5]=P,this}invert(){var m=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),_=this.m[3]*m,k=-this.m[1]*m,x=-this.m[2]*m,A=this.m[0]*m,S=m*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),P=m*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=_,this.m[1]=k,this.m[2]=x,this.m[3]=A,this.m[4]=S,this.m[5]=P,this}getMatrix(){return this.m}decompose(){var m=this.m[0],_=this.m[1],k=this.m[2],x=this.m[3],A=this.m[4],S=this.m[5],P=m*x-_*k;let C={x:A,y:S,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(m!=0||_!=0){var R=Math.sqrt(m*m+_*_);C.rotation=_>0?Math.acos(m/R):-Math.acos(m/R),C.scaleX=R,C.scaleY=P/R,C.skewX=(m*k+_*x)/P,C.skewY=0}else if(k!=0||x!=0){var N=Math.sqrt(k*k+x*x);C.rotation=Math.PI/2-(x>0?Math.acos(-k/N):-Math.acos(k/N)),C.scaleX=P/N,C.scaleY=N,C.skewX=0,C.skewY=(m*k+_*x)/P}return C.rotation=e.Util._getRotation(C.rotation),C}}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="#",h="",O="0",w="Konva warning: ",b="Konva error: ",E="rgb(",p={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},v=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,g=[];const y=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 m=d[0];return m==="#"||m==="."||m===m.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){g.push(d),g.length===1&&y(function(){const m=g;g=[],m.forEach(function(_){_()})})},createCanvasElement(){var d=document.createElement("canvas");try{d.style=d.style||{}}catch{}return d},createImageElement(){return document.createElement("img")},_isInDocument(d){for(;d=d.parentNode;)if(d==document)return!0;return!1},_urlToImage(d,m){var _=e.Util.createImageElement();_.onload=function(){m(_)},_.src=d},_rgbToHex(d,m,_){return((1<<24)+(d<<16)+(m<<8)+_).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,h);var m=parseInt(d,16);return{r:m>>16&255,g:m>>8&255,b:m&255}},getRandomColor(){for(var d=(Math.random()*16777215<<0).toString(16);d.length<6;)d=O+d;return f+d},getRGB(d){var m;return d in p?(m=p[d],{r:m[0],g:m[1],b:m[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===E?(m=v.exec(d.replace(/ /g,"")),{r:parseInt(m[1],10),g:parseInt(m[2],10),b:parseInt(m[3],10)}):{r:0,g:0,b:0}},colorToRGBA(d){return d=d||"black",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 m=p[d.toLowerCase()];return m?{r:m[0],g:m[1],b:m[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];var m=d.split(/ *, */).map(Number);return{r:m[0],g:m[1],b:m[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];var m=d.split(/ *, */).map((_,k)=>_.slice(-1)==="%"?k===3?parseInt(_)/100:parseInt(_)/100*255:Number(_));return{r:m[0],g:m[1],b:m[2],a:m[3]}}},_hex8ColorToRGBA(d){if(d[0]==="#"&&d.length===9)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:parseInt(d.slice(7,9),16)/255}},_hex6ColorToRGBA(d){if(d[0]==="#"&&d.length===7)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:1}},_hex4ColorToRGBA(d){if(d[0]==="#"&&d.length===5)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:parseInt(d[4]+d[4],16)/255}},_hex3ColorToRGBA(d){if(d[0]==="#"&&d.length===4)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:1}},_hslColorToRGBA(d){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(d)){const[m,..._]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),k=Number(_[0])/360,x=Number(_[1])/100,A=Number(_[2])/100;let S,P,C;if(x===0)return C=A*255,{r:Math.round(C),g:Math.round(C),b:Math.round(C),a:1};A<.5?S=A*(1+x):S=A+x-A*x;const R=2*A-S,N=[0,0,0];for(let U=0;U<3;U++)P=k+1/3*-(U-1),P<0&&P++,P>1&&P--,6*P<1?C=R+(S-R)*6*P:2*P<1?C=S:3*P<2?C=R+(S-R)*(2/3-P)*6:C=R,N[U]=C*255;return{r:Math.round(N[0]),g:Math.round(N[1]),b:Math.round(N[2]),a:1}}},haveIntersection(d,m){return!(m.x>d.x+d.width||m.x+m.width<d.x||m.y>d.y+d.height||m.y+m.height<d.y)},cloneObject(d){var m={};for(var _ in d)this._isPlainObject(d[_])?m[_]=this.cloneObject(d[_]):this._isArray(d[_])?m[_]=this.cloneArray(d[_]):m[_]=d[_];return m},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(b+d)},error(d){console.error(b+d)},warn(d){t.Konva.showWarnings&&console.warn(w+d)},each(d,m){for(var _ in d)m(_,d[_])},_inRange(d,m,_){return m<=d&&d<_},_getProjectionToSegment(d,m,_,k,x,A){var S,P,C,R=(d-_)*(d-_)+(m-k)*(m-k);if(R==0)S=d,P=m,C=(x-_)*(x-_)+(A-k)*(A-k);else{var N=((x-d)*(_-d)+(A-m)*(k-m))/R;N<0?(S=d,P=m,C=(d-x)*(d-x)+(m-A)*(m-A)):N>1?(S=_,P=k,C=(_-x)*(_-x)+(k-A)*(k-A)):(S=d+N*(_-d),P=m+N*(k-m),C=(S-x)*(S-x)+(P-A)*(P-A))}return[S,P,C]},_getProjectionToLine(d,m,_){var k=e.Util.cloneObject(d),x=Number.MAX_VALUE;return m.forEach(function(A,S){if(!(!_&&S===m.length-1)){var P=m[(S+1)%m.length],C=e.Util._getProjectionToSegment(A.x,A.y,P.x,P.y,d.x,d.y),R=C[0],N=C[1],U=C[2];U<x&&(k.x=R,k.y=N,x=U)}}),k},_prepareArrayForTween(d,m,_){var k,x=[],A=[];if(d.length>m.length){var S=m;m=d,d=S}for(k=0;k<d.length;k+=2)x.push({x:d[k],y:d[k+1]});for(k=0;k<m.length;k+=2)A.push({x:m[k],y:m[k+1]});var P=[];return A.forEach(function(C){var R=e.Util._getProjectionToLine(C,x,_);P.push(R.x),P.push(R.y)}),P},_prepareToStringify(d){var m;d.visitedByCircularReferenceRemoval=!0;for(var _ in d)if(d.hasOwnProperty(_)&&d[_]&&typeof d[_]=="object"){if(m=Object.getOwnPropertyDescriptor(d,_),d[_].visitedByCircularReferenceRemoval||e.Util._isElement(d[_]))if(m.configurable)delete d[_];else return null;else if(e.Util._prepareToStringify(d[_])===null)if(m.configurable)delete d[_];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,m){for(var _ in m)d[_]=m[_];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){t.Konva.releaseCanvasOnDestroy&&d.forEach(m=>{m.width=0,m.height=0})},drawRoundedRectPath(d,m,_,k){let x=0,A=0,S=0,P=0;typeof k=="number"?x=A=S=P=Math.min(k,m/2,_/2):(x=Math.min(k[0]||0,m/2,_/2),A=Math.min(k[1]||0,m/2,_/2),P=Math.min(k[2]||0,m/2,_/2),S=Math.min(k[3]||0,m/2,_/2)),d.moveTo(x,0),d.lineTo(m-A,0),d.arc(m-A,A,A,Math.PI*3/2,0,!1),d.lineTo(m,_-P),d.arc(m-P,_-P,P,0,Math.PI/2,!1),d.lineTo(S,_),d.arc(S,_-S,S,Math.PI/2,Math.PI,!1),d.lineTo(0,x),d.arc(x,x,x,Math.PI,Math.PI*3/2,!1)}}})(Qt);var qt={},ft={},Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.getComponentValidator=Ge.getBooleanValidator=Ge.getNumberArrayValidator=Ge.getFunctionValidator=Ge.getStringOrGradientValidator=Ge.getStringValidator=Ge.getNumberOrAutoValidator=Ge.getNumberOrArrayOfNumbersValidator=Ge.getNumberValidator=Ge.alphaComponent=Ge.RGBComponent=void 0;const ka=ct,er=Qt;function Ta(e){return er.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||er.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function Ok(e){return e>255?255:e<0?0:Math.round(e)}Ge.RGBComponent=Ok;function Pk(e){return e>1?1:e<1e-4?1e-4:e}Ge.alphaComponent=Pk;function xk(){if(ka.Konva.isUnminified)return function(e,t){return er.Util._isNumber(e)||er.Util.warn(Ta(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}Ge.getNumberValidator=xk;function Ck(e){if(ka.Konva.isUnminified)return function(t,r){let n=er.Util._isNumber(t),i=er.Util._isArray(t)&&t.length==e;return!n&&!i&&er.Util.warn(Ta(t)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+e+")"),t}}Ge.getNumberOrArrayOfNumbersValidator=Ck;function kk(){if(ka.Konva.isUnminified)return function(e,t){var r=er.Util._isNumber(e),n=e==="auto";return r||n||er.Util.warn(Ta(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}Ge.getNumberOrAutoValidator=kk;function Tk(){if(ka.Konva.isUnminified)return function(e,t){return er.Util._isString(e)||er.Util.warn(Ta(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}Ge.getStringValidator=Tk;function Ak(){if(ka.Konva.isUnminified)return function(e,t){const r=er.Util._isString(e),n=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return r||n||er.Util.warn(Ta(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}Ge.getStringOrGradientValidator=Ak;function Rk(){if(ka.Konva.isUnminified)return function(e,t){return er.Util._isFunction(e)||er.Util.warn(Ta(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}Ge.getFunctionValidator=Rk;function Mk(){if(ka.Konva.isUnminified)return function(e,t){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&e instanceof r||(er.Util._isArray(e)?e.forEach(function(n){er.Util._isNumber(n)||er.Util.warn('"'+t+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):er.Util.warn(Ta(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}Ge.getNumberArrayValidator=Mk;function Lk(){if(ka.Konva.isUnminified)return function(e,t){var r=e===!0||e===!1;return r||er.Util.warn(Ta(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}Ge.getBooleanValidator=Lk;function Nk(e){if(ka.Konva.isUnminified)return function(t,r){return t==null||er.Util.isObject(t)||er.Util.warn(Ta(t)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+e),t}}Ge.getComponentValidator=Nk;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=Qt,r=Ge;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(h){return l&&h!==void 0&&h!==null&&(h=l.call(this,h,o)),this._setAttr(o,h),u&&u.call(this),this}},addComponentsGetterSetter(a,o,l,u,f){var h=l.length,O=t.Util._capitalize,w=n+O(o),b=i+O(o),E,p;a.prototype[w]=function(){var g={};for(E=0;E<h;E++)p=l[E],g[p]=this.getAttr(o+O(p));return g};var v=(0,r.getComponentValidator)(l);a.prototype[b]=function(g){var y=this.attrs[o],d;u&&(g=u.call(this,g)),v&&v.call(this,g,o);for(d in g)g.hasOwnProperty(d)&&this._setAttr(o+O(d),g[d]);return g||l.forEach(m=>{this._setAttr(o+O(m),void 0)}),this._fireChangeEvent(o,y,g),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),h=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[f]=function(){t.Util.error(h);var O=this.attrs[o];return O===void 0?l:O},e.Factory.addSetter(a,o,u,function(){t.Util.error(h)}),e.Factory.addOverloadedGetterSetter(a,o)},backCompat(a,o){t.Util.each(o,function(l,u){var f=a.prototype[u],h=n+t.Util._capitalize(l),O=i+t.Util._capitalize(l);function w(){f.apply(this,arguments),t.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}a.prototype[l]=w,a.prototype[h]=w,a.prototype[O]=w})},afterSetFilter(){this._filterUpToDate=!1}}})(ft);var yi={},ba={};Object.defineProperty(ba,"__esModule",{value:!0});ba.HitContext=ba.SceneContext=ba.Context=void 0;const n9=Qt,Ik=ct;function Dk(e){var t=[],r=e.length,n=n9.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 R5=",",jk="(",Fk=")",zk="([",Bk="])",Uk=";",Hk="()",$k="=",M5=["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"],Gk=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const Vk=100;class rp{constructor(t){this.canvas=t,Ik.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+=Hk:n9.Util._isArray(f[0])?a+=zk+f.join(R5)+Bk:(r&&(f=f.map(h=>typeof h=="number"?Math.floor(h):h)),a+=jk+f.join(R5)+Fk)):(a+=l.property,t||(a+=$k+l.val)),a+=Uk;return a}clearTrace(){this.traceArr=[]}_trace(t){var r=this.traceArr,n;r.push(t),n=r.length,n>=Vk&&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 h=arguments,O=this._context;h.length===3?O.drawImage(t,r,n):h.length===5?O.drawImage(t,r,n,i,a):h.length===9&&O.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=M5.length,n=this.setAttr,i,a,o=function(l){var u=t[l],f;t[l]=function(){return a=Dk(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(M5[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)}}ba.Context=rp;Gk.forEach(function(e){Object.defineProperty(rp.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class qk extends rp{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(),h=u.x*f,O=u.y*f;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(h),Math.abs(O))),this.setAttr("shadowOffsetX",l.x*h),this.setAttr("shadowOffsetY",l.y*O)}}ba.SceneContext=qk;class Wk extends rp{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()}}}ba.HitContext=Wk;Object.defineProperty(yi,"__esModule",{value:!0});yi.HitCanvas=yi.SceneCanvas=yi.Canvas=void 0;const bh=Qt,i9=ba,a9=ct,Kk=ft,Yk=Ge;var gd;function Xk(){if(gd)return gd;var e=bh.Util.createCanvasElement(),t=e.getContext("2d");return gd=function(){var r=a9.Konva._global.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return r/n}(),bh.Util.releaseCanvas(e),gd}class np{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var r=t||{},n=r.pixelRatio||a9.Konva.pixelRatio||Xk();this.pixelRatio=n,this._canvas=bh.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 bh.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}yi.Canvas=np;Kk.Factory.addGetterSetter(np,"pixelRatio",void 0,(0,Yk.getNumberValidator)());class Zk extends np{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new i9.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}yi.SceneCanvas=Zk;class Qk extends np{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new i9.HitContext(this),this.setSize(t.width,t.height)}}yi.HitCanvas=Qk;var ip={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=ct,r=Qt;e.DD={get isDragging(){var n=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){var n;return e.DD._dragElements.forEach(i=>{n=i.node}),n},_dragElements:new Map,_drag(n){const i=[];e.DD._dragElements.forEach((a,o)=>{const{node:l}=a,u=l.getStage();u.setPointersPositions(n),a.pointerId===void 0&&(a.pointerId=r.Util._getFirstPointerId(n));const f=u._changedPointerPositions.find(w=>w.id===a.pointerId);if(f){if(a.dragStatus!=="dragging"){var h=l.dragDistance(),O=Math.max(Math.abs(f.x-a.startPointerPos.x),Math.abs(f.y-a.startPointerPos.y));if(O<h||(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(h=>h.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))})(ip);Object.defineProperty(qt,"__esModule",{value:!0});qt.Node=void 0;const vt=Qt,$c=ft,Lu=yi,qa=ct,$n=ip,ar=Ge;var Dd="absoluteOpacity",vd="allEventListeners",ca="absoluteTransform",L5="absoluteScale",$o="canvas",Jk="Change",eT="children",tT="konva",am="listening",N5="mouseenter",I5="mouseleave",D5="set",j5="Shape",jd=" ",F5="stage",Wa="transform",rT="Stage",om="visible",nT=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(jd);let iT=1,st=class lm{constructor(t){this._id=iT++,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===Wa||t===ca)&&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===Wa||t===ca,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(jd);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get($o)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===ca&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has($o)){const{scene:t,filter:r,hit:n}=this._cache.get($o);vt.Util.releaseCanvas(t,r,n),this._cache.delete($o)}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,h=r.drawBorder||!1,O=r.hitCanvasPixelRatio||1;if(!i||!a){vt.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const w=Math.abs(Math.round(n.x)-l)>.5?1:0,b=Math.abs(Math.round(n.y)-u)>.5?1:0;i+=f*2+w,a+=f*2+b,l-=f,u-=f;var E=new Lu.SceneCanvas({pixelRatio:o,width:i,height:a}),p=new Lu.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),v=new Lu.HitCanvas({pixelRatio:O,width:i,height:a}),g=E.getContext(),y=v.getContext();return v.isCache=!0,E.isCache=!0,this._cache.delete($o),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(E.getContext()._context.imageSmoothingEnabled=!1,p.getContext()._context.imageSmoothingEnabled=!1),g.save(),y.save(),g.translate(-l,-u),y.translate(-l,-u),this._isUnderCache=!0,this._clearSelfAndDescendantCache(Dd),this._clearSelfAndDescendantCache(L5),this.drawScene(E,this),this.drawHit(v,this),this._isUnderCache=!1,g.restore(),y.restore(),h&&(g.save(),g.beginPath(),g.rect(0,0,i,a),g.closePath(),g.setAttr("strokeStyle","red"),g.setAttr("lineWidth",5),g.stroke(),g.restore()),this._cache.set($o,{scene:E,filter:p,hit:v,x:l,y:u}),this._requestDraw(),this}isCached(){return this._cache.has($o)}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 h=u.point(f);i===void 0&&(i=o=h.x,a=l=h.y),i=Math.min(i,h.x),a=Math.min(a,h.y),o=Math.max(o,h.x),l=Math.max(l,h.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 h=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()/h,n.getHeight()/h),l=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++){if(f=t[u],typeof f!="function"){vt.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(O){vt.Util.error("Unable to apply filter. "+O.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(vd),arguments.length===3)return this._delegate.apply(this,arguments);var n=t.split(jd),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(jd),i=n.length,a,o,l,u,f,h;if(this._cache&&this._cache.delete(vd),!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],h=u[1],f)this.eventListeners[f]&&this._off(f,h,r);else for(o in this.eventListeners)this._off(o,h,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=vt.Util.cloneObject(a),a.currentTarget=o[l],n.call(o[l],a)})}remove(){return this.isDragging()&&this.stopDrag(),$n.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(ca),this._clearSelfAndDescendantCache(Dd),this._clearSelfAndDescendantCache(L5),this._clearSelfAndDescendantCache(F5),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"+vt.Util._capitalize(t);return vt.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!==eT&&(n=D5+vt.Util._capitalize(r),vt.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;$n.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(i=!0)});var a=!r&&!qa.Konva.hitOnDragEnabled&&(i||qa.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(h){for(i=[],a=h.length,o=0;o<a;o++)l=h[o],n++,l.nodeType!==j5&&(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!==rT&&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(Wa),this._clearSelfAndDescendantCache(ca)),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 vt.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(Wa);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(Wa),this._clearSelfAndDescendantCache(ca),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 vt.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 vt.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 vt.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 vt.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 vt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&vt.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(Dd,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=vt.Util.isObject(n)&&!vt.Util._isPlainObject(n)&&!vt.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 vt.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],vt.Util.isValidSelector(a)||(vt.Util.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),vt.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),vt.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(F5,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(ca,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var r;if(t)return r=new vt.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(ca)||new vt.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(Wa,this._getTransform)}_getTransform(){var t,r,n=this._cache.get(Wa)||new vt.Transform;n.reset();var i=this.x(),a=this.y(),o=qa.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,h=this.attrs.skewY||0,O=this.attrs.offsetX||0,w=this.attrs.offsetY||0;return(i!==0||a!==0)&&n.translate(i,a),o!==0&&n.rotate(o),(f!==0||h!==0)&&n.skew(f,h),(l!==1||u!==1)&&n.scale(l,u),(O!==0||w!==0)&&n.translate(-1*O,-1*w),n.dirty=!1,n}clone(t){var r=vt.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(tT)<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 Lu.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 Lu.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,vt.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():qa.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+Jk,{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[D5+vt.Util._capitalize(t)];return vt.Util._isFunction(n)?n.call(this,r):this._setAttr(t,r),this}_requestDraw(){if(qa.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,r){var n=this.attrs[t];n===r&&!vt.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===j5&&(r.target=this);var i=(t===N5||t===I5)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n);if(!i){this._fire(t,r);var a=(t===N5||t===I5)&&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(vd))!==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(vd,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;$n.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){$n.DD._dragElements.has(this._id)||this._createDragElement(t);const n=$n.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:vt.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=$n.DD._dragElements.get(this._id);r&&(r.dragStatus="stopped"),$n.DD._endDragBefore(t),$n.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=$n.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||qa.Konva.dragButtons.indexOf(t.evt.button)>=0;if(n&&!this.isDragging()){var i=!1;$n.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=$n.DD._dragElements.get(this._id),n=r&&r.dragStatus==="dragging",i=r&&r.dragStatus==="ready";n?this.stopDrag():i&&$n.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 vt.Util.haveIntersection(n,this.getClientRect())}static create(t,r){return vt.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),qa.Konva[n]||(vt.Util.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=qa.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}};qt.Node=st;st.prototype.nodeType="Node";st.prototype._attrsAffectingSize=[];st.prototype.eventListeners={};st.prototype.on.call(st.prototype,nT,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Wa),this._clearSelfAndDescendantCache(ca)});st.prototype.on.call(st.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(om)});st.prototype.on.call(st.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(am)});st.prototype.on.call(st.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(Dd)});const Lt=$c.Factory.addGetterSetter;Lt(st,"zIndex");Lt(st,"absolutePosition");Lt(st,"position");Lt(st,"x",0,(0,ar.getNumberValidator)());Lt(st,"y",0,(0,ar.getNumberValidator)());Lt(st,"globalCompositeOperation","source-over",(0,ar.getStringValidator)());Lt(st,"opacity",1,(0,ar.getNumberValidator)());Lt(st,"name","",(0,ar.getStringValidator)());Lt(st,"id","",(0,ar.getStringValidator)());Lt(st,"rotation",0,(0,ar.getNumberValidator)());$c.Factory.addComponentsGetterSetter(st,"scale",["x","y"]);Lt(st,"scaleX",1,(0,ar.getNumberValidator)());Lt(st,"scaleY",1,(0,ar.getNumberValidator)());$c.Factory.addComponentsGetterSetter(st,"skew",["x","y"]);Lt(st,"skewX",0,(0,ar.getNumberValidator)());Lt(st,"skewY",0,(0,ar.getNumberValidator)());$c.Factory.addComponentsGetterSetter(st,"offset",["x","y"]);Lt(st,"offsetX",0,(0,ar.getNumberValidator)());Lt(st,"offsetY",0,(0,ar.getNumberValidator)());Lt(st,"dragDistance",null,(0,ar.getNumberValidator)());Lt(st,"width",0,(0,ar.getNumberValidator)());Lt(st,"height",0,(0,ar.getNumberValidator)());Lt(st,"listening",!0,(0,ar.getBooleanValidator)());Lt(st,"preventDefault",!0,(0,ar.getBooleanValidator)());Lt(st,"filters",null,function(e){return this._filterUpToDate=!1,e});Lt(st,"visible",!0,(0,ar.getBooleanValidator)());Lt(st,"transformsEnabled","all",(0,ar.getStringValidator)());Lt(st,"size");Lt(st,"dragBoundFunc");Lt(st,"draggable",!1,(0,ar.getBooleanValidator)());$c.Factory.backCompat(st,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var yl={};Object.defineProperty(yl,"__esModule",{value:!0});yl.Container=void 0;const Ks=ft,G1=qt,ap=Ge;class bl 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 h=this.getAbsoluteTransform(r).getMatrix();o.transform(h[0],h[1],h[2],h[3],h[4],h[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(),h=typeof l=="number"&&typeof u=="number"||f;const O=n===this;if(h){o.save();var w=this.getAbsoluteTransform(n),b=w.getMatrix();o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),o.beginPath();let g;if(f)g=f.call(this,o,this);else{var E=this.clipX(),p=this.clipY();o.rect(E||0,p||0,l,u)}o.clip.apply(o,g),b=w.copy().invert().getMatrix(),o.transform(b[0],b[1],b[2],b[3],b[4],b[5])}var v=!O&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";v&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(g){g[t](r,n,i)}),v&&o.restore(),h&&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},h=this;(r=this.children)===null||r===void 0||r.forEach(function(p){if(p.visible()){var v=p.getClientRect({relativeTo:h,skipShadow:t.skipShadow,skipStroke:t.skipStroke});v.width===0&&v.height===0||(a===void 0?(a=v.x,o=v.y,l=v.x+v.width,u=v.y+v.height):(a=Math.min(a,v.x),o=Math.min(o,v.y),l=Math.max(l,v.x+v.width),u=Math.max(u,v.y+v.height)))}});for(var O=this.find("Shape"),w=!1,b=0;b<O.length;b++){var E=O[b];if(E._isVisible(this)){w=!0;break}}return w&&a!==void 0?f={x:a,y:o,width:l-a,height:u-o}:f={x:0,y:0,width:0,height:0},n?f:this._transformedRect(f,i)}}yl.Container=bl;Ks.Factory.addComponentsGetterSetter(bl,"clip",["x","y","width","height"]);Ks.Factory.addGetterSetter(bl,"clipX",void 0,(0,ap.getNumberValidator)());Ks.Factory.addGetterSetter(bl,"clipY",void 0,(0,ap.getNumberValidator)());Ks.Factory.addGetterSetter(bl,"clipWidth",void 0,(0,ap.getNumberValidator)());Ks.Factory.addGetterSetter(bl,"clipHeight",void 0,(0,ap.getNumberValidator)());Ks.Factory.addGetterSetter(bl,"clipFunc");var o9={},xn={};Object.defineProperty(xn,"__esModule",{value:!0});xn.releaseCapture=xn.setPointerCapture=xn.hasPointerCapture=xn.createEvent=xn.getCapturedShape=void 0;const aT=ct,Sc=new Map,l9=aT.Konva._global.PointerEvent!==void 0;function oT(e){return Sc.get(e)}xn.getCapturedShape=oT;function Iy(e){return{evt:e,pointerId:e.pointerId}}xn.createEvent=Iy;function lT(e,t){return Sc.get(e)===t}xn.hasPointerCapture=lT;function sT(e,t){s9(e),t.getStage()&&(Sc.set(e,t),l9&&t._fire("gotpointercapture",Iy(new PointerEvent("gotpointercapture"))))}xn.setPointerCapture=sT;function s9(e,t){const r=Sc.get(e);if(!r)return;const n=r.getStage();n&&n.content,Sc.delete(e),l9&&r._fire("lostpointercapture",Iy(new PointerEvent("lostpointercapture")))}xn.releaseCapture=s9;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=Qt,r=ft,n=yl,i=ct,a=yi,o=ip,l=ct,u=xn;var f="Stage",h="string",O="px",w="mouseout",b="mouseleave",E="mouseover",p="mouseenter",v="mousemove",g="mousedown",y="mouseup",d="pointermove",m="pointerdown",_="pointerup",k="pointercancel",x="lostpointercapture",A="pointerout",S="pointerleave",P="pointerover",C="pointerenter",R="contextmenu",N="touchstart",U="touchend",G="touchmove",Z="touchcancel",W="wheel",H=5,M=[[p,"_pointerenter"],[g,"_pointerdown"],[v,"_pointermove"],[y,"_pointerup"],[b,"_pointerleave"],[N,"_pointerdown"],[G,"_pointermove"],[U,"_pointerup"],[Z,"_pointercancel"],[E,"_pointerover"],[W,"_wheel"],[R,"_contextmenu"],[m,"_pointerdown"],[d,"_pointermove"],[_,"_pointerup"],[k,"_pointercancel"],[x,"_lostpointercapture"]];const L={mouse:{[A]:w,[S]:b,[P]:E,[C]:p,[d]:v,[m]:g,[_]:y,[k]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[A]:"touchout",[S]:"touchleave",[P]:"touchover",[C]:"touchenter",[d]:G,[m]:N,[_]:U,[k]:Z,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[A]:A,[S]:S,[P]:P,[C]:C,[d]:d,[m]:m,[_]:_,[k]:k,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},D=$=>$.indexOf("pointer")>=0?"pointer":$.indexOf("touch")>=0?"touch":"mouse",B=$=>{const F=D($);if(F==="pointer")return i.Konva.pointerEventsEnabled&&L.pointer;if(F==="touch")return L.touch;if(F==="mouse")return L.mouse};function q($={}){return($.clipFunc||$.clipWidth||$.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),$}const K="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 z extends n.Container{constructor(F){super(q(F)),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",()=>{q(this.attrs)}),this._checkVisibility()}_validateAdd(F){const Y=F.getType()==="Layer",X=F.getType()==="FastLayer";Y||X||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const F=this.visible()?"":"none";this.content.style.display=F}setContainer(F){if(typeof F===h){if(F.charAt(0)==="."){var Y=F.slice(1);F=document.getElementsByClassName(Y)[0]}else{var X;F.charAt(0)!=="#"?X=F:X=F.slice(1),F=document.getElementById(X)}if(!F)throw"Can not find container in document with id "+X}return this._setAttr("container",F),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),F.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var F=this.children,Y=F.length,X;for(X=0;X<Y;X++)F[X].clear();return this}clone(F){return F||(F={}),F.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,F)}destroy(){super.destroy();var F=this.content;F&&t.Util._isInDocument(F)&&this.container().removeChild(F);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 F=this._pointerPositions[0]||this._changedPointerPositions[0];return F?{x:F.x,y:F.y}:(t.Util.warn(K),null)}_getPointerById(F){return this._pointerPositions.find(Y=>Y.id===F)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(F){F=F||{},F.x=F.x||0,F.y=F.y||0,F.width=F.width||this.width(),F.height=F.height||this.height();var Y=new a.SceneCanvas({width:F.width,height:F.height,pixelRatio:F.pixelRatio||1}),X=Y.getContext()._context,Q=this.children;return(F.x||F.y)&&X.translate(-1*F.x,-1*F.y),Q.forEach(function(ee){if(ee.isVisible()){var re=ee._toKonvaCanvas(F);X.drawImage(re._canvas,F.x,F.y,re.getWidth()/re.getPixelRatio(),re.getHeight()/re.getPixelRatio())}}),Y}getIntersection(F){if(!F)return null;var Y=this.children,X=Y.length,Q=X-1,ee;for(ee=Q;ee>=0;ee--){const re=Y[ee].getIntersection(F);if(re)return re}return null}_resizeDOM(){var F=this.width(),Y=this.height();this.content&&(this.content.style.width=F+O,this.content.style.height=Y+O),this.bufferCanvas.setSize(F,Y),this.bufferHitCanvas.setSize(F,Y),this.children.forEach(X=>{X.setSize({width:F,height:Y}),X.draw()})}add(F,...Y){if(arguments.length>1){for(var X=0;X<arguments.length;X++)this.add(arguments[X]);return this}super.add(F);var Q=this.children.length;return Q>H&&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."),F.setSize({width:this.width(),height:this.height()}),F.draw(),i.Konva.isBrowser&&this.content.appendChild(F.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(F){return u.hasPointerCapture(F,this)}setPointerCapture(F){u.setPointerCapture(F,this)}releaseCapture(F){u.releaseCapture(F,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&M.forEach(([F,Y])=>{this.content.addEventListener(F,X=>{this[Y](X)},{passive:!1})})}_pointerenter(F){this.setPointersPositions(F);const Y=B(F.type);Y&&this._fire(Y.pointerenter,{evt:F,target:this,currentTarget:this})}_pointerover(F){this.setPointersPositions(F);const Y=B(F.type);Y&&this._fire(Y.pointerover,{evt:F,target:this,currentTarget:this})}_getTargetShape(F){let Y=this[F+"targetShape"];return Y&&!Y.getStage()&&(Y=null),Y}_pointerleave(F){const Y=B(F.type),X=D(F.type);if(Y){this.setPointersPositions(F);var Q=this._getTargetShape(X),ee=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;Q&&ee?(Q._fireAndBubble(Y.pointerout,{evt:F}),Q._fireAndBubble(Y.pointerleave,{evt:F}),this._fire(Y.pointerleave,{evt:F,target:this,currentTarget:this}),this[X+"targetShape"]=null):ee&&(this._fire(Y.pointerleave,{evt:F,target:this,currentTarget:this}),this._fire(Y.pointerout,{evt:F,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(F){const Y=B(F.type),X=D(F.type);if(Y){this.setPointersPositions(F);var Q=!1;this._changedPointerPositions.forEach(ee=>{var re=this.getIntersection(ee);if(o.DD.justDragged=!1,i.Konva["_"+X+"ListenClick"]=!0,!re||!re.isListening()){this[X+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&re.setPointerCapture(ee.id),this[X+"ClickStartShape"]=re,re._fireAndBubble(Y.pointerdown,{evt:F,pointerId:ee.id}),Q=!0;const oe=F.type.indexOf("touch")>=0;re.preventDefault()&&F.cancelable&&oe&&F.preventDefault()}),Q||this._fire(Y.pointerdown,{evt:F,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(F){const Y=B(F.type),X=D(F.type);if(!Y)return;i.Konva.isDragging()&&o.DD.node.preventDefault()&&F.cancelable&&F.preventDefault(),this.setPointersPositions(F);var Q=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;if(!Q)return;var ee={};let re=!1;var oe=this._getTargetShape(X);this._changedPointerPositions.forEach(ae=>{const ie=u.getCapturedShape(ae.id)||this.getIntersection(ae),Re=ae.id,Me={evt:F,pointerId:Re};var ne=oe!==ie;if(ne&&oe&&(oe._fireAndBubble(Y.pointerout,{...Me},ie),oe._fireAndBubble(Y.pointerleave,{...Me},ie)),ie){if(ee[ie._id])return;ee[ie._id]=!0}ie&&ie.isListening()?(re=!0,ne&&(ie._fireAndBubble(Y.pointerover,{...Me},oe),ie._fireAndBubble(Y.pointerenter,{...Me},oe),this[X+"targetShape"]=ie),ie._fireAndBubble(Y.pointermove,{...Me})):oe&&(this._fire(Y.pointerover,{evt:F,target:this,currentTarget:this,pointerId:Re}),this[X+"targetShape"]=null)}),re||this._fire(Y.pointermove,{evt:F,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(F){const Y=B(F.type),X=D(F.type);if(!Y)return;this.setPointersPositions(F);const Q=this[X+"ClickStartShape"],ee=this[X+"ClickEndShape"];var re={};let oe=!1;this._changedPointerPositions.forEach(ae=>{const ie=u.getCapturedShape(ae.id)||this.getIntersection(ae);if(ie){if(ie.releaseCapture(ae.id),re[ie._id])return;re[ie._id]=!0}const Re=ae.id,Me={evt:F,pointerId:Re};let ne=!1;i.Konva["_"+X+"InDblClickWindow"]?(ne=!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),ie&&ie.isListening()?(oe=!0,this[X+"ClickEndShape"]=ie,ie._fireAndBubble(Y.pointerup,{...Me}),i.Konva["_"+X+"ListenClick"]&&Q&&Q===ie&&(ie._fireAndBubble(Y.pointerclick,{...Me}),ne&&ee&&ee===ie&&ie._fireAndBubble(Y.pointerdblclick,{...Me}))):(this[X+"ClickEndShape"]=null,i.Konva["_"+X+"ListenClick"]&&this._fire(Y.pointerclick,{evt:F,target:this,currentTarget:this,pointerId:Re}),ne&&this._fire(Y.pointerdblclick,{evt:F,target:this,currentTarget:this,pointerId:Re}))}),oe||this._fire(Y.pointerup,{evt:F,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+X+"ListenClick"]=!1,F.cancelable&&X!=="touch"&&F.preventDefault()}_contextmenu(F){this.setPointersPositions(F);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(R,{evt:F}):this._fire(R,{evt:F,target:this,currentTarget:this})}_wheel(F){this.setPointersPositions(F);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(W,{evt:F}):this._fire(W,{evt:F,target:this,currentTarget:this})}_pointercancel(F){this.setPointersPositions(F);const Y=u.getCapturedShape(F.pointerId)||this.getIntersection(this.getPointerPosition());Y&&Y._fireAndBubble(_,u.createEvent(F)),u.releaseCapture(F.pointerId)}_lostpointercapture(F){u.releaseCapture(F.pointerId)}setPointersPositions(F){var Y=this._getContentPosition(),X=null,Q=null;F=F||window.event,F.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(F.touches,ee=>{this._pointerPositions.push({id:ee.identifier,x:(ee.clientX-Y.left)/Y.scaleX,y:(ee.clientY-Y.top)/Y.scaleY})}),Array.prototype.forEach.call(F.changedTouches||F.touches,ee=>{this._changedPointerPositions.push({id:ee.identifier,x:(ee.clientX-Y.left)/Y.scaleX,y:(ee.clientY-Y.top)/Y.scaleY})})):(X=(F.clientX-Y.left)/Y.scaleX,Q=(F.clientY-Y.top)/Y.scaleY,this.pointerPos={x:X,y:Q},this._pointerPositions=[{x:X,y:Q,id:t.Util._getFirstPointerId(F)}],this._changedPointerPositions=[{x:X,y:Q,id:t.Util._getFirstPointerId(F)}])}_setPointerPosition(F){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(F)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var F=this.content.getBoundingClientRect();return{top:F.top,left:F.left,scaleX:F.width/this.content.clientWidth||1,scaleY:F.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 F=this.container();if(!F)throw"Stage has no container. A container is required.";F.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"),F.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(F){F.batchDraw()}),this}}e.Stage=z,z.prototype.nodeType=f,(0,l._registerNode)(z),r.Factory.addGetterSetter(z,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach($=>{$.batchDraw()})})})(o9);var Gc={},yr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=ct,r=Qt,n=ft,i=qt,a=Ge,o=ct,l=xn;var u="hasShadow",f="shadowRGBA",h="patternImage",O="linearGradient",w="radialGradient";let b;function E(){return b||(b=r.Util.createCanvasElement().getContext("2d"),b)}e.shapes={};function p(S){const P=this.attrs.fillRule;P?S.fill(P):S.fill()}function v(S){S.stroke()}function g(S){S.fill()}function y(S){S.stroke()}function d(){this._clearCache(u)}function m(){this._clearCache(f)}function _(){this._clearCache(h)}function k(){this._clearCache(O)}function x(){this._clearCache(w)}class A extends i.Node{constructor(P){super(P);let C;for(;C=r.Util.getRandomColor(),!(C&&!(C in e.shapes)););this.colorKey=C,e.shapes[C]=this}getContext(){return r.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return r.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(u,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(h,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var P=E();const C=P.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(C&&C.setTransform){const R=new r.Transform;R.translate(this.fillPatternX(),this.fillPatternY()),R.rotate(t.Konva.getAngle(this.fillPatternRotation())),R.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),R.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const N=R.getMatrix(),U=typeof DOMMatrix>"u"?{a:N[0],b:N[1],c:N[2],d:N[3],e:N[4],f:N[5]}:new DOMMatrix(N);C.setTransform(U)}return C}}_getLinearGradient(){return this._getCache(O,this.__getLinearGradient)}__getLinearGradient(){var P=this.fillLinearGradientColorStops();if(P){for(var C=E(),R=this.fillLinearGradientStartPoint(),N=this.fillLinearGradientEndPoint(),U=C.createLinearGradient(R.x,R.y,N.x,N.y),G=0;G<P.length;G+=2)U.addColorStop(P[G],P[G+1]);return U}}_getRadialGradient(){return this._getCache(w,this.__getRadialGradient)}__getRadialGradient(){var P=this.fillRadialGradientColorStops();if(P){for(var C=E(),R=this.fillRadialGradientStartPoint(),N=this.fillRadialGradientEndPoint(),U=C.createRadialGradient(R.x,R.y,this.fillRadialGradientStartRadius(),N.x,N.y,this.fillRadialGradientEndRadius()),G=0;G<P.length;G+=2)U.addColorStop(P[G],P[G+1]);return U}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var P=r.Util.colorToRGBA(this.shadowColor());if(P)return"rgba("+P.r+","+P.g+","+P.b+","+P.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const P=this.hitStrokeWidth();return P==="auto"?this.hasStroke():this.strokeEnabled()&&!!P}intersects(P){var C=this.getStage();if(!C)return!1;const R=C.bufferHitCanvas;return R.getContext().clear(),this.drawHit(R,void 0,!0),R.context.getImageData(Math.round(P.x),Math.round(P.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(P){var C;if(!((C=this.attrs.perfectDrawEnabled)!==null&&C!==void 0?C:!0))return!1;const N=P||this.hasFill(),U=this.hasStroke(),G=this.getAbsoluteOpacity()!==1;if(N&&U&&G)return!0;const Z=this.hasShadow(),W=this.shadowForStrokeEnabled();return!!(N&&U&&Z&&W)}setStrokeHitEnabled(P){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),P?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var P=this.size();return{x:this._centroid?-P.width/2:0,y:this._centroid?-P.height/2:0,width:P.width,height:P.height}}getClientRect(P={}){let C=!1,R=this.getParent();for(;R;){if(R.isCached()){C=!0;break}R=R.getParent()}const N=P.skipTransform,U=P.relativeTo||C&&this.getStage()||void 0,G=this.getSelfRect(),W=!P.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,H=G.width+W,M=G.height+W,L=!P.skipShadow&&this.hasShadow(),D=L?this.shadowOffsetX():0,B=L?this.shadowOffsetY():0,q=H+Math.abs(D),K=M+Math.abs(B),z=L&&this.shadowBlur()||0,$=q+z*2,F=K+z*2,Y={width:$,height:F,x:-(W/2+z)+Math.min(D,0)+G.x,y:-(W/2+z)+Math.min(B,0)+G.y};return N?Y:this._transformedRect(Y,U)}drawScene(P,C,R){var N=this.getLayer(),U=P||N.getCanvas(),G=U.getContext(),Z=this._getCanvasCache(),W=this.getSceneFunc(),H=this.hasShadow(),M,L,D=U.isCache,B=C===this;if(!this.isVisible()&&!B)return this;if(Z){G.save();var q=this.getAbsoluteTransform(C).getMatrix();return G.transform(q[0],q[1],q[2],q[3],q[4],q[5]),this._drawCachedSceneCanvas(G),G.restore(),this}if(!W)return this;if(G.save(),this._useBufferCanvas()&&!D){M=this.getStage();const $=R||M.bufferCanvas;L=$.getContext(),L.clear(),L.save(),L._applyLineJoin(this);var K=this.getAbsoluteTransform(C).getMatrix();L.transform(K[0],K[1],K[2],K[3],K[4],K[5]),W.call(this,L,this),L.restore();var z=$.pixelRatio;H&&G._applyShadow(this),G._applyOpacity(this),G._applyGlobalCompositeOperation(this),G.drawImage($._canvas,0,0,$.width/z,$.height/z)}else{if(G._applyLineJoin(this),!B){var K=this.getAbsoluteTransform(C).getMatrix();G.transform(K[0],K[1],K[2],K[3],K[4],K[5]),G._applyOpacity(this),G._applyGlobalCompositeOperation(this)}H&&G._applyShadow(this),W.call(this,G,this)}return G.restore(),this}drawHit(P,C,R=!1){if(!this.shouldDrawHit(C,R))return this;var N=this.getLayer(),U=P||N.hitCanvas,G=U&&U.getContext(),Z=this.hitFunc()||this.sceneFunc(),W=this._getCanvasCache(),H=W&&W.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()"),H){G.save();var M=this.getAbsoluteTransform(C).getMatrix();return G.transform(M[0],M[1],M[2],M[3],M[4],M[5]),this._drawCachedHitCanvas(G),G.restore(),this}if(!Z)return this;if(G.save(),G._applyLineJoin(this),!(this===C)){var D=this.getAbsoluteTransform(C).getMatrix();G.transform(D[0],D[1],D[2],D[3],D[4],D[5])}return Z.call(this,G,this),G.restore(),this}drawHitFromCache(P=0){var C=this._getCanvasCache(),R=this._getCachedSceneCanvas(),N=C.hit,U=N.getContext(),G=N.getWidth(),Z=N.getHeight(),W,H,M,L,D,B;U.clear(),U.drawImage(R._canvas,0,0,G,Z);try{for(W=U.getImageData(0,0,G,Z),H=W.data,M=H.length,L=r.Util._hexToRgb(this.colorKey),D=0;D<M;D+=4)B=H[D+3],B>P?(H[D]=L.r,H[D+1]=L.g,H[D+2]=L.b,H[D+3]=255):H[D+3]=0;U.putImageData(W,0,0)}catch(q){r.Util.error("Unable to draw hit graph from cached scene canvas. "+q.message)}return this}hasPointerCapture(P){return l.hasPointerCapture(P,this)}setPointerCapture(P){l.setPointerCapture(P,this)}releaseCapture(P){l.releaseCapture(P,this)}}e.Shape=A,A.prototype._fillFunc=p,A.prototype._strokeFunc=v,A.prototype._fillFuncHit=g,A.prototype._strokeFuncHit=y,A.prototype._centroid=!1,A.prototype.nodeType="Shape",(0,o._registerNode)(A),A.prototype.eventListeners={},A.prototype.on.call(A.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),A.prototype.on.call(A.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",m),A.prototype.on.call(A.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",_),A.prototype.on.call(A.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",k),A.prototype.on.call(A.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",x),n.Factory.addGetterSetter(A,"stroke",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(A,"strokeWidth",2,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(A,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(A,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(A,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(A,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(A,"lineJoin"),n.Factory.addGetterSetter(A,"lineCap"),n.Factory.addGetterSetter(A,"sceneFunc"),n.Factory.addGetterSetter(A,"hitFunc"),n.Factory.addGetterSetter(A,"dash"),n.Factory.addGetterSetter(A,"dashOffset",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"shadowColor",void 0,(0,a.getStringValidator)()),n.Factory.addGetterSetter(A,"shadowBlur",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"shadowOpacity",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(A,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(A,"shadowOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"shadowOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"fillPatternImage"),n.Factory.addGetterSetter(A,"fill",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(A,"fillPatternX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"fillPatternY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(A,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(A,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(A,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(A,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(A,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(A,"fillEnabled",!0),n.Factory.addGetterSetter(A,"strokeEnabled",!0),n.Factory.addGetterSetter(A,"shadowEnabled",!0),n.Factory.addGetterSetter(A,"dashEnabled",!0),n.Factory.addGetterSetter(A,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(A,"fillPriority","color"),n.Factory.addComponentsGetterSetter(A,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(A,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(A,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(A,"fillPatternScaleX",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"fillPatternScaleY",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(A,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(A,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(A,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(A,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(A,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(A,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(A,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(A,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(A,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(A,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(A,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(A,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(A,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(A,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(A,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(A,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(A,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(A,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(A,"fillPatternRotation",0),n.Factory.addGetterSetter(A,"fillRule",void 0,(0,a.getStringValidator)()),n.Factory.backCompat(A,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(yr);Object.defineProperty(Gc,"__esModule",{value:!0});Gc.Layer=void 0;const ua=Qt,V1=yl,Yl=qt,Dy=ft,z5=yi,uT=Ge,cT=yr,fT=ct;var dT="#",hT="beforeDraw",pT="draw",u9=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],gT=u9.length;let Ys=class extends V1.Container{constructor(t){super(t),this.canvas=new z5.SceneCanvas,this.hitCanvas=new z5.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(){Yl.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=Yl.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(Yl.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(Yl.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 Yl.Node.prototype.remove.call(this),t&&t.parentNode&&ua.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"&&ua.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(),Yl.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(){ua.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){ua.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,ua.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<gT;i++){const a=u9[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=ua.Util._rgbToHex(n[0],n[1],n[2]),o=cT.shapes[dT+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(hT,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),V1.Container.prototype.drawScene.call(this,i,r),this._fire(pT,{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){ua.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return ua.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 ua.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Gc.Layer=Ys;Ys.prototype.nodeType="Layer";(0,fT._registerNode)(Ys);Dy.Factory.addGetterSetter(Ys,"imageSmoothingEnabled",!0);Dy.Factory.addGetterSetter(Ys,"clearBeforeDraw",!0);Dy.Factory.addGetterSetter(Ys,"hitGraphEnabled",!0,(0,uT.getBooleanValidator)());var op={};Object.defineProperty(op,"__esModule",{value:!0});op.FastLayer=void 0;const vT=Qt,mT=Gc,yT=ct;let jy=class extends mT.Layer{constructor(t){super(t),this.listening(!1),vT.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};op.FastLayer=jy;jy.prototype.nodeType="FastLayer";(0,yT._registerNode)(jy);var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.Group=void 0;const bT=Qt,_T=yl,wT=ct;let Fy=class extends _T.Container{_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&bT.Util.throw("You may only add groups and shapes to groups.")}};Xs.Group=Fy;Fy.prototype.nodeType="Group";(0,wT._registerNode)(Fy);var Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.Animation=void 0;const q1=ct,B5=Qt,W1=function(){return q1.glob.performance&&q1.glob.performance.now?function(){return q1.glob.performance.now()}:function(){return new Date().getTime()}}();class zi{constructor(t,r){this.id=zi.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=zi.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(),zi._addAnimation(this),this}stop(){return zi._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 h=a[f];h._id!==void 0&&(t[h._id]=h)}}for(let n in t)t.hasOwnProperty(n)&&t[n].batchDraw()}static _animationLoop(){const t=zi;t.animations.length?(t._runFrames(),B5.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,B5.Util.requestAnimFrame(this._animationLoop))}}Zs.Animation=zi;zi.animations=[];zi.animIdCounter=0;zi.animRunning=!1;var c9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=Qt,r=Zs,n=qt,i=ct;var a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,f=0,h=["fill","stroke","shadowColor"];class O{constructor(E,p,v,g,y,d,m){this.prop=E,this.propFunc=p,this.begin=g,this._pos=g,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=m,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=v,this._change=y-this.begin,this.pause()}fire(E){var p=this[E];p&&p()}setTime(E){E>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():E<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=E,this.update())}getTime(){return this._time}setPosition(E){this.prevPos=this._pos,this.propFunc(E),this._pos=E}getPosition(E){return E===void 0&&(E=this._time),this.func(E,this.begin,this._change,this.duration)}play(){this.state=l,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=u,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(E){this.pause(),this._time=E,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var E=this.getTimer()-this._startTime;this.state===l?this.setTime(E):this.state===u&&this.setTime(this.duration-E)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class w{constructor(E){var p=this,v=E.node,g=v._id,y,d=E.easing||e.Easings.Linear,m=!!E.yoyo,_;typeof E.duration>"u"?y=.3:E.duration===0?y=.001:y=E.duration,this.node=v,this._id=f++;var k=v.getLayer()||(v instanceof i.Konva.Stage?v.getLayers():null);k||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new r.Animation(function(){p.tween.onEnterFrame()},k),this.tween=new O(_,function(x){p._tweenFunc(x)},d,0,1,y*1e3,m),this._addListeners(),w.attrs[g]||(w.attrs[g]={}),w.attrs[g][this._id]||(w.attrs[g][this._id]={}),w.tweens[g]||(w.tweens[g]={});for(_ in E)a[_]===void 0&&this._addAttr(_,E[_]);this.reset(),this.onFinish=E.onFinish,this.onReset=E.onReset,this.onUpdate=E.onUpdate}_addAttr(E,p){var v=this.node,g=v._id,y,d,m,_,k,x,A,S;if(m=w.tweens[g][E],m&&delete w.attrs[g][m][E],y=v.getAttr(E),t.Util._isArray(p))if(d=[],k=Math.max(p.length,y.length),E==="points"&&p.length!==y.length&&(p.length>y.length?(A=y,y=t.Util._prepareArrayForTween(y,p,v.closed())):(x=p,p=t.Util._prepareArrayForTween(p,y,v.closed()))),E.indexOf("fill")===0)for(_=0;_<k;_++)if(_%2===0)d.push(p[_]-y[_]);else{var P=t.Util.colorToRGBA(y[_]);S=t.Util.colorToRGBA(p[_]),y[_]=P,d.push({r:S.r-P.r,g:S.g-P.g,b:S.b-P.b,a:S.a-P.a})}else for(_=0;_<k;_++)d.push(p[_]-y[_]);else h.indexOf(E)!==-1?(y=t.Util.colorToRGBA(y),S=t.Util.colorToRGBA(p),d={r:S.r-y.r,g:S.g-y.g,b:S.b-y.b,a:S.a-y.a}):d=p-y;w.attrs[g][this._id][E]={start:y,diff:d,end:p,trueEnd:x,trueStart:A},w.tweens[g][E]=this._id}_tweenFunc(E){var p=this.node,v=w.attrs[p._id][this._id],g,y,d,m,_,k,x,A;for(g in v){if(y=v[g],d=y.start,m=y.diff,A=y.end,t.Util._isArray(d))if(_=[],x=Math.max(d.length,A.length),g.indexOf("fill")===0)for(k=0;k<x;k++)k%2===0?_.push((d[k]||0)+m[k]*E):_.push("rgba("+Math.round(d[k].r+m[k].r*E)+","+Math.round(d[k].g+m[k].g*E)+","+Math.round(d[k].b+m[k].b*E)+","+(d[k].a+m[k].a*E)+")");else for(k=0;k<x;k++)_.push((d[k]||0)+m[k]*E);else h.indexOf(g)!==-1?_="rgba("+Math.round(d.r+m.r*E)+","+Math.round(d.g+m.g*E)+","+Math.round(d.b+m.b*E)+","+(d.a+m.a*E)+")":_=d+m*E;p.setAttr(g,_)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var E=this.node,p=w.attrs[E._id][this._id];p.points&&p.points.trueEnd&&E.setAttr("points",p.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var E=this.node,p=w.attrs[E._id][this._id];p.points&&p.points.trueStart&&E.points(p.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(E){return this.tween.seek(E*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var E=this.node._id,p=this._id,v=w.tweens[E],g;this.pause();for(g in v)delete w.tweens[E][g];delete w.attrs[E][p]}}e.Tween=w,w.attrs={},w.tweens={},n.Node.prototype.to=function(b){var E=b.onFinish;b.node=this,b.onFinish=function(){this.destroy(),E&&E()};var p=new w(b);p.play()},e.Easings={BackEaseIn(b,E,p,v){var g=1.70158;return p*(b/=v)*b*((g+1)*b-g)+E},BackEaseOut(b,E,p,v){var g=1.70158;return p*((b=b/v-1)*b*((g+1)*b+g)+1)+E},BackEaseInOut(b,E,p,v){var g=1.70158;return(b/=v/2)<1?p/2*(b*b*(((g*=1.525)+1)*b-g))+E:p/2*((b-=2)*b*(((g*=1.525)+1)*b+g)+2)+E},ElasticEaseIn(b,E,p,v,g,y){var d=0;return b===0?E:(b/=v)===1?E+p:(y||(y=v*.3),!g||g<Math.abs(p)?(g=p,d=y/4):d=y/(2*Math.PI)*Math.asin(p/g),-(g*Math.pow(2,10*(b-=1))*Math.sin((b*v-d)*(2*Math.PI)/y))+E)},ElasticEaseOut(b,E,p,v,g,y){var d=0;return b===0?E:(b/=v)===1?E+p:(y||(y=v*.3),!g||g<Math.abs(p)?(g=p,d=y/4):d=y/(2*Math.PI)*Math.asin(p/g),g*Math.pow(2,-10*b)*Math.sin((b*v-d)*(2*Math.PI)/y)+p+E)},ElasticEaseInOut(b,E,p,v,g,y){var d=0;return b===0?E:(b/=v/2)===2?E+p:(y||(y=v*(.3*1.5)),!g||g<Math.abs(p)?(g=p,d=y/4):d=y/(2*Math.PI)*Math.asin(p/g),b<1?-.5*(g*Math.pow(2,10*(b-=1))*Math.sin((b*v-d)*(2*Math.PI)/y))+E:g*Math.pow(2,-10*(b-=1))*Math.sin((b*v-d)*(2*Math.PI)/y)*.5+p+E)},BounceEaseOut(b,E,p,v){return(b/=v)<1/2.75?p*(7.5625*b*b)+E:b<2/2.75?p*(7.5625*(b-=1.5/2.75)*b+.75)+E:b<2.5/2.75?p*(7.5625*(b-=2.25/2.75)*b+.9375)+E:p*(7.5625*(b-=2.625/2.75)*b+.984375)+E},BounceEaseIn(b,E,p,v){return p-e.Easings.BounceEaseOut(v-b,0,p,v)+E},BounceEaseInOut(b,E,p,v){return b<v/2?e.Easings.BounceEaseIn(b*2,0,p,v)*.5+E:e.Easings.BounceEaseOut(b*2-v,0,p,v)*.5+p*.5+E},EaseIn(b,E,p,v){return p*(b/=v)*b+E},EaseOut(b,E,p,v){return-p*(b/=v)*(b-2)+E},EaseInOut(b,E,p,v){return(b/=v/2)<1?p/2*b*b+E:-p/2*(--b*(b-2)-1)+E},StrongEaseIn(b,E,p,v){return p*(b/=v)*b*b*b*b+E},StrongEaseOut(b,E,p,v){return p*((b=b/v-1)*b*b*b*b+1)+E},StrongEaseInOut(b,E,p,v){return(b/=v/2)<1?p/2*b*b*b*b*b+E:p/2*((b-=2)*b*b*b*b+2)+E},Linear(b,E,p,v){return p*b/v+E}}})(c9);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=ct,r=Qt,n=qt,i=yl,a=o9,o=Gc,l=op,u=Xs,f=ip,h=yr,O=Zs,w=c9,b=ba,E=yi;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:h.Shape,shapes:h.shapes,Animation:O.Animation,Tween:w.Tween,Easings:w.Easings,Context:b.Context,Canvas:E.Canvas}),e.default=e.Konva})(yh);var lp={};Object.defineProperty(lp,"__esModule",{value:!0});lp.Arc=void 0;const sp=ft,ST=yr,U5=ct,up=Ge,ET=ct;let Aa=class extends ST.Shape{_sceneFunc(t){var r=U5.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=U5.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),h=o*r,O=l*(l>0?t:r),w=u*(u>0?r:t);return{x:f,y:n?-1*w:O,width:h-f,height:w-O}}};lp.Arc=Aa;Aa.prototype._centroid=!0;Aa.prototype.className="Arc";Aa.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,ET._registerNode)(Aa);sp.Factory.addGetterSetter(Aa,"innerRadius",0,(0,up.getNumberValidator)());sp.Factory.addGetterSetter(Aa,"outerRadius",0,(0,up.getNumberValidator)());sp.Factory.addGetterSetter(Aa,"angle",0,(0,up.getNumberValidator)());sp.Factory.addGetterSetter(Aa,"clockwise",!1,(0,up.getBooleanValidator)());var cp={},Vc={};Object.defineProperty(Vc,"__esModule",{value:!0});Vc.Line=void 0;const fp=ft,OT=yr,f9=Ge,PT=ct;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),h=o*u/(l+u),O=r-f*(i-e),w=n-f*(a-t),b=r+h*(i-e),E=n+h*(a-t);return[O,w,b,E]}function H5(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 Oo=class extends OT.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():H5(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=H5(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}}};Vc.Line=Oo;Oo.prototype.className="Line";Oo.prototype._attrsAffectingSize=["points","bezier","tension"];(0,PT._registerNode)(Oo);fp.Factory.addGetterSetter(Oo,"closed",!1);fp.Factory.addGetterSetter(Oo,"bezier",!1);fp.Factory.addGetterSetter(Oo,"tension",0,(0,f9.getNumberValidator)());fp.Factory.addGetterSetter(Oo,"points",[],(0,f9.getNumberArrayValidator)());var Qs={},d9={};(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,h,O;f=u/2,h=0;for(let b=0;b<20;b++)O=f*e.tValues[20][b]+f,h+=e.cValues[20][b]*n(o,l,O);return f*h};e.getCubicArcLength=t;const r=(o,l,u)=>{u===void 0&&(u=1);const f=o[0]-2*o[1]+o[2],h=l[0]-2*l[1]+l[2],O=2*o[1]-2*o[0],w=2*l[1]-2*l[0],b=4*(f*f+h*h),E=4*(f*O+h*w),p=O*O+w*w;if(b===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(l[2]-l[0],2));const v=E/(2*b),g=p/b,y=u+v,d=g-v*v,m=y*y+d>0?Math.sqrt(y*y+d):0,_=v*v+d>0?Math.sqrt(v*v+d):0,k=v+Math.sqrt(v*v+d)!==0?d*Math.log(Math.abs((y+m)/(v+_))):0;return Math.sqrt(b)/2*(y*m-v*_+k)};e.getQuadraticArcLength=r;function n(o,l,u){const f=i(1,u,o),h=i(1,u,l),O=f*f+h*h;return Math.sqrt(O)}const i=(o,l,u)=>{const f=u.length-1;let h,O;if(f===0)return 0;if(o===0){O=0;for(let w=0;w<=f;w++)O+=e.binomialCoefficients[f][w]*Math.pow(1-l,f-w)*Math.pow(l,w)*u[w];return O}else{h=new Array(f);for(let w=0;w<f;w++)h[w]=f*(u[w+1]-u[w]);return i(o-1,l,h)}},a=(o,l,u)=>{let f=1,h=o/l,O=(o-u(h))/l,w=0;for(;f>.001;){const b=u(h+O),E=Math.abs(o-b)/l;if(E<f)f=E,h+=O;else{const p=u(h-O),v=Math.abs(o-p)/l;v<f?(f=v,h-=O):O/=2}if(w++,w>500)break}return h};e.t2length=a})(d9);Object.defineProperty(Qs,"__esModule",{value:!0});Qs.Path=void 0;const xT=ft,CT=yr,kT=ct,Xl=d9;let qc=class sn extends CT.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],h=o[3],O=o[4],w=o[5],b=o[6],E=o[7],p=f>h?f:h,v=f>h?1:f/h,g=f>h?h/f:1;t.translate(l,u),t.rotate(b),t.scale(v,g),t.arc(0,0,p,O,O+w,1-E),t.scale(1/v,1/g),t.rotate(-b),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 h=f.points[4],O=f.points[5],w=f.points[4]+O,b=Math.PI/180;if(Math.abs(h-w)<b&&(b=Math.abs(h-w)),O<0)for(let E=h-b;E>w;E-=b){const p=sn.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],E,0);t.push(p.x,p.y)}else for(let E=h+b;E<w;E+=b){const p=sn.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],E,0);t.push(p.x,p.y)}}else if(f.command==="C")for(let E=0;E<=1;E+=.01){const p=sn.getPointOnCubicBezier(E,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3],f.points[4],f.points[5]);t.push(p.x,p.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,Xl.t2length)(t,sn.getPathLength(r),p=>(0,Xl.getCubicArcLength)([o.start.x,l[0],l[2],l[4]],[o.start.y,l[1],l[3],l[5]],p)),o.start.x,o.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return sn.getPointOnQuadraticBezier((0,Xl.t2length)(t,sn.getPathLength(r),p=>(0,Xl.getQuadraticArcLength)([o.start.x,l[0],l[2]],[o.start.y,l[1],l[3]],p)),o.start.x,o.start.y,l[0],l[1],l[2],l[3]);case"A":var u=l[0],f=l[1],h=l[2],O=l[3],w=l[4],b=l[5],E=l[6];return w+=b*t/o.pathLength,sn.getPointOnEllipticalArc(u,f,h,O,w,E)}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),h=Math.sqrt(t*t/(1+f*f))*(i<r?-1:1),O=f*h;if(Math.abs(l-n-f*(o-r))<1e-10)return{x:o+h,y:l+O};const w=((o-r)*(i-r)+(l-n)*(a-n))/(u*u),b=r+w*(i-r),E=n+w*(a-n),p=this.getLineLength(o,l,b,E),v=Math.sqrt(t*t-p*p),g=Math.sqrt(v*v/(1+f*f))*(i<r?-1:1),y=f*g;return{x:b+g,y:E+y}}static getPointOnCubicBezier(t,r,n,i,a,o,l,u,f){function h(v){return v*v*v}function O(v){return 3*v*v*(1-v)}function w(v){return 3*v*(1-v)*(1-v)}function b(v){return(1-v)*(1-v)*(1-v)}var E=u*h(t)+o*O(t)+i*w(t)+r*b(t),p=f*h(t)+l*O(t)+a*w(t)+n*b(t);return{x:E,y:p}}static getPointOnQuadraticBezier(t,r,n,i,a,o,l){function u(b){return b*b}function f(b){return 2*b*(1-b)}function h(b){return(1-b)*(1-b)}var O=o*u(t)+i*f(t)+r*h(t),w=l*u(t)+a*f(t)+n*h(t);return{x:O,y:w}}static getPointOnEllipticalArc(t,r,n,i,a,o){var l=Math.cos(o),u=Math.sin(o),f={x:n*Math.cos(a),y:i*Math.sin(a)};return{x:t+(f.x*l-f.y*u),y:r+(f.x*u+f.y*l)}}static parsePathData(t){if(!t)return[];var r=t,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];r=r.replace(new RegExp(" ","g"),",");for(var i=0;i<n.length;i++)r=r.replace(new RegExp(n[i],"g"),"|"+n[i]);var a=r.split("|"),o=[],l=[],u=0,f=0,h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,O;for(i=1;i<a.length;i++){var w=a[i],b=w.charAt(0);for(w=w.slice(1),l.length=0;O=h.exec(w);)l.push(O[0]);for(var E=[],p=0,v=l.length;p<v;p++){if(l[p]==="00"){E.push(0,0);continue}var g=parseFloat(l[p]);isNaN(g)?E.push(0):E.push(g)}for(;E.length>0&&!isNaN(E[0]);){var y="",d=[],m=u,_=f,k,x,A,S,P,C,R,N,U,G;switch(b){case"l":u+=E.shift(),f+=E.shift(),y="L",d.push(u,f);break;case"L":u=E.shift(),f=E.shift(),d.push(u,f);break;case"m":var Z=E.shift(),W=E.shift();if(u+=Z,f+=W,y="M",o.length>2&&o[o.length-1].command==="z"){for(var H=o.length-2;H>=0;H--)if(o[H].command==="M"){u=o[H].points[0]+Z,f=o[H].points[1]+W;break}}d.push(u,f),b="l";break;case"M":u=E.shift(),f=E.shift(),y="M",d.push(u,f),b="L";break;case"h":u+=E.shift(),y="L",d.push(u,f);break;case"H":u=E.shift(),y="L",d.push(u,f);break;case"v":f+=E.shift(),y="L",d.push(u,f);break;case"V":f=E.shift(),y="L",d.push(u,f);break;case"C":d.push(E.shift(),E.shift(),E.shift(),E.shift()),u=E.shift(),f=E.shift(),d.push(u,f);break;case"c":d.push(u+E.shift(),f+E.shift(),u+E.shift(),f+E.shift()),u+=E.shift(),f+=E.shift(),y="C",d.push(u,f);break;case"S":x=u,A=f,k=o[o.length-1],k.command==="C"&&(x=u+(u-k.points[2]),A=f+(f-k.points[3])),d.push(x,A,E.shift(),E.shift()),u=E.shift(),f=E.shift(),y="C",d.push(u,f);break;case"s":x=u,A=f,k=o[o.length-1],k.command==="C"&&(x=u+(u-k.points[2]),A=f+(f-k.points[3])),d.push(x,A,u+E.shift(),f+E.shift()),u+=E.shift(),f+=E.shift(),y="C",d.push(u,f);break;case"Q":d.push(E.shift(),E.shift()),u=E.shift(),f=E.shift(),d.push(u,f);break;case"q":d.push(u+E.shift(),f+E.shift()),u+=E.shift(),f+=E.shift(),y="Q",d.push(u,f);break;case"T":x=u,A=f,k=o[o.length-1],k.command==="Q"&&(x=u+(u-k.points[0]),A=f+(f-k.points[1])),u=E.shift(),f=E.shift(),y="Q",d.push(x,A,u,f);break;case"t":x=u,A=f,k=o[o.length-1],k.command==="Q"&&(x=u+(u-k.points[0]),A=f+(f-k.points[1])),u+=E.shift(),f+=E.shift(),y="Q",d.push(x,A,u,f);break;case"A":S=E.shift(),P=E.shift(),C=E.shift(),R=E.shift(),N=E.shift(),U=u,G=f,u=E.shift(),f=E.shift(),y="A",d=this.convertEndpointToCenterParameterization(U,G,u,f,R,N,S,P,C);break;case"a":S=E.shift(),P=E.shift(),C=E.shift(),R=E.shift(),N=E.shift(),U=u,G=f,u+=E.shift(),f+=E.shift(),y="A",d=this.convertEndpointToCenterParameterization(U,G,u,f,R,N,S,P,C);break}o.push({command:y||b,points:d,start:{x:m,y:_},pathLength:this.calcLength(m,_,y||b,d)})}(b==="z"||b==="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,Xl.getCubicArcLength)([t,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return(0,Xl.getQuadraticArcLength)([t,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;var h=i[4],O=i[5],w=i[4]+O,b=Math.PI/180;if(Math.abs(h-w)<b&&(b=Math.abs(h-w)),o=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],h,0),O<0)for(u=h-b;u>w;u-=b)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=h+b;u<w;u+=b)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;return l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],w,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),a}return 0}static convertEndpointToCenterParameterization(t,r,n,i,a,o,l,u,f){var h=f*(Math.PI/180),O=Math.cos(h)*(t-n)/2+Math.sin(h)*(r-i)/2,w=-1*Math.sin(h)*(t-n)/2+Math.cos(h)*(r-i)/2,b=O*O/(l*l)+w*w/(u*u);b>1&&(l*=Math.sqrt(b),u*=Math.sqrt(b));var E=Math.sqrt((l*l*(u*u)-l*l*(w*w)-u*u*(O*O))/(l*l*(w*w)+u*u*(O*O)));a===o&&(E*=-1),isNaN(E)&&(E=0);var p=E*l*w/u,v=E*-u*O/l,g=(t+n)/2+Math.cos(h)*p-Math.sin(h)*v,y=(r+i)/2+Math.sin(h)*p+Math.cos(h)*v,d=function(P){return Math.sqrt(P[0]*P[0]+P[1]*P[1])},m=function(P,C){return(P[0]*C[0]+P[1]*C[1])/(d(P)*d(C))},_=function(P,C){return(P[0]*C[1]<P[1]*C[0]?-1:1)*Math.acos(m(P,C))},k=_([1,0],[(O-p)/l,(w-v)/u]),x=[(O-p)/l,(w-v)/u],A=[(-1*O-p)/l,(-1*w-v)/u],S=_(x,A);return m(x,A)<=-1&&(S=Math.PI),m(x,A)>=1&&(S=0),o===0&&S>0&&(S=S-2*Math.PI),o===1&&S<0&&(S=S+2*Math.PI),[g,y,l,u,k,S,h,o]}};Qs.Path=qc;qc.prototype.className="Path";qc.prototype._attrsAffectingSize=["data"];(0,kT._registerNode)(qc);xT.Factory.addGetterSetter(qc,"data");Object.defineProperty(cp,"__esModule",{value:!0});cp.Arrow=void 0;const dp=ft,TT=Vc,h9=Ge,AT=ct,$5=Qs;let _l=class extends TT.Line{_sceneFunc(t){super._sceneFunc(t);var r=Math.PI*2,n=this.points(),i=n,a=this.tension()!==0&&n.length>4;a&&(i=this.getTensionPoints());var o=this.pointerLength(),l=n.length,u,f;if(a){const w=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],n[l-2],n[l-1]],b=$5.Path.calcLength(i[i.length-4],i[i.length-3],"C",w),E=$5.Path.getPointOnQuadraticBezier(Math.min(1,1-o/b),w[0],w[1],w[2],w[3],w[4],w[5]);u=n[l-2]-E.x,f=n[l-1]-E.y}else u=n[l-2]-n[l-4],f=n[l-1]-n[l-3];var h=(Math.atan2(f,u)+r)%r,O=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(n[l-2],n[l-1]),t.rotate(h),t.moveTo(0,0),t.lineTo(-o,O/2),t.lineTo(-o,-O/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,O/2),t.lineTo(-o,-O/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var r=this.dashEnabled();r&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),r&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),r=this.pointerWidth()/2;return{x:t.x-r,y:t.y-r,width:t.width+r*2,height:t.height+r*2}}};cp.Arrow=_l;_l.prototype.className="Arrow";(0,AT._registerNode)(_l);dp.Factory.addGetterSetter(_l,"pointerLength",10,(0,h9.getNumberValidator)());dp.Factory.addGetterSetter(_l,"pointerWidth",10,(0,h9.getNumberValidator)());dp.Factory.addGetterSetter(_l,"pointerAtBeginning",!1);dp.Factory.addGetterSetter(_l,"pointerAtEnding",!0);var hp={};Object.defineProperty(hp,"__esModule",{value:!0});hp.Circle=void 0;const RT=ft,MT=yr,LT=Ge,NT=ct;let Js=class extends MT.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)}};hp.Circle=Js;Js.prototype._centroid=!0;Js.prototype.className="Circle";Js.prototype._attrsAffectingSize=["radius"];(0,NT._registerNode)(Js);RT.Factory.addGetterSetter(Js,"radius",0,(0,LT.getNumberValidator)());var pp={};Object.defineProperty(pp,"__esModule",{value:!0});pp.Ellipse=void 0;const zy=ft,IT=yr,p9=Ge,DT=ct;let Po=class extends IT.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)}};pp.Ellipse=Po;Po.prototype.className="Ellipse";Po.prototype._centroid=!0;Po.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,DT._registerNode)(Po);zy.Factory.addComponentsGetterSetter(Po,"radius",["x","y"]);zy.Factory.addGetterSetter(Po,"radiusX",0,(0,p9.getNumberValidator)());zy.Factory.addGetterSetter(Po,"radiusY",0,(0,p9.getNumberValidator)());var gp={};Object.defineProperty(gp,"__esModule",{value:!0});gp.Image=void 0;const K1=Qt,wl=ft,jT=yr,FT=ct,Wc=Ge;let Zi=class g9 extends jT.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 g9({image:i});r(a)},i.onerror=n,i.crossOrigin="Anonymous",i.src=t}};gp.Image=Zi;Zi.prototype.className="Image";(0,FT._registerNode)(Zi);wl.Factory.addGetterSetter(Zi,"cornerRadius",0,(0,Wc.getNumberOrArrayOfNumbersValidator)(4));wl.Factory.addGetterSetter(Zi,"image");wl.Factory.addComponentsGetterSetter(Zi,"crop",["x","y","width","height"]);wl.Factory.addGetterSetter(Zi,"cropX",0,(0,Wc.getNumberValidator)());wl.Factory.addGetterSetter(Zi,"cropY",0,(0,Wc.getNumberValidator)());wl.Factory.addGetterSetter(Zi,"cropWidth",0,(0,Wc.getNumberValidator)());wl.Factory.addGetterSetter(Zi,"cropHeight",0,(0,Wc.getNumberValidator)());var Ns={};Object.defineProperty(Ns,"__esModule",{value:!0});Ns.Tag=Ns.Label=void 0;const vp=ft,zT=yr,BT=Xs,By=Ge,v9=ct;var m9=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],UT="Change.konva",HT="none",um="up",cm="right",fm="down",dm="left",$T=m9.length;let Uy=class extends BT.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<$T;n++)t.on(m9[n]+UT,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})}}};Ns.Label=Uy;Uy.prototype.className="Label";(0,v9._registerNode)(Uy);let Sl=class extends zT.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,h=0,O=0;typeof l=="number"?u=f=h=O=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),O=Math.min(l[2]||0,r/2,n/2),h=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-O),t.arc(r-O,n-O,O,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(h,n),t.arc(h,n-h,h,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}}};Ns.Tag=Sl;Sl.prototype.className="Tag";(0,v9._registerNode)(Sl);vp.Factory.addGetterSetter(Sl,"pointerDirection",HT);vp.Factory.addGetterSetter(Sl,"pointerWidth",0,(0,By.getNumberValidator)());vp.Factory.addGetterSetter(Sl,"pointerHeight",0,(0,By.getNumberValidator)());vp.Factory.addGetterSetter(Sl,"cornerRadius",0,(0,By.getNumberOrArrayOfNumbersValidator)(4));var Kc={};Object.defineProperty(Kc,"__esModule",{value:!0});Kc.Rect=void 0;const GT=ft,VT=yr,qT=ct,WT=Qt,KT=Ge;let mp=class extends VT.Shape{_sceneFunc(t){var r=this.cornerRadius(),n=this.width(),i=this.height();t.beginPath(),r?WT.Util.drawRoundedRectPath(t,n,i,r):t.rect(0,0,n,i),t.closePath(),t.fillStrokeShape(this)}};Kc.Rect=mp;mp.prototype.className="Rect";(0,qT._registerNode)(mp);GT.Factory.addGetterSetter(mp,"cornerRadius",0,(0,KT.getNumberOrArrayOfNumbersValidator)(4));var yp={};Object.defineProperty(yp,"__esModule",{value:!0});yp.RegularPolygon=void 0;const y9=ft,YT=yr,b9=Ge,XT=ct;let El=class extends YT.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)}};yp.RegularPolygon=El;El.prototype.className="RegularPolygon";El.prototype._centroid=!0;El.prototype._attrsAffectingSize=["radius"];(0,XT._registerNode)(El);y9.Factory.addGetterSetter(El,"radius",0,(0,b9.getNumberValidator)());y9.Factory.addGetterSetter(El,"sides",0,(0,b9.getNumberValidator)());var bp={};Object.defineProperty(bp,"__esModule",{value:!0});bp.Ring=void 0;const _9=ft,ZT=yr,w9=Ge,QT=ct;var G5=Math.PI*2;let Ol=class extends ZT.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,G5,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),G5,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}};bp.Ring=Ol;Ol.prototype.className="Ring";Ol.prototype._centroid=!0;Ol.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,QT._registerNode)(Ol);_9.Factory.addGetterSetter(Ol,"innerRadius",0,(0,w9.getNumberValidator)());_9.Factory.addGetterSetter(Ol,"outerRadius",0,(0,w9.getNumberValidator)());var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.Sprite=void 0;const Pl=ft,JT=yr,eA=Zs,S9=Ge,tA=ct;let Qi=class extends JT.Shape{constructor(t){super(t),this._updated=!0,this.anim=new eA.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],h=a[i+3],O=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,f,h),t.closePath(),t.fillStrokeShape(this)),O)if(o){var w=o[r],b=n*2;t.drawImage(O,l,u,f,h,w[b+0],w[b+1],f,h)}else t.drawImage(O,l,u,f,h,0,0,f,h)}_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],h=n*2;t.rect(f[h+0],f[h+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)}};_p.Sprite=Qi;Qi.prototype.className="Sprite";(0,tA._registerNode)(Qi);Pl.Factory.addGetterSetter(Qi,"animation");Pl.Factory.addGetterSetter(Qi,"animations");Pl.Factory.addGetterSetter(Qi,"frameOffsets");Pl.Factory.addGetterSetter(Qi,"image");Pl.Factory.addGetterSetter(Qi,"frameIndex",0,(0,S9.getNumberValidator)());Pl.Factory.addGetterSetter(Qi,"frameRate",17,(0,S9.getNumberValidator)());Pl.Factory.backCompat(Qi,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var wp={};Object.defineProperty(wp,"__esModule",{value:!0});wp.Star=void 0;const Hy=ft,rA=yr,$y=Ge,nA=ct;let xo=class extends rA.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)}};wp.Star=xo;xo.prototype.className="Star";xo.prototype._centroid=!0;xo.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,nA._registerNode)(xo);Hy.Factory.addGetterSetter(xo,"numPoints",5,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(xo,"innerRadius",0,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(xo,"outerRadius",0,(0,$y.getNumberValidator)());var dl={};Object.defineProperty(dl,"__esModule",{value:!0});dl.Text=dl.stringToArray=void 0;const hm=Qt,Vr=ft,iA=yr,Y1=ct,Co=Ge,aA=ct;function E9(e){return Array.from(e)}dl.stringToArray=E9;var Zl="auto",oA="center",O9="inherit",Nu="justify",lA="Change.konva",sA="2d",V5="-",P9="left",uA="text",cA="Text",fA="top",dA="bottom",q5="middle",x9="normal",hA="px ",md=" ",pA="right",W5="rtl",gA="word",vA="char",K5="none",X1="…",C9=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],mA=C9.length;function yA(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 yd;function Z1(){return yd||(yd=hm.Util.createCanvasElement().getContext(sA),yd)}function bA(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function _A(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function wA(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let tr=class extends iA.Shape{constructor(t){super(wA(t)),this._partialTextX=0,this._partialTextY=0;for(var r=0;r<mA;r++)this.on(C9[r]+lA,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,h=this.align(),O=this.getWidth(),w=this.letterSpacing(),b=this.fill(),E=this.textDecoration(),p=E.indexOf("underline")!==-1,v=E.indexOf("line-through")!==-1,g;u=u===O9?t.direction:u;var y=o/2,d=q5;if(Y1.Konva._fixTextRendering){var m=this.measureSize("M");d="alphabetic",y=(m.fontBoundingBoxAscent-m.fontBoundingBoxDescent)/2+o/2}var _=0,k=0;for(u===W5&&t.setAttr("direction",u),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",d),t.setAttr("textAlign",P9),l===q5?f=(this.getHeight()-n*o-i*2)/2:l===dA&&(f=this.getHeight()-n*o-i*2),t.translate(i,f+i),g=0;g<n;g++){var _=0,k=0,x=r[g],A=x.text,S=x.width,P=x.lastInParagraph,C,R,N;if(t.save(),h===pA?_+=O-S-i*2:h===oA&&(_+=(O-S-i*2)/2),p){t.save(),t.beginPath();let M=Y1.Konva._fixTextRendering?Math.round(a/4):Math.round(a/2);const L=_,D=y+k+M;t.moveTo(L,D),C=A.split(" ").length-1,R=C===0,N=h===Nu&&!P?O-i*2:S,t.lineTo(L+Math.round(N),D),t.lineWidth=a/15;const B=this._getLinearGradient();t.strokeStyle=B||b,t.stroke(),t.restore()}if(v){t.save(),t.beginPath();let M=Y1.Konva._fixTextRendering?-Math.round(a/4):0;t.moveTo(_,y+k+M),C=A.split(" ").length-1,R=C===0,N=h===Nu&&P&&!R?O-i*2:S,t.lineTo(_+Math.round(N),y+k+M),t.lineWidth=a/15;const L=this._getLinearGradient();t.strokeStyle=L||b,t.stroke(),t.restore()}if(u!==W5&&(w!==0||h===Nu)){C=A.split(" ").length-1;for(var U=E9(A),G=0;G<U.length;G++){var Z=U[G];Z===" "&&!P&&h===Nu&&(_+=(O-i*2-S)/C),this._partialTextX=_,this._partialTextY=y+k,this._partialText=Z,t.fillStrokeShape(this),_+=this.measureSize(Z).width+w}}else w!==0&&t.setAttr("letterSpacing",`${w}px`),this._partialTextX=_,this._partialTextY=y+k,this._partialText=A,t.fillStrokeShape(this);t.restore(),n>1&&(y+=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(uA,r),this}getWidth(){var t=this.attrs.width===Zl||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Zl||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,n,i,a,o,l,u,f,h,O,w,b=Z1(),E=this.fontSize(),p;b.save(),b.font=this._getContextFont(),p=b.measureText(t),b.restore();const v=E/100;return{actualBoundingBoxAscent:(r=p.actualBoundingBoxAscent)!==null&&r!==void 0?r:71.58203125*v,actualBoundingBoxDescent:(n=p.actualBoundingBoxDescent)!==null&&n!==void 0?n:0,actualBoundingBoxLeft:(i=p.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*v,actualBoundingBoxRight:(a=p.actualBoundingBoxRight)!==null&&a!==void 0?a:75.732421875*v,alphabeticBaseline:(o=p.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(l=p.emHeightAscent)!==null&&l!==void 0?l:100*v,emHeightDescent:(u=p.emHeightDescent)!==null&&u!==void 0?u:-20*v,fontBoundingBoxAscent:(f=p.fontBoundingBoxAscent)!==null&&f!==void 0?f:91*v,fontBoundingBoxDescent:(h=p.fontBoundingBoxDescent)!==null&&h!==void 0?h:21*v,hangingBaseline:(O=p.hangingBaseline)!==null&&O!==void 0?O:72.80000305175781*v,ideographicBaseline:(w=p.ideographicBaseline)!==null&&w!==void 0?w:-21*v,width:p.width,height:E}}_getContextFont(){return this.fontStyle()+md+this.fontVariant()+md+(this.fontSize()+hA)+yA(this.fontFamily())}_addTextLine(t){this.align()===Nu&&(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!==Zl&&a!==void 0,u=o!==Zl&&o!==void 0,f=this.padding(),h=a-f*2,O=o-f*2,w=0,b=this.wrap(),E=b!==K5,p=b!==vA&&E,v=this.ellipsis();this.textArr=[],Z1().font=this._getContextFont();for(var g=v?this._getTextWidth(X1):0,y=0,d=t.length;y<d;++y){var m=t[y],_=this._getTextWidth(m);if(l&&_>h)for(;m.length>0;){for(var k=0,x=m.length,A="",S=0;k<x;){var P=k+x>>>1,C=m.slice(0,P+1),R=this._getTextWidth(C)+g;R<=h?(k=P+1,A=C,S=R):x=P}if(A){if(p){var N,U=m[A.length],G=U===md||U===V5;G&&S<=h?N=A.length:N=Math.max(A.lastIndexOf(md),A.lastIndexOf(V5))+1,N>0&&(k=N,A=A.slice(0,k),S=this._getTextWidth(A))}A=A.trimRight(),this._addTextLine(A),n=Math.max(n,S),w+=i;var Z=this._shouldHandleEllipsis(w);if(Z){this._tryToAddEllipsisToLastLine();break}if(m=m.slice(k),m=m.trimLeft(),m.length>0&&(_=this._getTextWidth(m),_<=h)){this._addTextLine(m),w+=i,n=Math.max(n,_);break}}else break}else this._addTextLine(m),w+=i,n=Math.max(n,_),this._shouldHandleEllipsis(w)&&y<d-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&w+i>O)break}this.textHeight=r,this.textWidth=n}_shouldHandleEllipsis(t){var r=+this.fontSize(),n=this.lineHeight()*r,i=this.attrs.height,a=i!==Zl&&i!==void 0,o=this.padding(),l=i-o*2,u=this.wrap(),f=u!==K5;return!f||a&&t+n>l}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,r=t!==Zl&&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()}};dl.Text=tr;tr.prototype._fillFunc=bA;tr.prototype._strokeFunc=_A;tr.prototype.className=cA;tr.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,aA._registerNode)(tr);Vr.Factory.overWriteSetter(tr,"width",(0,Co.getNumberOrAutoValidator)());Vr.Factory.overWriteSetter(tr,"height",(0,Co.getNumberOrAutoValidator)());Vr.Factory.addGetterSetter(tr,"direction",O9);Vr.Factory.addGetterSetter(tr,"fontFamily","Arial");Vr.Factory.addGetterSetter(tr,"fontSize",12,(0,Co.getNumberValidator)());Vr.Factory.addGetterSetter(tr,"fontStyle",x9);Vr.Factory.addGetterSetter(tr,"fontVariant",x9);Vr.Factory.addGetterSetter(tr,"padding",0,(0,Co.getNumberValidator)());Vr.Factory.addGetterSetter(tr,"align",P9);Vr.Factory.addGetterSetter(tr,"verticalAlign",fA);Vr.Factory.addGetterSetter(tr,"lineHeight",1,(0,Co.getNumberValidator)());Vr.Factory.addGetterSetter(tr,"wrap",gA);Vr.Factory.addGetterSetter(tr,"ellipsis",!1,(0,Co.getBooleanValidator)());Vr.Factory.addGetterSetter(tr,"letterSpacing",0,(0,Co.getNumberValidator)());Vr.Factory.addGetterSetter(tr,"text","",(0,Co.getStringValidator)());Vr.Factory.addGetterSetter(tr,"textDecoration","");var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});Sp.TextPath=void 0;const Q1=Qt,Si=ft,SA=yr,Iu=Qs,J1=dl,k9=Ge,EA=ct;var OA="",T9="normal";function A9(e){e.fillText(this.partialText,0,0)}function R9(e){e.strokeText(this.partialText,0,0)}let br=class extends SA.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 Iu.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const r=this.pathLength;return t-1>r?null:Iu.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Iu.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 h=0;h<u.length;h++){const O=this._getPointAtLength(f);if(!O)return;let w=this._getTextSize(u[h]).width+n;if(u[h]===" "&&i==="justify"){const y=this.text().split(" ").length-1;w+=(this.pathLength-o)/y}const b=this._getPointAtLength(f+w);if(!b)return;const E=Iu.Path.getLineLength(O.x,O.y,b.x,b.y);let p=0;if(a)try{p=a(u[h-1],u[h])*this.fontSize()}catch{p=0}O.x+=p,b.x+=p,this.textWidth+=p;const v=Iu.Path.getPointOnLine(p+E/2,O.x,O.y,b.x,b.y),g=Math.atan2(b.y-O.y,b.x-O.x);this.glyphInfo.push({transposeX:v.x,transposeY:v.y,text:u[h],rotation:g,p0:O,p1:b}),f+=w}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(h){t.push(h.p0.x),t.push(h.p0.y),t.push(h.p1.x),t.push(h.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()}};Sp.TextPath=br;br.prototype._fillFunc=A9;br.prototype._strokeFunc=R9;br.prototype._fillFuncHit=A9;br.prototype._strokeFuncHit=R9;br.prototype.className="TextPath";br.prototype._attrsAffectingSize=["text","fontSize","data"];(0,EA._registerNode)(br);Si.Factory.addGetterSetter(br,"data");Si.Factory.addGetterSetter(br,"fontFamily","Arial");Si.Factory.addGetterSetter(br,"fontSize",12,(0,k9.getNumberValidator)());Si.Factory.addGetterSetter(br,"fontStyle",T9);Si.Factory.addGetterSetter(br,"align","left");Si.Factory.addGetterSetter(br,"letterSpacing",0,(0,k9.getNumberValidator)());Si.Factory.addGetterSetter(br,"textBaseline","middle");Si.Factory.addGetterSetter(br,"fontVariant",T9);Si.Factory.addGetterSetter(br,"text",OA);Si.Factory.addGetterSetter(br,"textDecoration",null);Si.Factory.addGetterSetter(br,"kerningFunc",null);var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Transformer=void 0;const At=Qt,xt=ft,Y5=qt,PA=yr,xA=Kc,X5=Xs,si=ct,ko=Ge,CA=ct;var M9="tr-konva",kA=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${M9}`).join(" "),Z5="nodesRect",TA=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],AA={"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 RA="ontouchstart"in si.Konva._global;function MA(e,t,r){if(e==="rotater")return r;t+=At.Util.degToRad(AA[e]||0);var n=(At.Util.radToDeg(t)%360+360)%360;return At.Util._inRange(n,315+22.5,360)||At.Util._inRange(n,0,22.5)?"ns-resize":At.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":At.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":At.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":At.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":At.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":At.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":At.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(At.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var _h=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],Q5=1e8;function LA(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 L9(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 NA(e,t){const r=LA(e);return L9(e,t,r)}function IA(e,t,r){let n=t;for(let i=0;i<e.length;i++){const a=si.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,bt=class extends X5.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(kA,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return At.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 M9+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const r=t.filter(i=>i.isAncestorOf(this)?(At.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(TA.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(Z5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(Z5,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=(si.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),h={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 L9(h,-si.Konva.getAngle(r),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-Q5,y:-Q5,width:0,height:0,rotation:0};const r=[];this.nodes().map(f=>{const h=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var O=[{x:h.x,y:h.y},{x:h.x+h.width,y:h.y},{x:h.x+h.width,y:h.y+h.height},{x:h.x,y:h.y+h.height}],w=f.getAbsoluteTransform();O.forEach(function(b){var E=w.point(b);r.push(E)})});const n=new At.Transform;n.rotate(-si.Konva.getAngle(this.rotation()));var i=1/0,a=1/0,o=-1/0,l=-1/0;r.forEach(function(f){var h=n.point(f);i===void 0&&(i=o=h.x,a=l=h.y),i=Math.min(i,h.x),a=Math.min(a,h.y),o=Math.max(o,h.x),l=Math.max(l,h.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:si.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(),_h.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var r=new xA.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:RA?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=si.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=MA(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 PA.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()*At.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 h=a.getAbsolutePosition();if(!(f.x===h.x&&f.y===h.y)){if(this._movingAnchorName==="rotater"){var O=this._getNodeRect();r=a.x()-O.width/2,n=-a.y()+O.height/2;let N=Math.atan2(-n,r)+Math.PI/2;O.height<0&&(N-=Math.PI);var w=si.Konva.getAngle(this.rotation());const U=w+N,G=si.Konva.getAngle(this.rotationSnapTolerance()),W=IA(this.rotationSnaps(),U,G)-O.rotation,H=NA(O,W);this._fitNodesInto(H,t);return}var b=this.shiftBehavior(),E;b==="inverted"?E=this.keepRatio()&&!t.shiftKey:b==="none"?E=this.keepRatio():E=this.keepRatio()||t.shiftKey;var d=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(E){var p=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(p.x-a.x(),2)+Math.pow(p.y-a.y(),2));var v=this.findOne(".top-left").x()>p.x?-1:1,g=this.findOne(".top-left").y()>p.y?-1:1;r=i*this.cos*v,n=i*this.sin*g,this.findOne(".top-left").x(p.x-r),this.findOne(".top-left").y(p.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(E){var p=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()-p.x,2)+Math.pow(p.y-a.y(),2));var v=this.findOne(".top-right").x()<p.x?-1:1,g=this.findOne(".top-right").y()>p.y?-1:1;r=i*this.cos*v,n=i*this.sin*g,this.findOne(".top-right").x(p.x+r),this.findOne(".top-right").y(p.y-n)}var y=a.position();this.findOne(".top-left").y(y.y),this.findOne(".bottom-right").x(y.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(E){var p=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(p.x-a.x(),2)+Math.pow(a.y()-p.y,2));var v=p.x<a.x()?-1:1,g=a.y()<p.y?-1:1;r=i*this.cos*v,n=i*this.sin*g,a.x(p.x-r),a.y(p.y+n)}y=a.position(),this.findOne(".top-left").x(y.x),this.findOne(".bottom-right").y(y.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(E){var p=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()-p.x,2)+Math.pow(a.y()-p.y,2));var v=this.findOne(".bottom-right").x()<p.x?-1:1,g=this.findOne(".bottom-right").y()<p.y?-1:1;r=i*this.cos*v,n=i*this.sin*g,this.findOne(".bottom-right").x(p.x+r),this.findOne(".bottom-right").y(p.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var d=this.centeredScaling()||t.altKey;if(d){var m=this.findOne(".top-left"),_=this.findOne(".bottom-right"),k=m.x(),x=m.y(),A=this.getWidth()-_.x(),S=this.getHeight()-_.y();_.move({x:-k,y:-x}),m.move({x:A,y:S})}var P=this.findOne(".top-left").getAbsolutePosition();r=P.x,n=P.y;var C=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),R=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:r,y:n,width:C,height:R,rotation:si.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(At.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(At.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}var a=new At.Transform;if(a.rotate(si.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const w=a.point({x:-this.padding()*2,y:0});t.x+=w.x,t.y+=w.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const w=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const w=a.point({x:0,y:-this.padding()*2});t.x+=w.x,t.y+=w.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const w=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const w=this.boundBoxFunc()(n,t);w?t=w:At.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,l=new At.Transform;l.translate(n.x,n.y),l.rotate(n.rotation),l.scale(n.width/o,n.height/o);const u=new At.Transform,f=t.width/o,h=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(h))):(u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(f,h));const O=u.multiply(l.invert());this._nodes.forEach(w=>{var b;const E=w.getParent().getAbsoluteTransform(),p=w.getTransform().copy();p.translate(w.offsetX(),w.offsetY());const v=new At.Transform;v.multiply(E.copy().invert()).multiply(O).multiply(E).multiply(p);const g=v.decompose();w.setAttrs(g),(b=w.getLayer())===null||b===void 0||b.batchDraw()}),this.rotation(At.Util._getRotation(t.rotation)),this._nodes.forEach(w=>{this._fire("transform",{evt:r,target:w}),w._fire("transform",{evt:r,target:w})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,r){this.findOne(t).setAttrs(r)}update(){var t,r=this._getNodeRect();this.rotation(At.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(O=>{O.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()*At.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 h=this.anchorStyleFunc();h&&f.forEach(O=>{h(O)}),(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=""),X5.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Y5.Node.prototype.toObject.call(this)}clone(t){var r=Y5.Node.prototype.clone.call(this,t);return r}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};Ep.Transformer=bt;bt.isTransforming=()=>pm>0;function DA(e){return e instanceof Array||At.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){_h.indexOf(t)===-1&&At.Util.warn("Unknown anchor name: "+t+". Available names are: "+_h.join(", "))}),e||[]}bt.prototype.className="Transformer";(0,CA._registerNode)(bt);xt.Factory.addGetterSetter(bt,"enabledAnchors",_h,DA);xt.Factory.addGetterSetter(bt,"flipEnabled",!0,(0,ko.getBooleanValidator)());xt.Factory.addGetterSetter(bt,"resizeEnabled",!0);xt.Factory.addGetterSetter(bt,"anchorSize",10,(0,ko.getNumberValidator)());xt.Factory.addGetterSetter(bt,"rotateEnabled",!0);xt.Factory.addGetterSetter(bt,"rotateLineVisible",!0);xt.Factory.addGetterSetter(bt,"rotationSnaps",[]);xt.Factory.addGetterSetter(bt,"rotateAnchorOffset",50,(0,ko.getNumberValidator)());xt.Factory.addGetterSetter(bt,"rotateAnchorCursor","crosshair");xt.Factory.addGetterSetter(bt,"rotationSnapTolerance",5,(0,ko.getNumberValidator)());xt.Factory.addGetterSetter(bt,"borderEnabled",!0);xt.Factory.addGetterSetter(bt,"anchorStroke","rgb(0, 161, 255)");xt.Factory.addGetterSetter(bt,"anchorStrokeWidth",1,(0,ko.getNumberValidator)());xt.Factory.addGetterSetter(bt,"anchorFill","white");xt.Factory.addGetterSetter(bt,"anchorCornerRadius",0,(0,ko.getNumberValidator)());xt.Factory.addGetterSetter(bt,"borderStroke","rgb(0, 161, 255)");xt.Factory.addGetterSetter(bt,"borderStrokeWidth",1,(0,ko.getNumberValidator)());xt.Factory.addGetterSetter(bt,"borderDash");xt.Factory.addGetterSetter(bt,"keepRatio",!0);xt.Factory.addGetterSetter(bt,"shiftBehavior","default");xt.Factory.addGetterSetter(bt,"centeredScaling",!1);xt.Factory.addGetterSetter(bt,"ignoreStroke",!1);xt.Factory.addGetterSetter(bt,"padding",0,(0,ko.getNumberValidator)());xt.Factory.addGetterSetter(bt,"node");xt.Factory.addGetterSetter(bt,"nodes");xt.Factory.addGetterSetter(bt,"boundBoxFunc");xt.Factory.addGetterSetter(bt,"anchorDragBoundFunc");xt.Factory.addGetterSetter(bt,"anchorStyleFunc");xt.Factory.addGetterSetter(bt,"shouldOverdrawWholeArea",!1);xt.Factory.addGetterSetter(bt,"useSingleNodeRotation",!0);xt.Factory.backCompat(bt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Op={};Object.defineProperty(Op,"__esModule",{value:!0});Op.Wedge=void 0;const Pp=ft,jA=yr,FA=ct,N9=Ge,zA=ct;let Ra=class extends jA.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,FA.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)}};Op.Wedge=Ra;Ra.prototype.className="Wedge";Ra.prototype._centroid=!0;Ra.prototype._attrsAffectingSize=["radius"];(0,zA._registerNode)(Ra);Pp.Factory.addGetterSetter(Ra,"radius",0,(0,N9.getNumberValidator)());Pp.Factory.addGetterSetter(Ra,"angle",0,(0,N9.getNumberValidator)());Pp.Factory.addGetterSetter(Ra,"clockwise",!1);Pp.Factory.backCompat(Ra,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var xp={};Object.defineProperty(xp,"__esModule",{value:!0});xp.Blur=void 0;const J5=ft,BA=qt,UA=Ge;function e4(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var HA=[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],$A=[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 GA(e,t){var r=e.data,n=e.width,i=e.height,a,o,l,u,f,h,O,w,b,E,p,v,g,y,d,m,_,k,x,A,S,P,C,R,N=t+t+1,U=n-1,G=i-1,Z=t+1,W=Z*(Z+1)/2,H=new e4,M=null,L=H,D=null,B=null,q=HA[t],K=$A[t];for(l=1;l<N;l++)L=L.next=new e4,l===Z&&(M=L);for(L.next=H,O=h=0,o=0;o<i;o++){for(m=_=k=x=w=b=E=p=0,v=Z*(A=r[h]),g=Z*(S=r[h+1]),y=Z*(P=r[h+2]),d=Z*(C=r[h+3]),w+=W*A,b+=W*S,E+=W*P,p+=W*C,L=H,l=0;l<Z;l++)L.r=A,L.g=S,L.b=P,L.a=C,L=L.next;for(l=1;l<Z;l++)u=h+((U<l?U:l)<<2),w+=(L.r=A=r[u])*(R=Z-l),b+=(L.g=S=r[u+1])*R,E+=(L.b=P=r[u+2])*R,p+=(L.a=C=r[u+3])*R,m+=A,_+=S,k+=P,x+=C,L=L.next;for(D=H,B=M,a=0;a<n;a++)r[h+3]=C=p*q>>K,C!==0?(C=255/C,r[h]=(w*q>>K)*C,r[h+1]=(b*q>>K)*C,r[h+2]=(E*q>>K)*C):r[h]=r[h+1]=r[h+2]=0,w-=v,b-=g,E-=y,p-=d,v-=D.r,g-=D.g,y-=D.b,d-=D.a,u=O+((u=a+t+1)<U?u:U)<<2,m+=D.r=r[u],_+=D.g=r[u+1],k+=D.b=r[u+2],x+=D.a=r[u+3],w+=m,b+=_,E+=k,p+=x,D=D.next,v+=A=B.r,g+=S=B.g,y+=P=B.b,d+=C=B.a,m-=A,_-=S,k-=P,x-=C,B=B.next,h+=4;O+=n}for(a=0;a<n;a++){for(_=k=x=m=b=E=p=w=0,h=a<<2,v=Z*(A=r[h]),g=Z*(S=r[h+1]),y=Z*(P=r[h+2]),d=Z*(C=r[h+3]),w+=W*A,b+=W*S,E+=W*P,p+=W*C,L=H,l=0;l<Z;l++)L.r=A,L.g=S,L.b=P,L.a=C,L=L.next;for(f=n,l=1;l<=t;l++)h=f+a<<2,w+=(L.r=A=r[h])*(R=Z-l),b+=(L.g=S=r[h+1])*R,E+=(L.b=P=r[h+2])*R,p+=(L.a=C=r[h+3])*R,m+=A,_+=S,k+=P,x+=C,L=L.next,l<G&&(f+=n);for(h=a,D=H,B=M,o=0;o<i;o++)u=h<<2,r[u+3]=C=p*q>>K,C>0?(C=255/C,r[u]=(w*q>>K)*C,r[u+1]=(b*q>>K)*C,r[u+2]=(E*q>>K)*C):r[u]=r[u+1]=r[u+2]=0,w-=v,b-=g,E-=y,p-=d,v-=D.r,g-=D.g,y-=D.b,d-=D.a,u=a+((u=o+Z)<G?u:G)*n<<2,w+=m+=D.r=r[u],b+=_+=D.g=r[u+1],E+=k+=D.b=r[u+2],p+=x+=D.a=r[u+3],D=D.next,v+=A=B.r,g+=S=B.g,y+=P=B.b,d+=C=B.a,m-=A,_-=S,k-=P,x-=C,B=B.next,h+=n}}const VA=function(t){var r=Math.round(this.blurRadius());r>0&&GA(t,r)};xp.Blur=VA;J5.Factory.addGetterSetter(BA.Node,"blurRadius",0,(0,UA.getNumberValidator)(),J5.Factory.afterSetFilter);var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.Brighten=void 0;const t4=ft,qA=qt,WA=Ge,KA=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};Cp.Brighten=KA;t4.Factory.addGetterSetter(qA.Node,"brightness",0,(0,WA.getNumberValidator)(),t4.Factory.afterSetFilter);var kp={};Object.defineProperty(kp,"__esModule",{value:!0});kp.Contrast=void 0;const r4=ft,YA=qt,XA=Ge,ZA=function(e){var t=Math.pow((this.contrast()+100)/100,2),r=e.data,n=r.length,i=150,a=150,o=150,l;for(l=0;l<n;l+=4)i=r[l],a=r[l+1],o=r[l+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,r[l]=i,r[l+1]=a,r[l+2]=o};kp.Contrast=ZA;r4.Factory.addGetterSetter(YA.Node,"contrast",0,(0,XA.getNumberValidator)(),r4.Factory.afterSetFilter);var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0});Tp.Emboss=void 0;const mo=ft,Ap=qt,QA=Qt,I9=Ge,JA=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,h=u*4,O=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:QA.Util.error("Unknown emboss direction: "+n)}do{var w=(O-1)*h,b=a;O+b<1&&(b=0),O+b>f&&(b=0);var E=(O-1+b)*u*4,p=u;do{var v=w+(p-1)*4,g=o;p+g<1&&(g=0),p+g>u&&(g=0);var y=E+(p-1+g)*4,d=l[v]-l[y],m=l[v+1]-l[y+1],_=l[v+2]-l[y+2],k=d,x=k>0?k:-k,A=m>0?m:-m,S=_>0?_:-_;if(A>x&&(k=m),S>x&&(k=_),k*=t,i){var P=l[v]+k,C=l[v+1]+k,R=l[v+2]+k;l[v]=P>255?255:P<0?0:P,l[v+1]=C>255?255:C<0?0:C,l[v+2]=R>255?255:R<0?0:R}else{var N=r-k;N<0?N=0:N>255&&(N=255),l[v]=l[v+1]=l[v+2]=N}}while(--p)}while(--O)};Tp.Emboss=JA;mo.Factory.addGetterSetter(Ap.Node,"embossStrength",.5,(0,I9.getNumberValidator)(),mo.Factory.afterSetFilter);mo.Factory.addGetterSetter(Ap.Node,"embossWhiteLevel",.5,(0,I9.getNumberValidator)(),mo.Factory.afterSetFilter);mo.Factory.addGetterSetter(Ap.Node,"embossDirection","top-left",null,mo.Factory.afterSetFilter);mo.Factory.addGetterSetter(Ap.Node,"embossBlend",!1,null,mo.Factory.afterSetFilter);var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.Enhance=void 0;const n4=ft,eR=qt,tR=Ge;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 rR=function(e){var t=e.data,r=t.length,n=t[0],i=n,a,o=t[1],l=o,u,f=t[2],h=f,O,w,b=this.enhance();if(b!==0){for(w=0;w<r;w+=4)a=t[w+0],a<n?n=a:a>i&&(i=a),u=t[w+1],u<o?o=u:u>l&&(l=u),O=t[w+2],O<f?f=O:O>h&&(h=O);i===n&&(i=255,n=0),l===o&&(l=255,o=0),h===f&&(h=255,f=0);var E,p,v,g,y,d,m,_,k;for(b>0?(p=i+b*(255-i),v=n-b*(n-0),y=l+b*(255-l),d=o-b*(o-0),_=h+b*(255-h),k=f-b*(f-0)):(E=(i+n)*.5,p=i+b*(i-E),v=n+b*(n-E),g=(l+o)*.5,y=l+b*(l-g),d=o+b*(o-g),m=(h+f)*.5,_=h+b*(h-m),k=f+b*(f-m)),w=0;w<r;w+=4)t[w+0]=eg(t[w+0],n,i,v,p),t[w+1]=eg(t[w+1],o,l,d,y),t[w+2]=eg(t[w+2],f,h,k,_)}};Rp.Enhance=rR;n4.Factory.addGetterSetter(eR.Node,"enhance",0,(0,tR.getNumberValidator)(),n4.Factory.afterSetFilter);var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});Mp.Grayscale=void 0;const nR=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};Mp.Grayscale=nR;var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});Lp.HSL=void 0;const Is=ft,Gy=qt,Vy=Ge;Is.Factory.addGetterSetter(Gy.Node,"hue",0,(0,Vy.getNumberValidator)(),Is.Factory.afterSetFilter);Is.Factory.addGetterSetter(Gy.Node,"saturation",0,(0,Vy.getNumberValidator)(),Is.Factory.afterSetFilter);Is.Factory.addGetterSetter(Gy.Node,"luminance",0,(0,Vy.getNumberValidator)(),Is.Factory.afterSetFilter);const iR=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),h=.299*n+.701*u+.167*f,O=.587*n-.587*u+.33*f,w=.114*n-.114*u-.497*f,b=.299*n-.299*u-.328*f,E=.587*n+.413*u+.035*f,p=.114*n-.114*u+.293*f,v=.299*n-.3*u+1.25*f,g=.587*n-.586*u-1.05*f,y=.114*n+.886*u-.2*f,d,m,_,k;for(l=0;l<r;l+=4)d=t[l+0],m=t[l+1],_=t[l+2],k=t[l+3],t[l+0]=h*d+O*m+w*_+o,t[l+1]=b*d+E*m+p*_+o,t[l+2]=v*d+g*m+y*_+o,t[l+3]=k};Lp.HSL=iR;var Np={};Object.defineProperty(Np,"__esModule",{value:!0});Np.HSV=void 0;const Ds=ft,qy=qt,Wy=Ge,aR=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,h=.587*n-.587*l+.33*u,O=.114*n-.114*l-.497*u,w=.299*n-.299*l-.328*u,b=.587*n+.413*l+.035*u,E=.114*n-.114*l+.293*u,p=.299*n-.3*l+1.25*u,v=.587*n-.586*l-1.05*u,g=.114*n+.886*l-.2*u,y,d,m,_;for(o=0;o<r;o+=4)y=t[o+0],d=t[o+1],m=t[o+2],_=t[o+3],t[o+0]=f*y+h*d+O*m,t[o+1]=w*y+b*d+E*m,t[o+2]=p*y+v*d+g*m,t[o+3]=_};Np.HSV=aR;Ds.Factory.addGetterSetter(qy.Node,"hue",0,(0,Wy.getNumberValidator)(),Ds.Factory.afterSetFilter);Ds.Factory.addGetterSetter(qy.Node,"saturation",0,(0,Wy.getNumberValidator)(),Ds.Factory.afterSetFilter);Ds.Factory.addGetterSetter(qy.Node,"value",0,(0,Wy.getNumberValidator)(),Ds.Factory.afterSetFilter);var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.Invert=void 0;const oR=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]};Ip.Invert=oR;var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0});Dp.Kaleidoscope=void 0;const wh=ft,D9=qt,i4=Qt,j9=Ge;var lR=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,h,O,w=0,b=0,E=0,p=0,v,g=Math.sqrt(l*l+u*u);h=a-l,O=o-u,v=Math.sqrt(h*h+O*O),g=v>g?v:g;var y=o,d=a,m,_,k=360/d*Math.PI/180,x,A;for(_=0;_<d;_+=1)for(x=Math.sin(_*k),A=Math.cos(_*k),m=0;m<y;m+=1)h=Math.floor(l+g*m/y*A),O=Math.floor(u+g*m/y*x),f=(O*a+h)*4,w=n[f+0],b=n[f+1],E=n[f+2],p=n[f+3],f=(_+m*a)*4,i[f+0]=w,i[f+1]=b,i[f+2]=E,i[f+3]=p},sR=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,h,O,w,b,E=0,p=0,v=0,g=0,y,d=Math.sqrt(l*l+u*u);h=a-l,O=o-u,y=Math.sqrt(h*h+O*O),d=y>d?y:d;var m=o,_=a,k,x,A=0,S,P;for(h=0;h<a;h+=1)for(O=0;O<o;O+=1)w=h-l,b=O-u,k=Math.sqrt(w*w+b*b)*m/d,x=(Math.atan2(b,w)*180/Math.PI+360+A)%360,x=x*_/360,S=Math.floor(x),P=Math.floor(k),f=(P*a+S)*4,E=n[f+0],p=n[f+1],v=n[f+2],g=n[f+3],f=(O*a+h)*4,i[f+0]=E,i[f+1]=p,i[f+2]=v,i[f+3]=g};const uR=function(e){var t=e.width,r=e.height,n,i,a,o,l,u,f,h,O,w,b=Math.round(this.kaleidoscopePower()),E=Math.round(this.kaleidoscopeAngle()),p=Math.floor(t*(E%360)/360);if(!(b<1)){var v=i4.Util.createCanvasElement();v.width=t,v.height=r;var g=v.getContext("2d").getImageData(0,0,t,r);i4.Util.releaseCanvas(v),lR(e,g,{polarCenterX:t/2,polarCenterY:r/2});for(var y=t/Math.pow(2,b);y<=8;)y=y*2,b-=1;y=Math.ceil(y);var d=y,m=0,_=d,k=1;for(p+y>t&&(m=d,_=0,k=-1),i=0;i<r;i+=1)for(n=m;n!==_;n+=k)a=Math.round(n+p)%t,O=(t*i+a)*4,l=g.data[O+0],u=g.data[O+1],f=g.data[O+2],h=g.data[O+3],w=(t*i+n)*4,g.data[w+0]=l,g.data[w+1]=u,g.data[w+2]=f,g.data[w+3]=h;for(i=0;i<r;i+=1)for(d=Math.floor(y),o=0;o<b;o+=1){for(n=0;n<d+1;n+=1)O=(t*i+n)*4,l=g.data[O+0],u=g.data[O+1],f=g.data[O+2],h=g.data[O+3],w=(t*i+d*2-n-1)*4,g.data[w+0]=l,g.data[w+1]=u,g.data[w+2]=f,g.data[w+3]=h;d*=2}sR(g,e,{polarRotation:0})}};Dp.Kaleidoscope=uR;wh.Factory.addGetterSetter(D9.Node,"kaleidoscopePower",2,(0,j9.getNumberValidator)(),wh.Factory.afterSetFilter);wh.Factory.addGetterSetter(D9.Node,"kaleidoscopeAngle",0,(0,j9.getNumberValidator)(),wh.Factory.afterSetFilter);var jp={};Object.defineProperty(jp,"__esModule",{value:!0});jp.Mask=void 0;const a4=ft,cR=qt,fR=Ge;function bd(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 Du(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 dR(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 hR(e,t){var r=bd(e,0,0),n=bd(e,e.width-1,0),i=bd(e,0,e.height-1),a=bd(e,e.width-1,e.height-1),o=t||10;if(Du(r,n)<o&&Du(n,a)<o&&Du(a,i)<o&&Du(i,r)<o){for(var l=dR([n,r,a,i]),u=[],f=0;f<e.width*e.height;f++){var h=Du(l,[e.data[f*4],e.data[f*4+1],e.data[f*4+2]]);u[f]=h<o?0:255}return u}}function pR(e,t){for(var r=0;r<e.width*e.height;r++)e.data[4*r+3]=t[r]}function gR(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,h=0,O=0;O<i;O++)for(var w=0;w<i;w++){var b=l+O-a,E=u+w-a;if(b>=0&&b<r&&E>=0&&E<t){var p=b*t+E,v=n[O*i+w];h+=e[p]*v}}o[f]=h===255*8?255:0}return o}function vR(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,h=0,O=0;O<i;O++)for(var w=0;w<i;w++){var b=l+O-a,E=u+w-a;if(b>=0&&b<r&&E>=0&&E<t){var p=b*t+E,v=n[O*i+w];h+=e[p]*v}}o[f]=h>=255*4?255:0}return o}function mR(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,h=0,O=0;O<i;O++)for(var w=0;w<i;w++){var b=l+O-a,E=u+w-a;if(b>=0&&b<r&&E>=0&&E<t){var p=b*t+E,v=n[O*i+w];h+=e[p]*v}}o[f]=h}return o}const yR=function(e){var t=this.threshold(),r=hR(e,t);return r&&(r=gR(r,e.width,e.height),r=vR(r,e.width,e.height),r=mR(r,e.width,e.height),pR(e,r)),e};jp.Mask=yR;a4.Factory.addGetterSetter(cR.Node,"threshold",0,(0,fR.getNumberValidator)(),a4.Factory.afterSetFilter);var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0});Fp.Noise=void 0;const o4=ft,bR=qt,_R=Ge,wR=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()};Fp.Noise=wR;o4.Factory.addGetterSetter(bR.Node,"noise",.2,(0,_R.getNumberValidator)(),o4.Factory.afterSetFilter);var zp={};Object.defineProperty(zp,"__esModule",{value:!0});zp.Pixelate=void 0;const l4=ft,SR=Qt,ER=qt,OR=Ge,PR=function(e){var t=Math.ceil(this.pixelSize()),r=e.width,n=e.height,i,a,o,l,u,f,h,O=Math.ceil(r/t),w=Math.ceil(n/t),b,E,p,v,g,y,d,m=e.data;if(t<=0){SR.Util.error("pixelSize value can not be <= 0");return}for(g=0;g<O;g+=1)for(y=0;y<w;y+=1){for(l=0,u=0,f=0,h=0,b=g*t,E=b+t,p=y*t,v=p+t,d=0,i=b;i<E;i+=1)if(!(i>=r))for(a=p;a<v;a+=1)a>=n||(o=(r*a+i)*4,l+=m[o+0],u+=m[o+1],f+=m[o+2],h+=m[o+3],d+=1);for(l=l/d,u=u/d,f=f/d,h=h/d,i=b;i<E;i+=1)if(!(i>=r))for(a=p;a<v;a+=1)a>=n||(o=(r*a+i)*4,m[o+0]=l,m[o+1]=u,m[o+2]=f,m[o+3]=h)}};zp.Pixelate=PR;l4.Factory.addGetterSetter(ER.Node,"pixelSize",8,(0,OR.getNumberValidator)(),l4.Factory.afterSetFilter);var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0});Bp.Posterize=void 0;const s4=ft,xR=qt,CR=Ge,kR=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};Bp.Posterize=kR;s4.Factory.addGetterSetter(xR.Node,"levels",.5,(0,CR.getNumberValidator)(),s4.Factory.afterSetFilter);var Up={};Object.defineProperty(Up,"__esModule",{value:!0});Up.RGB=void 0;const Sh=ft,Ky=qt,TR=Ge,AR=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]};Up.RGB=AR;Sh.Factory.addGetterSetter(Ky.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Sh.Factory.addGetterSetter(Ky.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Sh.Factory.addGetterSetter(Ky.Node,"blue",0,TR.RGBComponent,Sh.Factory.afterSetFilter);var Hp={};Object.defineProperty(Hp,"__esModule",{value:!0});Hp.RGBA=void 0;const Ec=ft,$p=qt,RR=Ge,MR=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};Hp.RGBA=MR;Ec.Factory.addGetterSetter($p.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Ec.Factory.addGetterSetter($p.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Ec.Factory.addGetterSetter($p.Node,"blue",0,RR.RGBComponent,Ec.Factory.afterSetFilter);Ec.Factory.addGetterSetter($p.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0});Gp.Sepia=void 0;const LR=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)};Gp.Sepia=LR;var Vp={};Object.defineProperty(Vp,"__esModule",{value:!0});Vp.Solarize=void 0;const NR=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],h=t[u+1],O=t[u+2];f>127&&(f=255-f),h>127&&(h=255-h),O>127&&(O=255-O),t[u]=f,t[u+1]=h,t[u+2]=O}while(--l)}while(--a)};Vp.Solarize=NR;var qp={};Object.defineProperty(qp,"__esModule",{value:!0});qp.Threshold=void 0;const u4=ft,IR=qt,DR=Ge,jR=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};qp.Threshold=jR;u4.Factory.addGetterSetter(IR.Node,"threshold",.5,(0,DR.getNumberValidator)(),u4.Factory.afterSetFilter);Object.defineProperty(tp,"__esModule",{value:!0});tp.Konva=void 0;const c4=yh,FR=lp,zR=cp,BR=hp,UR=pp,HR=gp,f4=Ns,$R=Vc,GR=Qs,VR=Kc,qR=yp,WR=bp,KR=_p,YR=wp,XR=dl,ZR=Sp,QR=Ep,JR=Op,eM=xp,tM=Cp,rM=kp,nM=Tp,iM=Rp,aM=Mp,oM=Lp,lM=Np,sM=Ip,uM=Dp,cM=jp,fM=Fp,dM=zp,hM=Bp,pM=Up,gM=Hp,vM=Gp,mM=Vp,yM=qp;tp.Konva=c4.Konva.Util._assign(c4.Konva,{Arc:FR.Arc,Arrow:zR.Arrow,Circle:BR.Circle,Ellipse:UR.Ellipse,Image:HR.Image,Label:f4.Label,Tag:f4.Tag,Line:$R.Line,Path:GR.Path,Rect:VR.Rect,RegularPolygon:qR.RegularPolygon,Ring:WR.Ring,Sprite:KR.Sprite,Star:YR.Star,Text:XR.Text,TextPath:ZR.TextPath,Transformer:QR.Transformer,Wedge:JR.Wedge,Filters:{Blur:eM.Blur,Brighten:tM.Brighten,Contrast:rM.Contrast,Emboss:nM.Emboss,Enhance:iM.Enhance,Grayscale:aM.Grayscale,HSL:oM.HSL,HSV:lM.HSV,Invert:sM.Invert,Kaleidoscope:uM.Kaleidoscope,Mask:cM.Mask,Noise:fM.Noise,Pixelate:dM.Pixelate,Posterize:hM.Posterize,RGB:pM.RGB,RGBA:gM.RGBA,Sepia:vM.Sepia,Solarize:mM.Solarize,Threshold:yM.Threshold}});var bM=Ny.exports;Object.defineProperty(bM,"__esModule",{value:!0});const _M=tp;Ny.exports=_M.Konva;var Ei=Ny.exports,gm={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=yh;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=yh;e.exports=n.Konva})(gm,gm.exports);var wM=gm.exports;const Oc=Ch(wM);var F9={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 SM=function(t){var r={},n=et,i=Hu,a=Object.assign;function o(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,T=1;T<arguments.length;T++)c+="&args[]="+encodeURIComponent(arguments[T]);return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),f=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),E=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),_=Symbol.iterator;function k(s){return s===null||typeof s!="object"?null:(s=_&&s[_]||s["@@iterator"],typeof s=="function"?s:null)}function x(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 h:return"Fragment";case f:return"Portal";case w:return"Profiler";case O:return"StrictMode";case v:return"Suspense";case g:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case E:return(s.displayName||"Context")+".Consumer";case b:return(s._context.displayName||"Context")+".Provider";case p:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case y:return c=s.displayName||null,c!==null?c:x(s.type)||"Memo";case d:c=s._payload,s=s._init;try{return x(s(c))}catch{}}return null}function A(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 x(c);case 8:return c===O?"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 S(s){var c=s,T=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,c.flags&4098&&(T=c.return),s=c.return;while(s)}return c.tag===3?T:null}function P(s){if(S(s)!==s)throw Error(o(188))}function C(s){var c=s.alternate;if(!c){if(c=S(s),c===null)throw Error(o(188));return c!==s?null:s}for(var T=s,I=c;;){var j=T.return;if(j===null)break;var V=j.alternate;if(V===null){if(I=j.return,I!==null){T=I;continue}break}if(j.child===V.child){for(V=j.child;V;){if(V===T)return P(j),s;if(V===I)return P(j),c;V=V.sibling}throw Error(o(188))}if(T.return!==I.return)T=j,I=V;else{for(var J=!1,ue=j.child;ue;){if(ue===T){J=!0,T=j,I=V;break}if(ue===I){J=!0,I=j,T=V;break}ue=ue.sibling}if(!J){for(ue=V.child;ue;){if(ue===T){J=!0,T=V,I=j;break}if(ue===I){J=!0,I=V,T=j;break}ue=ue.sibling}if(!J)throw Error(o(189))}}if(T.alternate!==I)throw Error(o(190))}if(T.tag!==3)throw Error(o(188));return T.stateNode.current===T?s:c}function R(s){return s=C(s),s!==null?N(s):null}function N(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=N(s);if(c!==null)return c;s=s.sibling}return null}function U(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){if(s.tag!==4){var c=U(s);if(c!==null)return c}s=s.sibling}return null}var G=Array.isArray,Z=t.getPublicInstance,W=t.getRootHostContext,H=t.getChildHostContext,M=t.prepareForCommit,L=t.resetAfterCommit,D=t.createInstance,B=t.appendInitialChild,q=t.finalizeInitialChildren,K=t.prepareUpdate,z=t.shouldSetTextContent,$=t.createTextInstance,F=t.scheduleTimeout,Y=t.cancelTimeout,X=t.noTimeout,Q=t.isPrimaryRenderer,ee=t.supportsMutation,re=t.supportsPersistence,oe=t.supportsHydration,ae=t.getInstanceFromNode,ie=t.preparePortalMount,Re=t.getCurrentEventPriority,Me=t.detachDeletedInstance,ne=t.supportsMicrotasks,le=t.scheduleMicrotask,be=t.supportsTestSelectors,ye=t.findFiberRoot,te=t.getBoundingRect,de=t.getTextContent,he=t.isHiddenSubtree,Se=t.matchAccessibilityRole,$e=t.setFocusIfFocusable,tt=t.setupIntersectionObserver,Ae=t.appendChild,Ce=t.appendChildToContainer,Oe=t.commitTextUpdate,Fe=t.commitMount,Qe=t.commitUpdate,se=t.insertBefore,fe=t.insertInContainerBefore,Ze=t.removeChild,Je=t.removeChildFromContainer,_e=t.resetTextContent,xe=t.hideInstance,qe=t.hideTextInstance,we=t.unhideInstance,We=t.unhideTextInstance,Ee=t.clearContainer,Ke=t.cloneInstance,rr=t.createContainerChildSet,gt=t.appendChildToContainerChildSet,cr=t.finalizeContainerChildren,Le=t.replaceContainerChildren,Ye=t.cloneHiddenInstance,rt=t.cloneHiddenTextInstance,Pt=t.canHydrateInstance,Ct=t.canHydrateTextInstance,en=t.canHydrateSuspenseInstance,qr=t.isSuspenseInstancePending,_r=t.isSuspenseInstanceFallback,bn=t.getSuspenseInstanceFallbackErrorDetails,Oi=t.registerSuspenseInstanceRetry,_n=t.getNextHydratableSibling,Ne=t.getFirstHydratableChild,nt=t.getFirstHydratableChildWithinContainer,mt=t.getFirstHydratableChildWithinSuspenseInstance,Nt=t.hydrateInstance,yt=t.hydrateTextInstance,kr=t.hydrateSuspenseInstance,wn=t.getNextHydratableInstanceAfterSuspenseInstance,or=t.commitHydratedContainer,Ji=t.commitHydratedSuspenseInstance,Pi=t.clearSuspenseBoundary,ea=t.clearSuspenseBoundaryFromContainer,Na=t.shouldDeleteUnhydratedTailInstances,ou=t.didNotMatchHydratedContainerTextInstance,Mo=t.didNotMatchHydratedTextInstance,ta;function Nn(s){if(ta===void 0)try{throw Error()}catch(T){var c=T.stack.trim().match(/\n( *(at )?)/);ta=c&&c[1]||""}return`
|
|
52
|
+
`+ta+s}var Rl=!1;function Ml(s,c){if(!s||Rl)return"";Rl=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(ke){var I=ke}Reflect.construct(s,[],c)}else{try{c.call()}catch(ke){I=ke}s.call(c.prototype)}else{try{throw Error()}catch(ke){I=ke}s()}}catch(ke){if(ke&&I&&typeof ke.stack=="string"){for(var j=ke.stack.split(`
|
|
53
|
+
`),V=I.stack.split(`
|
|
54
|
+
`),J=j.length-1,ue=V.length-1;1<=J&&0<=ue&&j[J]!==V[ue];)ue--;for(;1<=J&&0<=ue;J--,ue--)if(j[J]!==V[ue]){if(J!==1||ue!==1)do if(J--,ue--,0>ue||j[J]!==V[ue]){var ge=`
|
|
55
|
+
`+j[J].replace(" at new "," at ");return s.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",s.displayName)),ge}while(1<=J&&0<=ue);break}}}finally{Rl=!1,Error.prepareStackTrace=T}return(s=s?s.displayName||s.name:"")?Nn(s):""}var NS=Object.prototype.hasOwnProperty,r0=[],Ll=-1;function Ia(s){return{current:s}}function zt(s){0>Ll||(s.current=r0[Ll],r0[Ll]=null,Ll--)}function It(s,c){Ll++,r0[Ll]=s.current,s.current=c}var Da={},Dr=Ia(Da),tn=Ia(!1),Lo=Da;function Nl(s,c){var T=s.type.contextTypes;if(!T)return Da;var I=s.stateNode;if(I&&I.__reactInternalMemoizedUnmaskedChildContext===c)return I.__reactInternalMemoizedMaskedChildContext;var j={},V;for(V in T)j[V]=c[V];return I&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=j),j}function rn(s){return s=s.childContextTypes,s!=null}function ef(){zt(tn),zt(Dr)}function x2(s,c,T){if(Dr.current!==Da)throw Error(o(168));It(Dr,c),It(tn,T)}function C2(s,c,T){var I=s.stateNode;if(c=c.childContextTypes,typeof I.getChildContext!="function")return T;I=I.getChildContext();for(var j in I)if(!(j in c))throw Error(o(108,A(s)||"Unknown",j));return a({},T,I)}function tf(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Da,Lo=Dr.current,It(Dr,s),It(tn,tn.current),!0}function k2(s,c,T){var I=s.stateNode;if(!I)throw Error(o(169));T?(s=C2(s,c,Lo),I.__reactInternalMemoizedMergedChildContext=s,zt(tn),zt(Dr),It(Dr,s)):zt(tn),It(tn,T)}var ti=Math.clz32?Math.clz32:jS,IS=Math.log,DS=Math.LN2;function jS(s){return s>>>=0,s===0?32:31-(IS(s)/DS|0)|0}var rf=64,nf=4194304;function lu(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 af(s,c){var T=s.pendingLanes;if(T===0)return 0;var I=0,j=s.suspendedLanes,V=s.pingedLanes,J=T&268435455;if(J!==0){var ue=J&~j;ue!==0?I=lu(ue):(V&=J,V!==0&&(I=lu(V)))}else J=T&~j,J!==0?I=lu(J):V!==0&&(I=lu(V));if(I===0)return 0;if(c!==0&&c!==I&&!(c&j)&&(j=I&-I,V=c&-c,j>=V||j===16&&(V&4194240)!==0))return c;if(I&4&&(I|=T&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=I;0<c;)T=31-ti(c),j=1<<T,I|=s[T],c&=~j;return I}function FS(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 zS(s,c){for(var T=s.suspendedLanes,I=s.pingedLanes,j=s.expirationTimes,V=s.pendingLanes;0<V;){var J=31-ti(V),ue=1<<J,ge=j[J];ge===-1?(!(ue&T)||ue&I)&&(j[J]=FS(ue,c)):ge<=c&&(s.expiredLanes|=ue),V&=~ue}}function n0(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function T2(){var s=rf;return rf<<=1,!(rf&4194240)&&(rf=64),s}function i0(s){for(var c=[],T=0;31>T;T++)c.push(s);return c}function su(s,c,T){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-ti(c),s[c]=T}function BS(s,c){var T=s.pendingLanes&~c;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=c,s.mutableReadLanes&=c,s.entangledLanes&=c,c=s.entanglements;var I=s.eventTimes;for(s=s.expirationTimes;0<T;){var j=31-ti(T),V=1<<j;c[j]=0,I[j]=-1,s[j]=-1,T&=~V}}function a0(s,c){var T=s.entangledLanes|=c;for(s=s.entanglements;T;){var I=31-ti(T),j=1<<I;j&c|s[I]&c&&(s[I]|=c),T&=~j}}var wt=0;function A2(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var o0=i.unstable_scheduleCallback,R2=i.unstable_cancelCallback,US=i.unstable_shouldYield,HS=i.unstable_requestPaint,wr=i.unstable_now,l0=i.unstable_ImmediatePriority,$S=i.unstable_UserBlockingPriority,s0=i.unstable_NormalPriority,GS=i.unstable_IdlePriority,of=null,xi=null;function VS(s){if(xi&&typeof xi.onCommitFiberRoot=="function")try{xi.onCommitFiberRoot(of,s,void 0,(s.current.flags&128)===128)}catch{}}function qS(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var ri=typeof Object.is=="function"?Object.is:qS,ra=null,lf=!1,u0=!1;function M2(s){ra===null?ra=[s]:ra.push(s)}function WS(s){lf=!0,M2(s)}function Ci(){if(!u0&&ra!==null){u0=!0;var s=0,c=wt;try{var T=ra;for(wt=1;s<T.length;s++){var I=T[s];do I=I(!0);while(I!==null)}ra=null,lf=!1}catch(j){throw ra!==null&&(ra=ra.slice(s+1)),o0(l0,Ci),j}finally{wt=c,u0=!1}}return null}var Il=[],Dl=0,sf=null,uf=0,In=[],Dn=0,No=null,na=1,ia="";function Io(s,c){Il[Dl++]=uf,Il[Dl++]=sf,sf=s,uf=c}function L2(s,c,T){In[Dn++]=na,In[Dn++]=ia,In[Dn++]=No,No=s;var I=na;s=ia;var j=32-ti(I)-1;I&=~(1<<j),T+=1;var V=32-ti(c)+j;if(30<V){var J=j-j%5;V=(I&(1<<J)-1).toString(32),I>>=J,j-=J,na=1<<32-ti(c)+j|T<<j|I,ia=V+s}else na=1<<V|T<<j|I,ia=s}function c0(s){s.return!==null&&(Io(s,1),L2(s,1,0))}function f0(s){for(;s===sf;)sf=Il[--Dl],Il[Dl]=null,uf=Il[--Dl],Il[Dl]=null;for(;s===No;)No=In[--Dn],In[Dn]=null,ia=In[--Dn],In[Dn]=null,na=In[--Dn],In[Dn]=null}var Sn=null,jn=null,$t=!1,uu=!1,ni=null;function N2(s,c){var T=Hn(5,null,null,0);T.elementType="DELETED",T.stateNode=c,T.return=s,c=s.deletions,c===null?(s.deletions=[T],s.flags|=16):c.push(T)}function I2(s,c){switch(s.tag){case 5:return c=Pt(c,s.type,s.pendingProps),c!==null?(s.stateNode=c,Sn=s,jn=Ne(c),!0):!1;case 6:return c=Ct(c,s.pendingProps),c!==null?(s.stateNode=c,Sn=s,jn=null,!0):!1;case 13:if(c=en(c),c!==null){var T=No!==null?{id:na,overflow:ia}:null;return s.memoizedState={dehydrated:c,treeContext:T,retryLane:1073741824},T=Hn(18,null,null,0),T.stateNode=c,T.return=s,s.child=T,Sn=s,jn=null,!0}return!1;default:return!1}}function d0(s){return(s.mode&1)!==0&&(s.flags&128)===0}function h0(s){if($t){var c=jn;if(c){var T=c;if(!I2(s,c)){if(d0(s))throw Error(o(418));c=_n(T);var I=Sn;c&&I2(s,c)?N2(I,T):(s.flags=s.flags&-4097|2,$t=!1,Sn=s)}}else{if(d0(s))throw Error(o(418));s.flags=s.flags&-4097|2,$t=!1,Sn=s}}}function D2(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;Sn=s}function cf(s){if(!oe||s!==Sn)return!1;if(!$t)return D2(s),$t=!0,!1;if(s.tag!==3&&(s.tag!==5||Na(s.type)&&!z(s.type,s.memoizedProps))){var c=jn;if(c){if(d0(s))throw j2(),Error(o(418));for(;c;)N2(s,c),c=_n(c)}}if(D2(s),s.tag===13){if(!oe)throw Error(o(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));jn=wn(s)}else jn=Sn?_n(s.stateNode):null;return!0}function j2(){for(var s=jn;s;)s=_n(s)}function jl(){oe&&(jn=Sn=null,uu=$t=!1)}function p0(s){ni===null?ni=[s]:ni.push(s)}var KS=l.ReactCurrentBatchConfig;function ff(s,c){if(ri(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var T=Object.keys(s),I=Object.keys(c);if(T.length!==I.length)return!1;for(I=0;I<T.length;I++){var j=T[I];if(!NS.call(c,j)||!ri(s[j],c[j]))return!1}return!0}function YS(s){switch(s.tag){case 5:return Nn(s.type);case 16:return Nn("Lazy");case 13:return Nn("Suspense");case 19:return Nn("SuspenseList");case 0:case 2:case 15:return s=Ml(s.type,!1),s;case 11:return s=Ml(s.type.render,!1),s;case 1:return s=Ml(s.type,!0),s;default:return""}}function cu(s,c,T){if(s=T.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(T._owner){if(T=T._owner,T){if(T.tag!==1)throw Error(o(309));var I=T.stateNode}if(!I)throw Error(o(147,s));var j=I,V=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===V?c.ref:(c=function(J){var ue=j.refs;J===null?delete ue[V]:ue[V]=J},c._stringRef=V,c)}if(typeof s!="string")throw Error(o(284));if(!T._owner)throw Error(o(290,s))}return s}function df(s,c){throw s=Object.prototype.toString.call(c),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function F2(s){var c=s._init;return c(s._payload)}function z2(s){function c(pe,ce){if(s){var ve=pe.deletions;ve===null?(pe.deletions=[ce],pe.flags|=16):ve.push(ce)}}function T(pe,ce){if(!s)return null;for(;ce!==null;)c(pe,ce),ce=ce.sibling;return null}function I(pe,ce){for(pe=new Map;ce!==null;)ce.key!==null?pe.set(ce.key,ce):pe.set(ce.index,ce),ce=ce.sibling;return pe}function j(pe,ce){return pe=$a(pe,ce),pe.index=0,pe.sibling=null,pe}function V(pe,ce,ve){return pe.index=ve,s?(ve=pe.alternate,ve!==null?(ve=ve.index,ve<ce?(pe.flags|=2,ce):ve):(pe.flags|=2,ce)):(pe.flags|=1048576,ce)}function J(pe){return s&&pe.alternate===null&&(pe.flags|=2),pe}function ue(pe,ce,ve,De){return ce===null||ce.tag!==6?(ce=u1(ve,pe.mode,De),ce.return=pe,ce):(ce=j(ce,ve),ce.return=pe,ce)}function ge(pe,ce,ve,De){var Xe=ve.type;return Xe===h?Ue(pe,ce,ve.props.children,De,ve.key):ce!==null&&(ce.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===d&&F2(Xe)===ce.type)?(De=j(ce,ve.props),De.ref=cu(pe,ce,ve),De.return=pe,De):(De=$f(ve.type,ve.key,ve.props,null,pe.mode,De),De.ref=cu(pe,ce,ve),De.return=pe,De)}function ke(pe,ce,ve,De){return ce===null||ce.tag!==4||ce.stateNode.containerInfo!==ve.containerInfo||ce.stateNode.implementation!==ve.implementation?(ce=c1(ve,pe.mode,De),ce.return=pe,ce):(ce=j(ce,ve.children||[]),ce.return=pe,ce)}function Ue(pe,ce,ve,De,Xe){return ce===null||ce.tag!==7?(ce=Ho(ve,pe.mode,De,Xe),ce.return=pe,ce):(ce=j(ce,ve),ce.return=pe,ce)}function at(pe,ce,ve){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return ce=u1(""+ce,pe.mode,ve),ce.return=pe,ce;if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case u:return ve=$f(ce.type,ce.key,ce.props,null,pe.mode,ve),ve.ref=cu(pe,null,ce),ve.return=pe,ve;case f:return ce=c1(ce,pe.mode,ve),ce.return=pe,ce;case d:var De=ce._init;return at(pe,De(ce._payload),ve)}if(G(ce)||k(ce))return ce=Ho(ce,pe.mode,ve,null),ce.return=pe,ce;df(pe,ce)}return null}function Ie(pe,ce,ve,De){var Xe=ce!==null?ce.key:null;if(typeof ve=="string"&&ve!==""||typeof ve=="number")return Xe!==null?null:ue(pe,ce,""+ve,De);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case u:return ve.key===Xe?ge(pe,ce,ve,De):null;case f:return ve.key===Xe?ke(pe,ce,ve,De):null;case d:return Xe=ve._init,Ie(pe,ce,Xe(ve._payload),De)}if(G(ve)||k(ve))return Xe!==null?null:Ue(pe,ce,ve,De,null);df(pe,ve)}return null}function Bt(pe,ce,ve,De,Xe){if(typeof De=="string"&&De!==""||typeof De=="number")return pe=pe.get(ve)||null,ue(ce,pe,""+De,Xe);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case u:return pe=pe.get(De.key===null?ve:De.key)||null,ge(ce,pe,De,Xe);case f:return pe=pe.get(De.key===null?ve:De.key)||null,ke(ce,pe,De,Xe);case d:var ut=De._init;return Bt(pe,ce,ve,ut(De._payload),Xe)}if(G(De)||k(De))return pe=pe.get(ve)||null,Ue(ce,pe,De,Xe,null);df(ce,De)}return null}function Mt(pe,ce,ve,De){for(var Xe=null,ut=null,ot=ce,St=ce=0,Or=null;ot!==null&&St<ve.length;St++){ot.index>St?(Or=ot,ot=null):Or=ot.sibling;var Et=Ie(pe,ot,ve[St],De);if(Et===null){ot===null&&(ot=Or);break}s&&ot&&Et.alternate===null&&c(pe,ot),ce=V(Et,ce,St),ut===null?Xe=Et:ut.sibling=Et,ut=Et,ot=Or}if(St===ve.length)return T(pe,ot),$t&&Io(pe,St),Xe;if(ot===null){for(;St<ve.length;St++)ot=at(pe,ve[St],De),ot!==null&&(ce=V(ot,ce,St),ut===null?Xe=ot:ut.sibling=ot,ut=ot);return $t&&Io(pe,St),Xe}for(ot=I(pe,ot);St<ve.length;St++)Or=Bt(ot,pe,St,ve[St],De),Or!==null&&(s&&Or.alternate!==null&&ot.delete(Or.key===null?St:Or.key),ce=V(Or,ce,St),ut===null?Xe=Or:ut.sibling=Or,ut=Or);return s&&ot.forEach(function(Ga){return c(pe,Ga)}),$t&&Io(pe,St),Xe}function ln(pe,ce,ve,De){var Xe=k(ve);if(typeof Xe!="function")throw Error(o(150));if(ve=Xe.call(ve),ve==null)throw Error(o(151));for(var ut=Xe=null,ot=ce,St=ce=0,Or=null,Et=ve.next();ot!==null&&!Et.done;St++,Et=ve.next()){ot.index>St?(Or=ot,ot=null):Or=ot.sibling;var Ga=Ie(pe,ot,Et.value,De);if(Ga===null){ot===null&&(ot=Or);break}s&&ot&&Ga.alternate===null&&c(pe,ot),ce=V(Ga,ce,St),ut===null?Xe=Ga:ut.sibling=Ga,ut=Ga,ot=Or}if(Et.done)return T(pe,ot),$t&&Io(pe,St),Xe;if(ot===null){for(;!Et.done;St++,Et=ve.next())Et=at(pe,Et.value,De),Et!==null&&(ce=V(Et,ce,St),ut===null?Xe=Et:ut.sibling=Et,ut=Et);return $t&&Io(pe,St),Xe}for(ot=I(pe,ot);!Et.done;St++,Et=ve.next())Et=Bt(ot,pe,St,Et.value,De),Et!==null&&(s&&Et.alternate!==null&&ot.delete(Et.key===null?St:Et.key),ce=V(Et,ce,St),ut===null?Xe=Et:ut.sibling=Et,ut=Et);return s&&ot.forEach(function(PE){return c(pe,PE)}),$t&&Io(pe,St),Xe}function sa(pe,ce,ve,De){if(typeof ve=="object"&&ve!==null&&ve.type===h&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case u:e:{for(var Xe=ve.key,ut=ce;ut!==null;){if(ut.key===Xe){if(Xe=ve.type,Xe===h){if(ut.tag===7){T(pe,ut.sibling),ce=j(ut,ve.props.children),ce.return=pe,pe=ce;break e}}else if(ut.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===d&&F2(Xe)===ut.type){T(pe,ut.sibling),ce=j(ut,ve.props),ce.ref=cu(pe,ut,ve),ce.return=pe,pe=ce;break e}T(pe,ut);break}else c(pe,ut);ut=ut.sibling}ve.type===h?(ce=Ho(ve.props.children,pe.mode,De,ve.key),ce.return=pe,pe=ce):(De=$f(ve.type,ve.key,ve.props,null,pe.mode,De),De.ref=cu(pe,ce,ve),De.return=pe,pe=De)}return J(pe);case f:e:{for(ut=ve.key;ce!==null;){if(ce.key===ut)if(ce.tag===4&&ce.stateNode.containerInfo===ve.containerInfo&&ce.stateNode.implementation===ve.implementation){T(pe,ce.sibling),ce=j(ce,ve.children||[]),ce.return=pe,pe=ce;break e}else{T(pe,ce);break}else c(pe,ce);ce=ce.sibling}ce=c1(ve,pe.mode,De),ce.return=pe,pe=ce}return J(pe);case d:return ut=ve._init,sa(pe,ce,ut(ve._payload),De)}if(G(ve))return Mt(pe,ce,ve,De);if(k(ve))return ln(pe,ce,ve,De);df(pe,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"?(ve=""+ve,ce!==null&&ce.tag===6?(T(pe,ce.sibling),ce=j(ce,ve),ce.return=pe,pe=ce):(T(pe,ce),ce=u1(ve,pe.mode,De),ce.return=pe,pe=ce),J(pe)):T(pe,ce)}return sa}var Fl=z2(!0),B2=z2(!1),hf=Ia(null),pf=null,zl=null,g0=null;function v0(){g0=zl=pf=null}function U2(s,c,T){Q?(It(hf,c._currentValue),c._currentValue=T):(It(hf,c._currentValue2),c._currentValue2=T)}function m0(s){var c=hf.current;zt(hf),Q?s._currentValue=c:s._currentValue2=c}function y0(s,c,T){for(;s!==null;){var I=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,I!==null&&(I.childLanes|=c)):I!==null&&(I.childLanes&c)!==c&&(I.childLanes|=c),s===T)break;s=s.return}}function Bl(s,c){pf=s,g0=zl=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&c&&(nn=!0),s.firstContext=null)}function Fn(s){var c=Q?s._currentValue:s._currentValue2;if(g0!==s)if(s={context:s,memoizedValue:c,next:null},zl===null){if(pf===null)throw Error(o(308));zl=s,pf.dependencies={lanes:0,firstContext:s}}else zl=zl.next=s;return c}var Do=null;function b0(s){Do===null?Do=[s]:Do.push(s)}function H2(s,c,T,I){var j=c.interleaved;return j===null?(T.next=T,b0(c)):(T.next=j.next,j.next=T),c.interleaved=T,ki(s,I)}function ki(s,c){s.lanes|=c;var T=s.alternate;for(T!==null&&(T.lanes|=c),T=s,s=s.return;s!==null;)s.childLanes|=c,T=s.alternate,T!==null&&(T.childLanes|=c),T=s,s=s.return;return T.tag===3?T.stateNode:null}var ja=!1;function _0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $2(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function aa(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function Fa(s,c,T){var I=s.updateQueue;if(I===null)return null;if(I=I.shared,dt&2){var j=I.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),I.pending=c,ki(s,T)}return j=I.interleaved,j===null?(c.next=c,b0(I)):(c.next=j.next,j.next=c),I.interleaved=c,ki(s,T)}function gf(s,c,T){if(c=c.updateQueue,c!==null&&(c=c.shared,(T&4194240)!==0)){var I=c.lanes;I&=s.pendingLanes,T|=I,c.lanes=T,a0(s,T)}}function G2(s,c){var T=s.updateQueue,I=s.alternate;if(I!==null&&(I=I.updateQueue,T===I)){var j=null,V=null;if(T=T.firstBaseUpdate,T!==null){do{var J={eventTime:T.eventTime,lane:T.lane,tag:T.tag,payload:T.payload,callback:T.callback,next:null};V===null?j=V=J:V=V.next=J,T=T.next}while(T!==null);V===null?j=V=c:V=V.next=c}else j=V=c;T={baseState:I.baseState,firstBaseUpdate:j,lastBaseUpdate:V,shared:I.shared,effects:I.effects},s.updateQueue=T;return}s=T.lastBaseUpdate,s===null?T.firstBaseUpdate=c:s.next=c,T.lastBaseUpdate=c}function vf(s,c,T,I){var j=s.updateQueue;ja=!1;var V=j.firstBaseUpdate,J=j.lastBaseUpdate,ue=j.shared.pending;if(ue!==null){j.shared.pending=null;var ge=ue,ke=ge.next;ge.next=null,J===null?V=ke:J.next=ke,J=ge;var Ue=s.alternate;Ue!==null&&(Ue=Ue.updateQueue,ue=Ue.lastBaseUpdate,ue!==J&&(ue===null?Ue.firstBaseUpdate=ke:ue.next=ke,Ue.lastBaseUpdate=ge))}if(V!==null){var at=j.baseState;J=0,Ue=ke=ge=null,ue=V;do{var Ie=ue.lane,Bt=ue.eventTime;if((I&Ie)===Ie){Ue!==null&&(Ue=Ue.next={eventTime:Bt,lane:0,tag:ue.tag,payload:ue.payload,callback:ue.callback,next:null});e:{var Mt=s,ln=ue;switch(Ie=c,Bt=T,ln.tag){case 1:if(Mt=ln.payload,typeof Mt=="function"){at=Mt.call(Bt,at,Ie);break e}at=Mt;break e;case 3:Mt.flags=Mt.flags&-65537|128;case 0:if(Mt=ln.payload,Ie=typeof Mt=="function"?Mt.call(Bt,at,Ie):Mt,Ie==null)break e;at=a({},at,Ie);break e;case 2:ja=!0}}ue.callback!==null&&ue.lane!==0&&(s.flags|=64,Ie=j.effects,Ie===null?j.effects=[ue]:Ie.push(ue))}else Bt={eventTime:Bt,lane:Ie,tag:ue.tag,payload:ue.payload,callback:ue.callback,next:null},Ue===null?(ke=Ue=Bt,ge=at):Ue=Ue.next=Bt,J|=Ie;if(ue=ue.next,ue===null){if(ue=j.shared.pending,ue===null)break;Ie=ue,ue=Ie.next,Ie.next=null,j.lastBaseUpdate=Ie,j.shared.pending=null}}while(!0);if(Ue===null&&(ge=at),j.baseState=ge,j.firstBaseUpdate=ke,j.lastBaseUpdate=Ue,c=j.shared.interleaved,c!==null){j=c;do J|=j.lane,j=j.next;while(j!==c)}else V===null&&(j.shared.lanes=0);Fo|=J,s.lanes=J,s.memoizedState=at}}function V2(s,c,T){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var I=s[c],j=I.callback;if(j!==null){if(I.callback=null,I=T,typeof j!="function")throw Error(o(191,j));j.call(I)}}}var fu={},zn=Ia(fu),du=Ia(fu),Ul=Ia(fu);function Ti(s){if(s===fu)throw Error(o(174));return s}function w0(s,c){It(Ul,c),It(du,s),It(zn,fu),s=W(c),zt(zn),It(zn,s)}function Hl(){zt(zn),zt(du),zt(Ul)}function q2(s){var c=Ti(Ul.current),T=Ti(zn.current);c=H(T,s.type,c),T!==c&&(It(du,s),It(zn,c))}function S0(s){du.current===s&&(zt(zn),zt(du))}var Wt=Ia(0);function mf(s){for(var c=s;c!==null;){if(c.tag===13){var T=c.memoizedState;if(T!==null&&(T=T.dehydrated,T===null||qr(T)||_r(T)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var E0=[];function O0(){for(var s=0;s<E0.length;s++){var c=E0[s];Q?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}E0.length=0}var yf=l.ReactCurrentDispatcher,P0=l.ReactCurrentBatchConfig,jo=0,Kt=null,fr=null,Sr=null,bf=!1,hu=!1,pu=0,XS=0;function jr(){throw Error(o(321))}function x0(s,c){if(c===null)return!1;for(var T=0;T<c.length&&T<s.length;T++)if(!ri(s[T],c[T]))return!1;return!0}function C0(s,c,T,I,j,V){if(jo=V,Kt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,yf.current=s===null||s.memoizedState===null?eE:tE,s=T(I,j),hu){V=0;do{if(hu=!1,pu=0,25<=V)throw Error(o(301));V+=1,Sr=fr=null,c.updateQueue=null,yf.current=rE,s=T(I,j)}while(hu)}if(yf.current=Sf,c=fr!==null&&fr.next!==null,jo=0,Sr=fr=Kt=null,bf=!1,c)throw Error(o(300));return s}function k0(){var s=pu!==0;return pu=0,s}function Ai(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sr===null?Kt.memoizedState=Sr=s:Sr=Sr.next=s,Sr}function Bn(){if(fr===null){var s=Kt.alternate;s=s!==null?s.memoizedState:null}else s=fr.next;var c=Sr===null?Kt.memoizedState:Sr.next;if(c!==null)Sr=c,fr=s;else{if(s===null)throw Error(o(310));fr=s,s={memoizedState:fr.memoizedState,baseState:fr.baseState,baseQueue:fr.baseQueue,queue:fr.queue,next:null},Sr===null?Kt.memoizedState=Sr=s:Sr=Sr.next=s}return Sr}function gu(s,c){return typeof c=="function"?c(s):c}function T0(s){var c=Bn(),T=c.queue;if(T===null)throw Error(o(311));T.lastRenderedReducer=s;var I=fr,j=I.baseQueue,V=T.pending;if(V!==null){if(j!==null){var J=j.next;j.next=V.next,V.next=J}I.baseQueue=j=V,T.pending=null}if(j!==null){V=j.next,I=I.baseState;var ue=J=null,ge=null,ke=V;do{var Ue=ke.lane;if((jo&Ue)===Ue)ge!==null&&(ge=ge.next={lane:0,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null}),I=ke.hasEagerState?ke.eagerState:s(I,ke.action);else{var at={lane:Ue,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null};ge===null?(ue=ge=at,J=I):ge=ge.next=at,Kt.lanes|=Ue,Fo|=Ue}ke=ke.next}while(ke!==null&&ke!==V);ge===null?J=I:ge.next=ue,ri(I,c.memoizedState)||(nn=!0),c.memoizedState=I,c.baseState=J,c.baseQueue=ge,T.lastRenderedState=I}if(s=T.interleaved,s!==null){j=s;do V=j.lane,Kt.lanes|=V,Fo|=V,j=j.next;while(j!==s)}else j===null&&(T.lanes=0);return[c.memoizedState,T.dispatch]}function A0(s){var c=Bn(),T=c.queue;if(T===null)throw Error(o(311));T.lastRenderedReducer=s;var I=T.dispatch,j=T.pending,V=c.memoizedState;if(j!==null){T.pending=null;var J=j=j.next;do V=s(V,J.action),J=J.next;while(J!==j);ri(V,c.memoizedState)||(nn=!0),c.memoizedState=V,c.baseQueue===null&&(c.baseState=V),T.lastRenderedState=V}return[V,I]}function W2(){}function K2(s,c){var T=Kt,I=Bn(),j=c(),V=!ri(I.memoizedState,j);if(V&&(I.memoizedState=j,nn=!0),I=I.queue,R0(Z2.bind(null,T,I,s),[s]),I.getSnapshot!==c||V||Sr!==null&&Sr.memoizedState.tag&1){if(T.flags|=2048,vu(9,X2.bind(null,T,I,j,c),void 0,null),Er===null)throw Error(o(349));jo&30||Y2(T,c,j)}return j}function Y2(s,c,T){s.flags|=16384,s={getSnapshot:c,value:T},c=Kt.updateQueue,c===null?(c={lastEffect:null,stores:null},Kt.updateQueue=c,c.stores=[s]):(T=c.stores,T===null?c.stores=[s]:T.push(s))}function X2(s,c,T,I){c.value=T,c.getSnapshot=I,Q2(c)&&J2(s)}function Z2(s,c,T){return T(function(){Q2(c)&&J2(s)})}function Q2(s){var c=s.getSnapshot;s=s.value;try{var T=c();return!ri(s,T)}catch{return!0}}function J2(s){var c=ki(s,1);c!==null&&Un(c,s,1,-1)}function eb(s){var c=Ai();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gu,lastRenderedState:s},c.queue=s,s=s.dispatch=JS.bind(null,Kt,s),[c.memoizedState,s]}function vu(s,c,T,I){return s={tag:s,create:c,destroy:T,deps:I,next:null},c=Kt.updateQueue,c===null?(c={lastEffect:null,stores:null},Kt.updateQueue=c,c.lastEffect=s.next=s):(T=c.lastEffect,T===null?c.lastEffect=s.next=s:(I=T.next,T.next=s,s.next=I,c.lastEffect=s)),s}function tb(){return Bn().memoizedState}function _f(s,c,T,I){var j=Ai();Kt.flags|=s,j.memoizedState=vu(1|c,T,void 0,I===void 0?null:I)}function wf(s,c,T,I){var j=Bn();I=I===void 0?null:I;var V=void 0;if(fr!==null){var J=fr.memoizedState;if(V=J.destroy,I!==null&&x0(I,J.deps)){j.memoizedState=vu(c,T,V,I);return}}Kt.flags|=s,j.memoizedState=vu(1|c,T,V,I)}function rb(s,c){return _f(8390656,8,s,c)}function R0(s,c){return wf(2048,8,s,c)}function nb(s,c){return wf(4,2,s,c)}function ib(s,c){return wf(4,4,s,c)}function ab(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 ob(s,c,T){return T=T!=null?T.concat([s]):null,wf(4,4,ab.bind(null,c,s),T)}function M0(){}function lb(s,c){var T=Bn();c=c===void 0?null:c;var I=T.memoizedState;return I!==null&&c!==null&&x0(c,I[1])?I[0]:(T.memoizedState=[s,c],s)}function sb(s,c){var T=Bn();c=c===void 0?null:c;var I=T.memoizedState;return I!==null&&c!==null&&x0(c,I[1])?I[0]:(s=s(),T.memoizedState=[s,c],s)}function ub(s,c,T){return jo&21?(ri(T,c)||(T=T2(),Kt.lanes|=T,Fo|=T,s.baseState=!0),c):(s.baseState&&(s.baseState=!1,nn=!0),s.memoizedState=T)}function ZS(s,c){var T=wt;wt=T!==0&&4>T?T:4,s(!0);var I=P0.transition;P0.transition={};try{s(!1),c()}finally{wt=T,P0.transition=I}}function cb(){return Bn().memoizedState}function QS(s,c,T){var I=Ua(s);if(T={lane:I,action:T,hasEagerState:!1,eagerState:null,next:null},fb(s))db(c,T);else if(T=H2(s,c,T,I),T!==null){var j=Br();Un(T,s,I,j),hb(T,c,I)}}function JS(s,c,T){var I=Ua(s),j={lane:I,action:T,hasEagerState:!1,eagerState:null,next:null};if(fb(s))db(c,j);else{var V=s.alternate;if(s.lanes===0&&(V===null||V.lanes===0)&&(V=c.lastRenderedReducer,V!==null))try{var J=c.lastRenderedState,ue=V(J,T);if(j.hasEagerState=!0,j.eagerState=ue,ri(ue,J)){var ge=c.interleaved;ge===null?(j.next=j,b0(c)):(j.next=ge.next,ge.next=j),c.interleaved=j;return}}catch{}finally{}T=H2(s,c,j,I),T!==null&&(j=Br(),Un(T,s,I,j),hb(T,c,I))}}function fb(s){var c=s.alternate;return s===Kt||c!==null&&c===Kt}function db(s,c){hu=bf=!0;var T=s.pending;T===null?c.next=c:(c.next=T.next,T.next=c),s.pending=c}function hb(s,c,T){if(T&4194240){var I=c.lanes;I&=s.pendingLanes,T|=I,c.lanes=T,a0(s,T)}}var Sf={readContext:Fn,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},eE={readContext:Fn,useCallback:function(s,c){return Ai().memoizedState=[s,c===void 0?null:c],s},useContext:Fn,useEffect:rb,useImperativeHandle:function(s,c,T){return T=T!=null?T.concat([s]):null,_f(4194308,4,ab.bind(null,c,s),T)},useLayoutEffect:function(s,c){return _f(4194308,4,s,c)},useInsertionEffect:function(s,c){return _f(4,2,s,c)},useMemo:function(s,c){var T=Ai();return c=c===void 0?null:c,s=s(),T.memoizedState=[s,c],s},useReducer:function(s,c,T){var I=Ai();return c=T!==void 0?T(c):c,I.memoizedState=I.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},I.queue=s,s=s.dispatch=QS.bind(null,Kt,s),[I.memoizedState,s]},useRef:function(s){var c=Ai();return s={current:s},c.memoizedState=s},useState:eb,useDebugValue:M0,useDeferredValue:function(s){return Ai().memoizedState=s},useTransition:function(){var s=eb(!1),c=s[0];return s=ZS.bind(null,s[1]),Ai().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,T){var I=Kt,j=Ai();if($t){if(T===void 0)throw Error(o(407));T=T()}else{if(T=c(),Er===null)throw Error(o(349));jo&30||Y2(I,c,T)}j.memoizedState=T;var V={value:T,getSnapshot:c};return j.queue=V,rb(Z2.bind(null,I,V,s),[s]),I.flags|=2048,vu(9,X2.bind(null,I,V,T,c),void 0,null),T},useId:function(){var s=Ai(),c=Er.identifierPrefix;if($t){var T=ia,I=na;T=(I&~(1<<32-ti(I)-1)).toString(32)+T,c=":"+c+"R"+T,T=pu++,0<T&&(c+="H"+T.toString(32)),c+=":"}else T=XS++,c=":"+c+"r"+T.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},tE={readContext:Fn,useCallback:lb,useContext:Fn,useEffect:R0,useImperativeHandle:ob,useInsertionEffect:nb,useLayoutEffect:ib,useMemo:sb,useReducer:T0,useRef:tb,useState:function(){return T0(gu)},useDebugValue:M0,useDeferredValue:function(s){var c=Bn();return ub(c,fr.memoizedState,s)},useTransition:function(){var s=T0(gu)[0],c=Bn().memoizedState;return[s,c]},useMutableSource:W2,useSyncExternalStore:K2,useId:cb,unstable_isNewReconciler:!1},rE={readContext:Fn,useCallback:lb,useContext:Fn,useEffect:R0,useImperativeHandle:ob,useInsertionEffect:nb,useLayoutEffect:ib,useMemo:sb,useReducer:A0,useRef:tb,useState:function(){return A0(gu)},useDebugValue:M0,useDeferredValue:function(s){var c=Bn();return fr===null?c.memoizedState=s:ub(c,fr.memoizedState,s)},useTransition:function(){var s=A0(gu)[0],c=Bn().memoizedState;return[s,c]},useMutableSource:W2,useSyncExternalStore:K2,useId:cb,unstable_isNewReconciler:!1};function ii(s,c){if(s&&s.defaultProps){c=a({},c),s=s.defaultProps;for(var T in s)c[T]===void 0&&(c[T]=s[T]);return c}return c}function L0(s,c,T,I){c=s.memoizedState,T=T(I,c),T=T==null?c:a({},c,T),s.memoizedState=T,s.lanes===0&&(s.updateQueue.baseState=T)}var Ef={isMounted:function(s){return(s=s._reactInternals)?S(s)===s:!1},enqueueSetState:function(s,c,T){s=s._reactInternals;var I=Br(),j=Ua(s),V=aa(I,j);V.payload=c,T!=null&&(V.callback=T),c=Fa(s,V,j),c!==null&&(Un(c,s,j,I),gf(c,s,j))},enqueueReplaceState:function(s,c,T){s=s._reactInternals;var I=Br(),j=Ua(s),V=aa(I,j);V.tag=1,V.payload=c,T!=null&&(V.callback=T),c=Fa(s,V,j),c!==null&&(Un(c,s,j,I),gf(c,s,j))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var T=Br(),I=Ua(s),j=aa(T,I);j.tag=2,c!=null&&(j.callback=c),c=Fa(s,j,I),c!==null&&(Un(c,s,I,T),gf(c,s,I))}};function pb(s,c,T,I,j,V,J){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(I,V,J):c.prototype&&c.prototype.isPureReactComponent?!ff(T,I)||!ff(j,V):!0}function gb(s,c,T){var I=!1,j=Da,V=c.contextType;return typeof V=="object"&&V!==null?V=Fn(V):(j=rn(c)?Lo:Dr.current,I=c.contextTypes,V=(I=I!=null)?Nl(s,j):Da),c=new c(T,V),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Ef,s.stateNode=c,c._reactInternals=s,I&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=j,s.__reactInternalMemoizedMaskedChildContext=V),c}function vb(s,c,T,I){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(T,I),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(T,I),c.state!==s&&Ef.enqueueReplaceState(c,c.state,null)}function N0(s,c,T,I){var j=s.stateNode;j.props=T,j.state=s.memoizedState,j.refs={},_0(s);var V=c.contextType;typeof V=="object"&&V!==null?j.context=Fn(V):(V=rn(c)?Lo:Dr.current,j.context=Nl(s,V)),j.state=s.memoizedState,V=c.getDerivedStateFromProps,typeof V=="function"&&(L0(s,c,V,T),j.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(c=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),c!==j.state&&Ef.enqueueReplaceState(j,j.state,null),vf(s,T,j,I),j.state=s.memoizedState),typeof j.componentDidMount=="function"&&(s.flags|=4194308)}function $l(s,c){try{var T="",I=c;do T+=YS(I),I=I.return;while(I);var j=T}catch(V){j=`
|
|
56
|
+
Error generating stack: `+V.message+`
|
|
57
|
+
`+V.stack}return{value:s,source:c,stack:j,digest:null}}function I0(s,c,T){return{value:s,source:null,stack:T??null,digest:c??null}}function D0(s,c){try{console.error(c.value)}catch(T){setTimeout(function(){throw T})}}var nE=typeof WeakMap=="function"?WeakMap:Map;function mb(s,c,T){T=aa(-1,T),T.tag=3,T.payload={element:null};var I=c.value;return T.callback=function(){jf||(jf=!0,r1=I),D0(s,c)},T}function yb(s,c,T){T=aa(-1,T),T.tag=3;var I=s.type.getDerivedStateFromError;if(typeof I=="function"){var j=c.value;T.payload=function(){return I(j)},T.callback=function(){D0(s,c)}}var V=s.stateNode;return V!==null&&typeof V.componentDidCatch=="function"&&(T.callback=function(){D0(s,c),typeof I!="function"&&(za===null?za=new Set([this]):za.add(this));var J=c.stack;this.componentDidCatch(c.value,{componentStack:J!==null?J:""})}),T}function bb(s,c,T){var I=s.pingCache;if(I===null){I=s.pingCache=new nE;var j=new Set;I.set(c,j)}else j=I.get(c),j===void 0&&(j=new Set,I.set(c,j));j.has(T)||(j.add(T),s=mE.bind(null,s,c,T),c.then(s,s))}function _b(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 wb(s,c,T,I,j){return s.mode&1?(s.flags|=65536,s.lanes=j,s):(s===c?s.flags|=65536:(s.flags|=128,T.flags|=131072,T.flags&=-52805,T.tag===1&&(T.alternate===null?T.tag=17:(c=aa(-1,1),c.tag=2,Fa(T,c,1))),T.lanes|=1),s)}var iE=l.ReactCurrentOwner,nn=!1;function Wr(s,c,T,I){c.child=s===null?B2(c,null,T,I):Fl(c,s.child,T,I)}function Sb(s,c,T,I,j){T=T.render;var V=c.ref;return Bl(c,j),I=C0(s,c,T,I,V,j),T=k0(),s!==null&&!nn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~j,oa(s,c,j)):($t&&T&&c0(c),c.flags|=1,Wr(s,c,I,j),c.child)}function Eb(s,c,T,I,j){if(s===null){var V=T.type;return typeof V=="function"&&!s1(V)&&V.defaultProps===void 0&&T.compare===null&&T.defaultProps===void 0?(c.tag=15,c.type=V,Ob(s,c,V,I,j)):(s=$f(T.type,null,I,c,c.mode,j),s.ref=c.ref,s.return=c,c.child=s)}if(V=s.child,!(s.lanes&j)){var J=V.memoizedProps;if(T=T.compare,T=T!==null?T:ff,T(J,I)&&s.ref===c.ref)return oa(s,c,j)}return c.flags|=1,s=$a(V,I),s.ref=c.ref,s.return=c,c.child=s}function Ob(s,c,T,I,j){if(s!==null){var V=s.memoizedProps;if(ff(V,I)&&s.ref===c.ref)if(nn=!1,c.pendingProps=I=V,(s.lanes&j)!==0)s.flags&131072&&(nn=!0);else return c.lanes=s.lanes,oa(s,c,j)}return j0(s,c,T,I,j)}function Pb(s,c,T){var I=c.pendingProps,j=I.children,V=s!==null?s.memoizedState:null;if(I.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},It(Vl,En),En|=T;else{if(!(T&1073741824))return s=V!==null?V.baseLanes|T:T,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,It(Vl,En),En|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},I=V!==null?V.baseLanes:T,It(Vl,En),En|=I}else V!==null?(I=V.baseLanes|T,c.memoizedState=null):I=T,It(Vl,En),En|=I;return Wr(s,c,j,T),c.child}function xb(s,c){var T=c.ref;(s===null&&T!==null||s!==null&&s.ref!==T)&&(c.flags|=512,c.flags|=2097152)}function j0(s,c,T,I,j){var V=rn(T)?Lo:Dr.current;return V=Nl(c,V),Bl(c,j),T=C0(s,c,T,I,V,j),I=k0(),s!==null&&!nn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~j,oa(s,c,j)):($t&&I&&c0(c),c.flags|=1,Wr(s,c,T,j),c.child)}function Cb(s,c,T,I,j){if(rn(T)){var V=!0;tf(c)}else V=!1;if(Bl(c,j),c.stateNode===null)Pf(s,c),gb(c,T,I),N0(c,T,I,j),I=!0;else if(s===null){var J=c.stateNode,ue=c.memoizedProps;J.props=ue;var ge=J.context,ke=T.contextType;typeof ke=="object"&&ke!==null?ke=Fn(ke):(ke=rn(T)?Lo:Dr.current,ke=Nl(c,ke));var Ue=T.getDerivedStateFromProps,at=typeof Ue=="function"||typeof J.getSnapshotBeforeUpdate=="function";at||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(ue!==I||ge!==ke)&&vb(c,J,I,ke),ja=!1;var Ie=c.memoizedState;J.state=Ie,vf(c,I,J,j),ge=c.memoizedState,ue!==I||Ie!==ge||tn.current||ja?(typeof Ue=="function"&&(L0(c,T,Ue,I),ge=c.memoizedState),(ue=ja||pb(c,T,ue,I,Ie,ge,ke))?(at||typeof J.UNSAFE_componentWillMount!="function"&&typeof J.componentWillMount!="function"||(typeof J.componentWillMount=="function"&&J.componentWillMount(),typeof J.UNSAFE_componentWillMount=="function"&&J.UNSAFE_componentWillMount()),typeof J.componentDidMount=="function"&&(c.flags|=4194308)):(typeof J.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=I,c.memoizedState=ge),J.props=I,J.state=ge,J.context=ke,I=ue):(typeof J.componentDidMount=="function"&&(c.flags|=4194308),I=!1)}else{J=c.stateNode,$2(s,c),ue=c.memoizedProps,ke=c.type===c.elementType?ue:ii(c.type,ue),J.props=ke,at=c.pendingProps,Ie=J.context,ge=T.contextType,typeof ge=="object"&&ge!==null?ge=Fn(ge):(ge=rn(T)?Lo:Dr.current,ge=Nl(c,ge));var Bt=T.getDerivedStateFromProps;(Ue=typeof Bt=="function"||typeof J.getSnapshotBeforeUpdate=="function")||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(ue!==at||Ie!==ge)&&vb(c,J,I,ge),ja=!1,Ie=c.memoizedState,J.state=Ie,vf(c,I,J,j);var Mt=c.memoizedState;ue!==at||Ie!==Mt||tn.current||ja?(typeof Bt=="function"&&(L0(c,T,Bt,I),Mt=c.memoizedState),(ke=ja||pb(c,T,ke,I,Ie,Mt,ge)||!1)?(Ue||typeof J.UNSAFE_componentWillUpdate!="function"&&typeof J.componentWillUpdate!="function"||(typeof J.componentWillUpdate=="function"&&J.componentWillUpdate(I,Mt,ge),typeof J.UNSAFE_componentWillUpdate=="function"&&J.UNSAFE_componentWillUpdate(I,Mt,ge)),typeof J.componentDidUpdate=="function"&&(c.flags|=4),typeof J.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof J.componentDidUpdate!="function"||ue===s.memoizedProps&&Ie===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||ue===s.memoizedProps&&Ie===s.memoizedState||(c.flags|=1024),c.memoizedProps=I,c.memoizedState=Mt),J.props=I,J.state=Mt,J.context=ge,I=ke):(typeof J.componentDidUpdate!="function"||ue===s.memoizedProps&&Ie===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||ue===s.memoizedProps&&Ie===s.memoizedState||(c.flags|=1024),I=!1)}return F0(s,c,T,I,V,j)}function F0(s,c,T,I,j,V){xb(s,c);var J=(c.flags&128)!==0;if(!I&&!J)return j&&k2(c,T,!1),oa(s,c,V);I=c.stateNode,iE.current=c;var ue=J&&typeof T.getDerivedStateFromError!="function"?null:I.render();return c.flags|=1,s!==null&&J?(c.child=Fl(c,s.child,null,V),c.child=Fl(c,null,ue,V)):Wr(s,c,ue,V),c.memoizedState=I.state,j&&k2(c,T,!0),c.child}function kb(s){var c=s.stateNode;c.pendingContext?x2(s,c.pendingContext,c.pendingContext!==c.context):c.context&&x2(s,c.context,!1),w0(s,c.containerInfo)}function Tb(s,c,T,I,j){return jl(),p0(j),c.flags|=256,Wr(s,c,T,I),c.child}var z0={dehydrated:null,treeContext:null,retryLane:0};function B0(s){return{baseLanes:s,cachePool:null,transitions:null}}function Ab(s,c,T){var I=c.pendingProps,j=Wt.current,V=!1,J=(c.flags&128)!==0,ue;if((ue=J)||(ue=s!==null&&s.memoizedState===null?!1:(j&2)!==0),ue?(V=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(j|=1),It(Wt,j&1),s===null)return h0(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(c.mode&1?_r(s)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(J=I.children,s=I.fallback,V?(I=c.mode,V=c.child,J={mode:"hidden",children:J},!(I&1)&&V!==null?(V.childLanes=0,V.pendingProps=J):V=Gf(J,I,0,null),s=Ho(s,I,T,null),V.return=c,s.return=c,V.sibling=s,c.child=V,c.child.memoizedState=B0(T),c.memoizedState=z0,s):U0(c,J));if(j=s.memoizedState,j!==null&&(ue=j.dehydrated,ue!==null))return aE(s,c,J,I,ue,j,T);if(V){V=I.fallback,J=c.mode,j=s.child,ue=j.sibling;var ge={mode:"hidden",children:I.children};return!(J&1)&&c.child!==j?(I=c.child,I.childLanes=0,I.pendingProps=ge,c.deletions=null):(I=$a(j,ge),I.subtreeFlags=j.subtreeFlags&14680064),ue!==null?V=$a(ue,V):(V=Ho(V,J,T,null),V.flags|=2),V.return=c,I.return=c,I.sibling=V,c.child=I,I=V,V=c.child,J=s.child.memoizedState,J=J===null?B0(T):{baseLanes:J.baseLanes|T,cachePool:null,transitions:J.transitions},V.memoizedState=J,V.childLanes=s.childLanes&~T,c.memoizedState=z0,I}return V=s.child,s=V.sibling,I=$a(V,{mode:"visible",children:I.children}),!(c.mode&1)&&(I.lanes=T),I.return=c,I.sibling=null,s!==null&&(T=c.deletions,T===null?(c.deletions=[s],c.flags|=16):T.push(s)),c.child=I,c.memoizedState=null,I}function U0(s,c){return c=Gf({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function Of(s,c,T,I){return I!==null&&p0(I),Fl(c,s.child,null,T),s=U0(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function aE(s,c,T,I,j,V,J){if(T)return c.flags&256?(c.flags&=-257,I=I0(Error(o(422))),Of(s,c,J,I)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(V=I.fallback,j=c.mode,I=Gf({mode:"visible",children:I.children},j,0,null),V=Ho(V,j,J,null),V.flags|=2,I.return=c,V.return=c,I.sibling=V,c.child=I,c.mode&1&&Fl(c,s.child,null,J),c.child.memoizedState=B0(J),c.memoizedState=z0,V);if(!(c.mode&1))return Of(s,c,J,null);if(_r(j))return I=bn(j).digest,V=Error(o(419)),I=I0(V,I,void 0),Of(s,c,J,I);if(T=(J&s.childLanes)!==0,nn||T){if(I=Er,I!==null){switch(J&-J){case 4:j=2;break;case 16:j=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:j=32;break;case 536870912:j=268435456;break;default:j=0}j=j&(I.suspendedLanes|J)?0:j,j!==0&&j!==V.retryLane&&(V.retryLane=j,ki(s,j),Un(I,s,j,-1))}return l1(),I=I0(Error(o(421))),Of(s,c,J,I)}return qr(j)?(c.flags|=128,c.child=s.child,c=yE.bind(null,s),Oi(j,c),null):(s=V.treeContext,oe&&(jn=mt(j),Sn=c,$t=!0,ni=null,uu=!1,s!==null&&(In[Dn++]=na,In[Dn++]=ia,In[Dn++]=No,na=s.id,ia=s.overflow,No=c)),c=U0(c,I.children),c.flags|=4096,c)}function Rb(s,c,T){s.lanes|=c;var I=s.alternate;I!==null&&(I.lanes|=c),y0(s.return,c,T)}function H0(s,c,T,I,j){var V=s.memoizedState;V===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:I,tail:T,tailMode:j}:(V.isBackwards=c,V.rendering=null,V.renderingStartTime=0,V.last=I,V.tail=T,V.tailMode=j)}function Mb(s,c,T){var I=c.pendingProps,j=I.revealOrder,V=I.tail;if(Wr(s,c,I.children,T),I=Wt.current,I&2)I=I&1|2,c.flags|=128;else{if(s!==null&&s.flags&128)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Rb(s,T,c);else if(s.tag===19)Rb(s,T,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}I&=1}if(It(Wt,I),!(c.mode&1))c.memoizedState=null;else switch(j){case"forwards":for(T=c.child,j=null;T!==null;)s=T.alternate,s!==null&&mf(s)===null&&(j=T),T=T.sibling;T=j,T===null?(j=c.child,c.child=null):(j=T.sibling,T.sibling=null),H0(c,!1,j,T,V);break;case"backwards":for(T=null,j=c.child,c.child=null;j!==null;){if(s=j.alternate,s!==null&&mf(s)===null){c.child=j;break}s=j.sibling,j.sibling=T,T=j,j=s}H0(c,!0,T,null,V);break;case"together":H0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Pf(s,c){!(c.mode&1)&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function oa(s,c,T){if(s!==null&&(c.dependencies=s.dependencies),Fo|=c.lanes,!(T&c.childLanes))return null;if(s!==null&&c.child!==s.child)throw Error(o(153));if(c.child!==null){for(s=c.child,T=$a(s,s.pendingProps),c.child=T,T.return=c;s.sibling!==null;)s=s.sibling,T=T.sibling=$a(s,s.pendingProps),T.return=c;T.sibling=null}return c.child}function oE(s,c,T){switch(c.tag){case 3:kb(c),jl();break;case 5:q2(c);break;case 1:rn(c.type)&&tf(c);break;case 4:w0(c,c.stateNode.containerInfo);break;case 10:U2(c,c.type._context,c.memoizedProps.value);break;case 13:var I=c.memoizedState;if(I!==null)return I.dehydrated!==null?(It(Wt,Wt.current&1),c.flags|=128,null):T&c.child.childLanes?Ab(s,c,T):(It(Wt,Wt.current&1),s=oa(s,c,T),s!==null?s.sibling:null);It(Wt,Wt.current&1);break;case 19:if(I=(T&c.childLanes)!==0,s.flags&128){if(I)return Mb(s,c,T);c.flags|=128}var j=c.memoizedState;if(j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),It(Wt,Wt.current),I)break;return null;case 22:case 23:return c.lanes=0,Pb(s,c,T)}return oa(s,c,T)}function Ri(s){s.flags|=4}function Lb(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 mu,yu,xf,Cf;if(ee)mu=function(s,c){for(var T=c.child;T!==null;){if(T.tag===5||T.tag===6)B(s,T.stateNode);else if(T.tag!==4&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===c)break;for(;T.sibling===null;){if(T.return===null||T.return===c)return;T=T.return}T.sibling.return=T.return,T=T.sibling}},yu=function(){},xf=function(s,c,T,I,j){if(s=s.memoizedProps,s!==I){var V=c.stateNode,J=Ti(zn.current);T=K(V,T,s,I,j,J),(c.updateQueue=T)&&Ri(c)}},Cf=function(s,c,T,I){T!==I&&Ri(c)};else if(re){mu=function(s,c,T,I){for(var j=c.child;j!==null;){if(j.tag===5){var V=j.stateNode;T&&I&&(V=Ye(V,j.type,j.memoizedProps,j)),B(s,V)}else if(j.tag===6)V=j.stateNode,T&&I&&(V=rt(V,j.memoizedProps,j)),B(s,V);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)V=j.child,V!==null&&(V.return=j),mu(s,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}};var Nb=function(s,c,T,I){for(var j=c.child;j!==null;){if(j.tag===5){var V=j.stateNode;T&&I&&(V=Ye(V,j.type,j.memoizedProps,j)),gt(s,V)}else if(j.tag===6)V=j.stateNode,T&&I&&(V=rt(V,j.memoizedProps,j)),gt(s,V);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)V=j.child,V!==null&&(V.return=j),Nb(s,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}};yu=function(s,c){var T=c.stateNode;if(!Lb(s,c)){s=T.containerInfo;var I=rr(s);Nb(I,c,!1,!1),T.pendingChildren=I,Ri(c),cr(s,I)}},xf=function(s,c,T,I,j){var V=s.stateNode,J=s.memoizedProps;if((s=Lb(s,c))&&J===I)c.stateNode=V;else{var ue=c.stateNode,ge=Ti(zn.current),ke=null;J!==I&&(ke=K(ue,T,J,I,j,ge)),s&&ke===null?c.stateNode=V:(V=Ke(V,ke,T,J,I,c,s,ue),q(V,T,I,j,ge)&&Ri(c),c.stateNode=V,s?Ri(c):mu(V,c,!1,!1))}},Cf=function(s,c,T,I){T!==I?(s=Ti(Ul.current),T=Ti(zn.current),c.stateNode=$(I,s,T,c),Ri(c)):c.stateNode=s.stateNode}}else yu=function(){},xf=function(){},Cf=function(){};function bu(s,c){if(!$t)switch(s.tailMode){case"hidden":c=s.tail;for(var T=null;c!==null;)c.alternate!==null&&(T=c),c=c.sibling;T===null?s.tail=null:T.sibling=null;break;case"collapsed":T=s.tail;for(var I=null;T!==null;)T.alternate!==null&&(I=T),T=T.sibling;I===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:I.sibling=null}}function Fr(s){var c=s.alternate!==null&&s.alternate.child===s.child,T=0,I=0;if(c)for(var j=s.child;j!==null;)T|=j.lanes|j.childLanes,I|=j.subtreeFlags&14680064,I|=j.flags&14680064,j.return=s,j=j.sibling;else for(j=s.child;j!==null;)T|=j.lanes|j.childLanes,I|=j.subtreeFlags,I|=j.flags,j.return=s,j=j.sibling;return s.subtreeFlags|=I,s.childLanes=T,c}function lE(s,c,T){var I=c.pendingProps;switch(f0(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)&&ef(),Fr(c),null;case 3:return T=c.stateNode,Hl(),zt(tn),zt(Dr),O0(),T.pendingContext&&(T.context=T.pendingContext,T.pendingContext=null),(s===null||s.child===null)&&(cf(c)?Ri(c):s===null||s.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,ni!==null&&(a1(ni),ni=null))),yu(s,c),Fr(c),null;case 5:S0(c),T=Ti(Ul.current);var j=c.type;if(s!==null&&c.stateNode!=null)xf(s,c,j,I,T),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!I){if(c.stateNode===null)throw Error(o(166));return Fr(c),null}if(s=Ti(zn.current),cf(c)){if(!oe)throw Error(o(175));s=Nt(c.stateNode,c.type,c.memoizedProps,T,s,c,!uu),c.updateQueue=s,s!==null&&Ri(c)}else{var V=D(j,I,T,s,c);mu(V,c,!1,!1),c.stateNode=V,q(V,j,I,T,s)&&Ri(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Fr(c),null;case 6:if(s&&c.stateNode!=null)Cf(s,c,s.memoizedProps,I);else{if(typeof I!="string"&&c.stateNode===null)throw Error(o(166));if(s=Ti(Ul.current),T=Ti(zn.current),cf(c)){if(!oe)throw Error(o(176));if(s=c.stateNode,T=c.memoizedProps,(I=yt(s,T,c,!uu))&&(j=Sn,j!==null))switch(j.tag){case 3:ou(j.stateNode.containerInfo,s,T,(j.mode&1)!==0);break;case 5:Mo(j.type,j.memoizedProps,j.stateNode,s,T,(j.mode&1)!==0)}I&&Ri(c)}else c.stateNode=$(I,s,T,c)}return Fr(c),null;case 13:if(zt(Wt),I=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if($t&&jn!==null&&c.mode&1&&!(c.flags&128))j2(),jl(),c.flags|=98560,j=!1;else if(j=cf(c),I!==null&&I.dehydrated!==null){if(s===null){if(!j)throw Error(o(318));if(!oe)throw Error(o(344));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(o(317));kr(j,c)}else jl(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Fr(c),j=!1}else ni!==null&&(a1(ni),ni=null),j=!0;if(!j)return c.flags&65536?c:null}return c.flags&128?(c.lanes=T,c):(T=I!==null,T!==(s!==null&&s.memoizedState!==null)&&T&&(c.child.flags|=8192,c.mode&1&&(s===null||Wt.current&1?dr===0&&(dr=3):l1())),c.updateQueue!==null&&(c.flags|=4),Fr(c),null);case 4:return Hl(),yu(s,c),s===null&&ie(c.stateNode.containerInfo),Fr(c),null;case 10:return m0(c.type._context),Fr(c),null;case 17:return rn(c.type)&&ef(),Fr(c),null;case 19:if(zt(Wt),j=c.memoizedState,j===null)return Fr(c),null;if(I=(c.flags&128)!==0,V=j.rendering,V===null)if(I)bu(j,!1);else{if(dr!==0||s!==null&&s.flags&128)for(s=c.child;s!==null;){if(V=mf(s),V!==null){for(c.flags|=128,bu(j,!1),s=V.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),c.subtreeFlags=0,s=T,T=c.child;T!==null;)I=T,j=s,I.flags&=14680066,V=I.alternate,V===null?(I.childLanes=0,I.lanes=j,I.child=null,I.subtreeFlags=0,I.memoizedProps=null,I.memoizedState=null,I.updateQueue=null,I.dependencies=null,I.stateNode=null):(I.childLanes=V.childLanes,I.lanes=V.lanes,I.child=V.child,I.subtreeFlags=0,I.deletions=null,I.memoizedProps=V.memoizedProps,I.memoizedState=V.memoizedState,I.updateQueue=V.updateQueue,I.type=V.type,j=V.dependencies,I.dependencies=j===null?null:{lanes:j.lanes,firstContext:j.firstContext}),T=T.sibling;return It(Wt,Wt.current&1|2),c.child}s=s.sibling}j.tail!==null&&wr()>t1&&(c.flags|=128,I=!0,bu(j,!1),c.lanes=4194304)}else{if(!I)if(s=mf(V),s!==null){if(c.flags|=128,I=!0,s=s.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),bu(j,!0),j.tail===null&&j.tailMode==="hidden"&&!V.alternate&&!$t)return Fr(c),null}else 2*wr()-j.renderingStartTime>t1&&T!==1073741824&&(c.flags|=128,I=!0,bu(j,!1),c.lanes=4194304);j.isBackwards?(V.sibling=c.child,c.child=V):(s=j.last,s!==null?s.sibling=V:c.child=V,j.last=V)}return j.tail!==null?(c=j.tail,j.rendering=c,j.tail=c.sibling,j.renderingStartTime=wr(),c.sibling=null,s=Wt.current,It(Wt,I?s&1|2:s&1),c):(Fr(c),null);case 22:case 23:return o1(),T=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==T&&(c.flags|=8192),T&&c.mode&1?En&1073741824&&(Fr(c),ee&&c.subtreeFlags&6&&(c.flags|=8192)):Fr(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}function sE(s,c){switch(f0(c),c.tag){case 1:return rn(c.type)&&ef(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Hl(),zt(tn),zt(Dr),O0(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return S0(c),null;case 13:if(zt(Wt),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(o(340));jl()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return zt(Wt),null;case 4:return Hl(),null;case 10:return m0(c.type._context),null;case 22:case 23:return o1(),null;case 24:return null;default:return null}}var kf=!1,zr=!1,uE=typeof WeakSet=="function"?WeakSet:Set,ze=null;function Gl(s,c){var T=s.ref;if(T!==null)if(typeof T=="function")try{T(null)}catch(I){Gt(s,c,I)}else T.current=null}function $0(s,c,T){try{T()}catch(I){Gt(s,c,I)}}var Ib=!1;function cE(s,c){for(M(s.containerInfo),ze=c;ze!==null;)if(s=ze,c=s.child,(s.subtreeFlags&1028)!==0&&c!==null)c.return=s,ze=c;else for(;ze!==null;){s=ze;try{var T=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(T!==null){var I=T.memoizedProps,j=T.memoizedState,V=s.stateNode,J=V.getSnapshotBeforeUpdate(s.elementType===s.type?I:ii(s.type,I),j);V.__reactInternalSnapshotBeforeUpdate=J}break;case 3:ee&&Ee(s.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(ue){Gt(s,s.return,ue)}if(c=s.sibling,c!==null){c.return=s.return,ze=c;break}ze=s.return}return T=Ib,Ib=!1,T}function _u(s,c,T){var I=c.updateQueue;if(I=I!==null?I.lastEffect:null,I!==null){var j=I=I.next;do{if((j.tag&s)===s){var V=j.destroy;j.destroy=void 0,V!==void 0&&$0(c,T,V)}j=j.next}while(j!==I)}}function Tf(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var T=c=c.next;do{if((T.tag&s)===s){var I=T.create;T.destroy=I()}T=T.next}while(T!==c)}}function G0(s){var c=s.ref;if(c!==null){var T=s.stateNode;switch(s.tag){case 5:s=Z(T);break;default:s=T}typeof c=="function"?c(s):c.current=s}}function Db(s){var c=s.alternate;c!==null&&(s.alternate=null,Db(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&Me(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 jb(s){return s.tag===5||s.tag===3||s.tag===4}function Fb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||jb(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 V0(s,c,T){var I=s.tag;if(I===5||I===6)s=s.stateNode,c?fe(T,s,c):Ce(T,s);else if(I!==4&&(s=s.child,s!==null))for(V0(s,c,T),s=s.sibling;s!==null;)V0(s,c,T),s=s.sibling}function q0(s,c,T){var I=s.tag;if(I===5||I===6)s=s.stateNode,c?se(T,s,c):Ae(T,s);else if(I!==4&&(s=s.child,s!==null))for(q0(s,c,T),s=s.sibling;s!==null;)q0(s,c,T),s=s.sibling}var Tr=null,ai=!1;function Mi(s,c,T){for(T=T.child;T!==null;)W0(s,c,T),T=T.sibling}function W0(s,c,T){if(xi&&typeof xi.onCommitFiberUnmount=="function")try{xi.onCommitFiberUnmount(of,T)}catch{}switch(T.tag){case 5:zr||Gl(T,c);case 6:if(ee){var I=Tr,j=ai;Tr=null,Mi(s,c,T),Tr=I,ai=j,Tr!==null&&(ai?Je(Tr,T.stateNode):Ze(Tr,T.stateNode))}else Mi(s,c,T);break;case 18:ee&&Tr!==null&&(ai?ea(Tr,T.stateNode):Pi(Tr,T.stateNode));break;case 4:ee?(I=Tr,j=ai,Tr=T.stateNode.containerInfo,ai=!0,Mi(s,c,T),Tr=I,ai=j):(re&&(I=T.stateNode.containerInfo,j=rr(I),Le(I,j)),Mi(s,c,T));break;case 0:case 11:case 14:case 15:if(!zr&&(I=T.updateQueue,I!==null&&(I=I.lastEffect,I!==null))){j=I=I.next;do{var V=j,J=V.destroy;V=V.tag,J!==void 0&&(V&2||V&4)&&$0(T,c,J),j=j.next}while(j!==I)}Mi(s,c,T);break;case 1:if(!zr&&(Gl(T,c),I=T.stateNode,typeof I.componentWillUnmount=="function"))try{I.props=T.memoizedProps,I.state=T.memoizedState,I.componentWillUnmount()}catch(ue){Gt(T,c,ue)}Mi(s,c,T);break;case 21:Mi(s,c,T);break;case 22:T.mode&1?(zr=(I=zr)||T.memoizedState!==null,Mi(s,c,T),zr=I):Mi(s,c,T);break;default:Mi(s,c,T)}}function zb(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var T=s.stateNode;T===null&&(T=s.stateNode=new uE),c.forEach(function(I){var j=bE.bind(null,s,I);T.has(I)||(T.add(I),I.then(j,j))})}}function oi(s,c){var T=c.deletions;if(T!==null)for(var I=0;I<T.length;I++){var j=T[I];try{var V=s,J=c;if(ee){var ue=J;e:for(;ue!==null;){switch(ue.tag){case 5:Tr=ue.stateNode,ai=!1;break e;case 3:Tr=ue.stateNode.containerInfo,ai=!0;break e;case 4:Tr=ue.stateNode.containerInfo,ai=!0;break e}ue=ue.return}if(Tr===null)throw Error(o(160));W0(V,J,j),Tr=null,ai=!1}else W0(V,J,j);var ge=j.alternate;ge!==null&&(ge.return=null),j.return=null}catch(ke){Gt(j,c,ke)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Bb(c,s),c=c.sibling}function Bb(s,c){var T=s.alternate,I=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(oi(c,s),Li(s),I&4){try{_u(3,s,s.return),Tf(3,s)}catch(Ie){Gt(s,s.return,Ie)}try{_u(5,s,s.return)}catch(Ie){Gt(s,s.return,Ie)}}break;case 1:oi(c,s),Li(s),I&512&&T!==null&&Gl(T,T.return);break;case 5:if(oi(c,s),Li(s),I&512&&T!==null&&Gl(T,T.return),ee){if(s.flags&32){var j=s.stateNode;try{_e(j)}catch(Ie){Gt(s,s.return,Ie)}}if(I&4&&(j=s.stateNode,j!=null)){var V=s.memoizedProps;if(T=T!==null?T.memoizedProps:V,I=s.type,c=s.updateQueue,s.updateQueue=null,c!==null)try{Qe(j,c,I,T,V,s)}catch(Ie){Gt(s,s.return,Ie)}}}break;case 6:if(oi(c,s),Li(s),I&4&&ee){if(s.stateNode===null)throw Error(o(162));j=s.stateNode,V=s.memoizedProps,T=T!==null?T.memoizedProps:V;try{Oe(j,T,V)}catch(Ie){Gt(s,s.return,Ie)}}break;case 3:if(oi(c,s),Li(s),I&4){if(ee&&oe&&T!==null&&T.memoizedState.isDehydrated)try{or(c.containerInfo)}catch(Ie){Gt(s,s.return,Ie)}if(re){j=c.containerInfo,V=c.pendingChildren;try{Le(j,V)}catch(Ie){Gt(s,s.return,Ie)}}}break;case 4:if(oi(c,s),Li(s),I&4&&re){V=s.stateNode,j=V.containerInfo,V=V.pendingChildren;try{Le(j,V)}catch(Ie){Gt(s,s.return,Ie)}}break;case 13:oi(c,s),Li(s),j=s.child,j.flags&8192&&(V=j.memoizedState!==null,j.stateNode.isHidden=V,!V||j.alternate!==null&&j.alternate.memoizedState!==null||(e1=wr())),I&4&&zb(s);break;case 22:var J=T!==null&&T.memoizedState!==null;if(s.mode&1?(zr=(T=zr)||J,oi(c,s),zr=T):oi(c,s),Li(s),I&8192){if(T=s.memoizedState!==null,(s.stateNode.isHidden=T)&&!J&&s.mode&1)for(ze=s,I=s.child;I!==null;){for(c=ze=I;ze!==null;){J=ze;var ue=J.child;switch(J.tag){case 0:case 11:case 14:case 15:_u(4,J,J.return);break;case 1:Gl(J,J.return);var ge=J.stateNode;if(typeof ge.componentWillUnmount=="function"){var ke=J,Ue=J.return;try{var at=ke;ge.props=at.memoizedProps,ge.state=at.memoizedState,ge.componentWillUnmount()}catch(Ie){Gt(ke,Ue,Ie)}}break;case 5:Gl(J,J.return);break;case 22:if(J.memoizedState!==null){$b(c);continue}}ue!==null?(ue.return=J,ze=ue):$b(c)}I=I.sibling}if(ee){e:if(I=null,ee)for(c=s;;){if(c.tag===5){if(I===null){I=c;try{j=c.stateNode,T?xe(j):we(c.stateNode,c.memoizedProps)}catch(Ie){Gt(s,s.return,Ie)}}}else if(c.tag===6){if(I===null)try{V=c.stateNode,T?qe(V):We(V,c.memoizedProps)}catch(Ie){Gt(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;I===c&&(I=null),c=c.return}I===c&&(I=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:oi(c,s),Li(s),I&4&&zb(s);break;case 21:break;default:oi(c,s),Li(s)}}function Li(s){var c=s.flags;if(c&2){try{if(ee){e:{for(var T=s.return;T!==null;){if(jb(T)){var I=T;break e}T=T.return}throw Error(o(160))}switch(I.tag){case 5:var j=I.stateNode;I.flags&32&&(_e(j),I.flags&=-33);var V=Fb(s);q0(s,V,j);break;case 3:case 4:var J=I.stateNode.containerInfo,ue=Fb(s);V0(s,ue,J);break;default:throw Error(o(161))}}}catch(ge){Gt(s,s.return,ge)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function fE(s,c,T){ze=s,Ub(s)}function Ub(s,c,T){for(var I=(s.mode&1)!==0;ze!==null;){var j=ze,V=j.child;if(j.tag===22&&I){var J=j.memoizedState!==null||kf;if(!J){var ue=j.alternate,ge=ue!==null&&ue.memoizedState!==null||zr;ue=kf;var ke=zr;if(kf=J,(zr=ge)&&!ke)for(ze=j;ze!==null;)J=ze,ge=J.child,J.tag===22&&J.memoizedState!==null?Gb(j):ge!==null?(ge.return=J,ze=ge):Gb(j);for(;V!==null;)ze=V,Ub(V),V=V.sibling;ze=j,kf=ue,zr=ke}Hb(s)}else j.subtreeFlags&8772&&V!==null?(V.return=j,ze=V):Hb(s)}}function Hb(s){for(;ze!==null;){var c=ze;if(c.flags&8772){var T=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:zr||Tf(5,c);break;case 1:var I=c.stateNode;if(c.flags&4&&!zr)if(T===null)I.componentDidMount();else{var j=c.elementType===c.type?T.memoizedProps:ii(c.type,T.memoizedProps);I.componentDidUpdate(j,T.memoizedState,I.__reactInternalSnapshotBeforeUpdate)}var V=c.updateQueue;V!==null&&V2(c,V,I);break;case 3:var J=c.updateQueue;if(J!==null){if(T=null,c.child!==null)switch(c.child.tag){case 5:T=Z(c.child.stateNode);break;case 1:T=c.child.stateNode}V2(c,J,T)}break;case 5:var ue=c.stateNode;T===null&&c.flags&4&&Fe(ue,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(oe&&c.memoizedState===null){var ge=c.alternate;if(ge!==null){var ke=ge.memoizedState;if(ke!==null){var Ue=ke.dehydrated;Ue!==null&&Ji(Ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}zr||c.flags&512&&G0(c)}catch(at){Gt(c,c.return,at)}}if(c===s){ze=null;break}if(T=c.sibling,T!==null){T.return=c.return,ze=T;break}ze=c.return}}function $b(s){for(;ze!==null;){var c=ze;if(c===s){ze=null;break}var T=c.sibling;if(T!==null){T.return=c.return,ze=T;break}ze=c.return}}function Gb(s){for(;ze!==null;){var c=ze;try{switch(c.tag){case 0:case 11:case 15:var T=c.return;try{Tf(4,c)}catch(ge){Gt(c,T,ge)}break;case 1:var I=c.stateNode;if(typeof I.componentDidMount=="function"){var j=c.return;try{I.componentDidMount()}catch(ge){Gt(c,j,ge)}}var V=c.return;try{G0(c)}catch(ge){Gt(c,V,ge)}break;case 5:var J=c.return;try{G0(c)}catch(ge){Gt(c,J,ge)}}}catch(ge){Gt(c,c.return,ge)}if(c===s){ze=null;break}var ue=c.sibling;if(ue!==null){ue.return=c.return,ze=ue;break}ze=c.return}}var Af=0,Rf=1,Mf=2,Lf=3,Nf=4;if(typeof Symbol=="function"&&Symbol.for){var wu=Symbol.for;Af=wu("selector.component"),Rf=wu("selector.has_pseudo_class"),Mf=wu("selector.role"),Lf=wu("selector.test_id"),Nf=wu("selector.text")}function K0(s){var c=ae(s);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(o(364));return c}if(s=ye(s),s===null)throw Error(o(362));return s.stateNode.current}function Y0(s,c){switch(c.$$typeof){case Af:if(s.type===c.value)return!0;break;case Rf:e:{c=c.value,s=[s,0];for(var T=0;T<s.length;){var I=s[T++],j=s[T++],V=c[j];if(I.tag!==5||!he(I)){for(;V!=null&&Y0(I,V);)j++,V=c[j];if(j===c.length){c=!0;break e}else for(I=I.child;I!==null;)s.push(I,j),I=I.sibling}}c=!1}return c;case Mf:if(s.tag===5&&Se(s.stateNode,c.value))return!0;break;case Nf:if((s.tag===5||s.tag===6)&&(s=de(s),s!==null&&0<=s.indexOf(c.value)))return!0;break;case Lf: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 X0(s){switch(s.$$typeof){case Af:return"<"+(x(s.value)||"Unknown")+">";case Rf:return":has("+(X0(s)||"")+")";case Mf:return'[role="'+s.value+'"]';case Nf:return'"'+s.value+'"';case Lf:return'[data-testname="'+s.value+'"]';default:throw Error(o(365))}}function Vb(s,c){var T=[];s=[s,0];for(var I=0;I<s.length;){var j=s[I++],V=s[I++],J=c[V];if(j.tag!==5||!he(j)){for(;J!=null&&Y0(j,J);)V++,J=c[V];if(V===c.length)T.push(j);else for(j=j.child;j!==null;)s.push(j,V),j=j.sibling}}return T}function Z0(s,c){if(!be)throw Error(o(363));s=K0(s),s=Vb(s,c),c=[],s=Array.from(s);for(var T=0;T<s.length;){var I=s[T++];if(I.tag===5)he(I)||c.push(I.stateNode);else for(I=I.child;I!==null;)s.push(I),I=I.sibling}return c}var dE=Math.ceil,If=l.ReactCurrentDispatcher,Q0=l.ReactCurrentOwner,nr=l.ReactCurrentBatchConfig,dt=0,Er=null,lr=null,Ar=0,En=0,Vl=Ia(0),dr=0,Su=null,Fo=0,Df=0,J0=0,Eu=null,an=null,e1=0,t1=1/0,la=null;function ql(){t1=wr()+500}var jf=!1,r1=null,za=null,Ff=!1,Ba=null,zf=0,Ou=0,n1=null,Bf=-1,Uf=0;function Br(){return dt&6?wr():Bf!==-1?Bf:Bf=wr()}function Ua(s){return s.mode&1?dt&2&&Ar!==0?Ar&-Ar:KS.transition!==null?(Uf===0&&(Uf=T2()),Uf):(s=wt,s!==0?s:Re()):1}function Un(s,c,T,I){if(50<Ou)throw Ou=0,n1=null,Error(o(185));su(s,T,I),(!(dt&2)||s!==Er)&&(s===Er&&(!(dt&2)&&(Df|=T),dr===4&&Ha(s,Ar)),on(s,I),T===1&&dt===0&&!(c.mode&1)&&(ql(),lf&&Ci()))}function on(s,c){var T=s.callbackNode;zS(s,c);var I=af(s,s===Er?Ar:0);if(I===0)T!==null&&R2(T),s.callbackNode=null,s.callbackPriority=0;else if(c=I&-I,s.callbackPriority!==c){if(T!=null&&R2(T),c===1)s.tag===0?WS(Wb.bind(null,s)):M2(Wb.bind(null,s)),ne?le(function(){!(dt&6)&&Ci()}):o0(l0,Ci),T=null;else{switch(A2(I)){case 1:T=l0;break;case 4:T=$S;break;case 16:T=s0;break;case 536870912:T=GS;break;default:T=s0}T=r3(T,qb.bind(null,s))}s.callbackPriority=c,s.callbackNode=T}}function qb(s,c){if(Bf=-1,Uf=0,dt&6)throw Error(o(327));var T=s.callbackNode;if(Uo()&&s.callbackNode!==T)return null;var I=af(s,s===Er?Ar:0);if(I===0)return null;if(I&30||I&s.expiredLanes||c)c=Hf(s,I);else{c=I;var j=dt;dt|=2;var V=Xb();(Er!==s||Ar!==c)&&(la=null,ql(),zo(s,c));do try{gE();break}catch(ue){Yb(s,ue)}while(!0);v0(),If.current=V,dt=j,lr!==null?c=0:(Er=null,Ar=0,c=dr)}if(c!==0){if(c===2&&(j=n0(s),j!==0&&(I=j,c=i1(s,j))),c===1)throw T=Su,zo(s,0),Ha(s,I),on(s,wr()),T;if(c===6)Ha(s,I);else{if(j=s.current.alternate,!(I&30)&&!hE(j)&&(c=Hf(s,I),c===2&&(V=n0(s),V!==0&&(I=V,c=i1(s,V))),c===1))throw T=Su,zo(s,0),Ha(s,I),on(s,wr()),T;switch(s.finishedWork=j,s.finishedLanes=I,c){case 0:case 1:throw Error(o(345));case 2:Bo(s,an,la);break;case 3:if(Ha(s,I),(I&130023424)===I&&(c=e1+500-wr(),10<c)){if(af(s,0)!==0)break;if(j=s.suspendedLanes,(j&I)!==I){Br(),s.pingedLanes|=s.suspendedLanes&j;break}s.timeoutHandle=F(Bo.bind(null,s,an,la),c);break}Bo(s,an,la);break;case 4:if(Ha(s,I),(I&4194240)===I)break;for(c=s.eventTimes,j=-1;0<I;){var J=31-ti(I);V=1<<J,J=c[J],J>j&&(j=J),I&=~V}if(I=j,I=wr()-I,I=(120>I?120:480>I?480:1080>I?1080:1920>I?1920:3e3>I?3e3:4320>I?4320:1960*dE(I/1960))-I,10<I){s.timeoutHandle=F(Bo.bind(null,s,an,la),I);break}Bo(s,an,la);break;case 5:Bo(s,an,la);break;default:throw Error(o(329))}}}return on(s,wr()),s.callbackNode===T?qb.bind(null,s):null}function i1(s,c){var T=Eu;return s.current.memoizedState.isDehydrated&&(zo(s,c).flags|=256),s=Hf(s,c),s!==2&&(c=an,an=T,c!==null&&a1(c)),s}function a1(s){an===null?an=s:an.push.apply(an,s)}function hE(s){for(var c=s;;){if(c.flags&16384){var T=c.updateQueue;if(T!==null&&(T=T.stores,T!==null))for(var I=0;I<T.length;I++){var j=T[I],V=j.getSnapshot;j=j.value;try{if(!ri(V(),j))return!1}catch{return!1}}}if(T=c.child,c.subtreeFlags&16384&&T!==null)T.return=c,c=T;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ha(s,c){for(c&=~J0,c&=~Df,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var T=31-ti(c),I=1<<T;s[T]=-1,c&=~I}}function Wb(s){if(dt&6)throw Error(o(327));Uo();var c=af(s,0);if(!(c&1))return on(s,wr()),null;var T=Hf(s,c);if(s.tag!==0&&T===2){var I=n0(s);I!==0&&(c=I,T=i1(s,I))}if(T===1)throw T=Su,zo(s,0),Ha(s,c),on(s,wr()),T;if(T===6)throw Error(o(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,Bo(s,an,la),on(s,wr()),null}function Kb(s){Ba!==null&&Ba.tag===0&&!(dt&6)&&Uo();var c=dt;dt|=1;var T=nr.transition,I=wt;try{if(nr.transition=null,wt=1,s)return s()}finally{wt=I,nr.transition=T,dt=c,!(dt&6)&&Ci()}}function o1(){En=Vl.current,zt(Vl)}function zo(s,c){s.finishedWork=null,s.finishedLanes=0;var T=s.timeoutHandle;if(T!==X&&(s.timeoutHandle=X,Y(T)),lr!==null)for(T=lr.return;T!==null;){var I=T;switch(f0(I),I.tag){case 1:I=I.type.childContextTypes,I!=null&&ef();break;case 3:Hl(),zt(tn),zt(Dr),O0();break;case 5:S0(I);break;case 4:Hl();break;case 13:zt(Wt);break;case 19:zt(Wt);break;case 10:m0(I.type._context);break;case 22:case 23:o1()}T=T.return}if(Er=s,lr=s=$a(s.current,null),Ar=En=c,dr=0,Su=null,J0=Df=Fo=0,an=Eu=null,Do!==null){for(c=0;c<Do.length;c++)if(T=Do[c],I=T.interleaved,I!==null){T.interleaved=null;var j=I.next,V=T.pending;if(V!==null){var J=V.next;V.next=j,I.next=J}T.pending=I}Do=null}return s}function Yb(s,c){do{var T=lr;try{if(v0(),yf.current=Sf,bf){for(var I=Kt.memoizedState;I!==null;){var j=I.queue;j!==null&&(j.pending=null),I=I.next}bf=!1}if(jo=0,Sr=fr=Kt=null,hu=!1,pu=0,Q0.current=null,T===null||T.return===null){dr=1,Su=c,lr=null;break}e:{var V=s,J=T.return,ue=T,ge=c;if(c=Ar,ue.flags|=32768,ge!==null&&typeof ge=="object"&&typeof ge.then=="function"){var ke=ge,Ue=ue,at=Ue.tag;if(!(Ue.mode&1)&&(at===0||at===11||at===15)){var Ie=Ue.alternate;Ie?(Ue.updateQueue=Ie.updateQueue,Ue.memoizedState=Ie.memoizedState,Ue.lanes=Ie.lanes):(Ue.updateQueue=null,Ue.memoizedState=null)}var Bt=_b(J);if(Bt!==null){Bt.flags&=-257,wb(Bt,J,ue,V,c),Bt.mode&1&&bb(V,ke,c),c=Bt,ge=ke;var Mt=c.updateQueue;if(Mt===null){var ln=new Set;ln.add(ge),c.updateQueue=ln}else Mt.add(ge);break e}else{if(!(c&1)){bb(V,ke,c),l1();break e}ge=Error(o(426))}}else if($t&&ue.mode&1){var sa=_b(J);if(sa!==null){!(sa.flags&65536)&&(sa.flags|=256),wb(sa,J,ue,V,c),p0($l(ge,ue));break e}}V=ge=$l(ge,ue),dr!==4&&(dr=2),Eu===null?Eu=[V]:Eu.push(V),V=J;do{switch(V.tag){case 3:V.flags|=65536,c&=-c,V.lanes|=c;var pe=mb(V,ge,c);G2(V,pe);break e;case 1:ue=ge;var ce=V.type,ve=V.stateNode;if(!(V.flags&128)&&(typeof ce.getDerivedStateFromError=="function"||ve!==null&&typeof ve.componentDidCatch=="function"&&(za===null||!za.has(ve)))){V.flags|=65536,c&=-c,V.lanes|=c;var De=yb(V,ue,c);G2(V,De);break e}}V=V.return}while(V!==null)}Qb(T)}catch(Xe){c=Xe,lr===T&&T!==null&&(lr=T=T.return);continue}break}while(!0)}function Xb(){var s=If.current;return If.current=Sf,s===null?Sf:s}function l1(){(dr===0||dr===3||dr===2)&&(dr=4),Er===null||!(Fo&268435455)&&!(Df&268435455)||Ha(Er,Ar)}function Hf(s,c){var T=dt;dt|=2;var I=Xb();(Er!==s||Ar!==c)&&(la=null,zo(s,c));do try{pE();break}catch(j){Yb(s,j)}while(!0);if(v0(),dt=T,If.current=I,lr!==null)throw Error(o(261));return Er=null,Ar=0,dr}function pE(){for(;lr!==null;)Zb(lr)}function gE(){for(;lr!==null&&!US();)Zb(lr)}function Zb(s){var c=t3(s.alternate,s,En);s.memoizedProps=s.pendingProps,c===null?Qb(s):lr=c,Q0.current=null}function Qb(s){var c=s;do{var T=c.alternate;if(s=c.return,c.flags&32768){if(T=sE(T,c),T!==null){T.flags&=32767,lr=T;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{dr=6,lr=null;return}}else if(T=lE(T,c,En),T!==null){lr=T;return}if(c=c.sibling,c!==null){lr=c;return}lr=c=s}while(c!==null);dr===0&&(dr=5)}function Bo(s,c,T){var I=wt,j=nr.transition;try{nr.transition=null,wt=1,vE(s,c,T,I)}finally{nr.transition=j,wt=I}return null}function vE(s,c,T,I){do Uo();while(Ba!==null);if(dt&6)throw Error(o(327));T=s.finishedWork;var j=s.finishedLanes;if(T===null)return null;if(s.finishedWork=null,s.finishedLanes=0,T===s.current)throw Error(o(177));s.callbackNode=null,s.callbackPriority=0;var V=T.lanes|T.childLanes;if(BS(s,V),s===Er&&(lr=Er=null,Ar=0),!(T.subtreeFlags&2064)&&!(T.flags&2064)||Ff||(Ff=!0,r3(s0,function(){return Uo(),null})),V=(T.flags&15990)!==0,T.subtreeFlags&15990||V){V=nr.transition,nr.transition=null;var J=wt;wt=1;var ue=dt;dt|=4,Q0.current=null,cE(s,T),Bb(T,s),L(s.containerInfo),s.current=T,fE(T),HS(),dt=ue,wt=J,nr.transition=V}else s.current=T;if(Ff&&(Ff=!1,Ba=s,zf=j),V=s.pendingLanes,V===0&&(za=null),VS(T.stateNode),on(s,wr()),c!==null)for(I=s.onRecoverableError,T=0;T<c.length;T++)j=c[T],I(j.value,{componentStack:j.stack,digest:j.digest});if(jf)throw jf=!1,s=r1,r1=null,s;return zf&1&&s.tag!==0&&Uo(),V=s.pendingLanes,V&1?s===n1?Ou++:(Ou=0,n1=s):Ou=0,Ci(),null}function Uo(){if(Ba!==null){var s=A2(zf),c=nr.transition,T=wt;try{if(nr.transition=null,wt=16>s?16:s,Ba===null)var I=!1;else{if(s=Ba,Ba=null,zf=0,dt&6)throw Error(o(331));var j=dt;for(dt|=4,ze=s.current;ze!==null;){var V=ze,J=V.child;if(ze.flags&16){var ue=V.deletions;if(ue!==null){for(var ge=0;ge<ue.length;ge++){var ke=ue[ge];for(ze=ke;ze!==null;){var Ue=ze;switch(Ue.tag){case 0:case 11:case 15:_u(8,Ue,V)}var at=Ue.child;if(at!==null)at.return=Ue,ze=at;else for(;ze!==null;){Ue=ze;var Ie=Ue.sibling,Bt=Ue.return;if(Db(Ue),Ue===ke){ze=null;break}if(Ie!==null){Ie.return=Bt,ze=Ie;break}ze=Bt}}}var Mt=V.alternate;if(Mt!==null){var ln=Mt.child;if(ln!==null){Mt.child=null;do{var sa=ln.sibling;ln.sibling=null,ln=sa}while(ln!==null)}}ze=V}}if(V.subtreeFlags&2064&&J!==null)J.return=V,ze=J;else e:for(;ze!==null;){if(V=ze,V.flags&2048)switch(V.tag){case 0:case 11:case 15:_u(9,V,V.return)}var pe=V.sibling;if(pe!==null){pe.return=V.return,ze=pe;break e}ze=V.return}}var ce=s.current;for(ze=ce;ze!==null;){J=ze;var ve=J.child;if(J.subtreeFlags&2064&&ve!==null)ve.return=J,ze=ve;else e:for(J=ce;ze!==null;){if(ue=ze,ue.flags&2048)try{switch(ue.tag){case 0:case 11:case 15:Tf(9,ue)}}catch(Xe){Gt(ue,ue.return,Xe)}if(ue===J){ze=null;break e}var De=ue.sibling;if(De!==null){De.return=ue.return,ze=De;break e}ze=ue.return}}if(dt=j,Ci(),xi&&typeof xi.onPostCommitFiberRoot=="function")try{xi.onPostCommitFiberRoot(of,s)}catch{}I=!0}return I}finally{wt=T,nr.transition=c}}return!1}function Jb(s,c,T){c=$l(T,c),c=mb(s,c,1),s=Fa(s,c,1),c=Br(),s!==null&&(su(s,1,c),on(s,c))}function Gt(s,c,T){if(s.tag===3)Jb(s,s,T);else for(;c!==null;){if(c.tag===3){Jb(c,s,T);break}else if(c.tag===1){var I=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof I.componentDidCatch=="function"&&(za===null||!za.has(I))){s=$l(T,s),s=yb(c,s,1),c=Fa(c,s,1),s=Br(),c!==null&&(su(c,1,s),on(c,s));break}}c=c.return}}function mE(s,c,T){var I=s.pingCache;I!==null&&I.delete(c),c=Br(),s.pingedLanes|=s.suspendedLanes&T,Er===s&&(Ar&T)===T&&(dr===4||dr===3&&(Ar&130023424)===Ar&&500>wr()-e1?zo(s,0):J0|=T),on(s,c)}function e3(s,c){c===0&&(s.mode&1?(c=nf,nf<<=1,!(nf&130023424)&&(nf=4194304)):c=1);var T=Br();s=ki(s,c),s!==null&&(su(s,c,T),on(s,T))}function yE(s){var c=s.memoizedState,T=0;c!==null&&(T=c.retryLane),e3(s,T)}function bE(s,c){var T=0;switch(s.tag){case 13:var I=s.stateNode,j=s.memoizedState;j!==null&&(T=j.retryLane);break;case 19:I=s.stateNode;break;default:throw Error(o(314))}I!==null&&I.delete(c),e3(s,T)}var t3;t3=function(s,c,T){if(s!==null)if(s.memoizedProps!==c.pendingProps||tn.current)nn=!0;else{if(!(s.lanes&T)&&!(c.flags&128))return nn=!1,oE(s,c,T);nn=!!(s.flags&131072)}else nn=!1,$t&&c.flags&1048576&&L2(c,uf,c.index);switch(c.lanes=0,c.tag){case 2:var I=c.type;Pf(s,c),s=c.pendingProps;var j=Nl(c,Dr.current);Bl(c,T),j=C0(null,c,I,s,j,T);var V=k0();return c.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,rn(I)?(V=!0,tf(c)):V=!1,c.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,_0(c),j.updater=Ef,c.stateNode=j,j._reactInternals=c,N0(c,I,s,T),c=F0(null,c,I,!0,V,T)):(c.tag=0,$t&&V&&c0(c),Wr(null,c,j,T),c=c.child),c;case 16:I=c.elementType;e:{switch(Pf(s,c),s=c.pendingProps,j=I._init,I=j(I._payload),c.type=I,j=c.tag=wE(I),s=ii(I,s),j){case 0:c=j0(null,c,I,s,T);break e;case 1:c=Cb(null,c,I,s,T);break e;case 11:c=Sb(null,c,I,s,T);break e;case 14:c=Eb(null,c,I,ii(I.type,s),T);break e}throw Error(o(306,I,""))}return c;case 0:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:ii(I,j),j0(s,c,I,j,T);case 1:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:ii(I,j),Cb(s,c,I,j,T);case 3:e:{if(kb(c),s===null)throw Error(o(387));I=c.pendingProps,V=c.memoizedState,j=V.element,$2(s,c),vf(c,I,null,T);var J=c.memoizedState;if(I=J.element,oe&&V.isDehydrated)if(V={element:I,isDehydrated:!1,cache:J.cache,pendingSuspenseBoundaries:J.pendingSuspenseBoundaries,transitions:J.transitions},c.updateQueue.baseState=V,c.memoizedState=V,c.flags&256){j=$l(Error(o(423)),c),c=Tb(s,c,I,T,j);break e}else if(I!==j){j=$l(Error(o(424)),c),c=Tb(s,c,I,T,j);break e}else for(oe&&(jn=nt(c.stateNode.containerInfo),Sn=c,$t=!0,ni=null,uu=!1),T=B2(c,null,I,T),c.child=T;T;)T.flags=T.flags&-3|4096,T=T.sibling;else{if(jl(),I===j){c=oa(s,c,T);break e}Wr(s,c,I,T)}c=c.child}return c;case 5:return q2(c),s===null&&h0(c),I=c.type,j=c.pendingProps,V=s!==null?s.memoizedProps:null,J=j.children,z(I,j)?J=null:V!==null&&z(I,V)&&(c.flags|=32),xb(s,c),Wr(s,c,J,T),c.child;case 6:return s===null&&h0(c),null;case 13:return Ab(s,c,T);case 4:return w0(c,c.stateNode.containerInfo),I=c.pendingProps,s===null?c.child=Fl(c,null,I,T):Wr(s,c,I,T),c.child;case 11:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:ii(I,j),Sb(s,c,I,j,T);case 7:return Wr(s,c,c.pendingProps,T),c.child;case 8:return Wr(s,c,c.pendingProps.children,T),c.child;case 12:return Wr(s,c,c.pendingProps.children,T),c.child;case 10:e:{if(I=c.type._context,j=c.pendingProps,V=c.memoizedProps,J=j.value,U2(c,I,J),V!==null)if(ri(V.value,J)){if(V.children===j.children&&!tn.current){c=oa(s,c,T);break e}}else for(V=c.child,V!==null&&(V.return=c);V!==null;){var ue=V.dependencies;if(ue!==null){J=V.child;for(var ge=ue.firstContext;ge!==null;){if(ge.context===I){if(V.tag===1){ge=aa(-1,T&-T),ge.tag=2;var ke=V.updateQueue;if(ke!==null){ke=ke.shared;var Ue=ke.pending;Ue===null?ge.next=ge:(ge.next=Ue.next,Ue.next=ge),ke.pending=ge}}V.lanes|=T,ge=V.alternate,ge!==null&&(ge.lanes|=T),y0(V.return,T,c),ue.lanes|=T;break}ge=ge.next}}else if(V.tag===10)J=V.type===c.type?null:V.child;else if(V.tag===18){if(J=V.return,J===null)throw Error(o(341));J.lanes|=T,ue=J.alternate,ue!==null&&(ue.lanes|=T),y0(J,T,c),J=V.sibling}else J=V.child;if(J!==null)J.return=V;else for(J=V;J!==null;){if(J===c){J=null;break}if(V=J.sibling,V!==null){V.return=J.return,J=V;break}J=J.return}V=J}Wr(s,c,j.children,T),c=c.child}return c;case 9:return j=c.type,I=c.pendingProps.children,Bl(c,T),j=Fn(j),I=I(j),c.flags|=1,Wr(s,c,I,T),c.child;case 14:return I=c.type,j=ii(I,c.pendingProps),j=ii(I.type,j),Eb(s,c,I,j,T);case 15:return Ob(s,c,c.type,c.pendingProps,T);case 17:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:ii(I,j),Pf(s,c),c.tag=1,rn(I)?(s=!0,tf(c)):s=!1,Bl(c,T),gb(c,I,j),N0(c,I,j,T),F0(null,c,I,!0,s,T);case 19:return Mb(s,c,T);case 22:return Pb(s,c,T)}throw Error(o(156,c.tag))};function r3(s,c){return o0(s,c)}function _E(s,c,T,I){this.tag=s,this.key=T,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=I,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hn(s,c,T,I){return new _E(s,c,T,I)}function s1(s){return s=s.prototype,!(!s||!s.isReactComponent)}function wE(s){if(typeof s=="function")return s1(s)?1:0;if(s!=null){if(s=s.$$typeof,s===p)return 11;if(s===y)return 14}return 2}function $a(s,c){var T=s.alternate;return T===null?(T=Hn(s.tag,c,s.key,s.mode),T.elementType=s.elementType,T.type=s.type,T.stateNode=s.stateNode,T.alternate=s,s.alternate=T):(T.pendingProps=c,T.type=s.type,T.flags=0,T.subtreeFlags=0,T.deletions=null),T.flags=s.flags&14680064,T.childLanes=s.childLanes,T.lanes=s.lanes,T.child=s.child,T.memoizedProps=s.memoizedProps,T.memoizedState=s.memoizedState,T.updateQueue=s.updateQueue,c=s.dependencies,T.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},T.sibling=s.sibling,T.index=s.index,T.ref=s.ref,T}function $f(s,c,T,I,j,V){var J=2;if(I=s,typeof s=="function")s1(s)&&(J=1);else if(typeof s=="string")J=5;else e:switch(s){case h:return Ho(T.children,j,V,c);case O:J=8,j|=8;break;case w:return s=Hn(12,T,c,j|2),s.elementType=w,s.lanes=V,s;case v:return s=Hn(13,T,c,j),s.elementType=v,s.lanes=V,s;case g:return s=Hn(19,T,c,j),s.elementType=g,s.lanes=V,s;case m:return Gf(T,j,V,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case b:J=10;break e;case E:J=9;break e;case p:J=11;break e;case y:J=14;break e;case d:J=16,I=null;break e}throw Error(o(130,s==null?s:typeof s,""))}return c=Hn(J,T,c,j),c.elementType=s,c.type=I,c.lanes=V,c}function Ho(s,c,T,I){return s=Hn(7,s,I,c),s.lanes=T,s}function Gf(s,c,T,I){return s=Hn(22,s,I,c),s.elementType=m,s.lanes=T,s.stateNode={isHidden:!1},s}function u1(s,c,T){return s=Hn(6,s,null,c),s.lanes=T,s}function c1(s,c,T){return c=Hn(4,s.children!==null?s.children:[],s.key,c),c.lanes=T,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function SE(s,c,T,I,j){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=X,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=i0(0),this.expirationTimes=i0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=i0(0),this.identifierPrefix=I,this.onRecoverableError=j,oe&&(this.mutableSourceEagerHydrationData=null)}function n3(s,c,T,I,j,V,J,ue,ge){return s=new SE(s,c,T,ue,ge),c===1?(c=1,V===!0&&(c|=8)):c=0,V=Hn(3,null,null,c),s.current=V,V.stateNode=s,V.memoizedState={element:I,isDehydrated:T,cache:null,transitions:null,pendingSuspenseBoundaries:null},_0(V),s}function i3(s){if(!s)return Da;s=s._reactInternals;e:{if(S(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 T=s.type;if(rn(T))return C2(s,T,c)}return c}function a3(s){var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(o(188)):(s=Object.keys(s).join(","),Error(o(268,s)));return s=R(c),s===null?null:s.stateNode}function o3(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var T=s.retryLane;s.retryLane=T!==0&&T<c?T:c}}function Vf(s,c){o3(s,c),(s=s.alternate)&&o3(s,c)}function EE(s){return s=R(s),s===null?null:s.stateNode}function OE(){return null}return r.attemptContinuousHydration=function(s){if(s.tag===13){var c=ki(s,134217728);if(c!==null){var T=Br();Un(c,s,134217728,T)}Vf(s,134217728)}},r.attemptDiscreteHydration=function(s){if(s.tag===13){var c=ki(s,1);if(c!==null){var T=Br();Un(c,s,1,T)}Vf(s,1)}},r.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var c=Ua(s),T=ki(s,c);if(T!==null){var I=Br();Un(T,s,c,I)}Vf(s,c)}},r.attemptSynchronousHydration=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var T=lu(c.pendingLanes);T!==0&&(a0(c,T|1),on(c,wr()),!(dt&6)&&(ql(),Ci()))}break;case 13:Kb(function(){var I=ki(s,1);if(I!==null){var j=Br();Un(I,s,1,j)}}),Vf(s,1)}},r.batchedUpdates=function(s,c){var T=dt;dt|=1;try{return s(c)}finally{dt=T,dt===0&&(ql(),lf&&Ci())}},r.createComponentSelector=function(s){return{$$typeof:Af,value:s}},r.createContainer=function(s,c,T,I,j,V,J){return n3(s,c,!1,null,T,I,j,V,J)},r.createHasPseudoClassSelector=function(s){return{$$typeof:Rf,value:s}},r.createHydrationContainer=function(s,c,T,I,j,V,J,ue,ge){return s=n3(T,I,!0,s,j,V,J,ue,ge),s.context=i3(null),T=s.current,I=Br(),j=Ua(T),V=aa(I,j),V.callback=c??null,Fa(T,V,j),s.current.lanes=j,su(s,j,I),on(s,I),s},r.createPortal=function(s,c,T){var I=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:I==null?null:""+I,children:s,containerInfo:c,implementation:T}},r.createRoleSelector=function(s){return{$$typeof:Mf,value:s}},r.createTestNameSelector=function(s){return{$$typeof:Lf,value:s}},r.createTextSelector=function(s){return{$$typeof:Nf,value:s}},r.deferredUpdates=function(s){var c=wt,T=nr.transition;try{return nr.transition=null,wt=16,s()}finally{wt=c,nr.transition=T}},r.discreteUpdates=function(s,c,T,I,j){var V=wt,J=nr.transition;try{return nr.transition=null,wt=1,s(c,T,I,j)}finally{wt=V,nr.transition=J,dt===0&&ql()}},r.findAllNodes=Z0,r.findBoundingRects=function(s,c){if(!be)throw Error(o(363));c=Z0(s,c),s=[];for(var T=0;T<c.length;T++)s.push(te(c[T]));for(c=s.length-1;0<c;c--){T=s[c];for(var I=T.x,j=I+T.width,V=T.y,J=V+T.height,ue=c-1;0<=ue;ue--)if(c!==ue){var ge=s[ue],ke=ge.x,Ue=ke+ge.width,at=ge.y,Ie=at+ge.height;if(I>=ke&&V>=at&&j<=Ue&&J<=Ie){s.splice(c,1);break}else if(I!==ke||T.width!==ge.width||Ie<V||at>J){if(!(V!==at||T.height!==ge.height||Ue<I||ke>j)){ke>I&&(ge.width+=ke-I,ge.x=I),Ue<j&&(ge.width=j-ke),s.splice(c,1);break}}else{at>V&&(ge.height+=at-V,ge.y=V),Ie<J&&(ge.height=J-at),s.splice(c,1);break}}}return s},r.findHostInstance=a3,r.findHostInstanceWithNoPortals=function(s){return s=C(s),s=s!==null?U(s):null,s===null?null:s.stateNode},r.findHostInstanceWithWarning=function(s){return a3(s)},r.flushControlled=function(s){var c=dt;dt|=1;var T=nr.transition,I=wt;try{nr.transition=null,wt=1,s()}finally{wt=I,nr.transition=T,dt=c,dt===0&&(ql(),Ci())}},r.flushPassiveEffects=Uo,r.flushSync=Kb,r.focusWithin=function(s,c){if(!be)throw Error(o(363));for(s=K0(s),c=Vb(s,c),c=Array.from(c),s=0;s<c.length;){var T=c[s++];if(!he(T)){if(T.tag===5&&$e(T.stateNode))return!0;for(T=T.child;T!==null;)c.push(T),T=T.sibling}}return!1},r.getCurrentUpdatePriority=function(){return wt},r.getFindAllNodesFailureDescription=function(s,c){if(!be)throw Error(o(363));var T=0,I=[];s=[K0(s),0];for(var j=0;j<s.length;){var V=s[j++],J=s[j++],ue=c[J];if((V.tag!==5||!he(V))&&(Y0(V,ue)&&(I.push(X0(ue)),J++,J>T&&(T=J)),J<c.length))for(V=V.child;V!==null;)s.push(V,J),V=V.sibling}if(T<c.length){for(s=[];T<c.length;T++)s.push(X0(c[T]));return`findAllNodes was able to match part of the selector:
|
|
58
|
+
`+(I.join(" > ")+`
|
|
59
|
+
|
|
60
|
+
No matching component was found for:
|
|
61
|
+
`)+s.join(" > ")}return null},r.getPublicRootInstance=function(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return Z(s.child.stateNode);default:return s.child.stateNode}},r.injectIntoDevTools=function(s){if(s={bundleType:s.bundleType,version:s.version,rendererPackageName:s.rendererPackageName,rendererConfig:s.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:EE,findFiberByHostInstance:s.findFiberByHostInstance||OE,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{of=c.inject(s),xi=c}catch{}s=!!c.checkDCE}}return s},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(s,c,T,I){if(!be)throw Error(o(363));s=Z0(s,c);var j=tt(s,T,I).disconnect;return{disconnect:function(){j()}}},r.registerMutableSourceForHydration=function(s,c){var T=c._getVersion;T=T(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,T]:s.mutableSourceEagerHydrationData.push(c,T)},r.runWithPriority=function(s,c){var T=wt;try{return wt=s,c()}finally{wt=T}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(s,c,T,I){var j=c.current,V=Br(),J=Ua(j);return T=i3(T),c.context===null?c.context=T:c.pendingContext=T,c=aa(V,J),c.payload={element:s},I=I===void 0?null:I,I!==null&&(c.callback=I),s=Fa(j,c,J),s!==null&&(Un(s,j,J,V),gf(s,j,J)),J},r};F9.exports=SM;var EM=F9.exports;const OM=Ch(EM);var z9={exports:{}},xl={};/**
|
|
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
|
+
*/xl.ConcurrentRoot=1;xl.ContinuousEventPriority=4;xl.DefaultEventPriority=16;xl.DiscreteEventPriority=1;xl.IdleEventPriority=536870912;xl.LegacyRoot=0;z9.exports=xl;var B9=z9.exports;const d4={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let h4=!1,p4=!1;const Yy=".react-konva-event";let U9=!1;function PM(e){U9=e}const xM=`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
|
+
`,CM=`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
|
+
`,kM={};function Wp(e,t,r=kM){if(!h4&&"zIndex"in t&&(console.warn(CM),h4=!0),!p4&&t.draggable){var n=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;n&&!i&&(console.warn(xM),p4=!0)}for(var a in r)if(!d4[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 h=U9||t._useStrictMode,O={},w=!1;const b={};for(var a in t)if(!d4[a]){var o=a.slice(0,2)==="on",E=r[a]!==t[a];if(o&&E){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[a]&&(b[u]=t[a])}!o&&(t[a]!==r[a]||h&&t[a]!==e.getAttr(a))&&(w=!0,O[a]=t[a])}w&&(e.setAttrs(O),To(e));for(var u in b)e.on(u+Yy,b[u])}function To(e){if(!ct.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const H9={},TM={};Oc.Node.prototype._applyProps=Wp;function AM(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),To(e)}function RM(e,t,r){let n=Oc[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=Oc.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 Wp(u,a),u}function MM(e,t,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function LM(e,t,r){return!1}function NM(e){return e}function IM(){return null}function DM(){return null}function jM(e,t,r,n){return TM}function FM(){}function zM(e){}function BM(e,t){return!1}function UM(){return H9}function HM(){return H9}const $M=setTimeout,GM=clearTimeout,VM=-1;function qM(e,t){return!1}const WM=!1,KM=!0,YM=!0;function XM(e,t){t.parent===e?t.moveToTop():e.add(t),To(e)}function ZM(e,t){t.parent===e?t.moveToTop():e.add(t),To(e)}function $9(e,t,r){t._remove(),e.add(t),t.setZIndex(r.getZIndex()),To(e)}function QM(e,t,r){$9(e,t,r)}function JM(e,t){t.destroy(),t.off(Yy),To(e)}function eL(e,t){t.destroy(),t.off(Yy),To(e)}function tL(e,t,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function rL(e,t,r){}function nL(e,t,r,n,i){Wp(e,i,n)}function iL(e){e.hide(),To(e)}function aL(e){}function oL(e,t){(t.visible==null||t.visible)&&e.show()}function lL(e,t){}function sL(e){}function uL(){}const cL=()=>B9.DefaultEventPriority,fL=Object.freeze(Object.defineProperty({__proto__:null,appendChild:XM,appendChildToContainer:ZM,appendInitialChild:AM,cancelTimeout:GM,clearContainer:sL,commitMount:rL,commitTextUpdate:tL,commitUpdate:nL,createInstance:RM,createTextInstance:MM,detachDeletedInstance:uL,finalizeInitialChildren:LM,getChildHostContext:HM,getCurrentEventPriority:cL,getPublicInstance:NM,getRootHostContext:UM,hideInstance:iL,hideTextInstance:aL,idlePriority:Hu.unstable_IdlePriority,insertBefore:$9,insertInContainerBefore:QM,isPrimaryRenderer:WM,noTimeout:VM,now:Hu.unstable_now,prepareForCommit:IM,preparePortalMount:DM,prepareUpdate:jM,removeChild:JM,removeChildFromContainer:eL,resetAfterCommit:FM,resetTextContent:zM,run:Hu.unstable_runWithPriority,scheduleTimeout:$M,shouldDeprioritizeSubtree:BM,shouldSetTextContent:qM,supportsMutation:YM,unhideInstance:oL,unhideTextInstance:lL,warnsIfNotActing:KM},Symbol.toStringTag,{value:"Module"}));var dL=Object.defineProperty,hL=Object.defineProperties,pL=Object.getOwnPropertyDescriptors,g4=Object.getOwnPropertySymbols,gL=Object.prototype.hasOwnProperty,vL=Object.prototype.propertyIsEnumerable,v4=(e,t,r)=>t in e?dL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m4=(e,t)=>{for(var r in t||(t={}))gL.call(t,r)&&v4(e,r,t[r]);if(g4)for(var r of g4(t))vL.call(t,r)&&v4(e,r,t[r]);return e},mL=(e,t)=>hL(e,pL(t)),y4,b4;typeof window<"u"&&((y4=window.document)!=null&&y4.createElement||((b4=window.navigator)==null?void 0:b4.product)==="ReactNative")?et.useLayoutEffect:et.useEffect;function G9(e,t,r){if(!e)return;if(r(e)===!0)return e;let n=e.child;for(;n;){const i=G9(n,t,r);if(i)return i;n=n.sibling}}function V9(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const _4=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=_4;return}return _4.apply(this,arguments)};const Xy=V9(et.createContext(null));class q9 extends et.Component{render(){return et.createElement(Xy.Provider,{value:this._reactInternals},this.props.children)}}function yL(){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=G9(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 bL(){const e=yL(),[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(V9(i)))}r=r.return}return t}function W9(){const e=bL();return et.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>n=>et.createElement(t,null,et.createElement(r.Provider,mL(m4({},n),{value:e.get(r)}))),t=>et.createElement(q9,m4({},t))),[e])}function _L(e){const t=ht.useRef({});return ht.useLayoutEffect(()=>{t.current=e}),ht.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const wL=e=>{const t=ht.useRef(),r=ht.useRef(),n=ht.useRef(),i=_L(e),a=W9(),o=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return ht.useLayoutEffect(()=>(r.current=new Oc.Stage({width:e.width,height:e.height,container:t.current}),o(r.current),n.current=hs.createContainer(r.current,B9.LegacyRoot,!1,null),hs.updateContainer(ht.createElement(a,{},e.children),n.current),()=>{Oc.isBrowser&&(o(null),hs.updateContainer(null,n.current,null),r.current.destroy())}),[]),ht.useLayoutEffect(()=>{o(r.current),Wp(r.current,e,i),hs.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})},SL="Layer",EL="FastLayer",Eh="Group",OL="Label",PL="Rect",xL="Circle",CL="Ellipse",kL="Wedge",TL="Line",AL="Sprite",RL="Image",ML="Text",LL="TextPath",NL="Star",IL="Ring",DL="Arc",jL="Tag",FL="Path",zL="RegularPolygon",BL="Arrow",UL="Shape",HL="Transformer",hs=OM(fL);hs.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:ht.version,rendererPackageName:"react-konva"});const $L=ht.forwardRef((e,t)=>ht.createElement(q9,{},ht.createElement(wL,{...e,forwardedRef:t}))),GL=PM,VL=Object.freeze(Object.defineProperty({__proto__:null,Arc:DL,Arrow:BL,Circle:xL,Ellipse:CL,FastLayer:EL,Group:Eh,Image:RL,KonvaRenderer:hs,Label:OL,Layer:SL,Line:TL,Path:FL,Rect:PL,RegularPolygon:zL,Ring:IL,Shape:UL,Sprite:AL,Stage:$L,Star:NL,Tag:jL,Text:ML,TextPath:LL,Transformer:HL,Wedge:kL,useStrictMode:GL},Symbol.toStringTag,{value:"Module"})),Ma=yo(VL);var Go=et,Kp=function(t,r,n){const i=Go.useRef("loading"),a=Go.useRef(),[o,l]=Go.useState(0),u=Go.useRef(),f=Go.useRef(),h=Go.useRef();return(u.current!==t||f.current!==r||h.current!==n)&&(i.current="loading",a.current=void 0,u.current=t,f.current=r,h.current=n),Go.useLayoutEffect(function(){if(!t)return;var O=document.createElement("img");function w(){i.current="loaded",a.current=O,l(Math.random())}function b(){i.current="failed",a.current=void 0,l(Math.random())}return O.addEventListener("load",w),O.addEventListener("error",b),r&&(O.crossOrigin=r),n&&(O.referrerPolicy=n),O.src=t,function(){O.removeEventListener("load",w),O.removeEventListener("error",b)}},[t,r,n]),[a.current,i.current]};const qL=Ch(Kp);var K9={},Zy={},WL=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 KL=e=>{const t=window.getComputedStyle(e).position;return!(t==="absolute"||t==="relative")};function Y9(e=()=>{}){const t=ht.useRef(e);return t.current=e,ht.useCallback((...r)=>t.current.apply(null,r),[])}const YL=({children:e,groupProps:t,divProps:r,transform:n,transformFunc:i})=>{const a=W9(),o=ht.useRef(null);ht.useRef();const[l]=ht.useState(()=>document.createElement("div")),u=ht.useMemo(()=>Fd.createRoot(l),[l]),f=n??!0,h=Y9(()=>{if(f&&o.current){let p=o.current.getAbsoluteTransform().decompose();i&&(p=i(p)),l.style.position="absolute",l.style.zIndex="10",l.style.top="0px",l.style.left="0px",l.style.transform=`translate(${p.x}px, ${p.y}px) rotate(${p.rotation}deg) scaleX(${p.scaleX}) scaleY(${p.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 O=r||{},{style:w}=O,b=WL(O,["style"]);Object.assign(l.style,w),Object.assign(l,b)});return ht.useLayoutEffect(()=>{var O;const w=o.current;if(!w)return;const b=(O=w.getStage())===null||O===void 0?void 0:O.container();if(b)return b.appendChild(l),f&&KL(b)&&(b.style.position="relative"),w.on("absoluteTransformChange",h),h(),()=>{var E;w.off("absoluteTransformChange",h),(E=l.parentNode)===null||E===void 0||E.removeChild(l)}},[f]),ht.useLayoutEffect(()=>{h()},[r,i]),ht.useLayoutEffect(()=>{u.render(ht.createElement(a,null,e))}),ht.useLayoutEffect(()=>()=>{setTimeout(()=>{u.unmount()})},[]),ht.createElement(Eh,Object.assign({ref:o},t))},XL=({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 h=u.getLayer();if(!h)return;h.batchDraw()}},[e,o]),ht.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.destroy()},[]),ht.createElement(Eh,{name:"_outer_portal",ref:n},ht.createElement(Eh,{name:"_inner_portal",ref:i},r))},ZL=Object.freeze(Object.defineProperty({__proto__:null,Html:YL,Portal:XL,useEvent:Y9,useImage:qL},Symbol.toStringTag,{value:"Module"})),Yc=yo(ZL);function QL(e,t){return Object.keys(e.values).forEach(r=>e.values[r]=e.values[r]&&parseFloat(e.values[r].toFixed(t))),e}function X9(e,t,r){const n=t-1,i=r[Q9(n,r.length)];return i.marker!=="Z"?i:X9(e,n,r)}function Z9(e,t,r){const n=t+1,i=r[Q9(n,r.length)];return i.marker==="Z"?Z9(e,n,r):i}function JL(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 eN(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 Q9(e,t){return(e%t+t)%t}function tN(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 rN(e,t,r){const n=S4(e.values,r.values),i=S4(t.values,e.values);return Math.min(i,n)}function w4(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function S4(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 E4(e,t){return Math.sin(e)*t}function O4(e,t){return Math.cos(e)*t}function P4(e,t){const r=t/Math.tan(e);return r===1/0||r===-1/0||isNaN(r)?t:r}function nN(e,t){return t*Math.tan(e)}function iN(e,t){let r,n=0,i=e*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=P4(e/2,-t):(r=P4(e/2,t),n=1,r===1/0&&(r=t)),{offset:r,sweepFlag:n}}function aN(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 J9(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 eN(n.marker,a)}).map(JL)}function e7(e,t,r){let n=[],i=[];return r&&e.forEach(a=>QL(a,r)),e.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(tN),vm(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(l=>!l.overlap).map((l,u,f)=>{const O=X9(l,u,f),w=Z9(l,u,f),b=w4(l.values,O.values),E=w4(l.values,w.values),p=E-b,v=p*(180/Math.PI),g=rN(l,O,w),y=Math.abs(nN(p/2,g/2)),d=Math.min(t,y),m=iN(p,d),_=m.offset,k=m.sweepFlag,x=(u==0||u==f.length-1)&&!o;switch(l.marker){case"M":case"L":const A=[l.values.x+E4(b,_),l.values.y+O4(b,_)],S=[l.values.x+E4(E,_),l.values.y+O4(E,_)];x?i.push({marker:l.marker,values:l.values}):i.push({marker:l.marker,values:{x:parseFloat(A[0].toFixed(3)),y:parseFloat(A[1].toFixed(3))}}),!x&&(w.marker==="L"||w.marker==="M")&&i.push({marker:"A",radius:d,values:{radiusX:parseFloat(d.toFixed(3)),radiusY:parseFloat(d.toFixed(3)),rotation:v,largeArc:0,sweep:k,x:parseFloat(S[0].toFixed(3)),y:parseFloat(S[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:aN(i),commands:i}}function oN(e,t,r){return e7([...J9(e)],t,r)}const lN=Object.freeze(Object.defineProperty({__proto__:null,parsePath:J9,roundCommands:e7,roundCorners:oN},Symbol.toStringTag,{value:"Module"})),sN=yo(lN);var Xc={},Qy={},Jy={},Cl=Cl||{};Cl.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 Cl=Cl||{};Cl.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(W){var H=new Error(t+": "+W);throw H.source=t,H}function n(){var W=i();return t.length>0&&r("Invalid input not EOF"),W}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,O)||o("repeating-radial-gradient",e.repeatingRadialGradient,O)}function o(W,H,M){return l(H,function(L){var D=M();return D&&(G(e.comma)||r("Missing comma before color stops")),{type:W,orientation:D,colorStops:d(m)}})}function l(W,H){var M=G(W);if(M){G(e.startCall)||r("Missing (");var L=H(M);return G(e.endCall)||r("Missing )"),L}}function u(){return f()||h()}function f(){return U("directional",e.sideOrCorner,1)}function h(){return U("angular",e.angleValue,1)}function O(){var W,H=w(),M;return H&&(W=[],W.push(H),M=t,G(e.comma)&&(H=w(),H?W.push(H):t=M)),W}function w(){var W=b()||E();if(W)W.at=v();else{var H=p();if(H){W=H;var M=v();M&&(W.at=M)}else{var L=g();L&&(W={type:"default-radial",at:L})}}return W}function b(){var W=U("shape",/^(circle)/i,0);return W&&(W.style=N()||p()),W}function E(){var W=U("shape",/^(ellipse)/i,0);return W&&(W.style=C()||p()),W}function p(){return U("extent-keyword",e.extentKeywords,1)}function v(){if(U("position",/^at/,0)){var W=g();return W||r("Missing positioning value"),W}}function g(){var W=y();if(W.x||W.y)return{type:"position",value:W}}function y(){return{x:C(),y:C()}}function d(W){var H=W(),M=[];if(H)for(M.push(H);G(e.comma);)H=W(),H?M.push(H):r("One extra comma");return M}function m(){var W=_();return W||r("Expected color definition"),W.length=C(),W}function _(){return x()||S()||A()||k()}function k(){return U("literal",e.literalColor,0)}function x(){return U("hex",e.hexColor,1)}function A(){return l(e.rgbColor,function(){return{type:"rgb",value:d(P)}})}function S(){return l(e.rgbaColor,function(){return{type:"rgba",value:d(P)}})}function P(){return G(e.number)[1]}function C(){return U("%",e.percentageValue,1)||R()||N()}function R(){return U("position-keyword",e.positionKeywords,1)}function N(){return U("px",e.pixelValue,1)||U("em",e.emValue,1)}function U(W,H,M){var L=G(H);if(L)return{type:W,value:L[M]}}function G(W){var H,M;return M=/^[\n\r\t\s]+/.exec(t),M&&Z(M[0].length),H=W.exec(t),H&&Z(H[0].length),H}function Z(W){t=t.substr(W)}return function(W){return t=W.toString(),n()}}();Jy.parse=Cl.parse;Jy.stringify=Cl.stringify;(function(e){var t=me&&me.__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=me&&me.__createBinding||(Object.create?function(f,h,O,w){w===void 0&&(w=O);var b=Object.getOwnPropertyDescriptor(h,O);b&&!("get"in b?!h.__esModule:b.writable||b.configurable)||(b={enumerable:!0,get:function(){return h[O]}}),Object.defineProperty(f,w,b)}:function(f,h,O,w){w===void 0&&(w=O),f[w]=h[O]}),r=me&&me.__setModuleDefault||(Object.create?function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}:function(f,h){f.default=h}),n=me&&me.__importStar||function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var O in f)O!=="default"&&Object.prototype.hasOwnProperty.call(f,O)&&t(h,f,O);return r(h,f),h},i=me&&me.__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(Ei),u=(f,h=f.fill,O="fill")=>a.default.useMemo(()=>{if(!o.isGradient(h))return{[O]:h};const{stops:w,rotation:b}=o.parseColor(h),E={x:f.a.width/2,y:f.a.height/2},p=Math.sqrt(Math.pow(E.x,2)+Math.pow(E.y,2)),v=l.default.Util.degToRad(b)-Math.PI/2,g=[];return w.forEach(({offset:y,color:d})=>{g.push(y,d)}),O==="fill"?{fillLinearGradientStartPointX:E.x-p*Math.cos(v),fillLinearGradientStartPointY:E.y-p*Math.sin(v),fillLinearGradientColorStops:g,fillLinearGradientEndPointX:E.x+p*Math.cos(v),fillLinearGradientEndPointY:E.y+p*Math.sin(v),fill:w[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:E.x-p*Math.cos(v),strokeLinearGradientStartPointY:E.y-p*Math.sin(v),strokeLinearGradientColorStops:g,strokeLinearGradientEndPointX:E.x+p*Math.cos(v),strokeLinearGradientEndPointY:E.y+p*Math.sin(v)}},[h,f.width,f.height]);e.useColor=u})(Xc);var Vi={},kl={};(function(e){var t=me&&me.__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(Ei);let i=!1;const a=(u=!i)=>{i=u};e.toggleFadeInAnimation=a;const o=()=>i;function l(u,f){const h=r.default.useRef();r.default.useLayoutEffect(()=>{h.current&&h.current.destroy()},[f]),r.default.useLayoutEffect(()=>{if(!i)return;const O=u.current.opacity();return O?(u.current.opacity(0),h.current=new n.default.Tween({node:u.current,opacity:O,onFinish:()=>{var w;(w=h.current)===null||w===void 0||w.destroy()}}),h.current.play(),()=>{var w;(w=h.current)===null||w===void 0||w.destroy()}):void 0},[])}e.isAnimationUsed=o,e.useFadeIn=l})(kl);(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=kl;let r=0,n=[],i=3e4;const a=g=>{i=g};e.setAssetLoadTimeout=a;const o=()=>i;e.getAssetLoadTimeout=o;let l=6e3;const u=g=>{l=g};e.setFontLoadTimeout=u;const f=()=>l;function h(g){r+=1;let y=!1;const d=setTimeout(()=>{y||(v(`Timeout loading asset ${g}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",g),y=!0,O())},i);return()=>{y||(clearTimeout(d),O())}}function O(){r-=1,r===0&&(n.forEach(g=>g()),n=[])}function w(g){r===0?g():n.push(g)}function b(){return new Promise(g=>w(()=>{(0,t.isAnimationUsed)()?setTimeout(g,300):g(!0)}))}e.getFontLoadTimeout=f,e.incrementLoader=h,e.decrementLoader=O,e.whenLoaded=b;let E=[];function p(g){E.push(g)}function v(g){E.forEach(y=>y(g))}e.onLoadError=p,e.triggerLoadError=v})(Vi);var eu={};(function(e){var t=me&&me.__createBinding||(Object.create?function(C,R,N,U){U===void 0&&(U=N);var G=Object.getOwnPropertyDescriptor(R,N);G&&!("get"in G?!R.__esModule:G.writable||G.configurable)||(G={enumerable:!0,get:function(){return R[N]}}),Object.defineProperty(C,U,G)}:function(C,R,N,U){U===void 0&&(U=N),C[U]=R[N]}),r=me&&me.__setModuleDefault||(Object.create?function(C,R){Object.defineProperty(C,"default",{enumerable:!0,value:R})}:function(C,R){C.default=R}),n=me&&me.__importStar||function(C){if(C&&C.__esModule)return C;var R={};if(C!=null)for(var N in C)N!=="default"&&Object.prototype.hasOwnProperty.call(C,N)&&t(R,C,N);return r(R,C),R};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(Xi),a=Vi;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(C){C!=="default"?(l.value=!0,o.splice(0,o.length),o.push(...C)):l.value=!1}function h(){return o}function O(C){e.globalFonts.push(C)}function w(C){const R=e.globalFonts.findIndex(N=>N.fontFamily===C);R!==-1&&e.globalFonts.splice(R,1)}function b(C){e.globalFonts.replace(C)}e.isGoogleFontChanged=u,e.setGoogleFonts=f,e.getFontsList=h,e.globalFonts=i.observable([]),e.addGlobalFont=O,e.removeGlobalFont=w,e.replaceGlobalFonts=b;var E="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",p=document.createElement("canvas");function v(C,R="Arial",N="normal",U="normal"){var G=p.getContext("2d");return G.font=`${N} ${U} 40px '${C}', ${R}`,G.measureText(E).width}const g={Arial:!0},y=C=>!!g[C];async function d(C,R,N){var U;if(g[C])return;const G=!!(!((U=document.fonts)===null||U===void 0)&&U.load),Z=v("Arial","Arial",R,N);if(G)try{await document.fonts.load(`16px '${C}', ${R} ${N}`);const L=v(C,"Arial",R,N);if(Z!==L)return void(g[C]=!0)}catch{}const W=v("Times","Times",R,N),H=v(C,"Arial",R,N),M=Math.min(6e3,(0,a.getFontLoadTimeout)())/60;for(let L=0;L<M;L++){const D=v(C,"Arial",R,N),B=v(C,"Times",R,N);if(D!==H||D!==Z||B!==W)return void(g[C]=!0);await new Promise(q=>setTimeout(q,60))}console.warn(`Timeout for loading font "${C}". Looks like polotno can't load it. Is it a correct font family?`),(0,a.triggerLoadError)(`Timeout for loading font "${C}"`)}e.isFontLoaded=y,e.loadFont=d;const m={};let _="400,400italic,700,700italic";function k(C){_=C}function x(){return _}function A(C){if(m[C])return;const R=`https://fonts.googleapis.com/css?family=${C.replace(/ /g,"+")}:${_}`,N=document.createElement("link");N.type="text/css",N.href=R,N.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(N),m[C]=!0}e.setGoogleFontsVariants=k,e.getGoogleFontsVariants=x,e.injectGoogleFont=A;const S={};function P(C){const R=C.fontFamily;if(S[R]||!C.url&&!C.styles)return;const N=document.createElement("style");N.type="text/css";const U=C.styles||(C.url?[{src:`url("${C.url}")`}]:[]);let G="";U.forEach(Z=>{G+=`
|
|
77
|
+
@font-face {
|
|
78
|
+
font-family: '${R}';
|
|
79
|
+
src: ${Z.src};
|
|
80
|
+
font-style: ${Z.fontStyle||"normal"};
|
|
81
|
+
font-weight: ${Z.fontWeight||"normal"};
|
|
82
|
+
}
|
|
83
|
+
`}),N.innerHTML=G,document.getElementsByTagName("head")[0].appendChild(N),S[C.fontFamily]=!0}e.injectCustomFont=P})(eu);var Xn={};(function(e){var t=me&&me.__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=me&&me.__setModuleDefault||(Object.create?function(a,o){Object.defineProperty(a,"default",{enumerable:!0,value:o})}:function(a,o){a.default=o}),n=me&&me.__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(Xi);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})})(Xn);var e2={};(function(e){function t(r=""){return(r.match(/<\/p>/gi)||[]).length>1&&(r=r.replace(/<\/p>/gi,(n,i,a)=>(a.slice(i+n.length).match(/<\/p>/gi)||[]).length>0?`
|
|
84
|
+
`:n)),r.replace(/(<([^>]+)>)/gi,"")}Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=void 0,e.removeTags=t})(e2);var Zc={};(function(e){var t=me&&me.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=void 0;const r=t(Ei);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})(Zc);var Tl={};(function(e){var t=me&&me.__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=Jn,i=Ma,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)))})(Tl);var Ao={};(function(e){var t=me&&me.__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})(Ao);var x4={},t7="warn";function r7(e){t7=e}function n7(){return t7}function uN(e){r7(e)}var pr;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(pr||(pr={}));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 Ft(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 vr=function(){return vr=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},vr.apply(this,arguments)};function cN(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 i7(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(h){return u([f,h])}}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(h){f=[6,h],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function ec(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 Ki(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 Yi(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 He(e).type}function fN(e,t){return He(e).getChildType(t)}function a7(e,t){return He(e).onPatch(t)}function dN(e,t){return He(e).onSnapshot(t)}function js(e,t){He(e).applyPatches(s2(t))}function hN(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=a7(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){js(o||e,r.patches)},undo:function(o){js(o||e,r.inversePatches.slice().reverse())}};return a.resume(),a}function pN(e){var t=He(e);if(!t.isRoot)throw new je("`protect` can only be invoked on root nodes");t.isProtectionEnabled=!0}function gN(e){var t=He(e);if(!t.isRoot)throw new je("`unprotect` can only be invoked on root nodes");t.isProtectionEnabled=!1}function vN(e){return He(e).isProtected}function o7(e,t){return He(e).applySnapshot(t)}function t2(e,t){t===void 0&&(t=!0);var r=He(e);return t?r.snapshot:r.type.getSnapshot(r,!1)}function mN(e,t){t===void 0&&(t=1);for(var r=He(e).parent;r;){if(--t===0)return!0;r=r.parent}return!1}function yN(e,t){t===void 0&&(t=1);for(var r=t,n=He(e).parent;n;){if(--r===0)return n.storedValue;n=n.parent}throw new je("Failed to find the parent of ".concat(He(e)," at depth ").concat(t))}function bN(e,t){for(var r=He(e).parent;r;){if(t.is(r.storedValue))return!0;r=r.parent}return!1}function _N(e,t){for(var r=He(e).parent;r;){if(t.is(r.storedValue))return r.storedValue;r=r.parent}throw new je("Failed to find the parent of ".concat(He(e)," of a given type"))}function l7(e){return He(e).root.storedValue}function s7(e){return He(e).path}function wN(e){return Hs(He(e).path)}function SN(e){return He(e).isRoot}function EN(e,t){var r=x7(He(e),t);return r?r.value:void 0}function ON(e,t,r){var n=He(t).root.identifierCache.resolve(e,tu(r));return n==null?void 0:n.value}function u7(e){return He(e).identifier}function PN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return;if(Tt(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 xN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return!1;if(Tt(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 c7(e,t){var r=x7(He(e),t,!1);if(r!==void 0)try{return r.value}catch{return}}function CN(e,t){return P7(He(e),He(t))}function kN(e,t){t===void 0&&(t=!0);var r=He(e);return r.type.create(r.snapshot,t===!0?r.root.environment:t===!1?void 0:t)}function TN(e){return He(e).detach(),e}function AN(e){var t=He(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function r2(e){return He(e).observableIsAlive}function RN(e,t){var r=He(e);return r.addDisposer(t),t}function MN(e){var t=He(e),r=t.root.environment;if(!r)throw new je("Failed to find the environment of ".concat(t," ").concat(t.path));return r}function LN(e){var t=He(e),r=t.root.environment;return!!r}function f7(e,t){var r=He(e);r.getChildren().forEach(function(n){Tt(n.storedValue)&&f7(n.storedValue,t)}),t(r.storedValue)}function d7(e){var t;return Tt(e)?t=Qc(e):t=e,{name:t.name,properties:vr({},t.properties)}}function NN(e){var t=He(e).type,r=vr(vr({},d7(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){D8(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):F8(e,i)?r.volatile.push(i):r.views.push(i)}}),r}function IN(e){return e}function DN(e){return e}function jN(e){return e}function FN(e){return He(e).nodeId}var h7=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:Mr.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 R7),this._hookSubscribers.register(t,r)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this._parent=t,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.pathAtom||(this.pathAtom=bc("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?fo(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!==Mr.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Mr.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=bc("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===Mr.CREATED){if(this.parent){if(this.parent.state!==Mr.FINALIZED)return;this.fireHook(pr.afterAttach)}this.state=Mr.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=Mr.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(pr.beforeDestroy)}}),e}(),Pc=function(e){Ft(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=Mr.DEAD,u}return l.state=Mr.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===Mr.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}(h7);Pc.prototype.die=ur(Pc.prototype.die);var zN=1,ui;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(ui||(ui={}));var On;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(On||(On={}));var BN={onError:function(e){throw e}},vn=function(e){Ft(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:++zN}),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:ui.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=gl(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=o,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new oI),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=tu(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===ui.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=ui.CREATING;for(var l=[],u=this.parent;u&&u._observableInstanceState===ui.UNINITIALIZED;)l.unshift(u),u=u.parent;try{for(var f=ec(l),h=f.next();!h.done;h=f.next()){var O=h.value;O.createObservableInstanceIfNeeded(!1)}}catch(p){n={error:p}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}var w=this.type;try{this.storedValue=w.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,w.finalizeNewInstance(this,this.storedValue)}catch(p){throw this.state=Mr.DEAD,p}finally{this._isRunningAction=!1}if(this._observableInstanceState=ui.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Bs,this.state=Mr.CREATED,r){this.fireHook(pr.afterCreate),this.finalizeCreation();try{for(var b=ec(l.reverse()),E=b.next();!E.done;E=b.next()){var O=E.value;O.fireHook(pr.afterCreate),O.finalizeCreation()}}catch(p){a={error:p}}finally{try{E&&!E.done&&(o=b.return)&&o.call(b)}finally{if(a)throw a.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(pr.beforeDetach);var r=this.state;this.state=Mr.DETACHING;var n=this.root,i=n.environment,a=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=r}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,a=n!==this.subpath;!i&&!a||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(pr.afterAttach)):a&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(Rs?Rs(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===ui.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=n7();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw new je(i);case"warn":bI(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&&fo(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&&s7(a.context)||n;o="".concat(l,".").concat(a.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(n,"', Subpath: '").concat(i,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===ui.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(Bs),this._autoUnbox=!1;try{return this._observableInstanceState===ui.CREATED?this.type.getChildren(this):k7(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=ec(r.getChildren()),o=a.next();!o.done;o=a.next()){var l=o.value;l.finalizeCreation()}}catch(u){n={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}r.fireInternalHook(pr.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new 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=xc(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=Hs(i.path),o=C7(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=xc(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),el(this.storedValue,"$treenode",this),el(this.storedValue,"toJSON",sI)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Mr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==ui.UNINITIALIZED&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(On.Dispose),this._internalEventsClear(On.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(On.Snapshot,r)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit(On.Snapshot,r)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister(On.Patch,r)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers(On.Patch)){var i=n.path.substr(this.path.length)+(r.path?"/"+r.path:""),a=vI({},r,{path:i}),o=Ki(PI(a),2),l=o[0],u=o[1];this._internalEventsEmit(On.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(On.Dispose,r)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister(On.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(On.Dispose,r))throw new je("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(On.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=k8(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},BN);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 R7),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,Yi([r],Ki(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}(h7);vn.prototype.createObservableInstance=ur(vn.prototype.createObservableInstance);vn.prototype.detach=ur(vn.prototype.detach);vn.prototype.die=ur(vn.prototype.die);var p7,lt;(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"})(lt||(lt={}));var g7="cannotDetermine",UN=Symbol("$type"),xa=function(){function e(t){Object.defineProperty(this,p7,{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 _a(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=O7(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}();p7=UN;xa.prototype.create=ur(xa.prototype.create);var Fs=function(e){Ft(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===tu(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||Tt(n)&&He(n)===r?!0:r.type===this&&T7(n)&&!Tt(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(),Tt(n)&&this.isAssignableFrom(Qc(n))){var l=He(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}(xa);Fs.prototype.create=ur(Fs.prototype.create);var Al=function(e){Ft(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}(xa);function mr(e){return typeof e=="object"&&e&&e.isType===!0}var Ii=new Map;function HN(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),Ii.set(r.id,{call:r,context:a,async:!1});try{var o=n(r);return e.onSuspend(r,a),Ii.get(r.id).async===!1&&(Ii.delete(r.id),e.onSuccess(r,a,o)),o}catch(u){throw Ii.delete(r.id),e.onFail(r,a,u),u}}else return n(r);case"flow_spawn":{var l=Ii.get(r.rootId);return l.async=!0,n(r)}case"flow_resume":case"flow_resume_error":{var l=Ii.get(r.rootId);e.onResume(r,l.context);try{return n(r)}finally{e.onSuspend(r,l.context)}}case"flow_throw":{var l=Ii.get(r.rootId);return Ii.delete(r.rootId),e.onFail(r,l.context,r.args[0]),n(r)}case"flow_return":{var l=Ii.get(r.rootId);return Ii.delete(r.rootId),e.onSuccess(r,l.context,r.args[0]),n(r)}}}}var $N=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 GN(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=vr(vr({},n),{env:a&&a.call.env,parentCall:a&&a.call}),l=!e.filter||e.filter(o),u=l?e:void 0,f=new $N(u,o);t.set(n.id,f);var h=void 0;try{h=i(n)}catch(w){throw t.delete(n.id),f.finish(w),w}return f.hasFlowsPending||(t.delete(n.id),f.finish()),h}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 O=n.args[0];try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish(O))}}case"flow_return":try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish())}}}}}function VN(e,t,r,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(Us(n))return n;if(Tt(n))return _d("[MSTNode: ".concat(Qc(n).name,"]"));if(typeof n=="function")return _d("[function]");if(typeof n=="object"&&!Zo(n)&&!l2(n))return _d("[object ".concat(n&&n.constructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(i){return _d(""+i)}}function qN(e,t){return t&&typeof t=="object"&&"$MST_DATE"in t?new Date(t.$MST_DATE):t}function _d(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function v7(e,t){Rs(function(){s2(t).forEach(function(r){return WN(e,r)})})}function WN(e,t){var r=c7(e,t.path||"");if(!r)throw new je("Invalid action path: ".concat(t.path||""));var n=He(r);if(t.name==="@APPLY_PATCHES")return js.call(null,r,t.args[0]);if(t.name==="@APPLY_SNAPSHOT")return o7.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 qN(n,i)}):[])}function KN(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=m7(e,n))},replay:function(o){v7(o,r)}};return a.resume(),a}function m7(e,t,r){return r===void 0&&(r=!1),_7(e,function(i,a){if(i.type==="action"&&i.id===i.rootId){var o=He(i.context),l={name:i.name,path:P7(He(e),o),args:i.args.map(function(f,h){return VN(o,i.name,h,f)})};if(r){var u=a(i);return t(l),u}else return t(l),a(i)}else return a(i)})}var YN=1,tc;function n2(){return tc}function y7(){return YN++}function ym(e,t){var r=He(e.context);e.type==="action"&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=tc;tc=e;try{return QN(r,e,t)}finally{tc=i,r._isRunningAction=n}}function b7(e){if(e)return e.type==="action"?e:e.parentActionEvent}function xc(e,t,r){var n=function(){var i=y7(),a=tc,o=b7(a);return ym({type:"action",name:t,id:i,args:M7(arguments),context:e,tree:l7(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?Yi(Yi([],Ki(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}function _7(e,t,r){r===void 0&&(r=!0);var n=He(e);return n.addMiddleWare(t,r)}function XN(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 ZN=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 QN(e,t,r){var n=new ZN(e,r);if(n.isEmpty)return ur(r).apply(null,t.args);var i=null;function a(o){var l=n.getNextMiddleware(),u=l&&l.handler;if(!u)return ur(r).apply(null,o.args);if(!l.includeHooks&&pr[o.name])return a(o);function f(O,w){i=a(O),w&&(i=w(i))}function h(O){i=O}return u(o,f,h),i}return a(t)}function i2(){for(var e=n2();e&&e.type!=="action";)e=e.parentActionEvent;return e}function w7(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 JN(e,t){return w7(e,t,!1)}function eI(e,t){return w7(e,t,!0)}function tI(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: ".concat(t,">")}}function S7(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):Tt(e)?"<".concat(e,">"):"`".concat(tI(e),"`")}function rI(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function nI(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=Tt(t)?"value of type ".concat(He(t).type.name,":"):Us(t)?"value":"snapshot",o=r&&Tt(t)&&r.is(He(t).snapshot);return"".concat(i).concat(a," ").concat(S7(t)," is not assignable ").concat(r?"to type: `".concat(r.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(r?V7(r)||Us(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 zs}function yn(e,t,r){return[{context:e,value:t,message:r}]}function Yp(e){return e.reduce(function(t,r){return t.concat(r)},[])}function _a(e,t){_I()&&E7(e,t)}function E7(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw new je(iI(e,t,r))}function iI(e,t,r){if(r.length!==0)return"Error while converting ".concat(rI(S7(t))," to `").concat(e.name,`\`:
|
|
93
|
+
|
|
94
|
+
`)+r.map(nI).join(`
|
|
95
|
+
`)}var aI=0,oI=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:aI++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Rt.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Rt.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,Rt.array([],Xp));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 z8(this.cache).forEach(function(a){for(var o=Ki(a,2),l=o[0],u=o[1],f=!1,h=u.length-1;h>=0;h--){var O=u[h];(O===t||O.path.indexOf(i)===0)&&(n.addNodeToCache(O,!1),u.splice(h,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=O7(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 Ro(e,t,r,n,i){return new Pc(e,t,r,n,i)}function lI(e){return e instanceof Pc||e instanceof vn}var Mr;(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"})(Mr||(Mr={}));function Tt(e){return!!(e&&e.$treenode)}function He(e){if(!Tt(e))throw new je("Value ".concat(e," is no MST Node"));return e.$treenode}function O7(e){return e&&e.$treenode||null}function sI(){return He(this).snapshot}var uI=function(e){return".."};function P7(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=Hs(e.path),n=Hs(t.path),i=0;i<r.length&&r[i]===n[i];i++);return r.slice(i).map(uI).join("/")+Oh(n.slice(i))}function x7(e,t,r){return r===void 0&&(r=!0),C7(e,Hs(t),r)}function C7(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 Pc){var o=n.value;Tt(o)&&(n=He(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(Oh(t.slice(0,i))||"/","' while resolving '").concat(Oh(t),"'"))}}catch(u){if(!r)return;throw u}return n}function k7(e){if(!e)return zs;var t=Object.keys(e);if(!t.length)return zs;var r=new Array(t.length);return t.forEach(function(n,i){r[i]=e[n]}),r}function cI(e){return L7(),N7(e)}var fI=Object.toString(),zs=Object.freeze([]),Bs=Object.freeze({}),Xp=v8().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Xp);var je=function(e){Ft(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 dI(e){return e}var hI=Number.isInteger;function pI(e){return Number(e)===e&&e%1!==0}function gI(e){return Number.isFinite(e)}function l2(e){return Array.isArray(e)||Jr(e)}function s2(e){return e?l2(e)?e:[e]:zs}function vI(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 Zo(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())===fI}function T7(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function Us(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function A7(e){return typeof e!="function"}function mI(e,t,r){Cr(e)?xy(e,t,r):Object.defineProperty(e,t,r)}function el(e,t,r){mI(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}var yI=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,Yi([],Ki(t),!1))})}}),e}(),R7=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 yI),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,Yi([],Ki(n),!1))}}),e}();function M7(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 L7=function(e,t){};L7.ids={};function bI(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function _I(){return typeof process<"u"&&x4&&x4.ENABLE_TYPE_CHECK==="true"}function rg(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function N7(e){return OI(e.name,e)}function wI(e){return e}function SI(e){return function(){var t,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];return i7(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,Yi([],Ki(r),!1))];case 1:return[2,n.sent()]}})}}function EI(e){return i7(this,function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent()]}})}function OI(e,t){var r=function(){var i=y7(),a=n2();if(!a)throw new je("a mst flow must always have a parent context");var o=b7(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:Yi(Yi([],Ki(a.allParentIds),!1),[a.id],!1),rootId:a.rootId,parentEvent:a,parentActionEvent:o},u=arguments;function f(h,O,w){return h.$mst_middleware=r.$mst_middleware,ym(vr(vr({},l),{type:O,args:[w]}),h)}return new Promise(function(h,O){var w,b=function(){w=t.apply(null,arguments),E(void 0)};b.$mst_middleware=r.$mst_middleware,ym(vr(vr({},l),{type:"flow_spawn",args:M7(u)}),b);function E(g){var y;try{var d=f(function(m){y=w.next(m)},"flow_resume",g);d instanceof Error&&(y=w.throw(d))}catch(m){rg(function(){f(function(_){O(m)},"flow_throw",m)});return}v(y)}function p(g){var y;try{f(function(d){y=w.throw(d)},"flow_resume_error",g)}catch(d){rg(function(){f(function(m){O(d)},"flow_throw",d)});return}v(y)}function v(g){if(g.done){rg(function(){f(function(y){h(y)},"flow_return",g.value)});return}if(!g.value||typeof g.value.then!="function")throw new je("Only promises can be yielded to `async`, got: "+g);return g.value.then(E,p)}})};return r._isFlowAction=!0,r}function PI(e){if(!("oldValue"in e))throw new je("Patches without `oldValue` field cannot be inversed");return[xI(e),CI(e)]}function xI(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 CI(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 kI(e){return typeof e=="number"}function fo(e){return kI(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function I7(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Oh(e){if(e.length===0)return"";var t=function(r){return r.map(fo).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function Hs(e){var t=e.split("/").map(I7),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"),TI=function(e){Ft(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|lt.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;AI(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)},W7(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=Tt(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,Tt(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=mr(r)?this._subtype:Tt(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 Fs))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(xa);function AI(e,t){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=ec(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 RI(e,t,r){return new TI(e,t,r)}var C4="Map.put can only be used to store complex values that have an identifier type attribute";function D7(e,t){var r,n,i=e.getSubTypes();if(i===g7)return!1;if(i){var a=s2(i);try{for(var o=ec(a),l=o.next();!l.done;l=o.next()){var u=l.value;if(!D7(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 Cc&&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 MI=function(e){Ft(t,e);function t(r,n){return e.call(this,r,Rt.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(Tt(r)){var n=He(r);if(n.identifier===null)throw new je(C4);return this.set(n.identifier,r),r}else if(T7(r)){var i=He(this),a=i.type;if(a.identifierMode!==Qa.YES)throw new je(C4);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=tu(l);return this.set(f,r),this.get(f)}else throw new je("Map.put can only be used to store complex values")}}),t}(ep),Ph=function(e){Ft(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:lt.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(D7(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 MI(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=xc(n,l,u);el(n,l,f)})}),Zh(n,this.willChange),Jh(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=He(r.object),i=r.name;n.assertWritable({subpath:i});var a=n.type,o=a._subType;switch(r.type){case"update":{var l=r.newValue,u=r.object.get(i);if(l===u)return null;_a(o,l),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":_a(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=He(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:fo(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:fo(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:fo(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){_a(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 Zo(r)?Yp(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 Bs}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(Fs);Ph.prototype.applySnapshot=ur(Ph.prototype.applySnapshot);function LI(e){return new Ph("Map<string, ".concat(e.name,">"),e)}function NI(e){return mr(e)&&(e.flags<.Map)>0}var xh=function(e){Ft(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:lt.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=vr(vr({},Xp),{name:this.name});return Rt.array(k7(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){_i(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=xc(n,l,u);el(n,l,f)})}),Zh(n,this.willChange),Jh(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=He(r.object);n.assertWritable({subpath:""+r.index});var i=n.type._subType,a=n.getChildren();switch(r.type){case"update":{if(r.newValue===r.object[r.index])return null;var o=k4(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,h=k4(n,i,a.slice(l,l+u),f,f.map(function(w,b){return l+b}));if(!h)return null;r.added=h;for(var O=l+u;O<a.length;O++)a[O].setParent(n,""+(O+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=He(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:""+r.index,value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"splice":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){_a(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)?Yp(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 zs}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(Fs);xh.prototype.applySnapshot=ur(xh.prototype.applySnapshot);function II(e){return new xh("".concat(e.name,"[]"),e)}function k4(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,h=""+i[o];if(lI(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(T4(u,f))r[o]=ig(t,e,h,f,u);else{for(var w=void 0,b=o;b<r.length;b++)if(T4(r[b],f)){w=r.splice(b,1)[0];break}a=!1;var O=ig(t,e,h,f,w);r.splice(o,0,O)}else{if(Tt(f)&&He(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(h,"', but it lives already at '").concat(He(f).path,"'"));a=!1;var O=ig(t,e,h,f);r.splice(o,0,O)}}return a?null:r}function ig(e,t,r,n,i){_a(e,n);function a(){if(Tt(n)){var l=He(n);if(l.assertAlive(Bs),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 T4(e,t){if(!e.isAlive)return!1;if(Tt(t)){var r=He(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&&Zo(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}function DI(e){return mr(e)&&(e.flags<.Array)>0}var A4="preProcessSnapshot",R4="postProcessSnapshot";function jI(){return He(this).toString()}var M4={name:"AnonymousModel",properties:{},initializers:zs};function FI(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 pr)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(Us(o))n[i]=tl(GI(o),o);else if(o instanceof Ph)n[i]=tl(o,{});else if(o instanceof xh)n[i]=tl(o,[]);else if(!mr(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},vr({},e))}var Cc=function(e){Ft(t,e);function t(r){var n=e.call(this,r.name||M4.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:lt.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,M4,r),n.properties=FI(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<.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(!Zo(n))throw new je("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===A4)throw new je("Cannot define action '".concat(A4,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===R4)throw new je("Cannot define action '".concat(R4,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var a=n[i],o=r[i];if(i in pr&&o){var l=a;a=function(){o.apply(null,arguments),l.apply(null,arguments)}}var u=a.$mst_middleware,f=a.bind(n);f._isFlowAction=a._isFlowAction||!1,f.$mst_middleware=u;var h=xc(r,i,f);n[i]=h,el(r,i,h)})}}),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(!Zo(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,h=cN(o,["actions","views","state"]);for(var O in h)throw new je("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(O,"'"));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(!Zo(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]=gl,a));else if(typeof o.value=="function")el(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=Tt(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=vr(vr({},Xp),{name:this.name});return Rt.object(r,Bs,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){el(n,"toString",jI),this.forAllProps(function(i){Ey(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),Zh(n,this.willChange),Jh(n,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=He(n.object),a=n.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(_a(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=He(n.object),a=i.type.properties[n.name];if(a){var o=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:fo(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=_i(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=Wi(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){_a(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 Zo(a)?Yp(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 Bs}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(Fs);Cc.prototype.applySnapshot=ur(Cc.prototype.applySnapshot);function zI(){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 Cc({name:r,properties:n})}function BI(){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 j7(e){return mr(e)&&(e.flags<.Object)>0}var La=function(e){Ft(t,e);function t(r,n,i,a){a===void 0&&(a=dI);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 Ro(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(Us(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}(Al),F7=new La("string",lt.String,function(e){return typeof e=="string"}),z7=new La("number",lt.Number,function(e){return typeof e=="number"}),UI=new La("integer",lt.Integer,function(e){return hI(e)}),HI=new La("float",lt.Float,function(e){return pI(e)}),$I=new La("finite",lt.Finite,function(e){return gI(e)}),B7=new La("boolean",lt.Boolean,function(e){return typeof e=="boolean"}),U7=new La("null",lt.Null,function(e){return e===null}),H7=new La("undefined",lt.Undefined,function(e){return e===void 0}),$7=new La("Date",lt.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});$7.getSnapshot=function(e){return e.storedValue.getTime()};var G7=$7;function GI(e){switch(typeof e){case"string":return F7;case"number":return z7;case"boolean":return B7;case"object":if(e instanceof Date)return G7}throw new je("Cannot determine primitive type from value "+e)}function V7(e){return mr(e)&&(e.flags&(lt.String|lt.Number|lt.Integer|lt.Boolean|lt.Date))>0}var VI=function(e){Ft(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:lt.Literal}),n.value=r,n}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Ro(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 Us(r)&&r===this.value?mn():yn(n,r,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),t}(Al);function q7(e){return new VI(e)}function qI(e){return mr(e)&&(e.flags<.Literal)>0}var WI=function(e){Ft(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|lt.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=Tt(r)?He(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}(xa);function KI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():mr(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 WI(r,n,i,a)}function YI(e){return mr(e)&&(e.flags<.Refinement)>0}function XI(e,t){var r=typeof e=="string"?t:e,n=Zp.apply(void 0,Yi([],Ki(r.map(function(i){return q7(""+i)})),!1));return typeof e=="string"&&(n.name=e),n}var ZI=function(e){Ft(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=vr({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=lt.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(Yp(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(xa);function Zp(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=mr(e)?void 0:e,i=mr(e)?Yi([e],Ki(t),!1):t,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new ZI(a,i,n)}function W7(e){return mr(e)&&(e.flags<.Union)>0}var QI=function(e){Ft(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|lt.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"&&_a(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}(xa);function JI(e,t){if(typeof t!="function"&&Tt(t))throw new je("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function tl(e,t,r){return JI(e,t),new QI(e,t,r||eD)}var eD=[void 0];function tD(e){return mr(e)&&(e.flags<.Optional)>0}var rD=tl(H7,void 0),nD=tl(U7,null);function K7(e){return Zp(e,rD)}function iD(e){return Zp(e,nD)}var aD=function(e){Ft(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)|lt.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||g7}}),t}(xa);function oD(e,t){var r=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?t:e;return new aD(r,n)}function lD(e){return mr(e)&&(e.flags<.Late)>0}function sD(e,t){return new uD(e,t)}var uD=function(e){Ft(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:lt.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Rt.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(ur(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=Ro(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):A7(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}(Al),Y7=function(e){Ft(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:lt.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 Ro(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return A7(r)?this.subType?this.subType.validate(r,n):mn():yn(n,r,"Value is not serializable and cannot be frozen")}}),t}(Al),L4=new Y7;function cD(e){return arguments.length===0?L4:mr(e)?new Y7(e):tl(L4,e)}function fD(e){return mr(e)&&(e.flags<.Frozen)>0}function dD(e){switch(e){case pr.beforeDestroy:return"destroy";case pr.beforeDetach:return"detach";default:return}}var hD=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(Tt(t)){var n=He(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=tu(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){Ft(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return t}(Error),X7=function(e){Ft(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:lt.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){js(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){j7(o.type)?this.replaceRef(void 0):js(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=He(a),l=function(h,O){var w=dD(O);w&&i.fireInvalidated(w,r,n,o)},u=o.registerHook(pr.beforeDetach,l),f=o.registerHook(pr.beforeDestroy,l);return function(){u(),f()}}}}),Object.defineProperty(t.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=this;if(this.onInvalidated){var o;r.registerHook(pr.beforeDestroy,function(){o&&o()});var l=function(u){o&&o();var f=r.parent,h=f&&f.storedValue;if(f&&f.isAlive&&h){var O=void 0;i?O=!!i.get(n,h):O=r.root.identifierCache.has(a.targetType,tu(n)),O?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===Mr.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(pr.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(pr.afterAttach,function(){l(!1)}))}}}),t}(Al),pD=function(e){Ft(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=Tt(a)?u7(a):a,l=new hD(a,this.targetType),u=Ro(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=Tt(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}(X7),gD=function(e){Ft(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=Tt(a)?this.options.set(a,r?r.storedValue:null):a,l=Ro(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=Tt(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}(X7);function Z7(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new gD(e,{get:r.get,set:r.set},n):new pD(e,n)}function vD(e){return mr(e)&&(e.flags<.Reference)>0}function mD(e,t){var r=Z7(e,vr(vr({},t),{onInvalidated:function(n){t&&t.onInvalidated&&t.onInvalidated(n),n.removeRef()}}));return t&&t.acceptsUndefined===!1?r:K7(r)}var Q7=function(e){Ft(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:lt.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 Cc))throw new je("Identifier types can only be instantiated as direct child of a model type");return Ro(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}(Al),yD=function(e){Ft(t,e);function t(){var r=e.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:lt.Identifier}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(Q7),bD=function(e){Ft(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}(Q7),_D=new yD,wD=new bD;function SD(e){return mr(e)&&(e.flags<.Identifier)>0}function tu(e){return""+e}function c2(e){return typeof e=="string"||typeof e=="number"}function ED(e){return new OD(e)}var OD=function(e){Ft(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:lt.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 Ro(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}(Al),N4={enumeration:XI,model:zI,compose:BI,custom:ED,reference:Z7,safeReference:mD,union:Zp,optional:tl,literal:q7,maybe:K7,maybeNull:iD,refinement:KI,string:F7,boolean:B7,number:z7,integer:UI,float:HI,finite:$I,Date:G7,map:LI,array:II,frozen:cD,identifier:_D,identifierNumber:wD,late:oD,lazy:sD,undefined:H7,null:U7,snapshotProcessor:RI};const PD=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:RN,addMiddleware:_7,applyAction:v7,applyPatch:js,applySnapshot:o7,cast:IN,castFlowReturn:wI,castToReferenceSnapshot:jN,castToSnapshot:DN,clone:kN,createActionTrackingMiddleware:HN,createActionTrackingMiddleware2:GN,decorate:XN,destroy:AN,detach:TN,escapeJsonPath:fo,flow:N7,getChildType:fN,getEnv:MN,getIdentifier:u7,getLivelinessChecking:n7,getMembers:NN,getNodeId:FN,getParent:yN,getParentOfType:_N,getPath:s7,getPathParts:wN,getPropertyMembers:d7,getRelativePath:CN,getRoot:l7,getRunningActionContext:i2,getSnapshot:t2,getType:Qc,hasEnv:LN,hasParent:mN,hasParentOfType:bN,isActionContextChildOf:JN,isActionContextThisOrChildOf:eI,isAlive:r2,isArrayType:DI,isFrozenType:fD,isIdentifierType:SD,isLateType:lD,isLiteralType:qI,isMapType:NI,isModelType:j7,isOptionalType:tD,isPrimitiveType:V7,isProtected:vN,isReferenceType:vD,isRefinementType:YI,isRoot:SN,isStateTreeNode:Tt,isType:mr,isUnionType:W7,isValidReference:xN,joinJsonPath:Oh,onAction:m7,onPatch:a7,onSnapshot:dN,process:cI,protect:pN,recordActions:KN,recordPatches:hN,resolveIdentifier:ON,resolvePath:EN,setLivelinessChecking:r7,setLivelynessChecking:uN,splitJsonPath:Hs,t:N4,toGenerator:EI,toGeneratorFunction:SI,tryReference:PN,tryResolve:c7,typecheck:E7,types:N4,unescapeJsonPath:I7,unprotect:gN,walk:f7},Symbol.toStringTag,{value:"Module"})),ei=yo(PD);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=me&&me.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};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=Jn,i=Ma,a=Yc,o=Xi,l=t(Ei),u=sN,f=Xc,h=Vi,O=eu,w=Xn,b=e2,E=Zc,p=kl,v=Tl,g=Ao,y=ei,d=f2;l.default._fixTextRendering=!0;const m=document.createElement("style");m.type="text/css",document.head.appendChild(m);const _={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function k(L){var D="֑-߿יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+D+"]*?["+D+"]").test(L)}function x(L){L=L.replace(/\s/g,"");let D=0;for(var B=0;B<L.length;B++)k(L[B])&&(D+=1);return D>L.length/2}function A(L){return x(L)?"rtl":"ltr"}e.isRTLText=x,e.getDir=A;const S=(0,n.observer)(({textNodeRef:L,element:D,onBlur:B,selectAll:q,cursorPosition:K})=>{const[z,$]=r.default.useState(_),F=L.current;r.default.useLayoutEffect(()=>{const re={};re.width=F.width()-2*F.padding()+"px",re.height=F.height()-2*F.padding()+F.fontSize()*F.lineHeight()+"px",re.fontSize=F.fontSize()+"px",re.lineHeight=F.lineHeight()+.01,re.fontFamily=F.fontFamily(),re.textAlign=F.align(),re.color=F.fill(),re.fontWeight=D.fontWeight,re.fontStyle=D.fontStyle,re.letterSpacing=D.letterSpacing+"em";const oe=`
|
|
96
|
+
.polotno-input::placeholder {
|
|
97
|
+
color: ${z.color};
|
|
98
|
+
opacity: 0.6;
|
|
99
|
+
}
|
|
100
|
+
`;m.innerHTML="",m.appendChild(document.createTextNode(oe)),JSON.stringify(re)!==JSON.stringify(z)&&$(re)});const Y=r.default.useRef(null);r.default.useLayoutEffect(()=>{var re;const oe=Y.current;if(!oe)return;(re=Y.current)===null||re===void 0||re.focus();const ae=K||oe.value.length;oe.selectionStart=oe.selectionEnd=ae,q&&(oe==null||oe.select(),document.execCommand("selectAll",!1,null))},[]),r.default.useEffect(()=>{window.addEventListener("blur",B);const re=oe=>{var ae;!((ae=Y.current)===null||ae===void 0)&&ae.contains(oe.target)||B()};return window.addEventListener("touchstart",re),()=>{window.removeEventListener("blur",B),window.removeEventListener("touchstart",re)}},[]);let X=0;const Q=F.textArr.length*F.lineHeight()*F.fontSize();D.verticalAlign==="middle"&&(X=(D.a.height-Q)/2),D.verticalAlign==="bottom"&&(X=D.a.height-Q);const ee=(0,b.removeTags)(D.text);return r.default.createElement("textarea",{className:"polotno-input",ref:Y,dir:A(ee),style:Object.assign(Object.assign(Object.assign({},_),z),{paddingTop:X+"px"}),value:ee,onChange:re=>{const oe=(0,d.getLimitedFontSize)({oldText:D.text,newText:re.target.value,element:D});D.set({text:re.target.value,fontSize:oe})},placeholder:D.placeholder,onBlur:B})}),P=L=>r.default.createElement(a.Html,null,r.default.createElement(S,Object.assign({},L))),C=L=>{const[D,B]=r.default.useState(!1),q=r.default.useRef(!1);return r.default.useEffect(()=>{var K=!0;return setTimeout(()=>{K&&(L._editModeEnabled&&(q.current=!0),B(!0),setTimeout(()=>{q.current=!1},50))},50),()=>{K=!1}},[]),{editorEnabled:D&&L._editModeEnabled,selectAll:q.current}},R=(L,D)=>{const[B,q]=r.default.useReducer(z=>z+1,0),K=r.default.useRef((0,O.isFontLoaded)(D));return r.default.useLayoutEffect(()=>{if(K.current=(0,O.isFontLoaded)(D),K.current)return;let z=!0;return(async()=>{K.current=!1,q();const $=(0,h.incrementLoader)(`text ${D}`);await L.loadFont(D),setTimeout($,100),z&&(K.current=!0,q())})(),()=>{z=!1}},[D]),[K.current]};e.useFontLoader=R;const N=({fontLoaded:L,fontFamily:D,fontSize:B,lineHeight:q})=>r.default.useMemo(()=>{if(typeof q=="number")return q;const K=document.createElement("div");K.style.fontFamily=D,K.style.fontSize=B+"px",K.style.lineHeight=q,K.innerText="Test text",document.body.appendChild(K);const z=K.offsetHeight;return document.body.removeChild(K),z/B},[L,D,B,q]);function U(L){var D=L.getAbsoluteTransform().copy();D.invert();var B=L.getStage().getPointerPosition();return D.point(B)}function G(L){var D;const B=L.target,q=U(B),K=B.textArr,z=Math.floor(q.y/(B.fontSize()*B.lineHeight())),$=K.slice(0,z).reduce((X,Q)=>X+Q.text.length,z),F=(D=K[z])!==null&&D!==void 0?D:K[0];let Y=0;return B.align()==="right"?Y=B.width()-F.width:B.align()==="center"&&(Y=B.width()/2-F.width/2),$+Math.round((q.x-Y)/F.width*F.text.length)}function Z(L){const D=r.default.useRef(L),B=r.default.useRef(L);return r.default.useMemo(()=>{B.current=D.current,D.current=L},[L]),B.current}function W(L){return/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(L)}function H(L,D){const B=L.fontSize(),q=L.height(),K=(0,b.removeTags)(D.text);let z=D.a.fontSize;L.height(void 0);const $=Math.round(2*D.a.fontSize)-1;for(let F=1;F<$;F++){const Y=D.a.height&&L.height()>D.a.height;let X=K.split(`
|
|
101
|
+
`).join(" ").split(/[\s-]+/).reduce((re,oe)=>W(oe)?re.concat(oe.split("")):re.concat(oe),[]),Q=L.textArr.map(re=>re.text).join(";");const ee=X.find(re=>!Q.includes(re)||(Q=Q.replace(re,""),!1));if(!(Y||ee))break;z-=.5,L.fontSize(z)}return L.fontSize(B),L.height(q),z}function M({lines:L,lineHeight:D,width:B,align:q="left",padding:K=0,cornerRadius:z=0}){var $;L.forEach((Q,ee)=>{Q.cx=B/2,q==="right"?Q.cx=B-Q.width/2:q==="left"&&(Q.cx=Q.width/2),q!=="justify"||Q.lastInParagraph||(Q.width=B),q==="justify"&&(Q.cx=Q.width/2)});let F=`M ${($=L[0])===null||$===void 0?void 0:$.cx} ${-K}`;L.forEach((Q,ee)=>{const{cx:re}=Q,oe=L[ee-1];oe&&oe.width>Q.width?F+=` L ${re+Q.width/2+K} ${ee*D+K}`:F+=` L ${re+Q.width/2+K} ${ee*D-K}`;const ae=L[ee+1];ae&&ae.width>Q.width?F+=` L ${re+Q.width/2+K} ${(ee+1)*D-K}`:F+=` L ${re+Q.width/2+K} ${(ee+1)*D+K}`});for(var Y=L.length-1;Y>=0;Y--){const Q=L[Y],{cx:ee}=Q,re=L[Y+1];re&&re.width>Q.width?F+=` L ${ee-Q.width/2-K} ${(Y+1)*D-K}`:F+=` L ${ee-Q.width/2-K} ${(Y+1)*D+K}`;const oe=L[Y-1];oe&&oe.width>Q.width?F+=` L ${ee-Q.width/2-K} ${Y*D+K}`:F+=` L ${ee-Q.width/2-K} ${Y*D-K}`}F+=" Z";const X=(0,u.parsePath)(F);return(0,u.roundCommands)(X,z).path}e.getLineHeight=N,e.usePrevious=Z,e.TextElement=(0,n.observer)(({element:L,store:D})=>{const B=r.default.useRef(null),q=r.default.useRef(null),{editorEnabled:K,selectAll:z}=C(L),[$,F]=r.default.useState(!1),[Y,X]=r.default.useState(!1),Q=r.default.useRef(L.a.height),ee=D.selectedShapes.indexOf(L)>=0,{textVerticalResizeEnabled:re}=w.flags,oe=Z(L.fontFamily),[ae,ie]=r.default.useState([]);r.default.useEffect(()=>{var Ce,Oe;const Fe=(Oe=(Ce=B.current)===null||Ce===void 0?void 0:Ce.textArr)!==null&&Oe!==void 0?Oe:[];JSON.stringify(Fe)!==JSON.stringify(ae)&&ie(Fe)}),r.default.useEffect(()=>{if(L.a.width)return;const Ce=B.current;Ce.width(600),L.set({width:1.4*Ce.getTextWidth()})},[]),r.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const Ce=B.current;(0,E.applyFilter)(Ce,L)}));const[Re]=(0,e.useFontLoader)(D,L.fontFamily),Me=(0,b.removeTags)(L.text),ne=()=>{const Ce=B.current.clone({height:void 0}),Oe=Math.ceil(Ce.fontSize()*Ce.lineHeight()*Ce.textArr.length+1);return Ce.destroy(),Oe};r.default.useLayoutEffect(()=>{if(!Re)return;const{textOverflow:Ce}=w.flags;if(L.a.height)if(Ce!=="change-font-size"||Y||D.isPlaying){if(Ce==="resize"){const Oe=ne();re&&L.a.height<Oe&&D.history.ignore(()=>{var Fe;(0,y.isAlive)(L)&&L.set({height:Oe}),(Fe=B.current)===null||Fe===void 0||Fe.height(Oe)},!1,!0),re||L.a.height===Oe||D.history.ignore(()=>{var Fe;(0,y.isAlive)(L)&&L.set({height:Oe}),(Fe=B.current)===null||Fe===void 0||Fe.height(Oe)},!1,!0)}}else{const Oe=H(B.current,L);if(Oe!==L.a.fontSize)return void D.history.ignore(()=>{L.set({fontSize:Oe})},!1,!0);const Fe=ne();L.a.height===Fe||re||D.history.ignore(()=>{L.set({height:Fe})},!1,!0)}else{const Oe=ne();D.history.ignore(()=>{L.set({height:Oe})},!1,!0)}}),r.default.useLayoutEffect(()=>{const Ce=B.current;Ce&&(Ce.width(Ce.width()+1e-8),Ce._setTextData(),(0,E.applyFilter)(Ce,L))},[Re]);const le=r.default.useRef(null),be=r.default.useRef(0),ye=Ce=>{Ce.evt.preventDefault(),D.selectedShapes.find(Fe=>Fe===L)&&L.contentEditable&&(be.current=G(Ce),L.toggleEditMode())},te=!Me&&L.placeholder?.6:L.a.opacity;(0,p.useFadeIn)(B,te);const de=(0,e.getLineHeight)({fontLoaded:Re,fontFamily:L.fontFamily,fontSize:L.a.fontSize,lineHeight:L.lineHeight}),he=L.selectable||D.role==="admin",Se=(0,f.useColor)(L),$e=r.default.useMemo(()=>L.backgroundEnabled?M({lines:JSON.parse(JSON.stringify(ae)),cornerRadius:L.backgroundCornerRadius*(L.a.fontSize*de*.5),lineHeight:de*L.a.fontSize,padding:L.backgroundPadding*(L.a.fontSize*de*.5),width:L.a.width,align:L.align}):"",[L.backgroundEnabled,L.backgroundCornerRadius,L.a.fontSize,de,L.backgroundPadding,L.a.width,L.align,ae]),tt=(0,g.isTouchDevice)();let Ae=0;return L.verticalAlign==="middle"?Ae=(L.a.height-ae.length*de*L.a.fontSize)/2:L.verticalAlign==="bottom"&&(Ae=L.a.height-ae.length*de*L.a.fontSize),r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Path,{ref:q,x:L.a.x,y:L.a.y,rotation:L.a.rotation,hideInExport:!L.showInExport,listening:!1,visible:L.backgroundEnabled,opacity:L.backgroundOpacity*te,data:$e,fill:L.backgroundColor,offsetY:-Ae}),r.default.createElement(i.Text,Object.assign({ref:B,id:L.id,name:"element",hideInExport:!L.showInExport,editModeEnabled:L._editModeEnabled,x:L.a.x,y:L.a.y,rotation:L.a.rotation,width:L.a.width,height:L.a.height,text:Me||L.placeholder},Se,{stroke:L.stroke,lineJoin:"round",strokeWidth:L.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:L.a.fontSize,fontFamily:`"${L.fontFamily}", "${oe}"`,fontStyle:L.fontStyle+" "+L.fontWeight,textDecoration:L.textDecoration,align:L.align,verticalAlign:L.verticalAlign,draggable:tt?L.draggable&&ee:L.draggable,preventDefault:!tt||ee,opacity:te,visible:!L._editModeEnabled,ellipsis:w.flags.textOverflow==="ellipsis",shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur,shadowOffsetX:L.shadowOffsetX,shadowOffsetY:L.shadowOffsetY,shadowColor:L.shadowColor,shadowOpacity:L.shadowOpacity,lineHeight:de,letterSpacing:L.letterSpacing*L.a.fontSize,listening:he,onDragMove:Ce=>{L.set({x:Ce.target.x(),y:Ce.target.y()})},onDragEnd:Ce=>{L.set({x:Ce.target.x(),y:Ce.target.y()})},onMouseEnter:()=>{F(!0)},onMouseLeave:()=>{F(!1)},onClick:ye,onTap:ye,onTransformStart:()=>{X(!0),Q.current=B.current.height()},onTransform:Ce=>{var Oe,Fe;const Qe=Ce.target;(Oe=q.current)===null||Oe===void 0||Oe.setAttrs({x:Qe.x(),y:Qe.y(),rotation:Qe.rotation(),scale:Qe.scale()});const se=((Fe=Qe.getStage())===null||Fe===void 0?void 0:Fe.findOne("Transformer")).getActiveAnchor();if(se==="middle-left"||se==="middle-right"){const fe=Qe.scaleX(),Ze=Qe.width()*fe,Je=L.a.fontSize;let _e=Ze;Ze<Je&&(_e=Je,le.current&&Qe.position(le.current)),Qe.width(_e),Qe.scaleX(1),Qe.scaleY(1);const xe=ne();if(w.flags.textOverflow!=="ellipsis"){const qe=Math.max(xe,Q.current);Qe.height(qe),L.set({height:Qe.height()})}L.set({x:Qe.x(),y:Qe.y(),width:Qe.width(),rotation:Qe.rotation()}),(0,E.applyFilter)(Qe,L)}if(se==="top-center"||se==="bottom-center"){let fe=w.flags.textOverflow==="resize"?ne():de*L.a.fontSize;Ce.target.height(Math.max(fe,Ce.target.height()*Ce.target.scaleY())),Ce.target.scaleY(1)}le.current=Ce.target.position()},onTransformEnd:Ce=>{var Oe;const Fe=Ce.target.scaleX();Ce.target.scaleX(1),Ce.target.scaleY(1),L.set({fontSize:Math.round(L.a.fontSize*Fe),width:Math.ceil(Ce.target.width()*Fe),x:Ce.target.x(),y:Ce.target.y(),rotation:Ce.target.rotation(),height:Ce.target.height()*Fe,shadowBlur:L.shadowBlur*Fe,shadowOffsetX:L.shadowOffsetX*Fe,shadowOffsetY:L.shadowOffsetY*Fe,strokeWidth:L.strokeWidth*Fe}),(Oe=q.current)===null||Oe===void 0||Oe.setAttrs({scaleX:1,scaleY:1}),X(!1)}})),K&&r.default.createElement(i.Group,{x:L.a.x,y:L.a.y,rotation:L.a.rotation},r.default.createElement(P,{textNodeRef:B,element:L,selectAll:z,cursorPosition:be.current,onBlur:()=>{L.toggleEditMode(!1)}})),!Y&&($||ee)&&r.default.createElement(v.Highlighter,{element:L}))})})(Zy);var d2={},ru={},J7={exports:{}},eS={exports:{}};(function(e,t){e.exports=r;function r(i){return n.bind(null,i)}function n(i){var a=[].slice.call(arguments,1);a.unshift("["+i+"]"),process.stderr.write(a.join(" ")+`
|
|
102
|
+
`)}})(eS);var h2=eS.exports;(function(e,t){h2("lex"),e.exports=r;function r(n){var i="",a,o=0,l=-1,u=0,f=1,h="before-selector",O=[h],w={},b=[],E=["media","keyframes",{name:"-webkit-keyframes",type:"keyframes",prefix:"-webkit-"},{name:"-moz-keyframes",type:"keyframes",prefix:"-moz-"},{name:"-ms-keyframes",type:"keyframes",prefix:"-ms-"},{name:"-o-keyframes",type:"keyframes",prefix:"-o-"},"font-face",{name:"import",state:"before-at-value"},{name:"charset",state:"before-at-value"},"supports","viewport",{name:"namespace",state:"before-at-value"},"document",{name:"-moz-document",type:"document",prefix:"-moz-"},"page"];function p(){return A(),n[l]}function v(W){return W?O[O.length-1-W]:h}function g(W){var H=l+1;return W===n.slice(H,H+W.length)}function y(W){var H=n.slice(l).indexOf(W);return H>0?H:!1}function d(W){return W===m(1)}function m(W){return n[l+(W||1)]}function _(){var W=O.pop();return h=O[O.length-1],W}function k(W){return h=W,O.push(h),O.length}function x(W){var H=h;return O[O.length-1]=h=W,H}function A(W){if((W||1)==1)n[l]==`
|
|
103
|
+
`?(f++,o=1):o++,l++;else{var H=n.slice(l,l+W).split(`
|
|
104
|
+
`);H.length>1&&(f+=H.length-1,o=1),o+=H[H.length-1].length,l=l+W}}function S(){w.end={line:f,col:o},b.push(w),i="",w={}}function P(W){w={type:W,start:{line:f,col:o}}}for(;a=p();)switch(a){case" ":switch(v()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":i+=a;break}break;case`
|
|
105
|
+
`:case" ":case"\r":case"\f":switch(v()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":i+=a;break;case"at-value":a===`
|
|
106
|
+
`&&(w.value=i.trim(),S(),_());break}break;case":":switch(v()){case"name":w.name=i.trim(),i="",x("before-value");break;case"before-selector":i+=a,P("selector"),k("selector");break;case"before-value":x("value"),i+=a;break;default:i+=a;break}break;case";":switch(v()){case"name":case"before-value":case"value":i.trim().length>0&&(w.value=i.trim(),S()),x("before-name");break;case"value-paren":i+=a;break;case"at-value":w.value=i.trim(),S(),_();break;case"before-name":break;default:i+=a;break}break;case"{":switch(v()){case"selector":if(m(-1)==="\\"){i+=a;break}w.text=i.trim(),S(),x("before-name"),u=u+1;break;case"at-group":switch(w.name=i.trim(),w.type){case"font-face":case"viewport":case"page":k("before-name");break;default:k("before-selector")}S(),u=u+1;break;case"name":case"at-rule":w.name=i.trim(),S(),k("before-name"),u=u+1;break;case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":x("value"),i+=a;break}break;case"}":switch(v()){case"before-name":case"name":case"before-value":case"value":i&&(w.value=i.trim()),w.name&&w.value&&S(),P("end"),S(),_(),v()==="at-group"&&(P("at-group-end"),S(),_()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(m(-1)==="\\"){i+=a;break}u>0&&v(1)==="at-group"&&(P("at-group-end"),S()),u>1&&_(),u>0&&(u=u-1);break;case"double-string":case"single-string":case"comment":i+=a;break}break;case'"':case"'":switch(v()){case"double-string":a==='"'&&m(-1)!=="\\"&&_();break;case"single-string":a==="'"&&m(-1)!=="\\"&&_();break;case"before-at-value":x("at-value"),k(a==='"'?"double-string":"single-string");break;case"before-value":x("value"),k(a==='"'?"double-string":"single-string");break;case"comment":break;default:m(-1)!=="\\"&&k(a==='"'?"double-string":"single-string")}i+=a;break;case"/":switch(v()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":case"selector":case"name":case"value":if(d("*")){var C=y("*/");C&&A(C+1)}else v()=="before-value"&&x("value"),i+=a;break;default:d("*")?(P("comment"),k("comment"),A()):i+=a;break}break;case"*":switch(v()){case"comment":d("/")?(w.text=i,A(),S(),_()):i+=a;break;case"before-selector":i+=a,P("selector"),k("selector");break;case"before-value":x("value"),i+=a;break;default:i+=a}break;case"@":switch(v()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":x("value"),i+=a;break;default:for(var R=!1,N,U,G=0,Z=E.length;!R&&G<Z;++G)U=E[G],N=U.name||U,g(N)&&(R=!0,P(N),k(U.state||"at-group"),A(N.length),U.prefix&&(w.prefix=U.prefix),U.type&&(w.type=U.type));R||(i+=a);break}break;case"(":switch(v()){case"value":k("value-paren");break;case"before-value":x("value");break}i+=a;break;case")":switch(v()){case"value-paren":_();break;case"before-value":x("value");break}i+=a;break;default:switch(v()){case"before-selector":P("selector"),k("selector");break;case"before-name":P("property"),x("name");break;case"before-value":x("value");break;case"before-at-value":x("at-value");break}i+=a;break}return b}})(J7);var tS=J7.exports,rS={exports:{}};(function(e,t){h2("parse");var r=tS;e.exports=l;var n,i,a,o;function l(_,k){k||(k={}),n=!!k.comments,a=!!k.position,i=0,o=Array.isArray(_)?_.slice():r(_);for(var x,A=[],S;S=f();)x=g(S),x&&A.push(x);return{type:"stylesheet",stylesheet:{rules:A}}}function u(_,k){k||(k={});for(var x,A=["type","name","value"],S={},P=0;P<A.length;++P)x=A[P],_[x]&&(S[x]=k[x]||_[x]);for(A=Object.keys(k),P=0;P<A.length;++P)x=A[P],S[x]||(S[x]=k[x]);return a&&(S.position={start:_.start,end:_.end}),S}function f(){var _=o.shift();return _}function h(_){i=i+1;var k={};switch(_.type){case"font-face":case"viewport":k.declarations=d();break;case"page":k.prefix=_.prefix,k.declarations=d();break;default:k.prefix=_.prefix,k.rules=m()}return u(_,k)}function O(_){return u(_)}function w(_){return u(_)}function b(_){return u(_,{text:_.text})}function E(_){return u(_)}function p(_){return u(_)}function v(_){function k(x){return x.trim()}return u(_,{type:"rule",selectors:_.text.split(",").map(k),declarations:d()})}function g(_){switch(_.type){case"property":return p(_);case"selector":return v(_);case"at-group-end":i=i-1;return;case"media":case"keyframes":return h(_);case"comment":if(n)return b(_);break;case"charset":return w(_);case"import":return O(_);case"namespace":return E(_);case"font-face":case"supports":case"viewport":case"document":case"page":return h(_)}}function y(_){for(var k,x=[],A;(A=f())&&_&&_(A);)k=g(A),k&&x.push(k);return A&&A.type!=="end"&&o.unshift(A),x}function d(){return y(function(_){return _.type==="property"||_.type==="comment"})}function m(){return y(function(){return i})}})(rS);var xD=rS.exports,nS={exports:{}};(function(e,t){h2("stringify");var r,n,i,a,o,l;e.exports=u;function u(m,_){_||(_={}),i=_.indentation||"",n=!!_.compress,r=!!_.comments,a=1,n?o=l="":(o=`
|
|
107
|
+
`,l=" ");var k=E(m.stylesheet.rules,y).join(`
|
|
108
|
+
`).trim();return k}function f(m){if(m){a+=m;return}return n?"":Array(a).join(i||"")}function h(m){return"@"+m.type+" "+m.value+";"+o}function O(m){var _="",k=m.prefix||"";m.name&&(_=" "+m.name);var x=m.type!=="page";return"@"+k+m.type+_+l+p(m,x)+o}function w(m){return r?"/*"+(m.text||"")+"*/"+o:""}function b(m){var _;return m.selectors?_=m.selectors.join(","+o):(_="@"+m.type,_+=m.name?" "+m.name:""),f()+_+l+p(m)+o}function E(m,_){return m.reduce(function(k,x){var A=x.type==="comment"?w(x):_(x);return A&&k.push(A),k},[])}function p(m,_){var k=m.declarations,x=g;return m.rules&&(k=m.rules,x=b),k=v(k,x),k&&(k=o+k+(_?"":o)),"{"+k+f()+"}"}function v(m,_){if(!m)return"";f(1);var k=E(m,_);return f(-1),k.length?k.join(o):""}function g(m){if(m.type==="property")return d(m)}function y(m){switch(m.type){case"rule":return b(m);case"media":case"keyframes":return O(m);case"comment":return w(m);case"import":case"charset":case"namespace":return h(m);case"font-face":case"supports":case"viewport":case"document":case"page":return O(m)}}function d(m){var _=m.name?m.name+":"+l:"";return f()+_+m.value+";"}})(nS);var CD=nS.exports,kD={lex:tS,parse:xD,stringify:CD};(function(e){var t=me&&me.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};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(Ei),n=t(et),i=Qy,a=t(kD);function o(_){for(;_.parentNode;){if(_.nodeName==="defs")return!0;_=_.parentNode}return!1}function l(_){const k={};return _.querySelectorAll("style").forEach(x=>{const A=a.default.parse(x.textContent).stylesheet.rules;for(let S of A)S.selectors&&S.selectors.forEach(P=>{const C=k[P]||{};S.declarations.forEach(R=>{C[R.name]=R.value}),k[P]=C})}),k}function u(_,k){var x;const A={fill:"",stroke:""},S=((x=_.getAttribute("class"))===null||x===void 0?void 0:x.split(" "))||[],P=_.getAttribute("id");let C={};if(P&&k[`#${P}`]?C=k[`#${P}`]:S.forEach(R=>{k[`.${R}`]&&(C=Object.assign(Object.assign({},C),k[`.${R}`]))}),k[_.nodeName]&&(C=Object.assign(Object.assign({},C),k[_.nodeName])),_.getAttribute("fill")&&_.getAttribute("fill")!=="none"?A.fill=_.getAttribute("fill"):C.fill&&C.fill!=="none"&&(A.fill=C.fill),_.getAttribute("stroke")&&_.getAttribute("stroke")!=="none"?A.stroke=_.getAttribute("stroke"):C.stroke&&C.stroke!=="none"&&(A.stroke=C.stroke),!A.fill&&_.style.fill&&_.style.fill!=="none"&&(A.fill=_.style.fill),!A.stroke&&_.style.stroke&&_.style.stroke!=="none"&&(A.stroke=_.style.stroke),!A.stroke&&!A.fill){const R=_.ownerSVGElement,N=R&&R!==_&&u(R,k);(N==null?void 0:N.fill)==="currentColor"||(N==null?void 0:N.stroke)==="currentColor"||(A.fill="black")}return A}const f=["path","rect","circle","line","polygon","polyline","ellipse","text"];function h(_){for(var k=[],x=_.getElementsByTagName("*"),A=0,S=x.length;A<S;A++){const P=x[A];o(P)||(P.getAttribute("fill")!==null&&k.push(P),(P.getAttribute("stroke")!==null||P.style&&P.style.fill||f.indexOf(P.nodeName)>=0)&&k.push(P))}return k}async function O(_){const k=await fetch(_);return E(await k.text())}async function w(_){return await(await fetch(_,{mode:"cors"})).text()}function b(_){var k=new DOMParser().parseFromString(_,"image/svg+xml");const x=l(k),A=h(k),S=[];return A.forEach(P=>{const{fill:C,stroke:R}=u(P,x);[C,R].forEach(N=>{N&&(N==="currentColor"&&(N="black"),r.default.Util.colorToRGBA(N)&&S.indexOf(N)===-1&&S.push(N))})}),S}function E(_){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(_)))}async function p(_){const k=await w(_),x=new DOMParser().parseFromString(k,"image/svg+xml").documentElement.getAttribute("viewBox"),[A,S,P,C]=(x==null?void 0:x.split(" "))||[];return{width:parseFloat(P),height:parseFloat(C)}}function v(_){var k=new DOMParser().parseFromString(_,"image/svg+xml");const x=k.documentElement.getAttribute("viewBox"),[A,S,P,C]=(x==null?void 0:x.split(" "))||[],R=k.documentElement.getAttribute("width");!R&&k.documentElement.setAttribute("width",P+"px");const N=k.documentElement.getAttribute("height");if((!N||N.indexOf("%")>=0)&&k.documentElement.setAttribute("height",C+"px"),R&&R.indexOf("%")>=0&&N&&N.indexOf("%")===-1){const U=parseFloat(N)/parseFloat(C);k.documentElement.setAttribute("width",U*parseFloat(P)+"px")}if(N&&N.indexOf("%")>=0&&R&&R.indexOf("%")===-1){const U=parseFloat(R)/parseFloat(P);k.documentElement.setAttribute("height",U*parseFloat(C)+"px")}return R==="100%"&&N==="100%"&&(k.documentElement.setAttribute("width",P+"px"),k.documentElement.setAttribute("height",C+"px")),new XMLSerializer().serializeToString(k)}e.urlToBase64=O,e.urlToString=w,e.getColors=b,e.svgToURL=E,e.getSvgSize=p,e.fixSize=v;const g=(_,k)=>{if(!_||!k)return!1;if(k==="currentColor"&&_==="black")return!0;const x=r.default.Util.colorToRGBA(_),A=r.default.Util.colorToRGBA(k);return x&&A?x.r===A.r&&x.g===A.g&&x.b===A.b&&x.a===A.a:void 0};function y(_,k,x,A){var S=_.namespaceURI,P=document.createElementNS(S,"linearGradient");const C=r.default.Util.degToRad(x+90),R=(Math.cos(C)+1)/2,N=(Math.sin(C)+1)/2,U=(Math.cos(C+Math.PI)+1)/2,G=(Math.sin(C+Math.PI)+1)/2;P.setAttribute("x1",100*R+"%"),P.setAttribute("y1",100*N+"%"),P.setAttribute("x2",100*U+"%"),P.setAttribute("y2",100*G+"%"),P.setAttribute("gradientUnits","userSpaceOnUse"),P.setAttribute("id",k);for(var Z=0;Z<A.length;Z++){var W=A[Z],H=document.createElementNS(S,"stop");for(var M in W)W.hasOwnProperty(M)&&H.setAttribute(M,W[M]);P.appendChild(H)}return(_.querySelector("defs")||_.insertBefore(document.createElementNS(S,"defs"),_.firstChild)).appendChild(P)}function d(_,k){var x=new DOMParser().parseFromString(_,"image/svg+xml");const A=h(x),S=Array.from(k.keys()),P=l(x);return A.forEach(C=>{const{fill:R,stroke:N}=u(C,P);[{prop:"fill",color:R},{prop:"stroke",color:N}].forEach(({prop:U,color:G})=>{const Z=S.find(W=>(0,e.sameColors)(W,G));if(Z){const W=k.get(Z);if((0,i.isGradient)(W)){const{rotation:H,stops:M}=(0,i.parseColor)(W),L=M.map(B=>({offset:100*B.offset+"%","stop-color":B.color})),D="color"+Math.round(1e8*Math.random());y(x.children[0],D,H,L),C.style[U]=null,C.setAttribute(U,`url('#${D}')`)}else C.style[U]=k.get(Z)}})}),E(new XMLSerializer().serializeToString(x))}e.sameColors=g,e.replaceColors=d;const m=_=>{const[k,x]=n.default.useState([]);return n.default.useEffect(()=>{let A=!1;return(async()=>{x([]);const S=b(await w(_));A||x(S)})(),()=>{A=!0}},[_]),k};e.useSvgColors=m})(ru);var p2={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.trySetCanvasSize=void 0;const t=(r,n,i)=>{let a=n,o=i,l=1;for(;a>0&&o>0;){r.width=a,r.height=o;const u=r.getContext("2d");if(!u)return;if(u.fillStyle="rgba(0,0,0,0.1)",u.fillRect(0,0,1,1),u.getImageData(0,0,1,1).data[3]!==0)return void u.clearRect(0,0,r.width,r.height);if(l*=.9,a=Math.floor(n*l),o=Math.floor(i*l),a=Math.max(a,1),o=Math.max(o,1),a<=1&&o<=1)return r.width=1,void(r.height=1)}};e.trySetCanvasSize=t})(p2);(function(e){var t=me&&me.__createBinding||(Object.create?function(z,$,F,Y){Y===void 0&&(Y=F);var X=Object.getOwnPropertyDescriptor($,F);X&&!("get"in X?!$.__esModule:X.writable||X.configurable)||(X={enumerable:!0,get:function(){return $[F]}}),Object.defineProperty(z,Y,X)}:function(z,$,F,Y){Y===void 0&&(Y=F),z[Y]=$[F]}),r=me&&me.__setModuleDefault||(Object.create?function(z,$){Object.defineProperty(z,"default",{enumerable:!0,value:$})}:function(z,$){z.default=$}),n=me&&me.__importStar||function(z){if(z&&z.__esModule)return z;var $={};if(z!=null)for(var F in z)F!=="default"&&Object.prototype.hasOwnProperty.call(z,F)&&t($,z,F);return r($,z),$},i=me&&me.__importDefault||function(z){return z&&z.__esModule?z:{default:z}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(et),o=Jn,l=Xi,u=Ma,f=i(Kp),h=i(Ei),O=Yc,w=Tl,b=Vi,E=n(ru),p=Xn,v=p2,g=Zc,y=kl,d=Ao;function m(){return document.createElement("canvas")}async function _(z){if(!(z.indexOf("data:image/svg+xml")>=0||z.indexOf(".svg")>=0))return z;const $=await E.urlToString(z),F=E.fixSize($);return E.svgToURL(F)}const k=z=>{const[$,F]=a.default.useState(z);return a.default.useEffect(()=>{(async()=>{const Y=await _(z);Y!==$&&F(Y)})()},[z]),$};function x(z,$){return Math.sqrt(Math.pow($.x-z.x,2)+Math.pow($.y-z.y,2))}function A(z,$){return{x:(z.x+$.x)/2,y:(z.y+$.y)/2}}const S=(z,$,F)=>{const Y=a.default.useMemo(()=>{var X,Q;const{flipX:ee,flipY:re}=z,oe=z.type==="svg"||z.src.indexOf("data:image/svg+xml")>=0||z.src.indexOf(".svg")>=0,ae=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,ie=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||ae)&&oe||z.maskSrc;if(!ee&&!re&&!ie)return $;if(!$||!$.width||!$.height)return null;const Re=m();let Me=1;z.type==="svg"&&(Me=Math.max(z.a.width/$.width*F,z.a.height/$.height*F)),(0,v.trySetCanvasSize)(Re,Math.max($.width*Me,1),Math.max($.height*Me,1));let ne=ee?-Re.width:0,le=re?-Re.height:0;return(X=Re.getContext("2d"))===null||X===void 0||X.scale(ee?-1:1,re?-1:1),(Q=Re.getContext("2d"))===null||Q===void 0||Q.drawImage($,ne,le,Re.width,Re.height),Re},[z.maskSrc,z.flipX,z.flipY,$,z.a.width,z.a.height,F]);return a.default.useEffect(()=>()=>{Y&&Y.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(Y)},[Y]),Y};function P(z,$){const F=$.width/$.height;let Y,X;return F>=z.width/z.height?(Y=z.width,X=z.width/F):(Y=z.height*F,X=z.height),{x:(z.width-Y)/2,y:(z.height-X)/2,width:Y,height:X}}function C(z,$,F,Y,X,Q,ee){for(var re=new ImageData($,F),oe=new Int32Array(z.data.buffer),ae=z.width,ie=new Int32Array(re.data.buffer),Re=re.width,Me=$/Q,ne=F/ee,le=Math.round(1/Me),be=Math.round(1/ne),ye=le*be,te=0;te<re.height;te++)for(var de=0;de<Re;de++){for(var he=Y+Math.round(de/Me)+(X+Math.round(te/ne))*ae,Se=0,$e=0,tt=0,Ae=0,Ce=0;Ce<be;Ce++)for(var Oe=0;Oe<le;Oe++){var Fe=oe[he+Oe+Ce*ae];Se+=Fe<<24>>>24,$e+=Fe<<16>>>24,tt+=Fe<<8>>>24,Ae+=Fe>>>24}Se=Math.round(Se/ye),$e=Math.round($e/ye),tt=Math.round(tt/ye),Ae=Math.round(Ae/ye),ie[de+te*Re]=Ae<<24|tt<<16|$e<<8|Se}return re}function R(z,$){var F,Y;const X=m();X.width=z.width,X.height=z.height;const Q=Math.max(1,Math.floor(X.width*$)),ee=Math.max(1,Math.floor(X.height*$));(F=X.getContext("2d"))===null||F===void 0||F.drawImage(z,0,0,X.width,X.height);const re=C(X.getContext("2d").getImageData(0,0,X.width,X.height),Q,ee,0,0,X.width,X.height);return X.width=Q,X.height=ee,(Y=X.getContext("2d"))===null||Y===void 0||Y.putImageData(re,0,0),X}const N=(z,$)=>{const[F,Y]=L(z.maskSrc,"anonymous"),X=z.maskSrc?Y:"loaded";return(0,e.useImageLoader)(X,z.id+"-mask"),a.default.useMemo(()=>{if(!F||!$||!$.width||!$.height)return $;const Q=m();Q.width=Math.max($.width,1),Q.height=Math.max($.height,1);const ee=Q.getContext("2d");if(!ee)return $;ee.drawImage($,0,0),ee.globalCompositeOperation="source-in";const re=P(F,z);return ee.drawImage(F,re.x,re.y,re.width,re.height,0,0,$.width,$.height),Q},[$,F,z.a.width,z.a.height])},U=(z,$,F)=>Math.max($,Math.min(F,z)),G=(z,$,F,Y,X=0,Q=!1,ee=!0)=>{const re=Math.floor(U(z.a.width*Y,1,1e4)),oe=Math.floor(U(z.a.height*Y,1,1e4)),ae=Math.min(X*Y,re/2,oe/2),ie=Math.max(z.a.width/F.width,z.a.height/F.height)*Y,Re=z.page._exportingOrRendering&&p.flags.imageDownScalingEnabled&&ie<1&&!Q,Me=F.x===0&&F.y===0&&F.width===($==null?void 0:$.width)&&F.height===($==null?void 0:$.height),ne=a.default.useMemo(()=>{if(!(!$||!$.width||!$.height))return Me&&ae===0&&!Re?void 0:m()},[$,ae,Re,Me]);return a.default.useLayoutEffect(()=>{if(!ne||!$)return;(0,v.trySetCanvasSize)(ne,re,oe);const le=ne.getContext("2d");if(!le)return;ae&&(le.beginPath(),le.moveTo(ae,0),le.lineTo(re-ae,0),le.arc(re-ae,ae,ae,3*Math.PI/2,0,!1),le.lineTo(re,oe-ae),le.arc(re-ae,oe-ae,ae,0,Math.PI/2,!1),le.lineTo(ae,oe),le.arc(ae,oe-ae,ae,Math.PI/2,Math.PI,!1),le.lineTo(0,ae),le.arc(ae,ae,ae,Math.PI,3*Math.PI/2,!1),le.clip());const be=Re?R($,ie):$,ye=Re?{x:Math.floor(F.x*ie),y:Math.floor(F.y*ie),width:Math.floor(F.width*ie),height:Math.floor(F.height*ie)}:F;le.drawImage(be,ye.x,ye.y,ye.width,ye.height,0,0,ne.width,ne.height)},[ne,z.a.width,z.a.height,F.x,F.y,F.width,F.height,X,Y,Q,z.page._exportingOrRendering,Re]),a.default.useEffect(()=>()=>{ne&&ne.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(ne)},[ne]),ne||$},Z=(z,$,F,Y)=>{const X=k(z.clipSrc||""),[Q,ee]=L(X,"anonymous"),re=z.clipSrc?ee:"loaded";(0,e.useImageLoader)(re,z.id+"-clip");const oe=a.default.useMemo(()=>{if($&&Q)return m()},[$,Q]);return a.default.useLayoutEffect(()=>{var ae;if(!Q||!$||!$.width||!$.height||!Q||!Q.width||!Q.height||!oe)return;const ie=m(),Re=Math.max(z.a.width/Q.width*F,z.a.height/Q.height*F);ie.width=Q.width*Re,ie.height=Q.height*Re,(ae=ie.getContext("2d"))===null||ae===void 0||ae.drawImage(Q,0,0,ie.width,ie.height),oe.width=Math.max($.width,1),oe.height=Math.max($.height,1);const Me=oe.getContext("2d");Me&&(Me.save(),Me.drawImage(ie,0,0,$.width,$.height),h.default.Util.releaseCanvas(ie),Me.globalCompositeOperation="source-in",Me.drawImage($,0,0,oe.width,oe.height),Me.restore())},[oe,$,Q,z.a.width,z.a.height,F,...Y]),z.clipSrc&&Q?oe:$},W=m(),H=(0,o.observer)(({element:z})=>{const $=Math.min(30,z.a.width/4,z.a.height/4),F=a.default.useRef(null);return a.default.useEffect(()=>{const Y=F.current;if(!Y)return;const X=new h.default.Animation(Q=>{Y.rotate(((Q==null?void 0:Q.timeDiff)||0)/2)},Y.getLayer());return X.start(),()=>{X.stop()}}),a.default.createElement(u.Group,{x:z.x,y:z.y,rotation:z.rotation,listening:!1,opacity:z.a.opacity,hideInExport:!z.showInExport},a.default.createElement(u.Rect,{width:z.a.width,height:z.a.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:F,x:z.a.width/2,y:z.a.height/2,fill:"white",outerRadius:Math.abs($),innerRadius:Math.max(1,$-5),angle:270}))}),M=(0,o.observer)(({element:z})=>{const $="Can not load the image...",F=Math.max(10,Math.min(30,z.a.width/25));return a.default.createElement(u.Group,{x:z.x,y:z.y,rotation:z.rotation,listening:!1,opacity:z.a.opacity,hideInExport:!z.showInExport},a.default.createElement(u.Rect,{width:z.a.width,height:z.a.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:$,fontSize:F,width:z.a.width,height:z.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let L=f.default;const D=z=>{L=z};e.setImageLoaderHook=D;const B=(z,$)=>{const F=a.default.useRef(),Y=()=>{var X;(X=F.current)===null||X===void 0||X.call(F),F.current=void 0};a.default.useEffect(()=>Y,[]),a.default.useLayoutEffect(()=>{z!=="loading"||F.current||(F.current=(0,b.incrementLoader)(`image ${$}`)),z!=="loading"&&Y(),z==="failed"&&(0,b.triggerLoadError)(`image ${$}`)},[z])};e.useImageLoader=B;const q=({image:z,status:$,type:F})=>{const Y=a.default.useRef();return a.default.useEffect(()=>{Y.current=z||Y.current},[z]),$!=="failed"||$!=="failed"&&F==="svg"?Y.current:void 0},K=z=>{const[$,F]=a.default.useReducer(ee=>ee+1,0),Y=a.default.useRef("loading"),X=a.default.useRef(z.src),Q=a.default.useRef(z.src);return Q.current!==z.src&&(Q.current=z.src,Y.current="loading"),a.default.useEffect(()=>{if(z.type!=="svg"||!z.src)return;let ee=!1;return(async()=>{Y.current="loading",F();const re=await E.urlToString(z.src),oe=E.fixSize(re),ae=E.replaceColors(oe,z.colorsReplace);ee||(X.current=ae,Y.current="loaded",F())})(),()=>{ee=!0}},[z.src,JSON.stringify(z.colorsReplace)]),z.type!=="svg"?[z.src,"loaded"]:[X.current,Y.current]};e.ImageElement=(0,o.observer)(({element:z,store:$})=>{var F;const[Y,X]=a.default.useState(!1),Q=a.default.useRef(null),ee=a.default.useRef(null),[re,oe]=a.default.useState(!1),ae=$.selectedShapes.indexOf(z)>=0,[ie,Re]=K(z),[Me,ne]=L(ie,"anonymous"),le=z.type!=="svg"||Re==="loaded"?ne:"loading";(0,e.useImageLoader)(le,z.id);const be=z.page._exportingOrRendering?1:Math.max(1,$.scale),ye=$._elementsPixelRatio*be,te=q({image:Me,status:ne,type:z.type}),de=S(z,Me||te,ye),he=N(z,de)||W;let{cropX:Se,cropY:$e,cropWidth:tt,cropHeight:Ae}=z;ne!=="loaded"&&(Se=$e=0,tt=Ae=1);const Ce=he.width*tt,Oe=he.height*Ae,Fe=z.a.width/z.a.height;let Qe,se;const fe=Ce/Oe,Ze=z.type==="svg";Ze?(Qe=Ce,se=Oe):Fe>=fe?(Qe=Ce,se=Ce/Fe):(Qe=Oe*Fe,se=Oe);const Je={x:he.width*Se,y:he.height*$e,width:Qe,height:se},_e=(F=z.cornerRadius)!==null&&F!==void 0?F:0,xe=z.page._exportingOrRendering?1:Math.min(2,$.scale),qe=$._elementsPixelRatio*xe;let we=Z(z,G(z,he,Je,qe,_e,Y||z._cropModeEnabled||z.type==="svg",!0),qe,[Je,_e,qe]);const We=Math.max(z.a.width/Qe,z.a.height/se);a.default.useEffect(()=>{var Ne;if(!z._cropModeEnabled)return;const nt=(Ne=Q.current)===null||Ne===void 0?void 0:Ne.getStage();function mt(yt){z._cropModeEnabled&&yt.target!==ee.current&&z.toggleCropMode(!1)}function Nt(yt){z._cropModeEnabled&&yt.target.parentNode!==nt.content&&z.toggleCropMode(!1)}return document.body.addEventListener("click",Nt),nt==null||nt.on("click",mt),nt==null||nt.on("tap",mt),()=>{document.body.removeEventListener("click",Nt),document.body.removeEventListener("touchstart",Nt),nt==null||nt.off("click",mt),nt==null||nt.off("click",mt)}},[z._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(Y||z._cropModeEnabled))return(0,g.applyFilter)(Q.current,z),(0,l.autorun)(()=>{(0,g.applyFilter)(Q.current,z)},{delay:100})},[we,z.page._exportingOrRendering,Y,tt,Ae,z._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Ne;Y||z._cropModeEnabled?(Ne=Q.current)===null||Ne===void 0||Ne.clearCache():(0,g.applyFilter)(Q.current,z)},[Y,z.a.width,z.a.height,z._cropModeEnabled]),a.default.useEffect(()=>{(0,g.applyFilter)(Q.current,z)},[z.shadowEnabled,z.shadowBlur,z.cornerRadius,z.shadowColor,z.shadowOffsetX,z.shadowOffsetY,z.shadowOpacity]);const Ee=a.default.useRef(null),Ke=a.default.useRef(null),rr=a.default.useRef(null);a.default.useLayoutEffect(()=>{z._cropModeEnabled&&(Ke.current.nodes([Ee.current]),rr.current.nodes([ee.current]))},[z._cropModeEnabled]);var gt=a.default.useRef(null),cr=a.default.useRef(0),Le=a.default.useRef(!1);const Ye=Ne=>{var nt;((nt=Ne.evt.touches)===null||nt===void 0?void 0:nt.length)>2&&Ne.target.stopDrag(),Math.round(Ne.target.x())>0&&(Ne.target.x(0),Ne.target.scaleX(1)),Math.round(Ne.target.y())>0&&(Ne.target.y(0),Ne.target.scaleY(1));const mt=Ne.target.width()*Ne.target.scaleX(),Nt=Ne.target.height()*Ne.target.scaleY(),yt=Math.min(1,Qe/mt),kr=Math.min(1,se/Nt),wn=1-yt,or=Math.min(wn,Math.max(0,Math.round(-Ne.target.x())/mt)),Ji=1-kr,Pi=Math.min(Ji,Math.max(0,Math.round(-Ne.target.y())/Nt));Ne.target.setAttrs({x:-or*he.width,y:-Pi*he.height,scaleX:1,scaleY:1}),z.set({cropX:or,cropY:Pi,cropWidth:yt,cropHeight:kr})},rt=()=>{z.type!=="svg"&&z.contentEditable&&setTimeout(()=>{z.toggleCropMode(!0)})},Pt=z.type==="svg"&&te,Ct=ne==="loading"&&!Pt,en=ne==="failed",qr=!Ct&&!en,_r=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),bn=qr?z.a.opacity:0;(0,y.useFadeIn)(Q,bn);const Oi=z.selectable||$.role==="admin",_n=(0,d.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,Ct&&a.default.createElement(H,{element:z}),en&&a.default.createElement(M,{element:z}),a.default.createElement(u.Image,{ref:Q,name:"element",id:z.id,image:we,x:z.a.x,y:z.a.y,width:z.a.width||1,height:z.a.height||1,rotation:z.a.rotation,opacity:bn,shadowEnabled:z.shadowEnabled,shadowBlur:z.shadowBlur,shadowOffsetX:z.shadowOffsetX,shadowOffsetY:z.shadowOffsetY,shadowColor:z.shadowColor,shadowOpacity:z.shadowOpacity,customCrop:Je,listening:Oi,draggable:_n?z.draggable&&ae:z.draggable,preventDefault:!_n||ae,hideInExport:!z.showInExport,onMouseEnter:()=>{oe(!0)},onMouseLeave:()=>{oe(!1)},onDragMove:Ne=>{z.set({x:Ne.target.x(),y:Ne.target.y()})},onDragEnd:Ne=>{z.set({x:Ne.target.x(),y:Ne.target.y()})},onDblClick:rt,onDblTap:rt,onTransformStart:()=>{X(!0),_r.current={cropX:z.cropX,cropY:z.cropY,cropWidth:z.cropWidth,cropHeight:z.cropHeight}},onTransform:Ne=>{var nt;const mt=Ne.currentTarget,Nt=Math.abs(mt.scaleX()-1)<1e-7?1:mt.scaleX(),yt=Math.abs(mt.scaleY()-1)<1e-7?1:mt.scaleY();mt.scaleX(1),mt.scaleY(1);const kr=(nt=Ne.target.getStage())===null||nt===void 0?void 0:nt.findOne("Transformer"),wn=1-Qe/he.width,or=Math.min(wn,Math.max(0,z.cropX)),Ji=1-se/he.height,Pi=Math.min(Ji,Math.max(0,z.cropY)),ea=kr.getActiveAnchor(),Na=!(ea.indexOf("middle")>=0||ea.indexOf("center")>=0),ou=!Na&&Nt<1&&_r.current.cropHeight>se/he.height;let Mo=Na?z.cropWidth:z.cropWidth*Nt;ou&&(Mo=z.cropWidth);const ta=!Na&&yt<1&&_r.current.cropWidth>Qe/he.width;let Nn=Na?z.cropHeight:z.cropHeight*yt;ta&&(Nn=z.cropHeight),Ze&&(Mo=z.cropWidth,Nn=z.cropHeight),z.set({cropX:or,cropY:Pi,x:mt.x(),y:mt.y(),width:mt.width()*Nt,height:mt.height()*yt,rotation:Ne.target.rotation(),cropWidth:Math.min(Mo,1-or),cropHeight:Math.min(Nn,1-Pi)})},onTransformEnd:Ne=>{const nt=Ne.currentTarget;z.set({width:nt.width(),height:nt.height(),x:nt.x(),y:nt.y(),rotation:Ne.target.rotation(),cropWidth:Qe/he.width,cropHeight:se/he.height}),X(!1)}}),a.default.createElement(u.Rect,{x:z.x,y:z.y,width:Math.max(z.a.width-z.borderSize,0),height:Math.max(z.a.height-z.borderSize,0),opacity:bn,offsetX:-z.borderSize/2,offsetY:-z.borderSize/2,stroke:z.borderColor,strokeWidth:z.borderSize,listening:!1,visible:!!z.borderSize,rotation:z.rotation,cornerRadius:Math.max(0,_e-z.borderSize),hideInExport:!z.showInExport}),z._cropModeEnabled&&a.default.createElement(O.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/$.scale,y:-window.innerWidth/$.scale,width:window.innerWidth/$.scale*3,height:window.innerWidth/$.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:we,x:z.x,y:z.y,width:z.a.width,height:z.a.height,rotation:z.rotation,shadowEnabled:z.shadowEnabled,shadowBlur:z.shadowBlur}),a.default.createElement(u.Group,{x:z.x,y:z.y,rotation:z.rotation,scaleX:We,scaleY:We},a.default.createElement(u.Image,{image:he,ref:ee,opacity:.4,draggable:!0,x:-z.cropX*he.width,y:-z.cropY*he.height,onDragMove:Ye,onTransform:Ye,onTouchMove:Ne=>{Ne.evt.preventDefault();const nt=Ne.target.getStage().getPointersPositions();var mt=nt[0],Nt=nt[1];const yt=Ne.target;if(mt&&!Nt&&!yt.isDragging()&&Le.current&&(yt.startDrag(),Le.current=!1),mt&&Nt){h.default.hitOnDragEnabled=!0,yt.isDragging()&&(Le.current=!0,yt.stopDrag());const ta=Ne.target.getAbsoluteTransform().copy();ta.invert();var kr={x:mt.x,y:mt.y},wn={x:Nt.x,y:Nt.y};if(!gt.current)return void(gt.current=A(kr,wn));var or=A(kr,wn),Ji=x(kr,wn);cr.current||(cr.current=Ji);const Nn=yt.position();var Pi={x:or.x-Nn.x,y:or.y-Nn.y},ea=Ji/cr.current;yt.scaleX(ea),yt.scaleY(ea);const Rl=ta.point(or),Ml=ta.point(gt.current);var Na=Rl.x-Ml.x,ou=Rl.y-Ml.y,Mo={x:Math.min(0,or.x-Pi.x*ea+Na),y:Math.min(0,or.y-Pi.y*ea+ou)};yt.position(Mo),cr.current=Ji,gt.current=or,Ye(Ne)}},onTouchEnd:Ne=>{cr.current=0,gt.current=null,h.default.hitOnDragEnabled=!1}}),a.default.createElement(u.Transformer,{ref:rr,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ne,nt)=>nt.width<5||nt.height<5?Ne:nt,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:Qe,height:se,ref:Ee,listening:!1,onTransform:Ne=>{Ne.target.x()<-z.cropX*he.width-1e-9&&(Ne.target.x(-z.cropX*he.width),Ne.target.scaleX(1)),Ne.target.y()<-z.cropY*he.height-1e-9&&(Ne.target.y(-z.cropY*he.height),Ne.target.scaleY(1));const nt=Math.min(1,Math.max(0,z.cropX+Ne.target.x()/he.width)),mt=Math.min(1,Math.max(0,Ne.target.y()/he.height+z.cropY)),Nt=Ne.target.width()*Ne.target.scaleX(),yt=Ne.target.height()*Ne.target.scaleY(),kr=Math.min(1-nt,Nt/he.width),wn=Math.min(1-mt,yt/he.height),or=Ne.target.getAbsolutePosition(Ne.target.getParent().getParent());Ne.target.scale({x:1,y:1}),Ne.target.position({x:0,y:0}),z.set({x:or.x,y:or.y,cropX:nt,cropY:mt,cropWidth:kr,cropHeight:wn,width:Math.min(Nt*We,he.width*(1-nt)*We),height:Math.min(yt*We,he.height*(1-mt)*We)})}}),a.default.createElement(u.Transformer,{ref:Ke,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ne,nt)=>nt.width<5||nt.height<5?Ne:nt,visible:z.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(re||ae)&&a.default.createElement(w.Highlighter,{element:z}))})})(d2);var iS={},aS={exports:{}};/*!
|
|
109
|
+
* Quill Editor v1.3.7
|
|
110
|
+
* https://quilljs.com/
|
|
111
|
+
* Copyright (c) 2014, Jason Chen
|
|
112
|
+
* Copyright (c) 2013, salesforce.com
|
|
113
|
+
*/(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:me,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,l){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:l})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(18),l=i(19),u=i(45),f=i(46),h=i(47),O=i(48),w=i(49),b=i(12),E=i(32),p=i(33),v=i(31),g=i(1),y={Scope:g.Scope,create:g.create,find:g.find,query:g.query,register:g.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:O.default,Scroll:u.default,Block:h.default,Inline:f.default,Text:w.default,Attributor:{Attribute:b.default,Class:E.default,Style:p.default,Store:v.default}};n.default=y},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,y){g.__proto__=y}||function(g,y){for(var d in y)y.hasOwnProperty(d)&&(g[d]=y[d])};return function(g,y){v(g,y);function d(){this.constructor=g}g.prototype=y===null?Object.create(y):(d.prototype=y.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(v){a(g,v);function g(y){var d=this;return y="[Parchment] "+y,d=v.call(this,y)||this,d.message=y,d.name=d.constructor.name,d}return g}(Error);n.ParchmentError=o;var l={},u={},f={},h={};n.DATA_KEY="__blot";var O;(function(v){v[v.TYPE=3]="TYPE",v[v.LEVEL=12]="LEVEL",v[v.ATTRIBUTE=13]="ATTRIBUTE",v[v.BLOT=14]="BLOT",v[v.INLINE=7]="INLINE",v[v.BLOCK=11]="BLOCK",v[v.BLOCK_BLOT=10]="BLOCK_BLOT",v[v.INLINE_BLOT=6]="INLINE_BLOT",v[v.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",v[v.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",v[v.ANY=15]="ANY"})(O=n.Scope||(n.Scope={}));function w(v,g){var y=E(v);if(y==null)throw new o("Unable to create "+v+" blot");var d=y,m=v instanceof Node||v.nodeType===Node.TEXT_NODE?v:d.create(g);return new d(m,g)}n.create=w;function b(v,g){return g===void 0&&(g=!1),v==null?null:v[n.DATA_KEY]!=null?v[n.DATA_KEY].blot:g?b(v.parentNode,g):null}n.find=b;function E(v,g){g===void 0&&(g=O.ANY);var y;if(typeof v=="string")y=h[v]||l[v];else if(v instanceof Text||v.nodeType===Node.TEXT_NODE)y=h.text;else if(typeof v=="number")v&O.LEVEL&O.BLOCK?y=h.block:v&O.LEVEL&O.INLINE&&(y=h.inline);else if(v instanceof HTMLElement){var d=(v.getAttribute("class")||"").split(/\s+/);for(var m in d)if(y=u[d[m]],y)break;y=y||f[v.tagName]}return y==null?null:g&O.LEVEL&y.scope&&g&O.TYPE&y.scope?y:null}n.query=E;function p(){for(var v=[],g=0;g<arguments.length;g++)v[g]=arguments[g];if(v.length>1)return v.map(function(m){return p(m)});var y=v[0];if(typeof y.blotName!="string"&&typeof y.attrName!="string")throw new o("Invalid definition");if(y.blotName==="abstract")throw new o("Cannot register abstract class");if(h[y.blotName||y.attrName]=y,typeof y.keyName=="string")l[y.keyName]=y;else if(y.className!=null&&(u[y.className]=y),y.tagName!=null){Array.isArray(y.tagName)?y.tagName=y.tagName.map(function(m){return m.toUpperCase()}):y.tagName=y.tagName.toUpperCase();var d=Array.isArray(y.tagName)?y.tagName:[y.tagName];d.forEach(function(m){(f[m]==null||y.className==null)&&(f[m]=y)})}return y}n.register=p},function(r,n,i){var a=i(51),o=i(11),l=i(3),u=i(20),f="\0",h=function(O){Array.isArray(O)?this.ops=O:O!=null&&Array.isArray(O.ops)?this.ops=O.ops:this.ops=[]};h.prototype.insert=function(O,w){var b={};return O.length===0?this:(b.insert=O,w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(b.attributes=w),this.push(b))},h.prototype.delete=function(O){return O<=0?this:this.push({delete:O})},h.prototype.retain=function(O,w){if(O<=0)return this;var b={retain:O};return w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(b.attributes=w),this.push(b)},h.prototype.push=function(O){var w=this.ops.length,b=this.ops[w-1];if(O=l(!0,{},O),typeof b=="object"){if(typeof O.delete=="number"&&typeof b.delete=="number")return this.ops[w-1]={delete:b.delete+O.delete},this;if(typeof b.delete=="number"&&O.insert!=null&&(w-=1,b=this.ops[w-1],typeof b!="object"))return this.ops.unshift(O),this;if(o(O.attributes,b.attributes)){if(typeof O.insert=="string"&&typeof b.insert=="string")return this.ops[w-1]={insert:b.insert+O.insert},typeof O.attributes=="object"&&(this.ops[w-1].attributes=O.attributes),this;if(typeof O.retain=="number"&&typeof b.retain=="number")return this.ops[w-1]={retain:b.retain+O.retain},typeof O.attributes=="object"&&(this.ops[w-1].attributes=O.attributes),this}}return w===this.ops.length?this.ops.push(O):this.ops.splice(w,0,O),this},h.prototype.chop=function(){var O=this.ops[this.ops.length-1];return O&&O.retain&&!O.attributes&&this.ops.pop(),this},h.prototype.filter=function(O){return this.ops.filter(O)},h.prototype.forEach=function(O){this.ops.forEach(O)},h.prototype.map=function(O){return this.ops.map(O)},h.prototype.partition=function(O){var w=[],b=[];return this.forEach(function(E){var p=O(E)?w:b;p.push(E)}),[w,b]},h.prototype.reduce=function(O,w){return this.ops.reduce(O,w)},h.prototype.changeLength=function(){return this.reduce(function(O,w){return w.insert?O+u.length(w):w.delete?O-w.delete:O},0)},h.prototype.length=function(){return this.reduce(function(O,w){return O+u.length(w)},0)},h.prototype.slice=function(O,w){O=O||0,typeof w!="number"&&(w=1/0);for(var b=[],E=u.iterator(this.ops),p=0;p<w&&E.hasNext();){var v;p<O?v=E.next(O-p):(v=E.next(w-p),b.push(v)),p+=u.length(v)}return new h(b)},h.prototype.compose=function(O){var w=u.iterator(this.ops),b=u.iterator(O.ops),E=[],p=b.peek();if(p!=null&&typeof p.retain=="number"&&p.attributes==null){for(var v=p.retain;w.peekType()==="insert"&&w.peekLength()<=v;)v-=w.peekLength(),E.push(w.next());p.retain-v>0&&b.next(p.retain-v)}for(var g=new h(E);w.hasNext()||b.hasNext();)if(b.peekType()==="insert")g.push(b.next());else if(w.peekType()==="delete")g.push(w.next());else{var y=Math.min(w.peekLength(),b.peekLength()),d=w.next(y),m=b.next(y);if(typeof m.retain=="number"){var _={};typeof d.retain=="number"?_.retain=y:_.insert=d.insert;var k=u.attributes.compose(d.attributes,m.attributes,typeof d.retain=="number");if(k&&(_.attributes=k),g.push(_),!b.hasNext()&&o(g.ops[g.ops.length-1],_)){var x=new h(w.rest());return g.concat(x).chop()}}else typeof m.delete=="number"&&typeof d.retain=="number"&&g.push(m)}return g.chop()},h.prototype.concat=function(O){var w=new h(this.ops.slice());return O.ops.length>0&&(w.push(O.ops[0]),w.ops=w.ops.concat(O.ops.slice(1))),w},h.prototype.diff=function(O,w){if(this.ops===O.ops)return new h;var b=[this,O].map(function(y){return y.map(function(d){if(d.insert!=null)return typeof d.insert=="string"?d.insert:f;var m=y===O?"on":"with";throw new Error("diff() called "+m+" non-document")}).join("")}),E=new h,p=a(b[0],b[1],w),v=u.iterator(this.ops),g=u.iterator(O.ops);return p.forEach(function(y){for(var d=y[1].length;d>0;){var m=0;switch(y[0]){case a.INSERT:m=Math.min(g.peekLength(),d),E.push(g.next(m));break;case a.DELETE:m=Math.min(d,v.peekLength()),v.next(m),E.delete(m);break;case a.EQUAL:m=Math.min(v.peekLength(),g.peekLength(),d);var _=v.next(m),k=g.next(m);o(_.insert,k.insert)?E.retain(m,u.attributes.diff(_.attributes,k.attributes)):E.push(k).delete(m);break}d-=m}}),E.chop()},h.prototype.eachLine=function(O,w){w=w||`
|
|
114
|
+
`;for(var b=u.iterator(this.ops),E=new h,p=0;b.hasNext();){if(b.peekType()!=="insert")return;var v=b.peek(),g=u.length(v)-b.peekLength(),y=typeof v.insert=="string"?v.insert.indexOf(w,g)-g:-1;if(y<0)E.push(b.next());else if(y>0)E.push(b.next(y));else{if(O(E,b.next(1).attributes||{},p)===!1)return;p+=1,E=new h}}E.length()>0&&O(E,{},p)},h.prototype.transform=function(O,w){if(w=!!w,typeof O=="number")return this.transformPosition(O,w);for(var b=u.iterator(this.ops),E=u.iterator(O.ops),p=new h;b.hasNext()||E.hasNext();)if(b.peekType()==="insert"&&(w||E.peekType()!=="insert"))p.retain(u.length(b.next()));else if(E.peekType()==="insert")p.push(E.next());else{var v=Math.min(b.peekLength(),E.peekLength()),g=b.next(v),y=E.next(v);if(g.delete)continue;y.delete?p.push(y):p.retain(v,u.attributes.transform(g.attributes,y.attributes,w))}return p.chop()},h.prototype.transformPosition=function(O,w){w=!!w;for(var b=u.iterator(this.ops),E=0;b.hasNext()&&E<=O;){var p=b.peekLength(),v=b.peekType();if(b.next(),v==="delete"){O-=Math.min(p,O-E);continue}else v==="insert"&&(E<O||!w)&&(O+=p);E+=p}return O},r.exports=h},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(b){return typeof Array.isArray=="function"?Array.isArray(b):a.call(b)==="[object Array]"},f=function(b){if(!b||a.call(b)!=="[object Object]")return!1;var E=i.call(b,"constructor"),p=b.constructor&&b.constructor.prototype&&i.call(b.constructor.prototype,"isPrototypeOf");if(b.constructor&&!E&&!p)return!1;var v;for(v in b);return typeof v>"u"||i.call(b,v)},h=function(b,E){o&&E.name==="__proto__"?o(b,E.name,{enumerable:!0,configurable:!0,value:E.newValue,writable:!0}):b[E.name]=E.newValue},O=function(b,E){if(E==="__proto__")if(i.call(b,E)){if(l)return l(b,E).value}else return;return b[E]};r.exports=function w(){var b,E,p,v,g,y,d=arguments[0],m=1,_=arguments.length,k=!1;for(typeof d=="boolean"&&(k=d,d=arguments[1]||{},m=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});m<_;++m)if(b=arguments[m],b!=null)for(E in b)p=O(d,E),v=O(b,E),d!==v&&(k&&v&&(f(v)||(g=u(v)))?(g?(g=!1,y=p&&u(p)?p:[]):y=p&&f(p)?p:{},h(d,{name:E,newValue:w(k,y,v)})):typeof v<"u"&&h(d,{name:E,newValue:v}));return d}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=function(){function C(R,N){for(var U=0;U<N.length;U++){var G=N[U];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(R,G.key,G)}}return function(R,N,U){return N&&C(R.prototype,N),U&&C(R,U),R}}(),o=function C(R,N,U){R===null&&(R=Function.prototype);var G=Object.getOwnPropertyDescriptor(R,N);if(G===void 0){var Z=Object.getPrototypeOf(R);return Z===null?void 0:C(Z,N,U)}else{if("value"in G)return G.value;var W=G.get;return W===void 0?void 0:W.call(U)}},l=i(3),u=d(l),f=i(2),h=d(f),O=i(0),w=d(O),b=i(16),E=d(b),p=i(6),v=d(p),g=i(7),y=d(g);function d(C){return C&&C.__esModule?C:{default:C}}function m(C,R){if(!(C instanceof R))throw new TypeError("Cannot call a class as a function")}function _(C,R){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:C}function k(C,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);C.prototype=Object.create(R&&R.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(C,R):C.__proto__=R)}var x=1,A=function(C){k(R,C);function R(){return m(this,R),_(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return a(R,[{key:"attach",value:function(){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"attach",this).call(this),this.attributes=new w.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new h.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(U,G){var Z=w.default.query(U,w.default.Scope.BLOCK_ATTRIBUTE);Z!=null&&this.attributes.attribute(Z,G)}},{key:"formatAt",value:function(U,G,Z,W){this.format(Z,W)}},{key:"insertAt",value:function(U,G,Z){if(typeof G=="string"&&G.endsWith(`
|
|
115
|
+
`)){var W=w.default.create(S.blotName);this.parent.insertBefore(W,U===0?this:this.next),W.insertAt(0,G.slice(0,-1))}else o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,U,G,Z)}}]),R}(w.default.Embed);A.scope=w.default.Scope.BLOCK_BLOT;var S=function(C){k(R,C);function R(N){m(this,R);var U=_(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,N));return U.cache={},U}return a(R,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(w.default.Leaf).reduce(function(U,G){return G.length()===0?U:U.insert(G.value(),P(G))},new h.default).insert(`
|
|
116
|
+
`,P(this))),this.cache.delta}},{key:"deleteAt",value:function(U,G){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"deleteAt",this).call(this,U,G),this.cache={}}},{key:"formatAt",value:function(U,G,Z,W){G<=0||(w.default.query(Z,w.default.Scope.BLOCK)?U+G===this.length()&&this.format(Z,W):o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"formatAt",this).call(this,U,Math.min(G,this.length()-U-1),Z,W),this.cache={})}},{key:"insertAt",value:function(U,G,Z){if(Z!=null)return o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,U,G,Z);if(G.length!==0){var W=G.split(`
|
|
117
|
+
`),H=W.shift();H.length>0&&(U<this.length()-1||this.children.tail==null?o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,Math.min(U,this.length()-1),H):this.children.tail.insertAt(this.children.tail.length(),H),this.cache={});var M=this;W.reduce(function(L,D){return M=M.split(L,!0),M.insertAt(0,D),D.length},U+H.length)}}},{key:"insertBefore",value:function(U,G){var Z=this.children.head;o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertBefore",this).call(this,U,G),Z instanceof E.default&&Z.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"length",this).call(this)+x),this.cache.length}},{key:"moveChildren",value:function(U,G){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"moveChildren",this).call(this,U,G),this.cache={}}},{key:"optimize",value:function(U){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"optimize",this).call(this,U),this.cache={}}},{key:"path",value:function(U){return o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"path",this).call(this,U,!0)}},{key:"removeChild",value:function(U){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"removeChild",this).call(this,U),this.cache={}}},{key:"split",value:function(U){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(G&&(U===0||U>=this.length()-x)){var Z=this.clone();return U===0?(this.parent.insertBefore(Z,this),this):(this.parent.insertBefore(Z,this.next),Z)}else{var W=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"split",this).call(this,U,G);return this.cache={},W}}}]),R}(w.default.Block);S.blotName="block",S.tagName="P",S.defaultChild="break",S.allowedChildren=[v.default,w.default.Embed,y.default];function P(C){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return C==null||(typeof C.formats=="function"&&(R=(0,u.default)(R,C.formats())),C.parent==null||C.parent.blotName=="scroll"||C.parent.statics.scope!==C.statics.scope)?R:P(C.parent,R)}n.bubbleFormats=P,n.BlockEmbed=A,n.default=S},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(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},o=function(){function M(L,D){var B=[],q=!0,K=!1,z=void 0;try{for(var $=L[Symbol.iterator](),F;!(q=(F=$.next()).done)&&(B.push(F.value),!(D&&B.length===D));q=!0);}catch(Y){K=!0,z=Y}finally{try{!q&&$.return&&$.return()}finally{if(K)throw z}}return B}return function(L,D){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return M(L,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function M(L,D){for(var B=0;B<D.length;B++){var q=D[B];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(L,q.key,q)}}return function(L,D,B){return D&&M(L.prototype,D),B&&M(L,B),L}}();i(50);var u=i(2),f=P(u),h=i(14),O=P(h),w=i(8),b=P(w),E=i(9),p=P(E),v=i(0),g=P(v),y=i(15),d=P(y),m=i(3),_=P(m),k=i(10),x=P(k),A=i(34),S=P(A);function P(M){return M&&M.__esModule?M:{default:M}}function C(M,L,D){return L in M?Object.defineProperty(M,L,{value:D,enumerable:!0,configurable:!0,writable:!0}):M[L]=D,M}function R(M,L){if(!(M instanceof L))throw new TypeError("Cannot call a class as a function")}var N=(0,x.default)("quill"),U=function(){l(M,null,[{key:"debug",value:function(D){D===!0&&(D="log"),x.default.level(D)}},{key:"find",value:function(D){return D.__quill||g.default.find(D)}},{key:"import",value:function(D){return this.imports[D]==null&&N.error("Cannot import "+D+". Are you sure it was registered?"),this.imports[D]}},{key:"register",value:function(D,B){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof D!="string"){var z=D.attrName||D.blotName;typeof z=="string"?this.register("formats/"+z,D,B):Object.keys(D).forEach(function($){q.register($,D[$],B)})}else this.imports[D]!=null&&!K&&N.warn("Overwriting "+D+" with",B),this.imports[D]=B,(D.startsWith("blots/")||D.startsWith("formats/"))&&B.blotName!=="abstract"?g.default.register(B):D.startsWith("modules")&&typeof B.register=="function"&&B.register()}}]);function M(L){var D=this,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(R(this,M),this.options=G(L,B),this.container=this.options.container,this.container==null)return N.error("Invalid Quill container",L);this.options.debug&&M.debug(this.options.debug);var q=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 b.default,this.scroll=g.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new O.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(b.default.events.EDITOR_CHANGE,function(z){z===b.default.events.TEXT_CHANGE&&D.root.classList.toggle("ql-blank",D.editor.isBlank())}),this.emitter.on(b.default.events.SCROLL_UPDATE,function(z,$){var F=D.selection.lastRange,Y=F&&F.length===0?F.index:void 0;Z.call(D,function(){return D.editor.update(null,$,Y)},z)});var K=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+q+"<p><br></p></div>");this.setContents(K),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(M,[{key:"addContainer",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof D=="string"){var q=D;D=document.createElement("div"),D.classList.add(q)}return this.container.insertBefore(D,B),D}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(D,B,q){var K=this,z=W(D,B,q),$=o(z,4);return D=$[0],B=$[1],q=$[3],Z.call(this,function(){return K.editor.deleteText(D,B)},q,D,-1*B)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(D),this.container.classList.toggle("ql-disabled",!D)}},{key:"focus",value:function(){var D=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=D,this.scrollIntoView()}},{key:"format",value:function(D,B){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:b.default.sources.API;return Z.call(this,function(){var z=q.getSelection(!0),$=new f.default;if(z==null)return $;if(g.default.query(D,g.default.Scope.BLOCK))$=q.editor.formatLine(z.index,z.length,C({},D,B));else{if(z.length===0)return q.selection.format(D,B),$;$=q.editor.formatText(z.index,z.length,C({},D,B))}return q.setSelection(z,b.default.sources.SILENT),$},K)}},{key:"formatLine",value:function(D,B,q,K,z){var $=this,F=void 0,Y=W(D,B,q,K,z),X=o(Y,4);return D=X[0],B=X[1],F=X[2],z=X[3],Z.call(this,function(){return $.editor.formatLine(D,B,F)},z,D,0)}},{key:"formatText",value:function(D,B,q,K,z){var $=this,F=void 0,Y=W(D,B,q,K,z),X=o(Y,4);return D=X[0],B=X[1],F=X[2],z=X[3],Z.call(this,function(){return $.editor.formatText(D,B,F)},z,D,0)}},{key:"getBounds",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,q=void 0;typeof D=="number"?q=this.selection.getBounds(D,B):q=this.selection.getBounds(D.index,D.length);var K=this.container.getBoundingClientRect();return{bottom:q.bottom-K.top,height:q.height,left:q.left-K.left,right:q.right-K.left,top:q.top-K.top,width:q.width}}},{key:"getContents",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-D,q=W(D,B),K=o(q,2);return D=K[0],B=K[1],this.editor.getContents(D,B)}},{key:"getFormat",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof D=="number"?this.editor.getFormat(D,B):this.editor.getFormat(D.index,D.length)}},{key:"getIndex",value:function(D){return D.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(D){return this.scroll.leaf(D)}},{key:"getLine",value:function(D){return this.scroll.line(D)}},{key:"getLines",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof D!="number"?this.scroll.lines(D.index,D.length):this.scroll.lines(D,B)}},{key:"getModule",value:function(D){return this.theme.modules[D]}},{key:"getSelection",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return D&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-D,q=W(D,B),K=o(q,2);return D=K[0],B=K[1],this.editor.getText(D,B)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(D,B,q){var K=this,z=arguments.length>3&&arguments[3]!==void 0?arguments[3]:M.sources.API;return Z.call(this,function(){return K.editor.insertEmbed(D,B,q)},z,D)}},{key:"insertText",value:function(D,B,q,K,z){var $=this,F=void 0,Y=W(D,0,q,K,z),X=o(Y,4);return D=X[0],F=X[2],z=X[3],Z.call(this,function(){return $.editor.insertText(D,B,F)},z,D,B.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(D,B,q){this.clipboard.dangerouslyPasteHTML(D,B,q)}},{key:"removeFormat",value:function(D,B,q){var K=this,z=W(D,B,q),$=o(z,4);return D=$[0],B=$[1],q=$[3],Z.call(this,function(){return K.editor.removeFormat(D,B)},q,D)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(D){var B=this,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:b.default.sources.API;return Z.call(this,function(){D=new f.default(D);var K=B.getLength(),z=B.editor.deleteText(0,K),$=B.editor.applyDelta(D),F=$.ops[$.ops.length-1];F!=null&&typeof F.insert=="string"&&F.insert[F.insert.length-1]===`
|
|
118
|
+
`&&(B.editor.deleteText(B.getLength()-1,1),$.delete(1));var Y=z.compose($);return Y},q)}},{key:"setSelection",value:function(D,B,q){if(D==null)this.selection.setRange(null,B||M.sources.API);else{var K=W(D,B,q),z=o(K,4);D=z[0],B=z[1],q=z[3],this.selection.setRange(new y.Range(D,B),q),q!==b.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:b.default.sources.API,q=new f.default().insert(D);return this.setContents(q,B)}},{key:"update",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b.default.sources.USER,B=this.scroll.update(D);return this.selection.update(D),B}},{key:"updateContents",value:function(D){var B=this,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:b.default.sources.API;return Z.call(this,function(){return D=new f.default(D),B.editor.applyDelta(D,q)},q,!0)}}]),M}();U.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},U.events=b.default.events,U.sources=b.default.sources,U.version="1.3.7",U.imports={delta:f.default,parchment:g.default,"core/module":p.default,"core/theme":S.default};function G(M,L){if(L=(0,_.default)(!0,{container:M,modules:{clipboard:!0,keyboard:!0,history:!0}},L),!L.theme||L.theme===U.DEFAULTS.theme)L.theme=S.default;else if(L.theme=U.import("themes/"+L.theme),L.theme==null)throw new Error("Invalid theme "+L.theme+". Did you register it?");var D=(0,_.default)(!0,{},L.theme.DEFAULTS);[D,L].forEach(function(K){K.modules=K.modules||{},Object.keys(K.modules).forEach(function(z){K.modules[z]===!0&&(K.modules[z]={})})});var B=Object.keys(D.modules).concat(Object.keys(L.modules)),q=B.reduce(function(K,z){var $=U.import("modules/"+z);return $==null?N.error("Cannot load "+z+" module. Are you sure you registered it?"):K[z]=$.DEFAULTS||{},K},{});return L.modules!=null&&L.modules.toolbar&&L.modules.toolbar.constructor!==Object&&(L.modules.toolbar={container:L.modules.toolbar}),L=(0,_.default)(!0,{},U.DEFAULTS,{modules:q},D,L),["bounds","container","scrollingContainer"].forEach(function(K){typeof L[K]=="string"&&(L[K]=document.querySelector(L[K]))}),L.modules=Object.keys(L.modules).reduce(function(K,z){return L.modules[z]&&(K[z]=L.modules[z]),K},{}),L}function Z(M,L,D,B){if(this.options.strict&&!this.isEnabled()&&L===b.default.sources.USER)return new f.default;var q=D==null?null:this.getSelection(),K=this.editor.delta,z=M();if(q!=null&&(D===!0&&(D=q.index),B==null?q=H(q,z,L):B!==0&&(q=H(q,D,B,L)),this.setSelection(q,b.default.sources.SILENT)),z.length()>0){var $,F=[b.default.events.TEXT_CHANGE,z,K,L];if(($=this.emitter).emit.apply($,[b.default.events.EDITOR_CHANGE].concat(F)),L!==b.default.sources.SILENT){var Y;(Y=this.emitter).emit.apply(Y,F)}}return z}function W(M,L,D,B,q){var K={};return typeof M.index=="number"&&typeof M.length=="number"?typeof L!="number"?(q=B,B=D,D=L,L=M.length,M=M.index):(L=M.length,M=M.index):typeof L!="number"&&(q=B,B=D,D=L,L=0),(typeof D>"u"?"undefined":a(D))==="object"?(K=D,q=B):typeof D=="string"&&(B!=null?K[D]=B:q=D),q=q||b.default.sources.API,[M,L,K,q]}function H(M,L,D,B){if(M==null)return null;var q=void 0,K=void 0;if(L instanceof f.default){var z=[M.index,M.index+M.length].map(function(X){return L.transformPosition(X,B!==b.default.sources.USER)}),$=o(z,2);q=$[0],K=$[1]}else{var F=[M.index,M.index+M.length].map(function(X){return X<L||X===L&&B===b.default.sources.USER?X:D>=0?X+D:Math.max(L,X+D)}),Y=o(F,2);q=Y[0],K=Y[1]}return new y.Range(q,K-q)}n.expandConfig=G,n.overload=W,n.default=U},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(g,y){for(var d=0;d<y.length;d++){var m=y[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(g,m.key,m)}}return function(g,y,d){return y&&v(g.prototype,y),d&&v(g,d),g}}(),o=function v(g,y,d){g===null&&(g=Function.prototype);var m=Object.getOwnPropertyDescriptor(g,y);if(m===void 0){var _=Object.getPrototypeOf(g);return _===null?void 0:v(_,y,d)}else{if("value"in m)return m.value;var k=m.get;return k===void 0?void 0:k.call(d)}},l=i(7),u=O(l),f=i(0),h=O(f);function O(v){return v&&v.__esModule?v:{default:v}}function w(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function b(v,g){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:v}function E(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);v.prototype=Object.create(g&&g.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(v,g):v.__proto__=g)}var p=function(v){E(g,v);function g(){return w(this,g),b(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,[{key:"formatAt",value:function(d,m,_,k){if(g.compare(this.statics.blotName,_)<0&&h.default.query(_,h.default.Scope.BLOT)){var x=this.isolate(d,m);k&&x.wrap(_,k)}else o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"formatAt",this).call(this,d,m,_,k)}},{key:"optimize",value:function(d){if(o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"optimize",this).call(this,d),this.parent instanceof g&&g.compare(this.statics.blotName,this.parent.statics.blotName)>0){var m=this.parent.isolate(this.offset(),this.length());this.moveChildren(m),m.wrap(this)}}}],[{key:"compare",value:function(d,m){var _=g.order.indexOf(d),k=g.order.indexOf(m);return _>=0||k>=0?_-k:d===m?0:d<m?-1:1}}]),g}(h.default.Inline);p.allowedChildren=[p,h.default.Embed,u.default],p.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,b){if(!(w instanceof b))throw new TypeError("Cannot call a class as a function")}function f(w,b){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:w}function h(w,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);w.prototype=Object.create(b&&b.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(w,b):w.__proto__=b)}var O=function(w){h(b,w);function b(){return u(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default.Text);n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(d,m){for(var _=0;_<m.length;_++){var k=m[_];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(d,k.key,k)}}return function(d,m,_){return m&&y(d.prototype,m),_&&y(d,_),d}}(),o=function y(d,m,_){d===null&&(d=Function.prototype);var k=Object.getOwnPropertyDescriptor(d,m);if(k===void 0){var x=Object.getPrototypeOf(d);return x===null?void 0:y(x,m,_)}else{if("value"in k)return k.value;var A=k.get;return A===void 0?void 0:A.call(_)}},l=i(54),u=O(l),f=i(10),h=O(f);function O(y){return y&&y.__esModule?y:{default:y}}function w(y,d){if(!(y instanceof d))throw new TypeError("Cannot call a class as a function")}function b(y,d){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:y}function E(y,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);y.prototype=Object.create(d&&d.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(y,d):y.__proto__=d)}var p=(0,h.default)("quill:events"),v=["selectionchange","mousedown","mouseup","click"];v.forEach(function(y){document.addEventListener(y,function(){for(var d=arguments.length,m=Array(d),_=0;_<d;_++)m[_]=arguments[_];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(k){if(k.__quill&&k.__quill.emitter){var x;(x=k.__quill.emitter).handleDOM.apply(x,m)}})})});var g=function(y){E(d,y);function d(){w(this,d);var m=b(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return m.listeners={},m.on("error",p.error),m}return a(d,[{key:"emit",value:function(){p.log.apply(p,arguments),o(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(_){for(var k=arguments.length,x=Array(k>1?k-1:0),A=1;A<k;A++)x[A-1]=arguments[A];(this.listeners[_.type]||[]).forEach(function(S){var P=S.node,C=S.handler;(_.target===P||P.contains(_.target))&&C.apply(void 0,[_].concat(x))})}},{key:"listenDOM",value:function(_,k,x){this.listeners[_]||(this.listeners[_]=[]),this.listeners[_].push({node:k,handler:x})}}]),d}(u.default);g.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"},g.sources={API:"api",SILENT:"silent",USER:"user"},n.default=g},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 h,O=arguments.length,w=Array(O>1?O-1:0),b=1;b<O;b++)w[b-1]=arguments[b];(h=console)[f].apply(h,w)}}function u(f){return a.reduce(function(h,O){return h[O]=l.bind(console,O,f),h},{})}l.level=u.level=function(f){o=f},n.default=u},function(r,n,i){var a=Array.prototype.slice,o=i(52),l=i(53),u=r.exports=function(w,b,E){return E||(E={}),w===b?!0:w instanceof Date&&b instanceof Date?w.getTime()===b.getTime():!w||!b||typeof w!="object"&&typeof b!="object"?E.strict?w===b:w==b:O(w,b,E)};function f(w){return w==null}function h(w){return!(!w||typeof w!="object"||typeof w.length!="number"||typeof w.copy!="function"||typeof w.slice!="function"||w.length>0&&typeof w[0]!="number")}function O(w,b,E){var p,v;if(f(w)||f(b)||w.prototype!==b.prototype)return!1;if(l(w))return l(b)?(w=a.call(w),b=a.call(b),u(w,b,E)):!1;if(h(w)){if(!h(b)||w.length!==b.length)return!1;for(p=0;p<w.length;p++)if(w[p]!==b[p])return!1;return!0}try{var g=o(w),y=o(b)}catch{return!1}if(g.length!=y.length)return!1;for(g.sort(),y.sort(),p=g.length-1;p>=0;p--)if(g[p]!=y[p])return!1;for(p=g.length-1;p>=0;p--)if(v=g[p],!u(w[v],b[v],E))return!1;return typeof w==typeof b}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u,f,h){h===void 0&&(h={}),this.attrName=u,this.keyName=f;var O=a.Scope.TYPE&a.Scope.ATTRIBUTE;h.scope!=null?this.scope=h.scope&a.Scope.LEVEL|O:this.scope=a.Scope.ATTRIBUTE,h.whitelist!=null&&(this.whitelist=h.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 h=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return h==null?!1:this.whitelist==null?!0:typeof f=="string"?this.whitelist.indexOf(f.replace(/["']/g,""))>-1:this.whitelist.indexOf(f)>-1},l.prototype.remove=function(u){u.removeAttribute(this.keyName)},l.prototype.value=function(u){var f=u.getAttribute(this.keyName);return this.canAdd(u,f)&&f?f:""},l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var a=function(){function A(S,P){var C=[],R=!0,N=!1,U=void 0;try{for(var G=S[Symbol.iterator](),Z;!(R=(Z=G.next()).done)&&(C.push(Z.value),!(P&&C.length===P));R=!0);}catch(W){N=!0,U=W}finally{try{!R&&G.return&&G.return()}finally{if(N)throw U}}return C}return function(S,P){if(Array.isArray(S))return S;if(Symbol.iterator in Object(S))return A(S,P);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function A(S,P){for(var C=0;C<P.length;C++){var R=P[C];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(S,R.key,R)}}return function(S,P,C){return P&&A(S.prototype,P),C&&A(S,C),S}}(),l=function A(S,P,C){S===null&&(S=Function.prototype);var R=Object.getOwnPropertyDescriptor(S,P);if(R===void 0){var N=Object.getPrototypeOf(S);return N===null?void 0:A(N,P,C)}else{if("value"in R)return R.value;var U=R.get;return U===void 0?void 0:U.call(C)}},u=i(2),f=y(u),h=i(0),O=y(h),w=i(4),b=y(w),E=i(6),p=y(E),v=i(7),g=y(v);function y(A){return A&&A.__esModule?A:{default:A}}function d(A,S){if(!(A instanceof S))throw new TypeError("Cannot call a class as a function")}function m(A,S){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:A}function _(A,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);A.prototype=Object.create(S&&S.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(A,S):A.__proto__=S)}var k=function(A){_(S,A);function S(){return d(this,S),m(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return S}(p.default);k.blotName="code",k.tagName="CODE";var x=function(A){_(S,A);function S(){return d(this,S),m(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return o(S,[{key:"delta",value:function(){var C=this,R=this.domNode.textContent;return R.endsWith(`
|
|
119
|
+
`)&&(R=R.slice(0,-1)),R.split(`
|
|
120
|
+
`).reduce(function(N,U){return N.insert(U).insert(`
|
|
121
|
+
`,C.formats())},new f.default)}},{key:"format",value:function(C,R){if(!(C===this.statics.blotName&&R)){var N=this.descendant(g.default,this.length()-1),U=a(N,1),G=U[0];G!=null&&G.deleteAt(G.length()-1,1),l(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"format",this).call(this,C,R)}}},{key:"formatAt",value:function(C,R,N,U){if(R!==0&&!(O.default.query(N,O.default.Scope.BLOCK)==null||N===this.statics.blotName&&U===this.statics.formats(this.domNode))){var G=this.newlineIndex(C);if(!(G<0||G>=C+R)){var Z=this.newlineIndex(C,!0)+1,W=G-Z+1,H=this.isolate(Z,W),M=H.next;H.format(N,U),M instanceof S&&M.formatAt(0,C-Z+R-W,N,U)}}}},{key:"insertAt",value:function(C,R,N){if(N==null){var U=this.descendant(g.default,C),G=a(U,2),Z=G[0],W=G[1];Z.insertAt(W,R)}}},{key:"length",value:function(){var C=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
|
122
|
+
`)?C:C+1}},{key:"newlineIndex",value:function(C){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(R)return this.domNode.textContent.slice(0,C).lastIndexOf(`
|
|
123
|
+
`);var N=this.domNode.textContent.slice(C).indexOf(`
|
|
124
|
+
`);return N>-1?C+N:-1}},{key:"optimize",value:function(C){this.domNode.textContent.endsWith(`
|
|
125
|
+
`)||this.appendChild(O.default.create("text",`
|
|
126
|
+
`)),l(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"optimize",this).call(this,C);var R=this.next;R!=null&&R.prev===this&&R.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===R.statics.formats(R.domNode)&&(R.optimize(C),R.moveChildren(this),R.remove())}},{key:"replace",value:function(C){l(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"replace",this).call(this,C),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(R){var N=O.default.find(R);N==null?R.parentNode.removeChild(R):N instanceof O.default.Embed?N.remove():N.unwrap()})}}],[{key:"create",value:function(C){var R=l(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,C);return R.setAttribute("spellcheck",!1),R}},{key:"formats",value:function(){return!0}}]),S}(b.default);x.blotName="code-block",x.tagName="PRE",x.TAB=" ",n.Code=k,n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},o=function(){function M(L,D){var B=[],q=!0,K=!1,z=void 0;try{for(var $=L[Symbol.iterator](),F;!(q=(F=$.next()).done)&&(B.push(F.value),!(D&&B.length===D));q=!0);}catch(Y){K=!0,z=Y}finally{try{!q&&$.return&&$.return()}finally{if(K)throw z}}return B}return function(L,D){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return M(L,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function M(L,D){for(var B=0;B<D.length;B++){var q=D[B];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(L,q.key,q)}}return function(L,D,B){return D&&M(L.prototype,D),B&&M(L,B),L}}(),u=i(2),f=R(u),h=i(20),O=R(h),w=i(0),b=R(w),E=i(13),p=R(E),v=i(24),g=R(v),y=i(4),d=R(y),m=i(16),_=R(m),k=i(21),x=R(k),A=i(11),S=R(A),P=i(3),C=R(P);function R(M){return M&&M.__esModule?M:{default:M}}function N(M,L,D){return L in M?Object.defineProperty(M,L,{value:D,enumerable:!0,configurable:!0,writable:!0}):M[L]=D,M}function U(M,L){if(!(M instanceof L))throw new TypeError("Cannot call a class as a function")}var G=/^[ -~]*$/,Z=function(){function M(L){U(this,M),this.scroll=L,this.delta=this.getDelta()}return l(M,[{key:"applyDelta",value:function(D){var B=this,q=!1;this.scroll.update();var K=this.scroll.length();return this.scroll.batchStart(),D=H(D),D.reduce(function(z,$){var F=$.retain||$.delete||$.insert.length||1,Y=$.attributes||{};if($.insert!=null){if(typeof $.insert=="string"){var X=$.insert;X.endsWith(`
|
|
127
|
+
`)&&q&&(q=!1,X=X.slice(0,-1)),z>=K&&!X.endsWith(`
|
|
128
|
+
`)&&(q=!0),B.scroll.insertAt(z,X);var Q=B.scroll.line(z),ee=o(Q,2),re=ee[0],oe=ee[1],ae=(0,C.default)({},(0,y.bubbleFormats)(re));if(re instanceof d.default){var ie=re.descendant(b.default.Leaf,oe),Re=o(ie,1),Me=Re[0];ae=(0,C.default)(ae,(0,y.bubbleFormats)(Me))}Y=O.default.attributes.diff(ae,Y)||{}}else if(a($.insert)==="object"){var ne=Object.keys($.insert)[0];if(ne==null)return z;B.scroll.insertAt(z,ne,$.insert[ne])}K+=F}return Object.keys(Y).forEach(function(le){B.scroll.formatAt(z,F,le,Y[le])}),z+F},0),D.reduce(function(z,$){return typeof $.delete=="number"?(B.scroll.deleteAt(z,$.delete),z):z+($.retain||$.insert.length||1)},0),this.scroll.batchEnd(),this.update(D)}},{key:"deleteText",value:function(D,B){return this.scroll.deleteAt(D,B),this.update(new f.default().retain(D).delete(B))}},{key:"formatLine",value:function(D,B){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(K).forEach(function(z){if(!(q.scroll.whitelist!=null&&!q.scroll.whitelist[z])){var $=q.scroll.lines(D,Math.max(B,1)),F=B;$.forEach(function(Y){var X=Y.length();if(!(Y instanceof p.default))Y.format(z,K[z]);else{var Q=D-Y.offset(q.scroll),ee=Y.newlineIndex(Q+F)-Q+1;Y.formatAt(Q,ee,z,K[z])}F-=X})}}),this.scroll.optimize(),this.update(new f.default().retain(D).retain(B,(0,x.default)(K)))}},{key:"formatText",value:function(D,B){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(K).forEach(function(z){q.scroll.formatAt(D,B,z,K[z])}),this.update(new f.default().retain(D).retain(B,(0,x.default)(K)))}},{key:"getContents",value:function(D,B){return this.delta.slice(D,D+B)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(D,B){return D.concat(B.delta())},new f.default)}},{key:"getFormat",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,q=[],K=[];B===0?this.scroll.path(D).forEach(function($){var F=o($,1),Y=F[0];Y instanceof d.default?q.push(Y):Y instanceof b.default.Leaf&&K.push(Y)}):(q=this.scroll.lines(D,B),K=this.scroll.descendants(b.default.Leaf,D,B));var z=[q,K].map(function($){if($.length===0)return{};for(var F=(0,y.bubbleFormats)($.shift());Object.keys(F).length>0;){var Y=$.shift();if(Y==null)return F;F=W((0,y.bubbleFormats)(Y),F)}return F});return C.default.apply(C.default,z)}},{key:"getText",value:function(D,B){return this.getContents(D,B).filter(function(q){return typeof q.insert=="string"}).map(function(q){return q.insert}).join("")}},{key:"insertEmbed",value:function(D,B,q){return this.scroll.insertAt(D,B,q),this.update(new f.default().retain(D).insert(N({},B,q)))}},{key:"insertText",value:function(D,B){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return B=B.replace(/\r\n/g,`
|
|
129
|
+
`).replace(/\r/g,`
|
|
130
|
+
`),this.scroll.insertAt(D,B),Object.keys(K).forEach(function(z){q.scroll.formatAt(D,B.length,z,K[z])}),this.update(new f.default().retain(D).insert(B,(0,x.default)(K)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var D=this.scroll.children.head;return D.statics.blotName!==d.default.blotName||D.children.length>1?!1:D.children.head instanceof _.default}},{key:"removeFormat",value:function(D,B){var q=this.getText(D,B),K=this.scroll.line(D+B),z=o(K,2),$=z[0],F=z[1],Y=0,X=new f.default;$!=null&&($ instanceof p.default?Y=$.newlineIndex(F)-F+1:Y=$.length()-F,X=$.delta().slice(F,F+Y-1).insert(`
|
|
131
|
+
`));var Q=this.getContents(D,B+Y),ee=Q.diff(new f.default().insert(q).concat(X)),re=new f.default().retain(D).concat(ee);return this.applyDelta(re)}},{key:"update",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,K=this.delta;if(B.length===1&&B[0].type==="characterData"&&B[0].target.data.match(G)&&b.default.find(B[0].target)){var z=b.default.find(B[0].target),$=(0,y.bubbleFormats)(z),F=z.offset(this.scroll),Y=B[0].oldValue.replace(g.default.CONTENTS,""),X=new f.default().insert(Y),Q=new f.default().insert(z.value()),ee=new f.default().retain(F).concat(X.diff(Q,q));D=ee.reduce(function(re,oe){return oe.insert?re.insert(oe.insert,$):re.push(oe)},new f.default),this.delta=K.compose(D)}else this.delta=this.getDelta(),(!D||!(0,S.default)(K.compose(D),this.delta))&&(D=K.diff(this.delta,q));return D}}]),M}();function W(M,L){return Object.keys(L).reduce(function(D,B){return M[B]==null||(L[B]===M[B]?D[B]=L[B]:Array.isArray(L[B])?L[B].indexOf(M[B])<0&&(D[B]=L[B].concat([M[B]])):D[B]=[L[B],M[B]]),D},{})}function H(M){return M.reduce(function(L,D){if(D.insert===1){var B=(0,x.default)(D.attributes);return delete B.image,L.insert({image:D.attributes.image},B)}if(D.attributes!=null&&(D.attributes.list===!0||D.attributes.bullet===!0)&&(D=(0,x.default)(D),D.attributes.list?D.attributes.list="ordered":(D.attributes.list="bullet",delete D.attributes.bullet)),typeof D.insert=="string"){var q=D.insert.replace(/\r\n/g,`
|
|
132
|
+
`).replace(/\r/g,`
|
|
133
|
+
`);return L.insert(q,D.attributes)}return L.push(D)},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 A(S,P){var C=[],R=!0,N=!1,U=void 0;try{for(var G=S[Symbol.iterator](),Z;!(R=(Z=G.next()).done)&&(C.push(Z.value),!(P&&C.length===P));R=!0);}catch(W){N=!0,U=W}finally{try{!R&&G.return&&G.return()}finally{if(N)throw U}}return C}return function(S,P){if(Array.isArray(S))return S;if(Symbol.iterator in Object(S))return A(S,P);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function A(S,P){for(var C=0;C<P.length;C++){var R=P[C];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(S,R.key,R)}}return function(S,P,C){return P&&A(S.prototype,P),C&&A(S,C),S}}(),l=i(0),u=g(l),f=i(21),h=g(f),O=i(11),w=g(O),b=i(8),E=g(b),p=i(10),v=g(p);function g(A){return A&&A.__esModule?A:{default:A}}function y(A){if(Array.isArray(A)){for(var S=0,P=Array(A.length);S<A.length;S++)P[S]=A[S];return P}else return Array.from(A)}function d(A,S){if(!(A instanceof S))throw new TypeError("Cannot call a class as a function")}var m=(0,v.default)("quill:selection"),_=function A(S){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,A),this.index=S,this.length=P},k=function(){function A(S,P){var C=this;d(this,A),this.emitter=P,this.scroll=S,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new _(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){C.mouseDown||setTimeout(C.update.bind(C,E.default.sources.USER),1)}),this.emitter.on(E.default.events.EDITOR_CHANGE,function(R,N){R===E.default.events.TEXT_CHANGE&&N.length()>0&&C.update(E.default.sources.SILENT)}),this.emitter.on(E.default.events.SCROLL_BEFORE_UPDATE,function(){if(C.hasFocus()){var R=C.getNativeRange();R!=null&&R.start.node!==C.cursor.textNode&&C.emitter.once(E.default.events.SCROLL_UPDATE,function(){try{C.setNativeRange(R.start.node,R.start.offset,R.end.node,R.end.offset)}catch{}})}}),this.emitter.on(E.default.events.SCROLL_OPTIMIZE,function(R,N){if(N.range){var U=N.range,G=U.startNode,Z=U.startOffset,W=U.endNode,H=U.endOffset;C.setNativeRange(G,Z,W,H)}}),this.update(E.default.sources.SILENT)}return o(A,[{key:"handleComposition",value:function(){var P=this;this.root.addEventListener("compositionstart",function(){P.composing=!0}),this.root.addEventListener("compositionend",function(){if(P.composing=!1,P.cursor.parent){var C=P.cursor.restore();if(!C)return;setTimeout(function(){P.setNativeRange(C.startNode,C.startOffset,C.endNode,C.endOffset)},1)}})}},{key:"handleDragging",value:function(){var P=this;this.emitter.listenDOM("mousedown",document.body,function(){P.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){P.mouseDown=!1,P.update(E.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(P,C){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[P])){this.scroll.update();var R=this.getNativeRange();if(!(R==null||!R.native.collapsed||u.default.query(P,u.default.Scope.BLOCK))){if(R.start.node!==this.cursor.textNode){var N=u.default.find(R.start.node,!1);if(N==null)return;if(N instanceof u.default.Leaf){var U=N.split(R.start.offset);N.parent.insertBefore(this.cursor,U)}else N.insertBefore(this.cursor,R.start.node);this.cursor.attach()}this.cursor.format(P,C),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(P){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,R=this.scroll.length();P=Math.min(P,R-1),C=Math.min(P+C,R-1)-P;var N=void 0,U=this.scroll.leaf(P),G=a(U,2),Z=G[0],W=G[1];if(Z==null)return null;var H=Z.position(W,!0),M=a(H,2);N=M[0],W=M[1];var L=document.createRange();if(C>0){L.setStart(N,W);var D=this.scroll.leaf(P+C),B=a(D,2);if(Z=B[0],W=B[1],Z==null)return null;var q=Z.position(W,!0),K=a(q,2);return N=K[0],W=K[1],L.setEnd(N,W),L.getBoundingClientRect()}else{var z="left",$=void 0;return N instanceof Text?(W<N.data.length?(L.setStart(N,W),L.setEnd(N,W+1)):(L.setStart(N,W-1),L.setEnd(N,W),z="right"),$=L.getBoundingClientRect()):($=Z.domNode.getBoundingClientRect(),W>0&&(z="right")),{bottom:$.top+$.height,height:$.height,left:$[z],right:$[z],top:$.top,width:0}}}},{key:"getNativeRange",value:function(){var P=document.getSelection();if(P==null||P.rangeCount<=0)return null;var C=P.getRangeAt(0);if(C==null)return null;var R=this.normalizeNative(C);return m.info("getNativeRange",R),R}},{key:"getRange",value:function(){var P=this.getNativeRange();if(P==null)return[null,null];var C=this.normalizedToRange(P);return[C,P]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(P){var C=this,R=[[P.start.node,P.start.offset]];P.native.collapsed||R.push([P.end.node,P.end.offset]);var N=R.map(function(Z){var W=a(Z,2),H=W[0],M=W[1],L=u.default.find(H,!0),D=L.offset(C.scroll);return M===0?D:L instanceof u.default.Container?D+L.length():D+L.index(H,M)}),U=Math.min(Math.max.apply(Math,y(N)),this.scroll.length()-1),G=Math.min.apply(Math,[U].concat(y(N)));return new _(G,U-G)}},{key:"normalizeNative",value:function(P){if(!x(this.root,P.startContainer)||!P.collapsed&&!x(this.root,P.endContainer))return null;var C={start:{node:P.startContainer,offset:P.startOffset},end:{node:P.endContainer,offset:P.endOffset},native:P};return[C.start,C.end].forEach(function(R){for(var N=R.node,U=R.offset;!(N instanceof Text)&&N.childNodes.length>0;)if(N.childNodes.length>U)N=N.childNodes[U],U=0;else if(N.childNodes.length===U)N=N.lastChild,U=N instanceof Text?N.data.length:N.childNodes.length+1;else break;R.node=N,R.offset=U}),C}},{key:"rangeToNative",value:function(P){var C=this,R=P.collapsed?[P.index]:[P.index,P.index+P.length],N=[],U=this.scroll.length();return R.forEach(function(G,Z){G=Math.min(U-1,G);var W=void 0,H=C.scroll.leaf(G),M=a(H,2),L=M[0],D=M[1],B=L.position(D,Z!==0),q=a(B,2);W=q[0],D=q[1],N.push(W,D)}),N.length<2&&(N=N.concat(N)),N}},{key:"scrollIntoView",value:function(P){var C=this.lastRange;if(C!=null){var R=this.getBounds(C.index,C.length);if(R!=null){var N=this.scroll.length()-1,U=this.scroll.line(Math.min(C.index,N)),G=a(U,1),Z=G[0],W=Z;if(C.length>0){var H=this.scroll.line(Math.min(C.index+C.length,N)),M=a(H,1);W=M[0]}if(!(Z==null||W==null)){var L=P.getBoundingClientRect();R.top<L.top?P.scrollTop-=L.top-R.top:R.bottom>L.bottom&&(P.scrollTop+=R.bottom-L.bottom)}}}}},{key:"setNativeRange",value:function(P,C){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:P,N=arguments.length>3&&arguments[3]!==void 0?arguments[3]:C,U=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(m.info("setNativeRange",P,C,R,N),!(P!=null&&(this.root.parentNode==null||P.parentNode==null||R.parentNode==null))){var G=document.getSelection();if(G!=null)if(P!=null){this.hasFocus()||this.root.focus();var Z=(this.getNativeRange()||{}).native;if(Z==null||U||P!==Z.startContainer||C!==Z.startOffset||R!==Z.endContainer||N!==Z.endOffset){P.tagName=="BR"&&(C=[].indexOf.call(P.parentNode.childNodes,P),P=P.parentNode),R.tagName=="BR"&&(N=[].indexOf.call(R.parentNode.childNodes,R),R=R.parentNode);var W=document.createRange();W.setStart(P,C),W.setEnd(R,N),G.removeAllRanges(),G.addRange(W)}}else G.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(P){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E.default.sources.API;if(typeof C=="string"&&(R=C,C=!1),m.info("setRange",P),P!=null){var N=this.rangeToNative(P);this.setNativeRange.apply(this,y(N).concat([C]))}else this.setNativeRange(null);this.update(R)}},{key:"update",value:function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E.default.sources.USER,C=this.lastRange,R=this.getRange(),N=a(R,2),U=N[0],G=N[1];if(this.lastRange=U,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,w.default)(C,this.lastRange)){var Z;!this.composing&&G!=null&&G.native.collapsed&&G.start.node!==this.cursor.textNode&&this.cursor.restore();var W=[E.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(C),P];if((Z=this.emitter).emit.apply(Z,[E.default.events.EDITOR_CHANGE].concat(W)),P!==E.default.sources.SILENT){var H;(H=this.emitter).emit.apply(H,W)}}}}]),A}();function x(A,S){try{S.parentNode}catch{return!1}return S instanceof Text&&(S=S.parentNode),A.contains(S)}n.Range=_,n.default=k},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(p,v){for(var g=0;g<v.length;g++){var y=v[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(p,y.key,y)}}return function(p,v,g){return v&&E(p.prototype,v),g&&E(p,g),p}}(),o=function E(p,v,g){p===null&&(p=Function.prototype);var y=Object.getOwnPropertyDescriptor(p,v);if(y===void 0){var d=Object.getPrototypeOf(p);return d===null?void 0:E(d,v,g)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(g)}},l=i(0),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function h(E,p){if(!(E instanceof p))throw new TypeError("Cannot call a class as a function")}function O(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 w(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 b=function(E){w(p,E);function p(){return h(this,p),O(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"insertInto",value:function(g,y){g.children.length===0?o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"insertInto",this).call(this,g,y):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),p}(u.default.Embed);b.blotName="break",b.tagName="BR",n.default=b},function(r,n,i){var a=this&&this.__extends||function(){var O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,b){w.__proto__=b}||function(w,b){for(var E in b)b.hasOwnProperty(E)&&(w[E]=b[E])};return function(w,b){O(w,b);function E(){this.constructor=w}w.prototype=b===null?Object.create(b):(E.prototype=b.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(44),l=i(30),u=i(1),f=function(O){a(w,O);function w(b){var E=O.call(this,b)||this;return E.build(),E}return w.prototype.appendChild=function(b){this.insertBefore(b)},w.prototype.attach=function(){O.prototype.attach.call(this),this.children.forEach(function(b){b.attach()})},w.prototype.build=function(){var b=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(E){try{var p=h(E);b.insertBefore(p,b.children.head||void 0)}catch(v){if(v instanceof u.ParchmentError)return;throw v}})},w.prototype.deleteAt=function(b,E){if(b===0&&E===this.length())return this.remove();this.children.forEachAt(b,E,function(p,v,g){p.deleteAt(v,g)})},w.prototype.descendant=function(b,E){var p=this.children.find(E),v=p[0],g=p[1];return b.blotName==null&&b(v)||b.blotName!=null&&v instanceof b?[v,g]:v instanceof w?v.descendant(b,g):[null,-1]},w.prototype.descendants=function(b,E,p){E===void 0&&(E=0),p===void 0&&(p=Number.MAX_VALUE);var v=[],g=p;return this.children.forEachAt(E,p,function(y,d,m){(b.blotName==null&&b(y)||b.blotName!=null&&y instanceof b)&&v.push(y),y instanceof w&&(v=v.concat(y.descendants(b,d,g))),g-=m}),v},w.prototype.detach=function(){this.children.forEach(function(b){b.detach()}),O.prototype.detach.call(this)},w.prototype.formatAt=function(b,E,p,v){this.children.forEachAt(b,E,function(g,y,d){g.formatAt(y,d,p,v)})},w.prototype.insertAt=function(b,E,p){var v=this.children.find(b),g=v[0],y=v[1];if(g)g.insertAt(y,E,p);else{var d=p==null?u.create("text",E):u.create(E,p);this.appendChild(d)}},w.prototype.insertBefore=function(b,E){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(p){return b instanceof p}))throw new u.ParchmentError("Cannot insert "+b.statics.blotName+" into "+this.statics.blotName);b.insertInto(this,E)},w.prototype.length=function(){return this.children.reduce(function(b,E){return b+E.length()},0)},w.prototype.moveChildren=function(b,E){this.children.forEach(function(p){b.insertBefore(p,E)})},w.prototype.optimize=function(b){if(O.prototype.optimize.call(this,b),this.children.length===0)if(this.statics.defaultChild!=null){var E=u.create(this.statics.defaultChild);this.appendChild(E),E.optimize(b)}else this.remove()},w.prototype.path=function(b,E){E===void 0&&(E=!1);var p=this.children.find(b,E),v=p[0],g=p[1],y=[[this,b]];return v instanceof w?y.concat(v.path(g,E)):(v!=null&&y.push([v,g]),y)},w.prototype.removeChild=function(b){this.children.remove(b)},w.prototype.replace=function(b){b instanceof w&&b.moveChildren(this),O.prototype.replace.call(this,b)},w.prototype.split=function(b,E){if(E===void 0&&(E=!1),!E){if(b===0)return this;if(b===this.length())return this.next}var p=this.clone();return this.parent.insertBefore(p,this.next),this.children.forEachAt(b,this.length(),function(v,g,y){v=v.split(g,E),p.appendChild(v)}),p},w.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},w.prototype.update=function(b,E){var p=this,v=[],g=[];b.forEach(function(y){y.target===p.domNode&&y.type==="childList"&&(v.push.apply(v,y.addedNodes),g.push.apply(g,y.removedNodes))}),g.forEach(function(y){if(!(y.parentNode!=null&&y.tagName!=="IFRAME"&&document.body.compareDocumentPosition(y)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var d=u.find(y);d!=null&&(d.domNode.parentNode==null||d.domNode.parentNode===p.domNode)&&d.detach()}}),v.filter(function(y){return y.parentNode==p.domNode}).sort(function(y,d){return y===d?0:y.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(y){var d=null;y.nextSibling!=null&&(d=u.find(y.nextSibling));var m=h(y);(m.next!=d||m.next==null)&&(m.parent!=null&&m.parent.removeChild(p),p.insertBefore(m,d||void 0))})},w}(l.default);function h(O){var w=u.find(O);if(w==null)try{w=u.create(O)}catch{w=u.create(u.Scope.INLINE),[].slice.call(O.childNodes).forEach(function(E){w.domNode.appendChild(E)}),O.parentNode&&O.parentNode.replaceChild(w.domNode,O),w.attach()}return w}n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,b){w.__proto__=b}||function(w,b){for(var E in b)b.hasOwnProperty(E)&&(w[E]=b[E])};return function(w,b){O(w,b);function E(){this.constructor=w}w.prototype=b===null?Object.create(b):(E.prototype=b.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),l=i(31),u=i(17),f=i(1),h=function(O){a(w,O);function w(b){var E=O.call(this,b)||this;return E.attributes=new l.default(E.domNode),E}return w.formats=function(b){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return b.tagName.toLowerCase()},w.prototype.format=function(b,E){var p=f.query(b);p instanceof o.default?this.attributes.attribute(p,E):E&&p!=null&&(b!==this.statics.blotName||this.formats()[b]!==E)&&this.replaceWith(b,E)},w.prototype.formats=function(){var b=this.attributes.values(),E=this.statics.formats(this.domNode);return E!=null&&(b[this.statics.blotName]=E),b},w.prototype.replaceWith=function(b,E){var p=O.prototype.replaceWith.call(this,b,E);return this.attributes.copy(p),p},w.prototype.update=function(b,E){var p=this;O.prototype.update.call(this,b,E),b.some(function(v){return v.target===p.domNode&&v.type==="attributes"})&&this.attributes.build()},w.prototype.wrap=function(b,E){var p=O.prototype.wrap.call(this,b,E);return p instanceof w&&p.statics.scope===this.statics.scope&&this.attributes.move(p),p},w}(u.default);n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,O){h.__proto__=O}||function(h,O){for(var w in O)O.hasOwnProperty(w)&&(h[w]=O[w])};return function(h,O){f(h,O);function w(){this.constructor=h}h.prototype=O===null?Object.create(O):(w.prototype=O.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),l=i(1),u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.value=function(O){return!0},h.prototype.index=function(O,w){return this.domNode===O||this.domNode.compareDocumentPosition(O)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(w,1):-1},h.prototype.position=function(O,w){var b=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return O>0&&(b+=1),[this.parent.domNode,b]},h.prototype.value=function(){var O;return O={},O[this.statics.blotName]=this.statics.value(this.domNode)||!0,O},h.scope=l.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),l={attributes:{compose:function(f,h,O){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var w=o(!0,{},h);O||(w=Object.keys(w).reduce(function(E,p){return w[p]!=null&&(E[p]=w[p]),E},{}));for(var b in f)f[b]!==void 0&&h[b]===void 0&&(w[b]=f[b]);return Object.keys(w).length>0?w:void 0},diff:function(f,h){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var O=Object.keys(f).concat(Object.keys(h)).reduce(function(w,b){return a(f[b],h[b])||(w[b]=h[b]===void 0?null:h[b]),w},{});return Object.keys(O).length>0?O:void 0},transform:function(f,h,O){if(typeof f!="object")return h;if(typeof h=="object"){if(!O)return h;var w=Object.keys(h).reduce(function(b,E){return f[E]===void 0&&(b[E]=h[E]),b},{});return Object.keys(w).length>0?w:void 0}}},iterator:function(f){return new u(f)},length:function(f){return typeof f.delete=="number"?f.delete:typeof f.retain=="number"?f.retain:typeof f.insert=="string"?f.insert.length:1}};function u(f){this.ops=f,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(f){f||(f=1/0);var h=this.ops[this.index];if(h){var O=this.offset,w=l.length(h);if(f>=w-O?(f=w-O,this.index+=1,this.offset=0):this.offset+=f,typeof h.delete=="number")return{delete:f};var b={};return h.attributes&&(b.attributes=h.attributes),typeof h.retain=="number"?b.retain=f:typeof h.insert=="string"?b.insert=h.insert.substr(O,f):b.insert=h.insert,b}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,h=this.index,O=this.next(),w=this.ops.slice(this.index);return this.offset=f,this.index=h,[O].concat(w)}else return[]},r.exports=l},function(r,n){var i=function(){function a(p,v){return v!=null&&p instanceof v}var o;try{o=Map}catch{o=function(){}}var l;try{l=Set}catch{l=function(){}}var u;try{u=Promise}catch{u=function(){}}function f(p,v,g,y,d){typeof v=="object"&&(g=v.depth,y=v.prototype,d=v.includeNonEnumerable,v=v.circular);var m=[],_=[],k=typeof Buffer<"u";typeof v>"u"&&(v=!0),typeof g>"u"&&(g=1/0);function x(A,S){if(A===null)return null;if(S===0)return A;var P,C;if(typeof A!="object")return A;if(a(A,o))P=new o;else if(a(A,l))P=new l;else if(a(A,u))P=new u(function(L,D){A.then(function(B){L(x(B,S-1))},function(B){D(x(B,S-1))})});else if(f.__isArray(A))P=[];else if(f.__isRegExp(A))P=new RegExp(A.source,E(A)),A.lastIndex&&(P.lastIndex=A.lastIndex);else if(f.__isDate(A))P=new Date(A.getTime());else{if(k&&Buffer.isBuffer(A))return Buffer.allocUnsafe?P=Buffer.allocUnsafe(A.length):P=new Buffer(A.length),A.copy(P),P;a(A,Error)?P=Object.create(A):typeof y>"u"?(C=Object.getPrototypeOf(A),P=Object.create(C)):(P=Object.create(y),C=y)}if(v){var R=m.indexOf(A);if(R!=-1)return _[R];m.push(A),_.push(P)}a(A,o)&&A.forEach(function(L,D){var B=x(D,S-1),q=x(L,S-1);P.set(B,q)}),a(A,l)&&A.forEach(function(L){var D=x(L,S-1);P.add(D)});for(var N in A){var U;C&&(U=Object.getOwnPropertyDescriptor(C,N)),!(U&&U.set==null)&&(P[N]=x(A[N],S-1))}if(Object.getOwnPropertySymbols)for(var G=Object.getOwnPropertySymbols(A),N=0;N<G.length;N++){var Z=G[N],W=Object.getOwnPropertyDescriptor(A,Z);W&&!W.enumerable&&!d||(P[Z]=x(A[Z],S-1),W.enumerable||Object.defineProperty(P,Z,{enumerable:!1}))}if(d)for(var H=Object.getOwnPropertyNames(A),N=0;N<H.length;N++){var M=H[N],W=Object.getOwnPropertyDescriptor(A,M);W&&W.enumerable||(P[M]=x(A[M],S-1),Object.defineProperty(P,M,{enumerable:!1}))}return P}return x(p,g)}f.clonePrototype=function(v){if(v===null)return null;var g=function(){};return g.prototype=v,new g};function h(p){return Object.prototype.toString.call(p)}f.__objToStr=h;function O(p){return typeof p=="object"&&h(p)==="[object Date]"}f.__isDate=O;function w(p){return typeof p=="object"&&h(p)==="[object Array]"}f.__isArray=w;function b(p){return typeof p=="object"&&h(p)==="[object RegExp]"}f.__isRegExp=b;function E(p){var v="";return p.global&&(v+="g"),p.ignoreCase&&(v+="i"),p.multiline&&(v+="m"),v}return f.__getRegExpFlags=E,f}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function P(C,R){var N=[],U=!0,G=!1,Z=void 0;try{for(var W=C[Symbol.iterator](),H;!(U=(H=W.next()).done)&&(N.push(H.value),!(R&&N.length===R));U=!0);}catch(M){G=!0,Z=M}finally{try{!U&&W.return&&W.return()}finally{if(G)throw Z}}return N}return function(C,R){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return P(C,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function P(C,R){for(var N=0;N<R.length;N++){var U=R[N];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(C,U.key,U)}}return function(C,R,N){return R&&P(C.prototype,R),N&&P(C,N),C}}(),l=function P(C,R,N){C===null&&(C=Function.prototype);var U=Object.getOwnPropertyDescriptor(C,R);if(U===void 0){var G=Object.getPrototypeOf(C);return G===null?void 0:P(G,R,N)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(N)}},u=i(0),f=m(u),h=i(8),O=m(h),w=i(4),b=m(w),E=i(16),p=m(E),v=i(13),g=m(v),y=i(25),d=m(y);function m(P){return P&&P.__esModule?P:{default:P}}function _(P,C){if(!(P instanceof C))throw new TypeError("Cannot call a class as a function")}function k(P,C){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:P}function x(P,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);P.prototype=Object.create(C&&C.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(P,C):P.__proto__=C)}function A(P){return P instanceof b.default||P instanceof w.BlockEmbed}var S=function(P){x(C,P);function C(R,N){_(this,C);var U=k(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,R));return U.emitter=N.emitter,Array.isArray(N.whitelist)&&(U.whitelist=N.whitelist.reduce(function(G,Z){return G[Z]=!0,G},{})),U.domNode.addEventListener("DOMNodeInserted",function(){}),U.optimize(),U.enable(),U}return o(C,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(N,U){var G=this.line(N),Z=a(G,2),W=Z[0],H=Z[1],M=this.line(N+U),L=a(M,1),D=L[0];if(l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"deleteAt",this).call(this,N,U),D!=null&&W!==D&&H>0){if(W instanceof w.BlockEmbed||D instanceof w.BlockEmbed){this.optimize();return}if(W instanceof g.default){var B=W.newlineIndex(W.length(),!0);if(B>-1&&(W=W.split(B+1),W===D)){this.optimize();return}}else if(D instanceof g.default){var q=D.newlineIndex(0);q>-1&&D.split(q+1)}var K=D.children.head instanceof p.default?null:D.children.head;W.moveChildren(D,K),W.remove()}this.optimize()}},{key:"enable",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",N)}},{key:"formatAt",value:function(N,U,G,Z){this.whitelist!=null&&!this.whitelist[G]||(l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"formatAt",this).call(this,N,U,G,Z),this.optimize())}},{key:"insertAt",value:function(N,U,G){if(!(G!=null&&this.whitelist!=null&&!this.whitelist[U])){if(N>=this.length())if(G==null||f.default.query(U,f.default.Scope.BLOCK)==null){var Z=f.default.create(this.statics.defaultChild);this.appendChild(Z),G==null&&U.endsWith(`
|
|
134
|
+
`)&&(U=U.slice(0,-1)),Z.insertAt(0,U,G)}else{var W=f.default.create(U,G);this.appendChild(W)}else l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,N,U,G);this.optimize()}}},{key:"insertBefore",value:function(N,U){if(N.statics.scope===f.default.Scope.INLINE_BLOT){var G=f.default.create(this.statics.defaultChild);G.appendChild(N),N=G}l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertBefore",this).call(this,N,U)}},{key:"leaf",value:function(N){return this.path(N).pop()||[null,-1]}},{key:"line",value:function(N){return N===this.length()?this.line(N-1):this.descendant(A,N)}},{key:"lines",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,G=function Z(W,H,M){var L=[],D=M;return W.children.forEachAt(H,M,function(B,q,K){A(B)?L.push(B):B instanceof f.default.Container&&(L=L.concat(Z(B,q,D))),D-=K}),L};return G(this,N,U)}},{key:"optimize",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"optimize",this).call(this,N,U),N.length>0&&this.emitter.emit(O.default.events.SCROLL_OPTIMIZE,N,U))}},{key:"path",value:function(N){return l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"path",this).call(this,N).slice(1)}},{key:"update",value:function(N){if(this.batch!==!0){var U=O.default.sources.USER;typeof N=="string"&&(U=N),Array.isArray(N)||(N=this.observer.takeRecords()),N.length>0&&this.emitter.emit(O.default.events.SCROLL_BEFORE_UPDATE,U,N),l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"update",this).call(this,N.concat([])),N.length>0&&this.emitter.emit(O.default.events.SCROLL_UPDATE,U,N)}}}]),C}(f.default.Scroll);S.blotName="scroll",S.className="ql-editor",S.tagName="DIV",S.defaultChild="block",S.allowedChildren=[b.default,w.BlockEmbed,d.default],n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},o=function(){function $(F,Y){var X=[],Q=!0,ee=!1,re=void 0;try{for(var oe=F[Symbol.iterator](),ae;!(Q=(ae=oe.next()).done)&&(X.push(ae.value),!(Y&&X.length===Y));Q=!0);}catch(ie){ee=!0,re=ie}finally{try{!Q&&oe.return&&oe.return()}finally{if(ee)throw re}}return X}return function(F,Y){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return $(F,Y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function $(F,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(F,Q.key,Q)}}return function(F,Y,X){return Y&&$(F.prototype,Y),X&&$(F,X),F}}(),u=i(21),f=P(u),h=i(11),O=P(h),w=i(3),b=P(w),E=i(2),p=P(E),v=i(20),g=P(v),y=i(0),d=P(y),m=i(5),_=P(m),k=i(10),x=P(k),A=i(9),S=P(A);function P($){return $&&$.__esModule?$:{default:$}}function C($,F,Y){return F in $?Object.defineProperty($,F,{value:Y,enumerable:!0,configurable:!0,writable:!0}):$[F]=Y,$}function R($,F){if(!($ instanceof F))throw new TypeError("Cannot call a class as a function")}function N($,F){if(!$)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:$}function U($,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);$.prototype=Object.create(F&&F.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf($,F):$.__proto__=F)}var G=(0,x.default)("quill:keyboard"),Z=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",W=function($){U(F,$),l(F,null,[{key:"match",value:function(X,Q){return Q=z(Q),["altKey","ctrlKey","metaKey","shiftKey"].some(function(ee){return!!Q[ee]!==X[ee]&&Q[ee]!==null})?!1:Q.key===(X.which||X.keyCode)}}]);function F(Y,X){R(this,F);var Q=N(this,(F.__proto__||Object.getPrototypeOf(F)).call(this,Y,X));return Q.bindings={},Object.keys(Q.options.bindings).forEach(function(ee){ee==="list autofill"&&Y.scroll.whitelist!=null&&!Y.scroll.whitelist.list||Q.options.bindings[ee]&&Q.addBinding(Q.options.bindings[ee])}),Q.addBinding({key:F.keys.ENTER,shiftKey:null},B),Q.addBinding({key:F.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(Q.addBinding({key:F.keys.BACKSPACE},{collapsed:!0},M),Q.addBinding({key:F.keys.DELETE},{collapsed:!0},L)):(Q.addBinding({key:F.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},M),Q.addBinding({key:F.keys.DELETE},{collapsed:!0,suffix:/^.?$/},L)),Q.addBinding({key:F.keys.BACKSPACE},{collapsed:!1},D),Q.addBinding({key:F.keys.DELETE},{collapsed:!1},D),Q.addBinding({key:F.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},M),Q.listen(),Q}return l(F,[{key:"addBinding",value:function(X){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},re=z(X);if(re==null||re.key==null)return G.warn("Attempted to add invalid keyboard binding",re);typeof Q=="function"&&(Q={handler:Q}),typeof ee=="function"&&(ee={handler:ee}),re=(0,b.default)(re,Q,ee),this.bindings[re.key]=this.bindings[re.key]||[],this.bindings[re.key].push(re)}},{key:"listen",value:function(){var X=this;this.quill.root.addEventListener("keydown",function(Q){if(!Q.defaultPrevented){var ee=Q.which||Q.keyCode,re=(X.bindings[ee]||[]).filter(function(Oe){return F.match(Q,Oe)});if(re.length!==0){var oe=X.quill.getSelection();if(!(oe==null||!X.quill.hasFocus())){var ae=X.quill.getLine(oe.index),ie=o(ae,2),Re=ie[0],Me=ie[1],ne=X.quill.getLeaf(oe.index),le=o(ne,2),be=le[0],ye=le[1],te=oe.length===0?[be,ye]:X.quill.getLeaf(oe.index+oe.length),de=o(te,2),he=de[0],Se=de[1],$e=be instanceof d.default.Text?be.value().slice(0,ye):"",tt=he instanceof d.default.Text?he.value().slice(Se):"",Ae={collapsed:oe.length===0,empty:oe.length===0&&Re.length()<=1,format:X.quill.getFormat(oe),offset:Me,prefix:$e,suffix:tt},Ce=re.some(function(Oe){if(Oe.collapsed!=null&&Oe.collapsed!==Ae.collapsed||Oe.empty!=null&&Oe.empty!==Ae.empty||Oe.offset!=null&&Oe.offset!==Ae.offset)return!1;if(Array.isArray(Oe.format)){if(Oe.format.every(function(Fe){return Ae.format[Fe]==null}))return!1}else if(a(Oe.format)==="object"&&!Object.keys(Oe.format).every(function(Fe){return Oe.format[Fe]===!0?Ae.format[Fe]!=null:Oe.format[Fe]===!1?Ae.format[Fe]==null:(0,O.default)(Oe.format[Fe],Ae.format[Fe])}))return!1;return Oe.prefix!=null&&!Oe.prefix.test(Ae.prefix)||Oe.suffix!=null&&!Oe.suffix.test(Ae.suffix)?!1:Oe.handler.call(X,oe,Ae)!==!0});Ce&&Q.preventDefault()}}}})}}]),F}(S.default);W.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},W.DEFAULTS={bindings:{bold:K("bold"),italic:K("italic"),underline:K("underline"),indent:{key:W.keys.TAB,format:["blockquote","indent","list"],handler:function(F,Y){if(Y.collapsed&&Y.offset!==0)return!0;this.quill.format("indent","+1",_.default.sources.USER)}},outdent:{key:W.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(F,Y){if(Y.collapsed&&Y.offset!==0)return!0;this.quill.format("indent","-1",_.default.sources.USER)}},"outdent backspace":{key:W.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(F,Y){Y.format.indent!=null?this.quill.format("indent","-1",_.default.sources.USER):Y.format.list!=null&&this.quill.format("list",!1,_.default.sources.USER)}},"indent code-block":q(!0),"outdent code-block":q(!1),"remove tab":{key:W.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(F){this.quill.deleteText(F.index-1,1,_.default.sources.USER)}},tab:{key:W.keys.TAB,handler:function(F){this.quill.history.cutoff();var Y=new p.default().retain(F.index).delete(F.length).insert(" ");this.quill.updateContents(Y,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(F.index+1,_.default.sources.SILENT)}},"list empty enter":{key:W.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(F,Y){this.quill.format("list",!1,_.default.sources.USER),Y.format.indent&&this.quill.format("indent",!1,_.default.sources.USER)}},"checklist enter":{key:W.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(F){var Y=this.quill.getLine(F.index),X=o(Y,2),Q=X[0],ee=X[1],re=(0,b.default)({},Q.formats(),{list:"checked"}),oe=new p.default().retain(F.index).insert(`
|
|
135
|
+
`,re).retain(Q.length()-ee-1).retain(1,{list:"unchecked"});this.quill.updateContents(oe,_.default.sources.USER),this.quill.setSelection(F.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:W.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(F,Y){var X=this.quill.getLine(F.index),Q=o(X,2),ee=Q[0],re=Q[1],oe=new p.default().retain(F.index).insert(`
|
|
136
|
+
`,Y.format).retain(ee.length()-re-1).retain(1,{header:null});this.quill.updateContents(oe,_.default.sources.USER),this.quill.setSelection(F.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(F,Y){var X=Y.prefix.length,Q=this.quill.getLine(F.index),ee=o(Q,2),re=ee[0],oe=ee[1];if(oe>X)return!0;var ae=void 0;switch(Y.prefix.trim()){case"[]":case"[ ]":ae="unchecked";break;case"[x]":ae="checked";break;case"-":case"*":ae="bullet";break;default:ae="ordered"}this.quill.insertText(F.index," ",_.default.sources.USER),this.quill.history.cutoff();var ie=new p.default().retain(F.index-oe).delete(X+1).retain(re.length()-2-oe).retain(1,{list:ae});this.quill.updateContents(ie,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(F.index-X,_.default.sources.SILENT)}},"code exit":{key:W.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(F){var Y=this.quill.getLine(F.index),X=o(Y,2),Q=X[0],ee=X[1],re=new p.default().retain(F.index+Q.length()-ee-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(re,_.default.sources.USER)}},"embed left":H(W.keys.LEFT,!1),"embed left shift":H(W.keys.LEFT,!0),"embed right":H(W.keys.RIGHT,!1),"embed right shift":H(W.keys.RIGHT,!0)}};function H($,F){var Y,X=$===W.keys.LEFT?"prefix":"suffix";return Y={key:$,shiftKey:F,altKey:null},C(Y,X,/^$/),C(Y,"handler",function(ee){var re=ee.index;$===W.keys.RIGHT&&(re+=ee.length+1);var oe=this.quill.getLeaf(re),ae=o(oe,1),ie=ae[0];return ie instanceof d.default.Embed?($===W.keys.LEFT?F?this.quill.setSelection(ee.index-1,ee.length+1,_.default.sources.USER):this.quill.setSelection(ee.index-1,_.default.sources.USER):F?this.quill.setSelection(ee.index,ee.length+1,_.default.sources.USER):this.quill.setSelection(ee.index+ee.length+1,_.default.sources.USER),!1):!0}),Y}function M($,F){if(!($.index===0||this.quill.getLength()<=1)){var Y=this.quill.getLine($.index),X=o(Y,1),Q=X[0],ee={};if(F.offset===0){var re=this.quill.getLine($.index-1),oe=o(re,1),ae=oe[0];if(ae!=null&&ae.length()>1){var ie=Q.formats(),Re=this.quill.getFormat($.index-1,1);ee=g.default.attributes.diff(ie,Re)||{}}}var Me=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(F.prefix)?2:1;this.quill.deleteText($.index-Me,Me,_.default.sources.USER),Object.keys(ee).length>0&&this.quill.formatLine($.index-Me,Me,ee,_.default.sources.USER),this.quill.focus()}}function L($,F){var Y=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(F.suffix)?2:1;if(!($.index>=this.quill.getLength()-Y)){var X={},Q=0,ee=this.quill.getLine($.index),re=o(ee,1),oe=re[0];if(F.offset>=oe.length()-1){var ae=this.quill.getLine($.index+1),ie=o(ae,1),Re=ie[0];if(Re){var Me=oe.formats(),ne=this.quill.getFormat($.index,1);X=g.default.attributes.diff(Me,ne)||{},Q=Re.length()}}this.quill.deleteText($.index,Y,_.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine($.index+Q-1,Y,X,_.default.sources.USER)}}function D($){var F=this.quill.getLines($),Y={};if(F.length>1){var X=F[0].formats(),Q=F[F.length-1].formats();Y=g.default.attributes.diff(Q,X)||{}}this.quill.deleteText($,_.default.sources.USER),Object.keys(Y).length>0&&this.quill.formatLine($.index,1,Y,_.default.sources.USER),this.quill.setSelection($.index,_.default.sources.SILENT),this.quill.focus()}function B($,F){var Y=this;$.length>0&&this.quill.scroll.deleteAt($.index,$.length);var X=Object.keys(F.format).reduce(function(Q,ee){return d.default.query(ee,d.default.Scope.BLOCK)&&!Array.isArray(F.format[ee])&&(Q[ee]=F.format[ee]),Q},{});this.quill.insertText($.index,`
|
|
137
|
+
`,X,_.default.sources.USER),this.quill.setSelection($.index+1,_.default.sources.SILENT),this.quill.focus(),Object.keys(F.format).forEach(function(Q){X[Q]==null&&(Array.isArray(F.format[Q])||Q!=="link"&&Y.quill.format(Q,F.format[Q],_.default.sources.USER))})}function q($){return{key:W.keys.TAB,shiftKey:!$,format:{"code-block":!0},handler:function(Y){var X=d.default.query("code-block"),Q=Y.index,ee=Y.length,re=this.quill.scroll.descendant(X,Q),oe=o(re,2),ae=oe[0],ie=oe[1];if(ae!=null){var Re=this.quill.getIndex(ae),Me=ae.newlineIndex(ie,!0)+1,ne=ae.newlineIndex(Re+ie+ee),le=ae.domNode.textContent.slice(Me,ne).split(`
|
|
138
|
+
`);ie=0,le.forEach(function(be,ye){$?(ae.insertAt(Me+ie,X.TAB),ie+=X.TAB.length,ye===0?Q+=X.TAB.length:ee+=X.TAB.length):be.startsWith(X.TAB)&&(ae.deleteAt(Me+ie,X.TAB.length),ie-=X.TAB.length,ye===0?Q-=X.TAB.length:ee-=X.TAB.length),ie+=be.length+1}),this.quill.update(_.default.sources.USER),this.quill.setSelection(Q,ee,_.default.sources.SILENT)}}}}function K($){return{key:$[0].toUpperCase(),shortKey:!0,handler:function(Y,X){this.quill.format($,!X.format[$],_.default.sources.USER)}}}function z($){if(typeof $=="string"||typeof $=="number")return z({key:$});if((typeof $>"u"?"undefined":a($))==="object"&&($=(0,f.default)($,!1)),typeof $.key=="string")if(W.keys[$.key.toUpperCase()]!=null)$.key=W.keys[$.key.toUpperCase()];else if($.key.length===1)$.key=$.key.toUpperCase().charCodeAt(0);else return null;return $.shortKey&&($[Z]=$.shortKey,delete $.shortKey),$}n.default=W,n.SHORTKEY=Z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function g(y,d){var m=[],_=!0,k=!1,x=void 0;try{for(var A=y[Symbol.iterator](),S;!(_=(S=A.next()).done)&&(m.push(S.value),!(d&&m.length===d));_=!0);}catch(P){k=!0,x=P}finally{try{!_&&A.return&&A.return()}finally{if(k)throw x}}return m}return function(y,d){if(Array.isArray(y))return y;if(Symbol.iterator in Object(y))return g(y,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function g(y,d,m){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var k=Object.getPrototypeOf(y);return k===null?void 0:g(k,d,m)}else{if("value"in _)return _.value;var x=_.get;return x===void 0?void 0:x.call(m)}},l=function(){function g(y,d){for(var m=0;m<d.length;m++){var _=d[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,d,m){return d&&g(y.prototype,d),m&&g(y,m),y}}(),u=i(0),f=w(u),h=i(7),O=w(h);function w(g){return g&&g.__esModule?g:{default:g}}function b(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}function E(g,y){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:g}function p(g,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);g.prototype=Object.create(y&&y.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(g,y):g.__proto__=y)}var v=function(g){p(y,g),l(y,null,[{key:"value",value:function(){}}]);function y(d,m){b(this,y);var _=E(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,d));return _.selection=m,_.textNode=document.createTextNode(y.CONTENTS),_.domNode.appendChild(_.textNode),_._length=0,_}return l(y,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(m,_){if(this._length!==0)return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,m,_);for(var k=this,x=0;k!=null&&k.statics.scope!==f.default.Scope.BLOCK_BLOT;)x+=k.offset(k.parent),k=k.parent;k!=null&&(this._length=y.CONTENTS.length,k.optimize(),k.formatAt(x,y.CONTENTS.length,m,_),this._length=0)}},{key:"index",value:function(m,_){return m===this.textNode?0:o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,m,_)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var m=this.textNode,_=this.selection.getNativeRange(),k=void 0,x=void 0,A=void 0;if(_!=null&&_.start.node===m&&_.end.node===m){var S=[m,_.start.offset,_.end.offset];k=S[0],x=S[1],A=S[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==y.CONTENTS){var P=this.textNode.data.split(y.CONTENTS).join("");this.next instanceof O.default?(k=this.next.domNode,this.next.insertAt(0,P),this.textNode.data=y.CONTENTS):(this.textNode.data=P,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(y.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),x!=null){var C=[x,A].map(function(N){return Math.max(0,Math.min(k.data.length,N-1))}),R=a(C,2);return x=R[0],A=R[1],{startNode:k,startOffset:x,endNode:k,endOffset:A}}}}},{key:"update",value:function(m,_){var k=this;if(m.some(function(A){return A.type==="characterData"&&A.target===k.textNode})){var x=this.restore();x&&(_.range=x)}}},{key:"value",value:function(){return""}}]),y}(f.default.Embed);v.blotName="cursor",v.className="ql-cursor",v.tagName="span",v.CONTENTS="\uFEFF",n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=f(a),l=i(4),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function h(E,p){if(!(E instanceof p))throw new TypeError("Cannot call a class as a function")}function O(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 w(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 b=function(E){w(p,E);function p(){return h(this,p),O(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default.Container);b.allowedChildren=[u.default,l.BlockEmbed,b],n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function v(g,y){for(var d=0;d<y.length;d++){var m=y[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(g,m.key,m)}}return function(g,y,d){return y&&v(g.prototype,y),d&&v(g,d),g}}(),o=function v(g,y,d){g===null&&(g=Function.prototype);var m=Object.getOwnPropertyDescriptor(g,y);if(m===void 0){var _=Object.getPrototypeOf(g);return _===null?void 0:v(_,y,d)}else{if("value"in m)return m.value;var k=m.get;return k===void 0?void 0:k.call(d)}},l=i(0),u=f(l);function f(v){return v&&v.__esModule?v:{default:v}}function h(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function O(v,g){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:v}function w(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);v.prototype=Object.create(g&&g.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(v,g):v.__proto__=g)}var b=function(v){w(g,v);function g(){return h(this,g),O(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,[{key:"value",value:function(d){var m=o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"value",this).call(this,d);return m.startsWith("rgb(")?(m=m.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+m.split(",").map(function(_){return("00"+parseInt(_).toString(16)).slice(-2)}).join("")):m}}]),g}(u.default.Attributor.Style),E=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),p=new b("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=b,n.ColorClass=E,n.ColorStyle=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function p(v,g){for(var y=0;y<g.length;y++){var d=g[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(v,d.key,d)}}return function(v,g,y){return g&&p(v.prototype,g),y&&p(v,y),v}}(),o=function p(v,g,y){v===null&&(v=Function.prototype);var d=Object.getOwnPropertyDescriptor(v,g);if(d===void 0){var m=Object.getPrototypeOf(v);return m===null?void 0:p(m,g,y)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(y)}},l=i(6),u=f(l);function f(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 O(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 b=function(p){w(v,p);function v(){return h(this,v),O(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"format",value:function(y,d){if(y!==this.statics.blotName||!d)return o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,y,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(y){var d=o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,y);return y=this.sanitize(y),d.setAttribute("href",y),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("target","_blank"),d}},{key:"formats",value:function(y){return y.getAttribute("href")}},{key:"sanitize",value:function(y){return E(y,this.PROTOCOL_WHITELIST)?y:this.SANITIZED_URL}}]),v}(u.default);b.blotName="link",b.tagName="A",b.SANITIZED_URL="about:blank",b.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function E(p,v){var g=document.createElement("a");g.href=p;var y=g.href.slice(0,g.href.indexOf(":"));return v.indexOf(y)>-1}n.default=b,n.sanitize=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},o=function(){function v(g,y){for(var d=0;d<y.length;d++){var m=y[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(g,m.key,m)}}return function(g,y,d){return y&&v(g.prototype,y),d&&v(g,d),g}}(),l=i(23),u=O(l),f=i(107),h=O(f);function O(v){return v&&v.__esModule?v:{default:v}}function w(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}var b=0;function E(v,g){v.setAttribute(g,v.getAttribute(g)!=="true")}var p=function(){function v(g){var y=this;w(this,v),this.select=g,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(){y.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case u.default.keys.ENTER:y.togglePicker();break;case u.default.keys.ESCAPE:y.escape(),d.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(v,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),E(this.label,"aria-expanded"),E(this.options,"aria-hidden")}},{key:"buildItem",value:function(y){var d=this,m=document.createElement("span");return m.tabIndex="0",m.setAttribute("role","button"),m.classList.add("ql-picker-item"),y.hasAttribute("value")&&m.setAttribute("data-value",y.getAttribute("value")),y.textContent&&m.setAttribute("data-label",y.textContent),m.addEventListener("click",function(){d.selectItem(m,!0)}),m.addEventListener("keydown",function(_){switch(_.keyCode){case u.default.keys.ENTER:d.selectItem(m,!0),_.preventDefault();break;case u.default.keys.ESCAPE:d.escape(),_.preventDefault();break}}),m}},{key:"buildLabel",value:function(){var y=document.createElement("span");return y.classList.add("ql-picker-label"),y.innerHTML=h.default,y.tabIndex="0",y.setAttribute("role","button"),y.setAttribute("aria-expanded","false"),this.container.appendChild(y),y}},{key:"buildOptions",value:function(){var y=this,d=document.createElement("span");d.classList.add("ql-picker-options"),d.setAttribute("aria-hidden","true"),d.tabIndex="-1",d.id="ql-picker-options-"+b,b+=1,this.label.setAttribute("aria-controls",d.id),this.options=d,[].slice.call(this.select.options).forEach(function(m){var _=y.buildItem(m);d.appendChild(_),m.selected===!0&&y.selectItem(_)}),this.container.appendChild(d)}},{key:"buildPicker",value:function(){var y=this;[].slice.call(this.select.attributes).forEach(function(d){y.container.setAttribute(d.name,d.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var y=this;this.close(),setTimeout(function(){return y.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(y){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m=this.container.querySelector(".ql-selected");if(y!==m&&(m!=null&&m.classList.remove("ql-selected"),y!=null&&(y.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(y.parentNode.children,y),y.hasAttribute("data-value")?this.label.setAttribute("data-value",y.getAttribute("data-value")):this.label.removeAttribute("data-value"),y.hasAttribute("data-label")?this.label.setAttribute("data-label",y.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 _=document.createEvent("Event");_.initEvent("change",!0,!0),this.select.dispatchEvent(_)}this.close()}}},{key:"update",value:function(){var y=void 0;if(this.select.selectedIndex>-1){var d=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];y=this.select.options[this.select.selectedIndex],this.selectItem(d)}else this.selectItem(null);var m=y!=null&&y!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",m)}}]),v}();n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=G(a),l=i(5),u=G(l),f=i(4),h=G(f),O=i(16),w=G(O),b=i(25),E=G(b),p=i(24),v=G(p),g=i(35),y=G(g),d=i(6),m=G(d),_=i(22),k=G(_),x=i(7),A=G(x),S=i(55),P=G(S),C=i(42),R=G(C),N=i(23),U=G(N);function G(Z){return Z&&Z.__esModule?Z:{default:Z}}u.default.register({"blots/block":h.default,"blots/block/embed":f.BlockEmbed,"blots/break":w.default,"blots/container":E.default,"blots/cursor":v.default,"blots/embed":y.default,"blots/inline":m.default,"blots/scroll":k.default,"blots/text":A.default,"modules/clipboard":P.default,"modules/history":R.default,"modules/keyboard":U.default}),o.default.register(h.default,w.default,v.default,m.default,k.default,A.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 h=this.isolate(u,f);h.remove()},l.prototype.formatAt=function(u,f,h,O){var w=this.isolate(u,f);if(a.query(h,a.Scope.BLOT)!=null&&O)w.wrap(h,O);else if(a.query(h,a.Scope.ATTRIBUTE)!=null){var b=a.create(this.statics.scope);w.wrap(b),b.format(h,O)}},l.prototype.insertAt=function(u,f,h){var O=h==null?a.create("text",f):a.create(f,h),w=this.split(u);this.parent.insertBefore(O,w)},l.prototype.insertInto=function(u,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var h=null;u.children.insertBefore(this,f),f!=null&&(h=f.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=h)&&u.domNode.insertBefore(this.domNode,h),this.parent=u,this.attach()},l.prototype.isolate=function(u,f){var h=this.split(u);return h.split(f),h},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 h=typeof u=="string"?a.create(u,f):u;return h.replace(this),h},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 h=typeof u=="string"?a.create(u,f):u;return this.parent!=null&&this.parent.insertBefore(h,this.next),h.appendChild(this),h},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 h(O){this.attributes={},this.domNode=O,this.build()}return h.prototype.attribute=function(O,w){w?O.add(this.domNode,w)&&(O.value(this.domNode)!=null?this.attributes[O.attrName]=O:delete this.attributes[O.attrName]):(O.remove(this.domNode),delete this.attributes[O.attrName])},h.prototype.build=function(){var O=this;this.attributes={};var w=a.default.keys(this.domNode),b=o.default.keys(this.domNode),E=l.default.keys(this.domNode);w.concat(b).concat(E).forEach(function(p){var v=u.query(p,u.Scope.ATTRIBUTE);v instanceof a.default&&(O.attributes[v.attrName]=v)})},h.prototype.copy=function(O){var w=this;Object.keys(this.attributes).forEach(function(b){var E=w.attributes[b].value(w.domNode);O.format(b,E)})},h.prototype.move=function(O){var w=this;this.copy(O),Object.keys(this.attributes).forEach(function(b){w.attributes[b].remove(w.domNode)}),this.attributes={}},h.prototype.values=function(){var O=this;return Object.keys(this.attributes).reduce(function(w,b){return w[b]=O.attributes[b].value(O.domNode),w},{})},h}();n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,O){h.__proto__=O}||function(h,O){for(var w in O)O.hasOwnProperty(w)&&(h[w]=O[w])};return function(h,O){f(h,O);function w(){this.constructor=h}h.prototype=O===null?Object.create(O):(w.prototype=O.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f,h){var O=f.getAttribute("class")||"";return O.split(/\s+/).filter(function(w){return w.indexOf(h+"-")===0})}var u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(O){return(O.getAttribute("class")||"").split(/\s+/).map(function(w){return w.split("-").slice(0,-1).join("-")})},h.prototype.add=function(O,w){return this.canAdd(O,w)?(this.remove(O),O.classList.add(this.keyName+"-"+w),!0):!1},h.prototype.remove=function(O){var w=l(O,this.keyName);w.forEach(function(b){O.classList.remove(b)}),O.classList.length===0&&O.removeAttribute("class")},h.prototype.value=function(O){var w=l(O,this.keyName)[0]||"",b=w.slice(this.keyName.length+1);return this.canAdd(O,b)?b:""},h}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,O){h.__proto__=O}||function(h,O){for(var w in O)O.hasOwnProperty(w)&&(h[w]=O[w])};return function(h,O){f(h,O);function w(){this.constructor=h}h.prototype=O===null?Object.create(O):(w.prototype=O.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f){var h=f.split("-"),O=h.slice(1).map(function(w){return w[0].toUpperCase()+w.slice(1)}).join("");return h[0]+O}var u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(O){return(O.getAttribute("style")||"").split(";").map(function(w){var b=w.split(":");return b[0].trim()})},h.prototype.add=function(O,w){return this.canAdd(O,w)?(O.style[l(this.keyName)]=w,!0):!1},h.prototype.remove=function(O){O.style[l(this.keyName)]="",O.getAttribute("style")||O.removeAttribute("style")},h.prototype.value=function(O){var w=O.style[l(this.keyName)];return this.canAdd(O,w)?w:""},h}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,h){for(var O=0;O<h.length;O++){var w=h[O];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,h,O){return h&&u(f.prototype,h),O&&u(f,O),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,h){o(this,u),this.quill=f,this.options=h,this.modules={}}return a(u,[{key:"init",value:function(){var h=this;Object.keys(this.options.modules).forEach(function(O){h.modules[O]==null&&h.addModule(O)})}},{key:"addModule",value:function(h){var O=this.quill.constructor.import("modules/"+h);return this.modules[h]=new O(this.quill,this.options.modules[h]||{}),this.modules[h]}}]),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 g(y,d){for(var m=0;m<d.length;m++){var _=d[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,d,m){return d&&g(y.prototype,d),m&&g(y,m),y}}(),o=function g(y,d,m){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var k=Object.getPrototypeOf(y);return k===null?void 0:g(k,d,m)}else{if("value"in _)return _.value;var x=_.get;return x===void 0?void 0:x.call(m)}},l=i(0),u=O(l),f=i(7),h=O(f);function O(g){return g&&g.__esModule?g:{default:g}}function w(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}function b(g,y){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:g}function E(g,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);g.prototype=Object.create(y&&y.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(g,y):g.__proto__=y)}var p="\uFEFF",v=function(g){E(y,g);function y(d){w(this,y);var m=b(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,d));return m.contentNode=document.createElement("span"),m.contentNode.setAttribute("contenteditable",!1),[].slice.call(m.domNode.childNodes).forEach(function(_){m.contentNode.appendChild(_)}),m.leftGuard=document.createTextNode(p),m.rightGuard=document.createTextNode(p),m.domNode.appendChild(m.leftGuard),m.domNode.appendChild(m.contentNode),m.domNode.appendChild(m.rightGuard),m}return a(y,[{key:"index",value:function(m,_){return m===this.leftGuard?0:m===this.rightGuard?1:o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,m,_)}},{key:"restore",value:function(m){var _=void 0,k=void 0,x=m.data.split(p).join("");if(m===this.leftGuard)if(this.prev instanceof h.default){var A=this.prev.length();this.prev.insertAt(A,x),_={startNode:this.prev.domNode,startOffset:A+x.length}}else k=document.createTextNode(x),this.parent.insertBefore(u.default.create(k),this),_={startNode:k,startOffset:x.length};else m===this.rightGuard&&(this.next instanceof h.default?(this.next.insertAt(0,x),_={startNode:this.next.domNode,startOffset:x.length}):(k=document.createTextNode(x),this.parent.insertBefore(u.default.create(k),this.next),_={startNode:k,startOffset:x.length}));return m.data=p,_}},{key:"update",value:function(m,_){var k=this;m.forEach(function(x){if(x.type==="characterData"&&(x.target===k.leftGuard||x.target===k.rightGuard)){var A=k.restore(x.target);A&&(_.range=A)}})}}]),y}(u.default.Embed);n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var a=i(0),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new o.default.Attributor.Attribute("align","align",u),h=new o.default.Attributor.Class("align","ql-align",u),O=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=f,n.AlignClass=h,n.AlignStyle=O},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(O){return O&&O.__esModule?O:{default:O}}var f=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),h=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var a=i(0),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},f=new o.default.Attributor.Attribute("direction","dir",u),h=new o.default.Attributor.Class("direction","ql-direction",u),O=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=f,n.DirectionClass=h,n.DirectionStyle=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function g(y,d){for(var m=0;m<d.length;m++){var _=d[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,d,m){return d&&g(y.prototype,d),m&&g(y,m),y}}(),o=function g(y,d,m){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var k=Object.getPrototypeOf(y);return k===null?void 0:g(k,d,m)}else{if("value"in _)return _.value;var x=_.get;return x===void 0?void 0:x.call(m)}},l=i(0),u=f(l);function f(g){return g&&g.__esModule?g:{default:g}}function h(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}function O(g,y){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:g}function w(g,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);g.prototype=Object.create(y&&y.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(g,y):g.__proto__=y)}var b={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},E=new u.default.Attributor.Class("font","ql-font",b),p=function(g){w(y,g);function y(){return h(this,y),O(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"value",value:function(m){return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,m).replace(/["']/g,"")}}]),y}(u.default.Attributor.Style),v=new p("font","font-family",b);n.FontStyle=v,n.FontClass=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var a=i(0),o=l(a);function l(h){return h&&h.__esModule?h:{default:h}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=f},function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var a=function(){function d(m,_){for(var k=0;k<_.length;k++){var x=_[k];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(m,x.key,x)}}return function(m,_,k){return _&&d(m.prototype,_),k&&d(m,k),m}}(),o=i(0),l=w(o),u=i(5),f=w(u),h=i(9),O=w(h);function w(d){return d&&d.__esModule?d:{default:d}}function b(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function E(d,m){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:d}function p(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}var v=function(d){p(m,d);function m(_,k){b(this,m);var x=E(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,_,k));return x.lastRecorded=0,x.ignoreChange=!1,x.clear(),x.quill.on(f.default.events.EDITOR_CHANGE,function(A,S,P,C){A!==f.default.events.TEXT_CHANGE||x.ignoreChange||(!x.options.userOnly||C===f.default.sources.USER?x.record(S,P):x.transform(S))}),x.quill.keyboard.addBinding({key:"Z",shortKey:!0},x.undo.bind(x)),x.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},x.redo.bind(x)),/Win/i.test(navigator.platform)&&x.quill.keyboard.addBinding({key:"Y",shortKey:!0},x.redo.bind(x)),x}return a(m,[{key:"change",value:function(k,x){if(this.stack[k].length!==0){var A=this.stack[k].pop();this.stack[x].push(A),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(A[k],f.default.sources.USER),this.ignoreChange=!1;var S=y(A[k]);this.quill.setSelection(S)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(k,x){if(k.ops.length!==0){this.stack.redo=[];var A=this.quill.getContents().diff(x),S=Date.now();if(this.lastRecorded+this.options.delay>S&&this.stack.undo.length>0){var P=this.stack.undo.pop();A=A.compose(P.undo),k=P.redo.compose(k)}else this.lastRecorded=S;this.stack.undo.push({redo:k,undo:A}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(k){this.stack.undo.forEach(function(x){x.undo=k.transform(x.undo,!0),x.redo=k.transform(x.redo,!0)}),this.stack.redo.forEach(function(x){x.undo=k.transform(x.undo,!0),x.redo=k.transform(x.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),m}(O.default);v.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function g(d){var m=d.ops[d.ops.length-1];return m==null?!1:m.insert!=null?typeof m.insert=="string"&&m.insert.endsWith(`
|
|
139
|
+
`):m.attributes!=null?Object.keys(m.attributes).some(function(_){return l.default.query(_,l.default.Scope.BLOCK)!=null}):!1}function y(d){var m=d.reduce(function(k,x){return k+=x.delete||0,k},0),_=d.length()-m;return g(d)&&(_-=1),_}n.default=v,n.getLastChangeIndex=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function B(q,K){for(var z=0;z<K.length;z++){var $=K[z];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(q,$.key,$)}}return function(q,K,z){return K&&B(q.prototype,K),z&&B(q,z),q}}(),o=function B(q,K,z){q===null&&(q=Function.prototype);var $=Object.getOwnPropertyDescriptor(q,K);if($===void 0){var F=Object.getPrototypeOf(q);return F===null?void 0:B(F,K,z)}else{if("value"in $)return $.value;var Y=$.get;return Y===void 0?void 0:Y.call(z)}},l=i(3),u=S(l),f=i(2),h=S(f),O=i(8),w=S(O),b=i(23),E=S(b),p=i(34),v=S(p),g=i(59),y=S(g),d=i(60),m=S(d),_=i(28),k=S(_),x=i(61),A=S(x);function S(B){return B&&B.__esModule?B:{default:B}}function P(B,q){if(!(B instanceof q))throw new TypeError("Cannot call a class as a function")}function C(B,q){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return q&&(typeof q=="object"||typeof q=="function")?q:B}function R(B,q){if(typeof q!="function"&&q!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof q);B.prototype=Object.create(q&&q.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),q&&(Object.setPrototypeOf?Object.setPrototypeOf(B,q):B.__proto__=q)}var N=[!1,"center","right","justify"],U=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],G=[!1,"serif","monospace"],Z=["1","2","3",!1],W=["small",!1,"large","huge"],H=function(B){R(q,B);function q(K,z){P(this,q);var $=C(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,K,z)),F=function Y(X){if(!document.body.contains(K.root))return document.body.removeEventListener("click",Y);$.tooltip!=null&&!$.tooltip.root.contains(X.target)&&document.activeElement!==$.tooltip.textbox&&!$.quill.hasFocus()&&$.tooltip.hide(),$.pickers!=null&&$.pickers.forEach(function(Q){Q.container.contains(X.target)||Q.close()})};return K.emitter.listenDOM("click",document.body,F),$}return a(q,[{key:"addModule",value:function(z){var $=o(q.prototype.__proto__||Object.getPrototypeOf(q.prototype),"addModule",this).call(this,z);return z==="toolbar"&&this.extendToolbar($),$}},{key:"buildButtons",value:function(z,$){z.forEach(function(F){var Y=F.getAttribute("class")||"";Y.split(/\s+/).forEach(function(X){if(X.startsWith("ql-")&&(X=X.slice(3),$[X]!=null))if(X==="direction")F.innerHTML=$[X][""]+$[X].rtl;else if(typeof $[X]=="string")F.innerHTML=$[X];else{var Q=F.value||"";Q!=null&&$[X][Q]&&(F.innerHTML=$[X][Q])}})})}},{key:"buildPickers",value:function(z,$){var F=this;this.pickers=z.map(function(X){if(X.classList.contains("ql-align"))return X.querySelector("option")==null&&D(X,N),new m.default(X,$.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&&D(X,U,Q==="background"?"#ffffff":"#000000"),new y.default(X,$[Q])}else return X.querySelector("option")==null&&(X.classList.contains("ql-font")?D(X,G):X.classList.contains("ql-header")?D(X,Z):X.classList.contains("ql-size")&&D(X,W)),new k.default(X)});var Y=function(){F.pickers.forEach(function(Q){Q.update()})};this.quill.on(w.default.events.EDITOR_CHANGE,Y)}}]),q}(v.default);H.DEFAULTS=(0,u.default)(!0,{},v.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var q=this,K=this.container.querySelector("input.ql-image[type=file]");K==null&&(K=document.createElement("input"),K.setAttribute("type","file"),K.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),K.classList.add("ql-image"),K.addEventListener("change",function(){if(K.files!=null&&K.files[0]!=null){var z=new FileReader;z.onload=function($){var F=q.quill.getSelection(!0);q.quill.updateContents(new h.default().retain(F.index).delete(F.length).insert({image:$.target.result}),w.default.sources.USER),q.quill.setSelection(F.index+1,w.default.sources.SILENT),K.value=""},z.readAsDataURL(K.files[0])}}),this.container.appendChild(K)),K.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var M=function(B){R(q,B);function q(K,z){P(this,q);var $=C(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,K,z));return $.textbox=$.root.querySelector('input[type="text"]'),$.listen(),$}return a(q,[{key:"listen",value:function(){var z=this;this.textbox.addEventListener("keydown",function($){E.default.match($,"enter")?(z.save(),$.preventDefault()):E.default.match($,"escape")&&(z.cancel(),$.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),$!=null?this.textbox.value=$:z!==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-"+z)||""),this.root.setAttribute("data-mode",z)}},{key:"restoreFocus",value:function(){var z=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=z}},{key:"save",value:function(){var z=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var $=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",z,w.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",z,w.default.sources.USER)),this.quill.root.scrollTop=$;break}case"video":z=L(z);case"formula":{if(!z)break;var F=this.quill.getSelection(!0);if(F!=null){var Y=F.index+F.length;this.quill.insertEmbed(Y,this.root.getAttribute("data-mode"),z,w.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(Y+1," ",w.default.sources.USER),this.quill.setSelection(Y+2,w.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),q}(A.default);function L(B){var q=B.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||B.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return q?(q[1]||"https")+"://www.youtube.com/embed/"+q[2]+"?showinfo=0":(q=B.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(q[1]||"https")+"://player.vimeo.com/video/"+q[2]+"/":B}function D(B,q){var K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;q.forEach(function(z){var $=document.createElement("option");z===K?$.setAttribute("selected","selected"):$.setAttribute("value",z),B.appendChild($)})}n.BaseTooltip=M,n.default=H},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,h=this.iterator();f=h();){var O=f.length();if(l<O||u&&l===O&&(f.next==null||f.next.length()!==0))return[f,l];l-=O}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 h=this.find(l),O=h[0],w=h[1],b,E=l-w,p=this.iterator(O);(b=p())&&E<l+u;){var v=b.length();l>E?f(b,l-E,Math.min(u,E+v-l)):f(b,0,Math.min(v,l+u-E)),E+=v}},o.prototype.map=function(l){return this.reduce(function(u,f){return u.push(l(f)),u},[])},o.prototype.reduce=function(l,u){for(var f,h=this.iterator();f=h();)u=l(u,f);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,b){w.__proto__=b}||function(w,b){for(var E in b)b.hasOwnProperty(E)&&(w[E]=b[E])};return function(w,b){O(w,b);function E(){this.constructor=w}w.prototype=b===null?Object.create(b):(E.prototype=b.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(17),l=i(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},f=100,h=function(O){a(w,O);function w(b){var E=O.call(this,b)||this;return E.scroll=E,E.observer=new MutationObserver(function(p){E.update(p)}),E.observer.observe(E.domNode,u),E.attach(),E}return w.prototype.detach=function(){O.prototype.detach.call(this),this.observer.disconnect()},w.prototype.deleteAt=function(b,E){this.update(),b===0&&E===this.length()?this.children.forEach(function(p){p.remove()}):O.prototype.deleteAt.call(this,b,E)},w.prototype.formatAt=function(b,E,p,v){this.update(),O.prototype.formatAt.call(this,b,E,p,v)},w.prototype.insertAt=function(b,E,p){this.update(),O.prototype.insertAt.call(this,b,E,p)},w.prototype.optimize=function(b,E){var p=this;b===void 0&&(b=[]),E===void 0&&(E={}),O.prototype.optimize.call(this,E);for(var v=[].slice.call(this.observer.takeRecords());v.length>0;)b.push(v.pop());for(var g=function(_,k){k===void 0&&(k=!0),!(_==null||_===p)&&_.domNode.parentNode!=null&&(_.domNode[l.DATA_KEY].mutations==null&&(_.domNode[l.DATA_KEY].mutations=[]),k&&g(_.parent))},y=function(_){_.domNode[l.DATA_KEY]==null||_.domNode[l.DATA_KEY].mutations==null||(_ instanceof o.default&&_.children.forEach(y),_.optimize(E))},d=b,m=0;d.length>0;m+=1){if(m>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(_){var k=l.find(_.target,!0);k!=null&&(k.domNode===_.target&&(_.type==="childList"?(g(l.find(_.previousSibling,!1)),[].forEach.call(_.addedNodes,function(x){var A=l.find(x,!1);g(A,!1),A instanceof o.default&&A.children.forEach(function(S){g(S,!1)})})):_.type==="attributes"&&g(k.prev)),g(k))}),this.children.forEach(y),d=[].slice.call(this.observer.takeRecords()),v=d.slice();v.length>0;)b.push(v.pop())}},w.prototype.update=function(b,E){var p=this;E===void 0&&(E={}),b=b||this.observer.takeRecords(),b.map(function(v){var g=l.find(v.target,!0);return g==null?null:g.domNode[l.DATA_KEY].mutations==null?(g.domNode[l.DATA_KEY].mutations=[v],g):(g.domNode[l.DATA_KEY].mutations.push(v),null)}).forEach(function(v){v==null||v===p||v.domNode[l.DATA_KEY]==null||v.update(v.domNode[l.DATA_KEY].mutations||[],E)}),this.domNode[l.DATA_KEY].mutations!=null&&O.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,E),this.optimize(b,E)},w.blotName="scroll",w.defaultChild="block",w.scope=l.Scope.BLOCK_BLOT,w.tagName="DIV",w}(o.default);n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,w){O.__proto__=w}||function(O,w){for(var b in w)w.hasOwnProperty(b)&&(O[b]=w[b])};return function(O,w){h(O,w);function b(){this.constructor=O}O.prototype=w===null?Object.create(w):(b.prototype=w.prototype,new b)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function u(h,O){if(Object.keys(h).length!==Object.keys(O).length)return!1;for(var w in h)if(h[w]!==O[w])return!1;return!0}var f=function(h){a(O,h);function O(){return h!==null&&h.apply(this,arguments)||this}return O.formats=function(w){if(w.tagName!==O.tagName)return h.formats.call(this,w)},O.prototype.format=function(w,b){var E=this;w===this.statics.blotName&&!b?(this.children.forEach(function(p){p instanceof o.default||(p=p.wrap(O.blotName,!0)),E.attributes.copy(p)}),this.unwrap()):h.prototype.format.call(this,w,b)},O.prototype.formatAt=function(w,b,E,p){if(this.formats()[E]!=null||l.query(E,l.Scope.ATTRIBUTE)){var v=this.isolate(w,b);v.format(E,p)}else h.prototype.formatAt.call(this,w,b,E,p)},O.prototype.optimize=function(w){h.prototype.optimize.call(this,w);var b=this.formats();if(Object.keys(b).length===0)return this.unwrap();var E=this.next;E instanceof O&&E.prev===this&&u(b,E.formats())&&(E.moveChildren(this),E.remove())},O.blotName="inline",O.scope=l.Scope.INLINE_BLOT,O.tagName="SPAN",O}(o.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,O){h.__proto__=O}||function(h,O){for(var w in O)O.hasOwnProperty(w)&&(h[w]=O[w])};return function(h,O){f(h,O);function w(){this.constructor=h}h.prototype=O===null?Object.create(O):(w.prototype=O.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1),u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.formats=function(O){var w=l.query(h.blotName).tagName;if(O.tagName!==w)return f.formats.call(this,O)},h.prototype.format=function(O,w){l.query(O,l.Scope.BLOCK)!=null&&(O===this.statics.blotName&&!w?this.replaceWith(h.blotName):f.prototype.format.call(this,O,w))},h.prototype.formatAt=function(O,w,b,E){l.query(b,l.Scope.BLOCK)!=null?this.format(b,E):f.prototype.formatAt.call(this,O,w,b,E)},h.prototype.insertAt=function(O,w,b){if(b==null||l.query(w,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,O,w,b);else{var E=this.split(O),p=l.create(w,b);E.parent.insertBefore(p,E)}},h.prototype.update=function(O,w){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,O,w)},h.blotName="block",h.scope=l.Scope.BLOCK_BLOT,h.tagName="P",h}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var O in h)h.hasOwnProperty(O)&&(f[O]=h[O])};return function(f,h){u(f,h);function O(){this.constructor=f}f.prototype=h===null?Object.create(h):(O.prototype=h.prototype,new O)}}();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(h){},f.prototype.format=function(h,O){u.prototype.formatAt.call(this,0,this.length(),h,O)},f.prototype.formatAt=function(h,O,w,b){h===0&&O===this.length()?this.format(w,b):u.prototype.formatAt.call(this,h,O,w,b)},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(h,O){h.__proto__=O}||function(h,O){for(var w in O)O.hasOwnProperty(w)&&(h[w]=O[w])};return function(h,O){f(h,O);function w(){this.constructor=h}h.prototype=O===null?Object.create(O):(w.prototype=O.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=i(1),u=function(f){a(h,f);function h(O){var w=f.call(this,O)||this;return w.text=w.statics.value(w.domNode),w}return h.create=function(O){return document.createTextNode(O)},h.value=function(O){var w=O.data;return w.normalize&&(w=w.normalize()),w},h.prototype.deleteAt=function(O,w){this.domNode.data=this.text=this.text.slice(0,O)+this.text.slice(O+w)},h.prototype.index=function(O,w){return this.domNode===O?w:-1},h.prototype.insertAt=function(O,w,b){b==null?(this.text=this.text.slice(0,O)+w+this.text.slice(O),this.domNode.data=this.text):f.prototype.insertAt.call(this,O,w,b)},h.prototype.length=function(){return this.text.length},h.prototype.optimize=function(O){f.prototype.optimize.call(this,O),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof h&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},h.prototype.position=function(O,w){return[this.domNode,O]},h.prototype.split=function(O,w){if(w===void 0&&(w=!1),!w){if(O===0)return this;if(O===this.length())return this.next}var b=l.create(this.domNode.splitText(O));return this.parent.insertBefore(b,this.next),this.text=this.statics.value(this.domNode),b},h.prototype.update=function(O,w){var b=this;O.some(function(E){return E.type==="characterData"&&E.target===b.domNode})&&(this.text=this.statics.value(this.domNode))},h.prototype.value=function(){return this.text},h.blotName="text",h.scope=l.Scope.INLINE_BLOT,h}(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 h=f.indexOf(l,u);return h!==-1&&h===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),h=f.length>>>0,O=arguments[1],w,b=0;b<h;b++)if(w=f[b],u.call(O,w,b,f))return w}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,a=1,o=0;function l(m,_,k){if(m==_)return m?[[o,m]]:[];(k<0||m.length<k)&&(k=null);var x=O(m,_),A=m.substring(0,x);m=m.substring(x),_=_.substring(x),x=w(m,_);var S=m.substring(m.length-x);m=m.substring(0,m.length-x),_=_.substring(0,_.length-x);var P=u(m,_);return A&&P.unshift([o,A]),S&&P.push([o,S]),E(P),k!=null&&(P=g(P,k)),P=y(P),P}function u(m,_){var k;if(!m)return[[a,_]];if(!_)return[[i,m]];var x=m.length>_.length?m:_,A=m.length>_.length?_:m,S=x.indexOf(A);if(S!=-1)return k=[[a,x.substring(0,S)],[o,A],[a,x.substring(S+A.length)]],m.length>_.length&&(k[0][0]=k[2][0]=i),k;if(A.length==1)return[[i,m],[a,_]];var P=b(m,_);if(P){var C=P[0],R=P[1],N=P[2],U=P[3],G=P[4],Z=l(C,N),W=l(R,U);return Z.concat([[o,G]],W)}return f(m,_)}function f(m,_){for(var k=m.length,x=_.length,A=Math.ceil((k+x)/2),S=A,P=2*A,C=new Array(P),R=new Array(P),N=0;N<P;N++)C[N]=-1,R[N]=-1;C[S+1]=0,R[S+1]=0;for(var U=k-x,G=U%2!=0,Z=0,W=0,H=0,M=0,L=0;L<A;L++){for(var D=-L+Z;D<=L-W;D+=2){var B=S+D,q;D==-L||D!=L&&C[B-1]<C[B+1]?q=C[B+1]:q=C[B-1]+1;for(var K=q-D;q<k&&K<x&&m.charAt(q)==_.charAt(K);)q++,K++;if(C[B]=q,q>k)W+=2;else if(K>x)Z+=2;else if(G){var z=S+U-D;if(z>=0&&z<P&&R[z]!=-1){var $=k-R[z];if(q>=$)return h(m,_,q,K)}}}for(var F=-L+H;F<=L-M;F+=2){var z=S+F,$;F==-L||F!=L&&R[z-1]<R[z+1]?$=R[z+1]:$=R[z-1]+1;for(var Y=$-F;$<k&&Y<x&&m.charAt(k-$-1)==_.charAt(x-Y-1);)$++,Y++;if(R[z]=$,$>k)M+=2;else if(Y>x)H+=2;else if(!G){var B=S+U-F;if(B>=0&&B<P&&C[B]!=-1){var q=C[B],K=S+q-B;if($=k-$,q>=$)return h(m,_,q,K)}}}}return[[i,m],[a,_]]}function h(m,_,k,x){var A=m.substring(0,k),S=_.substring(0,x),P=m.substring(k),C=_.substring(x),R=l(A,S),N=l(P,C);return R.concat(N)}function O(m,_){if(!m||!_||m.charAt(0)!=_.charAt(0))return 0;for(var k=0,x=Math.min(m.length,_.length),A=x,S=0;k<A;)m.substring(S,A)==_.substring(S,A)?(k=A,S=k):x=A,A=Math.floor((x-k)/2+k);return A}function w(m,_){if(!m||!_||m.charAt(m.length-1)!=_.charAt(_.length-1))return 0;for(var k=0,x=Math.min(m.length,_.length),A=x,S=0;k<A;)m.substring(m.length-A,m.length-S)==_.substring(_.length-A,_.length-S)?(k=A,S=k):x=A,A=Math.floor((x-k)/2+k);return A}function b(m,_){var k=m.length>_.length?m:_,x=m.length>_.length?_:m;if(k.length<4||x.length*2<k.length)return null;function A(W,H,M){for(var L=W.substring(M,M+Math.floor(W.length/4)),D=-1,B="",q,K,z,$;(D=H.indexOf(L,D+1))!=-1;){var F=O(W.substring(M),H.substring(D)),Y=w(W.substring(0,M),H.substring(0,D));B.length<Y+F&&(B=H.substring(D-Y,D)+H.substring(D,D+F),q=W.substring(0,M-Y),K=W.substring(M+F),z=H.substring(0,D-Y),$=H.substring(D+F))}return B.length*2>=W.length?[q,K,z,$,B]:null}var S=A(k,x,Math.ceil(k.length/4)),P=A(k,x,Math.ceil(k.length/2)),C;if(!S&&!P)return null;P?S?C=S[4].length>P[4].length?S:P:C=P:C=S;var R,N,U,G;m.length>_.length?(R=C[0],N=C[1],U=C[2],G=C[3]):(U=C[0],G=C[1],R=C[2],N=C[3]);var Z=C[4];return[R,N,U,G,Z]}function E(m){m.push([o,""]);for(var _=0,k=0,x=0,A="",S="",P;_<m.length;)switch(m[_][0]){case a:x++,S+=m[_][1],_++;break;case i:k++,A+=m[_][1],_++;break;case o:k+x>1?(k!==0&&x!==0&&(P=O(S,A),P!==0&&(_-k-x>0&&m[_-k-x-1][0]==o?m[_-k-x-1][1]+=S.substring(0,P):(m.splice(0,0,[o,S.substring(0,P)]),_++),S=S.substring(P),A=A.substring(P)),P=w(S,A),P!==0&&(m[_][1]=S.substring(S.length-P)+m[_][1],S=S.substring(0,S.length-P),A=A.substring(0,A.length-P))),k===0?m.splice(_-x,k+x,[a,S]):x===0?m.splice(_-k,k+x,[i,A]):m.splice(_-k-x,k+x,[i,A],[a,S]),_=_-k-x+(k?1:0)+(x?1:0)+1):_!==0&&m[_-1][0]==o?(m[_-1][1]+=m[_][1],m.splice(_,1)):_++,x=0,k=0,A="",S="";break}m[m.length-1][1]===""&&m.pop();var C=!1;for(_=1;_<m.length-1;)m[_-1][0]==o&&m[_+1][0]==o&&(m[_][1].substring(m[_][1].length-m[_-1][1].length)==m[_-1][1]?(m[_][1]=m[_-1][1]+m[_][1].substring(0,m[_][1].length-m[_-1][1].length),m[_+1][1]=m[_-1][1]+m[_+1][1],m.splice(_-1,1),C=!0):m[_][1].substring(0,m[_+1][1].length)==m[_+1][1]&&(m[_-1][1]+=m[_+1][1],m[_][1]=m[_][1].substring(m[_+1][1].length)+m[_+1][1],m.splice(_+1,1),C=!0)),_++;C&&E(m)}var p=l;p.INSERT=a,p.DELETE=i,p.EQUAL=o,r.exports=p;function v(m,_){if(_===0)return[o,m];for(var k=0,x=0;x<m.length;x++){var A=m[x];if(A[0]===i||A[0]===o){var S=k+A[1].length;if(_===S)return[x+1,m];if(_<S){m=m.slice();var P=_-k,C=[A[0],A[1].slice(0,P)],R=[A[0],A[1].slice(P)];return m.splice(x,1,C,R),[x+1,m]}else k=S}}throw new Error("cursor_pos is out of bounds!")}function g(m,_){var k=v(m,_),x=k[1],A=k[0],S=x[A],P=x[A+1];if(S==null)return m;if(S[0]!==o)return m;if(P!=null&&S[1]+P[1]===P[1]+S[1])return x.splice(A,2,P,S),d(x,A,2);if(P!=null&&P[1].indexOf(S[1])===0){x.splice(A,2,[P[0],S[1]],[0,S[1]]);var C=P[1].slice(S[1].length);return C.length>0&&x.splice(A+2,0,[P[0],C]),d(x,A,3)}else return m}function y(m){for(var _=!1,k=function(P){return P.charCodeAt(0)>=56320&&P.charCodeAt(0)<=57343},x=function(P){return P.charCodeAt(P.length-1)>=55296&&P.charCodeAt(P.length-1)<=56319},A=2;A<m.length;A+=1)m[A-2][0]===o&&x(m[A-2][1])&&m[A-1][0]===i&&k(m[A-1][1])&&m[A][0]===a&&k(m[A][1])&&(_=!0,m[A-1][1]=m[A-2][1].slice(-1)+m[A-1][1],m[A][1]=m[A-2][1].slice(-1)+m[A][1],m[A-2][1]=m[A-2][1].slice(0,-1));if(!_)return m;for(var S=[],A=0;A<m.length;A+=1)m[A][1].length>0&&S.push(m[A]);return S}function d(m,_,k){for(var x=_+k-1;x>=0&&x>=_-1;x--)if(x+1<m.length){var A=m[x],S=m[x+1];A[0]===S[1]&&m.splice(x,2,[A[0],A[1]+S[1]])}return m}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(a){var o=[];for(var l in a)o.push(l);return o}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?a:o,n.supported=a;function a(l){return Object.prototype.toString.call(l)=="[object Arguments]"}n.unsupported=o;function o(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function l(f,h,O){this.fn=f,this.context=h,this.once=O||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var h=[],O,w;if(this._eventsCount===0)return h;for(w in O=this._events)i.call(O,w)&&h.push(a?w.slice(1):w);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(O)):h},u.prototype.listeners=function(h,O){var w=a?a+h:h,b=this._events[w];if(O)return!!b;if(!b)return[];if(b.fn)return[b.fn];for(var E=0,p=b.length,v=new Array(p);E<p;E++)v[E]=b[E].fn;return v},u.prototype.emit=function(h,O,w,b,E,p){var v=a?a+h:h;if(!this._events[v])return!1;var g=this._events[v],y=arguments.length,d,m;if(g.fn){switch(g.once&&this.removeListener(h,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,O),!0;case 3:return g.fn.call(g.context,O,w),!0;case 4:return g.fn.call(g.context,O,w,b),!0;case 5:return g.fn.call(g.context,O,w,b,E),!0;case 6:return g.fn.call(g.context,O,w,b,E,p),!0}for(m=1,d=new Array(y-1);m<y;m++)d[m-1]=arguments[m];g.fn.apply(g.context,d)}else{var _=g.length,k;for(m=0;m<_;m++)switch(g[m].once&&this.removeListener(h,g[m].fn,void 0,!0),y){case 1:g[m].fn.call(g[m].context);break;case 2:g[m].fn.call(g[m].context,O);break;case 3:g[m].fn.call(g[m].context,O,w);break;case 4:g[m].fn.call(g[m].context,O,w,b);break;default:if(!d)for(k=1,d=new Array(y-1);k<y;k++)d[k-1]=arguments[k];g[m].fn.apply(g[m].context,d)}}return!0},u.prototype.on=function(h,O,w){var b=new l(O,w||this),E=a?a+h:h;return this._events[E]?this._events[E].fn?this._events[E]=[this._events[E],b]:this._events[E].push(b):(this._events[E]=b,this._eventsCount++),this},u.prototype.once=function(h,O,w){var b=new l(O,w||this,!0),E=a?a+h:h;return this._events[E]?this._events[E].fn?this._events[E]=[this._events[E],b]:this._events[E].push(b):(this._events[E]=b,this._eventsCount++),this},u.prototype.removeListener=function(h,O,w,b){var E=a?a+h:h;if(!this._events[E])return this;if(!O)return--this._eventsCount===0?this._events=new o:delete this._events[E],this;var p=this._events[E];if(p.fn)p.fn===O&&(!b||p.once)&&(!w||p.context===w)&&(--this._eventsCount===0?this._events=new o:delete this._events[E]);else{for(var v=0,g=[],y=p.length;v<y;v++)(p[v].fn!==O||b&&!p[v].once||w&&p[v].context!==w)&&g.push(p[v]);g.length?this._events[E]=g.length===1?g[0]:g:--this._eventsCount===0?this._events=new o:delete this._events[E]}return this},u.prototype.removeAllListeners=function(h){var O;return h?(O=a?a+h:h,this._events[O]&&(--this._eventsCount===0?this._events=new o:delete this._events[O])):(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(ne){return typeof ne}:function(ne){return ne&&typeof Symbol=="function"&&ne.constructor===Symbol&&ne!==Symbol.prototype?"symbol":typeof ne},o=function(){function ne(le,be){var ye=[],te=!0,de=!1,he=void 0;try{for(var Se=le[Symbol.iterator](),$e;!(te=($e=Se.next()).done)&&(ye.push($e.value),!(be&&ye.length===be));te=!0);}catch(tt){de=!0,he=tt}finally{try{!te&&Se.return&&Se.return()}finally{if(de)throw he}}return ye}return function(le,be){if(Array.isArray(le))return le;if(Symbol.iterator in Object(le))return ne(le,be);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function ne(le,be){for(var ye=0;ye<be.length;ye++){var te=be[ye];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(le,te.key,te)}}return function(le,be,ye){return be&&ne(le.prototype,be),ye&&ne(le,ye),le}}(),u=i(3),f=R(u),h=i(2),O=R(h),w=i(0),b=R(w),E=i(5),p=R(E),v=i(10),g=R(v),y=i(9),d=R(y),m=i(36),_=i(37),k=i(13),x=R(k),A=i(26),S=i(38),P=i(39),C=i(40);function R(ne){return ne&&ne.__esModule?ne:{default:ne}}function N(ne,le,be){return le in ne?Object.defineProperty(ne,le,{value:be,enumerable:!0,configurable:!0,writable:!0}):ne[le]=be,ne}function U(ne,le){if(!(ne instanceof le))throw new TypeError("Cannot call a class as a function")}function G(ne,le){if(!ne)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return le&&(typeof le=="object"||typeof le=="function")?le:ne}function Z(ne,le){if(typeof le!="function"&&le!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof le);ne.prototype=Object.create(le&&le.prototype,{constructor:{value:ne,enumerable:!1,writable:!0,configurable:!0}}),le&&(Object.setPrototypeOf?Object.setPrototypeOf(ne,le):ne.__proto__=le)}var W=(0,g.default)("quill:clipboard"),H="__ql-matcher",M=[[Node.TEXT_NODE,Me],[Node.TEXT_NODE,ae],["br",ee],[Node.ELEMENT_NODE,ae],[Node.ELEMENT_NODE,Q],[Node.ELEMENT_NODE,ie],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,Re],["li",oe],["b",Y.bind(Y,"bold")],["i",Y.bind(Y,"italic")],["style",re]],L=[m.AlignAttribute,S.DirectionAttribute].reduce(function(ne,le){return ne[le.keyName]=le,ne},{}),D=[m.AlignStyle,_.BackgroundStyle,A.ColorStyle,S.DirectionStyle,P.FontStyle,C.SizeStyle].reduce(function(ne,le){return ne[le.keyName]=le,ne},{}),B=function(ne){Z(le,ne);function le(be,ye){U(this,le);var te=G(this,(le.__proto__||Object.getPrototypeOf(le)).call(this,be,ye));return te.quill.root.addEventListener("paste",te.onPaste.bind(te)),te.container=te.quill.addContainer("ql-clipboard"),te.container.setAttribute("contenteditable",!0),te.container.setAttribute("tabindex",-1),te.matchers=[],M.concat(te.options.matchers).forEach(function(de){var he=o(de,2),Se=he[0],$e=he[1];!ye.matchVisual&&$e===ie||te.addMatcher(Se,$e)}),te}return l(le,[{key:"addMatcher",value:function(ye,te){this.matchers.push([ye,te])}},{key:"convert",value:function(ye){if(typeof ye=="string")return this.container.innerHTML=ye.replace(/\>\r?\n +\</g,"><"),this.convert();var te=this.quill.getFormat(this.quill.selection.savedRange.index);if(te[x.default.blotName]){var de=this.container.innerText;return this.container.innerHTML="",new O.default().insert(de,N({},x.default.blotName,te[x.default.blotName]))}var he=this.prepareMatching(),Se=o(he,2),$e=Se[0],tt=Se[1],Ae=F(this.container,$e,tt);return z(Ae,`
|
|
140
|
+
`)&&Ae.ops[Ae.ops.length-1].attributes==null&&(Ae=Ae.compose(new O.default().retain(Ae.length()-1).delete(1))),W.log("convert",this.container.innerHTML,Ae),this.container.innerHTML="",Ae}},{key:"dangerouslyPasteHTML",value:function(ye,te){var de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;if(typeof ye=="string")this.quill.setContents(this.convert(ye),te),this.quill.setSelection(0,p.default.sources.SILENT);else{var he=this.convert(te);this.quill.updateContents(new O.default().retain(ye).concat(he),de),this.quill.setSelection(ye+he.length(),p.default.sources.SILENT)}}},{key:"onPaste",value:function(ye){var te=this;if(!(ye.defaultPrevented||!this.quill.isEnabled())){var de=this.quill.getSelection(),he=new O.default().retain(de.index),Se=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(p.default.sources.SILENT),setTimeout(function(){he=he.concat(te.convert()).delete(de.length),te.quill.updateContents(he,p.default.sources.USER),te.quill.setSelection(he.length()-de.length,p.default.sources.SILENT),te.quill.scrollingContainer.scrollTop=Se,te.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var ye=this,te=[],de=[];return this.matchers.forEach(function(he){var Se=o(he,2),$e=Se[0],tt=Se[1];switch($e){case Node.TEXT_NODE:de.push(tt);break;case Node.ELEMENT_NODE:te.push(tt);break;default:[].forEach.call(ye.container.querySelectorAll($e),function(Ae){Ae[H]=Ae[H]||[],Ae[H].push(tt)});break}}),[te,de]}}]),le}(d.default);B.DEFAULTS={matchers:[],matchVisual:!0};function q(ne,le,be){return(typeof le>"u"?"undefined":a(le))==="object"?Object.keys(le).reduce(function(ye,te){return q(ye,te,le[te])},ne):ne.reduce(function(ye,te){return te.attributes&&te.attributes[le]?ye.push(te):ye.insert(te.insert,(0,f.default)({},N({},le,be),te.attributes))},new O.default)}function K(ne){if(ne.nodeType!==Node.ELEMENT_NODE)return{};var le="__ql-computed-style";return ne[le]||(ne[le]=window.getComputedStyle(ne))}function z(ne,le){for(var be="",ye=ne.ops.length-1;ye>=0&&be.length<le.length;--ye){var te=ne.ops[ye];if(typeof te.insert!="string")break;be=te.insert+be}return be.slice(-1*le.length)===le}function $(ne){if(ne.childNodes.length===0)return!1;var le=K(ne);return["block","list-item"].indexOf(le.display)>-1}function F(ne,le,be){return ne.nodeType===ne.TEXT_NODE?be.reduce(function(ye,te){return te(ne,ye)},new O.default):ne.nodeType===ne.ELEMENT_NODE?[].reduce.call(ne.childNodes||[],function(ye,te){var de=F(te,le,be);return te.nodeType===ne.ELEMENT_NODE&&(de=le.reduce(function(he,Se){return Se(te,he)},de),de=(te[H]||[]).reduce(function(he,Se){return Se(te,he)},de)),ye.concat(de)},new O.default):new O.default}function Y(ne,le,be){return q(be,ne,!0)}function X(ne,le){var be=b.default.Attributor.Attribute.keys(ne),ye=b.default.Attributor.Class.keys(ne),te=b.default.Attributor.Style.keys(ne),de={};return be.concat(ye).concat(te).forEach(function(he){var Se=b.default.query(he,b.default.Scope.ATTRIBUTE);Se!=null&&(de[Se.attrName]=Se.value(ne),de[Se.attrName])||(Se=L[he],Se!=null&&(Se.attrName===he||Se.keyName===he)&&(de[Se.attrName]=Se.value(ne)||void 0),Se=D[he],Se!=null&&(Se.attrName===he||Se.keyName===he)&&(Se=D[he],de[Se.attrName]=Se.value(ne)||void 0))}),Object.keys(de).length>0&&(le=q(le,de)),le}function Q(ne,le){var be=b.default.query(ne);if(be==null)return le;if(be.prototype instanceof b.default.Embed){var ye={},te=be.value(ne);te!=null&&(ye[be.blotName]=te,le=new O.default().insert(ye,be.formats(ne)))}else typeof be.formats=="function"&&(le=q(le,be.blotName,be.formats(ne)));return le}function ee(ne,le){return z(le,`
|
|
141
|
+
`)||le.insert(`
|
|
142
|
+
`),le}function re(){return new O.default}function oe(ne,le){var be=b.default.query(ne);if(be==null||be.blotName!=="list-item"||!z(le,`
|
|
143
|
+
`))return le;for(var ye=-1,te=ne.parentNode;!te.classList.contains("ql-clipboard");)(b.default.query(te)||{}).blotName==="list"&&(ye+=1),te=te.parentNode;return ye<=0?le:le.compose(new O.default().retain(le.length()-1).retain(1,{indent:ye}))}function ae(ne,le){return z(le,`
|
|
144
|
+
`)||($(ne)||le.length()>0&&ne.nextSibling&&$(ne.nextSibling))&&le.insert(`
|
|
145
|
+
`),le}function ie(ne,le){if($(ne)&&ne.nextElementSibling!=null&&!z(le,`
|
|
146
|
+
|
|
147
|
+
`)){var be=ne.offsetHeight+parseFloat(K(ne).marginTop)+parseFloat(K(ne).marginBottom);ne.nextElementSibling.offsetTop>ne.offsetTop+be*1.5&&le.insert(`
|
|
148
|
+
`)}return le}function Re(ne,le){var be={},ye=ne.style||{};return ye.fontStyle&&K(ne).fontStyle==="italic"&&(be.italic=!0),ye.fontWeight&&(K(ne).fontWeight.startsWith("bold")||parseInt(K(ne).fontWeight)>=700)&&(be.bold=!0),Object.keys(be).length>0&&(le=q(le,be)),parseFloat(ye.textIndent||0)>0&&(le=new O.default().insert(" ").concat(le)),le}function Me(ne,le){var be=ne.data;if(ne.parentNode.tagName==="O:P")return le.insert(be.trim());if(be.trim().length===0&&ne.parentNode.classList.contains("ql-clipboard"))return le;if(!K(ne.parentNode).whiteSpace.startsWith("pre")){var ye=function(de,he){return he=he.replace(/[^\u00a0]/g,""),he.length<1&&de?" ":he};be=be.replace(/\r\n/g," ").replace(/\n/g," "),be=be.replace(/\s\s+/g,ye.bind(ye,!0)),(ne.previousSibling==null&&$(ne.parentNode)||ne.previousSibling!=null&&$(ne.previousSibling))&&(be=be.replace(/^\s+/,ye.bind(ye,!1))),(ne.nextSibling==null&&$(ne.parentNode)||ne.nextSibling!=null&&$(ne.nextSibling))&&(be=be.replace(/\s+$/,ye.bind(ye,!1)))}return le.insert(be)}n.default=B,n.matchAttributor=X,n.matchBlot=Q,n.matchNewline=ae,n.matchSpacing=ie,n.matchText=Me},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(p,v){for(var g=0;g<v.length;g++){var y=v[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(p,y.key,y)}}return function(p,v,g){return v&&E(p.prototype,v),g&&E(p,g),p}}(),o=function E(p,v,g){p===null&&(p=Function.prototype);var y=Object.getOwnPropertyDescriptor(p,v);if(y===void 0){var d=Object.getPrototypeOf(p);return d===null?void 0:E(d,v,g)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(g)}},l=i(6),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function h(E,p){if(!(E instanceof p))throw new TypeError("Cannot call a class as a function")}function O(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 w(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 b=function(E){w(p,E);function p(){return h(this,p),O(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"optimize",value:function(g){o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"optimize",this).call(this,g),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),p}(u.default);b.blotName="bold",b.tagName=["STRONG","B"],n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=function(){function C(R,N){var U=[],G=!0,Z=!1,W=void 0;try{for(var H=R[Symbol.iterator](),M;!(G=(M=H.next()).done)&&(U.push(M.value),!(N&&U.length===N));G=!0);}catch(L){Z=!0,W=L}finally{try{!G&&H.return&&H.return()}finally{if(Z)throw W}}return U}return function(R,N){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return C(R,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function C(R,N){for(var U=0;U<N.length;U++){var G=N[U];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(R,G.key,G)}}return function(R,N,U){return N&&C(R.prototype,N),U&&C(R,U),R}}(),l=i(2),u=g(l),f=i(0),h=g(f),O=i(5),w=g(O),b=i(10),E=g(b),p=i(9),v=g(p);function g(C){return C&&C.__esModule?C:{default:C}}function y(C,R,N){return R in C?Object.defineProperty(C,R,{value:N,enumerable:!0,configurable:!0,writable:!0}):C[R]=N,C}function d(C,R){if(!(C instanceof R))throw new TypeError("Cannot call a class as a function")}function m(C,R){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:C}function _(C,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);C.prototype=Object.create(R&&R.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(C,R):C.__proto__=R)}var k=(0,E.default)("quill:toolbar"),x=function(C){_(R,C);function R(N,U){d(this,R);var G=m(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,N,U));if(Array.isArray(G.options.container)){var Z=document.createElement("div");S(Z,G.options.container),N.container.parentNode.insertBefore(Z,N.container),G.container=Z}else typeof G.options.container=="string"?G.container=document.querySelector(G.options.container):G.container=G.options.container;if(!(G.container instanceof HTMLElement)){var W;return W=k.error("Container required for toolbar",G.options),m(G,W)}return G.container.classList.add("ql-toolbar"),G.controls=[],G.handlers={},Object.keys(G.options.handlers).forEach(function(H){G.addHandler(H,G.options.handlers[H])}),[].forEach.call(G.container.querySelectorAll("button, select"),function(H){G.attach(H)}),G.quill.on(w.default.events.EDITOR_CHANGE,function(H,M){H===w.default.events.SELECTION_CHANGE&&G.update(M)}),G.quill.on(w.default.events.SCROLL_OPTIMIZE,function(){var H=G.quill.selection.getRange(),M=a(H,1),L=M[0];G.update(L)}),G}return o(R,[{key:"addHandler",value:function(U,G){this.handlers[U]=G}},{key:"attach",value:function(U){var G=this,Z=[].find.call(U.classList,function(H){return H.indexOf("ql-")===0});if(Z){if(Z=Z.slice(3),U.tagName==="BUTTON"&&U.setAttribute("type","button"),this.handlers[Z]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[Z]==null){k.warn("ignoring attaching to disabled format",Z,U);return}if(h.default.query(Z)==null){k.warn("ignoring attaching to nonexistent format",Z,U);return}}var W=U.tagName==="SELECT"?"change":"click";U.addEventListener(W,function(H){var M=void 0;if(U.tagName==="SELECT"){if(U.selectedIndex<0)return;var L=U.options[U.selectedIndex];L.hasAttribute("selected")?M=!1:M=L.value||!1}else U.classList.contains("ql-active")?M=!1:M=U.value||!U.hasAttribute("value"),H.preventDefault();G.quill.focus();var D=G.quill.selection.getRange(),B=a(D,1),q=B[0];if(G.handlers[Z]!=null)G.handlers[Z].call(G,M);else if(h.default.query(Z).prototype instanceof h.default.Embed){if(M=prompt("Enter "+Z),!M)return;G.quill.updateContents(new u.default().retain(q.index).delete(q.length).insert(y({},Z,M)),w.default.sources.USER)}else G.quill.format(Z,M,w.default.sources.USER);G.update(q)}),this.controls.push([Z,U])}}},{key:"update",value:function(U){var G=U==null?{}:this.quill.getFormat(U);this.controls.forEach(function(Z){var W=a(Z,2),H=W[0],M=W[1];if(M.tagName==="SELECT"){var L=void 0;if(U==null)L=null;else if(G[H]==null)L=M.querySelector("option[selected]");else if(!Array.isArray(G[H])){var D=G[H];typeof D=="string"&&(D=D.replace(/\"/g,'\\"')),L=M.querySelector('option[value="'+D+'"]')}L==null?(M.value="",M.selectedIndex=-1):L.selected=!0}else if(U==null)M.classList.remove("ql-active");else if(M.hasAttribute("value")){var B=G[H]===M.getAttribute("value")||G[H]!=null&&G[H].toString()===M.getAttribute("value")||G[H]==null&&!M.getAttribute("value");M.classList.toggle("ql-active",B)}else M.classList.toggle("ql-active",G[H]!=null)})}}]),R}(v.default);x.DEFAULTS={};function A(C,R,N){var U=document.createElement("button");U.setAttribute("type","button"),U.classList.add("ql-"+R),N!=null&&(U.value=N),C.appendChild(U)}function S(C,R){Array.isArray(R[0])||(R=[R]),R.forEach(function(N){var U=document.createElement("span");U.classList.add("ql-formats"),N.forEach(function(G){if(typeof G=="string")A(U,G);else{var Z=Object.keys(G)[0],W=G[Z];Array.isArray(W)?P(U,Z,W):A(U,Z,W)}}),C.appendChild(U)})}function P(C,R,N){var U=document.createElement("select");U.classList.add("ql-"+R),N.forEach(function(G){var Z=document.createElement("option");G!==!1?Z.setAttribute("value",G):Z.setAttribute("selected","selected"),U.appendChild(Z)}),C.appendChild(U)}x.DEFAULTS={container:null,handlers:{clean:function(){var R=this,N=this.quill.getSelection();if(N!=null)if(N.length==0){var U=this.quill.getFormat();Object.keys(U).forEach(function(G){h.default.query(G,h.default.Scope.INLINE)!=null&&R.quill.format(G,!1)})}else this.quill.removeFormat(N,w.default.sources.USER)},direction:function(R){var N=this.quill.getFormat().align;R==="rtl"&&N==null?this.quill.format("align","right",w.default.sources.USER):!R&&N==="right"&&this.quill.format("align",!1,w.default.sources.USER),this.quill.format("direction",R,w.default.sources.USER)},indent:function(R){var N=this.quill.getSelection(),U=this.quill.getFormat(N),G=parseInt(U.indent||0);if(R==="+1"||R==="-1"){var Z=R==="+1"?1:-1;U.direction==="rtl"&&(Z*=-1),this.quill.format("indent",G+Z,w.default.sources.USER)}},link:function(R){R===!0&&(R=prompt("Enter link URL:")),this.quill.format("link",R,w.default.sources.USER)},list:function(R){var N=this.quill.getSelection(),U=this.quill.getFormat(N);R==="check"?U.list==="checked"||U.list==="unchecked"?this.quill.format("list",!1,w.default.sources.USER):this.quill.format("list","unchecked",w.default.sources.USER):this.quill.format("list",R,w.default.sources.USER)}}},n.default=x,n.addControls=S},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(p,v){for(var g=0;g<v.length;g++){var y=v[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(p,y.key,y)}}return function(p,v,g){return v&&E(p.prototype,v),g&&E(p,g),p}}(),o=function E(p,v,g){p===null&&(p=Function.prototype);var y=Object.getOwnPropertyDescriptor(p,v);if(y===void 0){var d=Object.getPrototypeOf(p);return d===null?void 0:E(d,v,g)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(g)}},l=i(28),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function h(E,p){if(!(E instanceof p))throw new TypeError("Cannot call a class as a function")}function O(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 w(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 b=function(E){w(p,E);function p(v,g){h(this,p);var y=O(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,v));return y.label.innerHTML=g,y.container.classList.add("ql-color-picker"),[].slice.call(y.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(d){d.classList.add("ql-primary")}),y}return a(p,[{key:"buildItem",value:function(g){var y=o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"buildItem",this).call(this,g);return y.style.backgroundColor=g.getAttribute("value")||"",y}},{key:"selectItem",value:function(g,y){o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"selectItem",this).call(this,g,y);var d=this.label.querySelector(".ql-color-label"),m=g&&g.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=m:d.style.fill=m)}}]),p}(u.default);n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(p,v){for(var g=0;g<v.length;g++){var y=v[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(p,y.key,y)}}return function(p,v,g){return v&&E(p.prototype,v),g&&E(p,g),p}}(),o=function E(p,v,g){p===null&&(p=Function.prototype);var y=Object.getOwnPropertyDescriptor(p,v);if(y===void 0){var d=Object.getPrototypeOf(p);return d===null?void 0:E(d,v,g)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(g)}},l=i(28),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function h(E,p){if(!(E instanceof p))throw new TypeError("Cannot call a class as a function")}function O(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 w(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 b=function(E){w(p,E);function p(v,g){h(this,p);var y=O(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,v));return y.container.classList.add("ql-icon-picker"),[].forEach.call(y.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=g[d.getAttribute("data-value")||""]}),y.defaultItem=y.container.querySelector(".ql-selected"),y.selectItem(y.defaultItem),y}return a(p,[{key:"selectItem",value:function(g,y){o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"selectItem",this).call(this,g,y),g=g||this.defaultItem,this.label.innerHTML=g.innerHTML}}]),p}(u.default);n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,h){for(var O=0;O<h.length;O++){var w=h[O];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,h,O){return h&&u(f.prototype,h),O&&u(f,O),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,h){var O=this;o(this,u),this.quill=f,this.boundsContainer=h||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(){O.root.style.marginTop=-1*O.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(h){var O=h.left+h.width/2-this.root.offsetWidth/2,w=h.bottom+this.quill.root.scrollTop;this.root.style.left=O+"px",this.root.style.top=w+"px",this.root.classList.remove("ql-flip");var b=this.boundsContainer.getBoundingClientRect(),E=this.root.getBoundingClientRect(),p=0;if(E.right>b.right&&(p=b.right-E.right,this.root.style.left=O+p+"px"),E.left<b.left&&(p=b.left-E.left,this.root.style.left=O+p+"px"),E.bottom>b.bottom){var v=E.bottom-E.top,g=h.bottom-h.top+v;this.root.style.top=w-g+"px",this.root.classList.add("ql-flip")}return p}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function P(C,R){var N=[],U=!0,G=!1,Z=void 0;try{for(var W=C[Symbol.iterator](),H;!(U=(H=W.next()).done)&&(N.push(H.value),!(R&&N.length===R));U=!0);}catch(M){G=!0,Z=M}finally{try{!U&&W.return&&W.return()}finally{if(G)throw Z}}return N}return function(C,R){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return P(C,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function P(C,R,N){C===null&&(C=Function.prototype);var U=Object.getOwnPropertyDescriptor(C,R);if(U===void 0){var G=Object.getPrototypeOf(C);return G===null?void 0:P(G,R,N)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(N)}},l=function(){function P(C,R){for(var N=0;N<R.length;N++){var U=R[N];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(C,U.key,U)}}return function(C,R,N){return R&&P(C.prototype,R),N&&P(C,N),C}}(),u=i(3),f=d(u),h=i(8),O=d(h),w=i(43),b=d(w),E=i(27),p=d(E),v=i(15),g=i(41),y=d(g);function d(P){return P&&P.__esModule?P:{default:P}}function m(P,C){if(!(P instanceof C))throw new TypeError("Cannot call a class as a function")}function _(P,C){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:P}function k(P,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);P.prototype=Object.create(C&&C.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(P,C):P.__proto__=C)}var x=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],A=function(P){k(C,P);function C(R,N){m(this,C),N.modules.toolbar!=null&&N.modules.toolbar.container==null&&(N.modules.toolbar.container=x);var U=_(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,R,N));return U.quill.container.classList.add("ql-snow"),U}return l(C,[{key:"extendToolbar",value:function(N){N.container.classList.add("ql-snow"),this.buildButtons([].slice.call(N.container.querySelectorAll("button")),y.default),this.buildPickers([].slice.call(N.container.querySelectorAll("select")),y.default),this.tooltip=new S(this.quill,this.options.bounds),N.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(U,G){N.handlers.link.call(N,!G.format.link)})}}]),C}(b.default);A.DEFAULTS=(0,f.default)(!0,{},b.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(C){if(C){var R=this.quill.getSelection();if(R==null||R.length==0)return;var N=this.quill.getText(R);/^\S+@\S+\.\S+$/.test(N)&&N.indexOf("mailto:")!==0&&(N="mailto:"+N);var U=this.quill.theme.tooltip;U.edit("link",N)}else this.quill.format("link",!1)}}}}});var S=function(P){k(C,P);function C(R,N){m(this,C);var U=_(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,R,N));return U.preview=U.root.querySelector("a.ql-preview"),U}return l(C,[{key:"listen",value:function(){var N=this;o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(U){N.root.classList.contains("ql-editing")?N.save():N.edit("link",N.preview.textContent),U.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(U){if(N.linkRange!=null){var G=N.linkRange;N.restoreFocus(),N.quill.formatText(G,"link",!1,O.default.sources.USER),delete N.linkRange}U.preventDefault(),N.hide()}),this.quill.on(O.default.events.SELECTION_CHANGE,function(U,G,Z){if(U!=null){if(U.length===0&&Z===O.default.sources.USER){var W=N.quill.scroll.descendant(p.default,U.index),H=a(W,2),M=H[0],L=H[1];if(M!=null){N.linkRange=new v.Range(U.index-L,M.length());var D=p.default.formats(M.domNode);N.preview.textContent=D,N.preview.setAttribute("href",D),N.show(),N.position(N.quill.getBounds(N.linkRange));return}}else delete N.linkRange;N.hide()}})}},{key:"show",value:function(){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),C}(w.BaseTooltip);S.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=A},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(29),o=te(a),l=i(36),u=i(38),f=i(64),h=i(65),O=te(h),w=i(66),b=te(w),E=i(67),p=te(E),v=i(37),g=i(26),y=i(39),d=i(40),m=i(56),_=te(m),k=i(68),x=te(k),A=i(27),S=te(A),P=i(69),C=te(P),R=i(70),N=te(R),U=i(71),G=te(U),Z=i(72),W=te(Z),H=i(73),M=te(H),L=i(13),D=te(L),B=i(74),q=te(B),K=i(75),z=te(K),$=i(57),F=te($),Y=i(41),X=te(Y),Q=i(28),ee=te(Q),re=i(59),oe=te(re),ae=i(60),ie=te(ae),Re=i(61),Me=te(Re),ne=i(108),le=te(ne),be=i(62),ye=te(be);function te(de){return de&&de.__esModule?de:{default:de}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":v.BackgroundClass,"attributors/class/color":g.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":y.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":v.BackgroundStyle,"attributors/style/color":g.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":y.FontStyle,"attributors/style/size":d.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":f.IndentClass,"formats/background":v.BackgroundStyle,"formats/color":g.ColorStyle,"formats/font":y.FontClass,"formats/size":d.SizeClass,"formats/blockquote":O.default,"formats/code-block":D.default,"formats/header":b.default,"formats/list":p.default,"formats/bold":_.default,"formats/code":L.Code,"formats/italic":x.default,"formats/link":S.default,"formats/script":C.default,"formats/strike":N.default,"formats/underline":G.default,"formats/image":W.default,"formats/video":M.default,"formats/list/item":E.ListItem,"modules/formula":q.default,"modules/syntax":z.default,"modules/toolbar":F.default,"themes/bubble":le.default,"themes/snow":ye.default,"ui/icons":X.default,"ui/picker":ee.default,"ui/icon-picker":ie.default,"ui/color-picker":oe.default,"ui/tooltip":Me.default},!0),n.default=o.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=function(){function p(v,g){for(var y=0;y<g.length;y++){var d=g[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(v,d.key,d)}}return function(v,g,y){return g&&p(v.prototype,g),y&&p(v,y),v}}(),o=function p(v,g,y){v===null&&(v=Function.prototype);var d=Object.getOwnPropertyDescriptor(v,g);if(d===void 0){var m=Object.getPrototypeOf(v);return m===null?void 0:p(m,g,y)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(y)}},l=i(0),u=f(l);function f(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 O(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 b=function(p){w(v,p);function v(){return h(this,v),O(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"add",value:function(y,d){if(d==="+1"||d==="-1"){var m=this.value(y)||0;d=d==="+1"?m+1:m-1}return d===0?(this.remove(y),!0):o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"add",this).call(this,y,d)}},{key:"canAdd",value:function(y,d){return o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"canAdd",this).call(this,y,d)||o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"canAdd",this).call(this,y,parseInt(d))}},{key:"value",value:function(y){return parseInt(o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"value",this).call(this,y))||void 0}}]),v}(u.default.Attributor.Class),E=new b("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(4),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,b){if(!(w instanceof b))throw new TypeError("Cannot call a class as a function")}function f(w,b){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:w}function h(w,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);w.prototype=Object.create(b&&b.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(w,b):w.__proto__=b)}var O=function(w){h(b,w);function b(){return u(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default);O.blotName="blockquote",O.tagName="blockquote",n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function b(E,p){for(var v=0;v<p.length;v++){var g=p[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}return function(E,p,v){return p&&b(E.prototype,p),v&&b(E,v),E}}(),o=i(4),l=u(o);function u(b){return b&&b.__esModule?b:{default:b}}function f(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}function h(b,E){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:b}function O(b,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);b.prototype=Object.create(E&&E.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(b,E):b.__proto__=E)}var w=function(b){O(E,b);function E(){return f(this,E),h(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,null,[{key:"formats",value:function(v){return this.tagName.indexOf(v.tagName)+1}}]),E}(l.default);w.blotName="header",w.tagName=["H1","H2","H3","H4","H5","H6"],n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function m(_,k){for(var x=0;x<k.length;x++){var A=k[x];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(_,A.key,A)}}return function(_,k,x){return k&&m(_.prototype,k),x&&m(_,x),_}}(),o=function m(_,k,x){_===null&&(_=Function.prototype);var A=Object.getOwnPropertyDescriptor(_,k);if(A===void 0){var S=Object.getPrototypeOf(_);return S===null?void 0:m(S,k,x)}else{if("value"in A)return A.value;var P=A.get;return P===void 0?void 0:P.call(x)}},l=i(0),u=b(l),f=i(4),h=b(f),O=i(25),w=b(O);function b(m){return m&&m.__esModule?m:{default:m}}function E(m,_,k){return _ in m?Object.defineProperty(m,_,{value:k,enumerable:!0,configurable:!0,writable:!0}):m[_]=k,m}function p(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")}function v(m,_){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:m}function g(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(m,_):m.__proto__=_)}var y=function(m){g(_,m);function _(){return p(this,_),v(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"format",value:function(x,A){x===d.blotName&&!A?this.replaceWith(u.default.create(this.statics.scope)):o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,x,A)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(x,A){return this.parent.isolate(this.offset(this.parent),this.length()),x===this.parent.statics.blotName?(this.parent.replaceWith(x,A),this):(this.parent.unwrap(),o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replaceWith",this).call(this,x,A))}}],[{key:"formats",value:function(x){return x.tagName===this.tagName?void 0:o(_.__proto__||Object.getPrototypeOf(_),"formats",this).call(this,x)}}]),_}(h.default);y.blotName="list-item",y.tagName="LI";var d=function(m){g(_,m),a(_,null,[{key:"create",value:function(x){var A=x==="ordered"?"OL":"UL",S=o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,A);return(x==="checked"||x==="unchecked")&&S.setAttribute("data-checked",x==="checked"),S}},{key:"formats",value:function(x){if(x.tagName==="OL")return"ordered";if(x.tagName==="UL")return x.hasAttribute("data-checked")?x.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function _(k){p(this,_);var x=v(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,k)),A=function(P){if(P.target.parentNode===k){var C=x.statics.formats(k),R=u.default.find(P.target);C==="checked"?R.format("list","unchecked"):C==="unchecked"&&R.format("list","checked")}};return k.addEventListener("touchstart",A),k.addEventListener("mousedown",A),x}return a(_,[{key:"format",value:function(x,A){this.children.length>0&&this.children.tail.format(x,A)}},{key:"formats",value:function(){return E({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(x,A){if(x instanceof y)o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertBefore",this).call(this,x,A);else{var S=A==null?this.length():A.offset(this),P=this.split(S);P.parent.insertBefore(x,P)}}},{key:"optimize",value:function(x){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,x);var A=this.next;A!=null&&A.prev===this&&A.statics.blotName===this.statics.blotName&&A.domNode.tagName===this.domNode.tagName&&A.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(A.moveChildren(this),A.remove())}},{key:"replace",value:function(x){if(x.statics.blotName!==this.statics.blotName){var A=u.default.create(this.statics.defaultChild);x.moveChildren(A),this.appendChild(A)}o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replace",this).call(this,x)}}]),_}(w.default);d.blotName="list",d.scope=u.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[y],n.ListItem=y,n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,b){if(!(w instanceof b))throw new TypeError("Cannot call a class as a function")}function f(w,b){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:w}function h(w,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);w.prototype=Object.create(b&&b.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(w,b):w.__proto__=b)}var O=function(w){h(b,w);function b(){return u(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default);O.blotName="italic",O.tagName=["EM","I"],n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(p,v){for(var g=0;g<v.length;g++){var y=v[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(p,y.key,y)}}return function(p,v,g){return v&&E(p.prototype,v),g&&E(p,g),p}}(),o=function E(p,v,g){p===null&&(p=Function.prototype);var y=Object.getOwnPropertyDescriptor(p,v);if(y===void 0){var d=Object.getPrototypeOf(p);return d===null?void 0:E(d,v,g)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(g)}},l=i(6),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function h(E,p){if(!(E instanceof p))throw new TypeError("Cannot call a class as a function")}function O(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 w(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 b=function(E){w(p,E);function p(){return h(this,p),O(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,null,[{key:"create",value:function(g){return g==="super"?document.createElement("sup"):g==="sub"?document.createElement("sub"):o(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,g)}},{key:"formats",value:function(g){if(g.tagName==="SUB")return"sub";if(g.tagName==="SUP")return"super"}}]),p}(u.default);b.blotName="script",b.tagName=["SUB","SUP"],n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,b){if(!(w instanceof b))throw new TypeError("Cannot call a class as a function")}function f(w,b){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:w}function h(w,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);w.prototype=Object.create(b&&b.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(w,b):w.__proto__=b)}var O=function(w){h(b,w);function b(){return u(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default);O.blotName="strike",O.tagName="S",n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,b){if(!(w instanceof b))throw new TypeError("Cannot call a class as a function")}function f(w,b){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:w}function h(w,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);w.prototype=Object.create(b&&b.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(w,b):w.__proto__=b)}var O=function(w){h(b,w);function b(){return u(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default);O.blotName="underline",O.tagName="U",n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(g,y){for(var d=0;d<y.length;d++){var m=y[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(g,m.key,m)}}return function(g,y,d){return y&&v(g.prototype,y),d&&v(g,d),g}}(),o=function v(g,y,d){g===null&&(g=Function.prototype);var m=Object.getOwnPropertyDescriptor(g,y);if(m===void 0){var _=Object.getPrototypeOf(g);return _===null?void 0:v(_,y,d)}else{if("value"in m)return m.value;var k=m.get;return k===void 0?void 0:k.call(d)}},l=i(0),u=h(l),f=i(27);function h(v){return v&&v.__esModule?v:{default:v}}function O(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function w(v,g){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:v}function b(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);v.prototype=Object.create(g&&g.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(v,g):v.__proto__=g)}var E=["alt","height","width"],p=function(v){b(g,v);function g(){return O(this,g),w(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,[{key:"format",value:function(d,m){E.indexOf(d)>-1?m?this.domNode.setAttribute(d,m):this.domNode.removeAttribute(d):o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,d,m)}}],[{key:"create",value:function(d){var m=o(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,d);return typeof d=="string"&&m.setAttribute("src",this.sanitize(d)),m}},{key:"formats",value:function(d){return E.reduce(function(m,_){return d.hasAttribute(_)&&(m[_]=d.getAttribute(_)),m},{})}},{key:"match",value:function(d){return/\.(jpe?g|gif|png)$/.test(d)||/^data:image\/.+;base64/.test(d)}},{key:"sanitize",value:function(d){return(0,f.sanitize)(d,["http","https","data"])?d:"//:0"}},{key:"value",value:function(d){return d.getAttribute("src")}}]),g}(u.default.Embed);p.blotName="image",p.tagName="IMG",n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(g,y){for(var d=0;d<y.length;d++){var m=y[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(g,m.key,m)}}return function(g,y,d){return y&&v(g.prototype,y),d&&v(g,d),g}}(),o=function v(g,y,d){g===null&&(g=Function.prototype);var m=Object.getOwnPropertyDescriptor(g,y);if(m===void 0){var _=Object.getPrototypeOf(g);return _===null?void 0:v(_,y,d)}else{if("value"in m)return m.value;var k=m.get;return k===void 0?void 0:k.call(d)}},l=i(4),u=i(27),f=h(u);function h(v){return v&&v.__esModule?v:{default:v}}function O(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function w(v,g){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:v}function b(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);v.prototype=Object.create(g&&g.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(v,g):v.__proto__=g)}var E=["height","width"],p=function(v){b(g,v);function g(){return O(this,g),w(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,[{key:"format",value:function(d,m){E.indexOf(d)>-1?m?this.domNode.setAttribute(d,m):this.domNode.removeAttribute(d):o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,d,m)}}],[{key:"create",value:function(d){var m=o(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,d);return m.setAttribute("frameborder","0"),m.setAttribute("allowfullscreen",!0),m.setAttribute("src",this.sanitize(d)),m}},{key:"formats",value:function(d){return E.reduce(function(m,_){return d.hasAttribute(_)&&(m[_]=d.getAttribute(_)),m},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),g}(l.BlockEmbed);p.blotName="video",p.className="ql-video",p.tagName="IFRAME",n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var a=function(){function d(m,_){for(var k=0;k<_.length;k++){var x=_[k];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(m,x.key,x)}}return function(m,_,k){return _&&d(m.prototype,_),k&&d(m,k),m}}(),o=function d(m,_,k){m===null&&(m=Function.prototype);var x=Object.getOwnPropertyDescriptor(m,_);if(x===void 0){var A=Object.getPrototypeOf(m);return A===null?void 0:d(A,_,k)}else{if("value"in x)return x.value;var S=x.get;return S===void 0?void 0:S.call(k)}},l=i(35),u=b(l),f=i(5),h=b(f),O=i(9),w=b(O);function b(d){return d&&d.__esModule?d:{default:d}}function E(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function p(d,m){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:d}function v(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}var g=function(d){v(m,d);function m(){return E(this,m),p(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,null,[{key:"create",value:function(k){var x=o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,k);return typeof k=="string"&&(window.katex.render(k,x,{throwOnError:!1,errorColor:"#f00"}),x.setAttribute("data-value",k)),x}},{key:"value",value:function(k){return k.getAttribute("data-value")}}]),m}(u.default);g.blotName="formula",g.className="ql-formula",g.tagName="SPAN";var y=function(d){v(m,d),a(m,null,[{key:"register",value:function(){h.default.register(g,!0)}}]);function m(){E(this,m);var _=p(this,(m.__proto__||Object.getPrototypeOf(m)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return _}return m}(w.default);n.FormulaBlot=g,n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function k(x,A){for(var S=0;S<A.length;S++){var P=A[S];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(x,P.key,P)}}return function(x,A,S){return A&&k(x.prototype,A),S&&k(x,S),x}}(),o=function k(x,A,S){x===null&&(x=Function.prototype);var P=Object.getOwnPropertyDescriptor(x,A);if(P===void 0){var C=Object.getPrototypeOf(x);return C===null?void 0:k(C,A,S)}else{if("value"in P)return P.value;var R=P.get;return R===void 0?void 0:R.call(S)}},l=i(0),u=p(l),f=i(5),h=p(f),O=i(9),w=p(O),b=i(13),E=p(b);function p(k){return k&&k.__esModule?k:{default:k}}function v(k,x){if(!(k instanceof x))throw new TypeError("Cannot call a class as a function")}function g(k,x){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:k}function y(k,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);k.prototype=Object.create(x&&x.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(k,x):k.__proto__=x)}var d=function(k){y(x,k);function x(){return v(this,x),g(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"replaceWith",value:function(S){this.domNode.textContent=this.domNode.textContent,this.attach(),o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replaceWith",this).call(this,S)}},{key:"highlight",value:function(S){var P=this.domNode.textContent;this.cachedText!==P&&((P.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=S(P),this.domNode.normalize(),this.attach()),this.cachedText=P)}}]),x}(E.default);d.className="ql-syntax";var m=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),_=function(k){y(x,k),a(x,null,[{key:"register",value:function(){h.default.register(m,!0),h.default.register(d,!0)}}]);function x(A,S){v(this,x);var P=g(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,A,S));if(typeof P.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var C=null;return P.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(C),C=setTimeout(function(){P.highlight(),C=null},P.options.interval)}),P.highlight(),P}return a(x,[{key:"highlight",value:function(){var S=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var P=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(C){C.highlight(S.options.highlight)}),this.quill.update(h.default.sources.SILENT),P!=null&&this.quill.setSelection(P,h.default.sources.SILENT)}}}]),x}(w.default);_.DEFAULTS={highlight:function(){return window.hljs==null?null:function(k){var x=window.hljs.highlightAuto(k);return x.value}}(),interval:1e3},n.CodeBlock=d,n.CodeToken=m,n.default=_},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 x(A,S,P){A===null&&(A=Function.prototype);var C=Object.getOwnPropertyDescriptor(A,S);if(C===void 0){var R=Object.getPrototypeOf(A);return R===null?void 0:x(R,S,P)}else{if("value"in C)return C.value;var N=C.get;return N===void 0?void 0:N.call(P)}},o=function(){function x(A,S){for(var P=0;P<S.length;P++){var C=S[P];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(A,C.key,C)}}return function(A,S,P){return S&&x(A.prototype,S),P&&x(A,P),A}}(),l=i(3),u=v(l),f=i(8),h=v(f),O=i(43),w=v(O),b=i(15),E=i(41),p=v(E);function v(x){return x&&x.__esModule?x:{default:x}}function g(x,A){if(!(x instanceof A))throw new TypeError("Cannot call a class as a function")}function y(x,A){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:x}function d(x,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);x.prototype=Object.create(A&&A.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(x,A):x.__proto__=A)}var m=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],_=function(x){d(A,x);function A(S,P){g(this,A),P.modules.toolbar!=null&&P.modules.toolbar.container==null&&(P.modules.toolbar.container=m);var C=y(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,S,P));return C.quill.container.classList.add("ql-bubble"),C}return o(A,[{key:"extendToolbar",value:function(P){this.tooltip=new k(this.quill,this.options.bounds),this.tooltip.root.appendChild(P.container),this.buildButtons([].slice.call(P.container.querySelectorAll("button")),p.default),this.buildPickers([].slice.call(P.container.querySelectorAll("select")),p.default)}}]),A}(w.default);_.DEFAULTS=(0,u.default)(!0,{},w.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(A){A?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var k=function(x){d(A,x);function A(S,P){g(this,A);var C=y(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,S,P));return C.quill.on(h.default.events.EDITOR_CHANGE,function(R,N,U,G){if(R===h.default.events.SELECTION_CHANGE)if(N!=null&&N.length>0&&G===h.default.sources.USER){C.show(),C.root.style.left="0px",C.root.style.width="",C.root.style.width=C.root.offsetWidth+"px";var Z=C.quill.getLines(N.index,N.length);if(Z.length===1)C.position(C.quill.getBounds(N));else{var W=Z[Z.length-1],H=C.quill.getIndex(W),M=Math.min(W.length()-1,N.index+N.length-H),L=C.quill.getBounds(new b.Range(H,M));C.position(L)}}else document.activeElement!==C.textbox&&C.quill.hasFocus()&&C.hide()}),C}return o(A,[{key:"listen",value:function(){var P=this;a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){P.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!P.root.classList.contains("ql-hidden")){var C=P.quill.getSelection();C!=null&&P.position(P.quill.getBounds(C))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(P){var C=a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"position",this).call(this,P),R=this.root.querySelector(".ql-tooltip-arrow");if(R.style.marginLeft="",C===0)return C;R.style.marginLeft=-1*C-R.offsetWidth/2+"px"}}]),A}(O.BaseTooltip);k.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=k,n.default=_},function(r,n,i){r.exports=i(63)}]).default})})(aS);var TD=aS.exports,g2={},oS={exports:{}},Vo={},Uu={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Uu.exports;var I4;function AD(){return I4||(I4=1,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof me=="object"&&me;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,l=2147483647,u=36,f=1,h=26,O=38,w=700,b=72,E=128,p="-",v=/^xn--/,g=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=u-f,_=Math.floor,k=String.fromCharCode,x;function A(L){throw new RangeError(d[L])}function S(L,D){for(var B=L.length,q=[];B--;)q[B]=D(L[B]);return q}function P(L,D){var B=L.split("@"),q="";B.length>1&&(q=B[0]+"@",L=B[1]),L=L.replace(y,".");var K=L.split("."),z=S(K,D).join(".");return q+z}function C(L){for(var D=[],B=0,q=L.length,K,z;B<q;)K=L.charCodeAt(B++),K>=55296&&K<=56319&&B<q?(z=L.charCodeAt(B++),(z&64512)==56320?D.push(((K&1023)<<10)+(z&1023)+65536):(D.push(K),B--)):D.push(K);return D}function R(L){return S(L,function(D){var B="";return D>65535&&(D-=65536,B+=k(D>>>10&1023|55296),D=56320|D&1023),B+=k(D),B}).join("")}function N(L){return L-48<10?L-22:L-65<26?L-65:L-97<26?L-97:u}function U(L,D){return L+22+75*(L<26)-((D!=0)<<5)}function G(L,D,B){var q=0;for(L=B?_(L/w):L>>1,L+=_(L/D);L>m*h>>1;q+=u)L=_(L/m);return _(q+(m+1)*L/(L+O))}function Z(L){var D=[],B=L.length,q,K=0,z=E,$=b,F,Y,X,Q,ee,re,oe,ae,ie;for(F=L.lastIndexOf(p),F<0&&(F=0),Y=0;Y<F;++Y)L.charCodeAt(Y)>=128&&A("not-basic"),D.push(L.charCodeAt(Y));for(X=F>0?F+1:0;X<B;){for(Q=K,ee=1,re=u;X>=B&&A("invalid-input"),oe=N(L.charCodeAt(X++)),(oe>=u||oe>_((l-K)/ee))&&A("overflow"),K+=oe*ee,ae=re<=$?f:re>=$+h?h:re-$,!(oe<ae);re+=u)ie=u-ae,ee>_(l/ie)&&A("overflow"),ee*=ie;q=D.length+1,$=G(K-Q,q,Q==0),_(K/q)>l-z&&A("overflow"),z+=_(K/q),K%=q,D.splice(K++,0,z)}return R(D)}function W(L){var D,B,q,K,z,$,F,Y,X,Q,ee,re=[],oe,ae,ie,Re;for(L=C(L),oe=L.length,D=E,B=0,z=b,$=0;$<oe;++$)ee=L[$],ee<128&&re.push(k(ee));for(q=K=re.length,K&&re.push(p);q<oe;){for(F=l,$=0;$<oe;++$)ee=L[$],ee>=D&&ee<F&&(F=ee);for(ae=q+1,F-D>_((l-B)/ae)&&A("overflow"),B+=(F-D)*ae,D=F,$=0;$<oe;++$)if(ee=L[$],ee<D&&++B>l&&A("overflow"),ee==D){for(Y=B,X=u;Q=X<=z?f:X>=z+h?h:X-z,!(Y<Q);X+=u)Re=Y-Q,ie=u-Q,re.push(k(U(Q+Re%ie,0))),Y=_(Re/ie);re.push(k(U(Y,0))),z=G(B,ae,q==K),B=0,++q}++B,++D}return re.join("")}function H(L){return P(L,function(D){return v.test(D)?Z(D.slice(4).toLowerCase()):D})}function M(L){return P(L,function(D){return g.test(D)?"xn--"+W(D):D})}if(o={version:"1.4.1",ucs2:{decode:C,encode:R},decode:Z,encode:W,toASCII:M,toUnicode:H},n&&i)if(e.exports==n)i.exports=o;else for(x in o)o.hasOwnProperty(x)&&(n[x]=o[x]);else r.punycode=o})(me)}(Uu,Uu.exports)),Uu.exports}var ag,D4;function RD(){return D4||(D4=1,ag=Error),ag}var og,j4;function MD(){return j4||(j4=1,og=EvalError),og}var lg,F4;function LD(){return F4||(F4=1,lg=RangeError),lg}var sg,z4;function ND(){return z4||(z4=1,sg=ReferenceError),sg}var ug,B4;function lS(){return B4||(B4=1,ug=SyntaxError),ug}var cg,U4;function Jc(){return U4||(U4=1,cg=TypeError),cg}var fg,H4;function ID(){return H4||(H4=1,fg=URIError),fg}var dg,$4;function DD(){return $4||($4=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,G4;function jD(){if(G4)return hg;G4=1;var e=typeof Symbol<"u"&&Symbol,t=DD();return hg=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},hg}var pg,V4;function FD(){if(V4)return pg;V4=1;var e={__proto__:null,foo:{}},t=Object;return pg=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)},pg}var gg,q4;function zD(){if(q4)return gg;q4=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(u,f){for(var h=[],O=0;O<u.length;O+=1)h[O]=u[O];for(var w=0;w<f.length;w+=1)h[w+u.length]=f[w];return h},a=function(u,f){for(var h=[],O=f,w=0;O<u.length;O+=1,w+=1)h[w]=u[O];return h},o=function(l,u){for(var f="",h=0;h<l.length;h+=1)f+=l[h],h+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 h=a(arguments,1),O,w=function(){if(this instanceof O){var g=f.apply(this,i(h,arguments));return Object(g)===g?g:this}return f.apply(u,i(h,arguments))},b=r(0,f.length-h.length),E=[],p=0;p<b;p++)E[p]="$"+p;if(O=Function("binder","return function ("+o(E,",")+"){ return binder.apply(this,arguments); }")(w),f.prototype){var v=function(){};v.prototype=f.prototype,O.prototype=new v,v.prototype=null}return O},gg}var vg,W4;function v2(){if(W4)return vg;W4=1;var e=zD();return vg=Function.prototype.bind||e,vg}var mg,K4;function BD(){if(K4)return mg;K4=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=v2();return mg=r.call(e,t),mg}var yg,Y4;function nu(){if(Y4)return yg;Y4=1;var e,t=RD(),r=MD(),n=LD(),i=ND(),a=lS(),o=Jc(),l=ID(),u=Function,f=function(W){try{return u('"use strict"; return ('+W+").constructor;")()}catch{}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch{h=null}var O=function(){throw new o},w=h?function(){try{return arguments.callee,O}catch{try{return h(arguments,"callee").get}catch{return O}}}():O,b=jD()(),E=FD()(),p=Object.getPrototypeOf||(E?function(W){return W.__proto__}:null),v={},g=typeof Uint8Array>"u"||!p?e:p(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":b&&p?p([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":v,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":b&&p?p(p([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!b||!p?e:p(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"||!b||!p?e:p(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":b&&p?p(""[Symbol.iterator]()):e,"%Symbol%":b?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":w,"%TypedArray%":g,"%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(p)try{null.error}catch(W){var d=p(p(W));y["%Error.prototype%"]=d}var m=function W(H){var M;if(H==="%AsyncFunction%")M=f("async function () {}");else if(H==="%GeneratorFunction%")M=f("function* () {}");else if(H==="%AsyncGeneratorFunction%")M=f("async function* () {}");else if(H==="%AsyncGenerator%"){var L=W("%AsyncGeneratorFunction%");L&&(M=L.prototype)}else if(H==="%AsyncIteratorPrototype%"){var D=W("%AsyncGenerator%");D&&p&&(M=p(D.prototype))}return y[H]=M,M},_={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},k=v2(),x=BD(),A=k.call(Function.call,Array.prototype.concat),S=k.call(Function.apply,Array.prototype.splice),P=k.call(Function.call,String.prototype.replace),C=k.call(Function.call,String.prototype.slice),R=k.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,U=/\\(\\)?/g,G=function(H){var M=C(H,0,1),L=C(H,-1);if(M==="%"&&L!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(L==="%"&&M!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var D=[];return P(H,N,function(B,q,K,z){D[D.length]=K?P(z,U,"$1"):q||B}),D},Z=function(H,M){var L=H,D;if(x(_,L)&&(D=_[L],L="%"+D[0]+"%"),x(y,L)){var B=y[L];if(B===v&&(B=m(L)),typeof B>"u"&&!M)throw new o("intrinsic "+H+" exists, but is not available. Please file an issue!");return{alias:D,name:L,value:B}}throw new a("intrinsic "+H+" does not exist!")};return yg=function(H,M){if(typeof H!="string"||H.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof M!="boolean")throw new o('"allowMissing" argument must be a boolean');if(R(/^%?[^%]*%?$/,H)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var L=G(H),D=L.length>0?L[0]:"",B=Z("%"+D+"%",M),q=B.name,K=B.value,z=!1,$=B.alias;$&&(D=$[0],S(L,A([0,1],$)));for(var F=1,Y=!0;F<L.length;F+=1){var X=L[F],Q=C(X,0,1),ee=C(X,-1);if((Q==='"'||Q==="'"||Q==="`"||ee==='"'||ee==="'"||ee==="`")&&Q!==ee)throw new a("property names with quotes must have matching quotes");if((X==="constructor"||!Y)&&(z=!0),D+="."+X,q="%"+D+"%",x(y,q))K=y[q];else if(K!=null){if(!(X in K)){if(!M)throw new o("base intrinsic for "+H+" exists, but the property is not available.");return}if(h&&F+1>=L.length){var re=h(K,X);Y=!!re,Y&&"get"in re&&!("originalValue"in re.get)?K=re.get:K=K[X]}else Y=x(K,X),K=K[X];Y&&!z&&(y[q]=K)}}return K},yg}var bg={exports:{}},_g,X4;function m2(){if(X4)return _g;X4=1;var e=nu(),t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return _g=t,_g}var wg,Z4;function sS(){if(Z4)return wg;Z4=1;var e=nu(),t=e("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return wg=t,wg}var Sg,Q4;function UD(){if(Q4)return Sg;Q4=1;var e=m2(),t=lS(),r=Jc(),n=sS();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,h=arguments.length>5?arguments[5]:null,O=arguments.length>6?arguments[6]:!1,w=!!n&&n(a,o);if(e)e(a,o,{configurable:h===null&&w?w.configurable:!h,enumerable:u===null&&w?w.enumerable:!u,value:l,writable:f===null&&w?w.writable:!f});else if(O||!u&&!f&&!h)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,J4;function HD(){if(J4)return Eg;J4=1;var e=m2(),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,e_;function $D(){if(e_)return Og;e_=1;var e=nu(),t=UD(),r=HD()(),n=sS(),i=Jc(),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],h=!0,O=!0;if("length"in l&&n){var w=n(l,"length");w&&!w.configurable&&(h=!1),w&&!w.writable&&(O=!1)}return(h||O||!f)&&(r?t(l,"length",u,!0,!0):t(l,"length",u)),l},Og}var t_;function GD(){return t_||(t_=1,function(e){var t=v2(),r=nu(),n=$D(),i=Jc(),a=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),l=r("%Reflect.apply%",!0)||t.call(o,a),u=m2(),f=r("%Math.max%");e.exports=function(w){if(typeof w!="function")throw new i("a function is required");var b=l(t,o,arguments);return n(b,1+f(0,w.length-(arguments.length-1)),!0)};var h=function(){return l(t,a,arguments)};u?u(e.exports,"apply",{value:h}):e.exports.apply=h}(bg)),bg.exports}var Pg,r_;function VD(){if(r_)return Pg;r_=1;var e=nu(),t=GD(),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 qD={},WD=Object.freeze(Object.defineProperty({__proto__:null,default:qD},Symbol.toStringTag,{value:"Module"})),KD=yo(WD);var xg,n_;function YD(){if(n_)return xg;n_=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,h=typeof WeakSet=="function"&&WeakSet.prototype,O=h?WeakSet.prototype.has:null,w=typeof WeakRef=="function"&&WeakRef.prototype,b=w?WeakRef.prototype.deref:null,E=Boolean.prototype.valueOf,p=Object.prototype.toString,v=Function.prototype.toString,g=String.prototype.match,y=String.prototype.slice,d=String.prototype.replace,m=String.prototype.toUpperCase,_=String.prototype.toLowerCase,k=RegExp.prototype.test,x=Array.prototype.concat,A=Array.prototype.join,S=Array.prototype.slice,P=Math.floor,C=typeof BigInt=="function"?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,U=typeof Symbol=="function"&&typeof Symbol.iterator=="object",G=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===U||!0)?Symbol.toStringTag:null,Z=Object.prototype.propertyIsEnumerable,W=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(se){return se.__proto__}:null);function H(se,fe){if(se===1/0||se===-1/0||se!==se||se&&se>-1e3&&se<1e3||k.call(/e/,fe))return fe;var Ze=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof se=="number"){var Je=se<0?-P(-se):P(se);if(Je!==se){var _e=String(Je),xe=y.call(fe,_e.length+1);return d.call(_e,Ze,"$&_")+"."+d.call(d.call(xe,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(fe,Ze,"$&_")}var M=KD,L=M.custom,D=ee(L)?L:null;xg=function se(fe,Ze,Je,_e){var xe=Ze||{};if(ae(xe,"quoteStyle")&&xe.quoteStyle!=="single"&&xe.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ae(xe,"maxStringLength")&&(typeof xe.maxStringLength=="number"?xe.maxStringLength<0&&xe.maxStringLength!==1/0:xe.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var qe=ae(xe,"customInspect")?xe.customInspect:!0;if(typeof qe!="boolean"&&qe!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ae(xe,"indent")&&xe.indent!==null&&xe.indent!==" "&&!(parseInt(xe.indent,10)===xe.indent&&xe.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ae(xe,"numericSeparator")&&typeof xe.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var we=xe.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 he(fe,xe);if(typeof fe=="number"){if(fe===0)return 1/0/fe>0?"0":"-0";var We=String(fe);return we?H(fe,We):We}if(typeof fe=="bigint"){var Ee=String(fe)+"n";return we?H(fe,Ee):Ee}var Ke=typeof xe.depth>"u"?5:xe.depth;if(typeof Je>"u"&&(Je=0),Je>=Ke&&Ke>0&&typeof fe=="object")return K(fe)?"[Array]":"[Object]";var rr=Oe(xe,Je);if(typeof _e>"u")_e=[];else if(Me(_e,fe)>=0)return"[Circular]";function gt(yt,kr,wn){if(kr&&(_e=S.call(_e),_e.push(kr)),wn){var or={depth:xe.depth};return ae(xe,"quoteStyle")&&(or.quoteStyle=xe.quoteStyle),se(yt,or,Je+1,_e)}return se(yt,xe,Je+1,_e)}if(typeof fe=="function"&&!$(fe)){var cr=Re(fe),Le=Qe(fe,gt);return"[Function"+(cr?": "+cr:" (anonymous)")+"]"+(Le.length>0?" { "+A.call(Le,", ")+" }":"")}if(ee(fe)){var Ye=U?d.call(String(fe),/^(Symbol\(.*\))_[^)]*$/,"$1"):N.call(fe);return typeof fe=="object"&&!U?$e(Ye):Ye}if(de(fe)){for(var rt="<"+_.call(String(fe.nodeName)),Pt=fe.attributes||[],Ct=0;Ct<Pt.length;Ct++)rt+=" "+Pt[Ct].name+"="+B(q(Pt[Ct].value),"double",xe);return rt+=">",fe.childNodes&&fe.childNodes.length&&(rt+="..."),rt+="</"+_.call(String(fe.nodeName))+">",rt}if(K(fe)){if(fe.length===0)return"[]";var en=Qe(fe,gt);return rr&&!Ce(en)?"["+Fe(en,rr)+"]":"[ "+A.call(en,", ")+" ]"}if(F(fe)){var qr=Qe(fe,gt);return!("cause"in Error.prototype)&&"cause"in fe&&!Z.call(fe,"cause")?"{ ["+String(fe)+"] "+A.call(x.call("[cause]: "+gt(fe.cause),qr),", ")+" }":qr.length===0?"["+String(fe)+"]":"{ ["+String(fe)+"] "+A.call(qr,", ")+" }"}if(typeof fe=="object"&&qe){if(D&&typeof fe[D]=="function"&&M)return M(fe,{depth:Ke-Je});if(qe!=="symbol"&&typeof fe.inspect=="function")return fe.inspect()}if(ne(fe)){var _r=[];return n&&n.call(fe,function(yt,kr){_r.push(gt(kr,fe,!0)+" => "+gt(yt,fe))}),Ae("Map",r.call(fe),_r,rr)}if(ye(fe)){var bn=[];return l&&l.call(fe,function(yt){bn.push(gt(yt,fe))}),Ae("Set",o.call(fe),bn,rr)}if(le(fe))return tt("WeakMap");if(te(fe))return tt("WeakSet");if(be(fe))return tt("WeakRef");if(X(fe))return $e(gt(Number(fe)));if(re(fe))return $e(gt(C.call(fe)));if(Q(fe))return $e(E.call(fe));if(Y(fe))return $e(gt(String(fe)));if(typeof window<"u"&&fe===window)return"{ [object Window] }";if(typeof globalThis<"u"&&fe===globalThis||typeof me<"u"&&fe===me)return"{ [object globalThis] }";if(!z(fe)&&!$(fe)){var Oi=Qe(fe,gt),_n=W?W(fe)===Object.prototype:fe instanceof Object||fe.constructor===Object,Ne=fe instanceof Object?"":"null prototype",nt=!_n&&G&&Object(fe)===fe&&G in fe?y.call(ie(fe),8,-1):Ne?"Object":"",mt=_n||typeof fe.constructor!="function"?"":fe.constructor.name?fe.constructor.name+" ":"",Nt=mt+(nt||Ne?"["+A.call(x.call([],nt||[],Ne||[]),": ")+"] ":"");return Oi.length===0?Nt+"{}":rr?Nt+"{"+Fe(Oi,rr)+"}":Nt+"{ "+A.call(Oi,", ")+" }"}return String(fe)};function B(se,fe,Ze){var Je=(Ze.quoteStyle||fe)==="double"?'"':"'";return Je+se+Je}function q(se){return d.call(String(se),/"/g,""")}function K(se){return ie(se)==="[object Array]"&&(!G||!(typeof se=="object"&&G in se))}function z(se){return ie(se)==="[object Date]"&&(!G||!(typeof se=="object"&&G in se))}function $(se){return ie(se)==="[object RegExp]"&&(!G||!(typeof se=="object"&&G in se))}function F(se){return ie(se)==="[object Error]"&&(!G||!(typeof se=="object"&&G in se))}function Y(se){return ie(se)==="[object String]"&&(!G||!(typeof se=="object"&&G in se))}function X(se){return ie(se)==="[object Number]"&&(!G||!(typeof se=="object"&&G in se))}function Q(se){return ie(se)==="[object Boolean]"&&(!G||!(typeof se=="object"&&G in se))}function ee(se){if(U)return se&&typeof se=="object"&&se instanceof Symbol;if(typeof se=="symbol")return!0;if(!se||typeof se!="object"||!N)return!1;try{return N.call(se),!0}catch{}return!1}function re(se){if(!se||typeof se!="object"||!C)return!1;try{return C.call(se),!0}catch{}return!1}var oe=Object.prototype.hasOwnProperty||function(se){return se in this};function ae(se,fe){return oe.call(se,fe)}function ie(se){return p.call(se)}function Re(se){if(se.name)return se.name;var fe=g.call(v.call(se),/^function\s*([\w$]+)/);return fe?fe[1]:null}function Me(se,fe){if(se.indexOf)return se.indexOf(fe);for(var Ze=0,Je=se.length;Ze<Je;Ze++)if(se[Ze]===fe)return Ze;return-1}function ne(se){if(!r||!se||typeof se!="object")return!1;try{r.call(se);try{o.call(se)}catch{return!0}return se instanceof Map}catch{}return!1}function le(se){if(!f||!se||typeof se!="object")return!1;try{f.call(se,f);try{O.call(se,O)}catch{return!0}return se instanceof WeakMap}catch{}return!1}function be(se){if(!b||!se||typeof se!="object")return!1;try{return b.call(se),!0}catch{}return!1}function ye(se){if(!o||!se||typeof se!="object")return!1;try{o.call(se);try{r.call(se)}catch{return!0}return se instanceof Set}catch{}return!1}function te(se){if(!O||!se||typeof se!="object")return!1;try{O.call(se,O);try{f.call(se,f)}catch{return!0}return se instanceof WeakSet}catch{}return!1}function de(se){return!se||typeof se!="object"?!1:typeof HTMLElement<"u"&&se instanceof HTMLElement?!0:typeof se.nodeName=="string"&&typeof se.getAttribute=="function"}function he(se,fe){if(se.length>fe.maxStringLength){var Ze=se.length-fe.maxStringLength,Je="... "+Ze+" more character"+(Ze>1?"s":"");return he(y.call(se,0,fe.maxStringLength),fe)+Je}var _e=d.call(d.call(se,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Se);return B(_e,"single",fe)}function Se(se){var fe=se.charCodeAt(0),Ze={8:"b",9:"t",10:"n",12:"f",13:"r"}[fe];return Ze?"\\"+Ze:"\\x"+(fe<16?"0":"")+m.call(fe.toString(16))}function $e(se){return"Object("+se+")"}function tt(se){return se+" { ? }"}function Ae(se,fe,Ze,Je){var _e=Je?Fe(Ze,Je):A.call(Ze,", ");return se+" ("+fe+") {"+_e+"}"}function Ce(se){for(var fe=0;fe<se.length;fe++)if(Me(se[fe],`
|
|
149
|
+
`)>=0)return!1;return!0}function Oe(se,fe){var Ze;if(se.indent===" ")Ze=" ";else if(typeof se.indent=="number"&&se.indent>0)Ze=A.call(Array(se.indent+1)," ");else return null;return{base:Ze,prev:A.call(Array(fe+1),Ze)}}function Fe(se,fe){if(se.length===0)return"";var Ze=`
|
|
150
|
+
`+fe.prev+fe.base;return Ze+A.call(se,","+Ze)+`
|
|
151
|
+
`+fe.prev}function Qe(se,fe){var Ze=K(se),Je=[];if(Ze){Je.length=se.length;for(var _e=0;_e<se.length;_e++)Je[_e]=ae(se,_e)?fe(se[_e],se):""}var xe=typeof R=="function"?R(se):[],qe;if(U){qe={};for(var we=0;we<xe.length;we++)qe["$"+xe[we]]=xe[we]}for(var We in se)ae(se,We)&&(Ze&&String(Number(We))===We&&We<se.length||U&&qe["$"+We]instanceof Symbol||(k.call(/[^\w$]/,We)?Je.push(fe(We,se)+": "+fe(se[We],se)):Je.push(We+": "+fe(se[We],se))));if(typeof R=="function")for(var Ee=0;Ee<xe.length;Ee++)Z.call(se,xe[Ee])&&Je.push("["+fe(xe[Ee])+"]: "+fe(se[xe[Ee]],se));return Je}return xg}var Cg,i_;function XD(){if(i_)return Cg;i_=1;var e=nu(),t=VD(),r=YD(),n=Jc(),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),h=t("Map.prototype.set",!0),O=t("Map.prototype.has",!0),w=function(v,g){for(var y=v,d;(d=y.next)!==null;y=d)if(d.key===g)return y.next=d.next,d.next=v.next,v.next=d,d},b=function(v,g){var y=w(v,g);return y&&y.value},E=function(v,g,y){var d=w(v,g);d?d.value=y:v.next={key:g,next:v.next,value:y}},p=function(v,g){return!!w(v,g)};return Cg=function(){var g,y,d,m={assert:function(_){if(!m.has(_))throw new n("Side channel does not contain "+r(_))},get:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(g)return o(g,_)}else if(a){if(y)return f(y,_)}else if(d)return b(d,_)},has:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(g)return u(g,_)}else if(a){if(y)return O(y,_)}else if(d)return p(d,_);return!1},set:function(_,k){i&&_&&(typeof _=="object"||typeof _=="function")?(g||(g=new i),l(g,_,k)):a?(y||(y=new a),h(y,_,k)):(d||(d={key:{},next:null}),E(d,_,k))}};return m},Cg}var kg,a_;function y2(){if(a_)return kg;a_=1;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return kg={default:r.RFC3986,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},kg}var Tg,o_;function uS(){if(o_)return Tg;o_=1;var e=y2(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var v=[],g=0;g<256;++g)v.push("%"+((g<16?"0":"")+g.toString(16)).toUpperCase());return v}(),i=function(g){for(;g.length>1;){var y=g.pop(),d=y.obj[y.prop];if(r(d)){for(var m=[],_=0;_<d.length;++_)typeof d[_]<"u"&&m.push(d[_]);y.obj[y.prop]=m}}},a=function(g,y){for(var d=y&&y.plainObjects?Object.create(null):{},m=0;m<g.length;++m)typeof g[m]<"u"&&(d[m]=g[m]);return d},o=function v(g,y,d){if(!y)return g;if(typeof y!="object"){if(r(g))g.push(y);else if(g&&typeof g=="object")(d&&(d.plainObjects||d.allowPrototypes)||!t.call(Object.prototype,y))&&(g[y]=!0);else return[g,y];return g}if(!g||typeof g!="object")return[g].concat(y);var m=g;return r(g)&&!r(y)&&(m=a(g,d)),r(g)&&r(y)?(y.forEach(function(_,k){if(t.call(g,k)){var x=g[k];x&&typeof x=="object"&&_&&typeof _=="object"?g[k]=v(x,_,d):g.push(_)}else g[k]=_}),g):Object.keys(y).reduce(function(_,k){var x=y[k];return t.call(_,k)?_[k]=v(_[k],x,d):_[k]=x,_},m)},l=function(g,y){return Object.keys(y).reduce(function(d,m){return d[m]=y[m],d},g)},u=function(v,g,y){var d=v.replace(/\+/g," ");if(y==="iso-8859-1")return d.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(d)}catch{return d}},f=1024,h=function(g,y,d,m,_){if(g.length===0)return g;var k=g;if(typeof g=="symbol"?k=Symbol.prototype.toString.call(g):typeof g!="string"&&(k=String(g)),d==="iso-8859-1")return escape(k).replace(/%u[0-9a-f]{4}/gi,function(N){return"%26%23"+parseInt(N.slice(2),16)+"%3B"});for(var x="",A=0;A<k.length;A+=f){for(var S=k.length>=f?k.slice(A,A+f):k,P=[],C=0;C<S.length;++C){var R=S.charCodeAt(C);if(R===45||R===46||R===95||R===126||R>=48&&R<=57||R>=65&&R<=90||R>=97&&R<=122||_===e.RFC1738&&(R===40||R===41)){P[P.length]=S.charAt(C);continue}if(R<128){P[P.length]=n[R];continue}if(R<2048){P[P.length]=n[192|R>>6]+n[128|R&63];continue}if(R<55296||R>=57344){P[P.length]=n[224|R>>12]+n[128|R>>6&63]+n[128|R&63];continue}C+=1,R=65536+((R&1023)<<10|S.charCodeAt(C)&1023),P[P.length]=n[240|R>>18]+n[128|R>>12&63]+n[128|R>>6&63]+n[128|R&63]}x+=P.join("")}return x},O=function(g){for(var y=[{obj:{o:g},prop:"o"}],d=[],m=0;m<y.length;++m)for(var _=y[m],k=_.obj[_.prop],x=Object.keys(k),A=0;A<x.length;++A){var S=x[A],P=k[S];typeof P=="object"&&P!==null&&d.indexOf(P)===-1&&(y.push({obj:k,prop:S}),d.push(P))}return i(y),g},w=function(g){return Object.prototype.toString.call(g)==="[object RegExp]"},b=function(g){return!g||typeof g!="object"?!1:!!(g.constructor&&g.constructor.isBuffer&&g.constructor.isBuffer(g))},E=function(g,y){return[].concat(g,y)},p=function(g,y){if(r(g)){for(var d=[],m=0;m<g.length;m+=1)d.push(y(g[m]));return d}return y(g)};return Tg={arrayToObject:a,assign:l,combine:E,compact:O,decode:u,encode:h,isBuffer:b,isRegExp:w,maybeMap:p,merge:o},Tg}var Ag,l_;function ZD(){if(l_)return Ag;l_=1;var e=XD(),t=uS(),r=y2(),n=Object.prototype.hasOwnProperty,i={brackets:function(v){return v+"[]"},comma:"comma",indices:function(v,g){return v+"["+g+"]"},repeat:function(v){return v}},a=Array.isArray,o=Array.prototype.push,l=function(p,v){o.apply(p,a(v)?v:[v])},u=Date.prototype.toISOString,f=r.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:f,formatter:r.formatters[f],indices:!1,serializeDate:function(v){return u.call(v)},skipNulls:!1,strictNullHandling:!1},O=function(v){return typeof v=="string"||typeof v=="number"||typeof v=="boolean"||typeof v=="symbol"||typeof v=="bigint"},w={},b=function p(v,g,y,d,m,_,k,x,A,S,P,C,R,N,U,G,Z,W){for(var H=v,M=W,L=0,D=!1;(M=M.get(w))!==void 0&&!D;){var B=M.get(v);if(L+=1,typeof B<"u"){if(B===L)throw new RangeError("Cyclic object value");D=!0}typeof M.get(w)>"u"&&(L=0)}if(typeof S=="function"?H=S(g,H):H instanceof Date?H=R(H):y==="comma"&&a(H)&&(H=t.maybeMap(H,function(ie){return ie instanceof Date?R(ie):ie})),H===null){if(_)return A&&!G?A(g,h.encoder,Z,"key",N):g;H=""}if(O(H)||t.isBuffer(H)){if(A){var q=G?g:A(g,h.encoder,Z,"key",N);return[U(q)+"="+U(A(H,h.encoder,Z,"value",N))]}return[U(g)+"="+U(String(H))]}var K=[];if(typeof H>"u")return K;var z;if(y==="comma"&&a(H))G&&A&&(H=t.maybeMap(H,A)),z=[{value:H.length>0?H.join(",")||null:void 0}];else if(a(S))z=S;else{var $=Object.keys(H);z=P?$.sort(P):$}var F=x?g.replace(/\./g,"%2E"):g,Y=d&&a(H)&&H.length===1?F+"[]":F;if(m&&a(H)&&H.length===0)return Y+"[]";for(var X=0;X<z.length;++X){var Q=z[X],ee=typeof Q=="object"&&typeof Q.value<"u"?Q.value:H[Q];if(!(k&&ee===null)){var re=C&&x?Q.replace(/\./g,"%2E"):Q,oe=a(H)?typeof y=="function"?y(Y,re):Y:Y+(C?"."+re:"["+re+"]");W.set(v,L);var ae=e();ae.set(w,W),l(K,p(ee,oe,y,d,m,_,k,x,y==="comma"&&G&&a(H)?null:A,S,P,C,R,N,U,G,Z,ae))}}return K},E=function(v){if(!v)return h;if(typeof v.allowEmptyArrays<"u"&&typeof v.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof v.encodeDotInKeys<"u"&&typeof v.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(v.encoder!==null&&typeof v.encoder<"u"&&typeof v.encoder!="function")throw new TypeError("Encoder has to be a function.");var g=v.charset||h.charset;if(typeof v.charset<"u"&&v.charset!=="utf-8"&&v.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=r.default;if(typeof v.format<"u"){if(!n.call(r.formatters,v.format))throw new TypeError("Unknown format option provided.");y=v.format}var d=r.formatters[y],m=h.filter;(typeof v.filter=="function"||a(v.filter))&&(m=v.filter);var _;if(v.arrayFormat in i?_=v.arrayFormat:"indices"in v?_=v.indices?"indices":"repeat":_=h.arrayFormat,"commaRoundTrip"in v&&typeof v.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var k=typeof v.allowDots>"u"?v.encodeDotInKeys===!0?!0:h.allowDots:!!v.allowDots;return{addQueryPrefix:typeof v.addQueryPrefix=="boolean"?v.addQueryPrefix:h.addQueryPrefix,allowDots:k,allowEmptyArrays:typeof v.allowEmptyArrays=="boolean"?!!v.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:_,charset:g,charsetSentinel:typeof v.charsetSentinel=="boolean"?v.charsetSentinel:h.charsetSentinel,commaRoundTrip:v.commaRoundTrip,delimiter:typeof v.delimiter>"u"?h.delimiter:v.delimiter,encode:typeof v.encode=="boolean"?v.encode:h.encode,encodeDotInKeys:typeof v.encodeDotInKeys=="boolean"?v.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof v.encoder=="function"?v.encoder:h.encoder,encodeValuesOnly:typeof v.encodeValuesOnly=="boolean"?v.encodeValuesOnly:h.encodeValuesOnly,filter:m,format:y,formatter:d,serializeDate:typeof v.serializeDate=="function"?v.serializeDate:h.serializeDate,skipNulls:typeof v.skipNulls=="boolean"?v.skipNulls:h.skipNulls,sort:typeof v.sort=="function"?v.sort:null,strictNullHandling:typeof v.strictNullHandling=="boolean"?v.strictNullHandling:h.strictNullHandling}};return Ag=function(p,v){var g=p,y=E(v),d,m;typeof y.filter=="function"?(m=y.filter,g=m("",g)):a(y.filter)&&(m=y.filter,d=m);var _=[];if(typeof g!="object"||g===null)return"";var k=i[y.arrayFormat],x=k==="comma"&&y.commaRoundTrip;d||(d=Object.keys(g)),y.sort&&d.sort(y.sort);for(var A=e(),S=0;S<d.length;++S){var P=d[S];y.skipNulls&&g[P]===null||l(_,b(g[P],P,k,x,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,A))}var C=_.join(y.delimiter),R=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?R+="utf8=%26%2310003%3B&":R+="utf8=%E2%9C%93&"),C.length>0?R+C:""},Ag}var Rg,s_;function QD(){if(s_)return Rg;s_=1;var e=uS(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(w){return w.replace(/&#(\d+);/g,function(b,E){return String.fromCharCode(parseInt(E,10))})},a=function(w,b){return w&&typeof w=="string"&&b.comma&&w.indexOf(",")>-1?w.split(","):w},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(b,E){var p={__proto__:null},v=E.ignoreQueryPrefix?b.replace(/^\?/,""):b;v=v.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var g=E.parameterLimit===1/0?void 0:E.parameterLimit,y=v.split(E.delimiter,g),d=-1,m,_=E.charset;if(E.charsetSentinel)for(m=0;m<y.length;++m)y[m].indexOf("utf8=")===0&&(y[m]===l?_="utf-8":y[m]===o&&(_="iso-8859-1"),d=m,m=y.length);for(m=0;m<y.length;++m)if(m!==d){var k=y[m],x=k.indexOf("]="),A=x===-1?k.indexOf("="):x+1,S,P;A===-1?(S=E.decoder(k,n.decoder,_,"key"),P=E.strictNullHandling?null:""):(S=E.decoder(k.slice(0,A),n.decoder,_,"key"),P=e.maybeMap(a(k.slice(A+1),E),function(R){return E.decoder(R,n.decoder,_,"value")})),P&&E.interpretNumericEntities&&_==="iso-8859-1"&&(P=i(P)),k.indexOf("[]=")>-1&&(P=r(P)?[P]:P);var C=t.call(p,S);C&&E.duplicates==="combine"?p[S]=e.combine(p[S],P):(!C||E.duplicates==="last")&&(p[S]=P)}return p},f=function(w,b,E,p){for(var v=p?b:a(b,E),g=w.length-1;g>=0;--g){var y,d=w[g];if(d==="[]"&&E.parseArrays)y=E.allowEmptyArrays&&v===""?[]:[].concat(v);else{y=E.plainObjects?Object.create(null):{};var m=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,_=E.decodeDotInKeys?m.replace(/%2E/g,"."):m,k=parseInt(_,10);!E.parseArrays&&_===""?y={0:v}:!isNaN(k)&&d!==_&&String(k)===_&&k>=0&&E.parseArrays&&k<=E.arrayLimit?(y=[],y[k]=v):_!=="__proto__"&&(y[_]=v)}v=y}return v},h=function(b,E,p,v){if(b){var g=p.allowDots?b.replace(/\.([^.[]+)/g,"[$1]"):b,y=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,m=p.depth>0&&y.exec(g),_=m?g.slice(0,m.index):g,k=[];if(_){if(!p.plainObjects&&t.call(Object.prototype,_)&&!p.allowPrototypes)return;k.push(_)}for(var x=0;p.depth>0&&(m=d.exec(g))!==null&&x<p.depth;){if(x+=1,!p.plainObjects&&t.call(Object.prototype,m[1].slice(1,-1))&&!p.allowPrototypes)return;k.push(m[1])}return m&&k.push("["+g.slice(m.index)+"]"),f(k,E,p,v)}},O=function(b){if(!b)return n;if(typeof b.allowEmptyArrays<"u"&&typeof b.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof b.decodeDotInKeys<"u"&&typeof b.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(b.decoder!==null&&typeof b.decoder<"u"&&typeof b.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof b.charset<"u"&&b.charset!=="utf-8"&&b.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var E=typeof b.charset>"u"?n.charset:b.charset,p=typeof b.duplicates>"u"?n.duplicates:b.duplicates;if(p!=="combine"&&p!=="first"&&p!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var v=typeof b.allowDots>"u"?b.decodeDotInKeys===!0?!0:n.allowDots:!!b.allowDots;return{allowDots:v,allowEmptyArrays:typeof b.allowEmptyArrays=="boolean"?!!b.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof b.allowPrototypes=="boolean"?b.allowPrototypes:n.allowPrototypes,allowSparse:typeof b.allowSparse=="boolean"?b.allowSparse:n.allowSparse,arrayLimit:typeof b.arrayLimit=="number"?b.arrayLimit:n.arrayLimit,charset:E,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:n.charsetSentinel,comma:typeof b.comma=="boolean"?b.comma:n.comma,decodeDotInKeys:typeof b.decodeDotInKeys=="boolean"?b.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof b.decoder=="function"?b.decoder:n.decoder,delimiter:typeof b.delimiter=="string"||e.isRegExp(b.delimiter)?b.delimiter:n.delimiter,depth:typeof b.depth=="number"||b.depth===!1?+b.depth:n.depth,duplicates:p,ignoreQueryPrefix:b.ignoreQueryPrefix===!0,interpretNumericEntities:typeof b.interpretNumericEntities=="boolean"?b.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof b.parameterLimit=="number"?b.parameterLimit:n.parameterLimit,parseArrays:b.parseArrays!==!1,plainObjects:typeof b.plainObjects=="boolean"?b.plainObjects:n.plainObjects,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:n.strictNullHandling}};return Rg=function(w,b){var E=O(b);if(w===""||w===null||typeof w>"u")return E.plainObjects?Object.create(null):{};for(var p=typeof w=="string"?u(w,E):w,v=E.plainObjects?Object.create(null):{},g=Object.keys(p),y=0;y<g.length;++y){var d=g[y],m=h(d,p[d],E,typeof w=="string");v=e.merge(v,m,E)}return E.allowSparse===!0?v:e.compact(v)},Rg}var Mg,u_;function JD(){if(u_)return Mg;u_=1;var e=ZD(),t=QD(),r=y2();return Mg={formats:r,parse:t,stringify:e},Mg}var c_;function cS(){if(c_)return Vo;c_=1;var e=AD();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",`
|
|
152
|
+
`," "],o=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(o),u=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=255,O=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=JD();function g(_,k,x){if(_&&typeof _=="object"&&_ instanceof t)return _;var A=new t;return A.parse(_,k,x),A}t.prototype.parse=function(_,k,x){if(typeof _!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof _);var A=_.indexOf("?"),S=A!==-1&&A<_.indexOf("#")?"?":"#",P=_.split(S),C=/\\/g;P[0]=P[0].replace(C,"/"),_=P.join(S);var R=_;if(R=R.trim(),!x&&_.split("#").length===1){var N=i.exec(R);if(N)return this.path=R,this.href=R,this.pathname=N[1],N[2]?(this.search=N[2],k?this.query=v.parse(this.search.substr(1)):this.query=this.search.substr(1)):k&&(this.search="",this.query={}),this}var U=r.exec(R);if(U){U=U[0];var G=U.toLowerCase();this.protocol=G,R=R.substr(U.length)}if(x||U||R.match(/^\/\/[^@/]+@[^@/]+/)){var Z=R.substr(0,2)==="//";Z&&!(U&&E[U])&&(R=R.substr(2),this.slashes=!0)}if(!E[U]&&(Z||U&&!p[U])){for(var W=-1,H=0;H<f.length;H++){var M=R.indexOf(f[H]);M!==-1&&(W===-1||M<W)&&(W=M)}var L,D;W===-1?D=R.lastIndexOf("@"):D=R.lastIndexOf("@",W),D!==-1&&(L=R.slice(0,D),R=R.slice(D+1),this.auth=decodeURIComponent(L)),W=-1;for(var H=0;H<u.length;H++){var M=R.indexOf(u[H]);M!==-1&&(W===-1||M<W)&&(W=M)}W===-1&&(W=R.length),this.host=R.slice(0,W),R=R.slice(W),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var q=this.hostname.split(/\./),H=0,K=q.length;H<K;H++){var z=q[H];if(z&&!z.match(O)){for(var $="",F=0,Y=z.length;F<Y;F++)z.charCodeAt(F)>127?$+="x":$+=z[F];if(!$.match(O)){var X=q.slice(0,H),Q=q.slice(H+1),ee=z.match(w);ee&&(X.push(ee[1]),Q.unshift(ee[2])),Q.length&&(R="/"+Q.join(".")+R),this.hostname=X.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=e.toASCII(this.hostname));var re=this.port?":"+this.port:"",oe=this.hostname||"";this.host=oe+re,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),R[0]!=="/"&&(R="/"+R))}if(!b[G])for(var H=0,K=l.length;H<K;H++){var ae=l[H];if(R.indexOf(ae)!==-1){var ie=encodeURIComponent(ae);ie===ae&&(ie=escape(ae)),R=R.split(ae).join(ie)}}var Re=R.indexOf("#");Re!==-1&&(this.hash=R.substr(Re),R=R.slice(0,Re));var Me=R.indexOf("?");if(Me!==-1?(this.search=R.substr(Me),this.query=R.substr(Me+1),k&&(this.query=v.parse(this.query)),R=R.slice(0,Me)):k&&(this.search="",this.query={}),R&&(this.pathname=R),p[G]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var re=this.pathname||"",ne=this.search||"";this.path=re+ne}return this.href=this.format(),this};function y(_){return typeof _=="string"&&(_=g(_)),_ instanceof t?_.format():t.prototype.format.call(_)}t.prototype.format=function(){var _=this.auth||"";_&&(_=encodeURIComponent(_),_=_.replace(/%3A/i,":"),_+="@");var k=this.protocol||"",x=this.pathname||"",A=this.hash||"",S=!1,P="";this.host?S=_+this.host:this.hostname&&(S=_+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(S+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(P=v.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var C=this.search||P&&"?"+P||"";return k&&k.substr(-1)!==":"&&(k+=":"),this.slashes||(!k||p[k])&&S!==!1?(S="//"+(S||""),x&&x.charAt(0)!=="/"&&(x="/"+x)):S||(S=""),A&&A.charAt(0)!=="#"&&(A="#"+A),C&&C.charAt(0)!=="?"&&(C="?"+C),x=x.replace(/[?#]/g,function(R){return encodeURIComponent(R)}),C=C.replace("#","%23"),k+S+x+C+A};function d(_,k){return g(_,!1,!0).resolve(k)}t.prototype.resolve=function(_){return this.resolveObject(g(_,!1,!0)).format()};function m(_,k){return _?g(_,!1,!0).resolveObject(k):k}return t.prototype.resolveObject=function(_){if(typeof _=="string"){var k=new t;k.parse(_,!1,!0),_=k}for(var x=new t,A=Object.keys(this),S=0;S<A.length;S++){var P=A[S];x[P]=this[P]}if(x.hash=_.hash,_.href==="")return x.href=x.format(),x;if(_.slashes&&!_.protocol){for(var C=Object.keys(_),R=0;R<C.length;R++){var N=C[R];N!=="protocol"&&(x[N]=_[N])}return p[x.protocol]&&x.hostname&&!x.pathname&&(x.pathname="/",x.path=x.pathname),x.href=x.format(),x}if(_.protocol&&_.protocol!==x.protocol){if(!p[_.protocol]){for(var U=Object.keys(_),G=0;G<U.length;G++){var Z=U[G];x[Z]=_[Z]}return x.href=x.format(),x}if(x.protocol=_.protocol,!_.host&&!E[_.protocol]){for(var K=(_.pathname||"").split("/");K.length&&!(_.host=K.shift()););_.host||(_.host=""),_.hostname||(_.hostname=""),K[0]!==""&&K.unshift(""),K.length<2&&K.unshift(""),x.pathname=K.join("/")}else x.pathname=_.pathname;if(x.search=_.search,x.query=_.query,x.host=_.host||"",x.auth=_.auth,x.hostname=_.hostname||_.host,x.port=_.port,x.pathname||x.search){var W=x.pathname||"",H=x.search||"";x.path=W+H}return x.slashes=x.slashes||_.slashes,x.href=x.format(),x}var M=x.pathname&&x.pathname.charAt(0)==="/",L=_.host||_.pathname&&_.pathname.charAt(0)==="/",D=L||M||x.host&&_.pathname,B=D,q=x.pathname&&x.pathname.split("/")||[],K=_.pathname&&_.pathname.split("/")||[],z=x.protocol&&!p[x.protocol];if(z&&(x.hostname="",x.port=null,x.host&&(q[0]===""?q[0]=x.host:q.unshift(x.host)),x.host="",_.protocol&&(_.hostname=null,_.port=null,_.host&&(K[0]===""?K[0]=_.host:K.unshift(_.host)),_.host=null),D=D&&(K[0]===""||q[0]==="")),L)x.host=_.host||_.host===""?_.host:x.host,x.hostname=_.hostname||_.hostname===""?_.hostname:x.hostname,x.search=_.search,x.query=_.query,q=K;else if(K.length)q||(q=[]),q.pop(),q=q.concat(K),x.search=_.search,x.query=_.query;else if(_.search!=null){if(z){x.host=q.shift(),x.hostname=x.host;var $=x.host&&x.host.indexOf("@")>0?x.host.split("@"):!1;$&&(x.auth=$.shift(),x.hostname=$.shift(),x.host=x.hostname)}return x.search=_.search,x.query=_.query,(x.pathname!==null||x.search!==null)&&(x.path=(x.pathname?x.pathname:"")+(x.search?x.search:"")),x.href=x.format(),x}if(!q.length)return x.pathname=null,x.search?x.path="/"+x.search:x.path=null,x.href=x.format(),x;for(var F=q.slice(-1)[0],Y=(x.host||_.host||q.length>1)&&(F==="."||F==="..")||F==="",X=0,Q=q.length;Q>=0;Q--)F=q[Q],F==="."?q.splice(Q,1):F===".."?(q.splice(Q,1),X++):X&&(q.splice(Q,1),X--);if(!D&&!B)for(;X--;X)q.unshift("..");D&&q[0]!==""&&(!q[0]||q[0].charAt(0)!=="/")&&q.unshift(""),Y&&q.join("/").substr(-1)!=="/"&&q.push("");var ee=q[0]===""||q[0]&&q[0].charAt(0)==="/";if(z){x.hostname=ee?"":q.length?q.shift():"",x.host=x.hostname;var $=x.host&&x.host.indexOf("@")>0?x.host.split("@"):!1;$&&(x.auth=$.shift(),x.hostname=$.shift(),x.host=x.hostname)}return D=D||x.host&&q.length,D&&!ee&&q.unshift(""),q.length>0?x.pathname=q.join("/"):(x.pathname=null,x.path=null),(x.pathname!==null||x.search!==null)&&(x.path=(x.pathname?x.pathname:"")+(x.search?x.search:"")),x.auth=_.auth||x.auth,x.slashes=x.slashes||_.slashes,x.href=x.format(),x},t.prototype.parseHost=function(){var _=this.host,k=n.exec(_);k&&(k=k[0],k!==":"&&(this.port=k.substr(1)),_=_.substr(0,_.length-k.length)),_&&(this.hostname=_)},Vo.parse=g,Vo.resolve=d,Vo.resolveObject=m,Vo.format=y,Vo.Url=t,Vo}var Lg={exports:{}},f_;function ej(){return f_||(f_=1,function(e){(function(t,r){e.exports?e.exports=r():t.xmlserializer=r()})(me,function(){var t=function(b){return b.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(b){return b.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},n=function(b){return b.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},i=function(b){var E=b.value;return" "+b.name+'="'+r(E)+'"'},a=function(b){var E=b.tagName;return b.namespaceURI==="http://www.w3.org/1999/xhtml"&&(E=E.toLowerCase()),E},o=function(b,E){var p=Array.prototype.map.call(b.attributes||b.attrs,function(v){return v.name}).indexOf("xmlns")>=0;return!p&&(E||b.namespaceURI!==b.parentNode.namespaceURI)?' xmlns="'+b.namespaceURI+'"':""},l=function(b){return Array.prototype.map.call(b.childNodes,function(E){return w(E)}).join("")},u=function(b,E){var p="<"+a(b);return p+=o(b,E),Array.prototype.forEach.call(b.attributes||b.attrs,function(v){p+=i(v)}),b.childNodes.length>0?(p+=">",p+=l(b),p+="</"+a(b)+">"):p+="/>",p},f=function(b){var E=b.nodeValue||b.value||"";return n(E)},h=function(b){return"<!--"+b.data.replace(/-/g,"-")+"-->"},O=function(b){return"<![CDATA["+b.nodeValue+"]]>"},w=function(b,E){var p=E&&E.rootNode;if(b.nodeName==="#document"||b.nodeName==="#document-fragment")return l(b);if(b.tagName)return u(b,p);if(b.nodeName==="#text")return f(b);if(b.nodeName==="#comment")return h(b);if(b.nodeName==="#cdata-section")return O(b)};return{serializeToString:function(b){return t(w(b,{rootNode:!0}))}}})}(Lg)),Lg.exports}var Ng={},d_;function tj(){if(d_)return Ng;d_=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[^>]*>(.+?)
|
|
153
|
+
?</div>`),new RegExp(`^(.+)
|
|
154
|
+
`)],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={},h_;function Qp(){return h_||(h_=1,function(e){var t=cS();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(h){u.push(h)})})).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,h){var O=new window.XMLHttpRequest,w=e.joinUrl(u.baseUrl,l),b,E=function(){h({msg:"Unable to load url",url:w})};b=n(w,u.cache),O.addEventListener("load",function(){O.status===200||O.status===0?f(O.response):E()},!1),O.addEventListener("error",E,!1);try{O.open("GET",b,!0),O.overrideMimeType(u.mimeType),O.send(null)}catch{E()}})},e.binaryAjax=function(l,u){var f=e.clone(u);return f.mimeType="text/plain; charset=x-user-defined",e.ajax(l,f).then(function(h){for(var O="",w=0;w<h.length;w++)O+=String.fromCharCode(h.charCodeAt(w)&255);return O})};var i=function(l){var u=function(f,h){return f.substring(0,h.length)===h};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 h=btoa(f),O=i(f);return"data:"+O+";base64,"+h})};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 h=Array.prototype.slice.call(arguments),O=u(h),w=o(l),b;return f[w]&&f[w][O]?f[w][O]:(b=l.apply(null,h),f[w]=f[w]||{},f[w][O]=b,b)}}}(Dg)),Dg}var jg={},p_;function rj(){if(p_)return jg;p_=1;var e=Qp(),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(h){return h},function(h){throw{resourceType:"image",url:h.url,msg:"Unable to load image "+h.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 h=r(l);return e.collectAndReportErrors(h.map(function(O){return t(O,o).then(function(w){O.attributes.src?O.attributes.src.value=w:O.attributes["xlink:href"]?O.attributes["xlink:href"].value=w:O.attributes.href&&(O.attributes.href.value=w)})}))},jg}var Fg={},g_;function nj(){if(g_)return Fg;g_=1;var e=Qp(),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(h){throw{resourceType:"script",url:h.url,msg:"Unable to load script "+h.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={},v_;function b2(){return v_||(v_=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={},m_;function ij(){return m_||(m_=1,function(e){var t=b2(),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*$",h=new RegExp(u,"g"),O,w=[],b=function(E){var p=new RegExp(l,"g"),v=[],g;for(g=p.exec(E);g;)v.push(g[1]),g=p.exec(E);return v};if(a.match(new RegExp(f))){for(O=h.exec(a);O;)w.push(b(O[0])),O=h.exec(a);return w}return[]},i=function(a){var o,l;for(o=0;o<a.length;o++)try{return l=e.extractCssUrl(a[o]),{url:l,idx:o}}catch{}};e.parse=function(a){var o=n(a);return o.map(function(l){var u=i(l);return u?{preUrl:l.slice(0,u.idx),url:u.url,postUrl:l.slice(u.idx+1)}:{preUrl:l}})},e.serialize=function(a){var o=a.map(function(l){var u=[].concat(l.preUrl);return l.url&&u.push('url("'+l.url+'")'),l.postUrl&&(u=u.concat(l.postUrl)),u.join(" ")});return o.join(", ")}}(Ug)),Ug}function wd(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:{}},y_;function aj(){return y_||(y_=1,function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,a){function o(f,h){if(!i[f]){if(!n[f]){var O=typeof wd=="function"&&wd;if(!h&&O)return O(f,!0);if(l)return l(f,!0);var w=new Error("Cannot find module '"+f+"'");throw w.code="MODULE_NOT_FOUND",w}var b=i[f]={exports:{}};n[f][0].call(b.exports,function(E){var p=n[f][1][E];return o(p||E)},b,b.exports,r,n,i,a)}return i[f].exports}for(var l=typeof wd=="function"&&wd,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,f){function h(){this.constructor=u}h.prototype=f.prototype,u.prototype=new h}function o(u,f,h,O){this.message=u,this.expected=f,this.found=h,this.location=O,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,f){var h={literal:function(g){return'"'+w(g.text)+'"'},class:function(g){var y="",d;for(d=0;d<g.parts.length;d++)y+=g.parts[d]instanceof Array?b(g.parts[d][0])+"-"+b(g.parts[d][1]):b(g.parts[d]);return"["+(g.inverted?"^":"")+y+"]"},any:function(g){return"any character"},end:function(g){return"end of input"},other:function(g){return g.description}};function O(g){return g.charCodeAt(0).toString(16).toUpperCase()}function w(g){return 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(y){return"\\x0"+O(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+O(y)})}function b(g){return g.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(y){return"\\x0"+O(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+O(y)})}function E(g){return h[g.type](g)}function p(g){var y=new Array(g.length),d,m;for(d=0;d<g.length;d++)y[d]=E(g[d]);if(y.sort(),y.length>0){for(d=1,m=1;d<y.length;d++)y[d-1]!==y[d]&&(y[m]=y[d],m++);y.length=m}switch(y.length){case 1:return y[0];case 2:return y[0]+" or "+y[1];default:return y.slice(0,-1).join(", ")+", or "+y[y.length-1]}}function v(g){return g?'"'+w(g)+'"':"end of input"}return"Expected "+p(u)+" but "+v(f)+" found."};function l(u,f){f=f!==void 0?f:{};var h={},O={start:re},w=re,b="",E=function(){return[]},p=",",v=z(",",!1),g=function(te,de){return[te].concat(de)},y=function(te){return[te]},d=function(te,de){return{url:te,format:de}},m=function(te){return{url:te}},_="url(",k=z("url(",!1),x=")",A=z(")",!1),S=function(te){return te},P="format(",C=z("format(",!1),R="local(",N=z("local(",!1),U=function(te){return{local:te}},G=/^[^)]/,Z=$([")"],!0,!1),W=function(te){return ye.extractValue(te.join(""))},H=/^[ \t\r\n\f]/,M=$([" "," ","\r",`
|
|
155
|
+
`,"\f"],!1,!1),L=0,D=[{line:1,column:1}],B=0,q=[],K;if("startRule"in f){if(!(f.startRule in O))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');w=O[f.startRule]}function z(te,de){return{type:"literal",text:te,ignoreCase:de}}function $(te,de,he){return{type:"class",parts:te,inverted:de,ignoreCase:he}}function F(){return{type:"end"}}function Y(te){var de=D[te],he;if(de)return de;for(he=te-1;!D[he];)he--;for(de=D[he],de={line:de.line,column:de.column};he<te;)u.charCodeAt(he)===10?(de.line++,de.column=1):de.column++,he++;return D[te]=de,de}function X(te,de){var he=Y(te),Se=Y(de);return{start:{offset:te,line:he.line,column:he.column},end:{offset:de,line:Se.line,column:Se.column}}}function Q(te){L<B||(L>B&&(B=L,q=[]),q.push(te))}function ee(te,de,he){return new o(o.buildMessage(te,de),te,de,he)}function re(){var te,de;return te=oe(),te===h&&(te=L,de=b,de!==h&&(de=E()),te=de),te}function oe(){var te,de,he,Se,$e,tt;if(te=L,de=ae(),de!==h){for(he=[],Se=be();Se!==h;)he.push(Se),Se=be();if(he!==h)if(u.charCodeAt(L)===44?(Se=p,L++):(Se=h,Q(v)),Se!==h){for($e=[],tt=be();tt!==h;)$e.push(tt),tt=be();$e!==h?(tt=oe(),tt!==h?(de=g(de,tt),te=de):(L=te,te=h)):(L=te,te=h)}else L=te,te=h;else L=te,te=h}else L=te,te=h;return te===h&&(te=L,de=ae(),de!==h&&(de=y(de)),te=de),te}function ae(){var te;return te=ie(),te===h&&(te=ne()),te}function ie(){var te,de,he,Se;if(te=L,de=Re(),de!==h){if(he=[],Se=be(),Se!==h)for(;Se!==h;)he.push(Se),Se=be();else he=h;he!==h?(Se=Me(),Se!==h?(de=d(de,Se),te=de):(L=te,te=h)):(L=te,te=h)}else L=te,te=h;return te===h&&(te=L,de=Re(),de!==h&&(de=m(de)),te=de),te}function Re(){var te,de,he,Se;return te=L,u.substr(L,4)===_?(de=_,L+=4):(de=h,Q(k)),de!==h?(he=le(),he!==h?(u.charCodeAt(L)===41?(Se=x,L++):(Se=h,Q(A)),Se!==h?(de=S(he),te=de):(L=te,te=h)):(L=te,te=h)):(L=te,te=h),te}function Me(){var te,de,he,Se;return te=L,u.substr(L,7)===P?(de=P,L+=7):(de=h,Q(C)),de!==h?(he=le(),he!==h?(u.charCodeAt(L)===41?(Se=x,L++):(Se=h,Q(A)),Se!==h?(de=S(he),te=de):(L=te,te=h)):(L=te,te=h)):(L=te,te=h),te}function ne(){var te,de,he,Se;return te=L,u.substr(L,6)===R?(de=R,L+=6):(de=h,Q(N)),de!==h?(he=le(),he!==h?(u.charCodeAt(L)===41?(Se=x,L++):(Se=h,Q(A)),Se!==h?(de=U(he),te=de):(L=te,te=h)):(L=te,te=h)):(L=te,te=h),te}function le(){var te,de,he;if(te=L,de=[],G.test(u.charAt(L))?(he=u.charAt(L),L++):(he=h,Q(Z)),he!==h)for(;he!==h;)de.push(he),G.test(u.charAt(L))?(he=u.charAt(L),L++):(he=h,Q(Z));else de=h;return de!==h&&(de=W(de)),te=de,te}function be(){var te;return H.test(u.charAt(L))?(te=u.charAt(L),L++):(te=h,Q(M)),te}var ye=r("../util");if(K=w(),K!==h&&L===u.length)return K;throw K!==h&&L<u.length&&Q(F()),ee(q,B<u.length?u.charAt(B):null,B<u.length?X(B,B+1):X(B,B))}n.exports={SyntaxError:o,parse:l}},{"../util":3}],2:[function(r,n,i){var a=r("./grammar");i.SyntaxError=function(o,l){this.message=o,this.offset=l},i.parse=function(o){try{return a.parse(o)}catch(l){throw new i.SyntaxError(l.message,l.offset)}},i.serialize=function(o){return o.map(function(l){var u;return l.url?(u='url("'+l.url+'")',l.format&&(u+=' format("'+l.format+'")')):u='local("'+l.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(r,n,i){var a=function(l){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return l.replace(u,"$1")},o=function(l){var u=/^"(.*)"$/,f=/^'(.*)'$/;return u.test(l)?l.replace(u,"$1"):f.test(l)?l.replace(f,"$1"):l};i.extractValue=function(l){return o(a(l))}},{}]},{},[2])(2)})}(Hg)),Hg.exports}var b_;function oj(){return b_||(b_=1,function(e){var t=Qp(),r=b2(),n=ij(),i=aj(),a=function(y,d,m){y.style.setProperty(d,m,y.style.getPropertyPriority(d))},o=function(y){return y.filter(function(d){return d.type===window.CSSRule.STYLE_RULE&&(d.style.getPropertyValue("background-image")||d.style.getPropertyValue("background"))})},l=function(y){var d=[];return y.forEach(function(m){m.style.getPropertyValue("background-image")?d.push({property:"background-image",value:m.style.getPropertyValue("background-image"),rule:m}):m.style.getPropertyValue("background")&&d.push({property:"background",value:m.style.getPropertyValue("background"),rule:m})}),d},u=function(y){return y.filter(function(d){return d.type===window.CSSRule.FONT_FACE_RULE&&d.style.getPropertyValue("src")})},f=function(y){return y.filter(function(d){return d.type===window.CSSRule.IMPORT_RULE&&d.href})},h=function(y){var d=[];return y.forEach(function(m,_){m.url&&!t.isDataUri(m.url)&&d.push(_)}),d},O=function(y){var d=[];return y.forEach(function(m,_){m.url&&!t.isDataUri(m.url)&&d.push(_)}),d};e.adjustPathsOfCssResources=function(y,d){var m=o(d),_=l(m),k=!1;return _.forEach(function(x){var A=n.parse(x.value),S=h(A),P;S.length>0&&(S.forEach(function(C){var R=A[C].url,N=t.joinUrl(y,R);A[C].url=N}),P=n.serialize(A),a(x.rule,x.property,P),k=!0)}),u(d).forEach(function(x){var A=x.style.getPropertyValue("src"),S,P;try{S=i.parse(A)}catch{return}P=O(S),P.length>0&&(P.forEach(function(C){var R=S[C].url,N=t.joinUrl(y,R);S[C].url=N}),r.changeFontFaceRuleSrc(d,x,i.serialize(S)),k=!0)}),f(d).forEach(function(x){var A=x.href,S=t.joinUrl(y,A);r.exchangeRule(d,x,"@import url("+S+");"),k=!0}),k};var w=function(y,d,m){var _=y.indexOf(d);y.splice(_,1),m.forEach(function(k,x){y.splice(_+x,0,k)})},b=function(y,d,m,_){var k=d.href,x;return k=r.unquoteString(k),x=t.joinUrl(_.baseUrl,k),m.indexOf(x)>=0?(w(y,d,[]),Promise.resolve([])):(m.push(x),t.ajax(k,_).then(function(A){var S=r.rulesForCssText(A);return e.loadCSSImportsForRules(S,m,_).then(function(P){return e.adjustPathsOfCssResources(k,S),w(y,d,S),P.errors})},function(A){throw{resourceType:"stylesheet",url:A.url,msg:"Unable to load stylesheet "+A.url}}))};e.loadCSSImportsForRules=function(y,d,m){var _=f(y),k=[],x=!1;return Promise.all(_.map(function(A){return b(y,A,d,m).then(function(S){k=k.concat(S),x=!0},function(S){k.push(S)})})).then(function(){return{hasChanges:x,errors:k}})};var E=function(y,d){var m=n.parse(y),_=h(m),k=!1;return t.collectAndReportErrors(_.map(function(x){var A=m[x].url;return t.getDataURIForImageURL(A,d).then(function(S){m[x].url=S,k=!0},function(S){throw{resourceType:"backgroundImage",url:S.url,msg:"Unable to load background-image "+S.url}})})).then(function(x){return{backgroundValue:n.serialize(m),hasChanges:k,errors:x}})},p=function(y,d){var m=o(y),_=l(m),k=[],x=!1;return Promise.all(_.map(function(A){return E(A.value,d).then(function(S){S.hasChanges&&(a(A.rule,A.property,S.backgroundValue),x=!0),k=k.concat(S.errors)})})).then(function(){return{hasChanges:x,errors:k}})},v=function(y,d){var m=!1,_,k;try{_=i.parse(y)}catch{_=[]}return k=O(_),t.collectAndReportErrors(k.map(function(x){var A=_[x],S=A.format||"woff";return t.binaryAjax(A.url,d).then(function(P){var C=btoa(P);A.url="data:font/"+S+";base64,"+C,m=!0},function(P){throw{resourceType:"fontFace",url:P.url,msg:"Unable to load font-face "+P.url}})})).then(function(x){return{srcDeclarationValue:i.serialize(_),hasChanges:m,errors:x}})},g=function(y,d){var m=u(y),_=[],k=!1;return Promise.all(m.map(function(x){var A=x.style.getPropertyValue("src");return v(A,d).then(function(S){S.hasChanges&&(r.changeFontFaceRuleSrc(y,x,S.srcDeclarationValue),k=!0),_=_.concat(S.errors)})})).then(function(){return{hasChanges:k,errors:_}})};e.loadAndInlineCSSResourcesForRules=function(y,d){var m=!1,_=[];return Promise.all([p,g].map(function(k){return k(y,d).then(function(x){m=m||x.hasChanges,_=_.concat(x.errors)})})).then(function(){return{hasChanges:m,errors:_}})}}(zg)),zg}var __;function lj(){return __||(__=1,function(e){var t=Qp(),r=rj(),n=nj(),i=oj(),a=b2(),o=function(v){return t.joinUrl(v,".")},l=function(v){var g=v.map(function(y,d){return d===v.length-1&&(y={baseUrl:o(y.baseUrl)}),JSON.stringify(y)});return g},u=function(v,g){return g.cache!==!1&&g.cache!=="none"&&g.cacheBucket?t.memoize(v,l,g.cacheBucket):v},f=function(v,g,y){var d=a.rulesForCssText(v);return i.loadCSSImportsForRules(d,g,y).then(function(m){return i.loadAndInlineCSSResourcesForRules(d,y).then(function(_){var k=m.errors.concat(_.errors),x=m.hasChanges||_.hasChanges;return x&&(v=a.cssRulesToText(d)),{hasChanges:x,content:v,errors:k}})})},h=function(v,g,y){var d=v.textContent,m=u(f,g);return m(d,y,g).then(function(_){return _.hasChanges&&(v.childNodes[0].nodeValue=_.content),t.cloneArray(_.errors)})},O=function(v){var g=v.getElementsByTagName("style");return Array.prototype.filter.call(g,function(y){return!y.attributes.type||y.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(v,g){var y=O(v),d=[],m=[],_;return _=t.clone(g),_.baseUrl=_.baseUrl||t.getDocumentBaseUrl(v),Promise.all(y.map(function(k){return h(k,_,m).then(function(x){d=d.concat(x)})})).then(function(){return d})};var w=function(v,g){var y=v.parentNode,d;g=g.trim(),g&&(d=v.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(v.ownerDocument.createTextNode(g)),y.insertBefore(d,v)),y.removeChild(v)},b=function(v,g){return t.ajax(v,g).then(function(y){var d=a.rulesForCssText(y);return{content:y,cssRules:d}}).then(function(y){var d=i.adjustPathsOfCssResources(v,y.cssRules);return{content:y.content,cssRules:y.cssRules,hasChanges:d}}).then(function(y){return i.loadCSSImportsForRules(y.cssRules,[],g).then(function(d){return{content:y.content,cssRules:y.cssRules,hasChanges:y.hasChanges||d.hasChanges,errors:d.errors}})}).then(function(y){return i.loadAndInlineCSSResourcesForRules(y.cssRules,g).then(function(d){return{content:y.content,cssRules:y.cssRules,hasChanges:y.hasChanges||d.hasChanges,errors:y.errors.concat(d.errors)}})}).then(function(y){var d=y.content;return y.hasChanges&&(d=a.cssRulesToText(y.cssRules)),{content:d,errors:y.errors}})},E=function(v,g){var y=v.attributes.href.value,d=t.getDocumentBaseUrl(v.ownerDocument),m=t.clone(g);!m.baseUrl&&d&&(m.baseUrl=d);var _=u(b,g);return _(y,m).then(function(k){return{content:k.content,errors:t.cloneArray(k.errors)}})},p=function(v){var g=v.getElementsByTagName("link");return Array.prototype.filter.call(g,function(y){return y.attributes.rel&&y.attributes.rel.value==="stylesheet"&&(!y.attributes.type||y.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(v,g){var y=p(v),d=[];return Promise.all(y.map(function(m){return E(m,g).then(function(_){w(m,_.content+`
|
|
156
|
+
`),d=d.concat(_.errors)},function(_){d.push({resourceType:"stylesheet",url:_.url,msg:"Unable to load stylesheet "+_.url})})})).then(function(){return d})},e.loadAndInlineImages=r.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(v,g){var y=[],d=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return g.inlineScripts!==!1&&d.push(e.loadAndInlineScript),Promise.all(d.map(function(m){return m(v,g).then(function(_){y=y.concat(_)})})).then(function(){return y})}}(Ig)),Ig}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
|
|
157
|
+
* http://www.github.com/cburgmer/rasterizeHTML.js
|
|
158
|
+
* 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(cS(),ej(),tj(),lj()):t.rasterizeHTML=r(t.url,t.xmlserializer,t.sanedomparsererror,t.inlineresources)})(me,function(t,r,n,i){var a=function(E){var p={},v=[];p.joinUrl=function(d,m){return d?E.resolve(d,m):m},p.getConstantUniqueIdFor=function(d){return v.indexOf(d)<0&&v.push(d),v.indexOf(d)},p.clone=function(d){var m={},_;for(_ in d)d.hasOwnProperty(_)&&(m[_]=d[_]);return m};var g=function(d){return typeof d=="object"&&d!==null},y=function(d){return g(d)&&Object.prototype.toString.apply(d).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return p.parseOptionalParameters=function(d){var m={canvas:null,options:{}};return d[0]==null||y(d[0])?(m.canvas=d[0]||null,m.options=p.clone(d[1])):m.options=p.clone(d[0]),m},p}(t),o=function(E){var p={},v=function(g,y,d){var m=g[y];return g[y]=function(){var _=Array.prototype.slice.call(arguments);return d.apply(this,[_,m])},m};return p.baseUrlRespectingXhr=function(g,y){var d=function(){var m=new g;return v(m,"open",function(_,k){var x=_.shift(),A=_.shift(),S=E.joinUrl(y,A);return k.apply(this,[x,S].concat(_))}),m};return d},p.finishNotifyingXhr=function(g){var y=0,d=0,m=!1,_,k=new Promise(function(A){_=function(){var S=y-d;S<=0&&m&&A({totalCount:y})}}),x=function(){var A=new g;return v(A,"send",function(S,P){return y+=1,P.apply(this,arguments)}),A.addEventListener("load",function(){d+=1,_()}),A};return x.waitForRequestsToFinish=function(){return m=!0,_(),k},x},p}(a),l=function(){var E={},p=function(x){return Array.prototype.slice.call(x)};E.addClassName=function(x,A){x.className+=" "+A},E.addClassNameRecursively=function(x,A){E.addClassName(x,A),x.parentNode!==x.ownerDocument&&E.addClassNameRecursively(x.parentNode,A)};var v=function(x,A){var S=x.parentStyleSheet,P=p(S.cssRules).indexOf(x);S.insertRule(A,P+1),S.deleteRule(P)},g=function(x,A){var S=x.cssText.replace(/^[^\{]+/,""),P=A+" "+S;v(x,P)},y=function(x){return p(x).reduce(function(A,S){return A+S.cssText},"")},d=function(x){x.textContent=y(x.sheet.cssRules)},m=function(x){var A=document.implementation.createHTMLDocument(""),S=document.createElement("style");S.textContent=x.textContent,A.body.appendChild(S),x.sheet=S.sheet},_=function(x){return"((?:^|[^.#:\\w])|(?=\\W))("+x.join("|")+")(?=\\W|$)"},k=function(x,A,S){var P=_(A);p(x.querySelectorAll("style")).forEach(function(C){typeof C.sheet>"u"&&m(C);var R=p(C.sheet.cssRules).filter(function(N){return N.selectorText&&new RegExp(P,"i").test(N.selectorText)});R.length&&(R.forEach(function(N){var U=N.selectorText.replace(new RegExp(P,"gi"),function(G,Z,W){return Z+S(W)});U!==N.selectorText&&g(N,U)}),d(C))})};return E.rewriteCssSelectorWith=function(x,A,S){k(x,[A],function(){return S})},E.lowercaseCssTypeSelectors=function(x,A){k(x,A,function(S){return S.toLowerCase()})},E.findHtmlOnlyNodeNames=function(x){var A=x.ownerDocument.createTreeWalker(x,NodeFilter.SHOW_ELEMENT),S={},P={},C;do C=A.currentNode.tagName.toLowerCase(),A.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?S[C]=!0:P[C]=!0;while(A.nextNode());return Object.keys(S).filter(function(R){return!P[R]})},E}(),u=function(E){var p={},v=function(y){return Array.prototype.slice.call(y)},g={active:!0,hover:!0,focus:!1,target:!1};return p.fakeUserAction=function(y,d,m){var _=y.querySelector(d),k=":"+m,x="rasterizehtml"+m;_&&(g[m]?E.addClassNameRecursively(_,x):E.addClassName(_,x),E.rewriteCssSelectorWith(y,k,"."+x))},p.persistInputValues=function(y){var d=y.querySelectorAll("input"),m=y.querySelectorAll("textarea"),_=function(k){return k.type==="checkbox"||k.type==="radio"};v(d).filter(_).forEach(function(k){k.checked?k.setAttribute("checked",""):k.removeAttribute("checked")}),v(d).filter(function(k){return!_(k)}).forEach(function(k){k.setAttribute("value",k.value)}),v(m).forEach(function(k){k.textContent=k.value})},p.rewriteTagNameSelectorsToLowerCase=function(y){E.lowercaseCssTypeSelectors(y,E.findHtmlOnlyNodeNames(y))},p}(l),f=function(E,p,v,g){var y={},d=function(W,H,M,L){var D=W.createElement(H);return D.style.visibility="hidden",D.style.width=M+"px",D.style.height=L+"px",D.style.position="absolute",D.style.top=-1e4-L+"px",D.style.left=-1e4-M+"px",W.getElementsByTagName("body")[0].appendChild(D),D},m=function(W){return W>0?new Promise(function(H){setTimeout(H,W)}):Promise.resolve()};y.executeJavascript=function(W,H){return new Promise(function(M){var L=d(g.document,"iframe",H.width,H.height),D=W.outerHTML,B=[],q=H.executeJsTimeout||0,K=function(){g.document.getElementsByTagName("body")[0].removeChild(L)},z=function(){var X=L.contentDocument;M({document:X,errors:B,cleanUp:K})},$=L.contentWindow.XMLHttpRequest,F=p.finishNotifyingXhr($),Y=p.baseUrlRespectingXhr(F,H.baseUrl);L.onload=function(){m(q).then(F.waitForRequestsToFinish).then(z)},L.contentDocument.open(),L.contentWindow.XMLHttpRequest=Y,L.contentWindow.onerror=function(X){B.push({resourceType:"scriptExecution",msg:X})},L.contentDocument.write("<!DOCTYPE html>"),L.contentDocument.write(D),L.contentDocument.close()})};var _=function(W,H,M){var L=W.createElement("iframe");return L.style.width=H+"px",L.style.height=M+"px",L.style.visibility="hidden",L.style.position="absolute",L.style.top=-1e4-M+"px",L.style.left=-1e4-H+"px",L.style.borderWidth=0,L.sandbox="allow-same-origin",L.scrolling="no",L},k=function(W,H,M){var L=Math.floor(W/M),D=Math.floor(H/M);return _(g.document,L,D)},x=function(W,H,M,L){return{width:Math.max(W.width*L,H),height:Math.max(W.height*L,M)}},A=function(W,H){var M=W.querySelector(H);if(M)return M;if(W.ownerDocument.querySelector(H)===W)return W;throw{message:"Clipping selector not found"}},S=function(W,H,M,L,D){var B=Math.max(W.scrollWidth,W.clientWidth),q=Math.max(W.scrollHeight,W.clientHeight),K,z,$,F,Y,X,Q,ee;return H?(X=A(W,H),Q=X.getBoundingClientRect(),K=Q.top,z=Q.left,$=Q.width,F=Q.height):(K=0,z=0,$=B,F=q),ee=x({width:$,height:F},M,L,D),Y=g.getComputedStyle(W.ownerDocument.documentElement).fontSize,{left:z,top:K,width:ee.width,height:ee.height,viewportWidth:B,viewportHeight:q,rootFontSize:Y}},P=function(W,H){var M=W.tagName;return H.querySelector(M)},C=function(W){var H=W.tagName.toLowerCase();return H==="html"||H==="body"?W.outerHTML:'<body style="margin: 0;">'+W.outerHTML+"</body>"};y.calculateDocumentContentSize=function(W,H){return new Promise(function(M,L){var D=H.zoom||1,B;B=k(H.width,H.height,D),g.document.getElementsByTagName("body")[0].appendChild(B),B.onload=function(){var q=B.contentDocument,K;try{K=S(P(W,q),H.clip,H.width,H.height,D),M(K)}catch(z){L(z)}finally{g.document.getElementsByTagName("body")[0].removeChild(B)}},B.contentDocument.open(),B.contentDocument.write("<!DOCTYPE html>"),B.contentDocument.write(C(W)),B.contentDocument.close()})},y.parseHtmlFragment=function(W){var H=g.document.implementation.createHTMLDocument("");H.documentElement.innerHTML=W;var M=H.querySelector("body").firstChild;if(!M)throw"Invalid source";return M};var R=function(W,H){var M=/<html((?:\s+[^>]*)?)>/im.exec(H),L=g.document.implementation.createHTMLDocument(""),D,B,q,K;if(M)for(D="<div"+M[1]+"></div>",L.documentElement.innerHTML=D,q=L.querySelector("div"),B=0;B<q.attributes.length;B++)K=q.attributes[B],W.documentElement.setAttribute(K.name,K.value)};y.parseHTML=function(W){var H=g.document.implementation.createHTMLDocument("");return H.documentElement.innerHTML=W,R(H,W),H};var N=function(W){try{return v.failOnParseError(W)}catch(H){throw{message:"Invalid source",originalError:H}}};y.validateXHTML=function(W){var H=new DOMParser,M=H.parseFromString(W,"application/xml");N(M)};var U=null,G=function(W,H){return H==="none"||H==="repeated"?((U===null||H!=="repeated")&&(U=Date.now()),W+"?_="+U):W},Z=function(W,H){return new Promise(function(M,L){var D=new window.XMLHttpRequest,B=E.joinUrl(H.baseUrl,W),q=G(B,H.cache),K=function(z){L({message:"Unable to load page",originalError:z})};D.addEventListener("load",function(){D.status===200||D.status===0?M(D.responseXML):K(D.statusText)},!1),D.addEventListener("error",function(z){K(z)},!1);try{D.open("GET",q,!0),D.responseType="document",D.send(null)}catch(z){K(z)}})};return y.loadDocument=function(W,H){return Z(W,H).then(function(M){return N(M)})},y}(a,o,n,window),h=function(E){var p={},v=function(P,C){return C?URL.createObjectURL(new Blob([P],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(P)},g=function(P){P instanceof Blob&&URL.revokeObjectURL(P)},y='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',d=function(P){return new Promise(function(C,R){var N=document.createElement("canvas"),U=new Image;U.onload=function(){var G=N.getContext("2d");try{G.drawImage(U,0,0),N.toDataURL("image/png"),C(!0)}catch{C(!1)}},U.onerror=R,U.src=P})},m=function(){var P=v(y,!0);return d(P).then(function(C){return g(P),C?!1:d(v(y,!1)).then(function(R){return R})},function(){return!1})},_=function(){if(E.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},k=function(){return new Promise(function(P,C){_()&&E.URL?m().then(function(R){P(!R)},function(){C()}):P(!1)})},x,A=function(){return x===void 0&&(x=k()),x},S=function(P){return A().then(function(C){return v(P,C)})};return p.renderSvg=function(P){return new Promise(function(C,R){var N,U,G=function(){U.onload=null,U.onerror=null},Z=function(){N&&g(N)};U=new Image,U.onload=function(){G(),Z(),C(U)},U.onerror=function(){Z(),R()},S(P).then(function(W){N=W,U.src=N},R)})},p}(window),O=function(E,p,v,g){var y={},d=function(P,C){var R=C||1,N={width:P.width,height:P.height,"font-size":P.rootFontSize};return R!==1&&(N.style="transform:scale("+R+"); transform-origin: 0 0;"),N},m=function(P){var C,R,N,U;C=Math.round(P.viewportWidth),R=Math.round(P.viewportHeight),N=-P.left,U=-P.top;var G={x:N,y:U,width:C,height:R};return G},_=function(P){var C=P.style||"";P.style=C+"float: left;"},k=function(P){P.externalResourcesRequired=!0},x=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},A=function(P){var C=Object.keys(P);return C.length?" "+C.map(function(R){return R+'="'+P[R]+'"'}).join(" "):""},S=function(P,C,R){var N=g.serializeToString(P);p.validateXHTML(N);var U=m(C);return _(U),k(U),'<svg xmlns="http://www.w3.org/2000/svg"'+A(d(C,R))+">"+x()+"<foreignObject"+A(U)+">"+N+"</foreignObject></svg>"};return y.getSvgForDocument=function(P,C,R){return v.rewriteTagNameSelectorsToLowerCase(P),S(P,C,R)},y.drawDocumentAsSvg=function(P,C){return["hover","active","focus","target"].forEach(function(R){C[R]&&v.fakeUserAction(P,C[R],R)}),p.calculateDocumentContentSize(P,C).then(function(R){return y.getSvgForDocument(P,R,C.zoom)})},y}(a,f,u,r),w=function(E,p,v,g,y,d){var m={},_=function(P){return{message:"Error rendering page",originalError:P}},k=function(P){return y.renderSvg(P).then(function(C){return{image:C,svg:P}},function(C){throw _(C)})},x=function(P,C){try{C.getContext("2d").drawImage(P,0,0)}catch(R){throw _(R)}},A=function(P,C,R){return g.drawDocumentAsSvg(P,R).then(k).then(function(N){return C&&x(N.image,C),N})},S=function(P,C){return p.executeJavascript(P,C).then(function(R){var N=R.document;return v.persistInputValues(N),{document:N,errors:R.errors,cleanUp:R.cleanUp}})};return m.rasterize=function(P,C,R){var N;return N=E.clone(R),N.inlineScripts=R.executeJs===!0,d.inlineReferences(P,N).then(function(U){return R.executeJs?S(P,R).then(function(G){return{element:G.document.documentElement,errors:U.concat(G.errors),cleanUp:G.cleanUp}}):{element:P,errors:U,cleanUp:function(){}}}).then(function(U){return A(U.element,C,R).then(function(G){return U.cleanUp(),{image:G.image,svg:G.svg,errors:U.errors}})})},m}(a,f,u,O,h,i),b=function(E,p,v){var g={},y=function(x,A){var S=300,P=200,C=x?x.width:S,R=x?x.height:P,N=A.width!==void 0?A.width:C,U=A.height!==void 0?A.height:R;return{width:N,height:U}},d=function(x){var A=y(x.canvas,x.options),S;return S=E.clone(x.options),S.width=A.width,S.height=A.height,S};g.drawDocument=function(){var x=arguments[0],A=Array.prototype.slice.call(arguments,1),S=E.parseOptionalParameters(A),P=x.documentElement?x.documentElement:x;return v.rasterize(P,S.canvas,d(S))};var m=function(x,A,S){var P=p.parseHTML(x);return g.drawDocument(P,A,S)};g.drawHTML=function(){var x=arguments[0],A=Array.prototype.slice.call(arguments,1),S=E.parseOptionalParameters(A);return m(x,S.canvas,S.options)};var _=function(x,A,S){var P=document.implementation.createHTMLDocument("");P.replaceChild(x.documentElement,P.documentElement);var C=S?E.clone(S):{};return S.baseUrl||(C.baseUrl=A),{document:P,options:C}},k=function(x,A,S){return p.loadDocument(x,S).then(function(P){var C=_(P,x,S);return g.drawDocument(C.document,A,C.options)})};return g.drawURL=function(){var x=arguments[0],A=Array.prototype.slice.call(arguments,1),S=E.parseOptionalParameters(A);return k(x,S.canvas,S.options)},g}(a,f,w);return b})})(oS);var sj=oS.exports;(function(e){var t=me&&me.__createBinding||(Object.create?function(m,_,k,x){x===void 0&&(x=k);var A=Object.getOwnPropertyDescriptor(_,k);A&&!("get"in A?!_.__esModule:A.writable||A.configurable)||(A={enumerable:!0,get:function(){return _[k]}}),Object.defineProperty(m,x,A)}:function(m,_,k,x){x===void 0&&(x=k),m[x]=_[k]}),r=me&&me.__setModuleDefault||(Object.create?function(m,_){Object.defineProperty(m,"default",{enumerable:!0,value:_})}:function(m,_){m.default=_}),n=me&&me.__importStar||function(m){if(m&&m.__esModule)return m;var _={};if(m!=null)for(var k in m)k!=="default"&&Object.prototype.hasOwnProperty.call(m,k)&&t(_,m,k);return r(_,m),_};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToCanvas=e.detectSize=e.isContentWrapping=e.prerenderFont=e.resetStyleContent=void 0;const i=n(sj),a=eu,o=p2;e.resetStyleContent=`
|
|
159
|
+
p {
|
|
160
|
+
margin: 0;
|
|
161
|
+
padding: 0;
|
|
162
|
+
word-wrap: break-word; /* Required for Firefox */
|
|
163
|
+
/* a text may have several spaces, we need to preserve them */
|
|
164
|
+
white-space: pre-wrap;
|
|
165
|
+
}
|
|
166
|
+
ul, ol {
|
|
167
|
+
list-style-position: outside;
|
|
168
|
+
margin: 0;
|
|
169
|
+
padding: 0;
|
|
170
|
+
display: inline-block;
|
|
171
|
+
text-align: left;
|
|
172
|
+
width: 100%;
|
|
173
|
+
}
|
|
174
|
+
li {
|
|
175
|
+
margin-left: 1.7em;
|
|
176
|
+
padding-left: 0.5em; /* This should match the margin-left value */
|
|
177
|
+
}
|
|
178
|
+
/* Add resets */
|
|
179
|
+
ul {
|
|
180
|
+
list-style-type: disc;
|
|
181
|
+
}
|
|
182
|
+
ol {
|
|
183
|
+
list-style-type: decimal;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
`;const l=`
|
|
187
|
+
<style>
|
|
188
|
+
html, body {
|
|
189
|
+
padding: 0;
|
|
190
|
+
margin: 0;
|
|
191
|
+
}
|
|
192
|
+
${e.resetStyleContent}
|
|
193
|
+
</style>
|
|
194
|
+
`;let u;const f=()=>(u||(u=document.createElement("div"),u.id="polotno-hidden-do-not-touch",u.style.overflow="hidden",u.style.position="relative",document.body.appendChild(u),u.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),u),h=new Map,O=navigator.userAgent.includes("Firefox"),w=async m=>{if(h.has(m))return h.get(m);const _=(async()=>{const k=`<div style="font-family: ${m}; font-size: 100px;">${m}<strong>${m}</strong></div>`,x=document.createElement("div");x.innerHTML=k,x.style.visibility="hidden",x.style.position="absolute";const A=f();A.appendChild(x);const S=O?180:50;await new Promise(P=>setTimeout(P,S)),A.removeChild(x)})();return h.set(m,_),_};function b({html:m}){const _=document.createElement("div");_.innerHTML=m,_.style.display="inline-block",_.style.position="fixed",_.style.top="0px",_.style.left="0px",_.style.zIndex="1000",_.style.whiteSpace="nowrap",_.style.visibility="hidden";const k=f();k.appendChild(_);const x=_.textContent,A=_.childNodes[0],S=x.split(/\s+/);let P=!1;for(let C=0;C<S.length;C++){const R=S[C];if(A.textContent=R,P=A.scrollWidth>_.clientWidth,P)break}return k.removeChild(_),P}function E(m){m.indexOf("Avellino");const _=document.createElement("div");_.innerHTML=m,_.style.display="inline-block",_.style.position="fixed",_.style.top="0px",_.style.left="0px",_.style.zIndex="1000";const k=f();k.appendChild(_);const x=_.getBoundingClientRect();return k.removeChild(_),{width:x.width,height:x.height}}e.prerenderFont=w,e.isContentWrapping=b,e.detectSize=E;const p={};function v(m){const _=[];for(const k of document.styleSheets)try{for(const x of k.cssRules)x instanceof CSSFontFaceRule&&x.style.fontFamily.replace(/['"]/g,"")===m&&_.push(x)}catch(x){console.warn(`Could not access stylesheet: ${k.href}`,x)}return _}const g={},y=m=>{if(g[m])return g[m];const _=v(m).filter(k=>k.style.fontFamily.replace(/['"]/g,"")===m).map(k=>({src:k.style.src,fontStyle:k.style.fontStyle||"normal",fontWeight:k.style.fontWeight||"normal"}));return g[m]=_,_};async function d({html:m,width:_,height:k,fontFamily:x,padding:A,font:S,pixelRatio:P}){if(x!=="Arial"&&!S){const U=(0,a.getGoogleFontsVariants)();m+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${x}:${U}" rel="stylesheet">`}if(S){const U=S.styles||(S.url?[{src:`url("${S.url}")`}]:y(x));m+="<style>",U.forEach(G=>{m+=`
|
|
195
|
+
@font-face {
|
|
196
|
+
font-family: '${x}';
|
|
197
|
+
src: ${G.src};
|
|
198
|
+
font-style: ${G.fontStyle||"normal"};
|
|
199
|
+
font-weight: ${G.fontWeight||"normal"};
|
|
200
|
+
}
|
|
201
|
+
`}),m+="</style>"}m+=l;const C=document.createElement("canvas"),R=await i.drawHTML(`<div style="padding: ${A}px;">${m}</div>`,C,{width:_+2*A,height:k+2*A,cacheBucket:p});(0,o.trySetCanvasSize)(C,(_+2*A)*P,(k+2*A)*P);const N=C.getContext("2d");return N==null||N.drawImage(R.image,0,0,C.width,C.height),C}e.htmlToCanvas=d})(g2);var _2={},w2={};(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 m=r(d),_=m.data;return m.data="",_},i=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(d,m)=>{let _="",k="",x="";for(let A in d){let S=d[A];A[0]=="@"?A[1]=="i"?_=A+" "+S+";":k+=A[1]=="f"?o(S,A):A+"{"+o(S,A[1]=="k"?"":m)+"}":typeof S=="object"?k+=o(S,m?m.replace(/([^,])+/g,P=>A.replace(/(^:.*)|([^,])+/g,C=>/&/.test(C)?C.replace(/&/g,P):P?P+" "+C:C)):A):S!=null&&(A=A.replace(/[A-Z]/g,"-$&").toLowerCase(),x+=o.p?o.p(A,S):A+":"+S+";")}return _+(m&&x?m+"{"+x+"}":x)+k},l={},u=d=>{if(typeof d=="object"){let m="";for(let _ in d)m+=_+u(d[_]);return m}return d},f=(d,m,_,k,x)=>{let A=u(d),S=l[A]||(l[A]=(P=>{let C=0,R=11;for(;C<P.length;)R=101*R+P.charCodeAt(C++)>>>0;return"go"+R})(A));if(!l[S]){let P=A!==d?d:(C=>{let R,N=[{}];for(;R=i.exec(C.replace(a,""));)R[4]?N.shift():R[3]?N.unshift(N[0][R[3]]=N[0][R[3]]||{}):N[0][R[1]]=R[2];return N[0]})(d);l[S]=o(x?{["@keyframes "+S]:P}:P,_?"":"."+S)}return((P,C,R)=>{C.data.indexOf(P)==-1&&(C.data=R?P+C.data:C.data+P)})(l[S],m,k),S},h=(d,m,_)=>d.reduce((k,x,A)=>{let S=m[A];if(S&&S.call){let P=S(_),C=P&&P.props&&P.props.className||/^go/.test(P)&&P;S=C?"."+C:P&&typeof P=="object"?P.props?"":o(P,""):P===!1?"":P}return k+x+(S??"")},"");function O(d){let m=this||{},_=d.call?d(m.p):d;return f(_.unshift?_.raw?h(_,[].slice.call(arguments,1),m.p):_.reduce((k,x)=>Object.assign(k,x&&x.call?x(m.p):x),{}):_,r(m.target),m.g,m.o,m.k)}e.extractCss=n,e.css=O;let w,b,E,p=O.bind({g:1}),v=O.bind({k:1});function g(d,m,_,k){o.p=m,w=d,b=_,E=k}function y(d,m){let _=this||{};return function(){let k=arguments;function x(A,S){let P=Object.assign({},A),C=P.className||x.className;_.p=Object.assign({theme:b&&b()},P),_.o=/ *go\d+/.test(C),P.className=O.apply(_,k)+(C?" "+C:""),m&&(P.ref=S);let R=d;return d[0]&&(R=P.as||d,delete P.as),E&&R[0]&&E(P),w(R,P)}return m?m(x):x}}e.glob=p,e.keyframes=v,e.setup=g,e.styled=y})(w2);var uj=me&&me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_2,"__esModule",{value:!0});const cj=uj(et),w_=w2;(0,w_.setup)(cj.default.createElement),_2.default=w_.styled;(function(e){var t=me&&me.__createBinding||(Object.create?function(M,L,D,B){B===void 0&&(B=D);var q=Object.getOwnPropertyDescriptor(L,D);q&&!("get"in q?!L.__esModule:q.writable||q.configurable)||(q={enumerable:!0,get:function(){return L[D]}}),Object.defineProperty(M,B,q)}:function(M,L,D,B){B===void 0&&(B=D),M[B]=L[D]}),r=me&&me.__setModuleDefault||(Object.create?function(M,L){Object.defineProperty(M,"default",{enumerable:!0,value:L})}:function(M,L){M.default=L}),n=me&&me.__importStar||function(M){if(M&&M.__esModule)return M;var L={};if(M!=null)for(var D in M)D!=="default"&&Object.prototype.hasOwnProperty.call(M,D)&&t(L,M,D);return r(L,M),L},i=me&&me.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.quillRef=void 0;const a=i(et),o=Jn,l=Ma,u=i(TD),f=i(Ei),h=n(Xi),O=Xn,w=Zc,b=Zy,E=Xc,p=g2,v=kl,g=Tl,y=Yc,d=i(_2),m=Vi,_=e2,k=n(eu),x=Ao,A=f2;e.quillRef=h.observable({enabled:!1,currentFormat:{},editor:h.observable.object({instance:null},{},{deep:!1})});const S=(0,d.default)("div",a.default.forwardRef)`
|
|
202
|
+
.ql-editor {
|
|
203
|
+
outline: none;
|
|
204
|
+
}
|
|
205
|
+
${p.resetStyleContent}
|
|
206
|
+
strong {
|
|
207
|
+
font-weight: 700;
|
|
208
|
+
}
|
|
209
|
+
.ql-direction-rtl {
|
|
210
|
+
direction: rtl;
|
|
211
|
+
}
|
|
212
|
+
`,P=M=>new u.default(M,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:["bold","color","font","italic","size","strike","underline","indent","list","direction"]});e.createQuill=P;const C=(M,L)=>{var D=M.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+L+"<p><br></p></div>");M.setContents(D),M.history.clear()};e.setQuillContent=C;const R=({html:M,onBlur:L,onChange:D,element:B})=>{const q=a.default.useRef(null);a.default.useEffect(()=>{if(!q.current)return;const z=(0,e.createQuill)(q.current);return h.runInAction(()=>{e.quillRef.editor.instance=z}),window.__polotnoQuill=z,z.on("text-change",()=>{z.getSelection()&&h.runInAction(()=>{e.quillRef.currentFormat=z.getFormat()}),setTimeout(()=>{var $;const F=($=q.current)===null||$===void 0?void 0:$.childNodes[0];D(F.innerHTML)},10)}),z.setSelection(0,0,"api"),z.on("selection-change",$=>{$||L(),$&&h.runInAction(()=>{e.quillRef.currentFormat=z.getFormat()})}),q.current.childNodes[0].addEventListener("blur",$=>{var F;!((F=$.relatedTarget)===null||F===void 0)&&F.classList.contains("ql-clipboard")||L()}),()=>{h.runInAction(()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),a.default.useEffect(()=>{var z;const $=e.quillRef.editor.instance;if(!$)return;const F=$.getSelection();((z=q.current)===null||z===void 0?void 0:z.childNodes[0].innerHTML)===B.text||((0,e.setQuillContent)($,M),F&&($.setSelection(F.index,F.length),h.runInAction(()=>{e.quillRef.currentFormat=$.getFormat()})))},[B.text]);const K={color:B.fill};return B.fill.indexOf("gradient")>=0&&(K.backgroundColor=B.fill,K.backgroundImage=B.fill,K.backgroundSize="100% 100%",K.backgroundRepeat="repeat",K.webkitBackgroundClip="text",K.MozBackgroundClip="text",K.WebkitTextFillColor="transparent",K.MozTextFillColor="transparent"),a.default.createElement(S,{ref:q,style:Object.assign(Object.assign({},K),{fontSize:B.fontSize,width:B.a.width,fontFamily:B.fontFamily,lineHeight:B.lineHeight,letterSpacing:B.letterSpacing+"rem",textAlign:B.align}),dir:(0,b.getDir)((0,_.removeTags)(B.text))})};function N(M,L,D){return a.default.useMemo(()=>(0,p.detectSize)(M),[M,L.width,D])}function U(M){const L=M.getContext("2d").getImageData(0,0,M.width,M.height).data;for(let D=0;D<L.length;D+=4)if(L[D+3]!==0)return!0;return!1}function G(M){return!U(M)}function Z(M,{fontFamily:L="",color:D="black"}={}){let B=`color: ${D||M.fill}`;return M.fill.indexOf("gradient")>=0&&(B=`
|
|
213
|
+
background-color: ${D};
|
|
214
|
+
background-image: ${M.fill};
|
|
215
|
+
background-size: 100% 100%;
|
|
216
|
+
background-repeat: repeat;
|
|
217
|
+
-webkit-background-clip: text;
|
|
218
|
+
-moz-background-clip: text;
|
|
219
|
+
-webkit-text-fill-color: transparent;
|
|
220
|
+
-moz-text-fill-color: transparent;
|
|
221
|
+
`),`<div style="${["white-space: pre-wrap",`width: ${Math.round(M.width||100)}px`,B,`font-size: ${M.fontSize}px`,`font-family: '${L}'`,`text-align: ${M.align}`,M.textDecoration?`text-decoration: ${M.textDecoration}`:"",M.lineHeight?`line-height: ${M.lineHeight}`:"",M.letterSpacing?`letter-spacing: ${M.letterSpacing}rem`:"",M.fontStyle?`font-style: ${M.fontStyle}`:"",M.fontWeight?`font-weight: ${M.fontWeight}`:"",M.strokeWidth?`-webkit-text-stroke: ${M.strokeWidth}px ${M.stroke}`:"",M.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,b.getDir)((0,_.removeTags)(M.text))}">${M.text.replaceAll(`
|
|
222
|
+
`,"</br>")}</div>`}const W=M=>{let L=M.fontSize;for(let D=1;D<50;D++){const B=Z(Object.assign(Object.assign({},M.toJSON()),{fontSize:L}),{fontFamily:M.fontFamily}),{height:q}=(0,p.detectSize)(B),K=M.height&&q>M.height,z=(0,p.isContentWrapping)({html:B});if(!(K||z))break;L-=.5}return L},H=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,o.observer)(({element:M,store:L})=>{const D=a.default.useRef(null),[B,q]=a.default.useState(),[K,z]=a.default.useState(!1),[$,F]=a.default.useState(!0),[Y,X]=a.default.useState(!1),Q=a.default.useRef(M.height),ee=L.selectedShapes.indexOf(M)>=0,re=M.fontSize/3,{textVerticalResizeEnabled:oe}=O.flags,ae=(0,b.usePrevious)(M.fontFamily),[ie]=(0,b.useFontLoader)(L,M.fontFamily),Re=M._editModeEnabled;(0,v.useFadeIn)(D);const Me=ie?M.fontFamily:ae!==M.fontFamily?ae:"Arial",ne=(0,E.useColor)(M).fill,le=Z(M,{fontFamily:Me,color:ne}),{width:be,height:ye}=N(le,M,ie);a.default.useEffect(()=>{if(!ie)return;if(!M.height)return void M.set({height:ye});const{textOverflow:Ae}=O.flags;if(Ae!=="change-font-size"||K)Ae==="resize"&&(oe&&M.height<ye&&L.history.ignore(()=>{M.set({height:ye})}),oe||M.height===ye||L.history.ignore(()=>{M.set({height:ye})}));else{const Ce=W(M);Ce!==M.fontSize?L.history.ignore(()=>{M.set({fontSize:Ce})}):M.height!==ye&&(oe&&M.height<ye?L.history.ignore(()=>{M.set({height:ye})}):oe||L.history.ignore(()=>{M.set({height:ye})}))}});const te=a.default.useRef(0),de=a.default.useMemo(()=>{const Ae={lastArgs:null,lastResult:null};return async function(Ce){return Ae.lastArgs&&Ae.lastResult&&(Oe=Ae.lastArgs,Fe=Ce,JSON.stringify(Oe)===JSON.stringify(Fe))||(Ae.lastResult=await(0,p.htmlToCanvas)(Ce),Ae.lastArgs=Object.assign({},Ce)),Ae.lastResult;var Oe,Fe}},[]);a.default.useEffect(()=>{K||Re||(async()=>{te.current++;const Ae=te.current,Ce=(0,m.incrementLoader)(`text ${M.id}`);F(!0);let Oe=null;const Fe=H?5:1;for(let Qe=0;Qe<Fe;Qe++){if(Oe=await(Qe>0?de:p.htmlToCanvas)({skipCache:Qe>0,html:le,width:M.width||1,height:M.height||ye||1,fontFamily:Me,padding:re,pixelRatio:L._elementsPixelRatio,font:L.fonts.find(fe=>fe.fontFamily===Me)||k.globalFonts.find(fe=>fe.fontFamily===Me)}),Ae!==te.current)return void Ce();G(Oe)&&H&&await new Promise(fe=>setTimeout(fe,50*(Qe+1)))}Oe?(q(Oe),F(!1),f.default.Util.requestAnimFrame(Ce)):Ce()})()},[le,K,ye,Re,Me,M.height,L._elementsPixelRatio]);const he=K||$;a.default.useEffect(()=>h.autorun(()=>{const Ae=D.current;(0,w.applyFilter)(Ae,M)}),[B,he,M.shadowColor,M.shadowOffsetX,M.shadowOffsetY,M.shadowOpacity]);let Se=0;M.verticalAlign==="middle"&&(Se=(M.height-ye)/2),M.verticalAlign==="bottom"&&(Se=M.height-ye);const $e=(0,b.getLineHeight)({fontLoaded:ie,fontFamily:M.fontFamily,fontSize:M.fontSize,lineHeight:M.lineHeight}),tt=(0,x.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Rect,{x:M.a.x,y:M.a.y,offsetX:M.backgroundPadding*(M.fontSize*$e*.5),offsetY:M.backgroundPadding*(M.fontSize*$e*.5),rotation:M.a.rotation,hideInExport:!M.showInExport,listening:!1,visible:M.backgroundEnabled,opacity:M.backgroundOpacity*M.a.opacity,fill:M.backgroundColor,width:M.a.width+M.backgroundPadding*(M.fontSize*$e),height:M.a.height+M.backgroundPadding*(M.fontSize*$e),cornerRadius:M.backgroundCornerRadius*(M.fontSize*$e*.5)}),a.default.createElement(l.Rect,{ref:D,name:"element",x:M.a.x,y:M.a.y,listening:M.selectable,rotation:M.a.rotation,width:M.a.width,height:M.a.height,visible:!he,draggable:tt?M.draggable&&ee:M.draggable,preventDefault:!tt||ee,opacity:Re?0:M.a.opacity,hideInExport:!M.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:Ae=>{M.set({x:Ae.target.x(),y:Ae.target.y()})},onDragEnd:Ae=>{M.set({x:Ae.target.x(),y:Ae.target.y()})},id:M.id,onDblClick:()=>{M.contentEditable&&M.toggleEditMode(!0)},onDblTap:()=>{M.contentEditable&&M.toggleEditMode(!0)},onTransformStart:Ae=>{z(!0),Q.current=M.height},onTransform:Ae=>{var Ce;const Oe=Ae.target,Fe=((Ce=Oe.getStage())===null||Ce===void 0?void 0:Ce.findOne("Transformer")).getActiveAnchor(),Qe=Fe==="middle-left"||Fe==="middle-right",se=Fe==="top-center"||Fe==="bottom-center",fe=Oe.scaleX();if(Qe){const Ze=Oe.scaleX(),Je=Math.max(Oe.width()*Ze,M.fontSize);if(Oe.width(Je),Oe.scaleX(1),O.flags.textVerticalResizeEnabled){const _e=Math.max(ye,Q.current);M.set({height:_e})}M.set({width:Je,x:Oe.x(),y:Oe.y()})}else if(se){let Ze=O.flags.textOverflow==="resize"?ye:M.lineHeight*M.fontSize;const Je=Math.max(Ze,Ae.target.height()*Ae.target.scaleY());Oe.scaleY(1),M.set({x:Oe.x(),y:Oe.y(),height:Je,rotation:Oe.rotation()})}else Oe.scaleX(1),Oe.scaleY(1),M.set({fontSize:M.fontSize*fe,width:Oe.width()*fe,x:Oe.x(),y:Oe.y(),rotation:Oe.rotation(),height:Oe.height()*fe})},onTransformEnd:Ae=>{z(!1),F(!0);const Ce=Ae.target.scaleX();Ae.target.scaleX(1),Ae.target.scaleY(1),M.set({fontSize:M.fontSize*Ce,width:Ae.target.width()*Ce,x:Ae.target.x(),y:Ae.target.y(),rotation:Ae.target.rotation(),shadowBlur:M.shadowBlur*Ce,shadowOffsetX:M.shadowOffsetX*Ce,shadowOffsetY:M.shadowOffsetY*Ce,strokeWidth:M.strokeWidth*Ce})}}),a.default.createElement(l.Image,{ref:D,image:B,x:M.a.x,y:M.a.y,offsetX:re,offsetY:re-Se,listening:!1,rotation:M.rotation,width:M.a.width+2*re,height:M.a.height+2*re,visible:!he,opacity:Re?0:M.a.opacity,shadowEnabled:M.shadowEnabled,shadowBlur:M.shadowBlur,shadowOffsetX:M.shadowOffsetX,shadowOffsetY:M.shadowOffsetY,shadowColor:M.shadowColor,shadowOpacity:M.shadowOpacity,hideInExport:!M.showInExport}),he&&a.default.createElement(l.Group,{x:M.a.x,y:M.a.y,rotation:M.rotation,offsetY:-Se},a.default.createElement(y.Html,{divProps:{style:{pointerEvents:"none"}}},a.default.createElement(S,{dangerouslySetInnerHTML:{__html:le},style:{pointerEvents:"none",display:"inline-block"}}))),Re&&a.default.createElement(l.Group,{x:M.a.x,y:M.a.y,rotation:M.rotation,offsetY:-Se},a.default.createElement(y.Html,null,a.default.createElement(R,{html:le,element:M,onChange:Ae=>{const Ce=(0,A.getLimitedFontSize)({oldText:(0,_.removeTags)(M.text),newText:(0,_.removeTags)(Ae),element:M});M.set({text:Ae,fontSize:Ce})},onBlur:Ae=>{M.toggleEditMode(!1)}}))),(ee||Y)&&a.default.createElement(g.Highlighter,{element:M}))})})(iS);var fS={},S2={},iu={};(function(e){function t(u){return u/180*Math.PI}function r(u,f,h,O,w){const b=Math.sqrt(h*h+O*O);return w+=Math.atan2(O,h),{x:u+b*Math.cos(w),y:f+b*Math.sin(w)}}function n(u){const{x:f,y:h,width:O,height:w}=u,b=t(u.rotation),E=r(f,h,0,0,b),p=r(f,h,O,0,b),v=r(f,h,O,w,b),g=r(f,h,0,w,b),y=Math.min(E.x,p.x,v.x,g.x),d=Math.min(E.y,p.y,v.y,g.y),m=Math.max(E.x,p.x,v.x,g.x),_=Math.max(E.y,p.y,v.y,g.y);return{x:y,y:d,width:m-y,height:_-d,minX:y,minY:d,maxX:m,maxY:_}}function i(u){const f=u.map(E=>n(E)),h=Math.min(...f.map(E=>E.minX)),O=Math.min(...f.map(E=>E.minY)),w=Math.max(...f.map(E=>E.maxX)),b=Math.max(...f.map(E=>E.maxY));return{x:h,y:O,width:w-h,height:b-O,minX:h,minY:O,maxX:w,maxY:b}}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,h){const O=t(f),w=h.x+(u.x-h.x)*Math.cos(O)-(u.y-h.y)*Math.sin(O),b=h.y+(u.x-h.x)*Math.sin(O)+(u.y-h.y)*Math.cos(O);return Object.assign(Object.assign({},u),{rotation:u.rotation+f,x:w,y:b})}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})(iu);(function(e){var t=me&&me.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.useAnchorSnap=e.useSnap=e.setSnapFilterFunc=void 0;const r=t(et),n=t(Ei),i=iu;var a=5;let o=({targetKonvaNodes:b,guideKonvaNode:E,distance:p,snapDirection:v})=>p<a;const l=b=>{o=b};function u(b){const E=b.__getNodeRect(),p=(0,i.getClientRect)(Object.assign(Object.assign({},E),{rotation:n.default.Util.radToDeg(E.rotation)})),v=b.getAbsolutePosition();return{vertical:[{guide:p.x,offset:v.x-p.x,snap:"start",nodes:b.nodes()},{guide:p.x+p.width/2,offset:v.x-p.x-p.width/2,snap:"center",nodes:b.nodes()},{guide:p.x+p.width,offset:v.x-p.x-p.width,snap:"end",nodes:b.nodes()}],horizontal:[{guide:p.y,offset:v.y-p.y,snap:"start",nodes:b.nodes()},{guide:p.y+p.height/2,offset:v.y-p.y-p.height/2,snap:"center",nodes:b.nodes()},{guide:p.y+p.height,offset:v.y-p.y-p.height,snap:"end",nodes:b.nodes()}]}}function f(b,E){var p=[],v=[];b.vertical.forEach(k=>{E.vertical.forEach(x=>{var A=Math.abs(k.offset-x.guide);o({targetKonvaNodes:x.nodes,guideKonvaNode:k.node,distance:A,snapDirection:k.snap})&&p.push({lineGuide:k.offset,diff:A,snap:x.snap,offset:x.offset})})}),b.horizontal.forEach(k=>{E.horizontal.forEach(x=>{var A=Math.abs(k.offset-x.guide);o({targetKonvaNodes:x.nodes,guideKonvaNode:k.node,distance:A,snapDirection:k.snap})&&v.push({lineGuide:k.offset,diff:A,snap:x.snap,offset:x.offset})})});var g=[];const y=p.sort((k,x)=>k.diff-x.diff),d=v.sort((k,x)=>k.diff-x.diff);var m=y[0],_=d[0];return m&&y.filter(k=>Math.abs(k.diff-m.diff)<.1).forEach(k=>{g.push(Object.assign({orientation:"V"},k))}),_&&d.filter(k=>Math.abs(k.diff-_.diff)<.1).forEach(k=>{g.push(Object.assign({orientation:"H"},k))}),g}function h(b,E){const p=r.default.useRef(),v=k=>k.hasName("element")||k.hasName("page-background")||!p.current&&k.hasName("elements-area");function g(k){var x;const A=(x=b.current)===null||x===void 0?void 0:x.getStage(),S=[],P=[];return A.find(v).forEach(C=>{if(!(k.indexOf(C)>=0)){var R=C.getClientRect({skipShadow:!0,skipStroke:!0});S.push({offset:R.x,node:C,snap:"start"},{offset:R.x+R.width,node:C,snap:"end"},{offset:R.x+R.width/2,node:C,snap:"center"}),P.push({offset:R.y,node:C,snap:"start"},{offset:R.y+R.height,node:C,snap:"end"},{offset:R.y+R.height/2,node:C,snap:"center"})}}),{vertical:S,horizontal:P}}function y(k){var x;const A=(x=b.current)===null||x===void 0?void 0:x.getLayer(),S=A==null?void 0:A.children.find(P=>P.name()==="line-guides");k.forEach(P=>{if(P.orientation==="H"){var C=new n.default.Line({points:[-6e3,P.lineGuide,6e3,P.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});S==null||S.add(C),A.batchDraw()}else P.orientation==="V"&&(C=new n.default.Line({points:[P.lineGuide,-6e3,P.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),S==null||S.add(C))})}const d=k=>{const x=k.target.getLayer().children.find(N=>N.name()==="line-guides");x==null||x.destroyChildren();var A=f(g(k.target.nodes()),u(k.target));if(!A.length)return;y(A);const S=k.target.getAbsolutePosition(),P=(k.target.nodes().map(N=>N.getAbsolutePosition()),Object.assign({},S));A.forEach(N=>{switch(N.snap){case"start":case"center":case"end":switch(N.orientation){case"V":P.x=N.lineGuide+N.offset;break;case"H":P.y=N.lineGuide+N.offset}}});const C=P.x-S.x,R=P.y-S.y;k.evt.ctrlKey||k.evt.metaKey||k.target.nodes().forEach(N=>{const U=N.getAbsolutePosition();N.setAbsolutePosition({x:U.x+C,y:U.y+R})})},m=(k,x,A)=>{const S=b.current,P=S.getLayer(),C=P.children.find(W=>W.name()==="line-guides");if(C==null||C.destroyChildren(),S.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(x.x-k.x,2)+Math.pow(x.y-k.y,2))>50||!P)return x;var R=f(g(S.nodes()),{vertical:[{guide:x.x,offset:0,snap:"start",nodes:S.nodes()}],horizontal:[{guide:x.y,offset:0,snap:"start",nodes:S.nodes()}]});if(!R.length||(y(R),A.ctrlKey||A.metaKey))return x;let N=x.x,U=x.x;R.forEach(W=>{switch(W.orientation){case"V":N=W.lineGuide;break;case"H":U=W.lineGuide}});const G=Math.abs(x.x-N)<10,Z=Math.abs(x.y-U)<10;return G&&!Z?{x:N,y:k.y}:Z&&!G?{x:k.x,y:U}:G&&Z?{x:N,y:U}:x},_=k=>{if(!k.target)return;const x=k.target.getLayer(),A=x.children.find(S=>S.name()==="line-guides");A==null||A.destroyChildren(),x.batchDraw()};r.default.useEffect(()=>{b.current&&(b.current.anchorDragBoundFunc(m),b.current.on("dragstart",()=>{setTimeout(()=>{if(n.default.DD._dragElements.size===0)return;const k=[...n.default.DD._dragElements.entries()],x=k.find(([A,S])=>S.node instanceof n.default.Transformer);k.splice(k.indexOf(x),1),k.unshift(x),n.default.DD._dragElements.clear(),k.forEach(([A,S])=>{n.default.DD._dragElements.set(A,S)})})}),b.current.on("dragmove",d),b.current.on("dragend",_),b.current.on("transformend",_),b.current.on("transform",k=>{var x,A;k.evt.ctrlKey||k.evt.metaKey?(x=b.current)===null||x===void 0||x.rotationSnapTolerance(0):(A=b.current)===null||A===void 0||A.rotationSnapTolerance(5)}))},[])}function O(b){return{vertical:[{guide:b.absolutePosition().x,offset:0,snap:"center",nodes:[b]}],horizontal:[{guide:b.absolutePosition().y,offset:0,snap:"center",nodes:[b]}]}}function w(b,E,p){const v=d=>d.hasName("element")||d.hasName("line-anchor")||d.hasName("page-background")||d.hasName("elements-area"),g=d=>{const m=d.target.getLayer().children.find(P=>P.name()==="line-guides");m==null||m.destroyChildren();var _=f(function(P){var C;const R=(C=b.current)===null||C===void 0?void 0:C.getStage();var N=[],U=[];return R.find(v).forEach(G=>{if(!(P.indexOf(G)>=0)){var Z=G.getClientRect({skipShadow:!0,skipStroke:!0});G.hasName("line-anchor")&&(Z={x:G.absolutePosition().x,y:G.absolutePosition().y,width:0,height:0}),N.push({offset:Z.x,node:G,snap:"start"},{offset:Z.x+Z.width,node:G,snap:"end"},{offset:Z.x+Z.width/2,node:G,snap:"center"}),U.push({offset:Z.y,node:G,snap:"start"},{offset:Z.y+Z.height,node:G,snap:"end"},{offset:Z.y+Z.height/2,node:G,snap:"center"})}}),{vertical:N,horizontal:U}}([d.target,...E.map(P=>P.current)]),O(d.target));if(!_.length)return;(function(P){var C;const R=(C=b.current)===null||C===void 0?void 0:C.getLayer(),N=R==null?void 0:R.children.find(U=>U.name()==="line-guides");P.forEach(U=>{if(U.orientation==="H"){var G=new n.default.Line({points:[-6e3,U.lineGuide,6e3,U.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});N==null||N.add(G),R.batchDraw()}else U.orientation==="V"&&(G=new n.default.Line({points:[U.lineGuide,-6e3,U.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),N==null||N.add(G))})})(_);const k=d.target.getAbsolutePosition(),x=Object.assign({},k);_.forEach(P=>{switch(P.snap){case"start":case"center":case"end":switch(P.orientation){case"V":x.x=P.lineGuide+P.offset;break;case"H":x.y=P.lineGuide+P.offset}}});const A=x.x-k.x,S=x.y-k.y;if(!(d.evt.ctrlKey||d.evt.metaKey)){const P=d.target.getAbsolutePosition();d.target.absolutePosition({x:P.x+A,y:P.y+S})}},y=d=>{if(!d.target)return;const m=d.target.getLayer(),_=m.children.find(k=>k.name()==="line-guides");_==null||_.destroyChildren(),m.batchDraw()};r.default.useEffect(()=>{b.current&&(b.current.on("dragmove",g),b.current.on("dragend",y))},p)}e.setSnapFilterFunc=l,e.useSnap=h,e.useAnchorSnap=w})(S2);(function(e){var t=me&&me.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=e.getLinePositionFromMiddlePoints=e.getMiddlePoints=void 0;const r=t(et),n=Jn,i=Ma,a=Xc,o=Yc,l=Tl,u=S2,f=Ao;function h(E){const{x:p,y:v,width:g,height:y,rotation:d}=E.a,m=d*Math.PI/180,_={x:p+y/2*Math.cos(m+Math.PI/2),y:v+y/2*Math.sin(m+Math.PI/2)};return{middleLeft:_,middleRight:{x:_.x+g*Math.cos(m),y:_.y+g*Math.sin(m)}}}function O(E,p,v){const g=Math.sqrt(Math.pow(p.x-E.x,2)+Math.pow(p.y-E.y,2)),y=Math.atan2(p.y-E.y,p.x-E.x),d=180*y/Math.PI;return{x:E.x+Math.cos(y-Math.PI/2)*v/2,y:E.y+Math.sin(y-Math.PI/2)*v/2,width:g,height:v,rotation:d}}e.getMiddlePoints=h,e.getLinePositionFromMiddlePoints=O;const w=(E,p)=>({offsetX:5/E,offsetY:5/E,width:10/E,height:10/E,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:v=>{v.target.getStage().container().style.cursor="crosshair"},onMouseLeave:v=>{v.target.getStage().container().style.cursor=""},onDragStart:v=>{p.history.startTransaction()},onDragEnd:v=>{p.history.endTransaction()}}),b=(0,n.observer)(({element:E,type:p})=>{const v=(0,a.useColor)(E,E.a.color,"fill"),g=(0,a.useColor)(E,E.a.color,"stroke"),y=Object.assign(Object.assign(Object.assign({strokeWidth:E.height,lineCap:"round",lineJoin:"round"},g),v),{opacity:E.a.opacity,hideInExport:!E.showInExport});return r.default.createElement(r.default.Fragment,null,p==="arrow"&&r.default.createElement(i.Line,Object.assign({points:[3*E.height,2*-E.height,0,0,3*E.height,2*E.height]},y)),p==="triangle"&&r.default.createElement(i.Line,Object.assign({points:[3*E.height,2*-E.height,0,0,3*E.height,2*E.height],closed:!0},y)),p==="bar"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-E.height,0,2*E.height],closed:!0},y)),p==="square"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-E.height,4*E.height,2*-E.height,4*E.height,2*E.height,0,2*E.height],closed:!0},y)),p==="circle"&&r.default.createElement(i.Circle,Object.assign({x:2*E.height,y:0,radius:2*E.height},y)))});e.LineElement=(0,n.observer)(({element:E,store:p})=>{const v=r.default.useRef(null),g=r.default.useRef(null),y=r.default.useRef(null),d=E.selectable||p.role==="admin",m=(0,f.isTouchDevice)(),[_,k]=r.default.useState(!1),x=p.selectedElements.indexOf(E)>=0&&p.selectedElements.length===1,A=p.selectedShapes.indexOf(E)>=0,{middleLeft:S,middleRight:P}=h(E);(0,u.useAnchorSnap)(g,[v],[x]),(0,u.useAnchorSnap)(y,[v],[x]);const C=(0,a.useColor)(E,E.a.color,"stroke");return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Line,Object.assign({ref:v,name:"element",id:E.id,x:E.a.x,y:E.a.y,points:[0,0,E.a.width,0],offsetY:-E.a.height/2,strokeWidth:E.a.height,hitStrokeWidth:Math.max(E.a.height,20),dash:E.dash.map(R=>R*E.a.height)},C,{rotation:E.a.rotation,opacity:E.animated("opacity"),shadowEnabled:E.shadowEnabled,shadowBlur:E.shadowBlur,shadowOffsetX:E.shadowOffsetX,shadowOffsetY:E.shadowOffsetY,shadowColor:E.shadowColor,shadowOpacity:E.shadowOpacity,listening:d,draggable:m?E.draggable&&A:E.draggable,preventDefault:!m||A,hideInExport:!E.showInExport,onMouseEnter:()=>{k(!0)},onMouseLeave:()=>{k(!1)},onDragMove:R=>{E.set({x:R.target.x(),y:R.target.y()})},onDragEnd:R=>{E.set({x:R.target.x(),y:R.target.y()})},onTransform:R=>{const N=R.target.scaleX();R.target.scaleX(1),R.target.scaleY(1),E.set({height:E.height*N,width:E.width*N,x:R.target.x(),y:R.target.y(),rotation:R.target.rotation()})}})),r.default.createElement(i.Group,{x:S.x,y:S.y,rotation:E.rotation,hideInExport:!E.showInExport},r.default.createElement(b,{element:E,type:E.startHead})),r.default.createElement(i.Group,{x:P.x,y:P.y,rotation:E.rotation+180},r.default.createElement(b,{element:E,type:E.endHead})),(_||A&&!x)&&r.default.createElement(l.Highlighter,{element:E}),x&&E.resizable&&r.default.createElement(o.Portal,{selector:".page-abs-container",enabled:!0},r.default.createElement(i.Group,{visible:x},r.default.createElement(i.Rect,Object.assign({x:S.x,y:S.y,ref:g,name:"line-anchor"},w(p.scale,p),{onDragMove:R=>{const N=O(R.target.position(),P,E.height);E.set({x:N.x,y:N.y,width:N.width,rotation:N.rotation})}})),r.default.createElement(i.Rect,Object.assign({x:P.x,y:P.y,ref:y,name:"line-anchor"},w(p.scale,p),{onDragMove:R=>{const N=O(S,R.target.position(),E.height);E.set({x:N.x,y:N.y,width:N.width,rotation:N.rotation})}})))))})})(fS);var dS={};(function(e){var t=me&&me.__createBinding||(Object.create?function(M,L,D,B){B===void 0&&(B=D);var q=Object.getOwnPropertyDescriptor(L,D);q&&!("get"in q?!L.__esModule:q.writable||q.configurable)||(q={enumerable:!0,get:function(){return L[D]}}),Object.defineProperty(M,B,q)}:function(M,L,D,B){B===void 0&&(B=D),M[B]=L[D]}),r=me&&me.__setModuleDefault||(Object.create?function(M,L){Object.defineProperty(M,"default",{enumerable:!0,value:L})}:function(M,L){M.default=L}),n=me&&me.__importStar||function(M){if(M&&M.__esModule)return M;var L={};if(M!=null)for(var D in M)D!=="default"&&Object.prototype.hasOwnProperty.call(M,D)&&t(L,M,D);return r(L,M),L},i=me&&me.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(et),o=Jn,l=Xi,u=Ma,f=i(Kp),h=i(Ei),O=Yc,w=Tl,b=Vi,E=n(ru),p=Xn,v=Zc,g=kl,y=Ao;function d(){return document.createElement("canvas")}async function m(M){if(!(M.indexOf("data:image/svg+xml")>=0||M.indexOf(".svg")>=0))return M;const L=await E.urlToString(M),D=E.fixSize(L);return E.svgToURL(D)}const _=M=>{const[L,D]=a.default.useState(M);return a.default.useEffect(()=>{(async()=>{const B=await m(M);B!==L&&D(B)})()},[M]),L},k=new window.Image;k.src=E.svgToURL(`
|
|
223
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
224
|
+
<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"/>
|
|
225
|
+
<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"/>
|
|
226
|
+
</svg>
|
|
227
|
+
`);const x=new window.Image;x.src=E.svgToURL(`
|
|
228
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
229
|
+
<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"/>
|
|
230
|
+
<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"/>
|
|
231
|
+
<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"/>
|
|
232
|
+
<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"/>
|
|
233
|
+
</svg>
|
|
234
|
+
`);function A(M,L,D,B,q,K,z){for(var $=new ImageData(L,D),F=new Int32Array(M.data.buffer),Y=M.width,X=new Int32Array($.data.buffer),Q=$.width,ee=L/K,re=D/z,oe=Math.round(1/ee),ae=Math.round(1/re),ie=oe*ae,Re=0;Re<$.height;Re++)for(var Me=0;Me<Q;Me++){for(var ne=B+Math.round(Me/ee)+(q+Math.round(Re/re))*Y,le=0,be=0,ye=0,te=0,de=0;de<ae;de++)for(var he=0;he<oe;he++){var Se=F[ne+he+de*Y];le+=Se<<24>>>24,be+=Se<<16>>>24,ye+=Se<<8>>>24,te+=Se>>>24}le=Math.round(le/ie),be=Math.round(be/ie),ye=Math.round(ye/ie),te=Math.round(te/ie),X[Me+Re*Q]=te<<24|ye<<16|be<<8|le}return $}function S(M,L){var D,B;const q=d();q.width=M.width,q.height=M.height,(D=q.getContext("2d"))===null||D===void 0||D.drawImage(M,0,0,q.width,q.height);const K=A(q.getContext("2d").getImageData(0,0,q.width,q.height),Math.floor(q.width*L),Math.floor(q.height*L),0,0,q.width,q.height);return q.width=Math.floor(q.width*L),q.height=Math.floor(q.height*L),(B=q.getContext("2d"))===null||B===void 0||B.putImageData(K,0,0),q}const P=(M,L,D,B,q=0,K=!1)=>{const z=Math.floor(Math.max(M.width*B,1)),$=Math.floor(Math.max(M.height*B,1)),F=Math.min(q*B,z/2,$/2),Y=Math.max(M.width/D.width,M.height/D.height)*B,X=M.page._exportingOrRendering&&p.flags.imageDownScalingEnabled&&Y<1&&!K,Q=D.x===0&&D.y===0&&D.width===(L==null?void 0:L.width)&&D.height===(L==null?void 0:L.height),ee=a.default.useMemo(()=>{if(!(!L||!L.width||!L.height))return Q&&F===0&&!X?void 0:d()},[L,F,X,Q]),re=()=>{if(!ee||!L)return;ee.width=z,ee.height=$;const oe=ee.getContext("2d");if(!oe)return;F&&(oe.beginPath(),oe.moveTo(F,0),oe.lineTo(z-F,0),oe.arc(z-F,F,F,3*Math.PI/2,0,!1),oe.lineTo(z,$-F),oe.arc(z-F,$-F,F,0,Math.PI/2,!1),oe.lineTo(F,$),oe.arc(F,$-F,F,Math.PI/2,Math.PI,!1),oe.lineTo(0,F),oe.arc(F,F,F,Math.PI,3*Math.PI/2,!1),oe.clip());const ae=X?S(L,Y):L,ie=X?{x:Math.floor(D.x*Y),y:Math.floor(D.y*Y),width:Math.floor(D.width*Y),height:Math.floor(D.height*Y)}:D;oe.drawImage(ae,ie.x,ie.y,ie.width,ie.height,0,0,ee.width,ee.height)};return a.default.useLayoutEffect(()=>{re()},[ee,M.width,M.height,D.x,D.y,D.width,D.height,q,B,K,M.page._exportingOrRendering,X]),a.default.useEffect(()=>()=>{ee&&ee.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(ee)},[ee]),[ee||L,re]},C=(M,L,D,B)=>{const q=_(M.clipSrc||""),[K,z]=G(q,"anonymous"),$=M.clipSrc?z:"loaded";(0,e.useImageLoader)($,M.id+"-clip");const F=a.default.useMemo(()=>{if(L&&K)return d()},[L,K]);function Y(){var X;if(!K||!L||!L.width||!L.height||!K||!K.width||!K.height||!F)return;const Q=d(),ee=Math.max(M.width/K.width*D,M.height/K.height*D);Q.width=K.width*ee,Q.height=K.height*ee,(X=Q.getContext("2d"))===null||X===void 0||X.drawImage(K,0,0,Q.width,Q.height),F.width=Math.max(L.width,1),F.height=Math.max(L.height,1);const re=F.getContext("2d");re&&(re.save(),re.drawImage(Q,0,0,L.width,L.height),h.default.Util.releaseCanvas(Q),re.globalCompositeOperation="source-in",re.drawImage(L,0,0,F.width,F.height),re.restore())}return a.default.useLayoutEffect(()=>{Y()},[F,L,K,M.width,M.height,D,...B]),[M.clipSrc&&K?F:L,Y]},R=d(),N=(0,o.observer)(({element:M})=>{const L=Math.min(30,M.width/4,M.height/4),D=a.default.useRef(null);return a.default.useEffect(()=>{const B=D.current;if(!B)return;const q=new h.default.Animation(K=>{B.rotate(((K==null?void 0:K.timeDiff)||0)/2)},B.getLayer());return q.start(),()=>{q.stop()}}),a.default.createElement(u.Group,{x:M.x,y:M.y,rotation:M.rotation,listening:!1,opacity:M.a.opacity,hideInExport:!M.showInExport},a.default.createElement(u.Rect,{width:M.width,height:M.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:D,x:M.width/2,y:M.height/2,fill:"white",outerRadius:Math.abs(L),innerRadius:Math.max(1,L-5),angle:270}))}),U=(0,o.observer)(({element:M})=>{const L="Can not load the video...",D=Math.max(10,Math.min(30,M.width/25));return a.default.createElement(u.Group,{x:M.x,y:M.y,rotation:M.rotation,listening:!1,opacity:M.a.opacity,hideInExport:!M.showInExport},a.default.createElement(u.Rect,{width:M.width,height:M.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:L,fontSize:D,width:M.width,height:M.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let G=f.default;const Z=M=>{G=M};e.setImageLoaderHook=Z;const W=(M,L)=>{const D=a.default.useRef(),B=()=>{var q;(q=D.current)===null||q===void 0||q.call(D),D.current=void 0};a.default.useEffect(()=>B,[]),a.default.useLayoutEffect(()=>{M!=="loading"||D.current||(D.current=(0,b.incrementLoader)(`video ${L}`)),M!=="loading"&&B(),M==="failed"&&(0,b.triggerLoadError)(`video ${L}`)},[M])};e.useImageLoader=W;function H(M,L,D){const B=a.default.useRef("loading"),q=a.default.useRef(null),[K,z]=a.default.useState(0),$=a.default.useRef(),F=a.default.useRef(),Y=a.default.useRef();return $.current===M&&F.current===L&&Y.current===D||(B.current="loading",q.current=void 0,$.current=M,F.current=L,Y.current=D),a.default.useLayoutEffect(function(){if(M){var X=document.createElement("video");return X.addEventListener("canplay",Q),X.addEventListener("error",ee),X.crossOrigin=L,X.src=M,function(){X.removeEventListener("canplay",Q),X.removeEventListener("error",ee)}}function Q(){B.current="loaded",q.current=X,q.current.currentTime=0,z(Math.random()),q.current.removeEventListener("canplay",Q)}function ee(re){B.current="failed",q.current=void 0,z(Math.random())}},[M,L,D]),[q.current,B.current]}e.VideoElement=(0,o.observer)(({element:M,store:L})=>{var D;const[B,q]=a.default.useState(!1),K=a.default.useRef(null),z=a.default.useRef(null),[$,F]=a.default.useState(!1),Y=L.selectedShapes.indexOf(M)>=0,[X,Q]=a.default.useState(!1),[ee,re]=H(M.src,"anonymous"),oe=L.activePage===M.page;(0,e.useImageLoader)(re,M.id+"-video"),ee&&(ee.width=ee.videoWidth,ee.height=ee.videoHeight);const ae=ee||R;a.default.useEffect(()=>{ee&&L.history.ignore(()=>{M.set({duration:1e3*ee.duration})})},[ee]),a.default.useEffect(()=>{var Le;if(!ee)return;const Ye=oe&&(L.isPlaying||X);if(!Ye)return void ee.pause();Ye&&(ee.currentTime=M.startTime*ee.duration,ee.play());const rt=new h.default.Animation(()=>{se()},(Le=K.current)===null||Le===void 0?void 0:Le.getLayer());rt.start();const Pt=()=>{Q(!1),ee.currentTime=M.startTime*ee.duration},Ct=()=>{ee.currentTime>=M.endTime*ee.duration&&(ee.pause(),ee.currentTime=M.startTime*ee.duration,Q(!1))};return ee.addEventListener("ended",Pt),ee.addEventListener("timeupdate",Ct),()=>{rt.stop(),ee.removeEventListener("ended",Pt),ee.removeEventListener("timeupdate",Ct)}},[ee,X,L.isPlaying,oe]),a.default.useEffect(()=>{ee&&(ee.volume=M.volume)},[ee,M.volume]);const ie=a.default.useRef();a.default.useEffect(()=>{const Le=(0,l.autorun)(()=>{var Ye,rt;if(ee){const Pt=(L.currentTime-M.page.startTime)%M.duration;if(Math.abs(1e3*ee.currentTime-Pt)>500||!L.isPlaying){const Ct=Pt/1e3;Ct!==ee.currentTime&&(ee.currentTime=Ct),ee.readyState!==4&&!L.isPlaying&&!ie.current&&(ie.current=(0,b.incrementLoader)(`video ${M.id}`))}se(),(rt=(Ye=K.current)===null||Ye===void 0?void 0:Ye.getLayer())===null||rt===void 0||rt.batchDraw()}});return()=>{Le(),ie.current&&(ie.current(),ie.current=null)}},[L,ee]),a.default.useEffect(()=>{if(!ee)return;const Le=()=>{var rt,Pt;ee.readyState!==4&&M.page._exportingOrRendering||ie.current&&(se(),(Pt=(rt=K.current)===null||rt===void 0?void 0:rt.getLayer())===null||Pt===void 0||Pt.batchDraw(),ie.current(),ie.current=null)};let Ye;return M.page._exportingOrRendering&&(Ye=setInterval(Le,50)),ee.addEventListener("timeupdate",Le),ee.addEventListener("canplay",Le),()=>{clearInterval(Ye),ee.removeEventListener("timeupdate",Le),ee.removeEventListener("canplay",Le)}},[M.page._exportingOrRendering,ee,M.id,b.incrementLoader]);let{cropX:Re,cropY:Me,cropWidth:ne,cropHeight:le}=M;re!=="loaded"&&(Re=Me=0,ne=le=1);const be=ae.width*ne,ye=ae.height*le,te=M.width/M.height;let de,he;const Se=be/ye,$e=M.type==="svg";$e?(de=be,he=ye):te>=Se?(de=be,he=be/te):(de=ye*te,he=ye);const tt={x:ae.width*Re,y:ae.height*Me,width:de,height:he},Ae=(D=M.cornerRadius)!==null&&D!==void 0?D:0,[Ce,Oe]=P(M,ae,tt,L._elementsPixelRatio,Ae,B||M._cropModeEnabled||M.type==="svg");let[Fe,Qe]=C(M,Ce,L._elementsPixelRatio,[tt,Ae,L._elementsPixelRatio]);function se(){Oe(),Qe()}const fe=Math.max(M.width/de,M.height/he);a.default.useEffect(()=>{var Le;if(!M._cropModeEnabled)return;const Ye=(Le=K.current)===null||Le===void 0?void 0:Le.getStage();function rt(Ct){M._cropModeEnabled&&Ct.target!==z.current&&M.toggleCropMode(!1)}function Pt(Ct){M._cropModeEnabled&&Ct.target.parentNode!==Ye.content&&M.toggleCropMode(!1)}return document.body.addEventListener("click",Pt),Ye==null||Ye.on("click",rt),Ye==null||Ye.on("tap",rt),()=>{document.body.removeEventListener("click",Pt),document.body.removeEventListener("touchstart",Pt),Ye==null||Ye.off("click",rt),Ye==null||Ye.off("click",rt)}},[M._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(B||M._cropModeEnabled))return(0,v.applyFilter)(K.current,M),(0,l.autorun)(()=>{(0,v.applyFilter)(K.current,M)},{delay:100})},[ae,B,ne,le,M._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Le;B||M._cropModeEnabled?(Le=K.current)===null||Le===void 0||Le.clearCache():(0,v.applyFilter)(K.current,M)},[B,M.width,M.height,M._cropModeEnabled]),a.default.useEffect(()=>{(0,v.applyFilter)(K.current,M)},[M.shadowEnabled,M.shadowBlur,M.cornerRadius,M.shadowColor,M.shadowOffsetX,M.shadowOffsetY,M.shadowOpacity]);const Ze=a.default.useRef(null),Je=a.default.useRef(null),_e=a.default.useRef(null);a.default.useLayoutEffect(()=>{M._cropModeEnabled&&(Je.current.nodes([Ze.current]),_e.current.nodes([z.current]))},[M._cropModeEnabled]);const xe=Le=>{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 Ye=Le.target.width()*Le.target.scaleX(),rt=Le.target.height()*Le.target.scaleY(),Pt=Math.min(1,de/Ye),Ct=Math.min(1,he/rt),en=1-Pt,qr=Math.min(en,Math.max(0,Math.round(-Le.target.x())/Ye)),_r=1-Ct,bn=Math.min(_r,Math.max(0,Math.round(-Le.target.y())/rt));Le.target.setAttrs({x:-qr*ae.width,y:-bn*ae.height,scaleX:1,scaleY:1}),M.set({cropX:qr,cropY:bn,cropWidth:Pt,cropHeight:Ct})},qe=()=>{M.type!=="svg"&&M.contentEditable&&setTimeout(()=>{M.toggleCropMode(!0)})},we=re==="loading",We=re==="failed",Ee=!we&&!We,Ke=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),rr=Ee?M.a.opacity:0;(0,g.useFadeIn)(K,rr);const gt=M.selectable||L.role==="admin",cr=(0,y.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,we&&a.default.createElement(N,{element:M}),We&&a.default.createElement(U,{element:M}),a.default.createElement(u.Image,{ref:K,name:"element",id:M.id,image:Fe,x:M.x,y:M.y,width:M.width||1,height:M.height||1,rotation:M.rotation,opacity:rr,shadowEnabled:M.shadowEnabled,shadowBlur:M.shadowBlur,shadowOffsetX:M.shadowOffsetX,shadowOffsetY:M.shadowOffsetY,shadowColor:M.shadowColor,shadowOpacity:M.shadowOpacity,customCrop:tt,listening:gt,draggable:cr?M.draggable&&Y:M.draggable,preventDefault:!cr||Y,hideInExport:!M.showInExport,onMouseEnter:()=>{F(!0)},onMouseLeave:()=>{F(!1)},onDragMove:Le=>{M.set({x:Le.target.x(),y:Le.target.y()})},onDragEnd:Le=>{M.set({x:Le.target.x(),y:Le.target.y()})},onDblClick:qe,onDblTap:qe,onTransformStart:()=>{q(!0),Ke.current={cropX:M.cropX,cropY:M.cropY,cropWidth:M.cropWidth,cropHeight:M.cropHeight}},onTransform:Le=>{var Ye;const rt=Le.currentTarget,Pt=Math.abs(rt.scaleX()-1)<1e-7?1:rt.scaleX(),Ct=Math.abs(rt.scaleY()-1)<1e-7?1:rt.scaleY();rt.scaleX(1),rt.scaleY(1);const en=(Ye=Le.target.getStage())===null||Ye===void 0?void 0:Ye.findOne("Transformer"),qr=1-de/ae.width,_r=Math.min(qr,Math.max(0,M.cropX)),bn=1-he/ae.height,Oi=Math.min(bn,Math.max(0,M.cropY)),_n=en.getActiveAnchor(),Ne=!(_n.indexOf("middle")>=0||_n.indexOf("center")>=0),nt=!Ne&&Pt<1&&Ke.current.cropHeight>he/ae.height;let mt=Ne?M.cropWidth:M.cropWidth*Pt;nt&&(mt=M.cropWidth);const Nt=!Ne&&Ct<1&&Ke.current.cropWidth>de/ae.width;let yt=Ne?M.cropHeight:M.cropHeight*Ct;Nt&&(yt=M.cropHeight),$e&&(mt=M.cropWidth,yt=M.cropHeight),M.set({cropX:_r,cropY:Oi,x:rt.x(),y:rt.y(),width:rt.width()*Pt,height:rt.height()*Ct,rotation:Le.target.rotation(),cropWidth:Math.min(mt,1-_r),cropHeight:Math.min(yt,1-Oi)})},onTransformEnd:Le=>{const Ye=Le.currentTarget;M.set({width:Ye.width(),height:Ye.height(),x:Ye.x(),y:Ye.y(),rotation:Le.target.rotation(),cropWidth:de/ae.width,cropHeight:he/ae.height}),q(!1)}}),a.default.createElement(u.Rect,{x:M.x,y:M.y,width:Math.max(M.width-M.borderSize,0),height:Math.max(M.height-M.borderSize,0),opacity:rr,offsetX:-M.borderSize/2,offsetY:-M.borderSize/2,stroke:M.borderColor,strokeWidth:M.borderSize,listening:!1,visible:!!M.borderSize,rotation:M.rotation,cornerRadius:Math.max(0,Ae-M.borderSize),hideInExport:!M.showInExport}),!X&&!L.isPlaying&&a.default.createElement(u.Image,{image:k,x:M.x+M.width/2-15/L.scale,y:M.y+M.height/2-15/L.scale,width:30/L.scale,height:30/L.scale,hideInExport:!0,onClick:()=>{Q(!0)}}),X&&!L.isPlaying&&a.default.createElement(u.Image,{image:x,x:M.x+M.width/2-15/L.scale,y:M.y+M.height/2-15/L.scale,width:30/L.scale,height:30/L.scale,hideInExport:!0,onClick:()=>{Q(!1)}}),M._cropModeEnabled&&a.default.createElement(O.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:Fe,x:M.x,y:M.y,width:M.width,height:M.height,rotation:M.rotation,shadowEnabled:M.shadowEnabled,shadowBlur:M.shadowBlur}),a.default.createElement(u.Group,{x:M.x,y:M.y,rotation:M.rotation,scaleX:fe,scaleY:fe},a.default.createElement(u.Image,{image:ae,ref:z,opacity:.4,draggable:!0,x:-M.cropX*ae.width,y:-M.cropY*ae.height,onDragMove:xe,onTransform:xe}),a.default.createElement(u.Transformer,{ref:_e,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Le,Ye)=>Ye.width<5||Ye.height<5?Le:Ye,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:de,height:he,ref:Ze,listening:!1,onTransform:Le=>{Le.target.x()<-M.cropX*ae.width-1e-9&&(Le.target.x(-M.cropX*ae.width),Le.target.scaleX(1)),Le.target.y()<-M.cropY*ae.height-1e-9&&(Le.target.y(-M.cropY*ae.height),Le.target.scaleY(1));const Ye=Math.min(1,Math.max(0,M.cropX+Le.target.x()/ae.width)),rt=Math.min(1,Math.max(0,Le.target.y()/ae.height+M.cropY)),Pt=Le.target.width()*Le.target.scaleX(),Ct=Le.target.height()*Le.target.scaleY(),en=Math.min(1-Ye,Pt/ae.width),qr=Math.min(1-rt,Ct/ae.height),_r=Le.target.getAbsolutePosition(Le.target.getParent().getParent());Le.target.scale({x:1,y:1}),Le.target.position({x:0,y:0}),M.set({x:_r.x,y:_r.y,cropX:Ye,cropY:rt,cropWidth:en,cropHeight:qr,width:Math.min(Pt*fe,ae.width*(1-Ye)*fe),height:Math.min(Ct*fe,ae.height*(1-rt)*fe)})}}),a.default.createElement(u.Transformer,{ref:Je,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Le,Ye)=>Ye.width<5||Ye.height<5?Le:Ye,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),($||Y)&&a.default.createElement(w.Highlighter,{element:M}))})})(dS);var hS={},Jp={};(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:p,height:v,cornerRadius:g})=>{if(g>0){const y=Math.min(g,p/2,v/2);return`M 0 ${y} A ${y} ${y} 0 0 1 ${y} 0 L ${p-y} 0 A ${y} ${y} 0 0 1 ${p} ${y} L ${p} ${v-y} A ${y} ${y} 0 0 1 ${p-y} ${v} L ${y} ${v} A ${y} ${y} 0 0 1 0 ${v-y} Z`}return`M 0 0 L ${p} 0 L ${p} ${v} L 0 ${v} Z`};e.rectData=t;const r=({width:p,height:v})=>`M ${p/2} 0 L ${p} ${v} L 0 ${v} Z`;e.triangleData=r;const n=({width:p,height:v})=>`M 0 0 L ${p} 0 L 0 ${v} Z`;e.rightTriangleData=n;const i=({width:p,height:v})=>`M ${p/2} ${v/2} m -${p/2}, 0 a ${p/2},${v/2} 0 1,0 ${p},0 a ${p/2},${v/2} 0 1,0 -${p},0`;function a({width:p,height:v}){const g=p/2,y=v/2,d=p/2,m=v/2,_=d/2,k=m/2;let x="",A=Math.PI/5;for(let S=0;S<10;S++){const P=S%2==0?m:k,C=g+(S%2==0?d:_)*Math.sin(S*A),R=y-P*Math.cos(S*A);S===0?x=`M ${C} ${R}`:x+=` L ${C} ${R}`}return x+" Z"}function o({width:p,height:v}){const g=p/2,y=v/2;return`M ${g} 0 L ${p} ${y} L ${g} ${v} L 0 ${y} Z`}function l({width:p,height:v}){const g=p/2,y=v/2,d=p/2,m=v/2;let _="",k=2*Math.PI/5;for(let x=0;x<5;x++){const A=m,S=g+d*Math.sin(x*k),P=y-A*Math.cos(x*k);x===0?_=`M ${S} ${P}`:_+=` L ${S} ${P}`}return _+" Z"}function u({width:p,height:v}){const g=p/2,y=v/2,d=p/2,m=v/2;let _="",k=2*Math.PI/6;for(let x=0;x<6;x++){const A=m,S=g+d*Math.sin(x*k),P=y-A*Math.cos(x*k);x===0?_=`M ${S} ${P}`:_+=` L ${S} ${P}`}return _+" Z"}function f({path:p,aspectRatio:v,width:g,height:y}){return{path:p,scaleX:g/v.width,scaleY:y/v.height}}function h({width:p,height:v}){const g=.1*Math.min(p,v),y=.2*p,d=.2*v,m=.5*p;let _=`M ${g},0`;return _+=" H "+(p-g),_+=` A ${g},${g} 0 0 1 ${p},${g}`,_+=" V "+(v-g-d),_+=` A ${g},${g} 0 0 1 ${p-g},${v-d}`,_+=` H ${m+y/2}`,_+=` L ${m},${v}`,_+=` L ${m-y/2},${v-d}`,_+=` H ${g}`,_+=` A ${g},${g} 0 0 1 0,${v-g-d}`,_+=` V ${g}`,_+=` A ${g},${g} 0 0 1 ${g},0`,_+=" Z",_}function O({width:p,height:v}){const g=.3*p,y=.3*v,d=p/2,m=v/2,_=d-g/2,k=d+g/2,x=m-y/2,A=m+y/2;let S=`M ${_},0 `;return S+=`H ${k} `,S+=`V ${x} `,S+=`H ${p} `,S+=`V ${A} `,S+=`H ${k} `,S+=`V ${v} `,S+=`H ${_} `,S+=`V ${A} `,S+="H 0 ",S+=`V ${x} `,S+=`H ${_} `,S+="V 0 ",S+="Z",S}function w(p){return e.TYPES[p]||e.rectData}function b(p,v){const{width:g,height:y,fill:d,stroke:m,strokeWidth:_,dash:k}=p,x=(k||[]).map(R=>R*_);let A=v(p),S=1,P=1;typeof A!="string"&&(S=A.scaleX,P=A.scaleY,A=A.path);const C=`clip-${p.id||Math.random()}`;return`
|
|
235
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${g}" height="${y}">
|
|
236
|
+
<defs>
|
|
237
|
+
<clipPath id="${C}">
|
|
238
|
+
<path d="${A}" />
|
|
239
|
+
</clipPath>
|
|
240
|
+
</defs>
|
|
241
|
+
|
|
242
|
+
<!-- Path for the fill -->
|
|
243
|
+
<path d="${A}" fill="${d}" transform="scale(${S}, ${P})"/>
|
|
244
|
+
|
|
245
|
+
<!-- Path for the stroke, clipped by the star path -->
|
|
246
|
+
<path d="${A}" fill="none" stroke="${m}" stroke-width="${2*_}" clip-path="url(#${C})" transform="scale(${S}, ${P})" stroke-dasharray="${x.join(" ")}"/>
|
|
247
|
+
</svg>
|
|
248
|
+
`}function E(p){const{subType:v}=p,g=w(v);return g?b(p,g):(console.error(`Polotno error: Can not convert ${p.subType} figure to svg.`),(0,e.rectData)(p))}e.circleData=i,e.starPath=a,e.diamondPath=o,e.pentagonPath=l,e.hexagonPath=u,e.speechBubblePath=h,e.crossPath=O,e.TYPES={rect:e.rectData,circle:e.circleData,star:a,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:o,pentagon:l,hexagon:u,speechBubble:h,cross:O,arc:({width:p,height:v})=>f({path:"M234 117C234 85.97 221.673 56.21 199.731 34.269C177.79 12.327 148.03 0 117 0C85.97 0 56.2103 12.327 34.2685 34.268C12.3268 56.21 0 85.97 0 117H117H234Z",aspectRatio:{width:234,height:117},width:p,height:v}),cloud:({width:p,height:v})=>f({path:"M216.41 57.006C216.961 54.084 217.249 51.069 217.249 47.986C217.249 21.4841 195.972 0 169.725 0C153.666 0 139.467 8.043 130.865 20.3575C122.606 13.3566 111.954 9.1402 100.327 9.1402C74.3322 9.1402 53.2123 30.2136 52.8094 56.364H52.8035C23.6407 56.364 0 80.235 0 109.682C0 139.129 23.6407 163 52.8035 163H208.197C237.359 163 261 139.129 261 109.682C261 83.056 241.672 60.99 216.41 57.006Z",aspectRatio:{width:261,height:163},width:p,height:v}),rightArrow:({width:p,height:v})=>{const g=.6*p;return`M 0 ${v/4} L ${g} ${v/4} L ${g} 0 L ${p} ${v/2} L ${g} ${v} L ${g} ${.75*v} L 0 ${.75*v} Z`},leftArrow:({width:p,height:v})=>{const g=.4*p;return`M ${p} ${v/4} L ${g} ${v/4} L ${g} 0 L 0 ${v/2} L ${g} ${v} L ${g} ${.75*v} L ${p} ${.75*v} Z`},downArrow:({width:p,height:v})=>{const g=.6*v;return`M ${p/4} 0 L ${p/4} ${g} L 0 ${g} L ${p/2} ${v} L ${p} ${g} L ${.75*p} ${g} L ${.75*p} 0 Z`},upArrow:({width:p,height:v})=>{const g=.4*v;return`M ${p/4} ${v} L ${p/4} ${g} L 0 ${g} L ${p/2} 0 L ${p} ${g} L ${.75*p} ${g} L ${.75*p} ${v} Z`},asterisk1:({width:p,height:v})=>f({path:"M45.5265 218.498C51.5466 222.87 58.5359 224.98 65.4742 224.98C75.916 224.98 86.221 220.2 92.853 211.217C92.872 211.198 92.89 211.178 92.907 211.157C92.923 211.136 92.939 211.115 92.954 211.094L92.977 211.061C92.993 211.039 93.008 211.017 93.023 210.996L116.491 178.725L139.959 210.996C139.982 211.031 140.006 211.058 140.029 211.088C140.04 211.102 140.05 211.116 140.061 211.132C151.115 226.188 172.355 229.505 187.473 218.515C202.608 207.526 205.992 186.278 195.074 171.104L195.05 171.066C195.03 171.034 195.014 171.01 194.989 170.985L171.572 138.696L209.512 126.346C227.334 120.545 237.129 101.305 231.33 83.476C225.532 65.648 206.315 55.8493 188.476 61.6334L150.537 73.933L150.52 34.0064C150.502 15.2594 135.248 0 116.508 0C97.768 0 82.514 15.2594 82.497 34.0234L82.463 73.916L44.5233 61.6163C44.5083 61.6163 44.49 61.613 44.4716 61.6078C44.4477 61.6014 44.4232 61.5918 44.4041 61.5823C26.5992 55.8664 7.45076 65.665 1.66886 83.46C-4.11314 101.254 5.61427 120.426 23.3511 126.278C23.3675 126.283 23.3822 126.289 23.3963 126.295L23.4588 126.319L23.4873 126.329L61.4098 138.679L37.9929 170.968C37.9844 170.985 37.9718 171.002 37.9591 171.019C37.9462 171.036 37.9336 171.053 37.9251 171.07C26.9903 186.244 30.3915 207.509 45.5265 218.498Z",aspectRatio:{width:233,height:225},width:p,height:v}),asterisk2:({width:p,height:v})=>f({path:"M46.0556 112L0 85.388L33.9456 26.6121L80.028 53.1781L80.054 0H147.946L147.972 53.1781L194.054 26.6121L228 85.388L181.944 112L228 138.612L194.054 197.388L147.972 170.822L147.946 224H80.054L80.028 170.822L33.9456 197.388L0 138.612L46.0556 112Z",aspectRatio:{width:228,height:224},width:p,height:v}),bookmark:({width:p,height:v})=>f({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:p,height:v}),butterfly:({width:p,height:v})=>f({path:"M94.5 100.713C91.935 150.916 50.703 190.909 0 191.493V0C50.703 0.5845 91.935 40.5767 94.5 90.78C97.031 41.2385 137.217 1.6407 187 0.0438004V191.45C137.217 189.853 97.031 150.255 94.5 100.713Z",aspectRatio:{width:187,height:192},width:p,height:v}),cylinder:({width:p,height:v})=>f({path:"M169 36.8497V218.15C169 238.502 131.168 255 84.5 255C37.832 255 0 238.502 0 218.15V36.8497C0 16.4982 37.832 0 84.5 0C131.168 0 169 16.4982 169 36.8497Z",aspectRatio:{width:169,height:255},width:p,height:v}),diamond2:({width:p,height:v})=>f({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:p,height:v}),door:({width:p,height:v})=>f({path:"M140 69.697C140 31.2044 108.66 0 70 0C31.34 0 0 31.2044 0 69.697V207H140V69.697Z",aspectRatio:{width:140,height:207},width:p,height:v}),drop1:({width:p,height:v})=>f({path:"M167 150.687C167 196.328 129.407 234 83.139 234C37.593 234 0 196.328 0 150.687C0 100.7 51.329 36.9474 83.139 0C114.948 39.1207 167 98.526 167 150.687Z",aspectRatio:{width:167,height:234},width:p,height:v}),drop2:({width:p,height:v})=>f({path:"M73 239C53.64 239 35.071 231.315 21.3812 217.634C7.691 203.954 0 185.4 0 166.054C0 136.091 13.8696 113.633 30.768 86.27C43.912 64.9877 58.888 40.7377 70.597 7.6816C71.281 5.7496 72.989 0 72.989 0C72.989 0 72.993 0.0124998 73 0.0363998C73.007 0.0124998 73.011 0 73.011 0C73.011 0 74.719 5.7496 75.403 7.6816C87.112 40.7377 102.088 64.9877 115.232 86.27C132.13 113.633 146 136.091 146 166.054C146 185.4 138.309 203.954 124.619 217.634C111.025 231.218 92.225 239 73 239Z",aspectRatio:{width:146,height:239},width:p,height:v}),explosion:({width:p,height:v})=>f({path:"M165.802 184.465L118.997 260L125.343 182.079L34.9058 219.45L99.164 159.817L0 163.792L78.538 134.373L0 74.7401L86.471 89.052V0L118.997 89.052L165.802 10.3364L149.143 97.798L217.368 29.419L165.802 112.905L245.927 81.101L165.802 143.914H261L165.802 184.465Z",aspectRatio:{width:261,height:260},width:p,height:v}),flag:({width:p,height:v})=>f({path:"M0 142.161C0 142.161 51.9956 118.626 103 137.469C159.992 158.525 206 141.31 206 141.31V11.1373C206 11.1373 160 28.3218 103.016 7.28273C52 -11.553 0 12.0974 0 12.0974V142.161Z",aspectRatio:{width:206,height:148},width:p,height:v}),flower:({width:p,height:v})=>f({path:"M135.351 66.1893C196.683 -5.00591 256.536 100.304 164.908 117.361C256.536 135.16 195.944 239.728 135.351 168.532C166.386 257.526 45.9394 256.785 76.975 168.532C15.643 239.728 -44.2109 135.16 47.4173 117.361C-44.9498 100.304 15.643 -4.26431 76.975 66.1893C45.2005 -22.0631 166.386 -22.0631 135.351 66.1893ZM105.793 104.012C113.183 104.012 119.833 109.945 119.833 117.361C119.833 124.777 113.183 131.452 105.793 131.452C98.404 131.452 92.492 124.777 92.492 117.361C92.492 109.945 98.404 104.012 105.793 104.012Z",aspectRatio:{width:212,height:235},width:p,height:v}),frame:({width:p,height:v})=>f({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:p,height:v}),heart1:({width:p,height:v})=>f({path:"M215.886 56.157C215.886 24.729 191.112 0 160.584 0C135.933 0 115.08 16.983 107.937 39.93C100.788 16.986 79.935 0.591 55.284 0.591C24.75 0.591 0 24.615 0 56.055C0 71.919 6.321 83.127 16.494 95.121L107.988 189.447L199.377 95.121C209.559 83.127 215.886 72.009 215.886 56.157Z",aspectRatio:{width:216,height:190},width:p,height:v}),home:({width:p,height:v})=>f({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:p,height:v}),home2:({width:p,height:v})=>f({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:p,height:v}),hourglass:({width:p,height:v})=>f({path:"M0.392782 0H187.607C193.014 43.3688 140.804 53.797 140.804 97.5C140.804 141.203 193.014 151.631 187.607 195H0.392782C-5.01452 151.631 47.196 141.203 47.196 97.5C47.196 53.797 -5.01452 43.3688 0.392782 0Z",aspectRatio:{width:188,height:195},width:p,height:v}),house:({width:p,height:v})=>f({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:p,height:v}),keyhole:({width:p,height:v})=>f({path:"M115 57.0494C115 25.5387 89.416 0 57.863 0C26.311 0 0.726898 25.5414 0.726898 57.0494C0.726898 78.652 12.759 97.451 30.505 107.136L0 219H114.845L84.448 107.524C102.608 97.962 115 78.959 115 57.0494Z",aspectRatio:{width:115,height:219},width:p,height:v}),kiss:({width:p,height:v})=>f({path:"M124.5 17.1468C80.036 -36.5162 0 52.9218 0 52.9218C0 52.9218 44.4643 120 124.5 120C204.536 120 249 52.9218 249 52.9218C249 52.9218 168.964 -36.5162 124.5 17.1468Z",aspectRatio:{width:249,height:120},width:p,height:v}),leaf:({width:p,height:v})=>f({path:"M204.414 0.0151567C204.414 0.0151567 206.837 93.9509 150.394 150.394C93.9507 206.837 0.0151569 204.413 0.0151569 204.413C0.0151569 204.413 -2.40835 110.478 54.0347 54.0349C110.478 -2.40834 204.414 0.0151567 204.414 0.0151567Z",aspectRatio:{width:205,height:205},width:p,height:v}),lightning1:({width:p,height:v})=>f({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:p,height:v}),lightning2:({width:p,height:v})=>f({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:p,height:v}),magnet:({width:p,height:v})=>f({path:"M88.402 0H0V67.669H88.402C105.271 67.669 118.957 81.308 118.957 98C118.957 114.689 105.271 128.331 88.402 128.331H0V196H88.402C142.747 196 187 152.072 187 98C187 43.9279 142.747 0 88.402 0Z",aspectRatio:{width:187,height:196},width:p,height:v}),mithosis:({width:p,height:v})=>f({path:"M150.996 136.45C137.141 128.926 117.559 128.7 103.532 135.896C93.843 140.867 82.875 143.67 71.2577 143.67C31.9033 143.67 0 111.508 0 71.835C0 32.161 31.9033 0 71.2577 0C83.467 0 94.959 3.0955 105.004 8.5504C118.859 16.0745 138.441 16.3 152.467 9.1038C162.157 4.1328 173.125 1.3303 184.742 1.3303C224.097 1.3303 256 33.492 256 73.165C256 112.839 224.097 145 184.742 145C172.533 145 161.041 141.905 150.996 136.45Z",aspectRatio:{width:256,height:145},width:p,height:v}),orangeRicky:({width:p,height:v})=>f({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:p,height:v}),party:({width:p,height:v})=>f({path:"M134.622 0L144.682 68.2539L174.415 5.9977L163.91 74.1846L210.671 23.4578L180.535 85.519L240.169 50.8289L193.079 101.25L260.29 85.679L200.43 119.98L269.245 124.911L201.934 140.044L266.237 165.04L197.456 159.661L251.535 202.5L187.396 177.086L226.445 233.962L172.646 190.771L193.197 256.631L154.518 199.501L154.743 268.492L134.622 202.5L114.501 268.492L114.727 199.501L76.0482 256.631L96.5985 190.771L42.7992 233.962L81.8489 177.086L17.7091 202.5L71.7885 159.661L3.0072 165.04L67.3112 140.044L0 124.911L68.8149 119.98L8.9545 85.679L76.1658 101.25L29.0753 50.8289L88.7105 85.519L58.5743 23.4578L105.335 74.1846L94.8305 5.9977L124.562 68.2539L134.622 0Z",aspectRatio:{width:270,height:269},width:p,height:v}),pillow:({width:p,height:v})=>f({path:"M176 0.00169945C157.812 16.9062 125.203 28.174 88.001 28.174C50.798 28.174 18.1881 16.9054 0 0V258.421C18.1882 241.516 50.798 230.248 88 230.248C125.202 230.248 157.812 241.516 176 258.421V0.00169945Z",aspectRatio:{width:176,height:259},width:p,height:v}),polygon:({width:p,height:v})=>f({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:p,height:v}),rainbow:({width:p,height:v})=>f({path:"M186.907 141H282C282 63.128 218.872 0 141 0C63.1278 0 0 63.128 0 141H95.093C95.093 115.646 115.646 95.093 141 95.093C166.354 95.093 186.907 115.646 186.907 141Z",aspectRatio:{width:282,height:141},width:p,height:v}),rhodeIsland:({width:p,height:v})=>f({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:p,height:v}),shell:({width:p,height:v})=>f({path:"M109 0C169.199 0 218 48.743 218 108.87C185.392 108.87 158.958 135.273 158.958 167.842C158.958 179.736 158.958 191 158.958 191H59.042C59.042 191 59.042 179.736 59.042 167.842C59.042 135.273 32.6077 108.87 0 108.87C0 48.743 48.8007 0 109 0Z",aspectRatio:{width:218,height:191},width:p,height:v}),shield1:({width:p,height:v})=>f({path:"M203.184 30.7277C142.457 30.7277 102.853 0 102.853 0C102.853 0 63.249 30.7277 3.05098 30.7277C3.05098 30.7277 -3.81372 128.209 3.05098 162.115C9.38758 193.902 102.853 249 102.853 249C102.853 249 196.319 193.902 203.184 162.115C209.52 128.738 203.184 30.7277 203.184 30.7277Z",aspectRatio:{width:206,height:249},width:p,height:v}),shield2:({width:p,height:v})=>f({path:"M0 12.9585C64.624 -4.3195 136.376 -4.3195 201 12.9585C201 51.0564 201 89.154 201 127.252C201 184.396 100.498 240 100.498 240C100.498 240 0 184.406 0 127.252C0 89.154 0 51.0564 0 12.9585Z",aspectRatio:{width:201,height:240},width:p,height:v}),skewedRectangle:({width:p,height:v})=>f({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:p,height:v}),softFlower:({width:p,height:v})=>f({path:"M109 0C80.073 0 56.6234 23.4498 56.6234 52.3766C56.6234 54.722 54.722 56.6234 52.3766 56.6234C23.4498 56.6234 0 80.073 0 109C0 137.927 23.4498 161.377 52.3766 161.377C54.722 161.377 56.6234 163.278 56.6234 165.623C56.6234 194.55 80.073 218 109 218C137.927 218 161.377 194.55 161.377 165.623C161.377 163.278 163.278 161.377 165.623 161.377C194.55 161.377 218 137.927 218 109C218 80.073 194.55 56.6234 165.623 56.6234C163.278 56.6234 161.377 54.722 161.377 52.3766C161.377 23.4498 137.927 0 109 0Z",aspectRatio:{width:218,height:218},width:p,height:v}),softStar:({width:p,height:v})=>f({path:"M130.424 3.17662C130.927 -1.05888 137.073 -1.05888 137.576 3.17662L141.792 38.7086C147.236 84.59 183.41 120.764 229.291 126.208L264.823 130.424C269.059 130.927 269.059 137.073 264.823 137.576L229.291 141.792C183.41 147.236 147.236 183.41 141.792 229.291L137.576 264.823C137.073 269.059 130.927 269.059 130.424 264.823L126.208 229.291C120.764 183.41 84.59 147.236 38.7086 141.792L3.17662 137.576C-1.05888 137.073 -1.05888 130.927 3.17662 130.424L38.7086 126.208C84.59 120.764 120.764 84.59 126.208 38.7086L130.424 3.17662Z",aspectRatio:{width:268,height:268},width:p,height:v}),stairs1:({width:p,height:v})=>f({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:p,height:v}),stairs2:({width:p,height:v})=>f({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:p,height:v}),teewee:({width:p,height:v})=>f({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:p,height:v}),blob1:({width:p,height:v})=>f({path:"M172.979 19.611C191.285 33.0858 204.505 54.442 210.861 78.5949C217.471 103.002 217.471 130.46 205.776 151.816C194.335 173.427 171.454 189.444 147.047 196.054C122.639 202.919 96.7069 200.631 75.3506 190.715C54.2486 180.546 37.7229 163.003 23.4855 142.155C9.5022 121.307 -2.19289 97.4087 0.349524 74.7813C3.14617 52.1538 19.9261 30.7976 40.2654 17.8313C60.6046 4.61077 84.5033 -0.474048 108.148 0.0344341C131.538 0.542916 154.928 6.13621 172.979 19.611Z",aspectRatio:{width:216,height:200},width:p,height:v}),blob10:({width:p,height:v})=>f({path:"M188.684 8.95173C205.601 24.3309 200.988 63.0866 191.453 99.3816C182.225 135.677 168.076 169.511 146.238 175.355C124.399 181.507 94.871 159.668 66.5733 143.059C37.9679 126.449 10.5929 115.068 2.59569 95.0754C-5.4015 75.0824 5.97912 46.1694 24.4342 30.4826C42.8893 14.7958 68.4188 12.0276 100.715 6.79864C132.704 1.5697 171.767 -6.42749 188.684 8.95173Z",aspectRatio:{width:200,height:177},width:p,height:v}),blob11:({width:p,height:v})=>f({path:"M137.368 29.4923C148.97 46.7605 146.542 72.1231 148.161 99.1046C149.779 126.086 155.715 154.956 144.113 174.383C132.781 193.81 103.911 203.793 80.4369 198.666C56.963 193.27 38.6156 173.034 28.3626 153.607C17.8398 134.181 15.4115 115.833 9.47555 91.5498C3.53961 67.2664 -5.63411 37.3169 4.61887 20.0488C15.1417 2.51078 45.0911 -1.80626 72.8821 0.622074C100.673 2.78059 126.036 12.2241 137.368 29.4923Z",aspectRatio:{width:152,height:200},width:p,height:v}),blob12:({width:p,height:v})=>f({path:"M158.391 17.923C172.491 28.5703 180.261 48.1384 187.743 70.5842C194.937 93.3177 202.419 118.641 194.649 138.785C187.167 158.928 164.146 173.317 138.535 184.54C112.923 196.05 84.4347 204.108 58.8235 197.777C33.2123 191.446 10.191 170.439 2.99688 146.267C-4.48504 121.807 3.57241 94.181 10.4788 68.282C17.0974 42.0953 22.565 17.6352 37.8166 7.27563C53.0682 -3.37171 78.1038 0.081487 100.837 2.67138C123.859 5.26127 144.29 7.27563 158.391 17.923Z",aspectRatio:{width:198,height:200},width:p,height:v}),blob13:({width:p,height:v})=>f({path:"M149.668 1.37595C170.663 5.22017 193.728 17.3442 198.755 34.7911C204.078 52.2379 191.363 75.3032 178.943 93.9329C166.819 112.563 154.99 126.757 140.501 145.386C126.011 164.312 108.86 187.673 92.5957 186.194C76.3317 185.011 60.9549 159.285 45.8737 140.655C30.4968 122.321 15.7114 110.788 7.43151 95.1157C-0.848339 79.4432 -2.32688 59.0392 3.5873 41.5924C9.50148 23.8498 23.1041 8.76868 38.7767 3.44592C54.745 -1.87685 73.3746 2.55879 91.7086 2.26308C110.338 2.26308 128.968 -2.17256 149.668 1.37595Z",aspectRatio:{width:200,height:187},width:p,height:v}),blob14:({width:p,height:v})=>f({path:"M137.838 28.6426C150.711 40.5617 165.014 46.5213 178.363 58.2021C191.474 69.8828 203.87 87.0464 198.864 99.6807C193.858 112.315 171.689 120.42 157.862 135.676C144.275 151.171 139.269 173.579 126.873 182.161C114.477 190.505 94.9294 185.022 76.8123 178.109C58.4568 171.196 41.5316 163.091 28.1822 150.456C14.5943 137.822 4.58225 120.42 1.24488 101.826C-2.09248 83.2322 1.00651 62.9697 13.8792 52.4809C26.7519 41.992 49.1598 41.0385 65.6083 30.788C82.0567 20.5376 92.0688 0.990158 103.034 0.0366268C113.762 -0.916905 125.204 16.9618 137.838 28.6426Z",aspectRatio:{width:200,height:187},width:p,height:v}),blob15:({width:p,height:v})=>f({path:"M185.203 1.52939C197.679 7.62217 200 32.2835 200 51.7223C200 71.1612 197.389 85.3777 197.679 100.175C198.259 114.681 201.741 129.768 198.259 143.114C194.778 156.46 184.623 168.356 171.567 173.868C158.801 179.671 143.134 179.091 130.368 174.739C117.312 170.387 106.867 162.263 86.8482 160.812C66.539 159.362 36.9454 164.294 18.9572 155.3C0.968966 146.306 -5.41395 123.095 5.03083 105.977C15.4756 88.5692 42.4579 77.5442 55.5139 59.5559C68.2798 41.8578 67.1192 17.4867 76.9837 9.6531C86.5581 2.10965 107.158 11.3939 128.627 9.6531C150.097 8.20244 172.728 -4.27327 185.203 1.52939Z",aspectRatio:{width:200,height:179},width:p,height:v}),blob16:({width:p,height:v})=>f({path:"M158.441 55.3221C167.253 80.2399 160.264 105.462 147.501 134.938C134.738 164.717 116.81 199.055 97.0576 199.967C77.3057 201.182 55.7305 168.668 34.4592 133.722C13.1879 99.0802 -7.77953 62.3112 2.85612 36.4818C13.4918 10.6523 56.0344 -3.93369 90.0685 0.928322C123.799 6.09421 149.324 30.7081 158.441 55.3221Z",aspectRatio:{width:163,height:200},width:p,height:v}),blob17:({width:p,height:v})=>f({path:"M168.917 36.7587C178.871 53.2457 175.138 76.5764 172.961 106.129C170.472 135.37 169.85 170.832 150.563 187.63C131.276 204.739 93.3252 203.495 65.0173 187.63C36.7095 172.077 18.0449 142.213 7.77943 107.373C-2.79714 72.2213 -4.35252 32.7147 14.312 14.0502C32.9765 -4.3033 72.1721 -1.50361 103.591 4.7179C135.32 10.6283 158.962 20.2717 168.917 36.7587Z",aspectRatio:{width:176,height:200},width:p,height:v}),blob18:({width:p,height:v})=>f({path:"M178.188 21.1464C193.012 36.3069 196.381 62.9219 198.739 88.1893C200.76 113.12 201.771 136.366 190.316 149.168C178.862 162.307 155.279 164.665 135.065 167.697C115.188 170.73 99.0168 174.098 72.4018 177.131C46.1237 180.163 9.40176 182.521 1.65309 168.371C-6.09559 154.221 15.4659 123.564 23.5515 92.9059C31.6371 62.2481 26.2467 31.2534 38.3751 15.4192C50.1665 -0.0781831 79.8136 -1.08888 107.776 0.595609C136.076 1.9432 163.028 5.64909 178.188 21.1464Z",aspectRatio:{width:200,height:180},width:p,height:v}),blob19:({width:p,height:v})=>f({path:"M148.621 13.3857C171.945 24.3818 194.937 41.3756 192.938 60.702C190.605 80.3615 163.282 101.687 149.953 123.346C136.958 145.005 137.958 166.664 128.295 174.661C118.631 182.325 98.3054 175.994 73.6476 181.991C48.9899 187.989 20.0004 205.983 11.0036 197.986C1.67366 189.989 12.6697 156.001 12.3365 131.343C12.0033 106.685 0.340809 91.0243 0.00759636 75.0301C-0.325616 59.0359 10.3372 42.3753 25.3318 28.7135C39.9931 15.0518 58.9863 4.05578 80.3119 1.05687C101.638 -2.27526 124.962 2.38972 148.621 13.3857Z",aspectRatio:{width:194,height:200},width:p,height:v}),blob2:({width:p,height:v})=>f({path:"M140.464 18.6393C156.081 28.3718 169.887 39.9149 178.714 54.853C187.541 69.5649 191.389 87.6717 189.578 104.421C187.768 121.396 180.525 137.239 172.377 153.535C164.455 169.832 155.854 186.58 142.048 194.276C128.241 201.971 109.456 200.613 92.4804 197.671C75.2789 194.502 60.1144 189.749 45.1762 182.733C30.4644 175.716 16.2052 166.21 8.28346 153.083C0.361703 139.729 -1.44898 122.527 1.04072 106.91C3.30408 91.2931 9.64147 76.8076 15.9789 60.5114C22.0899 44.2153 28.201 26.1084 40.6495 14.7916C53.0979 3.24849 71.8838 -1.27823 89.7643 0.306124C107.871 1.66414 124.846 9.13322 140.464 18.6393Z",aspectRatio:{width:191,height:200},width:p,height:v}),blob20:({width:p,height:v})=>f({path:"M150.035 13.2464C157.376 24.9386 153.026 48.323 157.92 65.7254C163.087 83.1277 177.498 94.2761 182.392 108.415C187.287 122.555 182.392 139.957 173.147 156.272C163.63 172.587 149.763 187.814 132.089 195.155C114.414 202.225 93.2053 201.137 73.6276 194.611C54.3219 188.357 36.9196 176.937 25.7712 161.438C14.8947 145.667 10.5441 126.09 5.92163 105.696C1.57105 85.0311 -3.05145 63.5501 2.65869 45.0601C8.64075 26.5701 24.6835 11.0711 43.1735 4.54524C61.6635 -1.98064 82.6007 0.194657 102.722 1.01039C122.844 1.82613 142.421 1.55421 150.035 13.2464Z",aspectRatio:{width:185,height:200},width:p,height:v}),blob21:({width:p,height:v})=>f({path:"M152.611 0.184799C172.596 -0.723643 197.73 1.39606 199.85 13.8114C201.969 26.2268 181.075 48.9379 174.716 68.0151C168.357 87.0924 176.533 102.536 174.11 114.649C171.991 127.064 159.575 136.148 146.252 139.782C132.928 143.719 118.696 141.902 105.977 139.176C93.562 136.451 82.6606 132.212 63.2805 131.909C43.9004 131.606 16.0416 135.24 5.44306 125.853C-5.15543 116.465 1.50648 94.0572 10.2881 76.4939C18.7669 59.2335 29.6682 46.8182 38.7526 35.3112C48.1398 23.5015 56.3158 12.903 66.9143 8.36078C77.5128 4.12138 91.1394 6.24108 104.766 5.63546C118.696 4.72701 132.928 1.09324 152.611 0.184799Z",aspectRatio:{width:200,height:143},width:p,height:v}),blob22:({width:p,height:v})=>f({path:"M195.507 15.5715C206.818 33.1668 193.622 69.3001 190.166 101.663C186.71 134.34 193.308 163.561 181.996 178.014C170.685 192.153 141.464 191.525 114.443 189.326C87.1072 187.44 62.2852 183.67 40.6052 169.531C19.2395 155.077 1.6441 130.255 0.0730908 103.862C-1.18372 77.4694 13.898 49.5054 35.2638 31.91C56.6296 14.0004 84.5936 6.45958 116.328 2.37494C148.063 -1.70969 184.196 -2.3381 195.507 15.5715Z",aspectRatio:{width:200,height:191},width:p,height:v}),blob23:({width:p,height:v})=>f({path:"M135.742 9.14189C157.815 19.2326 179.258 38.4681 176.105 56.7576C172.951 74.7317 145.202 92.0751 127.858 109.734C110.83 127.077 104.523 145.052 87.4953 164.918C70.4672 184.468 42.7177 206.227 27.5816 198.343C12.4455 190.46 9.60747 153.566 6.45411 126.762C2.98542 100.274 -0.798607 84.1917 0.147399 67.1636C0.77807 50.4508 6.76944 32.4767 19.0675 20.8093C31.0503 9.14189 49.6551 3.78119 70.4672 1.2585C90.964 -1.26418 113.668 -0.633508 135.742 9.14189Z",aspectRatio:{width:177,height:200},width:p,height:v}),blob24:({width:p,height:v})=>f({path:"M165.663 24.3715C171.555 44.4059 158.003 76.2254 151.816 96.2598C145.923 116.294 147.691 124.544 148.28 135.445C148.575 146.346 147.396 159.309 140.62 170.8C133.549 181.996 120.88 191.424 104.381 196.432C87.8821 201.441 67.553 202.03 54.8841 192.602C41.9207 183.469 36.6174 164.023 25.1271 143.105C13.3421 122.187 -4.33535 99.7953 0.967891 85.0641C6.27113 70.6275 34.2604 63.8511 56.0626 48.5307C77.5702 33.5048 92.8907 9.93489 113.22 2.56928C133.843 -4.79633 159.77 4.04241 165.663 24.3715Z",aspectRatio:{width:168,height:200},width:p,height:v}),blob25:({width:p,height:v})=>f({path:"M180.115 1.256C192.651 2.1962 189.83 34.163 190.771 58.2947C191.711 82.4265 196.098 98.4099 198.606 117.214C201.113 136.018 201.426 157.642 189.204 165.791C177.294 173.626 153.163 167.671 135.299 163.91C117.749 159.836 106.466 157.956 85.7818 162.97C65.0974 168.298 35.3244 180.521 18.7143 174.253C1.79068 167.985 -1.97012 142.913 0.850478 120.975C3.67107 99.0367 13.0731 79.6059 18.4009 54.8473C23.7287 30.0888 24.9823 -0.310996 40.0254 0.00240332C54.7552 0.00240332 82.9612 31.029 111.167 31.029C139.373 31.029 167.579 0.315802 180.115 1.256Z",aspectRatio:{width:200,height:176},width:p,height:v}),blob26:({width:p,height:v})=>f({path:"M142.571 0.586925C159.976 3.39414 176.258 15.1844 184.96 30.9048C193.662 46.6253 194.224 66.8372 189.171 83.6805C183.837 100.805 172.327 114.56 163.064 129.157C153.8 143.755 146.501 158.914 134.43 173.231C122.359 187.828 105.516 201.303 89.5146 199.899C73.2327 198.776 58.0738 182.775 42.9148 169.862C28.0366 157.23 13.7198 147.685 6.42103 134.491C-0.877729 121.297 -1.15845 103.892 1.64876 88.4528C4.45598 72.7324 10.0704 58.6963 18.4921 47.4674C27.1944 36.2386 38.4233 27.8169 50.4943 22.2025C62.846 16.3073 75.7592 13.5001 91.1989 8.72785C106.919 4.23631 125.166 -1.93957 142.571 0.586925Z",aspectRatio:{width:193,height:200},width:p,height:v}),blob27:({width:p,height:v})=>f({path:"M112.602 54.9337C129.225 71.8646 155.391 78.9448 158.777 89.719C162.471 100.493 143.693 114.654 127.07 135.586C110.447 156.519 96.2866 184.224 71.0442 194.998C46.1096 205.465 10.4008 199.308 2.0893 178.375C-6.22223 157.443 12.5557 121.734 18.4045 92.1817C24.5612 62.6296 17.7889 38.9263 26.4082 21.9954C34.7197 5.06454 58.423 -5.40183 73.5069 2.9097C88.8986 10.9134 95.9788 38.0028 112.602 54.9337Z",aspectRatio:{width:160,height:200},width:p,height:v}),blob28:({width:p,height:v})=>f({path:"M125.281 68.5835C142.15 82.9923 165.344 90.021 181.862 108.998C198.028 127.624 207.516 158.902 192.405 166.634C177.293 174.716 137.581 159.605 112.629 156.442C87.326 152.928 77.1344 161.713 59.9142 165.579C43.0453 169.445 19.1478 168.391 11.7677 157.496C4.73907 146.25 14.2278 124.813 11.4163 94.2382C8.2534 63.6634 -6.85825 23.9514 3.68476 8.48836C14.2278 -7.32615 50.4254 1.10826 73.9715 16.2199C97.5175 31.683 108.412 54.1747 125.281 68.5835Z",aspectRatio:{width:200,height:169},width:p,height:v}),blob29:({width:p,height:v})=>f({path:"M162.987 10.2348C169.16 25.1809 154.864 58.6471 147.066 79.4417C139.268 100.236 138.293 108.359 134.719 114.532C131.47 120.706 125.297 124.93 119.448 143.45C113.6 161.97 107.426 194.461 98.004 199.335C88.5814 204.209 75.5849 181.14 55.7651 167.494C35.6203 153.522 8.65241 148.648 1.8292 135.327C-4.994 122.33 8.65241 100.561 20.0244 82.041C31.3964 63.5208 40.1691 48.2498 53.4906 35.5782C66.8122 22.9065 84.0326 13.159 106.452 6.33584C128.871 -0.812285 156.489 -4.71127 162.987 10.2348Z",aspectRatio:{width:165,height:200},width:p,height:v}),blob3:({width:p,height:v})=>f({path:"M158.095 64.2637C176.543 95.19 192.277 129.1 181.697 155.686C171.117 182.001 133.951 201.533 99.4982 199.905C64.7739 198.549 33.0338 176.032 15.4004 145.377C-2.23296 114.994 -5.75963 76.2002 10.2461 46.6303C26.2518 17.0605 61.5185 -3.557 89.732 0.512241C118.217 4.58149 139.377 33.0662 158.095 64.2637Z",aspectRatio:{width:186,height:200},width:p,height:v}),blob30:({width:p,height:v})=>f({path:"M146.076 34.4585C157.052 54.582 155.833 80.1936 164.675 100.622C173.212 121.355 191.201 136.905 189.372 149.711C187.542 162.212 165.285 171.969 146.99 175.018C129.001 178.372 114.671 174.713 103.39 175.018C92.1083 175.018 83.876 178.982 66.8015 186.299C49.7271 193.617 23.8105 204.288 14.3586 198.19C4.90665 191.787 11.6145 168.615 10.3949 147.882C8.87037 127.148 -0.581561 108.549 0.0282404 89.3407C0.638042 70.1319 11.6145 50.6182 28.384 32.934C44.8487 15.5546 67.4113 0.309578 89.974 0.00467694C112.537 -0.300224 135.099 14.335 146.076 34.4585Z",aspectRatio:{width:190,height:200},width:p,height:v}),blob31:({width:p,height:v})=>f({path:"M134.218 44.0392C153.568 36.4264 184.97 26.9105 195.755 33.2544C206.222 39.9156 195.755 62.1194 181.481 76.3933C166.89 90.35 148.175 96.0596 145.638 116.36C143.1 136.661 156.74 171.235 151.664 183.923C146.589 196.928 123.434 187.413 105.036 178.531C86.6388 169.967 73.3165 161.72 52.0643 158.548C30.812 155.058 1.62986 156.644 0.0438693 145.225C-1.22492 133.806 25.4197 109.382 29.2261 86.8609C32.7152 64.3398 13.6834 44.0392 11.7802 26.9105C9.877 9.46461 24.7853 -4.80928 42.5484 1.53467C59.9942 7.87863 79.9777 34.5232 93.6172 45.308C107.257 56.4099 114.869 51.3347 134.218 44.0392Z",aspectRatio:{width:200,height:191},width:p,height:v}),blob32:({width:p,height:v})=>f({path:"M200 100.339C200 149.831 145.763 197.966 95.5932 197.966C45.7627 197.966 0 149.831 0 100.339C0 50.8475 45.7627 0 95.5932 0C145.763 0 200 50.8475 200 100.339Z",aspectRatio:{width:200,height:198},width:p,height:v}),blob4:({width:p,height:v})=>f({path:"M183.427 38.712C198.21 63.2519 196.141 95.1833 189.341 126.523C182.836 157.863 171.305 188.908 150.609 197.482C130.208 205.76 100.642 192.16 69.8936 177.968C39.4405 164.072 7.80478 150.176 1.30024 128.593C-5.2043 107.01 13.718 77.7393 35.3012 51.7211C56.5888 25.9986 81.1287 3.23272 108.921 0.276112C137.009 -2.38484 168.349 14.4678 183.427 38.712Z",aspectRatio:{width:195,height:200},width:p,height:v}),blob5:({width:p,height:v})=>f({path:"M166.251 30.6913C183.816 48.5185 195.875 71.8512 199.021 98.8542C202.429 125.595 197.186 155.744 179.359 169.115C161.794 182.223 131.645 178.815 103.331 176.979C75.0171 175.144 48.8006 174.882 29.6625 161.512C10.7866 148.141 -0.748681 121.925 0.0378149 96.2326C0.824311 70.8025 14.1947 46.159 33.0706 28.3318C52.2087 10.5045 76.8522 -0.5064 100.971 0.0179307C125.091 0.804426 148.423 12.864 166.251 30.6913Z",aspectRatio:{width:200,height:179},width:p,height:v}),blob6:({width:p,height:v})=>f({path:"M149.146 50.5452C161.911 68.0278 171.901 81.9028 176.619 97.9979C181.336 114.37 180.781 133.241 173.011 149.891C165.519 166.541 151.366 180.693 133.051 189.851C114.736 199.008 92.2586 202.893 71.446 197.621C50.6334 192.348 30.9308 177.918 18.1658 158.216C5.12323 138.791 -0.981801 113.815 0.128204 87.7304C1.51571 61.6453 10.6733 34.1726 29.2658 17.5226C48.1359 1.14999 76.996 -4.40004 98.9186 3.6475C120.841 11.695 136.381 32.7851 149.146 50.5452Z",aspectRatio:{width:180,height:200},width:p,height:v}),blob7:({width:p,height:v})=>f({path:"M158.662 41.8295C178.593 57.8305 204.138 64.5677 213.402 79.7266C222.666 94.6047 215.367 118.466 203.015 135.028C190.383 151.871 172.698 161.977 156.416 168.434C140.134 174.89 124.975 177.697 104.483 185.277C83.9903 192.856 58.1642 205.208 44.9704 197.629C31.4959 190.33 31.2152 163.1 21.9514 138.116C12.9684 112.851 -4.71688 90.1132 1.17822 75.5158C7.35404 61.1991 36.8295 55.5847 58.7256 40.1452C80.9024 24.7056 95.4998 -0.278374 109.816 0.00234533C124.414 0.283064 138.45 25.8285 158.662 41.8295Z",aspectRatio:{width:218,height:200},width:p,height:v}),blob8:({width:p,height:v})=>f({path:"M153.53 11.0108C168.179 18.1858 181.931 29.5461 192.993 44.4939C203.755 59.4417 212.425 78.2759 210.631 96.5122C209.136 114.748 197.477 132.088 182.529 142.252C167.581 152.716 148.747 156.004 128.717 168.262C108.687 180.22 87.1622 201.147 69.8228 199.951C52.7823 198.456 39.6283 174.54 32.4533 153.015C25.2784 131.49 24.0826 112.357 16.6087 91.131C9.13477 70.2041 -4.31825 46.8855 1.36191 31.9377C7.04207 16.691 31.8554 9.51607 52.7823 5.33069C73.4103 0.846349 90.4507 -0.648433 106.594 0.248435C123.037 1.1453 138.882 4.13486 153.53 11.0108Z",aspectRatio:{width:211,height:200},width:p,height:v}),blob9:({width:p,height:v})=>f({path:"M140.289 20.2182C156.96 27.7956 176.661 32.0895 189.29 43.9608C201.667 55.5796 206.718 75.0283 202.424 91.6987C198.131 108.622 184.491 122.766 175.651 140.952C166.81 158.885 162.769 180.607 150.393 191.216C138.016 201.824 117.052 201.572 98.866 197.025C80.6802 192.479 65.2727 183.891 48.3497 175.808C31.4268 167.726 13.2409 160.148 5.1583 146.761C-2.67172 133.122 -0.398493 113.673 4.14797 96.7504C8.69444 80.08 15.5141 65.6828 23.3442 52.296C31.4268 38.6566 40.5197 25.775 52.6436 15.6717C65.0201 5.82101 80.6802 -1.50385 95.3299 0.264221C109.98 1.77971 123.619 12.6407 140.289 20.2182Z",aspectRatio:{width:204,height:200},width:p,height:v})},e.subTypeToPathDataFunc=w,e.figureToSvg=E})(Jp);(function(e){var t=me&&me.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=t(et),n=Jn,i=Ma,a=Jp,o=Tl,l=Ao,u=Xc,f={};e.FigureElement=(0,n.observer)(({element:h,store:O})=>{const w=h.selectable||O.role==="admin",b=(0,l.isTouchDevice)(),[E,p]=r.default.useState(!1),v=O.selectedShapes.indexOf(h)>=0,g=Math.min(h.strokeWidth,h.width/2,h.height/2),y=Math.max(0,Math.min(h.width/2,h.height/2,h.cornerRadius)),d=(0,u.useColor)(h,h.a.fill,"fill"),m=Object.assign(Object.assign({width:h.a.width,height:h.a.height},d),{cornerRadius:y,opacity:h.animated("opacity"),shadowEnabled:h.shadowEnabled,shadowBlur:h.shadowBlur,shadowOffsetX:h.shadowOffsetX,shadowOffsetY:h.shadowOffsetY,shadowColor:h.shadowColor,shadowOpacity:h.shadowOpacity,preventDefault:!b||v,hideInExport:!h.showInExport}),_=(0,u.useColor)(h,h.stroke,"stroke"),k=Object.assign(Object.assign({visible:g>0,x:g/2,y:g/2,width:h.a.width-g,height:h.a.height-g},_),{strokeWidth:g,cornerRadius:Math.max(0,y-g),dash:h.dash.map(P=>P*g),opacity:h.animated("opacity"),hideInExport:!h.showInExport,listening:!1}),x=(A=h.subType,f[A]||(f[A]=(S=(0,a.subTypeToPathDataFunc)(A),(0,n.observer)(({element:P,fillProps:C,strokeProps:R})=>{let N=S({width:P.a.width,height:P.a.height,cornerRadius:P.cornerRadius}),U=1,G=1;typeof N!="string"&&(U=N.scaleX,G=N.scaleY,N=N.path);const Z=r.default.useRef(null);return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Rect,{width:P.width,height:P.height,fill:"transparent"}),r.default.createElement(i.Path,Object.assign({},C,{ref:Z,data:N,scaleX:U,scaleY:G})),r.default.createElement(i.Group,{clipFunc:W=>{const H=Z.current;if(H){var M=H.dataArray;W.beginPath();for(var L=0;L<M.length;L++){var D=M[L].command,B=M[L].points;switch(D){case"L":W.lineTo(B[0],B[1]);break;case"M":W.moveTo(B[0],B[1]);break;case"C":W.bezierCurveTo(B[0],B[1],B[2],B[3],B[4],B[5]);break;case"Q":W.quadraticCurveTo(B[0],B[1],B[2],B[3]);break;case"A":var q=B[0],K=B[1],z=B[2],$=B[3],F=B[4],Y=B[5],X=B[6],Q=B[7],ee=z>$?z:$,re=z>$?1:z/$,oe=z>$?$/z:1;W.translate(q,K),W.rotate(X),W.scale(re,oe),W.arc(0,0,ee,F,F+Y,1-Q),W.scale(1/re,1/oe),W.rotate(-X),W.translate(-q,-K);break;case"z":W.closePath()}}}},scaleX:U,scaleY:G},r.default.createElement(i.Path,Object.assign({},R,{x:0,y:0,data:N,strokeWidth:2*R.strokeWidth,dash:R.dash.map(W=>W)}))))}))),f[A]||i.Group);var A,S;return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Group,{id:h.id,x:h.a.x,y:h.a.y,rotation:h.a.rotation,opacity:h.a.opacity,listening:w,draggable:b?h.draggable&&v:h.draggable,name:"element",onMouseEnter:()=>{p(!0)},onMouseLeave:()=>{p(!1)},onDragMove:P=>{h.set({x:P.target.x(),y:P.target.y()})},onDragEnd:P=>{h.set({x:P.target.x(),y:P.target.y()})},onTransform:P=>{const C=P.target.scale();P.target.scaleX(1),P.target.scaleY(1),h.set({width:h.width*C.x,height:h.height*C.y,x:P.target.x(),y:P.target.y(),rotation:P.target.rotation()})}},r.default.createElement(x,{element:h,fillProps:m,strokeProps:k})),(E||v)&&r.default.createElement(o.Highlighter,{element:h}))})})(hS);(function(e){var t=me&&me.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=void 0;const r=t(et),n=Jn,i=Zy,a=d2,o=iS,l=fS,u=dS,f=hS,h=Ma,O=Xn,w=(0,n.observer)(v=>{const{element:g,store:y}=v,{children:d}=g,m=g.selectable||y.role==="admin";return r.default.createElement(h.Group,{opacity:g.opacity,listening:m,hideInExport:!g.showInExport},d.map(_=>r.default.createElement(p,Object.assign({},v,{key:_.id,store:y,element:_}))))}),b={text:i.TextElement,image:a.ImageElement,svg:a.ImageElement,line:l.LineElement,video:u.VideoElement,figure:f.FigureElement,group:w};function E(v,g){b[v]=g}e.registerShapeComponent=E;const p=(0,n.observer)(v=>{let g=b[v.element.type];return v.element.type==="text"&&O.flags.htmlRenderEnabled&&(g=o.HTMLElement),v.element.visible?g?r.default.createElement(g,Object.assign({},v)):(console.error("Can not find component for "+v.element.type),null):null});e.default=p})(K9);var pS={};(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})(pS);var $g={},Gg={},S_;function fj(){return S_||(S_=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=E2();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,m)=>{n[d]||(n[d]=!0,console.error(m))},a=`API for iconscout is provided as a demonstration.
|
|
249
|
+
For production usage you have to use your own API endpoint.
|
|
250
|
+
https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
|
|
251
|
+
https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:d,page:m=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${d}&per_page=20&page=${m}&KEY=${(0,t.getKey)()}`,unsplashDownload:d=>`${(0,e.getAPI)()}/download-unsplash?id=${d}&KEY=${(0,t.getKey)()}`,svgapiList:({query:d,page:m=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${d}&page=${m}&per_page=20&KEY=${(0,t.getKey)()}`,svgapiDownload:d=>`${(0,e.getAPI)()}/download-svgapi?path=${d}&KEY=${(0,t.getKey)()}`,iconscoutList:({query:d,page:m=1})=>(i("iconscout",a),`${(0,e.getAPI)()}/get-iconscout?query=${d}&page=${m}&KEY=${(0,t.getKey)()}`),iconscoutDownload:d=>(i("iconscout",a),`${(0,e.getAPI)()}/download-iconscout?uuid=${d}&KEY=${(0,t.getKey)()}`),nounProjectList:({query:d,page:m=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${d}&page=${m}&KEY=${(0,t.getKey)()}`,nounProjectDownload:d=>`${(0,e.getAPI)()}/download-nounproject?id=${d}&KEY=${(0,t.getKey)()}`,templateList:({query:d,page:m=1,sizeQuery:_})=>`${(0,e.getAPI)()}/get-templates?${_}&query=${d}&per_page=30&page=${m}&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/${m=d,_=" ",k="-",m.replace(new RegExp(_,"g"),k)}.png`;var m,_,k};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 h=d=>e.URLS.templateList(d);e.templateList=h;const O=()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,t.getKey)()}`;e.textTemplateList=O;const w=d=>e.URLS.unsplashList(d);e.unsplashList=w;const b=d=>e.URLS.unsplashDownload(d);e.unsplashDownload=b;const E=d=>e.URLS.svgapiList(d);e.svgapiList=E;const p=d=>e.URLS.svgapiDownload(d);e.svgapiDownload=p;const v=d=>e.URLS.iconscoutList(d);e.iconscoutList=v;const g=d=>e.URLS.iconscoutDownload(d);e.iconscoutDownload=g;const y=(d,m)=>{e.URLS[d]=m};e.setAPI=y}(Gg)),Gg}var E_;function E2(){return E_||(E_=1,function(e){var t=me&&me.__createBinding||(Object.create?function(k,x,A,S){S===void 0&&(S=A);var P=Object.getOwnPropertyDescriptor(x,A);P&&!("get"in P?!x.__esModule:P.writable||P.configurable)||(P={enumerable:!0,get:function(){return x[A]}}),Object.defineProperty(k,S,P)}:function(k,x,A,S){S===void 0&&(S=A),k[S]=x[A]}),r=me&&me.__setModuleDefault||(Object.create?function(k,x){Object.defineProperty(k,"default",{enumerable:!0,value:x})}:function(k,x){k.default=x}),n=me&&me.__importStar||function(k){if(k&&k.__esModule)return k;var x={};if(k!=null)for(var A in k)A!=="default"&&Object.prototype.hasOwnProperty.call(k,A)&&t(x,k,A);return r(x,k),x};Object.defineProperty(e,"__esModule",{value:!0}),e.validateKey=e.isKeyPaid=e.getKey=e.shouldShowCredit=void 0;const i=n(Xi),a=fj(),o=Xn;e.shouldShowCredit=i.observable({value:!1});const l=i.action(()=>{e.shouldShowCredit.value=!0});let u="";const f=()=>u||"";e.getKey=f;const h=5,O=3e3,w="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",b="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",E="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",p="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let v=window.location.origin;const g=navigator.userAgent.indexOf("Headless")>-1,y=navigator.userAgent.indexOf("Electron")>-1;v==="file://"&&g&&(v="headless"),v==="file://"&&y&&(v="electron");const d=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${v}" here: https://polotno.com/cabinet`;async function m(k){for(let x=0;x<h;x++)try{const A=await fetch((0,a.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:k,site:location.host})});if(!k)return console.warn(w),!1;if(A.status!==200){await new Promise(P=>setTimeout(P,O));continue}const S=await A.json();return S.is_valid||console.warn(b),S.is_paid||console.log(p,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),S.is_domain_valid||console.log(d,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,o.useRemoveBackground)(S.remove_background_enabled),S.is_paid||!1}catch{await new Promise(S=>setTimeout(S,O))}return console.error(E),!0}async function _(k,x){u=k,await m(k)&&!x||l()}e.isKeyPaid=m,e.validateKey=_}($g)),$g}var e0={};(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})(e0);(function(e){var t=me&&me.__rest||function(H,M){var L={};for(var D in H)Object.prototype.hasOwnProperty.call(H,D)&&M.indexOf(D)<0&&(L[D]=H[D]);if(H!=null&&typeof Object.getOwnPropertySymbols=="function"){var B=0;for(D=Object.getOwnPropertySymbols(H);B<D.length;B++)M.indexOf(D[B])<0&&Object.prototype.propertyIsEnumerable.call(H,D[B])&&(L[D[B]]=H[D[B]])}return L},r=me&&me.__importDefault||function(H){return H&&H.__esModule?H:{default:H}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.registerTransformerAttrs=e.setTransformerStyle=void 0;const n=r(et),i=Jn,a=Xi,o=Ma,l=r(Kp),u=r(Ei),f=r(K9),h=S2,O=d2,w=pS,b=E2(),E=iu,p=e0,v=Xn,g=Ao,y=u.default.DD._drag;window.removeEventListener("mousemove",y),u.default.DD._drag=function(H){(0,a.runInAction)(()=>{y.call(this,H)})},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 m=d.toCanvas({pixelRatio:2,width:20,height:20}),_={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:H=>{H.hasName("rotater")&&H.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:m,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},k=H=>{Object.assign(_,H)};e.setTransformerStyle=k;const x={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},line:{enabledAnchors:[],borderEnabled:!1,rotateEnabled:!1},image:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},many:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},group:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]}};function A(H,M){x[H]=x[H]||M,Object.assign(x[H],M)}e.registerTransformerAttrs=A;const S=H=>n.default.createElement(o.Rect,Object.assign({},H,{preventDefault:!1})),P=H=>{var{url:M}=H,L=t(H,["url"]);const[D,B]=(0,l.default)(M,"anonymous"),q=D?(0,w.getCrop)(D,{width:L.width,height:L.height},"center-middle"):{};return(0,O.useImageLoader)(B,"background"),n.default.createElement(o.Image,Object.assign({image:D},L,q))},C=H=>n.default.createElement(o.Rect,Object.assign({},H)),R=H=>{const{background:M,scale:L,borderColor:D}=H,B=t(H,["background","scale","borderColor"]),q=n.default.useMemo(()=>!!u.default.Util.colorToRGBA(M),[M]),K=n.default.useMemo(()=>{const z=document.createElement("canvas"),$=30;z.width=60,z.height=60;const F=z.getContext("2d");return F&&(F.fillStyle="black",F.fillRect($,0,$,$),F.fillRect(0,$,$,$)),z},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:K},B,{opacity:.1,hideInExport:!0})),q?n.default.createElement(C,Object.assign({fill:M},B)):n.default.createElement(P,Object.assign({url:M},B)))},N=(0,i.observer)(({selection:H})=>H.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(H.x1,H.x2),y:Math.min(H.y1,H.y2),width:Math.abs(H.x1-H.x2),height:Math.abs(H.y1-H.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),U=(0,i.observer)(({x:H,y:M,width:L,height:D,rotation:B,anchor:q,store:K})=>{const z=(0,E.getClientRect)({x:H,y:M,width:L,height:D,rotation:u.default.Util.radToDeg(B)});if(q===void 0)return null;const $=(D/2+70)*Math.cos(B-Math.PI/2),F=(D/2+70)*Math.sin(B-Math.PI/2),Y=(0,p.pxToUnitRounded)({unit:K.unit,dpi:K.dpi,px:L/K.scale,precious:K.unit==="px"?0:1})+" x "+(0,p.pxToUnitRounded)({unit:K.unit,dpi:K.dpi,px:D/K.scale,precious:K.unit==="px"?0:1})+(K.unit==="px"?"":" "+K.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(z.minX+z.maxX)/2+$,y:(z.minY+z.maxY)/2+F,offsetX:14,offsetY:14,visible:q==="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(u.default.Util.radToDeg(B)).toString()+"°"})),n.default.createElement(o.Label,{x:(z.minX+z.maxX)/2,y:z.maxY+20,visible:q!=="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})))}),G=(0,i.observer)(({elements:H,store:M})=>{const L=H.filter(B=>B.alwaysOnTop),D=H.filter(B=>!B.alwaysOnTop).concat(L);return n.default.createElement(n.default.Fragment,null,D.map(B=>n.default.createElement(f.default,{key:B.id,store:M,element:B,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let Z=null;const W=H=>{Z=H};e.registerNextDomDrop=W,e.default=(0,i.observer)(({store:H,page:M,width:L,height:D,pageControlsEnabled:B,backColor:q,pageBorderColor:K,activePageBorderColor:z,components:$,bleedColor:F,altCloneEnabled:Y})=>{const X=H.bleedVisible?M.bleed:0,Q=M.computedWidth+2*X,ee=M.computedHeight+2*X,re=(L-Q*H.scale)/2,oe=(D-ee*H.scale)/2,ae=n.default.useRef(null),ie=n.default.useRef(null),Re=n.default.useRef(null),Me=B==null||B,[ne,le]=n.default.useState(null),[be,ye]=n.default.useState({}),te=H.selectedElements.find(_e=>_e._cropModeEnabled),de=H.selectedShapes.filter(_e=>!_e.resizable).length>0,he=H.selectedShapes.filter(_e=>!_e.draggable).length>0,Se=H.selectedElements.filter(_e=>!_e.visible).length>0;n.default.useLayoutEffect(()=>{var _e,xe,qe;if(!ae.current)return;const we=ae.current.getStage(),We=H.selectedShapes.map(Ke=>Ke._cropModeEnabled?null:we.findOne("#"+Ke.id)).filter(Ke=>Ke),Ee=H.selectedElements.length===1&&((_e=H.selectedElements[0])===null||_e===void 0?void 0:_e.type)||"many";x[Ee]?(ae.current.setAttrs(Object.assign(Object.assign({},_),x[Ee])),Ee!=="svg"&&Ee!=="image"||H.selectedElements[0].keepRatio||ae.current.setAttrs({enabledAnchors:_.enabledAnchors}),Ee==="text"&&v.flags.textVerticalResizeEnabled&&ae.current.setAttrs({enabledAnchors:(xe=x.text.enabledAnchors)===null||xe===void 0?void 0:xe.concat(["bottom-center"])})):ae.current.setAttrs(_),de&&ae.current.enabledAnchors([]),he&&ae.current.rotateEnabled(!1),We.find(Ke=>Ke==null?void 0:Ke.isDragging())&&We.forEach(Ke=>{Ke.isDragging()||Ke==null||Ke.startDrag()}),ae.current.nodes(We),(qe=ae.current.getLayer())===null||qe===void 0||qe.batchDraw()},[H.selectedElements,te,de,Se,he]);const $e=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),tt=n.default.useRef(!1),Ae=(0,g.isTouchDevice)(),Ce=(0,a.action)(_e=>{var xe,qe;if(Ae)return;tt.current=!1;const we=_e.target.findAncestor(".elements-container"),We=_e.target.findAncestor("Transformer"),Ee=_e.target.findAncestor(".page-abs-container");if(we||We||Ee)return;const Ke=(xe=_e.target.getStage())===null||xe===void 0?void 0:xe.getPointerPosition();Ke&&($e.visible=!0,$e.x1=Ke.x,$e.y1=Ke.y,$e.x2=Ke.x,$e.y2=Ke.y,((qe=_e.target.getStage())===null||qe===void 0?void 0:qe.getPointersPositions().length)>=2&&($e.visible=!1))});n.default.useEffect(()=>{const _e=(0,a.action)(qe=>{var we,We;if(!$e.visible)return;(we=ie.current)===null||we===void 0||we.setPointersPositions(qe);let Ee=((We=ie.current)===null||We===void 0?void 0:We.getPointerPosition())||{x:$e.x2,y:$e.y2};$e.x2=Ee.x,$e.y2=Ee.y}),xe=(0,a.action)(()=>{if(!$e.visible||!ie.current)return;const qe=ie.current.findOne(".selection"),we=qe?qe.getClientRect():{width:0,height:0,x:0,y:0};if(we.width&&we.height){const We=[];ie.current.find(".element").forEach(Ke=>{const rr=Ke.getClientRect(),gt=H.getElementById(Ke.id()),cr=gt==null?void 0:gt.draggable,Le=gt==null?void 0:gt.selectable;u.default.Util.haveIntersection(we,rr)&&cr&&Le&&We.push(gt.top.id)});const Ee=[...new Set(We)];H.selectElements(Ee)}$e.visible=!1,tt.current=!0});return window.addEventListener("mousemove",_e),window.addEventListener("touchmove",_e),window.addEventListener("mouseup",xe),window.addEventListener("touchend",xe),()=>{window.removeEventListener("mousemove",_e),window.removeEventListener("touchmove",_e),window.removeEventListener("mouseup",xe),window.removeEventListener("touchend",xe)}},[]);const Oe=n.default.useRef(!1);n.default.useEffect(()=>{var _e;let xe;const qe=(_e=Re.current)===null||_e===void 0?void 0:_e.closest(".polotno-workspace-inner"),we=()=>{Oe.current=!0,clearTimeout(xe),xe=setTimeout(()=>{Oe.current=!1},300)};return qe.addEventListener("scroll",we),()=>{clearTimeout(xe),qe.removeEventListener("scroll",we)}},[]);const Fe=_e=>{if(H.activePage!==M&&M.select(),Oe.current||tt.current)return;const xe=_e.evt.ctrlKey||_e.evt.metaKey||_e.evt.shiftKey,qe=_e.target.findAncestor(".elements-container"),we=_e.target.findAncestor(".page-abs-container"),We=_e.target.findAncestor("Transformer");if(!(xe||qe||We||we))return void H.selectElements([]);const Ee=_e.target.findAncestor(".element",!0),Ke=H.getElementById(Ee==null?void 0:Ee.id()),rr=Ke==null?void 0:Ke.top,gt=rr==null?void 0:rr.id,cr=H.selectedElementsIds.indexOf(gt)>=0;gt&&xe&&!cr?H.selectElements(H.selectedElementsIds.concat([gt])):gt&&xe&&cr?H.selectElements(H.selectedElementsIds.filter(Le=>Le!==gt)):!gt||xe||cr||H.selectElements([gt])};(0,h.useSnap)(ae,H);const Qe=H.activePage===M,se=$==null?void 0:$.PageControls,fe=$==null?void 0:$.Tooltip,Ze=1/H.scale,Je=0/H.scale;return n.default.createElement("div",{ref:Re,onDragOver:_e=>_e.preventDefault(),onDrop:_e=>{if(_e.preventDefault(),!ie.current)return;ie.current.setPointersPositions(_e);const xe=ie.current.findOne(".elements-container").getRelativePointerPosition(),qe=ie.current.getPointerPosition(),we=ie.current.getAllIntersections(qe).map(Ke=>Ke.findAncestor(".element",!0)).filter(Boolean),We=[...new Set(we.reverse())].map(Ke=>H.getElementById(Ke.id())),Ee=We[0];Z&&(Z(xe,Ee,{elements:We,page:M}),Z=null)},style:{position:"relative",width:L+"px"},className:"polotno-page-container"+(Qe?" active-page":"")},n.default.createElement(o.Stage,{ref:ie,width:Math.min(L,4*window.innerWidth),height:Math.min(D,4*window.innerHeight),onClick:Fe,onTap:Fe,onMouseDown:Ce,onMouseMove:_e=>{if(!_e.evt.altKey&&ne)return void le(null);if(!_e.evt.altKey)return;const xe=_e.target.findAncestor(".element",!0),qe=xe==null?void 0:xe.id();if(!H.selectedElements[0]||H.selectedElementsIds.includes(qe))return;const we=(0,E.getTotalClientRect)(H.selectedShapes),We=qe?H.getElementById(qe):{x:0,y:0,width:M.computedWidth,height:M.computedHeight,rotation:0},Ee=(0,E.getClientRect)(We),Ke=[];we.minX>Ee.maxX&&Ke.push({distance:we.minX-Ee.maxX,box1:we,box2:Ee,points:[{x:we.minX,y:we.minY+we.height/2},{x:Ee.maxX,y:we.minY+we.height/2},{x:Ee.maxX,y:Ee.minY+Ee.height/2}]}),we.maxX<Ee.minX&&Ke.push({distance:Ee.minX-we.maxX,box1:we,box2:Ee,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Ee.minX,y:we.minY+we.height/2},{x:Ee.minX,y:Ee.minY+Ee.height/2}]}),we.minY>Ee.maxY&&Ke.push({box1:we,box2:Ee,distance:we.minY-Ee.maxY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Ee.maxY},{x:Ee.minX+Ee.width/2,y:Ee.maxY}]}),we.maxY<Ee.minY&&Ke.push({box1:we,box2:Ee,distance:Ee.minY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Ee.minY},{x:Ee.minX+Ee.width/2,y:Ee.minY}]}),we.minX>=Ee.minX&&we.maxX<=Ee.maxX&&we.minY>=Ee.minY&&we.maxY<=Ee.maxY&&(Ke.push({distance:we.minX-Ee.minX,box1:we,box2:Ee,points:[{x:we.minX,y:we.minY+we.height/2},{x:Ee.minX,y:we.minY+we.height/2},{x:Ee.minX,y:Ee.minY+Ee.height/2}]}),Ke.push({distance:Ee.maxX-we.maxX,box1:we,box2:Ee,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Ee.maxX,y:we.minY+we.height/2},{x:Ee.maxX,y:Ee.minY+Ee.height/2}]}),Ke.push({box1:we,box2:Ee,distance:we.minY-Ee.minY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Ee.minY},{x:Ee.minX+Ee.width/2,y:Ee.minY}]}),Ke.push({box1:we,box2:Ee,distance:Ee.maxY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Ee.maxY},{x:Ee.minX+Ee.width/2,y:Ee.maxY}]})),JSON.stringify(ne)!==JSON.stringify(Ke)&&le(Ke)},onDragStart:_e=>{var xe;const qe=_e.target.findAncestor(".element",!0);if(qe){const we=H.getElementById(qe==null?void 0:qe.id()),We=we==null?void 0:we.top,Ee=We==null?void 0:We.id;!(H.selectedElementsIds.indexOf(Ee)>=0)&&Ee&&(H.selectElements([Ee]),_e.target.stopDrag(),_e.target.startDrag(_e),(xe=ae.current)===null||xe===void 0||xe.startDrag(_e))}ne&&le(null)},pageId:M.id,style:{position:"relative"}},n.default.createElement(o.Layer,null,n.default.createElement(S,{width:L,height:D,fill:q}),n.default.createElement(o.Group,{x:re,y:oe,scaleX:H.scale,scaleY:H.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(R,{x:-M.bleed,y:-M.bleed,width:M.computedWidth+2*M.bleed,height:M.computedHeight+2*M.bleed,background:M.background,name:"page-background",preventDefault:!1,scale:H.scale})),n.default.createElement(o.Group,{x:X,y:X,name:"elements-container",listening:!H.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:M.computedWidth,height:M.computedHeight,listening:!1}),n.default.createElement(G,{elements:M.children,store:H})),n.default.createElement(o.Rect,{stroke:F,name:"bleed",strokeWidth:M.bleed,x:M.bleed/2,y:M.bleed/2,width:M.computedWidth+M.bleed,height:M.computedHeight+M.bleed,listening:!1,visible:M.bleed>0&&H.bleedVisible,hideInExport:!0}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,L,0,L,D,0,D,0,0,re,oe,re,D-oe,L-re,D-oe,L-re,oe,re,oe],listening:!1,closed:!0,fill:q}),n.default.createElement(o.Group,{x:re,y:oe,scaleX:H.scale,scaleY:H.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-Ze/2-Je,y:-Ze/2-Je,width:Q+Ze+2*Je,height:ee+Ze+2*Je,stroke:Qe&&H.pages.length>1?z:K,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:re+X*H.scale,y:oe+X*H.scale,scaleX:H.scale,scaleY:H.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:ae,onDragStart:_e=>{var xe;!((xe=_e.evt)===null||xe===void 0)&&xe.altKey&&Y&&H.selectedElements.forEach(qe=>{const we=qe.clone({},{skipSelect:!0}),We=M.children.indexOf(qe);M.setElementZIndex(we.id,We)}),H.history.startTransaction()},onDragEnd:()=>{H.history.endTransaction()},onTransformStart:()=>{H.history.startTransaction()},boundBoxFunc:(_e,xe)=>{const qe=Math.abs(xe.width)<1||Math.abs(xe.height)<1,we=Math.abs(_e.width)<1||Math.abs(_e.height)<1;return qe&&!we?_e:xe},onTransform:_e=>{var xe,qe;const we=ae.current.nodes(),We=we[we.length-1];if(_e.target!==We)return;const Ee=(xe=ae.current)===null||xe===void 0?void 0:xe.__getNodeRect(),Ke=(qe=ae.current)===null||qe===void 0?void 0:qe.getActiveAnchor();ye({anchor:Ke,x:Ee.x,y:Ee.y,rotation:Ee.rotation,width:Ee.width,height:Ee.height})},onTransformEnd:_e=>{ye({}),H.history.endTransaction()},visible:!H.isPlaying}),ne&&ne.map(({points:_e,distance:xe,box1:qe,box2:we},We)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:We,listening:!1},n.default.createElement(o.Rect,Object.assign({},qe,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Rect,Object.assign({},we,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[_e[0].x,_e[0].y,_e[1].x,_e[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[_e[1].x,_e[1].y,_e[2].x,_e[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(_e[0].x+_e[1].x)/2,y:(_e[0].y+_e[1].y)/2,offsetY:-10,scaleX:1/H.scale,scaleY:1/H.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,p.pxToUnitString)({unit:H.unit,dpi:H.dpi,px:xe})})))),M._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:Q,height:ee,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:Q,height:ee,align:"center",verticalAlign:"middle"})),fe&&n.default.createElement(fe,{components:$,store:H,page:M,stageRef:ie})),n.default.createElement(U,Object.assign({},be,{store:H})),n.default.createElement(N,{selection:$e}),b.shouldShowCredit.value&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:L-170,y:D-18,onMouseEnter:_e=>{_e.target.getStage().container().style.cursor="pointer"},onMouseLeave:_e=>{_e.target.getStage().container().style.cursor=""},onTouchStart:_e=>{_e.cancelBubble=!0},onMouseDown:_e=>{_e.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),Me&&Qe&&se&&n.default.createElement(se,{store:H,page:M,xPadding:re,yPadding:oe}))})})(r9);var gS={};(function(e){var t=me&&me.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(e,"__esModule",{value:!0}),e.LeftRules=e.TopRules=void 0;const r=t(et),n=iu,i=e0,a=Jn,o=w2,l=(0,o.styled)("div",r.default.forwardRef)`
|
|
252
|
+
position: absolute;
|
|
253
|
+
top: 0;
|
|
254
|
+
left: 0;
|
|
255
|
+
pointer-events: none;
|
|
256
|
+
`,u=(0,o.styled)("div",r.default.forwardRef)`
|
|
257
|
+
height: 14px;
|
|
258
|
+
position: sticky;
|
|
259
|
+
font-size: 8px;
|
|
260
|
+
line-height: 14px;
|
|
261
|
+
top: 0;
|
|
262
|
+
left: 0;
|
|
263
|
+
color: grey;
|
|
264
|
+
border-bottom: 1px solid grey;
|
|
265
|
+
background-color: #e8e8e8;
|
|
266
|
+
overflow: hidden;
|
|
267
|
+
`,f=(0,o.styled)("div",r.default.forwardRef)`
|
|
268
|
+
left: 0;
|
|
269
|
+
width: 14px;
|
|
270
|
+
position: sticky;
|
|
271
|
+
font-size: 8px;
|
|
272
|
+
line-height: 14px;
|
|
273
|
+
color: grey;
|
|
274
|
+
border-right: 1px solid grey;
|
|
275
|
+
background-color: #e8e8e8;
|
|
276
|
+
overflow: hidden;
|
|
277
|
+
`,h=(0,o.styled)("div",r.default.forwardRef)`
|
|
278
|
+
position: absolute;
|
|
279
|
+
border-left: 1px solid grey;
|
|
280
|
+
padding-left: 2px;
|
|
281
|
+
`,O=(0,o.styled)("div",r.default.forwardRef)`
|
|
282
|
+
position: absolute;
|
|
283
|
+
left: 14px;
|
|
284
|
+
border-left: 1px solid grey;
|
|
285
|
+
padding-left: 2px;
|
|
286
|
+
transform: rotate(90deg);
|
|
287
|
+
transform-origin: left top;
|
|
288
|
+
overflow: hidden;
|
|
289
|
+
`,w=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];function b(){return r.default.createElement("div",null,r.default.createElement("h1",null,"Top rules"))}e.TopRules=(0,a.observer)(({store:E,width:p,height:v})=>{const g=r.default.useRef(null);if(!E.activePage)return null;const y=E.activePage,d=(E.bleedVisible&&y.bleed,y.computedWidth*E.scale),m=y.computedHeight*E.scale,_=(p-d)/2,k=(x=R=>(0,i.unitToPx)({unitVal:R,dpi:E.dpi,unit:E.unit})*E.scale,w.find(R=>x(R)>30)||1e4);var x;const A=(0,i.unitToPx)({unitVal:k,dpi:E.dpi,unit:E.unit})*E.scale,S=Math.round(d/A)+1,P=Math.round(m/A)+1,C=(0,n.getTotalClientRect)(E.selectedShapes);return r.default.createElement(l,{ref:g,className:"polotno-rulers"},r.default.createElement(u,{style:{width:p+"px"},className:"polotno-x-ruler"},[...Array(S)].map((R,N)=>r.default.createElement(h,{key:N,style:{left:_+N*A+"px",width:A+"px"}},E.unit==="px"||k>=1?Math.round(k*N):(k*N).toFixed(1))),!!E.selectedShapes.length&&r.default.createElement("div",{style:{position:"absolute",left:_+C.x*E.scale+"px",height:"14px",width:C.width*E.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),E.pages.map((R,N)=>{var U;const G=R.computedHeight*E.scale,Z=(v-G)/2;return r.default.createElement(f,{key:R.id,style:{height:v+"px"},className:"polotno-y-ruler"},[...Array(P)].map((W,H)=>r.default.createElement(O,{key:H,style:{top:Z+H*A-14+"px",width:A+"px"}},E.unit==="px"||k>=1?Math.round(k*H):(k*H).toFixed(1))),((U=E.selectedShapes[0])===null||U===void 0?void 0:U.page)===R&&r.default.createElement("div",{style:{position:"absolute",top:Z+C.y*E.scale-14+"px",width:"14px",height:C.height*E.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),e.LeftRules=b})(gS);var vS={};(function(e){var t=me&&me.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioElement=void 0;const r=t(et),n=Jn;function i(a){const[o,l]=r.default.useState(null),[u,f]=r.default.useState("loading");return r.default.useEffect(()=>{const h=new Audio(a),O=()=>{f("loaded"),l(h)},w=()=>{f("failed"),l(null)};return h.addEventListener("canplay",O),h.addEventListener("error",w),()=>{h.removeEventListener("canplay",O),h.removeEventListener("error",w)}},[a]),[o,u]}e.AudioElement=(0,n.observer)(({audio:a,store:o})=>{const[l,u]=i(a.src);return r.default.useEffect(()=>{l&&o.history.ignore(()=>{a.set({duration:1e3*l.duration})})},[l,a,o.history]),r.default.useEffect(()=>{if(!l)return;o.isPlaying?(l.currentTime=a.startTime*a.duration,l.volume=a.volume,l.play()):l.pause();const f=()=>{l.currentTime=a.startTime*a.duration},h=()=>{l.currentTime>=a.endTime*a.duration&&(l.pause(),l.currentTime=a.startTime*a.duration)};return l.addEventListener("ended",f),l.addEventListener("timeupdate",h),()=>{l.removeEventListener("ended",f),l.removeEventListener("timeupdate",h)}},[o.isPlaying,a.startTime,a.endTime,a.volume,l]),null})})(vS);var mS={},Vg={};let dj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",yS=e=>crypto.getRandomValues(new Uint8Array(e)),bS=(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}}},hj=(e,t=21)=>bS(e,t,yS),pj=(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 gj=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:hj,customRandom:bS,nanoid:pj,random:yS,urlAlphabet:dj},Symbol.toStringTag,{value:"Module"})),t0=yo(gj);var qg={},Wg={},_S={},O2={};(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})(O2);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const t=ei,r=O2;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 h=()=>f>0;function O(){const b=(0,t.getSnapshot)(i);return{pages:b.pages,width:b.width,height:b.height,custom:b.custom}}function w(b){const E=i.pages.map(y=>y.id),p=b.pages.map(y=>y.id),v=!(0,r.deepEqual)(E,p),g=!(0,r.deepEqual)(i.custom,b.custom);v?(0,t.applySnapshot)(i.pages,b.pages):i.pages.forEach((y,d)=>{(0,t.applySnapshot)(y,b.pages[d])}),g&&i.set({custom:b.custom}),i.setSize(b.width,b.height)}return{startTransaction(){f++},endTransaction(b){f--,b||this.requestAddState(O())},async ignore(b,E=!1,p=!1){p&&await new Promise(m=>setTimeout(m,10)),u&&n.addUndoState();let v=h();n.startTransaction();let g=f;try{await b()}catch(m){setTimeout(()=>{throw m})}const y=g!==f,d=!y;n.endTransaction(d),E||v||n.replaceState(),y||(clearTimeout(u),u=0)},async transaction(b){await n.ignore(b,!0),this.addUndoState()},requestAddState(b){l=b,u||h()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),h()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const b=n.history[n.undoIdx];!(0,r.deepEqual)(l,b)&&(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(O())}),n.history.length===0&&this.requestAddState(O())},clear(){clearTimeout(u),u=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(O())},beforeDestroy(){a()},undo(){u&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,w(n.history[n.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){u&&this.addUndoState(),n.canRedo?(n.undoIdx++,o=!0,w(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=O()}}}),e.default=e.UndoManager})(_S);var wS={};(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})(wS);var SS={};(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})(SS);var ES={};(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
|
|
290
|
+
(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]);
|
|
291
|
+
`],{type:"application/javascript"}))})}e.getGIF=r,e.createGIF=n})(ES);var OS={};(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})(OS);var PS={},kc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=e.cropImage=e.loadImage=e.getImageSize=void 0;const t=ru;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=h=>{u(h)},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 h=document.createElement("canvas");h.width=l.width,h.height=l.height;const O=h.getContext("2d");let{cropX:w,cropY:b}=l;const E=f.width*l.cropWidth,p=f.height*l.cropHeight,v=l.width/l.height;let g,y;const d=E/p;return l.type==="svg"?(g=E,y=p):v>=d?(g=E,y=E/v):(g=p*v,y=p),O.drawImage(f,w*f.width,b*f.height,g,y,0,0,h.width,h.height),h.toDataURL("image/png")}function a(o,l){const{width:u,height:f}=o,h=u/f;let O,w;h>=l.width/l.height?(O=l.width,w=l.width/h):(O=l.height*h,w=l.height);const b=(l.width-O)/2,E=(l.height-w)/2;return{cropX:b/l.width,cropY:E/l.height,cropWidth:O/l.width,cropHeight:w/l.height}}e.getImageSize=r,e.loadImage=n,e.cropImage=i,e.getCrop=a})(kc);(function(e){var t=me&&me.__createBinding||(Object.create?function(S,P,C,R){R===void 0&&(R=C);var N=Object.getOwnPropertyDescriptor(P,C);N&&!("get"in N?!P.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return P[C]}}),Object.defineProperty(S,R,N)}:function(S,P,C,R){R===void 0&&(R=C),S[R]=P[C]}),r=me&&me.__setModuleDefault||(Object.create?function(S,P){Object.defineProperty(S,"default",{enumerable:!0,value:P})}:function(S,P){S.default=P}),n=me&&me.__importStar||function(S){if(S&&S.__esModule)return S;var P={};if(S!=null)for(var C in S)C!=="default"&&Object.prototype.hasOwnProperty.call(S,C)&&t(P,S,C);return r(P,S),P},i=me&&me.__rest||function(S,P){var C={};for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&P.indexOf(R)<0&&(C[R]=S[R]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(R=Object.getOwnPropertySymbols(S);N<R.length;N++)P.indexOf(R[N])<0&&Object.prototype.propertyIsEnumerable.call(S,R[N])&&(C[R[N]]=S[R[N]])}return C};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToHTML=e.jsonToDOM=e.fixRatio=void 0;const a=kc,o=n(ru),l=kc,u=Jp,f=g2,h=(S,P,...C)=>({type:S,props:P,children:C||[]});function O(S){var P=new DOMParser().parseFromString(S,"image/svg+xml");return P.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(P)}e.fixRatio=O;const w=async({element:S,page:P,store:C})=>{let{src:R}=S;if(S.type==="svg"&&Object.keys(S.colorsReplace).length){const X=await o.urlToString(R);R=o.replaceColors(X,new Map(Object.entries(S.colorsReplace)))}let N="";S.flipX&&(N+="scaleX(-1)"),S.flipY&&(N+="scaleY(-1)"),N||(N="none");const U={};if(S.clipSrc){const X=await o.urlToBase64(S.clipSrc);U["clip-path"]=`url(${X})`}const G=await(0,l.loadImage)(R),Z=G.width*S.cropWidth,W=G.height*S.cropHeight,H=S.width/S.height;let M,L;const D=Z/W;S.type==="svg"?(M=Z,L=W):H>=D?(M=Z,L=Z/H):(M=W*H,L=W);const B=M/G.width,q=L/G.height,K=M/L>S.width/S.height?S.height/L:S.width/M,z=M*K/B,$=L*K/q,F=S.cropX*K*G.width,Y=S.cropY*K*G.height;return h("div",{style:Object.assign(Object.assign({},U),{width:"100%",height:"100%","border-radius":S.cornerRadius+"px",border:S.borderSize?`${S.borderSize}px solid ${S.borderColor}`:"none",background:`url(${R})`,transform:N,"background-size":`${Math.round(z)}px ${Math.round($)}px`,"background-position-x":-Math.round(F)+"px","background-position-y":-Math.round(Y)+"px"})})},b=async({element:S,page:P,store:C})=>{let R={top:0,left:0};S.fill.indexOf("gradient")>=0&&(R=Object.assign(Object.assign({},R),{"background-color":S.fill,"background-image":S.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const N=S.backgroundPadding*(S.fontSize*S.lineHeight),U=h("div",{style:{position:"absolute",top:-N/2+"px",left:-N/2+"px",display:S.backgroundEnabled?"block":"none",width:S.width+N+"px",height:S.height+N+"px","background-color":S.backgroundColor,"border-radius":S.backgroundCornerRadius*(S.fontSize*S.lineHeight*.5)+"px"}});S.verticalAlign==="middle"?(R.top="50%",R.transform="translateY(-50%)"):S.verticalAlign==="bottom"&&(R.bottom=0);const G=/<[a-z][\s\S]*>/i.test(S.text),Z=Object.assign(Object.assign({},R),{position:"absolute",width:S.width+"px",color:S.fill,"white-space":"pre-wrap","font-size":S.fontSize+"px","text-align":S.align,"font-family":S.fontFamily,"text-decoration":S.textDecoration||"none","line-height":S.lineHeight,"letter-spacing":S.letterSpacing+"em","font-style":S.fontStyle,"font-weight":S.fontWeight,"-webkit-text-stroke":`${S.strokeWidth}px ${S.stroke}`,"text-stroke":`${S.strokeWidth}px ${S.stroke}`}),W="el-"+S.id,H=G?{id:W}:{},M=`<style>#${W} {${f.resetStyleContent}}</style>`,L=h("div",Object.assign(Object.assign({style:Z},H),{innerHTML:G?`${M}${S.text}`:S.text.split(`
|
|
292
|
+
`).join("<br />")}));return h("div",{style:{position:"relative",width:"100%",height:"100%"}},U,L)},E=({element:S,type:P})=>{const C={"stroke-width":S.height,stroke:S.color,"line-cap":"round","stroke-linejoin":"round",opacity:S.opacity};return P==="arrow"||P==="triangle"?h("polyline",Object.assign({points:`${3*S.height},${2*-S.height} 0,0 ${3*S.height},${2*S.height}`},C)):P==="bar"?h("polyline",Object.assign({points:`0,${2*-S.height} 0,${2*S.height}`},C)):P==="circle"?h("circle",Object.assign({r:S.height},C)):P==="square"?h("polyline",Object.assign({points:`${-S.height},${-S.height} ${-S.height},${S.height} ${S.height},${S.height} ${S.height},${-S.height}`},C)):null},p=async({element:S,page:P,store:C})=>h("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},h("rect",{x:0,y:0,width:S.width,height:S.height,fill:S.color}),h("g",{transform:`translate(0 ${S.height/2})`},E({element:S,type:S.startHead})),h("g",{transform:`translate(${S.width} ${S.height/2}) rotate(180)`},E({element:S,type:S.endHead}))),v=async({element:S,page:P,store:C,elementHook:R})=>{const N=await Promise.all(S.children.map(G=>d({element:G,page:P,store:C,elementHook:R}))),U=h("div",{style:{"transform-origin":"top left",opacity:S.opacity}},...N);return R&&R({dom:U,element:S})||U},g=async({element:S,page:P,store:C,elementHook:R})=>{const N=(0,u.figureToSvg)(S),U=h("div",{innerHTML:N});return R&&R({dom:U,element:S})||U},y={image:w,svg:w,text:b,line:p,figure:g,group:v};async function d({element:S,page:P,store:C,elementHook:R}){let N=await y[S.type];N||(N=()=>h("div",{}),console.error(`HTML export does not support ${S.type} type...`));const U=await N({element:S,page:P,store:C}),G=[];S.blurEnabled&&G.push(`blur(${S.blurRadius/2}px)`),S.brightnessEnabled&&G.push(`brightness(${100*S.brightness+100}%)`),S.sepiaEnabled&&G.push("sepia()"),S.grayscaleEnabled&&G.push("grayscale()"),S.shadowEnabled&&G.push(`drop-shadow(${S.shadowOffsetX}px ${S.shadowOffsetY}px ${S.shadowBlur}px ${S.shadowColor})`);const Z=h("div",{id:S.id,style:{position:"absolute",left:S.x+"px",top:S.y+"px",width:S.width+"px",height:S.height+"px",transform:`rotate(${S.rotation}deg)`,"transform-origin":"top left",opacity:S.opacity,display:S.visible&&S.showInExport?"block":"none",filter:G.join(" ")||"none"}},U);return R&&R({dom:Z,element:S})||Z}async function m({page:S,store:P,elementHook:C}){const R=await Promise.all(S.children.map(Z=>d({element:Z,page:S,store:P,elementHook:C}))),N=S.width==="auto"?P.width:S.width,U=S.height==="auto"?P.height:S.height;let G={};if(S.background.indexOf("url")>=0||S.background.indexOf("http")>=0||S.background.indexOf(".jpg")>=0||S.background.indexOf(".png")>=0||S.background.indexOf(".jpeg")>=0){const{width:Z,height:W}=await(0,l.loadImage)(S.background),H=await w({element:Object.assign({x:0,y:0,width:Z,height:W,src:S.background,cornerRadius:0},(0,a.getCrop)({width:Z,height:W},{width:Z,height:W})),page:S,store:P});R.unshift(H)}else G=Object.assign(Object.assign({},G),{"background-color":S.background});return h("div",{className:"page",id:S.id,style:Object.assign(Object.assign({},G),{width:N+"px",height:U+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...R)}async function _({json:S,elementHook:P}){const C=await Promise.all(S.pages.map(U=>m({page:U,store:S,elementHook:P}))),R=[];S.pages.forEach(U=>{U.children.forEach(G=>{G.type==="text"&&R.indexOf(G.fontFamily)===-1&&R.push(G.fontFamily)})});const N=R.map(U=>S.fonts.find(G=>G.fontFamily===U)?h("style",{},""):h("link",{href:`https://fonts.googleapis.com/css?family=${U}`,rel:"stylesheet"}));return h("div",{className:"design"},...N,...C)}e.jsonToDOM=_;const k=(S,P)=>typeof P=="object"?`${S}="${Object.keys(P).map(C=>`${C}:${P[C]};`).join(" ")}"`:`${S}="${P}"`,x=({dom:S})=>{if(typeof S=="string")return S;if(!S)return"";const P=S.props,{innerHTML:C}=P,R=i(P,["innerHTML"]);return`<${S.type} ${Object.keys(R).map(N=>k(N,S.props[N])).join(" ")}>${C||S.children.map(N=>x({dom:N})).join("")}</${S.type}>`};async function A({json:S,elementHook:P}){const C=await _({json:S,elementHook:P});return x({dom:C})}e.jsonToHTML=A})(PS);var xS={};(function(e){var t=me&&me.__createBinding||(Object.create?function(S,P,C,R){R===void 0&&(R=C);var N=Object.getOwnPropertyDescriptor(P,C);N&&!("get"in N?!P.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return P[C]}}),Object.defineProperty(S,R,N)}:function(S,P,C,R){R===void 0&&(R=C),S[R]=P[C]}),r=me&&me.__setModuleDefault||(Object.create?function(S,P){Object.defineProperty(S,"default",{enumerable:!0,value:P})}:function(S,P){S.default=P}),n=me&&me.__importStar||function(S){if(S&&S.__esModule)return S;var P={};if(S!=null)for(var C in S)C!=="default"&&Object.prototype.hasOwnProperty.call(S,C)&&t(P,S,C);return r(P,S),P},i=me&&me.__rest||function(S,P){var C={};for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&P.indexOf(R)<0&&(C[R]=S[R]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(R=Object.getOwnPropertySymbols(S);N<R.length;N++)P.indexOf(R[N])<0&&Object.prototype.propertyIsEnumerable.call(S,R[N])&&(C[R[N]]=S[R[N]])}return C};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToSVG=e.jsonToDOM=e.fixRatio=void 0;const a=kc,o=n(ru),l=kc,u=Jp,f=(S,P,...C)=>({type:S,props:P,children:C||[]});function h(S){var P=new DOMParser().parseFromString(S,"image/svg+xml");return P.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(P)}e.fixRatio=h;const O=async({element:S,page:P,store:C})=>{let{src:R}=S;if(S.type==="svg"){const Q=await o.urlToString(R);R=o.replaceColors(Q,new Map(Object.entries(S.colorsReplace)))}let N="";S.flipX&&(N+="scaleX(-1)"),S.flipY&&(N+="scaleY(-1)"),S.clipSrc&&await o.urlToBase64(S.clipSrc);const U=await(0,l.loadImage)(R),G=U.width*S.cropWidth,Z=U.height*S.cropHeight,W=S.width/S.height;let H,M;const L=G/Z;S.type==="svg"?(H=G,M=Z):W>=L?(H=G,M=G/W):(H=Z*W,M=Z);const D=H/U.width,B=M/U.height,q=H/M>S.width/S.height?S.height/M:S.width/H,K=H*q/D,z=M*q/B,$=S.cropX*U.width*q,F=S.cropY*U.height*q,Y=`clip-${S.id}`,X=R.replace(/&/g,"&");return f("g",{style:{transform:N}},f("defs",{},f("clipPath",{id:Y},f("rect",{x:0,y:0,width:S.width,height:S.height}))),f("image",{"xlink:href":X,x:-$,y:-F,width:K,height:z,preserveAspectRatio:"none","clip-path":`url(#${Y})`}))},w=async({element:S,page:P,store:C})=>{const R=(W,H,M,L,D)=>{const B=document.createElement("canvas").getContext("2d");return B.font=`${D} ${L} ${H}px ${M}`,B.measureText(W).width},N=((W,H,M,L,D,B)=>{const q=[];return W.split(`
|
|
293
|
+
`).forEach(K=>{const z=K.split(" ");let $="";for(let F=0;F<z.length;F++){const Y=$+z[F]+" ";R(Y,M,L,D,B)>H&&F>0?(q.push($.trim()),$=z[F]+" "):$=Y}q.push($.trim())}),q})(S.text,S.width,S.fontSize,S.fontFamily,S.fontWeight,S.fontStyle),U=S.fontSize*S.lineHeight,G=S.align==="center"?"middle":S.align==="right"?"end":"start",Z=N.map((W,H)=>f("tspan",{x:S.align==="center"?S.width/2:S.align==="right"?S.width:0,dy:H===0?0:U,innerHTML:W}));return f("g",{},f("text",{fill:S.fill,y:S.fontSize,"font-size":S.fontSize+"px","text-anchor":G,"font-family":S.fontFamily,"font-style":S.fontStyle,"font-weight":S.fontWeight,"text-decoration":S.textDecoration,"line-height":S.lineHeight,"letter-spacing":S.letterSpacing+"em","stroke-width":S.strokeWidth,stroke:S.stroke},...Z))},b=({element:S,type:P})=>{const C={"stroke-width":S.height,stroke:S.color,"line-cap":"round","stroke-linejoin":"round",opacity:S.opacity};return P==="arrow"||P==="triangle"?f("polyline",Object.assign({points:`${3*S.height},${2*-S.height} 0,0 ${3*S.height},${2*S.height}`},C)):P==="bar"?f("polyline",Object.assign({points:`0,${2*-S.height} 0,${2*S.height}`},C)):P==="circle"?f("circle",Object.assign({r:S.height},C)):P==="square"?f("polyline",Object.assign({points:`${-S.height},${-S.height} ${-S.height},${S.height} ${S.height},${S.height} ${S.height},${-S.height}`},C)):null},E=async({element:S,page:P,store:C})=>f("g",{},f("line",{x1:0,y1:S.height/2,x2:S.width,y2:S.height/2,stroke:S.color,"stroke-width":S.height}),f("g",{transform:`translate(0 ${S.height/2})`},b({element:S,type:S.startHead})),f("g",{transform:`translate(${S.width} ${S.height/2}) rotate(180)`},b({element:S,type:S.endHead}))),p=async({element:S,page:P,store:C,elementHook:R})=>{const N=await Promise.all(S.children.map(G=>d({element:G,page:P,store:C,elementHook:R}))),U=f("g",{opacity:S.opacity,transform:`translate(${S.x}, ${S.y}) rotate(${S.rotation})`,style:{"transform-origin":"top left"}},...N);return R&&R({dom:U,element:S})||U};function v(S){let P=S.replace(/<svg[^>]*>/,"");return P=P.replace(/<\/svg>/,""),P}const g=async({element:S,page:P,store:C,elementHook:R})=>{const N=v((0,u.figureToSvg)(S)),U=f("g",{innerHTML:N});return R&&R({dom:U,element:S})||U},y={image:O,svg:O,text:w,line:E,figure:g,group:p};async function d({element:S,page:P,store:C,elementHook:R}){let N=await y[S.type];N||(N=()=>f("g",{}),console.error(`SVG export does not support ${S.type} type...`));const U=await N({element:S,page:P,store:C}),G=[];S.blurEnabled&&G.push(`blur(${S.blurRadius/2}px)`),S.brightnessEnabled&&G.push(`brightness(${100*S.brightness+100}%)`),S.sepiaEnabled&&G.push("sepia()"),S.grayscaleEnabled&&G.push("grayscale()"),S.shadowEnabled&&G.push(`drop-shadow(${S.shadowOffsetX}px ${S.shadowOffsetY}px ${S.shadowBlur}px ${S.shadowColor})`);const Z=f("g",{className:"element",id:S.id,transform:`translate(${S.x}, ${S.y}) rotate(${S.rotation})`,display:S.visible?void 0:"none",style:{"transform-origin":"top left",filter:G.join(" ")}},U);return R&&R({dom:Z,element:S})||Z}async function m({page:S,store:P,elementHook:C}){const R=await Promise.all(S.children.map(G=>d({element:G,page:S,store:P,elementHook:C}))),N=S.background.indexOf("url")>=0||S.background.indexOf("http")>=0||S.background.indexOf(".jpg")>=0||S.background.indexOf(".png")>=0||S.background.indexOf(".jpeg")>=0;let U;if(N){const G=await(0,l.loadImage)(S.background);U=await(0,l.cropImage)(S.background,Object.assign({width:P.width,height:P.height,x:0,y:0},(0,a.getCrop)({width:P.width,height:P.height},{width:G.width,height:G.height})))}return f("g",{className:"page",style:{}},N?f("image",{"xlink:href":U,x:0,y:0,width:P.width,height:P.height,preserveAspectRatio:"none"}):f("rect",{x:0,y:0,width:P.width,height:P.height,fill:N?void 0:S.background}),...R)}async function _({json:S,elementHook:P}){const C=await Promise.all(S.pages.map(U=>m({page:U,store:S,elementHook:P}))),R=[];S.pages.forEach(U=>{U.children.forEach(G=>{G.type==="text"&&R.indexOf(G.fontFamily)===-1&&R.push(G.fontFamily)})});const N=R.map(U=>S.fonts.find(G=>G.fontFamily===U)?f("style",{},""):f("defs",{},f("style",{type:"text/css",innerHTML:`@import url('https://fonts.googleapis.com/css?family=${U}:bi,normal,i,b');`.replace(/&/g,"&")})));return f("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${S.width} ${S.height}`},...N,...C)}e.jsonToDOM=_;const k=(S,P)=>typeof P=="object"?`${S}="${Object.keys(P).map(C=>`${C}:${P[C]};`).join(" ")}"`:P==null||P===""?"":`${S}="${P}"`,x=({dom:S,nestLevel:P=0})=>{if(typeof S=="string")return S;if(!S)return"";const C=S.props,{innerHTML:R}=C,N=i(C,["innerHTML"]),U=" ".repeat(P);return`${U}<${S.type} ${Object.keys(N).map(G=>k(G,N[G])).join(" ")}>${R||`
|
|
294
|
+
`+S.children.map(G=>x({dom:G,nestLevel:P+1})).join("")}${U}</${S.type}>
|
|
295
|
+
`};async function A({json:S,elementHook:P}){const C=await _({json:S,elementHook:P});return x({dom:C})}e.jsonToSVG=A})(xS);var Kg={},O_;function CS(){return O_||(O_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const t=ei,r=t0,n=Tc(),i=P2(),a=Tc(),o=iu;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 h in u)h[0]!=="_"&&(f[h]=l[h]);return f}).views(l=>({get store(){return(0,t.getParentOfType)(l,i.Store)}})).views(l=>({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 h=u.map(O=>({id:O,index:l.children.findIndex(w=>w.id===O)}));h.sort((O,w)=>w.index-O.index);for(const{index:O}of h){if(O==-1)continue;const w=O<l.children.length-1&&l.children[O+1],b=u.indexOf(w==null?void 0:w.id)>=0;O===l.children.length-1||b||f(O)}},_forEachElementDown(u,f){const h=u.map(O=>({id:O,index:l.children.findIndex(w=>w.id===O)}));h.sort((O,w)=>O.index-w.index);for(const{index:O}of h){if(O==-1)continue;const w=O>0&&l.children[O-1],b=u.indexOf(w==null?void 0:w.id)>=0;O===0||b||f(O)}return!1}})).actions(l=>({clone(u={}){const f=l.toJSON();f.children.forEach(b=>{b.id=(0,r.nanoid)(10),(0,a.forEveryChild)(b,E=>{E.id=(0,r.nanoid)(10)})});const h=Object.assign(Object.assign(Object.assign({},f),{id:(0,r.nanoid)(10)}),u),O=l.store.addPage(h),w=l.store.pages.indexOf(l);O.setZIndex(w+1),O.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 h=a.TYPES_MAP[u.type];if(!h)return void console.error("Can not find model with type "+u.type);u.children&&u.children.forEach(w=>{w.id=(0,r.nanoid)(10)});const O=h.create(Object.assign({id:(0,r.nanoid)(10)},u));return l.children.push(O),O.selectable&&!f&&l.store.selectElements([O.id]),O},canMoveElementsUp(u){let f=!1;return l._forEachElementUp(u,()=>{f=f||!0}),f},moveElementsUp(u){l._forEachElementUp(u,f=>{const h=l.children[f];(0,t.detach)(h),l.children.splice(f+1,0,h)})},canMoveElementsTop(u){return this.canMoveElementsUp(u)},moveElementsTop(u){const f=[],h=[];l.children.forEach(O=>{u.indexOf(O.id)>=0?f.push(O):h.push(O)}),l.children.replace(h.concat(f))},canMoveElementsDown(u){let f=!1;return l._forEachElementDown(u,()=>{f=f||!0}),f},moveElementsDown(u){l._forEachElementDown(u,f=>{const h=l.children[f];(0,t.detach)(h),l.children.splice(f-1,0,h)})},canMoveElementsBottom(u){return this.canMoveElementsDown(u)},moveElementsBottom(u){const f=[],h=[];l.children.forEach(O=>{u.indexOf(O.id)>=0?f.push(O):h.push(O)}),l.children.replace(f.concat(h))},setElementZIndex(u,f){const h=l.children.find(O=>O.id===u);h&&((0,t.detach)(h),l.children.remove(h),l.children.splice(f,0,h))},setSize({width:u,height:f,useMagic:h,softChange:O}){if(h){const w=[],b=N=>N.type==="image"&&N.x<1&&N.y<1&&N.width>=l.computedWidth-2&&N.height>=l.computedHeight-2;(0,a.forEveryChild)(l,N=>{N.type!=="group"&&(b(N)||w.push(N))});const E=w.length?(0,o.getTotalClientRect)(w):{x:0,y:0,width:l.computedWidth,height:l.computedHeight},p=0,v=Math.max(0,Math.min(E.x,l.computedWidth-E.x-E.width)),g=l.computedWidth*p,y=Math.max(0,v-g),d=Math.max(0,Math.min(E.y,l.computedHeight-E.y-E.height)),m=l.computedHeight*p,_=Math.max(0,d-m),k=l.computedWidth-2*y,x=l.computedHeight-2*_,A=u/k,S=f/x,P=Math.min(A,S),C=(u-k*P)/2-y*P,R=(f-x*P)/2-_*P;(0,a.forEveryChild)(l,N=>{N.type!=="group"&&(b(N)?N.set({x:N.x*P,y:N.y*P,width:N.width*A,height:N.height*S,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(N.set({x:C+N.x*P,y:R+N.y*P,width:N.width*P,height:N.height*P}),N.type==="text"?N.set({fontSize:N.fontSize*P}):N.type==="figure"&&N.set({strokeWidth:N.strokeWidth*P})))})}O||(l.width=u),O||(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 kS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Audio=void 0;const t=ei;e.Audio=t.types.model("Audio",{id:t.types.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(r=>({toJSON:()=>Object.assign({},(0,t.getSnapshot)(r))})).actions(r=>({set(n){Object.assign(r,n)}}))})(kS);var P_;function P2(){return P_||(P_=1,function(e){var t=me&&me.__createBinding||(Object.create?function(S,P,C,R){R===void 0&&(R=C);var N=Object.getOwnPropertyDescriptor(P,C);N&&!("get"in N?!P.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return P[C]}}),Object.defineProperty(S,R,N)}:function(S,P,C,R){R===void 0&&(R=C),S[R]=P[C]}),r=me&&me.__setModuleDefault||(Object.create?function(S,P){Object.defineProperty(S,"default",{enumerable:!0,value:P})}:function(S,P){S.default=P}),n=me&&me.__importStar||function(S){if(S&&S.__esModule)return S;var P={};if(S!=null)for(var C in S)C!=="default"&&Object.prototype.hasOwnProperty.call(S,C)&&t(P,S,C);return r(P,S),P},i=me&&me.__rest||function(S,P){var C={};for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&P.indexOf(R)<0&&(C[R]=S[R]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(R=Object.getOwnPropertySymbols(S);N<R.length;N++)P.indexOf(R[N])<0&&Object.prototype.propertyIsEnumerable.call(S,R[N])&&(C[R[N]]=S[R[N]])}return C},a=me&&me.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.createStore=e.Store=e.Font=void 0;const o=ei,l=_S,u=t0,f=a(Ei),h=wS,O=SS,w=ES,b=E2(),E=n(eu),p=Vi,v=e0,g=O2,y=OS,d=PS,m=xS,_=CS(),k=Tc(),x=kS;function A({key:S,showCredit:P}={key:"",showCredit:!1}){const C=e.Store.create();return(0,b.validateKey)(S,P),C}(0,o.setLivelinessChecking)("ignore"),e.Font=o.types.model("Font",{fontFamily:o.types.string,url:o.types.optional(o.types.string,""),styles:o.types.frozen()}).preProcessSnapshot(S=>Object.assign(Object.assign({},S),{fontFamily:S.fontFamily||S.name})),e.Store=o.types.model("Store",{role:"",pages:o.types.array(_.Page),fonts:o.types.array(e.Font),audios:o.types.array(x.Audio),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:Math.min(2,window.devicePixelRatio||1),_activePageId:""}).views(S=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),S.bleedVisible},get selectedElements(){return S.selectedElementsIds.map(P=>{for(const C of S.pages)for(const R of C.children)if(R.id===P)return R}).filter(P=>!!P)},get children(){return S.pages},get selectedShapes(){const P=[];return(0,k.forEveryChild)({children:S.selectedElements},C=>{C.type!=="group"&&P.push(C)}),P},get activePage(){return S.pages.slice().find(P=>P.id===S._activePageId)||(S.pages.length?S.pages[0]:null)},get duration(){let P=0;return S.pages.forEach(C=>{P+=C.duration}),P},get _hasCroppedImages(){return S.find(P=>P.type==="image"&&P._cropModeEnabled)},find(P){let C;return(0,k.forEveryChild)({children:S.pages},R=>{if(!C&&P(R))return C=R,!0}),C},getElementById:P=>S.find(C=>C.id===P)})).actions(S=>{let P=0,C=null,R=!1;return{afterCreate(){S.history.canUndo},setCurrentTime(N){S.currentTime=N},play({animatedElementsIds:N=[],startTime:U=0,currentTime:G=0,endTime:Z=S.duration,repeat:W=!1}={}){G&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),U=G),S.animatedElementsIds=(0,o.cast)(N),S.currentTime=U,S.isPlaying=!0,P=Date.now(),C=Z,R=W,requestAnimationFrame(S.seek)},checkActivePage(){let N=0;for(const U of S.pages){if(S.currentTime>=U.startTime&&S.currentTime<U.startTime+U.duration){S.selectPage(U.id);break}N+=U.duration}},seek(){if(!S.isPlaying)return;const N=Date.now(),U=N-P;P=N,S.currentTime+=U,S.checkActivePage();const G=C||S.duration;S.isPlaying&&S.currentTime<G?requestAnimationFrame(S.seek):S.isPlaying&&R?(S.currentTime=0,requestAnimationFrame(S.seek)):S.stop()},stop(){S.isPlaying=!1,S.currentTime=0,S.animatedElementsIds=(0,o.cast)([]),S.checkActivePage()}}}).actions(S=>({set(P){Object.assign(S,P)},setUnit({unit:P,dpi:C}){S.unit=P||S.unit,S.dpi=C||S.dpi},setRole(P){S.role=P},addPage(P){const C=_.Page.create(Object.assign({id:(0,u.nanoid)(10)},P));return S.pages.push(C),S._activePageId=C.id,C},selectPage(P){S._activePageId=P},selectElements(P){const C=P.map(R=>S.getElementById(R)).sort((R,N)=>R.page.children.indexOf(R)-R.page.children.indexOf(N)).filter(R=>!!R).map(R=>R.id);S.selectedElementsIds=(0,o.cast)(C)},toggleBleed(P){S.bleedVisible=P??!S.bleedVisible},toggleRulers(P){S.rulesVisible=P??!S.rulesVisible},openSidePanel(P){S.openedSidePanel!==P&&(S.previousOpenedSidePanel=S.openedSidePanel,S.openedSidePanel=P)},setScale(P){S.scale=P},_setScaleToFit(P){S.scaleToFit=P},setElementsPixelRatio(P){S._elementsPixelRatio=P},setSize(P,C,R){S.pages.forEach(N=>{N.setSize({width:P,height:C,useMagic:R,softChange:!0})}),S.width=P,S.height=C},setPageZIndex(P,C){const R=S.pages.find(N=>N.id===P);R&&((0,o.detach)(R),S.pages.remove(R),S.pages.splice(C,0,R))},deletePages(P){const C=S.pages.indexOf(S.activePage);P.forEach(U=>{const G=S.pages.find(Z=>Z.id===U);(0,o.destroy)(G)});const R=Math.min(S.pages.length-1,C),N=S.pages[R];N&&(S._activePageId=N.id),S.selectedElementsIds=(0,o.cast)(S.selectedElementsIds.filter(U=>S.getElementById(U)))},groupElements(P){const C=P.map(U=>S.getElementById(U));C.forEach(U=>{U&&(0,o.detach)(U)});const R=S.activePage,N={id:(0,u.nanoid)(10),children:C,type:"group"};return R.children.push(N),S.selectedElementsIds=(0,o.cast)([N.id]),N},ungroupElements(P){const C=P.map(N=>S.getElementById(N)),R=[];C.forEach(N=>{if(N&&N.type==="group"){const U=N.page,G=U.children.indexOf(N);N.children.forEach(Z=>{R.push(Z.id)}),N.children.forEach(Z=>{(0,o.detach)(Z),U.children.push(Z)}),U.children.splice(G,1)}}),S.selectedElementsIds=(0,o.cast)(R)},deleteElements(P){const C=[];S.find(R=>(P.includes(R.id)&&C.push(R),!1)),C.forEach(R=>{(0,o.destroy)(R)}),S.selectedElementsIds=(0,o.cast)(S.selectedElementsIds.filter(R=>S.getElementById(R)))},on(P,C){if(P==="change"){let R=S.toJSON();return(0,o.onSnapshot)(S,N=>{const U=S.toJSON();!(0,g.deepEqual)(R,U)&&(R=U,C(U))})}},async _toCanvas({pixelRatio:P,ignoreBackground:C,pageId:R,mimeType:N,includeBleed:U,_skipTimeout:G}={}){var Z;const W=P||1;R=R||((Z=S.pages[0])===null||Z===void 0?void 0:Z.id);const H=S.pages.find(ie=>ie.id===R);if(!H)throw new Error(`No page for export with id ${R}`);H==null||H.set({_exporting:!0});const M=await(0,y.waitTillAvailable)(()=>f.default.stages.find(ie=>ie.getAttr("pageId")===R));if(!M)throw new Error(`Export is failed. Can not find stage for page ${R}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const L=!!M.findOne(".page-container"),D=S._elementsPixelRatio;W>S._elementsPixelRatio&&S.setElementsPixelRatio(W),await S.waitLoading({_skipTimeout:G});const B=M.findOne(".page-container");if(!B)throw S.setElementsPixelRatio(D),new Error(`Export is failed. Can't find page container. ${L}`);M.find("Transformer").forEach(ie=>ie.visible(!1)),B.find(".page-background").forEach(ie=>ie.shadowEnabled(!1)),B.find(".page-background").forEach(ie=>ie.strokeEnabled(!1)),B.find(".highlighter").forEach(ie=>ie.visible(!1));const q=B.findOne(".page-background-group"),K=q.clip();q.clip({x:null,y:null,width:null,height:null});const z=B.findOne(".elements-container"),$=z.clip();z.clip({x:null,y:null,width:null,height:null});const F=B.find(ie=>ie.getAttr("hideInExport"));F.forEach(ie=>{ie.setAttr("oldVisible",ie.visible()),ie.hide()});const Y=B.find(ie=>!ie.visible()&&ie.getAttr("editModeEnabled"));Y.forEach(ie=>{ie.setAttr("oldVisible",ie.visible()),ie.show()}),C&&B.find(".page-background").forEach(ie=>ie.hide());const X=U?H.bleed:0;let Q=X;!S.bleedVisible&&U||(S.bleedVisible||U?S.bleedVisible&&U?Q=0:S.bleedVisible&&!U&&(Q=-H.bleed):Q=0);const ee=document.createElement("canvas");ee.width=Math.round((H.computedWidth+2*X)*W),ee.height=Math.round((H.computedHeight+2*X)*W);const re=ee.getContext("2d");N==="image/jpeg"&&(re.fillStyle="white",re.fillRect(0,0,ee.width,ee.height));const oe=B.scale();B.scale({x:1,y:1});const ae=B.toCanvas({x:B.x()-Q,y:B.y()-Q,width:H.computedWidth+2*X,height:H.computedHeight+2*X,pixelRatio:W});return B.scale(oe),re.drawImage(ae,0,0,ee.width,ee.height),f.default.Util.releaseCanvas(ae),C&&B.find(".page-background").forEach(ie=>ie.show()),F.forEach(ie=>{ie.visible(ie.getAttr("oldVisible"))}),Y.forEach(ie=>{ie.visible(ie.getAttr("oldVisible"))}),B.find(".page-background").forEach(ie=>ie.shadowEnabled(!0)),B.find(".page-background").forEach(ie=>ie.strokeEnabled(!0)),M.find("Transformer").forEach(ie=>ie.visible(!0)),B.find(".highlighter").forEach(ie=>ie.visible(!0)),q.clip(K),z.clip($),S.setElementsPixelRatio(D),H==null||H.set({_exporting:!1}),ee},async toDataURL(P={}){var{mimeType:C,quality:R}=P,N=i(P,["mimeType","quality"]);const U=await S._toCanvas(Object.assign({mimeType:C},N)),G=U.toDataURL(C,R);return f.default.Util.releaseCanvas(U),G},async toBlob(P={}){var{mimeType:C,quality:R}=P,N=i(P,["mimeType","quality"]);const U=await S._toCanvas(Object.assign({mimeType:C},N)),G=new Promise(Z=>{U.toBlob(Z,C,R)});return f.default.Util.releaseCanvas(U),G},async saveAsImage(P={}){var{fileName:C}=P,R=i(P,["fileName"]);const N=R.mimeType||"image/png",U=N.split("/")[1];(0,h.downloadFile)(await S.toDataURL(R),C||"polotno."+U,N)},async _toPDF(P){const C=P.dpi||S.dpi,R=P.parallel||1,N=P.unit||(S.unit==="px"?"mm":S.unit),U=P.pixelRatio||1,G=P.pageIds||S.pages.map(F=>F.id),Z=S.pages.filter(F=>G.includes(F.id)),W=await(0,O.getJsPDF)(),H=F=>(0,v.pxToUnit)({px:F,unit:N,dpi:C}),M=H(P.cropMarkSize||0),L=Z[0]||{},D=P.includeBleed?L.bleed:0,B=H(L.computedWidth+2*D)+2*M,q=H(L.computedHeight+2*D)+2*M;var K=new W({unit:N,orientation:B>q?"landscape":"portrait",format:[B,q],compress:!0,putOnlyUsedFonts:!0});K.deletePage(1);const z=((F,Y)=>{for(var X=[],Q=0;Q<F.length;Q+=Y)X.push(F.slice(Q,Q+Y));return X})(Z,R);let $=0;for(const F of z){const Y=F.map(async X=>{const Q=P.includeBleed?X.bleed:0,ee=H(X.computedWidth+2*Q)+2*M,re=H(X.computedHeight+2*Q)+2*M;let oe=0,ae=U;for(;oe<10;){oe+=1,oe===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const ie=await S.toDataURL(Object.assign(Object.assign({},P),{pageId:X.id,pixelRatio:ae}));if(ie.length>20)return P.onProgress&&P.onProgress(++$/G.length*.9),{url:ie,width:ee,height:re};ae*=.8}});(await Promise.all(Y)).forEach(({url:X,width:Q,height:ee})=>{K.addPage([Q,ee],Q>ee?"landscape":"portrait"),M&&(K.setLineWidth(H(1)),K.line(2*M,0,2*M,M),K.line(0,2*M,M,2*M),K.line(Q-2*M,0,Q-2*M,M),K.line(Q,2*M,Q-M,2*M),K.line(0,ee-2*M,M,ee-2*M),K.line(2*M,ee,2*M,ee-M),K.line(Q,ee-2*M,Q-M,ee-2*M),K.line(Q-2*M,ee,Q-2*M,ee-M)),K.addImage(X,M,M,Q-2*M,ee-2*M,void 0,"FAST")})}return K},toPDFDataURL:async P=>(await S._toPDF(Object.assign({mimeType:"image/jpeg"},P))).output("datauristring"),async toGIFDataURL(P={}){const C=P.pixelRatio||1,R=await(0,w.createGIF)({width:S.width*C,height:S.height*C}),N=1e3/(P.fps||10),U=S.duration/N;for(let G=0;G<U-1;G++){const Z=G*N||1;S.setCurrentTime(Z);let W=0,H="";for(const L of S.pages)if(W+=L.duration,L.set({_rendering:W>Z}),W>Z){H=L.id;break}const M=await S._toCanvas({pixelRatio:C,pageId:H,_skipTimeout:!0});R.addFrame(M.getContext("2d"),{delay:N,copy:!0})}for(const G of S.pages)G.set({_rendering:!1});return S.stop(),R.render(),new Promise(G=>{R.on("finished",function(Z){(function(W,H){var M=new FileReader;M.onload=function(L){H(L.target.result)},M.readAsDataURL(W)})(Z,G)})})},async saveAsGIF(P={}){var{fileName:C}=P,R=i(P,["fileName"]);const N=await S.toGIFDataURL(R);(0,h.downloadFile)(N,C||"polotno.gif")},async toHTML({elementHook:P}={elementHook:void 0}){const C=S.toJSON();return(0,d.jsonToHTML)({json:C,elementHook:P})},async saveAsHTML({fileName:P}={}){const C=await S.toHTML(),R="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(C)));(0,h.downloadFile)(R,P||"polotno.html")},async toSVG({elementHook:P}={elementHook:void 0}){const C=S.toJSON();return(0,m.jsonToSVG)({json:C,elementHook:P})},async saveAsSVG({fileName:P,elementHook:C}={}){const R=await S.toSVG({elementHook:C}),N="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(R)));(0,h.downloadFile)(N,P||"polotno.svg")},async saveAsPDF(P={}){var{fileName:C}=P,R=i(P,["fileName"]);(await S._toPDF(Object.assign({mimeType:"image/jpeg"},R))).save(C||"polotno.pdf")},async waitLoading({_skipTimeout:P=!1}={}){P||await new Promise(C=>setTimeout(C,50)),await(0,p.whenLoaded)()},toJSON:()=>({width:S.width,height:S.height,fonts:(0,o.getSnapshot)(S.fonts),pages:(0,o.getSnapshot)(S.pages),audios:(0,o.getSnapshot)(S.audios),unit:S.unit,dpi:S.dpi,custom:S.custom}),loadJSON(P,C=!1){var R;const N=Object.assign({},P),U=S.pages.indexOf(S.activePage);let G=(R=N.pages[U]||N.pages[0])===null||R===void 0?void 0:R.id;N._activePageId=G;const Z=Object.assign({},(0,o.getSnapshot)(S));Object.assign(Z,N),Z.history=C?S.history.toJSON():{history:[],undoIdx:-1},(0,o.applySnapshot)(S,Z)},clear({keepHistory:P=!1}={}){const C=S.pages.map(R=>R.id);S.deletePages(C),P||S.history.clear()},addFont(P){S.removeFont(P.fontFamily),S.fonts.push(P),S.loadFont(P.fontFamily)},removeFont(P){S.fonts.filter(C=>C.fontFamily===P).forEach(C=>(0,o.destroy)(C))},addAudio(P){const C=x.Audio.create(Object.assign({id:(0,u.nanoid)(10)},P));S.audios.push(C)},removeAudio(P){const C=S.audios.find(R=>R.id===P);C&&S.audios.remove(C)},async loadFont(P){const C=S.fonts.find(N=>N.fontFamily===P)||E.globalFonts.find(N=>N.fontFamily===P);let R=[{fontStyle:"normal",fontWeight:"normal"}];return C?(C.styles&&(R=C.styles.map(N=>({fontStyle:N.fontStyle||"normal",fontWeight:N.fontWeight||"normal"}))),E.injectCustomFont(C)):E.injectGoogleFont(P),Promise.all(R.map(N=>E.loadFont(P,N.fontStyle,N.fontWeight)))},validate:P=>e.Store.validate(P,[{path:"",type:e.Store}]).map(C=>({path:"store"+C.context.map(R=>R.path).join("."),message:C.message}))})),e.createStore=A,e.default=A}(Wg)),Wg}var x_;function TS(){return x_||(x_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const t=ei,r=t0,n=P2(),i=CS(),a=Tc();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,h=>{h.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={},AS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const t=iu,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),h=f<=1?f:2-f;return{opacity:o.opacity*h}},bounce:({dTime:a,element:o,animation:l})=>{const u=l.duration,f=u/2,h={},O={x:o.x+o.width/3,y:o.y+o.height/3,width:o.width/3,height:o.height/3,fontSize:o.fontSize/3},w={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize},b=a%u/f,E=b<=1?b:2-b;for(let p in O){const v=O[p],g=w[p]-v;h[p]=v+E*g}return h},move:({dTime:a,element:o,animation:l})=>{const u=r[l.data.direction]||r.right,f={};for(var h in u.from){let O=u.from[h],w=u.to[h];l.type==="exit"&&(O=u.to[h],w=-u.from[h]);const b=o[h]+O,E=o[h]+w-b;f[h]=b+a/l.duration*E}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},h={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize};for(var O in f){let w=f[O],b=h[O];if(l.type==="exit"){const p=w;w=b,b=p}const E=b-w;u[O]=w+a/l.duration*E}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})(AS);var C_;function au(){return C_||(C_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.Animation=void 0;const t=ei,r=AS,n=Xi,i=TS();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 h=a.store.animatedElementsIds;if(h.length&&!h.includes(a.id))return o;const O=a.animations.find(E=>E.type==="enter");if(O!=null&&O.enabled&&f<O.delay&&l({opacity:0}),O!=null&&O.enabled&&f>=O.delay&&f<=O.delay+O.duration){const E=f-O.delay,p=(0,r.animate)({element:a,animation:O,dTime:E});l(p)}const w=a.animations.find(E=>E.type==="exit");if(w!=null&&w.enabled&&f>=a.page.duration-w.duration-w.delay&&f<=a.page.duration-w.delay){const E=f-(a.page.duration-w.duration-w.delay),p=(0,r.animate)({element:a,animation:w,dTime:E});l(p)}w!=null&&w.enabled&&f>=a.page.duration-w.delay&&l({opacity:0});const b=a.animations.find(E=>E.type==="loop");if(b!=null&&b.enabled){const E=f,p=(0,r.animate)({element:a,animation:b,dTime:E});l(p)}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={},k_;function vj(){return k_||(k_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const t=ei,r=au();e.TextElement=r.Shape.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:t.types.optional(t.types.union(t.types.number,t.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(n=>Object.assign({},n)).actions(n=>({toggleEditMode(i){n._editModeEnabled=i??!n._editModeEnabled,n._editModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()}}))}(Xg)),Xg}var Zg={},T_;function RS(){return T_||(T_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const t=au();e.ImageElement=t.Shape.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,_cropModeEnabled:!1}).actions(r=>({toggleCropMode(n){r._cropModeEnabled=n??!r._cropModeEnabled,r._cropModeEnabled?r.store.history.startTransaction():r.store.history.endTransaction()},beforeDestroy(){r._cropModeEnabled&&r.store.history.endTransaction()}}))}(Zg)),Zg}var Qg={},A_;function mj(){return A_||(A_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const t=RS();e.VideoElement=t.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}(Qg)),Qg}var Jg={},R_;function yj(){return R_||(R_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const t=ei,r=au();e.LineElement=r.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:t.types.array(t.types.number),startHead:"",endHead:""}).actions(n=>({}))}(Jg)),Jg}var ev={},M_;function bj(){return M_||(M_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const t=ei,r=au();e.SVGElement=r.Shape.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:t.types.map(t.types.string)}).preProcessSnapshot(n=>Object.assign(Object.assign({},n),{src:n.src||n.svgSource})).actions(n=>({replaceColor(i,a){n.colorsReplace.set(i,a)}}))}(ev)),ev}var tv={},L_;function _j(){return L_||(L_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=ei,r=au();e.FigureElement=r.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:t.types.array(t.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(tv)),tv}var N_;function Tc(){return N_||(N_=1,function(e){var t=me&&me.__rest||function(v,g){var y={};for(var d in v)Object.prototype.hasOwnProperty.call(v,d)&&g.indexOf(d)<0&&(y[d]=v[d]);if(v!=null&&typeof Object.getOwnPropertySymbols=="function"){var m=0;for(d=Object.getOwnPropertySymbols(v);m<d.length;m++)g.indexOf(d[m])<0&&Object.prototype.propertyIsEnumerable.call(v,d[m])&&(y[d[m]]=v[d[m]])}return y};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeModel=e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0;const r=ei,n=t0,i=TS(),a=au(),o=vj(),l=RS(),u=mj(),f=yj(),h=bj(),O=_j(),w=(v,g)=>{if(v.children)for(const y of v.children){if(g(y)===!0)break;(0,e.forEveryChild)(y,g)}};e.forEveryChild=w;const b=[...new Array(20)].map((v,g)=>r.types.late(()=>E[g]));e.ElementTypes=r.types.union({dispatcher:v=>{const g=e.TYPES_MAP[v.type];if(!g)throw new Error(`Unknown element type: "${v.type}"`);return g}},h.SVGElement,o.TextElement,l.ImageElement,f.LineElement,u.VideoElement,O.FigureElement,r.types.late(()=>e.GroupElement),...b),e.GroupElement=i.Node.named("Group").props({type:"group",children:r.types.array(e.ElementTypes)}).views(v=>({get draggable(){let g=!0;return(0,e.forEveryChild)(v,y=>{y.draggable||(g=!1)}),g},get resizable(){let g=!0;return(0,e.forEveryChild)(v,y=>{y.resizable||(g=!1)}),g},get contentEditable(){let g=!0;return(0,e.forEveryChild)(v,y=>{y.contentEditable||(g=!1)}),g},get styleEditable(){let g=!0;return(0,e.forEveryChild)(v,y=>{y.styleEditable||(g=!1)}),g},get locked(){let g=!0;return(0,e.forEveryChild)(v,y=>{y.locked||(g=!1)}),g}})).actions(v=>({set(g){var{draggable:y,contentEditable:d,styleEditable:m,resizable:_}=g,k=t(g,["draggable","contentEditable","styleEditable","resizable"]);y!==void 0&&(0,e.forEveryChild)(v,x=>{x.set({draggable:y})}),d!==void 0&&(0,e.forEveryChild)(v,x=>{x.set({contentEditable:d})}),m!==void 0&&(0,e.forEveryChild)(v,x=>{x.set({styleEditable:m})}),_!==void 0&&(0,e.forEveryChild)(v,x=>{x.set({resizable:_})}),Object.assign(v,k)},addElement(g,{skipSelect:y=!1}={}){const d=e.TYPES_MAP[g.type];if(!d)return void console.error("Can not find model with type "+g.type);g.children&&g.children.forEach(_=>{_.id=(0,n.nanoid)(10)});const m=d.create(Object.assign({id:(0,n.nanoid)(10)},g));return v.children.push(m),m.selectable&&!y&&v.store.selectElements([m.id]),m},setElementZIndex(g,y){const d=v.children.find(m=>m.id===g);d&&((0,r.detach)(d),v.children.remove(d),v.children.splice(y,0,d))}}));const E=[];function p(v,g){const y=v.type;if(!y)throw new Error('You must pass "type" attribute to custom model.');let d=a.Shape.named(y).props(v);g&&(d=g(d)),e.TYPES_MAP[y]=d,E.push(d)}e.TYPES_MAP={svg:h.SVGElement,text:o.TextElement,image:l.ImageElement,group:e.GroupElement,line:f.LineElement,video:u.VideoElement,figure:O.FigureElement},e.registerShapeModel=p}(Vg)),Vg}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=void 0;const t=Tc();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 h,O,w,b,E,p,v,g;if(((h=document.activeElement)===null||h===void 0?void 0:h.tagName)==="INPUT"||((O=document.activeElement)===null||O===void 0?void 0:O.tagName)==="TEXTAREA"||((w=document.activeElement)===null||w===void 0?void 0:w.contentEditable)==="true")return;const y=f.selectedElements.filter(k=>k.removable),d=y.map(k=>k.id);u.keyCode!==46&&u.keyCode!==8||f.deleteElements(d);const m=u.ctrlKey||u.metaKey,_=u.shiftKey;if(m&&!_&&u.code==="KeyZ"&&(u.preventDefault(),f.history.undo()),m&&_&&u.code==="KeyZ"&&(u.preventDefault(),f.history.redo()),m&&u.code==="KeyA"){u.preventDefault();const k=(b=f.activePage)===null||b===void 0?void 0:b.children.filter(A=>A.selectable),x=(k==null?void 0:k.map(A=>A.id))||[];f.selectElements(x)}if(m&&u.code==="KeyC"&&(u.preventDefault(),n=(E=f.activePage)===null||E===void 0?void 0:E.id,a(f.selectedElements.map(k=>k.toJSON()))),m&&u.code==="KeyX"&&(u.preventDefault(),n=(p=f.activePage)===null||p===void 0?void 0:p.id,a(f.selectedElements.map(k=>k.toJSON())),f.deleteElements(y)),m&&u.code==="KeyV"){u.preventDefault();let k=0;n===((v=f.activePage)===null||v===void 0?void 0:v.id)&&(k=f.width/20),n=(g=f.activePage)===null||g===void 0?void 0:g.id,f.history.transaction(()=>{const x=[],A=o();(0,t.forEveryChild)({children:A},S=>{delete S.id,S.type!=="group"&&(S.x+=k,S.y+=k)}),A.forEach(S=>{var P;const C=(P=f.activePage)===null||P===void 0?void 0:P.addElement(S);C&&x.push(C.id)}),a(A),f.selectElements(x)})}u.code==="ArrowDown"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({y:k.y+1})})),u.code==="ArrowUp"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({y:k.y-1})})),u.code==="ArrowLeft"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({x:k.x-1})})),u.code==="ArrowRight"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({x:k.x+1})}))}e.handleHotkey=l})(mS);var MS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const t=Xi,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"},pagesTimeline:{pages:"Pages",removePage:"Remove page",removeAudio:"Remove audio"}});function n(h,O){var w,b=O.split("."),E=h;for(w=0;w<b.length;++w){if(E[b[w]]==null)return;E=E[b[w]]}return E}const i=h=>h&&typeof h=="object";function a(h,O){Object.keys(O).forEach(w=>{const b=h[w],E=O[w];i(E)&&i(b)?a(b,E):h[w]=E})}function o(h,O,w=""){Object.keys(O).forEach(b=>{const E=O[b],p=w?`${w}.${b}`:b;i(E)?i(h[b])?o(h[b],E,p):console.warn(`Missing nested translation object at '${p}'`):h[b]===void 0&&console.warn(`Missing translation '${p}'`)})}e.setTranslations=(0,t.action)((h,{validate:O=!1}={})=>{O&&o(h,r),a(r,h)});const l=()=>(0,t.toJS)(r);e.getTranslations=l;const u={},f=h=>{const O=n(r,h);if(O!==void 0)return O;u[h]||(u[h]=!0,console.warn(`Missing translation '${h}'`));const w=h.split("."),b=w[w.length-1]||" ";return b.charAt(0).toUpperCase()+b.slice(1)};e.t=f})(MS);(function(e){var t=me&&me.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const r=t(et),n=Jn,i=t(r9),a=gS,o=vS,l=mS,u=MS,f=`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
296
|
+
Width or height of parent elements is equal 0.
|
|
297
|
+
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
298
|
+
For simpler debugging here is the log of the parent element:`,h=(p,v,g,y,d,m)=>{const _=r.default.useRef({width:v,height:g}),k=r.default.useRef({top:0,left:0}),x=r.default.useRef(!1),A=r.default.useRef(d.pages.length);x.current=A.current!==d.pages.length,A.current=d.pages.length,r.default.useEffect(()=>{const S=p.current,P=C=>{k.current={top:S.scrollTop,left:S.scrollLeft}};return S.addEventListener("scroll",P),()=>{S.removeEventListener("scroll",P)}},[]),r.default.useLayoutEffect(()=>{if(!p.current||x.current)return;const S=p.current,P=(k.current.left+S.offsetWidth/2)/_.current.width,C=(k.current.top+S.offsetHeight/2)/_.current.height;m.current=!0,S.scrollLeft=P*v-S.offsetWidth/2,S.scrollTop=C*g-S.offsetHeight/2,_.current={width:v,height:g}},[y,v,g])},O=({element:p,scrollTop:v=0,duration:g=300,onFinish:y=()=>{}})=>{const d=p.scrollTop,m=v-d;let _=0,k=!1;const x=()=>{if(k)return;_+=20;const S=A(_,d,m,g);p.scrollTop=S,_<g?setTimeout(x,20):y()},A=(S,P,C,R)=>(S/=R/2)<1?C/2*S*S+P:-C/2*(--S*(S-2)-1)+P;return x(),()=>{k=!0}},w=(p,v,g,y,d)=>{const m=r.default.useRef(!1),_=r.default.useRef(null),k=r.default.useRef(!1);r.default.useEffect(()=>{const A=p.current,S=()=>{d.current};return A.addEventListener("scroll",S),()=>{A.removeEventListener("scroll",S)}},[]);const x=g.pages.indexOf(g.activePage);return r.default.useLayoutEffect(()=>{if(!g.activePage||!p.current||m.current)return;const A=p.current,S=g.pages.indexOf(g.activePage)*v;let P=()=>{};return(Math.abs(S-A.scrollTop)>.5*v||k.current)&&(k.current=!0,P=O({element:A,scrollTop:S,onFinish:()=>{k.current=!1}})),P},[g.activePage,x]),{handleScroll:A=>{if(k.current)return;m.current=!0,clearTimeout(_.current),_.current=setTimeout(()=>{m.current=!1},300);const S=A.currentTarget.childNodes[0].offsetHeight,P=A.currentTarget.scrollTop,C=Math.floor((P+y.height/3)/S),R=g.pages[C];R&&g.activePage!==R&&R.select()}}},b=({store:p})=>r.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},r.default.createElement("p",null,(0,u.t)("workspace.noPages")),r.default.createElement("button",{onClick:()=>{p.addPage()}},(0,u.t)("workspace.addPage"))),E=({width:p,height:v,xPadding:g,yPadding:y,backgroundColor:d})=>r.default.createElement("div",{style:{width:p+"px",height:v+"px",backgroundColor:d,paddingLeft:g+"px",paddingRight:g+"px",paddingTop:y+"px",paddingBottom:y+"px"}},r.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:p,pageControlsEnabled:v,backgroundColor:g,pageBorderColor:y,activePageBorderColor:d,bleedColor:m,components:_,onKeyDown:k,paddingX:x,paddingY:A,altCloneEnabled:S=!0,visiblePagesOffset:P,renderOnlyActivePage:C})=>{var R;const N=x??20,U=A??55,[G,Z]=r.default.useState({width:100,height:100}),W=r.default.useRef(G),H=r.default.useRef(null),M=r.default.useRef(null),L=p.bleedVisible?Math.max(0,...p.pages.map(ne=>ne.bleed)):0,D=Math.max(...p.pages.map(ne=>ne.computedWidth)),B=Math.max(...p.pages.map(ne=>ne.computedHeight)),q=((R=p.activePage)===null||R===void 0?void 0:R.computedHeight)||0,K=D+2*L,z=(C?q:B)+2*L,$=async({skipTimeout:ne}={skipTimeout:!1})=>{if(ne||await new Promise(Se=>setTimeout(Se,50)),H.current===null)return;const le=H.current.getBoundingClientRect();le.width!==0&&le.height!==0||(console.warn(f),console.log(H.current));const be=M.current.clientWidth||le.width,ye={width:be,height:le.height};(W.current.width!==ye.width||W.current.height!==ye.height)&&(Z(ye),W.current=ye);const te=(be-2*N)/K,de=(le.height-2*U)/z,he=Math.max(Math.min(te,de),.01);p.scaleToFit!==he&&(p.setScale(he),p._setScaleToFit(he))};r.default.useLayoutEffect(()=>{$({skipTimeout:!0})},[]),r.default.useEffect(()=>{$()},[K,z]),r.default.useEffect(()=>{const ne=H.current;if(window.ResizeObserver){const le=new ResizeObserver(()=>{$({skipTimeout:!0})});return le.observe(ne),()=>le.unobserve(ne)}{const le=setInterval(()=>{$({skipTimeout:!0})},100);return()=>clearInterval(le)}},[K,z]);const F=Math.max(N,(G.width-K*p.scale)/2),Y=C?1:p.pages.length,X=z*p.scale*Y,Q=Math.max(U,(G.height-X)/Y/2);r.default.useEffect(()=>{const ne=le=>{(k||l.handleHotkey)(le,p)};return window.addEventListener("keydown",ne),()=>window.removeEventListener("keydown",ne)},[]),r.default.useEffect(()=>{var ne;const le=be=>{if(be.ctrlKey||be.metaKey){be.preventDefault();const he=Math.max(3,p.scaleToFit),Se=Math.min(.1,p.scaleToFit),$e=(ye=be.deltaY<0?1.05*p.scale:p.scale/1.05,te=Se,de=he,Math.max(te,Math.min(de,ye)));p.setScale($e)}else var ye,te,de};return(ne=M.current)===null||ne===void 0||ne.addEventListener("wheel",le),()=>{var be;return(be=M.current)===null||be===void 0?void 0:be.removeEventListener("wheel",le)}},[]);const ee=r.default.useRef(!1);h(M,K*p.scale+2*F,z*p.scale+2*Q,p.scale,p,ee);const{handleScroll:re}=w(M,z*p.scale+2*Q,p,G,ee),oe=G.width>=K*p.scale+2*F,ae=g||"rgba(232, 232, 232, 0.9)",ie=p.pages.indexOf(p.activePage),Re=(_==null?void 0:_.NoPages)||b,Me=P??Math.min(3,Math.max(1,Math.ceil(G.height/2/(z*p.scale))));return r.default.createElement("div",{ref:H,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:ae},tabIndex:0,className:"polotno-workspace-container"},r.default.createElement("div",{ref:M,onScroll:re,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:oe?"hidden":"auto"},className:"polotno-workspace-inner"},p.pages.map((ne,le)=>C&&ne!==p.activePage&&!ne._exportingOrRendering?null:Math.abs(le-ie)<=Me||ne._exportingOrRendering?r.default.createElement(i.default,{key:ne.id,page:ne,xPadding:F,yPadding:Q,width:K*p.scale+2*F,height:z*p.scale+2*Q,store:p,pageControlsEnabled:v,backColor:ae,pageBorderColor:y||"lightgrey",activePageBorderColor:d||"rgb(0, 161, 255)",altCloneEnabled:S,bleedColor:m||"rgba(255, 0, 0, 0.1)",components:_}):r.default.createElement(E,{key:ne.id,width:K*p.scale+2*F,height:z*p.scale+2*Q,backgroundColor:ae,xPadding:F,yPadding:Q})),p.rulesVisible&&r.default.createElement(a.TopRules,{store:p,xPadding:F,yPadding:Q,width:K*p.scale+2*F,height:z*p.scale+2*Q}),p.pages.length===0&&r.default.createElement(Re,{store:p}),p.audios.map(ne=>r.default.createElement(o.AudioElement,{key:ne.id,audio:ne,store:p}))))}),e.default=e.WorkspaceCanvas})(qw);var wj=P2();kl.toggleFadeInAnimation(!1);Xn.setTextOverflow("change-font-size");const Sj=new URLSearchParams(location.search).get("key"),LS=wj.createStore({key:Sj});window.store=LS;window.config={addGlobalFont:eu.addGlobalFont,unstable_useHtmlTextRender:Xn.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:Xn.setTextVerticalResizeEnabled,unstable_setTextOverflow:Xn.setTextOverflow,onLoadError:Vi.onLoadError,setAssetLoadTimeout:Vi.setAssetLoadTimeout,setFontLoadTimeout:Vi.setFontLoadTimeout};const Ej=Fd.createRoot(document.getElementById("root"));Ej.render(ht.createElement(qw.WorkspaceCanvas,{visiblePagesOffset:0,store:LS,components:{PageControls:()=>null,Tooltip:()=>null}}));
|