polotno-node 2.10.9 → 2.11.0

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.
@@ -1,303 +0,0 @@
1
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var _e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function _a(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var I_={exports:{}},ht={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Nc=Symbol.for("react.element"),PE=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(t){return t===null||typeof t!="object"?null:(t=l3&&t[l3]||t["@@iterator"],typeof t=="function"?t:null)}var D_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j_=Object.assign,F_={};function Vs(t,e,n){this.props=t,this.context=e,this.refs=F_,this.updater=n||D_}Vs.prototype.isReactComponent={};Vs.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Vs.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function z_(){}z_.prototype=Vs.prototype;function bm(t,e,n){this.props=t,this.context=e,this.refs=F_,this.updater=n||D_}var _m=bm.prototype=new z_;_m.constructor=bm;j_(_m,Vs.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_(t,e,n){var r,i={},o=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(o=""+e.key),e)B_.call(e,r)&&!U_.hasOwnProperty(r)&&(i[r]=e[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var s=Array(l),f=0;f<l;f++)s[f]=arguments[f+2];i.children=s}if(t&&t.defaultProps)for(r in l=t.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:Nc,type:t,key:o,ref:a,props:i,_owner:wm.current}}function jE(t,e){return{$$typeof:Nc,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Sm(t){return typeof t=="object"&&t!==null&&t.$$typeof===Nc}function FE(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var u3=/\/+/g;function f1(t,e){return typeof t=="object"&&t!==null&&t.key!=null?FE(""+t.key):e.toString(36)}function Ed(t,e,n,r,i){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case Nc:case PE:a=!0}}if(a)return a=t,i=i(a),t=r===""?"."+f1(a,0):r,s3(i)?(n="",t!=null&&(n=t.replace(u3,"$&/")+"/"),Ed(i,e,n,"",function(f){return f})):i!=null&&(Sm(i)&&(i=jE(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(u3,"$&/")+"/")+t)),e.push(i)),1;if(a=0,r=r===""?".":r+":",s3(t))for(var l=0;l<t.length;l++){o=t[l];var s=r+f1(o,l);a+=Ed(o,e,n,s,i)}else if(s=DE(t),typeof s=="function")for(t=s.call(t),l=0;!(o=t.next()).done;)o=o.value,s=r+f1(o,l++),a+=Ed(o,e,n,s,i);else if(o==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return a}function Kf(t,e,n){if(t==null)return t;var r=[],i=0;return Ed(t,r,"","",function(o){return e.call(n,o,i++)}),r}function zE(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var er={current:null},Od={transition:null},BE={ReactCurrentDispatcher:er,ReactCurrentBatchConfig:Od,ReactCurrentOwner:wm};function $_(){throw Error("act(...) is not supported in production builds of React.")}ht.Children={map:Kf,forEach:function(t,e,n){Kf(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Kf(t,function(){e++}),e},toArray:function(t){return Kf(t,function(e){return e})||[]},only:function(t){if(!Sm(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ht.Component=Vs;ht.Fragment=CE;ht.Profiler=TE;ht.PureComponent=bm;ht.StrictMode=kE;ht.Suspense=LE;ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=BE;ht.act=$_;ht.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=j_({},t.props),i=t.key,o=t.ref,a=t._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,a=wm.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(s in e)B_.call(e,s)&&!U_.hasOwnProperty(s)&&(r[s]=e[s]===void 0&&l!==void 0?l[s]:e[s])}var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){l=Array(s);for(var f=0;f<s;f++)l[f]=arguments[f+2];r.children=l}return{$$typeof:Nc,type:t.type,key:i,ref:o,props:r,_owner:a}};ht.createContext=function(t){return t={$$typeof:RE,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:AE,_context:t},t.Consumer=t};ht.createElement=H_;ht.createFactory=function(t){var e=H_.bind(null,t);return e.type=t,e};ht.createRef=function(){return{current:null}};ht.forwardRef=function(t){return{$$typeof:ME,render:t}};ht.isValidElement=Sm;ht.lazy=function(t){return{$$typeof:IE,_payload:{_status:-1,_result:t},_init:zE}};ht.memo=function(t,e){return{$$typeof:NE,type:t,compare:e===void 0?null:e}};ht.startTransition=function(t){var e=Od.transition;Od.transition={};try{t()}finally{Od.transition=e}};ht.unstable_act=$_;ht.useCallback=function(t,e){return er.current.useCallback(t,e)};ht.useContext=function(t){return er.current.useContext(t)};ht.useDebugValue=function(){};ht.useDeferredValue=function(t){return er.current.useDeferredValue(t)};ht.useEffect=function(t,e){return er.current.useEffect(t,e)};ht.useId=function(){return er.current.useId()};ht.useImperativeHandle=function(t,e,n){return er.current.useImperativeHandle(t,e,n)};ht.useInsertionEffect=function(t,e){return er.current.useInsertionEffect(t,e)};ht.useLayoutEffect=function(t,e){return er.current.useLayoutEffect(t,e)};ht.useMemo=function(t,e){return er.current.useMemo(t,e)};ht.useReducer=function(t,e,n){return er.current.useReducer(t,e,n)};ht.useRef=function(t){return er.current.useRef(t)};ht.useState=function(t){return er.current.useState(t)};ht.useSyncExternalStore=function(t,e,n){return er.current.useSyncExternalStore(t,e,n)};ht.useTransition=function(){return er.current.useTransition()};ht.version="18.3.1";I_.exports=ht;var Qe=I_.exports;const dt=kh(Qe);var zd={},G_={exports:{}},Lr={},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(t){function e(H,L){var M=H.length;H.push(L);e:for(;0<M;){var D=M-1>>>1,B=H[D];if(0<i(B,L))H[D]=L,H[M]=B,M=D;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var L=H[0],M=H.pop();if(M!==L){H[0]=M;e:for(var D=0,B=H.length,V=B>>>1;D<V;){var Y=2*(D+1)-1,F=H[Y],$=Y+1,z=H[$];if(0>i(F,M))$<B&&0>i(z,F)?(H[D]=z,H[$]=M,D=$):(H[D]=F,H[Y]=M,D=Y);else if($<B&&0>i(z,M))H[D]=z,H[$]=M,D=$;else break e}}return L}function i(H,L){var M=H.sortIndex-L.sortIndex;return M!==0?M:H.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var s=[],f=[],h=1,x=null,w=3,v=!1,O=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,p=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 L=n(f);L!==null;){if(L.callback===null)r(f);else if(L.startTime<=H)r(f),L.sortIndex=L.expirationTime,e(s,L);else break;L=n(f)}}function m(H){if(g=!1,d(H),!O)if(n(s)!==null)O=!0,Z(_);else{var L=n(f);L!==null&&W(m,L.startTime-H)}}function _(H,L){O=!1,g&&(g=!1,p(R),R=-1),v=!0;var M=w;try{for(d(L),x=n(s);x!==null&&(!(x.expirationTime>L)||H&&!P());){var D=x.callback;if(typeof D=="function"){x.callback=null,w=x.priorityLevel;var B=D(x.expirationTime<=L);L=t.unstable_now(),typeof B=="function"?x.callback=B:x===n(s)&&r(s),d(L)}else r(s);x=n(s)}if(x!==null)var V=!0;else{var Y=n(f);Y!==null&&W(m,Y.startTime-L),V=!1}return V}finally{x=null,w=M,v=!1}}var A=!1,C=null,R=-1,S=5,E=-1;function P(){return!(t.unstable_now()-E<S)}function T(){if(C!==null){var H=t.unstable_now();E=H;var L=!0;try{L=C(!0,H)}finally{L?N():(A=!1,C=null)}}else A=!1}var N;if(typeof y=="function")N=function(){y(T)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,G=U.port2;U.port1.onmessage=T,N=function(){G.postMessage(null)}}else N=function(){b(T,0)};function Z(H){C=H,A||(A=!0,N())}function W(H,L){R=b(function(){H(t.unstable_now())},L)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(H){H.callback=null},t.unstable_continueExecution=function(){O||v||(O=!0,Z(_))},t.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},t.unstable_getCurrentPriorityLevel=function(){return w},t.unstable_getFirstCallbackNode=function(){return n(s)},t.unstable_next=function(H){switch(w){case 1:case 2:case 3:var L=3;break;default:L=w}var M=w;w=L;try{return H()}finally{w=M}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(H,L){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var M=w;w=H;try{return L()}finally{w=M}},t.unstable_scheduleCallback=function(H,L,M){var D=t.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?D+M:D):M=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=M+B,H={id:h++,callback:L,priorityLevel:H,startTime:M,expirationTime:B,sortIndex:-1},M>D?(H.sortIndex=M,e(f,H),n(s)===null&&H===n(f)&&(g?(p(R),R=-1):g=!0,W(m,M-D))):(H.sortIndex=B,e(s,H),O||v||(O=!0,Z(_))),H},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(H){var L=w;return function(){var M=w;w=L;try{return H.apply(this,arguments)}finally{w=M}}}})(q_);V_.exports=q_;var qu=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=Qe,Rr=qu;function xe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var W_=new Set,ac={};function vl(t,e){Os(t,e),Os(t+"Capture",e)}function Os(t,e){for(ac[t]=e,t=0;t<e.length;t++)W_.add(e[t])}var Oo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nv=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(t){return nv.call(f3,t)?!0:nv.call(c3,t)?!1:HE.test(t)?f3[t]=!0:(c3[t]=!0,!1)}function GE(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function VE(t,e,n,r){if(e===null||typeof e>"u"||GE(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function tr(t,e,n,r,i,o,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=a}var Fn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Fn[t]=new tr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Fn[e]=new tr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Fn[t]=new tr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Fn[t]=new tr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Fn[t]=new tr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Fn[t]=new tr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Fn[t]=new tr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Fn[t]=new tr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Fn[t]=new tr(t,5,!1,t.toLowerCase(),null,!1,!1)});var Em=/[\-:]([a-z])/g;function Om(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Em,Om);Fn[e]=new tr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Em,Om);Fn[e]=new tr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Em,Om);Fn[e]=new tr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Fn[t]=new tr(t,1,!1,t.toLowerCase(),null,!1,!1)});Fn.xlinkHref=new tr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Fn[t]=new tr(t,1,!1,t.toLowerCase(),null,!0,!0)});function xm(t,e,n,r){var i=Fn.hasOwnProperty(e)?Fn[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(VE(e,n,i,r)&&(n=null),r||i===null?$E(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Ao=UE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Xf=Symbol.for("react.element"),ns=Symbol.for("react.portal"),rs=Symbol.for("react.fragment"),Pm=Symbol.for("react.strict_mode"),rv=Symbol.for("react.profiler"),Y_=Symbol.for("react.provider"),K_=Symbol.for("react.context"),Cm=Symbol.for("react.forward_ref"),iv=Symbol.for("react.suspense"),ov=Symbol.for("react.suspense_list"),km=Symbol.for("react.memo"),Zo=Symbol.for("react.lazy"),X_=Symbol.for("react.offscreen"),d3=Symbol.iterator;function Tu(t){return t===null||typeof t!="object"?null:(t=d3&&t[d3]||t["@@iterator"],typeof t=="function"?t:null)}var Jt=Object.assign,d1;function Uu(t){if(d1===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);d1=e&&e[1]||""}return`
26
- `+d1+t}var h1=!1;function p1(t,e){if(!t||h1)return"";h1=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(f){var r=f}Reflect.construct(t,[],e)}else{try{e.call()}catch(f){r=f}t.call(e.prototype)}else{try{throw Error()}catch(f){r=f}t()}}catch(f){if(f&&r&&typeof f.stack=="string"){for(var i=f.stack.split(`
27
- `),o=r.stack.split(`
28
- `),a=i.length-1,l=o.length-1;1<=a&&0<=l&&i[a]!==o[l];)l--;for(;1<=a&&0<=l;a--,l--)if(i[a]!==o[l]){if(a!==1||l!==1)do if(a--,l--,0>l||i[a]!==o[l]){var s=`
29
- `+i[a].replace(" at new "," at ");return t.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",t.displayName)),s}while(1<=a&&0<=l);break}}}finally{h1=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Uu(t):""}function qE(t){switch(t.tag){case 5:return Uu(t.type);case 16:return Uu("Lazy");case 13:return Uu("Suspense");case 19:return Uu("SuspenseList");case 0:case 2:case 15:return t=p1(t.type,!1),t;case 11:return t=p1(t.type.render,!1),t;case 1:return t=p1(t.type,!0),t;default:return""}}function av(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case rs:return"Fragment";case ns:return"Portal";case rv:return"Profiler";case Pm:return"StrictMode";case iv:return"Suspense";case ov:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case K_:return(t.displayName||"Context")+".Consumer";case Y_:return(t._context.displayName||"Context")+".Provider";case Cm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case km:return e=t.displayName||null,e!==null?e:av(t.type)||"Memo";case Zo:e=t._payload,t=t._init;try{return av(t(e))}catch{}}return null}function WE(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return av(e);case 8:return e===Pm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ga(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Z_(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function YE(t){var e=Z_(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Zf(t){t._valueTracker||(t._valueTracker=YE(t))}function Q_(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Z_(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Bd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function lv(t,e){var n=e.checked;return Jt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function h3(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=ga(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function J_(t,e){e=e.checked,e!=null&&xm(t,"checked",e,!1)}function sv(t,e){J_(t,e);var n=ga(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?uv(t,e.type,n):e.hasOwnProperty("defaultValue")&&uv(t,e.type,ga(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function p3(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function uv(t,e,n){(e!=="number"||Bd(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Hu=Array.isArray;function ms(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+ga(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function cv(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(xe(91));return Jt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function g3(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(xe(92));if(Hu(n)){if(1<n.length)throw Error(xe(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:ga(n)}}function e6(t,e){var n=ga(e.value),r=ga(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function v3(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function t6(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function fv(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?t6(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Qf,n6=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Qf=Qf||document.createElement("div"),Qf.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Qf.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function lc(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Wu={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},KE=["Webkit","ms","Moz","O"];Object.keys(Wu).forEach(function(t){KE.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Wu[e]=Wu[t]})});function r6(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Wu.hasOwnProperty(t)&&Wu[t]?(""+e).trim():e+"px"}function i6(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=r6(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var XE=Jt({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(t,e){if(e){if(XE[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(xe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(xe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(xe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(xe(62))}}function hv(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pv=null;function Tm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var gv=null,ys=null,bs=null;function m3(t){if(t=jc(t)){if(typeof gv!="function")throw Error(xe(280));var e=t.stateNode;e&&(e=Lh(e),gv(t.stateNode,t.type,e))}}function o6(t){ys?bs?bs.push(t):bs=[t]:ys=t}function a6(){if(ys){var t=ys,e=bs;if(bs=ys=null,m3(t),e)for(t=0;t<e.length;t++)m3(e[t])}}function l6(t,e){return t(e)}function s6(){}var g1=!1;function u6(t,e,n){if(g1)return t(e,n);g1=!0;try{return l6(t,e,n)}finally{g1=!1,(ys!==null||bs!==null)&&(s6(),a6())}}function sc(t,e){var n=t.stateNode;if(n===null)return null;var r=Lh(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(xe(231,e,typeof n));return n}var vv=!1;if(Oo)try{var Au={};Object.defineProperty(Au,"passive",{get:function(){vv=!0}}),window.addEventListener("test",Au,Au),window.removeEventListener("test",Au,Au)}catch{vv=!1}function ZE(t,e,n,r,i,o,a,l,s){var f=Array.prototype.slice.call(arguments,3);try{e.apply(n,f)}catch(h){this.onError(h)}}var Yu=!1,Ud=null,Hd=!1,mv=null,QE={onError:function(t){Yu=!0,Ud=t}};function JE(t,e,n,r,i,o,a,l,s){Yu=!1,Ud=null,ZE.apply(QE,arguments)}function eO(t,e,n,r,i,o,a,l,s){if(JE.apply(this,arguments),Yu){if(Yu){var f=Ud;Yu=!1,Ud=null}else throw Error(xe(198));Hd||(Hd=!0,mv=f)}}function ml(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function c6(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function y3(t){if(ml(t)!==t)throw Error(xe(188))}function tO(t){var e=t.alternate;if(!e){if(e=ml(t),e===null)throw Error(xe(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return y3(i),t;if(o===r)return y3(i),e;o=o.sibling}throw Error(xe(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,l=i.child;l;){if(l===n){a=!0,n=i,r=o;break}if(l===r){a=!0,r=i,n=o;break}l=l.sibling}if(!a){for(l=o.child;l;){if(l===n){a=!0,n=o,r=i;break}if(l===r){a=!0,r=o,n=i;break}l=l.sibling}if(!a)throw Error(xe(189))}}if(n.alternate!==r)throw Error(xe(190))}if(n.tag!==3)throw Error(xe(188));return n.stateNode.current===n?t:e}function f6(t){return t=tO(t),t!==null?d6(t):null}function d6(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=d6(t);if(e!==null)return e;t=t.sibling}return null}var h6=Rr.unstable_scheduleCallback,b3=Rr.unstable_cancelCallback,nO=Rr.unstable_shouldYield,rO=Rr.unstable_requestPaint,ln=Rr.unstable_now,iO=Rr.unstable_getCurrentPriorityLevel,Am=Rr.unstable_ImmediatePriority,p6=Rr.unstable_UserBlockingPriority,$d=Rr.unstable_NormalPriority,oO=Rr.unstable_LowPriority,g6=Rr.unstable_IdlePriority,Th=null,Gi=null;function aO(t){if(Gi&&typeof Gi.onCommitFiberRoot=="function")try{Gi.onCommitFiberRoot(Th,t,void 0,(t.current.flags&128)===128)}catch{}}var vi=Math.clz32?Math.clz32:uO,lO=Math.log,sO=Math.LN2;function uO(t){return t>>>=0,t===0?32:31-(lO(t)/sO|0)|0}var Jf=64,ed=4194304;function $u(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Gd(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,a=n&268435455;if(a!==0){var l=a&~i;l!==0?r=$u(l):(o&=a,o!==0&&(r=$u(o)))}else a=n&~i,a!==0?r=$u(a):o!==0&&(r=$u(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-vi(e),i=1<<n,r|=t[n],e&=~i;return r}function cO(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fO(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,o=t.pendingLanes;0<o;){var a=31-vi(o),l=1<<a,s=i[a];s===-1?(!(l&n)||l&r)&&(i[a]=cO(l,e)):s<=e&&(t.expiredLanes|=l),o&=~l}}function yv(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function v6(){var t=Jf;return Jf<<=1,!(Jf&4194240)&&(Jf=64),t}function v1(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Ic(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-vi(e),t[e]=n}function dO(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-vi(n),o=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~o}}function Rm(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-vi(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var Ct=0;function m6(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var y6,Mm,b6,_6,w6,bv=!1,td=[],oa=null,aa=null,la=null,uc=new Map,cc=new Map,Jo=[],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(t,e){switch(t){case"focusin":case"focusout":oa=null;break;case"dragenter":case"dragleave":aa=null;break;case"mouseover":case"mouseout":la=null;break;case"pointerover":case"pointerout":uc.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":cc.delete(e.pointerId)}}function Ru(t,e,n,r,i,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},e!==null&&(e=jc(e),e!==null&&Mm(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function pO(t,e,n,r,i){switch(e){case"focusin":return oa=Ru(oa,t,e,n,r,i),!0;case"dragenter":return aa=Ru(aa,t,e,n,r,i),!0;case"mouseover":return la=Ru(la,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return uc.set(o,Ru(uc.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,cc.set(o,Ru(cc.get(o)||null,t,e,n,r,i)),!0}return!1}function S6(t){var e=Qa(t.target);if(e!==null){var n=ml(e);if(n!==null){if(e=n.tag,e===13){if(e=c6(n),e!==null){t.blockedOn=e,w6(t.priority,function(){b6(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function xd(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=_v(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);pv=r,n.target.dispatchEvent(r),pv=null}else return e=jc(n),e!==null&&Mm(e),t.blockedOn=n,!1;e.shift()}return!0}function w3(t,e,n){xd(t)&&n.delete(e)}function gO(){bv=!1,oa!==null&&xd(oa)&&(oa=null),aa!==null&&xd(aa)&&(aa=null),la!==null&&xd(la)&&(la=null),uc.forEach(w3),cc.forEach(w3)}function Mu(t,e){t.blockedOn===e&&(t.blockedOn=null,bv||(bv=!0,Rr.unstable_scheduleCallback(Rr.unstable_NormalPriority,gO)))}function fc(t){function e(i){return Mu(i,t)}if(0<td.length){Mu(td[0],t);for(var n=1;n<td.length;n++){var r=td[n];r.blockedOn===t&&(r.blockedOn=null)}}for(oa!==null&&Mu(oa,t),aa!==null&&Mu(aa,t),la!==null&&Mu(la,t),uc.forEach(e),cc.forEach(e),n=0;n<Jo.length;n++)r=Jo[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Jo.length&&(n=Jo[0],n.blockedOn===null);)S6(n),n.blockedOn===null&&Jo.shift()}var _s=Ao.ReactCurrentBatchConfig,Vd=!0;function vO(t,e,n,r){var i=Ct,o=_s.transition;_s.transition=null;try{Ct=1,Lm(t,e,n,r)}finally{Ct=i,_s.transition=o}}function mO(t,e,n,r){var i=Ct,o=_s.transition;_s.transition=null;try{Ct=4,Lm(t,e,n,r)}finally{Ct=i,_s.transition=o}}function Lm(t,e,n,r){if(Vd){var i=_v(t,e,n,r);if(i===null)P1(t,e,r,qd,n),_3(t,r);else if(pO(i,t,e,n,r))r.stopPropagation();else if(_3(t,r),e&4&&-1<hO.indexOf(t)){for(;i!==null;){var o=jc(i);if(o!==null&&y6(o),o=_v(t,e,n,r),o===null&&P1(t,e,r,qd,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else P1(t,e,r,null,n)}}var qd=null;function _v(t,e,n,r){if(qd=null,t=Tm(r),t=Qa(t),t!==null)if(e=ml(t),e===null)t=null;else if(n=e.tag,n===13){if(t=c6(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return qd=t,null}function E6(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(iO()){case Am:return 1;case p6:return 4;case $d:case oO:return 16;case g6:return 536870912;default:return 16}default:return 16}}var na=null,Nm=null,Pd=null;function O6(){if(Pd)return Pd;var t,e=Nm,n=e.length,r,i="value"in na?na.value:na.textContent,o=i.length;for(t=0;t<n&&e[t]===i[t];t++);var a=n-t;for(r=1;r<=a&&e[n-r]===i[o-r];r++);return Pd=i.slice(t,1<r?1-r:void 0)}function Cd(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function nd(){return!0}function S3(){return!1}function Nr(t){function e(n,r,i,o,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(n=t[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?nd:S3,this.isPropagationStopped=S3,this}return Jt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=nd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=nd)},persist:function(){},isPersistent:nd}),e}var qs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Im=Nr(qs),Dc=Jt({},qs,{view:0,detail:0}),yO=Nr(Dc),m1,y1,Lu,Ah=Jt({},Dc,{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(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Lu&&(Lu&&t.type==="mousemove"?(m1=t.screenX-Lu.screenX,y1=t.screenY-Lu.screenY):y1=m1=0,Lu=t),m1)},movementY:function(t){return"movementY"in t?t.movementY:y1}}),E3=Nr(Ah),bO=Jt({},Ah,{dataTransfer:0}),_O=Nr(bO),wO=Jt({},Dc,{relatedTarget:0}),b1=Nr(wO),SO=Jt({},qs,{animationName:0,elapsedTime:0,pseudoElement:0}),EO=Nr(SO),OO=Jt({},qs,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),xO=Nr(OO),PO=Jt({},qs,{data:0}),O3=Nr(PO),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(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=TO[t])?!!e[t]:!1}function Dm(){return AO}var RO=Jt({},Dc,{key:function(t){if(t.key){var e=CO[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Cd(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?kO[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dm,charCode:function(t){return t.type==="keypress"?Cd(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Cd(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),MO=Nr(RO),LO=Jt({},Ah,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),x3=Nr(LO),NO=Jt({},Dc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),IO=Nr(NO),DO=Jt({},qs,{propertyName:0,elapsedTime:0,pseudoElement:0}),jO=Nr(DO),FO=Jt({},Ah,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),zO=Nr(FO),BO=[9,13,27,32],jm=Oo&&"CompositionEvent"in window,Ku=null;Oo&&"documentMode"in document&&(Ku=document.documentMode);var UO=Oo&&"TextEvent"in window&&!Ku,x6=Oo&&(!jm||Ku&&8<Ku&&11>=Ku),P3=" ",C3=!1;function P6(t,e){switch(t){case"keyup":return BO.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function C6(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var is=!1;function HO(t,e){switch(t){case"compositionend":return C6(e);case"keypress":return e.which!==32?null:(C3=!0,P3);case"textInput":return t=e.data,t===P3&&C3?null:t;default:return null}}function $O(t,e){if(is)return t==="compositionend"||!jm&&P6(t,e)?(t=O6(),Pd=Nm=na=null,is=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return x6&&e.locale!=="ko"?null:e.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(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!GO[t.type]:e==="textarea"}function k6(t,e,n,r){o6(r),e=Wd(e,"onChange"),0<e.length&&(n=new Im("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Xu=null,dc=null;function VO(t){z6(t,0)}function Rh(t){var e=ls(t);if(Q_(e))return t}function qO(t,e){if(t==="change")return e}var T6=!1;if(Oo){var _1;if(Oo){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(){Xu&&(Xu.detachEvent("onpropertychange",A6),dc=Xu=null)}function A6(t){if(t.propertyName==="value"&&Rh(dc)){var e=[];k6(e,dc,t,Tm(t)),u6(VO,e)}}function WO(t,e,n){t==="focusin"?(A3(),Xu=e,dc=n,Xu.attachEvent("onpropertychange",A6)):t==="focusout"&&A3()}function YO(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Rh(dc)}function KO(t,e){if(t==="click")return Rh(e)}function XO(t,e){if(t==="input"||t==="change")return Rh(e)}function ZO(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Si=typeof Object.is=="function"?Object.is:ZO;function hc(t,e){if(Si(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!nv.call(e,i)||!Si(t[i],e[i]))return!1}return!0}function R3(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function M3(t,e){var n=R3(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=R3(n)}}function R6(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?R6(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function M6(){for(var t=window,e=Bd();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Bd(t.document)}return e}function Fm(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function QO(t){var e=M6(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&R6(n.ownerDocument.documentElement,n)){if(r!==null&&Fm(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=M3(n,o);var a=M3(n,r);i&&a&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var JO=Oo&&"documentMode"in document&&11>=document.documentMode,os=null,wv=null,Zu=null,Sv=!1;function L3(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Sv||os==null||os!==Bd(r)||(r=os,"selectionStart"in r&&Fm(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Zu&&hc(Zu,r)||(Zu=r,r=Wd(wv,"onSelect"),0<r.length&&(e=new Im("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=os)))}function rd(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var as={animationend:rd("Animation","AnimationEnd"),animationiteration:rd("Animation","AnimationIteration"),animationstart:rd("Animation","AnimationStart"),transitionend:rd("Transition","TransitionEnd")},S1={},L6={};Oo&&(L6=document.createElement("div").style,"AnimationEvent"in window||(delete as.animationend.animation,delete as.animationiteration.animation,delete as.animationstart.animation),"TransitionEvent"in window||delete as.transitionend.transition);function Mh(t){if(S1[t])return S1[t];if(!as[t])return t;var e=as[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in L6)return S1[t]=e[n];return t}var N6=Mh("animationend"),I6=Mh("animationiteration"),D6=Mh("animationstart"),j6=Mh("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 wa(t,e){F6.set(t,e),vl(e,[t])}for(var E1=0;E1<N3.length;E1++){var O1=N3[E1],ex=O1.toLowerCase(),tx=O1[0].toUpperCase()+O1.slice(1);wa(ex,"on"+tx)}wa(N6,"onAnimationEnd");wa(I6,"onAnimationIteration");wa(D6,"onAnimationStart");wa("dblclick","onDoubleClick");wa("focusin","onFocus");wa("focusout","onBlur");wa(j6,"onTransitionEnd");Os("onMouseEnter",["mouseout","mouseover"]);Os("onMouseLeave",["mouseout","mouseover"]);Os("onPointerEnter",["pointerout","pointerover"]);Os("onPointerLeave",["pointerout","pointerover"]);vl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));vl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));vl("onBeforeInput",["compositionend","keypress","textInput","paste"]);vl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));vl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));vl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gu="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(" "),nx=new Set("cancel close invalid load scroll toggle".split(" ").concat(Gu));function I3(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,eO(r,e,void 0,t),t.currentTarget=null}function z6(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var a=r.length-1;0<=a;a--){var l=r[a],s=l.instance,f=l.currentTarget;if(l=l.listener,s!==o&&i.isPropagationStopped())break e;I3(i,l,f),o=s}else for(a=0;a<r.length;a++){if(l=r[a],s=l.instance,f=l.currentTarget,l=l.listener,s!==o&&i.isPropagationStopped())break e;I3(i,l,f),o=s}}}if(Hd)throw t=mv,Hd=!1,mv=null,t}function Ut(t,e){var n=e[Cv];n===void 0&&(n=e[Cv]=new Set);var r=t+"__bubble";n.has(r)||(B6(e,t,2,!1),n.add(r))}function x1(t,e,n){var r=0;e&&(r|=4),B6(n,t,r,e)}var id="_reactListening"+Math.random().toString(36).slice(2);function pc(t){if(!t[id]){t[id]=!0,W_.forEach(function(n){n!=="selectionchange"&&(nx.has(n)||x1(n,!1,t),x1(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[id]||(e[id]=!0,x1("selectionchange",!1,e))}}function B6(t,e,n,r){switch(E6(e)){case 1:var i=vO;break;case 4:i=mO;break;default:i=Lm}n=i.bind(null,e,n,t),i=void 0,!vv||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function P1(t,e,n,r,i){var o=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var s=a.tag;if((s===3||s===4)&&(s=a.stateNode.containerInfo,s===i||s.nodeType===8&&s.parentNode===i))return;a=a.return}for(;l!==null;){if(a=Qa(l),a===null)return;if(s=a.tag,s===5||s===6){r=o=a;continue e}l=l.parentNode}}r=r.return}u6(function(){var f=o,h=Tm(n),x=[];e:{var w=F6.get(t);if(w!==void 0){var v=Im,O=t;switch(t){case"keypress":if(Cd(n)===0)break e;case"keydown":case"keyup":v=MO;break;case"focusin":O="focus",v=b1;break;case"focusout":O="blur",v=b1;break;case"beforeblur":case"afterblur":v=b1;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=E3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=_O;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=IO;break;case N6:case I6:case D6:v=EO;break;case j6:v=jO;break;case"scroll":v=yO;break;case"wheel":v=zO;break;case"copy":case"cut":case"paste":v=xO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=x3}var g=(e&4)!==0,b=!g&&t==="scroll",p=g?w!==null?w+"Capture":null:w;g=[];for(var y=f,d;y!==null;){d=y;var m=d.stateNode;if(d.tag===5&&m!==null&&(d=m,p!==null&&(m=sc(y,p),m!=null&&g.push(gc(y,m,d)))),b)break;y=y.return}0<g.length&&(w=new v(w,O,null,n,h),x.push({event:w,listeners:g}))}}if(!(e&7)){e:{if(w=t==="mouseover"||t==="pointerover",v=t==="mouseout"||t==="pointerout",w&&n!==pv&&(O=n.relatedTarget||n.fromElement)&&(Qa(O)||O[xo]))break e;if((v||w)&&(w=h.window===h?h:(w=h.ownerDocument)?w.defaultView||w.parentWindow:window,v?(O=n.relatedTarget||n.toElement,v=f,O=O?Qa(O):null,O!==null&&(b=ml(O),O!==b||O.tag!==5&&O.tag!==6)&&(O=null)):(v=null,O=f),v!==O)){if(g=E3,m="onMouseLeave",p="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(g=x3,m="onPointerLeave",p="onPointerEnter",y="pointer"),b=v==null?w:ls(v),d=O==null?w:ls(O),w=new g(m,y+"leave",v,n,h),w.target=b,w.relatedTarget=d,m=null,Qa(h)===f&&(g=new g(p,y+"enter",O,n,h),g.target=d,g.relatedTarget=b,m=g),b=m,v&&O)t:{for(g=v,p=O,y=0,d=g;d;d=Xl(d))y++;for(d=0,m=p;m;m=Xl(m))d++;for(;0<y-d;)g=Xl(g),y--;for(;0<d-y;)p=Xl(p),d--;for(;y--;){if(g===p||p!==null&&g===p.alternate)break t;g=Xl(g),p=Xl(p)}g=null}else g=null;v!==null&&D3(x,w,v,g,!1),O!==null&&b!==null&&D3(x,b,O,g,!0)}}e:{if(w=f?ls(f):window,v=w.nodeName&&w.nodeName.toLowerCase(),v==="select"||v==="input"&&w.type==="file")var _=qO;else if(k3(w))if(T6)_=XO;else{_=YO;var A=WO}else(v=w.nodeName)&&v.toLowerCase()==="input"&&(w.type==="checkbox"||w.type==="radio")&&(_=KO);if(_&&(_=_(t,f))){k6(x,_,n,h);break e}A&&A(t,w,f),t==="focusout"&&(A=w._wrapperState)&&A.controlled&&w.type==="number"&&uv(w,"number",w.value)}switch(A=f?ls(f):window,t){case"focusin":(k3(A)||A.contentEditable==="true")&&(os=A,wv=f,Zu=null);break;case"focusout":Zu=wv=os=null;break;case"mousedown":Sv=!0;break;case"contextmenu":case"mouseup":case"dragend":Sv=!1,L3(x,n,h);break;case"selectionchange":if(JO)break;case"keydown":case"keyup":L3(x,n,h)}var C;if(jm)e:{switch(t){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else is?P6(t,n)&&(R="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(R="onCompositionStart");R&&(x6&&n.locale!=="ko"&&(is||R!=="onCompositionStart"?R==="onCompositionEnd"&&is&&(C=O6()):(na=h,Nm="value"in na?na.value:na.textContent,is=!0)),A=Wd(f,R),0<A.length&&(R=new O3(R,t,null,n,h),x.push({event:R,listeners:A}),C?R.data=C:(C=C6(n),C!==null&&(R.data=C)))),(C=UO?HO(t,n):$O(t,n))&&(f=Wd(f,"onBeforeInput"),0<f.length&&(h=new O3("onBeforeInput","beforeinput",null,n,h),x.push({event:h,listeners:f}),h.data=C))}z6(x,e)})}function gc(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Wd(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=sc(t,n),o!=null&&r.unshift(gc(t,o,i)),o=sc(t,e),o!=null&&r.push(gc(t,o,i))),t=t.return}return r}function Xl(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function D3(t,e,n,r,i){for(var o=e._reactName,a=[];n!==null&&n!==r;){var l=n,s=l.alternate,f=l.stateNode;if(s!==null&&s===r)break;l.tag===5&&f!==null&&(l=f,i?(s=sc(n,o),s!=null&&a.unshift(gc(n,s,l))):i||(s=sc(n,o),s!=null&&a.push(gc(n,s,l)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var rx=/\r\n?/g,ix=/\u0000|\uFFFD/g;function j3(t){return(typeof t=="string"?t:""+t).replace(rx,`
30
- `).replace(ix,"")}function od(t,e,n){if(e=j3(e),j3(t)!==e&&n)throw Error(xe(425))}function Yd(){}var Ev=null,Ov=null;function xv(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Pv=typeof setTimeout=="function"?setTimeout:void 0,ox=typeof clearTimeout=="function"?clearTimeout:void 0,F3=typeof Promise=="function"?Promise:void 0,ax=typeof queueMicrotask=="function"?queueMicrotask:typeof F3<"u"?function(t){return F3.resolve(null).then(t).catch(lx)}:Pv;function lx(t){setTimeout(function(){throw t})}function C1(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),fc(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);fc(e)}function sa(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function z3(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Ws=Math.random().toString(36).slice(2),Bi="__reactFiber$"+Ws,vc="__reactProps$"+Ws,xo="__reactContainer$"+Ws,Cv="__reactEvents$"+Ws,sx="__reactListeners$"+Ws,ux="__reactHandles$"+Ws;function Qa(t){var e=t[Bi];if(e)return e;for(var n=t.parentNode;n;){if(e=n[xo]||n[Bi]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=z3(t);t!==null;){if(n=t[Bi])return n;t=z3(t)}return e}t=n,n=t.parentNode}return null}function jc(t){return t=t[Bi]||t[xo],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function ls(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(xe(33))}function Lh(t){return t[vc]||null}var kv=[],ss=-1;function Sa(t){return{current:t}}function Ht(t){0>ss||(t.current=kv[ss],kv[ss]=null,ss--)}function It(t,e){ss++,kv[ss]=t.current,t.current=e}var va={},Kn=Sa(va),gr=Sa(!1),al=va;function xs(t,e){var n=t.type.contextTypes;if(!n)return va;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function vr(t){return t=t.childContextTypes,t!=null}function Kd(){Ht(gr),Ht(Kn)}function B3(t,e,n){if(Kn.current!==va)throw Error(xe(168));It(Kn,e),It(gr,n)}function U6(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(xe(108,WE(t)||"Unknown",i));return Jt({},n,r)}function Xd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||va,al=Kn.current,It(Kn,t),It(gr,gr.current),!0}function U3(t,e,n){var r=t.stateNode;if(!r)throw Error(xe(169));n?(t=U6(t,e,al),r.__reactInternalMemoizedMergedChildContext=t,Ht(gr),Ht(Kn),It(Kn,t)):Ht(gr),It(gr,n)}var go=null,Nh=!1,k1=!1;function H6(t){go===null?go=[t]:go.push(t)}function cx(t){Nh=!0,H6(t)}function Ea(){if(!k1&&go!==null){k1=!0;var t=0,e=Ct;try{var n=go;for(Ct=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}go=null,Nh=!1}catch(i){throw go!==null&&(go=go.slice(t+1)),h6(Am,Ea),i}finally{Ct=e,k1=!1}}return null}var us=[],cs=0,Zd=null,Qd=0,qr=[],Wr=0,ll=null,mo=1,yo="";function Xa(t,e){us[cs++]=Qd,us[cs++]=Zd,Zd=t,Qd=e}function $6(t,e,n){qr[Wr++]=mo,qr[Wr++]=yo,qr[Wr++]=ll,ll=t;var r=mo;t=yo;var i=32-vi(r)-1;r&=~(1<<i),n+=1;var o=32-vi(e)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,mo=1<<32-vi(e)+i|n<<i|r,yo=o+t}else mo=1<<o|n<<i|r,yo=t}function zm(t){t.return!==null&&(Xa(t,1),$6(t,1,0))}function Bm(t){for(;t===Zd;)Zd=us[--cs],us[cs]=null,Qd=us[--cs],us[cs]=null;for(;t===ll;)ll=qr[--Wr],qr[Wr]=null,yo=qr[--Wr],qr[Wr]=null,mo=qr[--Wr],qr[Wr]=null}var Ar=null,Tr=null,Vt=!1,gi=null;function G6(t,e){var n=Xr(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function H3(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Ar=t,Tr=sa(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Ar=t,Tr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=ll!==null?{id:mo,overflow:yo}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Xr(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Ar=t,Tr=null,!0):!1;default:return!1}}function Tv(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Av(t){if(Vt){var e=Tr;if(e){var n=e;if(!H3(t,e)){if(Tv(t))throw Error(xe(418));e=sa(n.nextSibling);var r=Ar;e&&H3(t,e)?G6(r,n):(t.flags=t.flags&-4097|2,Vt=!1,Ar=t)}}else{if(Tv(t))throw Error(xe(418));t.flags=t.flags&-4097|2,Vt=!1,Ar=t}}}function $3(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Ar=t}function ad(t){if(t!==Ar)return!1;if(!Vt)return $3(t),Vt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!xv(t.type,t.memoizedProps)),e&&(e=Tr)){if(Tv(t))throw V6(),Error(xe(418));for(;e;)G6(t,e),e=sa(e.nextSibling)}if($3(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(xe(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Tr=sa(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Tr=null}}else Tr=Ar?sa(t.stateNode.nextSibling):null;return!0}function V6(){for(var t=Tr;t;)t=sa(t.nextSibling)}function Ps(){Tr=Ar=null,Vt=!1}function Um(t){gi===null?gi=[t]:gi.push(t)}var fx=Ao.ReactCurrentBatchConfig;function Nu(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(xe(309));var r=n.stateNode}if(!r)throw Error(xe(147,t));var i=r,o=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===o?e.ref:(e=function(a){var l=i.refs;a===null?delete l[o]:l[o]=a},e._stringRef=o,e)}if(typeof t!="string")throw Error(xe(284));if(!n._owner)throw Error(xe(290,t))}return t}function ld(t,e){throw t=Object.prototype.toString.call(e),Error(xe(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function G3(t){var e=t._init;return e(t._payload)}function q6(t){function e(p,y){if(t){var d=p.deletions;d===null?(p.deletions=[y],p.flags|=16):d.push(y)}}function n(p,y){if(!t)return null;for(;y!==null;)e(p,y),y=y.sibling;return null}function r(p,y){for(p=new Map;y!==null;)y.key!==null?p.set(y.key,y):p.set(y.index,y),y=y.sibling;return p}function i(p,y){return p=da(p,y),p.index=0,p.sibling=null,p}function o(p,y,d){return p.index=d,t?(d=p.alternate,d!==null?(d=d.index,d<y?(p.flags|=2,y):d):(p.flags|=2,y)):(p.flags|=1048576,y)}function a(p){return t&&p.alternate===null&&(p.flags|=2),p}function l(p,y,d,m){return y===null||y.tag!==6?(y=I1(d,p.mode,m),y.return=p,y):(y=i(y,d),y.return=p,y)}function s(p,y,d,m){var _=d.type;return _===rs?h(p,y,d.props.children,m,d.key):y!==null&&(y.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Zo&&G3(_)===y.type)?(m=i(y,d.props),m.ref=Nu(p,y,d),m.return=p,m):(m=Nd(d.type,d.key,d.props,null,p.mode,m),m.ref=Nu(p,y,d),m.return=p,m)}function f(p,y,d,m){return y===null||y.tag!==4||y.stateNode.containerInfo!==d.containerInfo||y.stateNode.implementation!==d.implementation?(y=D1(d,p.mode,m),y.return=p,y):(y=i(y,d.children||[]),y.return=p,y)}function h(p,y,d,m,_){return y===null||y.tag!==7?(y=rl(d,p.mode,m,_),y.return=p,y):(y=i(y,d),y.return=p,y)}function x(p,y,d){if(typeof y=="string"&&y!==""||typeof y=="number")return y=I1(""+y,p.mode,d),y.return=p,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Xf:return d=Nd(y.type,y.key,y.props,null,p.mode,d),d.ref=Nu(p,null,y),d.return=p,d;case ns:return y=D1(y,p.mode,d),y.return=p,y;case Zo:var m=y._init;return x(p,m(y._payload),d)}if(Hu(y)||Tu(y))return y=rl(y,p.mode,d,null),y.return=p,y;ld(p,y)}return null}function w(p,y,d,m){var _=y!==null?y.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return _!==null?null:l(p,y,""+d,m);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Xf:return d.key===_?s(p,y,d,m):null;case ns:return d.key===_?f(p,y,d,m):null;case Zo:return _=d._init,w(p,y,_(d._payload),m)}if(Hu(d)||Tu(d))return _!==null?null:h(p,y,d,m,null);ld(p,d)}return null}function v(p,y,d,m,_){if(typeof m=="string"&&m!==""||typeof m=="number")return p=p.get(d)||null,l(y,p,""+m,_);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Xf:return p=p.get(m.key===null?d:m.key)||null,s(y,p,m,_);case ns:return p=p.get(m.key===null?d:m.key)||null,f(y,p,m,_);case Zo:var A=m._init;return v(p,y,d,A(m._payload),_)}if(Hu(m)||Tu(m))return p=p.get(d)||null,h(y,p,m,_,null);ld(y,m)}return null}function O(p,y,d,m){for(var _=null,A=null,C=y,R=y=0,S=null;C!==null&&R<d.length;R++){C.index>R?(S=C,C=null):S=C.sibling;var E=w(p,C,d[R],m);if(E===null){C===null&&(C=S);break}t&&C&&E.alternate===null&&e(p,C),y=o(E,y,R),A===null?_=E:A.sibling=E,A=E,C=S}if(R===d.length)return n(p,C),Vt&&Xa(p,R),_;if(C===null){for(;R<d.length;R++)C=x(p,d[R],m),C!==null&&(y=o(C,y,R),A===null?_=C:A.sibling=C,A=C);return Vt&&Xa(p,R),_}for(C=r(p,C);R<d.length;R++)S=v(C,p,R,d[R],m),S!==null&&(t&&S.alternate!==null&&C.delete(S.key===null?R:S.key),y=o(S,y,R),A===null?_=S:A.sibling=S,A=S);return t&&C.forEach(function(P){return e(p,P)}),Vt&&Xa(p,R),_}function g(p,y,d,m){var _=Tu(d);if(typeof _!="function")throw Error(xe(150));if(d=_.call(d),d==null)throw Error(xe(151));for(var A=_=null,C=y,R=y=0,S=null,E=d.next();C!==null&&!E.done;R++,E=d.next()){C.index>R?(S=C,C=null):S=C.sibling;var P=w(p,C,E.value,m);if(P===null){C===null&&(C=S);break}t&&C&&P.alternate===null&&e(p,C),y=o(P,y,R),A===null?_=P:A.sibling=P,A=P,C=S}if(E.done)return n(p,C),Vt&&Xa(p,R),_;if(C===null){for(;!E.done;R++,E=d.next())E=x(p,E.value,m),E!==null&&(y=o(E,y,R),A===null?_=E:A.sibling=E,A=E);return Vt&&Xa(p,R),_}for(C=r(p,C);!E.done;R++,E=d.next())E=v(C,p,R,E.value,m),E!==null&&(t&&E.alternate!==null&&C.delete(E.key===null?R:E.key),y=o(E,y,R),A===null?_=E:A.sibling=E,A=E);return t&&C.forEach(function(T){return e(p,T)}),Vt&&Xa(p,R),_}function b(p,y,d,m){if(typeof d=="object"&&d!==null&&d.type===rs&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case Xf:e:{for(var _=d.key,A=y;A!==null;){if(A.key===_){if(_=d.type,_===rs){if(A.tag===7){n(p,A.sibling),y=i(A,d.props.children),y.return=p,p=y;break e}}else if(A.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Zo&&G3(_)===A.type){n(p,A.sibling),y=i(A,d.props),y.ref=Nu(p,A,d),y.return=p,p=y;break e}n(p,A);break}else e(p,A);A=A.sibling}d.type===rs?(y=rl(d.props.children,p.mode,m,d.key),y.return=p,p=y):(m=Nd(d.type,d.key,d.props,null,p.mode,m),m.ref=Nu(p,y,d),m.return=p,p=m)}return a(p);case ns:e:{for(A=d.key;y!==null;){if(y.key===A)if(y.tag===4&&y.stateNode.containerInfo===d.containerInfo&&y.stateNode.implementation===d.implementation){n(p,y.sibling),y=i(y,d.children||[]),y.return=p,p=y;break e}else{n(p,y);break}else e(p,y);y=y.sibling}y=D1(d,p.mode,m),y.return=p,p=y}return a(p);case Zo:return A=d._init,b(p,y,A(d._payload),m)}if(Hu(d))return O(p,y,d,m);if(Tu(d))return g(p,y,d,m);ld(p,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,y!==null&&y.tag===6?(n(p,y.sibling),y=i(y,d),y.return=p,p=y):(n(p,y),y=I1(d,p.mode,m),y.return=p,p=y),a(p)):n(p,y)}return b}var Cs=q6(!0),W6=q6(!1),Jd=Sa(null),eh=null,fs=null,Hm=null;function $m(){Hm=fs=eh=null}function Gm(t){var e=Jd.current;Ht(Jd),t._currentValue=e}function Rv(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function ws(t,e){eh=t,Hm=fs=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(dr=!0),t.firstContext=null)}function Jr(t){var e=t._currentValue;if(Hm!==t)if(t={context:t,memoizedValue:e,next:null},fs===null){if(eh===null)throw Error(xe(308));fs=t,eh.dependencies={lanes:0,firstContext:t}}else fs=fs.next=t;return e}var Ja=null;function Vm(t){Ja===null?Ja=[t]:Ja.push(t)}function Y6(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Vm(e)):(n.next=i.next,i.next=n),e.interleaved=n,Po(t,r)}function Po(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Qo=!1;function qm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function K6(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function bo(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ua(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,vt&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Po(t,n)}return i=r.interleaved,i===null?(e.next=e,Vm(r)):(e.next=i.next,i.next=e),r.interleaved=e,Po(t,n)}function kd(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Rm(t,n)}}function V3(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function th(t,e,n,r){var i=t.updateQueue;Qo=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var s=l,f=s.next;s.next=null,a===null?o=f:a.next=f,a=s;var h=t.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==a&&(l===null?h.firstBaseUpdate=f:l.next=f,h.lastBaseUpdate=s))}if(o!==null){var x=i.baseState;a=0,h=f=s=null,l=o;do{var w=l.lane,v=l.eventTime;if((r&w)===w){h!==null&&(h=h.next={eventTime:v,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var O=t,g=l;switch(w=e,v=n,g.tag){case 1:if(O=g.payload,typeof O=="function"){x=O.call(v,x,w);break e}x=O;break e;case 3:O.flags=O.flags&-65537|128;case 0:if(O=g.payload,w=typeof O=="function"?O.call(v,x,w):O,w==null)break e;x=Jt({},x,w);break e;case 2:Qo=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,w=i.effects,w===null?i.effects=[l]:w.push(l))}else v={eventTime:v,lane:w,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(f=h=v,s=x):h=h.next=v,a|=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&&(s=x),i.baseState=s,i.firstBaseUpdate=f,i.lastBaseUpdate=h,e=i.shared.interleaved,e!==null){i=e;do a|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);ul|=a,t.lanes=a,t.memoizedState=x}}function q3(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(xe(191,i));i.call(r)}}}var Fc={},Vi=Sa(Fc),mc=Sa(Fc),yc=Sa(Fc);function el(t){if(t===Fc)throw Error(xe(174));return t}function Wm(t,e){switch(It(yc,e),It(mc,t),It(Vi,Fc),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:fv(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=fv(e,t)}Ht(Vi),It(Vi,e)}function ks(){Ht(Vi),Ht(mc),Ht(yc)}function X6(t){el(yc.current);var e=el(Vi.current),n=fv(e,t.type);e!==n&&(It(mc,t),It(Vi,n))}function Ym(t){mc.current===t&&(Ht(Vi),Ht(mc))}var Zt=Sa(0);function nh(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var T1=[];function Km(){for(var t=0;t<T1.length;t++)T1[t]._workInProgressVersionPrimary=null;T1.length=0}var Td=Ao.ReactCurrentDispatcher,A1=Ao.ReactCurrentBatchConfig,sl=0,Qt=null,mn=null,An=null,rh=!1,Qu=!1,bc=0,dx=0;function qn(){throw Error(xe(321))}function Xm(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Si(t[n],e[n]))return!1;return!0}function Zm(t,e,n,r,i,o){if(sl=o,Qt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Td.current=t===null||t.memoizedState===null?vx:mx,t=n(r,i),Qu){o=0;do{if(Qu=!1,bc=0,25<=o)throw Error(xe(301));o+=1,An=mn=null,e.updateQueue=null,Td.current=yx,t=n(r,i)}while(Qu)}if(Td.current=ih,e=mn!==null&&mn.next!==null,sl=0,An=mn=Qt=null,rh=!1,e)throw Error(xe(300));return t}function Qm(){var t=bc!==0;return bc=0,t}function zi(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return An===null?Qt.memoizedState=An=t:An=An.next=t,An}function ei(){if(mn===null){var t=Qt.alternate;t=t!==null?t.memoizedState:null}else t=mn.next;var e=An===null?Qt.memoizedState:An.next;if(e!==null)An=e,mn=t;else{if(t===null)throw Error(xe(310));mn=t,t={memoizedState:mn.memoizedState,baseState:mn.baseState,baseQueue:mn.baseQueue,queue:mn.queue,next:null},An===null?Qt.memoizedState=An=t:An=An.next=t}return An}function _c(t,e){return typeof e=="function"?e(t):e}function R1(t){var e=ei(),n=e.queue;if(n===null)throw Error(xe(311));n.lastRenderedReducer=t;var r=mn,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var l=a=null,s=null,f=o;do{var h=f.lane;if((sl&h)===h)s!==null&&(s=s.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),r=f.hasEagerState?f.eagerState:t(r,f.action);else{var x={lane:h,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};s===null?(l=s=x,a=r):s=s.next=x,Qt.lanes|=h,ul|=h}f=f.next}while(f!==null&&f!==o);s===null?a=r:s.next=l,Si(r,e.memoizedState)||(dr=!0),e.memoizedState=r,e.baseState=a,e.baseQueue=s,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do o=i.lane,Qt.lanes|=o,ul|=o,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function M1(t){var e=ei(),n=e.queue;if(n===null)throw Error(xe(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do o=t(o,a.action),a=a.next;while(a!==i);Si(o,e.memoizedState)||(dr=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function Z6(){}function Q6(t,e){var n=Qt,r=ei(),i=e(),o=!Si(r.memoizedState,i);if(o&&(r.memoizedState=i,dr=!0),r=r.queue,Jm(tw.bind(null,n,r,t),[t]),r.getSnapshot!==e||o||An!==null&&An.memoizedState.tag&1){if(n.flags|=2048,wc(9,ew.bind(null,n,r,i,e),void 0,null),Rn===null)throw Error(xe(349));sl&30||J6(n,e,i)}return i}function J6(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Qt.updateQueue,e===null?(e={lastEffect:null,stores:null},Qt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function ew(t,e,n,r){e.value=n,e.getSnapshot=r,nw(e)&&rw(t)}function tw(t,e,n){return n(function(){nw(e)&&rw(t)})}function nw(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Si(t,n)}catch{return!0}}function rw(t){var e=Po(t,1);e!==null&&mi(e,t,1,-1)}function W3(t){var e=zi();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_c,lastRenderedState:t},e.queue=t,t=t.dispatch=gx.bind(null,Qt,t),[e.memoizedState,t]}function wc(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Qt.updateQueue,e===null?(e={lastEffect:null,stores:null},Qt.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function iw(){return ei().memoizedState}function Ad(t,e,n,r){var i=zi();Qt.flags|=t,i.memoizedState=wc(1|e,n,void 0,r===void 0?null:r)}function Ih(t,e,n,r){var i=ei();r=r===void 0?null:r;var o=void 0;if(mn!==null){var a=mn.memoizedState;if(o=a.destroy,r!==null&&Xm(r,a.deps)){i.memoizedState=wc(e,n,o,r);return}}Qt.flags|=t,i.memoizedState=wc(1|e,n,o,r)}function Y3(t,e){return Ad(8390656,8,t,e)}function Jm(t,e){return Ih(2048,8,t,e)}function ow(t,e){return Ih(4,2,t,e)}function aw(t,e){return Ih(4,4,t,e)}function lw(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function sw(t,e,n){return n=n!=null?n.concat([t]):null,Ih(4,4,lw.bind(null,e,t),n)}function ey(){}function uw(t,e){var n=ei();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Xm(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function cw(t,e){var n=ei();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Xm(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function fw(t,e,n){return sl&21?(Si(n,e)||(n=v6(),Qt.lanes|=n,ul|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,dr=!0),t.memoizedState=n)}function hx(t,e){var n=Ct;Ct=n!==0&&4>n?n:4,t(!0);var r=A1.transition;A1.transition={};try{t(!1),e()}finally{Ct=n,A1.transition=r}}function dw(){return ei().memoizedState}function px(t,e,n){var r=fa(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hw(t))pw(e,n);else if(n=Y6(t,e,n,r),n!==null){var i=Jn();mi(n,t,r,i),gw(n,e,r)}}function gx(t,e,n){var r=fa(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hw(t))pw(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var a=e.lastRenderedState,l=o(a,n);if(i.hasEagerState=!0,i.eagerState=l,Si(l,a)){var s=e.interleaved;s===null?(i.next=i,Vm(e)):(i.next=s.next,s.next=i),e.interleaved=i;return}}catch{}finally{}n=Y6(t,e,i,r),n!==null&&(i=Jn(),mi(n,t,r,i),gw(n,e,r))}}function hw(t){var e=t.alternate;return t===Qt||e!==null&&e===Qt}function pw(t,e){Qu=rh=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function gw(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Rm(t,n)}}var ih={readContext:Jr,useCallback:qn,useContext:qn,useEffect:qn,useImperativeHandle:qn,useInsertionEffect:qn,useLayoutEffect:qn,useMemo:qn,useReducer:qn,useRef:qn,useState:qn,useDebugValue:qn,useDeferredValue:qn,useTransition:qn,useMutableSource:qn,useSyncExternalStore:qn,useId:qn,unstable_isNewReconciler:!1},vx={readContext:Jr,useCallback:function(t,e){return zi().memoizedState=[t,e===void 0?null:e],t},useContext:Jr,useEffect:Y3,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Ad(4194308,4,lw.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Ad(4194308,4,t,e)},useInsertionEffect:function(t,e){return Ad(4,2,t,e)},useMemo:function(t,e){var n=zi();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=zi();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=px.bind(null,Qt,t),[r.memoizedState,t]},useRef:function(t){var e=zi();return t={current:t},e.memoizedState=t},useState:W3,useDebugValue:ey,useDeferredValue:function(t){return zi().memoizedState=t},useTransition:function(){var t=W3(!1),e=t[0];return t=hx.bind(null,t[1]),zi().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Qt,i=zi();if(Vt){if(n===void 0)throw Error(xe(407));n=n()}else{if(n=e(),Rn===null)throw Error(xe(349));sl&30||J6(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,Y3(tw.bind(null,r,o,t),[t]),r.flags|=2048,wc(9,ew.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=zi(),e=Rn.identifierPrefix;if(Vt){var n=yo,r=mo;n=(r&~(1<<32-vi(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=bc++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=dx++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},mx={readContext:Jr,useCallback:uw,useContext:Jr,useEffect:Jm,useImperativeHandle:sw,useInsertionEffect:ow,useLayoutEffect:aw,useMemo:cw,useReducer:R1,useRef:iw,useState:function(){return R1(_c)},useDebugValue:ey,useDeferredValue:function(t){var e=ei();return fw(e,mn.memoizedState,t)},useTransition:function(){var t=R1(_c)[0],e=ei().memoizedState;return[t,e]},useMutableSource:Z6,useSyncExternalStore:Q6,useId:dw,unstable_isNewReconciler:!1},yx={readContext:Jr,useCallback:uw,useContext:Jr,useEffect:Jm,useImperativeHandle:sw,useInsertionEffect:ow,useLayoutEffect:aw,useMemo:cw,useReducer:M1,useRef:iw,useState:function(){return M1(_c)},useDebugValue:ey,useDeferredValue:function(t){var e=ei();return mn===null?e.memoizedState=t:fw(e,mn.memoizedState,t)},useTransition:function(){var t=M1(_c)[0],e=ei().memoizedState;return[t,e]},useMutableSource:Z6,useSyncExternalStore:Q6,useId:dw,unstable_isNewReconciler:!1};function hi(t,e){if(t&&t.defaultProps){e=Jt({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Mv(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Jt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Dh={isMounted:function(t){return(t=t._reactInternals)?ml(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Jn(),i=fa(t),o=bo(r,i);o.payload=e,n!=null&&(o.callback=n),e=ua(t,o,i),e!==null&&(mi(e,t,i,r),kd(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Jn(),i=fa(t),o=bo(r,i);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=ua(t,o,i),e!==null&&(mi(e,t,i,r),kd(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Jn(),r=fa(t),i=bo(n,r);i.tag=2,e!=null&&(i.callback=e),e=ua(t,i,r),e!==null&&(mi(e,t,r,n),kd(e,t,r))}};function K3(t,e,n,r,i,o,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,a):e.prototype&&e.prototype.isPureReactComponent?!hc(n,r)||!hc(i,o):!0}function vw(t,e,n){var r=!1,i=va,o=e.contextType;return typeof o=="object"&&o!==null?o=Jr(o):(i=vr(e)?al:Kn.current,r=e.contextTypes,o=(r=r!=null)?xs(t,i):va),e=new e(n,o),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Dh,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function X3(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Dh.enqueueReplaceState(e,e.state,null)}function Lv(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},qm(t);var o=e.contextType;typeof o=="object"&&o!==null?i.context=Jr(o):(o=vr(e)?al:Kn.current,i.context=xs(t,o)),i.state=t.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(Mv(t,e,o,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Dh.enqueueReplaceState(i,i.state,null),th(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Ts(t,e){try{var n="",r=e;do n+=qE(r),r=r.return;while(r);var i=n}catch(o){i=`
31
- Error generating stack: `+o.message+`
32
- `+o.stack}return{value:t,source:e,stack:i,digest:null}}function L1(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Nv(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var bx=typeof WeakMap=="function"?WeakMap:Map;function mw(t,e,n){n=bo(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){ah||(ah=!0,Gv=r),Nv(t,e)},n}function yw(t,e,n){n=bo(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){Nv(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Nv(t,e),typeof r!="function"&&(ca===null?ca=new Set([this]):ca.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}function Z3(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new bx;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=Lx.bind(null,t,e,n),e.then(t,t))}function Q3(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function J3(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=bo(-1,1),e.tag=2,ua(n,e,1))),n.lanes|=1),t)}var _x=Ao.ReactCurrentOwner,dr=!1;function Qn(t,e,n,r){e.child=t===null?W6(e,null,n,r):Cs(e,t.child,n,r)}function e5(t,e,n,r,i){n=n.render;var o=e.ref;return ws(e,i),r=Zm(t,e,n,r,o,i),n=Qm(),t!==null&&!dr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Co(t,e,i)):(Vt&&n&&zm(e),e.flags|=1,Qn(t,e,r,i),e.child)}function t5(t,e,n,r,i){if(t===null){var o=n.type;return typeof o=="function"&&!sy(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=o,bw(t,e,o,r,i)):(t=Nd(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!(t.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:hc,n(a,r)&&t.ref===e.ref)return Co(t,e,i)}return e.flags|=1,t=da(o,r),t.ref=e.ref,t.return=e,e.child=t}function bw(t,e,n,r,i){if(t!==null){var o=t.memoizedProps;if(hc(o,r)&&t.ref===e.ref)if(dr=!1,e.pendingProps=r=o,(t.lanes&i)!==0)t.flags&131072&&(dr=!0);else return e.lanes=t.lanes,Co(t,e,i)}return Iv(t,e,n,r,i)}function _w(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},It(hs,Pr),Pr|=n;else{if(!(n&1073741824))return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,It(hs,Pr),Pr|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,It(hs,Pr),Pr|=r}else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,It(hs,Pr),Pr|=r;return Qn(t,e,i,n),e.child}function ww(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Iv(t,e,n,r,i){var o=vr(n)?al:Kn.current;return o=xs(e,o),ws(e,i),n=Zm(t,e,n,r,o,i),r=Qm(),t!==null&&!dr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Co(t,e,i)):(Vt&&r&&zm(e),e.flags|=1,Qn(t,e,n,i),e.child)}function n5(t,e,n,r,i){if(vr(n)){var o=!0;Xd(e)}else o=!1;if(ws(e,i),e.stateNode===null)Rd(t,e),vw(e,n,r),Lv(e,n,r,i),r=!0;else if(t===null){var a=e.stateNode,l=e.memoizedProps;a.props=l;var s=a.context,f=n.contextType;typeof f=="object"&&f!==null?f=Jr(f):(f=vr(n)?al:Kn.current,f=xs(e,f));var h=n.getDerivedStateFromProps,x=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function";x||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||s!==f)&&X3(e,a,r,f),Qo=!1;var w=e.memoizedState;a.state=w,th(e,r,a,i),s=e.memoizedState,l!==r||w!==s||gr.current||Qo?(typeof h=="function"&&(Mv(e,n,h,r),s=e.memoizedState),(l=Qo||K3(e,n,l,r,w,s,f))?(x||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=s),a.props=r,a.state=s,a.context=f,r=l):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{a=e.stateNode,K6(t,e),l=e.memoizedProps,f=e.type===e.elementType?l:hi(e.type,l),a.props=f,x=e.pendingProps,w=a.context,s=n.contextType,typeof s=="object"&&s!==null?s=Jr(s):(s=vr(n)?al:Kn.current,s=xs(e,s));var v=n.getDerivedStateFromProps;(h=typeof v=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==x||w!==s)&&X3(e,a,r,s),Qo=!1,w=e.memoizedState,a.state=w,th(e,r,a,i);var O=e.memoizedState;l!==x||w!==O||gr.current||Qo?(typeof v=="function"&&(Mv(e,n,v,r),O=e.memoizedState),(f=Qo||K3(e,n,f,r,w,O,s)||!1)?(h||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,O,s),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,O,s)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===t.memoizedProps&&w===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&w===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=O),a.props=r,a.state=O,a.context=s,r=f):(typeof a.componentDidUpdate!="function"||l===t.memoizedProps&&w===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&w===t.memoizedState||(e.flags|=1024),r=!1)}return Dv(t,e,n,r,o,i)}function Dv(t,e,n,r,i,o){ww(t,e);var a=(e.flags&128)!==0;if(!r&&!a)return i&&U3(e,n,!1),Co(t,e,o);r=e.stateNode,_x.current=e;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&a?(e.child=Cs(e,t.child,null,o),e.child=Cs(e,null,l,o)):Qn(t,e,l,o),e.memoizedState=r.state,i&&U3(e,n,!0),e.child}function Sw(t){var e=t.stateNode;e.pendingContext?B3(t,e.pendingContext,e.pendingContext!==e.context):e.context&&B3(t,e.context,!1),Wm(t,e.containerInfo)}function r5(t,e,n,r,i){return Ps(),Um(i),e.flags|=256,Qn(t,e,n,r),e.child}var jv={dehydrated:null,treeContext:null,retryLane:0};function Fv(t){return{baseLanes:t,cachePool:null,transitions:null}}function Ew(t,e,n){var r=e.pendingProps,i=Zt.current,o=!1,a=(e.flags&128)!==0,l;if((l=a)||(l=t!==null&&t.memoizedState===null?!1:(i&2)!==0),l?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),It(Zt,i&1),t===null)return Av(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(a=r.children,t=r.fallback,o?(r=e.mode,o=e.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=zh(a,r,0,null),t=rl(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=Fv(n),e.memoizedState=jv,t):ty(e,a));if(i=t.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return wx(t,e,a,r,l,i,n);if(o){o=r.fallback,a=e.mode,i=t.child,l=i.sibling;var s={mode:"hidden",children:r.children};return!(a&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=s,e.deletions=null):(r=da(i,s),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?o=da(l,o):(o=rl(o,a,n,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,a=t.child.memoizedState,a=a===null?Fv(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=t.childLanes&~n,e.memoizedState=jv,r}return o=t.child,t=o.sibling,r=da(o,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function ty(t,e){return e=zh({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function sd(t,e,n,r){return r!==null&&Um(r),Cs(e,t.child,null,n),t=ty(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function wx(t,e,n,r,i,o,a){if(n)return e.flags&256?(e.flags&=-257,r=L1(Error(xe(422))),sd(t,e,a,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=r.fallback,i=e.mode,r=zh({mode:"visible",children:r.children},i,0,null),o=rl(o,i,a,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,e.mode&1&&Cs(e,t.child,null,a),e.child.memoizedState=Fv(a),e.memoizedState=jv,o);if(!(e.mode&1))return sd(t,e,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(xe(419)),r=L1(o,r,void 0),sd(t,e,a,r)}if(l=(a&t.childLanes)!==0,dr||l){if(r=Rn,r!==null){switch(a&-a){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&(r.suspendedLanes|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Po(t,i),mi(r,t,i,-1))}return ly(),r=L1(Error(xe(421))),sd(t,e,a,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=Nx.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,Tr=sa(i.nextSibling),Ar=e,Vt=!0,gi=null,t!==null&&(qr[Wr++]=mo,qr[Wr++]=yo,qr[Wr++]=ll,mo=t.id,yo=t.overflow,ll=e),e=ty(e,r.children),e.flags|=4096,e)}function i5(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Rv(t.return,e,n)}function N1(t,e,n,r,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Ow(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(Qn(t,e,r.children,n),r=Zt.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&i5(t,n,e);else if(t.tag===19)i5(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(It(Zt,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&nh(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),N1(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&nh(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}N1(e,!0,n,null,o);break;case"together":N1(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Rd(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Co(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),ul|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(xe(153));if(e.child!==null){for(t=e.child,n=da(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=da(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Sx(t,e,n){switch(e.tag){case 3:Sw(e),Ps();break;case 5:X6(e);break;case 1:vr(e.type)&&Xd(e);break;case 4:Wm(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;It(Jd,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(It(Zt,Zt.current&1),e.flags|=128,null):n&e.child.childLanes?Ew(t,e,n):(It(Zt,Zt.current&1),t=Co(t,e,n),t!==null?t.sibling:null);It(Zt,Zt.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return Ow(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),It(Zt,Zt.current),r)break;return null;case 22:case 23:return e.lanes=0,_w(t,e,n)}return Co(t,e,n)}var xw,zv,Pw,Cw;xw=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};zv=function(){};Pw=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,el(Vi.current);var o=null;switch(n){case"input":i=lv(t,i),r=lv(t,r),o=[];break;case"select":i=Jt({},i,{value:void 0}),r=Jt({},r,{value:void 0}),o=[];break;case"textarea":i=cv(t,i),r=cv(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Yd)}dv(n,r);var a;n=null;for(f in i)if(!r.hasOwnProperty(f)&&i.hasOwnProperty(f)&&i[f]!=null)if(f==="style"){var l=i[f];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(ac.hasOwnProperty(f)?o||(o=[]):(o=o||[]).push(f,null));for(f in r){var s=r[f];if(l=i!=null?i[f]:void 0,r.hasOwnProperty(f)&&s!==l&&(s!=null||l!=null))if(f==="style")if(l){for(a in l)!l.hasOwnProperty(a)||s&&s.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in s)s.hasOwnProperty(a)&&l[a]!==s[a]&&(n||(n={}),n[a]=s[a])}else n||(o||(o=[]),o.push(f,n)),n=s;else f==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,l=l?l.__html:void 0,s!=null&&l!==s&&(o=o||[]).push(f,s)):f==="children"?typeof s!="string"&&typeof s!="number"||(o=o||[]).push(f,""+s):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(ac.hasOwnProperty(f)?(s!=null&&f==="onScroll"&&Ut("scroll",t),o||l===s||(o=[])):(o=o||[]).push(f,s))}n&&(o=o||[]).push("style",n);var f=o;(e.updateQueue=f)&&(e.flags|=4)}};Cw=function(t,e,n,r){n!==r&&(e.flags|=4)};function Iu(t,e){if(!Vt)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Wn(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function Ex(t,e,n){var r=e.pendingProps;switch(Bm(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wn(e),null;case 1:return vr(e.type)&&Kd(),Wn(e),null;case 3:return r=e.stateNode,ks(),Ht(gr),Ht(Kn),Km(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(ad(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,gi!==null&&(Wv(gi),gi=null))),zv(t,e),Wn(e),null;case 5:Ym(e);var i=el(yc.current);if(n=e.type,t!==null&&e.stateNode!=null)Pw(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(xe(166));return Wn(e),null}if(t=el(Vi.current),ad(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[Bi]=e,r[vc]=o,t=(e.mode&1)!==0,n){case"dialog":Ut("cancel",r),Ut("close",r);break;case"iframe":case"object":case"embed":Ut("load",r);break;case"video":case"audio":for(i=0;i<Gu.length;i++)Ut(Gu[i],r);break;case"source":Ut("error",r);break;case"img":case"image":case"link":Ut("error",r),Ut("load",r);break;case"details":Ut("toggle",r);break;case"input":h3(r,o),Ut("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Ut("invalid",r);break;case"textarea":g3(r,o),Ut("invalid",r)}dv(n,o),i=null;for(var a in o)if(o.hasOwnProperty(a)){var l=o[a];a==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&od(r.textContent,l,t),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&od(r.textContent,l,t),i=["children",""+l]):ac.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&Ut("scroll",r)}switch(n){case"input":Zf(r),p3(r,o,!0);break;case"textarea":Zf(r),v3(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=Yd)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=t6(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=a.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[Bi]=e,t[vc]=r,xw(t,e,!1,!1),e.stateNode=t;e:{switch(a=hv(n,r),n){case"dialog":Ut("cancel",t),Ut("close",t),i=r;break;case"iframe":case"object":case"embed":Ut("load",t),i=r;break;case"video":case"audio":for(i=0;i<Gu.length;i++)Ut(Gu[i],t);i=r;break;case"source":Ut("error",t),i=r;break;case"img":case"image":case"link":Ut("error",t),Ut("load",t),i=r;break;case"details":Ut("toggle",t),i=r;break;case"input":h3(t,r),i=lv(t,r),Ut("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=Jt({},r,{value:void 0}),Ut("invalid",t);break;case"textarea":g3(t,r),i=cv(t,r),Ut("invalid",t);break;default:i=r}dv(n,i),l=i;for(o in l)if(l.hasOwnProperty(o)){var s=l[o];o==="style"?i6(t,s):o==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,s!=null&&n6(t,s)):o==="children"?typeof s=="string"?(n!=="textarea"||s!=="")&&lc(t,s):typeof s=="number"&&lc(t,""+s):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(ac.hasOwnProperty(o)?s!=null&&o==="onScroll"&&Ut("scroll",t):s!=null&&xm(t,o,s,a))}switch(n){case"input":Zf(t),p3(t,r,!1);break;case"textarea":Zf(t),v3(t);break;case"option":r.value!=null&&t.setAttribute("value",""+ga(r.value));break;case"select":t.multiple=!!r.multiple,o=r.value,o!=null?ms(t,!!r.multiple,o,!1):r.defaultValue!=null&&ms(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Yd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Wn(e),null;case 6:if(t&&e.stateNode!=null)Cw(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(xe(166));if(n=el(yc.current),el(Vi.current),ad(e)){if(r=e.stateNode,n=e.memoizedProps,r[Bi]=e,(o=r.nodeValue!==n)&&(t=Ar,t!==null))switch(t.tag){case 3:od(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&od(r.nodeValue,n,(t.mode&1)!==0)}o&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Bi]=e,e.stateNode=r}return Wn(e),null;case 13:if(Ht(Zt),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Vt&&Tr!==null&&e.mode&1&&!(e.flags&128))V6(),Ps(),e.flags|=98560,o=!1;else if(o=ad(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(xe(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(xe(317));o[Bi]=e}else Ps(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Wn(e),o=!1}else gi!==null&&(Wv(gi),gi=null),o=!0;if(!o)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||Zt.current&1?_n===0&&(_n=3):ly())),e.updateQueue!==null&&(e.flags|=4),Wn(e),null);case 4:return ks(),zv(t,e),t===null&&pc(e.stateNode.containerInfo),Wn(e),null;case 10:return Gm(e.type._context),Wn(e),null;case 17:return vr(e.type)&&Kd(),Wn(e),null;case 19:if(Ht(Zt),o=e.memoizedState,o===null)return Wn(e),null;if(r=(e.flags&128)!==0,a=o.rendering,a===null)if(r)Iu(o,!1);else{if(_n!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=nh(t),a!==null){for(e.flags|=128,Iu(o,!1),r=a.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)o=n,t=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=t,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,t=a.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return It(Zt,Zt.current&1|2),e.child}t=t.sibling}o.tail!==null&&ln()>As&&(e.flags|=128,r=!0,Iu(o,!1),e.lanes=4194304)}else{if(!r)if(t=nh(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Iu(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!Vt)return Wn(e),null}else 2*ln()-o.renderingStartTime>As&&n!==1073741824&&(e.flags|=128,r=!0,Iu(o,!1),e.lanes=4194304);o.isBackwards?(a.sibling=e.child,e.child=a):(n=o.last,n!==null?n.sibling=a:e.child=a,o.last=a)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=ln(),e.sibling=null,n=Zt.current,It(Zt,r?n&1|2:n&1),e):(Wn(e),null);case 22:case 23:return ay(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Pr&1073741824&&(Wn(e),e.subtreeFlags&6&&(e.flags|=8192)):Wn(e),null;case 24:return null;case 25:return null}throw Error(xe(156,e.tag))}function Ox(t,e){switch(Bm(e),e.tag){case 1:return vr(e.type)&&Kd(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return ks(),Ht(gr),Ht(Kn),Km(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Ym(e),null;case 13:if(Ht(Zt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(xe(340));Ps()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ht(Zt),null;case 4:return ks(),null;case 10:return Gm(e.type._context),null;case 22:case 23:return ay(),null;case 24:return null;default:return null}}var ud=!1,Yn=!1,xx=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function ds(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){nn(t,e,r)}else n.current=null}function Bv(t,e,n){try{n()}catch(r){nn(t,e,r)}}var o5=!1;function Px(t,e){if(Ev=Vd,t=M6(),Fm(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,l=-1,s=-1,f=0,h=0,x=t,w=null;t:for(;;){for(var v;x!==n||i!==0&&x.nodeType!==3||(l=a+i),x!==o||r!==0&&x.nodeType!==3||(s=a+r),x.nodeType===3&&(a+=x.nodeValue.length),(v=x.firstChild)!==null;)w=x,x=v;for(;;){if(x===t)break t;if(w===n&&++f===i&&(l=a),w===o&&++h===r&&(s=a),(v=x.nextSibling)!==null)break;x=w,w=x.parentNode}x=v}n=l===-1||s===-1?null:{start:l,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ov={focusedElem:t,selectionRange:n},Vd=!1,Ue=e;Ue!==null;)if(e=Ue,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ue=t;else for(;Ue!==null;){e=Ue;try{var O=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(O!==null){var g=O.memoizedProps,b=O.memoizedState,p=e.stateNode,y=p.getSnapshotBeforeUpdate(e.elementType===e.type?g:hi(e.type,g),b);p.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var d=e.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(xe(163))}}catch(m){nn(e,e.return,m)}if(t=e.sibling,t!==null){t.return=e.return,Ue=t;break}Ue=e.return}return O=o5,o5=!1,O}function Ju(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&Bv(e,n,o)}i=i.next}while(i!==r)}}function jh(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Uv(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function kw(t){var e=t.alternate;e!==null&&(t.alternate=null,kw(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Bi],delete e[vc],delete e[Cv],delete e[sx],delete e[ux])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Tw(t){return t.tag===5||t.tag===3||t.tag===4}function a5(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Tw(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Hv(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Yd));else if(r!==4&&(t=t.child,t!==null))for(Hv(t,e,n),t=t.sibling;t!==null;)Hv(t,e,n),t=t.sibling}function $v(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for($v(t,e,n),t=t.sibling;t!==null;)$v(t,e,n),t=t.sibling}var In=null,pi=!1;function Yo(t,e,n){for(n=n.child;n!==null;)Aw(t,e,n),n=n.sibling}function Aw(t,e,n){if(Gi&&typeof Gi.onCommitFiberUnmount=="function")try{Gi.onCommitFiberUnmount(Th,n)}catch{}switch(n.tag){case 5:Yn||ds(n,e);case 6:var r=In,i=pi;In=null,Yo(t,e,n),In=r,pi=i,In!==null&&(pi?(t=In,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):In.removeChild(n.stateNode));break;case 18:In!==null&&(pi?(t=In,n=n.stateNode,t.nodeType===8?C1(t.parentNode,n):t.nodeType===1&&C1(t,n),fc(t)):C1(In,n.stateNode));break;case 4:r=In,i=pi,In=n.stateNode.containerInfo,pi=!0,Yo(t,e,n),In=r,pi=i;break;case 0:case 11:case 14:case 15:if(!Yn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&Bv(n,e,a),i=i.next}while(i!==r)}Yo(t,e,n);break;case 1:if(!Yn&&(ds(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){nn(n,e,l)}Yo(t,e,n);break;case 21:Yo(t,e,n);break;case 22:n.mode&1?(Yn=(r=Yn)||n.memoizedState!==null,Yo(t,e,n),Yn=r):Yo(t,e,n);break;default:Yo(t,e,n)}}function l5(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new xx),e.forEach(function(r){var i=Ix.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ci(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=t,a=e,l=a;e:for(;l!==null;){switch(l.tag){case 5:In=l.stateNode,pi=!1;break e;case 3:In=l.stateNode.containerInfo,pi=!0;break e;case 4:In=l.stateNode.containerInfo,pi=!0;break e}l=l.return}if(In===null)throw Error(xe(160));Aw(o,a,i),In=null,pi=!1;var s=i.alternate;s!==null&&(s.return=null),i.return=null}catch(f){nn(i,e,f)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Rw(e,t),e=e.sibling}function Rw(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(ci(e,t),ji(t),r&4){try{Ju(3,t,t.return),jh(3,t)}catch(g){nn(t,t.return,g)}try{Ju(5,t,t.return)}catch(g){nn(t,t.return,g)}}break;case 1:ci(e,t),ji(t),r&512&&n!==null&&ds(n,n.return);break;case 5:if(ci(e,t),ji(t),r&512&&n!==null&&ds(n,n.return),t.flags&32){var i=t.stateNode;try{lc(i,"")}catch(g){nn(t,t.return,g)}}if(r&4&&(i=t.stateNode,i!=null)){var o=t.memoizedProps,a=n!==null?n.memoizedProps:o,l=t.type,s=t.updateQueue;if(t.updateQueue=null,s!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&J_(i,o),hv(l,a);var f=hv(l,o);for(a=0;a<s.length;a+=2){var h=s[a],x=s[a+1];h==="style"?i6(i,x):h==="dangerouslySetInnerHTML"?n6(i,x):h==="children"?lc(i,x):xm(i,h,x,f)}switch(l){case"input":sv(i,o);break;case"textarea":e6(i,o);break;case"select":var w=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var v=o.value;v!=null?ms(i,!!o.multiple,v,!1):w!==!!o.multiple&&(o.defaultValue!=null?ms(i,!!o.multiple,o.defaultValue,!0):ms(i,!!o.multiple,o.multiple?[]:"",!1))}i[vc]=o}catch(g){nn(t,t.return,g)}}break;case 6:if(ci(e,t),ji(t),r&4){if(t.stateNode===null)throw Error(xe(162));i=t.stateNode,o=t.memoizedProps;try{i.nodeValue=o}catch(g){nn(t,t.return,g)}}break;case 3:if(ci(e,t),ji(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{fc(e.containerInfo)}catch(g){nn(t,t.return,g)}break;case 4:ci(e,t),ji(t);break;case 13:ci(e,t),ji(t),i=t.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(iy=ln())),r&4&&l5(t);break;case 22:if(h=n!==null&&n.memoizedState!==null,t.mode&1?(Yn=(f=Yn)||h,ci(e,t),Yn=f):ci(e,t),ji(t),r&8192){if(f=t.memoizedState!==null,(t.stateNode.isHidden=f)&&!h&&t.mode&1)for(Ue=t,h=t.child;h!==null;){for(x=Ue=h;Ue!==null;){switch(w=Ue,v=w.child,w.tag){case 0:case 11:case 14:case 15:Ju(4,w,w.return);break;case 1:ds(w,w.return);var O=w.stateNode;if(typeof O.componentWillUnmount=="function"){r=w,n=w.return;try{e=r,O.props=e.memoizedProps,O.state=e.memoizedState,O.componentWillUnmount()}catch(g){nn(r,n,g)}}break;case 5:ds(w,w.return);break;case 22:if(w.memoizedState!==null){u5(x);continue}}v!==null?(v.return=w,Ue=v):u5(x)}h=h.sibling}e:for(h=null,x=t;;){if(x.tag===5){if(h===null){h=x;try{i=x.stateNode,f?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=x.stateNode,s=x.memoizedProps.style,a=s!=null&&s.hasOwnProperty("display")?s.display:null,l.style.display=r6("display",a))}catch(g){nn(t,t.return,g)}}}else if(x.tag===6){if(h===null)try{x.stateNode.nodeValue=f?"":x.memoizedProps}catch(g){nn(t,t.return,g)}}else if((x.tag!==22&&x.tag!==23||x.memoizedState===null||x===t)&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;h===x&&(h=null),x=x.return}h===x&&(h=null),x.sibling.return=x.return,x=x.sibling}}break;case 19:ci(e,t),ji(t),r&4&&l5(t);break;case 21:break;default:ci(e,t),ji(t)}}function ji(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(Tw(n)){var r=n;break e}n=n.return}throw Error(xe(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(lc(i,""),r.flags&=-33);var o=a5(t);$v(t,o,i);break;case 3:case 4:var a=r.stateNode.containerInfo,l=a5(t);Hv(t,l,a);break;default:throw Error(xe(161))}}catch(s){nn(t,t.return,s)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Cx(t,e,n){Ue=t,Mw(t)}function Mw(t,e,n){for(var r=(t.mode&1)!==0;Ue!==null;){var i=Ue,o=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||ud;if(!a){var l=i.alternate,s=l!==null&&l.memoizedState!==null||Yn;l=ud;var f=Yn;if(ud=a,(Yn=s)&&!f)for(Ue=i;Ue!==null;)a=Ue,s=a.child,a.tag===22&&a.memoizedState!==null?c5(i):s!==null?(s.return=a,Ue=s):c5(i);for(;o!==null;)Ue=o,Mw(o),o=o.sibling;Ue=i,ud=l,Yn=f}s5(t)}else i.subtreeFlags&8772&&o!==null?(o.return=i,Ue=o):s5(t)}}function s5(t){for(;Ue!==null;){var e=Ue;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Yn||jh(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Yn)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:hi(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&q3(e,o,r);break;case 3:var a=e.updateQueue;if(a!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}q3(e,a,n)}break;case 5:var l=e.stateNode;if(n===null&&e.flags&4){n=l;var s=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":s.autoFocus&&n.focus();break;case"img":s.src&&(n.src=s.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var f=e.alternate;if(f!==null){var h=f.memoizedState;if(h!==null){var x=h.dehydrated;x!==null&&fc(x)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(xe(163))}Yn||e.flags&512&&Uv(e)}catch(w){nn(e,e.return,w)}}if(e===t){Ue=null;break}if(n=e.sibling,n!==null){n.return=e.return,Ue=n;break}Ue=e.return}}function u5(t){for(;Ue!==null;){var e=Ue;if(e===t){Ue=null;break}var n=e.sibling;if(n!==null){n.return=e.return,Ue=n;break}Ue=e.return}}function c5(t){for(;Ue!==null;){var e=Ue;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{jh(4,e)}catch(s){nn(e,n,s)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(s){nn(e,i,s)}}var o=e.return;try{Uv(e)}catch(s){nn(e,o,s)}break;case 5:var a=e.return;try{Uv(e)}catch(s){nn(e,a,s)}}}catch(s){nn(e,e.return,s)}if(e===t){Ue=null;break}var l=e.sibling;if(l!==null){l.return=e.return,Ue=l;break}Ue=e.return}}var kx=Math.ceil,oh=Ao.ReactCurrentDispatcher,ny=Ao.ReactCurrentOwner,Zr=Ao.ReactCurrentBatchConfig,vt=0,Rn=null,fn=null,jn=0,Pr=0,hs=Sa(0),_n=0,Sc=null,ul=0,Fh=0,ry=0,ec=null,fr=null,iy=0,As=1/0,po=null,ah=!1,Gv=null,ca=null,cd=!1,ra=null,lh=0,tc=0,Vv=null,Md=-1,Ld=0;function Jn(){return vt&6?ln():Md!==-1?Md:Md=ln()}function fa(t){return t.mode&1?vt&2&&jn!==0?jn&-jn:fx.transition!==null?(Ld===0&&(Ld=v6()),Ld):(t=Ct,t!==0||(t=window.event,t=t===void 0?16:E6(t.type)),t):1}function mi(t,e,n,r){if(50<tc)throw tc=0,Vv=null,Error(xe(185));Ic(t,n,r),(!(vt&2)||t!==Rn)&&(t===Rn&&(!(vt&2)&&(Fh|=n),_n===4&&ea(t,jn)),mr(t,r),n===1&&vt===0&&!(e.mode&1)&&(As=ln()+500,Nh&&Ea()))}function mr(t,e){var n=t.callbackNode;fO(t,e);var r=Gd(t,t===Rn?jn:0);if(r===0)n!==null&&b3(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&b3(n),e===1)t.tag===0?cx(f5.bind(null,t)):H6(f5.bind(null,t)),ax(function(){!(vt&6)&&Ea()}),n=null;else{switch(m6(r)){case 1:n=Am;break;case 4:n=p6;break;case 16:n=$d;break;case 536870912:n=g6;break;default:n=$d}n=Bw(n,Lw.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function Lw(t,e){if(Md=-1,Ld=0,vt&6)throw Error(xe(327));var n=t.callbackNode;if(Ss()&&t.callbackNode!==n)return null;var r=Gd(t,t===Rn?jn:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=sh(t,r);else{e=r;var i=vt;vt|=2;var o=Iw();(Rn!==t||jn!==e)&&(po=null,As=ln()+500,nl(t,e));do try{Rx();break}catch(l){Nw(t,l)}while(!0);$m(),oh.current=o,vt=i,fn!==null?e=0:(Rn=null,jn=0,e=_n)}if(e!==0){if(e===2&&(i=yv(t),i!==0&&(r=i,e=qv(t,i))),e===1)throw n=Sc,nl(t,0),ea(t,r),mr(t,ln()),n;if(e===6)ea(t,r);else{if(i=t.current.alternate,!(r&30)&&!Tx(i)&&(e=sh(t,r),e===2&&(o=yv(t),o!==0&&(r=o,e=qv(t,o))),e===1))throw n=Sc,nl(t,0),ea(t,r),mr(t,ln()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(xe(345));case 2:Za(t,fr,po);break;case 3:if(ea(t,r),(r&130023424)===r&&(e=iy+500-ln(),10<e)){if(Gd(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){Jn(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Pv(Za.bind(null,t,fr,po),e);break}Za(t,fr,po);break;case 4:if(ea(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var a=31-vi(r);o=1<<a,a=e[a],a>i&&(i=a),r&=~o}if(r=i,r=ln()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*kx(r/1960))-r,10<r){t.timeoutHandle=Pv(Za.bind(null,t,fr,po),r);break}Za(t,fr,po);break;case 5:Za(t,fr,po);break;default:throw Error(xe(329))}}}return mr(t,ln()),t.callbackNode===n?Lw.bind(null,t):null}function qv(t,e){var n=ec;return t.current.memoizedState.isDehydrated&&(nl(t,e).flags|=256),t=sh(t,e),t!==2&&(e=fr,fr=n,e!==null&&Wv(e)),t}function Wv(t){fr===null?fr=t:fr.push.apply(fr,t)}function Tx(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!Si(o(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ea(t,e){for(e&=~ry,e&=~Fh,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-vi(e),r=1<<n;t[n]=-1,e&=~r}}function f5(t){if(vt&6)throw Error(xe(327));Ss();var e=Gd(t,0);if(!(e&1))return mr(t,ln()),null;var n=sh(t,e);if(t.tag!==0&&n===2){var r=yv(t);r!==0&&(e=r,n=qv(t,r))}if(n===1)throw n=Sc,nl(t,0),ea(t,e),mr(t,ln()),n;if(n===6)throw Error(xe(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Za(t,fr,po),mr(t,ln()),null}function oy(t,e){var n=vt;vt|=1;try{return t(e)}finally{vt=n,vt===0&&(As=ln()+500,Nh&&Ea())}}function cl(t){ra!==null&&ra.tag===0&&!(vt&6)&&Ss();var e=vt;vt|=1;var n=Zr.transition,r=Ct;try{if(Zr.transition=null,Ct=1,t)return t()}finally{Ct=r,Zr.transition=n,vt=e,!(vt&6)&&Ea()}}function ay(){Pr=hs.current,Ht(hs)}function nl(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,ox(n)),fn!==null)for(n=fn.return;n!==null;){var r=n;switch(Bm(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Kd();break;case 3:ks(),Ht(gr),Ht(Kn),Km();break;case 5:Ym(r);break;case 4:ks();break;case 13:Ht(Zt);break;case 19:Ht(Zt);break;case 10:Gm(r.type._context);break;case 22:case 23:ay()}n=n.return}if(Rn=t,fn=t=da(t.current,null),jn=Pr=e,_n=0,Sc=null,ry=Fh=ul=0,fr=ec=null,Ja!==null){for(e=0;e<Ja.length;e++)if(n=Ja[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=i,r.next=a}n.pending=r}Ja=null}return t}function Nw(t,e){do{var n=fn;try{if($m(),Td.current=ih,rh){for(var r=Qt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}rh=!1}if(sl=0,An=mn=Qt=null,Qu=!1,bc=0,ny.current=null,n===null||n.return===null){_n=1,Sc=e,fn=null;break}e:{var o=t,a=n.return,l=n,s=e;if(e=jn,l.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){var f=s,h=l,x=h.tag;if(!(h.mode&1)&&(x===0||x===11||x===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 v=Q3(a);if(v!==null){v.flags&=-257,J3(v,a,l,o,e),v.mode&1&&Z3(o,f,e),e=v,s=f;var O=e.updateQueue;if(O===null){var g=new Set;g.add(s),e.updateQueue=g}else O.add(s);break e}else{if(!(e&1)){Z3(o,f,e),ly();break e}s=Error(xe(426))}}else if(Vt&&l.mode&1){var b=Q3(a);if(b!==null){!(b.flags&65536)&&(b.flags|=256),J3(b,a,l,o,e),Um(Ts(s,l));break e}}o=s=Ts(s,l),_n!==4&&(_n=2),ec===null?ec=[o]:ec.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var p=mw(o,s,e);V3(o,p);break e;case 1:l=s;var y=o.type,d=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(ca===null||!ca.has(d)))){o.flags|=65536,e&=-e,o.lanes|=e;var m=yw(o,l,e);V3(o,m);break e}}o=o.return}while(o!==null)}jw(n)}catch(_){e=_,fn===n&&n!==null&&(fn=n=n.return);continue}break}while(!0)}function Iw(){var t=oh.current;return oh.current=ih,t===null?ih:t}function ly(){(_n===0||_n===3||_n===2)&&(_n=4),Rn===null||!(ul&268435455)&&!(Fh&268435455)||ea(Rn,jn)}function sh(t,e){var n=vt;vt|=2;var r=Iw();(Rn!==t||jn!==e)&&(po=null,nl(t,e));do try{Ax();break}catch(i){Nw(t,i)}while(!0);if($m(),vt=n,oh.current=r,fn!==null)throw Error(xe(261));return Rn=null,jn=0,_n}function Ax(){for(;fn!==null;)Dw(fn)}function Rx(){for(;fn!==null&&!nO();)Dw(fn)}function Dw(t){var e=zw(t.alternate,t,Pr);t.memoizedProps=t.pendingProps,e===null?jw(t):fn=e,ny.current=null}function jw(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=Ox(n,e),n!==null){n.flags&=32767,fn=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{_n=6,fn=null;return}}else if(n=Ex(n,e,Pr),n!==null){fn=n;return}if(e=e.sibling,e!==null){fn=e;return}fn=e=t}while(e!==null);_n===0&&(_n=5)}function Za(t,e,n){var r=Ct,i=Zr.transition;try{Zr.transition=null,Ct=1,Mx(t,e,n,r)}finally{Zr.transition=i,Ct=r}return null}function Mx(t,e,n,r){do Ss();while(ra!==null);if(vt&6)throw Error(xe(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(xe(177));t.callbackNode=null,t.callbackPriority=0;var o=n.lanes|n.childLanes;if(dO(t,o),t===Rn&&(fn=Rn=null,jn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||cd||(cd=!0,Bw($d,function(){return Ss(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Zr.transition,Zr.transition=null;var a=Ct;Ct=1;var l=vt;vt|=4,ny.current=null,Px(t,n),Rw(n,t),QO(Ov),Vd=!!Ev,Ov=Ev=null,t.current=n,Cx(n),rO(),vt=l,Ct=a,Zr.transition=o}else t.current=n;if(cd&&(cd=!1,ra=t,lh=i),o=t.pendingLanes,o===0&&(ca=null),aO(n.stateNode),mr(t,ln()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(ah)throw ah=!1,t=Gv,Gv=null,t;return lh&1&&t.tag!==0&&Ss(),o=t.pendingLanes,o&1?t===Vv?tc++:(tc=0,Vv=t):tc=0,Ea(),null}function Ss(){if(ra!==null){var t=m6(lh),e=Zr.transition,n=Ct;try{if(Zr.transition=null,Ct=16>t?16:t,ra===null)var r=!1;else{if(t=ra,ra=null,lh=0,vt&6)throw Error(xe(331));var i=vt;for(vt|=4,Ue=t.current;Ue!==null;){var o=Ue,a=o.child;if(Ue.flags&16){var l=o.deletions;if(l!==null){for(var s=0;s<l.length;s++){var f=l[s];for(Ue=f;Ue!==null;){var h=Ue;switch(h.tag){case 0:case 11:case 15:Ju(8,h,o)}var x=h.child;if(x!==null)x.return=h,Ue=x;else for(;Ue!==null;){h=Ue;var w=h.sibling,v=h.return;if(kw(h),h===f){Ue=null;break}if(w!==null){w.return=v,Ue=w;break}Ue=v}}}var O=o.alternate;if(O!==null){var g=O.child;if(g!==null){O.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}Ue=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,Ue=a;else e:for(;Ue!==null;){if(o=Ue,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ju(9,o,o.return)}var p=o.sibling;if(p!==null){p.return=o.return,Ue=p;break e}Ue=o.return}}var y=t.current;for(Ue=y;Ue!==null;){a=Ue;var d=a.child;if(a.subtreeFlags&2064&&d!==null)d.return=a,Ue=d;else e:for(a=y;Ue!==null;){if(l=Ue,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:jh(9,l)}}catch(_){nn(l,l.return,_)}if(l===a){Ue=null;break e}var m=l.sibling;if(m!==null){m.return=l.return,Ue=m;break e}Ue=l.return}}if(vt=i,Ea(),Gi&&typeof Gi.onPostCommitFiberRoot=="function")try{Gi.onPostCommitFiberRoot(Th,t)}catch{}r=!0}return r}finally{Ct=n,Zr.transition=e}}return!1}function d5(t,e,n){e=Ts(n,e),e=mw(t,e,1),t=ua(t,e,1),e=Jn(),t!==null&&(Ic(t,1,e),mr(t,e))}function nn(t,e,n){if(t.tag===3)d5(t,t,n);else for(;e!==null;){if(e.tag===3){d5(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ca===null||!ca.has(r))){t=Ts(n,t),t=yw(e,t,1),e=ua(e,t,1),t=Jn(),e!==null&&(Ic(e,1,t),mr(e,t));break}}e=e.return}}function Lx(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Jn(),t.pingedLanes|=t.suspendedLanes&n,Rn===t&&(jn&n)===n&&(_n===4||_n===3&&(jn&130023424)===jn&&500>ln()-iy?nl(t,0):ry|=n),mr(t,e)}function Fw(t,e){e===0&&(t.mode&1?(e=ed,ed<<=1,!(ed&130023424)&&(ed=4194304)):e=1);var n=Jn();t=Po(t,e),t!==null&&(Ic(t,e,n),mr(t,n))}function Nx(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Fw(t,n)}function Ix(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(xe(314))}r!==null&&r.delete(e),Fw(t,n)}var zw;zw=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||gr.current)dr=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return dr=!1,Sx(t,e,n);dr=!!(t.flags&131072)}else dr=!1,Vt&&e.flags&1048576&&$6(e,Qd,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Rd(t,e),t=e.pendingProps;var i=xs(e,Kn.current);ws(e,n),i=Zm(null,e,r,t,i,n);var o=Qm();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,vr(r)?(o=!0,Xd(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,qm(e),i.updater=Dh,e.stateNode=i,i._reactInternals=e,Lv(e,r,t,n),e=Dv(null,e,r,!0,o,n)):(e.tag=0,Vt&&o&&zm(e),Qn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Rd(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=jx(r),t=hi(r,t),i){case 0:e=Iv(null,e,r,t,n);break e;case 1:e=n5(null,e,r,t,n);break e;case 11:e=e5(null,e,r,t,n);break e;case 14:e=t5(null,e,r,hi(r.type,t),n);break e}throw Error(xe(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:hi(r,i),Iv(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:hi(r,i),n5(t,e,r,i,n);case 3:e:{if(Sw(e),t===null)throw Error(xe(387));r=e.pendingProps,o=e.memoizedState,i=o.element,K6(t,e),th(e,r,null,n);var a=e.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Ts(Error(xe(423)),e),e=r5(t,e,r,n,i);break e}else if(r!==i){i=Ts(Error(xe(424)),e),e=r5(t,e,r,n,i);break e}else for(Tr=sa(e.stateNode.containerInfo.firstChild),Ar=e,Vt=!0,gi=null,n=W6(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ps(),r===i){e=Co(t,e,n);break e}Qn(t,e,r,n)}e=e.child}return e;case 5:return X6(e),t===null&&Av(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,a=i.children,xv(r,i)?a=null:o!==null&&xv(r,o)&&(e.flags|=32),ww(t,e),Qn(t,e,a,n),e.child;case 6:return t===null&&Av(e),null;case 13:return Ew(t,e,n);case 4:return Wm(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Cs(e,null,r,n):Qn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:hi(r,i),e5(t,e,r,i,n);case 7:return Qn(t,e,e.pendingProps,n),e.child;case 8:return Qn(t,e,e.pendingProps.children,n),e.child;case 12:return Qn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,a=i.value,It(Jd,r._currentValue),r._currentValue=a,o!==null)if(Si(o.value,a)){if(o.children===i.children&&!gr.current){e=Co(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var l=o.dependencies;if(l!==null){a=o.child;for(var s=l.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=bo(-1,n&-n),s.tag=2;var f=o.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?s.next=s:(s.next=h.next,h.next=s),f.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),Rv(o.return,n,e),l.lanes|=n;break}s=s.next}}else if(o.tag===10)a=o.type===e.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(xe(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),Rv(a,n,e),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===e){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Qn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,ws(e,n),i=Jr(i),r=r(i),e.flags|=1,Qn(t,e,r,n),e.child;case 14:return r=e.type,i=hi(r,e.pendingProps),i=hi(r.type,i),t5(t,e,r,i,n);case 15:return bw(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:hi(r,i),Rd(t,e),e.tag=1,vr(r)?(t=!0,Xd(e)):t=!1,ws(e,n),vw(e,r,i),Lv(e,r,i,n),Dv(null,e,r,!0,t,n);case 19:return Ow(t,e,n);case 22:return _w(t,e,n)}throw Error(xe(156,e.tag))};function Bw(t,e){return h6(t,e)}function Dx(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xr(t,e,n,r){return new Dx(t,e,n,r)}function sy(t){return t=t.prototype,!(!t||!t.isReactComponent)}function jx(t){if(typeof t=="function")return sy(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Cm)return 11;if(t===km)return 14}return 2}function da(t,e){var n=t.alternate;return n===null?(n=Xr(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Nd(t,e,n,r,i,o){var a=2;if(r=t,typeof t=="function")sy(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case rs:return rl(n.children,i,o,e);case Pm:a=8,i|=8;break;case rv:return t=Xr(12,n,e,i|2),t.elementType=rv,t.lanes=o,t;case iv:return t=Xr(13,n,e,i),t.elementType=iv,t.lanes=o,t;case ov:return t=Xr(19,n,e,i),t.elementType=ov,t.lanes=o,t;case X_:return zh(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Y_:a=10;break e;case K_:a=9;break e;case Cm:a=11;break e;case km:a=14;break e;case Zo:a=16,r=null;break e}throw Error(xe(130,t==null?t:typeof t,""))}return e=Xr(a,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function rl(t,e,n,r){return t=Xr(7,t,r,e),t.lanes=n,t}function zh(t,e,n,r){return t=Xr(22,t,r,e),t.elementType=X_,t.lanes=n,t.stateNode={isHidden:!1},t}function I1(t,e,n){return t=Xr(6,t,null,e),t.lanes=n,t}function D1(t,e,n){return e=Xr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Fx(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=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=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function uy(t,e,n,r,i,o,a,l,s){return t=new Fx(t,e,n,l,s),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Xr(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qm(o),t}function zx(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ns,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function Uw(t){if(!t)return va;t=t._reactInternals;e:{if(ml(t)!==t||t.tag!==1)throw Error(xe(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(vr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(xe(171))}if(t.tag===1){var n=t.type;if(vr(n))return U6(t,n,e)}return e}function Hw(t,e,n,r,i,o,a,l,s){return t=uy(n,r,!0,t,i,o,a,l,s),t.context=Uw(null),n=t.current,r=Jn(),i=fa(n),o=bo(r,i),o.callback=e??null,ua(n,o,i),t.current.lanes=i,Ic(t,i,r),mr(t,r),t}function Bh(t,e,n,r){var i=e.current,o=Jn(),a=fa(i);return n=Uw(n),e.context===null?e.context=n:e.pendingContext=n,e=bo(o,a),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=ua(i,e,a),t!==null&&(mi(t,i,a,o),kd(t,i,a)),a}function uh(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function h5(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function cy(t,e){h5(t,e),(t=t.alternate)&&h5(t,e)}function Bx(){return null}var $w=typeof reportError=="function"?reportError:function(t){console.error(t)};function fy(t){this._internalRoot=t}Uh.prototype.render=fy.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(xe(409));Bh(t,e,null,null)};Uh.prototype.unmount=fy.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;cl(function(){Bh(null,t,null,null)}),e[xo]=null}};function Uh(t){this._internalRoot=t}Uh.prototype.unstable_scheduleHydration=function(t){if(t){var e=_6();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Jo.length&&e!==0&&e<Jo[n].priority;n++);Jo.splice(n,0,t),n===0&&S6(t)}};function dy(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Hh(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function p5(){}function Ux(t,e,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var f=uh(a);o.call(f)}}var a=Hw(e,r,t,0,null,!1,!1,"",p5);return t._reactRootContainer=a,t[xo]=a.current,pc(t.nodeType===8?t.parentNode:t),cl(),a}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var f=uh(s);l.call(f)}}var s=uy(t,0,!1,null,null,!1,!1,"",p5);return t._reactRootContainer=s,t[xo]=s.current,pc(t.nodeType===8?t.parentNode:t),cl(function(){Bh(e,s,n,r)}),s}function $h(t,e,n,r,i){var o=n._reactRootContainer;if(o){var a=o;if(typeof i=="function"){var l=i;i=function(){var s=uh(a);l.call(s)}}Bh(e,a,t,i)}else a=Ux(n,e,t,i,r);return uh(a)}y6=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=$u(e.pendingLanes);n!==0&&(Rm(e,n|1),mr(e,ln()),!(vt&6)&&(As=ln()+500,Ea()))}break;case 13:cl(function(){var r=Po(t,1);if(r!==null){var i=Jn();mi(r,t,1,i)}}),cy(t,1)}};Mm=function(t){if(t.tag===13){var e=Po(t,134217728);if(e!==null){var n=Jn();mi(e,t,134217728,n)}cy(t,134217728)}};b6=function(t){if(t.tag===13){var e=fa(t),n=Po(t,e);if(n!==null){var r=Jn();mi(n,t,e,r)}cy(t,e)}};_6=function(){return Ct};w6=function(t,e){var n=Ct;try{return Ct=t,e()}finally{Ct=n}};gv=function(t,e,n){switch(e){case"input":if(sv(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=Lh(r);if(!i)throw Error(xe(90));Q_(r),sv(r,i)}}}break;case"textarea":e6(t,n);break;case"select":e=n.value,e!=null&&ms(t,!!n.multiple,e,!1)}};l6=oy;s6=cl;var Hx={usingClientEntryPoint:!1,Events:[jc,ls,Lh,o6,a6,oy]},Du={findFiberByHostInstance:Qa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$x={bundleType:Du.bundleType,version:Du.version,rendererPackageName:Du.rendererPackageName,rendererConfig:Du.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ao.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=f6(t),t===null?null:t.stateNode},findFiberByHostInstance:Du.findFiberByHostInstance||Bx,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 fd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fd.isDisabled&&fd.supportsFiber)try{Th=fd.inject($x),Gi=fd}catch{}}Lr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hx;Lr.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dy(e))throw Error(xe(200));return zx(t,e,null,n)};Lr.createRoot=function(t,e){if(!dy(t))throw Error(xe(299));var n=!1,r="",i=$w;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=uy(t,1,!1,null,null,n,!1,r,i),t[xo]=e.current,pc(t.nodeType===8?t.parentNode:t),new fy(e)};Lr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(xe(188)):(t=Object.keys(t).join(","),Error(xe(268,t)));return t=f6(e),t=t===null?null:t.stateNode,t};Lr.flushSync=function(t){return cl(t)};Lr.hydrate=function(t,e,n){if(!Hh(e))throw Error(xe(200));return $h(null,t,e,!0,n)};Lr.hydrateRoot=function(t,e,n){if(!dy(t))throw Error(xe(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",a=$w;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),e=Hw(e,null,t,1,n??null,i,!1,o,a),t[xo]=e.current,pc(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new Uh(e)};Lr.render=function(t,e,n){if(!Hh(e))throw Error(xe(200));return $h(null,t,e,!1,n)};Lr.unmountComponentAtNode=function(t){if(!Hh(t))throw Error(xe(40));return t._reactRootContainer?(cl(function(){$h(null,null,t,!1,function(){t._reactRootContainer=null,t[xo]=null})}),!0):!1};Lr.unstable_batchedUpdates=oy;Lr.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Hh(n))throw Error(xe(200));if(t==null||t._reactInternals===void 0)throw Error(xe(38));return $h(t,e,n,!1,r)};Lr.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(t){console.error(t)}}Gw(),G_.exports=Lr;var Vw=G_.exports,g5=Vw;zd.createRoot=g5.createRoot,zd.hydrateRoot=g5.hydrateRoot;var qw={};function tt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];throw new Error(typeof t=="number"?"[MobX] minified error nr: "+t+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var Gx={};function hy(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Gx}var Ww=Object.assign,ch=Object.getOwnPropertyDescriptor,qi=Object.defineProperty,zc=Object.prototype,Yv=[];Object.freeze(Yv);var py={};Object.freeze(py);var Vx=typeof Proxy<"u",qx=Object.toString();function Yw(){Vx||tt("Proxy not available")}function Kw(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var ps=function(){};function Mr(t){return typeof t=="function"}function fl(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function Gh(t){return t!==null&&typeof t=="object"}function ko(t){if(!Gh(t))return!1;var e=Object.getPrototypeOf(t);if(e==null)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n.toString()===qx}function Xw(t){var e=t==null?void 0:t.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function Bc(t,e,n){qi(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Zw(t,e,n){qi(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Oa(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(r){return Gh(r)&&r[n]===!0}}function Ys(t){return t!=null&&Object.prototype.toString.call(t)==="[object Map]"}function Wx(t){var e=Object.getPrototypeOf(t),n=Object.getPrototypeOf(e),r=Object.getPrototypeOf(n);return r===null}function vo(t){return t!=null&&Object.prototype.toString.call(t)==="[object Set]"}var Qw=typeof Object.getOwnPropertySymbols<"u";function Yx(t){var e=Object.keys(t);if(!Qw)return e;var n=Object.getOwnPropertySymbols(t);return n.length?[].concat(e,n.filter(function(r){return zc.propertyIsEnumerable.call(t,r)})):e}var Rs=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Qw?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function Jw(t){return t===null?null:typeof t=="object"?""+t:t}function _o(t,e){return zc.hasOwnProperty.call(t,e)}var Kx=Object.getOwnPropertyDescriptors||function(e){var n={};return Rs(e).forEach(function(r){n[r]=ch(e,r)}),n};function Cr(t,e){return!!(t&e)}function kr(t,e,n){return n?t|=e:t&=~e,t}function v5(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Xx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Qx(r.key),r)}}function Ks(t,e,n){return e&&Xx(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function gs(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Jx(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}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 ma(){return ma=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ma.apply(null,arguments)}function e8(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Kv(t,e)}function Kv(t,e){return Kv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Kv(t,e)}function Zx(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Qx(t){var e=Zx(t,"string");return typeof e=="symbol"?e:e+""}function Jx(t,e){if(t){if(typeof t=="string")return v5(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v5(t,e):void 0}}var $i=Symbol("mobx-stored-annotations");function yi(t){function e(n,r){if(Uc(r))return t.decorate_20223_(n,r);Xs(n,r,t)}return Object.assign(e,t)}function Xs(t,e,n){_o(t,$i)||Bc(t,$i,ma({},t[$i])),sP(n)||(t[$i][e]=n)}function eP(t){return _o(t,$i)||Bc(t,$i,ma({},t[$i])),t[$i]}function Uc(t){return typeof t=="object"&&typeof t.kind=="string"}var qe=Symbol("mobx administration"),xa=function(){function t(n){n===void 0&&(n="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=wt.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var e=t.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},e.reportObserved=function(){return b8(this)},e.reportChanged=function(){hr(),_8(this),pr()},e.toString=function(){return this.name_},Ks(t,[{key:"isBeingObserved",get:function(){return Cr(this.flags_,t.isBeingObservedMask_)},set:function(r){this.flags_=kr(this.flags_,t.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Cr(this.flags_,t.isPendingUnobservationMask_)},set:function(r){this.flags_=kr(this.flags_,t.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Cr(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=kr(this.flags_,t.diffValueMask_,r===1)}}])}();xa.isBeingObservedMask_=1;xa.isPendingUnobservationMask_=2;xa.diffValueMask_=4;var gy=Oa("Atom",xa);function Ec(t,e,n){e===void 0&&(e=ps),n===void 0&&(n=ps);var r=new xa(t);return e!==ps&&T8(r,e),n!==ps&&wy(r,n),r}function tP(t,e){return t===e}function nP(t,e){return Ry(t,e)}function rP(t,e){return Ry(t,e,1)}function iP(t,e){return Object.is?Object.is(t,e):t===e?t!==0||1/t===1/e:t!==t&&e!==e}var dl={identity:tP,structural:nP,default:iP,shallow:rP};function hl(t,e,n){return Qh(t)?t:Array.isArray(t)?Rt.array(t,{name:n}):ko(t)?Rt.object(t,void 0,{name:n}):Ys(t)?Rt.map(t,{name:n}):vo(t)?Rt.set(t,{name:n}):typeof t=="function"&&!$c(t)&&!Ns(t)?Xw(t)?gl(t):Ms(n,t):t}function oP(t,e,n){if(t==null||Mn(t)||nr(t)||zn(t)||yn(t))return t;if(Array.isArray(t))return Rt.array(t,{name:n,deep:!1});if(ko(t))return Rt.object(t,void 0,{name:n,deep:!1});if(Ys(t))return Rt.map(t,{name:n,deep:!1});if(vo(t))return Rt.set(t,{name:n,deep:!1})}function Vh(t){return t}function aP(t,e){return Ry(t,e)?e:t}var t8="override",lP=yi({annotationType_:t8,make_:uP,extend_:cP,decorate_20223_:fP});function sP(t){return t.annotationType_===t8}function uP(t,e){return 0}function cP(t,e,n,r){tt("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function fP(t,e){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function Hc(t,e){return{annotationType_:t,options_:e,make_:dP,extend_:hP,decorate_20223_:pP}}function dP(t,e,n,r){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(t,e,n,!1)===null?0:1;if(r===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if($c(n.value))return 1;var o=n8(t,this,e,n,!1);return qi(r,e,o),2}function hP(t,e,n,r){var i=n8(t,this,e,n);return t.defineProperty_(e,i,r)}function pP(t,e){var n=e.kind,r=e.name,i=e.addInitializer,o=this,a=function(f){var h,x,w,v;return ya((h=(x=o.options_)==null?void 0:x.name)!=null?h:r.toString(),f,(w=(v=o.options_)==null?void 0:v.autoAction)!=null?w:!1)};if(n=="field"){i(function(){Xs(this,r,o)});return}if(n=="method"){var l;return $c(t)||(t=a(t)),(l=this.options_)!=null&&l.bound&&i(function(){var s=this,f=s[r].bind(s);f.isMobxAction=!0,s[r]=f}),t}tt("Cannot apply '"+o.annotationType_+"' to '"+String(r)+"' (kind: "+n+"):"+(`
34
- '`+o.annotationType_+"' can only be used on properties with a function value."))}function gP(t,e,n,r){e.annotationType_,r.value}function n8(t,e,n,r,i){var o,a,l,s,f,h,x;i===void 0&&(i=Re.safeDescriptors),gP(t,e,n,r);var w=r.value;if((o=e.options_)!=null&&o.bound){var v;w=w.bind((v=t.proxy_)!=null?v:t.target_)}return{value:ya((a=(l=e.options_)==null?void 0:l.name)!=null?a:n.toString(),w,(s=(f=e.options_)==null?void 0:f.autoAction)!=null?s:!1,(h=e.options_)!=null&&h.bound?(x=t.proxy_)!=null?x:t.target_:void 0),configurable:i?t.isPlainObject_:!0,enumerable:!1,writable:!i}}function r8(t,e){return{annotationType_:t,options_:e,make_:vP,extend_:mP,decorate_20223_:yP}}function vP(t,e,n,r){var i;if(r===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!_o(t.target_,e)||!Ns(t.target_[e]))&&this.extend_(t,e,n,!1)===null)return 0;if(Ns(n.value))return 1;var o=i8(t,this,e,n,!1,!1);return qi(r,e,o),2}function mP(t,e,n,r){var i,o=i8(t,this,e,n,(i=this.options_)==null?void 0:i.bound);return t.defineProperty_(e,o,r)}function yP(t,e){var n,r=e.name,i=e.addInitializer;return Ns(t)||(t=gl(t)),(n=this.options_)!=null&&n.bound&&i(function(){var o=this,a=o[r].bind(o);a.isMobXFlow=!0,o[r]=a}),t}function bP(t,e,n,r){e.annotationType_,r.value}function i8(t,e,n,r,i,o){o===void 0&&(o=Re.safeDescriptors),bP(t,e,n,r);var a=r.value;if(Ns(a)||(a=gl(a)),i){var l;a=a.bind((l=t.proxy_)!=null?l:t.target_),a.isMobXFlow=!0}return{value:a,configurable:o?t.isPlainObject_:!0,enumerable:!1,writable:!o}}function vy(t,e){return{annotationType_:t,options_:e,make_:_P,extend_:wP,decorate_20223_:SP}}function _P(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function wP(t,e,n,r){return EP(t,this,e,n),t.defineComputedProperty_(e,ma({},this.options_,{get:n.get,set:n.set}),r)}function SP(t,e){var n=this,r=e.name,i=e.addInitializer;return i(function(){var o=_l(this)[qe],a=ma({},n.options_,{get:t,context:this});a.name||(a.name="ObservableObject."+r.toString()),o.values_.set(r,new Ei(a))}),function(){return this[qe].getObservablePropValue_(r)}}function EP(t,e,n,r){e.annotationType_,r.get}function qh(t,e){return{annotationType_:t,options_:e,make_:OP,extend_:xP,decorate_20223_:PP}}function OP(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function xP(t,e,n,r){var i,o;return CP(t,this),t.defineObservableProperty_(e,n.value,(i=(o=this.options_)==null?void 0:o.enhancer)!=null?i:hl,r)}function PP(t,e){var n=this,r=e.kind,i=e.name,o=new WeakSet;function a(l,s){var f,h,x=_l(l)[qe],w=new ha(s,(f=(h=n.options_)==null?void 0:h.enhancer)!=null?f:hl,"ObservableObject."+i.toString(),!1);x.values_.set(i,w),o.add(l)}if(r=="accessor")return{get:function(){return o.has(this)||a(this,t.get.call(this)),this[qe].getObservablePropValue_(i)},set:function(s){return o.has(this)||a(this,s),this[qe].setObservablePropValue_(i,s)},init:function(s){return o.has(this)||a(this,s),s}}}function CP(t,e,n,r){e.annotationType_}var kP="true",TP=o8();function o8(t){return{annotationType_:kP,options_:t,make_:AP,extend_:RP,decorate_20223_:MP}}function AP(t,e,n,r){var i,o;if(n.get)return yl.make_(t,e,n,r);if(n.set){var a=ya(e.toString(),n.set);return r===t.target_?t.defineProperty_(e,{configurable:Re.safeDescriptors?t.isPlainObject_:!0,set:a})===null?0:2:(qi(r,e,{configurable:!0,set:a}),2)}if(r!==t.target_&&typeof n.value=="function"){var l;if(Xw(n.value)){var s,f=(s=this.options_)!=null&&s.autoBind?gl.bound:gl;return f.make_(t,e,n,r)}var h=(l=this.options_)!=null&&l.autoBind?Ms.bound:Ms;return h.make_(t,e,n,r)}var x=((i=this.options_)==null?void 0:i.deep)===!1?Rt.ref:Rt;if(typeof n.value=="function"&&(o=this.options_)!=null&&o.autoBind){var w;n.value=n.value.bind((w=t.proxy_)!=null?w:t.target_)}return x.make_(t,e,n,r)}function RP(t,e,n,r){var i,o;if(n.get)return yl.extend_(t,e,n,r);if(n.set)return t.defineProperty_(e,{configurable:Re.safeDescriptors?t.isPlainObject_:!0,set:ya(e.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var a;n.value=n.value.bind((a=t.proxy_)!=null?a:t.target_)}var l=((o=this.options_)==null?void 0:o.deep)===!1?Rt.ref:Rt;return l.extend_(t,e,n,r)}function MP(t,e){tt("'"+this.annotationType_+"' cannot be used as a decorator")}var LP="observable",NP="observable.ref",IP="observable.shallow",DP="observable.struct",a8={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(a8);function dd(t){return t||a8}var Xv=qh(LP),jP=qh(NP,{enhancer:Vh}),FP=qh(IP,{enhancer:oP}),zP=qh(DP,{enhancer:aP}),l8=yi(Xv);function hd(t){return t.deep===!0?hl:t.deep===!1?Vh:UP(t.defaultDecorator)}function BP(t){var e;return t?(e=t.defaultDecorator)!=null?e:o8(t):void 0}function UP(t){var e,n;return t&&(e=(n=t.options_)==null?void 0:n.enhancer)!=null?e:hl}function s8(t,e,n){if(Uc(e))return Xv.decorate_20223_(t,e);if(fl(e)){Xs(t,e,Xv);return}return Qh(t)?t:ko(t)?Rt.object(t,e,n):Array.isArray(t)?Rt.array(t,e):Ys(t)?Rt.map(t,e):vo(t)?Rt.set(t,e):typeof t=="object"&&t!==null?t:Rt.box(t,e)}Ww(s8,l8);var HP={box:function(e,n){var r=dd(n);return new ha(e,hd(r),r.name,!0,r.equals)},array:function(e,n){var r=dd(n);return(Re.useProxies===!1||r.proxy===!1?YC:FC)(e,hd(r),r.name)},map:function(e,n){var r=dd(n);return new ep(e,hd(r),r.name)},set:function(e,n){var r=dd(n);return new Ty(e,hd(r),r.name)},object:function(e,n,r){return Pa(function(){return Sy(Re.useProxies===!1||(r==null?void 0:r.proxy)===!1?_l({},r):NC({},r),e,n)})},ref:yi(jP),shallow:yi(FP),deep:l8,struct:yi(zP)},Rt=Ww(s8,HP),u8="computed",$P="computed.struct",Zv=vy(u8),GP=vy($P,{equals:dl.structural}),yl=function(e,n){if(Uc(n))return Zv.decorate_20223_(e,n);if(fl(n))return Xs(e,n,Zv);if(ko(e))return yi(vy(u8,e));var r=ko(n)?n:{};return r.get=e,r.name||(r.name=e.name||""),new Ei(r)};Object.assign(yl,Zv);yl.struct=yi(GP);var m5,y5,fh=0,VP=1,qP=(m5=(y5=ch(function(){},"name"))==null?void 0:y5.configurable)!=null?m5:!1,b5={value:"action",configurable:!0,writable:!1,enumerable:!1};function ya(t,e,n,r){n===void 0&&(n=!1);function i(){return c8(t,n,e,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return e.toString()},qP&&(b5.value=t,qi(i,"name",b5)),i}function c8(t,e,n,r,i){var o=f8(t,e);try{return n.apply(r,i)}catch(a){throw o.error_=a,a}finally{d8(o)}}function f8(t,e,n,r){var i=!1,o=0,a=Re.trackingDerivation,l=!e||!a;hr();var s=Re.allowStateChanges;l&&(bl(),s=Wh(!0));var f=Kh(!0),h={runAsAction_:l,prevDerivation_:a,prevAllowStateChanges_:s,prevAllowStateReads_:f,notifySpy_:i,startTime_:o,actionId_:VP++,parentActionId_:fh};return fh=h.actionId_,h}function d8(t){fh!==t.actionId_&&tt(30),fh=t.parentActionId_,t.error_!==void 0&&(Re.suppressReactionErrors=!0),Yh(t.prevAllowStateChanges_),Es(t.prevAllowStateReads_),pr(),t.runAsAction_&&wo(t.prevDerivation_),Re.suppressReactionErrors=!1}function my(t,e){var n=Wh(t);try{return e()}finally{Yh(n)}}function Wh(t){var e=Re.allowStateChanges;return Re.allowStateChanges=t,e}function Yh(t){Re.allowStateChanges=t}var ha=function(t){function e(r,i,o,a,l){var s;return o===void 0&&(o="ObservableValue"),l===void 0&&(l=dl.default),s=t.call(this,o)||this,s.enhancer=void 0,s.name_=void 0,s.equals=void 0,s.hasUnreportedChange_=!1,s.interceptors_=void 0,s.changeListeners_=void 0,s.value_=void 0,s.dehancer=void 0,s.enhancer=i,s.name_=o,s.equals=l,s.value_=i(r,void 0,o),s}e8(e,t);var n=e.prototype;return n.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},n.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==Re.UNCHANGED&&this.setNewValue_(i)},n.prepareNewValue_=function(i){if(Yr(this)){var o=Kr(this,{object:this,type:Wi,newValue:i});if(!o)return Re.UNCHANGED;i=o.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Re.UNCHANGED:i},n.setNewValue_=function(i){var o=this.value_;this.value_=i,this.reportChanged(),bi(this)&&_i(this,{type:Wi,object:this,newValue:i,oldValue:o})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return Gc(this,i)},n.observe_=function(i,o){return o&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Wi,newValue:this.value_,oldValue:void 0}),Vc(this,i)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return Jw(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},e}(xa),yy=Oa("ObservableValue",ha),Ei=function(){function t(n){this.dependenciesState_=wt.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=wt.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new hh(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=dh.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,n.get||tt(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=ya("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?dl.structural:dl.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){nC(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},e.get=function(){if(this.isComputing&&tt(32,this.name_,this.derivation),Re.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Qv(this)&&(this.warnAboutUntrackedRead_(),hr(),this.value_=this.computeValue_(!1),pr());else if(b8(this),Qv(this)){var r=Re.trackingContext;this.keepAlive_&&!r&&(Re.trackingContext=this),this.trackAndCompute()&&tC(this),Re.trackingContext=r}var i=this.value_;if(Id(i))throw i.cause;return i},e.set=function(r){if(this.setter_){this.isRunningSetter&&tt(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else tt(34,this.name_)},e.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===wt.NOT_TRACKING_,o=this.computeValue_(!0),a=i||Id(r)||Id(o)||!this.equals_(r,o);return a&&(this.value_=o),a},e.computeValue_=function(r){this.isComputing=!0;var i=Wh(!1),o;if(r)o=h8(this,this.derivation,this.scope_);else if(Re.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(a){o=new hh(a)}return Yh(i),this.isComputing=!1,o},e.suspend_=function(){this.keepAlive_||(Jv(this),this.value_=void 0)},e.observe_=function(r,i){var o=this,a=!0,l=void 0;return _y(function(){var s=o.get();if(!a||i){var f=bl();r({observableKind:"computed",debugObjectName:o.name_,type:Wi,object:o,newValue:s,oldValue:l}),wo(f)}a=!1,l=s})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return Jw(this.get())},e[Symbol.toPrimitive]=function(){return this.valueOf()},Ks(t,[{key:"isComputing",get:function(){return Cr(this.flags_,t.isComputingMask_)},set:function(r){this.flags_=kr(this.flags_,t.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return Cr(this.flags_,t.isRunningSetterMask_)},set:function(r){this.flags_=kr(this.flags_,t.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return Cr(this.flags_,t.isBeingObservedMask_)},set:function(r){this.flags_=kr(this.flags_,t.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Cr(this.flags_,t.isPendingUnobservationMask_)},set:function(r){this.flags_=kr(this.flags_,t.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Cr(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=kr(this.flags_,t.diffValueMask_,r===1)}}])}();Ei.isComputingMask_=1;Ei.isRunningSetterMask_=2;Ei.isBeingObservedMask_=4;Ei.isPendingUnobservationMask_=8;Ei.diffValueMask_=16;var pl=Oa("ComputedValue",Ei),wt;(function(t){t[t.NOT_TRACKING_=-1]="NOT_TRACKING_",t[t.UP_TO_DATE_=0]="UP_TO_DATE_",t[t.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",t[t.STALE_=2]="STALE_"})(wt||(wt={}));var dh;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(dh||(dh={}));var hh=function(e){this.cause=void 0,this.cause=e};function Id(t){return t instanceof hh}function Qv(t){switch(t.dependenciesState_){case wt.UP_TO_DATE_:return!1;case wt.NOT_TRACKING_:case wt.STALE_:return!0;case wt.POSSIBLY_STALE_:{for(var e=Kh(!0),n=bl(),r=t.observing_,i=r.length,o=0;o<i;o++){var a=r[o];if(pl(a)){if(Re.disableErrorBoundaries)a.get();else try{a.get()}catch{return wo(n),Es(e),!0}if(t.dependenciesState_===wt.STALE_)return wo(n),Es(e),!0}}return p8(t),wo(n),Es(e),!1}}}function WP(){return Re.trackingDerivation!==null}function h8(t,e,n){var r=Kh(!0);p8(t),t.newObserving_=new Array(t.runId_===0?100:t.observing_.length),t.unboundDepsCount_=0,t.runId_=++Re.runId;var i=Re.trackingDerivation;Re.trackingDerivation=t,Re.inBatch++;var o;if(Re.disableErrorBoundaries===!0)o=e.call(n);else try{o=e.call(n)}catch(a){o=new hh(a)}return Re.inBatch--,Re.trackingDerivation=i,YP(t),Es(r),o}function YP(t){for(var e=t.observing_,n=t.observing_=t.newObserving_,r=wt.UP_TO_DATE_,i=0,o=t.unboundDepsCount_,a=0;a<o;a++){var l=n[a];l.diffValue===0&&(l.diffValue=1,i!==a&&(n[i]=l),i++),l.dependenciesState_>r&&(r=l.dependenciesState_)}for(n.length=i,t.newObserving_=null,o=e.length;o--;){var s=e[o];s.diffValue===0&&m8(s,t),s.diffValue=0}for(;i--;){var f=n[i];f.diffValue===1&&(f.diffValue=0,eC(f,t))}r!==wt.UP_TO_DATE_&&(t.dependenciesState_=r,t.onBecomeStale_())}function Jv(t){var e=t.observing_;t.observing_=[];for(var n=e.length;n--;)m8(e[n],t);t.dependenciesState_=wt.NOT_TRACKING_}function by(t){var e=bl();try{return t()}finally{wo(e)}}function bl(){var t=Re.trackingDerivation;return Re.trackingDerivation=null,t}function wo(t){Re.trackingDerivation=t}function Kh(t){var e=Re.allowStateReads;return Re.allowStateReads=t,e}function Es(t){Re.allowStateReads=t}function p8(t){if(t.dependenciesState_!==wt.UP_TO_DATE_){t.dependenciesState_=wt.UP_TO_DATE_;for(var e=t.observing_,n=e.length;n--;)e[n].lowestObserverState_=wt.UP_TO_DATE_}}var KP=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],nc=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},Dd=!0,g8=!1,Re=function(){var t=hy();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(Dd=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new nc().version&&(Dd=!1),Dd?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new nc):(setTimeout(function(){g8||tt(35)},1),new nc)}();function XP(){if((Re.pendingReactions.length||Re.inBatch||Re.isRunningReactions)&&tt(36),g8=!0,Dd){var t=hy();--t.__mobxInstanceCount===0&&(t.__mobxGlobals=void 0),Re=new nc}}function v8(){return Re}function ZP(){var t=new nc;for(var e in t)KP.indexOf(e)===-1&&(Re[e]=t[e]);Re.allowStateChanges=!Re.enforceActions}function QP(t){return t.observers_&&t.observers_.size>0}function JP(t){return t.observers_}function eC(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function m8(t,e){t.observers_.delete(e),t.observers_.size===0&&y8(t)}function y8(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,Re.pendingUnobservations.push(t))}function hr(){Re.inBatch++}function pr(){if(--Re.inBatch===0){w8();for(var t=Re.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof Ei&&n.suspend_())}Re.pendingUnobservations=[]}}function b8(t){var e=Re.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved&&Re.trackingContext&&(t.isBeingObserved=!0,t.onBO())),t.isBeingObserved):(t.observers_.size===0&&Re.inBatch>0&&y8(t),!1)}function _8(t){t.lowestObserverState_!==wt.STALE_&&(t.lowestObserverState_=wt.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===wt.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=wt.STALE_}))}function tC(t){t.lowestObserverState_!==wt.STALE_&&(t.lowestObserverState_=wt.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===wt.POSSIBLY_STALE_?e.dependenciesState_=wt.STALE_:e.dependenciesState_===wt.UP_TO_DATE_&&(t.lowestObserverState_=wt.UP_TO_DATE_)}))}function nC(t){t.lowestObserverState_===wt.UP_TO_DATE_&&(t.lowestObserverState_=wt.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===wt.UP_TO_DATE_&&(e.dependenciesState_=wt.POSSIBLY_STALE_,e.onBecomeStale_())}))}var Oi=function(){function t(n,r,i,o){n===void 0&&(n="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=wt.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=dh.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=o}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Re.pendingReactions.push(this),w8())},e.runReaction_=function(){if(!this.isDisposed){hr(),this.isScheduled=!1;var r=Re.trackingContext;if(Re.trackingContext=this,Qv(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Re.trackingContext=r,pr()}},e.track=function(r){if(!this.isDisposed){hr(),this.isRunning=!0;var i=Re.trackingContext;Re.trackingContext=this;var o=h8(this,r,void 0);Re.trackingContext=i,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Jv(this),Id(o)&&this.reportExceptionInDerivation_(o.cause),pr()}},e.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(Re.disableErrorBoundaries)throw r;var o="[mobx] uncaught error in '"+this+"'";Re.suppressReactionErrors||console.error(o,r),Re.globalReactionErrorHandlers.forEach(function(a){return a(r,i)})},e.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(hr(),Jv(this),pr()))},e.getDisposer_=function(r){var i=this,o=function a(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",a)};return r==null||r.addEventListener==null||r.addEventListener("abort",o),o[qe]=this,o},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(r){},Ks(t,[{key:"isDisposed",get:function(){return Cr(this.flags_,t.isDisposedMask_)},set:function(r){this.flags_=kr(this.flags_,t.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return Cr(this.flags_,t.isScheduledMask_)},set:function(r){this.flags_=kr(this.flags_,t.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return Cr(this.flags_,t.isTrackPendingMask_)},set:function(r){this.flags_=kr(this.flags_,t.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return Cr(this.flags_,t.isRunningMask_)},set:function(r){this.flags_=kr(this.flags_,t.isRunningMask_,r)}},{key:"diffValue",get:function(){return Cr(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=kr(this.flags_,t.diffValueMask_,r===1)}}])}();Oi.isDisposedMask_=1;Oi.isScheduledMask_=2;Oi.isTrackPendingMask_=4;Oi.isRunningMask_=8;Oi.diffValueMask_=16;function rC(t){return Re.globalReactionErrorHandlers.push(t),function(){var e=Re.globalReactionErrorHandlers.indexOf(t);e>=0&&Re.globalReactionErrorHandlers.splice(e,1)}}var iC=100,em=function(e){return e()};function w8(){Re.inBatch>0||Re.isRunningReactions||em(oC)}function oC(){Re.isRunningReactions=!0;for(var t=Re.pendingReactions,e=0;t.length>0;){++e===iC&&(console.error("[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}Re.isRunningReactions=!1}var ph=Oa("Reaction",Oi);function aC(t){var e=em;em=function(r){return t(function(){return e(r)})}}function rc(){return!1}function S8(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var E8="action",lC="action.bound",O8="autoAction",sC="autoAction.bound",x8="<unnamed action>",tm=Hc(E8),uC=Hc(lC,{bound:!0}),nm=Hc(O8,{autoAction:!0}),cC=Hc(sC,{autoAction:!0,bound:!0});function P8(t){var e=function(r,i){if(Mr(r))return ya(r.name||x8,r,t);if(Mr(i))return ya(r,i,t);if(Uc(i))return(t?nm:tm).decorate_20223_(r,i);if(fl(i))return Xs(r,i,t?nm:tm);if(fl(r))return yi(Hc(t?O8:E8,{name:r,autoAction:t}))};return e}var dn=P8(!1);Object.assign(dn,tm);var Ms=P8(!0);Object.assign(Ms,nm);dn.bound=yi(uC);Ms.bound=yi(cC);function Ls(t){return c8(t.name||x8,!1,t,this,void 0)}function $c(t){return Mr(t)&&t.isMobxAction===!0}function _y(t,e){var n,r,i,o;e===void 0&&(e=py);var a=(n=(r=e)==null?void 0:r.name)!=null?n:"Autorun",l=!e.scheduler&&!e.delay,s;if(l)s=new Oi(a,function(){this.track(x)},e.onError,e.requiresObservable);else{var f=C8(e),h=!1;s=new Oi(a,function(){h||(h=!0,f(function(){h=!1,s.isDisposed||s.track(x)}))},e.onError,e.requiresObservable)}function x(){t(s)}return(i=e)!=null&&(i=i.signal)!=null&&i.aborted||s.schedule_(),s.getDisposer_((o=e)==null?void 0:o.signal)}var fC=function(e){return e()};function C8(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:fC}function k8(t,e,n){var r,i,o;n===void 0&&(n=py);var a=(r=n.name)!=null?r:"Reaction",l=dn(a,n.onError?dC(n.onError,e):e),s=!n.scheduler&&!n.delay,f=C8(n),h=!0,x=!1,w,v=n.compareStructural?dl.structural:n.equals||dl.default,O=new Oi(a,function(){h||s?g():x||(x=!0,f(g))},n.onError,n.requiresObservable);function g(){if(x=!1,!O.isDisposed){var b=!1,p=w;O.track(function(){var y=my(!1,function(){return t(O)});b=h||!v(w,y),w=y}),(h&&n.fireImmediately||!h&&b)&&l(w,p,O),h=!1}}return(i=n)!=null&&(i=i.signal)!=null&&i.aborted||O.schedule_(),O.getDisposer_((o=n)==null?void 0:o.signal)}function dC(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}var hC="onBO",pC="onBUO";function T8(t,e,n){return A8(hC,t,e,n)}function wy(t,e,n){return A8(pC,t,e,n)}function A8(t,e,n,r){var i=typeof r=="function"?Ki(e,n):Ki(e),o=Mr(r)?r:n,a=t+"L";return i[a]?i[a].add(o):i[a]=new Set([o]),function(){var l=i[a];l&&(l.delete(o),l.size===0&&delete i[a])}}var gC="never",pd="always",vC="observed";function R8(t){t.isolateGlobalState===!0&&XP();var e=t.useProxies,n=t.enforceActions;if(e!==void 0&&(Re.useProxies=e===pd?!0:e===gC?!1:typeof Proxy<"u"),e==="ifavailable"&&(Re.verifyProxies=!0),n!==void 0){var r=n===pd?pd:n===vC;Re.enforceActions=r,Re.allowStateChanges=!(r===!0||r===pd)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in t&&(Re[i]=!!t[i])}),Re.allowStateReads=!Re.observableRequiresReaction,t.reactionScheduler&&aC(t.reactionScheduler)}function Sy(t,e,n,r){var i=Kx(e);return Pa(function(){var o=_l(t,r)[qe];Rs(i).forEach(function(a){o.extend_(a,i[a],n&&a in n?n[a]:!0)})}),t}function M8(t,e){return L8(Ki(t,e))}function L8(t){var e={name:t.name_};return t.observing_&&t.observing_.length>0&&(e.dependencies=yC(t.observing_).map(L8)),e}function mC(t,e){return N8(Ki(t,e))}function N8(t){var e={name:t.name_};return QP(t)&&(e.observers=Array.from(JP(t)).map(N8)),e}function yC(t){return Array.from(new Set(t))}var bC=0;function Xh(){this.message="FLOW_CANCELLED"}Xh.prototype=Object.create(Error.prototype);function _C(t){return t instanceof Xh}var j1=r8("flow"),wC=r8("flow.bound",{bound:!0}),gl=Object.assign(function(e,n){if(Uc(n))return j1.decorate_20223_(e,n);if(fl(n))return Xs(e,n,j1);var r=e,i=r.name||"<unnamed flow>",o=function(){var l=this,s=arguments,f=++bC,h=dn(i+" - runid: "+f+" - init",r).apply(l,s),x,w=void 0,v=new Promise(function(O,g){var b=0;x=g;function p(m){w=void 0;var _;try{_=dn(i+" - runid: "+f+" - yield "+b++,h.next).call(h,m)}catch(A){return g(A)}d(_)}function y(m){w=void 0;var _;try{_=dn(i+" - runid: "+f+" - yield "+b++,h.throw).call(h,m)}catch(A){return g(A)}d(_)}function d(m){if(Mr(m==null?void 0:m.then)){m.then(d,g);return}return m.done?O(m.value):(w=Promise.resolve(m.value),w.then(p,y))}p(void 0)});return v.cancel=dn(i+" - runid: "+f+" - cancel",function(){try{w&&_5(w);var O=h.return(void 0),g=Promise.resolve(O.value);g.then(ps,ps),_5(g),x(new Xh)}catch(b){x(b)}}),v};return o.isMobXFlow=!0,o},j1);gl.bound=yi(wC);function _5(t){Mr(t.cancel)&&t.cancel()}function SC(t){return t}function Ns(t){return(t==null?void 0:t.isMobXFlow)===!0}function Ey(t,e,n){var r;return zn(t)||nr(t)||yy(t)?r=xi(t):Mn(t)&&(r=xi(t,e)),r.dehancer=typeof e=="function"?e:n,function(){r.dehancer=void 0}}function Zh(t,e,n){return Mr(n)?OC(t,e,n):EC(t,e)}function EC(t,e){return xi(t).intercept_(e)}function OC(t,e,n){return xi(t,e).intercept_(n)}function I8(t,e){if(e===void 0)return pl(t);if(Mn(t)===!1||!t[qe].values_.has(e))return!1;var n=Ki(t,e);return pl(n)}function xC(t){return I8(t)}function D8(t,e){return I8(t,e)}function j8(t,e){return t?e!==void 0?Mn(t)?t[qe].values_.has(e):!1:Mn(t)||!!t[qe]||gy(t)||ph(t)||pl(t):!1}function Qh(t){return j8(t)}function F8(t,e){return j8(t,e)}function Oc(t){if(Mn(t))return t[qe].keys_();if(zn(t)||yn(t))return Array.from(t.keys());if(nr(t))return t.map(function(e,n){return n});tt(5)}function Oy(t){if(Mn(t))return Oc(t).map(function(e){return t[e]});if(zn(t))return Oc(t).map(function(e){return t.get(e)});if(yn(t))return Array.from(t.values());if(nr(t))return t.slice();tt(6)}function z8(t){if(Mn(t))return Oc(t).map(function(e){return[e,t[e]]});if(zn(t))return Oc(t).map(function(e){return[e,t.get(e)]});if(yn(t))return Array.from(t.entries());if(nr(t))return t.map(function(e,n){return[n,e]});tt(7)}function xy(t,e,n){if(arguments.length===2&&!yn(t)){hr();var r=e;try{for(var i in r)xy(t,i,r[i])}finally{pr()}return}Mn(t)?t[qe].set_(e,n):zn(t)?t.set(e,n):yn(t)?t.add(e):nr(t)?(typeof e!="number"&&(e=parseInt(e,10)),e<0&&tt("Invalid index: '"+e+"'"),hr(),e>=t.length&&(t.length=e+1),t[e]=n,pr()):tt(8)}function PC(t,e){Mn(t)?t[qe].delete_(e):zn(t)||yn(t)?t.delete(e):nr(t)?(typeof e!="number"&&(e=parseInt(e,10)),t.splice(e,1)):tt(9)}function B8(t,e){if(Mn(t))return t[qe].has_(e);if(zn(t))return t.has(e);if(yn(t))return t.has(e);if(nr(t))return e>=0&&e<t.length;tt(10)}function CC(t,e){if(B8(t,e)){if(Mn(t))return t[qe].get_(e);if(zn(t))return t.get(e);if(nr(t))return t[e];tt(11)}}function Py(t,e,n){if(Mn(t))return t[qe].defineProperty_(e,n);tt(39)}function U8(t){if(Mn(t))return t[qe].ownKeys_();tt(38)}function Jh(t,e,n,r){return Mr(n)?TC(t,e,n,r):kC(t,e,n)}function kC(t,e,n){return xi(t).observe_(e,n)}function TC(t,e,n,r){return xi(t,e).observe_(n,r)}function gd(t,e,n){return t.set(e,n),n}function ts(t,e){if(t==null||typeof t!="object"||t instanceof Date||!Qh(t))return t;if(yy(t)||pl(t))return ts(t.get(),e);if(e.has(t))return e.get(t);if(nr(t)){var n=gd(e,t,new Array(t.length));return t.forEach(function(a,l){n[l]=ts(a,e)}),n}if(yn(t)){var r=gd(e,t,new Set);return t.forEach(function(a){r.add(ts(a,e))}),r}if(zn(t)){var i=gd(e,t,new Map);return t.forEach(function(a,l){i.set(l,ts(a,e))}),i}else{var o=gd(e,t,{});return U8(t).forEach(function(a){zc.propertyIsEnumerable.call(t,a)&&(o[a]=ts(t[a],e))}),o}}function AC(t,e){return ts(t,new Map)}function RC(){}function Ui(t,e){e===void 0&&(e=void 0),hr();try{return t.apply(e)}finally{pr()}}function rm(t,e,n){return arguments.length===1||e&&typeof e=="object"?MC(t,e):H8(t,e,n||{})}function H8(t,e,n){var r;if(typeof n.timeout=="number"){var i=new Error("WHEN_TIMEOUT");r=setTimeout(function(){if(!a[qe].isDisposed)if(a(),n.onError)n.onError(i);else throw i},n.timeout)}n.name="When";var o=ya("When-effect",e),a=_y(function(l){var s=my(!1,t);s&&(l.dispose(),r&&clearTimeout(r),o())},n);return a}function MC(t,e){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var r,i,o=new Promise(function(a,l){var s,f=H8(t,a,ma({},e,{onError:l}));r=function(){f(),l(new Error("WHEN_CANCELLED"))},i=function(){f(),l(new Error("WHEN_ABORTED"))},e==null||(s=e.signal)==null||s.addEventListener==null||s.addEventListener("abort",i)}).finally(function(){var a;return e==null||(a=e.signal)==null||a.removeEventListener==null?void 0:a.removeEventListener("abort",i)});return o.cancel=r,o}function Zl(t){return t[qe]}var LC={has:function(e,n){return Zl(e).has_(n)},get:function(e,n){return Zl(e).get_(n)},set:function(e,n,r){var i;return fl(n)?(i=Zl(e).set_(n,r,!0))!=null?i:!0:!1},deleteProperty:function(e,n){var r;return fl(n)?(r=Zl(e).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(e,n,r){var i;return(i=Zl(e).defineProperty_(n,r))!=null?i:!0},ownKeys:function(e){return Zl(e).ownKeys_()},preventExtensions:function(e){tt(13)}};function NC(t,e){var n,r;return Yw(),t=_l(t,e),(r=(n=t[qe]).proxy_)!=null?r:n.proxy_=new Proxy(t,LC)}function Yr(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function Gc(t,e){var n=t.interceptors_||(t.interceptors_=[]);return n.push(e),Kw(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function Kr(t,e){var n=bl();try{for(var r=[].concat(t.interceptors_||[]),i=0,o=r.length;i<o&&(e=r[i](e),e&&!e.type&&tt(14),!!e);i++);return e}finally{wo(n)}}function bi(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function Vc(t,e){var n=t.changeListeners_||(t.changeListeners_=[]);return n.push(e),Kw(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function _i(t,e){var n=bl(),r=t.changeListeners_;if(r){r=r.slice();for(var i=0,o=r.length;i<o;i++)r[i](e);wo(n)}}function Cy(t,e,n){return Pa(function(){var r,i=_l(t,n)[qe];(r=e)!=null||(e=eP(t)),Rs(e).forEach(function(o){return i.make_(o,e[o])})}),t}var F1=Symbol("mobx-keys");function IC(t,e,n){return ko(t)?Sy(t,t,e,n):(Pa(function(){var r=_l(t,n)[qe];if(!t[F1]){var i=Object.getPrototypeOf(t),o=new Set([].concat(Rs(t),Rs(i)));o.delete("constructor"),o.delete(qe),Bc(i,F1,o)}t[F1].forEach(function(a){return r.make_(a,e&&a in e?e[a]:!0)})}),t)}var w5="splice",Wi="update",DC=1e4,jC={get:function(e,n){var r=e[qe];return n===qe?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):_o(gh,n)?gh[n]:e[n]},set:function(e,n,r){var i=e[qe];return n==="length"&&i.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?e[n]=r:i.set_(parseInt(n),r),!0},preventExtensions:function(){tt(15)}},ky=function(){function t(n,r,i,o){n===void 0&&(n="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_=o,this.atom_=new xa(n),this.enhancer_=function(a,l){return r(a,l,"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},e.intercept_=function(r){return Gc(this,r)},e.observe_=function(r,i){return i===void 0&&(i=!1),i&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Vc(this,r)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&tt("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var o=new Array(r-i),a=0;a<r-i;a++)o[a]=void 0;this.spliceWithArray_(i,0,o)}else this.spliceWithArray_(r,i-r)},e.updateArrayLength_=function(r,i){r!==this.lastKnownLength_&&tt(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&W8(r+i+1)},e.spliceWithArray_=function(r,i,o){var a=this;this.atom_;var l=this.values_.length;if(r===void 0?r=0:r>l?r=l:r<0&&(r=Math.max(0,l+r)),arguments.length===1?i=l-r:i==null?i=0:i=Math.max(0,Math.min(i,l-r)),o===void 0&&(o=Yv),Yr(this)){var s=Kr(this,{object:this.proxy_,type:w5,index:r,removedCount:i,added:o});if(!s)return Yv;i=s.removedCount,o=s.added}if(o=o.length===0?o:o.map(function(x){return a.enhancer_(x,void 0)}),this.legacyMode_){var f=o.length-i;this.updateArrayLength_(l,f)}var h=this.spliceItemsIntoValues_(r,i,o);return(i!==0||o.length!==0)&&this.notifyArraySplice_(r,o,h),this.dehanceValues_(h)},e.spliceItemsIntoValues_=function(r,i,o){if(o.length<DC){var a;return(a=this.values_).splice.apply(a,[r,i].concat(o))}else{var l=this.values_.slice(r,r+i),s=this.values_.slice(r+i);this.values_.length+=o.length-i;for(var f=0;f<o.length;f++)this.values_[r+f]=o[f];for(var h=0;h<s.length;h++)this.values_[r+o.length+h]=s[h];return l}},e.notifyArrayChildUpdate_=function(r,i,o){var a=!this.owned_&&rc(),l=bi(this),s=l||a?{observableKind:"array",object:this.proxy_,type:Wi,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:o}:null;this.atom_.reportChanged(),l&&_i(this,s)},e.notifyArraySplice_=function(r,i,o){var a=!this.owned_&&rc(),l=bi(this),s=l||a?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:w5,index:r,removed:o,added:i,removedCount:o.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&_i(this,s)},e.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx] Out of bounds read: "+r);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},e.set_=function(r,i){var o=this.values_;if(this.legacyMode_&&r>o.length&&tt(17,r,o.length),r<o.length){this.atom_;var a=o[r];if(Yr(this)){var l=Kr(this,{type:Wi,object:this.proxy_,index:r,newValue:i});if(!l)return;i=l.newValue}i=this.enhancer_(i,a);var s=i!==a;s&&(o[r]=i,this.notifyArrayChildUpdate_(r,i,a))}else{for(var f=new Array(r+1-o.length),h=0;h<f.length-1;h++)f[h]=void 0;f[f.length-1]=i,this.spliceWithArray_(o.length,0,f)}},t}();function FC(t,e,n,r){return n===void 0&&(n="ObservableArray"),r===void 0&&(r=!1),Yw(),Pa(function(){var i=new ky(n,e,r,!1);Zw(i.values_,qe,i);var o=new Proxy(i.values_,jC);return i.proxy_=o,t&&t.length&&i.spliceWithArray_(0,0,t),o})}var gh={clear:function(){return this.splice(0)},replace:function(e){var n=this[qe];return n.spliceWithArray_(0,n.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];var a=this[qe];switch(arguments.length){case 0:return[];case 1:return a.spliceWithArray_(e);case 2:return a.spliceWithArray_(e,n)}return a.spliceWithArray_(e,n,i)},spliceWithArray:function(e,n,r){return this[qe].spliceWithArray_(e,n,r)},push:function(){for(var e=this[qe],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.spliceWithArray_(e.values_.length,0,r),e.values_.length},pop:function(){return this.splice(Math.max(this[qe].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[qe],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.spliceWithArray_(0,0,r),e.values_.length},reverse:function(){return Re.trackingDerivation&&tt(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Re.trackingDerivation&&tt(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var n=this[qe],r=n.dehanceValues_(n.values_).indexOf(e);return r>-1?(this.splice(r,1),!0):!1}};Dt("at",Ir);Dt("concat",Ir);Dt("flat",Ir);Dt("includes",Ir);Dt("indexOf",Ir);Dt("join",Ir);Dt("lastIndexOf",Ir);Dt("slice",Ir);Dt("toString",Ir);Dt("toLocaleString",Ir);Dt("toSorted",Ir);Dt("toSpliced",Ir);Dt("with",Ir);Dt("every",Pi);Dt("filter",Pi);Dt("find",Pi);Dt("findIndex",Pi);Dt("findLast",Pi);Dt("findLastIndex",Pi);Dt("flatMap",Pi);Dt("forEach",Pi);Dt("map",Pi);Dt("some",Pi);Dt("toReversed",Pi);Dt("reduce",$8);Dt("reduceRight",$8);function Dt(t,e){typeof Array.prototype[t]=="function"&&(gh[t]=e(t))}function Ir(t){return function(){var e=this[qe];e.atom_.reportObserved();var n=e.dehanceValues_(e.values_);return n[t].apply(n,arguments)}}function Pi(t){return function(e,n){var r=this,i=this[qe];i.atom_.reportObserved();var o=i.dehanceValues_(i.values_);return o[t](function(a,l){return e.call(n,a,l,r)})}}function $8(t){return function(){var e=this,n=this[qe];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(o,a,l){return i(o,a,l,e)},r[t].apply(r,arguments)}}var zC=Oa("ObservableArrayAdministration",ky);function nr(t){return Gh(t)&&zC(t[qe])}var BC={},ia="add",vh="delete",ep=function(){function t(n,r,i){var o=this;r===void 0&&(r=hl),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[qe]=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_=r,this.name_=i,Mr(Map)||tt(18),Pa(function(){o.keysAtom_=Ec("ObservableMap.keys()"),o.data_=new Map,o.hasMap_=new Map,n&&o.merge(n)})}var e=t.prototype;return e.has_=function(r){return this.data_.has(r)},e.has=function(r){var i=this;if(!Re.trackingDerivation)return this.has_(r);var o=this.hasMap_.get(r);if(!o){var a=o=new ha(this.has_(r),Vh,"ObservableMap.key?",!1);this.hasMap_.set(r,a),wy(a,function(){return i.hasMap_.delete(r)})}return o.get()},e.set=function(r,i){var o=this.has_(r);if(Yr(this)){var a=Kr(this,{type:o?Wi:ia,object:this,newValue:i,name:r});if(!a)return this;i=a.newValue}return o?this.updateValue_(r,i):this.addValue_(r,i),this},e.delete=function(r){var i=this;if(this.keysAtom_,Yr(this)){var o=Kr(this,{type:vh,object:this,name:r});if(!o)return!1}if(this.has_(r)){var a=rc(),l=bi(this),s=l||a?{observableKind:"map",debugObjectName:this.name_,type:vh,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return Ui(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(r))==null||f.setNewValue_(!1);var h=i.data_.get(r);h.setNewValue_(void 0),i.data_.delete(r)}),l&&_i(this,s),!0}return!1},e.updateValue_=function(r,i){var o=this.data_.get(r);if(i=o.prepareNewValue_(i),i!==Re.UNCHANGED){var a=rc(),l=bi(this),s=l||a?{observableKind:"map",debugObjectName:this.name_,type:Wi,object:this,oldValue:o.value_,name:r,newValue:i}:null;o.setNewValue_(i),l&&_i(this,s)}},e.addValue_=function(r,i){var o=this;this.keysAtom_,Ui(function(){var f,h=new ha(i,o.enhancer_,"ObservableMap.key",!1);o.data_.set(r,h),i=h.value_,(f=o.hasMap_.get(r))==null||f.setNewValue_(!0),o.keysAtom_.reportChanged()});var a=rc(),l=bi(this),s=l||a?{observableKind:"map",debugObjectName:this.name_,type:ia,object:this,name:r,newValue:i}:null;l&&_i(this,s)},e.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var r=this,i=this.keys();return xc({next:function(){var a=i.next(),l=a.done,s=a.value;return{done:l,value:l?void 0:r.get(s)}}})},e.entries=function(){var r=this,i=this.keys();return xc({next:function(){var a=i.next(),l=a.done,s=a.value;return{done:l,value:l?void 0:[s,r.get(s)]}}})},e[Symbol.iterator]=function(){return this.entries()},e.forEach=function(r,i){for(var o=gs(this),a;!(a=o()).done;){var l=a.value,s=l[0],f=l[1];r.call(i,f,s,this)}},e.merge=function(r){var i=this;return zn(r)&&(r=new Map(r)),Ui(function(){ko(r)?Yx(r).forEach(function(o){return i.set(o,r[o])}):Array.isArray(r)?r.forEach(function(o){var a=o[0],l=o[1];return i.set(a,l)}):Ys(r)?(Wx(r)||tt(19,r),r.forEach(function(o,a){return i.set(a,o)})):r!=null&&tt(20,r)}),this},e.clear=function(){var r=this;Ui(function(){by(function(){for(var i=gs(r.keys()),o;!(o=i()).done;){var a=o.value;r.delete(a)}})})},e.replace=function(r){var i=this;return Ui(function(){for(var o=UC(r),a=new Map,l=!1,s=gs(i.data_.keys()),f;!(f=s()).done;){var h=f.value;if(!o.has(h)){var x=i.delete(h);if(x)l=!0;else{var w=i.data_.get(h);a.set(h,w)}}}for(var v=gs(o.entries()),O;!(O=v()).done;){var g=O.value,b=g[0],p=g[1],y=i.data_.has(b);if(i.set(b,p),i.data_.has(b)){var d=i.data_.get(b);a.set(b,d),y||(l=!0)}}if(!l)if(i.data_.size!==a.size)i.keysAtom_.reportChanged();else for(var m=i.data_.keys(),_=a.keys(),A=m.next(),C=_.next();!A.done;){if(A.value!==C.value){i.keysAtom_.reportChanged();break}A=m.next(),C=_.next()}i.data_=a}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(r,i){return Vc(this,r)},e.intercept_=function(r){return Gc(this,r)},Ks(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),zn=Oa("ObservableMap",ep);function UC(t){if(Ys(t)||zn(t))return t;if(Array.isArray(t))return new Map(t);if(ko(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return tt(21,t)}var HC={},Ty=function(){function t(n,r,i){var o=this;r===void 0&&(r=hl),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[qe]=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,Mr(Set)||tt(22),this.enhancer_=function(a,l){return r(a,l,i)},Pa(function(){o.atom_=Ec(o.name_),n&&o.replace(n)})}var e=t.prototype;return e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.clear=function(){var r=this;Ui(function(){by(function(){for(var i=gs(r.data_.values()),o;!(o=i()).done;){var a=o.value;r.delete(a)}})})},e.forEach=function(r,i){for(var o=gs(this),a;!(a=o()).done;){var l=a.value;r.call(i,l,l,this)}},e.add=function(r){var i=this;if(this.atom_,Yr(this)){var o=Kr(this,{type:ia,object:this,newValue:r});if(!o)return this}if(!this.has(r)){Ui(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var a=!1,l=bi(this),s=l||a?{observableKind:"set",debugObjectName:this.name_,type:ia,object:this,newValue:r}:null;l&&_i(this,s)}return this},e.delete=function(r){var i=this;if(Yr(this)){var o=Kr(this,{type:vh,object:this,oldValue:r});if(!o)return!1}if(this.has(r)){var a=!1,l=bi(this),s=l||a?{observableKind:"set",debugObjectName:this.name_,type:vh,object:this,oldValue:r}:null;return Ui(function(){i.atom_.reportChanged(),i.data_.delete(r)}),l&&_i(this,s),!0}return!1},e.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},e.entries=function(){var r=0,i=Array.from(this.keys()),o=Array.from(this.values());return xc({next:function(){var l=r;return r+=1,l<o.length?{value:[i[l],o[l]],done:!1}:{done:!0}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var r=this,i=0,o=Array.from(this.data_.values());return xc({next:function(){return i<o.length?{value:r.dehanceValue_(o[i++]),done:!1}:{done:!0}}})},e.intersection=function(r){if(vo(r)&&!yn(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},e.union=function(r){if(vo(r)&&!yn(r))return r.union(this);var i=new Set(this);return i.union(r)},e.difference=function(r){return new Set(this).difference(r)},e.symmetricDifference=function(r){if(vo(r)&&!yn(r))return r.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(r)},e.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},e.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},e.isDisjointFrom=function(r){if(vo(r)&&!yn(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},e.replace=function(r){var i=this;return yn(r)&&(r=new Set(r)),Ui(function(){Array.isArray(r)?(i.clear(),r.forEach(function(o){return i.add(o)})):vo(r)?(i.clear(),r.forEach(function(o){return i.add(o)})):r!=null&&tt("Cannot initialize set from "+r)}),this},e.observe_=function(r,i){return Vc(this,r)},e.intercept_=function(r){return Gc(this,r)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[Symbol.iterator]=function(){return this.values()},Ks(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),yn=Oa("ObservableSet",Ty),S5=Object.create(null),E5="remove",G8=function(){function t(n,r,i,o){r===void 0&&(r=new Map),o===void 0&&(o=TP),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=r,this.name_=i,this.defaultAnnotation_=o,this.keysAtom_=new xa("ObservableObject.keys"),this.isPlainObject_=ko(this.target_)}var e=t.prototype;return e.getObservablePropValue_=function(r){return this.values_.get(r).get()},e.setObservablePropValue_=function(r,i){var o=this.values_.get(r);if(o instanceof Ei)return o.set(i),!0;if(Yr(this)){var a=Kr(this,{type:Wi,object:this.proxy_||this.target_,name:r,newValue:i});if(!a)return null;i=a.newValue}if(i=o.prepareNewValue_(i),i!==Re.UNCHANGED){var l=bi(this),s=!1,f=l||s?{type:Wi,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:r,newValue:i}:null;o.setNewValue_(i),l&&_i(this,f)}return!0},e.get_=function(r){return Re.trackingDerivation&&!_o(this.target_,r)&&this.has_(r),this.target_[r]},e.set_=function(r,i,o){return o===void 0&&(o=!1),_o(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,i):o?Reflect.set(this.target_,r,i):(this.target_[r]=i,!0):this.extend_(r,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,o)},e.has_=function(r){if(!Re.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(r);return i||(i=new ha(r in this.target_,Vh,"ObservableObject.key?",!1),this.pendingKeys_.set(r,i)),i.get()},e.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(r in this.target_)){var o;if((o=this.target_[$i])!=null&&o[r])return;tt(1,i.annotationType_,this.name_+"."+r.toString())}for(var a=this.target_;a&&a!==zc;){var l=ch(a,r);if(l){var s=i.make_(this,r,l,a);if(s===0)return;if(s===1)break}a=Object.getPrototypeOf(a)}x5(this,i,r)}},e.extend_=function(r,i,o,a){if(a===void 0&&(a=!1),o===!0&&(o=this.defaultAnnotation_),o===!1)return this.defineProperty_(r,i,a);var l=o.extend_(this,r,i,a);return l&&x5(this,o,r),l},e.defineProperty_=function(r,i,o){o===void 0&&(o=!1),this.keysAtom_;try{hr();var a=this.delete_(r);if(!a)return a;if(Yr(this)){var l=Kr(this,{object:this.proxy_||this.target_,name:r,type:ia,newValue:i.value});if(!l)return null;var s=l.newValue;i.value!==s&&(i=ma({},i,{value:s}))}if(o){if(!Reflect.defineProperty(this.target_,r,i))return!1}else qi(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{pr()}return!0},e.defineObservableProperty_=function(r,i,o,a){a===void 0&&(a=!1),this.keysAtom_;try{hr();var l=this.delete_(r);if(!l)return l;if(Yr(this)){var s=Kr(this,{object:this.proxy_||this.target_,name:r,type:ia,newValue:i});if(!s)return null;i=s.newValue}var f=O5(r),h={configurable:Re.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(a){if(!Reflect.defineProperty(this.target_,r,h))return!1}else qi(this.target_,r,h);var x=new ha(i,o,"ObservableObject.key",!1);this.values_.set(r,x),this.notifyPropertyAddition_(r,x.value_)}finally{pr()}return!0},e.defineComputedProperty_=function(r,i,o){o===void 0&&(o=!1),this.keysAtom_;try{hr();var a=this.delete_(r);if(!a)return a;if(Yr(this)){var l=Kr(this,{object:this.proxy_||this.target_,name:r,type:ia,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var s=O5(r),f={configurable:Re.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:s.get,set:s.set};if(o){if(!Reflect.defineProperty(this.target_,r,f))return!1}else qi(this.target_,r,f);this.values_.set(r,new Ei(i)),this.notifyPropertyAddition_(r,void 0)}finally{pr()}return!0},e.delete_=function(r,i){if(i===void 0&&(i=!1),this.keysAtom_,!_o(this.target_,r))return!0;if(Yr(this)){var o=Kr(this,{object:this.proxy_||this.target_,name:r,type:E5});if(!o)return null}try{var a;hr();var l=bi(this),s=!1,f=this.values_.get(r),h=void 0;if(!f&&(l||s)){var x;h=(x=ch(this.target_,r))==null?void 0:x.value}if(i){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(f&&(this.values_.delete(r),f instanceof ha&&(h=f.value_),_8(f)),this.keysAtom_.reportChanged(),(a=this.pendingKeys_)==null||(a=a.get(r))==null||a.set(r in this.target_),l||s){var w={type:E5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:h,name:r};l&&_i(this,w)}}finally{pr()}return!0},e.observe_=function(r,i){return Vc(this,r)},e.intercept_=function(r){return Gc(this,r)},e.notifyPropertyAddition_=function(r,i){var o,a=bi(this),l=!1;if(a||l){var s=a||l?{type:ia,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;a&&_i(this,s)}(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),Rs(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function _l(t,e){var n;if(_o(t,qe))return t;var r=(n=e==null?void 0:e.name)!=null?n:"ObservableObject",i=new G8(t,new Map,String(r),BP(e));return Bc(t,qe,i),t}var $C=Oa("ObservableObjectAdministration",G8);function O5(t){return S5[t]||(S5[t]={get:function(){return this[qe].getObservablePropValue_(t)},set:function(n){return this[qe].setObservablePropValue_(t,n)}})}function Mn(t){return Gh(t)?$C(t[qe]):!1}function x5(t,e,n){var r;(r=t.target_[$i])==null||delete r[n]}var GC=q8(0),VC=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1}(),z1=0,V8=function(){};function qC(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):t.prototype.__proto__!==void 0?t.prototype.__proto__=e:t.prototype=e}qC(V8,Array.prototype);var Ay=function(t){function e(r,i,o,a){var l;return o===void 0&&(o="ObservableArray"),a===void 0&&(a=!1),l=t.call(this)||this,Pa(function(){var s=new ky(o,i,a,!0);s.proxy_=l,Zw(l,qe,s),r&&r.length&&l.spliceWithArray(0,0,r),VC&&Object.defineProperty(l,"0",GC)}),l}e8(e,t);var n=e.prototype;return n.concat=function(){this[qe].atom_.reportObserved();for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return Array.prototype.concat.apply(this.slice(),o.map(function(l){return nr(l)?l.slice():l}))},n[Symbol.iterator]=function(){var r=this,i=0;return xc({next:function(){return i<r.length?{value:r[i++],done:!1}:{done:!0,value:void 0}}})},Ks(e,[{key:"length",get:function(){return this[qe].getArrayLength_()},set:function(i){this[qe].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(V8);Object.entries(gh).forEach(function(t){var e=t[0],n=t[1];e!=="concat"&&Bc(Ay.prototype,e,n)});function q8(t){return{enumerable:!1,configurable:!0,get:function(){return this[qe].get_(t)},set:function(n){this[qe].set_(t,n)}}}function WC(t){qi(Ay.prototype,""+t,q8(t))}function W8(t){if(t>z1){for(var e=z1;e<t+100;e++)WC(e);z1=t}}W8(1e3);function YC(t,e,n){return new Ay(t,e,n)}function Ki(t,e){if(typeof t=="object"&&t!==null){if(nr(t))return e!==void 0&&tt(23),t[qe].atom_;if(yn(t))return t.atom_;if(zn(t)){if(e===void 0)return t.keysAtom_;var n=t.data_.get(e)||t.hasMap_.get(e);return n||tt(25,e,mh(t)),n}if(Mn(t)){if(!e)return tt(26);var r=t[qe].values_.get(e);return r||tt(27,e,mh(t)),r}if(gy(t)||pl(t)||ph(t))return t}else if(Mr(t)&&ph(t[qe]))return t[qe];tt(28)}function xi(t,e){if(t||tt(29),e!==void 0)return xi(Ki(t,e));if(gy(t)||pl(t)||ph(t)||zn(t)||yn(t))return t;if(t[qe])return t[qe];tt(24,t)}function mh(t,e){var n;if(e!==void 0)n=Ki(t,e);else{if($c(t))return t.name;Mn(t)||zn(t)||yn(t)?n=xi(t):n=Ki(t)}return n.name_}function Pa(t){var e=bl(),n=Wh(!0);hr();try{return t()}finally{pr(),Yh(n),wo(e)}}var P5=zc.toString;function Ry(t,e,n){return n===void 0&&(n=-1),im(t,e,n)}function im(t,e,n,r,i){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var o=typeof t;if(o!=="function"&&o!=="object"&&typeof e!="object")return!1;var a=P5.call(t);if(a!==P5.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++;break}t=C5(t),e=C5(e);var l=a==="[object Array]";if(!l){if(typeof t!="object"||typeof e!="object")return!1;var s=t.constructor,f=e.constructor;if(s!==f&&!(Mr(s)&&s instanceof s&&Mr(f)&&f instanceof f)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var h=r.length;h--;)if(r[h]===t)return i[h]===e;if(r.push(t),i.push(e),l){if(h=t.length,h!==e.length)return!1;for(;h--;)if(!im(t[h],e[h],n-1,r,i))return!1}else{var x=Object.keys(t),w;if(h=x.length,Object.keys(e).length!==h)return!1;for(;h--;)if(w=x[h],!(_o(e,w)&&im(t[w],e[w],n-1,r,i)))return!1}return r.pop(),i.pop(),!0}function C5(t){return nr(t)?t.slice():Ys(t)||zn(t)||vo(t)||yn(t)?Array.from(t.entries()):t}function xc(t){return t[Symbol.iterator]=KC,t}function KC(){return this}["Symbol","Map","Set"].forEach(function(t){var e=hy();typeof e[t]>"u"&&tt("MobX requires global '"+t+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:S8,extras:{getDebugName:mh},$mobx:qe});const XC=Object.freeze(Object.defineProperty({__proto__:null,$mobx:qe,FlowCancellationError:Xh,ObservableMap:ep,ObservableSet:Ty,Reaction:Oi,_allowStateChanges:my,_allowStateChangesInsideComputed:Ls,_allowStateReadsEnd:Es,_allowStateReadsStart:Kh,_autoAction:Ms,_endAction:d8,_getAdministration:xi,_getGlobalState:v8,_interceptReads:Ey,_isComputingDerivation:WP,_resetGlobalState:ZP,_startAction:f8,action:dn,autorun:_y,comparer:dl,computed:yl,configure:R8,createAtom:Ec,defineProperty:Py,entries:z8,extendObservable:Sy,flow:gl,flowResult:SC,get:CC,getAtom:Ki,getDebugName:mh,getDependencyTree:M8,getObserverTree:mC,has:B8,intercept:Zh,isAction:$c,isBoxedObservable:yy,isComputed:xC,isComputedProp:D8,isFlow:Ns,isFlowCancellationError:_C,isObservable:Qh,isObservableArray:nr,isObservableMap:zn,isObservableObject:Mn,isObservableProp:F8,isObservableSet:yn,keys:Oc,makeAutoObservable:IC,makeObservable:Cy,observable:Rt,observe:Jh,onBecomeObserved:T8,onBecomeUnobserved:wy,onReactionError:rC,override:lP,ownKeys:U8,reaction:k8,remove:PC,runInAction:Ls,set:xy,spy:S8,toJS:AC,trace:RC,transaction:Ui,untracked:by,values:Oy,when:rm},Symbol.toStringTag,{value:"Module"}));if(!Qe.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(t){t()}function Y8(t){t||(t=ZC),R8({reactionScheduler:t})}var QC=function(){return!0};function JC(t){return M8(t)}var K8=!1;function X8(t){K8=t}function My(){return K8}var ek=1e4,tk=1e4,nk=function(){function t(e){var n=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=ek),clearTimeout(n.sweepTimeout),n.sweepTimeout=void 0;var i=Date.now();n.registrations.forEach(function(o,a){i-o.registeredAt>=r&&(n.finalize(o.value),n.registrations.delete(a))}),n.registrations.size>0&&n.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){n.sweep(0)}})}return Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n,r){this.registrations.set(r,{value:n,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(t.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,tk))}}),t}(),rk=typeof FinalizationRegistry<"u"?FinalizationRegistry:nk,yh=new rk(function(t){var e;(e=t.reaction)===null||e===void 0||e.dispose(),t.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 Is=Qe;function ik(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ok=typeof Object.is=="function"?Object.is:ik,ak=Is.useState,lk=Is.useEffect,sk=Is.useLayoutEffect,uk=Is.useDebugValue;function ck(t,e){var n=e(),r=ak({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return sk(function(){i.value=n,i.getSnapshot=e,B1(i)&&o({inst:i})},[t,n,e]),lk(function(){return B1(i)&&o({inst:i}),t(function(){B1(i)&&o({inst:i})})},[t]),uk(n),n}function B1(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ok(t,n)}catch{return!0}}function fk(t,e){return e()}var dk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?fk:ck;Q8.useSyncExternalStore=Is.useSyncExternalStore!==void 0?Is.useSyncExternalStore:dk;Z8.exports=Q8;var hk=Z8.exports;function k5(t){t.reaction=new Oi("observer".concat(t.name),function(){var e;t.stateVersion=Symbol(),(e=t.onStoreChange)===null||e===void 0||e.call(t)})}function Ly(t,e){if(e===void 0&&(e="observed"),My())return t();var n=dt.useRef(null);if(!n.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:e,subscribe:function(l){return yh.unregister(r),r.onStoreChange=l,r.reaction||(k5(r),r.stateVersion=Symbol()),function(){var s;r.onStoreChange=null,(s=r.reaction)===null||s===void 0||s.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};n.current=r}var i=n.current;i.reaction||(k5(i),yh.register(n,i,i)),dt.useDebugValue(i.reaction,JC),hk.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var o,a;if(i.reaction.track(function(){try{o=t()}catch(l){a=l}}),a)throw a;return o}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 Qe.forwardRef=="function"&&Qe.forwardRef(function(t){return null}).$$typeof,A5=J8?Symbol.for("react.memo"):typeof Qe.memo=="function"&&Qe.memo(function(t){return null}).$$typeof;function gk(t,e){var n;if(A5&&t.$$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 t;var r=(n=e==null?void 0:e.forwardRef)!==null&&n!==void 0?n:!1,i=t,o=t.displayName||t.name;if(T5&&t.$$typeof===T5&&(r=!0,i=t.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var a=function(l,s){return Ly(function(){return i(l,s)},o)};return a.displayName=t.displayName,pk&&Object.defineProperty(a,"name",{value:t.name,writable:!0,configurable:!0}),t.contextTypes&&(a.contextTypes=t.contextTypes),r&&(a=Qe.forwardRef(a)),a=Qe.memo(a),mk(t,a),a}var vk={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function mk(t,e){Object.keys(t).forEach(function(n){vk[n]||Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}function e9(t){var e=t.children,n=t.render,r=e||n;return typeof r!="function"?null:Ly(r)}e9.displayName="Observer";function yk(t,e){return Qe.useState(function(){return Rt(t(),e,{autoBind:!0})})[0]}function t9(t){var e=Qe.useState(function(){return Rt(t,{},{deep:!1})})[0];return Ls(function(){Object.assign(e,t)}),e}function bk(t,e){var n=e&&t9(e);return Qe.useState(function(){return Rt(t(n),void 0,{autoBind:!0})})[0]}var $1;Y8(Vw.unstable_batchedUpdates);var _k=($1=yh.finalizeAllImmediately)!==null&&$1!==void 0?$1:function(){};function wk(t,e){return e===void 0&&(e="observed"),Ly(t,e)}function Sk(t){X8(t)}const Ek=Object.freeze(Object.defineProperty({__proto__:null,Observer:e9,_observerFinalizationRegistry:yh,clearTimers:_k,enableStaticRendering:X8,isObserverBatched:QC,isUsingStaticRendering:My,observer:gk,observerBatching:Y8,useAsObservableSource:t9,useLocalObservable:yk,useLocalStore:bk,useObserver:wk,useStaticRendering:Sk},Symbol.toStringTag,{value:"Module"})),ti=_a(Ek);var n9={};const Qi=_a(XC);var Ny={exports:{}},tp={},bh={},st={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._registerNode=t.Konva=t.glob=void 0;const e=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}t.glob=typeof _e<"u"?_e:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},t.Konva={_global:t.glob,version:"9.3.16",isBrowser:n(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return t.Konva.angleDeg?i*e:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return t.Konva.DD.isDragging},isTransforming(){var i;return(i=t.Konva.Transformer)===null||i===void 0?void 0:i.isTransforming()},isDragReady(){return!!t.Konva.DD.node},releaseCanvasOnDestroy:!0,document:t.glob.document,_injectGlobal(i){t.glob.Konva=i}};const r=i=>{t.Konva[i.prototype.getClassName()]=i};t._registerNode=r,t.Konva._injectGlobal(t.Konva)})(st);var en={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Util=t.Transform=void 0;const e=st;class n{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 n(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){const _=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){const _=Math.cos(m),A=Math.sin(m),C=this.m[0]*_+this.m[2]*A,R=this.m[1]*_+this.m[3]*A,S=this.m[0]*-A+this.m[2]*_,E=this.m[1]*-A+this.m[3]*_;return this.m[0]=C,this.m[1]=R,this.m[2]=S,this.m[3]=E,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(m,_){const A=this.m[0]+this.m[2]*_,C=this.m[1]+this.m[3]*_,R=this.m[2]+this.m[0]*m,S=this.m[3]+this.m[1]*m;return this.m[0]=A,this.m[1]=C,this.m[2]=R,this.m[3]=S,this}multiply(m){const _=this.m[0]*m.m[0]+this.m[2]*m.m[1],A=this.m[1]*m.m[0]+this.m[3]*m.m[1],C=this.m[0]*m.m[2]+this.m[2]*m.m[3],R=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],E=this.m[1]*m.m[4]+this.m[3]*m.m[5]+this.m[5];return this.m[0]=_,this.m[1]=A,this.m[2]=C,this.m[3]=R,this.m[4]=S,this.m[5]=E,this}invert(){const m=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),_=this.m[3]*m,A=-this.m[1]*m,C=-this.m[2]*m,R=this.m[0]*m,S=m*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),E=m*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=_,this.m[1]=A,this.m[2]=C,this.m[3]=R,this.m[4]=S,this.m[5]=E,this}getMatrix(){return this.m}decompose(){const m=this.m[0],_=this.m[1],A=this.m[2],C=this.m[3],R=this.m[4],S=this.m[5],E=m*C-_*A,P={x:R,y:S,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(m!=0||_!=0){const T=Math.sqrt(m*m+_*_);P.rotation=_>0?Math.acos(m/T):-Math.acos(m/T),P.scaleX=T,P.scaleY=E/T,P.skewX=(m*A+_*C)/E,P.skewY=0}else if(A!=0||C!=0){const T=Math.sqrt(A*A+C*C);P.rotation=Math.PI/2-(C>0?Math.acos(-A/T):-Math.acos(A/T)),P.scaleX=E/T,P.scaleY=T,P.skewX=0,P.skewY=(m*A+_*C)/E}return P.rotation=t.Util._getRotation(P.rotation),P}}t.Transform=n;let r="[object Array]",i="[object Number]",o="[object String]",a="[object Boolean]",l=Math.PI/180,s=180/Math.PI,f="#",h="",x="0",w="Konva warning: ",v="Konva error: ",O="rgb(",g={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]},b=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,p=[];const y=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(d){setTimeout(d,60)};t.Util={_isElement(d){return!!(d&&d.nodeType==1)},_isFunction(d){return!!(d&&d.constructor&&d.call&&d.apply)},_isPlainObject(d){return!!d&&d.constructor===Object},_isArray(d){return Object.prototype.toString.call(d)===r},_isNumber(d){return Object.prototype.toString.call(d)===i&&!isNaN(d)&&isFinite(d)},_isString(d){return Object.prototype.toString.call(d)===o},_isBoolean(d){return Object.prototype.toString.call(d)===a},isObject(d){return d instanceof Object},isValidSelector(d){if(typeof d!="string")return!1;const m=d[0];return m==="#"||m==="."||m===m.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){p.push(d),p.length===1&&y(function(){const m=p;p=[],m.forEach(function(_){_()})})},createCanvasElement(){const 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){const _=t.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);const m=parseInt(d,16);return{r:m>>16&255,g:m>>8&255,b:m&255}},getRandomColor(){let d=(Math.random()*16777215<<0).toString(16);for(;d.length<6;)d=x+d;return f+d},getRGB(d){let m;return d in g?(m=g[d],{r:m[0],g:m[1],b:m[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===O?(m=b.exec(d.replace(/ /g,"")),{r:parseInt(m[1],10),g:parseInt(m[2],10),b:parseInt(m[3],10)}):{r:0,g:0,b:0}},colorToRGBA(d){return d=d||"black",t.Util._namedColorToRBA(d)||t.Util._hex3ColorToRGBA(d)||t.Util._hex4ColorToRGBA(d)||t.Util._hex6ColorToRGBA(d)||t.Util._hex8ColorToRGBA(d)||t.Util._rgbColorToRGBA(d)||t.Util._rgbaColorToRGBA(d)||t.Util._hslColorToRGBA(d)},_namedColorToRBA(d){const m=g[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];const 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];const m=d.split(/ *, */).map((_,A)=>_.slice(-1)==="%"?A===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),A=Number(_[0])/360,C=Number(_[1])/100,R=Number(_[2])/100;let S,E,P;if(C===0)return P=R*255,{r:Math.round(P),g:Math.round(P),b:Math.round(P),a:1};R<.5?S=R*(1+C):S=R+C-R*C;const T=2*R-S,N=[0,0,0];for(let U=0;U<3;U++)E=A+1/3*-(U-1),E<0&&E++,E>1&&E--,6*E<1?P=T+(S-T)*6*E:2*E<1?P=S:3*E<2?P=T+(S-T)*(2/3-E)*6:P=T,N[U]=P*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){const m={};for(const _ 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*s},_degToRad(d){return t.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),t.Util.degToRad(d)},_radToDeg(d){return t.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),t.Util.radToDeg(d)},_getRotation(d){return e.Konva.angleDeg?t.Util.radToDeg(d):d},_capitalize(d){return d.charAt(0).toUpperCase()+d.slice(1)},throw(d){throw new Error(v+d)},error(d){console.error(v+d)},warn(d){e.Konva.showWarnings&&console.warn(w+d)},each(d,m){for(const _ in d)m(_,d[_])},_inRange(d,m,_){return m<=d&&d<_},_getProjectionToSegment(d,m,_,A,C,R){let S,E,P;const T=(d-_)*(d-_)+(m-A)*(m-A);if(T==0)S=d,E=m,P=(C-_)*(C-_)+(R-A)*(R-A);else{const N=((C-d)*(_-d)+(R-m)*(A-m))/T;N<0?(S=d,E=m,P=(d-C)*(d-C)+(m-R)*(m-R)):N>1?(S=_,E=A,P=(_-C)*(_-C)+(A-R)*(A-R)):(S=d+N*(_-d),E=m+N*(A-m),P=(S-C)*(S-C)+(E-R)*(E-R))}return[S,E,P]},_getProjectionToLine(d,m,_){const A=t.Util.cloneObject(d);let C=Number.MAX_VALUE;return m.forEach(function(R,S){if(!_&&S===m.length-1)return;const E=m[(S+1)%m.length],P=t.Util._getProjectionToSegment(R.x,R.y,E.x,E.y,d.x,d.y),T=P[0],N=P[1],U=P[2];U<C&&(A.x=T,A.y=N,C=U)}),A},_prepareArrayForTween(d,m,_){let A,C=[],R=[];if(d.length>m.length){const E=m;m=d,d=E}for(A=0;A<d.length;A+=2)C.push({x:d[A],y:d[A+1]});for(A=0;A<m.length;A+=2)R.push({x:m[A],y:m[A+1]});const S=[];return R.forEach(function(E){const P=t.Util._getProjectionToLine(E,C,_);S.push(P.x),S.push(P.y)}),S},_prepareToStringify(d){let m;d.visitedByCircularReferenceRemoval=!0;for(const _ in d)if(d.hasOwnProperty(_)&&d[_]&&typeof d[_]=="object"){if(m=Object.getOwnPropertyDescriptor(d,_),d[_].visitedByCircularReferenceRemoval||t.Util._isElement(d[_]))if(m.configurable)delete d[_];else return null;else if(t.Util._prepareToStringify(d[_])===null)if(m.configurable)delete d[_];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,m){for(const _ in m)d[_]=m[_];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){e.Konva.releaseCanvasOnDestroy&&d.forEach(m=>{m.width=0,m.height=0})},drawRoundedRectPath(d,m,_,A){let C=0,R=0,S=0,E=0;typeof A=="number"?C=R=S=E=Math.min(A,m/2,_/2):(C=Math.min(A[0]||0,m/2,_/2),R=Math.min(A[1]||0,m/2,_/2),E=Math.min(A[2]||0,m/2,_/2),S=Math.min(A[3]||0,m/2,_/2)),d.moveTo(C,0),d.lineTo(m-R,0),d.arc(m-R,R,R,Math.PI*3/2,0,!1),d.lineTo(m,_-E),d.arc(m-E,_-E,E,0,Math.PI/2,!1),d.lineTo(S,_),d.arc(S,_-S,S,Math.PI/2,Math.PI,!1),d.lineTo(0,C),d.arc(C,C,C,Math.PI,Math.PI*3/2,!1)}}})(en);var qt={},ut={},Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.RGBComponent=Ok;Ze.alphaComponent=xk;Ze.getNumberValidator=Pk;Ze.getNumberOrArrayOfNumbersValidator=Ck;Ze.getNumberOrAutoValidator=kk;Ze.getStringValidator=Tk;Ze.getStringOrGradientValidator=Ak;Ze.getFunctionValidator=Rk;Ze.getNumberArrayValidator=Mk;Ze.getBooleanValidator=Lk;Ze.getComponentValidator=Nk;const Ro=st,rn=en;function Mo(t){return rn.Util._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||rn.Util._isBoolean(t)?t:Object.prototype.toString.call(t)}function Ok(t){return t>255?255:t<0?0:Math.round(t)}function xk(t){return t>1?1:t<1e-4?1e-4:t}function Pk(){if(Ro.Konva.isUnminified)return function(t,e){return rn.Util._isNumber(t)||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function Ck(t){if(Ro.Konva.isUnminified)return function(e,n){const r=rn.Util._isNumber(e),i=rn.Util._isArray(e)&&e.length==t;return!r&&!i&&rn.Util.warn(Mo(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function kk(){if(Ro.Konva.isUnminified)return function(t,e){return rn.Util._isNumber(t)||t==="auto"||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function Tk(){if(Ro.Konva.isUnminified)return function(t,e){return rn.Util._isString(t)||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function Ak(){if(Ro.Konva.isUnminified)return function(t,e){const n=rn.Util._isString(t),r=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return n||r||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function Rk(){if(Ro.Konva.isUnminified)return function(t,e){return rn.Util._isFunction(t)||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a function.'),t}}function Mk(){if(Ro.Konva.isUnminified)return function(t,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(rn.Util._isArray(t)?t.forEach(function(r){rn.Util._isNumber(r)||rn.Util.warn('"'+e+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function Lk(){if(Ro.Konva.isUnminified)return function(t,e){return t===!0||t===!1||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function Nk(t){if(Ro.Konva.isUnminified)return function(e,n){return e==null||rn.Util.isObject(e)||rn.Util.warn(Mo(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Factory=void 0;const e=en,n=Ze,r="get",i="set";t.Factory={addGetterSetter(o,a,l,s,f){t.Factory.addGetter(o,a,l),t.Factory.addSetter(o,a,s,f),t.Factory.addOverloadedGetterSetter(o,a)},addGetter(o,a,l){const s=r+e.Util._capitalize(a);o.prototype[s]=o.prototype[s]||function(){const f=this.attrs[a];return f===void 0?l:f}},addSetter(o,a,l,s){const f=i+e.Util._capitalize(a);o.prototype[f]||t.Factory.overWriteSetter(o,a,l,s)},overWriteSetter(o,a,l,s){const f=i+e.Util._capitalize(a);o.prototype[f]=function(h){return l&&h!==void 0&&h!==null&&(h=l.call(this,h,a)),this._setAttr(a,h),s&&s.call(this),this}},addComponentsGetterSetter(o,a,l,s,f){let h=l.length,x=e.Util._capitalize,w=r+x(a),v=i+x(a),O,g;o.prototype[w]=function(){const p={};for(O=0;O<h;O++)g=l[O],p[g]=this.getAttr(a+x(g));return p};const b=(0,n.getComponentValidator)(l);o.prototype[v]=function(p){let y=this.attrs[a],d;s&&(p=s.call(this,p)),b&&b.call(this,p,a);for(d in p)p.hasOwnProperty(d)&&this._setAttr(a+x(d),p[d]);return p||l.forEach(m=>{this._setAttr(a+x(m),void 0)}),this._fireChangeEvent(a,y,p),f&&f.call(this),this},t.Factory.addOverloadedGetterSetter(o,a)},addOverloadedGetterSetter(o,a){const l=e.Util._capitalize(a),s=i+l,f=r+l;o.prototype[a]=function(){return arguments.length?(this[s](arguments[0]),this):this[f]()}},addDeprecatedGetterSetter(o,a,l,s){e.Util.error("Adding deprecated "+a);const f=r+e.Util._capitalize(a),h=a+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[f]=function(){e.Util.error(h);const x=this.attrs[a];return x===void 0?l:x},t.Factory.addSetter(o,a,s,function(){e.Util.error(h)}),t.Factory.addOverloadedGetterSetter(o,a)},backCompat(o,a){e.Util.each(a,function(l,s){const f=o.prototype[s],h=r+e.Util._capitalize(l),x=i+e.Util._capitalize(l);function w(){f.apply(this,arguments),e.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+s+'" instead.')}o.prototype[l]=w,o.prototype[h]=w,o.prototype[x]=w})},afterSetFilter(){this._filterUpToDate=!1}}})(ut);var wi={},So={};Object.defineProperty(So,"__esModule",{value:!0});So.HitContext=So.SceneContext=So.Context=void 0;const r9=en,Ik=st;function Dk(t){let e=[],n=t.length,r=r9.Util,i,o;for(i=0;i<n;i++)o=t[i],r._isNumber(o)?o=Math.round(o*1e3)/1e3:r._isString(o)||(o=o+""),e.push(o);return e}const 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"],Vk=100;class np{constructor(e){this.canvas=e,Ik.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,n){let r=this.traceArr,i=r.length,o="",a,l,s,f;for(a=0;a<i;a++)l=r[a],s=l.method,s?(f=l.args,o+=s,e?o+=Hk:r9.Util._isArray(f[0])?o+=zk+f.join(R5)+Bk:(n&&(f=f.map(h=>typeof h=="number"?Math.floor(h):h)),o+=jk+f.join(R5)+Fk)):(o+=l.property,e||(o+=$k+l.val)),o+=Uk;return o}clearTrace(){this.traceArr=[]}_trace(e){let n=this.traceArr,r;n.push(e),r=n.length,r>=Vk&&n.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){const n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(e,n){this._context[e]=n}arc(e,n,r,i,o,a){this._context.arc(e,n,r,i,o,a)}arcTo(e,n,r,i,o){this._context.arcTo(e,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,r,i,o,a){this._context.bezierCurveTo(e,n,r,i,o,a)}clearRect(e,n,r,i){this._context.clearRect(e,n,r,i)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,n){const r=arguments;if(r.length===2)return this._context.createImageData(e,n);if(r.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,r,i){return this._context.createLinearGradient(e,n,r,i)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,r,i,o,a){return this._context.createRadialGradient(e,n,r,i,o,a)}drawImage(e,n,r,i,o,a,l,s,f){const h=arguments,x=this._context;h.length===3?x.drawImage(e,n,r):h.length===5?x.drawImage(e,n,r,i,o):h.length===9&&x.drawImage(e,n,r,i,o,a,l,s,f)}ellipse(e,n,r,i,o,a,l,s){this._context.ellipse(e,n,r,i,o,a,l,s)}isPointInPath(e,n,r,i){return r?this._context.isPointInPath(r,e,n,i):this._context.isPointInPath(e,n,i)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,n,r,i){this._context.fillRect(e,n,r,i)}strokeRect(e,n,r,i){this._context.strokeRect(e,n,r,i)}fillText(e,n,r,i){i?this._context.fillText(e,n,r,i):this._context.fillText(e,n,r)}measureText(e){return this._context.measureText(e)}getImageData(e,n,r,i){return this._context.getImageData(e,n,r,i)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,r,i){this._context.rect(e,n,r,i)}roundRect(e,n,r,i,o){this._context.roundRect(e,n,r,i,o)}putImageData(e,n,r){this._context.putImageData(e,n,r)}quadraticCurveTo(e,n,r,i){this._context.quadraticCurveTo(e,n,r,i)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,r,i,o,a){this._context.setTransform(e,n,r,i,o,a)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,r,i){this._context.strokeText(e,n,r,i)}transform(e,n,r,i,o,a){this._context.transform(e,n,r,i,o,a)}translate(e,n){this._context.translate(e,n)}_enableTrace(){let e=this,n=M5.length,r=this.setAttr,i,o;const a=function(l){let s=e[l],f;e[l]=function(){return o=Dk(Array.prototype.slice.call(arguments,0)),f=s.apply(e,arguments),e._trace({method:l,args:o}),f}};for(i=0;i<n;i++)a(M5[i]);e.setAttr=function(){r.apply(e,arguments);const l=arguments[0];let s=arguments[1];(l==="shadowOffsetX"||l==="shadowOffsetY"||l==="shadowBlur")&&(s=s/this.canvas.getPixelRatio()),e._trace({property:l,val:s})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;!n||n==="source-over"||this.setAttr("globalCompositeOperation",n)}}So.Context=np;Gk.forEach(function(t){Object.defineProperty(np.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class qk extends np{constructor(e,{willReadFrequently:n=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(e){const n=e.fill();this.setAttr("fillStyle",n),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const n=e._getLinearGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fillRadialGradient(e){const n=e._getRadialGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fill(e){const n=e.fill(),r=e.getFillPriority();if(n&&r==="color"){this._fillColor(e);return}const i=e.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(e);return}const o=e.getFillLinearGradientColorStops();if(o&&r==="linear-gradient"){this._fillLinearGradient(e);return}const a=e.getFillRadialGradientColorStops();if(a&&r==="radial-gradient"){this._fillRadialGradient(e);return}n?this._fillColor(e):i?this._fillPattern(e):o?this._fillLinearGradient(e):a&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const n=e.getStrokeLinearGradientStartPoint(),r=e.getStrokeLinearGradientEndPoint(),i=e.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(let a=0;a<i.length;a+=2)o.addColorStop(i[a],i[a+1]);this.setAttr("strokeStyle",o)}}_stroke(e){const n=e.dash(),r=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!r){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e),n&&e.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),r||this.restore()}}_applyShadow(e){var n,r,i;const o=(n=e.getShadowRGBA())!==null&&n!==void 0?n:"black",a=(r=e.getShadowBlur())!==null&&r!==void 0?r:5,l=(i=e.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},s=e.getAbsoluteScale(),f=this.canvas.getPixelRatio(),h=s.x*f,x=s.y*f;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",a*Math.min(Math.abs(h),Math.abs(x))),this.setAttr("shadowOffsetX",l.x*h),this.setAttr("shadowOffsetY",l.y*x)}}So.SceneContext=qk;class Wk extends np{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const n=e.getStrokeScaleEnabled();if(!n){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e);const r=e.hitStrokeWidth(),i=r==="auto"?e.strokeWidth():r;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),n||this.restore()}}}So.HitContext=Wk;Object.defineProperty(wi,"__esModule",{value:!0});wi.HitCanvas=wi.SceneCanvas=wi.Canvas=void 0;const _h=en,i9=So,o9=st,Yk=ut,Kk=Ze;let vd;function Xk(){if(vd)return vd;const t=_h.Util.createCanvasElement(),e=t.getContext("2d");return vd=function(){const n=o9.Konva._global.devicePixelRatio||1,r=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/r}(),_h.Util.releaseCanvas(t),vd}class rp{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const r=(e||{}).pixelRatio||o9.Konva.pixelRatio||Xk();this.pixelRatio=r,this._canvas=_h.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){const n=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,n){this.setWidth(e||0),this.setHeight(n||0)}toDataURL(e,n){try{return this._canvas.toDataURL(e,n)}catch{try{return this._canvas.toDataURL()}catch(i){return _h.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}wi.Canvas=rp;Yk.Factory.addGetterSetter(rp,"pixelRatio",void 0,(0,Kk.getNumberValidator)());class Zk extends rp{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new i9.SceneContext(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}wi.SceneCanvas=Zk;class Qk extends rp{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new i9.HitContext(this),this.setSize(e.width,e.height)}}wi.HitCanvas=Qk;var ip={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DD=void 0;const e=st,n=en;t.DD={get isDragging(){let r=!1;return t.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){let r;return t.DD._dragElements.forEach(i=>{r=i.node}),r},_dragElements:new Map,_drag(r){const i=[];t.DD._dragElements.forEach((o,a)=>{const{node:l}=o,s=l.getStage();s.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=n.Util._getFirstPointerId(r));const f=s._changedPointerPositions.find(h=>h.id===o.pointerId);if(f){if(o.dragStatus!=="dragging"){const h=l.dragDistance();if(Math.max(Math.abs(f.x-o.startPointerPos.x),Math.abs(f.y-o.startPointerPos.y))<h||(l.startDrag({evt:r}),!l.isDragging()))return}l._setDragPosition(r,o),i.push(l)}}),i.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const i=[];t.DD._dragElements.forEach(o=>{const{node:a}=o,l=a.getStage();if(r&&l.setPointersPositions(r),!l._changedPointerPositions.find(h=>h.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(t.DD.justDragged=!0,e.Konva._mouseListenClick=!1,e.Konva._touchListenClick=!1,e.Konva._pointerListenClick=!1,o.dragStatus="stopped");const f=o.node.getLayer()||o.node instanceof e.Konva.Stage&&o.node;f&&i.indexOf(f)===-1&&i.push(f)}),i.forEach(o=>{o.draw()})},_endDragAfter(r){t.DD._dragElements.forEach((i,o)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:r},!0),i.dragStatus!=="dragging"&&t.DD._dragElements.delete(o)})}},e.Konva.isBrowser&&(window.addEventListener("mouseup",t.DD._endDragBefore,!0),window.addEventListener("touchend",t.DD._endDragBefore,!0),window.addEventListener("touchcancel",t.DD._endDragBefore,!0),window.addEventListener("mousemove",t.DD._drag),window.addEventListener("touchmove",t.DD._drag),window.addEventListener("mouseup",t.DD._endDragAfter,!1),window.addEventListener("touchend",t.DD._endDragAfter,!1),window.addEventListener("touchcancel",t.DD._endDragAfter,!1))})(ip);Object.defineProperty(qt,"__esModule",{value:!0});qt.Node=void 0;const pt=en,qc=ut,ju=wi,Ko=st,Vr=ip,sn=Ze,jd="absoluteOpacity",md="allEventListeners",ho="absoluteTransform",L5="absoluteScale",Wa="canvas",Jk="Change",eT="children",tT="konva",om="listening",N5="mouseenter",I5="mouseleave",D5="set",j5="Shape",Fd=" ",F5="stage",Xo="transform",nT="Stage",am="visible",rT=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Fd);let iT=1,ot=class lm{constructor(e){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(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===Xo||e===ho)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){let r=this._cache.get(e);return(r===void 0||(e===Xo||e===ho)&&r.dirty===!0)&&(r=n.call(this),this._cache.set(e,r)),r}_calculate(e,n,r){if(!this._attachedDepsListeners.get(e)){const i=n.map(o=>o+"Change.konva").join(Fd);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,r)}_getCanvasCache(){return this._cache.get(Wa)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===ho&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Wa)){const{scene:e,filter:n,hit:r}=this._cache.get(Wa);pt.Util.releaseCanvas(e,n,r),this._cache.delete(Wa)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const n=e||{};let r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,l=n.x===void 0?Math.floor(r.x):n.x,s=n.y===void 0?Math.floor(r.y):n.y,f=n.offset||0,h=n.drawBorder||!1,x=n.hitCanvasPixelRatio||1;if(!i||!o){pt.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(r.x)-l)>.5?1:0,v=Math.abs(Math.round(r.y)-s)>.5?1:0;i+=f*2+w,o+=f*2+v,l-=f,s-=f;const O=new ju.SceneCanvas({pixelRatio:a,width:i,height:o}),g=new ju.SceneCanvas({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),b=new ju.HitCanvas({pixelRatio:x,width:i,height:o}),p=O.getContext(),y=b.getContext();return b.isCache=!0,O.isCache=!0,this._cache.delete(Wa),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(O.getContext()._context.imageSmoothingEnabled=!1,g.getContext()._context.imageSmoothingEnabled=!1),p.save(),y.save(),p.translate(-l,-s),y.translate(-l,-s),this._isUnderCache=!0,this._clearSelfAndDescendantCache(jd),this._clearSelfAndDescendantCache(L5),this.drawScene(O,this),this.drawHit(b,this),this._isUnderCache=!1,p.restore(),y.restore(),h&&(p.save(),p.beginPath(),p.rect(0,0,i,o),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set(Wa,{scene:O,filter:g,hit:b,x:l,y:s}),this._requestDraw(),this}isCached(){return this._cache.has(Wa)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){const r=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let i=1/0,o=1/0,a=-1/0,l=-1/0;const s=this.getAbsoluteTransform(n);return r.forEach(function(f){const h=s.point(f);i===void 0&&(i=a=h.x,o=l=h.y),i=Math.min(i,h.x),o=Math.min(o,h.y),a=Math.max(a,h.x),l=Math.max(l,h.y)}),{x:i,y:o,width:a-i,height:l-o}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);const r=this._getCachedSceneCanvas(),i=r.pixelRatio;e.drawImage(r._canvas,0,0,r.width/i,r.height/i),e.restore()}_drawCachedHitCanvas(e){const n=this._getCanvasCache(),r=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,l,s,f;if(e){if(!this._filterUpToDate){const h=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=e.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/h,r.getHeight()/h),l=o.getImageData(0,0,i.getWidth(),i.getHeight()),s=0;s<a;s++){if(f=e[s],typeof f!="function"){pt.Util.error("Filter should be type of function, but got "+typeof f+" instead. Please check correct filters");continue}f.call(this,l),o.putImageData(l,0,0)}}catch(x){pt.Util.error("Unable to apply filter. "+x.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return r}on(e,n){if(this._cache&&this._cache.delete(md),arguments.length===3)return this._delegate.apply(this,arguments);let r=e.split(Fd),i=r.length,o,a,l,s,f;for(o=0;o<i;o++)a=r[o],l=a.split("."),s=l[0],f=l[1]||"",this.eventListeners[s]||(this.eventListeners[s]=[]),this.eventListeners[s].push({name:f,handler:n});return this}off(e,n){let r=(e||"").split(Fd),i=r.length,o,a,l,s,f,h;if(this._cache&&this._cache.delete(md),!e)for(a in this.eventListeners)this._off(a);for(o=0;o<i;o++)if(l=r[o],s=l.split("."),f=s[0],h=s[1],f)this.eventListeners[f]&&this._off(f,h,n);else for(a in this.eventListeners)this._off(a,h,n);return this}dispatchEvent(e){const n={target:this,type:e.type,evt:e};return this.fire(e.type,n),this}addEventListener(e,n){return this.on(e,function(r){n.call(this,r.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,n,r){const i=this;this.on(e,function(o){const a=o.target.findAncestors(n,!0,i);for(let l=0;l<a.length;l++)o=pt.Util.cloneObject(o),o.currentTarget=a[l],r.call(a[l],o)})}remove(){return this.isDragging()&&this.stopDrag(),Vr.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(ho),this._clearSelfAndDescendantCache(jd),this._clearSelfAndDescendantCache(L5),this._clearSelfAndDescendantCache(F5),this._clearSelfAndDescendantCache(am),this._clearSelfAndDescendantCache(om)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const n="get"+pt.Util._capitalize(e);return pt.Util._isFunction(this[n])?this[n]():this.attrs[e]}getAncestors(){let e=this.getParent(),n=[];for(;e;)n.push(e),e=e.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let n,r;if(!e)return this;for(n in e)n!==eT&&(r=D5+pt.Util._capitalize(n),pt.Util._isFunction(this[r])?this[r](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(om,this._isListening)}_isListening(e){if(!this.listening())return!1;const r=this.getParent();return r&&r!==e&&this!==e?r._isListening(e):!0}isVisible(){return this._getCache(am,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const r=this.getParent();return r&&r!==e&&this!==e?r._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);const r=this.getLayer();let i=!1;Vr.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});const o=!n&&!Ko.Konva.hitOnDragEnabled&&(i||Ko.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),n=this,r=0,i,o,a,l;function s(h){for(i=[],o=h.length,a=0;a<o;a++)l=h[a],r++,l.nodeType!==j5&&(i=i.concat(l.getChildren().slice())),l._id===n._id&&(a=o);i.length>0&&i[0].getDepth()<=e&&s(i)}const f=this.getStage();return n.nodeType!==nT&&f&&s(f.getChildren()),r}getDepth(){let e=0,n=this.parent;for(;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Xo),this._clearSelfAndDescendantCache(ho)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const n=e.getPointerPosition();if(!n)return null;const r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}getAbsolutePosition(e){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!e&&(e=!0);const i=this.getAbsoluteTransform(e).getMatrix(),o=new pt.Transform,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(e){const{x:n,y:r,...i}=this._clearTransform();this.attrs.x=n,this.attrs.y=r,this._clearCache(Xo);const o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(e.x,e.y),e={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(i),this.setPosition({x:e.x,y:e.y}),this._clearCache(Xo),this._clearSelfAndDescendantCache(ho),this}_setTransform(e){let n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){const e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let n=e.x,r=e.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(e,n){let r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a<o;a++)e(r[a])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return pt.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return pt.Util.warn("Node has no parent. moveUp function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return pt.Util.warn("Node has no parent. moveDown function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return pt.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return pt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&pt.Util.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(jd,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),n,r,i,o,a;const l={attrs:{},className:this.getClassName()};for(n in e)r=e[n],a=pt.Util.isObject(r)&&!pt.Util._isPlainObject(r)&&!pt.Util._isArray(r),!a&&(i=typeof this[n]=="function"&&this[n],delete e[n],o=i?i.call(this):null,e[n]=r,o!==r&&(l.attrs[n]=r));return pt.Util._prepareToStringify(l)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,r){const i=[];n&&this._isMatch(e)&&i.push(this);let o=this.parent;for(;o;){if(o===r)return i;o._isMatch(e)&&i.push(o),o=o.parent}return i}isAncestorOf(e){return!1}findAncestor(e,n,r){return this.findAncestors(e,n,r)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let n=e.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i<r;i++)if(o=n[i],pt.Util.isValidSelector(o)||(pt.Util.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),pt.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),pt.Util.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){const e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(F5,this._getStage)}_getStage(){const e=this.getParent();return e?e.getStage():null}fire(e,n={},r){return n.target=n.target||this,r?this._fireAndBubble(e,n):this._fire(e,n),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(ho,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let n;if(e)return n=new pt.Transform,this._eachAncestorReverse(function(r){const i=r.transformsEnabled();i==="all"?n.multiply(r.getTransform()):i==="position"&&n.translate(r.x()-r.offsetX(),r.y()-r.offsetY())},e),n;{n=this._cache.get(ho)||new pt.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();const r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const i=this.attrs.x||0,o=this.attrs.y||0,a=this.attrs.offsetX||0,l=this.attrs.offsetY||0;n.translate(i-a,o-l)}return n.dirty=!1,n}}getAbsoluteScale(e){let n=this;for(;n;)n._isUnderCache&&(e=n),n=n.getParent();const i=this.getAbsoluteTransform(e).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(Xo,this._getTransform)}_getTransform(){var e,n;const r=this._cache.get(Xo)||new pt.Transform;r.reset();const i=this.x(),o=this.y(),a=Ko.Konva.getAngle(this.rotation()),l=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,s=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,f=this.attrs.skewX||0,h=this.attrs.skewY||0,x=this.attrs.offsetX||0,w=this.attrs.offsetY||0;return(i!==0||o!==0)&&r.translate(i,o),a!==0&&r.rotate(a),(f!==0||h!==0)&&r.skew(f,h),(l!==1||s!==1)&&r.scale(l,s),(x!==0||w!==0)&&r.translate(-1*x,-1*w),r.dirty=!1,r}clone(e){let n=pt.Util.cloneObject(this.attrs),r,i,o,a,l;for(r in e)n[r]=e[r];const s=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],o=i.length,a=0;a<o;a++)l=i[a],l.name.indexOf(tT)<0&&(s.eventListeners[r]||(s.eventListeners[r]=[]),s.eventListeners[r].push(l));return s}_toKonvaCanvas(e){e=e||{};const n=this.getClientRect(),r=this.getStage(),i=e.x!==void 0?e.x:Math.floor(n.x),o=e.y!==void 0?e.y:Math.floor(n.y),a=e.pixelRatio||1,l=new ju.SceneCanvas({width:e.width||Math.ceil(n.width)||(r?r.width():0),height:e.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:a}),s=l.getContext(),f=new ju.SceneCanvas({width:l.width/l.pixelRatio+Math.abs(i),height:l.height/l.pixelRatio+Math.abs(o),pixelRatio:l.pixelRatio});return e.imageSmoothingEnabled===!1&&(s._context.imageSmoothingEnabled=!1),s.save(),(i||o)&&s.translate(-1*i,-1*o),this.drawScene(l,void 0,f),s.restore(),l}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};const n=e.mimeType||null,r=e.quality||null,i=this._toKonvaCanvas(e).toDataURL(n,r);return e.callback&&e.callback(i),i}toImage(e){return new Promise((n,r)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,pt.Util._urlToImage(this.toDataURL(e),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(e){return new Promise((n,r)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,this.toCanvas(e).toBlob(o=>{n(o),i==null||i(o)},e==null?void 0:e.mimeType,e==null?void 0:e.quality)}catch(i){r(i)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Ko.Konva.dragDistance}_off(e,n,r){let i=this.eventListeners[e],o,a,l;for(o=0;o<i.length;o++)if(a=i[o].name,l=i[o].handler,(a!=="konva"||n==="konva")&&(!n||a===n)&&(!r||r===l)){if(i.splice(o,1),i.length===0){delete this.eventListeners[e];break}o--}}_fireChangeEvent(e,n,r){this._fire(e+Jk,{oldVal:n,newVal:r})}addName(e){if(!this.hasName(e)){const n=this.name(),r=n?n+" "+e:e;this.name(r)}return this}hasName(e){if(!e)return!1;const n=this.name();return n?(n||"").split(/\s/g).indexOf(e)!==-1:!1}removeName(e){const n=(this.name()||"").split(/\s/g),r=n.indexOf(e);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(e,n){const r=this[D5+pt.Util._capitalize(e)];return pt.Util._isFunction(r)?r.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(Ko.Konva.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,n){const r=this.attrs[e];r===n&&!pt.Util.isObject(n)||(n==null?delete this.attrs[e]:this.attrs[e]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(e,r,n),this._requestDraw())}_setComponentAttr(e,n,r){let i;r!==void 0&&(i=this.attrs[e],i||(this.attrs[e]=this.getAttr(e)),this.attrs[e][n]=r,this._fireChangeEvent(e,i,r))}_fireAndBubble(e,n,r){if(n&&this.nodeType===j5&&(n.target=this),!((e===N5||e===I5)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r))){this._fire(e,n);const o=(e===N5||e===I5)&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!o&&(r&&r.parent?this._fireAndBubble.call(this.parent,e,n,r):this._fireAndBubble.call(this.parent,e,n))}}_getProtoListeners(e){var n,r,i;const o=(n=this._cache.get(md))!==null&&n!==void 0?n:{};let a=o==null?void 0:o[e];if(a===void 0){a=[];let l=Object.getPrototypeOf(this);for(;l;){const s=(i=(r=l.eventListeners)===null||r===void 0?void 0:r[e])!==null&&i!==void 0?i:[];a.push(...s),l=Object.getPrototypeOf(l)}o[e]=a,this._cache.set(md,o)}return a}_fire(e,n){n=n||{},n.currentTarget=this,n.type=e;const r=this._getProtoListeners(e);if(r)for(var i=0;i<r.length;i++)r[i].handler.call(this,n);const o=this.eventListeners[e];if(o)for(var i=0;i<o.length;i++)o[i].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){const n=e?e.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition();if(!r)return;const o=r._getPointerById(n)||r._changedPointerPositions[0]||i;Vr.DD._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-i.x,y:o.y-i.y},dragStatus:"ready",pointerId:n})}startDrag(e,n=!0){Vr.DD._dragElements.has(this._id)||this._createDragElement(e);const r=Vr.DD._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},n)}_setDragPosition(e,n){const r=this.getStage()._getPointerById(n.pointerId);if(!r)return;let i={x:r.x-n.offset.x,y:r.y-n.offset.y};const o=this.dragBoundFunc();if(o!==void 0){const a=o.call(this,i,e);a?i=a:pt.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}stopDrag(e){const n=Vr.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),Vr.DD._endDragBefore(e),Vr.DD._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=Vr.DD._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(e.evt.button!==void 0)||Ko.Konva.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let i=!1;Vr.DD._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const n=Vr.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&Vr.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return pt.Util.haveIntersection(r,this.getClientRect())}static create(e,n){return pt.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){let r=lm.prototype.getClassName.call(e),i=e.children,o,a,l;n&&(e.attrs.container=n),Ko.Konva[r]||(pt.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const s=Ko.Konva[r];if(o=new s(e.attrs),i)for(a=i.length,l=0;l<a;l++)o.add(lm._createNode(i[l]));return o}};qt.Node=ot;ot.prototype.nodeType="Node";ot.prototype._attrsAffectingSize=[];ot.prototype.eventListeners={};ot.prototype.on.call(ot.prototype,rT,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Xo),this._clearSelfAndDescendantCache(ho)});ot.prototype.on.call(ot.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(am)});ot.prototype.on.call(ot.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(om)});ot.prototype.on.call(ot.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(jd)});const Lt=qc.Factory.addGetterSetter;Lt(ot,"zIndex");Lt(ot,"absolutePosition");Lt(ot,"position");Lt(ot,"x",0,(0,sn.getNumberValidator)());Lt(ot,"y",0,(0,sn.getNumberValidator)());Lt(ot,"globalCompositeOperation","source-over",(0,sn.getStringValidator)());Lt(ot,"opacity",1,(0,sn.getNumberValidator)());Lt(ot,"name","",(0,sn.getStringValidator)());Lt(ot,"id","",(0,sn.getStringValidator)());Lt(ot,"rotation",0,(0,sn.getNumberValidator)());qc.Factory.addComponentsGetterSetter(ot,"scale",["x","y"]);Lt(ot,"scaleX",1,(0,sn.getNumberValidator)());Lt(ot,"scaleY",1,(0,sn.getNumberValidator)());qc.Factory.addComponentsGetterSetter(ot,"skew",["x","y"]);Lt(ot,"skewX",0,(0,sn.getNumberValidator)());Lt(ot,"skewY",0,(0,sn.getNumberValidator)());qc.Factory.addComponentsGetterSetter(ot,"offset",["x","y"]);Lt(ot,"offsetX",0,(0,sn.getNumberValidator)());Lt(ot,"offsetY",0,(0,sn.getNumberValidator)());Lt(ot,"dragDistance",null,(0,sn.getNumberValidator)());Lt(ot,"width",0,(0,sn.getNumberValidator)());Lt(ot,"height",0,(0,sn.getNumberValidator)());Lt(ot,"listening",!0,(0,sn.getBooleanValidator)());Lt(ot,"preventDefault",!0,(0,sn.getBooleanValidator)());Lt(ot,"filters",null,function(t){return this._filterUpToDate=!1,t});Lt(ot,"visible",!0,(0,sn.getBooleanValidator)());Lt(ot,"transformsEnabled","all",(0,sn.getStringValidator)());Lt(ot,"size");Lt(ot,"dragBoundFunc");Lt(ot,"draggable",!1,(0,sn.getBooleanValidator)());qc.Factory.backCompat(ot,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var wl={};Object.defineProperty(wl,"__esModule",{value:!0});wl.Container=void 0;const Zs=ut,G1=qt,op=Ze;class Sl extends G1.Node{constructor(){super(...arguments),this.children=[]}getChildren(e){if(!e)return this.children||[];const n=this.children||[],r=[];return n.forEach(function(i){e(i)&&r.push(i)}),r}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let r=0;r<e.length;r++)this.add(e[r]);return this}const n=e[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const n=this._generalFind(e,!0);return n.length>0?n[0]:void 0}_generalFind(e,n){const r=[];return this._descendants(i=>{const o=i._isMatch(e);return o&&r.push(i),!!(o&&n)}),r}_descendants(e){let n=!1;const r=this.getChildren();for(const i of r){if(n=e(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(e),n))return!0}return!1}toObject(){const e=G1.Node.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){let n=e.getParent();for(;n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){const n=G1.Node.prototype.clone.call(this,e);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(e){const n=[];return this.find("Shape").forEach(r=>{r.isVisible()&&r.intersects(e)&&n.push(r)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(e,n,r){const i=this.getLayer(),o=e||i&&i.getCanvas(),a=o&&o.getContext(),l=this._getCanvasCache(),s=l&&l.scene,f=o&&o.isCache;if(!this.isVisible()&&!f)return this;if(s){a.save();const h=this.getAbsoluteTransform(n).getMatrix();a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren("drawScene",o,n,r);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;const r=this.getLayer(),i=e||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache();if(a&&a.hit){o.save();const s=this.getAbsoluteTransform(n).getMatrix();o.transform(s[0],s[1],s[2],s[3],s[4],s[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(e,n,r,i){var o;const a=n&&n.getContext(),l=this.clipWidth(),s=this.clipHeight(),f=this.clipFunc(),h=typeof l=="number"&&typeof s=="number"||f,x=r===this;if(h){a.save();const v=this.getAbsoluteTransform(r);let O=v.getMatrix();a.transform(O[0],O[1],O[2],O[3],O[4],O[5]),a.beginPath();let g;if(f)g=f.call(this,a,this);else{const b=this.clipX(),p=this.clipY();a.rect(b||0,p||0,l,s)}a.clip.apply(a,g),O=v.copy().invert().getMatrix(),a.transform(O[0],O[1],O[2],O[3],O[4],O[5])}const w=!x&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";w&&(a.save(),a._applyGlobalCompositeOperation(this)),(o=this.children)===null||o===void 0||o.forEach(function(v){v[e](n,r,i)}),w&&a.restore(),h&&a.restore()}getClientRect(e={}){var n;const r=e.skipTransform,i=e.relativeTo;let o,a,l,s,f={x:1/0,y:1/0,width:0,height:0};const h=this;(n=this.children)===null||n===void 0||n.forEach(function(v){if(!v.visible())return;const O=v.getClientRect({relativeTo:h,skipShadow:e.skipShadow,skipStroke:e.skipStroke});O.width===0&&O.height===0||(o===void 0?(o=O.x,a=O.y,l=O.x+O.width,s=O.y+O.height):(o=Math.min(o,O.x),a=Math.min(a,O.y),l=Math.max(l,O.x+O.width),s=Math.max(s,O.y+O.height)))});const x=this.find("Shape");let w=!1;for(let v=0;v<x.length;v++)if(x[v]._isVisible(this)){w=!0;break}return w&&o!==void 0?f={x:o,y:a,width:l-o,height:s-a}:f={x:0,y:0,width:0,height:0},r?f:this._transformedRect(f,i)}}wl.Container=Sl;Zs.Factory.addComponentsGetterSetter(Sl,"clip",["x","y","width","height"]);Zs.Factory.addGetterSetter(Sl,"clipX",void 0,(0,op.getNumberValidator)());Zs.Factory.addGetterSetter(Sl,"clipY",void 0,(0,op.getNumberValidator)());Zs.Factory.addGetterSetter(Sl,"clipWidth",void 0,(0,op.getNumberValidator)());Zs.Factory.addGetterSetter(Sl,"clipHeight",void 0,(0,op.getNumberValidator)());Zs.Factory.addGetterSetter(Sl,"clipFunc");var a9={},Ca={};Object.defineProperty(Ca,"__esModule",{value:!0});Ca.getCapturedShape=aT;Ca.createEvent=Iy;Ca.hasPointerCapture=lT;Ca.setPointerCapture=sT;Ca.releaseCapture=s9;const oT=st,Pc=new Map,l9=oT.Konva._global.PointerEvent!==void 0;function aT(t){return Pc.get(t)}function Iy(t){return{evt:t,pointerId:t.pointerId}}function lT(t,e){return Pc.get(t)===e}function sT(t,e){s9(t),e.getStage()&&(Pc.set(t,e),l9&&e._fire("gotpointercapture",Iy(new PointerEvent("gotpointercapture"))))}function s9(t,e){const n=Pc.get(t);if(!n)return;const r=n.getStage();r&&r.content,Pc.delete(t),l9&&n._fire("lostpointercapture",Iy(new PointerEvent("lostpointercapture")))}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Stage=t.stages=void 0;const e=en,n=ut,r=wl,i=st,o=wi,a=ip,l=st,s=Ca,f="Stage",h="string",x="px",w="mouseout",v="mouseleave",O="mouseover",g="mouseenter",b="mousemove",p="mousedown",y="mouseup",d="pointermove",m="pointerdown",_="pointerup",A="pointercancel",C="lostpointercapture",R="pointerout",S="pointerleave",E="pointerover",P="pointerenter",T="contextmenu",N="touchstart",U="touchend",G="touchmove",Z="touchcancel",W="wheel",H=5,L=[[g,"_pointerenter"],[p,"_pointerdown"],[b,"_pointermove"],[y,"_pointerup"],[v,"_pointerleave"],[N,"_pointerdown"],[G,"_pointermove"],[U,"_pointerup"],[Z,"_pointercancel"],[O,"_pointerover"],[W,"_wheel"],[T,"_contextmenu"],[m,"_pointerdown"],[d,"_pointermove"],[_,"_pointerup"],[A,"_pointercancel"],[C,"_lostpointercapture"]],M={mouse:{[R]:w,[S]:v,[E]:O,[P]:g,[d]:b,[m]:p,[_]:y,[A]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[R]:"touchout",[S]:"touchleave",[E]:"touchover",[P]:"touchenter",[d]:G,[m]:N,[_]:U,[A]:Z,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[R]:R,[S]:S,[E]:E,[P]:P,[d]:d,[m]:m,[_]:_,[A]:A,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},D=$=>$.indexOf("pointer")>=0?"pointer":$.indexOf("touch")>=0?"touch":"mouse",B=$=>{const z=D($);if(z==="pointer")return i.Konva.pointerEventsEnabled&&M.pointer;if(z==="touch")return M.touch;if(z==="mouse")return M.mouse};function V($={}){return($.clipFunc||$.clipWidth||$.clipHeight)&&e.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),$}const Y="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";t.stages=[];class F extends r.Container{constructor(z){super(V(z)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),t.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{V(this.attrs)}),this._checkVisibility()}_validateAdd(z){const K=z.getType()==="Layer",X=z.getType()==="FastLayer";K||X||e.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const z=this.visible()?"":"none";this.content.style.display=z}setContainer(z){if(typeof z===h){if(z.charAt(0)==="."){const X=z.slice(1);z=document.getElementsByClassName(X)[0]}else{var K;z.charAt(0)!=="#"?K=z:K=z.slice(1),z=document.getElementById(K)}if(!z)throw"Can not find container in document with id "+K}return this._setAttr("container",z),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),z.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){let z=this.children,K=z.length,X;for(X=0;X<K;X++)z[X].clear();return this}clone(z){return z||(z={}),z.container=typeof document<"u"&&document.createElement("div"),r.Container.prototype.clone.call(this,z)}destroy(){super.destroy();const z=this.content;z&&e.Util._isInDocument(z)&&this.container().removeChild(z);const K=t.stages.indexOf(this);return K>-1&&t.stages.splice(K,1),e.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const z=this._pointerPositions[0]||this._changedPointerPositions[0];return z?{x:z.x,y:z.y}:(e.Util.warn(Y),null)}_getPointerById(z){return this._pointerPositions.find(K=>K.id===z)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(z){z=z||{},z.x=z.x||0,z.y=z.y||0,z.width=z.width||this.width(),z.height=z.height||this.height();const K=new o.SceneCanvas({width:z.width,height:z.height,pixelRatio:z.pixelRatio||1}),X=K.getContext()._context,Q=this.children;return(z.x||z.y)&&X.translate(-1*z.x,-1*z.y),Q.forEach(function(J){if(!J.isVisible())return;const ne=J._toKonvaCanvas(z);X.drawImage(ne._canvas,z.x,z.y,ne.getWidth()/ne.getPixelRatio(),ne.getHeight()/ne.getPixelRatio())}),K}getIntersection(z){if(!z)return null;let K=this.children,X=K.length,Q=X-1,J;for(J=Q;J>=0;J--){const ne=K[J].getIntersection(z);if(ne)return ne}return null}_resizeDOM(){const z=this.width(),K=this.height();this.content&&(this.content.style.width=z+x,this.content.style.height=K+x),this.bufferCanvas.setSize(z,K),this.bufferHitCanvas.setSize(z,K),this.children.forEach(X=>{X.setSize({width:z,height:K}),X.draw()})}add(z,...K){if(arguments.length>1){for(let Q=0;Q<arguments.length;Q++)this.add(arguments[Q]);return this}super.add(z);const X=this.children.length;return X>H&&e.Util.warn("The stage has "+X+" 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."),z.setSize({width:this.width(),height:this.height()}),z.draw(),i.Konva.isBrowser&&this.content.appendChild(z.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(z){return s.hasPointerCapture(z,this)}setPointerCapture(z){s.setPointerCapture(z,this)}releaseCapture(z){s.releaseCapture(z,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&L.forEach(([z,K])=>{this.content.addEventListener(z,X=>{this[K](X)},{passive:!1})})}_pointerenter(z){this.setPointersPositions(z);const K=B(z.type);K&&this._fire(K.pointerenter,{evt:z,target:this,currentTarget:this})}_pointerover(z){this.setPointersPositions(z);const K=B(z.type);K&&this._fire(K.pointerover,{evt:z,target:this,currentTarget:this})}_getTargetShape(z){let K=this[z+"targetShape"];return K&&!K.getStage()&&(K=null),K}_pointerleave(z){const K=B(z.type),X=D(z.type);if(!K)return;this.setPointersPositions(z);const Q=this._getTargetShape(X),J=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;Q&&J?(Q._fireAndBubble(K.pointerout,{evt:z}),Q._fireAndBubble(K.pointerleave,{evt:z}),this._fire(K.pointerleave,{evt:z,target:this,currentTarget:this}),this[X+"targetShape"]=null):J&&(this._fire(K.pointerleave,{evt:z,target:this,currentTarget:this}),this._fire(K.pointerout,{evt:z,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(z){const K=B(z.type),X=D(z.type);if(!K)return;this.setPointersPositions(z);let Q=!1;this._changedPointerPositions.forEach(J=>{const ne=this.getIntersection(J);if(a.DD.justDragged=!1,i.Konva["_"+X+"ListenClick"]=!0,!ne||!ne.isListening()){this[X+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&ne.setPointerCapture(J.id),this[X+"ClickStartShape"]=ne,ne._fireAndBubble(K.pointerdown,{evt:z,pointerId:J.id}),Q=!0;const ie=z.type.indexOf("touch")>=0;ne.preventDefault()&&z.cancelable&&ie&&z.preventDefault()}),Q||this._fire(K.pointerdown,{evt:z,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(z){const K=B(z.type),X=D(z.type);if(!K||(i.Konva.isDragging()&&a.DD.node.preventDefault()&&z.cancelable&&z.preventDefault(),this.setPointersPositions(z),!(!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled)))return;const J={};let ne=!1;const ie=this._getTargetShape(X);this._changedPointerPositions.forEach(oe=>{const de=s.getCapturedShape(oe.id)||this.getIntersection(oe),me=oe.id,Pe={evt:z,pointerId:me},re=ie!==de;if(re&&ie&&(ie._fireAndBubble(K.pointerout,{...Pe},de),ie._fireAndBubble(K.pointerleave,{...Pe},de)),de){if(J[de._id])return;J[de._id]=!0}de&&de.isListening()?(ne=!0,re&&(de._fireAndBubble(K.pointerover,{...Pe},ie),de._fireAndBubble(K.pointerenter,{...Pe},ie),this[X+"targetShape"]=de),de._fireAndBubble(K.pointermove,{...Pe})):ie&&(this._fire(K.pointerover,{evt:z,target:this,currentTarget:this,pointerId:me}),this[X+"targetShape"]=null)}),ne||this._fire(K.pointermove,{evt:z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(z){const K=B(z.type),X=D(z.type);if(!K)return;this.setPointersPositions(z);const Q=this[X+"ClickStartShape"],J=this[X+"ClickEndShape"],ne={};let ie=!1;this._changedPointerPositions.forEach(oe=>{const de=s.getCapturedShape(oe.id)||this.getIntersection(oe);if(de){if(de.releaseCapture(oe.id),ne[de._id])return;ne[de._id]=!0}const me=oe.id,Pe={evt:z,pointerId:me};let re=!1;i.Konva["_"+X+"InDblClickWindow"]?(re=!0,clearTimeout(this[X+"DblTimeout"])):a.DD.justDragged||(i.Konva["_"+X+"InDblClickWindow"]=!0,clearTimeout(this[X+"DblTimeout"])),this[X+"DblTimeout"]=setTimeout(function(){i.Konva["_"+X+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),de&&de.isListening()?(ie=!0,this[X+"ClickEndShape"]=de,de._fireAndBubble(K.pointerup,{...Pe}),i.Konva["_"+X+"ListenClick"]&&Q&&Q===de&&(de._fireAndBubble(K.pointerclick,{...Pe}),re&&J&&J===de&&de._fireAndBubble(K.pointerdblclick,{...Pe}))):(this[X+"ClickEndShape"]=null,i.Konva["_"+X+"ListenClick"]&&this._fire(K.pointerclick,{evt:z,target:this,currentTarget:this,pointerId:me}),re&&this._fire(K.pointerdblclick,{evt:z,target:this,currentTarget:this,pointerId:me}))}),ie||this._fire(K.pointerup,{evt:z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+X+"ListenClick"]=!1,z.cancelable&&X!=="touch"&&z.preventDefault()}_contextmenu(z){this.setPointersPositions(z);const K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(T,{evt:z}):this._fire(T,{evt:z,target:this,currentTarget:this})}_wheel(z){this.setPointersPositions(z);const K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(W,{evt:z}):this._fire(W,{evt:z,target:this,currentTarget:this})}_pointercancel(z){this.setPointersPositions(z);const K=s.getCapturedShape(z.pointerId)||this.getIntersection(this.getPointerPosition());K&&K._fireAndBubble(_,s.createEvent(z)),s.releaseCapture(z.pointerId)}_lostpointercapture(z){s.releaseCapture(z.pointerId)}setPointersPositions(z){let K=this._getContentPosition(),X=null,Q=null;z=z||window.event,z.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(z.touches,J=>{this._pointerPositions.push({id:J.identifier,x:(J.clientX-K.left)/K.scaleX,y:(J.clientY-K.top)/K.scaleY})}),Array.prototype.forEach.call(z.changedTouches||z.touches,J=>{this._changedPointerPositions.push({id:J.identifier,x:(J.clientX-K.left)/K.scaleX,y:(J.clientY-K.top)/K.scaleY})})):(X=(z.clientX-K.left)/K.scaleX,Q=(z.clientY-K.top)/K.scaleY,this.pointerPos={x:X,y:Q},this._pointerPositions=[{x:X,y:Q,id:e.Util._getFirstPointerId(z)}],this._changedPointerPositions=[{x:X,y:Q,id:e.Util._getFirstPointerId(z)}])}_setPointerPosition(z){e.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(z)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const z=this.content.getBoundingClientRect();return{top:z.top,left:z.left,scaleX:z.width/this.content.clientWidth||1,scaleY:z.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new o.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new o.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!i.Konva.isBrowser)return;const z=this.container();if(!z)throw"Stage has no container. A container is required.";z.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"),z.appendChild(this.content),this._resizeDOM()}cache(){return e.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(z){z.batchDraw()}),this}}t.Stage=F,F.prototype.nodeType=f,(0,l._registerNode)(F),n.Factory.addGetterSetter(F,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{t.stages.forEach($=>{$.batchDraw()})})})(a9);var Wc={},En={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.shapes=void 0;const e=st,n=en,r=ut,i=qt,o=Ze,a=st,l=Ca,s="hasShadow",f="shadowRGBA",h="patternImage",x="linearGradient",w="radialGradient";let v;function O(){return v||(v=n.Util.createCanvasElement().getContext("2d"),v)}t.shapes={};function g(S){const E=this.attrs.fillRule;E?S.fill(E):S.fill()}function b(S){S.stroke()}function p(S){const E=this.attrs.fillRule;E?S.fill(E):S.fill()}function y(S){S.stroke()}function d(){this._clearCache(s)}function m(){this._clearCache(f)}function _(){this._clearCache(h)}function A(){this._clearCache(x)}function C(){this._clearCache(w)}class R extends i.Node{constructor(E){super(E);let P;for(;P=n.Util.getRandomColor(),!(P&&!(P in t.shapes)););this.colorKey=P,t.shapes[P]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.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(s,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()){const P=O().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(P&&P.setTransform){const T=new n.Transform;T.translate(this.fillPatternX(),this.fillPatternY()),T.rotate(e.Konva.getAngle(this.fillPatternRotation())),T.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),T.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const N=T.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);P.setTransform(U)}return P}}_getLinearGradient(){return this._getCache(x,this.__getLinearGradient)}__getLinearGradient(){const E=this.fillLinearGradientColorStops();if(E){const P=O(),T=this.fillLinearGradientStartPoint(),N=this.fillLinearGradientEndPoint(),U=P.createLinearGradient(T.x,T.y,N.x,N.y);for(let G=0;G<E.length;G+=2)U.addColorStop(E[G],E[G+1]);return U}}_getRadialGradient(){return this._getCache(w,this.__getRadialGradient)}__getRadialGradient(){const E=this.fillRadialGradientColorStops();if(E){const P=O(),T=this.fillRadialGradientStartPoint(),N=this.fillRadialGradientEndPoint(),U=P.createRadialGradient(T.x,T.y,this.fillRadialGradientStartRadius(),N.x,N.y,this.fillRadialGradientEndRadius());for(let G=0;G<E.length;G+=2)U.addColorStop(E[G],E[G+1]);return U}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const E=n.Util.colorToRGBA(this.shadowColor());if(E)return"rgba("+E.r+","+E.g+","+E.b+","+E.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 E=this.hitStrokeWidth();return E==="auto"?this.hasStroke():this.strokeEnabled()&&!!E}intersects(E){const P=this.getStage();if(!P)return!1;const T=P.bufferHitCanvas;return T.getContext().clear(),this.drawHit(T,void 0,!0),T.context.getImageData(Math.round(E.x),Math.round(E.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete t.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(E){var P;if(!((P=this.attrs.perfectDrawEnabled)!==null&&P!==void 0?P:!0))return!1;const N=E||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(E){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),E?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const E=this.size();return{x:this._centroid?-E.width/2:0,y:this._centroid?-E.height/2:0,width:E.width,height:E.height}}getClientRect(E={}){let P=!1,T=this.getParent();for(;T;){if(T.isCached()){P=!0;break}T=T.getParent()}const N=E.skipTransform,U=E.relativeTo||P&&this.getStage()||void 0,G=this.getSelfRect(),W=!E.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,H=G.width+W,L=G.height+W,M=!E.skipShadow&&this.hasShadow(),D=M?this.shadowOffsetX():0,B=M?this.shadowOffsetY():0,V=H+Math.abs(D),Y=L+Math.abs(B),F=M&&this.shadowBlur()||0,$=V+F*2,z=Y+F*2,K={width:$,height:z,x:-(W/2+F)+Math.min(D,0)+G.x,y:-(W/2+F)+Math.min(B,0)+G.y};return N?K:this._transformedRect(K,U)}drawScene(E,P,T){const N=this.getLayer();let U=E||N.getCanvas(),G=U.getContext(),Z=this._getCanvasCache(),W=this.getSceneFunc(),H=this.hasShadow(),L,M;const D=U.isCache,B=P===this;if(!this.isVisible()&&!B)return this;if(Z){G.save();const Y=this.getAbsoluteTransform(P).getMatrix();return G.transform(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]),this._drawCachedSceneCanvas(G),G.restore(),this}if(!W)return this;if(G.save(),this._useBufferCanvas()&&!D){L=this.getStage();const Y=T||L.bufferCanvas;M=Y.getContext(),M.clear(),M.save(),M._applyLineJoin(this);var V=this.getAbsoluteTransform(P).getMatrix();M.transform(V[0],V[1],V[2],V[3],V[4],V[5]),W.call(this,M,this),M.restore();const F=Y.pixelRatio;H&&G._applyShadow(this),G._applyOpacity(this),G._applyGlobalCompositeOperation(this),G.drawImage(Y._canvas,0,0,Y.width/F,Y.height/F)}else{if(G._applyLineJoin(this),!B){var V=this.getAbsoluteTransform(P).getMatrix();G.transform(V[0],V[1],V[2],V[3],V[4],V[5]),G._applyOpacity(this),G._applyGlobalCompositeOperation(this)}H&&G._applyShadow(this),W.call(this,G,this)}return G.restore(),this}drawHit(E,P,T=!1){if(!this.shouldDrawHit(P,T))return this;const N=this.getLayer(),U=E||N.hitCanvas,G=U&&U.getContext(),Z=this.hitFunc()||this.sceneFunc(),W=this._getCanvasCache(),H=W&&W.hit;if(this.colorKey||n.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();const M=this.getAbsoluteTransform(P).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===P)){const M=this.getAbsoluteTransform(P).getMatrix();G.transform(M[0],M[1],M[2],M[3],M[4],M[5])}return Z.call(this,G,this),G.restore(),this}drawHitFromCache(E=0){let P=this._getCanvasCache(),T=this._getCachedSceneCanvas(),N=P.hit,U=N.getContext(),G=N.getWidth(),Z=N.getHeight(),W,H,L,M,D,B;U.clear(),U.drawImage(T._canvas,0,0,G,Z);try{for(W=U.getImageData(0,0,G,Z),H=W.data,L=H.length,M=n.Util._hexToRgb(this.colorKey),D=0;D<L;D+=4)B=H[D+3],B>E?(H[D]=M.r,H[D+1]=M.g,H[D+2]=M.b,H[D+3]=255):H[D+3]=0;U.putImageData(W,0,0)}catch(V){n.Util.error("Unable to draw hit graph from cached scene canvas. "+V.message)}return this}hasPointerCapture(E){return l.hasPointerCapture(E,this)}setPointerCapture(E){l.setPointerCapture(E,this)}releaseCapture(E){l.releaseCapture(E,this)}}t.Shape=R,R.prototype._fillFunc=g,R.prototype._strokeFunc=b,R.prototype._fillFuncHit=p,R.prototype._strokeFuncHit=y,R.prototype._centroid=!1,R.prototype.nodeType="Shape",(0,a._registerNode)(R),R.prototype.eventListeners={},R.prototype.on.call(R.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),R.prototype.on.call(R.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",m),R.prototype.on.call(R.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",_),R.prototype.on.call(R.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",A),R.prototype.on.call(R.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",C),r.Factory.addGetterSetter(R,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(R,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(R,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(R,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(R,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(R,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(R,"lineJoin"),r.Factory.addGetterSetter(R,"lineCap"),r.Factory.addGetterSetter(R,"sceneFunc"),r.Factory.addGetterSetter(R,"hitFunc"),r.Factory.addGetterSetter(R,"dash"),r.Factory.addGetterSetter(R,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(R,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(R,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(R,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillPatternImage"),r.Factory.addGetterSetter(R,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(R,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(R,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(R,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(R,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(R,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(R,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(R,"fillEnabled",!0),r.Factory.addGetterSetter(R,"strokeEnabled",!0),r.Factory.addGetterSetter(R,"shadowEnabled",!0),r.Factory.addGetterSetter(R,"dashEnabled",!0),r.Factory.addGetterSetter(R,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(R,"fillPriority","color"),r.Factory.addComponentsGetterSetter(R,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(R,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(R,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(R,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(R,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(R,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(R,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(R,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(R,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(R,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(R,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(R,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(R,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(R,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(R,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(R,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(R,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(R,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(R,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(R,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(R,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(R,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(R,"fillPatternRotation",0),r.Factory.addGetterSetter(R,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(R,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(En);Object.defineProperty(Wc,"__esModule",{value:!0});Wc.Layer=void 0;const fo=en,V1=wl,Ql=qt,Dy=ut,z5=wi,uT=Ze,cT=En,fT=st,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 Qs=class extends V1.Container{constructor(e){super(e),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(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),e<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[e+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Ql.Node.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!Ql.Node.prototype.moveUp.call(this))return!1;const n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Ql.Node.prototype.moveDown.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Ql.Node.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return Ql.Node.prototype.remove.call(this),e&&e.parentNode&&fo.Util._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:n}){return this.canvas.setSize(e,n),this.hitCanvas.setSize(e,n),this._setSmoothEnabled(),this}_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&fo.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e=e||{},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),Ql.Node.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){fo.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){fo.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,fo.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let n=1,r=!1;for(;;){for(let i=0;i<gT;i++){const o=u9[i],a=this._getIntersection({x:e.x+o.x*n,y:e.y+o.y*n}),l=a.shape;if(l)return l;if(r=!!a.antialiased,!a.antialiased)break}if(r)n+=1;else return null}}_getIntersection(e){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(e.x*n),Math.round(e.y*n),1,1).data,i=r[3];if(i===255){const o=fo.Util._rgbToHex(r[0],r[1],r[2]),a=cT.shapes[dT+o];return a?{shape:a}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(e,n){const r=this.getLayer(),i=e||r&&r.getCanvas();return this._fire(hT,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),V1.Container.prototype.drawScene.call(this,i,n),this._fire(pT,{node:this}),this}drawHit(e,n){const r=this.getLayer(),i=e||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),V1.Container.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){fo.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return fo.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return fo.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Wc.Layer=Qs;Qs.prototype.nodeType="Layer";(0,fT._registerNode)(Qs);Dy.Factory.addGetterSetter(Qs,"imageSmoothingEnabled",!0);Dy.Factory.addGetterSetter(Qs,"clearBeforeDraw",!0);Dy.Factory.addGetterSetter(Qs,"hitGraphEnabled",!0,(0,uT.getBooleanValidator)());var ap={};Object.defineProperty(ap,"__esModule",{value:!0});ap.FastLayer=void 0;const vT=en,mT=Wc,yT=st;let jy=class extends mT.Layer{constructor(e){super(e),this.listening(!1),vT.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};ap.FastLayer=jy;jy.prototype.nodeType="FastLayer";(0,yT._registerNode)(jy);var Js={};Object.defineProperty(Js,"__esModule",{value:!0});Js.Group=void 0;const bT=en,_T=wl,wT=st;let Fy=class extends _T.Container{_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&bT.Util.throw("You may only add groups and shapes to groups.")}};Js.Group=Fy;Fy.prototype.nodeType="Group";(0,wT._registerNode)(Fy);var eu={};Object.defineProperty(eu,"__esModule",{value:!0});eu.Animation=void 0;const q1=st,B5=en,W1=function(){return q1.glob.performance&&q1.glob.performance.now?function(){return q1.glob.performance.now()}:function(){return new Date().getTime()}}();class Hi{constructor(e,n){this.id=Hi.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:W1(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){let n=[];return e&&(n=Array.isArray(e)?e:[e]),this.layers=n,this}getLayers(){return this.layers}addLayer(e){const n=this.layers,r=n.length;for(let i=0;i<r;i++)if(n[i]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const n=Hi.animations,r=n.length;for(let i=0;i<r;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=W1(),Hi._addAnimation(this),this}stop(){return Hi._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const n=e.id,r=this.animations,i=r.length;for(let o=0;o<i;o++)if(r[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){const e={},n=this.animations;for(let r=0;r<n.length;r++){const i=n[r],o=i.layers,a=i.func;i._updateFrameObject(W1());const l=o.length;let s;if(a?s=a.call(i,i.frame)!==!1:s=!0,!!s)for(let f=0;f<l;f++){const h=o[f];h._id!==void 0&&(e[h._id]=h)}}for(const r in e)e.hasOwnProperty(r)&&e[r].batchDraw()}static _animationLoop(){const e=Hi;e.animations.length?(e._runFrames(),B5.Util.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,B5.Util.requestAnimFrame(this._animationLoop))}}eu.Animation=Hi;Hi.animations=[];Hi.animIdCounter=0;Hi.animRunning=!1;var c9={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Easings=t.Tween=void 0;const e=en,n=eu,r=qt,i=st;let o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},a=1,l=2,s=3,f=0,h=["fill","stroke","shadowColor"];class x{constructor(O,g,b,p,y,d,m){this.prop=O,this.propFunc=g,this.begin=p,this._pos=p,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=b,this._change=y-this.begin,this.pause()}fire(O){const g=this[O];g&&g()}setTime(O){O>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():O<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=O,this.update())}getTime(){return this._time}setPosition(O){this.prevPos=this._pos,this.propFunc(O),this._pos=O}getPosition(O){return O===void 0&&(O=this._time),this.func(O,this.begin,this._change,this.duration)}play(){this.state=l,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=s,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(O){this.pause(),this._time=O,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(){const O=this.getTimer()-this._startTime;this.state===l?this.setTime(O):this.state===s&&this.setTime(this.duration-O)}pause(){this.state=a,this.fire("onPause")}getTimer(){return new Date().getTime()}}class w{constructor(O){let g=this,b=O.node,p=b._id,y,d=O.easing||t.Easings.Linear,m=!!O.yoyo,_;typeof O.duration>"u"?y=.3:O.duration===0?y=.001:y=O.duration,this.node=b,this._id=f++;const A=b.getLayer()||(b instanceof i.Konva.Stage?b.getLayers():null);A||e.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){g.tween.onEnterFrame()},A),this.tween=new x(_,function(C){g._tweenFunc(C)},d,0,1,y*1e3,m),this._addListeners(),w.attrs[p]||(w.attrs[p]={}),w.attrs[p][this._id]||(w.attrs[p][this._id]={}),w.tweens[p]||(w.tweens[p]={});for(_ in O)o[_]===void 0&&this._addAttr(_,O[_]);this.reset(),this.onFinish=O.onFinish,this.onReset=O.onReset,this.onUpdate=O.onUpdate}_addAttr(O,g){let b=this.node,p=b._id,y,d,m,_,A,C,R,S;if(m=w.tweens[p][O],m&&delete w.attrs[p][m][O],y=b.getAttr(O),e.Util._isArray(g))if(d=[],A=Math.max(g.length,y.length),O==="points"&&g.length!==y.length&&(g.length>y.length?(R=y,y=e.Util._prepareArrayForTween(y,g,b.closed())):(C=g,g=e.Util._prepareArrayForTween(g,y,b.closed()))),O.indexOf("fill")===0)for(_=0;_<A;_++)if(_%2===0)d.push(g[_]-y[_]);else{const E=e.Util.colorToRGBA(y[_]);S=e.Util.colorToRGBA(g[_]),y[_]=E,d.push({r:S.r-E.r,g:S.g-E.g,b:S.b-E.b,a:S.a-E.a})}else for(_=0;_<A;_++)d.push(g[_]-y[_]);else h.indexOf(O)!==-1?(y=e.Util.colorToRGBA(y),S=e.Util.colorToRGBA(g),d={r:S.r-y.r,g:S.g-y.g,b:S.b-y.b,a:S.a-y.a}):d=g-y;w.attrs[p][this._id][O]={start:y,diff:d,end:g,trueEnd:C,trueStart:R},w.tweens[p][O]=this._id}_tweenFunc(O){let g=this.node,b=w.attrs[g._id][this._id],p,y,d,m,_,A,C,R;for(p in b){if(y=b[p],d=y.start,m=y.diff,R=y.end,e.Util._isArray(d))if(_=[],C=Math.max(d.length,R.length),p.indexOf("fill")===0)for(A=0;A<C;A++)A%2===0?_.push((d[A]||0)+m[A]*O):_.push("rgba("+Math.round(d[A].r+m[A].r*O)+","+Math.round(d[A].g+m[A].g*O)+","+Math.round(d[A].b+m[A].b*O)+","+(d[A].a+m[A].a*O)+")");else for(A=0;A<C;A++)_.push((d[A]||0)+m[A]*O);else h.indexOf(p)!==-1?_="rgba("+Math.round(d.r+m.r*O)+","+Math.round(d.g+m.g*O)+","+Math.round(d.b+m.b*O)+","+(d.a+m.a*O)+")":_=d+m*O;g.setAttr(p,_)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const O=this.node,g=w.attrs[O._id][this._id];g.points&&g.points.trueEnd&&O.setAttr("points",g.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const O=this.node,g=w.attrs[O._id][this._id];g.points&&g.points.trueStart&&O.points(g.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(O){return this.tween.seek(O*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){let O=this.node._id,g=this._id,b=w.tweens[O],p;this.pause();for(p in b)delete w.tweens[O][p];delete w.attrs[O][g]}}t.Tween=w,w.attrs={},w.tweens={},r.Node.prototype.to=function(v){const O=v.onFinish;v.node=this,v.onFinish=function(){this.destroy(),O&&O()},new w(v).play()},t.Easings={BackEaseIn(v,O,g,b){return g*(v/=b)*v*((1.70158+1)*v-1.70158)+O},BackEaseOut(v,O,g,b){return g*((v=v/b-1)*v*((1.70158+1)*v+1.70158)+1)+O},BackEaseInOut(v,O,g,b){let p=1.70158;return(v/=b/2)<1?g/2*(v*v*(((p*=1.525)+1)*v-p))+O:g/2*((v-=2)*v*(((p*=1.525)+1)*v+p)+2)+O},ElasticEaseIn(v,O,g,b,p,y){let d=0;return v===0?O:(v/=b)===1?O+g:(y||(y=b*.3),!p||p<Math.abs(g)?(p=g,d=y/4):d=y/(2*Math.PI)*Math.asin(g/p),-(p*Math.pow(2,10*(v-=1))*Math.sin((v*b-d)*(2*Math.PI)/y))+O)},ElasticEaseOut(v,O,g,b,p,y){let d=0;return v===0?O:(v/=b)===1?O+g:(y||(y=b*.3),!p||p<Math.abs(g)?(p=g,d=y/4):d=y/(2*Math.PI)*Math.asin(g/p),p*Math.pow(2,-10*v)*Math.sin((v*b-d)*(2*Math.PI)/y)+g+O)},ElasticEaseInOut(v,O,g,b,p,y){let d=0;return v===0?O:(v/=b/2)===2?O+g:(y||(y=b*(.3*1.5)),!p||p<Math.abs(g)?(p=g,d=y/4):d=y/(2*Math.PI)*Math.asin(g/p),v<1?-.5*(p*Math.pow(2,10*(v-=1))*Math.sin((v*b-d)*(2*Math.PI)/y))+O:p*Math.pow(2,-10*(v-=1))*Math.sin((v*b-d)*(2*Math.PI)/y)*.5+g+O)},BounceEaseOut(v,O,g,b){return(v/=b)<1/2.75?g*(7.5625*v*v)+O:v<2/2.75?g*(7.5625*(v-=1.5/2.75)*v+.75)+O:v<2.5/2.75?g*(7.5625*(v-=2.25/2.75)*v+.9375)+O:g*(7.5625*(v-=2.625/2.75)*v+.984375)+O},BounceEaseIn(v,O,g,b){return g-t.Easings.BounceEaseOut(b-v,0,g,b)+O},BounceEaseInOut(v,O,g,b){return v<b/2?t.Easings.BounceEaseIn(v*2,0,g,b)*.5+O:t.Easings.BounceEaseOut(v*2-b,0,g,b)*.5+g*.5+O},EaseIn(v,O,g,b){return g*(v/=b)*v+O},EaseOut(v,O,g,b){return-g*(v/=b)*(v-2)+O},EaseInOut(v,O,g,b){return(v/=b/2)<1?g/2*v*v+O:-g/2*(--v*(v-2)-1)+O},StrongEaseIn(v,O,g,b){return g*(v/=b)*v*v*v*v+O},StrongEaseOut(v,O,g,b){return g*((v=v/b-1)*v*v*v*v+1)+O},StrongEaseInOut(v,O,g,b){return(v/=b/2)<1?g/2*v*v*v*v*v+O:g/2*((v-=2)*v*v*v*v+2)+O},Linear(v,O,g,b){return g*v/b+O}}})(c9);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;const e=st,n=en,r=qt,i=wl,o=a9,a=Wc,l=ap,s=Js,f=ip,h=En,x=eu,w=c9,v=So,O=wi;t.Konva=n.Util._assign(e.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:i.Container,Stage:o.Stage,stages:o.stages,Layer:a.Layer,FastLayer:l.FastLayer,Group:s.Group,DD:f.DD,Shape:h.Shape,shapes:h.shapes,Animation:x.Animation,Tween:w.Tween,Easings:w.Easings,Context:v.Context,Canvas:O.Canvas}),t.default=t.Konva})(bh);var lp={};Object.defineProperty(lp,"__esModule",{value:!0});lp.Arc=void 0;const sp=ut,ST=En,U5=st,up=Ze,ET=st;let Lo=class extends ST.Shape{_sceneFunc(e){const n=U5.Konva.getAngle(this.angle()),r=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,n,r),e.arc(0,0,this.innerRadius(),n,0,!r),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),n=this.outerRadius(),r=this.clockwise(),i=U5.Konva.getAngle(r?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),a=1,l=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),s=Math.sin(Math.min(i,Math.PI/2)),f=o*(o>0?e:n),h=a*n,x=l*(l>0?e:n),w=s*(s>0?n:e);return{x:f,y:r?-1*w:x,width:h-f,height:w-x}}};lp.Arc=Lo;Lo.prototype._centroid=!0;Lo.prototype.className="Arc";Lo.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,ET._registerNode)(Lo);sp.Factory.addGetterSetter(Lo,"innerRadius",0,(0,up.getNumberValidator)());sp.Factory.addGetterSetter(Lo,"outerRadius",0,(0,up.getNumberValidator)());sp.Factory.addGetterSetter(Lo,"angle",0,(0,up.getNumberValidator)());sp.Factory.addGetterSetter(Lo,"clockwise",!1,(0,up.getBooleanValidator)());var cp={},Yc={};Object.defineProperty(Yc,"__esModule",{value:!0});Yc.Line=void 0;const fp=ut,OT=st,xT=En,f9=Ze;function sm(t,e,n,r,i,o,a){const l=Math.sqrt(Math.pow(n-t,2)+Math.pow(r-e,2)),s=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),f=a*l/(l+s),h=a*s/(l+s),x=n-f*(i-t),w=r-f*(o-e),v=n+h*(i-t),O=r+h*(o-e);return[x,w,v,O]}function H5(t,e){const n=t.length,r=[];for(let i=2;i<n-2;i+=2){const o=sm(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e);isNaN(o[0])||(r.push(o[0]),r.push(o[1]),r.push(t[i]),r.push(t[i+1]),r.push(o[2]),r.push(o[3]))}return r}let ka=class extends xT.Shape{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){let n=this.points(),r=n.length,i=this.tension(),o=this.closed(),a=this.bezier(),l,s,f;if(r){if(e.beginPath(),e.moveTo(n[0],n[1]),i!==0&&r>4){for(l=this.getTensionPoints(),s=l.length,f=o?0:4,o||e.quadraticCurveTo(l[0],l[1],l[2],l[3]);f<s-2;)e.bezierCurveTo(l[f++],l[f++],l[f++],l[f++],l[f++],l[f++]);o||e.quadraticCurveTo(l[s-2],l[s-1],n[r-2],n[r-1])}else if(a)for(f=2;f<r;)e.bezierCurveTo(n[f++],n[f++],n[f++],n[f++],n[f++],n[f++]);else for(f=2;f<r;f+=2)e.lineTo(n[f],n[f+1]);o?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():H5(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),n=e.length,r=this.tension(),i=sm(e[n-2],e[n-1],e[0],e[1],e[2],e[3],r),o=sm(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],r),a=H5(e,r);return[i[2],i[3]].concat(a).concat([o[0],o[1],e[n-2],e[n-1],o[2],o[3],i[0],i[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:e=this.points();let n=e[0],r=e[0],i=e[1],o=e[1],a,l;for(let s=0;s<e.length/2;s++)a=e[s*2],l=e[s*2+1],n=Math.min(n,a),r=Math.max(r,a),i=Math.min(i,l),o=Math.max(o,l);return{x:n,y:i,width:r-n,height:o-i}}};Yc.Line=ka;ka.prototype.className="Line";ka.prototype._attrsAffectingSize=["points","bezier","tension"];(0,OT._registerNode)(ka);fp.Factory.addGetterSetter(ka,"closed",!1);fp.Factory.addGetterSetter(ka,"bezier",!1);fp.Factory.addGetterSetter(ka,"tension",0,(0,f9.getNumberValidator)());fp.Factory.addGetterSetter(ka,"points",[],(0,f9.getNumberArrayValidator)());var tu={},d9={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.t2length=t.getQuadraticArcLength=t.getCubicArcLength=t.binomialCoefficients=t.cValues=t.tValues=void 0,t.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],t.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],t.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const e=(a,l,s)=>{let f,h;const w=s/2;f=0;for(let v=0;v<20;v++)h=w*t.tValues[20][v]+w,f+=t.cValues[20][v]*r(a,l,h);return w*f};t.getCubicArcLength=e;const n=(a,l,s)=>{s===void 0&&(s=1);const f=a[0]-2*a[1]+a[2],h=l[0]-2*l[1]+l[2],x=2*a[1]-2*a[0],w=2*l[1]-2*l[0],v=4*(f*f+h*h),O=4*(f*x+h*w),g=x*x+w*w;if(v===0)return s*Math.sqrt(Math.pow(a[2]-a[0],2)+Math.pow(l[2]-l[0],2));const b=O/(2*v),p=g/v,y=s+b,d=p-b*b,m=y*y+d>0?Math.sqrt(y*y+d):0,_=b*b+d>0?Math.sqrt(b*b+d):0,A=b+Math.sqrt(b*b+d)!==0?d*Math.log(Math.abs((y+m)/(b+_))):0;return Math.sqrt(v)/2*(y*m-b*_+A)};t.getQuadraticArcLength=n;function r(a,l,s){const f=i(1,s,a),h=i(1,s,l),x=f*f+h*h;return Math.sqrt(x)}const i=(a,l,s)=>{const f=s.length-1;let h,x;if(f===0)return 0;if(a===0){x=0;for(let w=0;w<=f;w++)x+=t.binomialCoefficients[f][w]*Math.pow(1-l,f-w)*Math.pow(l,w)*s[w];return x}else{h=new Array(f);for(let w=0;w<f;w++)h[w]=f*(s[w+1]-s[w]);return i(a-1,l,h)}},o=(a,l,s)=>{let f=1,h=a/l,x=(a-s(h))/l,w=0;for(;f>.001;){const v=s(h+x),O=Math.abs(a-v)/l;if(O<f)f=O,h+=x;else{const g=s(h-x),b=Math.abs(a-g)/l;b<f?(f=b,h-=x):x/=2}if(w++,w>500)break}return h};t.t2length=o})(d9);Object.defineProperty(tu,"__esModule",{value:!0});tu.Path=void 0;const PT=ut,CT=En,kT=st,Jl=d9;let Kc=class cr extends CT.Shape{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=cr.parsePathData(this.data()),this.pathLength=cr.getPathLength(this.dataArray)}_sceneFunc(e){const n=this.dataArray;e.beginPath();let r=!1;for(let g=0;g<n.length;g++){const b=n[g].command,p=n[g].points;switch(b){case"L":e.lineTo(p[0],p[1]);break;case"M":e.moveTo(p[0],p[1]);break;case"C":e.bezierCurveTo(p[0],p[1],p[2],p[3],p[4],p[5]);break;case"Q":e.quadraticCurveTo(p[0],p[1],p[2],p[3]);break;case"A":var i=p[0],o=p[1],a=p[2],l=p[3],s=p[4],f=p[5],h=p[6],x=p[7],w=a>l?a:l,v=a>l?1:a/l,O=a>l?l/a:1;e.translate(i,o),e.rotate(h),e.scale(v,O),e.arc(0,0,w,s,s+f,1-x),e.scale(1/v,1/O),e.rotate(-h),e.translate(-i,-o);break;case"z":r=!0,e.closePath();break}}!r&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(s){if(s.command==="A"){const f=s.points[4],h=s.points[5],x=s.points[4]+h;let w=Math.PI/180;if(Math.abs(f-x)<w&&(w=Math.abs(f-x)),h<0)for(let v=f-w;v>x;v-=w){const O=cr.getPointOnEllipticalArc(s.points[0],s.points[1],s.points[2],s.points[3],v,0);e.push(O.x,O.y)}else for(let v=f+w;v<x;v+=w){const O=cr.getPointOnEllipticalArc(s.points[0],s.points[1],s.points[2],s.points[3],v,0);e.push(O.x,O.y)}}else if(s.command==="C")for(let f=0;f<=1;f+=.01){const h=cr.getPointOnCubicBezier(f,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3],s.points[4],s.points[5]);e.push(h.x,h.y)}else e=e.concat(s.points)});let n=e[0],r=e[0],i=e[1],o=e[1],a,l;for(let s=0;s<e.length/2;s++)a=e[s*2],l=e[s*2+1],isNaN(a)||(n=Math.min(n,a),r=Math.max(r,a)),isNaN(l)||(i=Math.min(i,l),o=Math.max(o,l));return{x:n,y:i,width:r-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(e){return cr.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,n,r,i){return Math.sqrt((r-e)*(r-e)+(i-n)*(i-n))}static getPathLength(e){let n=0;for(let r=0;r<e.length;++r)n+=e[r].pathLength;return n}static getPointAtLengthOfDataArray(e,n){let r,i=0,o=n.length;if(!o)return null;for(;i<o&&e>n[i].pathLength;)e-=n[i].pathLength,++i;if(i===o)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(e<.01)return r=n[i].points.slice(0,2),{x:r[0],y:r[1]};const a=n[i],l=a.points;switch(a.command){case"L":return cr.getPointOnLine(e,a.start.x,a.start.y,l[0],l[1]);case"C":return cr.getPointOnCubicBezier((0,Jl.t2length)(e,cr.getPathLength(n),g=>(0,Jl.getCubicArcLength)([a.start.x,l[0],l[2],l[4]],[a.start.y,l[1],l[3],l[5]],g)),a.start.x,a.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return cr.getPointOnQuadraticBezier((0,Jl.t2length)(e,cr.getPathLength(n),g=>(0,Jl.getQuadraticArcLength)([a.start.x,l[0],l[2]],[a.start.y,l[1],l[3]],g)),a.start.x,a.start.y,l[0],l[1],l[2],l[3]);case"A":var s=l[0],f=l[1],h=l[2],x=l[3],w=l[4],v=l[5],O=l[6];return w+=v*e/a.pathLength,cr.getPointOnEllipticalArc(s,f,h,x,w,O)}return null}static getPointOnLine(e,n,r,i,o,a,l){a=a??n,l=l??r;const s=this.getLineLength(n,r,i,o);if(s<1e-10)return{x:n,y:r};if(i===n)return{x:a,y:l+(o>r?e:-e)};const f=(o-r)/(i-n),h=Math.sqrt(e*e/(1+f*f))*(i<n?-1:1),x=f*h;if(Math.abs(l-r-f*(a-n))<1e-10)return{x:a+h,y:l+x};const w=((a-n)*(i-n)+(l-r)*(o-r))/(s*s),v=n+w*(i-n),O=r+w*(o-r),g=this.getLineLength(a,l,v,O),b=Math.sqrt(e*e-g*g),p=Math.sqrt(b*b/(1+f*f))*(i<n?-1:1),y=f*p;return{x:v+p,y:O+y}}static getPointOnCubicBezier(e,n,r,i,o,a,l,s,f){function h(b){return b*b*b}function x(b){return 3*b*b*(1-b)}function w(b){return 3*b*(1-b)*(1-b)}function v(b){return(1-b)*(1-b)*(1-b)}const O=s*h(e)+a*x(e)+i*w(e)+n*v(e),g=f*h(e)+l*x(e)+o*w(e)+r*v(e);return{x:O,y:g}}static getPointOnQuadraticBezier(e,n,r,i,o,a,l){function s(v){return v*v}function f(v){return 2*v*(1-v)}function h(v){return(1-v)*(1-v)}const x=a*s(e)+i*f(e)+n*h(e),w=l*s(e)+o*f(e)+r*h(e);return{x,y:w}}static getPointOnEllipticalArc(e,n,r,i,o,a){const l=Math.cos(a),s=Math.sin(a),f={x:r*Math.cos(o),y:i*Math.sin(o)};return{x:e+(f.x*l-f.y*s),y:n+(f.x*s+f.y*l)}}static parsePathData(e){if(!e)return[];let n=e;const r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(var i=0;i<r.length;i++)n=n.replace(new RegExp(r[i],"g"),"|"+r[i]);const o=n.split("|"),a=[],l=[];let s=0,f=0;const h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let x;for(i=1;i<o.length;i++){let R=o[i],S=R.charAt(0);for(R=R.slice(1),l.length=0;x=h.exec(R);)l.push(x[0]);const E=[];for(let P=0,T=l.length;P<T;P++){if(l[P]==="00"){E.push(0,0);continue}const N=parseFloat(l[P]);isNaN(N)?E.push(0):E.push(N)}for(;E.length>0&&!isNaN(E[0]);){let P="",T=[];const N=s,U=f;var w,v,O,g,b,p,y,d,m,_;switch(S){case"l":s+=E.shift(),f+=E.shift(),P="L",T.push(s,f);break;case"L":s=E.shift(),f=E.shift(),T.push(s,f);break;case"m":var A=E.shift(),C=E.shift();if(s+=A,f+=C,P="M",a.length>2&&a[a.length-1].command==="z"){for(let G=a.length-2;G>=0;G--)if(a[G].command==="M"){s=a[G].points[0]+A,f=a[G].points[1]+C;break}}T.push(s,f),S="l";break;case"M":s=E.shift(),f=E.shift(),P="M",T.push(s,f),S="L";break;case"h":s+=E.shift(),P="L",T.push(s,f);break;case"H":s=E.shift(),P="L",T.push(s,f);break;case"v":f+=E.shift(),P="L",T.push(s,f);break;case"V":f=E.shift(),P="L",T.push(s,f);break;case"C":T.push(E.shift(),E.shift(),E.shift(),E.shift()),s=E.shift(),f=E.shift(),T.push(s,f);break;case"c":T.push(s+E.shift(),f+E.shift(),s+E.shift(),f+E.shift()),s+=E.shift(),f+=E.shift(),P="C",T.push(s,f);break;case"S":v=s,O=f,w=a[a.length-1],w.command==="C"&&(v=s+(s-w.points[2]),O=f+(f-w.points[3])),T.push(v,O,E.shift(),E.shift()),s=E.shift(),f=E.shift(),P="C",T.push(s,f);break;case"s":v=s,O=f,w=a[a.length-1],w.command==="C"&&(v=s+(s-w.points[2]),O=f+(f-w.points[3])),T.push(v,O,s+E.shift(),f+E.shift()),s+=E.shift(),f+=E.shift(),P="C",T.push(s,f);break;case"Q":T.push(E.shift(),E.shift()),s=E.shift(),f=E.shift(),T.push(s,f);break;case"q":T.push(s+E.shift(),f+E.shift()),s+=E.shift(),f+=E.shift(),P="Q",T.push(s,f);break;case"T":v=s,O=f,w=a[a.length-1],w.command==="Q"&&(v=s+(s-w.points[0]),O=f+(f-w.points[1])),s=E.shift(),f=E.shift(),P="Q",T.push(v,O,s,f);break;case"t":v=s,O=f,w=a[a.length-1],w.command==="Q"&&(v=s+(s-w.points[0]),O=f+(f-w.points[1])),s+=E.shift(),f+=E.shift(),P="Q",T.push(v,O,s,f);break;case"A":g=E.shift(),b=E.shift(),p=E.shift(),y=E.shift(),d=E.shift(),m=s,_=f,s=E.shift(),f=E.shift(),P="A",T=this.convertEndpointToCenterParameterization(m,_,s,f,y,d,g,b,p);break;case"a":g=E.shift(),b=E.shift(),p=E.shift(),y=E.shift(),d=E.shift(),m=s,_=f,s+=E.shift(),f+=E.shift(),P="A",T=this.convertEndpointToCenterParameterization(m,_,s,f,y,d,g,b,p);break}a.push({command:P||S,points:T,start:{x:N,y:U},pathLength:this.calcLength(N,U,P||S,T)})}(S==="z"||S==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,n,r,i){let o,a,l,s;const f=cr;switch(r){case"L":return f.getLineLength(e,n,i[0],i[1]);case"C":return(0,Jl.getCubicArcLength)([e,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return(0,Jl.getQuadraticArcLength)([e,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;var h=i[4],x=i[5],w=i[4]+x,v=Math.PI/180;if(Math.abs(h-w)<v&&(v=Math.abs(h-w)),a=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],h,0),x<0)for(s=h-v;s>w;s-=v)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],s,0),o+=f.getLineLength(a.x,a.y,l.x,l.y),a=l;else for(s=h+v;s<w;s+=v)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],s,0),o+=f.getLineLength(a.x,a.y,l.x,l.y),a=l;return l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],w,0),o+=f.getLineLength(a.x,a.y,l.x,l.y),o}return 0}static convertEndpointToCenterParameterization(e,n,r,i,o,a,l,s,f){const h=f*(Math.PI/180),x=Math.cos(h)*(e-r)/2+Math.sin(h)*(n-i)/2,w=-1*Math.sin(h)*(e-r)/2+Math.cos(h)*(n-i)/2,v=x*x/(l*l)+w*w/(s*s);v>1&&(l*=Math.sqrt(v),s*=Math.sqrt(v));let O=Math.sqrt((l*l*(s*s)-l*l*(w*w)-s*s*(x*x))/(l*l*(w*w)+s*s*(x*x)));o===a&&(O*=-1),isNaN(O)&&(O=0);const g=O*l*w/s,b=O*-s*x/l,p=(e+r)/2+Math.cos(h)*g-Math.sin(h)*b,y=(n+i)/2+Math.sin(h)*g+Math.cos(h)*b,d=function(E){return Math.sqrt(E[0]*E[0]+E[1]*E[1])},m=function(E,P){return(E[0]*P[0]+E[1]*P[1])/(d(E)*d(P))},_=function(E,P){return(E[0]*P[1]<E[1]*P[0]?-1:1)*Math.acos(m(E,P))},A=_([1,0],[(x-g)/l,(w-b)/s]),C=[(x-g)/l,(w-b)/s],R=[(-1*x-g)/l,(-1*w-b)/s];let S=_(C,R);return m(C,R)<=-1&&(S=Math.PI),m(C,R)>=1&&(S=0),a===0&&S>0&&(S=S-2*Math.PI),a===1&&S<0&&(S=S+2*Math.PI),[p,y,l,s,A,S,h,a]}};tu.Path=Kc;Kc.prototype.className="Path";Kc.prototype._attrsAffectingSize=["data"];(0,kT._registerNode)(Kc);PT.Factory.addGetterSetter(Kc,"data");Object.defineProperty(cp,"__esModule",{value:!0});cp.Arrow=void 0;const dp=ut,TT=Yc,h9=Ze,AT=st,$5=tu;let El=class extends TT.Line{_sceneFunc(e){super._sceneFunc(e);const n=Math.PI*2,r=this.points();let i=r;const o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());const a=this.pointerLength(),l=r.length;let s,f;if(o){const w=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[l-2],r[l-1]],v=$5.Path.calcLength(i[i.length-4],i[i.length-3],"C",w),O=$5.Path.getPointOnQuadraticBezier(Math.min(1,1-a/v),w[0],w[1],w[2],w[3],w[4],w[5]);s=r[l-2]-O.x,f=r[l-1]-O.y}else s=r[l-2]-r[l-4],f=r[l-1]-r[l-3];const h=(Math.atan2(f,s)+n)%n,x=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(r[l-2],r[l-1]),e.rotate(h),e.moveTo(0,0),e.lineTo(-a,x/2),e.lineTo(-a,-x/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(r[0],r[1]),o?(s=(i[0]+i[2])/2-r[0],f=(i[1]+i[3])/2-r[1]):(s=r[2]-r[0],f=r[3]-r[1]),e.rotate((Math.atan2(-f,-s)+n)%n),e.moveTo(0,0),e.lineTo(-a,x/2),e.lineTo(-a,-x/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x-n,y:e.y-n,width:e.width+n*2,height:e.height+n*2}}};cp.Arrow=El;El.prototype.className="Arrow";(0,AT._registerNode)(El);dp.Factory.addGetterSetter(El,"pointerLength",10,(0,h9.getNumberValidator)());dp.Factory.addGetterSetter(El,"pointerWidth",10,(0,h9.getNumberValidator)());dp.Factory.addGetterSetter(El,"pointerAtBeginning",!1);dp.Factory.addGetterSetter(El,"pointerAtEnding",!0);var hp={};Object.defineProperty(hp,"__esModule",{value:!0});hp.Circle=void 0;const RT=ut,MT=En,LT=Ze,NT=st;let nu=class extends MT.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};hp.Circle=nu;nu.prototype._centroid=!0;nu.prototype.className="Circle";nu.prototype._attrsAffectingSize=["radius"];(0,NT._registerNode)(nu);RT.Factory.addGetterSetter(nu,"radius",0,(0,LT.getNumberValidator)());var pp={};Object.defineProperty(pp,"__esModule",{value:!0});pp.Ellipse=void 0;const zy=ut,IT=En,p9=Ze,DT=st;let Ta=class extends IT.Shape{_sceneFunc(e){const n=this.radiusX(),r=this.radiusY();e.beginPath(),e.save(),n!==r&&e.scale(1,r/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}};pp.Ellipse=Ta;Ta.prototype.className="Ellipse";Ta.prototype._centroid=!0;Ta.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,DT._registerNode)(Ta);zy.Factory.addComponentsGetterSetter(Ta,"radius",["x","y"]);zy.Factory.addGetterSetter(Ta,"radiusX",0,(0,p9.getNumberValidator)());zy.Factory.addGetterSetter(Ta,"radiusY",0,(0,p9.getNumberValidator)());var gp={};Object.defineProperty(gp,"__esModule",{value:!0});gp.Image=void 0;const Y1=en,Ol=ut,jT=En,FT=st,Xc=Ze;let Ji=class g9 extends jT.Shape{constructor(e){super(e),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){const e=!!this.cornerRadius(),n=this.hasShadow();return e&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let a;if(o){const l=this.attrs.cropWidth,s=this.attrs.cropHeight;l&&s?a=[o,this.cropX(),this.cropY(),l,s,0,0,n,r]:a=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?Y1.Util.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),o&&(i&&e.clip(),e.drawImage.apply(e,a))}_hitFunc(e){const n=this.width(),r=this.height(),i=this.cornerRadius();e.beginPath(),i?Y1.Util.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n;return(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var e,n;return(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(e,n,r=null){const i=Y1.Util.createImageElement();i.onload=function(){const o=new g9({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=e}};gp.Image=Ji;Ji.prototype.className="Image";(0,FT._registerNode)(Ji);Ol.Factory.addGetterSetter(Ji,"cornerRadius",0,(0,Xc.getNumberOrArrayOfNumbersValidator)(4));Ol.Factory.addGetterSetter(Ji,"image");Ol.Factory.addComponentsGetterSetter(Ji,"crop",["x","y","width","height"]);Ol.Factory.addGetterSetter(Ji,"cropX",0,(0,Xc.getNumberValidator)());Ol.Factory.addGetterSetter(Ji,"cropY",0,(0,Xc.getNumberValidator)());Ol.Factory.addGetterSetter(Ji,"cropWidth",0,(0,Xc.getNumberValidator)());Ol.Factory.addGetterSetter(Ji,"cropHeight",0,(0,Xc.getNumberValidator)());var Ds={};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.Tag=Ds.Label=void 0;const vp=ut,zT=En,BT=Js,By=Ze,v9=st,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(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let n=this,r;const i=function(){n._sync()};for(r=0;r<$T;r++)e.on(m9[r]+UT,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),n=this.getTag(),r,i,o,a,l,s,f;if(e&&n){switch(r=e.width(),i=e.height(),o=n.pointerDirection(),a=n.pointerWidth(),f=n.pointerHeight(),l=0,s=0,o){case um:l=r/2,s=-1*f;break;case cm:l=r+a,s=i/2;break;case fm:l=r/2,s=i+f;break;case dm:l=-1*a,s=i/2;break}n.setAttrs({x:-1*l,y:-1*s,width:r,height:i}),e.setAttrs({x:-1*l,y:-1*s})}}};Ds.Label=Uy;Uy.prototype.className="Label";(0,v9._registerNode)(Uy);let xl=class extends zT.Shape{_sceneFunc(e){const n=this.width(),r=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),a=this.pointerHeight(),l=this.cornerRadius();let s=0,f=0,h=0,x=0;typeof l=="number"?s=f=h=x=Math.min(l,n/2,r/2):(s=Math.min(l[0]||0,n/2,r/2),f=Math.min(l[1]||0,n/2,r/2),x=Math.min(l[2]||0,n/2,r/2),h=Math.min(l[3]||0,n/2,r/2)),e.beginPath(),e.moveTo(s,0),i===um&&(e.lineTo((n-o)/2,0),e.lineTo(n/2,-1*a),e.lineTo((n+o)/2,0)),e.lineTo(n-f,0),e.arc(n-f,f,f,Math.PI*3/2,0,!1),i===cm&&(e.lineTo(n,(r-a)/2),e.lineTo(n+o,r/2),e.lineTo(n,(r+a)/2)),e.lineTo(n,r-x),e.arc(n-x,r-x,x,0,Math.PI/2,!1),i===fm&&(e.lineTo((n+o)/2,r),e.lineTo(n/2,r+a),e.lineTo((n-o)/2,r)),e.lineTo(h,r),e.arc(h,r-h,h,Math.PI/2,Math.PI,!1),i===dm&&(e.lineTo(0,(r+a)/2),e.lineTo(-1*o,r/2),e.lineTo(0,(r-a)/2)),e.lineTo(0,s),e.arc(s,s,s,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,n=0,r=this.pointerWidth(),i=this.pointerHeight(),o=this.pointerDirection(),a=this.width(),l=this.height();return o===um?(n-=i,l+=i):o===fm?l+=i:o===dm?(e-=r*1.5,a+=r):o===cm&&(a+=r*1.5),{x:e,y:n,width:a,height:l}}};Ds.Tag=xl;xl.prototype.className="Tag";(0,v9._registerNode)(xl);vp.Factory.addGetterSetter(xl,"pointerDirection",HT);vp.Factory.addGetterSetter(xl,"pointerWidth",0,(0,By.getNumberValidator)());vp.Factory.addGetterSetter(xl,"pointerHeight",0,(0,By.getNumberValidator)());vp.Factory.addGetterSetter(xl,"cornerRadius",0,(0,By.getNumberOrArrayOfNumbersValidator)(4));var Zc={};Object.defineProperty(Zc,"__esModule",{value:!0});Zc.Rect=void 0;const GT=ut,VT=En,qT=st,WT=en,YT=Ze;let mp=class extends VT.Shape{_sceneFunc(e){const n=this.cornerRadius(),r=this.width(),i=this.height();e.beginPath(),n?WT.Util.drawRoundedRectPath(e,r,i,n):e.rect(0,0,r,i),e.closePath(),e.fillStrokeShape(this)}};Zc.Rect=mp;mp.prototype.className="Rect";(0,qT._registerNode)(mp);GT.Factory.addGetterSetter(mp,"cornerRadius",0,(0,YT.getNumberOrArrayOfNumbersValidator)(4));var yp={};Object.defineProperty(yp,"__esModule",{value:!0});yp.RegularPolygon=void 0;const y9=ut,KT=En,b9=Ze,XT=st;let Pl=class extends KT.Shape{_sceneFunc(e){const n=this._getPoints();e.beginPath(),e.moveTo(n[0].x,n[0].y);for(let r=1;r<n.length;r++)e.lineTo(n[r].x,n[r].y);e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,n=this.attrs.radius||0,r=[];for(let i=0;i<e;i++)r.push({x:n*Math.sin(i*2*Math.PI/e),y:-1*n*Math.cos(i*2*Math.PI/e)});return r}getSelfRect(){const e=this._getPoints();let n=e[0].x,r=e[0].y,i=e[0].x,o=e[0].y;return e.forEach(a=>{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};yp.RegularPolygon=Pl;Pl.prototype.className="RegularPolygon";Pl.prototype._centroid=!0;Pl.prototype._attrsAffectingSize=["radius"];(0,XT._registerNode)(Pl);y9.Factory.addGetterSetter(Pl,"radius",0,(0,b9.getNumberValidator)());y9.Factory.addGetterSetter(Pl,"sides",0,(0,b9.getNumberValidator)());var bp={};Object.defineProperty(bp,"__esModule",{value:!0});bp.Ring=void 0;const _9=ut,ZT=En,w9=Ze,QT=st,G5=Math.PI*2;let Cl=class extends ZT.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,G5,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),G5,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};bp.Ring=Cl;Cl.prototype.className="Ring";Cl.prototype._centroid=!0;Cl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,QT._registerNode)(Cl);_9.Factory.addGetterSetter(Cl,"innerRadius",0,(0,w9.getNumberValidator)());_9.Factory.addGetterSetter(Cl,"outerRadius",0,(0,w9.getNumberValidator)());var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.Sprite=void 0;const kl=ut,JT=En,eA=eu,S9=Ze,tA=st;let eo=class extends JT.Shape{constructor(e){super(e),this._updated=!0,this.anim=new eA.Animation(()=>{const n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),l=o[i+0],s=o[i+1],f=o[i+2],h=o[i+3],x=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,f,h),e.closePath(),e.fillStrokeShape(this)),x)if(a){const w=a[n],v=r*2;e.drawImage(x,l,s,f,h,w[v+0],w[v+1],f,h)}else e.drawImage(x,l,s,f,h,0,0,f,h)}_hitFunc(e){const n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),l=o[i+2],s=o[i+3];if(e.beginPath(),a){const f=a[n],h=r*2;e.rect(f[h+0],f[h+1],l,s)}else e.rect(0,0,l,s);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;e<o-1?this.frameIndex(e+1):this.frameIndex(0)}};_p.Sprite=eo;eo.prototype.className="Sprite";(0,tA._registerNode)(eo);kl.Factory.addGetterSetter(eo,"animation");kl.Factory.addGetterSetter(eo,"animations");kl.Factory.addGetterSetter(eo,"frameOffsets");kl.Factory.addGetterSetter(eo,"image");kl.Factory.addGetterSetter(eo,"frameIndex",0,(0,S9.getNumberValidator)());kl.Factory.addGetterSetter(eo,"frameRate",17,(0,S9.getNumberValidator)());kl.Factory.backCompat(eo,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var wp={};Object.defineProperty(wp,"__esModule",{value:!0});wp.Star=void 0;const Hy=ut,nA=En,$y=Ze,rA=st;let Aa=class extends nA.Shape{_sceneFunc(e){const n=this.innerRadius(),r=this.outerRadius(),i=this.numPoints();e.beginPath(),e.moveTo(0,0-r);for(let o=1;o<i*2;o++){const a=o%2===0?r:n,l=a*Math.sin(o*Math.PI/i),s=-1*a*Math.cos(o*Math.PI/i);e.lineTo(l,s)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};wp.Star=Aa;Aa.prototype.className="Star";Aa.prototype._centroid=!0;Aa.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,rA._registerNode)(Aa);Hy.Factory.addGetterSetter(Aa,"numPoints",5,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(Aa,"innerRadius",0,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(Aa,"outerRadius",0,(0,$y.getNumberValidator)());var ru={};Object.defineProperty(ru,"__esModule",{value:!0});ru.Text=void 0;ru.stringToArray=E9;const hm=en,Xn=ut,iA=En,K1=st,Ra=Ze,oA=st;function E9(t){return[...t].reduce((e,n,r,i)=>(new RegExp("\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?(?:\\u200D\\p{Emoji_Presentation})+","u").test(n)?e.push(n):new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(i[r+1]||""))?e.push(n+i[r+1]):r>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?e[e.length-1]+=n:e.push(n),e),[])}const es="auto",aA="center",O9="inherit",Fu="justify",lA="Change.konva",sA="2d",V5="-",x9="left",uA="text",cA="Text",fA="top",dA="bottom",q5="middle",P9="normal",hA="px ",yd=" ",pA="right",W5="rtl",gA="word",vA="char",Y5="none",X1="…",C9=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],mA=C9.length;function yA(t){return t.split(",").map(e=>{e=e.trim();const n=e.indexOf(" ")>=0,r=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!r&&(e=`"${e}"`),e}).join(", ")}let bd;function Z1(){return bd||(bd=hm.Util.createCanvasElement().getContext(sA),bd)}function bA(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function _A(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function wA(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let on=class extends iA.Shape{constructor(e){super(wA(e)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<mA;n++)this.on(C9[n]+lA,this._setTextData);this._setTextData()}_sceneFunc(e){const n=this.textArr,r=n.length;if(!this.text())return;let i=this.padding(),o=this.fontSize(),a=this.lineHeight()*o,l=this.verticalAlign(),s=this.direction(),f=0,h=this.align(),x=this.getWidth(),w=this.letterSpacing(),v=this.fill(),O=this.textDecoration(),g=O.indexOf("underline")!==-1,b=O.indexOf("line-through")!==-1,p;s=s===O9?e.direction:s;let y=a/2,d=q5;if(K1.Konva._fixTextRendering){const N=this.measureSize("M");d="alphabetic",y=(N.fontBoundingBoxAscent-N.fontBoundingBoxDescent)/2+a/2}var m=0,_=0;for(s===W5&&e.setAttr("direction",s),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",d),e.setAttr("textAlign",x9),l===q5?f=(this.getHeight()-r*a-i*2)/2:l===dA&&(f=this.getHeight()-r*a-i*2),e.translate(i,f+i),p=0;p<r;p++){var m=0,_=0,A=n[p],C=A.text,R=A.width,S=A.lastInParagraph,E,P,T;if(e.save(),h===pA?m+=x-R-i*2:h===aA&&(m+=(x-R-i*2)/2),g){e.save(),e.beginPath();const G=K1.Konva._fixTextRendering?Math.round(o/4):Math.round(o/2),Z=m,W=y+_+G;e.moveTo(Z,W),E=C.split(" ").length-1,P=E===0,T=h===Fu&&!S?x-i*2:R,e.lineTo(Z+Math.round(T),W),e.lineWidth=o/15;const H=this._getLinearGradient();e.strokeStyle=H||v,e.stroke(),e.restore()}if(b){e.save(),e.beginPath();const G=K1.Konva._fixTextRendering?-Math.round(o/4):0;e.moveTo(m,y+_+G),E=C.split(" ").length-1,P=E===0,T=h===Fu&&S&&!P?x-i*2:R,e.lineTo(m+Math.round(T),y+_+G),e.lineWidth=o/15;const Z=this._getLinearGradient();e.strokeStyle=Z||v,e.stroke(),e.restore()}if(s!==W5&&(w!==0||h===Fu)){E=C.split(" ").length-1;const G=E9(C);for(let Z=0;Z<G.length;Z++){const W=G[Z];W===" "&&!S&&h===Fu&&(m+=(x-i*2-R)/E),this._partialTextX=m,this._partialTextY=y+_,this._partialText=W,e.fillStrokeShape(this),m+=this.measureSize(W).width+w}}else w!==0&&e.setAttr("letterSpacing",`${w}px`),this._partialTextX=m,this._partialTextY=y+_,this._partialText=C,e.fillStrokeShape(this);e.restore(),r>1&&(y+=a)}}_hitFunc(e){const n=this.getWidth(),r=this.getHeight();e.beginPath(),e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}setText(e){const n=hm.Util._isString(e)?e:e==null?"":e+"";return this._setAttr(uA,n),this}getWidth(){return this.attrs.width===es||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===es||this.attrs.height===void 0?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(e){var n,r,i,o,a,l,s,f,h,x,w;let v=Z1(),O=this.fontSize(),g;v.save(),v.font=this._getContextFont(),g=v.measureText(e),v.restore();const b=O/100;return{actualBoundingBoxAscent:(n=g.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*b,actualBoundingBoxDescent:(r=g.actualBoundingBoxDescent)!==null&&r!==void 0?r:0,actualBoundingBoxLeft:(i=g.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*b,actualBoundingBoxRight:(o=g.actualBoundingBoxRight)!==null&&o!==void 0?o:75.732421875*b,alphabeticBaseline:(a=g.alphabeticBaseline)!==null&&a!==void 0?a:0,emHeightAscent:(l=g.emHeightAscent)!==null&&l!==void 0?l:100*b,emHeightDescent:(s=g.emHeightDescent)!==null&&s!==void 0?s:-20*b,fontBoundingBoxAscent:(f=g.fontBoundingBoxAscent)!==null&&f!==void 0?f:91*b,fontBoundingBoxDescent:(h=g.fontBoundingBoxDescent)!==null&&h!==void 0?h:21*b,hangingBaseline:(x=g.hangingBaseline)!==null&&x!==void 0?x:72.80000305175781*b,ideographicBaseline:(w=g.ideographicBaseline)!==null&&w!==void 0?w:-21*b,width:g.width,height:O}}_getContextFont(){return this.fontStyle()+yd+this.fontVariant()+yd+(this.fontSize()+hA)+yA(this.fontFamily())}_addTextLine(e){this.align()===Fu&&(e=e.trim());const r=this._getTextWidth(e);return this.textArr.push({text:e,width:r,lastInParagraph:!1})}_getTextWidth(e){const n=this.letterSpacing(),r=e.length;return Z1().measureText(e).width+(r?n*(r-1):0)}_setTextData(){let e=this.text().split(`
43
- `),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,l=o!==es&&o!==void 0,s=a!==es&&a!==void 0,f=this.padding(),h=o-f*2,x=a-f*2,w=0,v=this.wrap(),O=v!==Y5,g=v!==vA&&O,b=this.ellipsis();this.textArr=[],Z1().font=this._getContextFont();const p=b?this._getTextWidth(X1):0;for(let d=0,m=e.length;d<m;++d){let _=e[d],A=this._getTextWidth(_);if(l&&A>h)for(;_.length>0;){let C=0,R=_.length,S="",E=0;for(;C<R;){const P=C+R>>>1,T=_.slice(0,P+1),N=this._getTextWidth(T)+p;N<=h?(C=P+1,S=T,E=N):R=P}if(S){if(g){var y;const T=_[S.length];(T===yd||T===V5)&&E<=h?y=S.length:y=Math.max(S.lastIndexOf(yd),S.lastIndexOf(V5))+1,y>0&&(C=y,S=S.slice(0,C),E=this._getTextWidth(S))}if(S=S.trimRight(),this._addTextLine(S),r=Math.max(r,E),w+=i,this._shouldHandleEllipsis(w)){this._tryToAddEllipsisToLastLine();break}if(_=_.slice(C),_=_.trimLeft(),_.length>0&&(A=this._getTextWidth(_),A<=h)){this._addTextLine(_),w+=i,r=Math.max(r,A);break}}else break}else this._addTextLine(_),w+=i,r=Math.max(r,A),this._shouldHandleEllipsis(w)&&d<m-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),s&&w+i>x)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(e){const n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==es&&i!==void 0,a=this.padding(),l=i-a*2;return!(this.wrap()!==Y5)||o&&e+r>l}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,n=e!==es&&e!==void 0,r=this.padding(),i=e-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];!a||!o||(n&&(this._getTextWidth(a.text+X1)<i||(a.text=a.text.slice(0,a.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(a.text+X1))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,n=this.hasShadow();return e&&n?!0:super._useBufferCanvas()}};ru.Text=on;on.prototype._fillFunc=bA;on.prototype._strokeFunc=_A;on.prototype.className=cA;on.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,oA._registerNode)(on);Xn.Factory.overWriteSetter(on,"width",(0,Ra.getNumberOrAutoValidator)());Xn.Factory.overWriteSetter(on,"height",(0,Ra.getNumberOrAutoValidator)());Xn.Factory.addGetterSetter(on,"direction",O9);Xn.Factory.addGetterSetter(on,"fontFamily","Arial");Xn.Factory.addGetterSetter(on,"fontSize",12,(0,Ra.getNumberValidator)());Xn.Factory.addGetterSetter(on,"fontStyle",P9);Xn.Factory.addGetterSetter(on,"fontVariant",P9);Xn.Factory.addGetterSetter(on,"padding",0,(0,Ra.getNumberValidator)());Xn.Factory.addGetterSetter(on,"align",x9);Xn.Factory.addGetterSetter(on,"verticalAlign",fA);Xn.Factory.addGetterSetter(on,"lineHeight",1,(0,Ra.getNumberValidator)());Xn.Factory.addGetterSetter(on,"wrap",gA);Xn.Factory.addGetterSetter(on,"ellipsis",!1,(0,Ra.getBooleanValidator)());Xn.Factory.addGetterSetter(on,"letterSpacing",0,(0,Ra.getNumberValidator)());Xn.Factory.addGetterSetter(on,"text","",(0,Ra.getStringValidator)());Xn.Factory.addGetterSetter(on,"textDecoration","");var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});Sp.TextPath=void 0;const Q1=en,Ci=ut,SA=En,zu=tu,J1=ru,k9=Ze,EA=st,OA="",T9="normal";function A9(t){t.fillText(this.partialText,0,0)}function R9(t){t.strokeText(this.partialText,0,0)}let On=class extends SA.Shape{constructor(e){super(e),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 zu.Path.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const n=this.pathLength;return e-1>n?null:zu.Path.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=zu.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const n=this.textDecoration(),r=this.fill(),i=this.fontSize(),o=this.glyphInfo;n==="underline"&&e.beginPath();for(let a=0;a<o.length;a++){e.save();const l=o[a].p0;e.translate(l.x,l.y),e.rotate(o[a].rotation),this.partialText=o[a].text,e.fillStrokeShape(this),n==="underline"&&(a===0&&e.moveTo(0,i/2+1),e.lineTo(i,i/2+1)),e.restore()}n==="underline"&&(e.strokeStyle=r,e.lineWidth=i/20,e.stroke()),e.restore()}_hitFunc(e){e.beginPath();const n=this.glyphInfo;if(n.length>=1){const r=n[0].p0;e.moveTo(r.x,r.y)}for(let r=0;r<n.length;r++){const i=n[r].p1;e.lineTo(i.x,i.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.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(e){return J1.Text.prototype.setText.call(this,e)}_getContextFont(){return J1.Text.prototype._getContextFont.call(this)}_getTextSize(e){const r=this.dummyCanvas.getContext("2d");r.save(),r.font=this._getContextFont();const i=r.measureText(e);return r.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:e,height:n}=this._getTextSize(this.attrs.text);if(this.textWidth=e,this.textHeight=n,this.glyphInfo=[],!this.attrs.data)return null;const r=this.letterSpacing(),i=this.align(),o=this.kerningFunc(),a=Math.max(this.textWidth+((this.attrs.text||"").length-1)*r,0);let l=0;i==="center"&&(l=Math.max(0,this.pathLength/2-a/2)),i==="right"&&(l=Math.max(0,this.pathLength-a));const s=(0,J1.stringToArray)(this.text());let f=l;for(let h=0;h<s.length;h++){const x=this._getPointAtLength(f);if(!x)return;let w=this._getTextSize(s[h]).width+r;if(s[h]===" "&&i==="justify"){const y=this.text().split(" ").length-1;w+=(this.pathLength-a)/y}const v=this._getPointAtLength(f+w);if(!v)return;const O=zu.Path.getLineLength(x.x,x.y,v.x,v.y);let g=0;if(o)try{g=o(s[h-1],s[h])*this.fontSize()}catch{g=0}x.x+=g,v.x+=g,this.textWidth+=g;const b=zu.Path.getPointOnLine(g+O/2,x.x,x.y,v.x,v.y),p=Math.atan2(v.y-x.y,v.x-x.x);this.glyphInfo.push({transposeX:b.x,transposeY:b.y,text:s[h],rotation:p,p0:x,p1:v}),f+=w}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const e=[];this.glyphInfo.forEach(function(f){e.push(f.p0.x),e.push(f.p0.y),e.push(f.p1.x),e.push(f.p1.y)});let n=e[0]||0,r=e[0]||0,i=e[1]||0,o=e[1]||0,a,l;for(let f=0;f<e.length/2;f++)a=e[f*2],l=e[f*2+1],n=Math.min(n,a),r=Math.max(r,a),i=Math.min(i,l),o=Math.max(o,l);const s=this.fontSize();return{x:n-s/2,y:i-s/2,width:r-n+s,height:o-i+s}}destroy(){return Q1.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};Sp.TextPath=On;On.prototype._fillFunc=A9;On.prototype._strokeFunc=R9;On.prototype._fillFuncHit=A9;On.prototype._strokeFuncHit=R9;On.prototype.className="TextPath";On.prototype._attrsAffectingSize=["text","fontSize","data"];(0,EA._registerNode)(On);Ci.Factory.addGetterSetter(On,"data");Ci.Factory.addGetterSetter(On,"fontFamily","Arial");Ci.Factory.addGetterSetter(On,"fontSize",12,(0,k9.getNumberValidator)());Ci.Factory.addGetterSetter(On,"fontStyle",T9);Ci.Factory.addGetterSetter(On,"align","left");Ci.Factory.addGetterSetter(On,"letterSpacing",0,(0,k9.getNumberValidator)());Ci.Factory.addGetterSetter(On,"textBaseline","middle");Ci.Factory.addGetterSetter(On,"fontVariant",T9);Ci.Factory.addGetterSetter(On,"text",OA);Ci.Factory.addGetterSetter(On,"textDecoration",null);Ci.Factory.addGetterSetter(On,"kerningFunc",null);var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Transformer=void 0;const At=en,Et=ut,K5=qt,xA=En,PA=Zc,X5=Js,fi=st,Ma=Ze,CA=st,M9="tr-konva",kA=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${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},RA="ontouchstart"in fi.Konva._global;function MA(t,e,n){if(t==="rotater")return n;e+=At.Util.degToRad(AA[t]||0);const r=(At.Util.radToDeg(e)%360+360)%360;return At.Util._inRange(r,315+22.5,360)||At.Util._inRange(r,0,22.5)?"ns-resize":At.Util._inRange(r,45-22.5,45+22.5)?"nesw-resize":At.Util._inRange(r,90-22.5,90+22.5)?"ew-resize":At.Util._inRange(r,135-22.5,135+22.5)?"nwse-resize":At.Util._inRange(r,180-22.5,180+22.5)?"ns-resize":At.Util._inRange(r,225-22.5,225+22.5)?"nesw-resize":At.Util._inRange(r,270-22.5,270+22.5)?"ew-resize":At.Util._inRange(r,315-22.5,315+22.5)?"nwse-resize":(At.Util.error("Transformer has unknown angle for cursor detection: "+r),"pointer")}const wh=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],Q5=1e8;function LA(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}function L9(t,e,n){const r=n.x+(t.x-n.x)*Math.cos(e)-(t.y-n.y)*Math.sin(e),i=n.y+(t.x-n.x)*Math.sin(e)+(t.y-n.y)*Math.cos(e);return{...t,rotation:t.rotation+e,x:r,y:i}}function NA(t,e){const n=LA(t);return L9(t,e,n)}function IA(t,e,n){let r=e;for(let i=0;i<t.length;i++){const o=fi.Konva.getAngle(t[i]),a=Math.abs(o-e)%(Math.PI*2);Math.min(a,Math.PI*2-a)<n&&(r=o)}return r}let pm=0,gt=class extends X5.Group{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(kA,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){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([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return M9+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const n=e.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);return this._nodes=e=n,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const o=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},a=i._attrsAffectingSize.map(l=>l+"Change."+this._getEventNamespace()).join(" ");i.on(a,o),i.on(TA.map(l=>l+`.${this._getEventNamespace()}`).join(" "),o),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,o),this._proxyDrag(i)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let n;e.on(`dragstart.${this._getEventNamespace()}`,r=>{n=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(r,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=e.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(l=>{if(l===e||l.isDragging())return;const s=l.getAbsolutePosition();l.setAbsolutePosition({x:s.x+o,y:s.y+a}),l.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(Z5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(Z5,this.__getNodeRect)}__getNodeShape(e,n=this.rotation(),r){const i=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(r),a=e.getAbsolutePosition(r),l=i.x*o.x-e.offsetX()*o.x,s=i.y*o.y-e.offsetY()*o.y,f=(fi.Konva.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),h={x:a.x+l*Math.cos(f)+s*Math.sin(-f),y:a.y+s*Math.cos(f)+l*Math.sin(f),width:i.width*o.x,height:i.height*o.y,rotation:f};return L9(h,-fi.Konva.getAngle(n),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-Q5,y:-Q5,width:0,height:0,rotation:0};const n=[];this.nodes().map(f=>{const h=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),x=[{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();x.forEach(function(v){const O=w.point(v);n.push(O)})});const r=new At.Transform;r.rotate(-fi.Konva.getAngle(this.rotation()));let i=1/0,o=1/0,a=-1/0,l=-1/0;n.forEach(function(f){const h=r.point(f);i===void 0&&(i=a=h.x,o=l=h.y),i=Math.min(i,h.x),o=Math.min(o,h.y),a=Math.max(a,h.x),l=Math.max(l,h.y)}),r.invert();const s=r.point({x:i,y:o});return{x:s.x,y:s.y,width:a-i,height:l-o,rotation:fi.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(),wh.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater")}_createAnchor(e){const n=new PA.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:RA?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{const i=fi.Konva.getAngle(this.rotation()),o=this.rotateAnchorCursor(),a=MA(e,i,o);n.getStage().content&&(n.getStage().content.style.cursor=a),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){const e=new xA.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(n,r){const i=r.getParent(),o=i.padding();n.beginPath(),n.rect(-o,-o,r.width()+o*2,r.height()+o*2),n.moveTo(r.width()/2,-o),i.rotateEnabled()&&i.rotateLineVisible()&&n.lineTo(r.width()/2,-i.rotateAnchorOffset()*At.Util._sign(r.height())-o),n.fillStrokeShape(r)},hitFunc:(n,r)=>{if(!this.shouldOverdrawWholeArea())return;const i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}});this.add(e),this._proxyDrag(e),e.on("dragstart",n=>{n.cancelBubble=!0}),e.on("dragmove",n=>{n.cancelBubble=!0}),e.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),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;const a=e.target.getAbsolutePosition(),l=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:l.x-a.x,y:l.y-a.y},pm++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(s=>{s._fire("transformstart",{evt:e.evt,target:s})})}_handleMouseMove(e){let n,r,i;const o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(e);const l=a.getPointerPosition();let s={x:l.x-this._anchorDragOffset.x,y:l.y-this._anchorDragOffset.y};const f=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(f,s,e)),o.setAbsolutePosition(s);const h=o.getAbsolutePosition();if(f.x===h.x&&f.y===h.y)return;if(this._movingAnchorName==="rotater"){const _=this._getNodeRect();n=o.x()-_.width/2,r=-o.y()+_.height/2;let A=Math.atan2(-r,n)+Math.PI/2;_.height<0&&(A-=Math.PI);const R=fi.Konva.getAngle(this.rotation())+A,S=fi.Konva.getAngle(this.rotationSnapTolerance()),P=IA(this.rotationSnaps(),R,S)-_.rotation,T=NA(_,P);this._fitNodesInto(T,e);return}const x=this.shiftBehavior();let w;x==="inverted"?w=this.keepRatio()&&!e.shiftKey:x==="none"?w=this.keepRatio():w=this.keepRatio()||e.shiftKey;var p=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(w){var v=p?{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(v.x-o.x(),2)+Math.pow(v.y-o.y(),2));var O=this.findOne(".top-left").x()>v.x?-1:1,g=this.findOne(".top-left").y()>v.y?-1:1;n=i*this.cos*O,r=i*this.sin*g,this.findOne(".top-left").x(v.x-n),this.findOne(".top-left").y(v.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(w){var v=p?{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(o.x()-v.x,2)+Math.pow(v.y-o.y(),2));var O=this.findOne(".top-right").x()<v.x?-1:1,g=this.findOne(".top-right").y()>v.y?-1:1;n=i*this.cos*O,r=i*this.sin*g,this.findOne(".top-right").x(v.x+n),this.findOne(".top-right").y(v.y-r)}var b=o.position();this.findOne(".top-left").y(b.y),this.findOne(".bottom-right").x(b.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(w){var v=p?{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(v.x-o.x(),2)+Math.pow(o.y()-v.y,2));var O=v.x<o.x()?-1:1,g=o.y()<v.y?-1:1;n=i*this.cos*O,r=i*this.sin*g,o.x(v.x-n),o.y(v.y+r)}b=o.position(),this.findOne(".top-left").x(b.x),this.findOne(".bottom-right").y(b.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(o.y());else if(this._movingAnchorName==="bottom-right"){if(w){var v=p?{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(o.x()-v.x,2)+Math.pow(o.y()-v.y,2));var O=this.findOne(".bottom-right").x()<v.x?-1:1,g=this.findOne(".bottom-right").y()<v.y?-1:1;n=i*this.cos*O,r=i*this.sin*g,this.findOne(".bottom-right").x(v.x+n),this.findOne(".bottom-right").y(v.y+r)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var p=this.centeredScaling()||e.altKey;if(p){const _=this.findOne(".top-left"),A=this.findOne(".bottom-right"),C=_.x(),R=_.y(),S=this.getWidth()-A.x(),E=this.getHeight()-A.y();A.move({x:-C,y:-R}),_.move({x:S,y:E})}const y=this.findOne(".top-left").getAbsolutePosition();n=y.x,r=y.y;const d=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),m=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:r,width:d,height:m,rotation:fi.Konva.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var n;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));const r=this.getNode();pm--,this._fire("transformend",{evt:e,target:r}),(n=this.getLayer())===null||n===void 0||n.batchDraw(),r&&this._nodes.forEach(i=>{var o;i._fire("transformend",{evt:e,target:i}),(o=i.getLayer())===null||o===void 0||o.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,n){const r=this._getNodeRect(),i=1;if(At.Util._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(At.Util._inRange(e.height,-this.padding()*2-i,i)){this.update();return}const o=new At.Transform;if(o.rotate(fi.Konva.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const w=o.point({x:-this.padding()*2,y:0});e.x+=w.x,e.y+=w.y,e.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&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const w=o.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const w=o.point({x:0,y:-this.padding()*2});e.x+=w.x,e.y+=w.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const w=o.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const w=this.boundBoxFunc()(r,e);w?e=w:At.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const a=1e7,l=new At.Transform;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/a,r.height/a);const s=new At.Transform,f=e.width/a,h=e.height/a;this.flipEnabled()===!1?(s.translate(e.x,e.y),s.rotate(e.rotation),s.translate(e.width<0?e.width:0,e.height<0?e.height:0),s.scale(Math.abs(f),Math.abs(h))):(s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(f,h));const x=s.multiply(l.invert());this._nodes.forEach(w=>{var v;const O=w.getParent().getAbsoluteTransform(),g=w.getTransform().copy();g.translate(w.offsetX(),w.offsetY());const b=new At.Transform;b.multiply(O.copy().invert()).multiply(x).multiply(O).multiply(g);const p=b.decompose();w.setAttrs(p),(v=w.getLayer())===null||v===void 0||v.batchDraw()}),this.rotation(At.Util._getRotation(e.rotation)),this._nodes.forEach(w=>{this._fire("transform",{evt:n,target:w}),w._fire("transform",{evt:n,target:w})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,n){this.findOne(e).setAttrs(n)}update(){var e;const n=this._getNodeRect();this.rotation(At.Util._getRotation(n.rotation));const r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),l=this.padding(),s=this.anchorSize(),f=this.find("._anchor");f.forEach(x=>{x.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:s/2+l,offsetY:s/2+l,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:s/2+l,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:s/2-l,offsetY:s/2+l,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:s/2+l,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:s/2-l,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:s/2+l,offsetY:s/2-l,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:s/2-l,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:s/2-l,offsetY:s/2-l,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*At.Util._sign(i)-l,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,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(x=>{h(x)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);e&&e.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 K5.Node.prototype.toObject.call(this)}clone(e){return K5.Node.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};Ep.Transformer=gt;gt.isTransforming=()=>pm>0;function DA(t){return t instanceof Array||At.Util.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){wh.indexOf(e)===-1&&At.Util.warn("Unknown anchor name: "+e+". Available names are: "+wh.join(", "))}),t||[]}gt.prototype.className="Transformer";(0,CA._registerNode)(gt);Et.Factory.addGetterSetter(gt,"enabledAnchors",wh,DA);Et.Factory.addGetterSetter(gt,"flipEnabled",!0,(0,Ma.getBooleanValidator)());Et.Factory.addGetterSetter(gt,"resizeEnabled",!0);Et.Factory.addGetterSetter(gt,"anchorSize",10,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"rotateEnabled",!0);Et.Factory.addGetterSetter(gt,"rotateLineVisible",!0);Et.Factory.addGetterSetter(gt,"rotationSnaps",[]);Et.Factory.addGetterSetter(gt,"rotateAnchorOffset",50,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"rotateAnchorCursor","crosshair");Et.Factory.addGetterSetter(gt,"rotationSnapTolerance",5,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"borderEnabled",!0);Et.Factory.addGetterSetter(gt,"anchorStroke","rgb(0, 161, 255)");Et.Factory.addGetterSetter(gt,"anchorStrokeWidth",1,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"anchorFill","white");Et.Factory.addGetterSetter(gt,"anchorCornerRadius",0,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"borderStroke","rgb(0, 161, 255)");Et.Factory.addGetterSetter(gt,"borderStrokeWidth",1,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"borderDash");Et.Factory.addGetterSetter(gt,"keepRatio",!0);Et.Factory.addGetterSetter(gt,"shiftBehavior","default");Et.Factory.addGetterSetter(gt,"centeredScaling",!1);Et.Factory.addGetterSetter(gt,"ignoreStroke",!1);Et.Factory.addGetterSetter(gt,"padding",0,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"node");Et.Factory.addGetterSetter(gt,"nodes");Et.Factory.addGetterSetter(gt,"boundBoxFunc");Et.Factory.addGetterSetter(gt,"anchorDragBoundFunc");Et.Factory.addGetterSetter(gt,"anchorStyleFunc");Et.Factory.addGetterSetter(gt,"shouldOverdrawWholeArea",!1);Et.Factory.addGetterSetter(gt,"useSingleNodeRotation",!0);Et.Factory.backCompat(gt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Op={};Object.defineProperty(Op,"__esModule",{value:!0});Op.Wedge=void 0;const xp=ut,jA=En,FA=st,N9=Ze,zA=st;let No=class extends jA.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,FA.Konva.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};Op.Wedge=No;No.prototype.className="Wedge";No.prototype._centroid=!0;No.prototype._attrsAffectingSize=["radius"];(0,zA._registerNode)(No);xp.Factory.addGetterSetter(No,"radius",0,(0,N9.getNumberValidator)());xp.Factory.addGetterSetter(No,"angle",0,(0,N9.getNumberValidator)());xp.Factory.addGetterSetter(No,"clockwise",!1);xp.Factory.backCompat(No,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});Pp.Blur=void 0;const J5=ut,BA=qt,UA=Ze;function e4(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const 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(t,e){const n=t.data,r=t.width,i=t.height;let o,a,l,s,f,h,x,w,v,O,g,b,p,y,d,m,_,A,C,R,S,E,P,T,N=e+e+1,U=r-1,G=i-1,Z=e+1,W=Z*(Z+1)/2,H=new e4,L=null,M=H,D=null,B=null,V=HA[e],Y=$A[e];for(l=1;l<N;l++)M=M.next=new e4,l===Z&&(L=M);for(M.next=H,x=h=0,a=0;a<i;a++){for(m=_=A=C=w=v=O=g=0,b=Z*(R=n[h]),p=Z*(S=n[h+1]),y=Z*(E=n[h+2]),d=Z*(P=n[h+3]),w+=W*R,v+=W*S,O+=W*E,g+=W*P,M=H,l=0;l<Z;l++)M.r=R,M.g=S,M.b=E,M.a=P,M=M.next;for(l=1;l<Z;l++)s=h+((U<l?U:l)<<2),w+=(M.r=R=n[s])*(T=Z-l),v+=(M.g=S=n[s+1])*T,O+=(M.b=E=n[s+2])*T,g+=(M.a=P=n[s+3])*T,m+=R,_+=S,A+=E,C+=P,M=M.next;for(D=H,B=L,o=0;o<r;o++)n[h+3]=P=g*V>>Y,P!==0?(P=255/P,n[h]=(w*V>>Y)*P,n[h+1]=(v*V>>Y)*P,n[h+2]=(O*V>>Y)*P):n[h]=n[h+1]=n[h+2]=0,w-=b,v-=p,O-=y,g-=d,b-=D.r,p-=D.g,y-=D.b,d-=D.a,s=x+((s=o+e+1)<U?s:U)<<2,m+=D.r=n[s],_+=D.g=n[s+1],A+=D.b=n[s+2],C+=D.a=n[s+3],w+=m,v+=_,O+=A,g+=C,D=D.next,b+=R=B.r,p+=S=B.g,y+=E=B.b,d+=P=B.a,m-=R,_-=S,A-=E,C-=P,B=B.next,h+=4;x+=r}for(o=0;o<r;o++){for(_=A=C=m=v=O=g=w=0,h=o<<2,b=Z*(R=n[h]),p=Z*(S=n[h+1]),y=Z*(E=n[h+2]),d=Z*(P=n[h+3]),w+=W*R,v+=W*S,O+=W*E,g+=W*P,M=H,l=0;l<Z;l++)M.r=R,M.g=S,M.b=E,M.a=P,M=M.next;for(f=r,l=1;l<=e;l++)h=f+o<<2,w+=(M.r=R=n[h])*(T=Z-l),v+=(M.g=S=n[h+1])*T,O+=(M.b=E=n[h+2])*T,g+=(M.a=P=n[h+3])*T,m+=R,_+=S,A+=E,C+=P,M=M.next,l<G&&(f+=r);for(h=o,D=H,B=L,a=0;a<i;a++)s=h<<2,n[s+3]=P=g*V>>Y,P>0?(P=255/P,n[s]=(w*V>>Y)*P,n[s+1]=(v*V>>Y)*P,n[s+2]=(O*V>>Y)*P):n[s]=n[s+1]=n[s+2]=0,w-=b,v-=p,O-=y,g-=d,b-=D.r,p-=D.g,y-=D.b,d-=D.a,s=o+((s=a+Z)<G?s:G)*r<<2,w+=m+=D.r=n[s],v+=_+=D.g=n[s+1],O+=A+=D.b=n[s+2],g+=C+=D.a=n[s+3],D=D.next,b+=R=B.r,p+=S=B.g,y+=E=B.b,d+=P=B.a,m-=R,_-=S,A-=E,C-=P,B=B.next,h+=r}}const VA=function(e){const n=Math.round(this.blurRadius());n>0&&GA(e,n)};Pp.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=ut,qA=qt,WA=Ze,YA=function(t){let e=this.brightness()*255,n=t.data,r=n.length,i;for(i=0;i<r;i+=4)n[i]+=e,n[i+1]+=e,n[i+2]+=e};Cp.Brighten=YA;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 n4=ut,KA=qt,XA=Ze,ZA=function(t){const e=Math.pow((this.contrast()+100)/100,2);let n=t.data,r=n.length,i=150,o=150,a=150,l;for(l=0;l<r;l+=4)i=n[l],o=n[l+1],a=n[l+2],i/=255,i-=.5,i*=e,i+=.5,i*=255,o/=255,o-=.5,o*=e,o+=.5,o*=255,a/=255,a-=.5,a*=e,a+=.5,a*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[l]=i,n[l+1]=o,n[l+2]=a};kp.Contrast=ZA;n4.Factory.addGetterSetter(KA.Node,"contrast",0,(0,XA.getNumberValidator)(),n4.Factory.afterSetFilter);var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0});Tp.Emboss=void 0;const ba=ut,Ap=qt,QA=en,I9=Ze,JA=function(t){let e=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,l=t.data,s=t.width,f=t.height,h=s*4,x=f;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:QA.Util.error("Unknown emboss direction: "+r)}do{const w=(x-1)*h;let v=o;x+v<1&&(v=0),x+v>f&&(v=0);const O=(x-1+v)*s*4;let g=s;do{const b=w+(g-1)*4;let p=a;g+p<1&&(p=0),g+p>s&&(p=0);const y=O+(g-1+p)*4,d=l[b]-l[y],m=l[b+1]-l[y+1],_=l[b+2]-l[y+2];let A=d;const C=A>0?A:-A,R=m>0?m:-m,S=_>0?_:-_;if(R>C&&(A=m),S>C&&(A=_),A*=e,i){const E=l[b]+A,P=l[b+1]+A,T=l[b+2]+A;l[b]=E>255?255:E<0?0:E,l[b+1]=P>255?255:P<0?0:P,l[b+2]=T>255?255:T<0?0:T}else{let E=n-A;E<0?E=0:E>255&&(E=255),l[b]=l[b+1]=l[b+2]=E}}while(--g)}while(--x)};Tp.Emboss=JA;ba.Factory.addGetterSetter(Ap.Node,"embossStrength",.5,(0,I9.getNumberValidator)(),ba.Factory.afterSetFilter);ba.Factory.addGetterSetter(Ap.Node,"embossWhiteLevel",.5,(0,I9.getNumberValidator)(),ba.Factory.afterSetFilter);ba.Factory.addGetterSetter(Ap.Node,"embossDirection","top-left",null,ba.Factory.afterSetFilter);ba.Factory.addGetterSetter(Ap.Node,"embossBlend",!1,null,ba.Factory.afterSetFilter);var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.Enhance=void 0;const r4=ut,eR=qt,tR=Ze;function eg(t,e,n,r,i){let o=n-e,a=i-r,l;return o===0?r+a/2:a===0?r:(l=(t-e)/o,l=a*l+r,l)}const nR=function(t){let e=t.data,n=e.length,r=e[0],i=r,o,a=e[1],l=a,s,f=e[2],h=f,x,w;const v=this.enhance();if(v===0)return;for(w=0;w<n;w+=4)o=e[w+0],o<r?r=o:o>i&&(i=o),s=e[w+1],s<a?a=s:s>l&&(l=s),x=e[w+2],x<f?f=x:x>h&&(h=x);i===r&&(i=255,r=0),l===a&&(l=255,a=0),h===f&&(h=255,f=0);let O,g,b,p,y,d,m,_,A;for(v>0?(g=i+v*(255-i),b=r-v*(r-0),y=l+v*(255-l),d=a-v*(a-0),_=h+v*(255-h),A=f-v*(f-0)):(O=(i+r)*.5,g=i+v*(i-O),b=r+v*(r-O),p=(l+a)*.5,y=l+v*(l-p),d=a+v*(a-p),m=(h+f)*.5,_=h+v*(h-m),A=f+v*(f-m)),w=0;w<n;w+=4)e[w+0]=eg(e[w+0],r,i,b,g),e[w+1]=eg(e[w+1],a,l,d,y),e[w+2]=eg(e[w+2],f,h,A,_)};Rp.Enhance=nR;r4.Factory.addGetterSetter(eR.Node,"enhance",0,(0,tR.getNumberValidator)(),r4.Factory.afterSetFilter);var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});Mp.Grayscale=void 0;const rR=function(t){let e=t.data,n=e.length,r,i;for(r=0;r<n;r+=4)i=.34*e[r]+.5*e[r+1]+.16*e[r+2],e[r]=i,e[r+1]=i,e[r+2]=i};Mp.Grayscale=rR;var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});Lp.HSL=void 0;const js=ut,Gy=qt,Vy=Ze;js.Factory.addGetterSetter(Gy.Node,"hue",0,(0,Vy.getNumberValidator)(),js.Factory.afterSetFilter);js.Factory.addGetterSetter(Gy.Node,"saturation",0,(0,Vy.getNumberValidator)(),js.Factory.afterSetFilter);js.Factory.addGetterSetter(Gy.Node,"luminance",0,(0,Vy.getNumberValidator)(),js.Factory.afterSetFilter);const iR=function(t){let e=t.data,n=e.length,r=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,a=this.luminance()*127,l;const s=r*i*Math.cos(o*Math.PI/180),f=r*i*Math.sin(o*Math.PI/180),h=.299*r+.701*s+.167*f,x=.587*r-.587*s+.33*f,w=.114*r-.114*s-.497*f,v=.299*r-.299*s-.328*f,O=.587*r+.413*s+.035*f,g=.114*r-.114*s+.293*f,b=.299*r-.3*s+1.25*f,p=.587*r-.586*s-1.05*f,y=.114*r+.886*s-.2*f;let d,m,_,A;for(l=0;l<n;l+=4)d=e[l+0],m=e[l+1],_=e[l+2],A=e[l+3],e[l+0]=h*d+x*m+w*_+a,e[l+1]=v*d+O*m+g*_+a,e[l+2]=b*d+p*m+y*_+a,e[l+3]=A};Lp.HSL=iR;var Np={};Object.defineProperty(Np,"__esModule",{value:!0});Np.HSV=void 0;const Fs=ut,qy=qt,Wy=Ze,oR=function(t){const e=t.data,n=e.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,a=r*i*Math.cos(o*Math.PI/180),l=r*i*Math.sin(o*Math.PI/180),s=.299*r+.701*a+.167*l,f=.587*r-.587*a+.33*l,h=.114*r-.114*a-.497*l,x=.299*r-.299*a-.328*l,w=.587*r+.413*a+.035*l,v=.114*r-.114*a+.293*l,O=.299*r-.3*a+1.25*l,g=.587*r-.586*a-1.05*l,b=.114*r+.886*a-.2*l;let p,y,d,m;for(let _=0;_<n;_+=4)p=e[_+0],y=e[_+1],d=e[_+2],m=e[_+3],e[_+0]=s*p+f*y+h*d,e[_+1]=x*p+w*y+v*d,e[_+2]=O*p+g*y+b*d,e[_+3]=m};Np.HSV=oR;Fs.Factory.addGetterSetter(qy.Node,"hue",0,(0,Wy.getNumberValidator)(),Fs.Factory.afterSetFilter);Fs.Factory.addGetterSetter(qy.Node,"saturation",0,(0,Wy.getNumberValidator)(),Fs.Factory.afterSetFilter);Fs.Factory.addGetterSetter(qy.Node,"value",0,(0,Wy.getNumberValidator)(),Fs.Factory.afterSetFilter);var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.Invert=void 0;const aR=function(t){let e=t.data,n=e.length,r;for(r=0;r<n;r+=4)e[r]=255-e[r],e[r+1]=255-e[r+1],e[r+2]=255-e[r+2]};Ip.Invert=aR;var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0});Dp.Kaleidoscope=void 0;const Sh=ut,D9=qt,i4=en,j9=Ze,lR=function(t,e,n){let r=t.data,i=e.data,o=t.width,a=t.height,l=n.polarCenterX||o/2,s=n.polarCenterY||a/2,f,h,x,w=0,v=0,O=0,g=0,b,p=Math.sqrt(l*l+s*s);h=o-l,x=a-s,b=Math.sqrt(h*h+x*x),p=b>p?b:p;let y=a,d=o,m,_,A=360/d*Math.PI/180,C,R;for(_=0;_<d;_+=1)for(C=Math.sin(_*A),R=Math.cos(_*A),m=0;m<y;m+=1)h=Math.floor(l+p*m/y*R),x=Math.floor(s+p*m/y*C),f=(x*o+h)*4,w=r[f+0],v=r[f+1],O=r[f+2],g=r[f+3],f=(_+m*o)*4,i[f+0]=w,i[f+1]=v,i[f+2]=O,i[f+3]=g},sR=function(t,e,n){let r=t.data,i=e.data,o=t.width,a=t.height,l=n.polarCenterX||o/2,s=n.polarCenterY||a/2,f,h,x,w,v,O=0,g=0,b=0,p=0,y,d=Math.sqrt(l*l+s*s);h=o-l,x=a-s,y=Math.sqrt(h*h+x*x),d=y>d?y:d;let m=a,_=o,A,C,R=0,S,E;for(h=0;h<o;h+=1)for(x=0;x<a;x+=1)w=h-l,v=x-s,A=Math.sqrt(w*w+v*v)*m/d,C=(Math.atan2(v,w)*180/Math.PI+360+R)%360,C=C*_/360,S=Math.floor(C),E=Math.floor(A),f=(E*o+S)*4,O=r[f+0],g=r[f+1],b=r[f+2],p=r[f+3],f=(x*o+h)*4,i[f+0]=O,i[f+1]=g,i[f+2]=b,i[f+3]=p},uR=function(t){const e=t.width,n=t.height;let r,i,o,a,l,s,f,h,x,w,v=Math.round(this.kaleidoscopePower());const O=Math.round(this.kaleidoscopeAngle()),g=Math.floor(e*(O%360)/360);if(v<1)return;const b=i4.Util.createCanvasElement();b.width=e,b.height=n;const p=b.getContext("2d").getImageData(0,0,e,n);i4.Util.releaseCanvas(b),lR(t,p,{polarCenterX:e/2,polarCenterY:n/2});let y=e/Math.pow(2,v);for(;y<=8;)y=y*2,v-=1;y=Math.ceil(y);let d=y,m=0,_=d,A=1;for(g+y>e&&(m=d,_=0,A=-1),i=0;i<n;i+=1)for(r=m;r!==_;r+=A)o=Math.round(r+g)%e,x=(e*i+o)*4,l=p.data[x+0],s=p.data[x+1],f=p.data[x+2],h=p.data[x+3],w=(e*i+r)*4,p.data[w+0]=l,p.data[w+1]=s,p.data[w+2]=f,p.data[w+3]=h;for(i=0;i<n;i+=1)for(d=Math.floor(y),a=0;a<v;a+=1){for(r=0;r<d+1;r+=1)x=(e*i+r)*4,l=p.data[x+0],s=p.data[x+1],f=p.data[x+2],h=p.data[x+3],w=(e*i+d*2-r-1)*4,p.data[w+0]=l,p.data[w+1]=s,p.data[w+2]=f,p.data[w+3]=h;d*=2}sR(p,t,{polarRotation:0})};Dp.Kaleidoscope=uR;Sh.Factory.addGetterSetter(D9.Node,"kaleidoscopePower",2,(0,j9.getNumberValidator)(),Sh.Factory.afterSetFilter);Sh.Factory.addGetterSetter(D9.Node,"kaleidoscopeAngle",0,(0,j9.getNumberValidator)(),Sh.Factory.afterSetFilter);var jp={};Object.defineProperty(jp,"__esModule",{value:!0});jp.Mask=void 0;const o4=ut,cR=qt,fR=Ze;function _d(t,e,n){let r=(n*t.width+e)*4;const i=[];return i.push(t.data[r++],t.data[r++],t.data[r++],t.data[r++]),i}function Bu(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function dR(t){const e=[0,0,0];for(let n=0;n<t.length;n++)e[0]+=t[n][0],e[1]+=t[n][1],e[2]+=t[n][2];return e[0]/=t.length,e[1]/=t.length,e[2]/=t.length,e}function hR(t,e){const n=_d(t,0,0),r=_d(t,t.width-1,0),i=_d(t,0,t.height-1),o=_d(t,t.width-1,t.height-1),a=e||10;if(Bu(n,r)<a&&Bu(r,o)<a&&Bu(o,i)<a&&Bu(i,n)<a){const l=dR([r,n,o,i]),s=[];for(let f=0;f<t.width*t.height;f++){const h=Bu(l,[t.data[f*4],t.data[f*4+1],t.data[f*4+2]]);s[f]=h<a?0:255}return s}}function pR(t,e){for(let n=0;n<t.width*t.height;n++)t.data[4*n+3]=e[n]}function gR(t,e,n){const r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[];for(let l=0;l<n;l++)for(let s=0;s<e;s++){const f=l*e+s;let h=0;for(let x=0;x<i;x++)for(let w=0;w<i;w++){const v=l+x-o,O=s+w-o;if(v>=0&&v<n&&O>=0&&O<e){const g=v*e+O,b=r[x*i+w];h+=t[g]*b}}a[f]=h===255*8?255:0}return a}function vR(t,e,n){const r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[];for(let l=0;l<n;l++)for(let s=0;s<e;s++){const f=l*e+s;let h=0;for(let x=0;x<i;x++)for(let w=0;w<i;w++){const v=l+x-o,O=s+w-o;if(v>=0&&v<n&&O>=0&&O<e){const g=v*e+O,b=r[x*i+w];h+=t[g]*b}}a[f]=h>=255*4?255:0}return a}function mR(t,e,n){const r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[];for(let l=0;l<n;l++)for(let s=0;s<e;s++){const f=l*e+s;let h=0;for(let x=0;x<i;x++)for(let w=0;w<i;w++){const v=l+x-o,O=s+w-o;if(v>=0&&v<n&&O>=0&&O<e){const g=v*e+O,b=r[x*i+w];h+=t[g]*b}}a[f]=h}return a}const yR=function(t){let e=this.threshold(),n=hR(t,e);return n&&(n=gR(n,t.width,t.height),n=vR(n,t.width,t.height),n=mR(n,t.width,t.height),pR(t,n)),t};jp.Mask=yR;o4.Factory.addGetterSetter(cR.Node,"threshold",0,(0,fR.getNumberValidator)(),o4.Factory.afterSetFilter);var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0});Fp.Noise=void 0;const a4=ut,bR=qt,_R=Ze,wR=function(t){const e=this.noise()*255,n=t.data,r=n.length,i=e/2;for(let o=0;o<r;o+=4)n[o+0]+=i-2*i*Math.random(),n[o+1]+=i-2*i*Math.random(),n[o+2]+=i-2*i*Math.random()};Fp.Noise=wR;a4.Factory.addGetterSetter(bR.Node,"noise",.2,(0,_R.getNumberValidator)(),a4.Factory.afterSetFilter);var zp={};Object.defineProperty(zp,"__esModule",{value:!0});zp.Pixelate=void 0;const l4=ut,SR=en,ER=qt,OR=Ze,xR=function(t){let e=Math.ceil(this.pixelSize()),n=t.width,r=t.height,i,o,a,l,s,f,h,x=Math.ceil(n/e),w=Math.ceil(r/e),v,O,g,b,p,y,d,m=t.data;if(e<=0){SR.Util.error("pixelSize value can not be <= 0");return}for(p=0;p<x;p+=1)for(y=0;y<w;y+=1){for(l=0,s=0,f=0,h=0,v=p*e,O=v+e,g=y*e,b=g+e,d=0,i=v;i<O;i+=1)if(!(i>=n))for(o=g;o<b;o+=1)o>=r||(a=(n*o+i)*4,l+=m[a+0],s+=m[a+1],f+=m[a+2],h+=m[a+3],d+=1);for(l=l/d,s=s/d,f=f/d,h=h/d,i=v;i<O;i+=1)if(!(i>=n))for(o=g;o<b;o+=1)o>=r||(a=(n*o+i)*4,m[a+0]=l,m[a+1]=s,m[a+2]=f,m[a+3]=h)}};zp.Pixelate=xR;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=ut,PR=qt,CR=Ze,kR=function(t){let e=Math.round(this.levels()*254)+1,n=t.data,r=n.length,i=255/e,o;for(o=0;o<r;o+=1)n[o]=Math.floor(n[o]/i)*i};Bp.Posterize=kR;s4.Factory.addGetterSetter(PR.Node,"levels",.5,(0,CR.getNumberValidator)(),s4.Factory.afterSetFilter);var Up={};Object.defineProperty(Up,"__esModule",{value:!0});Up.RGB=void 0;const Eh=ut,Yy=qt,TR=Ze,AR=function(t){let e=t.data,n=e.length,r=this.red(),i=this.green(),o=this.blue(),a,l;for(a=0;a<n;a+=4)l=(.34*e[a]+.5*e[a+1]+.16*e[a+2])/255,e[a]=l*r,e[a+1]=l*i,e[a+2]=l*o,e[a+3]=e[a+3]};Up.RGB=AR;Eh.Factory.addGetterSetter(Yy.Node,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});Eh.Factory.addGetterSetter(Yy.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});Eh.Factory.addGetterSetter(Yy.Node,"blue",0,TR.RGBComponent,Eh.Factory.afterSetFilter);var Hp={};Object.defineProperty(Hp,"__esModule",{value:!0});Hp.RGBA=void 0;const Cc=ut,$p=qt,RR=Ze,MR=function(t){const e=t.data,n=e.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha();for(let l=0;l<n;l+=4){const s=1-a;e[l]=r*a+e[l]*s,e[l+1]=i*a+e[l+1]*s,e[l+2]=o*a+e[l+2]*s}};Hp.RGBA=MR;Cc.Factory.addGetterSetter($p.Node,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});Cc.Factory.addGetterSetter($p.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});Cc.Factory.addGetterSetter($p.Node,"blue",0,RR.RGBComponent,Cc.Factory.afterSetFilter);Cc.Factory.addGetterSetter($p.Node,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0});Gp.Sepia=void 0;const LR=function(t){let e=t.data,n=e.length,r,i,o,a;for(r=0;r<n;r+=4)i=e[r+0],o=e[r+1],a=e[r+2],e[r+0]=Math.min(255,i*.393+o*.769+a*.189),e[r+1]=Math.min(255,i*.349+o*.686+a*.168),e[r+2]=Math.min(255,i*.272+o*.534+a*.131)};Gp.Sepia=LR;var Vp={};Object.defineProperty(Vp,"__esModule",{value:!0});Vp.Solarize=void 0;const NR=function(t){const e=t.data,n=t.width,r=t.height,i=n*4;let o=r;do{const a=(o-1)*i;let l=n;do{const s=a+(l-1)*4;let f=e[s],h=e[s+1],x=e[s+2];f>127&&(f=255-f),h>127&&(h=255-h),x>127&&(x=255-x),e[s]=f,e[s+1]=h,e[s+2]=x}while(--l)}while(--o)};Vp.Solarize=NR;var qp={};Object.defineProperty(qp,"__esModule",{value:!0});qp.Threshold=void 0;const u4=ut,IR=qt,DR=Ze,jR=function(t){const e=this.threshold()*255,n=t.data,r=n.length;for(let i=0;i<r;i+=1)n[i]=n[i]<e?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=bh,FR=lp,zR=cp,BR=hp,UR=pp,HR=gp,f4=Ds,$R=Yc,GR=tu,VR=Zc,qR=yp,WR=bp,YR=_p,KR=wp,XR=ru,ZR=Sp,QR=Ep,JR=Op,eM=Pp,tM=Cp,nM=kp,rM=Tp,iM=Rp,oM=Mp,aM=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:YR.Sprite,Star:KR.Star,Text:XR.Text,TextPath:ZR.TextPath,Transformer:QR.Transformer,Wedge:JR.Wedge,Filters:{Blur:eM.Blur,Brighten:tM.Brighten,Contrast:nM.Contrast,Emboss:rM.Emboss,Enhance:iM.Enhance,Grayscale:oM.Grayscale,HSL:aM.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 ki=Ny.exports,gm={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;var n=bh;Object.defineProperty(e,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=bh;t.exports=r.Konva})(gm,gm.exports);var wM=gm.exports;const kc=kh(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(e){var n={},r=Qe,i=qu,o=Object.assign;function a(u){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+u,k=1;k<arguments.length;k++)c+="&args[]="+encodeURIComponent(arguments[k]);return"Minified React error #"+u+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,s=Symbol.for("react.element"),f=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),O=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),_=Symbol.iterator;function A(u){return u===null||typeof u!="object"?null:(u=_&&u[_]||u["@@iterator"],typeof u=="function"?u:null)}function C(u){if(u==null)return null;if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case h:return"Fragment";case f:return"Portal";case w:return"Profiler";case x:return"StrictMode";case b:return"Suspense";case p:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case O:return(u.displayName||"Context")+".Consumer";case v:return(u._context.displayName||"Context")+".Provider";case g:var c=u.render;return u=u.displayName,u||(u=c.displayName||c.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case y:return c=u.displayName||null,c!==null?c:C(u.type)||"Memo";case d:c=u._payload,u=u._init;try{return C(u(c))}catch{}}return null}function R(u){var c=u.type;switch(u.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 u=c.render,u=u.displayName||u.name||"",c.displayName||(u!==""?"ForwardRef("+u+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return C(c);case 8:return c===x?"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(u){var c=u,k=u;if(u.alternate)for(;c.return;)c=c.return;else{u=c;do c=u,c.flags&4098&&(k=c.return),u=c.return;while(u)}return c.tag===3?k:null}function E(u){if(S(u)!==u)throw Error(a(188))}function P(u){var c=u.alternate;if(!c){if(c=S(u),c===null)throw Error(a(188));return c!==u?null:u}for(var k=u,I=c;;){var j=k.return;if(j===null)break;var q=j.alternate;if(q===null){if(I=j.return,I!==null){k=I;continue}break}if(j.child===q.child){for(q=j.child;q;){if(q===k)return E(j),u;if(q===I)return E(j),c;q=q.sibling}throw Error(a(188))}if(k.return!==I.return)k=j,I=q;else{for(var ee=!1,le=j.child;le;){if(le===k){ee=!0,k=j,I=q;break}if(le===I){ee=!0,I=j,k=q;break}le=le.sibling}if(!ee){for(le=q.child;le;){if(le===k){ee=!0,k=q,I=j;break}if(le===I){ee=!0,I=q,k=j;break}le=le.sibling}if(!ee)throw Error(a(189))}}if(k.alternate!==I)throw Error(a(190))}if(k.tag!==3)throw Error(a(188));return k.stateNode.current===k?u:c}function T(u){return u=P(u),u!==null?N(u):null}function N(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){var c=N(u);if(c!==null)return c;u=u.sibling}return null}function U(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){if(u.tag!==4){var c=U(u);if(c!==null)return c}u=u.sibling}return null}var G=Array.isArray,Z=e.getPublicInstance,W=e.getRootHostContext,H=e.getChildHostContext,L=e.prepareForCommit,M=e.resetAfterCommit,D=e.createInstance,B=e.appendInitialChild,V=e.finalizeInitialChildren,Y=e.prepareUpdate,F=e.shouldSetTextContent,$=e.createTextInstance,z=e.scheduleTimeout,K=e.cancelTimeout,X=e.noTimeout,Q=e.isPrimaryRenderer,J=e.supportsMutation,ne=e.supportsPersistence,ie=e.supportsHydration,oe=e.getInstanceFromNode,de=e.preparePortalMount,me=e.getCurrentEventPriority,Pe=e.detachDeletedInstance,re=e.supportsMicrotasks,ae=e.scheduleMicrotask,we=e.supportsTestSelectors,be=e.findFiberRoot,te=e.getBoundingRect,fe=e.getTextContent,he=e.isHiddenSubtree,Ee=e.matchAccessibilityRole,Ve=e.setFocusIfFocusable,Je=e.setupIntersectionObserver,Ae=e.appendChild,Ce=e.appendChildToContainer,Me=e.commitTextUpdate,ze=e.commitMount,We=e.commitUpdate,St=e.insertBefore,mt=e.insertInContainerBefore,ue=e.removeChild,ce=e.removeChildFromContainer,Se=e.resetTextContent,Le=e.hideInstance,Ne=e.hideTextInstance,ge=e.unhideInstance,Xe=e.unhideTextInstance,Oe=e.clearContainer,$e=e.cloneInstance,Wt=e.createContainerChildSet,Tt=e.appendChildToContainerChildSet,Yt=e.finalizeContainerChildren,ke=e.replaceContainerChildren,Ye=e.cloneHiddenInstance,at=e.cloneHiddenTextInstance,Ot=e.canHydrateInstance,xt=e.canHydrateTextInstance,un=e.canHydrateSuspenseInstance,hn=e.isSuspenseInstancePending,pn=e.isSuspenseInstanceFallback,rr=e.getSuspenseInstanceFallbackErrorDetails,to=e.registerSuspenseInstanceRetry,wr=e.getNextHydratableSibling,Ie=e.getFirstHydratableChild,et=e.getFirstHydratableChildWithinContainer,ft=e.getFirstHydratableChildWithinSuspenseInstance,Ft=e.hydrateInstance,Pt=e.hydrateTextInstance,Bn=e.hydrateSuspenseInstance,xn=e.getNextHydratableInstanceAfterSuspenseInstance,tn=e.commitHydratedContainer,ri=e.commitHydratedSuspenseInstance,Sr=e.clearSuspenseBoundary,no=e.clearSuspenseBoundaryFromContainer,jo=e.shouldDeleteUnhydratedTailInstances,cu=e.didNotMatchHydratedContainerTextInstance,Da=e.didNotMatchHydratedTextInstance,ro;function Dr(u){if(ro===void 0)try{throw Error()}catch(k){var c=k.stack.trim().match(/\n( *(at )?)/);ro=c&&c[1]||""}return`
52
- `+ro+u}var Nl=!1;function Il(u,c){if(!u||Nl)return"";Nl=!0;var k=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(Te){var I=Te}Reflect.construct(u,[],c)}else{try{c.call()}catch(Te){I=Te}u.call(c.prototype)}else{try{throw Error()}catch(Te){I=Te}u()}}catch(Te){if(Te&&I&&typeof Te.stack=="string"){for(var j=Te.stack.split(`
53
- `),q=I.stack.split(`
54
- `),ee=j.length-1,le=q.length-1;1<=ee&&0<=le&&j[ee]!==q[le];)le--;for(;1<=ee&&0<=le;ee--,le--)if(j[ee]!==q[le]){if(ee!==1||le!==1)do if(ee--,le--,0>le||j[ee]!==q[le]){var ve=`
55
- `+j[ee].replace(" at new "," at ");return u.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",u.displayName)),ve}while(1<=ee&&0<=le);break}}}finally{Nl=!1,Error.prepareStackTrace=k}return(u=u?u.displayName||u.name:"")?Dr(u):""}var NS=Object.prototype.hasOwnProperty,n0=[],Dl=-1;function Fo(u){return{current:u}}function zt(u){0>Dl||(u.current=n0[Dl],n0[Dl]=null,Dl--)}function Nt(u,c){Dl++,n0[Dl]=u.current,u.current=c}var zo={},Un=Fo(zo),ir=Fo(!1),ja=zo;function jl(u,c){var k=u.type.contextTypes;if(!k)return zo;var I=u.stateNode;if(I&&I.__reactInternalMemoizedUnmaskedChildContext===c)return I.__reactInternalMemoizedMaskedChildContext;var j={},q;for(q in k)j[q]=c[q];return I&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=c,u.__reactInternalMemoizedMaskedChildContext=j),j}function or(u){return u=u.childContextTypes,u!=null}function rf(){zt(ir),zt(Un)}function P2(u,c,k){if(Un.current!==zo)throw Error(a(168));Nt(Un,c),Nt(ir,k)}function C2(u,c,k){var I=u.stateNode;if(c=c.childContextTypes,typeof I.getChildContext!="function")return k;I=I.getChildContext();for(var j in I)if(!(j in c))throw Error(a(108,R(u)||"Unknown",j));return o({},k,I)}function of(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||zo,ja=Un.current,Nt(Un,u),Nt(ir,ir.current),!0}function k2(u,c,k){var I=u.stateNode;if(!I)throw Error(a(169));k?(u=C2(u,c,ja),I.__reactInternalMemoizedMergedChildContext=u,zt(ir),zt(Un),Nt(Un,u)):zt(ir),Nt(ir,k)}var ii=Math.clz32?Math.clz32:jS,IS=Math.log,DS=Math.LN2;function jS(u){return u>>>=0,u===0?32:31-(IS(u)/DS|0)|0}var af=64,lf=4194304;function fu(u){switch(u&-u){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 u&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return u&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return u}}function sf(u,c){var k=u.pendingLanes;if(k===0)return 0;var I=0,j=u.suspendedLanes,q=u.pingedLanes,ee=k&268435455;if(ee!==0){var le=ee&~j;le!==0?I=fu(le):(q&=ee,q!==0&&(I=fu(q)))}else ee=k&~j,ee!==0?I=fu(ee):q!==0&&(I=fu(q));if(I===0)return 0;if(c!==0&&c!==I&&!(c&j)&&(j=I&-I,q=c&-c,j>=q||j===16&&(q&4194240)!==0))return c;if(I&4&&(I|=k&16),c=u.entangledLanes,c!==0)for(u=u.entanglements,c&=I;0<c;)k=31-ii(c),j=1<<k,I|=u[k],c&=~j;return I}function FS(u,c){switch(u){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(u,c){for(var k=u.suspendedLanes,I=u.pingedLanes,j=u.expirationTimes,q=u.pendingLanes;0<q;){var ee=31-ii(q),le=1<<ee,ve=j[ee];ve===-1?(!(le&k)||le&I)&&(j[ee]=FS(le,c)):ve<=c&&(u.expiredLanes|=le),q&=~le}}function r0(u){return u=u.pendingLanes&-1073741825,u!==0?u:u&1073741824?1073741824:0}function T2(){var u=af;return af<<=1,!(af&4194240)&&(af=64),u}function i0(u){for(var c=[],k=0;31>k;k++)c.push(u);return c}function du(u,c,k){u.pendingLanes|=c,c!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,c=31-ii(c),u[c]=k}function BS(u,c){var k=u.pendingLanes&~c;u.pendingLanes=c,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=c,u.mutableReadLanes&=c,u.entangledLanes&=c,c=u.entanglements;var I=u.eventTimes;for(u=u.expirationTimes;0<k;){var j=31-ii(k),q=1<<j;c[j]=0,I[j]=-1,u[j]=-1,k&=~q}}function o0(u,c){var k=u.entangledLanes|=c;for(u=u.entanglements;k;){var I=31-ii(k),j=1<<I;j&c|u[I]&c&&(u[I]|=c),k&=~j}}var yt=0;function A2(u){return u&=-u,1<u?4<u?u&268435455?16:536870912:4:1}var a0=i.unstable_scheduleCallback,R2=i.unstable_cancelCallback,US=i.unstable_shouldYield,HS=i.unstable_requestPaint,Pn=i.unstable_now,l0=i.unstable_ImmediatePriority,$S=i.unstable_UserBlockingPriority,s0=i.unstable_NormalPriority,GS=i.unstable_IdlePriority,uf=null,Ti=null;function VS(u){if(Ti&&typeof Ti.onCommitFiberRoot=="function")try{Ti.onCommitFiberRoot(uf,u,void 0,(u.current.flags&128)===128)}catch{}}function qS(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var oi=typeof Object.is=="function"?Object.is:qS,io=null,cf=!1,u0=!1;function M2(u){io===null?io=[u]:io.push(u)}function WS(u){cf=!0,M2(u)}function Ai(){if(!u0&&io!==null){u0=!0;var u=0,c=yt;try{var k=io;for(yt=1;u<k.length;u++){var I=k[u];do I=I(!0);while(I!==null)}io=null,cf=!1}catch(j){throw io!==null&&(io=io.slice(u+1)),a0(l0,Ai),j}finally{yt=c,u0=!1}}return null}var Fl=[],zl=0,ff=null,df=0,jr=[],Fr=0,Fa=null,oo=1,ao="";function za(u,c){Fl[zl++]=df,Fl[zl++]=ff,ff=u,df=c}function L2(u,c,k){jr[Fr++]=oo,jr[Fr++]=ao,jr[Fr++]=Fa,Fa=u;var I=oo;u=ao;var j=32-ii(I)-1;I&=~(1<<j),k+=1;var q=32-ii(c)+j;if(30<q){var ee=j-j%5;q=(I&(1<<ee)-1).toString(32),I>>=ee,j-=ee,oo=1<<32-ii(c)+j|k<<j|I,ao=q+u}else oo=1<<q|k<<j|I,ao=u}function c0(u){u.return!==null&&(za(u,1),L2(u,1,0))}function f0(u){for(;u===ff;)ff=Fl[--zl],Fl[zl]=null,df=Fl[--zl],Fl[zl]=null;for(;u===Fa;)Fa=jr[--Fr],jr[Fr]=null,ao=jr[--Fr],jr[Fr]=null,oo=jr[--Fr],jr[Fr]=null}var Er=null,zr=null,$t=!1,hu=!1,ai=null;function N2(u,c){var k=Gr(5,null,null,0);k.elementType="DELETED",k.stateNode=c,k.return=u,c=u.deletions,c===null?(u.deletions=[k],u.flags|=16):c.push(k)}function I2(u,c){switch(u.tag){case 5:return c=Ot(c,u.type,u.pendingProps),c!==null?(u.stateNode=c,Er=u,zr=Ie(c),!0):!1;case 6:return c=xt(c,u.pendingProps),c!==null?(u.stateNode=c,Er=u,zr=null,!0):!1;case 13:if(c=un(c),c!==null){var k=Fa!==null?{id:oo,overflow:ao}:null;return u.memoizedState={dehydrated:c,treeContext:k,retryLane:1073741824},k=Gr(18,null,null,0),k.stateNode=c,k.return=u,u.child=k,Er=u,zr=null,!0}return!1;default:return!1}}function d0(u){return(u.mode&1)!==0&&(u.flags&128)===0}function h0(u){if($t){var c=zr;if(c){var k=c;if(!I2(u,c)){if(d0(u))throw Error(a(418));c=wr(k);var I=Er;c&&I2(u,c)?N2(I,k):(u.flags=u.flags&-4097|2,$t=!1,Er=u)}}else{if(d0(u))throw Error(a(418));u.flags=u.flags&-4097|2,$t=!1,Er=u}}}function D2(u){for(u=u.return;u!==null&&u.tag!==5&&u.tag!==3&&u.tag!==13;)u=u.return;Er=u}function hf(u){if(!ie||u!==Er)return!1;if(!$t)return D2(u),$t=!0,!1;if(u.tag!==3&&(u.tag!==5||jo(u.type)&&!F(u.type,u.memoizedProps))){var c=zr;if(c){if(d0(u))throw j2(),Error(a(418));for(;c;)N2(u,c),c=wr(c)}}if(D2(u),u.tag===13){if(!ie)throw Error(a(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(a(317));zr=xn(u)}else zr=Er?wr(u.stateNode):null;return!0}function j2(){for(var u=zr;u;)u=wr(u)}function Bl(){ie&&(zr=Er=null,hu=$t=!1)}function p0(u){ai===null?ai=[u]:ai.push(u)}var YS=l.ReactCurrentBatchConfig;function pf(u,c){if(oi(u,c))return!0;if(typeof u!="object"||u===null||typeof c!="object"||c===null)return!1;var k=Object.keys(u),I=Object.keys(c);if(k.length!==I.length)return!1;for(I=0;I<k.length;I++){var j=k[I];if(!NS.call(c,j)||!oi(u[j],c[j]))return!1}return!0}function KS(u){switch(u.tag){case 5:return Dr(u.type);case 16:return Dr("Lazy");case 13:return Dr("Suspense");case 19:return Dr("SuspenseList");case 0:case 2:case 15:return u=Il(u.type,!1),u;case 11:return u=Il(u.type.render,!1),u;case 1:return u=Il(u.type,!0),u;default:return""}}function pu(u,c,k){if(u=k.ref,u!==null&&typeof u!="function"&&typeof u!="object"){if(k._owner){if(k=k._owner,k){if(k.tag!==1)throw Error(a(309));var I=k.stateNode}if(!I)throw Error(a(147,u));var j=I,q=""+u;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===q?c.ref:(c=function(ee){var le=j.refs;ee===null?delete le[q]:le[q]=ee},c._stringRef=q,c)}if(typeof u!="string")throw Error(a(284));if(!k._owner)throw Error(a(290,u))}return u}function gf(u,c){throw u=Object.prototype.toString.call(c),Error(a(31,u==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":u))}function F2(u){var c=u._init;return c(u._payload)}function z2(u){function c(pe,se){if(u){var ye=pe.deletions;ye===null?(pe.deletions=[se],pe.flags|=16):ye.push(se)}}function k(pe,se){if(!u)return null;for(;se!==null;)c(pe,se),se=se.sibling;return null}function I(pe,se){for(pe=new Map;se!==null;)se.key!==null?pe.set(se.key,se):pe.set(se.index,se),se=se.sibling;return pe}function j(pe,se){return pe=qo(pe,se),pe.index=0,pe.sibling=null,pe}function q(pe,se,ye){return pe.index=ye,u?(ye=pe.alternate,ye!==null?(ye=ye.index,ye<se?(pe.flags|=2,se):ye):(pe.flags|=2,se)):(pe.flags|=1048576,se)}function ee(pe){return u&&pe.alternate===null&&(pe.flags|=2),pe}function le(pe,se,ye,je){return se===null||se.tag!==6?(se=u1(ye,pe.mode,je),se.return=pe,se):(se=j(se,ye),se.return=pe,se)}function ve(pe,se,ye,je){var Ke=ye.type;return Ke===h?He(pe,se,ye.props.children,je,ye.key):se!==null&&(se.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===d&&F2(Ke)===se.type)?(je=j(se,ye.props),je.ref=pu(pe,se,ye),je.return=pe,je):(je=qf(ye.type,ye.key,ye.props,null,pe.mode,je),je.ref=pu(pe,se,ye),je.return=pe,je)}function Te(pe,se,ye,je){return se===null||se.tag!==4||se.stateNode.containerInfo!==ye.containerInfo||se.stateNode.implementation!==ye.implementation?(se=c1(ye,pe.mode,je),se.return=pe,se):(se=j(se,ye.children||[]),se.return=pe,se)}function He(pe,se,ye,je,Ke){return se===null||se.tag!==7?(se=qa(ye,pe.mode,je,Ke),se.return=pe,se):(se=j(se,ye),se.return=pe,se)}function nt(pe,se,ye){if(typeof se=="string"&&se!==""||typeof se=="number")return se=u1(""+se,pe.mode,ye),se.return=pe,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case s:return ye=qf(se.type,se.key,se.props,null,pe.mode,ye),ye.ref=pu(pe,null,se),ye.return=pe,ye;case f:return se=c1(se,pe.mode,ye),se.return=pe,se;case d:var je=se._init;return nt(pe,je(se._payload),ye)}if(G(se)||A(se))return se=qa(se,pe.mode,ye,null),se.return=pe,se;gf(pe,se)}return null}function De(pe,se,ye,je){var Ke=se!==null?se.key:null;if(typeof ye=="string"&&ye!==""||typeof ye=="number")return Ke!==null?null:le(pe,se,""+ye,je);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case s:return ye.key===Ke?ve(pe,se,ye,je):null;case f:return ye.key===Ke?Te(pe,se,ye,je):null;case d:return Ke=ye._init,De(pe,se,Ke(ye._payload),je)}if(G(ye)||A(ye))return Ke!==null?null:He(pe,se,ye,je,null);gf(pe,ye)}return null}function Bt(pe,se,ye,je,Ke){if(typeof je=="string"&&je!==""||typeof je=="number")return pe=pe.get(ye)||null,le(se,pe,""+je,Ke);if(typeof je=="object"&&je!==null){switch(je.$$typeof){case s:return pe=pe.get(je.key===null?ye:je.key)||null,ve(se,pe,je,Ke);case f:return pe=pe.get(je.key===null?ye:je.key)||null,Te(se,pe,je,Ke);case d:var lt=je._init;return Bt(pe,se,ye,lt(je._payload),Ke)}if(G(je)||A(je))return pe=pe.get(ye)||null,He(se,pe,je,Ke,null);gf(se,je)}return null}function Mt(pe,se,ye,je){for(var Ke=null,lt=null,rt=se,bt=se=0,Tn=null;rt!==null&&bt<ye.length;bt++){rt.index>bt?(Tn=rt,rt=null):Tn=rt.sibling;var _t=De(pe,rt,ye[bt],je);if(_t===null){rt===null&&(rt=Tn);break}u&&rt&&_t.alternate===null&&c(pe,rt),se=q(_t,se,bt),lt===null?Ke=_t:lt.sibling=_t,lt=_t,rt=Tn}if(bt===ye.length)return k(pe,rt),$t&&za(pe,bt),Ke;if(rt===null){for(;bt<ye.length;bt++)rt=nt(pe,ye[bt],je),rt!==null&&(se=q(rt,se,bt),lt===null?Ke=rt:lt.sibling=rt,lt=rt);return $t&&za(pe,bt),Ke}for(rt=I(pe,rt);bt<ye.length;bt++)Tn=Bt(rt,pe,bt,ye[bt],je),Tn!==null&&(u&&Tn.alternate!==null&&rt.delete(Tn.key===null?bt:Tn.key),se=q(Tn,se,bt),lt===null?Ke=Tn:lt.sibling=Tn,lt=Tn);return u&&rt.forEach(function(Wo){return c(pe,Wo)}),$t&&za(pe,bt),Ke}function ur(pe,se,ye,je){var Ke=A(ye);if(typeof Ke!="function")throw Error(a(150));if(ye=Ke.call(ye),ye==null)throw Error(a(151));for(var lt=Ke=null,rt=se,bt=se=0,Tn=null,_t=ye.next();rt!==null&&!_t.done;bt++,_t=ye.next()){rt.index>bt?(Tn=rt,rt=null):Tn=rt.sibling;var Wo=De(pe,rt,_t.value,je);if(Wo===null){rt===null&&(rt=Tn);break}u&&rt&&Wo.alternate===null&&c(pe,rt),se=q(Wo,se,bt),lt===null?Ke=Wo:lt.sibling=Wo,lt=Wo,rt=Tn}if(_t.done)return k(pe,rt),$t&&za(pe,bt),Ke;if(rt===null){for(;!_t.done;bt++,_t=ye.next())_t=nt(pe,_t.value,je),_t!==null&&(se=q(_t,se,bt),lt===null?Ke=_t:lt.sibling=_t,lt=_t);return $t&&za(pe,bt),Ke}for(rt=I(pe,rt);!_t.done;bt++,_t=ye.next())_t=Bt(rt,pe,bt,_t.value,je),_t!==null&&(u&&_t.alternate!==null&&rt.delete(_t.key===null?bt:_t.key),se=q(_t,se,bt),lt===null?Ke=_t:lt.sibling=_t,lt=_t);return u&&rt.forEach(function(xE){return c(pe,xE)}),$t&&za(pe,bt),Ke}function co(pe,se,ye,je){if(typeof ye=="object"&&ye!==null&&ye.type===h&&ye.key===null&&(ye=ye.props.children),typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case s:e:{for(var Ke=ye.key,lt=se;lt!==null;){if(lt.key===Ke){if(Ke=ye.type,Ke===h){if(lt.tag===7){k(pe,lt.sibling),se=j(lt,ye.props.children),se.return=pe,pe=se;break e}}else if(lt.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===d&&F2(Ke)===lt.type){k(pe,lt.sibling),se=j(lt,ye.props),se.ref=pu(pe,lt,ye),se.return=pe,pe=se;break e}k(pe,lt);break}else c(pe,lt);lt=lt.sibling}ye.type===h?(se=qa(ye.props.children,pe.mode,je,ye.key),se.return=pe,pe=se):(je=qf(ye.type,ye.key,ye.props,null,pe.mode,je),je.ref=pu(pe,se,ye),je.return=pe,pe=je)}return ee(pe);case f:e:{for(lt=ye.key;se!==null;){if(se.key===lt)if(se.tag===4&&se.stateNode.containerInfo===ye.containerInfo&&se.stateNode.implementation===ye.implementation){k(pe,se.sibling),se=j(se,ye.children||[]),se.return=pe,pe=se;break e}else{k(pe,se);break}else c(pe,se);se=se.sibling}se=c1(ye,pe.mode,je),se.return=pe,pe=se}return ee(pe);case d:return lt=ye._init,co(pe,se,lt(ye._payload),je)}if(G(ye))return Mt(pe,se,ye,je);if(A(ye))return ur(pe,se,ye,je);gf(pe,ye)}return typeof ye=="string"&&ye!==""||typeof ye=="number"?(ye=""+ye,se!==null&&se.tag===6?(k(pe,se.sibling),se=j(se,ye),se.return=pe,pe=se):(k(pe,se),se=u1(ye,pe.mode,je),se.return=pe,pe=se),ee(pe)):k(pe,se)}return co}var Ul=z2(!0),B2=z2(!1),vf=Fo(null),mf=null,Hl=null,g0=null;function v0(){g0=Hl=mf=null}function U2(u,c,k){Q?(Nt(vf,c._currentValue),c._currentValue=k):(Nt(vf,c._currentValue2),c._currentValue2=k)}function m0(u){var c=vf.current;zt(vf),Q?u._currentValue=c:u._currentValue2=c}function y0(u,c,k){for(;u!==null;){var I=u.alternate;if((u.childLanes&c)!==c?(u.childLanes|=c,I!==null&&(I.childLanes|=c)):I!==null&&(I.childLanes&c)!==c&&(I.childLanes|=c),u===k)break;u=u.return}}function $l(u,c){mf=u,g0=Hl=null,u=u.dependencies,u!==null&&u.firstContext!==null&&(u.lanes&c&&(ar=!0),u.firstContext=null)}function Br(u){var c=Q?u._currentValue:u._currentValue2;if(g0!==u)if(u={context:u,memoizedValue:c,next:null},Hl===null){if(mf===null)throw Error(a(308));Hl=u,mf.dependencies={lanes:0,firstContext:u}}else Hl=Hl.next=u;return c}var Ba=null;function b0(u){Ba===null?Ba=[u]:Ba.push(u)}function H2(u,c,k,I){var j=c.interleaved;return j===null?(k.next=k,b0(c)):(k.next=j.next,j.next=k),c.interleaved=k,Ri(u,I)}function Ri(u,c){u.lanes|=c;var k=u.alternate;for(k!==null&&(k.lanes|=c),k=u,u=u.return;u!==null;)u.childLanes|=c,k=u.alternate,k!==null&&(k.childLanes|=c),k=u,u=u.return;return k.tag===3?k.stateNode:null}var Bo=!1;function _0(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $2(u,c){u=u.updateQueue,c.updateQueue===u&&(c.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,effects:u.effects})}function lo(u,c){return{eventTime:u,lane:c,tag:0,payload:null,callback:null,next:null}}function Uo(u,c,k){var I=u.updateQueue;if(I===null)return null;if(I=I.shared,ct&2){var j=I.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),I.pending=c,Ri(u,k)}return j=I.interleaved,j===null?(c.next=c,b0(I)):(c.next=j.next,j.next=c),I.interleaved=c,Ri(u,k)}function yf(u,c,k){if(c=c.updateQueue,c!==null&&(c=c.shared,(k&4194240)!==0)){var I=c.lanes;I&=u.pendingLanes,k|=I,c.lanes=k,o0(u,k)}}function G2(u,c){var k=u.updateQueue,I=u.alternate;if(I!==null&&(I=I.updateQueue,k===I)){var j=null,q=null;if(k=k.firstBaseUpdate,k!==null){do{var ee={eventTime:k.eventTime,lane:k.lane,tag:k.tag,payload:k.payload,callback:k.callback,next:null};q===null?j=q=ee:q=q.next=ee,k=k.next}while(k!==null);q===null?j=q=c:q=q.next=c}else j=q=c;k={baseState:I.baseState,firstBaseUpdate:j,lastBaseUpdate:q,shared:I.shared,effects:I.effects},u.updateQueue=k;return}u=k.lastBaseUpdate,u===null?k.firstBaseUpdate=c:u.next=c,k.lastBaseUpdate=c}function bf(u,c,k,I){var j=u.updateQueue;Bo=!1;var q=j.firstBaseUpdate,ee=j.lastBaseUpdate,le=j.shared.pending;if(le!==null){j.shared.pending=null;var ve=le,Te=ve.next;ve.next=null,ee===null?q=Te:ee.next=Te,ee=ve;var He=u.alternate;He!==null&&(He=He.updateQueue,le=He.lastBaseUpdate,le!==ee&&(le===null?He.firstBaseUpdate=Te:le.next=Te,He.lastBaseUpdate=ve))}if(q!==null){var nt=j.baseState;ee=0,He=Te=ve=null,le=q;do{var De=le.lane,Bt=le.eventTime;if((I&De)===De){He!==null&&(He=He.next={eventTime:Bt,lane:0,tag:le.tag,payload:le.payload,callback:le.callback,next:null});e:{var Mt=u,ur=le;switch(De=c,Bt=k,ur.tag){case 1:if(Mt=ur.payload,typeof Mt=="function"){nt=Mt.call(Bt,nt,De);break e}nt=Mt;break e;case 3:Mt.flags=Mt.flags&-65537|128;case 0:if(Mt=ur.payload,De=typeof Mt=="function"?Mt.call(Bt,nt,De):Mt,De==null)break e;nt=o({},nt,De);break e;case 2:Bo=!0}}le.callback!==null&&le.lane!==0&&(u.flags|=64,De=j.effects,De===null?j.effects=[le]:De.push(le))}else Bt={eventTime:Bt,lane:De,tag:le.tag,payload:le.payload,callback:le.callback,next:null},He===null?(Te=He=Bt,ve=nt):He=He.next=Bt,ee|=De;if(le=le.next,le===null){if(le=j.shared.pending,le===null)break;De=le,le=De.next,De.next=null,j.lastBaseUpdate=De,j.shared.pending=null}}while(!0);if(He===null&&(ve=nt),j.baseState=ve,j.firstBaseUpdate=Te,j.lastBaseUpdate=He,c=j.shared.interleaved,c!==null){j=c;do ee|=j.lane,j=j.next;while(j!==c)}else q===null&&(j.shared.lanes=0);Ha|=ee,u.lanes=ee,u.memoizedState=nt}}function V2(u,c,k){if(u=c.effects,c.effects=null,u!==null)for(c=0;c<u.length;c++){var I=u[c],j=I.callback;if(j!==null){if(I.callback=null,I=k,typeof j!="function")throw Error(a(191,j));j.call(I)}}}var gu={},Ur=Fo(gu),vu=Fo(gu),Gl=Fo(gu);function Mi(u){if(u===gu)throw Error(a(174));return u}function w0(u,c){Nt(Gl,c),Nt(vu,u),Nt(Ur,gu),u=W(c),zt(Ur),Nt(Ur,u)}function Vl(){zt(Ur),zt(vu),zt(Gl)}function q2(u){var c=Mi(Gl.current),k=Mi(Ur.current);c=H(k,u.type,c),k!==c&&(Nt(vu,u),Nt(Ur,c))}function S0(u){vu.current===u&&(zt(Ur),zt(vu))}var Kt=Fo(0);function _f(u){for(var c=u;c!==null;){if(c.tag===13){var k=c.memoizedState;if(k!==null&&(k=k.dehydrated,k===null||hn(k)||pn(k)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break;for(;c.sibling===null;){if(c.return===null||c.return===u)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var E0=[];function O0(){for(var u=0;u<E0.length;u++){var c=E0[u];Q?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}E0.length=0}var wf=l.ReactCurrentDispatcher,x0=l.ReactCurrentBatchConfig,Ua=0,Xt=null,gn=null,Cn=null,Sf=!1,mu=!1,yu=0,XS=0;function Hn(){throw Error(a(321))}function P0(u,c){if(c===null)return!1;for(var k=0;k<c.length&&k<u.length;k++)if(!oi(u[k],c[k]))return!1;return!0}function C0(u,c,k,I,j,q){if(Ua=q,Xt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,wf.current=u===null||u.memoizedState===null?eE:tE,u=k(I,j),mu){q=0;do{if(mu=!1,yu=0,25<=q)throw Error(a(301));q+=1,Cn=gn=null,c.updateQueue=null,wf.current=nE,u=k(I,j)}while(mu)}if(wf.current=xf,c=gn!==null&&gn.next!==null,Ua=0,Cn=gn=Xt=null,Sf=!1,c)throw Error(a(300));return u}function k0(){var u=yu!==0;return yu=0,u}function Li(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Cn===null?Xt.memoizedState=Cn=u:Cn=Cn.next=u,Cn}function Hr(){if(gn===null){var u=Xt.alternate;u=u!==null?u.memoizedState:null}else u=gn.next;var c=Cn===null?Xt.memoizedState:Cn.next;if(c!==null)Cn=c,gn=u;else{if(u===null)throw Error(a(310));gn=u,u={memoizedState:gn.memoizedState,baseState:gn.baseState,baseQueue:gn.baseQueue,queue:gn.queue,next:null},Cn===null?Xt.memoizedState=Cn=u:Cn=Cn.next=u}return Cn}function bu(u,c){return typeof c=="function"?c(u):c}function T0(u){var c=Hr(),k=c.queue;if(k===null)throw Error(a(311));k.lastRenderedReducer=u;var I=gn,j=I.baseQueue,q=k.pending;if(q!==null){if(j!==null){var ee=j.next;j.next=q.next,q.next=ee}I.baseQueue=j=q,k.pending=null}if(j!==null){q=j.next,I=I.baseState;var le=ee=null,ve=null,Te=q;do{var He=Te.lane;if((Ua&He)===He)ve!==null&&(ve=ve.next={lane:0,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null}),I=Te.hasEagerState?Te.eagerState:u(I,Te.action);else{var nt={lane:He,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null};ve===null?(le=ve=nt,ee=I):ve=ve.next=nt,Xt.lanes|=He,Ha|=He}Te=Te.next}while(Te!==null&&Te!==q);ve===null?ee=I:ve.next=le,oi(I,c.memoizedState)||(ar=!0),c.memoizedState=I,c.baseState=ee,c.baseQueue=ve,k.lastRenderedState=I}if(u=k.interleaved,u!==null){j=u;do q=j.lane,Xt.lanes|=q,Ha|=q,j=j.next;while(j!==u)}else j===null&&(k.lanes=0);return[c.memoizedState,k.dispatch]}function A0(u){var c=Hr(),k=c.queue;if(k===null)throw Error(a(311));k.lastRenderedReducer=u;var I=k.dispatch,j=k.pending,q=c.memoizedState;if(j!==null){k.pending=null;var ee=j=j.next;do q=u(q,ee.action),ee=ee.next;while(ee!==j);oi(q,c.memoizedState)||(ar=!0),c.memoizedState=q,c.baseQueue===null&&(c.baseState=q),k.lastRenderedState=q}return[q,I]}function W2(){}function Y2(u,c){var k=Xt,I=Hr(),j=c(),q=!oi(I.memoizedState,j);if(q&&(I.memoizedState=j,ar=!0),I=I.queue,R0(Z2.bind(null,k,I,u),[u]),I.getSnapshot!==c||q||Cn!==null&&Cn.memoizedState.tag&1){if(k.flags|=2048,_u(9,X2.bind(null,k,I,j,c),void 0,null),kn===null)throw Error(a(349));Ua&30||K2(k,c,j)}return j}function K2(u,c,k){u.flags|=16384,u={getSnapshot:c,value:k},c=Xt.updateQueue,c===null?(c={lastEffect:null,stores:null},Xt.updateQueue=c,c.stores=[u]):(k=c.stores,k===null?c.stores=[u]:k.push(u))}function X2(u,c,k,I){c.value=k,c.getSnapshot=I,Q2(c)&&J2(u)}function Z2(u,c,k){return k(function(){Q2(c)&&J2(u)})}function Q2(u){var c=u.getSnapshot;u=u.value;try{var k=c();return!oi(u,k)}catch{return!0}}function J2(u){var c=Ri(u,1);c!==null&&$r(c,u,1,-1)}function eb(u){var c=Li();return typeof u=="function"&&(u=u()),c.memoizedState=c.baseState=u,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bu,lastRenderedState:u},c.queue=u,u=u.dispatch=JS.bind(null,Xt,u),[c.memoizedState,u]}function _u(u,c,k,I){return u={tag:u,create:c,destroy:k,deps:I,next:null},c=Xt.updateQueue,c===null?(c={lastEffect:null,stores:null},Xt.updateQueue=c,c.lastEffect=u.next=u):(k=c.lastEffect,k===null?c.lastEffect=u.next=u:(I=k.next,k.next=u,u.next=I,c.lastEffect=u)),u}function tb(){return Hr().memoizedState}function Ef(u,c,k,I){var j=Li();Xt.flags|=u,j.memoizedState=_u(1|c,k,void 0,I===void 0?null:I)}function Of(u,c,k,I){var j=Hr();I=I===void 0?null:I;var q=void 0;if(gn!==null){var ee=gn.memoizedState;if(q=ee.destroy,I!==null&&P0(I,ee.deps)){j.memoizedState=_u(c,k,q,I);return}}Xt.flags|=u,j.memoizedState=_u(1|c,k,q,I)}function nb(u,c){return Ef(8390656,8,u,c)}function R0(u,c){return Of(2048,8,u,c)}function rb(u,c){return Of(4,2,u,c)}function ib(u,c){return Of(4,4,u,c)}function ob(u,c){if(typeof c=="function")return u=u(),c(u),function(){c(null)};if(c!=null)return u=u(),c.current=u,function(){c.current=null}}function ab(u,c,k){return k=k!=null?k.concat([u]):null,Of(4,4,ob.bind(null,c,u),k)}function M0(){}function lb(u,c){var k=Hr();c=c===void 0?null:c;var I=k.memoizedState;return I!==null&&c!==null&&P0(c,I[1])?I[0]:(k.memoizedState=[u,c],u)}function sb(u,c){var k=Hr();c=c===void 0?null:c;var I=k.memoizedState;return I!==null&&c!==null&&P0(c,I[1])?I[0]:(u=u(),k.memoizedState=[u,c],u)}function ub(u,c,k){return Ua&21?(oi(k,c)||(k=T2(),Xt.lanes|=k,Ha|=k,u.baseState=!0),c):(u.baseState&&(u.baseState=!1,ar=!0),u.memoizedState=k)}function ZS(u,c){var k=yt;yt=k!==0&&4>k?k:4,u(!0);var I=x0.transition;x0.transition={};try{u(!1),c()}finally{yt=k,x0.transition=I}}function cb(){return Hr().memoizedState}function QS(u,c,k){var I=Go(u);if(k={lane:I,action:k,hasEagerState:!1,eagerState:null,next:null},fb(u))db(c,k);else if(k=H2(u,c,k,I),k!==null){var j=Vn();$r(k,u,I,j),hb(k,c,I)}}function JS(u,c,k){var I=Go(u),j={lane:I,action:k,hasEagerState:!1,eagerState:null,next:null};if(fb(u))db(c,j);else{var q=u.alternate;if(u.lanes===0&&(q===null||q.lanes===0)&&(q=c.lastRenderedReducer,q!==null))try{var ee=c.lastRenderedState,le=q(ee,k);if(j.hasEagerState=!0,j.eagerState=le,oi(le,ee)){var ve=c.interleaved;ve===null?(j.next=j,b0(c)):(j.next=ve.next,ve.next=j),c.interleaved=j;return}}catch{}finally{}k=H2(u,c,j,I),k!==null&&(j=Vn(),$r(k,u,I,j),hb(k,c,I))}}function fb(u){var c=u.alternate;return u===Xt||c!==null&&c===Xt}function db(u,c){mu=Sf=!0;var k=u.pending;k===null?c.next=c:(c.next=k.next,k.next=c),u.pending=c}function hb(u,c,k){if(k&4194240){var I=c.lanes;I&=u.pendingLanes,k|=I,c.lanes=k,o0(u,k)}}var xf={readContext:Br,useCallback:Hn,useContext:Hn,useEffect:Hn,useImperativeHandle:Hn,useInsertionEffect:Hn,useLayoutEffect:Hn,useMemo:Hn,useReducer:Hn,useRef:Hn,useState:Hn,useDebugValue:Hn,useDeferredValue:Hn,useTransition:Hn,useMutableSource:Hn,useSyncExternalStore:Hn,useId:Hn,unstable_isNewReconciler:!1},eE={readContext:Br,useCallback:function(u,c){return Li().memoizedState=[u,c===void 0?null:c],u},useContext:Br,useEffect:nb,useImperativeHandle:function(u,c,k){return k=k!=null?k.concat([u]):null,Ef(4194308,4,ob.bind(null,c,u),k)},useLayoutEffect:function(u,c){return Ef(4194308,4,u,c)},useInsertionEffect:function(u,c){return Ef(4,2,u,c)},useMemo:function(u,c){var k=Li();return c=c===void 0?null:c,u=u(),k.memoizedState=[u,c],u},useReducer:function(u,c,k){var I=Li();return c=k!==void 0?k(c):c,I.memoizedState=I.baseState=c,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:c},I.queue=u,u=u.dispatch=QS.bind(null,Xt,u),[I.memoizedState,u]},useRef:function(u){var c=Li();return u={current:u},c.memoizedState=u},useState:eb,useDebugValue:M0,useDeferredValue:function(u){return Li().memoizedState=u},useTransition:function(){var u=eb(!1),c=u[0];return u=ZS.bind(null,u[1]),Li().memoizedState=u,[c,u]},useMutableSource:function(){},useSyncExternalStore:function(u,c,k){var I=Xt,j=Li();if($t){if(k===void 0)throw Error(a(407));k=k()}else{if(k=c(),kn===null)throw Error(a(349));Ua&30||K2(I,c,k)}j.memoizedState=k;var q={value:k,getSnapshot:c};return j.queue=q,nb(Z2.bind(null,I,q,u),[u]),I.flags|=2048,_u(9,X2.bind(null,I,q,k,c),void 0,null),k},useId:function(){var u=Li(),c=kn.identifierPrefix;if($t){var k=ao,I=oo;k=(I&~(1<<32-ii(I)-1)).toString(32)+k,c=":"+c+"R"+k,k=yu++,0<k&&(c+="H"+k.toString(32)),c+=":"}else k=XS++,c=":"+c+"r"+k.toString(32)+":";return u.memoizedState=c},unstable_isNewReconciler:!1},tE={readContext:Br,useCallback:lb,useContext:Br,useEffect:R0,useImperativeHandle:ab,useInsertionEffect:rb,useLayoutEffect:ib,useMemo:sb,useReducer:T0,useRef:tb,useState:function(){return T0(bu)},useDebugValue:M0,useDeferredValue:function(u){var c=Hr();return ub(c,gn.memoizedState,u)},useTransition:function(){var u=T0(bu)[0],c=Hr().memoizedState;return[u,c]},useMutableSource:W2,useSyncExternalStore:Y2,useId:cb,unstable_isNewReconciler:!1},nE={readContext:Br,useCallback:lb,useContext:Br,useEffect:R0,useImperativeHandle:ab,useInsertionEffect:rb,useLayoutEffect:ib,useMemo:sb,useReducer:A0,useRef:tb,useState:function(){return A0(bu)},useDebugValue:M0,useDeferredValue:function(u){var c=Hr();return gn===null?c.memoizedState=u:ub(c,gn.memoizedState,u)},useTransition:function(){var u=A0(bu)[0],c=Hr().memoizedState;return[u,c]},useMutableSource:W2,useSyncExternalStore:Y2,useId:cb,unstable_isNewReconciler:!1};function li(u,c){if(u&&u.defaultProps){c=o({},c),u=u.defaultProps;for(var k in u)c[k]===void 0&&(c[k]=u[k]);return c}return c}function L0(u,c,k,I){c=u.memoizedState,k=k(I,c),k=k==null?c:o({},c,k),u.memoizedState=k,u.lanes===0&&(u.updateQueue.baseState=k)}var Pf={isMounted:function(u){return(u=u._reactInternals)?S(u)===u:!1},enqueueSetState:function(u,c,k){u=u._reactInternals;var I=Vn(),j=Go(u),q=lo(I,j);q.payload=c,k!=null&&(q.callback=k),c=Uo(u,q,j),c!==null&&($r(c,u,j,I),yf(c,u,j))},enqueueReplaceState:function(u,c,k){u=u._reactInternals;var I=Vn(),j=Go(u),q=lo(I,j);q.tag=1,q.payload=c,k!=null&&(q.callback=k),c=Uo(u,q,j),c!==null&&($r(c,u,j,I),yf(c,u,j))},enqueueForceUpdate:function(u,c){u=u._reactInternals;var k=Vn(),I=Go(u),j=lo(k,I);j.tag=2,c!=null&&(j.callback=c),c=Uo(u,j,I),c!==null&&($r(c,u,I,k),yf(c,u,I))}};function pb(u,c,k,I,j,q,ee){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(I,q,ee):c.prototype&&c.prototype.isPureReactComponent?!pf(k,I)||!pf(j,q):!0}function gb(u,c,k){var I=!1,j=zo,q=c.contextType;return typeof q=="object"&&q!==null?q=Br(q):(j=or(c)?ja:Un.current,I=c.contextTypes,q=(I=I!=null)?jl(u,j):zo),c=new c(k,q),u.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Pf,u.stateNode=c,c._reactInternals=u,I&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=j,u.__reactInternalMemoizedMaskedChildContext=q),c}function vb(u,c,k,I){u=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(k,I),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(k,I),c.state!==u&&Pf.enqueueReplaceState(c,c.state,null)}function N0(u,c,k,I){var j=u.stateNode;j.props=k,j.state=u.memoizedState,j.refs={},_0(u);var q=c.contextType;typeof q=="object"&&q!==null?j.context=Br(q):(q=or(c)?ja:Un.current,j.context=jl(u,q)),j.state=u.memoizedState,q=c.getDerivedStateFromProps,typeof q=="function"&&(L0(u,c,q,k),j.state=u.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&&Pf.enqueueReplaceState(j,j.state,null),bf(u,k,j,I),j.state=u.memoizedState),typeof j.componentDidMount=="function"&&(u.flags|=4194308)}function ql(u,c){try{var k="",I=c;do k+=KS(I),I=I.return;while(I);var j=k}catch(q){j=`
56
- Error generating stack: `+q.message+`
57
- `+q.stack}return{value:u,source:c,stack:j,digest:null}}function I0(u,c,k){return{value:u,source:null,stack:k??null,digest:c??null}}function D0(u,c){try{console.error(c.value)}catch(k){setTimeout(function(){throw k})}}var rE=typeof WeakMap=="function"?WeakMap:Map;function mb(u,c,k){k=lo(-1,k),k.tag=3,k.payload={element:null};var I=c.value;return k.callback=function(){Bf||(Bf=!0,n1=I),D0(u,c)},k}function yb(u,c,k){k=lo(-1,k),k.tag=3;var I=u.type.getDerivedStateFromError;if(typeof I=="function"){var j=c.value;k.payload=function(){return I(j)},k.callback=function(){D0(u,c)}}var q=u.stateNode;return q!==null&&typeof q.componentDidCatch=="function"&&(k.callback=function(){D0(u,c),typeof I!="function"&&(Ho===null?Ho=new Set([this]):Ho.add(this));var ee=c.stack;this.componentDidCatch(c.value,{componentStack:ee!==null?ee:""})}),k}function bb(u,c,k){var I=u.pingCache;if(I===null){I=u.pingCache=new rE;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(k)||(j.add(k),u=mE.bind(null,u,c,k),c.then(u,u))}function _b(u){do{var c;if((c=u.tag===13)&&(c=u.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return u;u=u.return}while(u!==null);return null}function wb(u,c,k,I,j){return u.mode&1?(u.flags|=65536,u.lanes=j,u):(u===c?u.flags|=65536:(u.flags|=128,k.flags|=131072,k.flags&=-52805,k.tag===1&&(k.alternate===null?k.tag=17:(c=lo(-1,1),c.tag=2,Uo(k,c,1))),k.lanes|=1),u)}var iE=l.ReactCurrentOwner,ar=!1;function Zn(u,c,k,I){c.child=u===null?B2(c,null,k,I):Ul(c,u.child,k,I)}function Sb(u,c,k,I,j){k=k.render;var q=c.ref;return $l(c,j),I=C0(u,c,k,I,q,j),k=k0(),u!==null&&!ar?(c.updateQueue=u.updateQueue,c.flags&=-2053,u.lanes&=~j,so(u,c,j)):($t&&k&&c0(c),c.flags|=1,Zn(u,c,I,j),c.child)}function Eb(u,c,k,I,j){if(u===null){var q=k.type;return typeof q=="function"&&!s1(q)&&q.defaultProps===void 0&&k.compare===null&&k.defaultProps===void 0?(c.tag=15,c.type=q,Ob(u,c,q,I,j)):(u=qf(k.type,null,I,c,c.mode,j),u.ref=c.ref,u.return=c,c.child=u)}if(q=u.child,!(u.lanes&j)){var ee=q.memoizedProps;if(k=k.compare,k=k!==null?k:pf,k(ee,I)&&u.ref===c.ref)return so(u,c,j)}return c.flags|=1,u=qo(q,I),u.ref=c.ref,u.return=c,c.child=u}function Ob(u,c,k,I,j){if(u!==null){var q=u.memoizedProps;if(pf(q,I)&&u.ref===c.ref)if(ar=!1,c.pendingProps=I=q,(u.lanes&j)!==0)u.flags&131072&&(ar=!0);else return c.lanes=u.lanes,so(u,c,j)}return j0(u,c,k,I,j)}function xb(u,c,k){var I=c.pendingProps,j=I.children,q=u!==null?u.memoizedState:null;if(I.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nt(Yl,Or),Or|=k;else{if(!(k&1073741824))return u=q!==null?q.baseLanes|k:k,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:u,cachePool:null,transitions:null},c.updateQueue=null,Nt(Yl,Or),Or|=u,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},I=q!==null?q.baseLanes:k,Nt(Yl,Or),Or|=I}else q!==null?(I=q.baseLanes|k,c.memoizedState=null):I=k,Nt(Yl,Or),Or|=I;return Zn(u,c,j,k),c.child}function Pb(u,c){var k=c.ref;(u===null&&k!==null||u!==null&&u.ref!==k)&&(c.flags|=512,c.flags|=2097152)}function j0(u,c,k,I,j){var q=or(k)?ja:Un.current;return q=jl(c,q),$l(c,j),k=C0(u,c,k,I,q,j),I=k0(),u!==null&&!ar?(c.updateQueue=u.updateQueue,c.flags&=-2053,u.lanes&=~j,so(u,c,j)):($t&&I&&c0(c),c.flags|=1,Zn(u,c,k,j),c.child)}function Cb(u,c,k,I,j){if(or(k)){var q=!0;of(c)}else q=!1;if($l(c,j),c.stateNode===null)kf(u,c),gb(c,k,I),N0(c,k,I,j),I=!0;else if(u===null){var ee=c.stateNode,le=c.memoizedProps;ee.props=le;var ve=ee.context,Te=k.contextType;typeof Te=="object"&&Te!==null?Te=Br(Te):(Te=or(k)?ja:Un.current,Te=jl(c,Te));var He=k.getDerivedStateFromProps,nt=typeof He=="function"||typeof ee.getSnapshotBeforeUpdate=="function";nt||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(le!==I||ve!==Te)&&vb(c,ee,I,Te),Bo=!1;var De=c.memoizedState;ee.state=De,bf(c,I,ee,j),ve=c.memoizedState,le!==I||De!==ve||ir.current||Bo?(typeof He=="function"&&(L0(c,k,He,I),ve=c.memoizedState),(le=Bo||pb(c,k,le,I,De,ve,Te))?(nt||typeof ee.UNSAFE_componentWillMount!="function"&&typeof ee.componentWillMount!="function"||(typeof ee.componentWillMount=="function"&&ee.componentWillMount(),typeof ee.UNSAFE_componentWillMount=="function"&&ee.UNSAFE_componentWillMount()),typeof ee.componentDidMount=="function"&&(c.flags|=4194308)):(typeof ee.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=I,c.memoizedState=ve),ee.props=I,ee.state=ve,ee.context=Te,I=le):(typeof ee.componentDidMount=="function"&&(c.flags|=4194308),I=!1)}else{ee=c.stateNode,$2(u,c),le=c.memoizedProps,Te=c.type===c.elementType?le:li(c.type,le),ee.props=Te,nt=c.pendingProps,De=ee.context,ve=k.contextType,typeof ve=="object"&&ve!==null?ve=Br(ve):(ve=or(k)?ja:Un.current,ve=jl(c,ve));var Bt=k.getDerivedStateFromProps;(He=typeof Bt=="function"||typeof ee.getSnapshotBeforeUpdate=="function")||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(le!==nt||De!==ve)&&vb(c,ee,I,ve),Bo=!1,De=c.memoizedState,ee.state=De,bf(c,I,ee,j);var Mt=c.memoizedState;le!==nt||De!==Mt||ir.current||Bo?(typeof Bt=="function"&&(L0(c,k,Bt,I),Mt=c.memoizedState),(Te=Bo||pb(c,k,Te,I,De,Mt,ve)||!1)?(He||typeof ee.UNSAFE_componentWillUpdate!="function"&&typeof ee.componentWillUpdate!="function"||(typeof ee.componentWillUpdate=="function"&&ee.componentWillUpdate(I,Mt,ve),typeof ee.UNSAFE_componentWillUpdate=="function"&&ee.UNSAFE_componentWillUpdate(I,Mt,ve)),typeof ee.componentDidUpdate=="function"&&(c.flags|=4),typeof ee.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof ee.componentDidUpdate!="function"||le===u.memoizedProps&&De===u.memoizedState||(c.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||le===u.memoizedProps&&De===u.memoizedState||(c.flags|=1024),c.memoizedProps=I,c.memoizedState=Mt),ee.props=I,ee.state=Mt,ee.context=ve,I=Te):(typeof ee.componentDidUpdate!="function"||le===u.memoizedProps&&De===u.memoizedState||(c.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||le===u.memoizedProps&&De===u.memoizedState||(c.flags|=1024),I=!1)}return F0(u,c,k,I,q,j)}function F0(u,c,k,I,j,q){Pb(u,c);var ee=(c.flags&128)!==0;if(!I&&!ee)return j&&k2(c,k,!1),so(u,c,q);I=c.stateNode,iE.current=c;var le=ee&&typeof k.getDerivedStateFromError!="function"?null:I.render();return c.flags|=1,u!==null&&ee?(c.child=Ul(c,u.child,null,q),c.child=Ul(c,null,le,q)):Zn(u,c,le,q),c.memoizedState=I.state,j&&k2(c,k,!0),c.child}function kb(u){var c=u.stateNode;c.pendingContext?P2(u,c.pendingContext,c.pendingContext!==c.context):c.context&&P2(u,c.context,!1),w0(u,c.containerInfo)}function Tb(u,c,k,I,j){return Bl(),p0(j),c.flags|=256,Zn(u,c,k,I),c.child}var z0={dehydrated:null,treeContext:null,retryLane:0};function B0(u){return{baseLanes:u,cachePool:null,transitions:null}}function Ab(u,c,k){var I=c.pendingProps,j=Kt.current,q=!1,ee=(c.flags&128)!==0,le;if((le=ee)||(le=u!==null&&u.memoizedState===null?!1:(j&2)!==0),le?(q=!0,c.flags&=-129):(u===null||u.memoizedState!==null)&&(j|=1),Nt(Kt,j&1),u===null)return h0(c),u=c.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?(c.mode&1?pn(u)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(ee=I.children,u=I.fallback,q?(I=c.mode,q=c.child,ee={mode:"hidden",children:ee},!(I&1)&&q!==null?(q.childLanes=0,q.pendingProps=ee):q=Wf(ee,I,0,null),u=qa(u,I,k,null),q.return=c,u.return=c,q.sibling=u,c.child=q,c.child.memoizedState=B0(k),c.memoizedState=z0,u):U0(c,ee));if(j=u.memoizedState,j!==null&&(le=j.dehydrated,le!==null))return oE(u,c,ee,I,le,j,k);if(q){q=I.fallback,ee=c.mode,j=u.child,le=j.sibling;var ve={mode:"hidden",children:I.children};return!(ee&1)&&c.child!==j?(I=c.child,I.childLanes=0,I.pendingProps=ve,c.deletions=null):(I=qo(j,ve),I.subtreeFlags=j.subtreeFlags&14680064),le!==null?q=qo(le,q):(q=qa(q,ee,k,null),q.flags|=2),q.return=c,I.return=c,I.sibling=q,c.child=I,I=q,q=c.child,ee=u.child.memoizedState,ee=ee===null?B0(k):{baseLanes:ee.baseLanes|k,cachePool:null,transitions:ee.transitions},q.memoizedState=ee,q.childLanes=u.childLanes&~k,c.memoizedState=z0,I}return q=u.child,u=q.sibling,I=qo(q,{mode:"visible",children:I.children}),!(c.mode&1)&&(I.lanes=k),I.return=c,I.sibling=null,u!==null&&(k=c.deletions,k===null?(c.deletions=[u],c.flags|=16):k.push(u)),c.child=I,c.memoizedState=null,I}function U0(u,c){return c=Wf({mode:"visible",children:c},u.mode,0,null),c.return=u,u.child=c}function Cf(u,c,k,I){return I!==null&&p0(I),Ul(c,u.child,null,k),u=U0(c,c.pendingProps.children),u.flags|=2,c.memoizedState=null,u}function oE(u,c,k,I,j,q,ee){if(k)return c.flags&256?(c.flags&=-257,I=I0(Error(a(422))),Cf(u,c,ee,I)):c.memoizedState!==null?(c.child=u.child,c.flags|=128,null):(q=I.fallback,j=c.mode,I=Wf({mode:"visible",children:I.children},j,0,null),q=qa(q,j,ee,null),q.flags|=2,I.return=c,q.return=c,I.sibling=q,c.child=I,c.mode&1&&Ul(c,u.child,null,ee),c.child.memoizedState=B0(ee),c.memoizedState=z0,q);if(!(c.mode&1))return Cf(u,c,ee,null);if(pn(j))return I=rr(j).digest,q=Error(a(419)),I=I0(q,I,void 0),Cf(u,c,ee,I);if(k=(ee&u.childLanes)!==0,ar||k){if(I=kn,I!==null){switch(ee&-ee){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|ee)?0:j,j!==0&&j!==q.retryLane&&(q.retryLane=j,Ri(u,j),$r(I,u,j,-1))}return l1(),I=I0(Error(a(421))),Cf(u,c,ee,I)}return hn(j)?(c.flags|=128,c.child=u.child,c=yE.bind(null,u),to(j,c),null):(u=q.treeContext,ie&&(zr=ft(j),Er=c,$t=!0,ai=null,hu=!1,u!==null&&(jr[Fr++]=oo,jr[Fr++]=ao,jr[Fr++]=Fa,oo=u.id,ao=u.overflow,Fa=c)),c=U0(c,I.children),c.flags|=4096,c)}function Rb(u,c,k){u.lanes|=c;var I=u.alternate;I!==null&&(I.lanes|=c),y0(u.return,c,k)}function H0(u,c,k,I,j){var q=u.memoizedState;q===null?u.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:I,tail:k,tailMode:j}:(q.isBackwards=c,q.rendering=null,q.renderingStartTime=0,q.last=I,q.tail=k,q.tailMode=j)}function Mb(u,c,k){var I=c.pendingProps,j=I.revealOrder,q=I.tail;if(Zn(u,c,I.children,k),I=Kt.current,I&2)I=I&1|2,c.flags|=128;else{if(u!==null&&u.flags&128)e:for(u=c.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&Rb(u,k,c);else if(u.tag===19)Rb(u,k,c);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break e;for(;u.sibling===null;){if(u.return===null||u.return===c)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}I&=1}if(Nt(Kt,I),!(c.mode&1))c.memoizedState=null;else switch(j){case"forwards":for(k=c.child,j=null;k!==null;)u=k.alternate,u!==null&&_f(u)===null&&(j=k),k=k.sibling;k=j,k===null?(j=c.child,c.child=null):(j=k.sibling,k.sibling=null),H0(c,!1,j,k,q);break;case"backwards":for(k=null,j=c.child,c.child=null;j!==null;){if(u=j.alternate,u!==null&&_f(u)===null){c.child=j;break}u=j.sibling,j.sibling=k,k=j,j=u}H0(c,!0,k,null,q);break;case"together":H0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function kf(u,c){!(c.mode&1)&&u!==null&&(u.alternate=null,c.alternate=null,c.flags|=2)}function so(u,c,k){if(u!==null&&(c.dependencies=u.dependencies),Ha|=c.lanes,!(k&c.childLanes))return null;if(u!==null&&c.child!==u.child)throw Error(a(153));if(c.child!==null){for(u=c.child,k=qo(u,u.pendingProps),c.child=k,k.return=c;u.sibling!==null;)u=u.sibling,k=k.sibling=qo(u,u.pendingProps),k.return=c;k.sibling=null}return c.child}function aE(u,c,k){switch(c.tag){case 3:kb(c),Bl();break;case 5:q2(c);break;case 1:or(c.type)&&of(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?(Nt(Kt,Kt.current&1),c.flags|=128,null):k&c.child.childLanes?Ab(u,c,k):(Nt(Kt,Kt.current&1),u=so(u,c,k),u!==null?u.sibling:null);Nt(Kt,Kt.current&1);break;case 19:if(I=(k&c.childLanes)!==0,u.flags&128){if(I)return Mb(u,c,k);c.flags|=128}var j=c.memoizedState;if(j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),Nt(Kt,Kt.current),I)break;return null;case 22:case 23:return c.lanes=0,xb(u,c,k)}return so(u,c,k)}function Ni(u){u.flags|=4}function Lb(u,c){if(u!==null&&u.child===c.child)return!0;if(c.flags&16)return!1;for(u=c.child;u!==null;){if(u.flags&12854||u.subtreeFlags&12854)return!1;u=u.sibling}return!0}var wu,Su,Tf,Af;if(J)wu=function(u,c){for(var k=c.child;k!==null;){if(k.tag===5||k.tag===6)B(u,k.stateNode);else if(k.tag!==4&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===c)break;for(;k.sibling===null;){if(k.return===null||k.return===c)return;k=k.return}k.sibling.return=k.return,k=k.sibling}},Su=function(){},Tf=function(u,c,k,I,j){if(u=u.memoizedProps,u!==I){var q=c.stateNode,ee=Mi(Ur.current);k=Y(q,k,u,I,j,ee),(c.updateQueue=k)&&Ni(c)}},Af=function(u,c,k,I){k!==I&&Ni(c)};else if(ne){wu=function(u,c,k,I){for(var j=c.child;j!==null;){if(j.tag===5){var q=j.stateNode;k&&I&&(q=Ye(q,j.type,j.memoizedProps,j)),B(u,q)}else if(j.tag===6)q=j.stateNode,k&&I&&(q=at(q,j.memoizedProps,j)),B(u,q);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)q=j.child,q!==null&&(q.return=j),wu(u,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(u,c,k,I){for(var j=c.child;j!==null;){if(j.tag===5){var q=j.stateNode;k&&I&&(q=Ye(q,j.type,j.memoizedProps,j)),Tt(u,q)}else if(j.tag===6)q=j.stateNode,k&&I&&(q=at(q,j.memoizedProps,j)),Tt(u,q);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)q=j.child,q!==null&&(q.return=j),Nb(u,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}};Su=function(u,c){var k=c.stateNode;if(!Lb(u,c)){u=k.containerInfo;var I=Wt(u);Nb(I,c,!1,!1),k.pendingChildren=I,Ni(c),Yt(u,I)}},Tf=function(u,c,k,I,j){var q=u.stateNode,ee=u.memoizedProps;if((u=Lb(u,c))&&ee===I)c.stateNode=q;else{var le=c.stateNode,ve=Mi(Ur.current),Te=null;ee!==I&&(Te=Y(le,k,ee,I,j,ve)),u&&Te===null?c.stateNode=q:(q=$e(q,Te,k,ee,I,c,u,le),V(q,k,I,j,ve)&&Ni(c),c.stateNode=q,u?Ni(c):wu(q,c,!1,!1))}},Af=function(u,c,k,I){k!==I?(u=Mi(Gl.current),k=Mi(Ur.current),c.stateNode=$(I,u,k,c),Ni(c)):c.stateNode=u.stateNode}}else Su=function(){},Tf=function(){},Af=function(){};function Eu(u,c){if(!$t)switch(u.tailMode){case"hidden":c=u.tail;for(var k=null;c!==null;)c.alternate!==null&&(k=c),c=c.sibling;k===null?u.tail=null:k.sibling=null;break;case"collapsed":k=u.tail;for(var I=null;k!==null;)k.alternate!==null&&(I=k),k=k.sibling;I===null?c||u.tail===null?u.tail=null:u.tail.sibling=null:I.sibling=null}}function $n(u){var c=u.alternate!==null&&u.alternate.child===u.child,k=0,I=0;if(c)for(var j=u.child;j!==null;)k|=j.lanes|j.childLanes,I|=j.subtreeFlags&14680064,I|=j.flags&14680064,j.return=u,j=j.sibling;else for(j=u.child;j!==null;)k|=j.lanes|j.childLanes,I|=j.subtreeFlags,I|=j.flags,j.return=u,j=j.sibling;return u.subtreeFlags|=I,u.childLanes=k,c}function lE(u,c,k){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 $n(c),null;case 1:return or(c.type)&&rf(),$n(c),null;case 3:return k=c.stateNode,Vl(),zt(ir),zt(Un),O0(),k.pendingContext&&(k.context=k.pendingContext,k.pendingContext=null),(u===null||u.child===null)&&(hf(c)?Ni(c):u===null||u.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,ai!==null&&(o1(ai),ai=null))),Su(u,c),$n(c),null;case 5:S0(c),k=Mi(Gl.current);var j=c.type;if(u!==null&&c.stateNode!=null)Tf(u,c,j,I,k),u.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!I){if(c.stateNode===null)throw Error(a(166));return $n(c),null}if(u=Mi(Ur.current),hf(c)){if(!ie)throw Error(a(175));u=Ft(c.stateNode,c.type,c.memoizedProps,k,u,c,!hu),c.updateQueue=u,u!==null&&Ni(c)}else{var q=D(j,I,k,u,c);wu(q,c,!1,!1),c.stateNode=q,V(q,j,I,k,u)&&Ni(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return $n(c),null;case 6:if(u&&c.stateNode!=null)Af(u,c,u.memoizedProps,I);else{if(typeof I!="string"&&c.stateNode===null)throw Error(a(166));if(u=Mi(Gl.current),k=Mi(Ur.current),hf(c)){if(!ie)throw Error(a(176));if(u=c.stateNode,k=c.memoizedProps,(I=Pt(u,k,c,!hu))&&(j=Er,j!==null))switch(j.tag){case 3:cu(j.stateNode.containerInfo,u,k,(j.mode&1)!==0);break;case 5:Da(j.type,j.memoizedProps,j.stateNode,u,k,(j.mode&1)!==0)}I&&Ni(c)}else c.stateNode=$(I,u,k,c)}return $n(c),null;case 13:if(zt(Kt),I=c.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if($t&&zr!==null&&c.mode&1&&!(c.flags&128))j2(),Bl(),c.flags|=98560,j=!1;else if(j=hf(c),I!==null&&I.dehydrated!==null){if(u===null){if(!j)throw Error(a(318));if(!ie)throw Error(a(344));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(a(317));Bn(j,c)}else Bl(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;$n(c),j=!1}else ai!==null&&(o1(ai),ai=null),j=!0;if(!j)return c.flags&65536?c:null}return c.flags&128?(c.lanes=k,c):(k=I!==null,k!==(u!==null&&u.memoizedState!==null)&&k&&(c.child.flags|=8192,c.mode&1&&(u===null||Kt.current&1?vn===0&&(vn=3):l1())),c.updateQueue!==null&&(c.flags|=4),$n(c),null);case 4:return Vl(),Su(u,c),u===null&&de(c.stateNode.containerInfo),$n(c),null;case 10:return m0(c.type._context),$n(c),null;case 17:return or(c.type)&&rf(),$n(c),null;case 19:if(zt(Kt),j=c.memoizedState,j===null)return $n(c),null;if(I=(c.flags&128)!==0,q=j.rendering,q===null)if(I)Eu(j,!1);else{if(vn!==0||u!==null&&u.flags&128)for(u=c.child;u!==null;){if(q=_f(u),q!==null){for(c.flags|=128,Eu(j,!1),u=q.updateQueue,u!==null&&(c.updateQueue=u,c.flags|=4),c.subtreeFlags=0,u=k,k=c.child;k!==null;)I=k,j=u,I.flags&=14680066,q=I.alternate,q===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=q.childLanes,I.lanes=q.lanes,I.child=q.child,I.subtreeFlags=0,I.deletions=null,I.memoizedProps=q.memoizedProps,I.memoizedState=q.memoizedState,I.updateQueue=q.updateQueue,I.type=q.type,j=q.dependencies,I.dependencies=j===null?null:{lanes:j.lanes,firstContext:j.firstContext}),k=k.sibling;return Nt(Kt,Kt.current&1|2),c.child}u=u.sibling}j.tail!==null&&Pn()>t1&&(c.flags|=128,I=!0,Eu(j,!1),c.lanes=4194304)}else{if(!I)if(u=_f(q),u!==null){if(c.flags|=128,I=!0,u=u.updateQueue,u!==null&&(c.updateQueue=u,c.flags|=4),Eu(j,!0),j.tail===null&&j.tailMode==="hidden"&&!q.alternate&&!$t)return $n(c),null}else 2*Pn()-j.renderingStartTime>t1&&k!==1073741824&&(c.flags|=128,I=!0,Eu(j,!1),c.lanes=4194304);j.isBackwards?(q.sibling=c.child,c.child=q):(u=j.last,u!==null?u.sibling=q:c.child=q,j.last=q)}return j.tail!==null?(c=j.tail,j.rendering=c,j.tail=c.sibling,j.renderingStartTime=Pn(),c.sibling=null,u=Kt.current,Nt(Kt,I?u&1|2:u&1),c):($n(c),null);case 22:case 23:return a1(),k=c.memoizedState!==null,u!==null&&u.memoizedState!==null!==k&&(c.flags|=8192),k&&c.mode&1?Or&1073741824&&($n(c),J&&c.subtreeFlags&6&&(c.flags|=8192)):$n(c),null;case 24:return null;case 25:return null}throw Error(a(156,c.tag))}function sE(u,c){switch(f0(c),c.tag){case 1:return or(c.type)&&rf(),u=c.flags,u&65536?(c.flags=u&-65537|128,c):null;case 3:return Vl(),zt(ir),zt(Un),O0(),u=c.flags,u&65536&&!(u&128)?(c.flags=u&-65537|128,c):null;case 5:return S0(c),null;case 13:if(zt(Kt),u=c.memoizedState,u!==null&&u.dehydrated!==null){if(c.alternate===null)throw Error(a(340));Bl()}return u=c.flags,u&65536?(c.flags=u&-65537|128,c):null;case 19:return zt(Kt),null;case 4:return Vl(),null;case 10:return m0(c.type._context),null;case 22:case 23:return a1(),null;case 24:return null;default:return null}}var Rf=!1,Gn=!1,uE=typeof WeakSet=="function"?WeakSet:Set,Be=null;function Wl(u,c){var k=u.ref;if(k!==null)if(typeof k=="function")try{k(null)}catch(I){Gt(u,c,I)}else k.current=null}function $0(u,c,k){try{k()}catch(I){Gt(u,c,I)}}var Ib=!1;function cE(u,c){for(L(u.containerInfo),Be=c;Be!==null;)if(u=Be,c=u.child,(u.subtreeFlags&1028)!==0&&c!==null)c.return=u,Be=c;else for(;Be!==null;){u=Be;try{var k=u.alternate;if(u.flags&1024)switch(u.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var I=k.memoizedProps,j=k.memoizedState,q=u.stateNode,ee=q.getSnapshotBeforeUpdate(u.elementType===u.type?I:li(u.type,I),j);q.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:J&&Oe(u.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(le){Gt(u,u.return,le)}if(c=u.sibling,c!==null){c.return=u.return,Be=c;break}Be=u.return}return k=Ib,Ib=!1,k}function Ou(u,c,k){var I=c.updateQueue;if(I=I!==null?I.lastEffect:null,I!==null){var j=I=I.next;do{if((j.tag&u)===u){var q=j.destroy;j.destroy=void 0,q!==void 0&&$0(c,k,q)}j=j.next}while(j!==I)}}function Mf(u,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var k=c=c.next;do{if((k.tag&u)===u){var I=k.create;k.destroy=I()}k=k.next}while(k!==c)}}function G0(u){var c=u.ref;if(c!==null){var k=u.stateNode;switch(u.tag){case 5:u=Z(k);break;default:u=k}typeof c=="function"?c(u):c.current=u}}function Db(u){var c=u.alternate;c!==null&&(u.alternate=null,Db(c)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(c=u.stateNode,c!==null&&Pe(c)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function jb(u){return u.tag===5||u.tag===3||u.tag===4}function Fb(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||jb(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function V0(u,c,k){var I=u.tag;if(I===5||I===6)u=u.stateNode,c?mt(k,u,c):Ce(k,u);else if(I!==4&&(u=u.child,u!==null))for(V0(u,c,k),u=u.sibling;u!==null;)V0(u,c,k),u=u.sibling}function q0(u,c,k){var I=u.tag;if(I===5||I===6)u=u.stateNode,c?St(k,u,c):Ae(k,u);else if(I!==4&&(u=u.child,u!==null))for(q0(u,c,k),u=u.sibling;u!==null;)q0(u,c,k),u=u.sibling}var Ln=null,si=!1;function Ii(u,c,k){for(k=k.child;k!==null;)W0(u,c,k),k=k.sibling}function W0(u,c,k){if(Ti&&typeof Ti.onCommitFiberUnmount=="function")try{Ti.onCommitFiberUnmount(uf,k)}catch{}switch(k.tag){case 5:Gn||Wl(k,c);case 6:if(J){var I=Ln,j=si;Ln=null,Ii(u,c,k),Ln=I,si=j,Ln!==null&&(si?ce(Ln,k.stateNode):ue(Ln,k.stateNode))}else Ii(u,c,k);break;case 18:J&&Ln!==null&&(si?no(Ln,k.stateNode):Sr(Ln,k.stateNode));break;case 4:J?(I=Ln,j=si,Ln=k.stateNode.containerInfo,si=!0,Ii(u,c,k),Ln=I,si=j):(ne&&(I=k.stateNode.containerInfo,j=Wt(I),ke(I,j)),Ii(u,c,k));break;case 0:case 11:case 14:case 15:if(!Gn&&(I=k.updateQueue,I!==null&&(I=I.lastEffect,I!==null))){j=I=I.next;do{var q=j,ee=q.destroy;q=q.tag,ee!==void 0&&(q&2||q&4)&&$0(k,c,ee),j=j.next}while(j!==I)}Ii(u,c,k);break;case 1:if(!Gn&&(Wl(k,c),I=k.stateNode,typeof I.componentWillUnmount=="function"))try{I.props=k.memoizedProps,I.state=k.memoizedState,I.componentWillUnmount()}catch(le){Gt(k,c,le)}Ii(u,c,k);break;case 21:Ii(u,c,k);break;case 22:k.mode&1?(Gn=(I=Gn)||k.memoizedState!==null,Ii(u,c,k),Gn=I):Ii(u,c,k);break;default:Ii(u,c,k)}}function zb(u){var c=u.updateQueue;if(c!==null){u.updateQueue=null;var k=u.stateNode;k===null&&(k=u.stateNode=new uE),c.forEach(function(I){var j=bE.bind(null,u,I);k.has(I)||(k.add(I),I.then(j,j))})}}function ui(u,c){var k=c.deletions;if(k!==null)for(var I=0;I<k.length;I++){var j=k[I];try{var q=u,ee=c;if(J){var le=ee;e:for(;le!==null;){switch(le.tag){case 5:Ln=le.stateNode,si=!1;break e;case 3:Ln=le.stateNode.containerInfo,si=!0;break e;case 4:Ln=le.stateNode.containerInfo,si=!0;break e}le=le.return}if(Ln===null)throw Error(a(160));W0(q,ee,j),Ln=null,si=!1}else W0(q,ee,j);var ve=j.alternate;ve!==null&&(ve.return=null),j.return=null}catch(Te){Gt(j,c,Te)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Bb(c,u),c=c.sibling}function Bb(u,c){var k=u.alternate,I=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:if(ui(c,u),Di(u),I&4){try{Ou(3,u,u.return),Mf(3,u)}catch(De){Gt(u,u.return,De)}try{Ou(5,u,u.return)}catch(De){Gt(u,u.return,De)}}break;case 1:ui(c,u),Di(u),I&512&&k!==null&&Wl(k,k.return);break;case 5:if(ui(c,u),Di(u),I&512&&k!==null&&Wl(k,k.return),J){if(u.flags&32){var j=u.stateNode;try{Se(j)}catch(De){Gt(u,u.return,De)}}if(I&4&&(j=u.stateNode,j!=null)){var q=u.memoizedProps;if(k=k!==null?k.memoizedProps:q,I=u.type,c=u.updateQueue,u.updateQueue=null,c!==null)try{We(j,c,I,k,q,u)}catch(De){Gt(u,u.return,De)}}}break;case 6:if(ui(c,u),Di(u),I&4&&J){if(u.stateNode===null)throw Error(a(162));j=u.stateNode,q=u.memoizedProps,k=k!==null?k.memoizedProps:q;try{Me(j,k,q)}catch(De){Gt(u,u.return,De)}}break;case 3:if(ui(c,u),Di(u),I&4){if(J&&ie&&k!==null&&k.memoizedState.isDehydrated)try{tn(c.containerInfo)}catch(De){Gt(u,u.return,De)}if(ne){j=c.containerInfo,q=c.pendingChildren;try{ke(j,q)}catch(De){Gt(u,u.return,De)}}}break;case 4:if(ui(c,u),Di(u),I&4&&ne){q=u.stateNode,j=q.containerInfo,q=q.pendingChildren;try{ke(j,q)}catch(De){Gt(u,u.return,De)}}break;case 13:ui(c,u),Di(u),j=u.child,j.flags&8192&&(q=j.memoizedState!==null,j.stateNode.isHidden=q,!q||j.alternate!==null&&j.alternate.memoizedState!==null||(e1=Pn())),I&4&&zb(u);break;case 22:var ee=k!==null&&k.memoizedState!==null;if(u.mode&1?(Gn=(k=Gn)||ee,ui(c,u),Gn=k):ui(c,u),Di(u),I&8192){if(k=u.memoizedState!==null,(u.stateNode.isHidden=k)&&!ee&&u.mode&1)for(Be=u,I=u.child;I!==null;){for(c=Be=I;Be!==null;){ee=Be;var le=ee.child;switch(ee.tag){case 0:case 11:case 14:case 15:Ou(4,ee,ee.return);break;case 1:Wl(ee,ee.return);var ve=ee.stateNode;if(typeof ve.componentWillUnmount=="function"){var Te=ee,He=ee.return;try{var nt=Te;ve.props=nt.memoizedProps,ve.state=nt.memoizedState,ve.componentWillUnmount()}catch(De){Gt(Te,He,De)}}break;case 5:Wl(ee,ee.return);break;case 22:if(ee.memoizedState!==null){$b(c);continue}}le!==null?(le.return=ee,Be=le):$b(c)}I=I.sibling}if(J){e:if(I=null,J)for(c=u;;){if(c.tag===5){if(I===null){I=c;try{j=c.stateNode,k?Le(j):ge(c.stateNode,c.memoizedProps)}catch(De){Gt(u,u.return,De)}}}else if(c.tag===6){if(I===null)try{q=c.stateNode,k?Ne(q):Xe(q,c.memoizedProps)}catch(De){Gt(u,u.return,De)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===u)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break e;for(;c.sibling===null;){if(c.return===null||c.return===u)break e;I===c&&(I=null),c=c.return}I===c&&(I=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:ui(c,u),Di(u),I&4&&zb(u);break;case 21:break;default:ui(c,u),Di(u)}}function Di(u){var c=u.flags;if(c&2){try{if(J){e:{for(var k=u.return;k!==null;){if(jb(k)){var I=k;break e}k=k.return}throw Error(a(160))}switch(I.tag){case 5:var j=I.stateNode;I.flags&32&&(Se(j),I.flags&=-33);var q=Fb(u);q0(u,q,j);break;case 3:case 4:var ee=I.stateNode.containerInfo,le=Fb(u);V0(u,le,ee);break;default:throw Error(a(161))}}}catch(ve){Gt(u,u.return,ve)}u.flags&=-3}c&4096&&(u.flags&=-4097)}function fE(u,c,k){Be=u,Ub(u)}function Ub(u,c,k){for(var I=(u.mode&1)!==0;Be!==null;){var j=Be,q=j.child;if(j.tag===22&&I){var ee=j.memoizedState!==null||Rf;if(!ee){var le=j.alternate,ve=le!==null&&le.memoizedState!==null||Gn;le=Rf;var Te=Gn;if(Rf=ee,(Gn=ve)&&!Te)for(Be=j;Be!==null;)ee=Be,ve=ee.child,ee.tag===22&&ee.memoizedState!==null?Gb(j):ve!==null?(ve.return=ee,Be=ve):Gb(j);for(;q!==null;)Be=q,Ub(q),q=q.sibling;Be=j,Rf=le,Gn=Te}Hb(u)}else j.subtreeFlags&8772&&q!==null?(q.return=j,Be=q):Hb(u)}}function Hb(u){for(;Be!==null;){var c=Be;if(c.flags&8772){var k=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:Gn||Mf(5,c);break;case 1:var I=c.stateNode;if(c.flags&4&&!Gn)if(k===null)I.componentDidMount();else{var j=c.elementType===c.type?k.memoizedProps:li(c.type,k.memoizedProps);I.componentDidUpdate(j,k.memoizedState,I.__reactInternalSnapshotBeforeUpdate)}var q=c.updateQueue;q!==null&&V2(c,q,I);break;case 3:var ee=c.updateQueue;if(ee!==null){if(k=null,c.child!==null)switch(c.child.tag){case 5:k=Z(c.child.stateNode);break;case 1:k=c.child.stateNode}V2(c,ee,k)}break;case 5:var le=c.stateNode;k===null&&c.flags&4&&ze(le,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(ie&&c.memoizedState===null){var ve=c.alternate;if(ve!==null){var Te=ve.memoizedState;if(Te!==null){var He=Te.dehydrated;He!==null&&ri(He)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}Gn||c.flags&512&&G0(c)}catch(nt){Gt(c,c.return,nt)}}if(c===u){Be=null;break}if(k=c.sibling,k!==null){k.return=c.return,Be=k;break}Be=c.return}}function $b(u){for(;Be!==null;){var c=Be;if(c===u){Be=null;break}var k=c.sibling;if(k!==null){k.return=c.return,Be=k;break}Be=c.return}}function Gb(u){for(;Be!==null;){var c=Be;try{switch(c.tag){case 0:case 11:case 15:var k=c.return;try{Mf(4,c)}catch(ve){Gt(c,k,ve)}break;case 1:var I=c.stateNode;if(typeof I.componentDidMount=="function"){var j=c.return;try{I.componentDidMount()}catch(ve){Gt(c,j,ve)}}var q=c.return;try{G0(c)}catch(ve){Gt(c,q,ve)}break;case 5:var ee=c.return;try{G0(c)}catch(ve){Gt(c,ee,ve)}}}catch(ve){Gt(c,c.return,ve)}if(c===u){Be=null;break}var le=c.sibling;if(le!==null){le.return=c.return,Be=le;break}Be=c.return}}var Lf=0,Nf=1,If=2,Df=3,jf=4;if(typeof Symbol=="function"&&Symbol.for){var xu=Symbol.for;Lf=xu("selector.component"),Nf=xu("selector.has_pseudo_class"),If=xu("selector.role"),Df=xu("selector.test_id"),jf=xu("selector.text")}function Y0(u){var c=oe(u);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(a(364));return c}if(u=be(u),u===null)throw Error(a(362));return u.stateNode.current}function K0(u,c){switch(c.$$typeof){case Lf:if(u.type===c.value)return!0;break;case Nf:e:{c=c.value,u=[u,0];for(var k=0;k<u.length;){var I=u[k++],j=u[k++],q=c[j];if(I.tag!==5||!he(I)){for(;q!=null&&K0(I,q);)j++,q=c[j];if(j===c.length){c=!0;break e}else for(I=I.child;I!==null;)u.push(I,j),I=I.sibling}}c=!1}return c;case If:if(u.tag===5&&Ee(u.stateNode,c.value))return!0;break;case jf:if((u.tag===5||u.tag===6)&&(u=fe(u),u!==null&&0<=u.indexOf(c.value)))return!0;break;case Df:if(u.tag===5&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(a(365))}return!1}function X0(u){switch(u.$$typeof){case Lf:return"<"+(C(u.value)||"Unknown")+">";case Nf:return":has("+(X0(u)||"")+")";case If:return'[role="'+u.value+'"]';case jf:return'"'+u.value+'"';case Df:return'[data-testname="'+u.value+'"]';default:throw Error(a(365))}}function Vb(u,c){var k=[];u=[u,0];for(var I=0;I<u.length;){var j=u[I++],q=u[I++],ee=c[q];if(j.tag!==5||!he(j)){for(;ee!=null&&K0(j,ee);)q++,ee=c[q];if(q===c.length)k.push(j);else for(j=j.child;j!==null;)u.push(j,q),j=j.sibling}}return k}function Z0(u,c){if(!we)throw Error(a(363));u=Y0(u),u=Vb(u,c),c=[],u=Array.from(u);for(var k=0;k<u.length;){var I=u[k++];if(I.tag===5)he(I)||c.push(I.stateNode);else for(I=I.child;I!==null;)u.push(I),I=I.sibling}return c}var dE=Math.ceil,Ff=l.ReactCurrentDispatcher,Q0=l.ReactCurrentOwner,an=l.ReactCurrentBatchConfig,ct=0,kn=null,cn=null,Nn=0,Or=0,Yl=Fo(0),vn=0,Pu=null,Ha=0,zf=0,J0=0,Cu=null,lr=null,e1=0,t1=1/0,uo=null;function Kl(){t1=Pn()+500}var Bf=!1,n1=null,Ho=null,Uf=!1,$o=null,Hf=0,ku=0,r1=null,$f=-1,Gf=0;function Vn(){return ct&6?Pn():$f!==-1?$f:$f=Pn()}function Go(u){return u.mode&1?ct&2&&Nn!==0?Nn&-Nn:YS.transition!==null?(Gf===0&&(Gf=T2()),Gf):(u=yt,u!==0?u:me()):1}function $r(u,c,k,I){if(50<ku)throw ku=0,r1=null,Error(a(185));du(u,k,I),(!(ct&2)||u!==kn)&&(u===kn&&(!(ct&2)&&(zf|=k),vn===4&&Vo(u,Nn)),sr(u,I),k===1&&ct===0&&!(c.mode&1)&&(Kl(),cf&&Ai()))}function sr(u,c){var k=u.callbackNode;zS(u,c);var I=sf(u,u===kn?Nn:0);if(I===0)k!==null&&R2(k),u.callbackNode=null,u.callbackPriority=0;else if(c=I&-I,u.callbackPriority!==c){if(k!=null&&R2(k),c===1)u.tag===0?WS(Wb.bind(null,u)):M2(Wb.bind(null,u)),re?ae(function(){!(ct&6)&&Ai()}):a0(l0,Ai),k=null;else{switch(A2(I)){case 1:k=l0;break;case 4:k=$S;break;case 16:k=s0;break;case 536870912:k=GS;break;default:k=s0}k=n3(k,qb.bind(null,u))}u.callbackPriority=c,u.callbackNode=k}}function qb(u,c){if($f=-1,Gf=0,ct&6)throw Error(a(327));var k=u.callbackNode;if(Va()&&u.callbackNode!==k)return null;var I=sf(u,u===kn?Nn:0);if(I===0)return null;if(I&30||I&u.expiredLanes||c)c=Vf(u,I);else{c=I;var j=ct;ct|=2;var q=Xb();(kn!==u||Nn!==c)&&(uo=null,Kl(),$a(u,c));do try{gE();break}catch(le){Kb(u,le)}while(!0);v0(),Ff.current=q,ct=j,cn!==null?c=0:(kn=null,Nn=0,c=vn)}if(c!==0){if(c===2&&(j=r0(u),j!==0&&(I=j,c=i1(u,j))),c===1)throw k=Pu,$a(u,0),Vo(u,I),sr(u,Pn()),k;if(c===6)Vo(u,I);else{if(j=u.current.alternate,!(I&30)&&!hE(j)&&(c=Vf(u,I),c===2&&(q=r0(u),q!==0&&(I=q,c=i1(u,q))),c===1))throw k=Pu,$a(u,0),Vo(u,I),sr(u,Pn()),k;switch(u.finishedWork=j,u.finishedLanes=I,c){case 0:case 1:throw Error(a(345));case 2:Ga(u,lr,uo);break;case 3:if(Vo(u,I),(I&130023424)===I&&(c=e1+500-Pn(),10<c)){if(sf(u,0)!==0)break;if(j=u.suspendedLanes,(j&I)!==I){Vn(),u.pingedLanes|=u.suspendedLanes&j;break}u.timeoutHandle=z(Ga.bind(null,u,lr,uo),c);break}Ga(u,lr,uo);break;case 4:if(Vo(u,I),(I&4194240)===I)break;for(c=u.eventTimes,j=-1;0<I;){var ee=31-ii(I);q=1<<ee,ee=c[ee],ee>j&&(j=ee),I&=~q}if(I=j,I=Pn()-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){u.timeoutHandle=z(Ga.bind(null,u,lr,uo),I);break}Ga(u,lr,uo);break;case 5:Ga(u,lr,uo);break;default:throw Error(a(329))}}}return sr(u,Pn()),u.callbackNode===k?qb.bind(null,u):null}function i1(u,c){var k=Cu;return u.current.memoizedState.isDehydrated&&($a(u,c).flags|=256),u=Vf(u,c),u!==2&&(c=lr,lr=k,c!==null&&o1(c)),u}function o1(u){lr===null?lr=u:lr.push.apply(lr,u)}function hE(u){for(var c=u;;){if(c.flags&16384){var k=c.updateQueue;if(k!==null&&(k=k.stores,k!==null))for(var I=0;I<k.length;I++){var j=k[I],q=j.getSnapshot;j=j.value;try{if(!oi(q(),j))return!1}catch{return!1}}}if(k=c.child,c.subtreeFlags&16384&&k!==null)k.return=c,c=k;else{if(c===u)break;for(;c.sibling===null;){if(c.return===null||c.return===u)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Vo(u,c){for(c&=~J0,c&=~zf,u.suspendedLanes|=c,u.pingedLanes&=~c,u=u.expirationTimes;0<c;){var k=31-ii(c),I=1<<k;u[k]=-1,c&=~I}}function Wb(u){if(ct&6)throw Error(a(327));Va();var c=sf(u,0);if(!(c&1))return sr(u,Pn()),null;var k=Vf(u,c);if(u.tag!==0&&k===2){var I=r0(u);I!==0&&(c=I,k=i1(u,I))}if(k===1)throw k=Pu,$a(u,0),Vo(u,c),sr(u,Pn()),k;if(k===6)throw Error(a(345));return u.finishedWork=u.current.alternate,u.finishedLanes=c,Ga(u,lr,uo),sr(u,Pn()),null}function Yb(u){$o!==null&&$o.tag===0&&!(ct&6)&&Va();var c=ct;ct|=1;var k=an.transition,I=yt;try{if(an.transition=null,yt=1,u)return u()}finally{yt=I,an.transition=k,ct=c,!(ct&6)&&Ai()}}function a1(){Or=Yl.current,zt(Yl)}function $a(u,c){u.finishedWork=null,u.finishedLanes=0;var k=u.timeoutHandle;if(k!==X&&(u.timeoutHandle=X,K(k)),cn!==null)for(k=cn.return;k!==null;){var I=k;switch(f0(I),I.tag){case 1:I=I.type.childContextTypes,I!=null&&rf();break;case 3:Vl(),zt(ir),zt(Un),O0();break;case 5:S0(I);break;case 4:Vl();break;case 13:zt(Kt);break;case 19:zt(Kt);break;case 10:m0(I.type._context);break;case 22:case 23:a1()}k=k.return}if(kn=u,cn=u=qo(u.current,null),Nn=Or=c,vn=0,Pu=null,J0=zf=Ha=0,lr=Cu=null,Ba!==null){for(c=0;c<Ba.length;c++)if(k=Ba[c],I=k.interleaved,I!==null){k.interleaved=null;var j=I.next,q=k.pending;if(q!==null){var ee=q.next;q.next=j,I.next=ee}k.pending=I}Ba=null}return u}function Kb(u,c){do{var k=cn;try{if(v0(),wf.current=xf,Sf){for(var I=Xt.memoizedState;I!==null;){var j=I.queue;j!==null&&(j.pending=null),I=I.next}Sf=!1}if(Ua=0,Cn=gn=Xt=null,mu=!1,yu=0,Q0.current=null,k===null||k.return===null){vn=1,Pu=c,cn=null;break}e:{var q=u,ee=k.return,le=k,ve=c;if(c=Nn,le.flags|=32768,ve!==null&&typeof ve=="object"&&typeof ve.then=="function"){var Te=ve,He=le,nt=He.tag;if(!(He.mode&1)&&(nt===0||nt===11||nt===15)){var De=He.alternate;De?(He.updateQueue=De.updateQueue,He.memoizedState=De.memoizedState,He.lanes=De.lanes):(He.updateQueue=null,He.memoizedState=null)}var Bt=_b(ee);if(Bt!==null){Bt.flags&=-257,wb(Bt,ee,le,q,c),Bt.mode&1&&bb(q,Te,c),c=Bt,ve=Te;var Mt=c.updateQueue;if(Mt===null){var ur=new Set;ur.add(ve),c.updateQueue=ur}else Mt.add(ve);break e}else{if(!(c&1)){bb(q,Te,c),l1();break e}ve=Error(a(426))}}else if($t&&le.mode&1){var co=_b(ee);if(co!==null){!(co.flags&65536)&&(co.flags|=256),wb(co,ee,le,q,c),p0(ql(ve,le));break e}}q=ve=ql(ve,le),vn!==4&&(vn=2),Cu===null?Cu=[q]:Cu.push(q),q=ee;do{switch(q.tag){case 3:q.flags|=65536,c&=-c,q.lanes|=c;var pe=mb(q,ve,c);G2(q,pe);break e;case 1:le=ve;var se=q.type,ye=q.stateNode;if(!(q.flags&128)&&(typeof se.getDerivedStateFromError=="function"||ye!==null&&typeof ye.componentDidCatch=="function"&&(Ho===null||!Ho.has(ye)))){q.flags|=65536,c&=-c,q.lanes|=c;var je=yb(q,le,c);G2(q,je);break e}}q=q.return}while(q!==null)}Qb(k)}catch(Ke){c=Ke,cn===k&&k!==null&&(cn=k=k.return);continue}break}while(!0)}function Xb(){var u=Ff.current;return Ff.current=xf,u===null?xf:u}function l1(){(vn===0||vn===3||vn===2)&&(vn=4),kn===null||!(Ha&268435455)&&!(zf&268435455)||Vo(kn,Nn)}function Vf(u,c){var k=ct;ct|=2;var I=Xb();(kn!==u||Nn!==c)&&(uo=null,$a(u,c));do try{pE();break}catch(j){Kb(u,j)}while(!0);if(v0(),ct=k,Ff.current=I,cn!==null)throw Error(a(261));return kn=null,Nn=0,vn}function pE(){for(;cn!==null;)Zb(cn)}function gE(){for(;cn!==null&&!US();)Zb(cn)}function Zb(u){var c=t3(u.alternate,u,Or);u.memoizedProps=u.pendingProps,c===null?Qb(u):cn=c,Q0.current=null}function Qb(u){var c=u;do{var k=c.alternate;if(u=c.return,c.flags&32768){if(k=sE(k,c),k!==null){k.flags&=32767,cn=k;return}if(u!==null)u.flags|=32768,u.subtreeFlags=0,u.deletions=null;else{vn=6,cn=null;return}}else if(k=lE(k,c,Or),k!==null){cn=k;return}if(c=c.sibling,c!==null){cn=c;return}cn=c=u}while(c!==null);vn===0&&(vn=5)}function Ga(u,c,k){var I=yt,j=an.transition;try{an.transition=null,yt=1,vE(u,c,k,I)}finally{an.transition=j,yt=I}return null}function vE(u,c,k,I){do Va();while($o!==null);if(ct&6)throw Error(a(327));k=u.finishedWork;var j=u.finishedLanes;if(k===null)return null;if(u.finishedWork=null,u.finishedLanes=0,k===u.current)throw Error(a(177));u.callbackNode=null,u.callbackPriority=0;var q=k.lanes|k.childLanes;if(BS(u,q),u===kn&&(cn=kn=null,Nn=0),!(k.subtreeFlags&2064)&&!(k.flags&2064)||Uf||(Uf=!0,n3(s0,function(){return Va(),null})),q=(k.flags&15990)!==0,k.subtreeFlags&15990||q){q=an.transition,an.transition=null;var ee=yt;yt=1;var le=ct;ct|=4,Q0.current=null,cE(u,k),Bb(k,u),M(u.containerInfo),u.current=k,fE(k),HS(),ct=le,yt=ee,an.transition=q}else u.current=k;if(Uf&&(Uf=!1,$o=u,Hf=j),q=u.pendingLanes,q===0&&(Ho=null),VS(k.stateNode),sr(u,Pn()),c!==null)for(I=u.onRecoverableError,k=0;k<c.length;k++)j=c[k],I(j.value,{componentStack:j.stack,digest:j.digest});if(Bf)throw Bf=!1,u=n1,n1=null,u;return Hf&1&&u.tag!==0&&Va(),q=u.pendingLanes,q&1?u===r1?ku++:(ku=0,r1=u):ku=0,Ai(),null}function Va(){if($o!==null){var u=A2(Hf),c=an.transition,k=yt;try{if(an.transition=null,yt=16>u?16:u,$o===null)var I=!1;else{if(u=$o,$o=null,Hf=0,ct&6)throw Error(a(331));var j=ct;for(ct|=4,Be=u.current;Be!==null;){var q=Be,ee=q.child;if(Be.flags&16){var le=q.deletions;if(le!==null){for(var ve=0;ve<le.length;ve++){var Te=le[ve];for(Be=Te;Be!==null;){var He=Be;switch(He.tag){case 0:case 11:case 15:Ou(8,He,q)}var nt=He.child;if(nt!==null)nt.return=He,Be=nt;else for(;Be!==null;){He=Be;var De=He.sibling,Bt=He.return;if(Db(He),He===Te){Be=null;break}if(De!==null){De.return=Bt,Be=De;break}Be=Bt}}}var Mt=q.alternate;if(Mt!==null){var ur=Mt.child;if(ur!==null){Mt.child=null;do{var co=ur.sibling;ur.sibling=null,ur=co}while(ur!==null)}}Be=q}}if(q.subtreeFlags&2064&&ee!==null)ee.return=q,Be=ee;else e:for(;Be!==null;){if(q=Be,q.flags&2048)switch(q.tag){case 0:case 11:case 15:Ou(9,q,q.return)}var pe=q.sibling;if(pe!==null){pe.return=q.return,Be=pe;break e}Be=q.return}}var se=u.current;for(Be=se;Be!==null;){ee=Be;var ye=ee.child;if(ee.subtreeFlags&2064&&ye!==null)ye.return=ee,Be=ye;else e:for(ee=se;Be!==null;){if(le=Be,le.flags&2048)try{switch(le.tag){case 0:case 11:case 15:Mf(9,le)}}catch(Ke){Gt(le,le.return,Ke)}if(le===ee){Be=null;break e}var je=le.sibling;if(je!==null){je.return=le.return,Be=je;break e}Be=le.return}}if(ct=j,Ai(),Ti&&typeof Ti.onPostCommitFiberRoot=="function")try{Ti.onPostCommitFiberRoot(uf,u)}catch{}I=!0}return I}finally{yt=k,an.transition=c}}return!1}function Jb(u,c,k){c=ql(k,c),c=mb(u,c,1),u=Uo(u,c,1),c=Vn(),u!==null&&(du(u,1,c),sr(u,c))}function Gt(u,c,k){if(u.tag===3)Jb(u,u,k);else for(;c!==null;){if(c.tag===3){Jb(c,u,k);break}else if(c.tag===1){var I=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof I.componentDidCatch=="function"&&(Ho===null||!Ho.has(I))){u=ql(k,u),u=yb(c,u,1),c=Uo(c,u,1),u=Vn(),c!==null&&(du(c,1,u),sr(c,u));break}}c=c.return}}function mE(u,c,k){var I=u.pingCache;I!==null&&I.delete(c),c=Vn(),u.pingedLanes|=u.suspendedLanes&k,kn===u&&(Nn&k)===k&&(vn===4||vn===3&&(Nn&130023424)===Nn&&500>Pn()-e1?$a(u,0):J0|=k),sr(u,c)}function e3(u,c){c===0&&(u.mode&1?(c=lf,lf<<=1,!(lf&130023424)&&(lf=4194304)):c=1);var k=Vn();u=Ri(u,c),u!==null&&(du(u,c,k),sr(u,k))}function yE(u){var c=u.memoizedState,k=0;c!==null&&(k=c.retryLane),e3(u,k)}function bE(u,c){var k=0;switch(u.tag){case 13:var I=u.stateNode,j=u.memoizedState;j!==null&&(k=j.retryLane);break;case 19:I=u.stateNode;break;default:throw Error(a(314))}I!==null&&I.delete(c),e3(u,k)}var t3;t3=function(u,c,k){if(u!==null)if(u.memoizedProps!==c.pendingProps||ir.current)ar=!0;else{if(!(u.lanes&k)&&!(c.flags&128))return ar=!1,aE(u,c,k);ar=!!(u.flags&131072)}else ar=!1,$t&&c.flags&1048576&&L2(c,df,c.index);switch(c.lanes=0,c.tag){case 2:var I=c.type;kf(u,c),u=c.pendingProps;var j=jl(c,Un.current);$l(c,k),j=C0(null,c,I,u,j,k);var q=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,or(I)?(q=!0,of(c)):q=!1,c.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,_0(c),j.updater=Pf,c.stateNode=j,j._reactInternals=c,N0(c,I,u,k),c=F0(null,c,I,!0,q,k)):(c.tag=0,$t&&q&&c0(c),Zn(null,c,j,k),c=c.child),c;case 16:I=c.elementType;e:{switch(kf(u,c),u=c.pendingProps,j=I._init,I=j(I._payload),c.type=I,j=c.tag=wE(I),u=li(I,u),j){case 0:c=j0(null,c,I,u,k);break e;case 1:c=Cb(null,c,I,u,k);break e;case 11:c=Sb(null,c,I,u,k);break e;case 14:c=Eb(null,c,I,li(I.type,u),k);break e}throw Error(a(306,I,""))}return c;case 0:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:li(I,j),j0(u,c,I,j,k);case 1:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:li(I,j),Cb(u,c,I,j,k);case 3:e:{if(kb(c),u===null)throw Error(a(387));I=c.pendingProps,q=c.memoizedState,j=q.element,$2(u,c),bf(c,I,null,k);var ee=c.memoizedState;if(I=ee.element,ie&&q.isDehydrated)if(q={element:I,isDehydrated:!1,cache:ee.cache,pendingSuspenseBoundaries:ee.pendingSuspenseBoundaries,transitions:ee.transitions},c.updateQueue.baseState=q,c.memoizedState=q,c.flags&256){j=ql(Error(a(423)),c),c=Tb(u,c,I,k,j);break e}else if(I!==j){j=ql(Error(a(424)),c),c=Tb(u,c,I,k,j);break e}else for(ie&&(zr=et(c.stateNode.containerInfo),Er=c,$t=!0,ai=null,hu=!1),k=B2(c,null,I,k),c.child=k;k;)k.flags=k.flags&-3|4096,k=k.sibling;else{if(Bl(),I===j){c=so(u,c,k);break e}Zn(u,c,I,k)}c=c.child}return c;case 5:return q2(c),u===null&&h0(c),I=c.type,j=c.pendingProps,q=u!==null?u.memoizedProps:null,ee=j.children,F(I,j)?ee=null:q!==null&&F(I,q)&&(c.flags|=32),Pb(u,c),Zn(u,c,ee,k),c.child;case 6:return u===null&&h0(c),null;case 13:return Ab(u,c,k);case 4:return w0(c,c.stateNode.containerInfo),I=c.pendingProps,u===null?c.child=Ul(c,null,I,k):Zn(u,c,I,k),c.child;case 11:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:li(I,j),Sb(u,c,I,j,k);case 7:return Zn(u,c,c.pendingProps,k),c.child;case 8:return Zn(u,c,c.pendingProps.children,k),c.child;case 12:return Zn(u,c,c.pendingProps.children,k),c.child;case 10:e:{if(I=c.type._context,j=c.pendingProps,q=c.memoizedProps,ee=j.value,U2(c,I,ee),q!==null)if(oi(q.value,ee)){if(q.children===j.children&&!ir.current){c=so(u,c,k);break e}}else for(q=c.child,q!==null&&(q.return=c);q!==null;){var le=q.dependencies;if(le!==null){ee=q.child;for(var ve=le.firstContext;ve!==null;){if(ve.context===I){if(q.tag===1){ve=lo(-1,k&-k),ve.tag=2;var Te=q.updateQueue;if(Te!==null){Te=Te.shared;var He=Te.pending;He===null?ve.next=ve:(ve.next=He.next,He.next=ve),Te.pending=ve}}q.lanes|=k,ve=q.alternate,ve!==null&&(ve.lanes|=k),y0(q.return,k,c),le.lanes|=k;break}ve=ve.next}}else if(q.tag===10)ee=q.type===c.type?null:q.child;else if(q.tag===18){if(ee=q.return,ee===null)throw Error(a(341));ee.lanes|=k,le=ee.alternate,le!==null&&(le.lanes|=k),y0(ee,k,c),ee=q.sibling}else ee=q.child;if(ee!==null)ee.return=q;else for(ee=q;ee!==null;){if(ee===c){ee=null;break}if(q=ee.sibling,q!==null){q.return=ee.return,ee=q;break}ee=ee.return}q=ee}Zn(u,c,j.children,k),c=c.child}return c;case 9:return j=c.type,I=c.pendingProps.children,$l(c,k),j=Br(j),I=I(j),c.flags|=1,Zn(u,c,I,k),c.child;case 14:return I=c.type,j=li(I,c.pendingProps),j=li(I.type,j),Eb(u,c,I,j,k);case 15:return Ob(u,c,c.type,c.pendingProps,k);case 17:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:li(I,j),kf(u,c),c.tag=1,or(I)?(u=!0,of(c)):u=!1,$l(c,k),gb(c,I,j),N0(c,I,j,k),F0(null,c,I,!0,u,k);case 19:return Mb(u,c,k);case 22:return xb(u,c,k)}throw Error(a(156,c.tag))};function n3(u,c){return a0(u,c)}function _E(u,c,k,I){this.tag=u,this.key=k,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=I,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gr(u,c,k,I){return new _E(u,c,k,I)}function s1(u){return u=u.prototype,!(!u||!u.isReactComponent)}function wE(u){if(typeof u=="function")return s1(u)?1:0;if(u!=null){if(u=u.$$typeof,u===g)return 11;if(u===y)return 14}return 2}function qo(u,c){var k=u.alternate;return k===null?(k=Gr(u.tag,c,u.key,u.mode),k.elementType=u.elementType,k.type=u.type,k.stateNode=u.stateNode,k.alternate=u,u.alternate=k):(k.pendingProps=c,k.type=u.type,k.flags=0,k.subtreeFlags=0,k.deletions=null),k.flags=u.flags&14680064,k.childLanes=u.childLanes,k.lanes=u.lanes,k.child=u.child,k.memoizedProps=u.memoizedProps,k.memoizedState=u.memoizedState,k.updateQueue=u.updateQueue,c=u.dependencies,k.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},k.sibling=u.sibling,k.index=u.index,k.ref=u.ref,k}function qf(u,c,k,I,j,q){var ee=2;if(I=u,typeof u=="function")s1(u)&&(ee=1);else if(typeof u=="string")ee=5;else e:switch(u){case h:return qa(k.children,j,q,c);case x:ee=8,j|=8;break;case w:return u=Gr(12,k,c,j|2),u.elementType=w,u.lanes=q,u;case b:return u=Gr(13,k,c,j),u.elementType=b,u.lanes=q,u;case p:return u=Gr(19,k,c,j),u.elementType=p,u.lanes=q,u;case m:return Wf(k,j,q,c);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case v:ee=10;break e;case O:ee=9;break e;case g:ee=11;break e;case y:ee=14;break e;case d:ee=16,I=null;break e}throw Error(a(130,u==null?u:typeof u,""))}return c=Gr(ee,k,c,j),c.elementType=u,c.type=I,c.lanes=q,c}function qa(u,c,k,I){return u=Gr(7,u,I,c),u.lanes=k,u}function Wf(u,c,k,I){return u=Gr(22,u,I,c),u.elementType=m,u.lanes=k,u.stateNode={isHidden:!1},u}function u1(u,c,k){return u=Gr(6,u,null,c),u.lanes=k,u}function c1(u,c,k){return c=Gr(4,u.children!==null?u.children:[],u.key,c),c.lanes=k,c.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},c}function SE(u,c,k,I,j){this.tag=c,this.containerInfo=u,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,ie&&(this.mutableSourceEagerHydrationData=null)}function r3(u,c,k,I,j,q,ee,le,ve){return u=new SE(u,c,k,le,ve),c===1?(c=1,q===!0&&(c|=8)):c=0,q=Gr(3,null,null,c),u.current=q,q.stateNode=u,q.memoizedState={element:I,isDehydrated:k,cache:null,transitions:null,pendingSuspenseBoundaries:null},_0(q),u}function i3(u){if(!u)return zo;u=u._reactInternals;e:{if(S(u)!==u||u.tag!==1)throw Error(a(170));var c=u;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(or(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(a(171))}if(u.tag===1){var k=u.type;if(or(k))return C2(u,k,c)}return c}function o3(u){var c=u._reactInternals;if(c===void 0)throw typeof u.render=="function"?Error(a(188)):(u=Object.keys(u).join(","),Error(a(268,u)));return u=T(c),u===null?null:u.stateNode}function a3(u,c){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var k=u.retryLane;u.retryLane=k!==0&&k<c?k:c}}function Yf(u,c){a3(u,c),(u=u.alternate)&&a3(u,c)}function EE(u){return u=T(u),u===null?null:u.stateNode}function OE(){return null}return n.attemptContinuousHydration=function(u){if(u.tag===13){var c=Ri(u,134217728);if(c!==null){var k=Vn();$r(c,u,134217728,k)}Yf(u,134217728)}},n.attemptDiscreteHydration=function(u){if(u.tag===13){var c=Ri(u,1);if(c!==null){var k=Vn();$r(c,u,1,k)}Yf(u,1)}},n.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var c=Go(u),k=Ri(u,c);if(k!==null){var I=Vn();$r(k,u,c,I)}Yf(u,c)}},n.attemptSynchronousHydration=function(u){switch(u.tag){case 3:var c=u.stateNode;if(c.current.memoizedState.isDehydrated){var k=fu(c.pendingLanes);k!==0&&(o0(c,k|1),sr(c,Pn()),!(ct&6)&&(Kl(),Ai()))}break;case 13:Yb(function(){var I=Ri(u,1);if(I!==null){var j=Vn();$r(I,u,1,j)}}),Yf(u,1)}},n.batchedUpdates=function(u,c){var k=ct;ct|=1;try{return u(c)}finally{ct=k,ct===0&&(Kl(),cf&&Ai())}},n.createComponentSelector=function(u){return{$$typeof:Lf,value:u}},n.createContainer=function(u,c,k,I,j,q,ee){return r3(u,c,!1,null,k,I,j,q,ee)},n.createHasPseudoClassSelector=function(u){return{$$typeof:Nf,value:u}},n.createHydrationContainer=function(u,c,k,I,j,q,ee,le,ve){return u=r3(k,I,!0,u,j,q,ee,le,ve),u.context=i3(null),k=u.current,I=Vn(),j=Go(k),q=lo(I,j),q.callback=c??null,Uo(k,q,j),u.current.lanes=j,du(u,j,I),sr(u,I),u},n.createPortal=function(u,c,k){var I=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:I==null?null:""+I,children:u,containerInfo:c,implementation:k}},n.createRoleSelector=function(u){return{$$typeof:If,value:u}},n.createTestNameSelector=function(u){return{$$typeof:Df,value:u}},n.createTextSelector=function(u){return{$$typeof:jf,value:u}},n.deferredUpdates=function(u){var c=yt,k=an.transition;try{return an.transition=null,yt=16,u()}finally{yt=c,an.transition=k}},n.discreteUpdates=function(u,c,k,I,j){var q=yt,ee=an.transition;try{return an.transition=null,yt=1,u(c,k,I,j)}finally{yt=q,an.transition=ee,ct===0&&Kl()}},n.findAllNodes=Z0,n.findBoundingRects=function(u,c){if(!we)throw Error(a(363));c=Z0(u,c),u=[];for(var k=0;k<c.length;k++)u.push(te(c[k]));for(c=u.length-1;0<c;c--){k=u[c];for(var I=k.x,j=I+k.width,q=k.y,ee=q+k.height,le=c-1;0<=le;le--)if(c!==le){var ve=u[le],Te=ve.x,He=Te+ve.width,nt=ve.y,De=nt+ve.height;if(I>=Te&&q>=nt&&j<=He&&ee<=De){u.splice(c,1);break}else if(I!==Te||k.width!==ve.width||De<q||nt>ee){if(!(q!==nt||k.height!==ve.height||He<I||Te>j)){Te>I&&(ve.width+=Te-I,ve.x=I),He<j&&(ve.width=j-Te),u.splice(c,1);break}}else{nt>q&&(ve.height+=nt-q,ve.y=q),De<ee&&(ve.height=ee-nt),u.splice(c,1);break}}}return u},n.findHostInstance=o3,n.findHostInstanceWithNoPortals=function(u){return u=P(u),u=u!==null?U(u):null,u===null?null:u.stateNode},n.findHostInstanceWithWarning=function(u){return o3(u)},n.flushControlled=function(u){var c=ct;ct|=1;var k=an.transition,I=yt;try{an.transition=null,yt=1,u()}finally{yt=I,an.transition=k,ct=c,ct===0&&(Kl(),Ai())}},n.flushPassiveEffects=Va,n.flushSync=Yb,n.focusWithin=function(u,c){if(!we)throw Error(a(363));for(u=Y0(u),c=Vb(u,c),c=Array.from(c),u=0;u<c.length;){var k=c[u++];if(!he(k)){if(k.tag===5&&Ve(k.stateNode))return!0;for(k=k.child;k!==null;)c.push(k),k=k.sibling}}return!1},n.getCurrentUpdatePriority=function(){return yt},n.getFindAllNodesFailureDescription=function(u,c){if(!we)throw Error(a(363));var k=0,I=[];u=[Y0(u),0];for(var j=0;j<u.length;){var q=u[j++],ee=u[j++],le=c[ee];if((q.tag!==5||!he(q))&&(K0(q,le)&&(I.push(X0(le)),ee++,ee>k&&(k=ee)),ee<c.length))for(q=q.child;q!==null;)u.push(q,ee),q=q.sibling}if(k<c.length){for(u=[];k<c.length;k++)u.push(X0(c[k]));return`findAllNodes was able to match part of the selector:
58
- `+(I.join(" > ")+`
59
-
60
- No matching component was found for:
61
- `)+u.join(" > ")}return null},n.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 5:return Z(u.child.stateNode);default:return u.child.stateNode}},n.injectIntoDevTools=function(u){if(u={bundleType:u.bundleType,version:u.version,rendererPackageName:u.rendererPackageName,rendererConfig:u.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:u.findFiberByHostInstance||OE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)u=!0;else{try{uf=c.inject(u),Ti=c}catch{}u=!!c.checkDCE}}return u},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(u,c,k,I){if(!we)throw Error(a(363));u=Z0(u,c);var j=Je(u,k,I).disconnect;return{disconnect:function(){j()}}},n.registerMutableSourceForHydration=function(u,c){var k=c._getVersion;k=k(c._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[c,k]:u.mutableSourceEagerHydrationData.push(c,k)},n.runWithPriority=function(u,c){var k=yt;try{return yt=u,c()}finally{yt=k}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(u,c,k,I){var j=c.current,q=Vn(),ee=Go(j);return k=i3(k),c.context===null?c.context=k:c.pendingContext=k,c=lo(q,ee),c.payload={element:u},I=I===void 0?null:I,I!==null&&(c.callback=I),u=Uo(j,c,ee),u!==null&&($r(u,j,ee,q),yf(u,j,ee)),ee},n};F9.exports=SM;var EM=F9.exports;const OM=kh(EM);var z9={exports:{}},Tl={};/**
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
- */Tl.ConcurrentRoot=1;Tl.ContinuousEventPriority=4;Tl.DefaultEventPriority=16;Tl.DiscreteEventPriority=1;Tl.IdleEventPriority=536870912;Tl.LegacyRoot=0;z9.exports=Tl;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 Ky=".react-konva-event";let U9=!1;function xM(t){U9=t}const PM=`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(t,e,n=kM){if(!h4&&"zIndex"in e&&(console.warn(CM),h4=!0),!p4&&e.draggable){var r=e.x!==void 0||e.y!==void 0,i=e.onDragEnd||e.onDragMove;r&&!i&&(console.warn(PM),p4=!0)}for(var o in n)if(!d4[o]){var a=o.slice(0,2)==="on",l=n[o]!==e[o];if(a&&l){var s=o.substr(2).toLowerCase();s.substr(0,7)==="content"&&(s="content"+s.substr(7,1).toUpperCase()+s.substr(8)),t.off(s,n[o])}var f=!e.hasOwnProperty(o);f&&t.setAttr(o,void 0)}var h=U9||e._useStrictMode,x={},w=!1;const v={};for(var o in e)if(!d4[o]){var a=o.slice(0,2)==="on",O=n[o]!==e[o];if(a&&O){var s=o.substr(2).toLowerCase();s.substr(0,7)==="content"&&(s="content"+s.substr(7,1).toUpperCase()+s.substr(8)),e[o]&&(v[s]=e[o])}!a&&(e[o]!==n[o]||h&&e[o]!==t.getAttr(o))&&(w=!0,x[o]=e[o])}w&&(t.setAttrs(x),La(t));for(var s in v)t.on(s+Ky,v[s])}function La(t){if(!st.Konva.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}const H9={},TM={};kc.Node.prototype._applyProps=Wp;function AM(t,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}t.add(e),La(t)}function RM(t,e,n){let r=kc[t];r||(console.error(`Konva has no node with the type ${t}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${t}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=kc.Group);const i={},o={};for(var a in e){var l=a.slice(0,2)==="on";l?o[a]=e[a]:i[a]=e[a]}const s=new r(i);return Wp(s,o),s}function MM(t,e,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function LM(t,e,n){return!1}function NM(t){return t}function IM(){return null}function DM(){return null}function jM(t,e,n,r){return TM}function FM(){}function zM(t){}function BM(t,e){return!1}function UM(){return H9}function HM(){return H9}const $M=setTimeout,GM=clearTimeout,VM=-1;function qM(t,e){return!1}const WM=!1,YM=!0,KM=!0;function XM(t,e){e.parent===t?e.moveToTop():t.add(e),La(t)}function ZM(t,e){e.parent===t?e.moveToTop():t.add(e),La(t)}function $9(t,e,n){e._remove(),t.add(e),e.setZIndex(n.getZIndex()),La(t)}function QM(t,e,n){$9(t,e,n)}function JM(t,e){e.destroy(),e.off(Ky),La(t)}function eL(t,e){e.destroy(),e.off(Ky),La(t)}function tL(t,e,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function nL(t,e,n){}function rL(t,e,n,r,i){Wp(t,i,r)}function iL(t){t.hide(),La(t)}function oL(t){}function aL(t,e){(e.visible==null||e.visible)&&t.show()}function lL(t,e){}function sL(t){}function uL(){}const cL=()=>B9.DefaultEventPriority,fL=Object.freeze(Object.defineProperty({__proto__:null,appendChild:XM,appendChildToContainer:ZM,appendInitialChild:AM,cancelTimeout:GM,clearContainer:sL,commitMount:nL,commitTextUpdate:tL,commitUpdate:rL,createInstance:RM,createTextInstance:MM,detachDeletedInstance:uL,finalizeInitialChildren:LM,getChildHostContext:HM,getCurrentEventPriority:cL,getPublicInstance:NM,getRootHostContext:UM,hideInstance:iL,hideTextInstance:oL,idlePriority:qu.unstable_IdlePriority,insertBefore:$9,insertInContainerBefore:QM,isPrimaryRenderer:WM,noTimeout:VM,now:qu.unstable_now,prepareForCommit:IM,preparePortalMount:DM,prepareUpdate:jM,removeChild:JM,removeChildFromContainer:eL,resetAfterCommit:FM,resetTextContent:zM,run:qu.unstable_runWithPriority,scheduleTimeout:$M,shouldDeprioritizeSubtree:BM,shouldSetTextContent:qM,supportsMutation:KM,unhideInstance:aL,unhideTextInstance:lL,warnsIfNotActing:YM},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=(t,e,n)=>e in t?dL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,m4=(t,e)=>{for(var n in e||(e={}))gL.call(e,n)&&v4(t,n,e[n]);if(g4)for(var n of g4(e))vL.call(e,n)&&v4(t,n,e[n]);return t},mL=(t,e)=>hL(t,pL(e)),y4,b4;typeof window<"u"&&((y4=window.document)!=null&&y4.createElement||((b4=window.navigator)==null?void 0:b4.product)==="ReactNative")?Qe.useLayoutEffect:Qe.useEffect;function G9(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=t.child;for(;r;){const i=G9(r,e,n);if(i)return i;r=r.sibling}}function V9(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const _4=console.error;console.error=function(){const t=[...arguments].join("");if(t!=null&&t.startsWith("Warning:")&&t.includes("useContext")){console.error=_4;return}return _4.apply(this,arguments)};const Xy=V9(Qe.createContext(null));class q9 extends Qe.Component{render(){return Qe.createElement(Xy.Provider,{value:this._reactInternals},this.props.children)}}function yL(){const t=Qe.useContext(Xy);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=Qe.useId();return Qe.useMemo(()=>{for(const r of[t,t==null?void 0:t.alternate]){if(!r)continue;const i=G9(r,!1,o=>{let a=o.memoizedState;for(;a;){if(a.memoizedState===e)return!0;a=a.next}});if(i)return i}},[t,e])}function bL(){const t=yL(),[e]=Qe.useState(()=>new Map);e.clear();let n=t;for(;n;){if(n.type&&typeof n.type=="object"){const i=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;i&&i!==Xy&&!e.has(i)&&e.set(i,Qe.useContext(V9(i)))}n=n.return}return e}function W9(){const t=bL();return Qe.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>Qe.createElement(e,null,Qe.createElement(n.Provider,mL(m4({},r),{value:t.get(n)}))),e=>Qe.createElement(q9,m4({},e))),[t])}function _L(t){const e=dt.useRef({});return dt.useLayoutEffect(()=>{e.current=t}),dt.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const wL=t=>{const e=dt.useRef(),n=dt.useRef(),r=dt.useRef(),i=_L(t),o=W9(),a=l=>{const{forwardedRef:s}=t;s&&(typeof s=="function"?s(l):s.current=l)};return dt.useLayoutEffect(()=>(n.current=new kc.Stage({width:t.width,height:t.height,container:e.current}),a(n.current),r.current=vs.createContainer(n.current,B9.LegacyRoot,!1,null),vs.updateContainer(dt.createElement(o,{},t.children),r.current),()=>{kc.isBrowser&&(a(null),vs.updateContainer(null,r.current,null),n.current.destroy())}),[]),dt.useLayoutEffect(()=>{a(n.current),Wp(n.current,t,i),vs.updateContainer(dt.createElement(o,{},t.children),r.current,null)}),dt.createElement("div",{ref:e,id:t.id,accessKey:t.accessKey,className:t.className,role:t.role,style:t.style,tabIndex:t.tabIndex,title:t.title})},SL="Layer",EL="FastLayer",Oh="Group",OL="Label",xL="Rect",PL="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",vs=OM(fL);vs.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:dt.version,rendererPackageName:"react-konva"});const $L=dt.forwardRef((t,e)=>dt.createElement(q9,{},dt.createElement(wL,{...t,forwardedRef:e}))),GL=xM,VL=Object.freeze(Object.defineProperty({__proto__:null,Arc:DL,Arrow:BL,Circle:PL,Ellipse:CL,FastLayer:EL,Group:Oh,Image:RL,KonvaRenderer:vs,Label:OL,Layer:SL,Line:TL,Path:FL,Rect:xL,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"})),Io=_a(VL);var Ya=Qe,Yp=function(e,n,r){const i=Ya.useRef("loading"),o=Ya.useRef(),[a,l]=Ya.useState(0),s=Ya.useRef(),f=Ya.useRef(),h=Ya.useRef();return(s.current!==e||f.current!==n||h.current!==r)&&(i.current="loading",o.current=void 0,s.current=e,f.current=n,h.current=r),Ya.useLayoutEffect(function(){if(!e)return;var x=document.createElement("img");function w(){i.current="loaded",o.current=x,l(Math.random())}function v(){i.current="failed",o.current=void 0,l(Math.random())}return x.addEventListener("load",w),x.addEventListener("error",v),n&&(x.crossOrigin=n),r&&(x.referrerPolicy=r),x.src=e,function(){x.removeEventListener("load",w),x.removeEventListener("error",v)}},[e,n,r]),[o.current,i.current]};const qL=kh(Yp);var Y9={},Zy={},WL=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const YL=t=>{const e=window.getComputedStyle(t).position;return!(e==="absolute"||e==="relative")};function K9(t=()=>{}){const e=dt.useRef(t);return e.current=t,dt.useCallback((...n)=>e.current.apply(null,n),[])}const KL=({children:t,groupProps:e,divProps:n,transform:r,transformFunc:i})=>{const o=W9(),a=dt.useRef(null);dt.useRef();const[l]=dt.useState(()=>document.createElement("div")),s=dt.useMemo(()=>zd.createRoot(l),[l]),f=r??!0,h=K9(()=>{if(f&&a.current){let g=a.current.getAbsoluteTransform().decompose();i&&(g=i(g)),l.style.position="absolute",l.style.zIndex="10",l.style.top="0px",l.style.left="0px",l.style.transform=`translate(${g.x}px, ${g.y}px) rotate(${g.rotation}deg) scaleX(${g.scaleX}) scaleY(${g.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 x=n||{},{style:w}=x,v=WL(x,["style"]);Object.assign(l.style,w),Object.assign(l,v)});return dt.useLayoutEffect(()=>{var x;const w=a.current;if(!w)return;const v=(x=w.getStage())===null||x===void 0?void 0:x.container();if(v)return v.appendChild(l),f&&YL(v)&&(v.style.position="relative"),w.on("absoluteTransformChange",h),h(),()=>{var O;w.off("absoluteTransformChange",h),(O=l.parentNode)===null||O===void 0||O.removeChild(l)}},[f]),dt.useLayoutEffect(()=>{h()},[n,i]),dt.useLayoutEffect(()=>{s.render(dt.createElement(o,null,t))}),dt.useLayoutEffect(()=>()=>{setTimeout(()=>{s.unmount()})},[]),dt.createElement(Oh,Object.assign({ref:a},e))},XL=({selector:t,enabled:e,children:n})=>{const r=dt.useRef(null),i=dt.useRef(null),o=dt.useRef(),a=e??!0;return dt.useLayoutEffect(()=>{if(!r.current||!i.current)return;o.current=i.current;const s=r.current.getStage().findOne(t);a&&s?i.current.moveTo(s):i.current.moveTo(r.current);const f=r.current.getLayer();if(f&&(f.batchDraw(),s)){const h=s.getLayer();if(!h)return;h.batchDraw()}},[t,a]),dt.useEffect(()=>()=>{var l;(l=o.current)===null||l===void 0||l.destroy()},[]),dt.createElement(Oh,{name:"_outer_portal",ref:r},dt.createElement(Oh,{name:"_inner_portal",ref:i},n))},ZL=Object.freeze(Object.defineProperty({__proto__:null,Html:KL,Portal:XL,useEvent:K9,useImage:qL},Symbol.toStringTag,{value:"Module"})),Qc=_a(ZL);function QL(t,e){return Object.keys(t.values).forEach(n=>t.values[n]=t.values[n]&&parseFloat(t.values[n].toFixed(e))),t}function X9(t,e,n){const r=e-1,i=n[Q9(r,n.length)];return i.marker!=="Z"?i:X9(t,r,n)}function Z9(t,e,n){const r=e+1,i=n[Q9(r,n.length)];return i.marker==="Z"?Z9(t,r,n):i}function JL(t,e,n){let r=n[e-1]||{values:{x:0,y:0}};if(t.marker===t.marker.toLowerCase())switch(t.marker=t.marker.toUpperCase(),t.marker){case"M":t.values.x+=r.values.x,t.values.y+=r.values.y;break;case"L":case"A":t.values.x+=r.values.x,t.values.y+=r.values.y;break;case"H":t.marker="L",t.values.x+=r.values.x,t.values.y=r.values.y;break;case"V":t.marker="L",t.values.x=r.values.x,t.values.y+=r.values.y;break;case"C":t.values.x+=r.values.x,t.values.y+=r.values.y,t.values.x1+=r.values.x,t.values.y1+=r.values.y,t.values.x2+=r.values.x,t.values.y2+=r.values.y;break;case"S":t.values.x+=r.values.x,t.values.y+=r.values.y,t.values.x2+=r.values.x,t.values.y2+=r.values.y;break;case"Q":t.values.x+=r.values.x,t.values.y+=r.values.y,t.values.x1+=r.values.x,t.values.y1+=r.values.y;break;case"T":t.values.x+=r.values.x,t.values.y+=r.values.y;break}else if(t.marker===t.marker.toUpperCase())switch(t.marker){case"H":t.marker="L",t.values.y=r.values.y;break;case"V":t.marker="L",t.values.x=r.values.x;break}if(t.marker==="Z"){let o=function(l,s){return l[s].marker==="M"?l[s]:o(l,s-1)};var i=o;let a=o(n,e);t.values.x=a.values.x,t.values.y=a.values.y}return t}function eN(t,e){const n=[];switch(t.toUpperCase()){case"M":for(let r=0;r<e.length;r+=2){let i;t===t.toUpperCase()?i=r===0?"M":"L":i=r===0?"m":"l",n.push({marker:i,values:{x:e[r],y:e[r+1]}})}break;case"L":for(let r=0;r<e.length;r+=2)n.push({marker:t,values:{x:e[r],y:e[r+1]}});break;case"H":for(let r=0;r<e.length;r++)n.push({marker:t,values:{x:e[r],y:0}});break;case"V":for(let r=0;r<e.length;r++)n.push({marker:t,values:{x:0,y:e[r]}});break;case"C":for(let r=0;r<e.length;r+=6)n.push({marker:t,values:{x1:e[r],y1:e[r+1],x2:e[r+2],y2:e[r+3],x:e[r+4],y:e[r+5]}});break;case"S":for(let r=0;r<e.length;r+=4)n.push({marker:t,values:{x2:e[r],y2:e[r+1],x:e[r+2],y:e[r+3]}});break;case"Q":for(let r=0;r<e.length;r+=4)n.push({marker:t,values:{x1:e[r],y1:e[r+1],x:e[r+2],y:e[r+3]}});break;case"T":for(let r=0;r<e.length;r+=2)n.push({marker:t,values:{x:e[r],y:e[r+1]}});break;case"A":for(let r=0;r<e.length;r+=7)n.push({marker:t,values:{radiusX:e[r],radiusY:e[r+1],rotation:e[r+2],largeArc:e[r+3],sweep:e[r+4],x:e[r+5],y:e[r+6]}});break;case"Z":n.push({marker:t,values:{x:0,y:0}});break}return n}function Q9(t,e){return(t%e+e)%e}function tN(t,e,n){if(e!==0&&t.marker==="L"){let r=n[e-1];["x","y"].every(o=>Math.round(Math.abs(r.values[o]-t.values[o]))===0)&&(t.overlap=!0)}return t}function vm(t,e){const n=["x","y"].every(r=>Math.round(Math.abs(t[e].values[r]-t[0].values[r]))===0);t[e].marker==="L"&&n&&(t[e].overlap=!0,vm(t,e-1)),t[e].marker==="Z"&&vm(t,e-1)}function nN(t,e,n){const r=S4(t.values,n.values),i=S4(e.values,t.values);return Math.min(i,r)}function w4(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}function S4(t,e){const n=t.x-e.x,r=t.y-e.y;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2))}function E4(t,e){return Math.sin(t)*e}function O4(t,e){return Math.cos(t)*e}function x4(t,e){const n=e/Math.tan(t);return n===1/0||n===-1/0||isNaN(n)?e:n}function rN(t,e){return e*Math.tan(t)}function iN(t,e){let n,r=0,i=t*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?n=x4(t/2,-e):(n=x4(t/2,e),r=1,n===1/0&&(n=e)),{offset:n,sweepFlag:r}}function oN(t){const e=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return t.map(n=>{let r="";if(n.marker!=="Z"){const i=Object.keys(n.values);r=e.filter(o=>i.indexOf(o)!==-1).map(o=>n.values[o]).join()}return`${n.marker}${r}`}).join("").trim()}function J9(t){const e=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,n=/-?[0-9]*\.?\d+/g;return[...t.matchAll(e)].map(r=>({marker:r[0],index:r.index})).reduceRight((r,i)=>{const o=t.substring(i.index,r.length?r[r.length-1].index:t.length);return r.concat([{marker:i.marker,index:i.index,chunk:o.length>0?o.substr(1,o.length-1):o}])},[]).reverse().flatMap(r=>{const i=r.chunk.match(n),o=i?i.map(parseFloat):[];return eN(r.marker,o)}).map(JL)}function e7(t,e,n){let r=[],i=[];return n&&t.forEach(o=>QL(o,n)),t.forEach(o=>{o.marker==="M"&&r.push([]),r[r.length-1].push(o)}),r.forEach(o=>{o.map(tN),vm(o,o.length-1);const a=o[o.length-1].marker=="Z";o.filter(l=>!l.overlap).map((l,s,f)=>{const x=X9(l,s,f),w=Z9(l,s,f),v=w4(l.values,x.values),O=w4(l.values,w.values),g=O-v,b=g*(180/Math.PI),p=nN(l,x,w),y=Math.abs(rN(g/2,p/2)),d=Math.min(e,y),m=iN(g,d),_=m.offset,A=m.sweepFlag,C=(s==0||s==f.length-1)&&!a;switch(l.marker){case"M":case"L":const R=[l.values.x+E4(v,_),l.values.y+O4(v,_)],S=[l.values.x+E4(O,_),l.values.y+O4(O,_)];C?i.push({marker:l.marker,values:l.values}):i.push({marker:l.marker,values:{x:parseFloat(R[0].toFixed(3)),y:parseFloat(R[1].toFixed(3))}}),!C&&(w.marker==="L"||w.marker==="M")&&i.push({marker:"A",radius:d,values:{radiusX:parseFloat(d.toFixed(3)),radiusY:parseFloat(d.toFixed(3)),rotation:b,largeArc:0,sweep:A,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:oN(i),commands:i}}function aN(t,e,n){return e7([...J9(t)],e,n)}const lN=Object.freeze(Object.defineProperty({__proto__:null,parsePath:J9,roundCommands:e7,roundCorners:aN},Symbol.toStringTag,{value:"Module"})),sN=_a(lN);var Jc={},Qy={},Jy={},Al=Al||{};Al.stringify=function(){var t={"visit_linear-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return t.visit_gradient(e)},"visit_radial-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return t.visit_gradient(e)},visit_gradient:function(e){var n=t.visit(e.orientation);return n&&(n+=", "),e.type+"("+n+t.visit(e.colorStops)+")"},visit_shape:function(e){var n=e.value,r=t.visit(e.at),i=t.visit(e.style);return i&&(n+=" "+i),r&&(n+=" at "+r),n},"visit_default-radial":function(e){var n="",r=t.visit(e.at);return r&&(n+=r),n},"visit_extent-keyword":function(e){var n=e.value,r=t.visit(e.at);return r&&(n+=" at "+r),n},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return t.visit(e.value.x)+" "+t.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_literal:function(e){return t.visit_color(e.value,e)},visit_hex:function(e){return t.visit_color("#"+e.value,e)},visit_rgb:function(e){return t.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return t.visit_color("rgba("+e.value.join(", ")+")",e)},visit_color:function(e,n){var r=e,i=t.visit(n.length);return i&&(r+=" "+i),r},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var n="",r=e.length;return e.forEach(function(i,o){n+=t.visit(i),o<r-1&&(n+=", ")}),n},visit:function(e){if(!e)return"";var n="";if(e instanceof Array)return t.visit_array(e,n);if(e.type){var r=t["visit_"+e.type];if(r)return r(e);throw Error("Missing visitor visit_"+e.type)}else throw Error("Invalid node.")}};return function(e){return t.visit(e)}}();var Al=Al||{};Al.parse=function(){var t={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(W){var H=new Error(e+": "+W);throw H.source=e,H}function r(){var W=i();return e.length>0&&n("Invalid input not EOF"),W}function i(){return d(o)}function o(){return a("linear-gradient",t.linearGradient,s)||a("repeating-linear-gradient",t.repeatingLinearGradient,s)||a("radial-gradient",t.radialGradient,x)||a("repeating-radial-gradient",t.repeatingRadialGradient,x)}function a(W,H,L){return l(H,function(M){var D=L();return D&&(G(t.comma)||n("Missing comma before color stops")),{type:W,orientation:D,colorStops:d(m)}})}function l(W,H){var L=G(W);if(L){G(t.startCall)||n("Missing (");var M=H(L);return G(t.endCall)||n("Missing )"),M}}function s(){return f()||h()}function f(){return U("directional",t.sideOrCorner,1)}function h(){return U("angular",t.angleValue,1)}function x(){var W,H=w(),L;return H&&(W=[],W.push(H),L=e,G(t.comma)&&(H=w(),H?W.push(H):e=L)),W}function w(){var W=v()||O();if(W)W.at=b();else{var H=g();if(H){W=H;var L=b();L&&(W.at=L)}else{var M=p();M&&(W={type:"default-radial",at:M})}}return W}function v(){var W=U("shape",/^(circle)/i,0);return W&&(W.style=N()||g()),W}function O(){var W=U("shape",/^(ellipse)/i,0);return W&&(W.style=P()||g()),W}function g(){return U("extent-keyword",t.extentKeywords,1)}function b(){if(U("position",/^at/,0)){var W=p();return W||n("Missing positioning value"),W}}function p(){var W=y();if(W.x||W.y)return{type:"position",value:W}}function y(){return{x:P(),y:P()}}function d(W){var H=W(),L=[];if(H)for(L.push(H);G(t.comma);)H=W(),H?L.push(H):n("One extra comma");return L}function m(){var W=_();return W||n("Expected color definition"),W.length=P(),W}function _(){return C()||S()||R()||A()}function A(){return U("literal",t.literalColor,0)}function C(){return U("hex",t.hexColor,1)}function R(){return l(t.rgbColor,function(){return{type:"rgb",value:d(E)}})}function S(){return l(t.rgbaColor,function(){return{type:"rgba",value:d(E)}})}function E(){return G(t.number)[1]}function P(){return U("%",t.percentageValue,1)||T()||N()}function T(){return U("position-keyword",t.positionKeywords,1)}function N(){return U("px",t.pixelValue,1)||U("em",t.emValue,1)}function U(W,H,L){var M=G(H);if(M)return{type:W,value:M[L]}}function G(W){var H,L;return L=/^[\n\r\t\s]+/.exec(e),L&&Z(L[0].length),H=W.exec(e),H&&Z(H[0].length),H}function Z(W){e=e.substr(W)}return function(W){return e=W.toString(),r()}}();Jy.parse=Al.parse;Jy.stringify=Al.stringify;(function(t){var e=_e&&_e.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseColor=t.isGradient=void 0;const n=e(Jy),r=a=>a.indexOf("linear-gradient")>=0;t.isGradient=r;const i=a=>a.type==="hex"?"#"+a.value:a.type==="literal"?a.value:`${a.type}(${a.value.join(",")})`,o=a=>{if(!(0,t.isGradient)(a))return{rotation:0,stops:[{offset:0,color:a},{offset:1,color:a}]};const l=n.default.parse(a)[0];return{rotation:parseFloat(l.orientation.value),stops:l.colorStops.map((s,f)=>({color:i(s),offset:s.length?parseFloat(s.length.value)/100:f/(l.colorStops.length-1)}))}};t.parseColor=o})(Qy);(function(t){var e=_e&&_e.__createBinding||(Object.create?function(f,h,x,w){w===void 0&&(w=x);var v=Object.getOwnPropertyDescriptor(h,x);v&&!("get"in v?!h.__esModule:v.writable||v.configurable)||(v={enumerable:!0,get:function(){return h[x]}}),Object.defineProperty(f,w,v)}:function(f,h,x,w){w===void 0&&(w=x),f[w]=h[x]}),n=_e&&_e.__setModuleDefault||(Object.create?function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}:function(f,h){f.default=h}),r=_e&&_e.__importStar||function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var x in f)x!=="default"&&Object.prototype.hasOwnProperty.call(f,x)&&e(h,f,x);return n(h,f),h},i=_e&&_e.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(t,"__esModule",{value:!0}),t.useColor=void 0;const o=i(Qe),a=r(Qy),l=i(ki),s=(f,h=f.fill,x="fill")=>o.default.useMemo(()=>{if(!a.isGradient(h))return{[x]:h};const{stops:w,rotation:v}=a.parseColor(h),O={x:f.a.width/2,y:f.a.height/2},g=Math.sqrt(Math.pow(O.x,2)+Math.pow(O.y,2)),b=l.default.Util.degToRad(v)-Math.PI/2,p=[];return w.forEach(({offset:y,color:d})=>{p.push(y,d)}),x==="fill"?{fillLinearGradientStartPointX:O.x-g*Math.cos(b),fillLinearGradientStartPointY:O.y-g*Math.sin(b),fillLinearGradientColorStops:p,fillLinearGradientEndPointX:O.x+g*Math.cos(b),fillLinearGradientEndPointY:O.y+g*Math.sin(b),fill:w[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:O.x-g*Math.cos(b),strokeLinearGradientStartPointY:O.y-g*Math.sin(b),strokeLinearGradientColorStops:p,strokeLinearGradientEndPointX:O.x+g*Math.cos(b),strokeLinearGradientEndPointY:O.y+g*Math.sin(b)}},[h,f.width,f.height]);t.useColor=s})(Jc);var Yi={},Rl={};(function(t){var e=_e&&_e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAnimationUsed=t.toggleFadeInAnimation=void 0,t.useFadeIn=l;const n=e(Qe),r=e(ki);let i=!1;const o=(s=!i)=>{i=s};t.toggleFadeInAnimation=o;const a=()=>i;function l(s,f){const h=n.default.useRef();n.default.useLayoutEffect(()=>{h.current&&h.current.destroy()},[f]),n.default.useLayoutEffect(()=>{if(!i)return;const x=s.current.opacity();return x?(s.current.opacity(0),h.current=new r.default.Tween({node:s.current,opacity:x,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},[])}t.isAnimationUsed=a})(Rl);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getFontLoadTimeout=t.setFontLoadTimeout=t.getAssetLoadTimeout=t.setAssetLoadTimeout=void 0,t.incrementLoader=h,t.decrementLoader=x,t.whenLoaded=v,t.onLoadError=g,t.triggerLoadError=b;const e=Rl;let n=0,r=[],i=3e4;const o=p=>{i=p};t.setAssetLoadTimeout=o;const a=()=>i;t.getAssetLoadTimeout=a;let l=6e3;const s=p=>{l=p};t.setFontLoadTimeout=s;const f=()=>l;function h(p){n+=1;let y=!1;const d=setTimeout(()=>{y||(b(`Timeout loading asset ${p}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",p),y=!0,x())},i);return()=>{y||(clearTimeout(d),x())}}function x(){n-=1,n===0&&(r.forEach(p=>p()),r=[])}function w(p){n===0?p():r.push(p)}function v(){return new Promise(p=>w(()=>{(0,e.isAnimationUsed)()?setTimeout(p,300):p(!0)}))}t.getFontLoadTimeout=f;let O=[];function g(p){O.push(p)}function b(p){O.forEach(y=>y(p))}})(Yi);var iu={};(function(t){var e=_e&&_e.__createBinding||(Object.create?function(P,T,N,U){U===void 0&&(U=N);var G=Object.getOwnPropertyDescriptor(T,N);G&&!("get"in G?!T.__esModule:G.writable||G.configurable)||(G={enumerable:!0,get:function(){return T[N]}}),Object.defineProperty(P,U,G)}:function(P,T,N,U){U===void 0&&(U=N),P[U]=T[N]}),n=_e&&_e.__setModuleDefault||(Object.create?function(P,T){Object.defineProperty(P,"default",{enumerable:!0,value:T})}:function(P,T){P.default=T}),r=_e&&_e.__importStar||function(P){if(P&&P.__esModule)return P;var T={};if(P!=null)for(var N in P)N!=="default"&&Object.prototype.hasOwnProperty.call(P,N)&&e(T,P,N);return n(T,P),T};Object.defineProperty(t,"__esModule",{value:!0}),t.isFontLoaded=t.globalFonts=void 0,t.isGoogleFontChanged=s,t.setGoogleFonts=f,t.getFontsList=h,t.addGlobalFont=x,t.removeGlobalFont=w,t.replaceGlobalFonts=v,t.loadFont=d,t.setGoogleFontsVariants=A,t.getGoogleFontsVariants=C,t.injectGoogleFont=R,t.injectCustomFont=E;const i=r(Qi),o=Yi;let a=i.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),l=i.observable({value:!1});function s(){return l.value}function f(P){P!=="default"?(l.value=!0,a.splice(0,a.length),a.push(...P)):l.value=!1}function h(){return a}function x(P){t.globalFonts.push(P)}function w(P){const T=t.globalFonts.findIndex(N=>N.fontFamily===P);T!==-1&&t.globalFonts.splice(T,1)}function v(P){t.globalFonts.replace(P)}t.globalFonts=i.observable([]);var O="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",g=document.createElement("canvas");function b(P,T="Arial",N="normal",U="normal"){var G=g.getContext("2d");return G.font=`${N} ${U} 40px '${P}', ${T}`,G.measureText(O).width}const p={Arial:!0},y=P=>!!p[P];async function d(P,T,N){var U;if(p[P])return;const G=!!(!((U=document.fonts)===null||U===void 0)&&U.load),Z=b("Arial","Arial",T,N);if(G)try{await document.fonts.load(`16px '${P}', ${T} ${N}`);const M=b(P,"Arial",T,N);if(Z!==M)return void(p[P]=!0)}catch{}const W=b("Times","Times",T,N),H=b(P,"Arial",T,N),L=Math.min(6e3,(0,o.getFontLoadTimeout)())/60;for(let M=0;M<L;M++){const D=b(P,"Arial",T,N),B=b(P,"Times",T,N);if(D!==H||D!==Z||B!==W)return void(p[P]=!0);await new Promise(V=>setTimeout(V,60))}console.warn(`Timeout for loading font "${P}". Looks like polotno can't load it. Is it a correct font family?`),(0,o.triggerLoadError)(`Timeout for loading font "${P}"`)}t.isFontLoaded=y;const m={};let _="400,400italic,700,700italic";function A(P){_=P}function C(){return _}function R(P){if(m[P])return;const T=`https://fonts.googleapis.com/css?family=${P.replace(/ /g,"+")}:${_}`,N=document.createElement("link");N.type="text/css",N.href=T,N.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(N),m[P]=!0}const S={};function E(P){const T=P.fontFamily;if(S[T]||!P.url&&!P.styles)return;const N=document.createElement("style");N.type="text/css";const U=P.styles||(P.url?[{src:`url("${P.url}")`}]:[]);let G="";U.forEach(Z=>{G+=`
77
- @font-face {
78
- font-family: '${T}';
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[P.fontFamily]=!0}})(iu);var Qr={};(function(t){var e=_e&&_e.__createBinding||(Object.create?function(o,a,l,s){s===void 0&&(s=l);var f=Object.getOwnPropertyDescriptor(a,l);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[l]}}),Object.defineProperty(o,s,f)}:function(o,a,l,s){s===void 0&&(s=l),o[s]=a[l]}),n=_e&&_e.__setModuleDefault||(Object.create?function(o,a){Object.defineProperty(o,"default",{enumerable:!0,value:a})}:function(o,a){o.default=a}),r=_e&&_e.__importStar||function(o){if(o&&o.__esModule)return o;var a={};if(o!=null)for(var l in o)l!=="default"&&Object.prototype.hasOwnProperty.call(o,l)&&e(a,o,l);return n(a,o),a};Object.defineProperty(t,"__esModule",{value:!0}),t.setAnimationsEnabled=t.setTextSplitAllowed=t.setTextOverflow=t.setForceTextFit=t.useDownScaling=t.setDownScalingEnabled=t.useHtmlTextRender=t.useRemoveBackground=t.setTextVerticalResizeEnabled=t.flags=void 0;const i=r(Qi);t.flags=i.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),t.setTextVerticalResizeEnabled=i.action(o=>{t.flags.textVerticalResizeEnabled=o}),t.useRemoveBackground=i.action(o=>{t.flags.removeBackgroundEnabled=o}),t.useHtmlTextRender=i.action(o=>{t.flags.htmlRenderEnabled=o}),t.setDownScalingEnabled=i.action(o=>{t.flags.imageDownScalingEnabled=o}),t.useDownScaling=i.action(o=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,t.setDownScalingEnabled)(o)}),t.setForceTextFit=i.action(o=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),t.flags.textOverflow="change-font-size"}),t.setTextOverflow=i.action(o=>{t.flags.textOverflow=o}),t.setTextSplitAllowed=i.action(o=>{t.flags.textSplitAllowed=o}),t.setAnimationsEnabled=i.action(o=>{t.flags.animationsEnabled=o})})(Qr);var e2={};(function(t){function e(n=""){return(n.match(/<\/p>/gi)||[]).length>1&&(n=n.replace(/<\/p>/gi,(r,i,o)=>(o.slice(i+r.length).match(/<\/p>/gi)||[]).length>0?`
84
- `:r)),n.replace(/(<([^>]+)>)/gi,"")}Object.defineProperty(t,"__esModule",{value:!0}),t.removeTags=e})(e2);var ef={};(function(t){var e=_e&&_e.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.applyFilter=r;const n=e(ki);function r(i,o){var a;const l={filters:[]};o.brightnessEnabled&&(l.filters.push(n.default.Filters.Brighten),l.brightness=o.brightness),o.blurEnabled&&(l.filters.push(n.default.Filters.Blur),l.blurRadius=o.blurRadius),o.sepiaEnabled&&l.filters.push(n.default.Filters.Sepia),o.grayscaleEnabled&&l.filters.push(n.default.Filters.Grayscale),i.setAttrs(l),l.filters.length?i.cache({pixelRatio:o.store._elementsPixelRatio}):i.clearCache(),(a=i.getLayer())===null||a===void 0||a.batchDraw()}})(ef);var Ml={};(function(t){var e=_e&&_e.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(t,"__esModule",{value:!0}),t.Highlighter=t.setHighlighterStyle=void 0;const n=e(Qe),r=ti,i=Io,o={stroke:"rgb(0, 161, 255)",strokeWidth:2},a=l=>{Object.assign(o,l)};t.setHighlighterStyle=a,t.Highlighter=(0,r.observer)(({element:l})=>n.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},o)))})(Ml);var Na={};(function(t){var e=_e&&_e.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(t,"__esModule",{value:!0}),t.useMobile=t.isTouchDevice=t.mobileStyle=t.isMobile=t.MOBILE_BREAKPOINT=void 0;const n=e(Qe);t.MOBILE_BREAKPOINT=800;const r=()=>window.innerWidth<=t.MOBILE_BREAKPOINT;t.isMobile=r;const i=l=>`
85
- @media (max-width: ${t.MOBILE_BREAKPOINT}px) {
86
- ${l}
87
- }
88
-
89
- .polotno-mobile & {
90
- ${l}
91
- }
92
- `;t.mobileStyle=i;const o=()=>"ontouchstart"in window||navigator.maxTouchPoints>0;t.isTouchDevice=o;const a=()=>{const[l,s]=n.default.useState((0,t.isMobile)());return n.default.useEffect(()=>{const f=()=>{s((0,t.isMobile)())};return window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[]),l};t.useMobile=a})(Na);var P4={},t7="warn";function n7(t){t7=t}function r7(){return t7}function uN(t){n7(t)}var bn;(function(t){t.afterCreate="afterCreate",t.afterAttach="afterAttach",t.afterCreationFinalization="afterCreationFinalization",t.beforeDetach="beforeDetach",t.beforeDestroy="beforeDestroy"})(bn||(bn={}));var mm=function(t,e){return mm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},mm(t,e)};function jt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");mm(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var wn=function(){return wn=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},wn.apply(this,arguments)};function cN(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function i7(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(f){return function(h){return s([f,h])}}function s(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(n=0)),n;)try{if(r=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,i=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=e.call(t,n)}catch(h){f=[6,h],i=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function ic(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xi(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Zi(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function tf(t){return Ge(t).type}function fN(t,e){return Ge(t).getChildType(e)}function o7(t,e){return Ge(t).onPatch(e)}function dN(t,e){return Ge(t).onSnapshot(e)}function zs(t,e){Ge(t).applyPatches(s2(e))}function hN(t,e){var n={patches:[],inversePatches:[]},r={},i,o={get recording(){return!!i},get patches(){return r.patches||(r.patches=n.patches.slice()),r.patches},get reversedInversePatches(){return r.reversedInversePatches||(r.reversedInversePatches=n.inversePatches.slice().reverse()),r.reversedInversePatches},get inversePatches(){return r.inversePatches||(r.inversePatches=n.inversePatches.slice()),r.inversePatches},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=o7(t,function(a,l){e&&!e(a,l,i2())||(n.patches.push(a),n.inversePatches.push(l),r.patches=void 0,r.inversePatches=void 0,r.reversedInversePatches=void 0)}))},replay:function(a){zs(a||t,n.patches)},undo:function(a){zs(a||t,n.inversePatches.slice().reverse())}};return o.resume(),o}function pN(t){var e=Ge(t);if(!e.isRoot)throw new Fe("`protect` can only be invoked on root nodes");e.isProtectionEnabled=!0}function gN(t){var e=Ge(t);if(!e.isRoot)throw new Fe("`unprotect` can only be invoked on root nodes");e.isProtectionEnabled=!1}function vN(t){return Ge(t).isProtected}function a7(t,e){return Ge(t).applySnapshot(e)}function t2(t,e){e===void 0&&(e=!0);var n=Ge(t);return e?n.snapshot:n.type.getSnapshot(n,!1)}function mN(t,e){e===void 0&&(e=1);for(var n=Ge(t).parent;n;){if(--e===0)return!0;n=n.parent}return!1}function yN(t,e){e===void 0&&(e=1);for(var n=e,r=Ge(t).parent;r;){if(--n===0)return r.storedValue;r=r.parent}throw new Fe("Failed to find the parent of ".concat(Ge(t)," at depth ").concat(e))}function bN(t,e){for(var n=Ge(t).parent;n;){if(e.is(n.storedValue))return!0;n=n.parent}return!1}function _N(t,e){for(var n=Ge(t).parent;n;){if(e.is(n.storedValue))return n.storedValue;n=n.parent}throw new Fe("Failed to find the parent of ".concat(Ge(t)," of a given type"))}function l7(t){return Ge(t).root.storedValue}function s7(t){return Ge(t).path}function wN(t){return Gs(Ge(t).path)}function SN(t){return Ge(t).isRoot}function EN(t,e){var n=P7(Ge(t),e);return n?n.value:void 0}function ON(t,e,n){var r=Ge(e).root.identifierCache.resolve(t,ou(n));return r==null?void 0:r.value}function u7(t){return Ge(t).identifier}function xN(t,e){e===void 0&&(e=!0);try{var n=t();if(n==null)return;if(kt(n))return e?n2(n)?n:void 0:n;throw new Fe("The reference to be checked is not one of node, null or undefined")}catch(r){if(r instanceof u2)return;throw r}}function PN(t,e){e===void 0&&(e=!0);try{var n=t();if(n==null)return!1;if(kt(n))return e?n2(n):!0;throw new Fe("The reference to be checked is not one of node, null or undefined")}catch(r){if(r instanceof u2)return!1;throw r}}function c7(t,e){var n=P7(Ge(t),e,!1);if(n!==void 0)try{return n.value}catch{return}}function CN(t,e){return x7(Ge(t),Ge(e))}function kN(t,e){e===void 0&&(e=!0);var n=Ge(t);return n.type.create(n.snapshot,e===!0?n.root.environment:e===!1?void 0:e)}function TN(t){return Ge(t).detach(),t}function AN(t){var e=Ge(t);e.isRoot?e.die():e.parent.removeChild(e.subpath)}function n2(t){return Ge(t).observableIsAlive}function RN(t,e){var n=Ge(t);return n.addDisposer(e),e}function MN(t){var e=Ge(t),n=e.root.environment;if(!n)throw new Fe("Failed to find the environment of ".concat(e," ").concat(e.path));return n}function LN(t){var e=Ge(t),n=e.root.environment;return!!n}function f7(t,e){var n=Ge(t);n.getChildren().forEach(function(r){kt(r.storedValue)&&f7(r.storedValue,e)}),e(n.storedValue)}function d7(t){var e;return kt(t)?e=tf(t):e=t,{name:e.name,properties:wn({},e.properties)}}function NN(t){var e=Ge(t).type,n=wn(wn({},d7(e)),{actions:[],volatile:[],views:[],flowActions:[]}),r=Object.getOwnPropertyNames(t);return r.forEach(function(i){if(!(i in n.properties)){var o=Object.getOwnPropertyDescriptor(t,i);if(o.get){D8(t,i)?n.views.push(i):n.volatile.push(i);return}o.value._isFlowAction===!0&&n.flowActions.push(i),o.value._isMSTAction===!0?n.actions.push(i):F8(t,i)?n.volatile.push(i):n.views.push(i)}}),n}function IN(t){return t}function DN(t){return t}function jN(t){return t}function FN(t){return Ge(t).nodeId}var h7=function(){function t(e,n,r,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:Dn.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(n,r)}return Object.defineProperty(t.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){var n=this.isAlive;this._state=e;var r=this.isAlive;this.aliveAtom&&n!==r&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._hookSubscribers&&this._hookSubscribers.emit(e,this,e)}}),Object.defineProperty(t.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return this._hookSubscribers||(this._hookSubscribers=new R7),this._hookSubscribers.register(e,n)}}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(t.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){this._parent=e,this._subpath=n,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(t.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e&&(this.pathAtom||(this.pathAtom=Ec("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?pa(this._subpath):""),this.parent.getEscapedPath(e)+"/"+this._escapedSubpath):""}}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlive",{get:function(){return this.state!==Dn.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDetaching",{get:function(){return this.state===Dn.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=Ec("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.state===Dn.CREATED){if(this.parent){if(this.parent.state!==Dn.FINALIZED)return;this.fireHook(bn.afterAttach)}this.state=Dn.FINALIZED,e&&e()}}}),Object.defineProperty(t.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=Dn.DEAD}}),Object.defineProperty(t.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(bn.beforeDestroy)}}),t}(),Tc=function(t){jt(e,t);function e(n,r,i,o,a){var l=t.call(this,n,r,i,o)||this;try{l.storedValue=n.createNewInstance(a)}catch(s){throw l.state=Dn.DEAD,s}return l.state=Dn.CREATED,l.finalizeCreation(),l}return Object.defineProperty(e.prototype,"root",{get:function(){if(!this.parent)throw new Fe("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this.parent!==n,o=this.subpath!==r;!i&&!o||(this.environment=void 0,this.baseSetParent(this.parent,r))}}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Dn.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(e.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(e.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(e.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.fireInternalHook(n)}}),e}(h7);Tc.prototype.die=dn(Tc.prototype.die);var zN=1,di;(function(t){t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.CREATING=1]="CREATING",t[t.CREATED=2]="CREATED"})(di||(di={}));var xr;(function(t){t.Dispose="dispose",t.Patch="patch",t.Snapshot="snapshot"})(xr||(xr={}));var BN={onError:function(t){throw t}},yr=function(t){jt(e,t);function e(n,r,i,o,a){var l=t.call(this,n,r,i,o)||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:di.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=yl(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=a,l.identifierAttribute=n.identifierAttribute,r||(l.identifierCache=new aI),l._childNodes=n.initializeChildNodes(l,l._initialSnapshot),l.identifier=null,l.unnormalizedIdentifier=null,l.identifierAttribute&&l._initialSnapshot){var s=l._initialSnapshot[l.identifierAttribute];if(s===void 0){var f=l._childNodes[l.identifierAttribute];f&&(s=f.value)}if(typeof s!="string"&&typeof s!="number")throw new Fe("Instance identifier '".concat(l.identifierAttribute,"' for type '").concat(l.type.name,"' must be a string or a number"));l.identifier=ou(s),l.unnormalizedIdentifier=s}return r?r.root.identifierCache.addNodeToCache(l):l.identifierCache.addNodeToCache(l),l}return Object.defineProperty(e.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.createObservableInstanceIfNeeded(),this._applyPatches(n)}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.createObservableInstanceIfNeeded(),this._applySnapshot(n)}}),Object.defineProperty(e.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=!0),this._observableInstanceState===di.UNINITIALIZED&&this.createObservableInstance(n)}}),Object.defineProperty(e.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r,i,o,a;n===void 0&&(n=!0),this._observableInstanceState=di.CREATING;for(var l=[],s=this.parent;s&&s._observableInstanceState===di.UNINITIALIZED;)l.unshift(s),s=s.parent;try{for(var f=ic(l),h=f.next();!h.done;h=f.next()){var x=h.value;x.createObservableInstanceIfNeeded(!1)}}catch(g){r={error:g}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}var w=this.type;try{this.storedValue=w.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,w.finalizeNewInstance(this,this.storedValue)}catch(g){throw this.state=Dn.DEAD,g}finally{this._isRunningAction=!1}if(this._observableInstanceState=di.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Hs,this.state=Dn.CREATED,n){this.fireHook(bn.afterCreate),this.finalizeCreation();try{for(var v=ic(l.reverse()),O=v.next();!O.done;O=v.next()){var x=O.value;x.fireHook(bn.afterCreate),x.finalizeCreation()}}catch(g){o={error:g}}finally{try{O&&!O.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}}}}),Object.defineProperty(e.prototype,"root",{get:function(){var n=this.parent;return n?n.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(bn.beforeDetach);var n=this.state;this.state=Dn.DETACHING;var r=this.root,i=r.environment,o=r.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=o}finally{this.state=n}}}}),Object.defineProperty(e.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=n!==this.parent,o=r!==this.subpath;!i&&!o||(i?(this.environment=void 0,n.root.identifierCache.mergeCache(this),this.baseSetParent(n,r),this.fireHook(bn.afterAttach)):o&&this.baseSetParent(this.parent,r))}}),Object.defineProperty(e.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;this.fireInternalHook(n);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[n];typeof i=="function"&&(Ls?Ls(function(){i.apply(r.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===di.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(e.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var n=this.type,r=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=n.processInitialSnapshot(r,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(e.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(e.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=r7();if(!this.isAlive&&r!=="ignore"){var i=this._getAssertAliveError(n);switch(r){case"error":throw new Fe(i);case"warn":bI(i)}}}}),Object.defineProperty(e.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.getEscapedPath(!1)||this.pathUponDeath||"",i=n.subpath&&pa(n.subpath)||"",o=n.actionContext||r2();o&&o.type!=="action"&&o.parentActionEvent&&(o=o.parentActionEvent);var a="";if(o&&o.name!=null){var l=o&&o.context&&s7(o.context)||r;a="".concat(l,".").concat(o.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(r,"', Subpath: '").concat(i,"', Action: '").concat(a,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.assertAlive({subpath:n}),this._autoUnbox=!1;try{return this._observableInstanceState===di.CREATED?this.type.getChildNode(this,n):this._childNodes[n]}finally{this._autoUnbox=!0}}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(Hs),this._autoUnbox=!1;try{return this._observableInstanceState===di.CREATED?this.type.getChildren(this):k7(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.type.getChildType(n)}}),Object.defineProperty(e.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(this.assertAlive(n),!this.isRunningAction()&&this.isProtected)throw new Fe("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.type.removeChild(this,n)}}),Object.defineProperty(e.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n&&(this.assertAlive({subpath:n.subpath||n.subpathUponDeath}),this._autoUnbox?n.value:n)}}),Object.defineProperty(e.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=(this.isAlive?this.path:this.pathUponDeath)||"<root>",r=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(n).concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;this.baseFinalizeCreation(function(){var r,i;try{for(var o=ic(n.getChildren()),a=o.next();!a.done;a=o.next()){var l=a.value;l.finalizeCreation()}}catch(s){r={error:s}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}n.fireInternalHook(bn.afterCreationFinalization)})}}),Object.defineProperty(e.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new Fe("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(e.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;this._applyPatches=Ac(this.storedValue,"@APPLY_PATCHES",function(r){r.forEach(function(i){if(!i.path){n.type.applySnapshot(n,i.value);return}var o=Gs(i.path),a=C7(n,o.slice(0,-1));a.applyPatchLocally(o[o.length-1],i)})}),this._applySnapshot=Ac(this.storedValue,"@APPLY_SNAPSHOT",function(r){if(r!==n.snapshot)return n.type.applySnapshot(n,r)}),il(this.storedValue,"$treenode",this),il(this.storedValue,"toJSON",sI)}}),Object.defineProperty(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Dn.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==di.UNINITIALIZED&&(this.getChildren().forEach(function(n){n.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(xr.Dispose),this._internalEventsClear(xr.Dispose))}}),Object.defineProperty(e.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(r){r.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var n=this.snapshot;this._snapshotUponDeath=n,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(e.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._addSnapshotReaction(),this._internalEventsRegister(xr.Snapshot,n)}}),Object.defineProperty(e.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this._internalEventsEmit(xr.Snapshot,n)}}),Object.defineProperty(e.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._internalEventsRegister(xr.Patch,n)}}),Object.defineProperty(e.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this._internalEventsHasSubscribers(xr.Patch)){var i=r.path.substr(this.path.length)+(n.path?"/"+n.path:""),o=vI({},n,{path:i}),a=Xi(xI(o),2),l=a[0],s=a[1];this._internalEventsEmit(xr.Patch,l,s)}this.parent&&this.parent.emitPatch(n,r)}}),Object.defineProperty(e.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._internalEventsHas(xr.Dispose,n)}}),Object.defineProperty(e.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!this.hasDisposer(n)){this._internalEventsRegister(xr.Dispose,n,!0);return}throw new Fe("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(e.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!this._internalEventsHas(xr.Dispose,n))throw new Fe("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(xr.Dispose,n)}}),Object.defineProperty(e.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(this.middlewares){var r=this.middlewares.indexOf(n);r>=0&&this.middlewares.splice(r,1)}}}),Object.defineProperty(e.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;r===void 0&&(r=!0);var o={handler:n,includeHooks:r};return this.middlewares?this.middlewares.push(o):this.middlewares=[o],function(){i.removeMiddleware(o)}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){this.assertWritable({subpath:n}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,n,r)}}),Object.defineProperty(e.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;if(!this._hasSnapshotReaction){var r=k8(function(){return n.snapshot},function(i){return n.emitSnapshot(i)},BN);this.addDisposer(r),this._hasSnapshotReaction=!0}}}),Object.defineProperty(e.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return!!this._internalEvents&&this._internalEvents.hasSubscribers(n)}}),Object.defineProperty(e.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new R7),this._internalEvents.register(n,r,i)}}),Object.defineProperty(e.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return!!this._internalEvents&&this._internalEvents.has(n,r)}}),Object.defineProperty(e.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){this._internalEvents&&this._internalEvents.unregister(n,r)}}),Object.defineProperty(e.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(n){for(var r,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];this._internalEvents&&(r=this._internalEvents).emit.apply(r,Zi([n],Xi(i),!1))}}),Object.defineProperty(e.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this._internalEvents&&this._internalEvents.clear(n)}}),Object.defineProperty(e.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),e}(h7);yr.prototype.createObservableInstance=dn(yr.prototype.createObservableInstance);yr.prototype.detach=dn(yr.prototype.detach);yr.prototype.die=dn(yr.prototype.die);var p7,it;(function(t){t[t.String=1]="String",t[t.Number=2]="Number",t[t.Boolean=4]="Boolean",t[t.Date=8]="Date",t[t.Literal=16]="Literal",t[t.Array=32]="Array",t[t.Map=64]="Map",t[t.Object=128]="Object",t[t.Frozen=256]="Frozen",t[t.Optional=512]="Optional",t[t.Reference=1024]="Reference",t[t.Identifier=2048]="Identifier",t[t.Late=4096]="Late",t[t.Refinement=8192]="Refinement",t[t.Union=16384]="Union",t[t.Null=32768]="Null",t[t.Undefined=65536]="Undefined",t[t.Integer=131072]="Integer",t[t.Custom=262144]="Custom",t[t.SnapshotProcessor=524288]="SnapshotProcessor",t[t.Lazy=1048576]="Lazy",t[t.Finite=2097152]="Finite",t[t.Float=4194304]="Float"})(it||(it={}));var g7="cannotDetermine",UN=Symbol("$type"),To=function(){function t(e){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=e}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return Eo(this,e),this.instantiate(null,"",n,e).value}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){throw new Fe("unimplemented method")}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e===this}}),Object.defineProperty(t.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var r=O7(e);if(r){var i=tf(e);return this.isAssignableFrom(i)?br():_r(n,e)}return this.isValidSnapshot(e,n)}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.validate(e,[{path:"",type:this}]).length===0}}),Object.defineProperty(t.prototype,"Type",{get:function(){throw new Fe("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TypeWithoutSTN",{get:function(){throw new Fe("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SnapshotType",{get:function(){throw new Fe("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CreationType",{get:function(){throw new Fe("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),t}();p7=UN;To.prototype.create=dn(To.prototype.create);var Bs=function(t){jt(e,t);function e(n){var r=t.call(this,n)||this;return Object.defineProperty(r,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return n===void 0&&(n=this.getDefaultSnapshot()),t.prototype.create.call(this,n,r)}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.createObservableInstanceIfNeeded(),n.storedValue}}),Object.defineProperty(e.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return!n.identifierAttribute||n.identifier===ou(r[n.identifierAttribute])}}),Object.defineProperty(e.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return n.isDetaching?!1:n.snapshot===r||kt(r)&&Ge(r)===n?!0:n.type===this&&T7(r)&&!kt(r)&&this.isMatchingSnapshotId(n,r)?(n.applySnapshot(r),!0):!1}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){var a=this.tryToReconcileNode(n,r);if(a)return n.setParent(i,o),n;if(n.die(),kt(r)&&this.isAssignableFrom(tf(r))){var l=Ge(r);return l.setParent(i,o),l}return this.instantiate(i,o,void 0,r)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e}(To);Bs.prototype.create=dn(Bs.prototype.create);var Ll=function(t){jt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){if(!n.isDetaching&&n.type===this&&n.storedValue===r)return n;var a=this.instantiate(i,o,void 0,r);return n.die(),a}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e}(To);function Sn(t){return typeof t=="object"&&t&&t.isType===!0}var Fi=new Map;function HN(t){return function(n,r,i){switch(n.type){case"action":if(!t.filter||t.filter(n)===!0){var o=t.onStart(n);t.onResume(n,o),Fi.set(n.id,{call:n,context:o,async:!1});try{var a=r(n);return t.onSuspend(n,o),Fi.get(n.id).async===!1&&(Fi.delete(n.id),t.onSuccess(n,o,a)),a}catch(s){throw Fi.delete(n.id),t.onFail(n,o,s),s}}else return r(n);case"flow_spawn":{var l=Fi.get(n.rootId);return l.async=!0,r(n)}case"flow_resume":case"flow_resume_error":{var l=Fi.get(n.rootId);t.onResume(n,l.context);try{return r(n)}finally{t.onSuspend(n,l.context)}}case"flow_throw":{var l=Fi.get(n.rootId);return Fi.delete(n.rootId),t.onFail(n,l.context,n.args[0]),r(n)}case"flow_return":{var l=Fi.get(n.rootId);return Fi.delete(n.rootId),t.onSuccess(n,l.context,n.args[0]),r(n)}}}}var $N=function(){function t(e,n){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),e&&e.onStart(n)}return Object.defineProperty(t.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,e))}}),Object.defineProperty(t.prototype,"incFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(t.prototype,"decFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(t.prototype,"hasFlowsPending",{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),t}();function GN(t){var e=new Map;return function(r,i){var o=r.parentActionEvent?e.get(r.parentActionEvent.id):void 0;if(r.type==="action"){var a=wn(wn({},r),{env:o&&o.call.env,parentCall:o&&o.call}),l=!t.filter||t.filter(a),s=l?t:void 0,f=new $N(s,a);e.set(r.id,f);var h=void 0;try{h=i(r)}catch(w){throw e.delete(r.id),f.finish(w),w}return f.hasFlowsPending||(e.delete(r.id),f.finish()),h}else{if(!o)return i(r);switch(r.type){case"flow_spawn":return o.incFlowsPending(),i(r);case"flow_resume":case"flow_resume_error":return i(r);case"flow_throw":{var x=r.args[0];try{return i(r)}finally{o.decFlowsPending(),o.hasFlowsPending||(e.delete(r.parentActionEvent.id),o.finish(x))}}case"flow_return":try{return i(r)}finally{o.decFlowsPending(),o.hasFlowsPending||(e.delete(r.parentActionEvent.id),o.finish())}}}}}function VN(t,e,n,r){if(r instanceof Date)return{$MST_DATE:r.getTime()};if($s(r))return r;if(kt(r))return wd("[MSTNode: ".concat(tf(r).name,"]"));if(typeof r=="function")return wd("[function]");if(typeof r=="object"&&!tl(r)&&!l2(r))return wd("[object ".concat(r&&r.constructor&&r.constructor.name||"Complex Object","]"));try{return JSON.stringify(r),r}catch(i){return wd(""+i)}}function qN(t,e){return e&&typeof e=="object"&&"$MST_DATE"in e?new Date(e.$MST_DATE):e}function wd(t){return{$MST_UNSERIALIZABLE:!0,type:t}}function v7(t,e){Ls(function(){s2(e).forEach(function(n){return WN(t,n)})})}function WN(t,e){var n=c7(t,e.path||"");if(!n)throw new Fe("Invalid action path: ".concat(e.path||""));var r=Ge(n);if(e.name==="@APPLY_PATCHES")return zs.call(null,n,e.args[0]);if(e.name==="@APPLY_SNAPSHOT")return a7.call(null,n,e.args[0]);if(typeof n[e.name]!="function")throw new Fe("Action '".concat(e.name,"' does not exist in '").concat(r.path,"'"));return n[e.name].apply(n,e.args?e.args.map(function(i){return qN(r,i)}):[])}function YN(t,e){var n=[],r=function(a){var l=e?e(a,i2()):!0;l&&n.push(a)},i,o={actions:n,get recording(){return!!i},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=m7(t,r))},replay:function(a){v7(a,n)}};return o.resume(),o}function m7(t,e,n){return n===void 0&&(n=!1),_7(t,function(i,o){if(i.type==="action"&&i.id===i.rootId){var a=Ge(i.context),l={name:i.name,path:x7(Ge(t),a),args:i.args.map(function(f,h){return VN(a,i.name,h,f)})};if(n){var s=o(i);return e(l),s}else return e(l),o(i)}else return o(i)})}var KN=1,oc;function r2(){return oc}function y7(){return KN++}function ym(t,e){var n=Ge(t.context);t.type==="action"&&n.assertAlive({actionContext:t});var r=n._isRunningAction;n._isRunningAction=!0;var i=oc;oc=t;try{return QN(n,t,e)}finally{oc=i,n._isRunningAction=r}}function b7(t){if(t)return t.type==="action"?t:t.parentActionEvent}function Ac(t,e,n){var r=function(){var i=y7(),o=oc,a=b7(o);return ym({type:"action",name:e,id:i,args:M7(arguments),context:t,tree:l7(t),rootId:o?o.rootId:i,parentId:o?o.id:0,allParentIds:o?Zi(Zi([],Xi(o.allParentIds),!1),[o.id],!1):[],parentEvent:o,parentActionEvent:a},n)};return r._isMSTAction=!0,r._isFlowAction=n._isFlowAction,r}function _7(t,e,n){n===void 0&&(n=!0);var r=Ge(t);return r.addMiddleWare(e,n)}function XN(t,e,n){n===void 0&&(n=!0);var r={handler:t,includeHooks:n};return e.$mst_middleware=e.$mst_middleware||[],e.$mst_middleware.push(r),e}var ZN=function(){function t(e,n){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:[]}),n.$mst_middleware&&this.middlewares.push(n.$mst_middleware);for(var r=e;r;)r.middlewares&&this.middlewares.push(r.middlewares),r=r.parent}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.middlewares[this.arrayIndex];if(e){var n=e[this.inArrayIndex++];return n||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),t}();function QN(t,e,n){var r=new ZN(t,n);if(r.isEmpty)return dn(n).apply(null,e.args);var i=null;function o(a){var l=r.getNextMiddleware(),s=l&&l.handler;if(!s)return dn(n).apply(null,a.args);if(!l.includeHooks&&bn[a.name])return o(a);function f(x,w){i=o(x),w&&(i=w(i))}function h(x){i=x}return s(a,f,h),i}return o(e)}function i2(){for(var t=r2();t&&t.type!=="action";)t=t.parentActionEvent;return t}function w7(t,e,n){for(var r=typeof e=="number"?e:e.id,i=n?t:t.parentActionEvent;i;){if(i.id===r)return!0;i=i.parentActionEvent}return!1}function JN(t,e){return w7(t,e,!1)}function eI(t,e){return w7(t,e,!0)}function tI(t){try{return JSON.stringify(t)}catch(e){return"<Unserializable: ".concat(e,">")}}function S7(t){return typeof t=="function"?"<function".concat(t.name?" "+t.name:"",">"):kt(t)?"<".concat(t,">"):"`".concat(tI(t),"`")}function nI(t){return t.length<280?t:"".concat(t.substring(0,272),"......").concat(t.substring(t.length-8))}function rI(t){var e=t.value,n=t.context[t.context.length-1].type,r=t.context.map(function(l){var s=l.path;return s}).filter(function(l){return l.length>0}).join("/"),i=r.length>0?'at path "/'.concat(r,'" '):"",o=kt(e)?"value of type ".concat(Ge(e).type.name,":"):$s(e)?"value":"snapshot",a=n&&kt(e)&&n.is(Ge(e).snapshot);return"".concat(i).concat(o," ").concat(S7(e)," is not assignable ").concat(n?"to type: `".concat(n.name,"`"):"")+(t.message?" (".concat(t.message,")"):"")+(n?V7(n)||$s(e)?".":", expected an instance of `".concat(n.name,"` or a snapshot like `").concat(n.describe(),"` instead.")+(a?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function o2(t,e,n){return t.concat([{path:e,type:n}])}function br(){return Us}function _r(t,e,n){return[{context:t,value:e,message:n}]}function Kp(t){return t.reduce(function(e,n){return e.concat(n)},[])}function Eo(t,e){_I()&&E7(t,e)}function E7(t,e){var n=t.validate(e,[{path:"",type:t}]);if(n.length>0)throw new Fe(iI(t,e,n))}function iI(t,e,n){if(n.length!==0)return"Error while converting ".concat(nI(S7(e))," to `").concat(t.name,`\`:
93
-
94
- `)+n.map(rI).join(`
95
- `)}var oI=0,aI=function(){function t(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:oI++}),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(t.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this.lastCacheModificationPerId.get(e);this.lastCacheModificationPerId.set(e,n===void 0?1:n+1)}}),Object.defineProperty(t.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this.lastCacheModificationPerId.get(e)||0;return"".concat(this.cacheId,"-").concat(n)}}),Object.defineProperty(t.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){if(n===void 0&&(n=!0),e.identifierAttribute){var r=e.identifier;this.cache.has(r)||this.cache.set(r,Rt.array([],Xp));var i=this.cache.get(r);if(i.indexOf(e)!==-1)throw new Fe("Already registered");i.push(e),n&&this.updateLastCacheModificationPerId(r)}}}),Object.defineProperty(t.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this;Oy(e.identifierCache.cache).forEach(function(r){return r.forEach(function(i){n.addNodeToCache(i)})})}}),Object.defineProperty(t.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.identifierAttribute){var n=e.identifier,r=this.cache.get(n);r&&(r.remove(e),r.length||this.cache.delete(n),this.updateLastCacheModificationPerId(e.identifier))}}}),Object.defineProperty(t.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this,r=new t,i=e.path+"/";return z8(this.cache).forEach(function(o){for(var a=Xi(o,2),l=a[0],s=a[1],f=!1,h=s.length-1;h>=0;h--){var x=s[h];(x===e||x.path.indexOf(i)===0)&&(r.addNodeToCache(x,!1),s.splice(h,1),s.length||n.cache.delete(l),f=!0)}f&&n.updateLastCacheModificationPerId(l)}),r}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var r=this.cache.get(n);return r?r.some(function(i){return e.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(t.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var r=this.cache.get(n);if(!r)return null;var i=r.filter(function(o){return e.isAssignableFrom(o.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw new Fe("Cannot resolve a reference to type '".concat(e.name,"' with id: '").concat(n,"' unambigously, there are multiple candidates: ").concat(i.map(function(o){return o.path}).join(", ")))}}}),t}();function a2(t,e,n,r,i){var o=O7(i);if(o){if(o.parent)throw new Fe("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?e.path:"","/").concat(n,"', but it lives already at '").concat(o.path,"'"));return e&&o.setParent(e,n),o}return new yr(t,e,n,r,i)}function Ia(t,e,n,r,i){return new Tc(t,e,n,r,i)}function lI(t){return t instanceof Tc||t instanceof yr}var Dn;(function(t){t[t.INITIALIZING=0]="INITIALIZING",t[t.CREATED=1]="CREATED",t[t.FINALIZED=2]="FINALIZED",t[t.DETACHING=3]="DETACHING",t[t.DEAD=4]="DEAD"})(Dn||(Dn={}));function kt(t){return!!(t&&t.$treenode)}function Ge(t){if(!kt(t))throw new Fe("Value ".concat(t," is no MST Node"));return t.$treenode}function O7(t){return t&&t.$treenode||null}function sI(){return Ge(this).snapshot}var uI=function(t){return".."};function x7(t,e){if(t.root!==e.root)throw new Fe("Cannot calculate relative path: objects '".concat(t,"' and '").concat(e,"' are not part of the same object tree"));for(var n=Gs(t.path),r=Gs(e.path),i=0;i<n.length&&n[i]===r[i];i++);return n.slice(i).map(uI).join("/")+xh(r.slice(i))}function P7(t,e,n){return n===void 0&&(n=!0),C7(t,Gs(e),n)}function C7(t,e,n){n===void 0&&(n=!0);var r=t;try{for(var i=0;i<e.length;i++){var o=e[i];if(o===".."){if(r=r.parent,r)continue}else{if(o===".")continue;if(r){if(r instanceof Tc){var a=r.value;kt(a)&&(r=Ge(a))}if(r instanceof yr){var l=r.getChildType(o);if(l&&(r=r.getChildNode(o),r))continue}}}throw new Fe("Could not resolve '".concat(o,"' in path '").concat(xh(e.slice(0,i))||"/","' while resolving '").concat(xh(e),"'"))}}catch(s){if(!n)return;throw s}return r}function k7(t){if(!t)return Us;var e=Object.keys(t);if(!e.length)return Us;var n=new Array(e.length);return e.forEach(function(r,i){n[i]=t[r]}),n}function cI(t){return L7(),N7(t)}var fI=Object.toString(),Us=Object.freeze([]),Hs=Object.freeze({}),Xp=v8().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Xp);var Fe=function(t){jt(e,t);function e(n){return n===void 0&&(n="Illegal state"),t.call(this,"[mobx-state-tree] ".concat(n))||this}return e}(Error);function dI(t){return t}var hI=Number.isInteger;function pI(t){return Number(t)===t&&t%1!==0}function gI(t){return Number.isFinite(t)}function l2(t){return Array.isArray(t)||nr(t)}function s2(t){return t?l2(t)?t:[t]:Us}function vI(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var i=e[r];for(var o in i)t[o]=i[o]}return t}function tl(t){var e;if(t===null||typeof t!="object")return!1;var n=Object.getPrototypeOf(t);return n==null?!0:((e=n.constructor)===null||e===void 0?void 0:e.toString())===fI}function T7(t){return t!==null&&typeof t=="object"&&!(t instanceof Date)&&!(t instanceof RegExp)}function $s(t,e){return e===void 0&&(e=!0),t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e&&t instanceof Date}function A7(t){return typeof t!="function"}function mI(t,e,n){Mn(t)?Py(t,e,n):Object.defineProperty(t,e,n)}function il(t,e,n){mI(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}var yI=function(){function t(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(t.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var r=this;return n===void 0&&(n=!1),n?this.handlers.unshift(e):this.handlers.push(e),function(){r.unregister(e)}}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.handlers.indexOf(e)>=0}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this.handlers.indexOf(e);n>=0&&this.handlers.splice(n,1)}}),Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(t.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this.handlers.slice();r.forEach(function(i){return i.apply(void 0,Zi([],Xi(e),!1))})}}),t}(),R7=function(){function t(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(t.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this.eventHandlers&&this.eventHandlers[e];return!!n&&n.hasSubscribers}}),Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n,r){r===void 0&&(r=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[e];return i||(i=this.eventHandlers[e]=new yI),i.register(n,r)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var r=this.eventHandlers&&this.eventHandlers[e];return!!r&&r.has(n)}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var r=this.eventHandlers&&this.eventHandlers[e];r&&r.unregister(n)}}),Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.eventHandlers&&delete this.eventHandlers[e]}}),Object.defineProperty(t.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(t.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var n,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var o=this.eventHandlers&&this.eventHandlers[e];o&&(n=o).emit.apply(n,Zi([],Xi(r),!1))}}),t}();function M7(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=t[n];return e}function tg(t,e){return t.indexOf(e)===0}var L7=function(t,e){};L7.ids={};function bI(t){console.warn(new Error("[mobx-state-tree] ".concat(t)))}function _I(){return typeof process<"u"&&P4&&P4.ENABLE_TYPE_CHECK==="true"}function ng(t){typeof queueMicrotask=="function"?queueMicrotask(t):typeof setImmediate=="function"?setImmediate(t):setTimeout(t,1)}function N7(t){return OI(t.name,t)}function wI(t){return t}function SI(t){return function(){var e,n=[];for(e=0;e<arguments.length;e++)n[e]=arguments[e];return i7(this,function(r){switch(r.label){case 0:return[4,t.apply(void 0,Zi([],Xi(n),!1))];case 1:return[2,r.sent()]}})}}function EI(t){return i7(this,function(e){switch(e.label){case 0:return[4,t];case 1:return[2,e.sent()]}})}function OI(t,e){var n=function(){var i=y7(),o=r2();if(!o)throw new Fe("a mst flow must always have a parent context");var a=b7(o);if(!a)throw new Fe("a mst flow must always have a parent action context");var l={name:t,id:i,tree:o.tree,context:o.context,parentId:o.id,allParentIds:Zi(Zi([],Xi(o.allParentIds),!1),[o.id],!1),rootId:o.rootId,parentEvent:o,parentActionEvent:a},s=arguments;function f(h,x,w){return h.$mst_middleware=n.$mst_middleware,ym(wn(wn({},l),{type:x,args:[w]}),h)}return new Promise(function(h,x){var w,v=function(){w=e.apply(null,arguments),O(void 0)};v.$mst_middleware=n.$mst_middleware,ym(wn(wn({},l),{type:"flow_spawn",args:M7(s)}),v);function O(p){var y;try{var d=f(function(m){y=w.next(m)},"flow_resume",p);d instanceof Error&&(y=w.throw(d))}catch(m){ng(function(){f(function(_){x(m)},"flow_throw",m)});return}b(y)}function g(p){var y;try{f(function(d){y=w.throw(d)},"flow_resume_error",p)}catch(d){ng(function(){f(function(m){x(d)},"flow_throw",d)});return}b(y)}function b(p){if(p.done){ng(function(){f(function(y){h(y)},"flow_return",p.value)});return}if(!p.value||typeof p.value.then!="function")throw new Fe("Only promises can be yielded to `async`, got: "+p);return p.value.then(O,g)}})};return n._isFlowAction=!0,n}function xI(t){if(!("oldValue"in t))throw new Fe("Patches without `oldValue` field cannot be inversed");return[PI(t),CI(t)]}function PI(t){switch(t.op){case"add":return{op:"add",path:t.path,value:t.value};case"remove":return{op:"remove",path:t.path};case"replace":return{op:"replace",path:t.path,value:t.value}}}function CI(t){switch(t.op){case"add":return{op:"remove",path:t.path};case"remove":return{op:"add",path:t.path,value:t.oldValue};case"replace":return{op:"replace",path:t.path,value:t.oldValue}}}function kI(t){return typeof t=="number"}function pa(t){return kI(t)===!0?""+t:t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function I7(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function xh(t){if(t.length===0)return"";var e=function(n){return n.map(pa).join("/")};return t[0]==="."||t[0]===".."?e(t):"/"+e(t)}function Gs(t){var e=t.split("/").map(I7),n=t===""||t==="."||t===".."||tg(t,"/")||tg(t,"./")||tg(t,"../");if(!n)throw new Fe("a json path must be either rooted, empty or relative, but got '".concat(t,"'"));return e[0]===""&&e.shift(),e}var rg=Symbol("$preProcessorFailed"),TI=function(t){jt(e,t);function e(n,r,i){var o=t.call(this,i||n.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:r}),o}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|it.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(e.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._processors.preProcessor?this._processors.preProcessor.call(null,n):n}}),Object.defineProperty(e.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(n){try{return this.preProcessSnapshot(n)}catch{return rg}}}),Object.defineProperty(e.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return this._processors.postProcessor?this._processors.postProcessor.call(null,n,r.storedValue):n}}),Object.defineProperty(e.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;AI(n.type,this,"create"),n instanceof yr&&(n.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=n.getSnapshot;n.getSnapshot=function(){return r.postProcessSnapshot(i.call(n),n)},W7(this._subtype)||(n.getReconciliationType=function(){return r})}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){var a=kt(o)?o:this.preProcessSnapshot(o),l=this._subtype.instantiate(n,r,i,a);return this._fixNode(l),l}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){var a=this._subtype.reconcile(n,kt(r)?r:this.preProcessSnapshot(r),i,o);return a!==n&&this._fixNode(a),a}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){r===void 0&&(r=!0);var i=this._subtype.getSnapshot(n);return r?this.postProcessSnapshot(i,n):i}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this.preProcessSnapshotSafe(n);return i===rg?_r(r,n,"Failed to preprocess value"):this._subtype.validate(i,r)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=Sn(n)?this._subtype:kt(n)?t2(n,!1):this.preProcessSnapshotSafe(n);return r===rg?!1:this._subtype.validate(r,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._subtype.isAssignableFrom(n)}}),Object.defineProperty(e.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(!(this._subtype instanceof Bs))return!1;var i=this.preProcessSnapshot(r);return this._subtype.isMatchingSnapshotId(n,i)}}),e}(To);function AI(t,e){for(var n,r,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];try{for(var a=ic(i),l=a.next();!l.done;l=a.next()){var s=l.value;t[s]=e[s].bind(e)}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}function RI(t,e,n){return new TI(t,e,n)}var C4="Map.put can only be used to store complex values that have an identifier type attribute";function D7(t,e){var n,r,i=t.getSubTypes();if(i===g7)return!1;if(i){var o=s2(i);try{for(var a=ic(o),l=a.next();!l.done;l=a.next()){var s=l.value;if(!D7(s,e))return!1}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}return t instanceof Rc&&e.push(t),!0}var ta;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.YES=1]="YES",t[t.NO=2]="NO"})(ta||(ta={}));var MI=function(t){jt(e,t);function e(n,r){return t.call(this,n,Rt.ref.enhancer,r)||this}return Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return t.prototype.get.call(this,""+n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return t.prototype.has.call(this,""+n)}}),Object.defineProperty(e.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return t.prototype.delete.call(this,""+n)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return t.prototype.set.call(this,""+n,r)}}),Object.defineProperty(e.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!n)throw new Fe("Map.put cannot be used to set empty values");if(kt(n)){var r=Ge(n);if(r.identifier===null)throw new Fe(C4);return this.set(r.identifier,n),n}else if(T7(n)){var i=Ge(this),o=i.type;if(o.identifierMode!==ta.YES)throw new Fe(C4);var a=o.mapIdentifierAttribute,l=n[a];if(!c2(l)){var s=this.put(o.getChildType().create(n,i.environment));return this.put(t2(s))}var f=ou(l);return this.set(f,n),this.get(f)}else throw new Fe("Map.put can only be used to store complex values")}}),e}(ep),Ph=function(t){jt(e,t);function e(n,r,i){i===void 0&&(i=[]);var o=t.call(this,n)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:ta.UNKNOWN}),Object.defineProperty(o,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:it.Map}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o._determineIdentifierMode(),o.hookInitializers=i,o}return Object.defineProperty(e.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.hookInitializers.length>0?this.hookInitializers.concat(n):[n];return new e(this.name,this._subType,r)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){return this._determineIdentifierMode(),a2(this,n,r,i,o)}}),Object.defineProperty(e.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===ta.UNKNOWN){var n=[];if(D7(this._subType,n)){var r=n.reduce(function(i,o){if(!o.identifierAttribute)return i;if(i&&i!==o.identifierAttribute)throw new Fe("The objects in a map should all have the same identifier attribute, expected '".concat(i,"', but child of type '").concat(o.name,"' declared attribute '").concat(o.identifierAttribute,"' as identifier"));return o.identifierAttribute},void 0);r?(this.identifierMode=ta.YES,this.mapIdentifierAttribute=r):this.identifierMode=ta.NO}}}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){r===void 0&&(r={});var i=n.type._subType,o={};return Object.keys(r).forEach(function(a){o[a]=i.instantiate(n,a,void 0,r[a])}),o}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return new MI(n,this.name)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){Ey(r,n.unbox);var i=n.type;i.hookInitializers.forEach(function(o){var a=o(r);Object.keys(a).forEach(function(l){var s=a[l],f=Ac(r,l,s);il(r,l,f)})}),Zh(r,this.willChange),Jh(r,this.didChange)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return Oy(n.storedValue)}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=n.storedValue.get(""+r);if(!i)throw new Fe("Not a child "+r);return i}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=Ge(n.object),i=n.name;r.assertWritable({subpath:i});var o=r.type,a=o._subType;switch(n.type){case"update":{var l=n.newValue,s=n.object.get(i);if(l===s)return null;Eo(a,l),n.newValue=a.reconcile(r.getChildNode(i),n.newValue,r,i),o.processIdentifier(i,n.newValue)}break;case"add":Eo(a,n.newValue),n.newValue=a.instantiate(r,i,void 0,n.newValue),o.processIdentifier(i,n.newValue);break}return n}}),Object.defineProperty(e.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this.identifierMode===ta.YES&&r instanceof yr){var i=r.identifier;if(i!==n)throw new Fe("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(n,"'"))}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r={};return n.getChildren().forEach(function(i){r[i.subpath]=i.snapshot}),r}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r={};return Object.keys(n).forEach(function(i){r[i]=n[i].getSnapshot()}),r}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=Ge(n.object);switch(n.type){case"update":return void r.emitPatch({op:"replace",path:pa(n.name),value:n.newValue.snapshot,oldValue:n.oldValue?n.oldValue.snapshot:void 0},r);case"add":return void r.emitPatch({op:"add",path:pa(n.name),value:n.newValue.snapshot,oldValue:void 0},r);case"delete":var i=n.oldValue.snapshot;return n.oldValue.die(),void r.emitPatch({op:"remove",path:pa(n.name),oldValue:i},r)}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){var o=n.storedValue;switch(i.op){case"add":case"replace":o.set(r,i.value);break;case"remove":o.delete(r);break}}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){Eo(this,r);var i=n.storedValue,o={};if(Array.from(i.keys()).forEach(function(l){o[l]=!1}),r)for(var a in r)i.set(a,r[a]),o[""+a]=!0;Object.keys(o).forEach(function(l){o[l]===!1&&i.delete(l)})}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;return tl(n)?Kp(Object.keys(n).map(function(o){return i._subType.validate(n[o],o2(r,o,i._subType))})):_r(r,n,"Value is not a plain object")}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Hs}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){n.storedValue.delete(r)}}),e}(Bs);Ph.prototype.applySnapshot=dn(Ph.prototype.applySnapshot);function LI(t){return new Ph("Map<string, ".concat(t.name,">"),t)}function NI(t){return Sn(t)&&(t.flags&it.Map)>0}var Ch=function(t){jt(e,t);function e(n,r,i){i===void 0&&(i=[]);var o=t.call(this,n)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:it.Array}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o.hookInitializers=i,o}return Object.defineProperty(e.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.hookInitializers.length>0?this.hookInitializers.concat(n):[n];return new e(this.name,this._subType,r)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){return a2(this,n,r,i,o)}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){r===void 0&&(r=[]);var i=n.type._subType,o={};return r.forEach(function(a,l){var s=""+l;o[s]=i.instantiate(n,s,void 0,a)}),o}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=wn(wn({},Xp),{name:this.name});return Rt.array(k7(n),r)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){xi(r).dehancer=n.unbox;var i=n.type;i.hookInitializers.forEach(function(o){var a=o(r);Object.keys(a).forEach(function(l){var s=a[l],f=Ac(r,l,s);il(r,l,f)})}),Zh(r,this.willChange),Jh(r,this.didChange)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue.slice()}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=Number(r);if(i<n.storedValue.length)return n.storedValue[i];throw new Fe("Not a child: "+r)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=Ge(n.object);r.assertWritable({subpath:""+n.index});var i=r.type._subType,o=r.getChildren();switch(n.type){case"update":{if(n.newValue===n.object[n.index])return null;var a=k4(r,i,[o[n.index]],[n.newValue],[n.index]);if(!a)return null;n.newValue=a[0]}break;case"splice":{var l=n.index,s=n.removedCount,f=n.added,h=k4(r,i,o.slice(l,l+s),f,f.map(function(w,v){return l+v}));if(!h)return null;n.added=h;for(var x=l+s;x<o.length;x++)o[x].setParent(r,""+(x+f.length-s))}break}return n}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.getChildren().map(function(r){return r.snapshot})}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=[];return Object.keys(n).forEach(function(i){r.push(n[i].getSnapshot())}),r}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=Ge(n.object);switch(n.type){case"update":return void r.emitPatch({op:"replace",path:""+n.index,value:n.newValue.snapshot,oldValue:n.oldValue?n.oldValue.snapshot:void 0},r);case"splice":if(n.removedCount&&n.addedCount===n.object.length)return void r.emitPatch({op:"replace",path:"",value:r.snapshot,oldValue:n.removed.map(function(o){return o.snapshot})},r);for(var i=n.removedCount-1;i>=0;i--)r.emitPatch({op:"remove",path:""+(n.index+i),oldValue:n.removed[i].snapshot},r);for(var i=0;i<n.addedCount;i++)r.emitPatch({op:"add",path:""+(n.index+i),value:n.added[i].snapshot,oldValue:void 0},r);return}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){var o=n.storedValue,a=r==="-"?o.length:Number(r);switch(i.op){case"replace":o[a]=i.value;break;case"add":o.splice(a,0,i.value);break;case"remove":o.splice(a,1);break}}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){Eo(this,r);var i=n.storedValue;i.replace(r)}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;return l2(n)?Kp(n.map(function(o,a){return i._subType.validate(o,o2(r,""+a,i._subType))})):_r(r,n,"Value is not an array")}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Us}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){n.storedValue.splice(Number(r),1)}}),e}(Bs);Ch.prototype.applySnapshot=dn(Ch.prototype.applySnapshot);function II(t){return new Ch("".concat(t.name,"[]"),t)}function k4(t,e,n,r,i){for(var o=!0,a=0;;a++){var l=a<=r.length-1,s=n[a],f=l?r[a]:void 0,h=""+i[a];if(lI(f)&&(f=f.storedValue),!s&&!l)break;if(!l)o=!1,n.splice(a,1),s instanceof yr&&s.createObservableInstanceIfNeeded(),s.die(),a--;else if(s)if(T4(s,f))n[a]=ig(e,t,h,f,s);else{for(var w=void 0,v=a;v<n.length;v++)if(T4(n[v],f)){w=n.splice(v,1)[0];break}o=!1;var x=ig(e,t,h,f,w);n.splice(a,0,x)}else{if(kt(f)&&Ge(f).parent===t)throw new Fe("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.path,"/").concat(h,"', but it lives already at '").concat(Ge(f).path,"'"));o=!1;var x=ig(e,t,h,f);n.splice(a,0,x)}}return o?null:n}function ig(t,e,n,r,i){Eo(t,r);function o(){if(kt(r)){var l=Ge(r);if(l.assertAlive(Hs),l.parent!==null&&l.parent===e)return l.setParent(e,n),l}return i?t.reconcile(i,r,e,n):t.instantiate(e,n,void 0,r)}var a=o();return i&&i!==a&&(i instanceof yr&&i.createObservableInstanceIfNeeded(),i.die()),a}function T4(t,e){if(!t.isAlive)return!1;if(kt(e)){var n=Ge(e);return n.isAlive&&n===t}if(t.snapshot===e)return!0;if(!(t instanceof yr))return!1;var r=t.getReconciliationType();return t.identifier!==null&&t.identifierAttribute&&tl(e)&&r.is(e)&&r.isMatchingSnapshotId(t,e)}function DI(t){return Sn(t)&&(t.flags&it.Array)>0}var A4="preProcessSnapshot",R4="postProcessSnapshot";function jI(){return Ge(this).toString()}var M4={name:"AnonymousModel",properties:{},initializers:Us};function FI(t){var e=Object.keys(t),n=new Set;return e.forEach(function(r){if(n.has(r))throw new Fe("".concat(r," is declared twice in the model. Model should not contain the same keys"));n.add(r)}),e.reduce(function(r,i){if(i in bn)throw new Fe("Hook '".concat(i,"' was defined as property. Hooks should be defined as part of the actions"));var o=Object.getOwnPropertyDescriptor(t,i);if("get"in o)throw new Fe("Getters are not supported as properties. Please use views instead");var a=o.value;if(a==null)throw new Fe("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if($s(a))r[i]=ol(GI(a),a);else if(a instanceof Ph)r[i]=ol(a,{});else if(a instanceof Ch)r[i]=ol(a,[]);else if(!Sn(a))throw new Fe("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(a,"' (").concat(typeof a,")"));return r},wn({},t))}var Rc=function(t){jt(e,t);function e(n){var r=t.call(this,n.name||M4.name)||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:it.Object}),Object.defineProperty(r,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return r.cloneAndEnhance({name:i})}}),Object.defineProperty(r,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return r.cloneAndEnhance({properties:i})}}),Object.defineProperty(r,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var o=r.preProcessor;return o?r.cloneAndEnhance({preProcessor:function(a){return o(i(a))}}):r.cloneAndEnhance({preProcessor:i})}}),Object.defineProperty(r,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var o=r.postProcessor;return o?r.cloneAndEnhance({postProcessor:function(a){return i(o(a))}}):r.cloneAndEnhance({postProcessor:i})}}),Object.assign(r,M4,n),r.properties=FI(r.properties),r.properties,r.propertyNames=Object.keys(r.properties),r.identifierAttribute=r._getIdentifierAttribute(),r}return Object.defineProperty(e.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=void 0;return this.forAllProps(function(r,i){if(i.flags&it.Identifier){if(n)throw new Fe("Cannot define property '".concat(r,"' as object identifier, property '").concat(n,"' is already defined as identifier property"));n=r}}),n}}),Object.defineProperty(e.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return new e({name:n.name||this.name,properties:Object.assign({},this.properties,n.properties),initializers:this.initializers.concat(n.initializers||[]),preProcessor:n.preProcessor||this.preProcessor,postProcessor:n.postProcessor||this.postProcessor})}}),Object.defineProperty(e.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this,i=function(o){return r.instantiateActions(o,n(o)),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(!tl(r))throw new Fe("actions initializer should return a plain object containing actions");Object.keys(r).forEach(function(i){if(i===A4)throw new Fe("Cannot define action '".concat(A4,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===R4)throw new Fe("Cannot define action '".concat(R4,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var o=r[i],a=n[i];if(i in bn&&a){var l=o;o=function(){a.apply(null,arguments),l.apply(null,arguments)}}var s=o.$mst_middleware,f=o.bind(r);f._isFlowAction=o._isFlowAction||!1,f.$mst_middleware=s;var h=Ac(n,i,f);r[i]=h,il(n,i,h)})}}),Object.defineProperty(e.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;if(typeof n!="function")throw new Fe("You passed an ".concat(typeof n," to volatile state as an argument, when function is expected"));var i=function(o){return r.instantiateVolatileState(o,n(o)),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(!tl(r))throw new Fe("volatile state initializer should return a plain object containing state");xy(n,r)}}),Object.defineProperty(e.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this,i=function(o){var a=n(o),l=a.actions,s=a.views,f=a.state,h=cN(a,["actions","views","state"]);for(var x in h)throw new Fe("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(x,"'"));return f&&r.instantiateVolatileState(o,f),s&&r.instantiateViews(o,s),l&&r.instantiateActions(o,l),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this,i=function(o){return r.instantiateViews(o,n(o)),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(!tl(r))throw new Fe("views initializer should return a plain object containing views");Object.getOwnPropertyNames(r).forEach(function(i){var o,a=Object.getOwnPropertyDescriptor(r,i);if("get"in a)Py(n,i,a),Cy(n,(o={},o[i]=yl,o));else if(typeof a.value=="function")il(n,i,a.value);else throw new Fe("A view member should either be a function or getter based property")})}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){var a=kt(o)?o:this.applySnapshotPreProcessor(o);return a2(this,n,r,i,a)}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){r===void 0&&(r={});var i=n.type,o={};return i.forAllProps(function(a,l){o[a]=l.instantiate(n,a,void 0,r[a])}),o}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=wn(wn({},Xp),{name:this.name});return Rt.object(n,Hs,r)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){il(r,"toString",jI),this.forAllProps(function(i){Ey(r,i,n.unbox)}),this.initializers.reduce(function(i,o){return o(i)},r),Zh(r,this.willChange),Jh(r,this.didChange)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=n,i=Ge(r.object),o=r.name;i.assertWritable({subpath:o});var a=i.type.properties[o];return a&&(Eo(a,r.newValue),r.newValue=a.reconcile(i.getChildNode(o),r.newValue,i,o)),r}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=n,i=Ge(r.object),o=i.type.properties[r.name];if(o){var a=r.oldValue?r.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:pa(r.name),value:r.newValue.snapshot,oldValue:a},i)}}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this,i=[];return this.forAllProps(function(o){i.push(r.getChildNode(n,o))}),i}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i;if(!(r in this.properties))throw new Fe("Not a value property: "+r);var o=xi(n.storedValue,r),a=(i=o.raw)===null||i===void 0?void 0:i.call(o);if(!a)throw new Fe("Node not available for property "+r);return a}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;r===void 0&&(r=!0);var o={};return this.forAllProps(function(a,l){try{var s=Ki(n.storedValue,a);s.reportObserved()}catch{throw new Fe("".concat(a," property is declared twice"))}o[a]=i.getChildNode(n,a).snapshot}),r?this.applySnapshotPostProcessor(o):o}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r={};return Object.keys(n).forEach(function(i){r[i]=n[i].getSnapshot()}),this.applySnapshotPostProcessor(r)}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){if(!(i.op==="replace"||i.op==="add"))throw new Fe("object does not support operation ".concat(i.op));n.storedValue[r]=i.value}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){Eo(this,r);var i=this.applySnapshotPreProcessor(r);this.forAllProps(function(o){n.storedValue[o]=i[o]})}}),Object.defineProperty(e.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.preProcessor;return r?r.call(null,n):n}}),Object.defineProperty(e.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.postProcessor;return r?r.call(null,n):n}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.properties[n]}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this,o=this.applySnapshotPreProcessor(n);return tl(o)?Kp(this.propertyNames.map(function(a){return i.properties[a].validate(o[a],o2(r,a,i.properties[a]))})):_r(r,o,"Value is not a plain object")}}),Object.defineProperty(e.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;this.propertyNames.forEach(function(i){return n(i,r.properties[i])})}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;return"{ "+this.propertyNames.map(function(r){return r+": "+n.properties[r].describe()}).join("; ")+" }"}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Hs}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){n.storedValue[r]=void 0}}),e}(Bs);Rc.prototype.applySnapshot=dn(Rc.prototype.applySnapshot);function zI(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=typeof t[0]=="string"?t.shift():"AnonymousModel",r=t.shift()||{};return new Rc({name:n,properties:r})}function BI(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=typeof t[0]=="string",r=n?t[0]:"AnonymousModel";return n&&t.shift(),t.reduce(function(i,o){return i.cloneAndEnhance({name:i.name+"_"+o.name,properties:o.properties,initializers:o.initializers,preProcessor:function(a){return o.applySnapshotPreProcessor(i.applySnapshotPreProcessor(a))},postProcessor:function(a){return o.applySnapshotPostProcessor(i.applySnapshotPostProcessor(a))}})}).named(r)}function j7(t){return Sn(t)&&(t.flags&it.Object)>0}var Do=function(t){jt(e,t);function e(n,r,i,o){o===void 0&&(o=dI);var a=t.call(this,n)||this;return Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:o}),a.flags=r,a}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){return Ia(this,n,r,i,o)}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.initializer(n)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if($s(n)&&this.checker(n))return br();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return _r(r,n,"Value is not a ".concat(i))}}),e}(Ll),F7=new Do("string",it.String,function(t){return typeof t=="string"}),z7=new Do("number",it.Number,function(t){return typeof t=="number"}),UI=new Do("integer",it.Integer,function(t){return hI(t)}),HI=new Do("float",it.Float,function(t){return pI(t)}),$I=new Do("finite",it.Finite,function(t){return gI(t)}),B7=new Do("boolean",it.Boolean,function(t){return typeof t=="boolean"}),U7=new Do("null",it.Null,function(t){return t===null}),H7=new Do("undefined",it.Undefined,function(t){return t===void 0}),$7=new Do("Date",it.Date,function(t){return typeof t=="number"||t instanceof Date},function(t){return t instanceof Date?t:new Date(t)});$7.getSnapshot=function(t){return t.storedValue.getTime()};var G7=$7;function GI(t){switch(typeof t){case"string":return F7;case"number":return z7;case"boolean":return B7;case"object":if(t instanceof Date)return G7}throw new Fe("Cannot determine primitive type from value "+t)}function V7(t){return Sn(t)&&(t.flags&(it.String|it.Number|it.Integer|it.Boolean|it.Date))>0}var VI=function(t){jt(e,t);function e(n){var r=t.call(this,JSON.stringify(n))||this;return Object.defineProperty(r,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:it.Literal}),r.value=n,r}return Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){return Ia(this,n,r,i,o)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return $s(n)&&n===this.value?br():_r(r,n,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),e}(Ll);function q7(t){return new VI(t)}function qI(t){return Sn(t)&&(t.flags&it.Literal)>0}var WI=function(t){jt(e,t);function e(n,r,i,o){var a=t.call(this,n)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"_message",{enumerable:!0,configurable:!0,writable:!0,value:o}),a}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|it.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){return this._subtype.instantiate(n,r,i,o)}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._subtype.isAssignableFrom(n)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this._subtype.validate(n,r);if(i.length>0)return i;var o=kt(n)?Ge(n).snapshot:n;return this._predicate(o)?br():_r(r,n,this._message(n))}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){return this._subtype.reconcile(n,r,i,o)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),e}(To);function YI(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=typeof t[0]=="string"?t.shift():Sn(t[0])?t[0].name:null,r=t[0],i=t[1],o=t[2]?t[2]:function(a){return"Value does not respect the refinement predicate"};return new WI(n,r,i,o)}function KI(t){return Sn(t)&&(t.flags&it.Refinement)>0}function XI(t,e){var n=typeof t=="string"?e:t,r=Zp.apply(void 0,Zi([],Xi(n.map(function(i){return q7(""+i)})),!1));return typeof t=="string"&&(r.name=t),r}var ZI=function(t){jt(e,t);function e(n,r,i){var o=t.call(this,n)||this;return Object.defineProperty(o,"_types",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=wn({eager:!0,dispatcher:void 0},i),o._dispatcher=i.dispatcher,i.eager||(o._eager=!1),o}return Object.defineProperty(e.prototype,"flags",{get:function(){var n=it.Union;return this._types.forEach(function(r){n|=r.flags}),n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._types.some(function(r){return r.isAssignableFrom(n)})}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(n){return n.describe()}).join(" | ")+")"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){var a=this.determineType(o,void 0);if(!a)throw new Fe("No matching type for union "+this.describe());return a.instantiate(n,r,i,o)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){var a=this.determineType(r,n.getReconciliationType());if(!a)throw new Fe("No matching type for union "+this.describe());return a.reconcile(n,r,i,o)}}),Object.defineProperty(e.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return this._dispatcher?this._dispatcher(n):r?r.is(n)?r:this._types.filter(function(i){return i!==r}).find(function(i){return i.is(n)}):this._types.find(function(i){return i.is(n)})}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this._dispatcher)return this._dispatcher(n).validate(n,r);for(var i=[],o=0,a=0;a<this._types.length;a++){var l=this._types[a],s=l.validate(n,r);if(s.length===0){if(this._eager)return br();o++}else i.push(s)}return o===1?br():_r(r,n,"No type is applicable for the union").concat(Kp(i))}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),e}(To);function Zp(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=Sn(t)?void 0:t,i=Sn(t)?Zi([t],Xi(e),!1):e,o="("+i.map(function(a){return a.name}).join(" | ")+")";return new ZI(o,i,r)}function W7(t){return Sn(t)&&(t.flags&it.Union)>0}var QI=function(t){jt(e,t);function e(n,r,i){var o=t.call(this,n.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),o}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|it.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){if(this.optionalValues.indexOf(o)>=0){var a=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(n,r,i,a)}return this._subtype.instantiate(n,r,i,o)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){return this._subtype.reconcile(n,this.optionalValues.indexOf(r)<0&&this._subtype.is(r)?r:this.getDefaultInstanceOrSnapshot(),i,o)}}),Object.defineProperty(e.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&Eo(this,n),n}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return this.optionalValues.indexOf(n)>=0?br():this._subtype.validate(n,r)}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._subtype.isAssignableFrom(n)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),e}(To);function JI(t,e){if(typeof e!="function"&&kt(e))throw new Fe("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function ol(t,e,n){return JI(t,e),new QI(t,e,n||eD)}var eD=[void 0];function tD(t){return Sn(t)&&(t.flags&it.Optional)>0}var nD=ol(H7,void 0),rD=ol(U7,null);function Y7(t){return Zp(t,nD)}function iD(t){return Zp(t,rD)}var oD=function(t){jt(e,t);function e(n,r){var i=t.call(this,n)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(e.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|it.Late},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!this._subType){var r=void 0;try{r=this._definition()}catch(i){if(i instanceof ReferenceError)r=void 0;else throw i}if(n&&r===void 0)throw new Fe("Late type seems to be used too early, the definition (still) returns undefined");r&&(this._subType=r)}return this._subType}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){return this.getSubType(!0).instantiate(n,r,i,o)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){return this.getSubType(!0).reconcile(n,r,i,o)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this.getSubType(!1);return n?n.name:"<uknown late type>"}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this.getSubType(!1);return i?i.validate(n,r):br()}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.getSubType(!1);return r?r.isAssignableFrom(n):!1}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this.getSubType(!1);return n||g7}}),e}(To);function aD(t,e){var n=typeof t=="string"?t:"late(".concat(t.toString(),")"),r=typeof t=="string"?e:t;return new oD(n,r)}function lD(t){return Sn(t)&&(t.flags&it.Late)>0}function sD(t,e){return new uD(t,e)}var uD=function(t){jt(e,t);function e(n,r){var i=t.call(this,n)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:it.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()}),rm(function(){return i.pendingNodeList.length>0&&i.pendingNodeList.some(function(o){return o.isAlive&&i.options.shouldLoadPredicate(o.parent?o.parent.value:null)})},function(){i.options.loadType().then(dn(function(o){i.loadedType=o,i.pendingNodeList.forEach(function(a){a.parent&&i.loadedType&&a.parent.applyPatches([{op:"replace",path:"/".concat(a.subpath),value:a.snapshot}])})}))}),i}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){var a=this;if(this.loadedType)return this.loadedType.instantiate(n,r,i,o);var l=Ia(this,n,r,i,o);return this.pendingNodeList.push(l),rm(function(){return!l.isAlive},function(){return a.pendingNodeList.splice(a.pendingNodeList.indexOf(l),1)}),l}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return this.loadedType?this.loadedType.validate(n,r):A7(n)?br():_r(r,n,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){return this.loadedType?(n.die(),this.loadedType.instantiate(i,o,i.environment,r)):t.prototype.reconcile.call(this,n,r,i,o)}}),e}(Ll),K7=function(t){jt(e,t);function e(n){var r=t.call(this,n?"frozen(".concat(n.name,")"):"frozen")||this;return Object.defineProperty(r,"subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:it.Frozen}),r}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){return Ia(this,n,r,i,o)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return A7(n)?this.subType?this.subType.validate(n,r):br():_r(r,n,"Value is not serializable and cannot be frozen")}}),e}(Ll),L4=new K7;function cD(t){return arguments.length===0?L4:Sn(t)?new K7(t):ol(L4,t)}function fD(t){return Sn(t)&&(t.flags&it.Frozen)>0}function dD(t){switch(t){case bn.beforeDestroy:return"destroy";case bn.beforeDetach:return"detach";default:return}}var hD=function(){function t(e,n){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:n}),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(e))this.identifier=e;else if(kt(e)){var r=Ge(e);if(!r.identifierAttribute)throw new Fe("Can only store references with a defined identifier attribute.");var i=r.unnormalizedIdentifier;if(i==null)throw new Fe("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new Fe("Can only store references to tree nodes or identifiers, got: '".concat(e,"'"))}return Object.defineProperty(t.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=ou(this.identifier),r=e.root,i=r.identifierCache.getLastCacheModificationPerId(n);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var o=this.targetType,a=r.identifierCache.resolve(o,n);if(!a)throw new u2("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(e.path,")"));this.resolvedReference={node:a,lastCacheModification:i}}}}),Object.defineProperty(t.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),t}(),u2=function(t){jt(e,t);function e(n){var r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return e}(Error),X7=function(t){jt(e,t);function e(n,r){var i=t.call(this,"reference(".concat(n.name,")"))||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:it.Reference}),i}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.targetType.isAssignableFrom(n)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return c2(n)?br():_r(r,n,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(e.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){var a=r.parent;if(!(!a||!a.isAlive)){var l=a.storedValue;l&&this.onInvalidated({cause:n,parent:l,invalidTarget:o?o.storedValue:void 0,invalidId:i,replaceRef:function(s){zs(r.root.storedValue,{op:"replace",value:s,path:r.path})},removeRef:function(){j7(a.type)?this.replaceRef(void 0):zs(r.root.storedValue,{op:"remove",path:r.path})}})}}}),Object.defineProperty(e.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this,o=this.getValue(n);if(o){var a=Ge(o),l=function(h,x){var w=dD(x);w&&i.fireInvalidated(w,n,r,a)},s=a.registerHook(bn.beforeDetach,l),f=a.registerHook(bn.beforeDestroy,l);return function(){s(),f()}}}}),Object.defineProperty(e.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){var o=this;if(this.onInvalidated){var a;n.registerHook(bn.beforeDestroy,function(){a&&a()});var l=function(s){a&&a();var f=n.parent,h=f&&f.storedValue;if(f&&f.isAlive&&h){var x=void 0;i?x=!!i.get(r,h):x=n.root.identifierCache.has(o.targetType,ou(r)),x?a=o.addTargetNodeWatcher(n,r):s||o.fireInvalidated("invalidSnapshotReference",n,r,null)}};n.state===Dn.FINALIZED?l(!0):(n.isRoot||n.root.registerHook(bn.afterCreationFinalization,function(){n.parent&&n.parent.createObservableInstanceIfNeeded()}),n.registerHook(bn.afterAttach,function(){l(!1)}))}}}),e}(Ll),pD=function(t){jt(e,t);function e(n,r){return t.call(this,n,r)||this}return Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(n.isAlive){var r=n.storedValue;return r.resolvedValue}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=n.storedValue;return r.identifier}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){var a=kt(o)?u7(o):o,l=new hD(o,this.targetType),s=Ia(this,n,r,i,l);return l.node=s,this.watchTargetNodeForInvalidations(s,a,void 0),s}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){if(!n.isDetaching&&n.type===this){var a=kt(r),l=n.storedValue;if(!a&&l.identifier===r||a&&l.resolvedValue===r)return n.setParent(i,o),n}var s=this.instantiate(i,o,void 0,r);return n.die(),s}}),e}(X7),gD=function(t){jt(e,t);function e(n,r,i){var o=t.call(this,n,i)||this;return Object.defineProperty(o,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),o}return Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(n.isAlive){var r=this.options.get(n.storedValue,n.parent?n.parent.storedValue:null);return r}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){var a=kt(o)?this.options.set(o,n?n.storedValue:null):o,l=Ia(this,n,r,i,a);return this.watchTargetNodeForInvalidations(l,a,this.options),l}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){var a=kt(r)?this.options.set(r,n?n.storedValue:null):r;if(!n.isDetaching&&n.type===this&&n.storedValue===a)return n.setParent(i,o),n;var l=this.instantiate(i,o,void 0,a);return n.die(),l}}),e}(X7);function Z7(t,e){var n=e||void 0,r=e?e.onInvalidated:void 0;return n&&(n.get||n.set)?new gD(t,{get:n.get,set:n.set},r):new pD(t,r)}function vD(t){return Sn(t)&&(t.flags&it.Reference)>0}function mD(t,e){var n=Z7(t,wn(wn({},e),{onInvalidated:function(r){e&&e.onInvalidated&&e.onInvalidated(r),r.removeRef()}}));return e&&e.acceptsUndefined===!1?n:Y7(n)}var Q7=function(t){jt(e,t);function e(n,r){var i=t.call(this,n)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:it.Identifier}),i}return Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){if(!n||!(n.type instanceof Rc))throw new Fe("Identifier types can only be instantiated as direct child of a model type");return Ia(this,n,r,i,o)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){if(n.storedValue!==r)throw new Fe("Tried to change identifier from '".concat(n.storedValue,"' to '").concat(r,"'. Changing identifiers is not allowed."));return n.setParent(i,o),n}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return typeof n!==this.validType?_r(r,n,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):br()}}),e}(Ll),yD=function(t){jt(e,t);function e(){var n=t.call(this,"identifier","string")||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:it.Identifier}),n}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),e}(Q7),bD=function(t){jt(e,t);function e(){return t.call(this,"identifierNumber","number")||this}return Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),e}(Q7),_D=new yD,wD=new bD;function SD(t){return Sn(t)&&(t.flags&it.Identifier)>0}function ou(t){return""+t}function c2(t){return typeof t=="string"||typeof t=="number"}function ED(t){return new OD(t)}var OD=function(t){jt(e,t);function e(n){var r=t.call(this,n.name)||this;return Object.defineProperty(r,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:it.Custom}),r}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this.options.isTargetType(n))return br();var i=this.options.getValidationMessage(n);return i?_r(r,n,"Invalid value for type '".concat(this.name,"': ").concat(i)):br()}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.options.toSnapshot(n.storedValue)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){var a=this.options.isTargetType(o)?o:this.options.fromSnapshot(o,n&&n.root.environment);return Ia(this,n,r,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,o){var a=!this.options.isTargetType(r);if(!n.isDetaching){var l=n.type===this&&(a?r===n.snapshot:r===n.storedValue);if(l)return n.setParent(i,o),n}var s=a?this.options.fromSnapshot(r,i.root.environment):r,f=this.instantiate(i,o,void 0,s);return n.die(),f}}),e}(Ll),N4={enumeration:XI,model:zI,compose:BI,custom:ED,reference:Z7,safeReference:mD,union:Zp,optional:ol,literal:q7,maybe:Y7,maybeNull:iD,refinement:YI,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:aD,lazy:sD,undefined:H7,null:U7,snapshotProcessor:RI};const xD=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:RN,addMiddleware:_7,applyAction:v7,applyPatch:zs,applySnapshot:a7,cast:IN,castFlowReturn:wI,castToReferenceSnapshot:jN,castToSnapshot:DN,clone:kN,createActionTrackingMiddleware:HN,createActionTrackingMiddleware2:GN,decorate:XN,destroy:AN,detach:TN,escapeJsonPath:pa,flow:N7,getChildType:fN,getEnv:MN,getIdentifier:u7,getLivelinessChecking:r7,getMembers:NN,getNodeId:FN,getParent:yN,getParentOfType:_N,getPath:s7,getPathParts:wN,getPropertyMembers:d7,getRelativePath:CN,getRoot:l7,getRunningActionContext:i2,getSnapshot:t2,getType:tf,hasEnv:LN,hasParent:mN,hasParentOfType:bN,isActionContextChildOf:JN,isActionContextThisOrChildOf:eI,isAlive:n2,isArrayType:DI,isFrozenType:fD,isIdentifierType:SD,isLateType:lD,isLiteralType:qI,isMapType:NI,isModelType:j7,isOptionalType:tD,isPrimitiveType:V7,isProtected:vN,isReferenceType:vD,isRefinementType:KI,isRoot:SN,isStateTreeNode:kt,isType:Sn,isUnionType:W7,isValidReference:PN,joinJsonPath:xh,onAction:m7,onPatch:o7,onSnapshot:dN,process:cI,protect:pN,recordActions:YN,recordPatches:hN,resolveIdentifier:ON,resolvePath:EN,setLivelinessChecking:n7,setLivelynessChecking:uN,splitJsonPath:Gs,t:N4,toGenerator:EI,toGeneratorFunction:SI,tryReference:xN,tryResolve:c7,typecheck:E7,types:N4,unescapeJsonPath:I7,unprotect:gN,walk:f7},Symbol.toStringTag,{value:"Module"})),ni=_a(xD);var f2={};(function(t){function e({oldText:n,newText:r,element:i}){if(!(r.length/Math.max(20,n.length)>=4))return i.fontSize;const o=i.width*i.page.computedHeight/r.length,a=1.5*Math.sqrt(o),l=i.fontSize;return Math.min(l,Math.max(5,Math.round(a)))}Object.defineProperty(t,"__esModule",{value:!0}),t.getLimitedFontSize=e})(f2);(function(t){var e=_e&&_e.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(t,"__esModule",{value:!0}),t.TextElement=t.getLineHeight=t.useFontLoader=void 0,t.isRTLText=C,t.getDir=R,t.usePrevious=Z;const n=e(Qe),r=ti,i=Io,o=Qc,a=Qi,l=e(ki),s=sN,f=Jc,h=Yi,x=iu,w=Qr,v=e2,O=ef,g=Rl,b=Ml,p=Na,y=ni,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 A(M){var D="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+D+"]*?["+D+"]").test(M)}function C(M){M=M.replace(/\s/g,"");let D=0;for(var B=0;B<M.length;B++)A(M[B])&&(D+=1);return D>M.length/2}function R(M){return C(M)?"rtl":"ltr"}const S=(0,r.observer)(({textNodeRef:M,element:D,onBlur:B,selectAll:V,cursorPosition:Y})=>{const[F,$]=n.default.useState(_),z=M.current;n.default.useLayoutEffect(()=>{const ne={};ne.width=z.width()-2*z.padding()+"px",ne.height=z.height()-2*z.padding()+z.fontSize()*z.lineHeight()+"px",ne.fontSize=z.fontSize()+"px",ne.lineHeight=z.lineHeight()+.01,ne.fontFamily=z.fontFamily(),ne.textAlign=z.align(),ne.color=z.fill(),ne.fontWeight=D.fontWeight,ne.fontStyle=D.fontStyle,ne.letterSpacing=D.letterSpacing+"em";const ie=`
96
- .polotno-input::placeholder {
97
- color: ${F.color};
98
- opacity: 0.6;
99
- }
100
- `;m.innerHTML="",m.appendChild(document.createTextNode(ie)),JSON.stringify(ne)!==JSON.stringify(F)&&$(ne)});const K=n.default.useRef(null);n.default.useLayoutEffect(()=>{var ne;const ie=K.current;if(!ie)return;(ne=K.current)===null||ne===void 0||ne.focus();const oe=Y||ie.value.length;ie.selectionStart=ie.selectionEnd=oe,V&&(ie==null||ie.select(),document.execCommand("selectAll",!1,null))},[]),n.default.useEffect(()=>{window.addEventListener("blur",B);const ne=ie=>{var oe;!((oe=K.current)===null||oe===void 0)&&oe.contains(ie.target)||B()};return window.addEventListener("touchstart",ne),()=>{window.removeEventListener("blur",B),window.removeEventListener("touchstart",ne)}},[]);let X=0;const Q=z.textArr.length*z.lineHeight()*z.fontSize();D.verticalAlign==="middle"&&(X=(D.a.height-Q)/2),D.verticalAlign==="bottom"&&(X=D.a.height-Q);const J=(0,v.removeTags)(D.text);return n.default.createElement("textarea",{className:"polotno-input",ref:K,dir:R(J),style:Object.assign(Object.assign(Object.assign({},_),F),{paddingTop:X+"px"}),value:J,onChange:ne=>{const ie=(0,d.getLimitedFontSize)({oldText:D.text,newText:ne.target.value,element:D});D.set({text:ne.target.value,fontSize:ie})},placeholder:D.placeholder,onBlur:B})}),E=M=>n.default.createElement(o.Html,null,n.default.createElement(S,Object.assign({},M))),P=M=>{const[D,B]=n.default.useState(!1),V=n.default.useRef(!1);return n.default.useEffect(()=>{var Y=!0;return setTimeout(()=>{Y&&(M._editModeEnabled&&(V.current=!0),B(!0),setTimeout(()=>{V.current=!1},50))},50),()=>{Y=!1}},[]),{editorEnabled:D&&M._editModeEnabled,selectAll:V.current}},T=(M,D)=>{const[B,V]=n.default.useReducer(F=>F+1,0),Y=n.default.useRef((0,x.isFontLoaded)(D));return n.default.useLayoutEffect(()=>{if(Y.current=(0,x.isFontLoaded)(D),Y.current)return;let F=!0;return(async()=>{Y.current=!1,V();const $=(0,h.incrementLoader)(`text ${D}`);await M.loadFont(D),setTimeout($,100),F&&(Y.current=!0,V())})(),()=>{F=!1}},[D]),[Y.current]};t.useFontLoader=T;const N=({fontLoaded:M,fontFamily:D,fontSize:B,lineHeight:V})=>n.default.useMemo(()=>{if(typeof V=="number")return V;const Y=document.createElement("div");Y.style.fontFamily=D,Y.style.fontSize=B+"px",Y.style.lineHeight=V,Y.innerText="Test text",document.body.appendChild(Y);const F=Y.offsetHeight;return document.body.removeChild(Y),F/B},[M,D,B,V]);function U(M){var D=M.getAbsoluteTransform().copy();D.invert();var B=M.getStage().getPointerPosition();return D.point(B)}function G(M){var D;const B=M.target,V=U(B),Y=B.textArr,F=Math.floor(V.y/(B.fontSize()*B.lineHeight())),$=Y.slice(0,F).reduce((X,Q)=>X+Q.text.length,F),z=(D=Y[F])!==null&&D!==void 0?D:Y[0];let K=0;return B.align()==="right"?K=B.width()-z.width:B.align()==="center"&&(K=B.width()/2-z.width/2),$+Math.round((V.x-K)/z.width*z.text.length)}function Z(M){const D=n.default.useRef(M),B=n.default.useRef(M);return n.default.useMemo(()=>{B.current=D.current,D.current=M},[M]),B.current}function W(M){return/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(M)}function H(M,D,B=!1){const V=M.fontSize(),Y=M.height(),F=(0,v.removeTags)(D.text);let $=D.a.fontSize;M.height(void 0);const z=Math.round(2*D.a.fontSize)-1;for(let K=1;K<z;K++){const X=D.a.height&&M.height()>D.a.height;let Q=F.split(`
101
- `).join(" ").split(/[\s-]+/).reduce((ie,oe)=>W(oe)?ie.concat(oe.split("")):ie.concat(oe),[]),J=M.textArr.map(ie=>ie.text).join(";");const ne=Q.find(ie=>!J.includes(ie)||(J=J.replace(ie,""),!1));if(!(X||ne&&!B))break;$-=.5,M.fontSize($)}return M.fontSize(V),M.height(Y),$}function L({lines:M,lineHeight:D,width:B,align:V="left",padding:Y=0,cornerRadius:F=0}){var $;M.forEach((Q,J)=>{Q.cx=B/2,V==="right"?Q.cx=B-Q.width/2:V==="left"&&(Q.cx=Q.width/2),V!=="justify"||Q.lastInParagraph||(Q.width=B),V==="justify"&&(Q.cx=Q.width/2)});let z=`M ${($=M[0])===null||$===void 0?void 0:$.cx} ${-Y}`;M.forEach((Q,J)=>{const{cx:ne}=Q,ie=M[J-1];ie&&ie.width>Q.width?z+=` L ${ne+Q.width/2+Y} ${J*D+Y}`:z+=` L ${ne+Q.width/2+Y} ${J*D-Y}`;const oe=M[J+1];oe&&oe.width>Q.width?z+=` L ${ne+Q.width/2+Y} ${(J+1)*D-Y}`:z+=` L ${ne+Q.width/2+Y} ${(J+1)*D+Y}`});for(var K=M.length-1;K>=0;K--){const Q=M[K],{cx:J}=Q,ne=M[K+1];ne&&ne.width>Q.width?z+=` L ${J-Q.width/2-Y} ${(K+1)*D-Y}`:z+=` L ${J-Q.width/2-Y} ${(K+1)*D+Y}`;const ie=M[K-1];ie&&ie.width>Q.width?z+=` L ${J-Q.width/2-Y} ${K*D+Y}`:z+=` L ${J-Q.width/2-Y} ${K*D-Y}`}z+=" Z";const X=(0,s.parsePath)(z);return(0,s.roundCommands)(X,F).path}t.getLineHeight=N,t.TextElement=(0,r.observer)(({element:M,store:D})=>{const B=n.default.useRef(null),V=n.default.useRef(null),{editorEnabled:Y,selectAll:F}=P(M),[$,z]=n.default.useState(!1),[K,X]=n.default.useState(!1),Q=n.default.useRef(M.a.height),J=D.selectedShapes.indexOf(M)>=0,{textVerticalResizeEnabled:ne}=w.flags,ie=Z(M.fontFamily),[oe,de]=n.default.useState([]);n.default.useEffect(()=>{var Ce,Me;const ze=(Me=(Ce=B.current)===null||Ce===void 0?void 0:Ce.textArr)!==null&&Me!==void 0?Me:[];JSON.stringify(ze)!==JSON.stringify(oe)&&de(ze)}),n.default.useEffect(()=>{if(M.a.width)return;const Ce=B.current;Ce.width(600),M.set({width:1.4*Ce.getTextWidth()})},[]),n.default.useLayoutEffect(()=>(0,a.autorun)(()=>{const Ce=B.current;(0,O.applyFilter)(Ce,M)}));const[me]=(0,t.useFontLoader)(D,M.fontFamily),Pe=(0,v.removeTags)(M.text),re=()=>{const Ce=B.current.clone({height:void 0}),Me=Math.ceil(Ce.fontSize()*Ce.lineHeight()*Ce.textArr.length+1);return Ce.destroy(),Me};n.default.useLayoutEffect(()=>{if(!me)return;const{textOverflow:Ce,textSplitAllowed:Me}=w.flags;if(M.a.height){if(!D.isPlaying)if(Ce!=="change-font-size"||K){if(Ce==="resize"){const ze=re();ne&&M.a.height<ze&&D.history.ignore(()=>{var We;(0,y.isAlive)(M)&&M.set({height:ze}),(We=B.current)===null||We===void 0||We.height(ze)},!1,!0),ne||M.a.height===ze||D.history.ignore(()=>{var We;(0,y.isAlive)(M)&&M.set({height:ze}),(We=B.current)===null||We===void 0||We.height(ze)},!1,!0)}}else{const ze=H(B.current,M,Me);if(ze!==M.a.fontSize)return void D.history.ignore(()=>{M.set({fontSize:ze})},!1,!0);const We=re();M.a.height===We||ne||D.history.ignore(()=>{M.set({height:We})},!1,!0)}}else{const ze=re();D.history.ignore(()=>{M.set({height:ze})},!1,!0)}}),n.default.useLayoutEffect(()=>{const Ce=B.current;Ce&&(Ce.width(Ce.width()+1e-8),Ce._setTextData(),(0,O.applyFilter)(Ce,M))},[me]);const ae=n.default.useRef(null),we=n.default.useRef(0),be=Ce=>{Ce.evt.preventDefault(),D.selectedShapes.find(ze=>ze===M)&&M.contentEditable&&(we.current=G(Ce),M.toggleEditMode())},te=!Pe&&M.placeholder?.6:M.a.opacity;(0,g.useFadeIn)(B,te);const fe=(0,t.getLineHeight)({fontLoaded:me,fontFamily:M.fontFamily,fontSize:M.a.fontSize,lineHeight:M.lineHeight}),he=M.selectable||D.role==="admin",Ee=(0,f.useColor)(M),Ve=n.default.useMemo(()=>M.backgroundEnabled?L({lines:JSON.parse(JSON.stringify(oe)),cornerRadius:M.backgroundCornerRadius*(M.a.fontSize*fe*.5),lineHeight:fe*M.a.fontSize,padding:M.backgroundPadding*(M.a.fontSize*fe*.5),width:M.a.width,align:M.align}):"",[M.backgroundEnabled,M.backgroundCornerRadius,M.a.fontSize,fe,M.backgroundPadding,M.a.width,M.align,oe]),Je=(0,p.isTouchDevice)();let Ae=0;return M.verticalAlign==="middle"?Ae=(M.a.height-oe.length*fe*M.a.fontSize)/2:M.verticalAlign==="bottom"&&(Ae=M.a.height-oe.length*fe*M.a.fontSize),n.default.createElement(n.default.Fragment,null,n.default.createElement(i.Path,{ref:V,x:M.a.x,y:M.a.y,rotation:M.a.rotation,hideInExport:!M.showInExport,listening:!1,visible:M.backgroundEnabled,opacity:M.backgroundOpacity*te,data:Ve,fill:M.backgroundColor,offsetY:-Ae}),n.default.createElement(i.Text,Object.assign({ref:B,id:M.id,name:"element",hideInExport:!M.showInExport,editModeEnabled:M._editModeEnabled,x:M.a.x,y:M.a.y,rotation:M.a.rotation,width:M.a.width,height:M.a.height,text:Pe||M.placeholder,direction:R(Pe)},Ee,{stroke:M.stroke,lineJoin:"round",strokeWidth:M.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:M.a.fontSize,fontFamily:`"${M.fontFamily}", "${ie}"`,fontStyle:M.fontStyle+" "+M.fontWeight,textDecoration:M.textDecoration,align:M.align,verticalAlign:M.verticalAlign,draggable:Je?M.draggable&&J:M.draggable,preventDefault:!Je||J,opacity:te,visible:!M._editModeEnabled,ellipsis:w.flags.textOverflow==="ellipsis",shadowEnabled:M.shadowEnabled,shadowBlur:M.shadowBlur,shadowOffsetX:M.shadowOffsetX,shadowOffsetY:M.shadowOffsetY,shadowColor:M.shadowColor,shadowOpacity:M.shadowOpacity,lineHeight:fe,letterSpacing:M.letterSpacing*M.a.fontSize,listening:he,onDragMove:Ce=>{M.set({x:Ce.target.x(),y:Ce.target.y()})},onDragEnd:Ce=>{M.set({x:Ce.target.x(),y:Ce.target.y()})},onMouseEnter:()=>{z(!0)},onMouseLeave:()=>{z(!1)},onClick:be,onTap:be,onTransformStart:()=>{X(!0),Q.current=B.current.height()},onTransform:Ce=>{var Me,ze;const We=Ce.target;(Me=V.current)===null||Me===void 0||Me.setAttrs({x:We.x(),y:We.y(),rotation:We.rotation(),scale:We.scale()});const St=((ze=We.getStage())===null||ze===void 0?void 0:ze.findOne("Transformer")).getActiveAnchor();if(St==="middle-left"||St==="middle-right"){const mt=We.scaleX(),ue=We.width()*mt,ce=M.a.fontSize;let Se=ue;ue<ce&&(Se=ce,ae.current&&We.position(ae.current)),We.width(Se),We.scaleX(1),We.scaleY(1);const Le=re();if(w.flags.textOverflow!=="ellipsis"){const Ne=Math.max(Le,Q.current);We.height(Ne),M.set({height:We.height()})}M.set({x:We.x(),y:We.y(),width:We.width(),rotation:We.rotation()}),(0,O.applyFilter)(We,M)}if(St==="top-center"||St==="bottom-center"){let mt=w.flags.textOverflow==="resize"?re():fe*M.a.fontSize;Ce.target.height(Math.max(mt,Ce.target.height()*Ce.target.scaleY())),Ce.target.scaleY(1)}ae.current=Ce.target.position()},onTransformEnd:Ce=>{var Me;const ze=Ce.target.scaleX();Ce.target.scaleX(1),Ce.target.scaleY(1),M.set({fontSize:Math.round(M.a.fontSize*ze),width:Math.ceil(Ce.target.width()*ze),x:Ce.target.x(),y:Ce.target.y(),rotation:Ce.target.rotation(),height:Ce.target.height()*ze,shadowBlur:M.shadowBlur*ze,shadowOffsetX:M.shadowOffsetX*ze,shadowOffsetY:M.shadowOffsetY*ze,strokeWidth:M.strokeWidth*ze}),(Me=V.current)===null||Me===void 0||Me.setAttrs({scaleX:1,scaleY:1}),X(!1)}})),Y&&n.default.createElement(i.Group,{x:M.a.x,y:M.a.y,rotation:M.a.rotation},n.default.createElement(E,{textNodeRef:B,element:M,selectAll:F,cursorPosition:we.current,onBlur:()=>{M.toggleEditMode(!1)}})),!K&&($||J)&&n.default.createElement(b.Highlighter,{element:M}))})})(Zy);var d2={},au={},J7={exports:{}},eS={exports:{}};(function(t,e){t.exports=n;function n(i){return r.bind(null,i)}function r(i){var o=[].slice.call(arguments,1);o.unshift("["+i+"]"),process.stderr.write(o.join(" ")+`
102
- `)}})(eS);var h2=eS.exports;(function(t,e){h2("lex"),t.exports=n;function n(r){var i="",o,a=0,l=-1,s=0,f=1,h="before-selector",x=[h],w={},v=[],O=["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 g(){return R(),r[l]}function b(W){return W?x[x.length-1-W]:h}function p(W){var H=l+1;return W===r.slice(H,H+W.length)}function y(W){var H=r.slice(l).indexOf(W);return H>0?H:!1}function d(W){return W===m(1)}function m(W){return r[l+(W||1)]}function _(){var W=x.pop();return h=x[x.length-1],W}function A(W){return h=W,x.push(h),x.length}function C(W){var H=h;return x[x.length-1]=h=W,H}function R(W){if((W||1)==1)r[l]==`
103
- `?(f++,a=1):a++,l++;else{var H=r.slice(l,l+W).split(`
104
- `);H.length>1&&(f+=H.length-1,a=1),a+=H[H.length-1].length,l=l+W}}function S(){w.end={line:f,col:a},v.push(w),i="",w={}}function E(W){w={type:W,start:{line:f,col:a}}}for(;o=g();)switch(o){case" ":switch(b()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":i+=o;break}break;case`
105
- `:case" ":case"\r":case"\f":switch(b()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":i+=o;break;case"at-value":o===`
106
- `&&(w.value=i.trim(),S(),_());break}break;case":":switch(b()){case"name":w.name=i.trim(),i="",C("before-value");break;case"before-selector":i+=o,E("selector"),A("selector");break;case"before-value":C("value"),i+=o;break;default:i+=o;break}break;case";":switch(b()){case"name":case"before-value":case"value":i.trim().length>0&&(w.value=i.trim(),S()),C("before-name");break;case"value-paren":i+=o;break;case"at-value":w.value=i.trim(),S(),_();break;case"before-name":break;default:i+=o;break}break;case"{":switch(b()){case"selector":if(m(-1)==="\\"){i+=o;break}w.text=i.trim(),S(),C("before-name"),s=s+1;break;case"at-group":switch(w.name=i.trim(),w.type){case"font-face":case"viewport":case"page":A("before-name");break;default:A("before-selector")}S(),s=s+1;break;case"name":case"at-rule":w.name=i.trim(),S(),A("before-name"),s=s+1;break;case"comment":case"double-string":case"single-string":i+=o;break;case"before-value":C("value"),i+=o;break}break;case"}":switch(b()){case"before-name":case"name":case"before-value":case"value":i&&(w.value=i.trim()),w.name&&w.value&&S(),E("end"),S(),_(),b()==="at-group"&&(E("at-group-end"),S(),_()),s>0&&(s=s-1);break;case"at-group":case"before-selector":case"selector":if(m(-1)==="\\"){i+=o;break}s>0&&b(1)==="at-group"&&(E("at-group-end"),S()),s>1&&_(),s>0&&(s=s-1);break;case"double-string":case"single-string":case"comment":i+=o;break}break;case'"':case"'":switch(b()){case"double-string":o==='"'&&m(-1)!=="\\"&&_();break;case"single-string":o==="'"&&m(-1)!=="\\"&&_();break;case"before-at-value":C("at-value"),A(o==='"'?"double-string":"single-string");break;case"before-value":C("value"),A(o==='"'?"double-string":"single-string");break;case"comment":break;default:m(-1)!=="\\"&&A(o==='"'?"double-string":"single-string")}i+=o;break;case"/":switch(b()){case"comment":case"double-string":case"single-string":i+=o;break;case"before-value":case"selector":case"name":case"value":if(d("*")){var P=y("*/");P&&R(P+1)}else b()=="before-value"&&C("value"),i+=o;break;default:d("*")?(E("comment"),A("comment"),R()):i+=o;break}break;case"*":switch(b()){case"comment":d("/")?(w.text=i,R(),S(),_()):i+=o;break;case"before-selector":i+=o,E("selector"),A("selector");break;case"before-value":C("value"),i+=o;break;default:i+=o}break;case"@":switch(b()){case"comment":case"double-string":case"single-string":i+=o;break;case"before-value":C("value"),i+=o;break;default:for(var T=!1,N,U,G=0,Z=O.length;!T&&G<Z;++G)U=O[G],N=U.name||U,p(N)&&(T=!0,E(N),A(U.state||"at-group"),R(N.length),U.prefix&&(w.prefix=U.prefix),U.type&&(w.type=U.type));T||(i+=o);break}break;case"(":switch(b()){case"value":A("value-paren");break;case"before-value":C("value");break}i+=o;break;case")":switch(b()){case"value-paren":_();break;case"before-value":C("value");break}i+=o;break;default:switch(b()){case"before-selector":E("selector"),A("selector");break;case"before-name":E("property"),C("name");break;case"before-value":C("value");break;case"before-at-value":C("at-value");break}i+=o;break}return v}})(J7);var tS=J7.exports,nS={exports:{}};(function(t,e){h2("parse");var n=tS;t.exports=l;var r,i,o,a;function l(_,A){A||(A={}),r=!!A.comments,o=!!A.position,i=0,a=Array.isArray(_)?_.slice():n(_);for(var C,R=[],S;S=f();)C=p(S),C&&R.push(C);return{type:"stylesheet",stylesheet:{rules:R}}}function s(_,A){A||(A={});for(var C,R=["type","name","value"],S={},E=0;E<R.length;++E)C=R[E],_[C]&&(S[C]=A[C]||_[C]);for(R=Object.keys(A),E=0;E<R.length;++E)C=R[E],S[C]||(S[C]=A[C]);return o&&(S.position={start:_.start,end:_.end}),S}function f(){var _=a.shift();return _}function h(_){i=i+1;var A={};switch(_.type){case"font-face":case"viewport":A.declarations=d();break;case"page":A.prefix=_.prefix,A.declarations=d();break;default:A.prefix=_.prefix,A.rules=m()}return s(_,A)}function x(_){return s(_)}function w(_){return s(_)}function v(_){return s(_,{text:_.text})}function O(_){return s(_)}function g(_){return s(_)}function b(_){function A(C){return C.trim()}return s(_,{type:"rule",selectors:_.text.split(",").map(A),declarations:d()})}function p(_){switch(_.type){case"property":return g(_);case"selector":return b(_);case"at-group-end":i=i-1;return;case"media":case"keyframes":return h(_);case"comment":if(r)return v(_);break;case"charset":return w(_);case"import":return x(_);case"namespace":return O(_);case"font-face":case"supports":case"viewport":case"document":case"page":return h(_)}}function y(_){for(var A,C=[],R;(R=f())&&_&&_(R);)A=p(R),A&&C.push(A);return R&&R.type!=="end"&&a.unshift(R),C}function d(){return y(function(_){return _.type==="property"||_.type==="comment"})}function m(){return y(function(){return i})}})(nS);var PD=nS.exports,rS={exports:{}};(function(t,e){h2("stringify");var n,r,i,o,a,l;t.exports=s;function s(m,_){_||(_={}),i=_.indentation||"",r=!!_.compress,n=!!_.comments,o=1,r?a=l="":(a=`
107
- `,l=" ");var A=O(m.stylesheet.rules,y).join(`
108
- `).trim();return A}function f(m){if(m){o+=m;return}return r?"":Array(o).join(i||"")}function h(m){return"@"+m.type+" "+m.value+";"+a}function x(m){var _="",A=m.prefix||"";m.name&&(_=" "+m.name);var C=m.type!=="page";return"@"+A+m.type+_+l+g(m,C)+a}function w(m){return n?"/*"+(m.text||"")+"*/"+a:""}function v(m){var _;return m.selectors?_=m.selectors.join(","+a):(_="@"+m.type,_+=m.name?" "+m.name:""),f()+_+l+g(m)+a}function O(m,_){return m.reduce(function(A,C){var R=C.type==="comment"?w(C):_(C);return R&&A.push(R),A},[])}function g(m,_){var A=m.declarations,C=p;return m.rules&&(A=m.rules,C=v),A=b(A,C),A&&(A=a+A+(_?"":a)),"{"+A+f()+"}"}function b(m,_){if(!m)return"";f(1);var A=O(m,_);return f(-1),A.length?A.join(a):""}function p(m){if(m.type==="property")return d(m)}function y(m){switch(m.type){case"rule":return v(m);case"media":case"keyframes":return x(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 x(m)}}function d(m){var _=m.name?m.name+":"+l:"";return f()+_+m.value+";"}})(rS);var CD=rS.exports,kD={lex:tS,parse:PD,stringify:CD};(function(t){var e=_e&&_e.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(t,"__esModule",{value:!0}),t.useSvgColors=t.sameColors=void 0,t.urlToBase64=x,t.urlToString=w,t.getColors=v,t.svgToURL=O,t.getSvgSize=g,t.fixSize=b,t.replaceColors=d;const n=e(ki),r=e(Qe),i=Qy,o=e(kD);function a(_){for(;_.parentNode;){if(_.nodeName==="defs")return!0;_=_.parentNode}return!1}function l(_){const A={};return _.querySelectorAll("style").forEach(C=>{const R=o.default.parse(C.textContent).stylesheet.rules;for(let S of R)S.selectors&&S.selectors.forEach(E=>{const P=A[E]||{};S.declarations.forEach(T=>{P[T.name]=T.value}),A[E]=P})}),A}function s(_,A){var C;const R={fill:"",stroke:""},S=((C=_.getAttribute("class"))===null||C===void 0?void 0:C.split(" "))||[],E=_.getAttribute("id");let P={};if(E&&A[`#${E}`]?P=A[`#${E}`]:S.forEach(T=>{A[`.${T}`]&&(P=Object.assign(Object.assign({},P),A[`.${T}`]))}),A[_.nodeName]&&(P=Object.assign(Object.assign({},P),A[_.nodeName])),_.getAttribute("fill")&&_.getAttribute("fill")!=="none"?R.fill=_.getAttribute("fill"):P.fill&&P.fill!=="none"&&(R.fill=P.fill),_.getAttribute("stroke")&&_.getAttribute("stroke")!=="none"?R.stroke=_.getAttribute("stroke"):P.stroke&&P.stroke!=="none"&&(R.stroke=P.stroke),!R.fill&&_.style.fill&&_.style.fill!=="none"&&(R.fill=_.style.fill),!R.stroke&&_.style.stroke&&_.style.stroke!=="none"&&(R.stroke=_.style.stroke),!R.stroke&&!R.fill){const T=_.ownerSVGElement,N=T&&T!==_&&s(T,A);(N==null?void 0:N.fill)==="currentColor"||(N==null?void 0:N.stroke)==="currentColor"||(R.fill="black")}return R}const f=["path","rect","circle","line","polygon","polyline","ellipse","text"];function h(_){for(var A=[],C=_.getElementsByTagName("*"),R=0,S=C.length;R<S;R++){const E=C[R];a(E)||(E.getAttribute("fill")!==null&&A.push(E),(E.getAttribute("stroke")!==null||E.style&&E.style.fill||f.indexOf(E.nodeName)>=0)&&A.push(E))}return A}async function x(_){const A=await fetch(_);return O(await A.text())}async function w(_){return await(await fetch(_,{mode:"cors"})).text()}function v(_){var A=new DOMParser().parseFromString(_,"image/svg+xml");const C=l(A),R=h(A),S=[];return R.forEach(E=>{const{fill:P,stroke:T}=s(E,C);[P,T].forEach(N=>{N&&(N==="currentColor"&&(N="black"),n.default.Util.colorToRGBA(N)&&S.indexOf(N)===-1&&S.push(N))})}),S}function O(_){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(_)))}async function g(_){const A=await w(_),C=new DOMParser().parseFromString(A,"image/svg+xml").documentElement.getAttribute("viewBox"),[R,S,E,P]=(C==null?void 0:C.split(" "))||[];return{width:parseFloat(E),height:parseFloat(P)}}function b(_){var A=new DOMParser().parseFromString(_,"image/svg+xml");const C=A.documentElement.getAttribute("viewBox"),[R,S,E,P]=(C==null?void 0:C.split(" "))||[],T=A.documentElement.getAttribute("width");!T&&A.documentElement.setAttribute("width",E+"px");const N=A.documentElement.getAttribute("height");if((!N||N.indexOf("%")>=0)&&A.documentElement.setAttribute("height",P+"px"),T&&T.indexOf("%")>=0&&N&&N.indexOf("%")===-1){const U=parseFloat(N)/parseFloat(P);A.documentElement.setAttribute("width",U*parseFloat(E)+"px")}if(N&&N.indexOf("%")>=0&&T&&T.indexOf("%")===-1){const U=parseFloat(T)/parseFloat(E);A.documentElement.setAttribute("height",U*parseFloat(P)+"px")}return T==="100%"&&N==="100%"&&(A.documentElement.setAttribute("width",E+"px"),A.documentElement.setAttribute("height",P+"px")),new XMLSerializer().serializeToString(A)}const p=(_,A)=>{if(!_||!A)return!1;if(A==="currentColor"&&_==="black")return!0;const C=n.default.Util.colorToRGBA(_),R=n.default.Util.colorToRGBA(A);return C&&R?C.r===R.r&&C.g===R.g&&C.b===R.b&&C.a===R.a:void 0};function y(_,A,C,R){var S=_.namespaceURI,E=document.createElementNS(S,"linearGradient");const P=n.default.Util.degToRad(C+90),T=(Math.cos(P)+1)/2,N=(Math.sin(P)+1)/2,U=(Math.cos(P+Math.PI)+1)/2,G=(Math.sin(P+Math.PI)+1)/2;E.setAttribute("x1",100*T+"%"),E.setAttribute("y1",100*N+"%"),E.setAttribute("x2",100*U+"%"),E.setAttribute("y2",100*G+"%"),E.setAttribute("gradientUnits","userSpaceOnUse"),E.setAttribute("id",A);for(var Z=0;Z<R.length;Z++){var W=R[Z],H=document.createElementNS(S,"stop");for(var L in W)W.hasOwnProperty(L)&&H.setAttribute(L,W[L]);E.appendChild(H)}return(_.querySelector("defs")||_.insertBefore(document.createElementNS(S,"defs"),_.firstChild)).appendChild(E)}function d(_,A){var C=new DOMParser().parseFromString(_,"image/svg+xml");const R=h(C),S=Array.from(A.keys()),E=l(C);return R.forEach(P=>{const{fill:T,stroke:N}=s(P,E);[{prop:"fill",color:T},{prop:"stroke",color:N}].forEach(({prop:U,color:G})=>{const Z=S.find(W=>(0,t.sameColors)(W,G));if(Z){const W=A.get(Z);if((0,i.isGradient)(W)){const{rotation:H,stops:L}=(0,i.parseColor)(W),M=L.map(B=>({offset:100*B.offset+"%","stop-color":B.color})),D="color"+Math.round(1e8*Math.random());y(C.children[0],D,H,M),P.style[U]=null,P.setAttribute(U,`url('#${D}')`)}else P.style[U]=A.get(Z)}})}),O(new XMLSerializer().serializeToString(C))}t.sameColors=p;const m=_=>{const[A,C]=r.default.useState([]);return r.default.useEffect(()=>{let R=!1;return(async()=>{C([]);const S=v(await w(_));R||C(S)})(),()=>{R=!0}},[_]),A};t.useSvgColors=m})(au);var p2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.trySetCanvasSize=void 0;const e=(n,r,i)=>{let o=r,a=i,l=1;for(;o>0&&a>0;){n.width=o,n.height=a;const s=n.getContext("2d");if(!s)return;if(s.fillStyle="rgba(0,0,0,0.1)",s.fillRect(0,0,1,1),s.getImageData(0,0,1,1).data[3]!==0)return void s.clearRect(0,0,n.width,n.height);if(l*=.9,o=Math.floor(r*l),a=Math.floor(i*l),o=Math.max(o,1),a=Math.max(a,1),o<=1&&a<=1)return n.width=1,void(n.height=1)}};t.trySetCanvasSize=e})(p2);(function(t){var e=_e&&_e.__createBinding||(Object.create?function(F,$,z,K){K===void 0&&(K=z);var X=Object.getOwnPropertyDescriptor($,z);X&&!("get"in X?!$.__esModule:X.writable||X.configurable)||(X={enumerable:!0,get:function(){return $[z]}}),Object.defineProperty(F,K,X)}:function(F,$,z,K){K===void 0&&(K=z),F[K]=$[z]}),n=_e&&_e.__setModuleDefault||(Object.create?function(F,$){Object.defineProperty(F,"default",{enumerable:!0,value:$})}:function(F,$){F.default=$}),r=_e&&_e.__importStar||function(F){if(F&&F.__esModule)return F;var $={};if(F!=null)for(var z in F)z!=="default"&&Object.prototype.hasOwnProperty.call(F,z)&&e($,F,z);return n($,F),$},i=_e&&_e.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(t,"__esModule",{value:!0}),t.ImageElement=t.useImageLoader=t.setImageLoaderHook=void 0;const o=i(Qe),a=ti,l=Qi,s=Io,f=i(Yp),h=i(ki),x=Qc,w=Ml,v=Yi,O=r(au),g=Qr,b=p2,p=ef,y=Rl,d=Na;function m(){return document.createElement("canvas")}async function _(F){if(!(F.indexOf("data:image/svg+xml")>=0||F.indexOf(".svg")>=0))return F;const $=await O.urlToString(F),z=O.fixSize($);return O.svgToURL(z)}const A=F=>{const[$,z]=o.default.useState(F);return o.default.useEffect(()=>{(async()=>{const K=await _(F);K!==$&&z(K)})()},[F]),$};function C(F,$){return Math.sqrt(Math.pow($.x-F.x,2)+Math.pow($.y-F.y,2))}function R(F,$){return{x:(F.x+$.x)/2,y:(F.y+$.y)/2}}const S=(F,$,z)=>{const K=o.default.useMemo(()=>{var X,Q;const{flipX:J,flipY:ne}=F,ie=F.type==="svg"||F.src.indexOf("data:image/svg+xml")>=0||F.src.indexOf(".svg")>=0,oe=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,de=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||oe)&&ie||F.maskSrc;if(!J&&!ne&&!de)return $;if(!$||!$.width||!$.height)return null;const me=m();let Pe=1;F.type==="svg"&&(Pe=Math.max(F.a.width/$.width*z,F.a.height/$.height*z)),(0,b.trySetCanvasSize)(me,Math.max($.width*Pe,1),Math.max($.height*Pe,1));let re=J?-me.width:0,ae=ne?-me.height:0;return(X=me.getContext("2d"))===null||X===void 0||X.scale(J?-1:1,ne?-1:1),(Q=me.getContext("2d"))===null||Q===void 0||Q.drawImage($,re,ae,me.width,me.height),me},[F.maskSrc,F.flipX,F.flipY,$,F.a.width,F.a.height,z]);return o.default.useEffect(()=>()=>{K&&K.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(K)},[K]),K};function E(F,$){const z=$.width/$.height;let K,X;return z>=F.width/F.height?(K=F.width,X=F.width/z):(K=F.height*z,X=F.height),{x:(F.width-K)/2,y:(F.height-X)/2,width:K,height:X}}function P(F,$,z,K,X,Q,J){for(var ne=new ImageData($,z),ie=new Int32Array(F.data.buffer),oe=F.width,de=new Int32Array(ne.data.buffer),me=ne.width,Pe=$/Q,re=z/J,ae=Math.round(1/Pe),we=Math.round(1/re),be=ae*we,te=0;te<ne.height;te++)for(var fe=0;fe<me;fe++){for(var he=K+Math.round(fe/Pe)+(X+Math.round(te/re))*oe,Ee=0,Ve=0,Je=0,Ae=0,Ce=0;Ce<we;Ce++)for(var Me=0;Me<ae;Me++){var ze=ie[he+Me+Ce*oe];Ee+=ze<<24>>>24,Ve+=ze<<16>>>24,Je+=ze<<8>>>24,Ae+=ze>>>24}Ee=Math.round(Ee/be),Ve=Math.round(Ve/be),Je=Math.round(Je/be),Ae=Math.round(Ae/be),de[fe+te*me]=Ae<<24|Je<<16|Ve<<8|Ee}return ne}function T(F,$){var z,K;const X=m();X.width=F.width,X.height=F.height;const Q=Math.max(1,Math.floor(X.width*$)),J=Math.max(1,Math.floor(X.height*$));(z=X.getContext("2d"))===null||z===void 0||z.drawImage(F,0,0,X.width,X.height);const ne=P(X.getContext("2d").getImageData(0,0,X.width,X.height),Q,J,0,0,X.width,X.height);return X.width=Q,X.height=J,(K=X.getContext("2d"))===null||K===void 0||K.putImageData(ne,0,0),X}const N=(F,$)=>{const[z,K]=M(F.maskSrc,"anonymous"),X=F.maskSrc?K:"loaded";return(0,t.useImageLoader)(X,F.maskSrc||"",F.id),o.default.useMemo(()=>{if(!z||!$||!$.width||!$.height)return $;const Q=m();Q.width=Math.max($.width,1),Q.height=Math.max($.height,1);const J=Q.getContext("2d");if(!J)return $;J.drawImage($,0,0),J.globalCompositeOperation="source-in";const ne=E(z,F);return J.drawImage(z,ne.x,ne.y,ne.width,ne.height,0,0,$.width,$.height),Q},[$,z,F.a.width,F.a.height])},U=(F,$,z)=>Math.max($,Math.min(z,F)),G=(F,$,z,K,X=0,Q=!1,J=!0)=>{const ne=Math.floor(U(F.a.width*K,1,1e4)),ie=Math.floor(U(F.a.height*K,1,1e4)),oe=Math.min(X*K,ne/2,ie/2),de=Math.max(F.a.width/z.width,F.a.height/z.height)*K,me=F.page._exportingOrRendering&&g.flags.imageDownScalingEnabled&&de<1&&!Q,Pe=z.x===0&&z.y===0&&z.width===($==null?void 0:$.width)&&z.height===($==null?void 0:$.height),re=o.default.useMemo(()=>{if(!(!$||!$.width||!$.height))return Pe&&oe===0&&!me?void 0:m()},[$,oe,me,Pe]);return o.default.useLayoutEffect(()=>{if(!re||!$)return;(0,b.trySetCanvasSize)(re,ne,ie);const ae=re.getContext("2d");if(!ae)return;oe&&(ae.beginPath(),ae.moveTo(oe,0),ae.lineTo(ne-oe,0),ae.arc(ne-oe,oe,oe,3*Math.PI/2,0,!1),ae.lineTo(ne,ie-oe),ae.arc(ne-oe,ie-oe,oe,0,Math.PI/2,!1),ae.lineTo(oe,ie),ae.arc(oe,ie-oe,oe,Math.PI/2,Math.PI,!1),ae.lineTo(0,oe),ae.arc(oe,oe,oe,Math.PI,3*Math.PI/2,!1),ae.clip());const we=me?T($,de):$,be=me?{x:Math.floor(z.x*de),y:Math.floor(z.y*de),width:Math.floor(z.width*de),height:Math.floor(z.height*de)}:z;ae.drawImage(we,be.x,be.y,be.width,be.height,0,0,re.width,re.height)},[re,F.a.width,F.a.height,z.x,z.y,z.width,z.height,X,K,Q,F.page._exportingOrRendering,me]),o.default.useEffect(()=>()=>{re&&re.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(re)},[re]),re||$},Z=(F,$,z,K)=>{const X=A(F.clipSrc||""),[Q,J]=M(X,"anonymous"),ne=F.clipSrc?J:"loaded";(0,t.useImageLoader)(ne,F.clipSrc,F.id);const ie=o.default.useMemo(()=>{if($&&Q)return m()},[$,Q]);return o.default.useLayoutEffect(()=>{var oe;if(!Q||!$||!$.width||!$.height||!Q||!Q.width||!Q.height||!ie)return;const de=m(),me=Math.max(F.a.width/Q.width*z,F.a.height/Q.height*z);de.width=Q.width*me,de.height=Q.height*me,(oe=de.getContext("2d"))===null||oe===void 0||oe.drawImage(Q,0,0,de.width,de.height),ie.width=Math.max($.width,1),ie.height=Math.max($.height,1);const Pe=ie.getContext("2d");Pe&&(Pe.save(),Pe.drawImage(de,0,0,$.width,$.height),h.default.Util.releaseCanvas(de),Pe.globalCompositeOperation="source-in",Pe.drawImage($,0,0,ie.width,ie.height),Pe.restore())},[ie,$,Q,F.a.width,F.a.height,z,...K]),F.clipSrc&&Q?ie:$},W=m(),H=(0,a.observer)(({element:F})=>{const $=Math.min(30,F.a.width/4,F.a.height/4),z=o.default.useRef(null);return o.default.useEffect(()=>{const K=z.current;if(!K)return;const X=new h.default.Animation(Q=>{K.rotate(((Q==null?void 0:Q.timeDiff)||0)/2)},K.getLayer());return X.start(),()=>{X.stop()}}),o.default.createElement(s.Group,{x:F.x,y:F.y,rotation:F.rotation,listening:!1,opacity:F.a.opacity,hideInExport:!F.showInExport},o.default.createElement(s.Rect,{width:F.a.width,height:F.a.height,fill:"rgba(124, 173, 212, 0.8)"}),o.default.createElement(s.Arc,{ref:z,x:F.a.width/2,y:F.a.height/2,fill:"white",outerRadius:Math.abs($),innerRadius:Math.max(1,$-5),angle:270}))}),L=(0,a.observer)(({element:F})=>{const $="Can not load the image...",z=Math.max(10,Math.min(30,F.a.width/25));return o.default.createElement(s.Group,{x:F.x,y:F.y,rotation:F.rotation,listening:!1,opacity:F.a.opacity,hideInExport:!F.showInExport},o.default.createElement(s.Rect,{width:F.a.width,height:F.a.height,fill:"rgba(223, 102, 102, 0.8)"}),o.default.createElement(s.Text,{text:$,fontSize:z,width:F.a.width,height:F.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let M=f.default;const D=F=>{M=F};t.setImageLoaderHook=D;const B=(F,$="",z="")=>{const K=o.default.useRef(),X=()=>{var Q;(Q=K.current)===null||Q===void 0||Q.call(K),K.current=void 0};o.default.useEffect(()=>X,[]),o.default.useLayoutEffect(()=>{const Q=$.slice(0,200),J=`image with id ${z} url: ${Q}`;F!=="loading"||K.current||(K.current=(0,v.incrementLoader)(J)),F!=="loading"&&X(),F==="failed"&&(0,v.triggerLoadError)(J)},[F])};t.useImageLoader=B;const V=({image:F,status:$,type:z})=>{const K=o.default.useRef();return o.default.useEffect(()=>{K.current=F||K.current},[F]),$!=="failed"||$!=="failed"&&z==="svg"?K.current:void 0},Y=F=>{const[$,z]=o.default.useReducer(J=>J+1,0),K=o.default.useRef("loading"),X=o.default.useRef(F.src),Q=o.default.useRef(F.src);return Q.current!==F.src&&(Q.current=F.src,K.current="loading"),o.default.useEffect(()=>{if(F.type!=="svg"||!F.src)return;let J=!1;return(async()=>{K.current="loading",z();const ne=await O.urlToString(F.src),ie=O.fixSize(ne),oe=O.replaceColors(ie,F.colorsReplace);J||(X.current=oe,K.current="loaded",z())})(),()=>{J=!0}},[F.src,JSON.stringify(F.colorsReplace)]),F.type!=="svg"?[F.src,"loaded"]:[X.current,K.current]};t.ImageElement=(0,a.observer)(({element:F,store:$})=>{var z;const[K,X]=o.default.useState(!1),Q=o.default.useRef(null),J=o.default.useRef(null),[ne,ie]=o.default.useState(!1),oe=$.selectedShapes.indexOf(F)>=0,[de,me]=Y(F),[Pe,re]=M(de,"anonymous"),ae=F.type!=="svg"||me==="loaded"?re:"loading";(0,t.useImageLoader)(ae,F.src,F.id);const we=F.page._exportingOrRendering?1:Math.max(1,$.scale),be=$._elementsPixelRatio*we,te=V({image:Pe,status:re,type:F.type}),fe=S(F,Pe||te,be),he=N(F,fe)||W;let{cropX:Ee,cropY:Ve,cropWidth:Je,cropHeight:Ae}=F;re!=="loaded"&&(Ee=Ve=0,Je=Ae=1);const Ce=he.width*Je,Me=he.height*Ae,ze=F.a.width/F.a.height;let We,St;const mt=Ce/Me,ue=F.type==="svg";ue?(We=Ce,St=Me):ze>=mt?(We=Ce,St=Ce/ze):(We=Me*ze,St=Me);const ce={x:he.width*Ee,y:he.height*Ve,width:We,height:St},Se=(z=F.cornerRadius)!==null&&z!==void 0?z:0,Le=F.page._exportingOrRendering?1:Math.min(2,$.scale),Ne=$._elementsPixelRatio*Le;let ge=Z(F,G(F,he,ce,Ne,Se,K||F._cropModeEnabled||F.type==="svg",!0),Ne,[ce,Se,Ne]);const Xe=Math.max(F.a.width/We,F.a.height/St);o.default.useEffect(()=>{var Ie;if(!F._cropModeEnabled)return;const et=(Ie=Q.current)===null||Ie===void 0?void 0:Ie.getStage();function ft(Pt){F._cropModeEnabled&&Pt.target!==J.current&&F.toggleCropMode(!1)}function Ft(Pt){F._cropModeEnabled&&Pt.target.parentNode!==et.content&&F.toggleCropMode(!1)}return document.body.addEventListener("click",Ft),et==null||et.on("click",ft),et==null||et.on("tap",ft),()=>{document.body.removeEventListener("click",Ft),document.body.removeEventListener("touchstart",Ft),et==null||et.off("click",ft),et==null||et.off("click",ft)}},[F._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!(K||F._cropModeEnabled))return(0,p.applyFilter)(Q.current,F),(0,l.autorun)(()=>{(0,p.applyFilter)(Q.current,F)},{delay:100})},[ge,F.page._exportingOrRendering,K,Je,Ae,F._cropModeEnabled]),o.default.useLayoutEffect(()=>{var Ie;K||F._cropModeEnabled?(Ie=Q.current)===null||Ie===void 0||Ie.clearCache():(0,p.applyFilter)(Q.current,F)},[K,F.a.width,F.a.height,F._cropModeEnabled]),o.default.useEffect(()=>{(0,p.applyFilter)(Q.current,F)},[F.shadowEnabled,F.shadowBlur,F.cornerRadius,F.shadowColor,F.shadowOffsetX,F.shadowOffsetY,F.shadowOpacity]);const Oe=o.default.useRef(null),$e=o.default.useRef(null),Wt=o.default.useRef(null);o.default.useLayoutEffect(()=>{F._cropModeEnabled&&($e.current.nodes([Oe.current]),Wt.current.nodes([J.current]))},[F._cropModeEnabled]);var Tt=o.default.useRef(null),Yt=o.default.useRef(0),ke=o.default.useRef(!1);const Ye=Ie=>{var et;((et=Ie.evt.touches)===null||et===void 0?void 0:et.length)>2&&Ie.target.stopDrag(),Math.round(Ie.target.x())>0&&(Ie.target.x(0),Ie.target.scaleX(1)),Math.round(Ie.target.y())>0&&(Ie.target.y(0),Ie.target.scaleY(1));const ft=Ie.target.width()*Ie.target.scaleX(),Ft=Ie.target.height()*Ie.target.scaleY(),Pt=Math.min(1,We/ft),Bn=Math.min(1,St/Ft),xn=1-Pt,tn=Math.min(xn,Math.max(0,Math.round(-Ie.target.x())/ft)),ri=1-Bn,Sr=Math.min(ri,Math.max(0,Math.round(-Ie.target.y())/Ft));Ie.target.setAttrs({x:-tn*he.width,y:-Sr*he.height,scaleX:1,scaleY:1}),F.set({cropX:tn,cropY:Sr,cropWidth:Pt,cropHeight:Bn})},at=()=>{F.type!=="svg"&&F.contentEditable&&setTimeout(()=>{F.toggleCropMode(!0)})},Ot=F.type==="svg"&&te,xt=re==="loading"&&!Ot,un=re==="failed",hn=!xt&&!un,pn=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),rr=hn?F.a.opacity:0;(0,y.useFadeIn)(Q,rr);const to=F.selectable||$.role==="admin",wr=(0,d.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,xt&&o.default.createElement(H,{element:F}),un&&o.default.createElement(L,{element:F}),o.default.createElement(s.Image,{ref:Q,name:"element",id:F.id,image:ge,x:F.a.x,y:F.a.y,width:F.a.width||1,height:F.a.height||1,rotation:F.a.rotation,opacity:rr,shadowEnabled:F.shadowEnabled,shadowBlur:F.shadowBlur,shadowOffsetX:F.shadowOffsetX,shadowOffsetY:F.shadowOffsetY,shadowColor:F.shadowColor,shadowOpacity:F.shadowOpacity,customCrop:ce,listening:to,draggable:wr?F.draggable&&oe:F.draggable,preventDefault:!wr||oe,hideInExport:!F.showInExport,onMouseEnter:()=>{ie(!0)},onMouseLeave:()=>{ie(!1)},onDragMove:Ie=>{F.set({x:Ie.target.x(),y:Ie.target.y()})},onDragEnd:Ie=>{F.set({x:Ie.target.x(),y:Ie.target.y()})},onDblClick:at,onDblTap:at,onTransformStart:()=>{X(!0),pn.current={cropX:F.cropX,cropY:F.cropY,cropWidth:F.cropWidth,cropHeight:F.cropHeight}},onTransform:Ie=>{var et;const ft=Ie.currentTarget,Ft=Math.abs(ft.scaleX()-1)<1e-7?1:ft.scaleX(),Pt=Math.abs(ft.scaleY()-1)<1e-7?1:ft.scaleY();ft.scaleX(1),ft.scaleY(1);const Bn=(et=Ie.target.getStage())===null||et===void 0?void 0:et.findOne("Transformer"),xn=1-We/he.width,tn=Math.min(xn,Math.max(0,F.cropX)),ri=1-St/he.height,Sr=Math.min(ri,Math.max(0,F.cropY)),no=Bn.getActiveAnchor(),jo=!(no.indexOf("middle")>=0||no.indexOf("center")>=0),cu=!jo&&Ft<1&&pn.current.cropHeight>St/he.height;let Da=jo?F.cropWidth:F.cropWidth*Ft;cu&&(Da=F.cropWidth);const ro=!jo&&Pt<1&&pn.current.cropWidth>We/he.width;let Dr=jo?F.cropHeight:F.cropHeight*Pt;ro&&(Dr=F.cropHeight),ue&&(Da=F.cropWidth,Dr=F.cropHeight),F.set({cropX:tn,cropY:Sr,x:ft.x(),y:ft.y(),width:ft.width()*Ft,height:ft.height()*Pt,rotation:Ie.target.rotation(),cropWidth:Math.min(Da,1-tn),cropHeight:Math.min(Dr,1-Sr)})},onTransformEnd:Ie=>{const et=Ie.currentTarget;F.set({width:et.width(),height:et.height(),x:et.x(),y:et.y(),rotation:Ie.target.rotation(),cropWidth:We/he.width,cropHeight:St/he.height}),X(!1)}}),o.default.createElement(s.Rect,{x:F.x,y:F.y,width:Math.max(F.a.width-F.borderSize,0),height:Math.max(F.a.height-F.borderSize,0),opacity:rr,offsetX:-F.borderSize/2,offsetY:-F.borderSize/2,stroke:F.borderColor,strokeWidth:F.borderSize,listening:!1,visible:!!F.borderSize,rotation:F.rotation,cornerRadius:Math.max(0,Se-F.borderSize),hideInExport:!F.showInExport}),F._cropModeEnabled&&o.default.createElement(x.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(s.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)"}),o.default.createElement(s.Image,{listening:!1,image:ge,x:F.x,y:F.y,width:F.a.width,height:F.a.height,rotation:F.rotation,shadowEnabled:F.shadowEnabled,shadowBlur:F.shadowBlur}),o.default.createElement(s.Group,{x:F.x,y:F.y,rotation:F.rotation,scaleX:Xe,scaleY:Xe},o.default.createElement(s.Image,{image:he,ref:J,opacity:.4,draggable:!0,x:-F.cropX*he.width,y:-F.cropY*he.height,onDragMove:Ye,onTransform:Ye,onTouchMove:Ie=>{Ie.evt.preventDefault();const et=Ie.target.getStage().getPointersPositions();var ft=et[0],Ft=et[1];const Pt=Ie.target;if(ft&&!Ft&&!Pt.isDragging()&&ke.current&&(Pt.startDrag(),ke.current=!1),ft&&Ft){h.default.hitOnDragEnabled=!0,Pt.isDragging()&&(ke.current=!0,Pt.stopDrag());const ro=Ie.target.getAbsoluteTransform().copy();ro.invert();var Bn={x:ft.x,y:ft.y},xn={x:Ft.x,y:Ft.y};if(!Tt.current)return void(Tt.current=R(Bn,xn));var tn=R(Bn,xn),ri=C(Bn,xn);Yt.current||(Yt.current=ri);const Dr=Pt.position();var Sr={x:tn.x-Dr.x,y:tn.y-Dr.y},no=ri/Yt.current;Pt.scaleX(no),Pt.scaleY(no);const Nl=ro.point(tn),Il=ro.point(Tt.current);var jo=Nl.x-Il.x,cu=Nl.y-Il.y,Da={x:Math.min(0,tn.x-Sr.x*no+jo),y:Math.min(0,tn.y-Sr.y*no+cu)};Pt.position(Da),Yt.current=ri,Tt.current=tn,Ye(Ie)}},onTouchEnd:Ie=>{Yt.current=0,Tt.current=null,h.default.hitOnDragEnabled=!1}}),o.default.createElement(s.Transformer,{ref:Wt,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ie,et)=>et.width<5||et.height<5?Ie:et,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),o.default.createElement(s.Rect,{width:We,height:St,ref:Oe,listening:!1,onTransform:Ie=>{Ie.target.x()<-F.cropX*he.width-1e-9&&(Ie.target.x(-F.cropX*he.width),Ie.target.scaleX(1)),Ie.target.y()<-F.cropY*he.height-1e-9&&(Ie.target.y(-F.cropY*he.height),Ie.target.scaleY(1));const et=Math.min(1,Math.max(0,F.cropX+Ie.target.x()/he.width)),ft=Math.min(1,Math.max(0,Ie.target.y()/he.height+F.cropY)),Ft=Ie.target.width()*Ie.target.scaleX(),Pt=Ie.target.height()*Ie.target.scaleY(),Bn=Math.min(1-et,Ft/he.width),xn=Math.min(1-ft,Pt/he.height),tn=Ie.target.getAbsolutePosition(Ie.target.getParent().getParent());Ie.target.scale({x:1,y:1}),Ie.target.position({x:0,y:0}),F.set({x:tn.x,y:tn.y,cropX:et,cropY:ft,cropWidth:Bn,cropHeight:xn,width:Math.min(Ft*Xe,he.width*(1-et)*Xe),height:Math.min(Pt*Xe,he.height*(1-ft)*Xe)})}}),o.default.createElement(s.Transformer,{ref:$e,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ie,et)=>et.width<5||et.height<5?Ie:et,visible:F.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(ne||oe)&&o.default.createElement(w.Highlighter,{element:F}))})})(d2);var iS={},oS={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(t,e){(function(r,i){t.exports=i()})(typeof self<"u"?self:_e,function(){return function(n){var r={};function i(o){if(r[o])return r[o].exports;var a=r[o]={i:o,l:!1,exports:{}};return n[o].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=n,i.c=r,i.d=function(o,a,l){i.o(o,a)||Object.defineProperty(o,a,{configurable:!1,enumerable:!0,get:l})},i.n=function(o){var a=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(a,"a",a),a},i.o=function(o,a){return Object.prototype.hasOwnProperty.call(o,a)},i.p="",i(i.s=109)}([function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(17),a=i(18),l=i(19),s=i(45),f=i(46),h=i(47),x=i(48),w=i(49),v=i(12),O=i(32),g=i(33),b=i(31),p=i(1),y={Scope:p.Scope,create:p.create,find:p.find,query:p.query,register:p.register,Container:o.default,Format:a.default,Leaf:l.default,Embed:x.default,Scroll:s.default,Block:h.default,Inline:f.default,Text:w.default,Attributor:{Attribute:v.default,Class:O.default,Style:g.default,Store:b.default}};r.default=y},function(n,r,i){var o=this&&this.__extends||function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,y){p.__proto__=y}||function(p,y){for(var d in y)y.hasOwnProperty(d)&&(p[d]=y[d])};return function(p,y){b(p,y);function d(){this.constructor=p}p.prototype=y===null?Object.create(y):(d.prototype=y.prototype,new d)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=function(b){o(p,b);function p(y){var d=this;return y="[Parchment] "+y,d=b.call(this,y)||this,d.message=y,d.name=d.constructor.name,d}return p}(Error);r.ParchmentError=a;var l={},s={},f={},h={};r.DATA_KEY="__blot";var x;(function(b){b[b.TYPE=3]="TYPE",b[b.LEVEL=12]="LEVEL",b[b.ATTRIBUTE=13]="ATTRIBUTE",b[b.BLOT=14]="BLOT",b[b.INLINE=7]="INLINE",b[b.BLOCK=11]="BLOCK",b[b.BLOCK_BLOT=10]="BLOCK_BLOT",b[b.INLINE_BLOT=6]="INLINE_BLOT",b[b.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",b[b.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",b[b.ANY=15]="ANY"})(x=r.Scope||(r.Scope={}));function w(b,p){var y=O(b);if(y==null)throw new a("Unable to create "+b+" blot");var d=y,m=b instanceof Node||b.nodeType===Node.TEXT_NODE?b:d.create(p);return new d(m,p)}r.create=w;function v(b,p){return p===void 0&&(p=!1),b==null?null:b[r.DATA_KEY]!=null?b[r.DATA_KEY].blot:p?v(b.parentNode,p):null}r.find=v;function O(b,p){p===void 0&&(p=x.ANY);var y;if(typeof b=="string")y=h[b]||l[b];else if(b instanceof Text||b.nodeType===Node.TEXT_NODE)y=h.text;else if(typeof b=="number")b&x.LEVEL&x.BLOCK?y=h.block:b&x.LEVEL&x.INLINE&&(y=h.inline);else if(b instanceof HTMLElement){var d=(b.getAttribute("class")||"").split(/\s+/);for(var m in d)if(y=s[d[m]],y)break;y=y||f[b.tagName]}return y==null?null:p&x.LEVEL&y.scope&&p&x.TYPE&y.scope?y:null}r.query=O;function g(){for(var b=[],p=0;p<arguments.length;p++)b[p]=arguments[p];if(b.length>1)return b.map(function(m){return g(m)});var y=b[0];if(typeof y.blotName!="string"&&typeof y.attrName!="string")throw new a("Invalid definition");if(y.blotName==="abstract")throw new a("Cannot register abstract class");if(h[y.blotName||y.attrName]=y,typeof y.keyName=="string")l[y.keyName]=y;else if(y.className!=null&&(s[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}r.register=g},function(n,r,i){var o=i(51),a=i(11),l=i(3),s=i(20),f="\0",h=function(x){Array.isArray(x)?this.ops=x:x!=null&&Array.isArray(x.ops)?this.ops=x.ops:this.ops=[]};h.prototype.insert=function(x,w){var v={};return x.length===0?this:(v.insert=x,w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(v.attributes=w),this.push(v))},h.prototype.delete=function(x){return x<=0?this:this.push({delete:x})},h.prototype.retain=function(x,w){if(x<=0)return this;var v={retain:x};return w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(v.attributes=w),this.push(v)},h.prototype.push=function(x){var w=this.ops.length,v=this.ops[w-1];if(x=l(!0,{},x),typeof v=="object"){if(typeof x.delete=="number"&&typeof v.delete=="number")return this.ops[w-1]={delete:v.delete+x.delete},this;if(typeof v.delete=="number"&&x.insert!=null&&(w-=1,v=this.ops[w-1],typeof v!="object"))return this.ops.unshift(x),this;if(a(x.attributes,v.attributes)){if(typeof x.insert=="string"&&typeof v.insert=="string")return this.ops[w-1]={insert:v.insert+x.insert},typeof x.attributes=="object"&&(this.ops[w-1].attributes=x.attributes),this;if(typeof x.retain=="number"&&typeof v.retain=="number")return this.ops[w-1]={retain:v.retain+x.retain},typeof x.attributes=="object"&&(this.ops[w-1].attributes=x.attributes),this}}return w===this.ops.length?this.ops.push(x):this.ops.splice(w,0,x),this},h.prototype.chop=function(){var x=this.ops[this.ops.length-1];return x&&x.retain&&!x.attributes&&this.ops.pop(),this},h.prototype.filter=function(x){return this.ops.filter(x)},h.prototype.forEach=function(x){this.ops.forEach(x)},h.prototype.map=function(x){return this.ops.map(x)},h.prototype.partition=function(x){var w=[],v=[];return this.forEach(function(O){var g=x(O)?w:v;g.push(O)}),[w,v]},h.prototype.reduce=function(x,w){return this.ops.reduce(x,w)},h.prototype.changeLength=function(){return this.reduce(function(x,w){return w.insert?x+s.length(w):w.delete?x-w.delete:x},0)},h.prototype.length=function(){return this.reduce(function(x,w){return x+s.length(w)},0)},h.prototype.slice=function(x,w){x=x||0,typeof w!="number"&&(w=1/0);for(var v=[],O=s.iterator(this.ops),g=0;g<w&&O.hasNext();){var b;g<x?b=O.next(x-g):(b=O.next(w-g),v.push(b)),g+=s.length(b)}return new h(v)},h.prototype.compose=function(x){var w=s.iterator(this.ops),v=s.iterator(x.ops),O=[],g=v.peek();if(g!=null&&typeof g.retain=="number"&&g.attributes==null){for(var b=g.retain;w.peekType()==="insert"&&w.peekLength()<=b;)b-=w.peekLength(),O.push(w.next());g.retain-b>0&&v.next(g.retain-b)}for(var p=new h(O);w.hasNext()||v.hasNext();)if(v.peekType()==="insert")p.push(v.next());else if(w.peekType()==="delete")p.push(w.next());else{var y=Math.min(w.peekLength(),v.peekLength()),d=w.next(y),m=v.next(y);if(typeof m.retain=="number"){var _={};typeof d.retain=="number"?_.retain=y:_.insert=d.insert;var A=s.attributes.compose(d.attributes,m.attributes,typeof d.retain=="number");if(A&&(_.attributes=A),p.push(_),!v.hasNext()&&a(p.ops[p.ops.length-1],_)){var C=new h(w.rest());return p.concat(C).chop()}}else typeof m.delete=="number"&&typeof d.retain=="number"&&p.push(m)}return p.chop()},h.prototype.concat=function(x){var w=new h(this.ops.slice());return x.ops.length>0&&(w.push(x.ops[0]),w.ops=w.ops.concat(x.ops.slice(1))),w},h.prototype.diff=function(x,w){if(this.ops===x.ops)return new h;var v=[this,x].map(function(y){return y.map(function(d){if(d.insert!=null)return typeof d.insert=="string"?d.insert:f;var m=y===x?"on":"with";throw new Error("diff() called "+m+" non-document")}).join("")}),O=new h,g=o(v[0],v[1],w),b=s.iterator(this.ops),p=s.iterator(x.ops);return g.forEach(function(y){for(var d=y[1].length;d>0;){var m=0;switch(y[0]){case o.INSERT:m=Math.min(p.peekLength(),d),O.push(p.next(m));break;case o.DELETE:m=Math.min(d,b.peekLength()),b.next(m),O.delete(m);break;case o.EQUAL:m=Math.min(b.peekLength(),p.peekLength(),d);var _=b.next(m),A=p.next(m);a(_.insert,A.insert)?O.retain(m,s.attributes.diff(_.attributes,A.attributes)):O.push(A).delete(m);break}d-=m}}),O.chop()},h.prototype.eachLine=function(x,w){w=w||`
114
- `;for(var v=s.iterator(this.ops),O=new h,g=0;v.hasNext();){if(v.peekType()!=="insert")return;var b=v.peek(),p=s.length(b)-v.peekLength(),y=typeof b.insert=="string"?b.insert.indexOf(w,p)-p:-1;if(y<0)O.push(v.next());else if(y>0)O.push(v.next(y));else{if(x(O,v.next(1).attributes||{},g)===!1)return;g+=1,O=new h}}O.length()>0&&x(O,{},g)},h.prototype.transform=function(x,w){if(w=!!w,typeof x=="number")return this.transformPosition(x,w);for(var v=s.iterator(this.ops),O=s.iterator(x.ops),g=new h;v.hasNext()||O.hasNext();)if(v.peekType()==="insert"&&(w||O.peekType()!=="insert"))g.retain(s.length(v.next()));else if(O.peekType()==="insert")g.push(O.next());else{var b=Math.min(v.peekLength(),O.peekLength()),p=v.next(b),y=O.next(b);if(p.delete)continue;y.delete?g.push(y):g.retain(b,s.attributes.transform(p.attributes,y.attributes,w))}return g.chop()},h.prototype.transformPosition=function(x,w){w=!!w;for(var v=s.iterator(this.ops),O=0;v.hasNext()&&O<=x;){var g=v.peekLength(),b=v.peekType();if(v.next(),b==="delete"){x-=Math.min(g,x-O);continue}else b==="insert"&&(O<x||!w)&&(x+=g);O+=g}return x},n.exports=h},function(n,r){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,s=function(v){return typeof Array.isArray=="function"?Array.isArray(v):o.call(v)==="[object Array]"},f=function(v){if(!v||o.call(v)!=="[object Object]")return!1;var O=i.call(v,"constructor"),g=v.constructor&&v.constructor.prototype&&i.call(v.constructor.prototype,"isPrototypeOf");if(v.constructor&&!O&&!g)return!1;var b;for(b in v);return typeof b>"u"||i.call(v,b)},h=function(v,O){a&&O.name==="__proto__"?a(v,O.name,{enumerable:!0,configurable:!0,value:O.newValue,writable:!0}):v[O.name]=O.newValue},x=function(v,O){if(O==="__proto__")if(i.call(v,O)){if(l)return l(v,O).value}else return;return v[O]};n.exports=function w(){var v,O,g,b,p,y,d=arguments[0],m=1,_=arguments.length,A=!1;for(typeof d=="boolean"&&(A=d,d=arguments[1]||{},m=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});m<_;++m)if(v=arguments[m],v!=null)for(O in v)g=x(d,O),b=x(v,O),d!==b&&(A&&b&&(f(b)||(p=s(b)))?(p?(p=!1,y=g&&s(g)?g:[]):y=g&&f(g)?g:{},h(d,{name:O,newValue:w(A,y,b)})):typeof b<"u"&&h(d,{name:O,newValue:b}));return d}},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BlockEmbed=r.bubbleFormats=void 0;var o=function(){function P(T,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(T,G.key,G)}}return function(T,N,U){return N&&P(T.prototype,N),U&&P(T,U),T}}(),a=function P(T,N,U){T===null&&(T=Function.prototype);var G=Object.getOwnPropertyDescriptor(T,N);if(G===void 0){var Z=Object.getPrototypeOf(T);return Z===null?void 0:P(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),s=d(l),f=i(2),h=d(f),x=i(0),w=d(x),v=i(16),O=d(v),g=i(6),b=d(g),p=i(7),y=d(p);function d(P){return P&&P.__esModule?P:{default:P}}function m(P,T){if(!(P instanceof T))throw new TypeError("Cannot call a class as a function")}function _(P,T){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:P}function A(P,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);P.prototype=Object.create(T&&T.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(P,T):P.__proto__=T)}var C=1,R=function(P){A(T,P);function T(){return m(this,T),_(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}return o(T,[{key:"attach",value:function(){a(T.prototype.__proto__||Object.getPrototypeOf(T.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,s.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 a(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertAt",this).call(this,U,G,Z)}}]),T}(w.default.Embed);R.scope=w.default.Scope.BLOCK_BLOT;var S=function(P){A(T,P);function T(N){m(this,T);var U=_(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,N));return U.cache={},U}return o(T,[{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(),E(G))},new h.default).insert(`
116
- `,E(this))),this.cache.delta}},{key:"deleteAt",value:function(U,G){a(T.prototype.__proto__||Object.getPrototypeOf(T.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):a(T.prototype.__proto__||Object.getPrototypeOf(T.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 a(T.prototype.__proto__||Object.getPrototypeOf(T.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?a(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertAt",this).call(this,Math.min(U,this.length()-1),H):this.children.tail.insertAt(this.children.tail.length(),H),this.cache={});var L=this;W.reduce(function(M,D){return L=L.split(M,!0),L.insertAt(0,D),D.length},U+H.length)}}},{key:"insertBefore",value:function(U,G){var Z=this.children.head;a(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertBefore",this).call(this,U,G),Z instanceof O.default&&Z.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=a(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"length",this).call(this)+C),this.cache.length}},{key:"moveChildren",value:function(U,G){a(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"moveChildren",this).call(this,U,G),this.cache={}}},{key:"optimize",value:function(U){a(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"optimize",this).call(this,U),this.cache={}}},{key:"path",value:function(U){return a(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"path",this).call(this,U,!0)}},{key:"removeChild",value:function(U){a(T.prototype.__proto__||Object.getPrototypeOf(T.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()-C)){var Z=this.clone();return U===0?(this.parent.insertBefore(Z,this),this):(this.parent.insertBefore(Z,this.next),Z)}else{var W=a(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"split",this).call(this,U,G);return this.cache={},W}}}]),T}(w.default.Block);S.blotName="block",S.tagName="P",S.defaultChild="break",S.allowedChildren=[b.default,w.default.Embed,y.default];function E(P){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return P==null||(typeof P.formats=="function"&&(T=(0,s.default)(T,P.formats())),P.parent==null||P.parent.blotName=="scroll"||P.parent.statics.scope!==P.statics.scope)?T:E(P.parent,T)}r.bubbleFormats=E,r.BlockEmbed=R,r.default=S},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.overload=r.expandConfig=void 0;var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},a=function(){function L(M,D){var B=[],V=!0,Y=!1,F=void 0;try{for(var $=M[Symbol.iterator](),z;!(V=(z=$.next()).done)&&(B.push(z.value),!(D&&B.length===D));V=!0);}catch(K){Y=!0,F=K}finally{try{!V&&$.return&&$.return()}finally{if(Y)throw F}}return B}return function(M,D){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return L(M,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function L(M,D){for(var B=0;B<D.length;B++){var V=D[B];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(M,V.key,V)}}return function(M,D,B){return D&&L(M.prototype,D),B&&L(M,B),M}}();i(50);var s=i(2),f=E(s),h=i(14),x=E(h),w=i(8),v=E(w),O=i(9),g=E(O),b=i(0),p=E(b),y=i(15),d=E(y),m=i(3),_=E(m),A=i(10),C=E(A),R=i(34),S=E(R);function E(L){return L&&L.__esModule?L:{default:L}}function P(L,M,D){return M in L?Object.defineProperty(L,M,{value:D,enumerable:!0,configurable:!0,writable:!0}):L[M]=D,L}function T(L,M){if(!(L instanceof M))throw new TypeError("Cannot call a class as a function")}var N=(0,C.default)("quill"),U=function(){l(L,null,[{key:"debug",value:function(D){D===!0&&(D="log"),C.default.level(D)}},{key:"find",value:function(D){return D.__quill||p.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 V=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof D!="string"){var F=D.attrName||D.blotName;typeof F=="string"?this.register("formats/"+F,D,B):Object.keys(D).forEach(function($){V.register($,D[$],B)})}else this.imports[D]!=null&&!Y&&N.warn("Overwriting "+D+" with",B),this.imports[D]=B,(D.startsWith("blots/")||D.startsWith("formats/"))&&B.blotName!=="abstract"?p.default.register(B):D.startsWith("modules")&&typeof B.register=="function"&&B.register()}}]);function L(M){var D=this,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(T(this,L),this.options=G(M,B),this.container=this.options.container,this.container==null)return N.error("Invalid Quill container",M);this.options.debug&&L.debug(this.options.debug);var V=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 v.default,this.scroll=p.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new x.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(v.default.events.EDITOR_CHANGE,function(F){F===v.default.events.TEXT_CHANGE&&D.root.classList.toggle("ql-blank",D.editor.isBlank())}),this.emitter.on(v.default.events.SCROLL_UPDATE,function(F,$){var z=D.selection.lastRange,K=z&&z.length===0?z.index:void 0;Z.call(D,function(){return D.editor.update(null,$,K)},F)});var Y=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+V+"<p><br></p></div>");this.setContents(Y),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(L,[{key:"addContainer",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof D=="string"){var V=D;D=document.createElement("div"),D.classList.add(V)}return this.container.insertBefore(D,B),D}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(D,B,V){var Y=this,F=W(D,B,V),$=a(F,4);return D=$[0],B=$[1],V=$[3],Z.call(this,function(){return Y.editor.deleteText(D,B)},V,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 V=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v.default.sources.API;return Z.call(this,function(){var F=V.getSelection(!0),$=new f.default;if(F==null)return $;if(p.default.query(D,p.default.Scope.BLOCK))$=V.editor.formatLine(F.index,F.length,P({},D,B));else{if(F.length===0)return V.selection.format(D,B),$;$=V.editor.formatText(F.index,F.length,P({},D,B))}return V.setSelection(F,v.default.sources.SILENT),$},Y)}},{key:"formatLine",value:function(D,B,V,Y,F){var $=this,z=void 0,K=W(D,B,V,Y,F),X=a(K,4);return D=X[0],B=X[1],z=X[2],F=X[3],Z.call(this,function(){return $.editor.formatLine(D,B,z)},F,D,0)}},{key:"formatText",value:function(D,B,V,Y,F){var $=this,z=void 0,K=W(D,B,V,Y,F),X=a(K,4);return D=X[0],B=X[1],z=X[2],F=X[3],Z.call(this,function(){return $.editor.formatText(D,B,z)},F,D,0)}},{key:"getBounds",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,V=void 0;typeof D=="number"?V=this.selection.getBounds(D,B):V=this.selection.getBounds(D.index,D.length);var Y=this.container.getBoundingClientRect();return{bottom:V.bottom-Y.top,height:V.height,left:V.left-Y.left,right:V.right-Y.left,top:V.top-Y.top,width:V.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,V=W(D,B),Y=a(V,2);return D=Y[0],B=Y[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,V=W(D,B),Y=a(V,2);return D=Y[0],B=Y[1],this.editor.getText(D,B)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(D,B,V){var Y=this,F=arguments.length>3&&arguments[3]!==void 0?arguments[3]:L.sources.API;return Z.call(this,function(){return Y.editor.insertEmbed(D,B,V)},F,D)}},{key:"insertText",value:function(D,B,V,Y,F){var $=this,z=void 0,K=W(D,0,V,Y,F),X=a(K,4);return D=X[0],z=X[2],F=X[3],Z.call(this,function(){return $.editor.insertText(D,B,z)},F,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,V){this.clipboard.dangerouslyPasteHTML(D,B,V)}},{key:"removeFormat",value:function(D,B,V){var Y=this,F=W(D,B,V),$=a(F,4);return D=$[0],B=$[1],V=$[3],Z.call(this,function(){return Y.editor.removeFormat(D,B)},V,D)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(D){var B=this,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v.default.sources.API;return Z.call(this,function(){D=new f.default(D);var Y=B.getLength(),F=B.editor.deleteText(0,Y),$=B.editor.applyDelta(D),z=$.ops[$.ops.length-1];z!=null&&typeof z.insert=="string"&&z.insert[z.insert.length-1]===`
118
- `&&(B.editor.deleteText(B.getLength()-1,1),$.delete(1));var K=F.compose($);return K},V)}},{key:"setSelection",value:function(D,B,V){if(D==null)this.selection.setRange(null,B||L.sources.API);else{var Y=W(D,B,V),F=a(Y,4);D=F[0],B=F[1],V=F[3],this.selection.setRange(new y.Range(D,B),V),V!==v.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v.default.sources.API,V=new f.default().insert(D);return this.setContents(V,B)}},{key:"update",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v.default.sources.USER,B=this.scroll.update(D);return this.selection.update(D),B}},{key:"updateContents",value:function(D){var B=this,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v.default.sources.API;return Z.call(this,function(){return D=new f.default(D),B.editor.applyDelta(D,V)},V,!0)}}]),L}();U.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},U.events=v.default.events,U.sources=v.default.sources,U.version="1.3.7",U.imports={delta:f.default,parchment:p.default,"core/module":g.default,"core/theme":S.default};function G(L,M){if(M=(0,_.default)(!0,{container:L,modules:{clipboard:!0,keyboard:!0,history:!0}},M),!M.theme||M.theme===U.DEFAULTS.theme)M.theme=S.default;else if(M.theme=U.import("themes/"+M.theme),M.theme==null)throw new Error("Invalid theme "+M.theme+". Did you register it?");var D=(0,_.default)(!0,{},M.theme.DEFAULTS);[D,M].forEach(function(Y){Y.modules=Y.modules||{},Object.keys(Y.modules).forEach(function(F){Y.modules[F]===!0&&(Y.modules[F]={})})});var B=Object.keys(D.modules).concat(Object.keys(M.modules)),V=B.reduce(function(Y,F){var $=U.import("modules/"+F);return $==null?N.error("Cannot load "+F+" module. Are you sure you registered it?"):Y[F]=$.DEFAULTS||{},Y},{});return M.modules!=null&&M.modules.toolbar&&M.modules.toolbar.constructor!==Object&&(M.modules.toolbar={container:M.modules.toolbar}),M=(0,_.default)(!0,{},U.DEFAULTS,{modules:V},D,M),["bounds","container","scrollingContainer"].forEach(function(Y){typeof M[Y]=="string"&&(M[Y]=document.querySelector(M[Y]))}),M.modules=Object.keys(M.modules).reduce(function(Y,F){return M.modules[F]&&(Y[F]=M.modules[F]),Y},{}),M}function Z(L,M,D,B){if(this.options.strict&&!this.isEnabled()&&M===v.default.sources.USER)return new f.default;var V=D==null?null:this.getSelection(),Y=this.editor.delta,F=L();if(V!=null&&(D===!0&&(D=V.index),B==null?V=H(V,F,M):B!==0&&(V=H(V,D,B,M)),this.setSelection(V,v.default.sources.SILENT)),F.length()>0){var $,z=[v.default.events.TEXT_CHANGE,F,Y,M];if(($=this.emitter).emit.apply($,[v.default.events.EDITOR_CHANGE].concat(z)),M!==v.default.sources.SILENT){var K;(K=this.emitter).emit.apply(K,z)}}return F}function W(L,M,D,B,V){var Y={};return typeof L.index=="number"&&typeof L.length=="number"?typeof M!="number"?(V=B,B=D,D=M,M=L.length,L=L.index):(M=L.length,L=L.index):typeof M!="number"&&(V=B,B=D,D=M,M=0),(typeof D>"u"?"undefined":o(D))==="object"?(Y=D,V=B):typeof D=="string"&&(B!=null?Y[D]=B:V=D),V=V||v.default.sources.API,[L,M,Y,V]}function H(L,M,D,B){if(L==null)return null;var V=void 0,Y=void 0;if(M instanceof f.default){var F=[L.index,L.index+L.length].map(function(X){return M.transformPosition(X,B!==v.default.sources.USER)}),$=a(F,2);V=$[0],Y=$[1]}else{var z=[L.index,L.index+L.length].map(function(X){return X<M||X===M&&B===v.default.sources.USER?X:D>=0?X+D:Math.max(M,X+D)}),K=a(z,2);V=K[0],Y=K[1]}return new y.Range(V,Y-V)}r.expandConfig=G,r.overload=W,r.default=U},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(p,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(p,m.key,m)}}return function(p,y,d){return y&&b(p.prototype,y),d&&b(p,d),p}}(),a=function b(p,y,d){p===null&&(p=Function.prototype);var m=Object.getOwnPropertyDescriptor(p,y);if(m===void 0){var _=Object.getPrototypeOf(p);return _===null?void 0:b(_,y,d)}else{if("value"in m)return m.value;var A=m.get;return A===void 0?void 0:A.call(d)}},l=i(7),s=x(l),f=i(0),h=x(f);function x(b){return b&&b.__esModule?b:{default:b}}function w(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function v(b,p){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:b}function O(b,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);b.prototype=Object.create(p&&p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(b,p):b.__proto__=p)}var g=function(b){O(p,b);function p(){return w(this,p),v(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return o(p,[{key:"formatAt",value:function(d,m,_,A){if(p.compare(this.statics.blotName,_)<0&&h.default.query(_,h.default.Scope.BLOT)){var C=this.isolate(d,m);A&&C.wrap(_,A)}else a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"formatAt",this).call(this,d,m,_,A)}},{key:"optimize",value:function(d){if(a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"optimize",this).call(this,d),this.parent instanceof p&&p.compare(this.statics.blotName,this.parent.statics.blotName)>0){var m=this.parent.isolate(this.offset(),this.length());this.moveChildren(m),m.wrap(this)}}}],[{key:"compare",value:function(d,m){var _=p.order.indexOf(d),A=p.order.indexOf(m);return _>=0||A>=0?_-A:d===m?0:d<m?-1:1}}]),p}(h.default.Inline);g.allowedChildren=[g,h.default.Embed,s.default],g.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(0),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}function s(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function f(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function h(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var x=function(w){h(v,w);function v(){return s(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default.Text);r.default=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function y(d,m){for(var _=0;_<m.length;_++){var A=m[_];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(d,A.key,A)}}return function(d,m,_){return m&&y(d.prototype,m),_&&y(d,_),d}}(),a=function y(d,m,_){d===null&&(d=Function.prototype);var A=Object.getOwnPropertyDescriptor(d,m);if(A===void 0){var C=Object.getPrototypeOf(d);return C===null?void 0:y(C,m,_)}else{if("value"in A)return A.value;var R=A.get;return R===void 0?void 0:R.call(_)}},l=i(54),s=x(l),f=i(10),h=x(f);function x(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 v(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 O(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 g=(0,h.default)("quill:events"),b=["selectionchange","mousedown","mouseup","click"];b.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(A){if(A.__quill&&A.__quill.emitter){var C;(C=A.__quill.emitter).handleDOM.apply(C,m)}})})});var p=function(y){O(d,y);function d(){w(this,d);var m=v(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return m.listeners={},m.on("error",g.error),m}return o(d,[{key:"emit",value:function(){g.log.apply(g,arguments),a(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(_){for(var A=arguments.length,C=Array(A>1?A-1:0),R=1;R<A;R++)C[R-1]=arguments[R];(this.listeners[_.type]||[]).forEach(function(S){var E=S.node,P=S.handler;(_.target===E||E.contains(_.target))&&P.apply(void 0,[_].concat(C))})}},{key:"listenDOM",value:function(_,A,C){this.listeners[_]||(this.listeners[_]=[]),this.listeners[_].push({node:A,handler:C})}}]),d}(s.default);p.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},p.sources={API:"api",SILENT:"silent",USER:"user"},r.default=p},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});function o(l,s){if(!(l instanceof s))throw new TypeError("Cannot call a class as a function")}var a=function l(s){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};o(this,l),this.quill=s,this.options=f};a.DEFAULTS={},r.default=a},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=["error","warn","log","info"],a="warn";function l(f){if(o.indexOf(f)<=o.indexOf(a)){for(var h,x=arguments.length,w=Array(x>1?x-1:0),v=1;v<x;v++)w[v-1]=arguments[v];(h=console)[f].apply(h,w)}}function s(f){return o.reduce(function(h,x){return h[x]=l.bind(console,x,f),h},{})}l.level=s.level=function(f){a=f},r.default=s},function(n,r,i){var o=Array.prototype.slice,a=i(52),l=i(53),s=n.exports=function(w,v,O){return O||(O={}),w===v?!0:w instanceof Date&&v instanceof Date?w.getTime()===v.getTime():!w||!v||typeof w!="object"&&typeof v!="object"?O.strict?w===v:w==v:x(w,v,O)};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 x(w,v,O){var g,b;if(f(w)||f(v)||w.prototype!==v.prototype)return!1;if(l(w))return l(v)?(w=o.call(w),v=o.call(v),s(w,v,O)):!1;if(h(w)){if(!h(v)||w.length!==v.length)return!1;for(g=0;g<w.length;g++)if(w[g]!==v[g])return!1;return!0}try{var p=a(w),y=a(v)}catch{return!1}if(p.length!=y.length)return!1;for(p.sort(),y.sort(),g=p.length-1;g>=0;g--)if(p[g]!=y[g])return!1;for(g=p.length-1;g>=0;g--)if(b=p[g],!s(w[b],v[b],O))return!1;return typeof w==typeof v}},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(1),a=function(){function l(s,f,h){h===void 0&&(h={}),this.attrName=s,this.keyName=f;var x=o.Scope.TYPE&o.Scope.ATTRIBUTE;h.scope!=null?this.scope=h.scope&o.Scope.LEVEL|x:this.scope=o.Scope.ATTRIBUTE,h.whitelist!=null&&(this.whitelist=h.whitelist)}return l.keys=function(s){return[].map.call(s.attributes,function(f){return f.name})},l.prototype.add=function(s,f){return this.canAdd(s,f)?(s.setAttribute(this.keyName,f),!0):!1},l.prototype.canAdd=function(s,f){var h=o.query(s,o.Scope.BLOT&(this.scope|o.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(s){s.removeAttribute(this.keyName)},l.prototype.value=function(s){var f=s.getAttribute(this.keyName);return this.canAdd(s,f)&&f?f:""},l}();r.default=a},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Code=void 0;var o=function(){function R(S,E){var P=[],T=!0,N=!1,U=void 0;try{for(var G=S[Symbol.iterator](),Z;!(T=(Z=G.next()).done)&&(P.push(Z.value),!(E&&P.length===E));T=!0);}catch(W){N=!0,U=W}finally{try{!T&&G.return&&G.return()}finally{if(N)throw U}}return P}return function(S,E){if(Array.isArray(S))return S;if(Symbol.iterator in Object(S))return R(S,E);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function R(S,E){for(var P=0;P<E.length;P++){var T=E[P];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(S,T.key,T)}}return function(S,E,P){return E&&R(S.prototype,E),P&&R(S,P),S}}(),l=function R(S,E,P){S===null&&(S=Function.prototype);var T=Object.getOwnPropertyDescriptor(S,E);if(T===void 0){var N=Object.getPrototypeOf(S);return N===null?void 0:R(N,E,P)}else{if("value"in T)return T.value;var U=T.get;return U===void 0?void 0:U.call(P)}},s=i(2),f=y(s),h=i(0),x=y(h),w=i(4),v=y(w),O=i(6),g=y(O),b=i(7),p=y(b);function y(R){return R&&R.__esModule?R:{default:R}}function d(R,S){if(!(R instanceof S))throw new TypeError("Cannot call a class as a function")}function m(R,S){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:R}function _(R,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);R.prototype=Object.create(S&&S.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(R,S):R.__proto__=S)}var A=function(R){_(S,R);function S(){return d(this,S),m(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return S}(g.default);A.blotName="code",A.tagName="CODE";var C=function(R){_(S,R);function S(){return d(this,S),m(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,[{key:"delta",value:function(){var P=this,T=this.domNode.textContent;return T.endsWith(`
119
- `)&&(T=T.slice(0,-1)),T.split(`
120
- `).reduce(function(N,U){return N.insert(U).insert(`
121
- `,P.formats())},new f.default)}},{key:"format",value:function(P,T){if(!(P===this.statics.blotName&&T)){var N=this.descendant(p.default,this.length()-1),U=o(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,P,T)}}},{key:"formatAt",value:function(P,T,N,U){if(T!==0&&!(x.default.query(N,x.default.Scope.BLOCK)==null||N===this.statics.blotName&&U===this.statics.formats(this.domNode))){var G=this.newlineIndex(P);if(!(G<0||G>=P+T)){var Z=this.newlineIndex(P,!0)+1,W=G-Z+1,H=this.isolate(Z,W),L=H.next;H.format(N,U),L instanceof S&&L.formatAt(0,P-Z+T-W,N,U)}}}},{key:"insertAt",value:function(P,T,N){if(N==null){var U=this.descendant(p.default,P),G=o(U,2),Z=G[0],W=G[1];Z.insertAt(W,T)}}},{key:"length",value:function(){var P=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
122
- `)?P:P+1}},{key:"newlineIndex",value:function(P){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(T)return this.domNode.textContent.slice(0,P).lastIndexOf(`
123
- `);var N=this.domNode.textContent.slice(P).indexOf(`
124
- `);return N>-1?P+N:-1}},{key:"optimize",value:function(P){this.domNode.textContent.endsWith(`
125
- `)||this.appendChild(x.default.create("text",`
126
- `)),l(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"optimize",this).call(this,P);var T=this.next;T!=null&&T.prev===this&&T.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===T.statics.formats(T.domNode)&&(T.optimize(P),T.moveChildren(this),T.remove())}},{key:"replace",value:function(P){l(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"replace",this).call(this,P),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(T){var N=x.default.find(T);N==null?T.parentNode.removeChild(T):N instanceof x.default.Embed?N.remove():N.unwrap()})}}],[{key:"create",value:function(P){var T=l(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,P);return T.setAttribute("spellcheck",!1),T}},{key:"formats",value:function(){return!0}}]),S}(v.default);C.blotName="code-block",C.tagName="PRE",C.TAB=" ",r.Code=A,r.default=C},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},a=function(){function L(M,D){var B=[],V=!0,Y=!1,F=void 0;try{for(var $=M[Symbol.iterator](),z;!(V=(z=$.next()).done)&&(B.push(z.value),!(D&&B.length===D));V=!0);}catch(K){Y=!0,F=K}finally{try{!V&&$.return&&$.return()}finally{if(Y)throw F}}return B}return function(M,D){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return L(M,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function L(M,D){for(var B=0;B<D.length;B++){var V=D[B];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(M,V.key,V)}}return function(M,D,B){return D&&L(M.prototype,D),B&&L(M,B),M}}(),s=i(2),f=T(s),h=i(20),x=T(h),w=i(0),v=T(w),O=i(13),g=T(O),b=i(24),p=T(b),y=i(4),d=T(y),m=i(16),_=T(m),A=i(21),C=T(A),R=i(11),S=T(R),E=i(3),P=T(E);function T(L){return L&&L.__esModule?L:{default:L}}function N(L,M,D){return M in L?Object.defineProperty(L,M,{value:D,enumerable:!0,configurable:!0,writable:!0}):L[M]=D,L}function U(L,M){if(!(L instanceof M))throw new TypeError("Cannot call a class as a function")}var G=/^[ -~]*$/,Z=function(){function L(M){U(this,L),this.scroll=M,this.delta=this.getDelta()}return l(L,[{key:"applyDelta",value:function(D){var B=this,V=!1;this.scroll.update();var Y=this.scroll.length();return this.scroll.batchStart(),D=H(D),D.reduce(function(F,$){var z=$.retain||$.delete||$.insert.length||1,K=$.attributes||{};if($.insert!=null){if(typeof $.insert=="string"){var X=$.insert;X.endsWith(`
127
- `)&&V&&(V=!1,X=X.slice(0,-1)),F>=Y&&!X.endsWith(`
128
- `)&&(V=!0),B.scroll.insertAt(F,X);var Q=B.scroll.line(F),J=a(Q,2),ne=J[0],ie=J[1],oe=(0,P.default)({},(0,y.bubbleFormats)(ne));if(ne instanceof d.default){var de=ne.descendant(v.default.Leaf,ie),me=a(de,1),Pe=me[0];oe=(0,P.default)(oe,(0,y.bubbleFormats)(Pe))}K=x.default.attributes.diff(oe,K)||{}}else if(o($.insert)==="object"){var re=Object.keys($.insert)[0];if(re==null)return F;B.scroll.insertAt(F,re,$.insert[re])}Y+=z}return Object.keys(K).forEach(function(ae){B.scroll.formatAt(F,z,ae,K[ae])}),F+z},0),D.reduce(function(F,$){return typeof $.delete=="number"?(B.scroll.deleteAt(F,$.delete),F):F+($.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 V=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(Y).forEach(function(F){if(!(V.scroll.whitelist!=null&&!V.scroll.whitelist[F])){var $=V.scroll.lines(D,Math.max(B,1)),z=B;$.forEach(function(K){var X=K.length();if(!(K instanceof g.default))K.format(F,Y[F]);else{var Q=D-K.offset(V.scroll),J=K.newlineIndex(Q+z)-Q+1;K.formatAt(Q,J,F,Y[F])}z-=X})}}),this.scroll.optimize(),this.update(new f.default().retain(D).retain(B,(0,C.default)(Y)))}},{key:"formatText",value:function(D,B){var V=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(Y).forEach(function(F){V.scroll.formatAt(D,B,F,Y[F])}),this.update(new f.default().retain(D).retain(B,(0,C.default)(Y)))}},{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,V=[],Y=[];B===0?this.scroll.path(D).forEach(function($){var z=a($,1),K=z[0];K instanceof d.default?V.push(K):K instanceof v.default.Leaf&&Y.push(K)}):(V=this.scroll.lines(D,B),Y=this.scroll.descendants(v.default.Leaf,D,B));var F=[V,Y].map(function($){if($.length===0)return{};for(var z=(0,y.bubbleFormats)($.shift());Object.keys(z).length>0;){var K=$.shift();if(K==null)return z;z=W((0,y.bubbleFormats)(K),z)}return z});return P.default.apply(P.default,F)}},{key:"getText",value:function(D,B){return this.getContents(D,B).filter(function(V){return typeof V.insert=="string"}).map(function(V){return V.insert}).join("")}},{key:"insertEmbed",value:function(D,B,V){return this.scroll.insertAt(D,B,V),this.update(new f.default().retain(D).insert(N({},B,V)))}},{key:"insertText",value:function(D,B){var V=this,Y=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(Y).forEach(function(F){V.scroll.formatAt(D,B.length,F,Y[F])}),this.update(new f.default().retain(D).insert(B,(0,C.default)(Y)))}},{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 V=this.getText(D,B),Y=this.scroll.line(D+B),F=a(Y,2),$=F[0],z=F[1],K=0,X=new f.default;$!=null&&($ instanceof g.default?K=$.newlineIndex(z)-z+1:K=$.length()-z,X=$.delta().slice(z,z+K-1).insert(`
131
- `));var Q=this.getContents(D,B+K),J=Q.diff(new f.default().insert(V).concat(X)),ne=new f.default().retain(D).concat(J);return this.applyDelta(ne)}},{key:"update",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,Y=this.delta;if(B.length===1&&B[0].type==="characterData"&&B[0].target.data.match(G)&&v.default.find(B[0].target)){var F=v.default.find(B[0].target),$=(0,y.bubbleFormats)(F),z=F.offset(this.scroll),K=B[0].oldValue.replace(p.default.CONTENTS,""),X=new f.default().insert(K),Q=new f.default().insert(F.value()),J=new f.default().retain(z).concat(X.diff(Q,V));D=J.reduce(function(ne,ie){return ie.insert?ne.insert(ie.insert,$):ne.push(ie)},new f.default),this.delta=Y.compose(D)}else this.delta=this.getDelta(),(!D||!(0,S.default)(Y.compose(D),this.delta))&&(D=Y.diff(this.delta,V));return D}}]),L}();function W(L,M){return Object.keys(M).reduce(function(D,B){return L[B]==null||(M[B]===L[B]?D[B]=M[B]:Array.isArray(M[B])?M[B].indexOf(L[B])<0&&(D[B]=M[B].concat([L[B]])):D[B]=[M[B],L[B]]),D},{})}function H(L){return L.reduce(function(M,D){if(D.insert===1){var B=(0,C.default)(D.attributes);return delete B.image,M.insert({image:D.attributes.image},B)}if(D.attributes!=null&&(D.attributes.list===!0||D.attributes.bullet===!0)&&(D=(0,C.default)(D),D.attributes.list?D.attributes.list="ordered":(D.attributes.list="bullet",delete D.attributes.bullet)),typeof D.insert=="string"){var V=D.insert.replace(/\r\n/g,`
132
- `).replace(/\r/g,`
133
- `);return M.insert(V,D.attributes)}return M.push(D)},new f.default)}r.default=Z},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Range=void 0;var o=function(){function R(S,E){var P=[],T=!0,N=!1,U=void 0;try{for(var G=S[Symbol.iterator](),Z;!(T=(Z=G.next()).done)&&(P.push(Z.value),!(E&&P.length===E));T=!0);}catch(W){N=!0,U=W}finally{try{!T&&G.return&&G.return()}finally{if(N)throw U}}return P}return function(S,E){if(Array.isArray(S))return S;if(Symbol.iterator in Object(S))return R(S,E);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function R(S,E){for(var P=0;P<E.length;P++){var T=E[P];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(S,T.key,T)}}return function(S,E,P){return E&&R(S.prototype,E),P&&R(S,P),S}}(),l=i(0),s=p(l),f=i(21),h=p(f),x=i(11),w=p(x),v=i(8),O=p(v),g=i(10),b=p(g);function p(R){return R&&R.__esModule?R:{default:R}}function y(R){if(Array.isArray(R)){for(var S=0,E=Array(R.length);S<R.length;S++)E[S]=R[S];return E}else return Array.from(R)}function d(R,S){if(!(R instanceof S))throw new TypeError("Cannot call a class as a function")}var m=(0,b.default)("quill:selection"),_=function R(S){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,R),this.index=S,this.length=E},A=function(){function R(S,E){var P=this;d(this,R),this.emitter=E,this.scroll=S,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=s.default.create("cursor",this),this.lastRange=this.savedRange=new _(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){P.mouseDown||setTimeout(P.update.bind(P,O.default.sources.USER),1)}),this.emitter.on(O.default.events.EDITOR_CHANGE,function(T,N){T===O.default.events.TEXT_CHANGE&&N.length()>0&&P.update(O.default.sources.SILENT)}),this.emitter.on(O.default.events.SCROLL_BEFORE_UPDATE,function(){if(P.hasFocus()){var T=P.getNativeRange();T!=null&&T.start.node!==P.cursor.textNode&&P.emitter.once(O.default.events.SCROLL_UPDATE,function(){try{P.setNativeRange(T.start.node,T.start.offset,T.end.node,T.end.offset)}catch{}})}}),this.emitter.on(O.default.events.SCROLL_OPTIMIZE,function(T,N){if(N.range){var U=N.range,G=U.startNode,Z=U.startOffset,W=U.endNode,H=U.endOffset;P.setNativeRange(G,Z,W,H)}}),this.update(O.default.sources.SILENT)}return a(R,[{key:"handleComposition",value:function(){var E=this;this.root.addEventListener("compositionstart",function(){E.composing=!0}),this.root.addEventListener("compositionend",function(){if(E.composing=!1,E.cursor.parent){var P=E.cursor.restore();if(!P)return;setTimeout(function(){E.setNativeRange(P.startNode,P.startOffset,P.endNode,P.endOffset)},1)}})}},{key:"handleDragging",value:function(){var E=this;this.emitter.listenDOM("mousedown",document.body,function(){E.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){E.mouseDown=!1,E.update(O.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(E,P){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[E])){this.scroll.update();var T=this.getNativeRange();if(!(T==null||!T.native.collapsed||s.default.query(E,s.default.Scope.BLOCK))){if(T.start.node!==this.cursor.textNode){var N=s.default.find(T.start.node,!1);if(N==null)return;if(N instanceof s.default.Leaf){var U=N.split(T.start.offset);N.parent.insertBefore(this.cursor,U)}else N.insertBefore(this.cursor,T.start.node);this.cursor.attach()}this.cursor.format(E,P),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,T=this.scroll.length();E=Math.min(E,T-1),P=Math.min(E+P,T-1)-E;var N=void 0,U=this.scroll.leaf(E),G=o(U,2),Z=G[0],W=G[1];if(Z==null)return null;var H=Z.position(W,!0),L=o(H,2);N=L[0],W=L[1];var M=document.createRange();if(P>0){M.setStart(N,W);var D=this.scroll.leaf(E+P),B=o(D,2);if(Z=B[0],W=B[1],Z==null)return null;var V=Z.position(W,!0),Y=o(V,2);return N=Y[0],W=Y[1],M.setEnd(N,W),M.getBoundingClientRect()}else{var F="left",$=void 0;return N instanceof Text?(W<N.data.length?(M.setStart(N,W),M.setEnd(N,W+1)):(M.setStart(N,W-1),M.setEnd(N,W),F="right"),$=M.getBoundingClientRect()):($=Z.domNode.getBoundingClientRect(),W>0&&(F="right")),{bottom:$.top+$.height,height:$.height,left:$[F],right:$[F],top:$.top,width:0}}}},{key:"getNativeRange",value:function(){var E=document.getSelection();if(E==null||E.rangeCount<=0)return null;var P=E.getRangeAt(0);if(P==null)return null;var T=this.normalizeNative(P);return m.info("getNativeRange",T),T}},{key:"getRange",value:function(){var E=this.getNativeRange();if(E==null)return[null,null];var P=this.normalizedToRange(E);return[P,E]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(E){var P=this,T=[[E.start.node,E.start.offset]];E.native.collapsed||T.push([E.end.node,E.end.offset]);var N=T.map(function(Z){var W=o(Z,2),H=W[0],L=W[1],M=s.default.find(H,!0),D=M.offset(P.scroll);return L===0?D:M instanceof s.default.Container?D+M.length():D+M.index(H,L)}),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(E){if(!C(this.root,E.startContainer)||!E.collapsed&&!C(this.root,E.endContainer))return null;var P={start:{node:E.startContainer,offset:E.startOffset},end:{node:E.endContainer,offset:E.endOffset},native:E};return[P.start,P.end].forEach(function(T){for(var N=T.node,U=T.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;T.node=N,T.offset=U}),P}},{key:"rangeToNative",value:function(E){var P=this,T=E.collapsed?[E.index]:[E.index,E.index+E.length],N=[],U=this.scroll.length();return T.forEach(function(G,Z){G=Math.min(U-1,G);var W=void 0,H=P.scroll.leaf(G),L=o(H,2),M=L[0],D=L[1],B=M.position(D,Z!==0),V=o(B,2);W=V[0],D=V[1],N.push(W,D)}),N.length<2&&(N=N.concat(N)),N}},{key:"scrollIntoView",value:function(E){var P=this.lastRange;if(P!=null){var T=this.getBounds(P.index,P.length);if(T!=null){var N=this.scroll.length()-1,U=this.scroll.line(Math.min(P.index,N)),G=o(U,1),Z=G[0],W=Z;if(P.length>0){var H=this.scroll.line(Math.min(P.index+P.length,N)),L=o(H,1);W=L[0]}if(!(Z==null||W==null)){var M=E.getBoundingClientRect();T.top<M.top?E.scrollTop-=M.top-T.top:T.bottom>M.bottom&&(E.scrollTop+=T.bottom-M.bottom)}}}}},{key:"setNativeRange",value:function(E,P){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E,N=arguments.length>3&&arguments[3]!==void 0?arguments[3]:P,U=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(m.info("setNativeRange",E,P,T,N),!(E!=null&&(this.root.parentNode==null||E.parentNode==null||T.parentNode==null))){var G=document.getSelection();if(G!=null)if(E!=null){this.hasFocus()||this.root.focus();var Z=(this.getNativeRange()||{}).native;if(Z==null||U||E!==Z.startContainer||P!==Z.startOffset||T!==Z.endContainer||N!==Z.endOffset){E.tagName=="BR"&&(P=[].indexOf.call(E.parentNode.childNodes,E),E=E.parentNode),T.tagName=="BR"&&(N=[].indexOf.call(T.parentNode.childNodes,T),T=T.parentNode);var W=document.createRange();W.setStart(E,P),W.setEnd(T,N),G.removeAllRanges(),G.addRange(W)}}else G.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:O.default.sources.API;if(typeof P=="string"&&(T=P,P=!1),m.info("setRange",E),E!=null){var N=this.rangeToNative(E);this.setNativeRange.apply(this,y(N).concat([P]))}else this.setNativeRange(null);this.update(T)}},{key:"update",value:function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:O.default.sources.USER,P=this.lastRange,T=this.getRange(),N=o(T,2),U=N[0],G=N[1];if(this.lastRange=U,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,w.default)(P,this.lastRange)){var Z;!this.composing&&G!=null&&G.native.collapsed&&G.start.node!==this.cursor.textNode&&this.cursor.restore();var W=[O.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(P),E];if((Z=this.emitter).emit.apply(Z,[O.default.events.EDITOR_CHANGE].concat(W)),E!==O.default.sources.SILENT){var H;(H=this.emitter).emit.apply(H,W)}}}}]),R}();function C(R,S){try{S.parentNode}catch{return!1}return S instanceof Text&&(S=S.parentNode),R.contains(S)}r.Range=_,r.default=A},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(0),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(){return h(this,g),x(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return o(g,[{key:"insertInto",value:function(p,y){p.children.length===0?a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"insertInto",this).call(this,p,y):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),g}(s.default.Embed);v.blotName="break",v.tagName="BR",r.default=v},function(n,r,i){var o=this&&this.__extends||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,v){w.__proto__=v}||function(w,v){for(var O in v)v.hasOwnProperty(O)&&(w[O]=v[O])};return function(w,v){x(w,v);function O(){this.constructor=w}w.prototype=v===null?Object.create(v):(O.prototype=v.prototype,new O)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(44),l=i(30),s=i(1),f=function(x){o(w,x);function w(v){var O=x.call(this,v)||this;return O.build(),O}return w.prototype.appendChild=function(v){this.insertBefore(v)},w.prototype.attach=function(){x.prototype.attach.call(this),this.children.forEach(function(v){v.attach()})},w.prototype.build=function(){var v=this;this.children=new a.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(O){try{var g=h(O);v.insertBefore(g,v.children.head||void 0)}catch(b){if(b instanceof s.ParchmentError)return;throw b}})},w.prototype.deleteAt=function(v,O){if(v===0&&O===this.length())return this.remove();this.children.forEachAt(v,O,function(g,b,p){g.deleteAt(b,p)})},w.prototype.descendant=function(v,O){var g=this.children.find(O),b=g[0],p=g[1];return v.blotName==null&&v(b)||v.blotName!=null&&b instanceof v?[b,p]:b instanceof w?b.descendant(v,p):[null,-1]},w.prototype.descendants=function(v,O,g){O===void 0&&(O=0),g===void 0&&(g=Number.MAX_VALUE);var b=[],p=g;return this.children.forEachAt(O,g,function(y,d,m){(v.blotName==null&&v(y)||v.blotName!=null&&y instanceof v)&&b.push(y),y instanceof w&&(b=b.concat(y.descendants(v,d,p))),p-=m}),b},w.prototype.detach=function(){this.children.forEach(function(v){v.detach()}),x.prototype.detach.call(this)},w.prototype.formatAt=function(v,O,g,b){this.children.forEachAt(v,O,function(p,y,d){p.formatAt(y,d,g,b)})},w.prototype.insertAt=function(v,O,g){var b=this.children.find(v),p=b[0],y=b[1];if(p)p.insertAt(y,O,g);else{var d=g==null?s.create("text",O):s.create(O,g);this.appendChild(d)}},w.prototype.insertBefore=function(v,O){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(g){return v instanceof g}))throw new s.ParchmentError("Cannot insert "+v.statics.blotName+" into "+this.statics.blotName);v.insertInto(this,O)},w.prototype.length=function(){return this.children.reduce(function(v,O){return v+O.length()},0)},w.prototype.moveChildren=function(v,O){this.children.forEach(function(g){v.insertBefore(g,O)})},w.prototype.optimize=function(v){if(x.prototype.optimize.call(this,v),this.children.length===0)if(this.statics.defaultChild!=null){var O=s.create(this.statics.defaultChild);this.appendChild(O),O.optimize(v)}else this.remove()},w.prototype.path=function(v,O){O===void 0&&(O=!1);var g=this.children.find(v,O),b=g[0],p=g[1],y=[[this,v]];return b instanceof w?y.concat(b.path(p,O)):(b!=null&&y.push([b,p]),y)},w.prototype.removeChild=function(v){this.children.remove(v)},w.prototype.replace=function(v){v instanceof w&&v.moveChildren(this),x.prototype.replace.call(this,v)},w.prototype.split=function(v,O){if(O===void 0&&(O=!1),!O){if(v===0)return this;if(v===this.length())return this.next}var g=this.clone();return this.parent.insertBefore(g,this.next),this.children.forEachAt(v,this.length(),function(b,p,y){b=b.split(p,O),g.appendChild(b)}),g},w.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},w.prototype.update=function(v,O){var g=this,b=[],p=[];v.forEach(function(y){y.target===g.domNode&&y.type==="childList"&&(b.push.apply(b,y.addedNodes),p.push.apply(p,y.removedNodes))}),p.forEach(function(y){if(!(y.parentNode!=null&&y.tagName!=="IFRAME"&&document.body.compareDocumentPosition(y)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var d=s.find(y);d!=null&&(d.domNode.parentNode==null||d.domNode.parentNode===g.domNode)&&d.detach()}}),b.filter(function(y){return y.parentNode==g.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=s.find(y.nextSibling));var m=h(y);(m.next!=d||m.next==null)&&(m.parent!=null&&m.parent.removeChild(g),g.insertBefore(m,d||void 0))})},w}(l.default);function h(x){var w=s.find(x);if(w==null)try{w=s.create(x)}catch{w=s.create(s.Scope.INLINE),[].slice.call(x.childNodes).forEach(function(O){w.domNode.appendChild(O)}),x.parentNode&&x.parentNode.replaceChild(w.domNode,x),w.attach()}return w}r.default=f},function(n,r,i){var o=this&&this.__extends||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,v){w.__proto__=v}||function(w,v){for(var O in v)v.hasOwnProperty(O)&&(w[O]=v[O])};return function(w,v){x(w,v);function O(){this.constructor=w}w.prototype=v===null?Object.create(v):(O.prototype=v.prototype,new O)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(12),l=i(31),s=i(17),f=i(1),h=function(x){o(w,x);function w(v){var O=x.call(this,v)||this;return O.attributes=new l.default(O.domNode),O}return w.formats=function(v){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return v.tagName.toLowerCase()},w.prototype.format=function(v,O){var g=f.query(v);g instanceof a.default?this.attributes.attribute(g,O):O&&g!=null&&(v!==this.statics.blotName||this.formats()[v]!==O)&&this.replaceWith(v,O)},w.prototype.formats=function(){var v=this.attributes.values(),O=this.statics.formats(this.domNode);return O!=null&&(v[this.statics.blotName]=O),v},w.prototype.replaceWith=function(v,O){var g=x.prototype.replaceWith.call(this,v,O);return this.attributes.copy(g),g},w.prototype.update=function(v,O){var g=this;x.prototype.update.call(this,v,O),v.some(function(b){return b.target===g.domNode&&b.type==="attributes"})&&this.attributes.build()},w.prototype.wrap=function(v,O){var g=x.prototype.wrap.call(this,v,O);return g instanceof w&&g.statics.scope===this.statics.scope&&this.attributes.move(g),g},w}(s.default);r.default=h},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(30),l=i(1),s=function(f){o(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.value=function(x){return!0},h.prototype.index=function(x,w){return this.domNode===x||this.domNode.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(w,1):-1},h.prototype.position=function(x,w){var v=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return x>0&&(v+=1),[this.parent.domNode,v]},h.prototype.value=function(){var x;return x={},x[this.statics.blotName]=this.statics.value(this.domNode)||!0,x},h.scope=l.Scope.INLINE_BLOT,h}(a.default);r.default=s},function(n,r,i){var o=i(11),a=i(3),l={attributes:{compose:function(f,h,x){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var w=a(!0,{},h);x||(w=Object.keys(w).reduce(function(O,g){return w[g]!=null&&(O[g]=w[g]),O},{}));for(var v in f)f[v]!==void 0&&h[v]===void 0&&(w[v]=f[v]);return Object.keys(w).length>0?w:void 0},diff:function(f,h){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var x=Object.keys(f).concat(Object.keys(h)).reduce(function(w,v){return o(f[v],h[v])||(w[v]=h[v]===void 0?null:h[v]),w},{});return Object.keys(x).length>0?x:void 0},transform:function(f,h,x){if(typeof f!="object")return h;if(typeof h=="object"){if(!x)return h;var w=Object.keys(h).reduce(function(v,O){return f[O]===void 0&&(v[O]=h[O]),v},{});return Object.keys(w).length>0?w:void 0}}},iterator:function(f){return new s(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 s(f){this.ops=f,this.index=0,this.offset=0}s.prototype.hasNext=function(){return this.peekLength()<1/0},s.prototype.next=function(f){f||(f=1/0);var h=this.ops[this.index];if(h){var x=this.offset,w=l.length(h);if(f>=w-x?(f=w-x,this.index+=1,this.offset=0):this.offset+=f,typeof h.delete=="number")return{delete:f};var v={};return h.attributes&&(v.attributes=h.attributes),typeof h.retain=="number"?v.retain=f:typeof h.insert=="string"?v.insert=h.insert.substr(x,f):v.insert=h.insert,v}else return{retain:1/0}},s.prototype.peek=function(){return this.ops[this.index]},s.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},s.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"},s.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var f=this.offset,h=this.index,x=this.next(),w=this.ops.slice(this.index);return this.offset=f,this.index=h,[x].concat(w)}else return[]},n.exports=l},function(n,r){var i=function(){function o(g,b){return b!=null&&g instanceof b}var a;try{a=Map}catch{a=function(){}}var l;try{l=Set}catch{l=function(){}}var s;try{s=Promise}catch{s=function(){}}function f(g,b,p,y,d){typeof b=="object"&&(p=b.depth,y=b.prototype,d=b.includeNonEnumerable,b=b.circular);var m=[],_=[],A=typeof Buffer<"u";typeof b>"u"&&(b=!0),typeof p>"u"&&(p=1/0);function C(R,S){if(R===null)return null;if(S===0)return R;var E,P;if(typeof R!="object")return R;if(o(R,a))E=new a;else if(o(R,l))E=new l;else if(o(R,s))E=new s(function(M,D){R.then(function(B){M(C(B,S-1))},function(B){D(C(B,S-1))})});else if(f.__isArray(R))E=[];else if(f.__isRegExp(R))E=new RegExp(R.source,O(R)),R.lastIndex&&(E.lastIndex=R.lastIndex);else if(f.__isDate(R))E=new Date(R.getTime());else{if(A&&Buffer.isBuffer(R))return Buffer.allocUnsafe?E=Buffer.allocUnsafe(R.length):E=new Buffer(R.length),R.copy(E),E;o(R,Error)?E=Object.create(R):typeof y>"u"?(P=Object.getPrototypeOf(R),E=Object.create(P)):(E=Object.create(y),P=y)}if(b){var T=m.indexOf(R);if(T!=-1)return _[T];m.push(R),_.push(E)}o(R,a)&&R.forEach(function(M,D){var B=C(D,S-1),V=C(M,S-1);E.set(B,V)}),o(R,l)&&R.forEach(function(M){var D=C(M,S-1);E.add(D)});for(var N in R){var U;P&&(U=Object.getOwnPropertyDescriptor(P,N)),!(U&&U.set==null)&&(E[N]=C(R[N],S-1))}if(Object.getOwnPropertySymbols)for(var G=Object.getOwnPropertySymbols(R),N=0;N<G.length;N++){var Z=G[N],W=Object.getOwnPropertyDescriptor(R,Z);W&&!W.enumerable&&!d||(E[Z]=C(R[Z],S-1),W.enumerable||Object.defineProperty(E,Z,{enumerable:!1}))}if(d)for(var H=Object.getOwnPropertyNames(R),N=0;N<H.length;N++){var L=H[N],W=Object.getOwnPropertyDescriptor(R,L);W&&W.enumerable||(E[L]=C(R[L],S-1),Object.defineProperty(E,L,{enumerable:!1}))}return E}return C(g,p)}f.clonePrototype=function(b){if(b===null)return null;var p=function(){};return p.prototype=b,new p};function h(g){return Object.prototype.toString.call(g)}f.__objToStr=h;function x(g){return typeof g=="object"&&h(g)==="[object Date]"}f.__isDate=x;function w(g){return typeof g=="object"&&h(g)==="[object Array]"}f.__isArray=w;function v(g){return typeof g=="object"&&h(g)==="[object RegExp]"}f.__isRegExp=v;function O(g){var b="";return g.global&&(b+="g"),g.ignoreCase&&(b+="i"),g.multiline&&(b+="m"),b}return f.__getRegExpFlags=O,f}();typeof n=="object"&&n.exports&&(n.exports=i)},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function E(P,T){var N=[],U=!0,G=!1,Z=void 0;try{for(var W=P[Symbol.iterator](),H;!(U=(H=W.next()).done)&&(N.push(H.value),!(T&&N.length===T));U=!0);}catch(L){G=!0,Z=L}finally{try{!U&&W.return&&W.return()}finally{if(G)throw Z}}return N}return function(P,T){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return E(P,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function E(P,T){for(var N=0;N<T.length;N++){var U=T[N];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(P,U.key,U)}}return function(P,T,N){return T&&E(P.prototype,T),N&&E(P,N),P}}(),l=function E(P,T,N){P===null&&(P=Function.prototype);var U=Object.getOwnPropertyDescriptor(P,T);if(U===void 0){var G=Object.getPrototypeOf(P);return G===null?void 0:E(G,T,N)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(N)}},s=i(0),f=m(s),h=i(8),x=m(h),w=i(4),v=m(w),O=i(16),g=m(O),b=i(13),p=m(b),y=i(25),d=m(y);function m(E){return E&&E.__esModule?E:{default:E}}function _(E,P){if(!(E instanceof P))throw new TypeError("Cannot call a class as a function")}function A(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 C(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)}function R(E){return E instanceof v.default||E instanceof w.BlockEmbed}var S=function(E){C(P,E);function P(T,N){_(this,P);var U=A(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,T));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 a(P,[{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=o(G,2),W=Z[0],H=Z[1],L=this.line(N+U),M=o(L,1),D=M[0];if(l(P.prototype.__proto__||Object.getPrototypeOf(P.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 p.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 p.default){var V=D.newlineIndex(0);V>-1&&D.split(V+1)}var Y=D.children.head instanceof g.default?null:D.children.head;W.moveChildren(D,Y),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(P.prototype.__proto__||Object.getPrototypeOf(P.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(P.prototype.__proto__||Object.getPrototypeOf(P.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(P.prototype.__proto__||Object.getPrototypeOf(P.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(R,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,L){var M=[],D=L;return W.children.forEachAt(H,L,function(B,V,Y){R(B)?M.push(B):B instanceof f.default.Container&&(M=M.concat(Z(B,V,D))),D-=Y}),M};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(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,N,U),N.length>0&&this.emitter.emit(x.default.events.SCROLL_OPTIMIZE,N,U))}},{key:"path",value:function(N){return l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"path",this).call(this,N).slice(1)}},{key:"update",value:function(N){if(this.batch!==!0){var U=x.default.sources.USER;typeof N=="string"&&(U=N),Array.isArray(N)||(N=this.observer.takeRecords()),N.length>0&&this.emitter.emit(x.default.events.SCROLL_BEFORE_UPDATE,U,N),l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"update",this).call(this,N.concat([])),N.length>0&&this.emitter.emit(x.default.events.SCROLL_UPDATE,U,N)}}}]),P}(f.default.Scroll);S.blotName="scroll",S.className="ql-editor",S.tagName="DIV",S.defaultChild="block",S.allowedChildren=[v.default,w.BlockEmbed,d.default],r.default=S},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SHORTKEY=r.default=void 0;var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},a=function(){function $(z,K){var X=[],Q=!0,J=!1,ne=void 0;try{for(var ie=z[Symbol.iterator](),oe;!(Q=(oe=ie.next()).done)&&(X.push(oe.value),!(K&&X.length===K));Q=!0);}catch(de){J=!0,ne=de}finally{try{!Q&&ie.return&&ie.return()}finally{if(J)throw ne}}return X}return function(z,K){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return $(z,K);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function $(z,K){for(var X=0;X<K.length;X++){var Q=K[X];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(z,Q.key,Q)}}return function(z,K,X){return K&&$(z.prototype,K),X&&$(z,X),z}}(),s=i(21),f=E(s),h=i(11),x=E(h),w=i(3),v=E(w),O=i(2),g=E(O),b=i(20),p=E(b),y=i(0),d=E(y),m=i(5),_=E(m),A=i(10),C=E(A),R=i(9),S=E(R);function E($){return $&&$.__esModule?$:{default:$}}function P($,z,K){return z in $?Object.defineProperty($,z,{value:K,enumerable:!0,configurable:!0,writable:!0}):$[z]=K,$}function T($,z){if(!($ instanceof z))throw new TypeError("Cannot call a class as a function")}function N($,z){if(!$)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return z&&(typeof z=="object"||typeof z=="function")?z:$}function U($,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof z);$.prototype=Object.create(z&&z.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}}),z&&(Object.setPrototypeOf?Object.setPrototypeOf($,z):$.__proto__=z)}var G=(0,C.default)("quill:keyboard"),Z=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",W=function($){U(z,$),l(z,null,[{key:"match",value:function(X,Q){return Q=F(Q),["altKey","ctrlKey","metaKey","shiftKey"].some(function(J){return!!Q[J]!==X[J]&&Q[J]!==null})?!1:Q.key===(X.which||X.keyCode)}}]);function z(K,X){T(this,z);var Q=N(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,K,X));return Q.bindings={},Object.keys(Q.options.bindings).forEach(function(J){J==="list autofill"&&K.scroll.whitelist!=null&&!K.scroll.whitelist.list||Q.options.bindings[J]&&Q.addBinding(Q.options.bindings[J])}),Q.addBinding({key:z.keys.ENTER,shiftKey:null},B),Q.addBinding({key:z.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(Q.addBinding({key:z.keys.BACKSPACE},{collapsed:!0},L),Q.addBinding({key:z.keys.DELETE},{collapsed:!0},M)):(Q.addBinding({key:z.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},L),Q.addBinding({key:z.keys.DELETE},{collapsed:!0,suffix:/^.?$/},M)),Q.addBinding({key:z.keys.BACKSPACE},{collapsed:!1},D),Q.addBinding({key:z.keys.DELETE},{collapsed:!1},D),Q.addBinding({key:z.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},L),Q.listen(),Q}return l(z,[{key:"addBinding",value:function(X){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ne=F(X);if(ne==null||ne.key==null)return G.warn("Attempted to add invalid keyboard binding",ne);typeof Q=="function"&&(Q={handler:Q}),typeof J=="function"&&(J={handler:J}),ne=(0,v.default)(ne,Q,J),this.bindings[ne.key]=this.bindings[ne.key]||[],this.bindings[ne.key].push(ne)}},{key:"listen",value:function(){var X=this;this.quill.root.addEventListener("keydown",function(Q){if(!Q.defaultPrevented){var J=Q.which||Q.keyCode,ne=(X.bindings[J]||[]).filter(function(Me){return z.match(Q,Me)});if(ne.length!==0){var ie=X.quill.getSelection();if(!(ie==null||!X.quill.hasFocus())){var oe=X.quill.getLine(ie.index),de=a(oe,2),me=de[0],Pe=de[1],re=X.quill.getLeaf(ie.index),ae=a(re,2),we=ae[0],be=ae[1],te=ie.length===0?[we,be]:X.quill.getLeaf(ie.index+ie.length),fe=a(te,2),he=fe[0],Ee=fe[1],Ve=we instanceof d.default.Text?we.value().slice(0,be):"",Je=he instanceof d.default.Text?he.value().slice(Ee):"",Ae={collapsed:ie.length===0,empty:ie.length===0&&me.length()<=1,format:X.quill.getFormat(ie),offset:Pe,prefix:Ve,suffix:Je},Ce=ne.some(function(Me){if(Me.collapsed!=null&&Me.collapsed!==Ae.collapsed||Me.empty!=null&&Me.empty!==Ae.empty||Me.offset!=null&&Me.offset!==Ae.offset)return!1;if(Array.isArray(Me.format)){if(Me.format.every(function(ze){return Ae.format[ze]==null}))return!1}else if(o(Me.format)==="object"&&!Object.keys(Me.format).every(function(ze){return Me.format[ze]===!0?Ae.format[ze]!=null:Me.format[ze]===!1?Ae.format[ze]==null:(0,x.default)(Me.format[ze],Ae.format[ze])}))return!1;return Me.prefix!=null&&!Me.prefix.test(Ae.prefix)||Me.suffix!=null&&!Me.suffix.test(Ae.suffix)?!1:Me.handler.call(X,ie,Ae)!==!0});Ce&&Q.preventDefault()}}}})}}]),z}(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:Y("bold"),italic:Y("italic"),underline:Y("underline"),indent:{key:W.keys.TAB,format:["blockquote","indent","list"],handler:function(z,K){if(K.collapsed&&K.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(z,K){if(K.collapsed&&K.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(z,K){K.format.indent!=null?this.quill.format("indent","-1",_.default.sources.USER):K.format.list!=null&&this.quill.format("list",!1,_.default.sources.USER)}},"indent code-block":V(!0),"outdent code-block":V(!1),"remove tab":{key:W.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(z){this.quill.deleteText(z.index-1,1,_.default.sources.USER)}},tab:{key:W.keys.TAB,handler:function(z){this.quill.history.cutoff();var K=new g.default().retain(z.index).delete(z.length).insert(" ");this.quill.updateContents(K,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(z.index+1,_.default.sources.SILENT)}},"list empty enter":{key:W.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(z,K){this.quill.format("list",!1,_.default.sources.USER),K.format.indent&&this.quill.format("indent",!1,_.default.sources.USER)}},"checklist enter":{key:W.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(z){var K=this.quill.getLine(z.index),X=a(K,2),Q=X[0],J=X[1],ne=(0,v.default)({},Q.formats(),{list:"checked"}),ie=new g.default().retain(z.index).insert(`
135
- `,ne).retain(Q.length()-J-1).retain(1,{list:"unchecked"});this.quill.updateContents(ie,_.default.sources.USER),this.quill.setSelection(z.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:W.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(z,K){var X=this.quill.getLine(z.index),Q=a(X,2),J=Q[0],ne=Q[1],ie=new g.default().retain(z.index).insert(`
136
- `,K.format).retain(J.length()-ne-1).retain(1,{header:null});this.quill.updateContents(ie,_.default.sources.USER),this.quill.setSelection(z.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(z,K){var X=K.prefix.length,Q=this.quill.getLine(z.index),J=a(Q,2),ne=J[0],ie=J[1];if(ie>X)return!0;var oe=void 0;switch(K.prefix.trim()){case"[]":case"[ ]":oe="unchecked";break;case"[x]":oe="checked";break;case"-":case"*":oe="bullet";break;default:oe="ordered"}this.quill.insertText(z.index," ",_.default.sources.USER),this.quill.history.cutoff();var de=new g.default().retain(z.index-ie).delete(X+1).retain(ne.length()-2-ie).retain(1,{list:oe});this.quill.updateContents(de,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(z.index-X,_.default.sources.SILENT)}},"code exit":{key:W.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(z){var K=this.quill.getLine(z.index),X=a(K,2),Q=X[0],J=X[1],ne=new g.default().retain(z.index+Q.length()-J-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(ne,_.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($,z){var K,X=$===W.keys.LEFT?"prefix":"suffix";return K={key:$,shiftKey:z,altKey:null},P(K,X,/^$/),P(K,"handler",function(J){var ne=J.index;$===W.keys.RIGHT&&(ne+=J.length+1);var ie=this.quill.getLeaf(ne),oe=a(ie,1),de=oe[0];return de instanceof d.default.Embed?($===W.keys.LEFT?z?this.quill.setSelection(J.index-1,J.length+1,_.default.sources.USER):this.quill.setSelection(J.index-1,_.default.sources.USER):z?this.quill.setSelection(J.index,J.length+1,_.default.sources.USER):this.quill.setSelection(J.index+J.length+1,_.default.sources.USER),!1):!0}),K}function L($,z){if(!($.index===0||this.quill.getLength()<=1)){var K=this.quill.getLine($.index),X=a(K,1),Q=X[0],J={};if(z.offset===0){var ne=this.quill.getLine($.index-1),ie=a(ne,1),oe=ie[0];if(oe!=null&&oe.length()>1){var de=Q.formats(),me=this.quill.getFormat($.index-1,1);J=p.default.attributes.diff(de,me)||{}}}var Pe=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(z.prefix)?2:1;this.quill.deleteText($.index-Pe,Pe,_.default.sources.USER),Object.keys(J).length>0&&this.quill.formatLine($.index-Pe,Pe,J,_.default.sources.USER),this.quill.focus()}}function M($,z){var K=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(z.suffix)?2:1;if(!($.index>=this.quill.getLength()-K)){var X={},Q=0,J=this.quill.getLine($.index),ne=a(J,1),ie=ne[0];if(z.offset>=ie.length()-1){var oe=this.quill.getLine($.index+1),de=a(oe,1),me=de[0];if(me){var Pe=ie.formats(),re=this.quill.getFormat($.index,1);X=p.default.attributes.diff(Pe,re)||{},Q=me.length()}}this.quill.deleteText($.index,K,_.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine($.index+Q-1,K,X,_.default.sources.USER)}}function D($){var z=this.quill.getLines($),K={};if(z.length>1){var X=z[0].formats(),Q=z[z.length-1].formats();K=p.default.attributes.diff(Q,X)||{}}this.quill.deleteText($,_.default.sources.USER),Object.keys(K).length>0&&this.quill.formatLine($.index,1,K,_.default.sources.USER),this.quill.setSelection($.index,_.default.sources.SILENT),this.quill.focus()}function B($,z){var K=this;$.length>0&&this.quill.scroll.deleteAt($.index,$.length);var X=Object.keys(z.format).reduce(function(Q,J){return d.default.query(J,d.default.Scope.BLOCK)&&!Array.isArray(z.format[J])&&(Q[J]=z.format[J]),Q},{});this.quill.insertText($.index,`
137
- `,X,_.default.sources.USER),this.quill.setSelection($.index+1,_.default.sources.SILENT),this.quill.focus(),Object.keys(z.format).forEach(function(Q){X[Q]==null&&(Array.isArray(z.format[Q])||Q!=="link"&&K.quill.format(Q,z.format[Q],_.default.sources.USER))})}function V($){return{key:W.keys.TAB,shiftKey:!$,format:{"code-block":!0},handler:function(K){var X=d.default.query("code-block"),Q=K.index,J=K.length,ne=this.quill.scroll.descendant(X,Q),ie=a(ne,2),oe=ie[0],de=ie[1];if(oe!=null){var me=this.quill.getIndex(oe),Pe=oe.newlineIndex(de,!0)+1,re=oe.newlineIndex(me+de+J),ae=oe.domNode.textContent.slice(Pe,re).split(`
138
- `);de=0,ae.forEach(function(we,be){$?(oe.insertAt(Pe+de,X.TAB),de+=X.TAB.length,be===0?Q+=X.TAB.length:J+=X.TAB.length):we.startsWith(X.TAB)&&(oe.deleteAt(Pe+de,X.TAB.length),de-=X.TAB.length,be===0?Q-=X.TAB.length:J-=X.TAB.length),de+=we.length+1}),this.quill.update(_.default.sources.USER),this.quill.setSelection(Q,J,_.default.sources.SILENT)}}}}function Y($){return{key:$[0].toUpperCase(),shortKey:!0,handler:function(K,X){this.quill.format($,!X.format[$],_.default.sources.USER)}}}function F($){if(typeof $=="string"||typeof $=="number")return F({key:$});if((typeof $>"u"?"undefined":o($))==="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),$}r.default=W,r.SHORTKEY=Z},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function p(y,d){var m=[],_=!0,A=!1,C=void 0;try{for(var R=y[Symbol.iterator](),S;!(_=(S=R.next()).done)&&(m.push(S.value),!(d&&m.length===d));_=!0);}catch(E){A=!0,C=E}finally{try{!_&&R.return&&R.return()}finally{if(A)throw C}}return m}return function(y,d){if(Array.isArray(y))return y;if(Symbol.iterator in Object(y))return p(y,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function p(y,d,m){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var A=Object.getPrototypeOf(y);return A===null?void 0:p(A,d,m)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(m)}},l=function(){function p(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&&p(y.prototype,d),m&&p(y,m),y}}(),s=i(0),f=w(s),h=i(7),x=w(h);function w(p){return p&&p.__esModule?p:{default:p}}function v(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function O(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function g(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var b=function(p){g(y,p),l(y,null,[{key:"value",value:function(){}}]);function y(d,m){v(this,y);var _=O(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 a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,m,_);for(var A=this,C=0;A!=null&&A.statics.scope!==f.default.Scope.BLOCK_BLOT;)C+=A.offset(A.parent),A=A.parent;A!=null&&(this._length=y.CONTENTS.length,A.optimize(),A.formatAt(C,y.CONTENTS.length,m,_),this._length=0)}},{key:"index",value:function(m,_){return m===this.textNode?0:a(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(){a(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(),A=void 0,C=void 0,R=void 0;if(_!=null&&_.start.node===m&&_.end.node===m){var S=[m,_.start.offset,_.end.offset];A=S[0],C=S[1],R=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 E=this.textNode.data.split(y.CONTENTS).join("");this.next instanceof x.default?(A=this.next.domNode,this.next.insertAt(0,E),this.textNode.data=y.CONTENTS):(this.textNode.data=E,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(y.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),C!=null){var P=[C,R].map(function(N){return Math.max(0,Math.min(A.data.length,N-1))}),T=o(P,2);return C=T[0],R=T[1],{startNode:A,startOffset:C,endNode:A,endOffset:R}}}}},{key:"update",value:function(m,_){var A=this;if(m.some(function(R){return R.type==="characterData"&&R.target===A.textNode})){var C=this.restore();C&&(_.range=C)}}},{key:"value",value:function(){return""}}]),y}(f.default.Embed);b.blotName="cursor",b.className="ql-cursor",b.tagName="span",b.CONTENTS="\uFEFF",r.default=b},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(0),a=f(o),l=i(4),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(){return h(this,g),x(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return g}(a.default.Container);v.allowedChildren=[s.default,l.BlockEmbed,v],r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.ColorStyle=r.ColorClass=r.ColorAttributor=void 0;var o=function(){function b(p,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(p,m.key,m)}}return function(p,y,d){return y&&b(p.prototype,y),d&&b(p,d),p}}(),a=function b(p,y,d){p===null&&(p=Function.prototype);var m=Object.getOwnPropertyDescriptor(p,y);if(m===void 0){var _=Object.getPrototypeOf(p);return _===null?void 0:b(_,y,d)}else{if("value"in m)return m.value;var A=m.get;return A===void 0?void 0:A.call(d)}},l=i(0),s=f(l);function f(b){return b&&b.__esModule?b:{default:b}}function h(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function x(b,p){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:b}function w(b,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);b.prototype=Object.create(p&&p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(b,p):b.__proto__=p)}var v=function(b){w(p,b);function p(){return h(this,p),x(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return o(p,[{key:"value",value:function(d){var m=a(p.prototype.__proto__||Object.getPrototypeOf(p.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}}]),p}(s.default.Attributor.Style),O=new s.default.Attributor.Class("color","ql-color",{scope:s.default.Scope.INLINE}),g=new v("color","color",{scope:s.default.Scope.INLINE});r.ColorAttributor=v,r.ColorClass=O,r.ColorStyle=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.sanitize=r.default=void 0;var o=function(){function g(b,p){for(var y=0;y<p.length;y++){var d=p[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(b,d.key,d)}}return function(b,p,y){return p&&g(b.prototype,p),y&&g(b,y),b}}(),a=function g(b,p,y){b===null&&(b=Function.prototype);var d=Object.getOwnPropertyDescriptor(b,p);if(d===void 0){var m=Object.getPrototypeOf(b);return m===null?void 0:g(m,p,y)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(y)}},l=i(6),s=f(l);function f(g){return g&&g.__esModule?g:{default:g}}function h(g,b){if(!(g instanceof b))throw new TypeError("Cannot call a class as a function")}function x(g,b){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:g}function w(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(g,b):g.__proto__=b)}var v=function(g){w(b,g);function b(){return h(this,b),x(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return o(b,[{key:"format",value:function(y,d){if(y!==this.statics.blotName||!d)return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,y,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(y){var d=a(b.__proto__||Object.getPrototypeOf(b),"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 O(y,this.PROTOCOL_WHITELIST)?y:this.SANITIZED_URL}}]),b}(s.default);v.blotName="link",v.tagName="A",v.SANITIZED_URL="about:blank",v.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function O(g,b){var p=document.createElement("a");p.href=g;var y=p.href.slice(0,p.href.indexOf(":"));return b.indexOf(y)>-1}r.default=v,r.sanitize=O},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},a=function(){function b(p,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(p,m.key,m)}}return function(p,y,d){return y&&b(p.prototype,y),d&&b(p,d),p}}(),l=i(23),s=x(l),f=i(107),h=x(f);function x(b){return b&&b.__esModule?b:{default:b}}function w(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}var v=0;function O(b,p){b.setAttribute(p,b.getAttribute(p)!=="true")}var g=function(){function b(p){var y=this;w(this,b),this.select=p,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){y.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case s.default.keys.ENTER:y.togglePicker();break;case s.default.keys.ESCAPE:y.escape(),d.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return a(b,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),O(this.label,"aria-expanded"),O(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 s.default.keys.ENTER:d.selectItem(m,!0),_.preventDefault();break;case s.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-"+v,v+=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":o(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)}}]),b}();r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(0),a=G(o),l=i(5),s=G(l),f=i(4),h=G(f),x=i(16),w=G(x),v=i(25),O=G(v),g=i(24),b=G(g),p=i(35),y=G(p),d=i(6),m=G(d),_=i(22),A=G(_),C=i(7),R=G(C),S=i(55),E=G(S),P=i(42),T=G(P),N=i(23),U=G(N);function G(Z){return Z&&Z.__esModule?Z:{default:Z}}s.default.register({"blots/block":h.default,"blots/block/embed":f.BlockEmbed,"blots/break":w.default,"blots/container":O.default,"blots/cursor":b.default,"blots/embed":y.default,"blots/inline":m.default,"blots/scroll":A.default,"blots/text":R.default,"modules/clipboard":E.default,"modules/history":T.default,"modules/keyboard":U.default}),a.default.register(h.default,w.default,b.default,m.default,A.default,R.default),r.default=s.default},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(1),a=function(){function l(s){this.domNode=s,this.domNode[o.DATA_KEY]={blot:this}}return Object.defineProperty(l.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),l.create=function(s){if(this.tagName==null)throw new o.ParchmentError("Blot definition missing tagName");var f;return Array.isArray(this.tagName)?(typeof s=="string"&&(s=s.toUpperCase(),parseInt(s).toString()===s&&(s=parseInt(s))),typeof s=="number"?f=document.createElement(this.tagName[s-1]):this.tagName.indexOf(s)>-1?f=document.createElement(s):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 s=this.domNode.cloneNode(!1);return o.create(s)},l.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[o.DATA_KEY]},l.prototype.deleteAt=function(s,f){var h=this.isolate(s,f);h.remove()},l.prototype.formatAt=function(s,f,h,x){var w=this.isolate(s,f);if(o.query(h,o.Scope.BLOT)!=null&&x)w.wrap(h,x);else if(o.query(h,o.Scope.ATTRIBUTE)!=null){var v=o.create(this.statics.scope);w.wrap(v),v.format(h,x)}},l.prototype.insertAt=function(s,f,h){var x=h==null?o.create("text",f):o.create(f,h),w=this.split(s);this.parent.insertBefore(x,w)},l.prototype.insertInto=function(s,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var h=null;s.children.insertBefore(this,f),f!=null&&(h=f.domNode),(this.domNode.parentNode!=s.domNode||this.domNode.nextSibling!=h)&&s.domNode.insertBefore(this.domNode,h),this.parent=s,this.attach()},l.prototype.isolate=function(s,f){var h=this.split(s);return h.split(f),h},l.prototype.length=function(){return 1},l.prototype.offset=function(s){return s===void 0&&(s=this.parent),this.parent==null||this==s?0:this.parent.children.offset(this)+this.parent.offset(s)},l.prototype.optimize=function(s){this.domNode[o.DATA_KEY]!=null&&delete this.domNode[o.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(s){s.parent!=null&&(s.parent.insertBefore(this,s.next),s.remove())},l.prototype.replaceWith=function(s,f){var h=typeof s=="string"?o.create(s,f):s;return h.replace(this),h},l.prototype.split=function(s,f){return s===0?this:this.next},l.prototype.update=function(s,f){},l.prototype.wrap=function(s,f){var h=typeof s=="string"?o.create(s,f):s;return this.parent!=null&&this.parent.insertBefore(h,this.next),h.appendChild(this),h},l.blotName="abstract",l}();r.default=a},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(12),a=i(32),l=i(33),s=i(1),f=function(){function h(x){this.attributes={},this.domNode=x,this.build()}return h.prototype.attribute=function(x,w){w?x.add(this.domNode,w)&&(x.value(this.domNode)!=null?this.attributes[x.attrName]=x:delete this.attributes[x.attrName]):(x.remove(this.domNode),delete this.attributes[x.attrName])},h.prototype.build=function(){var x=this;this.attributes={};var w=o.default.keys(this.domNode),v=a.default.keys(this.domNode),O=l.default.keys(this.domNode);w.concat(v).concat(O).forEach(function(g){var b=s.query(g,s.Scope.ATTRIBUTE);b instanceof o.default&&(x.attributes[b.attrName]=b)})},h.prototype.copy=function(x){var w=this;Object.keys(this.attributes).forEach(function(v){var O=w.attributes[v].value(w.domNode);x.format(v,O)})},h.prototype.move=function(x){var w=this;this.copy(x),Object.keys(this.attributes).forEach(function(v){w.attributes[v].remove(w.domNode)}),this.attributes={}},h.prototype.values=function(){var x=this;return Object.keys(this.attributes).reduce(function(w,v){return w[v]=x.attributes[v].value(x.domNode),w},{})},h}();r.default=f},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(12);function l(f,h){var x=f.getAttribute("class")||"";return x.split(/\s+/).filter(function(w){return w.indexOf(h+"-")===0})}var s=function(f){o(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(x){return(x.getAttribute("class")||"").split(/\s+/).map(function(w){return w.split("-").slice(0,-1).join("-")})},h.prototype.add=function(x,w){return this.canAdd(x,w)?(this.remove(x),x.classList.add(this.keyName+"-"+w),!0):!1},h.prototype.remove=function(x){var w=l(x,this.keyName);w.forEach(function(v){x.classList.remove(v)}),x.classList.length===0&&x.removeAttribute("class")},h.prototype.value=function(x){var w=l(x,this.keyName)[0]||"",v=w.slice(this.keyName.length+1);return this.canAdd(x,v)?v:""},h}(a.default);r.default=s},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(12);function l(f){var h=f.split("-"),x=h.slice(1).map(function(w){return w[0].toUpperCase()+w.slice(1)}).join("");return h[0]+x}var s=function(f){o(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(x){return(x.getAttribute("style")||"").split(";").map(function(w){var v=w.split(":");return v[0].trim()})},h.prototype.add=function(x,w){return this.canAdd(x,w)?(x.style[l(this.keyName)]=w,!0):!1},h.prototype.remove=function(x){x.style[l(this.keyName)]="",x.getAttribute("style")||x.removeAttribute("style")},h.prototype.value=function(x){var w=x.style[l(this.keyName)];return this.canAdd(x,w)?w:""},h}(a.default);r.default=s},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function s(f,h){for(var x=0;x<h.length;x++){var w=h[x];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,h,x){return h&&s(f.prototype,h),x&&s(f,x),f}}();function a(s,f){if(!(s instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function s(f,h){a(this,s),this.quill=f,this.options=h,this.modules={}}return o(s,[{key:"init",value:function(){var h=this;Object.keys(this.options.modules).forEach(function(x){h.modules[x]==null&&h.addModule(x)})}},{key:"addModule",value:function(h){var x=this.quill.constructor.import("modules/"+h);return this.modules[h]=new x(this.quill,this.options.modules[h]||{}),this.modules[h]}}]),s}();l.DEFAULTS={modules:{}},l.themes={default:l},r.default=l},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function p(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&&p(y.prototype,d),m&&p(y,m),y}}(),a=function p(y,d,m){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var A=Object.getPrototypeOf(y);return A===null?void 0:p(A,d,m)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(m)}},l=i(0),s=x(l),f=i(7),h=x(f);function x(p){return p&&p.__esModule?p:{default:p}}function w(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function v(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function O(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var g="\uFEFF",b=function(p){O(y,p);function y(d){w(this,y);var m=v(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(g),m.rightGuard=document.createTextNode(g),m.domNode.appendChild(m.leftGuard),m.domNode.appendChild(m.contentNode),m.domNode.appendChild(m.rightGuard),m}return o(y,[{key:"index",value:function(m,_){return m===this.leftGuard?0:m===this.rightGuard?1:a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,m,_)}},{key:"restore",value:function(m){var _=void 0,A=void 0,C=m.data.split(g).join("");if(m===this.leftGuard)if(this.prev instanceof h.default){var R=this.prev.length();this.prev.insertAt(R,C),_={startNode:this.prev.domNode,startOffset:R+C.length}}else A=document.createTextNode(C),this.parent.insertBefore(s.default.create(A),this),_={startNode:A,startOffset:C.length};else m===this.rightGuard&&(this.next instanceof h.default?(this.next.insertAt(0,C),_={startNode:this.next.domNode,startOffset:C.length}):(A=document.createTextNode(C),this.parent.insertBefore(s.default.create(A),this.next),_={startNode:A,startOffset:C.length}));return m.data=g,_}},{key:"update",value:function(m,_){var A=this;m.forEach(function(C){if(C.type==="characterData"&&(C.target===A.leftGuard||C.target===A.rightGuard)){var R=A.restore(C.target);R&&(_.range=R)}})}}]),y}(s.default.Embed);r.default=b},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.AlignStyle=r.AlignClass=r.AlignAttribute=void 0;var o=i(0),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}var s={scope:a.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new a.default.Attributor.Attribute("align","align",s),h=new a.default.Attributor.Class("align","ql-align",s),x=new a.default.Attributor.Style("align","text-align",s);r.AlignAttribute=f,r.AlignClass=h,r.AlignStyle=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.BackgroundStyle=r.BackgroundClass=void 0;var o=i(0),a=s(o),l=i(26);function s(x){return x&&x.__esModule?x:{default:x}}var f=new a.default.Attributor.Class("background","ql-bg",{scope:a.default.Scope.INLINE}),h=new l.ColorAttributor("background","background-color",{scope:a.default.Scope.INLINE});r.BackgroundClass=f,r.BackgroundStyle=h},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.DirectionStyle=r.DirectionClass=r.DirectionAttribute=void 0;var o=i(0),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}var s={scope:a.default.Scope.BLOCK,whitelist:["rtl"]},f=new a.default.Attributor.Attribute("direction","dir",s),h=new a.default.Attributor.Class("direction","ql-direction",s),x=new a.default.Attributor.Style("direction","direction",s);r.DirectionAttribute=f,r.DirectionClass=h,r.DirectionStyle=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.FontClass=r.FontStyle=void 0;var o=function(){function p(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&&p(y.prototype,d),m&&p(y,m),y}}(),a=function p(y,d,m){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var A=Object.getPrototypeOf(y);return A===null?void 0:p(A,d,m)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(m)}},l=i(0),s=f(l);function f(p){return p&&p.__esModule?p:{default:p}}function h(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function x(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function w(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var v={scope:s.default.Scope.INLINE,whitelist:["serif","monospace"]},O=new s.default.Attributor.Class("font","ql-font",v),g=function(p){w(y,p);function y(){return h(this,y),x(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return o(y,[{key:"value",value:function(m){return a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,m).replace(/["']/g,"")}}]),y}(s.default.Attributor.Style),b=new g("font","font-family",v);r.FontStyle=b,r.FontClass=O},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SizeStyle=r.SizeClass=void 0;var o=i(0),a=l(o);function l(h){return h&&h.__esModule?h:{default:h}}var s=new a.default.Attributor.Class("size","ql-size",{scope:a.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new a.default.Attributor.Style("size","font-size",{scope:a.default.Scope.INLINE,whitelist:["10px","18px","32px"]});r.SizeClass=s,r.SizeStyle=f},function(n,r,i){n.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(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.getLastChangeIndex=r.default=void 0;var o=function(){function d(m,_){for(var A=0;A<_.length;A++){var C=_[A];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(m,C.key,C)}}return function(m,_,A){return _&&d(m.prototype,_),A&&d(m,A),m}}(),a=i(0),l=w(a),s=i(5),f=w(s),h=i(9),x=w(h);function w(d){return d&&d.__esModule?d:{default:d}}function v(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function O(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 g(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}var b=function(d){g(m,d);function m(_,A){v(this,m);var C=O(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,_,A));return C.lastRecorded=0,C.ignoreChange=!1,C.clear(),C.quill.on(f.default.events.EDITOR_CHANGE,function(R,S,E,P){R!==f.default.events.TEXT_CHANGE||C.ignoreChange||(!C.options.userOnly||P===f.default.sources.USER?C.record(S,E):C.transform(S))}),C.quill.keyboard.addBinding({key:"Z",shortKey:!0},C.undo.bind(C)),C.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},C.redo.bind(C)),/Win/i.test(navigator.platform)&&C.quill.keyboard.addBinding({key:"Y",shortKey:!0},C.redo.bind(C)),C}return o(m,[{key:"change",value:function(A,C){if(this.stack[A].length!==0){var R=this.stack[A].pop();this.stack[C].push(R),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(R[A],f.default.sources.USER),this.ignoreChange=!1;var S=y(R[A]);this.quill.setSelection(S)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(A,C){if(A.ops.length!==0){this.stack.redo=[];var R=this.quill.getContents().diff(C),S=Date.now();if(this.lastRecorded+this.options.delay>S&&this.stack.undo.length>0){var E=this.stack.undo.pop();R=R.compose(E.undo),A=E.redo.compose(A)}else this.lastRecorded=S;this.stack.undo.push({redo:A,undo:R}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(A){this.stack.undo.forEach(function(C){C.undo=A.transform(C.undo,!0),C.redo=A.transform(C.redo,!0)}),this.stack.redo.forEach(function(C){C.undo=A.transform(C.undo,!0),C.redo=A.transform(C.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),m}(x.default);b.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function p(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(A,C){return A+=C.delete||0,A},0),_=d.length()-m;return p(d)&&(_-=1),_}r.default=b,r.getLastChangeIndex=y},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BaseTooltip=void 0;var o=function(){function B(V,Y){for(var F=0;F<Y.length;F++){var $=Y[F];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(V,$.key,$)}}return function(V,Y,F){return Y&&B(V.prototype,Y),F&&B(V,F),V}}(),a=function B(V,Y,F){V===null&&(V=Function.prototype);var $=Object.getOwnPropertyDescriptor(V,Y);if($===void 0){var z=Object.getPrototypeOf(V);return z===null?void 0:B(z,Y,F)}else{if("value"in $)return $.value;var K=$.get;return K===void 0?void 0:K.call(F)}},l=i(3),s=S(l),f=i(2),h=S(f),x=i(8),w=S(x),v=i(23),O=S(v),g=i(34),b=S(g),p=i(59),y=S(p),d=i(60),m=S(d),_=i(28),A=S(_),C=i(61),R=S(C);function S(B){return B&&B.__esModule?B:{default:B}}function E(B,V){if(!(B instanceof V))throw new TypeError("Cannot call a class as a function")}function P(B,V){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V&&(typeof V=="object"||typeof V=="function")?V:B}function T(B,V){if(typeof V!="function"&&V!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof V);B.prototype=Object.create(V&&V.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),V&&(Object.setPrototypeOf?Object.setPrototypeOf(B,V):B.__proto__=V)}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){T(V,B);function V(Y,F){E(this,V);var $=P(this,(V.__proto__||Object.getPrototypeOf(V)).call(this,Y,F)),z=function K(X){if(!document.body.contains(Y.root))return document.body.removeEventListener("click",K);$.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 Y.emitter.listenDOM("click",document.body,z),$}return o(V,[{key:"addModule",value:function(F){var $=a(V.prototype.__proto__||Object.getPrototypeOf(V.prototype),"addModule",this).call(this,F);return F==="toolbar"&&this.extendToolbar($),$}},{key:"buildButtons",value:function(F,$){F.forEach(function(z){var K=z.getAttribute("class")||"";K.split(/\s+/).forEach(function(X){if(X.startsWith("ql-")&&(X=X.slice(3),$[X]!=null))if(X==="direction")z.innerHTML=$[X][""]+$[X].rtl;else if(typeof $[X]=="string")z.innerHTML=$[X];else{var Q=z.value||"";Q!=null&&$[X][Q]&&(z.innerHTML=$[X][Q])}})})}},{key:"buildPickers",value:function(F,$){var z=this;this.pickers=F.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 A.default(X)});var K=function(){z.pickers.forEach(function(Q){Q.update()})};this.quill.on(w.default.events.EDITOR_CHANGE,K)}}]),V}(b.default);H.DEFAULTS=(0,s.default)(!0,{},b.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var V=this,Y=this.container.querySelector("input.ql-image[type=file]");Y==null&&(Y=document.createElement("input"),Y.setAttribute("type","file"),Y.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),Y.classList.add("ql-image"),Y.addEventListener("change",function(){if(Y.files!=null&&Y.files[0]!=null){var F=new FileReader;F.onload=function($){var z=V.quill.getSelection(!0);V.quill.updateContents(new h.default().retain(z.index).delete(z.length).insert({image:$.target.result}),w.default.sources.USER),V.quill.setSelection(z.index+1,w.default.sources.SILENT),Y.value=""},F.readAsDataURL(Y.files[0])}}),this.container.appendChild(Y)),Y.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var L=function(B){T(V,B);function V(Y,F){E(this,V);var $=P(this,(V.__proto__||Object.getPrototypeOf(V)).call(this,Y,F));return $.textbox=$.root.querySelector('input[type="text"]'),$.listen(),$}return o(V,[{key:"listen",value:function(){var F=this;this.textbox.addEventListener("keydown",function($){O.default.match($,"enter")?(F.save(),$.preventDefault()):O.default.match($,"escape")&&(F.cancel(),$.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var F=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=$:F!==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-"+F)||""),this.root.setAttribute("data-mode",F)}},{key:"restoreFocus",value:function(){var F=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=F}},{key:"save",value:function(){var F=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var $=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",F,w.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",F,w.default.sources.USER)),this.quill.root.scrollTop=$;break}case"video":F=M(F);case"formula":{if(!F)break;var z=this.quill.getSelection(!0);if(z!=null){var K=z.index+z.length;this.quill.insertEmbed(K,this.root.getAttribute("data-mode"),F,w.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(K+1," ",w.default.sources.USER),this.quill.setSelection(K+2,w.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),V}(R.default);function M(B){var V=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 V?(V[1]||"https")+"://www.youtube.com/embed/"+V[2]+"?showinfo=0":(V=B.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(V[1]||"https")+"://player.vimeo.com/video/"+V[2]+"/":B}function D(B,V){var Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;V.forEach(function(F){var $=document.createElement("option");F===Y?$.setAttribute("selected","selected"):$.setAttribute("value",F),B.appendChild($)})}r.BaseTooltip=L,r.default=H},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function a(){this.head=this.tail=null,this.length=0}return a.prototype.append=function(){for(var l=[],s=0;s<arguments.length;s++)l[s]=arguments[s];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},a.prototype.contains=function(l){for(var s,f=this.iterator();s=f();)if(s===l)return!0;return!1},a.prototype.insertBefore=function(l,s){l&&(l.next=s,s!=null?(l.prev=s.prev,s.prev!=null&&(s.prev.next=l),s.prev=l,s===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)},a.prototype.offset=function(l){for(var s=0,f=this.head;f!=null;){if(f===l)return s;s+=f.length(),f=f.next}return-1},a.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)},a.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var s=l;return l!=null&&(l=l.next),s}},a.prototype.find=function(l,s){s===void 0&&(s=!1);for(var f,h=this.iterator();f=h();){var x=f.length();if(l<x||s&&l===x&&(f.next==null||f.next.length()!==0))return[f,l];l-=x}return[null,0]},a.prototype.forEach=function(l){for(var s,f=this.iterator();s=f();)l(s)},a.prototype.forEachAt=function(l,s,f){if(!(s<=0))for(var h=this.find(l),x=h[0],w=h[1],v,O=l-w,g=this.iterator(x);(v=g())&&O<l+s;){var b=v.length();l>O?f(v,l-O,Math.min(s,O+b-l)):f(v,0,Math.min(b,l+s-O)),O+=b}},a.prototype.map=function(l){return this.reduce(function(s,f){return s.push(l(f)),s},[])},a.prototype.reduce=function(l,s){for(var f,h=this.iterator();f=h();)s=l(s,f);return s},a}();r.default=o},function(n,r,i){var o=this&&this.__extends||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,v){w.__proto__=v}||function(w,v){for(var O in v)v.hasOwnProperty(O)&&(w[O]=v[O])};return function(w,v){x(w,v);function O(){this.constructor=w}w.prototype=v===null?Object.create(v):(O.prototype=v.prototype,new O)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(17),l=i(1),s={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},f=100,h=function(x){o(w,x);function w(v){var O=x.call(this,v)||this;return O.scroll=O,O.observer=new MutationObserver(function(g){O.update(g)}),O.observer.observe(O.domNode,s),O.attach(),O}return w.prototype.detach=function(){x.prototype.detach.call(this),this.observer.disconnect()},w.prototype.deleteAt=function(v,O){this.update(),v===0&&O===this.length()?this.children.forEach(function(g){g.remove()}):x.prototype.deleteAt.call(this,v,O)},w.prototype.formatAt=function(v,O,g,b){this.update(),x.prototype.formatAt.call(this,v,O,g,b)},w.prototype.insertAt=function(v,O,g){this.update(),x.prototype.insertAt.call(this,v,O,g)},w.prototype.optimize=function(v,O){var g=this;v===void 0&&(v=[]),O===void 0&&(O={}),x.prototype.optimize.call(this,O);for(var b=[].slice.call(this.observer.takeRecords());b.length>0;)v.push(b.pop());for(var p=function(_,A){A===void 0&&(A=!0),!(_==null||_===g)&&_.domNode.parentNode!=null&&(_.domNode[l.DATA_KEY].mutations==null&&(_.domNode[l.DATA_KEY].mutations=[]),A&&p(_.parent))},y=function(_){_.domNode[l.DATA_KEY]==null||_.domNode[l.DATA_KEY].mutations==null||(_ instanceof a.default&&_.children.forEach(y),_.optimize(O))},d=v,m=0;d.length>0;m+=1){if(m>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(_){var A=l.find(_.target,!0);A!=null&&(A.domNode===_.target&&(_.type==="childList"?(p(l.find(_.previousSibling,!1)),[].forEach.call(_.addedNodes,function(C){var R=l.find(C,!1);p(R,!1),R instanceof a.default&&R.children.forEach(function(S){p(S,!1)})})):_.type==="attributes"&&p(A.prev)),p(A))}),this.children.forEach(y),d=[].slice.call(this.observer.takeRecords()),b=d.slice();b.length>0;)v.push(b.pop())}},w.prototype.update=function(v,O){var g=this;O===void 0&&(O={}),v=v||this.observer.takeRecords(),v.map(function(b){var p=l.find(b.target,!0);return p==null?null:p.domNode[l.DATA_KEY].mutations==null?(p.domNode[l.DATA_KEY].mutations=[b],p):(p.domNode[l.DATA_KEY].mutations.push(b),null)}).forEach(function(b){b==null||b===g||b.domNode[l.DATA_KEY]==null||b.update(b.domNode[l.DATA_KEY].mutations||[],O)}),this.domNode[l.DATA_KEY].mutations!=null&&x.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,O),this.optimize(v,O)},w.blotName="scroll",w.defaultChild="block",w.scope=l.Scope.BLOCK_BLOT,w.tagName="DIV",w}(a.default);r.default=h},function(n,r,i){var o=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,w){x.__proto__=w}||function(x,w){for(var v in w)w.hasOwnProperty(v)&&(x[v]=w[v])};return function(x,w){h(x,w);function v(){this.constructor=x}x.prototype=w===null?Object.create(w):(v.prototype=w.prototype,new v)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(18),l=i(1);function s(h,x){if(Object.keys(h).length!==Object.keys(x).length)return!1;for(var w in h)if(h[w]!==x[w])return!1;return!0}var f=function(h){o(x,h);function x(){return h!==null&&h.apply(this,arguments)||this}return x.formats=function(w){if(w.tagName!==x.tagName)return h.formats.call(this,w)},x.prototype.format=function(w,v){var O=this;w===this.statics.blotName&&!v?(this.children.forEach(function(g){g instanceof a.default||(g=g.wrap(x.blotName,!0)),O.attributes.copy(g)}),this.unwrap()):h.prototype.format.call(this,w,v)},x.prototype.formatAt=function(w,v,O,g){if(this.formats()[O]!=null||l.query(O,l.Scope.ATTRIBUTE)){var b=this.isolate(w,v);b.format(O,g)}else h.prototype.formatAt.call(this,w,v,O,g)},x.prototype.optimize=function(w){h.prototype.optimize.call(this,w);var v=this.formats();if(Object.keys(v).length===0)return this.unwrap();var O=this.next;O instanceof x&&O.prev===this&&s(v,O.formats())&&(O.moveChildren(this),O.remove())},x.blotName="inline",x.scope=l.Scope.INLINE_BLOT,x.tagName="SPAN",x}(a.default);r.default=f},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(18),l=i(1),s=function(f){o(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.formats=function(x){var w=l.query(h.blotName).tagName;if(x.tagName!==w)return f.formats.call(this,x)},h.prototype.format=function(x,w){l.query(x,l.Scope.BLOCK)!=null&&(x===this.statics.blotName&&!w?this.replaceWith(h.blotName):f.prototype.format.call(this,x,w))},h.prototype.formatAt=function(x,w,v,O){l.query(v,l.Scope.BLOCK)!=null?this.format(v,O):f.prototype.formatAt.call(this,x,w,v,O)},h.prototype.insertAt=function(x,w,v){if(v==null||l.query(w,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,x,w,v);else{var O=this.split(x),g=l.create(w,v);O.parent.insertBefore(g,O)}},h.prototype.update=function(x,w){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,x,w)},h.blotName="block",h.scope=l.Scope.BLOCK_BLOT,h.tagName="P",h}(a.default);r.default=s},function(n,r,i){var o=this&&this.__extends||function(){var s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var x in h)h.hasOwnProperty(x)&&(f[x]=h[x])};return function(f,h){s(f,h);function x(){this.constructor=f}f.prototype=h===null?Object.create(h):(x.prototype=h.prototype,new x)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(19),l=function(s){o(f,s);function f(){return s!==null&&s.apply(this,arguments)||this}return f.formats=function(h){},f.prototype.format=function(h,x){s.prototype.formatAt.call(this,0,this.length(),h,x)},f.prototype.formatAt=function(h,x,w,v){h===0&&x===this.length()?this.format(w,v):s.prototype.formatAt.call(this,h,x,w,v)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f}(a.default);r.default=l},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(19),l=i(1),s=function(f){o(h,f);function h(x){var w=f.call(this,x)||this;return w.text=w.statics.value(w.domNode),w}return h.create=function(x){return document.createTextNode(x)},h.value=function(x){var w=x.data;return w.normalize&&(w=w.normalize()),w},h.prototype.deleteAt=function(x,w){this.domNode.data=this.text=this.text.slice(0,x)+this.text.slice(x+w)},h.prototype.index=function(x,w){return this.domNode===x?w:-1},h.prototype.insertAt=function(x,w,v){v==null?(this.text=this.text.slice(0,x)+w+this.text.slice(x),this.domNode.data=this.text):f.prototype.insertAt.call(this,x,w,v)},h.prototype.length=function(){return this.text.length},h.prototype.optimize=function(x){f.prototype.optimize.call(this,x),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(x,w){return[this.domNode,x]},h.prototype.split=function(x,w){if(w===void 0&&(w=!1),!w){if(x===0)return this;if(x===this.length())return this.next}var v=l.create(this.domNode.splitText(x));return this.parent.insertBefore(v,this.next),this.text=this.statics.value(this.domNode),v},h.prototype.update=function(x,w){var v=this;x.some(function(O){return O.type==="characterData"&&O.target===v.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}(a.default);r.default=s},function(n,r,i){var o=document.createElement("div");if(o.classList.toggle("test-class",!1),o.classList.contains("test-class")){var a=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(l,s){return arguments.length>1&&!this.contains(l)==!s?s:a.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,s){return s=s||0,this.substr(s,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,s){var f=this.toString();(typeof s!="number"||!isFinite(s)||Math.floor(s)!==s||s>f.length)&&(s=f.length),s-=l.length;var h=f.indexOf(l,s);return h!==-1&&h===s}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(s){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof s!="function")throw new TypeError("predicate must be a function");for(var f=Object(this),h=f.length>>>0,x=arguments[1],w,v=0;v<h;v++)if(w=f[v],s.call(x,w,v,f))return w}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(n,r){var i=-1,o=1,a=0;function l(m,_,A){if(m==_)return m?[[a,m]]:[];(A<0||m.length<A)&&(A=null);var C=x(m,_),R=m.substring(0,C);m=m.substring(C),_=_.substring(C),C=w(m,_);var S=m.substring(m.length-C);m=m.substring(0,m.length-C),_=_.substring(0,_.length-C);var E=s(m,_);return R&&E.unshift([a,R]),S&&E.push([a,S]),O(E),A!=null&&(E=p(E,A)),E=y(E),E}function s(m,_){var A;if(!m)return[[o,_]];if(!_)return[[i,m]];var C=m.length>_.length?m:_,R=m.length>_.length?_:m,S=C.indexOf(R);if(S!=-1)return A=[[o,C.substring(0,S)],[a,R],[o,C.substring(S+R.length)]],m.length>_.length&&(A[0][0]=A[2][0]=i),A;if(R.length==1)return[[i,m],[o,_]];var E=v(m,_);if(E){var P=E[0],T=E[1],N=E[2],U=E[3],G=E[4],Z=l(P,N),W=l(T,U);return Z.concat([[a,G]],W)}return f(m,_)}function f(m,_){for(var A=m.length,C=_.length,R=Math.ceil((A+C)/2),S=R,E=2*R,P=new Array(E),T=new Array(E),N=0;N<E;N++)P[N]=-1,T[N]=-1;P[S+1]=0,T[S+1]=0;for(var U=A-C,G=U%2!=0,Z=0,W=0,H=0,L=0,M=0;M<R;M++){for(var D=-M+Z;D<=M-W;D+=2){var B=S+D,V;D==-M||D!=M&&P[B-1]<P[B+1]?V=P[B+1]:V=P[B-1]+1;for(var Y=V-D;V<A&&Y<C&&m.charAt(V)==_.charAt(Y);)V++,Y++;if(P[B]=V,V>A)W+=2;else if(Y>C)Z+=2;else if(G){var F=S+U-D;if(F>=0&&F<E&&T[F]!=-1){var $=A-T[F];if(V>=$)return h(m,_,V,Y)}}}for(var z=-M+H;z<=M-L;z+=2){var F=S+z,$;z==-M||z!=M&&T[F-1]<T[F+1]?$=T[F+1]:$=T[F-1]+1;for(var K=$-z;$<A&&K<C&&m.charAt(A-$-1)==_.charAt(C-K-1);)$++,K++;if(T[F]=$,$>A)L+=2;else if(K>C)H+=2;else if(!G){var B=S+U-z;if(B>=0&&B<E&&P[B]!=-1){var V=P[B],Y=S+V-B;if($=A-$,V>=$)return h(m,_,V,Y)}}}}return[[i,m],[o,_]]}function h(m,_,A,C){var R=m.substring(0,A),S=_.substring(0,C),E=m.substring(A),P=_.substring(C),T=l(R,S),N=l(E,P);return T.concat(N)}function x(m,_){if(!m||!_||m.charAt(0)!=_.charAt(0))return 0;for(var A=0,C=Math.min(m.length,_.length),R=C,S=0;A<R;)m.substring(S,R)==_.substring(S,R)?(A=R,S=A):C=R,R=Math.floor((C-A)/2+A);return R}function w(m,_){if(!m||!_||m.charAt(m.length-1)!=_.charAt(_.length-1))return 0;for(var A=0,C=Math.min(m.length,_.length),R=C,S=0;A<R;)m.substring(m.length-R,m.length-S)==_.substring(_.length-R,_.length-S)?(A=R,S=A):C=R,R=Math.floor((C-A)/2+A);return R}function v(m,_){var A=m.length>_.length?m:_,C=m.length>_.length?_:m;if(A.length<4||C.length*2<A.length)return null;function R(W,H,L){for(var M=W.substring(L,L+Math.floor(W.length/4)),D=-1,B="",V,Y,F,$;(D=H.indexOf(M,D+1))!=-1;){var z=x(W.substring(L),H.substring(D)),K=w(W.substring(0,L),H.substring(0,D));B.length<K+z&&(B=H.substring(D-K,D)+H.substring(D,D+z),V=W.substring(0,L-K),Y=W.substring(L+z),F=H.substring(0,D-K),$=H.substring(D+z))}return B.length*2>=W.length?[V,Y,F,$,B]:null}var S=R(A,C,Math.ceil(A.length/4)),E=R(A,C,Math.ceil(A.length/2)),P;if(!S&&!E)return null;E?S?P=S[4].length>E[4].length?S:E:P=E:P=S;var T,N,U,G;m.length>_.length?(T=P[0],N=P[1],U=P[2],G=P[3]):(U=P[0],G=P[1],T=P[2],N=P[3]);var Z=P[4];return[T,N,U,G,Z]}function O(m){m.push([a,""]);for(var _=0,A=0,C=0,R="",S="",E;_<m.length;)switch(m[_][0]){case o:C++,S+=m[_][1],_++;break;case i:A++,R+=m[_][1],_++;break;case a:A+C>1?(A!==0&&C!==0&&(E=x(S,R),E!==0&&(_-A-C>0&&m[_-A-C-1][0]==a?m[_-A-C-1][1]+=S.substring(0,E):(m.splice(0,0,[a,S.substring(0,E)]),_++),S=S.substring(E),R=R.substring(E)),E=w(S,R),E!==0&&(m[_][1]=S.substring(S.length-E)+m[_][1],S=S.substring(0,S.length-E),R=R.substring(0,R.length-E))),A===0?m.splice(_-C,A+C,[o,S]):C===0?m.splice(_-A,A+C,[i,R]):m.splice(_-A-C,A+C,[i,R],[o,S]),_=_-A-C+(A?1:0)+(C?1:0)+1):_!==0&&m[_-1][0]==a?(m[_-1][1]+=m[_][1],m.splice(_,1)):_++,C=0,A=0,R="",S="";break}m[m.length-1][1]===""&&m.pop();var P=!1;for(_=1;_<m.length-1;)m[_-1][0]==a&&m[_+1][0]==a&&(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),P=!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),P=!0)),_++;P&&O(m)}var g=l;g.INSERT=o,g.DELETE=i,g.EQUAL=a,n.exports=g;function b(m,_){if(_===0)return[a,m];for(var A=0,C=0;C<m.length;C++){var R=m[C];if(R[0]===i||R[0]===a){var S=A+R[1].length;if(_===S)return[C+1,m];if(_<S){m=m.slice();var E=_-A,P=[R[0],R[1].slice(0,E)],T=[R[0],R[1].slice(E)];return m.splice(C,1,P,T),[C+1,m]}else A=S}}throw new Error("cursor_pos is out of bounds!")}function p(m,_){var A=b(m,_),C=A[1],R=A[0],S=C[R],E=C[R+1];if(S==null)return m;if(S[0]!==a)return m;if(E!=null&&S[1]+E[1]===E[1]+S[1])return C.splice(R,2,E,S),d(C,R,2);if(E!=null&&E[1].indexOf(S[1])===0){C.splice(R,2,[E[0],S[1]],[0,S[1]]);var P=E[1].slice(S[1].length);return P.length>0&&C.splice(R+2,0,[E[0],P]),d(C,R,3)}else return m}function y(m){for(var _=!1,A=function(E){return E.charCodeAt(0)>=56320&&E.charCodeAt(0)<=57343},C=function(E){return E.charCodeAt(E.length-1)>=55296&&E.charCodeAt(E.length-1)<=56319},R=2;R<m.length;R+=1)m[R-2][0]===a&&C(m[R-2][1])&&m[R-1][0]===i&&A(m[R-1][1])&&m[R][0]===o&&A(m[R][1])&&(_=!0,m[R-1][1]=m[R-2][1].slice(-1)+m[R-1][1],m[R][1]=m[R-2][1].slice(-1)+m[R][1],m[R-2][1]=m[R-2][1].slice(0,-1));if(!_)return m;for(var S=[],R=0;R<m.length;R+=1)m[R][1].length>0&&S.push(m[R]);return S}function d(m,_,A){for(var C=_+A-1;C>=0&&C>=_-1;C--)if(C+1<m.length){var R=m[C],S=m[C+1];R[0]===S[1]&&m.splice(C,2,[R[0],R[1]+S[1]])}return m}},function(n,r){r=n.exports=typeof Object.keys=="function"?Object.keys:i,r.shim=i;function i(o){var a=[];for(var l in o)a.push(l);return a}},function(n,r){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";r=n.exports=i?o:a,r.supported=o;function o(l){return Object.prototype.toString.call(l)=="[object Arguments]"}r.unsupported=a;function a(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}},function(n,r){var i=Object.prototype.hasOwnProperty,o="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(o=!1));function l(f,h,x){this.fn=f,this.context=h,this.once=x||!1}function s(){this._events=new a,this._eventsCount=0}s.prototype.eventNames=function(){var h=[],x,w;if(this._eventsCount===0)return h;for(w in x=this._events)i.call(x,w)&&h.push(o?w.slice(1):w);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(x)):h},s.prototype.listeners=function(h,x){var w=o?o+h:h,v=this._events[w];if(x)return!!v;if(!v)return[];if(v.fn)return[v.fn];for(var O=0,g=v.length,b=new Array(g);O<g;O++)b[O]=v[O].fn;return b},s.prototype.emit=function(h,x,w,v,O,g){var b=o?o+h:h;if(!this._events[b])return!1;var p=this._events[b],y=arguments.length,d,m;if(p.fn){switch(p.once&&this.removeListener(h,p.fn,void 0,!0),y){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,x),!0;case 3:return p.fn.call(p.context,x,w),!0;case 4:return p.fn.call(p.context,x,w,v),!0;case 5:return p.fn.call(p.context,x,w,v,O),!0;case 6:return p.fn.call(p.context,x,w,v,O,g),!0}for(m=1,d=new Array(y-1);m<y;m++)d[m-1]=arguments[m];p.fn.apply(p.context,d)}else{var _=p.length,A;for(m=0;m<_;m++)switch(p[m].once&&this.removeListener(h,p[m].fn,void 0,!0),y){case 1:p[m].fn.call(p[m].context);break;case 2:p[m].fn.call(p[m].context,x);break;case 3:p[m].fn.call(p[m].context,x,w);break;case 4:p[m].fn.call(p[m].context,x,w,v);break;default:if(!d)for(A=1,d=new Array(y-1);A<y;A++)d[A-1]=arguments[A];p[m].fn.apply(p[m].context,d)}}return!0},s.prototype.on=function(h,x,w){var v=new l(x,w||this),O=o?o+h:h;return this._events[O]?this._events[O].fn?this._events[O]=[this._events[O],v]:this._events[O].push(v):(this._events[O]=v,this._eventsCount++),this},s.prototype.once=function(h,x,w){var v=new l(x,w||this,!0),O=o?o+h:h;return this._events[O]?this._events[O].fn?this._events[O]=[this._events[O],v]:this._events[O].push(v):(this._events[O]=v,this._eventsCount++),this},s.prototype.removeListener=function(h,x,w,v){var O=o?o+h:h;if(!this._events[O])return this;if(!x)return--this._eventsCount===0?this._events=new a:delete this._events[O],this;var g=this._events[O];if(g.fn)g.fn===x&&(!v||g.once)&&(!w||g.context===w)&&(--this._eventsCount===0?this._events=new a:delete this._events[O]);else{for(var b=0,p=[],y=g.length;b<y;b++)(g[b].fn!==x||v&&!g[b].once||w&&g[b].context!==w)&&p.push(g[b]);p.length?this._events[O]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new a:delete this._events[O]}return this},s.prototype.removeAllListeners=function(h){var x;return h?(x=o?o+h:h,this._events[x]&&(--this._eventsCount===0?this._events=new a:delete this._events[x])):(this._events=new a,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,typeof n<"u"&&(n.exports=s)},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.matchText=r.matchSpacing=r.matchNewline=r.matchBlot=r.matchAttributor=r.default=void 0;var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(re){return typeof re}:function(re){return re&&typeof Symbol=="function"&&re.constructor===Symbol&&re!==Symbol.prototype?"symbol":typeof re},a=function(){function re(ae,we){var be=[],te=!0,fe=!1,he=void 0;try{for(var Ee=ae[Symbol.iterator](),Ve;!(te=(Ve=Ee.next()).done)&&(be.push(Ve.value),!(we&&be.length===we));te=!0);}catch(Je){fe=!0,he=Je}finally{try{!te&&Ee.return&&Ee.return()}finally{if(fe)throw he}}return be}return function(ae,we){if(Array.isArray(ae))return ae;if(Symbol.iterator in Object(ae))return re(ae,we);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function re(ae,we){for(var be=0;be<we.length;be++){var te=we[be];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(ae,te.key,te)}}return function(ae,we,be){return we&&re(ae.prototype,we),be&&re(ae,be),ae}}(),s=i(3),f=T(s),h=i(2),x=T(h),w=i(0),v=T(w),O=i(5),g=T(O),b=i(10),p=T(b),y=i(9),d=T(y),m=i(36),_=i(37),A=i(13),C=T(A),R=i(26),S=i(38),E=i(39),P=i(40);function T(re){return re&&re.__esModule?re:{default:re}}function N(re,ae,we){return ae in re?Object.defineProperty(re,ae,{value:we,enumerable:!0,configurable:!0,writable:!0}):re[ae]=we,re}function U(re,ae){if(!(re instanceof ae))throw new TypeError("Cannot call a class as a function")}function G(re,ae){if(!re)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ae&&(typeof ae=="object"||typeof ae=="function")?ae:re}function Z(re,ae){if(typeof ae!="function"&&ae!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ae);re.prototype=Object.create(ae&&ae.prototype,{constructor:{value:re,enumerable:!1,writable:!0,configurable:!0}}),ae&&(Object.setPrototypeOf?Object.setPrototypeOf(re,ae):re.__proto__=ae)}var W=(0,p.default)("quill:clipboard"),H="__ql-matcher",L=[[Node.TEXT_NODE,Pe],[Node.TEXT_NODE,oe],["br",J],[Node.ELEMENT_NODE,oe],[Node.ELEMENT_NODE,Q],[Node.ELEMENT_NODE,de],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,me],["li",ie],["b",K.bind(K,"bold")],["i",K.bind(K,"italic")],["style",ne]],M=[m.AlignAttribute,S.DirectionAttribute].reduce(function(re,ae){return re[ae.keyName]=ae,re},{}),D=[m.AlignStyle,_.BackgroundStyle,R.ColorStyle,S.DirectionStyle,E.FontStyle,P.SizeStyle].reduce(function(re,ae){return re[ae.keyName]=ae,re},{}),B=function(re){Z(ae,re);function ae(we,be){U(this,ae);var te=G(this,(ae.__proto__||Object.getPrototypeOf(ae)).call(this,we,be));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=[],L.concat(te.options.matchers).forEach(function(fe){var he=a(fe,2),Ee=he[0],Ve=he[1];!be.matchVisual&&Ve===de||te.addMatcher(Ee,Ve)}),te}return l(ae,[{key:"addMatcher",value:function(be,te){this.matchers.push([be,te])}},{key:"convert",value:function(be){if(typeof be=="string")return this.container.innerHTML=be.replace(/\>\r?\n +\</g,"><"),this.convert();var te=this.quill.getFormat(this.quill.selection.savedRange.index);if(te[C.default.blotName]){var fe=this.container.innerText;return this.container.innerHTML="",new x.default().insert(fe,N({},C.default.blotName,te[C.default.blotName]))}var he=this.prepareMatching(),Ee=a(he,2),Ve=Ee[0],Je=Ee[1],Ae=z(this.container,Ve,Je);return F(Ae,`
140
- `)&&Ae.ops[Ae.ops.length-1].attributes==null&&(Ae=Ae.compose(new x.default().retain(Ae.length()-1).delete(1))),W.log("convert",this.container.innerHTML,Ae),this.container.innerHTML="",Ae}},{key:"dangerouslyPasteHTML",value:function(be,te){var fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.default.sources.API;if(typeof be=="string")this.quill.setContents(this.convert(be),te),this.quill.setSelection(0,g.default.sources.SILENT);else{var he=this.convert(te);this.quill.updateContents(new x.default().retain(be).concat(he),fe),this.quill.setSelection(be+he.length(),g.default.sources.SILENT)}}},{key:"onPaste",value:function(be){var te=this;if(!(be.defaultPrevented||!this.quill.isEnabled())){var fe=this.quill.getSelection(),he=new x.default().retain(fe.index),Ee=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(g.default.sources.SILENT),setTimeout(function(){he=he.concat(te.convert()).delete(fe.length),te.quill.updateContents(he,g.default.sources.USER),te.quill.setSelection(he.length()-fe.length,g.default.sources.SILENT),te.quill.scrollingContainer.scrollTop=Ee,te.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var be=this,te=[],fe=[];return this.matchers.forEach(function(he){var Ee=a(he,2),Ve=Ee[0],Je=Ee[1];switch(Ve){case Node.TEXT_NODE:fe.push(Je);break;case Node.ELEMENT_NODE:te.push(Je);break;default:[].forEach.call(be.container.querySelectorAll(Ve),function(Ae){Ae[H]=Ae[H]||[],Ae[H].push(Je)});break}}),[te,fe]}}]),ae}(d.default);B.DEFAULTS={matchers:[],matchVisual:!0};function V(re,ae,we){return(typeof ae>"u"?"undefined":o(ae))==="object"?Object.keys(ae).reduce(function(be,te){return V(be,te,ae[te])},re):re.reduce(function(be,te){return te.attributes&&te.attributes[ae]?be.push(te):be.insert(te.insert,(0,f.default)({},N({},ae,we),te.attributes))},new x.default)}function Y(re){if(re.nodeType!==Node.ELEMENT_NODE)return{};var ae="__ql-computed-style";return re[ae]||(re[ae]=window.getComputedStyle(re))}function F(re,ae){for(var we="",be=re.ops.length-1;be>=0&&we.length<ae.length;--be){var te=re.ops[be];if(typeof te.insert!="string")break;we=te.insert+we}return we.slice(-1*ae.length)===ae}function $(re){if(re.childNodes.length===0)return!1;var ae=Y(re);return["block","list-item"].indexOf(ae.display)>-1}function z(re,ae,we){return re.nodeType===re.TEXT_NODE?we.reduce(function(be,te){return te(re,be)},new x.default):re.nodeType===re.ELEMENT_NODE?[].reduce.call(re.childNodes||[],function(be,te){var fe=z(te,ae,we);return te.nodeType===re.ELEMENT_NODE&&(fe=ae.reduce(function(he,Ee){return Ee(te,he)},fe),fe=(te[H]||[]).reduce(function(he,Ee){return Ee(te,he)},fe)),be.concat(fe)},new x.default):new x.default}function K(re,ae,we){return V(we,re,!0)}function X(re,ae){var we=v.default.Attributor.Attribute.keys(re),be=v.default.Attributor.Class.keys(re),te=v.default.Attributor.Style.keys(re),fe={};return we.concat(be).concat(te).forEach(function(he){var Ee=v.default.query(he,v.default.Scope.ATTRIBUTE);Ee!=null&&(fe[Ee.attrName]=Ee.value(re),fe[Ee.attrName])||(Ee=M[he],Ee!=null&&(Ee.attrName===he||Ee.keyName===he)&&(fe[Ee.attrName]=Ee.value(re)||void 0),Ee=D[he],Ee!=null&&(Ee.attrName===he||Ee.keyName===he)&&(Ee=D[he],fe[Ee.attrName]=Ee.value(re)||void 0))}),Object.keys(fe).length>0&&(ae=V(ae,fe)),ae}function Q(re,ae){var we=v.default.query(re);if(we==null)return ae;if(we.prototype instanceof v.default.Embed){var be={},te=we.value(re);te!=null&&(be[we.blotName]=te,ae=new x.default().insert(be,we.formats(re)))}else typeof we.formats=="function"&&(ae=V(ae,we.blotName,we.formats(re)));return ae}function J(re,ae){return F(ae,`
141
- `)||ae.insert(`
142
- `),ae}function ne(){return new x.default}function ie(re,ae){var we=v.default.query(re);if(we==null||we.blotName!=="list-item"||!F(ae,`
143
- `))return ae;for(var be=-1,te=re.parentNode;!te.classList.contains("ql-clipboard");)(v.default.query(te)||{}).blotName==="list"&&(be+=1),te=te.parentNode;return be<=0?ae:ae.compose(new x.default().retain(ae.length()-1).retain(1,{indent:be}))}function oe(re,ae){return F(ae,`
144
- `)||($(re)||ae.length()>0&&re.nextSibling&&$(re.nextSibling))&&ae.insert(`
145
- `),ae}function de(re,ae){if($(re)&&re.nextElementSibling!=null&&!F(ae,`
146
-
147
- `)){var we=re.offsetHeight+parseFloat(Y(re).marginTop)+parseFloat(Y(re).marginBottom);re.nextElementSibling.offsetTop>re.offsetTop+we*1.5&&ae.insert(`
148
- `)}return ae}function me(re,ae){var we={},be=re.style||{};return be.fontStyle&&Y(re).fontStyle==="italic"&&(we.italic=!0),be.fontWeight&&(Y(re).fontWeight.startsWith("bold")||parseInt(Y(re).fontWeight)>=700)&&(we.bold=!0),Object.keys(we).length>0&&(ae=V(ae,we)),parseFloat(be.textIndent||0)>0&&(ae=new x.default().insert(" ").concat(ae)),ae}function Pe(re,ae){var we=re.data;if(re.parentNode.tagName==="O:P")return ae.insert(we.trim());if(we.trim().length===0&&re.parentNode.classList.contains("ql-clipboard"))return ae;if(!Y(re.parentNode).whiteSpace.startsWith("pre")){var be=function(fe,he){return he=he.replace(/[^\u00a0]/g,""),he.length<1&&fe?" ":he};we=we.replace(/\r\n/g," ").replace(/\n/g," "),we=we.replace(/\s\s+/g,be.bind(be,!0)),(re.previousSibling==null&&$(re.parentNode)||re.previousSibling!=null&&$(re.previousSibling))&&(we=we.replace(/^\s+/,be.bind(be,!1))),(re.nextSibling==null&&$(re.parentNode)||re.nextSibling!=null&&$(re.nextSibling))&&(we=we.replace(/\s+$/,be.bind(be,!1)))}return ae.insert(we)}r.default=B,r.matchAttributor=X,r.matchBlot=Q,r.matchNewline=oe,r.matchSpacing=de,r.matchText=Pe},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(6),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(){return h(this,g),x(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return o(g,[{key:"optimize",value:function(p){a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"optimize",this).call(this,p),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return a(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),g}(s.default);v.blotName="bold",v.tagName=["STRONG","B"],r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.addControls=r.default=void 0;var o=function(){function P(T,N){var U=[],G=!0,Z=!1,W=void 0;try{for(var H=T[Symbol.iterator](),L;!(G=(L=H.next()).done)&&(U.push(L.value),!(N&&U.length===N));G=!0);}catch(M){Z=!0,W=M}finally{try{!G&&H.return&&H.return()}finally{if(Z)throw W}}return U}return function(T,N){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return P(T,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function P(T,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(T,G.key,G)}}return function(T,N,U){return N&&P(T.prototype,N),U&&P(T,U),T}}(),l=i(2),s=p(l),f=i(0),h=p(f),x=i(5),w=p(x),v=i(10),O=p(v),g=i(9),b=p(g);function p(P){return P&&P.__esModule?P:{default:P}}function y(P,T,N){return T in P?Object.defineProperty(P,T,{value:N,enumerable:!0,configurable:!0,writable:!0}):P[T]=N,P}function d(P,T){if(!(P instanceof T))throw new TypeError("Cannot call a class as a function")}function m(P,T){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:P}function _(P,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);P.prototype=Object.create(T&&T.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(P,T):P.__proto__=T)}var A=(0,O.default)("quill:toolbar"),C=function(P){_(T,P);function T(N,U){d(this,T);var G=m(this,(T.__proto__||Object.getPrototypeOf(T)).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=A.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,L){H===w.default.events.SELECTION_CHANGE&&G.update(L)}),G.quill.on(w.default.events.SCROLL_OPTIMIZE,function(){var H=G.quill.selection.getRange(),L=o(H,1),M=L[0];G.update(M)}),G}return a(T,[{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){A.warn("ignoring attaching to disabled format",Z,U);return}if(h.default.query(Z)==null){A.warn("ignoring attaching to nonexistent format",Z,U);return}}var W=U.tagName==="SELECT"?"change":"click";U.addEventListener(W,function(H){var L=void 0;if(U.tagName==="SELECT"){if(U.selectedIndex<0)return;var M=U.options[U.selectedIndex];M.hasAttribute("selected")?L=!1:L=M.value||!1}else U.classList.contains("ql-active")?L=!1:L=U.value||!U.hasAttribute("value"),H.preventDefault();G.quill.focus();var D=G.quill.selection.getRange(),B=o(D,1),V=B[0];if(G.handlers[Z]!=null)G.handlers[Z].call(G,L);else if(h.default.query(Z).prototype instanceof h.default.Embed){if(L=prompt("Enter "+Z),!L)return;G.quill.updateContents(new s.default().retain(V.index).delete(V.length).insert(y({},Z,L)),w.default.sources.USER)}else G.quill.format(Z,L,w.default.sources.USER);G.update(V)}),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=o(Z,2),H=W[0],L=W[1];if(L.tagName==="SELECT"){var M=void 0;if(U==null)M=null;else if(G[H]==null)M=L.querySelector("option[selected]");else if(!Array.isArray(G[H])){var D=G[H];typeof D=="string"&&(D=D.replace(/\"/g,'\\"')),M=L.querySelector('option[value="'+D+'"]')}M==null?(L.value="",L.selectedIndex=-1):M.selected=!0}else if(U==null)L.classList.remove("ql-active");else if(L.hasAttribute("value")){var B=G[H]===L.getAttribute("value")||G[H]!=null&&G[H].toString()===L.getAttribute("value")||G[H]==null&&!L.getAttribute("value");L.classList.toggle("ql-active",B)}else L.classList.toggle("ql-active",G[H]!=null)})}}]),T}(b.default);C.DEFAULTS={};function R(P,T,N){var U=document.createElement("button");U.setAttribute("type","button"),U.classList.add("ql-"+T),N!=null&&(U.value=N),P.appendChild(U)}function S(P,T){Array.isArray(T[0])||(T=[T]),T.forEach(function(N){var U=document.createElement("span");U.classList.add("ql-formats"),N.forEach(function(G){if(typeof G=="string")R(U,G);else{var Z=Object.keys(G)[0],W=G[Z];Array.isArray(W)?E(U,Z,W):R(U,Z,W)}}),P.appendChild(U)})}function E(P,T,N){var U=document.createElement("select");U.classList.add("ql-"+T),N.forEach(function(G){var Z=document.createElement("option");G!==!1?Z.setAttribute("value",G):Z.setAttribute("selected","selected"),U.appendChild(Z)}),P.appendChild(U)}C.DEFAULTS={container:null,handlers:{clean:function(){var T=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&&T.quill.format(G,!1)})}else this.quill.removeFormat(N,w.default.sources.USER)},direction:function(T){var N=this.quill.getFormat().align;T==="rtl"&&N==null?this.quill.format("align","right",w.default.sources.USER):!T&&N==="right"&&this.quill.format("align",!1,w.default.sources.USER),this.quill.format("direction",T,w.default.sources.USER)},indent:function(T){var N=this.quill.getSelection(),U=this.quill.getFormat(N),G=parseInt(U.indent||0);if(T==="+1"||T==="-1"){var Z=T==="+1"?1:-1;U.direction==="rtl"&&(Z*=-1),this.quill.format("indent",G+Z,w.default.sources.USER)}},link:function(T){T===!0&&(T=prompt("Enter link URL:")),this.quill.format("link",T,w.default.sources.USER)},list:function(T){var N=this.quill.getSelection(),U=this.quill.getFormat(N);T==="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",T,w.default.sources.USER)}}},r.default=C,r.addControls=S},function(n,r){n.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(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(28),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(b,p){h(this,g);var y=x(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,b));return y.label.innerHTML=p,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 o(g,[{key:"buildItem",value:function(p){var y=a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"buildItem",this).call(this,p);return y.style.backgroundColor=p.getAttribute("value")||"",y}},{key:"selectItem",value:function(p,y){a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"selectItem",this).call(this,p,y);var d=this.label.querySelector(".ql-color-label"),m=p&&p.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=m:d.style.fill=m)}}]),g}(s.default);r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(28),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(b,p){h(this,g);var y=x(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,b));return y.container.classList.add("ql-icon-picker"),[].forEach.call(y.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=p[d.getAttribute("data-value")||""]}),y.defaultItem=y.container.querySelector(".ql-selected"),y.selectItem(y.defaultItem),y}return o(g,[{key:"selectItem",value:function(p,y){a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"selectItem",this).call(this,p,y),p=p||this.defaultItem,this.label.innerHTML=p.innerHTML}}]),g}(s.default);r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function s(f,h){for(var x=0;x<h.length;x++){var w=h[x];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,h,x){return h&&s(f.prototype,h),x&&s(f,x),f}}();function a(s,f){if(!(s instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function s(f,h){var x=this;a(this,s),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(){x.root.style.marginTop=-1*x.quill.root.scrollTop+"px"}),this.hide()}return o(s,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(h){var x=h.left+h.width/2-this.root.offsetWidth/2,w=h.bottom+this.quill.root.scrollTop;this.root.style.left=x+"px",this.root.style.top=w+"px",this.root.classList.remove("ql-flip");var v=this.boundsContainer.getBoundingClientRect(),O=this.root.getBoundingClientRect(),g=0;if(O.right>v.right&&(g=v.right-O.right,this.root.style.left=x+g+"px"),O.left<v.left&&(g=v.left-O.left,this.root.style.left=x+g+"px"),O.bottom>v.bottom){var b=O.bottom-O.top,p=h.bottom-h.top+b;this.root.style.top=w-p+"px",this.root.classList.add("ql-flip")}return g}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),s}();r.default=l},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function E(P,T){var N=[],U=!0,G=!1,Z=void 0;try{for(var W=P[Symbol.iterator](),H;!(U=(H=W.next()).done)&&(N.push(H.value),!(T&&N.length===T));U=!0);}catch(L){G=!0,Z=L}finally{try{!U&&W.return&&W.return()}finally{if(G)throw Z}}return N}return function(P,T){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return E(P,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function E(P,T,N){P===null&&(P=Function.prototype);var U=Object.getOwnPropertyDescriptor(P,T);if(U===void 0){var G=Object.getPrototypeOf(P);return G===null?void 0:E(G,T,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 E(P,T){for(var N=0;N<T.length;N++){var U=T[N];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(P,U.key,U)}}return function(P,T,N){return T&&E(P.prototype,T),N&&E(P,N),P}}(),s=i(3),f=d(s),h=i(8),x=d(h),w=i(43),v=d(w),O=i(27),g=d(O),b=i(15),p=i(41),y=d(p);function d(E){return E&&E.__esModule?E:{default:E}}function m(E,P){if(!(E instanceof P))throw new TypeError("Cannot call a class as a function")}function _(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 A(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 C=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],R=function(E){A(P,E);function P(T,N){m(this,P),N.modules.toolbar!=null&&N.modules.toolbar.container==null&&(N.modules.toolbar.container=C);var U=_(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,T,N));return U.quill.container.classList.add("ql-snow"),U}return l(P,[{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)})}}]),P}(v.default);R.DEFAULTS=(0,f.default)(!0,{},v.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(P){if(P){var T=this.quill.getSelection();if(T==null||T.length==0)return;var N=this.quill.getText(T);/^\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(E){A(P,E);function P(T,N){m(this,P);var U=_(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,T,N));return U.preview=U.root.querySelector("a.ql-preview"),U}return l(P,[{key:"listen",value:function(){var N=this;a(P.prototype.__proto__||Object.getPrototypeOf(P.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,x.default.sources.USER),delete N.linkRange}U.preventDefault(),N.hide()}),this.quill.on(x.default.events.SELECTION_CHANGE,function(U,G,Z){if(U!=null){if(U.length===0&&Z===x.default.sources.USER){var W=N.quill.scroll.descendant(g.default,U.index),H=o(W,2),L=H[0],M=H[1];if(L!=null){N.linkRange=new b.Range(U.index-M,L.length());var D=g.default.formats(L.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(){a(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),P}(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(""),r.default=R},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(29),a=te(o),l=i(36),s=i(38),f=i(64),h=i(65),x=te(h),w=i(66),v=te(w),O=i(67),g=te(O),b=i(37),p=i(26),y=i(39),d=i(40),m=i(56),_=te(m),A=i(68),C=te(A),R=i(27),S=te(R),E=i(69),P=te(E),T=i(70),N=te(T),U=i(71),G=te(U),Z=i(72),W=te(Z),H=i(73),L=te(H),M=i(13),D=te(M),B=i(74),V=te(B),Y=i(75),F=te(Y),$=i(57),z=te($),K=i(41),X=te(K),Q=i(28),J=te(Q),ne=i(59),ie=te(ne),oe=i(60),de=te(oe),me=i(61),Pe=te(me),re=i(108),ae=te(re),we=i(62),be=te(we);function te(fe){return fe&&fe.__esModule?fe:{default:fe}}a.default.register({"attributors/attribute/direction":s.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":b.BackgroundClass,"attributors/class/color":p.ColorClass,"attributors/class/direction":s.DirectionClass,"attributors/class/font":y.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":b.BackgroundStyle,"attributors/style/color":p.ColorStyle,"attributors/style/direction":s.DirectionStyle,"attributors/style/font":y.FontStyle,"attributors/style/size":d.SizeStyle},!0),a.default.register({"formats/align":l.AlignClass,"formats/direction":s.DirectionClass,"formats/indent":f.IndentClass,"formats/background":b.BackgroundStyle,"formats/color":p.ColorStyle,"formats/font":y.FontClass,"formats/size":d.SizeClass,"formats/blockquote":x.default,"formats/code-block":D.default,"formats/header":v.default,"formats/list":g.default,"formats/bold":_.default,"formats/code":M.Code,"formats/italic":C.default,"formats/link":S.default,"formats/script":P.default,"formats/strike":N.default,"formats/underline":G.default,"formats/image":W.default,"formats/video":L.default,"formats/list/item":O.ListItem,"modules/formula":V.default,"modules/syntax":F.default,"modules/toolbar":z.default,"themes/bubble":ae.default,"themes/snow":be.default,"ui/icons":X.default,"ui/picker":J.default,"ui/icon-picker":de.default,"ui/color-picker":ie.default,"ui/tooltip":Pe.default},!0),r.default=a.default},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.IndentClass=void 0;var o=function(){function g(b,p){for(var y=0;y<p.length;y++){var d=p[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(b,d.key,d)}}return function(b,p,y){return p&&g(b.prototype,p),y&&g(b,y),b}}(),a=function g(b,p,y){b===null&&(b=Function.prototype);var d=Object.getOwnPropertyDescriptor(b,p);if(d===void 0){var m=Object.getPrototypeOf(b);return m===null?void 0:g(m,p,y)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(y)}},l=i(0),s=f(l);function f(g){return g&&g.__esModule?g:{default:g}}function h(g,b){if(!(g instanceof b))throw new TypeError("Cannot call a class as a function")}function x(g,b){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:g}function w(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(g,b):g.__proto__=b)}var v=function(g){w(b,g);function b(){return h(this,b),x(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return o(b,[{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):a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"add",this).call(this,y,d)}},{key:"canAdd",value:function(y,d){return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,y,d)||a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,y,parseInt(d))}},{key:"value",value:function(y){return parseInt(a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,y))||void 0}}]),b}(s.default.Attributor.Class),O=new v("indent","ql-indent",{scope:s.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});r.IndentClass=O},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(4),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}function s(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function f(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function h(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var x=function(w){h(v,w);function v(){return s(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default);x.blotName="blockquote",x.tagName="blockquote",r.default=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function v(O,g){for(var b=0;b<g.length;b++){var p=g[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(O,p.key,p)}}return function(O,g,b){return g&&v(O.prototype,g),b&&v(O,b),O}}(),a=i(4),l=s(a);function s(v){return v&&v.__esModule?v:{default:v}}function f(v,O){if(!(v instanceof O))throw new TypeError("Cannot call a class as a function")}function h(v,O){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:v}function x(v,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);v.prototype=Object.create(O&&O.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(v,O):v.__proto__=O)}var w=function(v){x(O,v);function O(){return f(this,O),h(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return o(O,null,[{key:"formats",value:function(b){return this.tagName.indexOf(b.tagName)+1}}]),O}(l.default);w.blotName="header",w.tagName=["H1","H2","H3","H4","H5","H6"],r.default=w},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.ListItem=void 0;var o=function(){function m(_,A){for(var C=0;C<A.length;C++){var R=A[C];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(_,R.key,R)}}return function(_,A,C){return A&&m(_.prototype,A),C&&m(_,C),_}}(),a=function m(_,A,C){_===null&&(_=Function.prototype);var R=Object.getOwnPropertyDescriptor(_,A);if(R===void 0){var S=Object.getPrototypeOf(_);return S===null?void 0:m(S,A,C)}else{if("value"in R)return R.value;var E=R.get;return E===void 0?void 0:E.call(C)}},l=i(0),s=v(l),f=i(4),h=v(f),x=i(25),w=v(x);function v(m){return m&&m.__esModule?m:{default:m}}function O(m,_,A){return _ in m?Object.defineProperty(m,_,{value:A,enumerable:!0,configurable:!0,writable:!0}):m[_]=A,m}function g(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")}function b(m,_){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:m}function p(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){p(_,m);function _(){return g(this,_),b(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return o(_,[{key:"format",value:function(C,R){C===d.blotName&&!R?this.replaceWith(s.default.create(this.statics.scope)):a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,C,R)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(C,R){return this.parent.isolate(this.offset(this.parent),this.length()),C===this.parent.statics.blotName?(this.parent.replaceWith(C,R),this):(this.parent.unwrap(),a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replaceWith",this).call(this,C,R))}}],[{key:"formats",value:function(C){return C.tagName===this.tagName?void 0:a(_.__proto__||Object.getPrototypeOf(_),"formats",this).call(this,C)}}]),_}(h.default);y.blotName="list-item",y.tagName="LI";var d=function(m){p(_,m),o(_,null,[{key:"create",value:function(C){var R=C==="ordered"?"OL":"UL",S=a(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,R);return(C==="checked"||C==="unchecked")&&S.setAttribute("data-checked",C==="checked"),S}},{key:"formats",value:function(C){if(C.tagName==="OL")return"ordered";if(C.tagName==="UL")return C.hasAttribute("data-checked")?C.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function _(A){g(this,_);var C=b(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,A)),R=function(E){if(E.target.parentNode===A){var P=C.statics.formats(A),T=s.default.find(E.target);P==="checked"?T.format("list","unchecked"):P==="unchecked"&&T.format("list","checked")}};return A.addEventListener("touchstart",R),A.addEventListener("mousedown",R),C}return o(_,[{key:"format",value:function(C,R){this.children.length>0&&this.children.tail.format(C,R)}},{key:"formats",value:function(){return O({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(C,R){if(C instanceof y)a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertBefore",this).call(this,C,R);else{var S=R==null?this.length():R.offset(this),E=this.split(S);E.parent.insertBefore(C,E)}}},{key:"optimize",value:function(C){a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,C);var R=this.next;R!=null&&R.prev===this&&R.statics.blotName===this.statics.blotName&&R.domNode.tagName===this.domNode.tagName&&R.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(R.moveChildren(this),R.remove())}},{key:"replace",value:function(C){if(C.statics.blotName!==this.statics.blotName){var R=s.default.create(this.statics.defaultChild);C.moveChildren(R),this.appendChild(R)}a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replace",this).call(this,C)}}]),_}(w.default);d.blotName="list",d.scope=s.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[y],r.ListItem=y,r.default=d},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(56),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}function s(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function f(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function h(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var x=function(w){h(v,w);function v(){return s(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default);x.blotName="italic",x.tagName=["EM","I"],r.default=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(6),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(){return h(this,g),x(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return o(g,null,[{key:"create",value:function(p){return p==="super"?document.createElement("sup"):p==="sub"?document.createElement("sub"):a(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,p)}},{key:"formats",value:function(p){if(p.tagName==="SUB")return"sub";if(p.tagName==="SUP")return"super"}}]),g}(s.default);v.blotName="script",v.tagName=["SUB","SUP"],r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(6),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}function s(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function f(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function h(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var x=function(w){h(v,w);function v(){return s(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default);x.blotName="strike",x.tagName="S",r.default=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(6),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}function s(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function f(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function h(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var x=function(w){h(v,w);function v(){return s(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default);x.blotName="underline",x.tagName="U",r.default=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(p,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(p,m.key,m)}}return function(p,y,d){return y&&b(p.prototype,y),d&&b(p,d),p}}(),a=function b(p,y,d){p===null&&(p=Function.prototype);var m=Object.getOwnPropertyDescriptor(p,y);if(m===void 0){var _=Object.getPrototypeOf(p);return _===null?void 0:b(_,y,d)}else{if("value"in m)return m.value;var A=m.get;return A===void 0?void 0:A.call(d)}},l=i(0),s=h(l),f=i(27);function h(b){return b&&b.__esModule?b:{default:b}}function x(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function w(b,p){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:b}function v(b,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);b.prototype=Object.create(p&&p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(b,p):b.__proto__=p)}var O=["alt","height","width"],g=function(b){v(p,b);function p(){return x(this,p),w(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return o(p,[{key:"format",value:function(d,m){O.indexOf(d)>-1?m?this.domNode.setAttribute(d,m):this.domNode.removeAttribute(d):a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,d,m)}}],[{key:"create",value:function(d){var m=a(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,d);return typeof d=="string"&&m.setAttribute("src",this.sanitize(d)),m}},{key:"formats",value:function(d){return O.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")}}]),p}(s.default.Embed);g.blotName="image",g.tagName="IMG",r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(p,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(p,m.key,m)}}return function(p,y,d){return y&&b(p.prototype,y),d&&b(p,d),p}}(),a=function b(p,y,d){p===null&&(p=Function.prototype);var m=Object.getOwnPropertyDescriptor(p,y);if(m===void 0){var _=Object.getPrototypeOf(p);return _===null?void 0:b(_,y,d)}else{if("value"in m)return m.value;var A=m.get;return A===void 0?void 0:A.call(d)}},l=i(4),s=i(27),f=h(s);function h(b){return b&&b.__esModule?b:{default:b}}function x(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function w(b,p){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:b}function v(b,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);b.prototype=Object.create(p&&p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(b,p):b.__proto__=p)}var O=["height","width"],g=function(b){v(p,b);function p(){return x(this,p),w(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return o(p,[{key:"format",value:function(d,m){O.indexOf(d)>-1?m?this.domNode.setAttribute(d,m):this.domNode.removeAttribute(d):a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,d,m)}}],[{key:"create",value:function(d){var m=a(p.__proto__||Object.getPrototypeOf(p),"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 O.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")}}]),p}(l.BlockEmbed);g.blotName="video",g.className="ql-video",g.tagName="IFRAME",r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.FormulaBlot=void 0;var o=function(){function d(m,_){for(var A=0;A<_.length;A++){var C=_[A];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(m,C.key,C)}}return function(m,_,A){return _&&d(m.prototype,_),A&&d(m,A),m}}(),a=function d(m,_,A){m===null&&(m=Function.prototype);var C=Object.getOwnPropertyDescriptor(m,_);if(C===void 0){var R=Object.getPrototypeOf(m);return R===null?void 0:d(R,_,A)}else{if("value"in C)return C.value;var S=C.get;return S===void 0?void 0:S.call(A)}},l=i(35),s=v(l),f=i(5),h=v(f),x=i(9),w=v(x);function v(d){return d&&d.__esModule?d:{default:d}}function O(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function g(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 b(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 p=function(d){b(m,d);function m(){return O(this,m),g(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return o(m,null,[{key:"create",value:function(A){var C=a(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,A);return typeof A=="string"&&(window.katex.render(A,C,{throwOnError:!1,errorColor:"#f00"}),C.setAttribute("data-value",A)),C}},{key:"value",value:function(A){return A.getAttribute("data-value")}}]),m}(s.default);p.blotName="formula",p.className="ql-formula",p.tagName="SPAN";var y=function(d){b(m,d),o(m,null,[{key:"register",value:function(){h.default.register(p,!0)}}]);function m(){O(this,m);var _=g(this,(m.__proto__||Object.getPrototypeOf(m)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return _}return m}(w.default);r.FormulaBlot=p,r.default=y},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.CodeToken=r.CodeBlock=void 0;var o=function(){function A(C,R){for(var S=0;S<R.length;S++){var E=R[S];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(C,E.key,E)}}return function(C,R,S){return R&&A(C.prototype,R),S&&A(C,S),C}}(),a=function A(C,R,S){C===null&&(C=Function.prototype);var E=Object.getOwnPropertyDescriptor(C,R);if(E===void 0){var P=Object.getPrototypeOf(C);return P===null?void 0:A(P,R,S)}else{if("value"in E)return E.value;var T=E.get;return T===void 0?void 0:T.call(S)}},l=i(0),s=g(l),f=i(5),h=g(f),x=i(9),w=g(x),v=i(13),O=g(v);function g(A){return A&&A.__esModule?A:{default:A}}function b(A,C){if(!(A instanceof C))throw new TypeError("Cannot call a class as a function")}function p(A,C){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:A}function y(A,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);A.prototype=Object.create(C&&C.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(A,C):A.__proto__=C)}var d=function(A){y(C,A);function C(){return b(this,C),p(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return o(C,[{key:"replaceWith",value:function(S){this.domNode.textContent=this.domNode.textContent,this.attach(),a(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"replaceWith",this).call(this,S)}},{key:"highlight",value:function(S){var E=this.domNode.textContent;this.cachedText!==E&&((E.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=S(E),this.domNode.normalize(),this.attach()),this.cachedText=E)}}]),C}(O.default);d.className="ql-syntax";var m=new s.default.Attributor.Class("token","hljs",{scope:s.default.Scope.INLINE}),_=function(A){y(C,A),o(C,null,[{key:"register",value:function(){h.default.register(m,!0),h.default.register(d,!0)}}]);function C(R,S){b(this,C);var E=p(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,R,S));if(typeof E.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var P=null;return E.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(P),P=setTimeout(function(){E.highlight(),P=null},E.options.interval)}),E.highlight(),E}return o(C,[{key:"highlight",value:function(){var S=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var E=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(P){P.highlight(S.options.highlight)}),this.quill.update(h.default.sources.SILENT),E!=null&&this.quill.setSelection(E,h.default.sources.SILENT)}}}]),C}(w.default);_.DEFAULTS={highlight:function(){return window.hljs==null?null:function(A){var C=window.hljs.highlightAuto(A);return C.value}}(),interval:1e3},r.CodeBlock=d,r.CodeToken=m,r.default=_},function(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r){n.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(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BubbleTooltip=void 0;var o=function C(R,S,E){R===null&&(R=Function.prototype);var P=Object.getOwnPropertyDescriptor(R,S);if(P===void 0){var T=Object.getPrototypeOf(R);return T===null?void 0:C(T,S,E)}else{if("value"in P)return P.value;var N=P.get;return N===void 0?void 0:N.call(E)}},a=function(){function C(R,S){for(var E=0;E<S.length;E++){var P=S[E];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(R,P.key,P)}}return function(R,S,E){return S&&C(R.prototype,S),E&&C(R,E),R}}(),l=i(3),s=b(l),f=i(8),h=b(f),x=i(43),w=b(x),v=i(15),O=i(41),g=b(O);function b(C){return C&&C.__esModule?C:{default:C}}function p(C,R){if(!(C instanceof R))throw new TypeError("Cannot call a class as a function")}function y(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 d(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 m=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],_=function(C){d(R,C);function R(S,E){p(this,R),E.modules.toolbar!=null&&E.modules.toolbar.container==null&&(E.modules.toolbar.container=m);var P=y(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,S,E));return P.quill.container.classList.add("ql-bubble"),P}return a(R,[{key:"extendToolbar",value:function(E){this.tooltip=new A(this.quill,this.options.bounds),this.tooltip.root.appendChild(E.container),this.buildButtons([].slice.call(E.container.querySelectorAll("button")),g.default),this.buildPickers([].slice.call(E.container.querySelectorAll("select")),g.default)}}]),R}(w.default);_.DEFAULTS=(0,s.default)(!0,{},w.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(R){R?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var A=function(C){d(R,C);function R(S,E){p(this,R);var P=y(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,S,E));return P.quill.on(h.default.events.EDITOR_CHANGE,function(T,N,U,G){if(T===h.default.events.SELECTION_CHANGE)if(N!=null&&N.length>0&&G===h.default.sources.USER){P.show(),P.root.style.left="0px",P.root.style.width="",P.root.style.width=P.root.offsetWidth+"px";var Z=P.quill.getLines(N.index,N.length);if(Z.length===1)P.position(P.quill.getBounds(N));else{var W=Z[Z.length-1],H=P.quill.getIndex(W),L=Math.min(W.length()-1,N.index+N.length-H),M=P.quill.getBounds(new v.Range(H,L));P.position(M)}}else document.activeElement!==P.textbox&&P.quill.hasFocus()&&P.hide()}),P}return a(R,[{key:"listen",value:function(){var E=this;o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){E.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!E.root.classList.contains("ql-hidden")){var P=E.quill.getSelection();P!=null&&E.position(E.quill.getBounds(P))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(E){var P=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"position",this).call(this,E),T=this.root.querySelector(".ql-tooltip-arrow");if(T.style.marginLeft="",P===0)return P;T.style.marginLeft=-1*P-T.offsetWidth/2+"px"}}]),R}(x.BaseTooltip);A.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(""),r.BubbleTooltip=A,r.default=_},function(n,r,i){n.exports=i(63)}]).default})})(oS);var TD=oS.exports,g2={},aS={exports:{}},Ka={},Vu={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Vu.exports;var I4;function AD(){return I4||(I4=1,function(t,e){(function(n){var r=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,o=typeof _e=="object"&&_e;(o.global===o||o.window===o||o.self===o)&&(n=o);var a,l=2147483647,s=36,f=1,h=26,x=38,w=700,v=72,O=128,g="-",b=/^xn--/,p=/[^\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=s-f,_=Math.floor,A=String.fromCharCode,C;function R(M){throw new RangeError(d[M])}function S(M,D){for(var B=M.length,V=[];B--;)V[B]=D(M[B]);return V}function E(M,D){var B=M.split("@"),V="";B.length>1&&(V=B[0]+"@",M=B[1]),M=M.replace(y,".");var Y=M.split("."),F=S(Y,D).join(".");return V+F}function P(M){for(var D=[],B=0,V=M.length,Y,F;B<V;)Y=M.charCodeAt(B++),Y>=55296&&Y<=56319&&B<V?(F=M.charCodeAt(B++),(F&64512)==56320?D.push(((Y&1023)<<10)+(F&1023)+65536):(D.push(Y),B--)):D.push(Y);return D}function T(M){return S(M,function(D){var B="";return D>65535&&(D-=65536,B+=A(D>>>10&1023|55296),D=56320|D&1023),B+=A(D),B}).join("")}function N(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:s}function U(M,D){return M+22+75*(M<26)-((D!=0)<<5)}function G(M,D,B){var V=0;for(M=B?_(M/w):M>>1,M+=_(M/D);M>m*h>>1;V+=s)M=_(M/m);return _(V+(m+1)*M/(M+x))}function Z(M){var D=[],B=M.length,V,Y=0,F=O,$=v,z,K,X,Q,J,ne,ie,oe,de;for(z=M.lastIndexOf(g),z<0&&(z=0),K=0;K<z;++K)M.charCodeAt(K)>=128&&R("not-basic"),D.push(M.charCodeAt(K));for(X=z>0?z+1:0;X<B;){for(Q=Y,J=1,ne=s;X>=B&&R("invalid-input"),ie=N(M.charCodeAt(X++)),(ie>=s||ie>_((l-Y)/J))&&R("overflow"),Y+=ie*J,oe=ne<=$?f:ne>=$+h?h:ne-$,!(ie<oe);ne+=s)de=s-oe,J>_(l/de)&&R("overflow"),J*=de;V=D.length+1,$=G(Y-Q,V,Q==0),_(Y/V)>l-F&&R("overflow"),F+=_(Y/V),Y%=V,D.splice(Y++,0,F)}return T(D)}function W(M){var D,B,V,Y,F,$,z,K,X,Q,J,ne=[],ie,oe,de,me;for(M=P(M),ie=M.length,D=O,B=0,F=v,$=0;$<ie;++$)J=M[$],J<128&&ne.push(A(J));for(V=Y=ne.length,Y&&ne.push(g);V<ie;){for(z=l,$=0;$<ie;++$)J=M[$],J>=D&&J<z&&(z=J);for(oe=V+1,z-D>_((l-B)/oe)&&R("overflow"),B+=(z-D)*oe,D=z,$=0;$<ie;++$)if(J=M[$],J<D&&++B>l&&R("overflow"),J==D){for(K=B,X=s;Q=X<=F?f:X>=F+h?h:X-F,!(K<Q);X+=s)me=K-Q,de=s-Q,ne.push(A(U(Q+me%de,0))),K=_(me/de);ne.push(A(U(K,0))),F=G(B,oe,V==Y),B=0,++V}++B,++D}return ne.join("")}function H(M){return E(M,function(D){return b.test(D)?Z(D.slice(4).toLowerCase()):D})}function L(M){return E(M,function(D){return p.test(D)?"xn--"+W(D):D})}if(a={version:"1.4.1",ucs2:{decode:P,encode:T},decode:Z,encode:W,toASCII:L,toUnicode:H},r&&i)if(t.exports==r)i.exports=a;else for(C in a)a.hasOwnProperty(C)&&(r[C]=a[C]);else n.punycode=a})(_e)}(Vu,Vu.exports)),Vu.exports}var og,D4;function RD(){return D4||(D4=1,og=Error),og}var ag,j4;function MD(){return j4||(j4=1,ag=EvalError),ag}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 nf(){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 e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,n);if(a.value!==i||a.enumerable!==!0)return!1}return!0}),dg}var hg,G4;function jD(){if(G4)return hg;G4=1;var t=typeof Symbol<"u"&&Symbol,e=DD();return hg=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},hg}var pg,V4;function FD(){if(V4)return pg;V4=1;var t={__proto__:null,foo:{}},e=Object;return pg=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},pg}var gg,q4;function zD(){if(q4)return gg;q4=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,r="[object Function]",i=function(s,f){for(var h=[],x=0;x<s.length;x+=1)h[x]=s[x];for(var w=0;w<f.length;w+=1)h[w+s.length]=f[w];return h},o=function(s,f){for(var h=[],x=f,w=0;x<s.length;x+=1,w+=1)h[w]=s[x];return h},a=function(l,s){for(var f="",h=0;h<l.length;h+=1)f+=l[h],h+1<l.length&&(f+=s);return f};return gg=function(s){var f=this;if(typeof f!="function"||e.apply(f)!==r)throw new TypeError(t+f);for(var h=o(arguments,1),x,w=function(){if(this instanceof x){var p=f.apply(this,i(h,arguments));return Object(p)===p?p:this}return f.apply(s,i(h,arguments))},v=n(0,f.length-h.length),O=[],g=0;g<v;g++)O[g]="$"+g;if(x=Function("binder","return function ("+a(O,",")+"){ return binder.apply(this,arguments); }")(w),f.prototype){var b=function(){};b.prototype=f.prototype,x.prototype=new b,b.prototype=null}return x},gg}var vg,W4;function v2(){if(W4)return vg;W4=1;var t=zD();return vg=Function.prototype.bind||t,vg}var mg,Y4;function BD(){if(Y4)return mg;Y4=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=v2();return mg=n.call(t,e),mg}var yg,K4;function lu(){if(K4)return yg;K4=1;var t,e=RD(),n=MD(),r=LD(),i=ND(),o=lS(),a=nf(),l=ID(),s=Function,f=function(W){try{return s('"use strict"; return ('+W+").constructor;")()}catch{}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch{h=null}var x=function(){throw new a},w=h?function(){try{return arguments.callee,x}catch{try{return h(arguments,"callee").get}catch{return x}}}():x,v=jD()(),O=FD()(),g=Object.getPrototypeOf||(O?function(W){return W.__proto__}:null),b={},p=typeof Uint8Array>"u"||!g?t:g(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":v&&g?g([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":b,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":v&&g?g(g([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!v||!g?t:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":r,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!v||!g?t:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":v&&g?g(""[Symbol.iterator]()):t,"%Symbol%":v?Symbol:t,"%SyntaxError%":o,"%ThrowTypeError%":w,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(g)try{null.error}catch(W){var d=g(g(W));y["%Error.prototype%"]=d}var m=function W(H){var L;if(H==="%AsyncFunction%")L=f("async function () {}");else if(H==="%GeneratorFunction%")L=f("function* () {}");else if(H==="%AsyncGeneratorFunction%")L=f("async function* () {}");else if(H==="%AsyncGenerator%"){var M=W("%AsyncGeneratorFunction%");M&&(L=M.prototype)}else if(H==="%AsyncIteratorPrototype%"){var D=W("%AsyncGenerator%");D&&g&&(L=g(D.prototype))}return y[H]=L,L},_={__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"]},A=v2(),C=BD(),R=A.call(Function.call,Array.prototype.concat),S=A.call(Function.apply,Array.prototype.splice),E=A.call(Function.call,String.prototype.replace),P=A.call(Function.call,String.prototype.slice),T=A.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,U=/\\(\\)?/g,G=function(H){var L=P(H,0,1),M=P(H,-1);if(L==="%"&&M!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(M==="%"&&L!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var D=[];return E(H,N,function(B,V,Y,F){D[D.length]=Y?E(F,U,"$1"):V||B}),D},Z=function(H,L){var M=H,D;if(C(_,M)&&(D=_[M],M="%"+D[0]+"%"),C(y,M)){var B=y[M];if(B===b&&(B=m(M)),typeof B>"u"&&!L)throw new a("intrinsic "+H+" exists, but is not available. Please file an issue!");return{alias:D,name:M,value:B}}throw new o("intrinsic "+H+" does not exist!")};return yg=function(H,L){if(typeof H!="string"||H.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof L!="boolean")throw new a('"allowMissing" argument must be a boolean');if(T(/^%?[^%]*%?$/,H)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var M=G(H),D=M.length>0?M[0]:"",B=Z("%"+D+"%",L),V=B.name,Y=B.value,F=!1,$=B.alias;$&&(D=$[0],S(M,R([0,1],$)));for(var z=1,K=!0;z<M.length;z+=1){var X=M[z],Q=P(X,0,1),J=P(X,-1);if((Q==='"'||Q==="'"||Q==="`"||J==='"'||J==="'"||J==="`")&&Q!==J)throw new o("property names with quotes must have matching quotes");if((X==="constructor"||!K)&&(F=!0),D+="."+X,V="%"+D+"%",C(y,V))Y=y[V];else if(Y!=null){if(!(X in Y)){if(!L)throw new a("base intrinsic for "+H+" exists, but the property is not available.");return}if(h&&z+1>=M.length){var ne=h(Y,X);K=!!ne,K&&"get"in ne&&!("originalValue"in ne.get)?Y=ne.get:Y=Y[X]}else K=C(Y,X),Y=Y[X];K&&!F&&(y[V]=Y)}}return Y},yg}var bg={exports:{}},_g,X4;function m2(){if(X4)return _g;X4=1;var t=lu(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return _g=e,_g}var wg,Z4;function sS(){if(Z4)return wg;Z4=1;var t=lu(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return wg=e,wg}var Sg,Q4;function UD(){if(Q4)return Sg;Q4=1;var t=m2(),e=lS(),n=nf(),r=sS();return Sg=function(o,a,l){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,x=arguments.length>6?arguments[6]:!1,w=!!r&&r(o,a);if(t)t(o,a,{configurable:h===null&&w?w.configurable:!h,enumerable:s===null&&w?w.enumerable:!s,value:l,writable:f===null&&w?w.writable:!f});else if(x||!s&&!f&&!h)o[a]=l;else throw new e("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 t=m2(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Eg=e,Eg}var Og,e_;function $D(){if(e_)return Og;e_=1;var t=lu(),e=UD(),n=HD()(),r=sS(),i=nf(),o=t("%Math.floor%");return Og=function(l,s){if(typeof l!="function")throw new i("`fn` is not a function");if(typeof s!="number"||s<0||s>4294967295||o(s)!==s)throw new i("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],h=!0,x=!0;if("length"in l&&r){var w=r(l,"length");w&&!w.configurable&&(h=!1),w&&!w.writable&&(x=!1)}return(h||x||!f)&&(n?e(l,"length",s,!0,!0):e(l,"length",s)),l},Og}var t_;function GD(){return t_||(t_=1,function(t){var e=v2(),n=lu(),r=$D(),i=nf(),o=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||e.call(a,o),s=m2(),f=n("%Math.max%");t.exports=function(w){if(typeof w!="function")throw new i("a function is required");var v=l(e,a,arguments);return r(v,1+f(0,w.length-(arguments.length-1)),!0)};var h=function(){return l(e,o,arguments)};s?s(t.exports,"apply",{value:h}):t.exports.apply=h}(bg)),bg.exports}var xg,n_;function VD(){if(n_)return xg;n_=1;var t=lu(),e=GD(),n=e(t("String.prototype.indexOf"));return xg=function(i,o){var a=t(i,!!o);return typeof a=="function"&&n(i,".prototype.")>-1?e(a):a},xg}const qD={},WD=Object.freeze(Object.defineProperty({__proto__:null,default:qD},Symbol.toStringTag,{value:"Module"})),YD=_a(WD);var Pg,r_;function KD(){if(r_)return Pg;r_=1;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=t&&e&&typeof e.get=="function"?e.get:null,r=t&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,a=i&&o&&typeof o.get=="function"?o.get:null,l=i&&Set.prototype.forEach,s=typeof WeakMap=="function"&&WeakMap.prototype,f=s?WeakMap.prototype.has:null,h=typeof WeakSet=="function"&&WeakSet.prototype,x=h?WeakSet.prototype.has:null,w=typeof WeakRef=="function"&&WeakRef.prototype,v=w?WeakRef.prototype.deref:null,O=Boolean.prototype.valueOf,g=Object.prototype.toString,b=Function.prototype.toString,p=String.prototype.match,y=String.prototype.slice,d=String.prototype.replace,m=String.prototype.toUpperCase,_=String.prototype.toLowerCase,A=RegExp.prototype.test,C=Array.prototype.concat,R=Array.prototype.join,S=Array.prototype.slice,E=Math.floor,P=typeof BigInt=="function"?BigInt.prototype.valueOf:null,T=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(ue){return ue.__proto__}:null);function H(ue,ce){if(ue===1/0||ue===-1/0||ue!==ue||ue&&ue>-1e3&&ue<1e3||A.call(/e/,ce))return ce;var Se=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ue=="number"){var Le=ue<0?-E(-ue):E(ue);if(Le!==ue){var Ne=String(Le),ge=y.call(ce,Ne.length+1);return d.call(Ne,Se,"$&_")+"."+d.call(d.call(ge,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(ce,Se,"$&_")}var L=YD,M=L.custom,D=ie(M)?M:null,B={__proto__:null,double:'"',single:"'"},V={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Pg=function ue(ce,Se,Le,Ne){var ge=Se||{};if(me(ge,"quoteStyle")&&!me(B,ge.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(me(ge,"maxStringLength")&&(typeof ge.maxStringLength=="number"?ge.maxStringLength<0&&ge.maxStringLength!==1/0:ge.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Xe=me(ge,"customInspect")?ge.customInspect:!0;if(typeof Xe!="boolean"&&Xe!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(me(ge,"indent")&&ge.indent!==null&&ge.indent!==" "&&!(parseInt(ge.indent,10)===ge.indent&&ge.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(me(ge,"numericSeparator")&&typeof ge.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Oe=ge.numericSeparator;if(typeof ce>"u")return"undefined";if(ce===null)return"null";if(typeof ce=="boolean")return ce?"true":"false";if(typeof ce=="string")return Ve(ce,ge);if(typeof ce=="number"){if(ce===0)return 1/0/ce>0?"0":"-0";var $e=String(ce);return Oe?H(ce,$e):$e}if(typeof ce=="bigint"){var Wt=String(ce)+"n";return Oe?H(ce,Wt):Wt}var Tt=typeof ge.depth>"u"?5:ge.depth;if(typeof Le>"u"&&(Le=0),Le>=Tt&&Tt>0&&typeof ce=="object")return $(ce)?"[Array]":"[Object]";var Yt=We(ge,Le);if(typeof Ne>"u")Ne=[];else if(ae(Ne,ce)>=0)return"[Circular]";function ke(xn,tn,ri){if(tn&&(Ne=S.call(Ne),Ne.push(tn)),ri){var Sr={depth:ge.depth};return me(ge,"quoteStyle")&&(Sr.quoteStyle=ge.quoteStyle),ue(xn,Sr,Le+1,Ne)}return ue(xn,ge,Le+1,Ne)}if(typeof ce=="function"&&!K(ce)){var Ye=re(ce),at=mt(ce,ke);return"[Function"+(Ye?": "+Ye:" (anonymous)")+"]"+(at.length>0?" { "+R.call(at,", ")+" }":"")}if(ie(ce)){var Ot=U?d.call(String(ce),/^(Symbol\(.*\))_[^)]*$/,"$1"):N.call(ce);return typeof ce=="object"&&!U?Ae(Ot):Ot}if(Ee(ce)){for(var xt="<"+_.call(String(ce.nodeName)),un=ce.attributes||[],hn=0;hn<un.length;hn++)xt+=" "+un[hn].name+"="+Y(F(un[hn].value),"double",ge);return xt+=">",ce.childNodes&&ce.childNodes.length&&(xt+="..."),xt+="</"+_.call(String(ce.nodeName))+">",xt}if($(ce)){if(ce.length===0)return"[]";var pn=mt(ce,ke);return Yt&&!ze(pn)?"["+St(pn,Yt)+"]":"[ "+R.call(pn,", ")+" ]"}if(X(ce)){var rr=mt(ce,ke);return!("cause"in Error.prototype)&&"cause"in ce&&!Z.call(ce,"cause")?"{ ["+String(ce)+"] "+R.call(C.call("[cause]: "+ke(ce.cause),rr),", ")+" }":rr.length===0?"["+String(ce)+"]":"{ ["+String(ce)+"] "+R.call(rr,", ")+" }"}if(typeof ce=="object"&&Xe){if(D&&typeof ce[D]=="function"&&L)return L(ce,{depth:Tt-Le});if(Xe!=="symbol"&&typeof ce.inspect=="function")return ce.inspect()}if(we(ce)){var to=[];return r&&r.call(ce,function(xn,tn){to.push(ke(tn,ce,!0)+" => "+ke(xn,ce))}),Me("Map",n.call(ce),to,Yt)}if(fe(ce)){var wr=[];return l&&l.call(ce,function(xn){wr.push(ke(xn,ce))}),Me("Set",a.call(ce),wr,Yt)}if(be(ce))return Ce("WeakMap");if(he(ce))return Ce("WeakSet");if(te(ce))return Ce("WeakRef");if(J(ce))return Ae(ke(Number(ce)));if(oe(ce))return Ae(ke(P.call(ce)));if(ne(ce))return Ae(O.call(ce));if(Q(ce))return Ae(ke(String(ce)));if(typeof window<"u"&&ce===window)return"{ [object Window] }";if(typeof globalThis<"u"&&ce===globalThis||typeof _e<"u"&&ce===_e)return"{ [object globalThis] }";if(!z(ce)&&!K(ce)){var Ie=mt(ce,ke),et=W?W(ce)===Object.prototype:ce instanceof Object||ce.constructor===Object,ft=ce instanceof Object?"":"null prototype",Ft=!et&&G&&Object(ce)===ce&&G in ce?y.call(Pe(ce),8,-1):ft?"Object":"",Pt=et||typeof ce.constructor!="function"?"":ce.constructor.name?ce.constructor.name+" ":"",Bn=Pt+(Ft||ft?"["+R.call(C.call([],Ft||[],ft||[]),": ")+"] ":"");return Ie.length===0?Bn+"{}":Yt?Bn+"{"+St(Ie,Yt)+"}":Bn+"{ "+R.call(Ie,", ")+" }"}return String(ce)};function Y(ue,ce,Se){var Le=Se.quoteStyle||ce,Ne=B[Le];return Ne+ue+Ne}function F(ue){return d.call(String(ue),/"/g,"&quot;")}function $(ue){return Pe(ue)==="[object Array]"&&(!G||!(typeof ue=="object"&&G in ue))}function z(ue){return Pe(ue)==="[object Date]"&&(!G||!(typeof ue=="object"&&G in ue))}function K(ue){return Pe(ue)==="[object RegExp]"&&(!G||!(typeof ue=="object"&&G in ue))}function X(ue){return Pe(ue)==="[object Error]"&&(!G||!(typeof ue=="object"&&G in ue))}function Q(ue){return Pe(ue)==="[object String]"&&(!G||!(typeof ue=="object"&&G in ue))}function J(ue){return Pe(ue)==="[object Number]"&&(!G||!(typeof ue=="object"&&G in ue))}function ne(ue){return Pe(ue)==="[object Boolean]"&&(!G||!(typeof ue=="object"&&G in ue))}function ie(ue){if(U)return ue&&typeof ue=="object"&&ue instanceof Symbol;if(typeof ue=="symbol")return!0;if(!ue||typeof ue!="object"||!N)return!1;try{return N.call(ue),!0}catch{}return!1}function oe(ue){if(!ue||typeof ue!="object"||!P)return!1;try{return P.call(ue),!0}catch{}return!1}var de=Object.prototype.hasOwnProperty||function(ue){return ue in this};function me(ue,ce){return de.call(ue,ce)}function Pe(ue){return g.call(ue)}function re(ue){if(ue.name)return ue.name;var ce=p.call(b.call(ue),/^function\s*([\w$]+)/);return ce?ce[1]:null}function ae(ue,ce){if(ue.indexOf)return ue.indexOf(ce);for(var Se=0,Le=ue.length;Se<Le;Se++)if(ue[Se]===ce)return Se;return-1}function we(ue){if(!n||!ue||typeof ue!="object")return!1;try{n.call(ue);try{a.call(ue)}catch{return!0}return ue instanceof Map}catch{}return!1}function be(ue){if(!f||!ue||typeof ue!="object")return!1;try{f.call(ue,f);try{x.call(ue,x)}catch{return!0}return ue instanceof WeakMap}catch{}return!1}function te(ue){if(!v||!ue||typeof ue!="object")return!1;try{return v.call(ue),!0}catch{}return!1}function fe(ue){if(!a||!ue||typeof ue!="object")return!1;try{a.call(ue);try{n.call(ue)}catch{return!0}return ue instanceof Set}catch{}return!1}function he(ue){if(!x||!ue||typeof ue!="object")return!1;try{x.call(ue,x);try{f.call(ue,f)}catch{return!0}return ue instanceof WeakSet}catch{}return!1}function Ee(ue){return!ue||typeof ue!="object"?!1:typeof HTMLElement<"u"&&ue instanceof HTMLElement?!0:typeof ue.nodeName=="string"&&typeof ue.getAttribute=="function"}function Ve(ue,ce){if(ue.length>ce.maxStringLength){var Se=ue.length-ce.maxStringLength,Le="... "+Se+" more character"+(Se>1?"s":"");return Ve(y.call(ue,0,ce.maxStringLength),ce)+Le}var Ne=V[ce.quoteStyle||"single"];Ne.lastIndex=0;var ge=d.call(d.call(ue,Ne,"\\$1"),/[\x00-\x1f]/g,Je);return Y(ge,"single",ce)}function Je(ue){var ce=ue.charCodeAt(0),Se={8:"b",9:"t",10:"n",12:"f",13:"r"}[ce];return Se?"\\"+Se:"\\x"+(ce<16?"0":"")+m.call(ce.toString(16))}function Ae(ue){return"Object("+ue+")"}function Ce(ue){return ue+" { ? }"}function Me(ue,ce,Se,Le){var Ne=Le?St(Se,Le):R.call(Se,", ");return ue+" ("+ce+") {"+Ne+"}"}function ze(ue){for(var ce=0;ce<ue.length;ce++)if(ae(ue[ce],`
149
- `)>=0)return!1;return!0}function We(ue,ce){var Se;if(ue.indent===" ")Se=" ";else if(typeof ue.indent=="number"&&ue.indent>0)Se=R.call(Array(ue.indent+1)," ");else return null;return{base:Se,prev:R.call(Array(ce+1),Se)}}function St(ue,ce){if(ue.length===0)return"";var Se=`
150
- `+ce.prev+ce.base;return Se+R.call(ue,","+Se)+`
151
- `+ce.prev}function mt(ue,ce){var Se=$(ue),Le=[];if(Se){Le.length=ue.length;for(var Ne=0;Ne<ue.length;Ne++)Le[Ne]=me(ue,Ne)?ce(ue[Ne],ue):""}var ge=typeof T=="function"?T(ue):[],Xe;if(U){Xe={};for(var Oe=0;Oe<ge.length;Oe++)Xe["$"+ge[Oe]]=ge[Oe]}for(var $e in ue)me(ue,$e)&&(Se&&String(Number($e))===$e&&$e<ue.length||U&&Xe["$"+$e]instanceof Symbol||(A.call(/[^\w$]/,$e)?Le.push(ce($e,ue)+": "+ce(ue[$e],ue)):Le.push($e+": "+ce(ue[$e],ue))));if(typeof T=="function")for(var Wt=0;Wt<ge.length;Wt++)Z.call(ue,ge[Wt])&&Le.push("["+ce(ge[Wt])+"]: "+ce(ue[ge[Wt]],ue));return Le}return Pg}var Cg,i_;function XD(){if(i_)return Cg;i_=1;var t=lu(),e=VD(),n=KD(),r=nf(),i=t("%WeakMap%",!0),o=t("%Map%",!0),a=e("WeakMap.prototype.get",!0),l=e("WeakMap.prototype.set",!0),s=e("WeakMap.prototype.has",!0),f=e("Map.prototype.get",!0),h=e("Map.prototype.set",!0),x=e("Map.prototype.has",!0),w=function(b,p){for(var y=b,d;(d=y.next)!==null;y=d)if(d.key===p)return y.next=d.next,d.next=b.next,b.next=d,d},v=function(b,p){var y=w(b,p);return y&&y.value},O=function(b,p,y){var d=w(b,p);d?d.value=y:b.next={key:p,next:b.next,value:y}},g=function(b,p){return!!w(b,p)};return Cg=function(){var p,y,d,m={assert:function(_){if(!m.has(_))throw new r("Side channel does not contain "+n(_))},get:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(p)return a(p,_)}else if(o){if(y)return f(y,_)}else if(d)return v(d,_)},has:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(p)return s(p,_)}else if(o){if(y)return x(y,_)}else if(d)return g(d,_);return!1},set:function(_,A){i&&_&&(typeof _=="object"||typeof _=="function")?(p||(p=new i),l(p,_,A)):o?(y||(y=new o),h(y,_,A)):(d||(d={key:{},next:null}),O(d,_,A))}};return m},Cg}var kg,o_;function y2(){if(o_)return kg;o_=1;var t=String.prototype.replace,e=/%20/g,n={RFC1738:"RFC1738",RFC3986:"RFC3986"};return kg={default:n.RFC3986,formatters:{RFC1738:function(r){return t.call(r,e,"+")},RFC3986:function(r){return String(r)}},RFC1738:n.RFC1738,RFC3986:n.RFC3986},kg}var Tg,a_;function uS(){if(a_)return Tg;a_=1;var t=y2(),e=Object.prototype.hasOwnProperty,n=Array.isArray,r=function(){for(var b=[],p=0;p<256;++p)b.push("%"+((p<16?"0":"")+p.toString(16)).toUpperCase());return b}(),i=function(p){for(;p.length>1;){var y=p.pop(),d=y.obj[y.prop];if(n(d)){for(var m=[],_=0;_<d.length;++_)typeof d[_]<"u"&&m.push(d[_]);y.obj[y.prop]=m}}},o=function(p,y){for(var d=y&&y.plainObjects?Object.create(null):{},m=0;m<p.length;++m)typeof p[m]<"u"&&(d[m]=p[m]);return d},a=function b(p,y,d){if(!y)return p;if(typeof y!="object"){if(n(p))p.push(y);else if(p&&typeof p=="object")(d&&(d.plainObjects||d.allowPrototypes)||!e.call(Object.prototype,y))&&(p[y]=!0);else return[p,y];return p}if(!p||typeof p!="object")return[p].concat(y);var m=p;return n(p)&&!n(y)&&(m=o(p,d)),n(p)&&n(y)?(y.forEach(function(_,A){if(e.call(p,A)){var C=p[A];C&&typeof C=="object"&&_&&typeof _=="object"?p[A]=b(C,_,d):p.push(_)}else p[A]=_}),p):Object.keys(y).reduce(function(_,A){var C=y[A];return e.call(_,A)?_[A]=b(_[A],C,d):_[A]=C,_},m)},l=function(p,y){return Object.keys(y).reduce(function(d,m){return d[m]=y[m],d},p)},s=function(b,p,y){var d=b.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(p,y,d,m,_){if(p.length===0)return p;var A=p;if(typeof p=="symbol"?A=Symbol.prototype.toString.call(p):typeof p!="string"&&(A=String(p)),d==="iso-8859-1")return escape(A).replace(/%u[0-9a-f]{4}/gi,function(N){return"%26%23"+parseInt(N.slice(2),16)+"%3B"});for(var C="",R=0;R<A.length;R+=f){for(var S=A.length>=f?A.slice(R,R+f):A,E=[],P=0;P<S.length;++P){var T=S.charCodeAt(P);if(T===45||T===46||T===95||T===126||T>=48&&T<=57||T>=65&&T<=90||T>=97&&T<=122||_===t.RFC1738&&(T===40||T===41)){E[E.length]=S.charAt(P);continue}if(T<128){E[E.length]=r[T];continue}if(T<2048){E[E.length]=r[192|T>>6]+r[128|T&63];continue}if(T<55296||T>=57344){E[E.length]=r[224|T>>12]+r[128|T>>6&63]+r[128|T&63];continue}P+=1,T=65536+((T&1023)<<10|S.charCodeAt(P)&1023),E[E.length]=r[240|T>>18]+r[128|T>>12&63]+r[128|T>>6&63]+r[128|T&63]}C+=E.join("")}return C},x=function(p){for(var y=[{obj:{o:p},prop:"o"}],d=[],m=0;m<y.length;++m)for(var _=y[m],A=_.obj[_.prop],C=Object.keys(A),R=0;R<C.length;++R){var S=C[R],E=A[S];typeof E=="object"&&E!==null&&d.indexOf(E)===-1&&(y.push({obj:A,prop:S}),d.push(E))}return i(y),p},w=function(p){return Object.prototype.toString.call(p)==="[object RegExp]"},v=function(p){return!p||typeof p!="object"?!1:!!(p.constructor&&p.constructor.isBuffer&&p.constructor.isBuffer(p))},O=function(p,y){return[].concat(p,y)},g=function(p,y){if(n(p)){for(var d=[],m=0;m<p.length;m+=1)d.push(y(p[m]));return d}return y(p)};return Tg={arrayToObject:o,assign:l,combine:O,compact:x,decode:s,encode:h,isBuffer:v,isRegExp:w,maybeMap:g,merge:a},Tg}var Ag,l_;function ZD(){if(l_)return Ag;l_=1;var t=XD(),e=uS(),n=y2(),r=Object.prototype.hasOwnProperty,i={brackets:function(b){return b+"[]"},comma:"comma",indices:function(b,p){return b+"["+p+"]"},repeat:function(b){return b}},o=Array.isArray,a=Array.prototype.push,l=function(g,b){a.apply(g,o(b)?b:[b])},s=Date.prototype.toISOString,f=n.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:f,formatter:n.formatters[f],indices:!1,serializeDate:function(b){return s.call(b)},skipNulls:!1,strictNullHandling:!1},x=function(b){return typeof b=="string"||typeof b=="number"||typeof b=="boolean"||typeof b=="symbol"||typeof b=="bigint"},w={},v=function g(b,p,y,d,m,_,A,C,R,S,E,P,T,N,U,G,Z,W){for(var H=b,L=W,M=0,D=!1;(L=L.get(w))!==void 0&&!D;){var B=L.get(b);if(M+=1,typeof B<"u"){if(B===M)throw new RangeError("Cyclic object value");D=!0}typeof L.get(w)>"u"&&(M=0)}if(typeof S=="function"?H=S(p,H):H instanceof Date?H=T(H):y==="comma"&&o(H)&&(H=e.maybeMap(H,function(de){return de instanceof Date?T(de):de})),H===null){if(_)return R&&!G?R(p,h.encoder,Z,"key",N):p;H=""}if(x(H)||e.isBuffer(H)){if(R){var V=G?p:R(p,h.encoder,Z,"key",N);return[U(V)+"="+U(R(H,h.encoder,Z,"value",N))]}return[U(p)+"="+U(String(H))]}var Y=[];if(typeof H>"u")return Y;var F;if(y==="comma"&&o(H))G&&R&&(H=e.maybeMap(H,R)),F=[{value:H.length>0?H.join(",")||null:void 0}];else if(o(S))F=S;else{var $=Object.keys(H);F=E?$.sort(E):$}var z=C?p.replace(/\./g,"%2E"):p,K=d&&o(H)&&H.length===1?z+"[]":z;if(m&&o(H)&&H.length===0)return K+"[]";for(var X=0;X<F.length;++X){var Q=F[X],J=typeof Q=="object"&&typeof Q.value<"u"?Q.value:H[Q];if(!(A&&J===null)){var ne=P&&C?Q.replace(/\./g,"%2E"):Q,ie=o(H)?typeof y=="function"?y(K,ne):K:K+(P?"."+ne:"["+ne+"]");W.set(b,M);var oe=t();oe.set(w,W),l(Y,g(J,ie,y,d,m,_,A,C,y==="comma"&&G&&o(H)?null:R,S,E,P,T,N,U,G,Z,oe))}}return Y},O=function(b){if(!b)return h;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.encodeDotInKeys<"u"&&typeof b.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(b.encoder!==null&&typeof b.encoder<"u"&&typeof b.encoder!="function")throw new TypeError("Encoder has to be a function.");var p=b.charset||h.charset;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 y=n.default;if(typeof b.format<"u"){if(!r.call(n.formatters,b.format))throw new TypeError("Unknown format option provided.");y=b.format}var d=n.formatters[y],m=h.filter;(typeof b.filter=="function"||o(b.filter))&&(m=b.filter);var _;if(b.arrayFormat in i?_=b.arrayFormat:"indices"in b?_=b.indices?"indices":"repeat":_=h.arrayFormat,"commaRoundTrip"in b&&typeof b.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var A=typeof b.allowDots>"u"?b.encodeDotInKeys===!0?!0:h.allowDots:!!b.allowDots;return{addQueryPrefix:typeof b.addQueryPrefix=="boolean"?b.addQueryPrefix:h.addQueryPrefix,allowDots:A,allowEmptyArrays:typeof b.allowEmptyArrays=="boolean"?!!b.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:_,charset:p,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:h.charsetSentinel,commaRoundTrip:b.commaRoundTrip,delimiter:typeof b.delimiter>"u"?h.delimiter:b.delimiter,encode:typeof b.encode=="boolean"?b.encode:h.encode,encodeDotInKeys:typeof b.encodeDotInKeys=="boolean"?b.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof b.encoder=="function"?b.encoder:h.encoder,encodeValuesOnly:typeof b.encodeValuesOnly=="boolean"?b.encodeValuesOnly:h.encodeValuesOnly,filter:m,format:y,formatter:d,serializeDate:typeof b.serializeDate=="function"?b.serializeDate:h.serializeDate,skipNulls:typeof b.skipNulls=="boolean"?b.skipNulls:h.skipNulls,sort:typeof b.sort=="function"?b.sort:null,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:h.strictNullHandling}};return Ag=function(g,b){var p=g,y=O(b),d,m;typeof y.filter=="function"?(m=y.filter,p=m("",p)):o(y.filter)&&(m=y.filter,d=m);var _=[];if(typeof p!="object"||p===null)return"";var A=i[y.arrayFormat],C=A==="comma"&&y.commaRoundTrip;d||(d=Object.keys(p)),y.sort&&d.sort(y.sort);for(var R=t(),S=0;S<d.length;++S){var E=d[S];y.skipNulls&&p[E]===null||l(_,v(p[E],E,A,C,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,R))}var P=_.join(y.delimiter),T=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?T+="utf8=%26%2310003%3B&":T+="utf8=%E2%9C%93&"),P.length>0?T+P:""},Ag}var Rg,s_;function QD(){if(s_)return Rg;s_=1;var t=uS(),e=Object.prototype.hasOwnProperty,n=Array.isArray,r={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:t.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(w){return w.replace(/&#(\d+);/g,function(v,O){return String.fromCharCode(parseInt(O,10))})},o=function(w,v){return w&&typeof w=="string"&&v.comma&&w.indexOf(",")>-1?w.split(","):w},a="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",s=function(v,O){var g={__proto__:null},b=O.ignoreQueryPrefix?v.replace(/^\?/,""):v;b=b.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var p=O.parameterLimit===1/0?void 0:O.parameterLimit,y=b.split(O.delimiter,p),d=-1,m,_=O.charset;if(O.charsetSentinel)for(m=0;m<y.length;++m)y[m].indexOf("utf8=")===0&&(y[m]===l?_="utf-8":y[m]===a&&(_="iso-8859-1"),d=m,m=y.length);for(m=0;m<y.length;++m)if(m!==d){var A=y[m],C=A.indexOf("]="),R=C===-1?A.indexOf("="):C+1,S,E;R===-1?(S=O.decoder(A,r.decoder,_,"key"),E=O.strictNullHandling?null:""):(S=O.decoder(A.slice(0,R),r.decoder,_,"key"),E=t.maybeMap(o(A.slice(R+1),O),function(T){return O.decoder(T,r.decoder,_,"value")})),E&&O.interpretNumericEntities&&_==="iso-8859-1"&&(E=i(E)),A.indexOf("[]=")>-1&&(E=n(E)?[E]:E);var P=e.call(g,S);P&&O.duplicates==="combine"?g[S]=t.combine(g[S],E):(!P||O.duplicates==="last")&&(g[S]=E)}return g},f=function(w,v,O,g){for(var b=g?v:o(v,O),p=w.length-1;p>=0;--p){var y,d=w[p];if(d==="[]"&&O.parseArrays)y=O.allowEmptyArrays&&(b===""||O.strictNullHandling&&b===null)?[]:[].concat(b);else{y=O.plainObjects?Object.create(null):{};var m=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,_=O.decodeDotInKeys?m.replace(/%2E/g,"."):m,A=parseInt(_,10);!O.parseArrays&&_===""?y={0:b}:!isNaN(A)&&d!==_&&String(A)===_&&A>=0&&O.parseArrays&&A<=O.arrayLimit?(y=[],y[A]=b):_!=="__proto__"&&(y[_]=b)}b=y}return b},h=function(v,O,g,b){if(v){var p=g.allowDots?v.replace(/\.([^.[]+)/g,"[$1]"):v,y=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,m=g.depth>0&&y.exec(p),_=m?p.slice(0,m.index):p,A=[];if(_){if(!g.plainObjects&&e.call(Object.prototype,_)&&!g.allowPrototypes)return;A.push(_)}for(var C=0;g.depth>0&&(m=d.exec(p))!==null&&C<g.depth;){if(C+=1,!g.plainObjects&&e.call(Object.prototype,m[1].slice(1,-1))&&!g.allowPrototypes)return;A.push(m[1])}if(m){if(g.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+g.depth+" and strictDepth is true");A.push("["+p.slice(m.index)+"]")}return f(A,O,g,b)}},x=function(v){if(!v)return r;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.decodeDotInKeys<"u"&&typeof v.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(v.decoder!==null&&typeof v.decoder<"u"&&typeof v.decoder!="function")throw new TypeError("Decoder has to be a function.");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 O=typeof v.charset>"u"?r.charset:v.charset,g=typeof v.duplicates>"u"?r.duplicates:v.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var b=typeof v.allowDots>"u"?v.decodeDotInKeys===!0?!0:r.allowDots:!!v.allowDots;return{allowDots:b,allowEmptyArrays:typeof v.allowEmptyArrays=="boolean"?!!v.allowEmptyArrays:r.allowEmptyArrays,allowPrototypes:typeof v.allowPrototypes=="boolean"?v.allowPrototypes:r.allowPrototypes,allowSparse:typeof v.allowSparse=="boolean"?v.allowSparse:r.allowSparse,arrayLimit:typeof v.arrayLimit=="number"?v.arrayLimit:r.arrayLimit,charset:O,charsetSentinel:typeof v.charsetSentinel=="boolean"?v.charsetSentinel:r.charsetSentinel,comma:typeof v.comma=="boolean"?v.comma:r.comma,decodeDotInKeys:typeof v.decodeDotInKeys=="boolean"?v.decodeDotInKeys:r.decodeDotInKeys,decoder:typeof v.decoder=="function"?v.decoder:r.decoder,delimiter:typeof v.delimiter=="string"||t.isRegExp(v.delimiter)?v.delimiter:r.delimiter,depth:typeof v.depth=="number"||v.depth===!1?+v.depth:r.depth,duplicates:g,ignoreQueryPrefix:v.ignoreQueryPrefix===!0,interpretNumericEntities:typeof v.interpretNumericEntities=="boolean"?v.interpretNumericEntities:r.interpretNumericEntities,parameterLimit:typeof v.parameterLimit=="number"?v.parameterLimit:r.parameterLimit,parseArrays:v.parseArrays!==!1,plainObjects:typeof v.plainObjects=="boolean"?v.plainObjects:r.plainObjects,strictDepth:typeof v.strictDepth=="boolean"?!!v.strictDepth:r.strictDepth,strictNullHandling:typeof v.strictNullHandling=="boolean"?v.strictNullHandling:r.strictNullHandling}};return Rg=function(w,v){var O=x(v);if(w===""||w===null||typeof w>"u")return O.plainObjects?Object.create(null):{};for(var g=typeof w=="string"?s(w,O):w,b=O.plainObjects?Object.create(null):{},p=Object.keys(g),y=0;y<p.length;++y){var d=p[y],m=h(d,g[d],O,typeof w=="string");b=t.merge(b,m,O)}return O.allowSparse===!0?b:t.compact(b)},Rg}var Mg,u_;function JD(){if(u_)return Mg;u_=1;var t=ZD(),e=QD(),n=y2();return Mg={formats:n,parse:e,stringify:t},Mg}var c_;function cS(){if(c_)return Ka;c_=1;var t=AD();function e(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var n=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=["<",">",'"',"`"," ","\r",`
152
- `," "],a=["{","}","|","\\","^","`"].concat(o),l=["'"].concat(a),s=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=255,x=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},O={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=JD();function p(_,A,C){if(_&&typeof _=="object"&&_ instanceof e)return _;var R=new e;return R.parse(_,A,C),R}e.prototype.parse=function(_,A,C){if(typeof _!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof _);var R=_.indexOf("?"),S=R!==-1&&R<_.indexOf("#")?"?":"#",E=_.split(S),P=/\\/g;E[0]=E[0].replace(P,"/"),_=E.join(S);var T=_;if(T=T.trim(),!C&&_.split("#").length===1){var N=i.exec(T);if(N)return this.path=T,this.href=T,this.pathname=N[1],N[2]?(this.search=N[2],A?this.query=b.parse(this.search.substr(1)):this.query=this.search.substr(1)):A&&(this.search="",this.query={}),this}var U=n.exec(T);if(U){U=U[0];var G=U.toLowerCase();this.protocol=G,T=T.substr(U.length)}if(C||U||T.match(/^\/\/[^@/]+@[^@/]+/)){var Z=T.substr(0,2)==="//";Z&&!(U&&O[U])&&(T=T.substr(2),this.slashes=!0)}if(!O[U]&&(Z||U&&!g[U])){for(var W=-1,H=0;H<f.length;H++){var L=T.indexOf(f[H]);L!==-1&&(W===-1||L<W)&&(W=L)}var M,D;W===-1?D=T.lastIndexOf("@"):D=T.lastIndexOf("@",W),D!==-1&&(M=T.slice(0,D),T=T.slice(D+1),this.auth=decodeURIComponent(M)),W=-1;for(var H=0;H<s.length;H++){var L=T.indexOf(s[H]);L!==-1&&(W===-1||L<W)&&(W=L)}W===-1&&(W=T.length),this.host=T.slice(0,W),T=T.slice(W),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var V=this.hostname.split(/\./),H=0,Y=V.length;H<Y;H++){var F=V[H];if(F&&!F.match(x)){for(var $="",z=0,K=F.length;z<K;z++)F.charCodeAt(z)>127?$+="x":$+=F[z];if(!$.match(x)){var X=V.slice(0,H),Q=V.slice(H+1),J=F.match(w);J&&(X.push(J[1]),Q.unshift(J[2])),Q.length&&(T="/"+Q.join(".")+T),this.hostname=X.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=t.toASCII(this.hostname));var ne=this.port?":"+this.port:"",ie=this.hostname||"";this.host=ie+ne,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),T[0]!=="/"&&(T="/"+T))}if(!v[G])for(var H=0,Y=l.length;H<Y;H++){var oe=l[H];if(T.indexOf(oe)!==-1){var de=encodeURIComponent(oe);de===oe&&(de=escape(oe)),T=T.split(oe).join(de)}}var me=T.indexOf("#");me!==-1&&(this.hash=T.substr(me),T=T.slice(0,me));var Pe=T.indexOf("?");if(Pe!==-1?(this.search=T.substr(Pe),this.query=T.substr(Pe+1),A&&(this.query=b.parse(this.query)),T=T.slice(0,Pe)):A&&(this.search="",this.query={}),T&&(this.pathname=T),g[G]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ne=this.pathname||"",re=this.search||"";this.path=ne+re}return this.href=this.format(),this};function y(_){return typeof _=="string"&&(_=p(_)),_ instanceof e?_.format():e.prototype.format.call(_)}e.prototype.format=function(){var _=this.auth||"";_&&(_=encodeURIComponent(_),_=_.replace(/%3A/i,":"),_+="@");var A=this.protocol||"",C=this.pathname||"",R=this.hash||"",S=!1,E="";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&&(E=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var P=this.search||E&&"?"+E||"";return A&&A.substr(-1)!==":"&&(A+=":"),this.slashes||(!A||g[A])&&S!==!1?(S="//"+(S||""),C&&C.charAt(0)!=="/"&&(C="/"+C)):S||(S=""),R&&R.charAt(0)!=="#"&&(R="#"+R),P&&P.charAt(0)!=="?"&&(P="?"+P),C=C.replace(/[?#]/g,function(T){return encodeURIComponent(T)}),P=P.replace("#","%23"),A+S+C+P+R};function d(_,A){return p(_,!1,!0).resolve(A)}e.prototype.resolve=function(_){return this.resolveObject(p(_,!1,!0)).format()};function m(_,A){return _?p(_,!1,!0).resolveObject(A):A}return e.prototype.resolveObject=function(_){if(typeof _=="string"){var A=new e;A.parse(_,!1,!0),_=A}for(var C=new e,R=Object.keys(this),S=0;S<R.length;S++){var E=R[S];C[E]=this[E]}if(C.hash=_.hash,_.href==="")return C.href=C.format(),C;if(_.slashes&&!_.protocol){for(var P=Object.keys(_),T=0;T<P.length;T++){var N=P[T];N!=="protocol"&&(C[N]=_[N])}return g[C.protocol]&&C.hostname&&!C.pathname&&(C.pathname="/",C.path=C.pathname),C.href=C.format(),C}if(_.protocol&&_.protocol!==C.protocol){if(!g[_.protocol]){for(var U=Object.keys(_),G=0;G<U.length;G++){var Z=U[G];C[Z]=_[Z]}return C.href=C.format(),C}if(C.protocol=_.protocol,!_.host&&!O[_.protocol]){for(var Y=(_.pathname||"").split("/");Y.length&&!(_.host=Y.shift()););_.host||(_.host=""),_.hostname||(_.hostname=""),Y[0]!==""&&Y.unshift(""),Y.length<2&&Y.unshift(""),C.pathname=Y.join("/")}else C.pathname=_.pathname;if(C.search=_.search,C.query=_.query,C.host=_.host||"",C.auth=_.auth,C.hostname=_.hostname||_.host,C.port=_.port,C.pathname||C.search){var W=C.pathname||"",H=C.search||"";C.path=W+H}return C.slashes=C.slashes||_.slashes,C.href=C.format(),C}var L=C.pathname&&C.pathname.charAt(0)==="/",M=_.host||_.pathname&&_.pathname.charAt(0)==="/",D=M||L||C.host&&_.pathname,B=D,V=C.pathname&&C.pathname.split("/")||[],Y=_.pathname&&_.pathname.split("/")||[],F=C.protocol&&!g[C.protocol];if(F&&(C.hostname="",C.port=null,C.host&&(V[0]===""?V[0]=C.host:V.unshift(C.host)),C.host="",_.protocol&&(_.hostname=null,_.port=null,_.host&&(Y[0]===""?Y[0]=_.host:Y.unshift(_.host)),_.host=null),D=D&&(Y[0]===""||V[0]==="")),M)C.host=_.host||_.host===""?_.host:C.host,C.hostname=_.hostname||_.hostname===""?_.hostname:C.hostname,C.search=_.search,C.query=_.query,V=Y;else if(Y.length)V||(V=[]),V.pop(),V=V.concat(Y),C.search=_.search,C.query=_.query;else if(_.search!=null){if(F){C.host=V.shift(),C.hostname=C.host;var $=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;$&&(C.auth=$.shift(),C.hostname=$.shift(),C.host=C.hostname)}return C.search=_.search,C.query=_.query,(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.href=C.format(),C}if(!V.length)return C.pathname=null,C.search?C.path="/"+C.search:C.path=null,C.href=C.format(),C;for(var z=V.slice(-1)[0],K=(C.host||_.host||V.length>1)&&(z==="."||z==="..")||z==="",X=0,Q=V.length;Q>=0;Q--)z=V[Q],z==="."?V.splice(Q,1):z===".."?(V.splice(Q,1),X++):X&&(V.splice(Q,1),X--);if(!D&&!B)for(;X--;X)V.unshift("..");D&&V[0]!==""&&(!V[0]||V[0].charAt(0)!=="/")&&V.unshift(""),K&&V.join("/").substr(-1)!=="/"&&V.push("");var J=V[0]===""||V[0]&&V[0].charAt(0)==="/";if(F){C.hostname=J?"":V.length?V.shift():"",C.host=C.hostname;var $=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;$&&(C.auth=$.shift(),C.hostname=$.shift(),C.host=C.hostname)}return D=D||C.host&&V.length,D&&!J&&V.unshift(""),V.length>0?C.pathname=V.join("/"):(C.pathname=null,C.path=null),(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.auth=_.auth||C.auth,C.slashes=C.slashes||_.slashes,C.href=C.format(),C},e.prototype.parseHost=function(){var _=this.host,A=r.exec(_);A&&(A=A[0],A!==":"&&(this.port=A.substr(1)),_=_.substr(0,_.length-A.length)),_&&(this.hostname=_)},Ka.parse=p,Ka.resolve=d,Ka.resolveObject=m,Ka.format=y,Ka.Url=e,Ka}var Lg={exports:{}},f_;function ej(){return f_||(f_=1,function(t){(function(e,n){t.exports?t.exports=n():e.xmlserializer=n()})(_e,function(){var e=function(v){return v.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},n=function(v){return v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},r=function(v){return v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},i=function(v){var O=v.value;return" "+v.name+'="'+n(O)+'"'},o=function(v){var O=v.tagName;return v.namespaceURI==="http://www.w3.org/1999/xhtml"&&(O=O.toLowerCase()),O},a=function(v,O){var g=Array.prototype.map.call(v.attributes||v.attrs,function(b){return b.name}).indexOf("xmlns")>=0;return!g&&(O||v.namespaceURI!==v.parentNode.namespaceURI)?' xmlns="'+v.namespaceURI+'"':""},l=function(v){return Array.prototype.map.call(v.childNodes,function(O){return w(O)}).join("")},s=function(v,O){var g="<"+o(v);return g+=a(v,O),Array.prototype.forEach.call(v.attributes||v.attrs,function(b){g+=i(b)}),v.childNodes.length>0?(g+=">",g+=l(v),g+="</"+o(v)+">"):g+="/>",g},f=function(v){var O=v.nodeValue||v.value||"";return r(O)},h=function(v){return"<!--"+v.data.replace(/-/g,"&#45;")+"-->"},x=function(v){return"<![CDATA["+v.nodeValue+"]]>"},w=function(v,O){var g=O&&O.rootNode;if(v.nodeName==="#document"||v.nodeName==="#document-fragment")return l(v);if(v.tagName)return s(v,g);if(v.nodeName==="#text")return f(v);if(v.nodeName==="#comment")return h(v);if(v.nodeName==="#cdata-section")return x(v)};return{serializeToString:function(v){return e(w(v,{rootNode:!0}))}}})}(Lg)),Lg.exports}var Ng={},d_;function tj(){if(d_)return Ng;d_=1;var t=function(o){var a=new XMLSerializer;return Array.prototype.map.call(o.childNodes,function(l){return a.serializeToString(l)}).join("")},e=function(o){if(o.documentElement.tagName==="parsererror"&&o.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return o.documentElement;if((o.documentElement.tagName==="xml"||o.documentElement.tagName==="html")&&o.documentElement.childNodes&&o.documentElement.childNodes.length>0&&o.documentElement.childNodes[0].nodeName==="parsererror")return o.documentElement.childNodes[0];if(o.documentElement.tagName==="html"&&o.documentElement.childNodes&&o.documentElement.childNodes.length>0&&o.documentElement.childNodes[0].nodeName==="body"&&o.documentElement.childNodes[0].childNodes&&o.documentElement.childNodes[0].childNodes.length&&o.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return o.documentElement.childNodes[0].childNodes[0]},n=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
153
- ?</div>`),new RegExp(`^(.+)
154
- `)],r=function(o){var a=t(o),l,s;for(l=0;l<n.length;l++)if(s=n[l].exec(a),s)return s[1]},i=function(o){var a;if(o===null)throw new Error("Parse error");var l=e(o);if(l!==void 0)throw a=r(l)||"Parse error",new Error(a)};return Ng.failOnParseError=function(o){return i(o),o},Ng}var Ig={},Dg={},h_;function Qp(){return h_||(h_=1,function(t){var e=cS();t.getDocumentBaseUrl=function(l){return l.baseURI!=="about:blank"?l.baseURI:null},t.clone=function(l){var s={},f;for(f in l)l.hasOwnProperty(f)&&(s[f]=l[f]);return s},t.cloneArray=function(l){return Array.prototype.slice.apply(l,[0])},t.joinUrl=function(l,s){return l?e.resolve(l,s):s},t.isDataUri=function(l){return/^data:/.test(l)},t.collectAndReportErrors=function(l){var s=[];return Promise.all(l.map(function(f){return f.catch(function(h){s.push(h)})})).then(function(){return s})};var n=null,r=function(l,s){return s===!1||s==="none"||s==="repeated"?((n===null||s!=="repeated")&&(n=Date.now()),l+"?_="+n):l};t.ajax=function(l,s){return new Promise(function(f,h){var x=new window.XMLHttpRequest,w=t.joinUrl(s.baseUrl,l),v,O=function(){h({msg:"Unable to load url",url:w})};v=r(w,s.cache),x.addEventListener("load",function(){x.status===200||x.status===0?f(x.response):O()},!1),x.addEventListener("error",O,!1);try{x.open("GET",v,!0),x.overrideMimeType(s.mimeType),x.send(null)}catch{O()}})},t.binaryAjax=function(l,s){var f=t.clone(s);return f.mimeType="text/plain; charset=x-user-defined",t.ajax(l,f).then(function(h){for(var x="",w=0;w<h.length;w++)x+=String.fromCharCode(h.charCodeAt(w)&255);return x})};var i=function(l){var s=function(f,h){return f.substring(0,h.length)===h};return s(l,"<?xml")||s(l,"<svg")?"image/svg+xml":"image/png"};t.getDataURIForImageURL=function(l,s){return t.binaryAjax(l,s).then(function(f){var h=btoa(f),x=i(f);return"data:"+x+";base64,"+h})};var o=[],a=function(l){return o.indexOf(l)<0&&o.push(l),o.indexOf(l)};t.memoize=function(l,s,f){if(typeof f!="object")throw new Error("cacheBucket is not an object");return function(){var h=Array.prototype.slice.call(arguments),x=s(h),w=a(l),v;return f[w]&&f[w][x]?f[w][x]:(v=l.apply(null,h),f[w]=f[w]||{},f[w][x]=v,v)}}}(Dg)),Dg}var jg={},p_;function nj(){if(p_)return jg;p_=1;var t=Qp(),e=function(o,a){var l=null;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"));var s=t.getDocumentBaseUrl(o.ownerDocument),f=t.clone(a);return!f.baseUrl&&s&&(f.baseUrl=s),t.getDataURIForImageURL(l,f).then(function(h){return h},function(h){throw{resourceType:"image",url:h.url,msg:"Unable to load image "+h.url}})},n=function(o){return o.filter(function(a){var l=null;return 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")),l!==null&&!t.isDataUri(l)})},r=function(o){return Array.prototype.filter.call(o,function(a){return a.type==="image"})},i=function(o){return Array.prototype.slice.call(o)};return jg.inline=function(o,a){var l=i(o.getElementsByTagName("img")),s=i(o.getElementsByTagName("image")),f=r(o.getElementsByTagName("input"));l=l.concat(s),l=l.concat(f);var h=n(l);return t.collectAndReportErrors(h.map(function(x){return e(x,a).then(function(w){x.attributes.src?x.attributes.src.value=w:x.attributes["xlink:href"]?x.attributes["xlink:href"].value=w:x.attributes.href&&(x.attributes.href.value=w)})}))},jg}var Fg={},g_;function rj(){if(g_)return Fg;g_=1;var t=Qp(),e=function(o,a){var l=o.attributes.src.value,s=t.getDocumentBaseUrl(o.ownerDocument),f=t.clone(a);return!f.baseUrl&&s&&(f.baseUrl=s),t.ajax(l,f).catch(function(h){throw{resourceType:"script",url:h.url,msg:"Unable to load script "+h.url}})},n=function(o){return o.replace(/<\//g,"<\\/")},r=function(o,a){o.attributes.removeNamedItem("src"),o.textContent=n(a)},i=function(o){var a=o.getElementsByTagName("script");return Array.prototype.filter.call(a,function(l){return!!l.attributes.src})};return Fg.inline=function(o,a){var l=i(o);return t.collectAndReportErrors(l.map(function(s){return e(s,a).then(function(f){r(s,f)})}))},Fg}var zg={},Bg={},v_;function b2(){return v_||(v_=1,function(t){t.unquoteString=function(e){var n=/^"(.*)"$/,r=/^'(.*)'$/;return n.test(e)?e.replace(n,"$1"):r.test(e)?e.replace(r,"$1"):e},t.rulesForCssText=function(e){var n=document.implementation.createHTMLDocument(""),r=document.createElement("style"),i;return r.textContent=e,n.body.appendChild(r),i=r.sheet.cssRules,Array.prototype.slice.call(i)},t.cssRulesToText=function(e){return e.reduce(function(n,r){return n+r.cssText},"")},t.exchangeRule=function(e,n,r){var i=e.indexOf(n);e[i]=t.rulesForCssText(r)[0]},t.changeFontFaceRuleSrc=function(e,n,r){var i="@font-face { font-family: "+n.style.getPropertyValue("font-family")+"; ";n.style.getPropertyValue("font-style")&&(i+="font-style: "+n.style.getPropertyValue("font-style")+"; "),n.style.getPropertyValue("font-weight")&&(i+="font-weight: "+n.style.getPropertyValue("font-weight")+"; "),n.style.getPropertyValue("unicode-range")&&(i+="unicode-range: "+n.style.getPropertyValue("unicode-range")+"; "),i+="src: "+r+"}",t.exchangeRule(e,n,i)}}(Bg)),Bg}var Ug={},m_;function ij(){return m_||(m_=1,function(t){var e=b2(),n=function(o){var a=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return o.replace(a,"$1")};t.extractCssUrl=function(o){var a=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,l;if(!a.test(o))throw new Error("Invalid url");return l=a.exec(o)[1],e.unquoteString(n(l))};var r=function(o){var a=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,l="(url\\("+a+"\\)|[^,\\s]+)",s="(?:\\s*"+l+")+",f="^\\s*("+s+")(?:\\s*,\\s*("+s+"))*\\s*$",h=new RegExp(s,"g"),x,w=[],v=function(O){var g=new RegExp(l,"g"),b=[],p;for(p=g.exec(O);p;)b.push(p[1]),p=g.exec(O);return b};if(o.match(new RegExp(f))){for(x=h.exec(o);x;)w.push(v(x[0])),x=h.exec(o);return w}return[]},i=function(o){var a,l;for(a=0;a<o.length;a++)try{return l=t.extractCssUrl(o[a]),{url:l,idx:a}}catch{}};t.parse=function(o){var a=r(o);return a.map(function(l){var s=i(l);return s?{preUrl:l.slice(0,s.idx),url:s.url,postUrl:l.slice(s.idx+1)}:{preUrl:l}})},t.serialize=function(o){var a=o.map(function(l){var s=[].concat(l.preUrl);return l.url&&s.push('url("'+l.url+'")'),l.postUrl&&(s=s.concat(l.postUrl)),s.join(" ")});return a.join(", ")}}(Ug)),Ug}function Sd(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Hg={exports:{}},y_;function oj(){return y_||(y_=1,function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function a(f,h){if(!i[f]){if(!r[f]){var x=typeof Sd=="function"&&Sd;if(!h&&x)return x(f,!0);if(l)return l(f,!0);var w=new Error("Cannot find module '"+f+"'");throw w.code="MODULE_NOT_FOUND",w}var v=i[f]={exports:{}};r[f][0].call(v.exports,function(O){var g=r[f][1][O];return a(g||O)},v,v.exports,n,r,i,o)}return i[f].exports}for(var l=typeof Sd=="function"&&Sd,s=0;s<o.length;s++)a(o[s]);return a}({1:[function(n,r,i){function o(s,f){function h(){this.constructor=s}h.prototype=f.prototype,s.prototype=new h}function a(s,f,h,x){this.message=s,this.expected=f,this.found=h,this.location=x,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,a)}o(a,Error),a.buildMessage=function(s,f){var h={literal:function(p){return'"'+w(p.text)+'"'},class:function(p){var y="",d;for(d=0;d<p.parts.length;d++)y+=p.parts[d]instanceof Array?v(p.parts[d][0])+"-"+v(p.parts[d][1]):v(p.parts[d]);return"["+(p.inverted?"^":"")+y+"]"},any:function(p){return"any character"},end:function(p){return"end of input"},other:function(p){return p.description}};function x(p){return p.charCodeAt(0).toString(16).toUpperCase()}function w(p){return p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+x(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+x(y)})}function v(p){return p.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+x(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+x(y)})}function O(p){return h[p.type](p)}function g(p){var y=new Array(p.length),d,m;for(d=0;d<p.length;d++)y[d]=O(p[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 b(p){return p?'"'+w(p)+'"':"end of input"}return"Expected "+g(s)+" but "+b(f)+" found."};function l(s,f){f=f!==void 0?f:{};var h={},x={start:ne},w=ne,v="",O=function(){return[]},g=",",b=F(",",!1),p=function(te,fe){return[te].concat(fe)},y=function(te){return[te]},d=function(te,fe){return{url:te,format:fe}},m=function(te){return{url:te}},_="url(",A=F("url(",!1),C=")",R=F(")",!1),S=function(te){return te},E="format(",P=F("format(",!1),T="local(",N=F("local(",!1),U=function(te){return{local:te}},G=/^[^)]/,Z=$([")"],!0,!1),W=function(te){return be.extractValue(te.join(""))},H=/^[ \t\r\n\f]/,L=$([" "," ","\r",`
155
- `,"\f"],!1,!1),M=0,D=[{line:1,column:1}],B=0,V=[],Y;if("startRule"in f){if(!(f.startRule in x))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');w=x[f.startRule]}function F(te,fe){return{type:"literal",text:te,ignoreCase:fe}}function $(te,fe,he){return{type:"class",parts:te,inverted:fe,ignoreCase:he}}function z(){return{type:"end"}}function K(te){var fe=D[te],he;if(fe)return fe;for(he=te-1;!D[he];)he--;for(fe=D[he],fe={line:fe.line,column:fe.column};he<te;)s.charCodeAt(he)===10?(fe.line++,fe.column=1):fe.column++,he++;return D[te]=fe,fe}function X(te,fe){var he=K(te),Ee=K(fe);return{start:{offset:te,line:he.line,column:he.column},end:{offset:fe,line:Ee.line,column:Ee.column}}}function Q(te){M<B||(M>B&&(B=M,V=[]),V.push(te))}function J(te,fe,he){return new a(a.buildMessage(te,fe),te,fe,he)}function ne(){var te,fe;return te=ie(),te===h&&(te=M,fe=v,fe!==h&&(fe=O()),te=fe),te}function ie(){var te,fe,he,Ee,Ve,Je;if(te=M,fe=oe(),fe!==h){for(he=[],Ee=we();Ee!==h;)he.push(Ee),Ee=we();if(he!==h)if(s.charCodeAt(M)===44?(Ee=g,M++):(Ee=h,Q(b)),Ee!==h){for(Ve=[],Je=we();Je!==h;)Ve.push(Je),Je=we();Ve!==h?(Je=ie(),Je!==h?(fe=p(fe,Je),te=fe):(M=te,te=h)):(M=te,te=h)}else M=te,te=h;else M=te,te=h}else M=te,te=h;return te===h&&(te=M,fe=oe(),fe!==h&&(fe=y(fe)),te=fe),te}function oe(){var te;return te=de(),te===h&&(te=re()),te}function de(){var te,fe,he,Ee;if(te=M,fe=me(),fe!==h){if(he=[],Ee=we(),Ee!==h)for(;Ee!==h;)he.push(Ee),Ee=we();else he=h;he!==h?(Ee=Pe(),Ee!==h?(fe=d(fe,Ee),te=fe):(M=te,te=h)):(M=te,te=h)}else M=te,te=h;return te===h&&(te=M,fe=me(),fe!==h&&(fe=m(fe)),te=fe),te}function me(){var te,fe,he,Ee;return te=M,s.substr(M,4)===_?(fe=_,M+=4):(fe=h,Q(A)),fe!==h?(he=ae(),he!==h?(s.charCodeAt(M)===41?(Ee=C,M++):(Ee=h,Q(R)),Ee!==h?(fe=S(he),te=fe):(M=te,te=h)):(M=te,te=h)):(M=te,te=h),te}function Pe(){var te,fe,he,Ee;return te=M,s.substr(M,7)===E?(fe=E,M+=7):(fe=h,Q(P)),fe!==h?(he=ae(),he!==h?(s.charCodeAt(M)===41?(Ee=C,M++):(Ee=h,Q(R)),Ee!==h?(fe=S(he),te=fe):(M=te,te=h)):(M=te,te=h)):(M=te,te=h),te}function re(){var te,fe,he,Ee;return te=M,s.substr(M,6)===T?(fe=T,M+=6):(fe=h,Q(N)),fe!==h?(he=ae(),he!==h?(s.charCodeAt(M)===41?(Ee=C,M++):(Ee=h,Q(R)),Ee!==h?(fe=U(he),te=fe):(M=te,te=h)):(M=te,te=h)):(M=te,te=h),te}function ae(){var te,fe,he;if(te=M,fe=[],G.test(s.charAt(M))?(he=s.charAt(M),M++):(he=h,Q(Z)),he!==h)for(;he!==h;)fe.push(he),G.test(s.charAt(M))?(he=s.charAt(M),M++):(he=h,Q(Z));else fe=h;return fe!==h&&(fe=W(fe)),te=fe,te}function we(){var te;return H.test(s.charAt(M))?(te=s.charAt(M),M++):(te=h,Q(L)),te}var be=n("../util");if(Y=w(),Y!==h&&M===s.length)return Y;throw Y!==h&&M<s.length&&Q(z()),J(V,B<s.length?s.charAt(B):null,B<s.length?X(B,B+1):X(B,B))}r.exports={SyntaxError:a,parse:l}},{"../util":3}],2:[function(n,r,i){var o=n("./grammar");i.SyntaxError=function(a,l){this.message=a,this.offset=l},i.parse=function(a){try{return o.parse(a)}catch(l){throw new i.SyntaxError(l.message,l.offset)}},i.serialize=function(a){return a.map(function(l){var s;return l.url?(s='url("'+l.url+'")',l.format&&(s+=' format("'+l.format+'")')):s='local("'+l.local+'")',s}).join(", ")}},{"./grammar":1}],3:[function(n,r,i){var o=function(l){var s=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return l.replace(s,"$1")},a=function(l){var s=/^"(.*)"$/,f=/^'(.*)'$/;return s.test(l)?l.replace(s,"$1"):f.test(l)?l.replace(f,"$1"):l};i.extractValue=function(l){return a(o(l))}},{}]},{},[2])(2)})}(Hg)),Hg.exports}var b_;function aj(){return b_||(b_=1,function(t){var e=Qp(),n=b2(),r=ij(),i=oj(),o=function(y,d,m){y.style.setProperty(d,m,y.style.getPropertyPriority(d))},a=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},s=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&&!e.isDataUri(m.url)&&d.push(_)}),d},x=function(y){var d=[];return y.forEach(function(m,_){m.url&&!e.isDataUri(m.url)&&d.push(_)}),d};t.adjustPathsOfCssResources=function(y,d){var m=a(d),_=l(m),A=!1;return _.forEach(function(C){var R=r.parse(C.value),S=h(R),E;S.length>0&&(S.forEach(function(P){var T=R[P].url,N=e.joinUrl(y,T);R[P].url=N}),E=r.serialize(R),o(C.rule,C.property,E),A=!0)}),s(d).forEach(function(C){var R=C.style.getPropertyValue("src"),S,E;try{S=i.parse(R)}catch{return}E=x(S),E.length>0&&(E.forEach(function(P){var T=S[P].url,N=e.joinUrl(y,T);S[P].url=N}),n.changeFontFaceRuleSrc(d,C,i.serialize(S)),A=!0)}),f(d).forEach(function(C){var R=C.href,S=e.joinUrl(y,R);n.exchangeRule(d,C,"@import url("+S+");"),A=!0}),A};var w=function(y,d,m){var _=y.indexOf(d);y.splice(_,1),m.forEach(function(A,C){y.splice(_+C,0,A)})},v=function(y,d,m,_){var A=d.href,C;return A=n.unquoteString(A),C=e.joinUrl(_.baseUrl,A),m.indexOf(C)>=0?(w(y,d,[]),Promise.resolve([])):(m.push(C),e.ajax(A,_).then(function(R){var S=n.rulesForCssText(R);return t.loadCSSImportsForRules(S,m,_).then(function(E){return t.adjustPathsOfCssResources(A,S),w(y,d,S),E.errors})},function(R){throw{resourceType:"stylesheet",url:R.url,msg:"Unable to load stylesheet "+R.url}}))};t.loadCSSImportsForRules=function(y,d,m){var _=f(y),A=[],C=!1;return Promise.all(_.map(function(R){return v(y,R,d,m).then(function(S){A=A.concat(S),C=!0},function(S){A.push(S)})})).then(function(){return{hasChanges:C,errors:A}})};var O=function(y,d){var m=r.parse(y),_=h(m),A=!1;return e.collectAndReportErrors(_.map(function(C){var R=m[C].url;return e.getDataURIForImageURL(R,d).then(function(S){m[C].url=S,A=!0},function(S){throw{resourceType:"backgroundImage",url:S.url,msg:"Unable to load background-image "+S.url}})})).then(function(C){return{backgroundValue:r.serialize(m),hasChanges:A,errors:C}})},g=function(y,d){var m=a(y),_=l(m),A=[],C=!1;return Promise.all(_.map(function(R){return O(R.value,d).then(function(S){S.hasChanges&&(o(R.rule,R.property,S.backgroundValue),C=!0),A=A.concat(S.errors)})})).then(function(){return{hasChanges:C,errors:A}})},b=function(y,d){var m=!1,_,A;try{_=i.parse(y)}catch{_=[]}return A=x(_),e.collectAndReportErrors(A.map(function(C){var R=_[C],S=R.format||"woff";return e.binaryAjax(R.url,d).then(function(E){var P=btoa(E);R.url="data:font/"+S+";base64,"+P,m=!0},function(E){throw{resourceType:"fontFace",url:E.url,msg:"Unable to load font-face "+E.url}})})).then(function(C){return{srcDeclarationValue:i.serialize(_),hasChanges:m,errors:C}})},p=function(y,d){var m=s(y),_=[],A=!1;return Promise.all(m.map(function(C){var R=C.style.getPropertyValue("src");return b(R,d).then(function(S){S.hasChanges&&(n.changeFontFaceRuleSrc(y,C,S.srcDeclarationValue),A=!0),_=_.concat(S.errors)})})).then(function(){return{hasChanges:A,errors:_}})};t.loadAndInlineCSSResourcesForRules=function(y,d){var m=!1,_=[];return Promise.all([g,p].map(function(A){return A(y,d).then(function(C){m=m||C.hasChanges,_=_.concat(C.errors)})})).then(function(){return{hasChanges:m,errors:_}})}}(zg)),zg}var __;function lj(){return __||(__=1,function(t){var e=Qp(),n=nj(),r=rj(),i=aj(),o=b2(),a=function(b){return e.joinUrl(b,".")},l=function(b){var p=b.map(function(y,d){return d===b.length-1&&(y={baseUrl:a(y.baseUrl)}),JSON.stringify(y)});return p},s=function(b,p){return p.cache!==!1&&p.cache!=="none"&&p.cacheBucket?e.memoize(b,l,p.cacheBucket):b},f=function(b,p,y){var d=o.rulesForCssText(b);return i.loadCSSImportsForRules(d,p,y).then(function(m){return i.loadAndInlineCSSResourcesForRules(d,y).then(function(_){var A=m.errors.concat(_.errors),C=m.hasChanges||_.hasChanges;return C&&(b=o.cssRulesToText(d)),{hasChanges:C,content:b,errors:A}})})},h=function(b,p,y){var d=b.textContent,m=s(f,p);return m(d,y,p).then(function(_){return _.hasChanges&&(b.childNodes[0].nodeValue=_.content),e.cloneArray(_.errors)})},x=function(b){var p=b.getElementsByTagName("style");return Array.prototype.filter.call(p,function(y){return!y.attributes.type||y.attributes.type.value==="text/css"})};t.loadAndInlineStyles=function(b,p){var y=x(b),d=[],m=[],_;return _=e.clone(p),_.baseUrl=_.baseUrl||e.getDocumentBaseUrl(b),Promise.all(y.map(function(A){return h(A,_,m).then(function(C){d=d.concat(C)})})).then(function(){return d})};var w=function(b,p){var y=b.parentNode,d;p=p.trim(),p&&(d=b.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(b.ownerDocument.createTextNode(p)),y.insertBefore(d,b)),y.removeChild(b)},v=function(b,p){return e.ajax(b,p).then(function(y){var d=o.rulesForCssText(y);return{content:y,cssRules:d}}).then(function(y){var d=i.adjustPathsOfCssResources(b,y.cssRules);return{content:y.content,cssRules:y.cssRules,hasChanges:d}}).then(function(y){return i.loadCSSImportsForRules(y.cssRules,[],p).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,p).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=o.cssRulesToText(y.cssRules)),{content:d,errors:y.errors}})},O=function(b,p){var y=b.attributes.href.value,d=e.getDocumentBaseUrl(b.ownerDocument),m=e.clone(p);!m.baseUrl&&d&&(m.baseUrl=d);var _=s(v,p);return _(y,m).then(function(A){return{content:A.content,errors:e.cloneArray(A.errors)}})},g=function(b){var p=b.getElementsByTagName("link");return Array.prototype.filter.call(p,function(y){return y.attributes.rel&&y.attributes.rel.value==="stylesheet"&&(!y.attributes.type||y.attributes.type.value==="text/css")})};t.loadAndInlineCssLinks=function(b,p){var y=g(b),d=[];return Promise.all(y.map(function(m){return O(m,p).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})},t.loadAndInlineImages=n.inline,t.loadAndInlineScript=r.inline,t.inlineReferences=function(b,p){var y=[],d=[t.loadAndInlineImages,t.loadAndInlineStyles,t.loadAndInlineCssLinks];return p.inlineScripts!==!1&&d.push(t.loadAndInlineScript),Promise.all(d.map(function(m){return m(b,p).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(t){(function(e,n){e===void 0&&window!==void 0&&(e=window),t.exports?t.exports=n(cS(),ej(),tj(),lj()):e.rasterizeHTML=n(e.url,e.xmlserializer,e.sanedomparsererror,e.inlineresources)})(_e,function(e,n,r,i){var o=function(O){var g={},b=[];g.joinUrl=function(d,m){return d?O.resolve(d,m):m},g.getConstantUniqueIdFor=function(d){return b.indexOf(d)<0&&b.push(d),b.indexOf(d)},g.clone=function(d){var m={},_;for(_ in d)d.hasOwnProperty(_)&&(m[_]=d[_]);return m};var p=function(d){return typeof d=="object"&&d!==null},y=function(d){return p(d)&&Object.prototype.toString.apply(d).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return g.parseOptionalParameters=function(d){var m={canvas:null,options:{}};return d[0]==null||y(d[0])?(m.canvas=d[0]||null,m.options=g.clone(d[1])):m.options=g.clone(d[0]),m},g}(e),a=function(O){var g={},b=function(p,y,d){var m=p[y];return p[y]=function(){var _=Array.prototype.slice.call(arguments);return d.apply(this,[_,m])},m};return g.baseUrlRespectingXhr=function(p,y){var d=function(){var m=new p;return b(m,"open",function(_,A){var C=_.shift(),R=_.shift(),S=O.joinUrl(y,R);return A.apply(this,[C,S].concat(_))}),m};return d},g.finishNotifyingXhr=function(p){var y=0,d=0,m=!1,_,A=new Promise(function(R){_=function(){var S=y-d;S<=0&&m&&R({totalCount:y})}}),C=function(){var R=new p;return b(R,"send",function(S,E){return y+=1,E.apply(this,arguments)}),R.addEventListener("load",function(){d+=1,_()}),R};return C.waitForRequestsToFinish=function(){return m=!0,_(),A},C},g}(o),l=function(){var O={},g=function(C){return Array.prototype.slice.call(C)};O.addClassName=function(C,R){C.className+=" "+R},O.addClassNameRecursively=function(C,R){O.addClassName(C,R),C.parentNode!==C.ownerDocument&&O.addClassNameRecursively(C.parentNode,R)};var b=function(C,R){var S=C.parentStyleSheet,E=g(S.cssRules).indexOf(C);S.insertRule(R,E+1),S.deleteRule(E)},p=function(C,R){var S=C.cssText.replace(/^[^\{]+/,""),E=R+" "+S;b(C,E)},y=function(C){return g(C).reduce(function(R,S){return R+S.cssText},"")},d=function(C){C.textContent=y(C.sheet.cssRules)},m=function(C){var R=document.implementation.createHTMLDocument(""),S=document.createElement("style");S.textContent=C.textContent,R.body.appendChild(S),C.sheet=S.sheet},_=function(C){return"((?:^|[^.#:\\w])|(?=\\W))("+C.join("|")+")(?=\\W|$)"},A=function(C,R,S){var E=_(R);g(C.querySelectorAll("style")).forEach(function(P){typeof P.sheet>"u"&&m(P);var T=g(P.sheet.cssRules).filter(function(N){return N.selectorText&&new RegExp(E,"i").test(N.selectorText)});T.length&&(T.forEach(function(N){var U=N.selectorText.replace(new RegExp(E,"gi"),function(G,Z,W){return Z+S(W)});U!==N.selectorText&&p(N,U)}),d(P))})};return O.rewriteCssSelectorWith=function(C,R,S){A(C,[R],function(){return S})},O.lowercaseCssTypeSelectors=function(C,R){A(C,R,function(S){return S.toLowerCase()})},O.findHtmlOnlyNodeNames=function(C){var R=C.ownerDocument.createTreeWalker(C,NodeFilter.SHOW_ELEMENT),S={},E={},P;do P=R.currentNode.tagName.toLowerCase(),R.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?S[P]=!0:E[P]=!0;while(R.nextNode());return Object.keys(S).filter(function(T){return!E[T]})},O}(),s=function(O){var g={},b=function(y){return Array.prototype.slice.call(y)},p={active:!0,hover:!0,focus:!1,target:!1};return g.fakeUserAction=function(y,d,m){var _=y.querySelector(d),A=":"+m,C="rasterizehtml"+m;_&&(p[m]?O.addClassNameRecursively(_,C):O.addClassName(_,C),O.rewriteCssSelectorWith(y,A,"."+C))},g.persistInputValues=function(y){var d=y.querySelectorAll("input"),m=y.querySelectorAll("textarea"),_=function(A){return A.type==="checkbox"||A.type==="radio"};b(d).filter(_).forEach(function(A){A.checked?A.setAttribute("checked",""):A.removeAttribute("checked")}),b(d).filter(function(A){return!_(A)}).forEach(function(A){A.setAttribute("value",A.value)}),b(m).forEach(function(A){A.textContent=A.value})},g.rewriteTagNameSelectorsToLowerCase=function(y){O.lowercaseCssTypeSelectors(y,O.findHtmlOnlyNodeNames(y))},g}(l),f=function(O,g,b,p){var y={},d=function(W,H,L,M){var D=W.createElement(H);return D.style.visibility="hidden",D.style.width=L+"px",D.style.height=M+"px",D.style.position="absolute",D.style.top=-1e4-M+"px",D.style.left=-1e4-L+"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(L){var M=d(p.document,"iframe",H.width,H.height),D=W.outerHTML,B=[],V=H.executeJsTimeout||0,Y=function(){p.document.getElementsByTagName("body")[0].removeChild(M)},F=function(){var X=M.contentDocument;L({document:X,errors:B,cleanUp:Y})},$=M.contentWindow.XMLHttpRequest,z=g.finishNotifyingXhr($),K=g.baseUrlRespectingXhr(z,H.baseUrl);M.onload=function(){m(V).then(z.waitForRequestsToFinish).then(F)},M.contentDocument.open(),M.contentWindow.XMLHttpRequest=K,M.contentWindow.onerror=function(X){B.push({resourceType:"scriptExecution",msg:X})},M.contentDocument.write("<!DOCTYPE html>"),M.contentDocument.write(D),M.contentDocument.close()})};var _=function(W,H,L){var M=W.createElement("iframe");return M.style.width=H+"px",M.style.height=L+"px",M.style.visibility="hidden",M.style.position="absolute",M.style.top=-1e4-L+"px",M.style.left=-1e4-H+"px",M.style.borderWidth=0,M.sandbox="allow-same-origin",M.scrolling="no",M},A=function(W,H,L){var M=Math.floor(W/L),D=Math.floor(H/L);return _(p.document,M,D)},C=function(W,H,L,M){return{width:Math.max(W.width*M,H),height:Math.max(W.height*M,L)}},R=function(W,H){var L=W.querySelector(H);if(L)return L;if(W.ownerDocument.querySelector(H)===W)return W;throw{message:"Clipping selector not found"}},S=function(W,H,L,M,D){var B=Math.max(W.scrollWidth,W.clientWidth),V=Math.max(W.scrollHeight,W.clientHeight),Y,F,$,z,K,X,Q,J;return H?(X=R(W,H),Q=X.getBoundingClientRect(),Y=Q.top,F=Q.left,$=Q.width,z=Q.height):(Y=0,F=0,$=B,z=V),J=C({width:$,height:z},L,M,D),K=p.getComputedStyle(W.ownerDocument.documentElement).fontSize,{left:F,top:Y,width:J.width,height:J.height,viewportWidth:B,viewportHeight:V,rootFontSize:K}},E=function(W,H){var L=W.tagName;return H.querySelector(L)},P=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(L,M){var D=H.zoom||1,B;B=A(H.width,H.height,D),p.document.getElementsByTagName("body")[0].appendChild(B),B.onload=function(){var V=B.contentDocument,Y;try{Y=S(E(W,V),H.clip,H.width,H.height,D),L(Y)}catch(F){M(F)}finally{p.document.getElementsByTagName("body")[0].removeChild(B)}},B.contentDocument.open(),B.contentDocument.write("<!DOCTYPE html>"),B.contentDocument.write(P(W)),B.contentDocument.close()})},y.parseHtmlFragment=function(W){var H=p.document.implementation.createHTMLDocument("");H.documentElement.innerHTML=W;var L=H.querySelector("body").firstChild;if(!L)throw"Invalid source";return L};var T=function(W,H){var L=/<html((?:\s+[^>]*)?)>/im.exec(H),M=p.document.implementation.createHTMLDocument(""),D,B,V,Y;if(L)for(D="<div"+L[1]+"></div>",M.documentElement.innerHTML=D,V=M.querySelector("div"),B=0;B<V.attributes.length;B++)Y=V.attributes[B],W.documentElement.setAttribute(Y.name,Y.value)};y.parseHTML=function(W){var H=p.document.implementation.createHTMLDocument("");return H.documentElement.innerHTML=W,T(H,W),H};var N=function(W){try{return b.failOnParseError(W)}catch(H){throw{message:"Invalid source",originalError:H}}};y.validateXHTML=function(W){var H=new DOMParser,L=H.parseFromString(W,"application/xml");N(L)};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(L,M){var D=new window.XMLHttpRequest,B=O.joinUrl(H.baseUrl,W),V=G(B,H.cache),Y=function(F){M({message:"Unable to load page",originalError:F})};D.addEventListener("load",function(){D.status===200||D.status===0?L(D.responseXML):Y(D.statusText)},!1),D.addEventListener("error",function(F){Y(F)},!1);try{D.open("GET",V,!0),D.responseType="document",D.send(null)}catch(F){Y(F)}})};return y.loadDocument=function(W,H){return Z(W,H).then(function(L){return N(L)})},y}(o,a,r,window),h=function(O){var g={},b=function(E,P){return P?URL.createObjectURL(new Blob([E],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(E)},p=function(E){E instanceof Blob&&URL.revokeObjectURL(E)},y='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',d=function(E){return new Promise(function(P,T){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"),P(!0)}catch{P(!1)}},U.onerror=T,U.src=E})},m=function(){var E=b(y,!0);return d(E).then(function(P){return p(E),P?!1:d(b(y,!1)).then(function(T){return T})},function(){return!1})},_=function(){if(O.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},A=function(){return new Promise(function(E,P){_()&&O.URL?m().then(function(T){E(!T)},function(){P()}):E(!1)})},C,R=function(){return C===void 0&&(C=A()),C},S=function(E){return R().then(function(P){return b(E,P)})};return g.renderSvg=function(E){return new Promise(function(P,T){var N,U,G=function(){U.onload=null,U.onerror=null},Z=function(){N&&p(N)};U=new Image,U.onload=function(){G(),Z(),P(U)},U.onerror=function(){Z(),T()},S(E).then(function(W){N=W,U.src=N},T)})},g}(window),x=function(O,g,b,p){var y={},d=function(E,P){var T=P||1,N={width:E.width,height:E.height,"font-size":E.rootFontSize};return T!==1&&(N.style="transform:scale("+T+"); transform-origin: 0 0;"),N},m=function(E){var P,T,N,U;P=Math.round(E.viewportWidth),T=Math.round(E.viewportHeight),N=-E.left,U=-E.top;var G={x:N,y:U,width:P,height:T};return G},_=function(E){var P=E.style||"";E.style=P+"float: left;"},A=function(E){E.externalResourcesRequired=!0},C=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},R=function(E){var P=Object.keys(E);return P.length?" "+P.map(function(T){return T+'="'+E[T]+'"'}).join(" "):""},S=function(E,P,T){var N=p.serializeToString(E);g.validateXHTML(N);var U=m(P);return _(U),A(U),'<svg xmlns="http://www.w3.org/2000/svg"'+R(d(P,T))+">"+C()+"<foreignObject"+R(U)+">"+N+"</foreignObject></svg>"};return y.getSvgForDocument=function(E,P,T){return b.rewriteTagNameSelectorsToLowerCase(E),S(E,P,T)},y.drawDocumentAsSvg=function(E,P){return["hover","active","focus","target"].forEach(function(T){P[T]&&b.fakeUserAction(E,P[T],T)}),g.calculateDocumentContentSize(E,P).then(function(T){return y.getSvgForDocument(E,T,P.zoom)})},y}(o,f,s,n),w=function(O,g,b,p,y,d){var m={},_=function(E){return{message:"Error rendering page",originalError:E}},A=function(E){return y.renderSvg(E).then(function(P){return{image:P,svg:E}},function(P){throw _(P)})},C=function(E,P){try{P.getContext("2d").drawImage(E,0,0)}catch(T){throw _(T)}},R=function(E,P,T){return p.drawDocumentAsSvg(E,T).then(A).then(function(N){return P&&C(N.image,P),N})},S=function(E,P){return g.executeJavascript(E,P).then(function(T){var N=T.document;return b.persistInputValues(N),{document:N,errors:T.errors,cleanUp:T.cleanUp}})};return m.rasterize=function(E,P,T){var N;return N=O.clone(T),N.inlineScripts=T.executeJs===!0,d.inlineReferences(E,N).then(function(U){return T.executeJs?S(E,T).then(function(G){return{element:G.document.documentElement,errors:U.concat(G.errors),cleanUp:G.cleanUp}}):{element:E,errors:U,cleanUp:function(){}}}).then(function(U){return R(U.element,P,T).then(function(G){return U.cleanUp(),{image:G.image,svg:G.svg,errors:U.errors}})})},m}(o,f,s,x,h,i),v=function(O,g,b){var p={},y=function(C,R){var S=300,E=200,P=C?C.width:S,T=C?C.height:E,N=R.width!==void 0?R.width:P,U=R.height!==void 0?R.height:T;return{width:N,height:U}},d=function(C){var R=y(C.canvas,C.options),S;return S=O.clone(C.options),S.width=R.width,S.height=R.height,S};p.drawDocument=function(){var C=arguments[0],R=Array.prototype.slice.call(arguments,1),S=O.parseOptionalParameters(R),E=C.documentElement?C.documentElement:C;return b.rasterize(E,S.canvas,d(S))};var m=function(C,R,S){var E=g.parseHTML(C);return p.drawDocument(E,R,S)};p.drawHTML=function(){var C=arguments[0],R=Array.prototype.slice.call(arguments,1),S=O.parseOptionalParameters(R);return m(C,S.canvas,S.options)};var _=function(C,R,S){var E=document.implementation.createHTMLDocument("");E.replaceChild(C.documentElement,E.documentElement);var P=S?O.clone(S):{};return S.baseUrl||(P.baseUrl=R),{document:E,options:P}},A=function(C,R,S){return g.loadDocument(C,S).then(function(E){var P=_(E,C,S);return p.drawDocument(P.document,R,P.options)})};return p.drawURL=function(){var C=arguments[0],R=Array.prototype.slice.call(arguments,1),S=O.parseOptionalParameters(R);return A(C,S.canvas,S.options)},p}(o,f,w);return v})})(aS);var sj=aS.exports;(function(t){var e=_e&&_e.__createBinding||(Object.create?function(m,_,A,C){C===void 0&&(C=A);var R=Object.getOwnPropertyDescriptor(_,A);R&&!("get"in R?!_.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return _[A]}}),Object.defineProperty(m,C,R)}:function(m,_,A,C){C===void 0&&(C=A),m[C]=_[A]}),n=_e&&_e.__setModuleDefault||(Object.create?function(m,_){Object.defineProperty(m,"default",{enumerable:!0,value:_})}:function(m,_){m.default=_}),r=_e&&_e.__importStar||function(m){if(m&&m.__esModule)return m;var _={};if(m!=null)for(var A in m)A!=="default"&&Object.prototype.hasOwnProperty.call(m,A)&&e(_,m,A);return n(_,m),_};Object.defineProperty(t,"__esModule",{value:!0}),t.prerenderFont=t.resetStyleContent=void 0,t.isContentWrapping=v,t.detectSize=O,t.htmlToCanvas=d;const i=r(sj),o=iu,a=p2;t.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
- * somehow display: inline-block is removing text-decoration
175
- * let's try to restore it that way
176
- */
177
- text-decoration: inherit;
178
- }
179
- li {
180
- margin-left: 1.7em;
181
- padding-left: 0.5em; /* This should match the margin-left value */
182
- }
183
- /* Add resets */
184
- ul {
185
- list-style-type: disc;
186
- }
187
- ol {
188
- list-style-type: decimal;
189
- }
190
-
191
- `;const l=`
192
- <style>
193
- html, body {
194
- padding: 0;
195
- margin: 0;
196
- }
197
- ${t.resetStyleContent}
198
- </style>
199
- `;let s;const f=()=>(s||(s=document.createElement("div"),s.id="polotno-hidden-do-not-touch",s.style.overflow="hidden",s.style.position="relative",document.body.appendChild(s),s.innerHTML=`<style>#polotno-hidden-do-not-touch {${t.resetStyleContent}}</style>`),s),h=new Map,x=navigator.userAgent.includes("Firefox"),w=async m=>{if(h.has(m))return h.get(m);const _=(async()=>{const A=`<div style="font-family: ${m}; font-size: 100px;">${m}<strong>${m}</strong></div>`,C=document.createElement("div");C.innerHTML=A,C.style.visibility="hidden",C.style.position="absolute";const R=f();R.appendChild(C);const S=x?180:50;await new Promise(E=>setTimeout(E,S)),R.removeChild(C)})();return h.set(m,_),_};function v({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 A=f();A.appendChild(_);const C=_.textContent,R=_.childNodes[0],S=C.split(/\s+/);let E=!1;for(let P=0;P<S.length;P++){const T=S[P];if(R.textContent=T,E=R.scrollWidth>_.clientWidth,E)break}return A.removeChild(_),E}function O(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 A=f();A.appendChild(_);const C=_.getBoundingClientRect();return A.removeChild(_),{width:C.width,height:C.height}}t.prerenderFont=w;const g={};function b(m){const _=[];for(const A of document.styleSheets)try{for(const C of A.cssRules)C instanceof CSSFontFaceRule&&C.style.fontFamily.replace(/['"]/g,"")===m&&_.push(C)}catch(C){console.warn(`Could not access stylesheet: ${A.href}`,C)}return _}const p={},y=m=>{if(p[m])return p[m];const _=b(m).filter(A=>A.style.fontFamily.replace(/['"]/g,"")===m).map(A=>({src:A.style.src,fontStyle:A.style.fontStyle||"normal",fontWeight:A.style.fontWeight||"normal"}));return p[m]=_,_};async function d({html:m,width:_,height:A,fontFamily:C,padding:R,font:S,pixelRatio:E}){if(C!=="Arial"&&!S){const U=(0,o.getGoogleFontsVariants)();m+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${C}:${U}" rel="stylesheet">`}if(S){const U=S.styles||(S.url?[{src:`url("${S.url}")`}]:y(C));m+="<style>",U.forEach(G=>{m+=`
200
- @font-face {
201
- font-family: '${C}';
202
- src: ${G.src};
203
- font-style: ${G.fontStyle||"normal"};
204
- font-weight: ${G.fontWeight||"normal"};
205
- }
206
- `}),m+="</style>"}m+=l;const P=document.createElement("canvas"),T=await i.drawHTML(`<div style="padding: ${R}px;">${m}</div>`,P,{width:_+2*R,height:A+2*R,cacheBucket:g});(0,a.trySetCanvasSize)(P,(_+2*R)*E,(A+2*R)*E);const N=P.getContext("2d");return N==null||N.drawImage(T.image,0,0,P.width,P.height),P}})(g2);var _2={},w2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.keyframes=t.glob=t.extractCss=void 0,t.css=x,t.setup=p,t.styled=y;let e={data:""},n=d=>typeof window=="object"?((d?d.querySelector("#_goober"):window._goober)||Object.assign((d||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:d||e,r=d=>{let m=n(d),_=m.data;return m.data="",_},i=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,o=/\/\*[^]*?\*\/|\s\s+|\n/g,a=(d,m)=>{let _="",A="",C="";for(let R in d){let S=d[R];R[0]=="@"?R[1]=="i"?_=R+" "+S+";":A+=R[1]=="f"?a(S,R):R+"{"+a(S,R[1]=="k"?"":m)+"}":typeof S=="object"?A+=a(S,m?m.replace(/([^,])+/g,E=>R.replace(/(^:.*)|([^,])+/g,P=>/&/.test(P)?P.replace(/&/g,E):E?E+" "+P:P)):R):S!=null&&(R=R.replace(/[A-Z]/g,"-$&").toLowerCase(),C+=a.p?a.p(R,S):R+":"+S+";")}return _+(m&&C?m+"{"+C+"}":C)+A},l={},s=d=>{if(typeof d=="object"){let m="";for(let _ in d)m+=_+s(d[_]);return m}return d},f=(d,m,_,A,C)=>{let R=s(d),S=l[R]||(l[R]=(E=>{let P=0,T=11;for(;P<E.length;)T=101*T+E.charCodeAt(P++)>>>0;return"go"+T})(R));if(!l[S]){let E=R!==d?d:(P=>{let T,N=[{}];for(;T=i.exec(P.replace(o,""));)T[4]?N.shift():T[3]?N.unshift(N[0][T[3]]=N[0][T[3]]||{}):N[0][T[1]]=T[2];return N[0]})(d);l[S]=a(C?{["@keyframes "+S]:E}:E,_?"":"."+S)}return((E,P,T)=>{P.data.indexOf(E)==-1&&(P.data=T?E+P.data:P.data+E)})(l[S],m,A),S},h=(d,m,_)=>d.reduce((A,C,R)=>{let S=m[R];if(S&&S.call){let E=S(_),P=E&&E.props&&E.props.className||/^go/.test(E)&&E;S=P?"."+P:E&&typeof E=="object"?E.props?"":a(E,""):E===!1?"":E}return A+C+(S??"")},"");function x(d){let m=this||{},_=d.call?d(m.p):d;return f(_.unshift?_.raw?h(_,[].slice.call(arguments,1),m.p):_.reduce((A,C)=>Object.assign(A,C&&C.call?C(m.p):C),{}):_,n(m.target),m.g,m.o,m.k)}t.extractCss=r;let w,v,O,g=x.bind({g:1}),b=x.bind({k:1});function p(d,m,_,A){a.p=m,w=d,v=_,O=A}function y(d,m){let _=this||{};return function(){let A=arguments;function C(R,S){let E=Object.assign({},R),P=E.className||C.className;_.p=Object.assign({theme:v&&v()},E),_.o=/ *go\d+/.test(P),E.className=x.apply(_,A)+(P?" "+P:""),m&&(E.ref=S);let T=d;return d[0]&&(T=E.as||d,delete E.as),O&&T[0]&&O(E),w(T,E)}return m?m(C):C}}t.glob=g,t.keyframes=b})(w2);var uj=_e&&_e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_2,"__esModule",{value:!0});const cj=uj(Qe),w_=w2;(0,w_.setup)(cj.default.createElement),_2.default=w_.styled;(function(t){var e=_e&&_e.__createBinding||(Object.create?function(L,M,D,B){B===void 0&&(B=D);var V=Object.getOwnPropertyDescriptor(M,D);V&&!("get"in V?!M.__esModule:V.writable||V.configurable)||(V={enumerable:!0,get:function(){return M[D]}}),Object.defineProperty(L,B,V)}:function(L,M,D,B){B===void 0&&(B=D),L[B]=M[D]}),n=_e&&_e.__setModuleDefault||(Object.create?function(L,M){Object.defineProperty(L,"default",{enumerable:!0,value:M})}:function(L,M){L.default=M}),r=_e&&_e.__importStar||function(L){if(L&&L.__esModule)return L;var M={};if(L!=null)for(var D in L)D!=="default"&&Object.prototype.hasOwnProperty.call(L,D)&&e(M,L,D);return n(M,L),M},i=_e&&_e.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLElement=t.setQuillContent=t.createQuill=t.quillRef=void 0;const o=i(Qe),a=ti,l=Io,s=i(TD),f=i(ki),h=r(Qi),x=Qr,w=ef,v=Zy,O=Jc,g=g2,b=Rl,p=Ml,y=Qc,d=i(_2),m=Yi,_=e2,A=r(iu),C=Na,R=f2;t.quillRef=h.observable({enabled:!1,currentFormat:{},editor:h.observable.object({instance:null},{},{deep:!1})});const S=(0,d.default)("div",o.default.forwardRef)`
207
- .ql-editor {
208
- outline: none;
209
- }
210
- ${g.resetStyleContent}
211
- strong {
212
- font-weight: 700;
213
- }
214
- .ql-direction-rtl {
215
- direction: rtl;
216
- }
217
- `,E=L=>new s.default(L,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:["bold","color","font","italic","size","strike","underline","indent","list","direction"]});t.createQuill=E;const P=(L,M)=>{var D=L.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+M+"<p><br></p></div>");L.setContents(D),L.history.clear()};t.setQuillContent=P;const T=({html:L,onBlur:M,onChange:D,element:B})=>{const V=o.default.useRef(null);o.default.useEffect(()=>{if(!V.current)return;const F=(0,t.createQuill)(V.current);return h.runInAction(()=>{t.quillRef.editor.instance=F}),window.__polotnoQuill=F,F.on("text-change",()=>{F.getSelection()&&h.runInAction(()=>{t.quillRef.currentFormat=F.getFormat()}),setTimeout(()=>{var $;const z=($=V.current)===null||$===void 0?void 0:$.childNodes[0];D(z.innerHTML)},10)}),F.setSelection(0,0,"api"),F.on("selection-change",$=>{$||M(),$&&h.runInAction(()=>{t.quillRef.currentFormat=F.getFormat()})}),V.current.childNodes[0].addEventListener("blur",$=>{var z;!((z=$.relatedTarget)===null||z===void 0)&&z.classList.contains("ql-clipboard")||M()}),()=>{h.runInAction(()=>{t.quillRef.editor.instance=null,t.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),o.default.useEffect(()=>{var F;const $=t.quillRef.editor.instance;if(!$)return;const z=$.getSelection();((F=V.current)===null||F===void 0?void 0:F.childNodes[0].innerHTML)===B.text||((0,t.setQuillContent)($,L),z&&($.setSelection(z.index,z.length),h.runInAction(()=>{t.quillRef.currentFormat=$.getFormat()})))},[B.text]);const Y={color:B.fill};return B.fill.indexOf("gradient")>=0&&(Y.backgroundColor=B.fill,Y.backgroundImage=B.fill,Y.backgroundSize="100% 100%",Y.backgroundRepeat="repeat",Y.webkitBackgroundClip="text",Y.MozBackgroundClip="text",Y.WebkitTextFillColor="transparent",Y.MozTextFillColor="transparent"),o.default.createElement(S,{ref:V,style:Object.assign(Object.assign({},Y),{fontSize:B.fontSize,width:B.a.width,fontFamily:B.fontFamily,lineHeight:B.lineHeight,letterSpacing:B.letterSpacing+"rem",textAlign:B.align}),dir:(0,v.getDir)((0,_.removeTags)(B.text))})};function N(L,M,D){return o.default.useMemo(()=>(0,g.detectSize)(L),[L,M.width,D])}function U(L){const M=L.getContext("2d").getImageData(0,0,L.width,L.height).data;for(let D=0;D<M.length;D+=4)if(M[D+3]!==0)return!0;return!1}function G(L){return!U(L)}function Z(L,{fontFamily:M="",color:D="black"}={}){let B=`color: ${D||L.fill}`;return L.fill.indexOf("gradient")>=0&&(B=`
218
- background-color: ${D};
219
- background-image: ${L.fill};
220
- background-size: 100% 100%;
221
- background-repeat: repeat;
222
- -webkit-background-clip: text;
223
- -moz-background-clip: text;
224
- -webkit-text-fill-color: transparent;
225
- -moz-text-fill-color: transparent;
226
- `),`<div style="${["white-space: pre-wrap",`width: ${Math.round(L.width||100)}px`,B,`font-size: ${L.fontSize}px`,`font-family: '${M}'`,`text-align: ${L.align}`,L.textDecoration?`text-decoration: ${L.textDecoration}`:"",L.lineHeight?`line-height: ${L.lineHeight}`:"",L.letterSpacing?`letter-spacing: ${L.letterSpacing}rem`:"",L.fontStyle?`font-style: ${L.fontStyle}`:"",L.fontWeight?`font-weight: ${L.fontWeight}`:"",L.strokeWidth?`-webkit-text-stroke: ${L.strokeWidth}px ${L.stroke}`:"",L.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,v.getDir)((0,_.removeTags)(L.text))}">${L.text.replaceAll(`
227
- `,"</br>")}</div>`}const W=L=>{let M=L.fontSize;for(let D=1;D<50;D++){const B=Z(Object.assign(Object.assign({},L.toJSON()),{fontSize:M}),{fontFamily:L.fontFamily}),{height:V}=(0,g.detectSize)(B),Y=L.height&&V>L.height,F=(0,g.isContentWrapping)({html:B});if(!(Y||F))break;M-=.5}return M},H=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);t.HTMLElement=(0,a.observer)(({element:L,store:M})=>{const D=o.default.useRef(null),[B,V]=o.default.useState(),[Y,F]=o.default.useState(!1),[$,z]=o.default.useState(!0),[K,X]=o.default.useState(!1),Q=o.default.useRef(L.height),J=M.selectedShapes.indexOf(L)>=0,ne=L.fontSize/3,{textVerticalResizeEnabled:ie}=x.flags,oe=(0,v.usePrevious)(L.fontFamily),[de]=(0,v.useFontLoader)(M,L.fontFamily),me=L._editModeEnabled;(0,b.useFadeIn)(D);const Pe=de?L.fontFamily:oe!==L.fontFamily?oe:"Arial",re=(0,O.useColor)(L).fill,ae=Z(L,{fontFamily:Pe,color:re}),{width:we,height:be}=N(ae,L,de);o.default.useEffect(()=>{if(!de)return;if(!L.height)return void L.set({height:be});const{textOverflow:Ae}=x.flags;if(Ae!=="change-font-size"||Y)Ae==="resize"&&(ie&&L.height<be&&M.history.ignore(()=>{L.set({height:be})}),ie||L.height===be||M.history.ignore(()=>{L.set({height:be})}));else{const Ce=W(L);Ce!==L.fontSize?M.history.ignore(()=>{L.set({fontSize:Ce})}):L.height!==be&&(ie&&L.height<be?M.history.ignore(()=>{L.set({height:be})}):ie||M.history.ignore(()=>{L.set({height:be})}))}});const te=o.default.useRef(0),fe=o.default.useMemo(()=>{const Ae={lastArgs:null,lastResult:null};return async function(Ce){return Ae.lastArgs&&Ae.lastResult&&(Me=Ae.lastArgs,ze=Ce,JSON.stringify(Me)===JSON.stringify(ze))||(Ae.lastResult=await(0,g.htmlToCanvas)(Ce),Ae.lastArgs=Object.assign({},Ce)),Ae.lastResult;var Me,ze}},[]);o.default.useEffect(()=>{Y||me||(async()=>{te.current++;const Ae=te.current,Ce=(0,m.incrementLoader)(`text ${L.id}`);z(!0);let Me=null;const ze=H?5:1;for(let We=0;We<ze;We++){if(Me=await(We>0?fe:g.htmlToCanvas)({skipCache:We>0,html:ae,width:L.width||1,height:L.height||be||1,fontFamily:Pe,padding:ne,pixelRatio:M._elementsPixelRatio,font:M.fonts.find(mt=>mt.fontFamily===Pe)||A.globalFonts.find(mt=>mt.fontFamily===Pe)}),Ae!==te.current)return void Ce();G(Me)&&H&&await new Promise(mt=>setTimeout(mt,50*(We+1)))}Me?(V(Me),z(!1),f.default.Util.requestAnimFrame(Ce)):Ce()})()},[ae,Y,be,me,Pe,L.height,M._elementsPixelRatio,de]);const he=Y||$;o.default.useEffect(()=>h.autorun(()=>{const Ae=D.current;(0,w.applyFilter)(Ae,L)}),[B,he,L.shadowColor,L.shadowOffsetX,L.shadowOffsetY,L.shadowOpacity]);let Ee=0;L.verticalAlign==="middle"&&(Ee=(L.height-be)/2),L.verticalAlign==="bottom"&&(Ee=L.height-be);const Ve=(0,v.getLineHeight)({fontLoaded:de,fontFamily:L.fontFamily,fontSize:L.fontSize,lineHeight:L.lineHeight}),Je=(0,C.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,o.default.createElement(l.Rect,{x:L.a.x,y:L.a.y,offsetX:L.backgroundPadding*(L.fontSize*Ve*.5),offsetY:L.backgroundPadding*(L.fontSize*Ve*.5),rotation:L.a.rotation,hideInExport:!L.showInExport,listening:!1,visible:L.backgroundEnabled,opacity:L.backgroundOpacity*L.a.opacity,fill:L.backgroundColor,width:L.a.width+L.backgroundPadding*(L.fontSize*Ve),height:L.a.height+L.backgroundPadding*(L.fontSize*Ve),cornerRadius:L.backgroundCornerRadius*(L.fontSize*Ve*.5)}),o.default.createElement(l.Rect,{ref:D,name:"element",x:L.a.x,y:L.a.y,listening:L.selectable,rotation:L.a.rotation,width:L.a.width,height:L.a.height,visible:!he,draggable:Je?L.draggable&&J:L.draggable,preventDefault:!Je||J,opacity:me?0:L.a.opacity,hideInExport:!L.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:Ae=>{L.set({x:Ae.target.x(),y:Ae.target.y()})},onDragEnd:Ae=>{L.set({x:Ae.target.x(),y:Ae.target.y()})},id:L.id,onDblClick:()=>{L.contentEditable&&L.toggleEditMode(!0)},onDblTap:()=>{L.contentEditable&&L.toggleEditMode(!0)},onTransformStart:Ae=>{F(!0),Q.current=L.height},onTransform:Ae=>{var Ce;const Me=Ae.target,ze=((Ce=Me.getStage())===null||Ce===void 0?void 0:Ce.findOne("Transformer")).getActiveAnchor(),We=ze==="middle-left"||ze==="middle-right",St=ze==="top-center"||ze==="bottom-center",mt=Me.scaleX();if(We){const ue=Me.scaleX(),ce=Math.max(Me.width()*ue,L.fontSize);if(Me.width(ce),Me.scaleX(1),x.flags.textVerticalResizeEnabled){const Se=Math.max(be,Q.current);L.set({height:Se})}L.set({width:ce,x:Me.x(),y:Me.y()})}else if(St){let ue=x.flags.textOverflow==="resize"?be:L.lineHeight*L.fontSize;const ce=Math.max(ue,Ae.target.height()*Ae.target.scaleY());Me.scaleY(1),L.set({x:Me.x(),y:Me.y(),height:ce,rotation:Me.rotation()})}else Me.scaleX(1),Me.scaleY(1),L.set({fontSize:L.fontSize*mt,width:Me.width()*mt,x:Me.x(),y:Me.y(),rotation:Me.rotation(),height:Me.height()*mt})},onTransformEnd:Ae=>{F(!1),z(!0);const Ce=Ae.target.scaleX();Ae.target.scaleX(1),Ae.target.scaleY(1),L.set({fontSize:L.fontSize*Ce,width:Ae.target.width()*Ce,x:Ae.target.x(),y:Ae.target.y(),rotation:Ae.target.rotation(),shadowBlur:L.shadowBlur*Ce,shadowOffsetX:L.shadowOffsetX*Ce,shadowOffsetY:L.shadowOffsetY*Ce,strokeWidth:L.strokeWidth*Ce})}}),o.default.createElement(l.Image,{ref:D,image:B,x:L.a.x,y:L.a.y,offsetX:ne,offsetY:ne-Ee,listening:!1,rotation:L.rotation,width:L.a.width+2*ne,height:L.a.height+2*ne,visible:!he,opacity:me?0:L.a.opacity,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur,shadowOffsetX:L.shadowOffsetX,shadowOffsetY:L.shadowOffsetY,shadowColor:L.shadowColor,shadowOpacity:L.shadowOpacity,hideInExport:!L.showInExport}),he&&o.default.createElement(l.Group,{x:L.a.x,y:L.a.y,rotation:L.rotation,offsetY:-Ee},o.default.createElement(y.Html,{divProps:{style:{pointerEvents:"none"}}},o.default.createElement(S,{dangerouslySetInnerHTML:{__html:ae},style:{pointerEvents:"none",display:"inline-block"}}))),me&&o.default.createElement(l.Group,{x:L.a.x,y:L.a.y,rotation:L.rotation,offsetY:-Ee},o.default.createElement(y.Html,null,o.default.createElement(T,{html:ae,element:L,onChange:Ae=>{const Ce=(0,R.getLimitedFontSize)({oldText:(0,_.removeTags)(L.text),newText:(0,_.removeTags)(Ae),element:L});L.set({text:Ae,fontSize:Ce})},onBlur:Ae=>{L.toggleEditMode(!1)}}))),(J||K)&&o.default.createElement(p.Highlighter,{element:L}))})})(iS);var fS={},S2={},su={};(function(t){function e(s){return s/180*Math.PI}function n(s,f,h,x,w){const v=Math.sqrt(h*h+x*x);return w+=Math.atan2(x,h),{x:s+v*Math.cos(w),y:f+v*Math.sin(w)}}function r(s){const{x:f,y:h,width:x,height:w}=s,v=e(s.rotation),O=n(f,h,0,0,v),g=n(f,h,x,0,v),b=n(f,h,x,w,v),p=n(f,h,0,w,v),y=Math.min(O.x,g.x,b.x,p.x),d=Math.min(O.y,g.y,b.y,p.y),m=Math.max(O.x,g.x,b.x,p.x),_=Math.max(O.y,g.y,b.y,p.y);return{x:y,y:d,width:m-y,height:_-d,minX:y,minY:d,maxX:m,maxY:_}}function i(s){const f=s.map(O=>r(O)),h=Math.min(...f.map(O=>O.minX)),x=Math.min(...f.map(O=>O.minY)),w=Math.max(...f.map(O=>O.maxX)),v=Math.max(...f.map(O=>O.maxY));return{x:h,y:x,width:w-h,height:v-x,minX:h,minY:x,maxX:w,maxY:v}}function o(s){const f=e(s.rotation||0);return{x:s.x+s.width/2*Math.cos(f)+s.height/2*Math.sin(-f),y:s.y+s.height/2*Math.cos(f)+s.width/2*Math.sin(f)}}function a(s,f,h){const x=e(f),w=h.x+(s.x-h.x)*Math.cos(x)-(s.y-h.y)*Math.sin(x),v=h.y+(s.x-h.x)*Math.sin(x)+(s.y-h.y)*Math.cos(x);return Object.assign(Object.assign({},s),{rotation:s.rotation+f,x:w,y:v})}function l(s,f){return a(s,f,o(s))}Object.defineProperty(t,"__esModule",{value:!0}),t.degToRad=e,t.getClientRect=r,t.getTotalClientRect=i,t.getCenter=o,t.rotateAroundPoint=a,t.rotateAroundCenter=l})(su);(function(t){var e=_e&&_e.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(t,"__esModule",{value:!0}),t.setSnapFilterFunc=void 0,t.useSnap=h,t.useAnchorSnap=w;const n=e(Qe),r=e(ki),i=su;var o=5;let a=({targetKonvaNodes:v,guideKonvaNode:O,distance:g,snapDirection:b})=>g<o;const l=v=>{a=v};function s(v){const O=v.__getNodeRect(),g=(0,i.getClientRect)(Object.assign(Object.assign({},O),{rotation:r.default.Util.radToDeg(O.rotation)})),b=v.getAbsolutePosition();return{vertical:[{guide:g.x,offset:b.x-g.x,snap:"start",nodes:v.nodes()},{guide:g.x+g.width/2,offset:b.x-g.x-g.width/2,snap:"center",nodes:v.nodes()},{guide:g.x+g.width,offset:b.x-g.x-g.width,snap:"end",nodes:v.nodes()}],horizontal:[{guide:g.y,offset:b.y-g.y,snap:"start",nodes:v.nodes()},{guide:g.y+g.height/2,offset:b.y-g.y-g.height/2,snap:"center",nodes:v.nodes()},{guide:g.y+g.height,offset:b.y-g.y-g.height,snap:"end",nodes:v.nodes()}]}}function f(v,O){var g=[],b=[];v.vertical.forEach(A=>{O.vertical.forEach(C=>{var R=Math.abs(A.offset-C.guide);a({targetKonvaNodes:C.nodes,guideKonvaNode:A.node,distance:R,snapDirection:A.snap})&&g.push({lineGuide:A.offset,diff:R,snap:C.snap,offset:C.offset})})}),v.horizontal.forEach(A=>{O.horizontal.forEach(C=>{var R=Math.abs(A.offset-C.guide);a({targetKonvaNodes:C.nodes,guideKonvaNode:A.node,distance:R,snapDirection:A.snap})&&b.push({lineGuide:A.offset,diff:R,snap:C.snap,offset:C.offset})})});var p=[];const y=g.sort((A,C)=>A.diff-C.diff),d=b.sort((A,C)=>A.diff-C.diff);var m=y[0],_=d[0];return m&&y.filter(A=>Math.abs(A.diff-m.diff)<.1).forEach(A=>{p.push(Object.assign({orientation:"V"},A))}),_&&d.filter(A=>Math.abs(A.diff-_.diff)<.1).forEach(A=>{p.push(Object.assign({orientation:"H"},A))}),p}function h(v,O){const g=n.default.useRef(),b=A=>A.hasName("element")||A.hasName("page-background")||!g.current&&A.hasName("elements-area");function p(A){var C;const R=(C=v.current)===null||C===void 0?void 0:C.getStage(),S=[],E=[];return R.find(b).forEach(P=>{if(!(A.indexOf(P)>=0)){var T=P.getClientRect({skipShadow:!0,skipStroke:!0});S.push({offset:T.x,node:P,snap:"start"},{offset:T.x+T.width,node:P,snap:"end"},{offset:T.x+T.width/2,node:P,snap:"center"}),E.push({offset:T.y,node:P,snap:"start"},{offset:T.y+T.height,node:P,snap:"end"},{offset:T.y+T.height/2,node:P,snap:"center"})}}),{vertical:S,horizontal:E}}function y(A){var C;const R=(C=v.current)===null||C===void 0?void 0:C.getLayer(),S=R==null?void 0:R.children.find(E=>E.name()==="line-guides");A.forEach(E=>{if(E.orientation==="H"){var P=new r.default.Line({points:[-6e3,E.lineGuide,6e3,E.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});S==null||S.add(P),R.batchDraw()}else E.orientation==="V"&&(P=new r.default.Line({points:[E.lineGuide,-6e3,E.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),S==null||S.add(P))})}const d=A=>{const C=A.target.getLayer().children.find(N=>N.name()==="line-guides");C==null||C.destroyChildren();var R=f(p(A.target.nodes()),s(A.target));if(!R.length)return;y(R);const S=A.target.getAbsolutePosition(),E=(A.target.nodes().map(N=>N.getAbsolutePosition()),Object.assign({},S));R.forEach(N=>{switch(N.snap){case"start":case"center":case"end":switch(N.orientation){case"V":E.x=N.lineGuide+N.offset;break;case"H":E.y=N.lineGuide+N.offset}}});const P=E.x-S.x,T=E.y-S.y;A.evt.ctrlKey||A.evt.metaKey||A.target.nodes().forEach(N=>{const U=N.getAbsolutePosition();N.setAbsolutePosition({x:U.x+P,y:U.y+T})})},m=(A,C,R)=>{const S=v.current,E=S.getLayer(),P=E.children.find(W=>W.name()==="line-guides");if(P==null||P.destroyChildren(),S.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(C.x-A.x,2)+Math.pow(C.y-A.y,2))>50||!E)return C;var T=f(p(S.nodes()),{vertical:[{guide:C.x,offset:0,snap:"start",nodes:S.nodes()}],horizontal:[{guide:C.y,offset:0,snap:"start",nodes:S.nodes()}]});if(!T.length||(y(T),R.ctrlKey||R.metaKey))return C;let N=C.x,U=C.x;T.forEach(W=>{switch(W.orientation){case"V":N=W.lineGuide;break;case"H":U=W.lineGuide}});const G=Math.abs(C.x-N)<10,Z=Math.abs(C.y-U)<10;return G&&!Z?{x:N,y:A.y}:Z&&!G?{x:A.x,y:U}:G&&Z?{x:N,y:U}:C},_=A=>{if(!A.target)return;const C=A.target.getLayer(),R=C.children.find(S=>S.name()==="line-guides");R==null||R.destroyChildren(),C.batchDraw()};n.default.useEffect(()=>{v.current&&(v.current.anchorDragBoundFunc(m),v.current.on("dragstart",A=>{setTimeout(()=>{if(r.default.DD._dragElements.size===0)return;const C=[...r.default.DD._dragElements.entries()],R=C.find(([S,E])=>E.node instanceof r.default.Transformer);R&&(C.splice(C.indexOf(R),1),C.unshift(R),r.default.DD._dragElements.clear(),C.forEach(([S,E])=>{r.default.DD._dragElements.set(S,E)}))})}),v.current.on("dragmove",d),v.current.on("dragend",_),v.current.on("transformend",_),v.current.on("transform",A=>{var C,R;A.evt.ctrlKey||A.evt.metaKey?(C=v.current)===null||C===void 0||C.rotationSnapTolerance(0):(R=v.current)===null||R===void 0||R.rotationSnapTolerance(5)}))},[])}function x(v){return{vertical:[{guide:v.absolutePosition().x,offset:0,snap:"center",nodes:[v]}],horizontal:[{guide:v.absolutePosition().y,offset:0,snap:"center",nodes:[v]}]}}function w(v,O,g){const b=d=>d.hasName("element")||d.hasName("line-anchor")||d.hasName("page-background")||d.hasName("elements-area"),p=d=>{const m=d.target.getLayer().children.find(E=>E.name()==="line-guides");m==null||m.destroyChildren();var _=f(function(E){var P;const T=(P=v.current)===null||P===void 0?void 0:P.getStage();var N=[],U=[];return T.find(b).forEach(G=>{if(!(E.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,...O.map(E=>E.current)]),x(d.target));if(!_.length)return;(function(E){var P;const T=(P=v.current)===null||P===void 0?void 0:P.getLayer(),N=T==null?void 0:T.children.find(U=>U.name()==="line-guides");E.forEach(U=>{if(U.orientation==="H"){var G=new r.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),T.batchDraw()}else U.orientation==="V"&&(G=new r.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 A=d.target.getAbsolutePosition(),C=Object.assign({},A);_.forEach(E=>{switch(E.snap){case"start":case"center":case"end":switch(E.orientation){case"V":C.x=E.lineGuide+E.offset;break;case"H":C.y=E.lineGuide+E.offset}}});const R=C.x-A.x,S=C.y-A.y;if(!(d.evt.ctrlKey||d.evt.metaKey)){const E=d.target.getAbsolutePosition();d.target.absolutePosition({x:E.x+R,y:E.y+S})}},y=d=>{if(!d.target)return;const m=d.target.getLayer(),_=m.children.find(A=>A.name()==="line-guides");_==null||_.destroyChildren(),m.batchDraw()};n.default.useEffect(()=>{v.current&&(v.current.on("dragmove",p),v.current.on("dragend",y))},g)}t.setSnapFilterFunc=l})(S2);(function(t){var e=_e&&_e.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(t,"__esModule",{value:!0}),t.LineElement=void 0,t.getMiddlePoints=h,t.getLinePositionFromMiddlePoints=x;const n=e(Qe),r=ti,i=Io,o=Jc,a=Qc,l=Ml,s=S2,f=Na;function h(O){const{x:g,y:b,width:p,height:y,rotation:d}=O.a,m=d*Math.PI/180,_={x:g+y/2*Math.cos(m+Math.PI/2),y:b+y/2*Math.sin(m+Math.PI/2)};return{middleLeft:_,middleRight:{x:_.x+p*Math.cos(m),y:_.y+p*Math.sin(m)}}}function x(O,g,b){const p=Math.sqrt(Math.pow(g.x-O.x,2)+Math.pow(g.y-O.y,2)),y=Math.atan2(g.y-O.y,g.x-O.x),d=180*y/Math.PI;return{x:O.x+Math.cos(y-Math.PI/2)*b/2,y:O.y+Math.sin(y-Math.PI/2)*b/2,width:p,height:b,rotation:d}}const w=(O,g)=>({offsetX:5/O,offsetY:5/O,width:10/O,height:10/O,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:b=>{b.target.getStage().container().style.cursor="crosshair"},onMouseLeave:b=>{b.target.getStage().container().style.cursor=""},onDragStart:b=>{g.history.startTransaction()},onDragEnd:b=>{g.history.endTransaction()}}),v=(0,r.observer)(({element:O,type:g})=>{const b=(0,o.useColor)(O,O.a.color,"fill"),p=(0,o.useColor)(O,O.a.color,"stroke"),y=Object.assign(Object.assign(Object.assign({strokeWidth:O.height,lineCap:"round",lineJoin:"round"},p),b),{opacity:O.a.opacity,hideInExport:!O.showInExport});return n.default.createElement(n.default.Fragment,null,g==="arrow"&&n.default.createElement(i.Line,Object.assign({points:[3*O.height,2*-O.height,0,0,3*O.height,2*O.height]},y)),g==="triangle"&&n.default.createElement(i.Line,Object.assign({points:[3*O.height,2*-O.height,0,0,3*O.height,2*O.height],closed:!0},y)),g==="bar"&&n.default.createElement(i.Line,Object.assign({points:[0,2*-O.height,0,2*O.height],closed:!0},y)),g==="square"&&n.default.createElement(i.Line,Object.assign({points:[0,2*-O.height,4*O.height,2*-O.height,4*O.height,2*O.height,0,2*O.height],closed:!0},y)),g==="circle"&&n.default.createElement(i.Circle,Object.assign({x:2*O.height,y:0,radius:2*O.height},y)))});t.LineElement=(0,r.observer)(({element:O,store:g})=>{const b=n.default.useRef(null),p=n.default.useRef(null),y=n.default.useRef(null),d=O.selectable||g.role==="admin",m=(0,f.isTouchDevice)(),[_,A]=n.default.useState(!1),C=g.selectedElements.indexOf(O)>=0&&g.selectedElements.length===1,R=g.selectedShapes.indexOf(O)>=0,{middleLeft:S,middleRight:E}=h(O);(0,s.useAnchorSnap)(p,[b],[C]),(0,s.useAnchorSnap)(y,[b],[C]);const P=(0,o.useColor)(O,O.a.color,"stroke");return n.default.createElement(n.default.Fragment,null,n.default.createElement(i.Line,Object.assign({ref:b,name:"element",id:O.id,x:O.a.x,y:O.a.y,points:[0,0,O.a.width,0],offsetY:-O.a.height/2,strokeWidth:O.a.height,hitStrokeWidth:Math.max(O.a.height,20),dash:O.dash.map(T=>T*O.a.height)},P,{rotation:O.a.rotation,opacity:O.animated("opacity"),shadowEnabled:O.shadowEnabled,shadowBlur:O.shadowBlur,shadowOffsetX:O.shadowOffsetX,shadowOffsetY:O.shadowOffsetY,shadowColor:O.shadowColor,shadowOpacity:O.shadowOpacity,listening:d,draggable:m?O.draggable&&R:O.draggable,preventDefault:!m||R,hideInExport:!O.showInExport,onMouseEnter:()=>{A(!0)},onMouseLeave:()=>{A(!1)},onDragMove:T=>{O.set({x:T.target.x(),y:T.target.y()})},onDragEnd:T=>{O.set({x:T.target.x(),y:T.target.y()})},onTransform:T=>{const N=T.target.scaleX();T.target.scaleX(1),T.target.scaleY(1),O.set({height:O.height*N,width:O.width*N,x:T.target.x(),y:T.target.y(),rotation:T.target.rotation()})}})),n.default.createElement(i.Group,{x:S.x,y:S.y,rotation:O.rotation,hideInExport:!O.showInExport},n.default.createElement(v,{element:O,type:O.startHead})),n.default.createElement(i.Group,{x:E.x,y:E.y,rotation:O.rotation+180},n.default.createElement(v,{element:O,type:O.endHead})),(_||R&&!C)&&n.default.createElement(l.Highlighter,{element:O}),C&&O.resizable&&n.default.createElement(a.Portal,{selector:".page-abs-container",enabled:!0},n.default.createElement(i.Group,{visible:C},n.default.createElement(i.Rect,Object.assign({x:S.x,y:S.y,ref:p,name:"line-anchor"},w(g.scale,g),{onDragMove:T=>{const N=x(T.target.position(),E,O.height);O.set({x:N.x,y:N.y,width:N.width,rotation:N.rotation})}})),n.default.createElement(i.Rect,Object.assign({x:E.x,y:E.y,ref:y,name:"line-anchor"},w(g.scale,g),{onDragMove:T=>{const N=x(S,T.target.position(),O.height);O.set({x:N.x,y:N.y,width:N.width,rotation:N.rotation})}})))))})})(fS);var dS={};(function(t){var e=_e&&_e.__createBinding||(Object.create?function(L,M,D,B){B===void 0&&(B=D);var V=Object.getOwnPropertyDescriptor(M,D);V&&!("get"in V?!M.__esModule:V.writable||V.configurable)||(V={enumerable:!0,get:function(){return M[D]}}),Object.defineProperty(L,B,V)}:function(L,M,D,B){B===void 0&&(B=D),L[B]=M[D]}),n=_e&&_e.__setModuleDefault||(Object.create?function(L,M){Object.defineProperty(L,"default",{enumerable:!0,value:M})}:function(L,M){L.default=M}),r=_e&&_e.__importStar||function(L){if(L&&L.__esModule)return L;var M={};if(L!=null)for(var D in L)D!=="default"&&Object.prototype.hasOwnProperty.call(L,D)&&e(M,L,D);return n(M,L),M},i=_e&&_e.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoElement=t.useImageLoader=t.setImageLoaderHook=void 0;const o=i(Qe),a=ti,l=Qi,s=Io,f=i(Yp),h=i(ki),x=Qc,w=Ml,v=Yi,O=r(au),g=Qr,b=ef,p=Rl,y=Na;function d(){return document.createElement("canvas")}async function m(L){if(!(L.indexOf("data:image/svg+xml")>=0||L.indexOf(".svg")>=0))return L;const M=await O.urlToString(L),D=O.fixSize(M);return O.svgToURL(D)}const _=L=>{const[M,D]=o.default.useState(L);return o.default.useEffect(()=>{(async()=>{const B=await m(L);B!==M&&D(B)})()},[L]),M},A=new window.Image;A.src=O.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="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"/>
230
- <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"/>
231
- </svg>
232
- `);const C=new window.Image;C.src=O.svgToURL(`
233
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
234
- <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"/>
235
- <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"/>
236
- <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"/>
237
- <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"/>
238
- </svg>
239
- `);function R(L,M,D,B,V,Y,F){for(var $=new ImageData(M,D),z=new Int32Array(L.data.buffer),K=L.width,X=new Int32Array($.data.buffer),Q=$.width,J=M/Y,ne=D/F,ie=Math.round(1/J),oe=Math.round(1/ne),de=ie*oe,me=0;me<$.height;me++)for(var Pe=0;Pe<Q;Pe++){for(var re=B+Math.round(Pe/J)+(V+Math.round(me/ne))*K,ae=0,we=0,be=0,te=0,fe=0;fe<oe;fe++)for(var he=0;he<ie;he++){var Ee=z[re+he+fe*K];ae+=Ee<<24>>>24,we+=Ee<<16>>>24,be+=Ee<<8>>>24,te+=Ee>>>24}ae=Math.round(ae/de),we=Math.round(we/de),be=Math.round(be/de),te=Math.round(te/de),X[Pe+me*Q]=te<<24|be<<16|we<<8|ae}return $}function S(L,M){var D,B;const V=d();V.width=L.width,V.height=L.height,(D=V.getContext("2d"))===null||D===void 0||D.drawImage(L,0,0,V.width,V.height);const Y=R(V.getContext("2d").getImageData(0,0,V.width,V.height),Math.floor(V.width*M),Math.floor(V.height*M),0,0,V.width,V.height);return V.width=Math.floor(V.width*M),V.height=Math.floor(V.height*M),(B=V.getContext("2d"))===null||B===void 0||B.putImageData(Y,0,0),V}const E=(L,M,D,B,V=0,Y=!1)=>{const F=Math.floor(Math.max(L.width*B,1)),$=Math.floor(Math.max(L.height*B,1)),z=Math.min(V*B,F/2,$/2),K=Math.max(L.width/D.width,L.height/D.height)*B,X=L.page._exportingOrRendering&&g.flags.imageDownScalingEnabled&&K<1&&!Y,Q=D.x===0&&D.y===0&&D.width===(M==null?void 0:M.width)&&D.height===(M==null?void 0:M.height),J=o.default.useMemo(()=>{if(!(!M||!M.width||!M.height))return Q&&z===0&&!X?void 0:d()},[M,z,X,Q]),ne=()=>{if(!J||!M)return;J.width=F,J.height=$;const ie=J.getContext("2d");if(!ie)return;z&&(ie.beginPath(),ie.moveTo(z,0),ie.lineTo(F-z,0),ie.arc(F-z,z,z,3*Math.PI/2,0,!1),ie.lineTo(F,$-z),ie.arc(F-z,$-z,z,0,Math.PI/2,!1),ie.lineTo(z,$),ie.arc(z,$-z,z,Math.PI/2,Math.PI,!1),ie.lineTo(0,z),ie.arc(z,z,z,Math.PI,3*Math.PI/2,!1),ie.clip());const oe=X?S(M,K):M,de=X?{x:Math.floor(D.x*K),y:Math.floor(D.y*K),width:Math.floor(D.width*K),height:Math.floor(D.height*K)}:D;ie.drawImage(oe,de.x,de.y,de.width,de.height,0,0,J.width,J.height)};return o.default.useLayoutEffect(()=>{ne()},[J,L.width,L.height,D.x,D.y,D.width,D.height,V,B,Y,L.page._exportingOrRendering,X]),o.default.useEffect(()=>()=>{J&&J.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(J)},[J]),[J||M,ne]},P=(L,M,D,B)=>{const V=_(L.clipSrc||""),[Y,F]=G(V,"anonymous"),$=L.clipSrc?F:"loaded";(0,t.useImageLoader)($,L.clipSrc,L.id);const z=o.default.useMemo(()=>{if(M&&Y)return d()},[M,Y]);function K(){var X;if(!Y||!M||!M.width||!M.height||!Y||!Y.width||!Y.height||!z)return;const Q=d(),J=Math.max(L.width/Y.width*D,L.height/Y.height*D);Q.width=Y.width*J,Q.height=Y.height*J,(X=Q.getContext("2d"))===null||X===void 0||X.drawImage(Y,0,0,Q.width,Q.height),z.width=Math.max(M.width,1),z.height=Math.max(M.height,1);const ne=z.getContext("2d");ne&&(ne.save(),ne.drawImage(Q,0,0,M.width,M.height),h.default.Util.releaseCanvas(Q),ne.globalCompositeOperation="source-in",ne.drawImage(M,0,0,z.width,z.height),ne.restore())}return o.default.useLayoutEffect(()=>{K()},[z,M,Y,L.width,L.height,D,...B]),[L.clipSrc&&Y?z:M,K]},T=d(),N=(0,a.observer)(({element:L})=>{const M=Math.min(30,L.width/4,L.height/4),D=o.default.useRef(null);return o.default.useEffect(()=>{const B=D.current;if(!B)return;const V=new h.default.Animation(Y=>{B.rotate(((Y==null?void 0:Y.timeDiff)||0)/2)},B.getLayer());return V.start(),()=>{V.stop()}}),o.default.createElement(s.Group,{x:L.a.x,y:L.a.y,rotation:L.a.rotation,listening:!1,opacity:L.a.opacity,hideInExport:!L.showInExport},o.default.createElement(s.Rect,{width:L.width,height:L.height,fill:"rgba(124, 173, 212, 0.8)"}),o.default.createElement(s.Arc,{ref:D,x:L.width/2,y:L.height/2,fill:"white",outerRadius:Math.abs(M),innerRadius:Math.max(1,M-5),angle:270}))}),U=(0,a.observer)(({element:L})=>{const M="Can not load the video...",D=Math.max(10,Math.min(30,L.width/25));return o.default.createElement(s.Group,{x:L.a.x,y:L.a.y,rotation:L.a.rotation,listening:!1,opacity:L.a.opacity,hideInExport:!L.showInExport},o.default.createElement(s.Rect,{width:L.width,height:L.height,fill:"rgba(223, 102, 102, 0.8)"}),o.default.createElement(s.Text,{text:M,fontSize:D,width:L.width,height:L.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let G=f.default;const Z=L=>{G=L};t.setImageLoaderHook=Z;const W=(L,M,D)=>{const B=o.default.useRef(),V=()=>{var Y;(Y=B.current)===null||Y===void 0||Y.call(B),B.current=void 0};o.default.useEffect(()=>V,[]),o.default.useLayoutEffect(()=>{const Y=M.slice(0,200),F=`video with id ${D} url: ${Y}`;L!=="loading"||B.current||(B.current=(0,v.incrementLoader)(F)),L!=="loading"&&V(),L==="failed"&&(0,v.triggerLoadError)(F)},[L])};t.useImageLoader=W;function H(L,M,D){const B=o.default.useRef("loading"),V=o.default.useRef(null),[Y,F]=o.default.useState(0),$=o.default.useRef(),z=o.default.useRef(),K=o.default.useRef();return $.current===L&&z.current===M&&K.current===D||(B.current="loading",V.current=void 0,$.current=L,z.current=M,K.current=D),o.default.useLayoutEffect(function(){if(L){var X=document.createElement("video");return X.addEventListener("canplay",Q),X.addEventListener("error",J),X.crossOrigin=M,X.src=L,X.load(),function(){X.removeEventListener("canplay",Q),X.removeEventListener("error",J)}}function Q(){B.current="loaded",V.current=X,V.current.currentTime=0,F(Math.random()),V.current.removeEventListener("canplay",Q)}function J(ne){B.current="failed",V.current=void 0,F(Math.random())}},[L,M,D]),[V.current,B.current]}t.VideoElement=(0,a.observer)(({element:L,store:M})=>{var D;const[B,V]=o.default.useState(!1),Y=o.default.useRef(null),F=o.default.useRef(null),[$,z]=o.default.useState(!1),K=M.selectedShapes.indexOf(L)>=0,[X,Q]=o.default.useState(!1),[J,ne]=H(L.src,"anonymous"),ie=M.activePage===L.page;(0,t.useImageLoader)(ne,L.src,L.id),J&&(J.width=J.videoWidth,J.height=J.videoHeight,J.playsInline=!0);const oe=J||T;o.default.useEffect(()=>{J&&M.history.ignore(()=>{L.set({duration:1e3*J.duration})})},[J]),o.default.useEffect(()=>{var ke;if(!J)return;const Ye=M.animatedElementsIds,at=(!Ye.length||Ye.includes(L.id))&&M.isPlaying,Ot=ie&&(at||X);if(!Ot)return void J.pause();Ot&&(J.currentTime=L.startTime*J.duration,J.play());const xt=new h.default.Animation(()=>{St()},(ke=Y.current)===null||ke===void 0?void 0:ke.getLayer());xt.start();const un=()=>{Q(!1),J.currentTime=L.startTime*J.duration},hn=()=>{J.currentTime>=L.endTime*J.duration&&(J.pause(),J.currentTime=L.startTime*J.duration,Q(!1))};return J.addEventListener("ended",un),J.addEventListener("timeupdate",hn),()=>{J.pause(),xt.stop(),J.removeEventListener("ended",un),J.removeEventListener("timeupdate",hn)}},[J,X,M.isPlaying,ie]),o.default.useEffect(()=>{J&&(J.volume=L.volume)},[J,L.volume]);const de=o.default.useRef();o.default.useEffect(()=>{const ke=(0,l.autorun)(()=>{var Ye,at;if(J){const Ot=M.animatedElementsIds;if(Ot.length&&!Ot.includes(L.id))return;const xt=(M.currentTime-L.page.startTime)%L.duration;if(Math.abs(1e3*J.currentTime-xt)>500||!M.isPlaying){const un=xt/1e3;un!==J.currentTime&&(J.currentTime=un),J.readyState!==4&&!M.isPlaying&&!de.current&&(de.current=(0,v.incrementLoader)(`video ${L.id}`))}St(),(at=(Ye=Y.current)===null||Ye===void 0?void 0:Ye.getLayer())===null||at===void 0||at.batchDraw()}});return()=>{ke(),de.current&&(de.current(),de.current=null)}},[M,J]),o.default.useEffect(()=>{if(!J)return;const ke=()=>{var at,Ot;J.readyState!==4&&L.page._exportingOrRendering||de.current&&(St(),(Ot=(at=Y.current)===null||at===void 0?void 0:at.getLayer())===null||Ot===void 0||Ot.batchDraw(),de.current(),de.current=null)};let Ye;return L.page._exportingOrRendering&&(Ye=setInterval(ke,50)),J.addEventListener("timeupdate",ke),J.addEventListener("canplay",ke),()=>{clearInterval(Ye),J.removeEventListener("timeupdate",ke),J.removeEventListener("canplay",ke)}},[L.page._exportingOrRendering,J,L.id,v.incrementLoader]);let{cropX:me,cropY:Pe,cropWidth:re,cropHeight:ae}=L;ne!=="loaded"&&(me=Pe=0,re=ae=1);const we=oe.width*re,be=oe.height*ae,te=L.width/L.height;let fe,he;const Ee=we/be,Ve=L.type==="svg";Ve?(fe=we,he=be):te>=Ee?(fe=we,he=we/te):(fe=be*te,he=be);const Je={x:oe.width*me,y:oe.height*Pe,width:fe,height:he},Ae=(D=L.cornerRadius)!==null&&D!==void 0?D:0,[Ce,Me]=E(L,oe,Je,M._elementsPixelRatio,Ae,B||L._cropModeEnabled||L.type==="svg");let[ze,We]=P(L,Ce,M._elementsPixelRatio,[Je,Ae,M._elementsPixelRatio]);function St(){Me(),We()}const mt=Math.max(L.width/fe,L.height/he);o.default.useEffect(()=>{var ke;if(!L._cropModeEnabled)return;const Ye=(ke=Y.current)===null||ke===void 0?void 0:ke.getStage();function at(xt){L._cropModeEnabled&&xt.target!==F.current&&L.toggleCropMode(!1)}function Ot(xt){L._cropModeEnabled&&xt.target.parentNode!==Ye.content&&L.toggleCropMode(!1)}return document.body.addEventListener("click",Ot),Ye==null||Ye.on("click",at),Ye==null||Ye.on("tap",at),()=>{document.body.removeEventListener("click",Ot),document.body.removeEventListener("touchstart",Ot),Ye==null||Ye.off("click",at),Ye==null||Ye.off("click",at)}},[L._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!(B||L._cropModeEnabled))return(0,b.applyFilter)(Y.current,L),(0,l.autorun)(()=>{(0,b.applyFilter)(Y.current,L)},{delay:100})},[oe,B,re,ae,L._cropModeEnabled]),o.default.useLayoutEffect(()=>{var ke;B||L._cropModeEnabled?(ke=Y.current)===null||ke===void 0||ke.clearCache():(0,b.applyFilter)(Y.current,L)},[B,L.width,L.height,L._cropModeEnabled]),o.default.useEffect(()=>{(0,b.applyFilter)(Y.current,L)},[L.shadowEnabled,L.shadowBlur,L.cornerRadius,L.shadowColor,L.shadowOffsetX,L.shadowOffsetY,L.shadowOpacity]);const ue=o.default.useRef(null),ce=o.default.useRef(null),Se=o.default.useRef(null);o.default.useLayoutEffect(()=>{L._cropModeEnabled&&(ce.current.nodes([ue.current]),Se.current.nodes([F.current]))},[L._cropModeEnabled]);const Le=ke=>{Math.round(ke.target.x())>0&&(ke.target.x(0),ke.target.scaleX(1)),Math.round(ke.target.y())>0&&(ke.target.y(0),ke.target.scaleY(1));const Ye=ke.target.width()*ke.target.scaleX(),at=ke.target.height()*ke.target.scaleY(),Ot=Math.min(1,fe/Ye),xt=Math.min(1,he/at),un=1-Ot,hn=Math.min(un,Math.max(0,Math.round(-ke.target.x())/Ye)),pn=1-xt,rr=Math.min(pn,Math.max(0,Math.round(-ke.target.y())/at));ke.target.setAttrs({x:-hn*oe.width,y:-rr*oe.height,scaleX:1,scaleY:1}),L.set({cropX:hn,cropY:rr,cropWidth:Ot,cropHeight:xt})},Ne=()=>{L.type!=="svg"&&L.contentEditable&&setTimeout(()=>{L.toggleCropMode(!0)})},ge=ne==="loading",Xe=ne==="failed",Oe=!ge&&!Xe,$e=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Wt=Oe?L.a.opacity:0;(0,p.useFadeIn)(Y,Wt);const Tt=L.selectable||M.role==="admin",Yt=(0,y.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,ge&&o.default.createElement(N,{element:L}),Xe&&o.default.createElement(U,{element:L}),o.default.createElement(s.Image,{ref:Y,name:"element",id:L.id,image:ze,x:L.a.x,y:L.a.y,width:L.a.width||1,height:L.a.height||1,rotation:L.a.rotation,opacity:Wt,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur,shadowOffsetX:L.shadowOffsetX,shadowOffsetY:L.shadowOffsetY,shadowColor:L.shadowColor,shadowOpacity:L.shadowOpacity,customCrop:Je,listening:Tt,draggable:Yt?L.draggable&&K:L.draggable,preventDefault:!Yt||K,hideInExport:!L.showInExport,onMouseEnter:()=>{z(!0)},onMouseLeave:()=>{z(!1)},onDragMove:ke=>{L.set({x:ke.target.x(),y:ke.target.y()})},onDragEnd:ke=>{L.set({x:ke.target.x(),y:ke.target.y()})},onDblClick:Ne,onDblTap:Ne,onTransformStart:()=>{V(!0),$e.current={cropX:L.cropX,cropY:L.cropY,cropWidth:L.cropWidth,cropHeight:L.cropHeight}},onTransform:ke=>{var Ye;const at=ke.currentTarget,Ot=Math.abs(at.scaleX()-1)<1e-7?1:at.scaleX(),xt=Math.abs(at.scaleY()-1)<1e-7?1:at.scaleY();at.scaleX(1),at.scaleY(1);const un=(Ye=ke.target.getStage())===null||Ye===void 0?void 0:Ye.findOne("Transformer"),hn=1-fe/oe.width,pn=Math.min(hn,Math.max(0,L.cropX)),rr=1-he/oe.height,to=Math.min(rr,Math.max(0,L.cropY)),wr=un.getActiveAnchor(),Ie=!(wr.indexOf("middle")>=0||wr.indexOf("center")>=0),et=!Ie&&Ot<1&&$e.current.cropHeight>he/oe.height;let ft=Ie?L.cropWidth:L.cropWidth*Ot;et&&(ft=L.cropWidth);const Ft=!Ie&&xt<1&&$e.current.cropWidth>fe/oe.width;let Pt=Ie?L.cropHeight:L.cropHeight*xt;Ft&&(Pt=L.cropHeight),Ve&&(ft=L.cropWidth,Pt=L.cropHeight),L.set({cropX:pn,cropY:to,x:at.x(),y:at.y(),width:at.width()*Ot,height:at.height()*xt,rotation:ke.target.rotation(),cropWidth:Math.min(ft,1-pn),cropHeight:Math.min(Pt,1-to)})},onTransformEnd:ke=>{const Ye=ke.currentTarget;L.set({width:Ye.width(),height:Ye.height(),x:Ye.x(),y:Ye.y(),rotation:ke.target.rotation(),cropWidth:fe/oe.width,cropHeight:he/oe.height}),V(!1)}}),o.default.createElement(s.Rect,{x:L.a.x,y:L.a.y,width:Math.max(L.a.width-L.borderSize,0),height:Math.max(L.a.height-L.borderSize,0),opacity:Wt,offsetX:-L.borderSize/2,offsetY:-L.borderSize/2,stroke:L.borderColor,strokeWidth:L.borderSize,listening:!1,visible:!!L.borderSize,rotation:L.rotation,cornerRadius:Math.max(0,Ae-L.borderSize),hideInExport:!L.showInExport}),!X&&!M.isPlaying&&o.default.createElement(s.Image,{image:A,x:L.a.x+L.a.width/2-15/M.scale,y:L.a.y+L.a.height/2-15/M.scale,width:30/M.scale,height:30/M.scale,hideInExport:!0,onClick:()=>{Q(!0)},onTap:()=>{Q(!0)}}),X&&!M.isPlaying&&o.default.createElement(s.Image,{image:C,x:L.a.x+L.a.width/2-15/M.scale,y:L.a.y+L.a.height/2-15/M.scale,width:30/M.scale,height:30/M.scale,hideInExport:!0,onClick:()=>{Q(!1)},onTap:()=>{Q(!1)}}),L._cropModeEnabled&&o.default.createElement(x.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(s.Rect,{x:-window.innerWidth/M.scale,y:-window.innerWidth/M.scale,width:window.innerWidth/M.scale*3,height:window.innerWidth/M.scale*3,fill:"rgba(0,0,0,0.3)"}),o.default.createElement(s.Image,{listening:!1,image:ze,x:L.a.x,y:L.a.y,width:L.a.width,height:L.a.height,rotation:L.a.rotation,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur}),o.default.createElement(s.Group,{x:L.a.x,y:L.a.y,rotation:L.a.rotation,scaleX:mt,scaleY:mt},o.default.createElement(s.Image,{image:oe,ref:F,opacity:.4,draggable:!0,x:-L.cropX*oe.width,y:-L.cropY*oe.height,onDragMove:Le,onTransform:Le}),o.default.createElement(s.Transformer,{ref:Se,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ke,Ye)=>Ye.width<5||Ye.height<5?ke:Ye,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),o.default.createElement(s.Rect,{width:fe,height:he,ref:ue,listening:!1,onTransform:ke=>{ke.target.x()<-L.cropX*oe.width-1e-9&&(ke.target.x(-L.cropX*oe.width),ke.target.scaleX(1)),ke.target.y()<-L.cropY*oe.height-1e-9&&(ke.target.y(-L.cropY*oe.height),ke.target.scaleY(1));const Ye=Math.min(1,Math.max(0,L.cropX+ke.target.x()/oe.width)),at=Math.min(1,Math.max(0,ke.target.y()/oe.height+L.cropY)),Ot=ke.target.width()*ke.target.scaleX(),xt=ke.target.height()*ke.target.scaleY(),un=Math.min(1-Ye,Ot/oe.width),hn=Math.min(1-at,xt/oe.height),pn=ke.target.getAbsolutePosition(ke.target.getParent().getParent());ke.target.scale({x:1,y:1}),ke.target.position({x:0,y:0}),L.set({x:pn.x,y:pn.y,cropX:Ye,cropY:at,cropWidth:un,cropHeight:hn,width:Math.min(Ot*mt,oe.width*(1-Ye)*mt),height:Math.min(xt*mt,oe.height*(1-at)*mt)})}}),o.default.createElement(s.Transformer,{ref:ce,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ke,Ye)=>Ye.width<5||Ye.height<5?ke:Ye,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),($||K)&&o.default.createElement(w.Highlighter,{element:L}))})})(dS);var hS={},Jp={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TYPES=t.circleData=t.rightTriangleData=t.triangleData=t.rectData=void 0,t.starPath=o,t.diamondPath=a,t.pentagonPath=l,t.hexagonPath=s,t.speechBubblePath=h,t.crossPath=x,t.subTypeToPathDataFunc=w,t.figureToSvg=O;const e=({width:g,height:b,cornerRadius:p})=>{if(p>0){const y=Math.min(p,g/2,b/2);return`M 0 ${y} A ${y} ${y} 0 0 1 ${y} 0 L ${g-y} 0 A ${y} ${y} 0 0 1 ${g} ${y} L ${g} ${b-y} A ${y} ${y} 0 0 1 ${g-y} ${b} L ${y} ${b} A ${y} ${y} 0 0 1 0 ${b-y} Z`}return`M 0 0 L ${g} 0 L ${g} ${b} L 0 ${b} Z`};t.rectData=e;const n=({width:g,height:b})=>`M ${g/2} 0 L ${g} ${b} L 0 ${b} Z`;t.triangleData=n;const r=({width:g,height:b})=>`M 0 0 L ${g} 0 L 0 ${b} Z`;t.rightTriangleData=r;const i=({width:g,height:b})=>`M ${g/2} ${b/2} m -${g/2}, 0 a ${g/2},${b/2} 0 1,0 ${g},0 a ${g/2},${b/2} 0 1,0 -${g},0`;function o({width:g,height:b}){const p=g/2,y=b/2,d=g/2,m=b/2,_=d/2,A=m/2;let C="",R=Math.PI/5;for(let S=0;S<10;S++){const E=S%2==0?m:A,P=p+(S%2==0?d:_)*Math.sin(S*R),T=y-E*Math.cos(S*R);S===0?C=`M ${P} ${T}`:C+=` L ${P} ${T}`}return C+" Z"}function a({width:g,height:b}){const p=g/2,y=b/2;return`M ${p} 0 L ${g} ${y} L ${p} ${b} L 0 ${y} Z`}function l({width:g,height:b}){const p=g/2,y=b/2,d=g/2,m=b/2;let _="",A=2*Math.PI/5;for(let C=0;C<5;C++){const R=m,S=p+d*Math.sin(C*A),E=y-R*Math.cos(C*A);C===0?_=`M ${S} ${E}`:_+=` L ${S} ${E}`}return _+" Z"}function s({width:g,height:b}){const p=g/2,y=b/2,d=g/2,m=b/2;let _="",A=2*Math.PI/6;for(let C=0;C<6;C++){const R=m,S=p+d*Math.sin(C*A),E=y-R*Math.cos(C*A);C===0?_=`M ${S} ${E}`:_+=` L ${S} ${E}`}return _+" Z"}function f({path:g,aspectRatio:b,width:p,height:y}){return{path:g,scaleX:p/b.width,scaleY:y/b.height}}function h({width:g,height:b}){const p=.1*Math.min(g,b),y=.2*g,d=.2*b,m=.5*g;let _=`M ${p},0`;return _+=" H "+(g-p),_+=` A ${p},${p} 0 0 1 ${g},${p}`,_+=" V "+(b-p-d),_+=` A ${p},${p} 0 0 1 ${g-p},${b-d}`,_+=` H ${m+y/2}`,_+=` L ${m},${b}`,_+=` L ${m-y/2},${b-d}`,_+=` H ${p}`,_+=` A ${p},${p} 0 0 1 0,${b-p-d}`,_+=` V ${p}`,_+=` A ${p},${p} 0 0 1 ${p},0`,_+=" Z",_}function x({width:g,height:b}){const p=.3*g,y=.3*b,d=g/2,m=b/2,_=d-p/2,A=d+p/2,C=m-y/2,R=m+y/2;let S=`M ${_},0 `;return S+=`H ${A} `,S+=`V ${C} `,S+=`H ${g} `,S+=`V ${R} `,S+=`H ${A} `,S+=`V ${b} `,S+=`H ${_} `,S+=`V ${R} `,S+="H 0 ",S+=`V ${C} `,S+=`H ${_} `,S+="V 0 ",S+="Z",S}function w(g){return t.TYPES[g]||t.rectData}function v(g,b){const{width:p,height:y,fill:d,stroke:m,strokeWidth:_,dash:A}=g,C=(A||[]).map(T=>T*_);let R=b(g),S=1,E=1;typeof R!="string"&&(S=R.scaleX,E=R.scaleY,R=R.path);const P=`clip-${g.id||Math.random()}`;return`
240
- <svg xmlns="http://www.w3.org/2000/svg" width="${p}" height="${y}">
241
- <defs>
242
- <clipPath id="${P}">
243
- <path d="${R}" />
244
- </clipPath>
245
- </defs>
246
-
247
- <!-- Path for the fill -->
248
- <path d="${R}" fill="${d}" transform="scale(${S}, ${E})"/>
249
-
250
- <!-- Path for the stroke, clipped by the star path -->
251
- <path d="${R}" fill="none" stroke="${m}" stroke-width="${2*_}" clip-path="url(#${P})" transform="scale(${S}, ${E})" stroke-dasharray="${C.join(" ")}"/>
252
- </svg>
253
- `}function O(g){const{subType:b}=g,p=w(b);return p?v(g,p):(console.error(`Polotno error: Can not convert ${g.subType} figure to svg.`),(0,t.rectData)(g))}t.circleData=i,t.TYPES={rect:t.rectData,circle:t.circleData,star:o,triangle:t.triangleData,rightTriangle:t.rightTriangleData,diamond:a,pentagon:l,hexagon:s,speechBubble:h,cross:x,arc:({width:g,height:b})=>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:g,height:b}),cloud:({width:g,height:b})=>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:g,height:b}),rightArrow:({width:g,height:b})=>{const p=.6*g;return`M 0 ${b/4} L ${p} ${b/4} L ${p} 0 L ${g} ${b/2} L ${p} ${b} L ${p} ${.75*b} L 0 ${.75*b} Z`},leftArrow:({width:g,height:b})=>{const p=.4*g;return`M ${g} ${b/4} L ${p} ${b/4} L ${p} 0 L 0 ${b/2} L ${p} ${b} L ${p} ${.75*b} L ${g} ${.75*b} Z`},downArrow:({width:g,height:b})=>{const p=.6*b;return`M ${g/4} 0 L ${g/4} ${p} L 0 ${p} L ${g/2} ${b} L ${g} ${p} L ${.75*g} ${p} L ${.75*g} 0 Z`},upArrow:({width:g,height:b})=>{const p=.4*b;return`M ${g/4} ${b} L ${g/4} ${p} L 0 ${p} L ${g/2} 0 L ${g} ${p} L ${.75*g} ${p} L ${.75*g} ${b} Z`},asterisk1:({width:g,height:b})=>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:g,height:b}),asterisk2:({width:g,height:b})=>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:g,height:b}),bookmark:({width:g,height:b})=>f({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:g,height:b}),butterfly:({width:g,height:b})=>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:g,height:b}),cylinder:({width:g,height:b})=>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:g,height:b}),diamond2:({width:g,height:b})=>f({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:g,height:b}),door:({width:g,height:b})=>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:g,height:b}),drop1:({width:g,height:b})=>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:g,height:b}),drop2:({width:g,height:b})=>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:g,height:b}),explosion:({width:g,height:b})=>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:g,height:b}),flag:({width:g,height:b})=>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:g,height:b}),flower:({width:g,height:b})=>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:g,height:b}),frame:({width:g,height:b})=>f({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:g,height:b}),heart1:({width:g,height:b})=>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:g,height:b}),home:({width:g,height:b})=>f({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:g,height:b}),home2:({width:g,height:b})=>f({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:g,height:b}),hourglass:({width:g,height:b})=>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:g,height:b}),house:({width:g,height:b})=>f({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:g,height:b}),keyhole:({width:g,height:b})=>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:g,height:b}),kiss:({width:g,height:b})=>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:g,height:b}),leaf:({width:g,height:b})=>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:g,height:b}),lightning1:({width:g,height:b})=>f({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:g,height:b}),lightning2:({width:g,height:b})=>f({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:g,height:b}),magnet:({width:g,height:b})=>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:g,height:b}),mithosis:({width:g,height:b})=>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:g,height:b}),orangeRicky:({width:g,height:b})=>f({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:g,height:b}),party:({width:g,height:b})=>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:g,height:b}),pillow:({width:g,height:b})=>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:g,height:b}),polygon:({width:g,height:b})=>f({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:g,height:b}),rainbow:({width:g,height:b})=>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:g,height:b}),rhodeIsland:({width:g,height:b})=>f({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:g,height:b}),shell:({width:g,height:b})=>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:g,height:b}),shield1:({width:g,height:b})=>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:g,height:b}),shield2:({width:g,height:b})=>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:g,height:b}),skewedRectangle:({width:g,height:b})=>f({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:g,height:b}),softFlower:({width:g,height:b})=>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:g,height:b}),softStar:({width:g,height:b})=>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:g,height:b}),stairs1:({width:g,height:b})=>f({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:g,height:b}),stairs2:({width:g,height:b})=>f({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:g,height:b}),teewee:({width:g,height:b})=>f({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:g,height:b}),blob1:({width:g,height:b})=>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:g,height:b}),blob10:({width:g,height:b})=>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:g,height:b}),blob11:({width:g,height:b})=>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:g,height:b}),blob12:({width:g,height:b})=>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:g,height:b}),blob13:({width:g,height:b})=>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:g,height:b}),blob14:({width:g,height:b})=>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:g,height:b}),blob15:({width:g,height:b})=>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:g,height:b}),blob16:({width:g,height:b})=>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:g,height:b}),blob17:({width:g,height:b})=>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:g,height:b}),blob18:({width:g,height:b})=>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:g,height:b}),blob19:({width:g,height:b})=>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:g,height:b}),blob2:({width:g,height:b})=>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:g,height:b}),blob20:({width:g,height:b})=>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:g,height:b}),blob21:({width:g,height:b})=>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:g,height:b}),blob22:({width:g,height:b})=>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:g,height:b}),blob23:({width:g,height:b})=>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:g,height:b}),blob24:({width:g,height:b})=>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:g,height:b}),blob25:({width:g,height:b})=>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:g,height:b}),blob26:({width:g,height:b})=>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:g,height:b}),blob27:({width:g,height:b})=>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:g,height:b}),blob28:({width:g,height:b})=>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:g,height:b}),blob29:({width:g,height:b})=>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:g,height:b}),blob3:({width:g,height:b})=>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:g,height:b}),blob30:({width:g,height:b})=>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:g,height:b}),blob31:({width:g,height:b})=>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:g,height:b}),blob32:({width:g,height:b})=>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:g,height:b}),blob4:({width:g,height:b})=>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:g,height:b}),blob5:({width:g,height:b})=>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:g,height:b}),blob6:({width:g,height:b})=>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:g,height:b}),blob7:({width:g,height:b})=>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:g,height:b}),blob8:({width:g,height:b})=>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:g,height:b}),blob9:({width:g,height:b})=>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:g,height:b})}})(Jp);(function(t){var e=_e&&_e.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(t,"__esModule",{value:!0}),t.FigureElement=void 0;const n=e(Qe),r=ti,i=Io,o=Jp,a=Ml,l=Na,s=Jc,f={};t.FigureElement=(0,r.observer)(({element:h,store:x})=>{const w=h.selectable||x.role==="admin",v=(0,l.isTouchDevice)(),[O,g]=n.default.useState(!1),b=x.selectedShapes.indexOf(h)>=0,p=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,s.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:!v||b,hideInExport:!h.showInExport}),_=(0,s.useColor)(h,h.stroke,"stroke"),A=Object.assign(Object.assign({visible:p>0,x:p/2,y:p/2,width:h.a.width-p,height:h.a.height-p},_),{strokeWidth:p,cornerRadius:Math.max(0,y-p),dash:h.dash.map(E=>E*p),opacity:h.animated("opacity"),hideInExport:!h.showInExport,listening:!1}),C=(R=h.subType,f[R]||(f[R]=(S=(0,o.subTypeToPathDataFunc)(R),(0,r.observer)(({element:E,fillProps:P,strokeProps:T})=>{let N=S({width:E.a.width,height:E.a.height,cornerRadius:E.cornerRadius}),U=1,G=1;typeof N!="string"&&(U=N.scaleX,G=N.scaleY,N=N.path);const Z=n.default.useRef(null);return n.default.createElement(n.default.Fragment,null,n.default.createElement(i.Rect,{width:E.width,height:E.height,fill:"transparent"}),n.default.createElement(i.Path,Object.assign({},P,{ref:Z,data:N,scaleX:U,scaleY:G})),n.default.createElement(i.Group,{clipFunc:W=>{const H=Z.current;if(H){var L=H.dataArray;W.beginPath();for(var M=0;M<L.length;M++){var D=L[M].command,B=L[M].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 V=B[0],Y=B[1],F=B[2],$=B[3],z=B[4],K=B[5],X=B[6],Q=B[7],J=F>$?F:$,ne=F>$?1:F/$,ie=F>$?$/F:1;W.translate(V,Y),W.rotate(X),W.scale(ne,ie),W.arc(0,0,J,z,z+K,1-Q),W.scale(1/ne,1/ie),W.rotate(-X),W.translate(-V,-Y);break;case"z":W.closePath()}}}},scaleX:U,scaleY:G},n.default.createElement(i.Path,Object.assign({},T,{x:0,y:0,data:N,strokeWidth:2*T.strokeWidth,dash:T.dash.map(W=>W)}))))}))),f[R]||i.Group);var R,S;return n.default.createElement(n.default.Fragment,null,n.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:v?h.draggable&&b:h.draggable,name:"element",onMouseEnter:()=>{g(!0)},onMouseLeave:()=>{g(!1)},onDragMove:E=>{h.set({x:E.target.x(),y:E.target.y()})},onDragEnd:E=>{h.set({x:E.target.x(),y:E.target.y()})},onTransform:E=>{const P=E.target.scale();E.target.scaleX(1),E.target.scaleY(1),h.set({width:h.width*P.x,height:h.height*P.y,x:E.target.x(),y:E.target.y(),rotation:E.target.rotation()})}},n.default.createElement(C,{element:h,fillProps:m,strokeProps:A})),(O||b)&&n.default.createElement(a.Highlighter,{element:h}))})})(hS);(function(t){var e=_e&&_e.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerShapeComponent=O;const n=e(Qe),r=ti,i=Zy,o=d2,a=iS,l=fS,s=dS,f=hS,h=Io,x=Qr,w=(0,r.observer)(b=>{const{element:p,store:y}=b,{children:d}=p,m=p.selectable||y.role==="admin";return n.default.createElement(h.Group,{opacity:p.opacity,listening:m,hideInExport:!p.showInExport},d.map(_=>n.default.createElement(g,Object.assign({},b,{key:_.id,store:y,element:_}))))}),v={text:i.TextElement,image:o.ImageElement,svg:o.ImageElement,line:l.LineElement,video:s.VideoElement,figure:f.FigureElement,group:w};function O(b,p){v[b]=p}const g=(0,r.observer)(b=>{let p=v[b.element.type];return b.element.type==="text"&&x.flags.htmlRenderEnabled&&(p=a.HTMLElement),b.element.visible?p?n.default.createElement(p,Object.assign({},b)):(console.error("Can not find component for "+b.element.type),null):null});t.default=g})(Y9);var pS={};(function(t){function e(n,r,i="scale"){const o=r.width/r.height;let a,l;o>=n.width/n.height?(a=n.width,l=n.width/o):(a=n.height*o,l=n.height);let s=0,f=0;return i==="left-top"?(s=0,f=0):i==="left-middle"?(s=0,f=(n.height-l)/2):i==="left-bottom"?(s=0,f=n.height-l):i==="center-top"?(s=(n.width-a)/2,f=0):i==="center-middle"?(s=(n.width-a)/2,f=(n.height-l)/2):i==="center-bottom"?(s=(n.width-a)/2,f=n.height-l):i==="right-top"?(s=n.width-a,f=0):i==="right-middle"?(s=n.width-a,f=(n.height-l)/2):i==="right-bottom"?(s=n.width-a,f=n.height-l):i==="scale"?(s=0,f=0,a=n.width,l=n.height):console.error(new Error("Unknown clip position property - "+i)),{cropX:s,cropY:f,cropWidth:a,cropHeight:l}}Object.defineProperty(t,"__esModule",{value:!0}),t.getCrop=e})(pS);var $g={},Gg={},S_;function fj(){return S_||(S_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.setAPI=t.iconscoutDownload=t.iconscoutList=t.svgapiDownload=t.svgapiList=t.unsplashDownload=t.unsplashList=t.textTemplateList=t.templateList=t.removeBackground=t.polotnoShapesList=t.getGoogleFontImage=t.getGoogleFontsListAPI=t.URLS=t.getAPI=t.API=t.URL=void 0;const e=E2();t.URL="https://api.polotno.com",t.API="https://api.polotno.com/api";const n=()=>t.URL+"/api";t.getAPI=n;const r={},i=(d,m)=>{r[d]||(r[d]=!0,console.error(m))},o=`API for iconscout is provided as a demonstration.
254
- For production usage you have to use your own API endpoint.
255
- https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
256
- https://polotno.com/docs/server-api`;t.URLS={unsplashList:({query:d,page:m=1})=>`${(0,t.getAPI)()}/get-unsplash?query=${d}&per_page=20&page=${m}&KEY=${(0,e.getKey)()}`,unsplashDownload:d=>`${(0,t.getAPI)()}/download-unsplash?id=${d}&KEY=${(0,e.getKey)()}`,svgapiList:({query:d,page:m=0})=>`${(0,t.getAPI)()}/get-svgapi?query=${d}&page=${m}&per_page=20&KEY=${(0,e.getKey)()}`,svgapiDownload:d=>`${(0,t.getAPI)()}/download-svgapi?path=${d}&KEY=${(0,e.getKey)()}`,iconscoutList:({query:d,page:m=1})=>(i("iconscout",o),`${(0,t.getAPI)()}/get-iconscout?query=${d}&page=${m}&KEY=${(0,e.getKey)()}`),iconscoutDownload:d=>(i("iconscout",o),`${(0,t.getAPI)()}/download-iconscout?uuid=${d}&KEY=${(0,e.getKey)()}`),nounProjectList:({query:d,page:m=1})=>`${(0,t.getAPI)()}/get-nounproject?query=${d}&page=${m}&KEY=${(0,e.getKey)()}`,nounProjectDownload:d=>`${(0,t.getAPI)()}/download-nounproject?id=${d}&KEY=${(0,e.getKey)()}`,templateList:({query:d,page:m=1,sizeQuery:_})=>`${(0,t.getAPI)()}/get-templates?${_}&query=${d}&per_page=30&page=${m}&KEY=${(0,e.getKey)()}`};const a=()=>`${(0,t.getAPI)()}/get-google-fonts?KEY=${(0,e.getKey)()}`;t.getGoogleFontsListAPI=a;const l=d=>{return`${t.URL}/google-fonts-previews/black/${m=d,_=" ",A="-",m.replace(new RegExp(_,"g"),A)}.png`;var m,_,A};t.getGoogleFontImage=l;const s=()=>`${(0,t.getAPI)()}/get-basic-shapes?KEY=${(0,e.getKey)()}`;t.polotnoShapesList=s;const f=()=>`${(0,t.getAPI)()}/remove-image-background?KEY=${(0,e.getKey)()}`;t.removeBackground=f;const h=d=>t.URLS.templateList(d);t.templateList=h;const x=()=>`${(0,t.getAPI)()}/get-text-templates?KEY=${(0,e.getKey)()}`;t.textTemplateList=x;const w=d=>t.URLS.unsplashList(d);t.unsplashList=w;const v=d=>t.URLS.unsplashDownload(d);t.unsplashDownload=v;const O=d=>t.URLS.svgapiList(d);t.svgapiList=O;const g=d=>t.URLS.svgapiDownload(d);t.svgapiDownload=g;const b=d=>t.URLS.iconscoutList(d);t.iconscoutList=b;const p=d=>t.URLS.iconscoutDownload(d);t.iconscoutDownload=p;const y=(d,m)=>{t.URLS[d]=m};t.setAPI=y}(Gg)),Gg}var E_;function E2(){return E_||(E_=1,function(t){var e=_e&&_e.__createBinding||(Object.create?function(R,S,E,P){P===void 0&&(P=E);var T=Object.getOwnPropertyDescriptor(S,E);T&&!("get"in T?!S.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(R,P,T)}:function(R,S,E,P){P===void 0&&(P=E),R[P]=S[E]}),n=_e&&_e.__setModuleDefault||(Object.create?function(R,S){Object.defineProperty(R,"default",{enumerable:!0,value:S})}:function(R,S){R.default=S}),r=_e&&_e.__importStar||function(R){if(R&&R.__esModule)return R;var S={};if(R!=null)for(var E in R)E!=="default"&&Object.prototype.hasOwnProperty.call(R,E)&&e(S,R,E);return n(S,R),S};Object.defineProperty(t,"__esModule",{value:!0}),t.getKey=t.isCreditVisible=void 0,t.isKeyPaid=A,t.validateKey=C;const i=r(Qi),o=fj(),a=Qr,l=i.observable({value:!1}),s=()=>l.value;t.isCreditVisible=s;const f=i.action(()=>{l.value=!0});let h="";const x=()=>h||"";t.getKey=x;const w=5,v=3e3,O="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",g="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",b="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 y=window.location.origin;const d=navigator.userAgent.indexOf("Headless")>-1,m=navigator.userAgent.indexOf("Electron")>-1;y==="file://"&&d&&(y="headless"),y==="file://"&&m&&(y="electron");const _=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${y}" here: https://polotno.com/cabinet`;async function A(R){for(let S=0;S<w;S++)try{const E=await fetch((0,o.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:R,site:location.host})});if(!R)return console.warn(O),!1;if(E.status!==200){await new Promise(T=>setTimeout(T,v));continue}const P=await E.json();return P.is_valid||console.warn(g),P.is_paid||console.log(p,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),P.is_domain_valid||console.log(_,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,a.useRemoveBackground)(P.remove_background_enabled),P.is_paid||!1}catch{await new Promise(P=>setTimeout(P,v))}return console.error(b),!0}async function C(R,S){h=R,await A(R)&&!S||f()}}($g)),$g}var e0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pxToUnitString=t.unitToPx=t.pxToUnitRounded=t.pxToUnit=void 0;const e=({px:o,unit:a="px",dpi:l})=>{switch(a){case"pt":default:return o;case"mm":return o/(l/25.4);case"cm":return o/(l/2.54);case"in":return o/l}};t.pxToUnit=e;const n=({px:o,precious:a=2,dpi:l=72,unit:s="px"})=>parseFloat((0,t.pxToUnit)({px:o,dpi:l,unit:s}).toFixed(a));t.pxToUnitRounded=n;const r=({unitVal:o,dpi:a,unit:l})=>o/(0,t.pxToUnit)({px:1,unit:l,dpi:a});t.unitToPx=r;const i=o=>{const a=parseFloat((0,t.pxToUnit)(o).toFixed(1));switch(o.unit){case"pt":return`${Math.round(a)}pt`;case"mm":return`${a}mm`;case"cm":return`${a}cm`;case"in":return`${a}in`;default:return`${Math.round(a)}px`}};t.pxToUnitString=i})(e0);(function(t){var e=_e&&_e.__rest||function(H,L){var M={};for(var D in H)Object.prototype.hasOwnProperty.call(H,D)&&L.indexOf(D)<0&&(M[D]=H[D]);if(H!=null&&typeof Object.getOwnPropertySymbols=="function"){var B=0;for(D=Object.getOwnPropertySymbols(H);B<D.length;B++)L.indexOf(D[B])<0&&Object.prototype.propertyIsEnumerable.call(H,D[B])&&(M[D[B]]=H[D[B]])}return M},n=_e&&_e.__importDefault||function(H){return H&&H.__esModule?H:{default:H}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerNextDomDrop=t.setTransformerStyle=void 0,t.registerTransformerAttrs=R;const r=n(Qe),i=ti,o=Qi,a=Io,l=n(Yp),s=n(ki),f=n(Y9),h=S2,x=d2,w=pS,v=E2(),O=su,g=e0,b=Qr,p=Na,y=s.default.DD._drag;window.removeEventListener("mousemove",y),s.default.DD._drag=function(H){(0,o.runInAction)(()=>{y.call(this,H)})},window.addEventListener("mousemove",s.default.DD._drag);const d=new s.default.Group;d.add(new s.default.Rect({width:20,height:20,fill:"white"})),d.add(new s.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"})}},A=H=>{Object.assign(_,H)};t.setTransformerStyle=A;const C={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 R(H,L){C[H]=C[H]||L,Object.assign(C[H],L)}const S=H=>r.default.createElement(a.Rect,Object.assign({},H,{preventDefault:!1})),E=H=>{var{url:L}=H,M=e(H,["url"]);const[D,B]=(0,l.default)(L,"anonymous"),V=D?(0,w.getCrop)(D,{width:M.width,height:M.height},"center-middle"):{};return(0,x.useImageLoader)(B,"background"),r.default.createElement(a.Image,Object.assign({image:D},M,V))},P=H=>r.default.createElement(a.Rect,Object.assign({},H)),T=H=>{const{background:L,scale:M,borderColor:D}=H,B=e(H,["background","scale","borderColor"]),V=r.default.useMemo(()=>!!s.default.Util.colorToRGBA(L),[L]),Y=r.default.useMemo(()=>{const F=document.createElement("canvas"),$=30;F.width=60,F.height=60;const z=F.getContext("2d");return z&&(z.fillStyle="black",z.fillRect($,0,$,$),z.fillRect(0,$,$,$)),F},[]);return r.default.createElement(r.default.Fragment,null,r.default.createElement(a.Rect,Object.assign({fillPatternImage:Y},B,{opacity:.1,hideInExport:!0})),V?r.default.createElement(P,Object.assign({fill:L},B)):r.default.createElement(E,Object.assign({url:L},B)))},N=(0,i.observer)(({selection:H})=>H.visible?r.default.createElement(a.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:L,width:M,height:D,rotation:B,anchor:V,store:Y})=>{const F=(0,O.getClientRect)({x:H,y:L,width:M,height:D,rotation:s.default.Util.radToDeg(B)});if(V===void 0)return null;const $=(D/2+70)*Math.cos(B-Math.PI/2),z=(D/2+70)*Math.sin(B-Math.PI/2),K=(0,g.pxToUnitRounded)({unit:Y.unit,dpi:Y.dpi,px:M/Y.scale,precious:Y.unit==="px"?0:1})+" x "+(0,g.pxToUnitRounded)({unit:Y.unit,dpi:Y.dpi,px:D/Y.scale,precious:Y.unit==="px"?0:1})+(Y.unit==="px"?"":" "+Y.unit);return r.default.createElement(r.default.Fragment,null,r.default.createElement(a.Label,{x:(F.minX+F.maxX)/2+$,y:(F.minY+F.maxY)/2+z,offsetX:14,offsetY:14,visible:V==="rotater"},r.default.createElement(a.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),r.default.createElement(a.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(s.default.Util.radToDeg(B)).toString()+"°"})),r.default.createElement(a.Label,{x:(F.minX+F.maxX)/2,y:F.maxY+20,visible:V!=="rotater"},r.default.createElement(a.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),r.default.createElement(a.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:K})))}),G=(0,i.observer)(({elements:H,store:L})=>{const M=H.filter(B=>B.alwaysOnTop),D=H.filter(B=>!B.alwaysOnTop).concat(M);return r.default.createElement(r.default.Fragment,null,D.map(B=>r.default.createElement(f.default,{key:B.id,store:L,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};t.registerNextDomDrop=W,t.default=(0,i.observer)(({store:H,page:L,width:M,height:D,pageControlsEnabled:B,backColor:V,pageBorderColor:Y,activePageBorderColor:F,components:$,bleedColor:z,altCloneEnabled:K})=>{const X=H.bleedVisible?L.bleed:0,Q=L.computedWidth+2*X,J=L.computedHeight+2*X,ne=(M-Q*H.scale)/2,ie=(D-J*H.scale)/2,oe=r.default.useRef(null),de=r.default.useRef(null),me=r.default.useRef(null),Pe=B==null||B,[re,ae]=r.default.useState(null),[we,be]=r.default.useState({}),te=H.selectedElements.find(Se=>Se._cropModeEnabled),fe=H.selectedShapes.filter(Se=>!Se.resizable).length>0,he=H.selectedShapes.filter(Se=>!Se.draggable).length>0,Ee=H.selectedElements.filter(Se=>!Se.visible).length>0;r.default.useLayoutEffect(()=>{var Se,Le,Ne;if(!oe.current)return;const ge=oe.current.getStage(),Xe=H.selectedShapes.map($e=>$e._cropModeEnabled?null:ge.findOne("#"+$e.id)).filter($e=>$e),Oe=H.selectedElements.length===1&&((Se=H.selectedElements[0])===null||Se===void 0?void 0:Se.type)||"many";C[Oe]?(oe.current.setAttrs(Object.assign(Object.assign({},_),C[Oe])),Oe!=="svg"&&Oe!=="image"||H.selectedElements[0].keepRatio||oe.current.setAttrs({enabledAnchors:_.enabledAnchors}),Oe==="text"&&b.flags.textVerticalResizeEnabled&&oe.current.setAttrs({enabledAnchors:(Le=C.text.enabledAnchors)===null||Le===void 0?void 0:Le.concat(["bottom-center"])})):oe.current.setAttrs(_),fe&&oe.current.enabledAnchors([]),he&&oe.current.rotateEnabled(!1),Xe.find($e=>$e==null?void 0:$e.isDragging())&&Xe.forEach($e=>{$e.isDragging()||$e==null||$e.startDrag()}),oe.current.nodes(Xe),(Ne=oe.current.getLayer())===null||Ne===void 0||Ne.batchDraw()},[H.selectedElements,te,fe,Ee,he]);const Ve=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),Je=r.default.useRef(!1),Ae=(0,p.isTouchDevice)(),Ce=(0,o.action)(Se=>{var Le,Ne;if(Ae)return;Je.current=!1;const ge=Se.target.findAncestor(".elements-container"),Xe=Se.target.findAncestor("Transformer"),Oe=Se.target.findAncestor(".page-abs-container");if(ge||Xe||Oe)return;const $e=(Le=Se.target.getStage())===null||Le===void 0?void 0:Le.getPointerPosition();$e&&(Ve.visible=!0,Ve.x1=$e.x,Ve.y1=$e.y,Ve.x2=$e.x,Ve.y2=$e.y,((Ne=Se.target.getStage())===null||Ne===void 0?void 0:Ne.getPointersPositions().length)>=2&&(Ve.visible=!1))});r.default.useEffect(()=>{const Se=(0,o.action)(Ne=>{var ge,Xe;if(!Ve.visible)return;(ge=de.current)===null||ge===void 0||ge.setPointersPositions(Ne);let Oe=((Xe=de.current)===null||Xe===void 0?void 0:Xe.getPointerPosition())||{x:Ve.x2,y:Ve.y2};Ve.x2=Oe.x,Ve.y2=Oe.y}),Le=(0,o.action)(()=>{if(!Ve.visible||!de.current)return;const Ne=de.current.findOne(".selection"),ge=Ne?Ne.getClientRect():{width:0,height:0,x:0,y:0};if(ge.width&&ge.height){const Xe=[];de.current.find(".element").forEach($e=>{const Wt=$e.getClientRect(),Tt=H.getElementById($e.id()),Yt=Tt==null?void 0:Tt.draggable,ke=Tt==null?void 0:Tt.selectable;s.default.Util.haveIntersection(ge,Wt)&&Yt&&ke&&Xe.push(Tt.top.id)});const Oe=[...new Set(Xe)];H.selectElements(Oe)}Ve.visible=!1,Je.current=!0});return window.addEventListener("mousemove",Se),window.addEventListener("touchmove",Se),window.addEventListener("mouseup",Le),window.addEventListener("touchend",Le),()=>{window.removeEventListener("mousemove",Se),window.removeEventListener("touchmove",Se),window.removeEventListener("mouseup",Le),window.removeEventListener("touchend",Le)}},[]);const Me=r.default.useRef(!1);r.default.useEffect(()=>{var Se;let Le;const Ne=(Se=me.current)===null||Se===void 0?void 0:Se.closest(".polotno-workspace-inner"),ge=()=>{Me.current=!0,clearTimeout(Le),Le=setTimeout(()=>{Me.current=!1},300)};return Ne.addEventListener("scroll",ge),()=>{clearTimeout(Le),Ne.removeEventListener("scroll",ge)}},[]);const ze=Se=>{if(H.activePage!==L&&L.select(),Me.current||Je.current)return;const Le=Se.evt.ctrlKey||Se.evt.metaKey||Se.evt.shiftKey,Ne=Se.target.findAncestor(".elements-container"),ge=Se.target.findAncestor(".page-abs-container"),Xe=Se.target.findAncestor("Transformer");if(!(Le||Ne||Xe||ge))return void H.selectElements([]);const Oe=Se.target.findAncestor(".element",!0),$e=H.getElementById(Oe==null?void 0:Oe.id()),Wt=$e==null?void 0:$e.top,Tt=Wt==null?void 0:Wt.id,Yt=H.selectedElementsIds.indexOf(Tt)>=0;Tt&&Le&&!Yt?H.selectElements(H.selectedElementsIds.concat([Tt])):Tt&&Le&&Yt?H.selectElements(H.selectedElementsIds.filter(ke=>ke!==Tt)):!Tt||Le||Yt||H.selectElements([Tt])};(0,h.useSnap)(oe,H);const We=H.activePage===L,St=$==null?void 0:$.PageControls,mt=$==null?void 0:$.Tooltip,ue=1/H.scale,ce=0/H.scale;return r.default.createElement("div",{ref:me,onDragOver:Se=>Se.preventDefault(),onDrop:Se=>{if(Se.preventDefault(),!de.current)return;de.current.setPointersPositions(Se);const Le=de.current.findOne(".elements-container").getRelativePointerPosition(),Ne=de.current.getPointerPosition(),ge=de.current.getAllIntersections(Ne).map($e=>$e.findAncestor(".element",!0)).filter(Boolean),Xe=[...new Set(ge.reverse())].map($e=>H.getElementById($e.id())),Oe=Xe[0];Z&&(Z(Le,Oe,{elements:Xe,page:L}),Z=null)},style:{position:"relative",width:M+"px"},className:"polotno-page-container"+(We?" active-page":"")},r.default.createElement(a.Stage,{ref:de,width:Math.min(M,10*window.innerWidth),height:Math.min(D,10*window.innerHeight),onClick:ze,onTap:ze,onMouseDown:Ce,onMouseMove:Se=>{if(!Se.evt.altKey&&re)return void ae(null);if(!Se.evt.altKey)return;const Le=Se.target.findAncestor(".element",!0),Ne=Le==null?void 0:Le.id();if(!H.selectedElements[0]||H.selectedElementsIds.includes(Ne))return;const ge=(0,O.getTotalClientRect)(H.selectedShapes),Xe=Ne?H.getElementById(Ne):{x:0,y:0,width:L.computedWidth,height:L.computedHeight,rotation:0},Oe=(0,O.getClientRect)(Xe),$e=[];ge.minX>Oe.maxX&&$e.push({distance:ge.minX-Oe.maxX,box1:ge,box2:Oe,points:[{x:ge.minX,y:ge.minY+ge.height/2},{x:Oe.maxX,y:ge.minY+ge.height/2},{x:Oe.maxX,y:Oe.minY+Oe.height/2}]}),ge.maxX<Oe.minX&&$e.push({distance:Oe.minX-ge.maxX,box1:ge,box2:Oe,points:[{x:ge.maxX,y:ge.minY+ge.height/2},{x:Oe.minX,y:ge.minY+ge.height/2},{x:Oe.minX,y:Oe.minY+Oe.height/2}]}),ge.minY>Oe.maxY&&$e.push({box1:ge,box2:Oe,distance:ge.minY-Oe.maxY,points:[{x:ge.minX+ge.width/2,y:ge.minY},{x:ge.minX+ge.width/2,y:Oe.maxY},{x:Oe.minX+Oe.width/2,y:Oe.maxY}]}),ge.maxY<Oe.minY&&$e.push({box1:ge,box2:Oe,distance:Oe.minY-ge.maxY,points:[{x:ge.minX+ge.width/2,y:ge.maxY},{x:ge.minX+ge.width/2,y:Oe.minY},{x:Oe.minX+Oe.width/2,y:Oe.minY}]}),ge.minX>=Oe.minX&&ge.maxX<=Oe.maxX&&ge.minY>=Oe.minY&&ge.maxY<=Oe.maxY&&($e.push({distance:ge.minX-Oe.minX,box1:ge,box2:Oe,points:[{x:ge.minX,y:ge.minY+ge.height/2},{x:Oe.minX,y:ge.minY+ge.height/2},{x:Oe.minX,y:Oe.minY+Oe.height/2}]}),$e.push({distance:Oe.maxX-ge.maxX,box1:ge,box2:Oe,points:[{x:ge.maxX,y:ge.minY+ge.height/2},{x:Oe.maxX,y:ge.minY+ge.height/2},{x:Oe.maxX,y:Oe.minY+Oe.height/2}]}),$e.push({box1:ge,box2:Oe,distance:ge.minY-Oe.minY,points:[{x:ge.minX+ge.width/2,y:ge.minY},{x:ge.minX+ge.width/2,y:Oe.minY},{x:Oe.minX+Oe.width/2,y:Oe.minY}]}),$e.push({box1:ge,box2:Oe,distance:Oe.maxY-ge.maxY,points:[{x:ge.minX+ge.width/2,y:ge.maxY},{x:ge.minX+ge.width/2,y:Oe.maxY},{x:Oe.minX+Oe.width/2,y:Oe.maxY}]})),JSON.stringify(re)!==JSON.stringify($e)&&ae($e)},onDragStart:Se=>{var Le;const Ne=Se.target.findAncestor(".element",!0);if(Ne){const ge=H.getElementById(Ne==null?void 0:Ne.id()),Xe=ge==null?void 0:ge.top,Oe=Xe==null?void 0:Xe.id;!(H.selectedElementsIds.indexOf(Oe)>=0)&&Oe&&(H.selectElements([Oe]),Se.target.stopDrag(),Se.target.startDrag(Se),(Le=oe.current)===null||Le===void 0||Le.startDrag(Se))}re&&ae(null)},pageId:L.id,style:{position:"relative"}},r.default.createElement(a.Layer,null,r.default.createElement(S,{width:M,height:D,fill:V}),r.default.createElement(a.Group,{x:ne,y:ie,scaleX:H.scale,scaleY:H.scale,name:"page-container"},r.default.createElement(a.Group,{name:"page-container-2"},r.default.createElement(a.Group,{name:"page-background-group",x:X,y:X},r.default.createElement(T,{x:-L.bleed,y:-L.bleed,width:L.computedWidth+2*L.bleed,height:L.computedHeight+2*L.bleed,background:L.background,name:"page-background",preventDefault:!1,scale:H.scale})),r.default.createElement(a.Group,{x:X,y:X,name:"elements-container",listening:!H.isPlaying},r.default.createElement(a.Rect,{name:"elements-area",width:L.computedWidth,height:L.computedHeight,listening:!1}),r.default.createElement(G,{elements:L.children,store:H})),r.default.createElement(a.Rect,{stroke:z,name:"bleed",strokeWidth:L.bleed,x:L.bleed/2,y:L.bleed/2,width:L.computedWidth+L.bleed,height:L.computedHeight+L.bleed,listening:!1,visible:L.bleed>0&&H.bleedVisible,hideInExport:!0}))),r.default.createElement(a.Line,{name:"workspace-background",points:[0,0,M,0,M,D,0,D,0,0,ne,ie,ne,D-ie,M-ne,D-ie,M-ne,ie,ne,ie],listening:!1,closed:!0,fill:V}),r.default.createElement(a.Group,{x:ne,y:ie,scaleX:H.scale,scaleY:H.scale},r.default.createElement(a.Rect,{name:"page-highlight",hideInExport:!0,x:-ue/2-ce,y:-ue/2-ce,width:Q+ue+2*ce,height:J+ue+2*ce,stroke:We&&H.pages.length>1?F:Y,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),r.default.createElement(a.Group,{x:ne+X*H.scale,y:ie+X*H.scale,scaleX:H.scale,scaleY:H.scale,name:"page-abs-container"},r.default.createElement(a.Transformer,{ref:oe,onDragStart:Se=>{var Le;!((Le=Se.evt)===null||Le===void 0)&&Le.altKey&&K&&H.selectedElements.forEach(Ne=>{const ge=Ne.clone({},{skipSelect:!0}),Xe=L.children.indexOf(Ne);L.setElementZIndex(ge.id,Xe)}),H.history.startTransaction()},onDragEnd:()=>{H.history.endTransaction()},onTransformStart:()=>{H.history.startTransaction()},boundBoxFunc:(Se,Le)=>{const Ne=Math.abs(Le.width)<1||Math.abs(Le.height)<1,ge=Math.abs(Se.width)<1||Math.abs(Se.height)<1;return Ne&&!ge?Se:Le},onTransform:Se=>{var Le,Ne;const ge=oe.current.nodes(),Xe=ge[ge.length-1];if(Se.target!==Xe)return;const Oe=(Le=oe.current)===null||Le===void 0?void 0:Le.__getNodeRect(),$e=(Ne=oe.current)===null||Ne===void 0?void 0:Ne.getActiveAnchor();be({anchor:$e,x:Oe.x,y:Oe.y,rotation:Oe.rotation,width:Oe.width,height:Oe.height})},onTransformEnd:Se=>{be({}),H.history.endTransaction()},visible:!H.isPlaying}),re&&re.map(({points:Se,distance:Le,box1:Ne,box2:ge},Xe)=>r.default.createElement(a.Group,{name:"distances-container",hideInExport:!0,key:Xe,listening:!1},r.default.createElement(a.Rect,Object.assign({},Ne,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),r.default.createElement(a.Rect,Object.assign({},ge,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),r.default.createElement(a.Line,{points:[Se[0].x,Se[0].y,Se[1].x,Se[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),r.default.createElement(a.Line,{points:[Se[1].x,Se[1].y,Se[2].x,Se[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),r.default.createElement(a.Label,{x:(Se[0].x+Se[1].x)/2,y:(Se[0].y+Se[1].y)/2,offsetY:-10,scaleX:1/H.scale,scaleY:1/H.scale},r.default.createElement(a.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),r.default.createElement(a.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,g.pxToUnitString)({unit:H.unit,dpi:H.dpi,px:Le})})))),L._rendering&&r.default.createElement(a.Group,null,r.default.createElement(a.Rect,{width:Q,height:J,fill:"rgba(255,255,255,0.9)"}),r.default.createElement(a.Text,{text:"Rendering...",fontSize:60,width:Q,height:J,align:"center",verticalAlign:"middle"})),mt&&r.default.createElement(mt,{components:$,store:H,page:L,stageRef:de})),r.default.createElement(U,Object.assign({},we,{store:H})),r.default.createElement(N,{selection:Ve}),(0,v.isCreditVisible)()&&r.default.createElement(a.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:M-170,y:D-18,onMouseEnter:Se=>{Se.target.getStage().container().style.cursor="pointer"},onMouseLeave:Se=>{Se.target.getStage().container().style.cursor=""},onTouchStart:Se=>{Se.cancelBubble=!0},onMouseDown:Se=>{Se.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),r.default.createElement(a.Group,{name:"line-guides"}))),Pe&&St&&r.default.createElement(St,{store:H,page:L,xPadding:ne,yPadding:ie}))})})(n9);var gS={};(function(t){var e=_e&&_e.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(t,"__esModule",{value:!0}),t.TopRules=void 0,t.LeftRules=v;const n=e(Qe),r=su,i=e0,o=ti,a=w2,l=(0,a.styled)("div",n.default.forwardRef)`
257
- position: absolute;
258
- top: 0;
259
- left: 0;
260
- pointer-events: none;
261
- `,s=(0,a.styled)("div",n.default.forwardRef)`
262
- height: 14px;
263
- position: sticky;
264
- font-size: 8px;
265
- line-height: 14px;
266
- top: 0;
267
- left: 0;
268
- color: grey;
269
- border-bottom: 1px solid grey;
270
- background-color: #e8e8e8;
271
- overflow: hidden;
272
- `,f=(0,a.styled)("div",n.default.forwardRef)`
273
- left: 0;
274
- width: 14px;
275
- position: sticky;
276
- font-size: 8px;
277
- line-height: 14px;
278
- color: grey;
279
- border-right: 1px solid grey;
280
- background-color: #e8e8e8;
281
- overflow: hidden;
282
- `,h=(0,a.styled)("div",n.default.forwardRef)`
283
- position: absolute;
284
- border-left: 1px solid grey;
285
- padding-left: 2px;
286
- `,x=(0,a.styled)("div",n.default.forwardRef)`
287
- position: absolute;
288
- left: 14px;
289
- border-left: 1px solid grey;
290
- padding-left: 2px;
291
- transform: rotate(90deg);
292
- transform-origin: left top;
293
- overflow: hidden;
294
- `,w=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];function v(){return n.default.createElement("div",null,n.default.createElement("h1",null,"Top rules"))}t.TopRules=(0,o.observer)(({store:O,width:g,height:b})=>{const p=n.default.useRef(null);if(!O.activePage)return null;const y=O.activePage,d=(O.bleedVisible&&y.bleed,y.computedWidth*O.scale),m=y.computedHeight*O.scale,_=(g-d)/2,A=(C=T=>(0,i.unitToPx)({unitVal:T,dpi:O.dpi,unit:O.unit})*O.scale,w.find(T=>C(T)>30)||1e4);var C;const R=(0,i.unitToPx)({unitVal:A,dpi:O.dpi,unit:O.unit})*O.scale,S=Math.round(d/R)+1,E=Math.round(m/R)+1,P=(0,r.getTotalClientRect)(O.selectedShapes);return n.default.createElement(l,{ref:p,className:"polotno-rulers"},n.default.createElement(s,{style:{width:g+"px"},className:"polotno-x-ruler"},[...Array(S)].map((T,N)=>n.default.createElement(h,{key:N,style:{left:_+N*R+"px",width:R+"px"}},O.unit==="px"||A>=1?Math.round(A*N):(A*N).toFixed(1))),!!O.selectedShapes.length&&n.default.createElement("div",{style:{position:"absolute",left:_+P.x*O.scale+"px",height:"14px",width:P.width*O.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),O.pages.map((T,N)=>{var U;const G=T.computedHeight*O.scale,Z=(b-G)/2;return n.default.createElement(f,{key:T.id,style:{height:b+"px"},className:"polotno-y-ruler"},[...Array(E)].map((W,H)=>n.default.createElement(x,{key:H,style:{top:Z+H*R-14+"px",width:R+"px"}},O.unit==="px"||A>=1?Math.round(A*H):(A*H).toFixed(1))),((U=O.selectedShapes[0])===null||U===void 0?void 0:U.page)===T&&n.default.createElement("div",{style:{position:"absolute",top:Z+P.y*O.scale-14+"px",width:"14px",height:P.height*O.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))})})(gS);var vS={};(function(t){var e=_e&&_e.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0}),t.AudioElement=void 0;const n=e(Qe),r=ti;function i(o){const[a,l]=n.default.useState(null),[s,f]=n.default.useState("loading");return n.default.useEffect(()=>{const h=new Audio(o),x=()=>{f("loaded"),l(h)},w=()=>{f("failed"),l(null)};return h.addEventListener("canplay",x),h.addEventListener("error",w),()=>{h.removeEventListener("canplay",x),h.removeEventListener("error",w)}},[o]),[a,s]}t.AudioElement=(0,r.observer)(({audio:o,store:a})=>{const[l,s]=i(o.src);return n.default.useEffect(()=>{l&&a.history.ignore(()=>{o.set({duration:1e3*l.duration})})},[l,o,a.history]),n.default.useEffect(()=>{if(!l)return;a.isPlaying&&a.animatedElementsIds.length===0?(l.currentTime=o.startTime*o.duration,l.volume=o.volume,l.play()):l.pause();const f=()=>{l.currentTime=o.startTime*o.duration},h=()=>{l.currentTime>=o.endTime*o.duration&&(l.pause(),l.currentTime=o.startTime*o.duration)};return l.addEventListener("ended",f),l.addEventListener("timeupdate",h),()=>{l.removeEventListener("ended",f),l.removeEventListener("timeupdate",h)}},[a.isPlaying,o.startTime,o.endTime,o.volume,l]),null})})(vS);var mS={},Vg={};let dj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",yS=t=>crypto.getRandomValues(new Uint8Array(t)),bS=(t,e,n)=>{let r=(2<<Math.log(t.length-1)/Math.LN2)-1,i=-~(1.6*r*e/t.length);return(o=e)=>{let a="";for(;;){let l=n(i),s=i;for(;s--;)if(a+=t[l[s]&r]||"",a.length===o)return a}}},hj=(t,e=21)=>bS(t,e,yS),pj=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");const gj=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:hj,customRandom:bS,nanoid:pj,random:yS,urlAlphabet:dj},Symbol.toStringTag,{value:"Module"})),t0=_a(gj);var qg={},Wg={},_S={},O2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.deepEqual=void 0;const e=function(n,r){if(n===r)return!0;if(typeof n=="object"&&n!=null&&typeof r=="object"&&r!=null){if(Object.keys(n).length!=Object.keys(r).length)return!1;for(var i in n)if(!r.hasOwnProperty(i)||!(0,t.deepEqual)(n[i],r[i]))return!1;return!0}return!1};t.deepEqual=e})(O2);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UndoManager=void 0;const e=ni,n=O2;Object.assign(e.types),t.UndoManager=e.types.model("UndoManager",{history:e.types.array(e.types.frozen()),undoIdx:-1,targetPath:""}).views(r=>({get canUndo(){return r.undoIdx>0},get canRedo(){return r.undoIdx<r.history.length-1}})).actions(r=>{let i,o,a=!1,l=null,s=0,f=0;const h=()=>f>0;function x(){const v=(0,e.getSnapshot)(i);return{pages:v.pages,width:v.width,height:v.height,custom:v.custom}}function w(v){const O=i.pages.map(y=>y.id),g=v.pages.map(y=>y.id),b=!(0,n.deepEqual)(O,g),p=!(0,n.deepEqual)(i.custom,v.custom);b?(0,e.applySnapshot)(i.pages,v.pages):i.pages.forEach((y,d)=>{(0,e.applySnapshot)(y,v.pages[d])}),p&&i.set({custom:v.custom}),i.setSize(v.width,v.height)}return{startTransaction(){f++},endTransaction(v){f--,v||this.requestAddState(x())},async ignore(v,O=!1,g=!1){g&&await new Promise(m=>setTimeout(m,10)),s&&r.addUndoState();let b=h();r.startTransaction();let p=f;try{await v()}catch(m){setTimeout(()=>{throw m})}const y=p!==f,d=!y;r.endTransaction(d),O||b||r.replaceState(),y||(clearTimeout(s),s=0)},async transaction(v){await r.ignore(v,!0),this.addUndoState()},requestAddState(v){l=v,s||h()||(a?a=!1:s=setTimeout(()=>{s=0,clearTimeout(s),h()||this.addUndoState()},100))},addUndoState(){if(a)return void(a=!1);const v=r.history[r.undoIdx];!(0,n.deepEqual)(l,v)&&(clearTimeout(s),s=0,r.history.splice(r.undoIdx+1),r.history.push(l),r.undoIdx=r.history.length-1)},afterCreate(){if(i=(0,e.resolvePath)(r,".."),!i)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");o=(0,e.onSnapshot)(i,()=>{this.requestAddState(x())}),r.history.length===0&&this.requestAddState(x())},clear(){clearTimeout(s),s=0,r.history.splice(0,r.history.length),r.undoIdx=-1,r.addUndoState(x())},beforeDestroy(){o()},undo(){s&&this.addUndoState(),r.canUndo?(r.undoIdx--,a=!0,w(r.history[r.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){s&&this.addUndoState(),r.canRedo?(r.undoIdx++,a=!0,w(r.history[r.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){r.history[r.undoIdx]=x()}}}),t.default=t.UndoManager})(_S);var wS={};(function(t){async function e(n,r){const i=await(await fetch(n)).blob(),o=document.createElement("a"),a=URL.createObjectURL(i);o.href=a,o.download=r,document.body.appendChild(o),o.click(),setTimeout(function(){document.body.removeChild(o),window.URL.revokeObjectURL(a)},0)}Object.defineProperty(t,"__esModule",{value:!0}),t.downloadFile=e})(wS);var SS={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getJsPDF=r;const e="https://unpkg.com/jspdf@2.2.0/dist/jspdf.umd.min.js";let n;function r(){return n?Promise.resolve(n):new Promise(i=>{var o=document.createElement("script");o.onload=function(){n=window.jspdf.jsPDF,i(n)},o.src=e,document.head.appendChild(o)})}})(SS);var ES={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getGIF=n,t.createGIF=r;const e="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js";function n(){return window.GIF?Promise.resolve(window.GIF):new Promise(i=>{var o=document.createElement("script");o.onload=function(){i(window.GIF)},o.src=e,document.head.appendChild(o)})}async function r({width:i,height:o}){return new(await n())({workers:4,width:i,height:o,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
295
- (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]);
296
- `],{type:"application/javascript"}))})}})(ES);var OS={};(function(t){async function e(n){for(let r=0;r<30;r++){const i=await n();if(i)return i;await new Promise(o=>setTimeout(o,50))}}Object.defineProperty(t,"__esModule",{value:!0}),t.waitTillAvailable=e})(OS);var xS={},Mc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getImageSize=n,t.loadImage=r,t.cropImage=i,t.getCrop=o;const e=au;function n(a){return new Promise(l=>{const s=document.createElement("img");s.onload=async()=>{s.width===0||s.height===0?l(await(0,e.getSvgSize)(a)):l({width:s.width,height:s.height})},s.crossOrigin="anonymous",s.src=a})}function r(a){return new Promise((l,s)=>{const f=document.createElement("img");f.onload=()=>{l(f)},f.onerror=h=>{s(h)},f.crossOrigin="anonymous",f.src=a})}async function i(a,l){const s=await r(a),f=document.createElement("canvas");f.width=2*s.width,f.height=2*s.height,f.getContext("2d").drawImage(s,0,0,f.width,f.height);const h=document.createElement("canvas");h.width=l.width,h.height=l.height;const x=h.getContext("2d");let{cropX:w,cropY:v}=l;const O=f.width*l.cropWidth,g=f.height*l.cropHeight,b=l.width/l.height;let p,y;const d=O/g;return l.type==="svg"?(p=O,y=g):b>=d?(p=O,y=O/b):(p=g*b,y=g),x.drawImage(f,w*f.width,v*f.height,p,y,0,0,h.width,h.height),h.toDataURL("image/png")}function o(a,l){const{width:s,height:f}=a,h=s/f;let x,w;h>=l.width/l.height?(x=l.width,w=l.width/h):(x=l.height*h,w=l.height);const v=(l.width-x)/2,O=(l.height-w)/2;return{cropX:v/l.width,cropY:O/l.height,cropWidth:x/l.width,cropHeight:w/l.height}}})(Mc);(function(t){var e=_e&&_e.__createBinding||(Object.create?function(S,E,P,T){T===void 0&&(T=P);var N=Object.getOwnPropertyDescriptor(E,P);N&&!("get"in N?!E.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return E[P]}}),Object.defineProperty(S,T,N)}:function(S,E,P,T){T===void 0&&(T=P),S[T]=E[P]}),n=_e&&_e.__setModuleDefault||(Object.create?function(S,E){Object.defineProperty(S,"default",{enumerable:!0,value:E})}:function(S,E){S.default=E}),r=_e&&_e.__importStar||function(S){if(S&&S.__esModule)return S;var E={};if(S!=null)for(var P in S)P!=="default"&&Object.prototype.hasOwnProperty.call(S,P)&&e(E,S,P);return n(E,S),E},i=_e&&_e.__rest||function(S,E){var P={};for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&E.indexOf(T)<0&&(P[T]=S[T]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(T=Object.getOwnPropertySymbols(S);N<T.length;N++)E.indexOf(T[N])<0&&Object.prototype.propertyIsEnumerable.call(S,T[N])&&(P[T[N]]=S[T[N]])}return P};Object.defineProperty(t,"__esModule",{value:!0}),t.fixRatio=x,t.jsonToDOM=_,t.jsonToHTML=R;const o=Mc,a=r(au),l=Mc,s=Jp,f=g2,h=(S,E,...P)=>({type:S,props:E,children:P||[]});function x(S){var E=new DOMParser().parseFromString(S,"image/svg+xml");return E.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(E)}const w=async({element:S,page:E,store:P})=>{let{src:T}=S;if(S.type==="svg"&&Object.keys(S.colorsReplace).length){const X=await a.urlToString(T);T=a.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 a.urlToBase64(S.clipSrc);U["clip-path"]=`url(${X})`}const G=await(0,l.loadImage)(T),Z=G.width*S.cropWidth,W=G.height*S.cropHeight,H=S.width/S.height;let L,M;const D=Z/W;S.type==="svg"?(L=Z,M=W):H>=D?(L=Z,M=Z/H):(L=W*H,M=W);const B=L/G.width,V=M/G.height,Y=L/M>S.width/S.height?S.height/M:S.width/L,F=L*Y/B,$=M*Y/V,z=S.cropX*Y*G.width,K=S.cropY*Y*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(${T})`,transform:N,"background-size":`${Math.round(F)}px ${Math.round($)}px`,"background-position-x":-Math.round(z)+"px","background-position-y":-Math.round(K)+"px"})})},v=async({element:S,page:E,store:P})=>{let T={top:0,left:0};S.fill.indexOf("gradient")>=0&&(T=Object.assign(Object.assign({},T),{"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"?(T.top="50%",T.transform="translateY(-50%)"):S.verticalAlign==="bottom"&&(T.bottom=0);const G=/<[a-z][\s\S]*>/i.test(S.text),Z=Object.assign(Object.assign({},T),{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}:{},L=`<style>#${W} {${f.resetStyleContent}}</style>`,M=h("div",Object.assign(Object.assign({style:Z},H),{innerHTML:G?`${L}${S.text}`:S.text.split(`
297
- `).join("<br />")}));return h("div",{style:{position:"relative",width:"100%",height:"100%"}},U,M)},O=({element:S,type:E})=>{const P={"stroke-width":S.height,stroke:S.color,"line-cap":"round","stroke-linejoin":"round",opacity:S.opacity};return E==="arrow"||E==="triangle"?h("polyline",Object.assign({points:`${3*S.height},${2*-S.height} 0,0 ${3*S.height},${2*S.height}`},P)):E==="bar"?h("polyline",Object.assign({points:`0,${2*-S.height} 0,${2*S.height}`},P)):E==="circle"?h("circle",Object.assign({r:S.height},P)):E==="square"?h("polyline",Object.assign({points:`${-S.height},${-S.height} ${-S.height},${S.height} ${S.height},${S.height} ${S.height},${-S.height}`},P)):null},g=async({element:S,page:E,store:P})=>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})`},O({element:S,type:S.startHead})),h("g",{transform:`translate(${S.width} ${S.height/2}) rotate(180)`},O({element:S,type:S.endHead}))),b=async({element:S,page:E,store:P,elementHook:T})=>{const N=await Promise.all(S.children.map(G=>d({element:G,page:E,store:P,elementHook:T}))),U=h("div",{style:{"transform-origin":"top left",opacity:S.opacity}},...N);return T&&T({dom:U,element:S})||U},p=async({element:S,page:E,store:P,elementHook:T})=>{const N=(0,s.figureToSvg)(S),U=h("div",{innerHTML:N});return T&&T({dom:U,element:S})||U},y={image:w,svg:w,text:v,line:g,figure:p,group:b};async function d({element:S,page:E,store:P,elementHook:T}){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:E,store:P}),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 T&&T({dom:Z,element:S})||Z}async function m({page:S,store:E,elementHook:P}){const T=await Promise.all(S.children.map(Z=>d({element:Z,page:S,store:E,elementHook:P}))),N=S.width==="auto"?E.width:S.width,U=S.height==="auto"?E.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,o.getCrop)({width:Z,height:W},{width:Z,height:W})),page:S,store:E});T.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"})},...T)}async function _({json:S,elementHook:E}){const P=await Promise.all(S.pages.map(U=>m({page:U,store:S,elementHook:E}))),T=[];S.pages.forEach(U=>{U.children.forEach(G=>{G.type==="text"&&T.indexOf(G.fontFamily)===-1&&T.push(G.fontFamily)})});const N=T.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,...P)}const A=(S,E)=>typeof E=="object"?`${S}="${Object.keys(E).map(P=>`${P}:${E[P]};`).join(" ")}"`:`${S}="${E}"`,C=({dom:S})=>{if(typeof S=="string")return S;if(!S)return"";const E=S.props,{innerHTML:P}=E,T=i(E,["innerHTML"]);return`<${S.type} ${Object.keys(T).map(N=>A(N,S.props[N])).join(" ")}>${P||S.children.map(N=>C({dom:N})).join("")}</${S.type}>`};async function R({json:S,elementHook:E}){const P=await _({json:S,elementHook:E});return C({dom:P})}})(xS);var PS={};(function(t){var e=_e&&_e.__createBinding||(Object.create?function(S,E,P,T){T===void 0&&(T=P);var N=Object.getOwnPropertyDescriptor(E,P);N&&!("get"in N?!E.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return E[P]}}),Object.defineProperty(S,T,N)}:function(S,E,P,T){T===void 0&&(T=P),S[T]=E[P]}),n=_e&&_e.__setModuleDefault||(Object.create?function(S,E){Object.defineProperty(S,"default",{enumerable:!0,value:E})}:function(S,E){S.default=E}),r=_e&&_e.__importStar||function(S){if(S&&S.__esModule)return S;var E={};if(S!=null)for(var P in S)P!=="default"&&Object.prototype.hasOwnProperty.call(S,P)&&e(E,S,P);return n(E,S),E},i=_e&&_e.__rest||function(S,E){var P={};for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&E.indexOf(T)<0&&(P[T]=S[T]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(T=Object.getOwnPropertySymbols(S);N<T.length;N++)E.indexOf(T[N])<0&&Object.prototype.propertyIsEnumerable.call(S,T[N])&&(P[T[N]]=S[T[N]])}return P};Object.defineProperty(t,"__esModule",{value:!0}),t.fixRatio=h,t.jsonToDOM=_,t.jsonToSVG=R;const o=Mc,a=r(au),l=Mc,s=Jp,f=(S,E,...P)=>({type:S,props:E,children:P||[]});function h(S){var E=new DOMParser().parseFromString(S,"image/svg+xml");return E.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(E)}const x=async({element:S,page:E,store:P})=>{let{src:T}=S;if(S.type==="svg"){const Q=await a.urlToString(T);T=a.replaceColors(Q,new Map(Object.entries(S.colorsReplace)))}let N="";S.flipX&&(N+="scaleX(-1)"),S.flipY&&(N+="scaleY(-1)"),S.clipSrc&&await a.urlToBase64(S.clipSrc);const U=await(0,l.loadImage)(T),G=U.width*S.cropWidth,Z=U.height*S.cropHeight,W=S.width/S.height;let H,L;const M=G/Z;S.type==="svg"?(H=G,L=Z):W>=M?(H=G,L=G/W):(H=Z*W,L=Z);const D=H/U.width,B=L/U.height,V=H/L>S.width/S.height?S.height/L:S.width/H,Y=H*V/D,F=L*V/B,$=S.cropX*U.width*V,z=S.cropY*U.height*V,K=`clip-${S.id}`,X=T.replace(/&/g,"&amp;");return f("g",{style:{transform:N}},f("defs",{},f("clipPath",{id:K},f("rect",{x:0,y:0,width:S.width,height:S.height}))),f("image",{"xlink:href":X,x:-$,y:-z,width:Y,height:F,preserveAspectRatio:"none","clip-path":`url(#${K})`}))},w=async({element:S,page:E,store:P})=>{const T=(W,H,L,M,D)=>{const B=document.createElement("canvas").getContext("2d");return B.font=`${D} ${M} ${H}px ${L}`,B.measureText(W).width},N=((W,H,L,M,D,B)=>{const V=[];return W.split(`
298
- `).forEach(Y=>{const F=Y.split(" ");let $="";for(let z=0;z<F.length;z++){const K=$+F[z]+" ";T(K,L,M,D,B)>H+.5&&z>0?(V.push($.trim()),$=F[z]+" "):$=K}V.push($.trim())}),V})(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))},v=({element:S,type:E})=>{const P={"stroke-width":S.height,stroke:S.color,"line-cap":"round","stroke-linejoin":"round",opacity:S.opacity};return E==="arrow"||E==="triangle"?f("polyline",Object.assign({points:`${3*S.height},${2*-S.height} 0,0 ${3*S.height},${2*S.height}`},P)):E==="bar"?f("polyline",Object.assign({points:`0,${2*-S.height} 0,${2*S.height}`},P)):E==="circle"?f("circle",Object.assign({r:S.height},P)):E==="square"?f("polyline",Object.assign({points:`${-S.height},${-S.height} ${-S.height},${S.height} ${S.height},${S.height} ${S.height},${-S.height}`},P)):null},O=async({element:S,page:E,store:P})=>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})`},v({element:S,type:S.startHead})),f("g",{transform:`translate(${S.width} ${S.height/2}) rotate(180)`},v({element:S,type:S.endHead}))),g=async({element:S,page:E,store:P,elementHook:T})=>{const N=await Promise.all(S.children.map(G=>d({element:G,page:E,store:P,elementHook:T}))),U=f("g",{opacity:S.opacity,transform:`translate(${S.x}, ${S.y}) rotate(${S.rotation})`,style:{"transform-origin":"top left"}},...N);return T&&T({dom:U,element:S})||U};function b(S){let E=S.replace(/<svg[^>]*>/,"");return E=E.replace(/<\/svg>/,""),E}const p=async({element:S,page:E,store:P,elementHook:T})=>{const N=b((0,s.figureToSvg)(S)),U=f("g",{innerHTML:N});return T&&T({dom:U,element:S})||U},y={image:x,svg:x,text:w,line:O,figure:p,group:g};async function d({element:S,page:E,store:P,elementHook:T}){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:E,store:P}),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 T&&T({dom:Z,element:S})||Z}async function m({page:S,store:E,elementHook:P}){const T=await Promise.all(S.children.map(G=>d({element:G,page:S,store:E,elementHook:P}))),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:E.width,height:E.height,x:0,y:0},(0,o.getCrop)({width:E.width,height:E.height},{width:G.width,height:G.height})))}return f("g",{className:"page",style:{}},N?f("image",{"xlink:href":U,x:0,y:0,width:E.width,height:E.height,preserveAspectRatio:"none"}):f("rect",{x:0,y:0,width:E.width,height:E.height,fill:N?void 0:S.background}),...T)}async function _({json:S,elementHook:E}){const P=await Promise.all(S.pages.map(U=>m({page:U,store:S,elementHook:E}))),T=[];S.pages.forEach(U=>{U.children.forEach(G=>{G.type==="text"&&T.indexOf(G.fontFamily)===-1&&T.push(G.fontFamily)})});const N=T.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,"&amp;")})));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}`,width:S.width,height:S.height},...N,...P)}const A=(S,E)=>typeof E=="object"?`${S}="${Object.keys(E).map(P=>`${P}:${E[P]};`).join(" ")}"`:E==null||E===""?"":`${S}="${E}"`,C=({dom:S,nestLevel:E=0})=>{if(typeof S=="string")return S;if(!S)return"";const P=S.props,{innerHTML:T}=P,N=i(P,["innerHTML"]),U=" ".repeat(E);return`${U}<${S.type} ${Object.keys(N).map(G=>A(G,N[G])).join(" ")}>${T||`
299
- `+S.children.map(G=>C({dom:G,nestLevel:E+1})).join("")}${U}</${S.type}>
300
- `};async function R({json:S,elementHook:E}){const P=await _({json:S,elementHook:E});return C({dom:P})}})(PS);var Yg={},O_;function CS(){return O_||(O_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Page=void 0;const e=ni,n=t0,r=Lc(),i=x2(),o=Lc(),a=su;t.Page=e.types.model("Page",{id:e.types.identifier,children:e.types.array(e.types.late(()=>r.ElementTypes)),width:e.types.optional(e.types.union(e.types.number,e.types.literal("auto")),"auto"),height:e.types.optional(e.types.union(e.types.number,e.types.literal("auto")),"auto"),background:"white",bleed:0,custom:e.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(l=>{const s=Object.assign({},l),f={};for(var h in s)h[0]!=="_"&&(f[h]=l[h]);return f}).views(l=>({get store(){return(0,e.getParentOfType)(l,i.Store)}})).views(l=>({get startTime(){let s=0;for(const f of l.store.pages){if(f.id===l.id)return s;s+=f.duration}return s},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,e.getSnapshot)(l))),_forEachElementUp(s,f){const h=s.map(x=>({id:x,index:l.children.findIndex(w=>w.id===x)}));h.sort((x,w)=>w.index-x.index);for(const{index:x}of h){if(x==-1)continue;const w=x<l.children.length-1&&l.children[x+1],v=s.indexOf(w==null?void 0:w.id)>=0;x===l.children.length-1||v||f(x)}},_forEachElementDown(s,f){const h=s.map(x=>({id:x,index:l.children.findIndex(w=>w.id===x)}));h.sort((x,w)=>x.index-w.index);for(const{index:x}of h){if(x==-1)continue;const w=x>0&&l.children[x-1],v=s.indexOf(w==null?void 0:w.id)>=0;x===0||v||f(x)}return!1}})).actions(l=>({clone(s={}){const f=l.toJSON();f.children.forEach(v=>{v.id=(0,n.nanoid)(10),(0,o.forEveryChild)(v,O=>{O.id=(0,n.nanoid)(10)})});const h=Object.assign(Object.assign(Object.assign({},f),{id:(0,n.nanoid)(10)}),s),x=l.store.addPage(h),w=l.store.pages.indexOf(l);x.setZIndex(w+1),x.select()},setZIndex(s){l.store.setPageZIndex(l.id,s)},set(s){Object.assign(l,s)},select(){l.store.selectPage(l.id)},addElement(s,{skipSelect:f=!1}={}){const h=o.TYPES_MAP[s.type];if(!h)return void console.error("Can not find model with type "+s.type);"children"in s&&Array.isArray(s.children)&&s.children.forEach(w=>{w.id=(0,n.nanoid)(10)});const x=h.create(Object.assign({id:(0,n.nanoid)(10)},s));return l.children.push(x),x.selectable&&!f&&l.store.selectElements([x.id]),x},canMoveElementsUp(s){let f=!1;return l._forEachElementUp(s,()=>{f=f||!0}),f},moveElementsUp(s){l._forEachElementUp(s,f=>{const h=l.children[f];(0,e.detach)(h),l.children.splice(f+1,0,h)})},canMoveElementsTop(s){return this.canMoveElementsUp(s)},moveElementsTop(s){const f=[],h=[];l.children.forEach(x=>{s.indexOf(x.id)>=0?f.push(x):h.push(x)}),l.children.replace(h.concat(f))},canMoveElementsDown(s){let f=!1;return l._forEachElementDown(s,()=>{f=f||!0}),f},moveElementsDown(s){l._forEachElementDown(s,f=>{const h=l.children[f];(0,e.detach)(h),l.children.splice(f-1,0,h)})},canMoveElementsBottom(s){return this.canMoveElementsDown(s)},moveElementsBottom(s){const f=[],h=[];l.children.forEach(x=>{s.indexOf(x.id)>=0?f.push(x):h.push(x)}),l.children.replace(f.concat(h))},setElementZIndex(s,f){const h=l.children.find(x=>x.id===s);h&&((0,e.detach)(h),l.children.remove(h),l.children.splice(f,0,h))},setSize({width:s,height:f,useMagic:h,softChange:x}){if(h){const w=[],v=N=>N.type==="image"&&N.x<1&&N.y<1&&N.width>=l.computedWidth-2&&N.height>=l.computedHeight-2;(0,o.forEveryChild)(l,N=>{N.type!=="group"&&(v(N)||w.push(N))});const O=w.length?(0,a.getTotalClientRect)(w):{x:0,y:0,width:l.computedWidth,height:l.computedHeight},g=1/4,b=Math.max(0,Math.min(O.x,l.computedWidth-O.x-O.width)),p=l.computedWidth*g,y=Math.max(0,b-p),d=Math.max(0,Math.min(O.y,l.computedHeight-O.y-O.height)),m=l.computedHeight*g,_=Math.max(0,d-m),A=l.computedWidth-2*y,C=l.computedHeight-2*_,R=s/A,S=f/C,E=Math.min(R,S),P=(s-A*E)/2-y*E,T=(f-C*E)/2-_*E;(0,o.forEveryChild)(l,N=>{N.type!=="group"&&(v(N)?N.set({x:N.x*E,y:N.y*E,width:N.width*R,height:N.height*S,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(N.set({x:P+N.x*E,y:T+N.y*E,width:N.width*E,height:N.height*E}),N.type==="text"?N.set({fontSize:N.fontSize*E}):N.type==="figure"&&N.set({strokeWidth:N.strokeWidth*E})))})}x||(l.width=s),x||(l.height=f)}})).actions(l=>({moveElementUp(s){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),l.moveElementsUp([s])},moveElementDown(s){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),l.moveElementsDown([s])},moveElementTop(s){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),l.moveElementsTop([s])},moveElementBottom(s){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),l.moveElementsBottom([s])},play(){l.store.play({startTime:l.startTime,endTime:l.startTime+l.duration})}}))}(Yg)),Yg}var kS={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Audio=void 0;const e=ni;t.Audio=e.types.model("Audio",{id:e.types.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(n=>({toJSON:()=>Object.assign({},(0,e.getSnapshot)(n))})).actions(n=>({set(r){Object.assign(n,r)}}))})(kS);var x_;function x2(){return x_||(x_=1,function(t){var e=_e&&_e.__createBinding||(Object.create?function(S,E,P,T){T===void 0&&(T=P);var N=Object.getOwnPropertyDescriptor(E,P);N&&!("get"in N?!E.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return E[P]}}),Object.defineProperty(S,T,N)}:function(S,E,P,T){T===void 0&&(T=P),S[T]=E[P]}),n=_e&&_e.__setModuleDefault||(Object.create?function(S,E){Object.defineProperty(S,"default",{enumerable:!0,value:E})}:function(S,E){S.default=E}),r=_e&&_e.__importStar||function(S){if(S&&S.__esModule)return S;var E={};if(S!=null)for(var P in S)P!=="default"&&Object.prototype.hasOwnProperty.call(S,P)&&e(E,S,P);return n(E,S),E},i=_e&&_e.__rest||function(S,E){var P={};for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&E.indexOf(T)<0&&(P[T]=S[T]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(T=Object.getOwnPropertySymbols(S);N<T.length;N++)E.indexOf(T[N])<0&&Object.prototype.propertyIsEnumerable.call(S,T[N])&&(P[T[N]]=S[T[N]])}return P},o=_e&&_e.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(t,"__esModule",{value:!0}),t.Store=t.Font=void 0,t.createStore=R;const a=ni,l=_S,s=t0,f=o(ki),h=wS,x=SS,w=ES,v=E2(),O=r(iu),g=Yi,b=e0,p=O2,y=OS,d=xS,m=PS,_=CS(),A=Lc(),C=kS;function R({key:S,showCredit:E}={key:"",showCredit:!1}){return t.Store.create({_forceShowCredit:E,_key:S})}(0,a.setLivelinessChecking)("ignore"),t.Font=a.types.model("Font",{fontFamily:a.types.string,url:a.types.optional(a.types.string,""),styles:a.types.frozen()}).preProcessSnapshot(S=>Object.assign(Object.assign({},S),{fontFamily:S.fontFamily||S.name})),t.Store=a.types.model("Store",{role:"",pages:a.types.array(_.Page),fonts:a.types.array(t.Font),audios:a.types.array(C.Audio),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:a.types.frozen(),selectedElementsIds:a.types.array(a.types.string),animatedElementsIds:a.types.array(a.types.string),history:a.types.optional(l.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(S=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),S.bleedVisible},get selectedElements(){return S.selectedElementsIds.map(E=>{for(const P of S.pages)for(const T of P.children)if(T.id===E)return T}).filter(E=>!!E)},get children(){return S.pages},get selectedShapes(){const E=[];return(0,A.forEveryChild)({children:S.selectedElements},P=>{P.type!=="group"&&E.push(P)}),E},get activePage(){return S.pages.slice().find(E=>E.id===S._activePageId)||(S.pages.length?S.pages[0]:null)},get duration(){let E=0;return S.pages.forEach(P=>{E+=P.duration}),E},get _hasCroppedImages(){return S.find(E=>E.type==="image"&&E._cropModeEnabled)},find(E){let P;return(0,A.forEveryChild)({children:S.pages},T=>{if(!P&&E(T))return P=T,!0}),P},getElementById:E=>S.find(P=>P.id===E)})).actions(S=>{let E=0,P=null,T=!1;return{afterCreate(){S.history.canUndo},setCurrentTime(N){S.currentTime=N},_togglePlaying(N=!S.isPlaying){S.isPlaying=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,a.cast)(N),S.currentTime=U,S.isPlaying=!0,E=Date.now(),P=Z,T=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-E;E=N,S.currentTime+=U,S.checkActivePage();const G=P||S.duration;S.isPlaying&&S.currentTime<G?requestAnimationFrame(S.seek):S.isPlaying&&T?(S.currentTime=0,requestAnimationFrame(S.seek)):S.stop()},stop(){S.isPlaying=!1,S.currentTime=0,S.animatedElementsIds=(0,a.cast)([]),S.checkActivePage()}}}).actions(S=>({__(){S._validated||((0,v.validateKey)(S._key,S._forceShowCredit),S._validated=!0)},set(E){Object.assign(S,E)},setUnit({unit:E,dpi:P}){S.unit=E||S.unit,S.dpi=P||S.dpi},setRole(E){S.role=E},addPage(E){const P=_.Page.create(Object.assign({id:(0,s.nanoid)(10)},E));return S.pages.push(P),S._activePageId=P.id,P},selectPage(E){S._activePageId=E},selectElements(E){const P=E.map(T=>S.getElementById(T)).sort((T,N)=>T.page.children.indexOf(T)-T.page.children.indexOf(N)).filter(T=>!!T).map(T=>T.id);S.selectedElementsIds=(0,a.cast)(P)},toggleBleed(E){S.bleedVisible=E??!S.bleedVisible},toggleRulers(E){S.rulesVisible=E??!S.rulesVisible},openSidePanel(E){S.openedSidePanel!==E&&(S.previousOpenedSidePanel=S.openedSidePanel,S.openedSidePanel=E)},setScale(E){S.scale=E},_setScaleToFit(E){S.scaleToFit=E},setElementsPixelRatio(E){S._elementsPixelRatio=E},setSize(E,P,T){S.pages.forEach(N=>{N.setSize({width:E,height:P,useMagic:T,softChange:!0})}),S.width=E,S.height=P},setPageZIndex(E,P){const T=S.pages.find(N=>N.id===E);T&&((0,a.detach)(T),S.pages.remove(T),S.pages.splice(P,0,T))},deletePages(E){const P=S.pages.indexOf(S.activePage);E.forEach(U=>{const G=S.pages.find(Z=>Z.id===U);(0,a.destroy)(G)});const T=Math.min(S.pages.length-1,P),N=S.pages[T];N&&(S._activePageId=N.id),S.selectedElementsIds=(0,a.cast)(S.selectedElementsIds.filter(U=>S.getElementById(U)))},groupElements(E){const P=E.map(U=>S.getElementById(U));P.forEach(U=>{U&&(0,a.detach)(U)});const T=S.activePage,N={id:(0,s.nanoid)(10),children:P,type:"group"};return T.children.push(N),S.selectedElementsIds=(0,a.cast)([N.id]),T.children.find(U=>U.id===N.id)},ungroupElements(E){const P=E.map(N=>S.getElementById(N)),T=[];P.forEach(N=>{if(N&&N.type==="group"){const U=N.page,G=U.children.indexOf(N);N.children.forEach(Z=>{T.push(Z.id)}),N.children.forEach(Z=>{(0,a.detach)(Z),U.children.push(Z)}),U.children.splice(G,1)}}),S.selectedElementsIds=(0,a.cast)(T)},deleteElements(E){const P=[];S.find(T=>(E.includes(T.id)&&P.push(T),!1)),P.forEach(T=>{(0,a.destroy)(T)}),S.selectedElementsIds=(0,a.cast)(S.selectedElementsIds.filter(T=>S.getElementById(T)))},on(E,P){if(E==="change"){let T=S.toJSON();return(0,a.onSnapshot)(S,N=>{const U=S.toJSON();!(0,p.deepEqual)(T,U)&&(T=U,P(U))})}},async _toCanvas({pixelRatio:E,ignoreBackground:P,pageId:T,mimeType:N,includeBleed:U,_skipTimeout:G,quickMode:Z=!1}={}){var W;const H=E||1;T=T||((W=S.pages[0])===null||W===void 0?void 0:W.id);const L=S.pages.find(me=>me.id===T);if(!L)throw new Error(`No page for export with id ${T}`);Z?L==null||L.set({_forceMount:!0}):L==null||L.set({_exporting:!0});const M=await(0,y.waitTillAvailable)(()=>f.default.stages.find(me=>me.getAttr("pageId")===T));if(!M)throw L==null||L.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can not find stage for page ${T}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const D=!!M.findOne(".page-container"),B=S._elementsPixelRatio;H>S._elementsPixelRatio&&S.setElementsPixelRatio(H),await S.waitLoading({_skipTimeout:G});const V=M.findOne(".page-container");if(!V)throw S.setElementsPixelRatio(B),L==null||L.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can't find page container. ${D}`);M.find("Transformer").forEach(me=>me.visible(!1)),V.find(".page-background").forEach(me=>me.shadowEnabled(!1)),V.find(".page-background").forEach(me=>me.strokeEnabled(!1)),V.find(".highlighter").forEach(me=>me.visible(!1));const Y=V.findOne(".page-background-group"),F=Y.clip();Y.clip({x:null,y:null,width:null,height:null});const $=V.findOne(".elements-container"),z=$.clip();$.clip({x:null,y:null,width:null,height:null});const K=V.find(me=>me.getAttr("hideInExport"));K.forEach(me=>{me.setAttr("oldVisible",me.visible()),me.hide()});const X=V.find(me=>!me.visible()&&me.getAttr("editModeEnabled"));X.forEach(me=>{me.setAttr("oldVisible",me.visible()),me.show()}),P&&V.find(".page-background").forEach(me=>me.hide());const Q=U?L.bleed:0;let J=Q;!S.bleedVisible&&U||(S.bleedVisible||U?S.bleedVisible&&U?J=0:S.bleedVisible&&!U&&(J=-L.bleed):J=0);const ne=document.createElement("canvas");ne.width=Math.round((L.computedWidth+2*Q)*H),ne.height=Math.round((L.computedHeight+2*Q)*H);const ie=ne.getContext("2d");N==="image/jpeg"&&(ie.fillStyle="white",ie.fillRect(0,0,ne.width,ne.height));const oe=V.scale();V.scale({x:1,y:1});const de=V.toCanvas({x:V.x()-J,y:V.y()-J,width:L.computedWidth+2*Q,height:L.computedHeight+2*Q,pixelRatio:H});return V.scale(oe),ie.drawImage(de,0,0,ne.width,ne.height),f.default.Util.releaseCanvas(de),P&&V.find(".page-background").forEach(me=>me.show()),K.forEach(me=>{me.visible(me.getAttr("oldVisible"))}),X.forEach(me=>{me.visible(me.getAttr("oldVisible"))}),V.find(".page-background").forEach(me=>me.shadowEnabled(!0)),V.find(".page-background").forEach(me=>me.strokeEnabled(!0)),M.find("Transformer").forEach(me=>me.visible(!0)),V.find(".highlighter").forEach(me=>me.visible(!0)),Y.clip(F),$.clip(z),S.setElementsPixelRatio(B),L==null||L.set({_exporting:!1,_forceMount:!1}),ne},async toDataURL(E={}){var{mimeType:P,quality:T}=E,N=i(E,["mimeType","quality"]);const U=await S._toCanvas(Object.assign({mimeType:P},N)),G=U.toDataURL(P,T);return f.default.Util.releaseCanvas(U),G},async toBlob(E={}){var{mimeType:P,quality:T}=E,N=i(E,["mimeType","quality"]);const U=await S._toCanvas(Object.assign({mimeType:P},N)),G=await new Promise(Z=>{U.toBlob(Z,P,T)});return f.default.Util.releaseCanvas(U),G},async saveAsImage(E={}){var{fileName:P}=E,T=i(E,["fileName"]);const N=T.mimeType||"image/png",U=N.split("/")[1];(0,h.downloadFile)(await S.toDataURL(T),P||"polotno."+U,N)},async _toPDF(E){const P=E.dpi||S.dpi,T=E.parallel||1,N=E.unit||(S.unit==="px"?"mm":S.unit),U=E.pixelRatio||1,G=E.pageIds||S.pages.map(K=>K.id),Z=S.pages.filter(K=>G.includes(K.id)),W=await(0,x.getJsPDF)(),H=K=>(0,b.pxToUnit)({px:K,unit:N,dpi:P}),L=E.cropMarkSize||0,M=H(L),D=Z[0]||{},B=E.includeBleed?D.bleed:0,V=H(D.computedWidth+2*B+2*M),Y=H(D.computedHeight+2*B+2*M);var F=new W({unit:N,orientation:V>Y?"landscape":"portrait",format:[V,Y],compress:!0,putOnlyUsedFonts:!0});F.deletePage(1);const $=((K,X)=>{for(var Q=[],J=0;J<K.length;J+=X)Q.push(K.slice(J,J+X));return Q})(Z,T);let z=0;for(const K of $){const X=K.map(async Q=>{const J=E.includeBleed?Q.bleed:0,ne=Q.computedWidth+2*J+2*L,ie=Q.computedHeight+2*J+2*L,oe=H(ne),de=H(ie);let me=0,Pe=U;for(;me<10;){me+=1,me===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const re=await S.toDataURL(Object.assign(Object.assign({},E),{pageId:Q.id,pixelRatio:Pe}));if(re.length>20)return E.onProgress&&E.onProgress(++z/G.length*.9),{url:re,width:oe,height:de,widthPx:ne,heightPx:ie};Pe*=.8}});(await Promise.all(X)).forEach(({url:Q,width:J,height:ne,widthPx:ie,heightPx:oe})=>{F.addPage([J,ne],J>ne?"landscape":"portrait");const de=F.getCurrentPageInfo();de.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:ie,topRightY:oe},de.pageContext.bleedBox={bottomLeftX:L+B,bottomLeftY:L+B,topRightX:ie-L-B,topRightY:oe-L-B},M&&(F.setLineWidth(H(1)),F.line(2*M,0,2*M,M),F.line(0,2*M,M,2*M),F.line(J-2*M,0,J-2*M,M),F.line(J,2*M,J-M,2*M),F.line(0,ne-2*M,M,ne-2*M),F.line(2*M,ne,2*M,ne-M),F.line(J,ne-2*M,J-M,ne-2*M),F.line(J-2*M,ne,J-2*M,ne-M)),F.addImage(Q,M,M,J-2*M,ne-2*M,void 0,"FAST")})}return F},toPDFDataURL:async E=>(await S._toPDF(Object.assign({mimeType:"image/jpeg"},E))).output("datauristring"),async toGIFDataURL(E={}){const P=E.pixelRatio||1,T=await(0,w.createGIF)({width:S.width*P,height:S.height*P}),N=1e3/(E.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 M of S.pages)if(W+=M.duration,M.set({_rendering:W>Z}),W>Z){H=M.id;break}const L=await S._toCanvas({pixelRatio:P,pageId:H,_skipTimeout:!0});T.addFrame(L.getContext("2d"),{delay:N,copy:!0})}for(const G of S.pages)G.set({_rendering:!1});return S.stop(),T.render(),new Promise(G=>{T.on("finished",function(Z){(function(W,H){var L=new FileReader;L.onload=function(M){H(M.target.result)},L.readAsDataURL(W)})(Z,G)})})},async saveAsGIF(E={}){var{fileName:P}=E,T=i(E,["fileName"]);const N=await S.toGIFDataURL(T);(0,h.downloadFile)(N,P||"polotno.gif")},async toHTML({elementHook:E}={elementHook:void 0}){const P=S.toJSON();return(0,d.jsonToHTML)({json:P,elementHook:E})},async saveAsHTML({fileName:E}={}){const P=await S.toHTML(),T="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(P)));(0,h.downloadFile)(T,E||"polotno.html")},async toSVG({elementHook:E,pageId:P}={elementHook:void 0,pageId:void 0}){var T;const N=S.toJSON();P=P||((T=N.pages[0])===null||T===void 0?void 0:T.id);const U=N.pages.find(G=>G.id===P);return(0,m.jsonToSVG)({json:Object.assign(Object.assign({},N),{pages:U?[U]:[]}),elementHook:E})},async saveAsSVG({fileName:E,elementHook:P,pageId:T}={}){const N=await S.toSVG({elementHook:P,pageId:T}),U="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(N)));(0,h.downloadFile)(U,E||"polotno.svg")},async saveAsPDF(E={}){var{fileName:P}=E,T=i(E,["fileName"]);(await S._toPDF(Object.assign({mimeType:"image/jpeg"},T))).save(P||"polotno.pdf")},async waitLoading({_skipTimeout:E=!1}={}){E||await new Promise(P=>setTimeout(P,50)),await(0,g.whenLoaded)()},toJSON:()=>({width:S.width,height:S.height,fonts:(0,a.getSnapshot)(S.fonts),pages:(0,a.getSnapshot)(S.pages),audios:(0,a.getSnapshot)(S.audios),unit:S.unit,dpi:S.dpi,custom:S.custom}),loadJSON(E,P=!1){var T;const N=Object.assign({},E),U=S.pages.indexOf(S.activePage);let G=(T=N.pages[U]||N.pages[0])===null||T===void 0?void 0:T.id;N._activePageId=G;const Z=Object.assign({},(0,a.getSnapshot)(S));Object.assign(Z,N),Z.history=P?S.history.toJSON():{history:[],undoIdx:-1},(0,a.applySnapshot)(S,Z)},clear({keepHistory:E=!1}={}){const P=S.pages.map(T=>T.id);S.deletePages(P),E||S.history.clear()},addFont(E){S.removeFont(E.fontFamily),S.fonts.push(E),S.loadFont(E.fontFamily)},removeFont(E){S.fonts.filter(P=>P.fontFamily===E).forEach(P=>(0,a.destroy)(P))},addAudio(E){const P=C.Audio.create(Object.assign({id:(0,s.nanoid)(10)},E));S.audios.push(P)},removeAudio(E){const P=S.audios.find(T=>T.id===E);P&&S.audios.remove(P)},async loadFont(E){const P=S.fonts.find(N=>N.fontFamily===E)||O.globalFonts.find(N=>N.fontFamily===E);let T=[{fontStyle:"normal",fontWeight:"normal"}];return P?(P.styles&&(T=P.styles.map(N=>({fontStyle:N.fontStyle||"normal",fontWeight:N.fontWeight||"normal"}))),O.injectCustomFont(P)):O.injectGoogleFont(E),Promise.all(T.map(N=>O.loadFont(E,N.fontStyle,N.fontWeight)))},validate:E=>t.Store.validate(E,[{path:"",type:t.Store}]).map(P=>({path:"store"+P.context.map(T=>T.path).join("."),message:P.message}))})),t.default=R}(Wg)),Wg}var P_;function TS(){return P_||(P_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Node=void 0;const e=ni,n=t0,r=x2(),i=CS(),o=Lc();t.Node=e.types.model("Node",{id:e.types.identifier,type:"none",name:"",opacity:1,custom:e.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(a=>{for(var l in a)a[l]===null&&(a[l]=void 0);return a}).postProcessSnapshot(a=>{const l=Object.assign({},a),s={};for(var f in l)f[0]!=="_"&&(s[f]=a[f]);return s}).views(a=>({get locked(){return!(a.draggable||a.contentEditable||a.styleEditable||a.resizable)},get page(){return(0,e.getParentOfType)(a,i.Page)},get store(){return(0,e.getParentOfType)(a,r.Store)},get top(){let l=a;for(;;){if(!(0,e.hasParentOfType)(l,o.GroupElement))return l;l=(0,e.getParentOfType)(l,o.GroupElement)}},get parent(){return(0,e.hasParentOfType)(a,o.GroupElement)?(0,e.getParentOfType)(a,o.GroupElement):(0,e.hasParentOfType)(a,i.Page)?(0,e.getParentOfType)(a,i.Page):(0,e.hasParentOfType)(a,r.Store)?(0,e.getParentOfType)(a,r.Store):null},get zIndex(){return a.parent.children.indexOf(a)}})).actions(a=>({toJSON:()=>Object.assign({},(0,e.getSnapshot)(a))})).actions(a=>({clone(l={},{skipSelect:s=!1}={}){const f=JSON.parse(JSON.stringify(a.toJSON()));return l.id=l.id||(0,n.nanoid)(10),(0,o.forEveryChild)(f,h=>{h.id=(0,n.nanoid)(10)}),Object.assign(f,l),a.page.addElement(f,{skipSelect:s})},set(l){Object.assign(a,l)},moveUp(){a.page.moveElementsUp([a.id])},moveTop(){a.page.moveElementsTop([a.id])},moveDown(){a.page.moveElementsDown([a.id])},moveBottom(){a.page.moveElementsBottom([a.id])},setZIndex(l){a.parent.setElementZIndex(a.id,l)},beforeDestroy(){}}))}(qg)),qg}var Kg={},AS={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.registerAnimation=t.animate=t.animations=void 0;const e=su,n={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}};t.animations={fade:({dTime:o,element:a,animation:l})=>{const s=o/l.duration;return l.type==="enter"?{opacity:s*a.opacity}:{opacity:(1-s)*a.opacity}},rotate:({dTime:o,element:a,animation:l})=>{const s=o/l.duration*360;return(0,e.rotateAroundCenter)({x:a.x,y:a.y,width:a.width,height:a.height,rotation:a.rotation},s)},blink:({dTime:o,element:a,animation:l})=>{const s=l.duration,f=o%s/(s/2),h=f<=1?f:2-f;return{opacity:a.opacity*h}},bounce:({dTime:o,element:a,animation:l})=>{const s=l.duration,f=s/2,h={},x={x:a.x+a.width/3,y:a.y+a.height/3,width:a.width/3,height:a.height/3,fontSize:a.fontSize/3},w={x:a.x,y:a.y,width:a.width,height:a.height,fontSize:a.fontSize},v=o%s/f,O=v<=1?v:2-v;for(let g in x){const b=x[g],p=w[g]-b;h[g]=b+O*p}return h},move:({dTime:o,element:a,animation:l})=>{const s=n[l.data.direction]||n.right,f={};for(var h in s.from){let x=s.from[h],w=s.to[h];l.type==="exit"&&(x=s.to[h],w=-s.from[h]);const v=a[h]+x,O=a[h]+w-v;f[h]=v+o/l.duration*O}return f},zoom:({dTime:o,element:a,animation:l})=>{const s={},f={x:a.x+a.width/3,y:a.y+a.height/3,width:a.width/3,height:a.height/3,fontSize:a.fontSize/3},h={x:a.x,y:a.y,width:a.width,height:a.height,fontSize:a.fontSize};for(var x in f){let w=f[x],v=h[x];if(l.type==="exit"){const g=w;w=v,v=g}const O=v-w;s[x]=w+o/l.duration*O}return s}};const r=({element:o,dTime:a,animation:l})=>{const s=t.animations[l.name];return s?s({element:o,dTime:a,animation:l}):(console.error("Can not find animation type: "+l.name),{})};t.animate=r;const i=(o,a)=>{};t.registerAnimation=i})(AS);var C_;function uu(){return C_||(C_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.Animation=void 0;const e=ni,n=AS,r=Qi,i=TS();t.Animation=e.types.model("Animation",{delay:0,duration:500,enabled:!0,type:e.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:e.types.frozen({})}),t.Shape=i.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:e.types.array(t.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(o=>{const a=Object.assign(Object.assign({},o),{x:o.x||0,y:o.y||0});return"width"in o&&(a.width=a.width||1),"height"in o&&(a.height=a.height||1),o.locked&&(a.draggable=!1,a.contentEditable=!1,a.styleEditable=!1,a.resizable=!1,a.removable=!1),a}).views(o=>{const a=(0,r.observable)({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation,opacity:o.opacity,color:o.color,fontSize:o.fontSize}),l=(0,r.action)(s=>{Object.assign(a,s)});return{get a(){const{currentTime:s}=o.store;if(l({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation,opacity:o.opacity,color:o.color,fontSize:o.fontSize}),s===0)return a;const f=s-o.page.startTime;if(f>o.page.duration||f<0)return a;const h=o.store.animatedElementsIds;if(h.length&&!h.includes(o.id))return a;const x=o.animations.find(O=>O.type==="enter");if(x!=null&&x.enabled&&f<x.delay&&l({opacity:0}),x!=null&&x.enabled&&f>=x.delay&&f<=x.delay+x.duration){const O=f-x.delay,g=(0,n.animate)({element:o,animation:x,dTime:O});l(g)}const w=o.animations.find(O=>O.type==="exit");if(w!=null&&w.enabled&&f>=o.page.duration-w.duration-w.delay&&f<=o.page.duration-w.delay){const O=f-(o.page.duration-w.duration-w.delay),g=(0,n.animate)({element:o,animation:w,dTime:O});l(g)}w!=null&&w.enabled&&f>=o.page.duration-w.delay&&l({opacity:0});const v=o.animations.find(O=>O.type==="loop");if(v!=null&&v.enabled){const O=f,g=(0,n.animate)({element:o,animation:v,dTime:O});l(g)}return a},animated:s=>o.a[s]}}).actions(o=>({setAnimation(a,l){const s=o.animations.find(f=>f.type===a);s?Object.assign(s,l):o.animations.push(Object.assign({type:a},l))}}))}(Kg)),Kg}var Xg={},k_;function vj(){return k_||(k_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextElement=void 0;const e=ni,n=uu();t.TextElement=n.Shape.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:e.types.optional(e.types.union(e.types.number,e.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(r=>Object.assign({},r)).actions(r=>({toggleEditMode(i){r._editModeEnabled=i??!r._editModeEnabled,r._editModeEnabled?r.store.history.startTransaction():r.store.history.endTransaction()}}))}(Xg)),Xg}var Zg={},T_;function RS(){return T_||(T_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageElement=void 0;const e=uu();t.ImageElement=e.Shape.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,_cropModeEnabled:!1}).actions(n=>({toggleCropMode(r){n._cropModeEnabled=r??!n._cropModeEnabled,n._cropModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()},beforeDestroy(){n._cropModeEnabled&&n.store.history.endTransaction()}}))}(Zg)),Zg}var Qg={},A_;function mj(){return A_||(A_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.VideoElement=void 0;const e=RS();t.VideoElement=e.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(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LineElement=void 0;const e=ni,n=uu();t.LineElement=n.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:e.types.array(e.types.number),startHead:"",endHead:""}).actions(r=>({}))}(Jg)),Jg}var ev={},M_;function bj(){return M_||(M_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SVGElement=void 0;const e=ni,n=uu();t.SVGElement=n.Shape.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:e.types.map(e.types.string)}).preProcessSnapshot(r=>Object.assign(Object.assign({},r),{src:r.src||r.svgSource})).actions(r=>({replaceColor(i,o){r.colorsReplace.set(i,o)}}))}(ev)),ev}var tv={},L_;function _j(){return L_||(L_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FigureElement=void 0;const e=ni,n=uu();t.FigureElement=n.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:e.types.array(e.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(tv)),tv}var N_;function Lc(){return N_||(N_=1,function(t){var e=_e&&_e.__rest||function(b,p){var y={};for(var d in b)Object.prototype.hasOwnProperty.call(b,d)&&p.indexOf(d)<0&&(y[d]=b[d]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function"){var m=0;for(d=Object.getOwnPropertySymbols(b);m<d.length;m++)p.indexOf(d[m])<0&&Object.prototype.propertyIsEnumerable.call(b,d[m])&&(y[d[m]]=b[d[m]])}return y};Object.defineProperty(t,"__esModule",{value:!0}),t.TYPES_MAP=t.GroupElement=t.ElementTypes=t.forEveryChild=void 0,t.registerShapeModel=g;const n=ni,r=t0,i=TS(),o=uu(),a=vj(),l=RS(),s=mj(),f=yj(),h=bj(),x=_j(),w=(b,p)=>{if(b.children)for(const y of b.children){if(p(y)===!0)break;(0,t.forEveryChild)(y,p)}};t.forEveryChild=w;const v=[...new Array(20)].map((b,p)=>n.types.late(()=>O[p]));t.ElementTypes=n.types.union({dispatcher:b=>{const p=t.TYPES_MAP[b.type];if(!p)throw new Error(`Unknown element type: "${b.type}"`);return p}},h.SVGElement,a.TextElement,l.ImageElement,f.LineElement,s.VideoElement,x.FigureElement,n.types.late(()=>t.GroupElement),...v),t.GroupElement=i.Node.named("Group").props({type:"group",children:n.types.array(t.ElementTypes)}).views(b=>({get draggable(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.draggable||(p=!1)}),p},get resizable(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.resizable||(p=!1)}),p},get contentEditable(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.contentEditable||(p=!1)}),p},get styleEditable(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.styleEditable||(p=!1)}),p},get locked(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.locked||(p=!1)}),p}})).actions(b=>({set(p){var{draggable:y,contentEditable:d,styleEditable:m,resizable:_}=p,A=e(p,["draggable","contentEditable","styleEditable","resizable"]);y!==void 0&&(0,t.forEveryChild)(b,C=>{C.set({draggable:y})}),d!==void 0&&(0,t.forEveryChild)(b,C=>{C.set({contentEditable:d})}),m!==void 0&&(0,t.forEveryChild)(b,C=>{C.set({styleEditable:m})}),_!==void 0&&(0,t.forEveryChild)(b,C=>{C.set({resizable:_})}),Object.assign(b,A)},addElement(p,{skipSelect:y=!1}={}){const d=t.TYPES_MAP[p.type];if(!d)return void console.error("Can not find model with type "+p.type);p.children&&p.children.forEach(_=>{_.id=(0,r.nanoid)(10)});const m=d.create(Object.assign({id:(0,r.nanoid)(10)},p));return b.children.push(m),m.selectable&&!y&&b.store.selectElements([m.id]),m},setElementZIndex(p,y){const d=b.children.find(m=>m.id===p);d&&((0,n.detach)(d),b.children.remove(d),b.children.splice(y,0,d))}}));const O=[];function g(b,p){const y=b.type;if(!y)throw new Error('You must pass "type" attribute to custom model.');let d=o.Shape.named(y).props(b);p&&(d=p(d)),t.TYPES_MAP[y]=d,O.push(d)}t.TYPES_MAP={svg:h.SVGElement,text:a.TextElement,image:l.ImageElement,group:t.GroupElement,line:f.LineElement,video:s.VideoElement,figure:x.FigureElement}}(Vg)),Vg}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.handleHotkey=l;const e=Lc();let n=[],r="";const i="polotno_clipboard",o=s=>{n=JSON.parse(JSON.stringify(s));try{localStorage.setItem(i,JSON.stringify(s))}catch{}},a=()=>{try{const s=localStorage.getItem(i);if(s)return JSON.parse(s)}catch{}return n};function l(s,f){var h,x,w,v,O,g,b,p;if(((h=document.activeElement)===null||h===void 0?void 0:h.tagName)==="INPUT"||((x=document.activeElement)===null||x===void 0?void 0:x.tagName)==="TEXTAREA"||((w=document.activeElement)===null||w===void 0?void 0:w.contentEditable)==="true")return;const y=f.selectedElements.filter(A=>A.removable),d=y.map(A=>A.id);s.keyCode!==46&&s.keyCode!==8||f.deleteElements(d);const m=s.ctrlKey||s.metaKey,_=s.shiftKey;if(m&&!_&&s.code==="KeyZ"&&(s.preventDefault(),f.history.undo()),m&&_&&s.code==="KeyZ"&&(s.preventDefault(),f.history.redo()),m&&s.code==="KeyA"){s.preventDefault();const A=(v=f.activePage)===null||v===void 0?void 0:v.children.filter(R=>R.selectable),C=(A==null?void 0:A.map(R=>R.id))||[];f.selectElements(C)}if(m&&s.code==="KeyC"&&(s.preventDefault(),r=(O=f.activePage)===null||O===void 0?void 0:O.id,o(f.selectedElements.map(A=>A.toJSON()))),m&&s.code==="KeyX"&&(s.preventDefault(),r=(g=f.activePage)===null||g===void 0?void 0:g.id,o(f.selectedElements.map(A=>A.toJSON())),f.deleteElements(y)),m&&s.code==="KeyV"){s.preventDefault();let A=0;r===((b=f.activePage)===null||b===void 0?void 0:b.id)&&(A=f.width/20),r=(p=f.activePage)===null||p===void 0?void 0:p.id,f.history.transaction(()=>{const C=[],R=a();(0,e.forEveryChild)({children:R},S=>{delete S.id,S.type!=="group"&&(S.x+=A,S.y+=A)}),R.forEach(S=>{var E;const P=(E=f.activePage)===null||E===void 0?void 0:E.addElement(S);P&&C.push(P.id)}),o(R),f.selectElements(C)})}s.code==="ArrowDown"&&(s.preventDefault(),f.selectedElements.forEach(A=>{A.draggable&&A.set({y:A.y+1})})),s.code==="ArrowUp"&&(s.preventDefault(),f.selectedElements.forEach(A=>{A.draggable&&A.set({y:A.y-1})})),s.code==="ArrowLeft"&&(s.preventDefault(),f.selectedElements.forEach(A=>{A.draggable&&A.set({x:A.x-1})})),s.code==="ArrowRight"&&(s.preventDefault(),f.selectedElements.forEach(A=>{A.draggable&&A.set({x:A.x+1})}))}})(mS);var MS={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.t=t.getTranslations=t.setTranslations=void 0;const e=Qi,n=(0,e.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",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"},aiText:{aiWrite:"AI write",rewrite:"Rewrite",shorten:"Shorten",continue:"Continue writing",proofread:"Proofread",tones:"Tones",friendly:"Friendly",professional:"Professional",humorous:"Humorous",formal:"Formal",customPrompt:"Custom prompt",cancel:"Cancel",generate:"Generate",back:"Back",tryAgain:"Try Again",insert:"Insert",promptPlaceholder:"Describe what you want to generate"}},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",addPage:"Add page",duplicatePage:"Duplicate page",removeAudio:"Remove audio"}});function r(h,x){var w,v=x.split("."),O=h;for(w=0;w<v.length;++w){if(O[v[w]]==null)return;O=O[v[w]]}return O}const i=h=>h&&typeof h=="object";function o(h,x){Object.keys(x).forEach(w=>{const v=h[w],O=x[w];i(O)&&i(v)?o(v,O):h[w]=O})}function a(h,x,w=""){Object.keys(x).forEach(v=>{const O=x[v],g=w?`${w}.${v}`:v;i(O)?i(h[v])?a(h[v],O,g):console.warn(`Missing nested translation object at '${g}'`):h[v]===void 0&&console.warn(`Missing translation '${g}'`)})}t.setTranslations=(0,e.action)((h,{validate:x=!1}={})=>{x&&a(h,n),o(n,h)});const l=()=>(0,e.toJS)(n);t.getTranslations=l;const s={},f=h=>{const x=r(n,h);if(x!==void 0)return x;s[h]||(s[h]=!0,console.warn(`Missing translation '${h}'`));const w=h.split("."),v=w[w.length-1]||" ";return v.charAt(0).toUpperCase()+v.slice(1)};t.t=f})(MS);(function(t){var e=_e&&_e.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceCanvas=void 0;const n=e(Qe),r=ti,i=e(n9),o=gS,a=vS,l=mS,s=MS,f=`Polotno warning: <Workspace /> component can not automatically detect its size.
301
- Width or height of parent elements is equal 0.
302
- Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
303
- For simpler debugging here is the log of the parent element:`,h=(g,b,p,y,d,m)=>{const _=n.default.useRef({width:b,height:p}),A=n.default.useRef({top:0,left:0}),C=n.default.useRef(!1),R=n.default.useRef(d.pages.length);C.current=R.current!==d.pages.length,R.current=d.pages.length,n.default.useEffect(()=>{const S=g.current,E=P=>{A.current={top:S.scrollTop,left:S.scrollLeft}};return S.addEventListener("scroll",E),()=>{S.removeEventListener("scroll",E)}},[]),n.default.useLayoutEffect(()=>{if(!g.current||C.current)return;const S=g.current,E=(A.current.left+S.offsetWidth/2)/_.current.width,P=(A.current.top+S.offsetHeight/2)/_.current.height;m.current=!0,S.scrollLeft=E*b-S.offsetWidth/2,S.scrollTop=P*p-S.offsetHeight/2,_.current={width:b,height:p}},[y,b,p])},x=({element:g,scrollTop:b=0,duration:p=300,onFinish:y=()=>{}})=>{const d=g.scrollTop,m=b-d;let _=0,A=!1;if(p===0)return g.scrollTop=b,()=>{};const C=()=>{if(A)return;_+=20;const S=R(_,d,m,p);g.scrollTop=S,_<p?setTimeout(C,20):y()},R=(S,E,P,T)=>(S/=T/2)<1?P/2*S*S+E:-P/2*(--S*(S-2)-1)+E;return C(),()=>{A=!0}},w=(g,b,p,y,d,m)=>{const _=n.default.useRef(!1),A=n.default.useRef(null),C=n.default.useRef(!1);n.default.useEffect(()=>{const S=g.current,E=()=>{d.current};return S.addEventListener("scroll",E),()=>{S.removeEventListener("scroll",E)}},[]);const R=p.pages.indexOf(p.activePage);return n.default.useLayoutEffect(()=>{if(!p.activePage||!g.current||_.current)return;const S=g.current,E=p.pages.indexOf(p.activePage)*b;let P=()=>{};return(Math.abs(E-S.scrollTop)>.5*b||C.current)&&(C.current=!0,P=x({element:S,scrollTop:E,onFinish:()=>{C.current=!1},duration:p.isPlaying?0:300})),P},[p.activePage,R,p.isPlaying]),{handleScroll:S=>{if(m||C.current)return;_.current=!0,clearTimeout(A.current),A.current=setTimeout(()=>{_.current=!1},300);const E=S.currentTarget.childNodes[0].offsetHeight,P=S.currentTarget.scrollTop,T=Math.floor((P+y.height/3)/E),N=p.pages[T];N&&p.activePage!==N&&N.select()}}},v=({store:g})=>n.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},n.default.createElement("p",null,(0,s.t)("workspace.noPages")),n.default.createElement("button",{onClick:()=>{g.addPage()}},(0,s.t)("workspace.addPage"))),O=({width:g,height:b,xPadding:p,yPadding:y,backgroundColor:d})=>n.default.createElement("div",{style:{width:g+"px",height:b+"px",backgroundColor:d,paddingLeft:p+"px",paddingRight:p+"px",paddingTop:y+"px",paddingBottom:y+"px"}},n.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));t.WorkspaceCanvas=(0,r.observer)(({store:g,pageControlsEnabled:b,backgroundColor:p,pageBorderColor:y,activePageBorderColor:d,bleedColor:m,components:_,onKeyDown:A,paddingX:C,paddingY:R,altCloneEnabled:S=!0,visiblePagesOffset:E,renderOnlyActivePage:P})=>{var T;const N=C??20,U=R??55,[G,Z]=n.default.useState({width:100,height:100}),W=n.default.useRef(G),H=n.default.useRef(null),L=n.default.useRef(null),M=g.bleedVisible?Math.max(0,...g.pages.map(re=>re.bleed)):0,D=Math.max(...g.pages.map(re=>re.computedWidth)),B=Math.max(...g.pages.map(re=>re.computedHeight)),V=((T=g.activePage)===null||T===void 0?void 0:T.computedHeight)||0,Y=D+2*M,F=(P?V:B)+2*M,$=async({skipTimeout:re}={skipTimeout:!1})=>{if(re||await new Promise(Ve=>setTimeout(Ve,50)),H.current===null)return;const ae=H.current.getBoundingClientRect();ae.width!==0&&ae.height!==0||(console.warn(f),console.log(H.current));const we=L.current.clientWidth||ae.width,be={width:we,height:ae.height};(W.current.width!==be.width||W.current.height!==be.height)&&(Z(be),W.current=be);const te=(we-2*N)/Y,fe=g.pages.length>1?3.1:2,he=(ae.height-U*fe)/F,Ee=Math.max(Math.min(te,he),.01);g.scaleToFit!==Ee&&(g.setScale(Ee),g._setScaleToFit(Ee))};n.default.useLayoutEffect(()=>{$({skipTimeout:!0})},[]),n.default.useEffect(()=>{$()},[Y,F]),n.default.useEffect(()=>{g.__()},[]),n.default.useEffect(()=>{const re=H.current;if(window.ResizeObserver){const ae=new ResizeObserver(()=>{$({skipTimeout:!0})});return ae.observe(re),()=>ae.unobserve(re)}{const ae=setInterval(()=>{$({skipTimeout:!0})},100);return()=>clearInterval(ae)}},[Y,F]);const z=Math.max(N,(G.width-Y*g.scale)/2),K=P?1:g.pages.length,X=F*g.scale*K,Q=Math.max(U,(G.height-X)/K/2);n.default.useEffect(()=>{const re=ae=>{(A||l.handleHotkey)(ae,g)};return window.addEventListener("keydown",re),()=>window.removeEventListener("keydown",re)},[]),n.default.useEffect(()=>{var re;const ae=we=>{if(we.ctrlKey||we.metaKey){we.preventDefault();const he=Math.max(3,g.scaleToFit),Ee=Math.min(.1,g.scaleToFit),Ve=(be=we.deltaY<0?1.05*g.scale:g.scale/1.05,te=Ee,fe=he,Math.max(te,Math.min(fe,be)));g.setScale(Ve)}else var be,te,fe};return(re=L.current)===null||re===void 0||re.addEventListener("wheel",ae),()=>{var we;return(we=L.current)===null||we===void 0?void 0:we.removeEventListener("wheel",ae)}},[]);const J=n.default.useRef(!1);h(L,Y*g.scale+2*z,F*g.scale+2*Q,g.scale,g,J);const{handleScroll:ne}=w(L,F*g.scale+2*Q,g,G,J,P),ie=G.width>=Y*g.scale+2*z,oe=p||"rgba(232, 232, 232, 0.9)",de=g.pages.indexOf(g.activePage),me=(_==null?void 0:_.NoPages)||v,Pe=E??Math.min(3,Math.max(1,Math.ceil(G.height/2/(F*g.scale))));return n.default.createElement("div",{ref:H,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:oe},tabIndex:0,className:"polotno-workspace-container"},n.default.createElement("div",{ref:L,onScroll:ne,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:ie?"hidden":"auto"},className:"polotno-workspace-inner"},g.pages.map((re,ae)=>{const we=re===g.activePage;if(P&&!we&&!re._exportingOrRendering&&!re._forceMount)return null;if(!(Math.abs(ae-de)<=Pe||re._exportingOrRendering||re._forceMount))return n.default.createElement(O,{key:re.id,width:Y*g.scale+2*z,height:F*g.scale+2*Q,backgroundColor:oe,xPadding:z,yPadding:Q});const be=n.default.createElement(i.default,{key:re.id,page:re,xPadding:z,yPadding:Q,width:Y*g.scale+2*z,height:F*g.scale+2*Q,store:g,pageControlsEnabled:b,backColor:oe,pageBorderColor:y||"lightgrey",activePageBorderColor:d||"rgb(0, 161, 255)",altCloneEnabled:S,bleedColor:m||"rgba(255, 0, 0, 0.1)",components:_});return(re._exportingOrRendering||re._forceMount)&&!we&&P?n.default.createElement("div",{style:{display:"none"},key:re.id},be):be}),g.rulesVisible&&n.default.createElement(o.TopRules,{store:g,xPadding:z,yPadding:Q,width:Y*g.scale+2*z,height:F*g.scale+2*Q}),g.pages.length===0&&n.default.createElement(me,{store:g}),g.audios.map(re=>n.default.createElement(a.AudioElement,{key:re.id,audio:re,store:g}))))}),t.default=t.WorkspaceCanvas})(qw);var wj=x2();Rl.toggleFadeInAnimation(!1);Qr.setTextOverflow("change-font-size");const Sj=new URLSearchParams(location.search).get("key"),LS=wj.createStore({key:Sj});window.store=LS;window.config={addGlobalFont:iu.addGlobalFont,unstable_useHtmlTextRender:Qr.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:Qr.setTextVerticalResizeEnabled,unstable_setTextOverflow:Qr.setTextOverflow,onLoadError:Yi.onLoadError,setAssetLoadTimeout:Yi.setAssetLoadTimeout,setFontLoadTimeout:Yi.setFontLoadTimeout};const Ej=zd.createRoot(document.getElementById("root"));Ej.render(dt.createElement(qw.WorkspaceCanvas,{visiblePagesOffset:0,store:LS,components:{PageControls:()=>null,Tooltip:()=>null}}));